I tried to create an index to a document I write, but when viewing the .pdf
output there was no index. Also no error messages were displayed. I managed to find this in the LOG FILE:
No file "Actual Document".ind.
("Actual Document.aux") )
Indeed, when I check the folder supposed to have these files, I found only a file Actual Document.idx
with all my indices, but no .ind
file. Changing the extension .idx
to .ind
produced an error.
Here is what I have written:
\documentclass[12pt]{book}
\usepackage{makeidx}
\makeindex
\begin{document}
continuous \index{continuous}
\clearpage
\printindex
\end{document}
What have I done wrong and what is going on with these files?
Best Answer
The
makeidx
package doesn't produce the index on its own; it just writes the entries, unsorted, to a separate file. You need to use an external processor, such asmakeindex
orxindy
, to sort the index and format it in a way appropriate for inclusion in your document.So your compilation process might look like this:
This produces a
jobname.pdf
file and writes the index entries tojobname.idx
.This sorts and formats the index entries and outputs
jobname.ind
.This produces a
pdf
file and includesjobname.ind
at whatever point in the document you issued\printindex
.Oftentimes, it's good to put these commands into a script so you don't forget to run them.
Remember that every time you compile your document, it is both including the contents of
jobname.ind
at whatever point you issued\printindex
and writing all your index entires tojobname.idx
. Once you have yourind
file, you don't need to rerunmakeindex
unless your page numbers have changed or you've changed entries in the index.