Okay, I think that I found the problem: I am missing the "xargs" package. The exported LaTeX file actually had a line:
        \usepackage{xargs}[2008/03/08]
which I discarded. This is presumably where the "\newcommandx" tag is defined. The problem is that when I run LaTeX on the file, I get an error:
        "File 'xargs.sty' not found"
The LyX file compiles fine, so I must have this file installed, but I cannot seem to find where. I have attached the actual .tex file that LyX produces. Is anyone else able to compile this?

James

Attachment: macro_test.tex
Description: Binary data





On Jan 6, 2009, at 8:58 AM, James C. Sutherland wrote:

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.

James

<macro_test.tex><macro_test.lyx>

Reply via email to