4 Sep
2012
4 Sep
'12
12:21 p.m.
Hi, I discovered strange behaviour concerning Lua conditionals within texdefinitions. ConTeXt complains: 'then' expected near 'thenelseend'. I guess it has something to do with how the content of a texdefinitions is grabbed. Seems like a bug or is this by design? % This works fine \def\mycmd{% \startluacode if true then else end \stopluacode} % This one fails % \starttexdefinition mycmd % \startluacode % if true then % else % end % \stopluacode % \stoptexdefinition \startluacode userdata = userdata or { } function userdata.myfun() if true then else end end \stopluacode % This also works fine \starttexdefinition mycmd \luacode{userdata.myfun()} \stoptexdefinition \mycmd Marco