![](https://secure.gravatar.com/avatar/d39338246f50cca667c8256c313d7cfd.jpg?s=120&d=mm&r=g)
4 Sep
2012
4 Sep
'12
6:21 a.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