Am 06.01.2009 um 16:58 schrieb James C. Sutherland:
I have been using macros in 1.6.1, and recently tried to use a macro
with an optional argument. I have attached a trivial LyX file that
shows this macro and an example of its use. This compiles through
LyX just fine.
The problem is that if I export the file to LaTeX and then try to
compile it, the macro definition seems to create problems. This
does not occur with macros that only have required arguments. I
don't know much about LaTeX macros, so I am not sure if what LyX is
doing for the LaTeX export makes sense or not. However, macros with
optional arguments have the "\newcommandx" tag while macros without
optional arguments do not. The "\newcommandx" tag seems to give
LaTeX some trouble. Specifically, when I compile the .tex file, I
get the error "Undefined control sequence" when the "\newcommandx"
line is parsed. I have also attached the exported .tex file.
Can anyone duplicate this? Is this a known problem?
I am on Mac OSX with LyX 1.6.1.
Updating your MacTex to the latest version will solve the problem.
Stefan