Am 04.09.2012 um 14:21 schrieb Marco Patzer
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?
When you use the texdefinition environment to create a command the end of line character which results normally in a space is ignored sees “thenelseend” as a single string, in such a case you can add a space and put a comment sign at the end of the line.
% This one fails % \starttexdefinition mycmd % \startluacode % if true then % else % end % \stopluacode % \stoptexdefinition
\starttexdefintion mycmd \startluacode if true then % else % end \stopluacode \stoptexdefinition Wolfgang