[NTG-context] prevent gobbling of spaces when omitting optional argument

Florian Wobbe Florian.Wobbe at awi.de
Sat Jan 29 17:21:26 CET 2011


> % \one, \one[…] and \one[…][…] (no spaces between “[][]” allowed)
> 
> \def\one
>  {\strictdoifnextoptionalelse\doone\noone}
> 
> \def\noone{[]}
> 
> \def\doone[#1]%
>  {\strictdoifnextoptionalelse{\dodoone[#1]}{\nodoone[#1]}}
> 
> \def\dodoone[#1][#2]%
>  {[#1:#2]}
> 
> \def\nodoone[#1]%
>  {[#1]}

One more problem: Adding

\setupinteraction[state=start]

> \starttext

and\footnote{\one[1]} etc. do not work. Why not?
Florian

> \startlines
> \one text
> \one[1] text
> \one[1][2] text
> \stoplines
> \stoptext



More information about the ntg-context mailing list