FAQ
overflow

Great Answers to
Questions About Everything

QUESTION

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)

\documentclass{ltxdoc}

%\usepackage{hyperref}
\usepackage{doc}

\EnableCrossrefs
\CodelineIndex

\begin{document}
Test\DescribeMacro{\name}

\PrintIndex
\end{document}

Is there a way to use both packages?

{ asked by Tobi }

ANSWER

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

\usepackage{hypdoc}

in place of

\usepackage{doc}
\usepackage{hyperref}

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

{ answered by Joseph Wright }
Tweet