Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to know what the current best practices are for index generation. What are the best packages/programs to use and which ones to avoid. What are the best ones to use for generating multiple indices?

I know that this kind of a question can generate a variety of responses based upon one's personal opinion. Please share why you like your particular options.

share|improve this question
    
The reason I ask: I inherited a LaTeX document that was very old (LaTeX 2.09) and was tasked with updating it. I have updated it to LaTeX 2e, but I'm having trouble creating the index. The old document used the 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? –  Jeremy Oct 27 '11 at 14:23
    
It's quite strange that \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). –  egreg Oct 27 '11 at 17:19
    
Try adding \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.) –  Stephen Oct 27 '11 at 17:51
    
Okay, so I'm kind of embarrassed. I found out that there was a makeidx.sty file in the directory of TeX files. That was messing things up. Once I removed that file, LaTeX compiles just fine until after makeindex 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} ? –  Jeremy Oct 28 '11 at 19:56
add comment

2 Answers

up vote 8 down vote accepted
\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.)

share|improve this answer
    
Thanks for the simple example. I tried it with success (after removing the \ty command. See my comment above. –  Jeremy Oct 28 '11 at 20:05
add comment

for multiple indexes look at the packages splitidx or index from the camel bundle, which I prefer. If you have utf8 characters to sort then give xindy a try, it is more powerful than the old makeindex program

share|improve this answer
    
I have used splitidx, but it seemed a little cumbersome to me. I think I had seen index before but never tried it. What are some benefits of index over splitidx? –  Jeremy Oct 28 '11 at 20:00
    
it is easier to use, from my point of view ... –  Herbert Oct 28 '11 at 20:06
2  
it looks like an equivalent of biblatex (a super package able to address all possibilities with the new engine biber) for indices would be welcome. –  pluton Oct 29 '11 at 0:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.