Difference between revisions of "Command/doif..."

From Wiki
Jump to navigation Jump to search
m (internal link instead of external one)
m
Line 3: Line 3:
 
Block of code depending on a Lua value - example (by WS, 3/2011):
 
Block of code depending on a Lua value - example (by WS, 3/2011):
  
<texcode>
+
<context source="yes" text="Gives:">
 
\starttext
 
\starttext
 
   \ctxlua{test = true}
 
   \ctxlua{test = true}
Line 13: Line 13:
 
   Test is \ctxlua{commands.testcase(test)}{True}{False}.
 
   Test is \ctxlua{commands.testcase(test)}{True}{False}.
 
\stoptext
 
\stoptext
</texcode>
+
</context>
  
 
== See also ==
 
== See also ==

Revision as of 09:49, 4 May 2012

\doif...

Block of code depending on a Lua value - example (by WS, 3/2011):

\starttext
  \ctxlua{test = true}
 
  Test is \ctxlua{commands.testcase(test)}{True}{False}.
 
  \ctxlua{test = false}

  Test is \ctxlua{commands.testcase(test)}{True}{False}.
\stoptext

Gives:

See also

Branches and Decisions

Help from ConTeXt-Mailinglist/Forum

All issues with: