Re: why doesn't \numberwithin{equation}{section} work?
Thanks, that is useful! I prefer keeping it organized in the preamble. Erez On Mon, Feb 23, 2009 at 7:34 AM, Guenter Milde wrote: > On 2009-02-21, Paul A. Rubin wrote: > > Erez Yerushalmi wrote: > > >> 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. > > > In Document > Settings... > Math Options, uncheck "Use AMS math package > > automatically" and check "Use AMS math package" instead, and it will > work. > > Alternatively, write in your preamble > > \usepackage{amsmath} > \numberwithin{equation}{section} > > so everything required is in one place. > > AFAIK, LyX does not load amsmath with options, so the second > \usepackage{amsmath} included by the LyX-automatism will be silently > ignored. (If you get a "package already loaded with options ..." error, > my knowledge is wrong.) > > Günter > > -- Erez Yerushalmi PhD Student Warwick University, UK http://www2.warwick.ac.uk/fac/soc/economics/research/phds/3rd_year/yerushalmi
Re: why doesn't \numberwithin{equation}{section} work?
On 2009-02-21, Paul A. Rubin wrote: > Erez Yerushalmi wrote: >> 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. > In Document > Settings... > Math Options, uncheck "Use AMS math package > automatically" and check "Use AMS math package" instead, and it will work. Alternatively, write in your preamble \usepackage{amsmath} \numberwithin{equation}{section} so everything required is in one place. AFAIK, LyX does not load amsmath with options, so the second \usepackage{amsmath} included by the LyX-automatism will be silently ignored. (If you get a "package already loaded with options ..." error, my knowledge is wrong.) Günter
Re: why doesn't \numberwithin{equation}{section} work?
Hi Paul, Thanks a lot That fixed it. I learned something new today. Best Regards, Erez On Sat, Feb 21, 2009 at 8:36 PM, Paul A. Rubin wrote: > 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 > > -- Erez Yerushalmi PhD Student Warwick University, UK http://www2.warwick.ac.uk/fac/soc/economics/research/phds/3rd_year/yerushalmi
Re: why doesn't \numberwithin{equation}{section} work?
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
why doesn't \numberwithin{equation}{section} work?
Hi All, 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. My errors are the following: error Undefined control sequence, with description \numberwithin{equation}{section} % #section.#equation 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. second error: LaTeX Error: Missing \begin{document}. with description: \numberwithin{equation}{section} % #section.#equation You're in trouble here. Try typing to proceed. If that doesn't work, type X to quit. I'm attaching the lyx file. Please look at the preample. Thanks a lot, Erez -- Erez Yerushalmi PhD Student Warwick University, UK http://www2.warwick.ac.uk/fac/soc/economics/research/phds/3rd_year/yerushalmi test.lyx Description: application/lyx