Am 27.02.2014 um 05:08 schrieb Rik Kabel <cont...@rik.users.panix.com>:

> The following code processes cleanly under TL2013 and fails with ConTeXt  
> ver: 2014.02.14 17:07 MKIV beta  fmt: 2014.2.16  int: english/english. I 
> suspect a regression, but I am also open to being told that I am doing things 
> incorrectly.

The \starttexdefinition was extended after the texlive release to support 
keywords like global or expanded and has therefore changed since then. The 
reason why it fails is that context passes the argument to Lua where they are 
parsed and at this point macros like your \EndTranslation are expanded. Even 
though this can be fixed I think it’s better to use the normal \def command 
when you want to create delimited commands.

> I also notice that it fails (even under TL2013) if a space is inserted after 
> [#SETUP] in the doTrans intro. I thought that spaces should be allowed in 
> \starttexdefinition -- is this only in the body and not the parameter 
> description?

No, spaces between arguments aren’t ignored but no spaces are added at the end 
of each line in the replacement text.

\starttexdefinition Test #1 #2
  “#2” “#1”
\stoptexdefinition

\starttext

\Test ab cd

\stoptext

BTW: It’s better to follow contexts rules and use start/stop for environments, 
this way you can make use of the buffer mechanism to store text.

\unexpanded\def\startTranslation
  {\begingroup
   \dosingleempty\dostartTranslation}

\def\dostartTranslation[#1]%
  {\iffirstargument
     \getrawparameters[Translation][setups=,language=en,#1]%
   \fi
   \grabbufferdata[Translation][startTranslation][stopTranslation]}

\def\stopTranslation
  {\language[\Translationlanguage]%
   \Translationsetups
   (\,\getbufferdata[Translation]\removeunwantedspaces\,)%
   \endgroup}

\starttext

\startTranslation[language=nl]
It betrays a slow-witted mentality to pursue the streams, but not to see the 
sources of things.
\stopTranslation

\stoptext

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