On Mon, Nov 11, 2002 at 03:13:26PM +0100, Christian Ridderstr?m wrote:
> I'm trying to use a command with an optional argument in Lyx. I'm not
> very experienced in Latex, but I found an example which I put in the
> preamble.
>
> \newcommand{\example}[2][YYY]{
> Mandatory arg: #2; \\
> Optional arg: #1. \\
> }
>
> When I use it with one argument, it works nicely... but when I give
> two arguments it still uses the "optional" argument. What's going on,
> i.e. what am I missing here?
If you want to use the optional argument, you should write
\example[opt. arg]{mand. arg}
and not
\example{mand. arg}{opt. arg}