Am 07.01.2009 um 22:45 schrieb Jean-Marc Lasgouttes:
xargs is only needed if you have macros with optional arguments. Of
course, \newcommand could handle the case with one optional. But,
what we need in fact is something equivalent to \global\def for
this case. Is there a way to do this with \newcommand?
Why \global?
I think that \global\newcommand works in any case.
It does? I think I tried and it did not.
A second requirement: the distinction between \newcommand and
\renewcommand is very fragile. It is far from trivial to say whether a
macro is redefined in some cases. E.g., in a lyx comment a definition
will be ignored.
It would be nice to make the case "all optional arguments are before
required ones" work with plain \newcommand.
What do you mean? I had a self-made \newcommand implementation that
could do that. But it is quite large (obviously), and it also look
strange to put that into the preamble. For that reason we switched to
xargs instead.
Stefan