Am 04.09.2012 um 14:21 schrieb Marco Patzer <home...@lavabit.com>:

> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to