Jens,

Absolutely did the trick. Thanks!! I'll watch for that in future, too.

Sue

On Dec 1, 2006, at 6:43 PM, Jens Noeckel wrote:

Sue,

the way to fix this is to put the following in the Document Preamble of the main file (Document > Settings > LaTeX Preamle - insert it either at the start or end, doesn't matter):

\newcommand\Prefix[3]{\vphantom{#3}#1#2#3}

What happened is that the author of the child document put in a custom definition in the preamble of that file, which is not defined at the top level (in your main document). That's the line I copied above. With this line added to the main preamble, everything compiles fine here.

The reason for this problem is that the "Child Document" feature of LyX is really simplistic. It doesn't seem to merge the preambles of the included documents. And of course that would be really hard to implement correctly in practice, so I think all one can say is: use this feature with caution.

Jens


On Dec 1, 2006, at 5:10 PM, Sue Kientz wrote:

Jens,

I've done as you suggested. It is in the child doc. with the new changes, which has a lot of equations. I attach here the parent doc and the recalcitrant child doc. As mentioned, the child doc by itself will generate a PDF just fine.
<pdf-gen-prob.lyx>

<materials.lyx>

"materials.lyx" must be in a subdirectory of the parent file and named "materials," or you must browse and select the file again.

Thanks for any help.

Sue Kientz

On Dec 1, 2006, at 4:21 PM, Jens Noeckel wrote:


On Dec 1, 2006, at 3:10 PM, Sue Kientz wrote:

On Dec 1, 2006, at 1:34 PM, Jens Noeckel wrote:

On Dec 1, 2006, at 1:04 PM, Sue Kientz wrote:

I had a set of related .lyx documents, a master and bunch of child documents, which were working fine as far as creating the PDF until someone changed one of the child documents. Now I cannot generate a PDF of the entire work. I get "Undefined control sequence" errors (about 40 of them), e.g.,

...symbol{\sigma}}\,,\label{eq:5}\end{gather}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Now I've tried adding an inconsequential change to the master document, opening and closing LyX, and every other trick I've used this last 6 months working with this program, as I have learned that many times the error messages tell you one thing is wrong when it's something completely different. FWIW, the child doc which was changed will generate a PDF just fine. In fact, each child document that I've tried generates a PDF with no trouble. As I said, only the one was changed. I'm using 1.4.3 on Max OS X.

Any fix, tips or lyx voodoo would be greatly appreciated.

Did you perhaps un-check the AMS math box in the master document? It needs to be checked (in Document>Settings>Math Options) because the "gather" environment is part of AMS LaTeX, not standard LaTeX. That's the only thing I can guess without an example file...

No, that's checked, both in the parent and in the child doc that was changed (and probably is checked in all docs. I didn't change anything else since this problem began).

I'll attach the parent file but how can you check the problem without all the files, and surely you don't want them all?


Sorry, that was my only idea for now. I guess it would be nice to have a minimal example. I.e., while periodically checking if the compilation succeeds, cut out all the files that are unrelated to the problem, and cut all the unrelated content from the files that cause the problem, and then post only those files that are left, with the compilation error still occurring. By doing that, you may even be able to isolate the problem yourself.

Jens




Reply via email to