[texhax] Eplain TeX: problem with \@optionalarg

Rodolfo Medina rodolfo.medina at gmail.com
Sun Feb 13 17:48:03 CET 2011


Heiko Oberdiek <heiko.oberdiek at googlemail.com> writes:

> 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.


Thanks.  But how can I do that in practice?  To put that condition,
\@optionalarg necessarily comes first!

Rodolfo



More information about the texhax mailing list