[XeTeX] newcommand with optional arguments

Sven Siegmund sven.siegmund at gmail.com
Mon Mar 3 13:21:21 CET 2008


Thanks a lot, Stephen,

that works exactly how I need.

S.


2008/3/3, Stephen Moye <stephenmoye at mac.com>:
>
>  On Mar 3, 2008, at 6:25 AM, Sven Siegmund wrote:
>
>  > \providecommand{\nuu}[1][1]{\textit{#2} `#1'}
>
>
> Try this:
>
>  \newcommand{\nuu}[2][]{%
>         \textit{#2}\ %
>         \ifx#1\empty
>         \else
>                 `#1'
>         \fi
>  }
>
>  The way this works is this:
>
>  \newcommand{\commandname}[<TOTAL number of args>][<default content of
>  optional arg>]{<TeX commands...}
>
>  Where #1 is the optional argument
>
>  Your example needs something a little more complex, because your macro
>  needs to determine if there is anything in the optional argument, and
>  then to act accordingly.
>
>  You were on the right track...
>
>
>  Stephen Moye
>
> _______________________________________________
>  XeTeX mailing list
>  postmaster at tug.org
>  http://tug.org/mailman/listinfo/xetex
>


More information about the XeTeX mailing list