\documentclass{book}
...
\usepackage{makeidx}
\makeindex
...
\begin{document}
...
text\index{abc@{\ty abc}} and other text...
...
\printindex
\end{document}
This should work and, apart from \usepackage
instead of an option to \documentstyle
has always been the method also in LaTeX209.
Check what the undefined command is, it would be very strange if it were \index
.
For multiple indices there is a choice between a few packages:
- multind (actually a LaTeX209 package)
- index
- splitidx
- imakeidx
I wouldn't recommend index that's not as customizable as the last two ones. The advantages of imakeidx over splitidx are that it can compile automatically all indices during the LaTeX run and that it's compatible with idxlayout that extends its customization possibilities. It also supports xindy
(as splitidx does). (Disclaimer: I'm one of the authors of imakeidx.)
makeidx
option and\input{XXXX.ind}
which, if I understand correctly is a bad/old way of doing things. The old document used commands like\index{xyz}
and\index{abcd@{\ty abcd}}
. When I include\usepackage{makeidx}
then I get an error that the\index
command doesn't exist. Are these still the correct way to add index entries?\index
is undefined, as it has a (dummy) definition in the kernel. It's probably some other command that doesn't exist, check the log file. The method is still\usepackage{makeidx}
, then\index{...}
; the index is printed with\printindex
(as it was also in LaTeX209).\makeindex
after\usepackage{makeidx}
in the preamble. With documents somewhere in-between LaTeX 2.09 and 2e it might help. (And please give feedback whether this worked.)makeidx.sty
file in the directory of TeX files. That was messing things up. Once I removed that file, LaTeX compiles just fine until aftermakeindex
is run. Then I get the error (not sure if you'll be able to see the formatting correctly, the line break comes after\ty
):! Undefined control sequence. l.23 \item {\ty a10}, \hyperpage{41} ?