[tex-eplain] Position of optional argument

Oleg Katsitadze olegkat at gmail.com
Mon Apr 27 01:05:24 CEST 2009


On Sun, Apr 26, 2009 at 07:16:55PM +0100, Rodolfo Medina wrote:
> I've been using the eplain \@getoptionalarg and \@optionalarg commands in a
> certain macro.  It turns out to me that the optional argument must be put
> *before* the non optional argument.
>
> How can I set things - if possible - so to put it after it?

Try this:

    \input eplain

    \makeatletter

    \def\test#1{%
      \def\test at arg{#1}%
      \@getoptionalarg\@test
    }

    \def\@test{%
      \message{^^JArg: \test at arg}%
      \message{^^JOptional arg: \@optionalarg}%
    }

    \makeatother

    \test{text}
    \test{text}[optional text]

    \bye

Best,
Oleg


More information about the tex-eplain mailing list