MakeIndex, Nomenclature, Glossaries and AcronymsRe: Index off by a page

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
Post Reply
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: Index off by a page

Post by Stefan Kottwitz »

Hi,

you gave a good description and provided a compilable example, so I think this can be solved here.

I guess you just need to call makeindex again and recompile with pdfLaTeX. Your described workflow included just one makeindex call, this is not enough. The reason is, that once you produce the index, another page for this index is generated at the beginning, and all further pages are shifted 1 page. Then you have to call makeindex again in this new situation to get the correct page numbers.

I tested your file.
  1. Run with pdfLaTeX. No index page, the document text is on page 1 and 2.
  2. Run makeindex, an index file is produces. No document change yet.
  3. Run pdfLaTeX, now the index page is produced as page 1, the document text goes to page 2 and 3. Now, the index page numbers are wrong, because they were created in the situation without the index page, still pointing to page 1 and 2.
    index-incorrect.png
    index-incorrect.png (5.85 KiB) Viewed 6004 times
  4. Run makeindex again. A new index file is produced, based on the current page numbers.
  5. Run pdfLaTeX again. The new index is included, the page references are correct to page 2 and 3.
    index-correct.png
    index-correct.png (5.94 KiB) Viewed 6004 times
So, the generation of the index simply caused the shift, another run fixes it.
Many users put the index to the end, after the text. In this situation such a problem could not occur.

Stefan
LaTeX.org admin

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
awls99
Posts: 1
Joined: Fri Mar 30, 2012 1:08 pm

Re: Index off by a Page

Post by awls99 »

Oh, that was kinda silly of me not figuring it out... I was reading the outputs expecting one of the commands to tell me it needed to be ran again
Indeed all uses of makeindex I found were for placing it at the end of the document so this issue was never addressed in the sources I read.

Thank you very much, my problem is resolved :)
Post Reply