I have a problem when adding index entries. When I use just the vanilla \index{...}, the generated PDF contains links on the page numbers in the index. But when using \index{...|textit} to mark index entries as primary entries, these links disappear. The same happens when I use textbf instead of textit.

I looked through the documentation of makeidx and hyperref, but didn't find any reference to that problem there.

Here is a minimal example. I used latexmk -pdf:

Text. \index{normal} \index{bold|textbf} \index{italic|textit}

This is my TeX version:

This is pdfTeX, Version 3.1415926-1.40.10 
(TeX Live 2009/Debian) (format=pdflatex 2011.5.25)
  • 1
    Doesn't happen to me. You should load makeidx before hyperref, but actually doesn't make any difference in the output – egreg Jul 22 '11 at 10:51
  • Hmm, I just compiled it on scribtex.com, and the linking works! Maybe it's a version problem? – daniel kullmann Jul 22 '11 at 11:00
  • That might be. Add a \listfiles command to the sample and compare the results you get in the log file. – egreg Jul 22 '11 at 11:08
  • I installed the latest texlive (20110724), and now my example works, but my original document still has the same problem. Still investigating.. – daniel kullmann Jul 25 '11 at 11:38
  • OK, it looks like it's the memoir document class that's causing the problem. I changed my docuemtn to use the book class, and now the links work. – daniel kullmann Jul 25 '11 at 11:57

OK, I found the solution. When looking at the .ind file produced by makeindex, the entries looked like this:

  \item Principal entry, \textit{14}
  \item Normal entry, \hyperpage{30}

This was because I used \index{Principal entry|textit} in my file. I solved it by defining a command that uses textit and hyperpage:


And then using \index{Principal entry|boldindex} to index terms.

This is even explained in the README file of the hyperref package, http://www.ctan.org/tex-archive/macros/latex/contrib/hyperref/.

  • 1
    Now don't start convincing me to read those README files. – BMS Sep 16 '14 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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