Changes

Jump to navigation Jump to search
408 bytes added ,  17:26, 12 November 2019
no edit summary
|attributes=
}}
 
== [[Help:Reference|Syntax]] (autogenerated) ==
<syntax>ctxcommand</syntax>
== [[Help:Reference|Syntax]] ==
== Description ==
To quickly access Lua commands in the {{code|command}} table, you .  \def\ctxcommand #1{\directlua{commands.#1}} % saves tokens  You can write e.g.
<texcode>
\ctxcommand{doifelse(\userpage < 10)}{early page}{later page}
instead of
<texcode>
\ctxlua{commandcommands.doifelse(\userpage < 10)}{early page}{later page}
</texcode>
.
<context source=yes mode=mkiv>
\ctxcommand{doifelse(\userpage < 10)}{early page}{later page}
</context>
 
== \ctxcommand vs. \cldcommand ==
<context source=yes mode=mkiv>
A
\ctxlua{commands.doif(true)}{one}
B
\cldcommand{doif("a","a","two")}
C
\ctxcommand{doif(true)}{three}
D
</context>
== See also ==
* {{cmd|ctxlua}}
* {{cmd|ctxcommand}}
* {{cmd|cldcontext}}
* {{cmd|cldcommand}}
== Help from ConTeXt-Mailinglist/Forum ==

Navigation menu