On 9/2/19 11:51 AM, Ralph Boland wrote:
Gave it a try.  Unfortunately it didn't work.
It turns out problem isn't as I described though.
amsbook (and presumably all the other ams document classes) work
ok.  The problem is I have defined my own document class based on
amsbook and that fails.   It seems Lyx knows about amsbook class
not needing the \usepackage{makeidx} line and doesn't add it.
But Lyx can't figure out that, since my class is based on amsbook
it doesn't need the line either.

I think Lyx has to have a checkbox in Document>Settings>Indexes
for whether the line should be added to the tex file.

Thanks for you help.

Ralph Boland

On Mon, 2 Sep 2019 at 08:27, Paul A. Rubin <parubi...@gmail.com> wrote:
On 9/2/19 4:28 AM, Ralph Boland wrote:
I get an error when I try to create a Lyx document with an index
using amsbook document class.  Searching the problem on the internet
I found out that for  amsbook and other ams document classes the
\usepackage(makeidx) line is unnecessary and generates an error
if added to your tex document.

I tested this by generating the .tex file from my .lyx file (using
Latex (pdflatex))
and then commenting out the line in the .tex file:

             \usepackage(makeidx)

With this line commented out the problem goes away.

The problem is of course that Lyx adds this line to the .tex file
if I create an index.  So I cannot prevent this from occurring.

I am using Lyx 2.3.2  and Debian 10 OS.

Is this fixed in Lyx 2.3.3?

Ralph Boland
Try putting "provides makeidx 1" in Document > Settings > Local layout.
This will hopefully dissuade LyX from adding the redundant \usepackage
command ... maybe.

Paul

I'm replying to the list to keep the discussion visible there.

I assume you have a custom layout file for your class. The amsbook.layout file contains the line "Provides makeidx         1" near the top. You might try copying that into your layout file.

Paul

Reply via email to