Difference between revisions of "Command/ctxlua"
< Command
Jump to navigation
Jump to search
(Create entire page) |
m (Garulfo moved page Commands/ctxlua to Command/ctxlua: Commands/ctxlua ==> Command/ctxlua) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
|attributes= | |attributes= | ||
}} | }} | ||
+ | |||
+ | == [[Help:Reference|Syntax]] (autogenerated) == | ||
+ | <syntax>ctxlua</syntax> | ||
== [[Help:Reference|Syntax]] == | == [[Help:Reference|Syntax]] == | ||
Line 43: | Line 46: | ||
{{Forum|{{SUBPAGENAME}}}} | {{Forum|{{SUBPAGENAME}}}} | ||
− | [[Category:Command/LuaTeX| | + | [[Category:Command/LuaTeX|cldcommand]] |
Latest revision as of 19:43, 8 June 2020
\ctxlua
Syntax (autogenerated)
\ctxlua{...} | |
{...} | command |
Syntax
\ctxlua{...} | |
{...} | lua code |
Description
Use this command to quickly execute some Lua code. TeX expands the argument before Lua receives it. Advantage: you can pass the contents of macro parameters like #1
to Lua. Disadvantage: everything after a percent sign is ignored, and once the comments are processed out the linebreaks are stripped, too.
Example
\ctxlua{context(1+5)} % 6 %\ctxlua{context("5%")} % Is seen as `\ctxlua{context("5` % 1, 2, 4, 8 \ctxlua{ context(1) % this comment is okay i=2; while i < 10 do context(', ' .. i); i = i*2 end}
See also
Help from ConTeXt-Mailinglist/Forum
All issues with: