latexreporthyperlinkpdflatexhyperref

Incorrect hyperlinking in LaTeX


So far the hyperref package in LaTeX has automatically linked all the items in my report correctly. But there is one that did not get linked properly, possibly because I manually added it to the table of contents like this:

\addcontentsline{toc}{chapter}{Bibliography}

How do I fix this?


Solution

  • You have to use the \phantomsection macro just before or after the \addtocontentsline. This instructs hyperref to add an anchor at that point. Also, take into account that you have to run LaTeX several times to make this anchor to be in the exact place.