From ConTeXt wiki
Revision as of 08:17, 21 August 2012 by Esteis (talk | contribs) (Create entire page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search



{...} lua code


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.


\ctxlua{context(1+5)} % 6

%\ctxlua{context("5%")}  % Is seen as `\ctxlua{context("5`

% 1, 2, 4, 8
    context(1)  % this comment is okay
    while i < 10 do 
       context(', ' .. i); 
       i = i*2

See also

Help from ConTeXt-Mailinglist/Forum

All issues with:

This category currently contains no pages or media.