TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Try the following code. Without hyperref everything is fine and there’s the right entry in the index. With hyperref this entry disappears. (The codeline entries which are not shown here ar not touched by using hyperref)






Is there a way to use both packages?

share|improve this question
up vote 13 down vote accepted

The hypdoc package is available specifically to augment doc with hyperref abilities. Thus you should simply use


in place of


This adds a few additional bells-and-whistles to the overall set up, so it's better than interfacing the two packages yourself.

share|improve this answer
Oh, nice. I didn't know there's such a package. – Andrey Vihrov Sep 20 '11 at 10:29
Thanks, but that does’t solve the problem completely. I had to add \hyperpage{#1}to the \usage macro to get links for index entries of \DescribeMacro/\DescribeEnv. Could this be a bug? – Tobi Sep 20 '11 at 11:07

The MakeIndex program, which is used to process the .ind file, expects index entries of form


which means to format the page number of item with \<cmd>.

If you look at the .ind file generated with hyperref, you will see that the index entry command really is


That is, there are two formatting commands \usage and \hyperpage — one from doc and one from hyperref! This confuses MakeIndex and it doesn't produce output. The solution is to redefine \usage to include \hyperpage in it, and tell hyperref not to override index commands:









You might also want to add hyperlinks to the page numbers of change history in a similar way:

share|improve this answer
Thanks Andrey. I used Josephs answer but your answer about \hyperpage helped too :-) – Tobi Sep 20 '11 at 11:09

Your Answer


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.