LyXLyX does not load amsmath for elsarticle

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
tafi
Posts: 42
Joined: Sat May 07, 2011 12:01 am

LyX does not load amsmath for elsarticle

Post by tafi »

I seem to have found a problem in the way lyx 2.0 handles mathematics in the elsarticle class.

After entering a formula including an integral sign I get the compilation error "command \iint already defined etc."
This usually indicates a package conflict or a case of packages being called in the wrong order.
The LyX maths defaults for this class appear to call both amsmath and esint packages automatically (both checkboxes are selected). The esint package requitres that amsmath be called first (something which is well advertised on the esint documentation). The document, however won't compile in LyX unless the esint package is switched off.

To check the behaviour I exported the document to tex format and found that amsmath was not actually being called at all. I just had to add "\usepackage{amsmath}" before "\usepackage{esint}" and it then compiled.

I have since gone back to LyX and have unchecked both amsmath and esint before reincluding them manually as the first lines in the preamble.

This now seems to work.

Has anyone else noticed this behaviour? Is it a problem with LyX's own internal settings or am I missing something?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gsmm
Posts: 4
Joined: Thu Feb 24, 2011 6:27 pm

Re: LyX does not load amsmath for elsarticle

Post by gsmm »

Yes. I had a similar problem just a couple of hours ago. After seeing your post, I unchecked esint and included it manually in the Preamble, as you suggested.

It compiles now.

Thanks.
Ganesh
Post Reply