[texhax] Eplain TeX: problem with \@optionalarg

Heiko Oberdiek heiko.oberdiek at googlemail.com
Sun Feb 13 16:10:05 CET 2011


On Sun, Feb 13, 2011 at 01:50:01PM +0000, Rodolfo Medina wrote:

> it is suggested the following code:
> 
>      \makeatletter
>      % \mo{m}[o]
>      \def\mo#1{\def\mo at arg{#1}\@getoptionalarg\fin at mo}
> 
>      \def\fin at mo{\vskip1pc
>       \message{^^JArg: \mo at arg}%
>       \message{^^JOptional arg: \@optionalarg}%
>      }
> 
> Now, I wish to put a condition there:
> 
>    \ifx\@optionalarg\empty
>         \fin at mo
>    \else
>         \@getoptionalarg\fin at mo
>    \fi

\@getoptionalarg defines \@optionalarg. Therefore \@getoptionalarg
must be called first. Then you can test inside \fin at mo.

Yours sincerely
  Heiko Oberdiek


More information about the texhax mailing list