[tex-eplain] optional arguments

Adam Fenn acwfenn at hotmail.com
Sun Feb 24 18:48:38 CET 2008


How can I modify this example from the eplain manual so that the optional argument
follows the first argument i.e \cmd{One}[Two] rather than \cmd[Two]{One}?

\makeatletter
\def\cmd{\@getoptionalarg\finishcmd} 
\def\finishcmd#1{% 
\ifx\@optionalarg\empty 
% No optional argument present.
#1
 \else 
 % One was present. 
{\@optionalarg} {\it#1}
 \fi} 
 \resetatcatcode 

Thanks in advance,
Adam Fenn.

_________________________________________________________________
Who's friends with who and co-starred in what?
http://www.searchgamesbox.com/celebrityseparation.shtml
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/tex-eplain/attachments/20080224/e1359c0d/attachment.html 


More information about the tex-eplain mailing list