4

I'm trying to create an index of manually-added words in memoir. I've looked up instructions in the documentation, and came up with the following MWE. It compiles, but why is the index not showing up?

\documentclass{memoir}

\makeindex
\indexintoc

\begin{document}

\frontmatter
\tableofcontents*

\mainmatter
\chapter{My chapter}
\noindent This is some text.
\index{text}

\backmatter
\printindex

\end{document}
jamaicanworm
  • 29,114
  • 3
    Did you run makeindex, and then rerun pdflatex? – Peter Grill Apr 04 '12 at 02:33
  • @PeterGrill I put the \makeindex command in the document, if that's what you mean...? – jamaicanworm Apr 04 '12 at 02:34
  • 1
    No. There is a separate executable you need to invoke. First run pdflatex (which produces the .idx file), then MakeIndex which generates the .ind file, which is read by the subsequent run of pdflatex which produces the index. – Peter Grill Apr 04 '12 at 02:41
  • @PeterGrill I checked, and it turns out TeXnicCenter is indeed (automatically) calling makeindex.exe (after pdflatex)--but still no index is showing up. Do any command-line arguments need to be written alongside makeindex.exe? (Also, is it necessary to have the line \makeindex in the document?) – jamaicanworm Apr 04 '12 at 02:46
  • 1
    Yet again a great chance to mention latexmk which will take care of all this by itself. That is, you have to take care of the code, and latexmk will take care of the compilation in terms of the different executables that have to be run, the order etc. – Dror Apr 04 '12 at 06:40
  • 1
    Just for fun, and to rule out the editor, try running Peters solution, i.e. pdflatex, makeindex, pdflatex, in a terminal, that is by not using an editor. Or try using TeXMaker instead (I'm not a big fan of TeXnicCenter) – daleif Apr 04 '12 at 07:46
  • Thank you to all the commentators! It turns out the problem was with TeXnicCenter, which wasn't calling makeindex properly. This answer (from the question @PeterGrill linked to in his answer) provided the solution. – jamaicanworm Apr 04 '12 at 14:22

1 Answers1

6

To generate an index, you need to:

  1. Run pdflatex which produces the .idx file
  2. Run MakeIndex which generated the .ind file
  3. Run pdflatex which will then incorporate the .ind file and produce the index page.

For issues related specifically to TeXnicCenter, see Makeindex in TeXnicCenter

Peter Grill
  • 223,288