Am 05.01.2011 um 20:22 schrieb Procházka Lukáš:

> Hello,
> 
> I'd need to pass a variable to Ctx and to retrieve it inside a compiled 
> document - via Ctx itself and also by Lua. Something like modes; but modes 
> allow just to check whether they are on or off. I'd need something like this:

You can check modes in Lua:

context --arguments="size=small" --mode=print test.tex

\starttext

Print mode: \doifmodeelse{print}{yes}{no}

\startluacode
        if tex.modes['print'] then
                context("Print mode is enabled")
        else
                context("Print mode is disabled")
        end
\stopluacode

\doifenvelse{size}
  {\processaction
     [\env{size}]
     [  small=>Small size,
       medium=>Medium size,
          big=>Big size,
      unknown=>Other size: \env{size}]}
  {No value “size”}

\stoptext

Wolfgang


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to