[NTG-context] Typing within doifmode leads to error

Aditya Mahajan adityam at umich.edu
Sat Mar 20 08:24:13 CET 2021

On Sat, 20 Mar 2021, Christoph Reller wrote:
> Of course we can do this in lua:
> if tex.modes["A"] and not tex.modes{"B"] then
> ...
> end

... which means that you can use that at the context end as well (old feature).
Save the following as test.mkix (or add "% macros=mkix" as the first line):

<?lua if tex.modes["A"] and not tex.modes["B"] then ?>
A and not B
<?lua else ?>
not (A and not B)
<?lua end ?>

See the templates manual for more details: https://www.pragma-ade.com/general/manuals/templates-mkiv.pdf


More information about the ntg-context mailing list