Erez Yerushalmi wrote:
I've been trying to figure this out for a long time. Maybe one of you
can help me?
I've been using \numberwithin{equation}{section} in the preamble for
quite some time.
Every time I open a new template, it takes me some time until the PDF
output doesn't get jammed with a crash.
This must mean I don't really understand something.
When I remove \numberwithin{equation}{section} from the preamble, pdf
output works fine.
When I put it back in, Lyx pdf output crashes.
In Document > Settings... > Math Options, uncheck "Use AMS math package
automatically" and check "Use AMS math package" instead, and it will work.
The \numberwithin macro is part of the AMS package, so if the AMS
package is not loaded, you get the aforementioned LaTeX error. The "...
automatically" setting (default) tells LyX to keep an eye out for things
in the body of the document that require AMS math, and load the AMS
package if and only if it finds any of them. The test document _body_
did not contain anything that triggered loading of AMS math. Either LyX
does not look for references to AMS macros in the preamble or it doesn't
recognize \numberwithin as one of them. This also sometimes happens
when someone uses an AMS macro in the body but puts it in ERT, rather
than having LyX insert it.
/Paul