[NTG-context] Typing within doifmode leads to error

Hans Hagen j.hagen at xs4all.nl
Fri Mar 19 09:49:08 CET 2021


On 3/19/2021 4:58 AM, Christoph Reller wrote:
> Hi,
> 
> Consider the following MWE:
> 
> \definetyping[T]
> \definemode[mode][yes]
> \starttext
> \doifmode{mode}{%
>    \startT
>      Bla
>    \stopT}
> \stoptext
> 
> Compilation with the currently latest ConTeXt LMTX (ver: 2021.03.17 
> 17:46 LMTX  fmt: 2021.3.18) fails with:
> 
> tex error       > runaway error: end of file encountered
> mtx-context     | fatal error: return code: 1
> 
> Compilation is successful if I replace doifmode{mode}{...} by 
> \startmode[mode]...\stopmode.
> 
> Is there anything I'm missing? (This could be a bug.)
not a bug, just the way tex works .. modes cannot know that what goes 
into an argument is something verbose

but you can use this (also more efficient here):

\definetyping[T]
\definemode[mode][yes]
\starttext
\startmode[mode]
\startT
     Bla
\stopT
\stopmode
\stoptext

% there's also \startnotmode



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list