# Hyperref - links in TOC link to one page before the right page

I use hyperref for my entries in the TOC to be link.

But with the example below, I have a problem:

\item{\textbf{item one}\addcontentsline{toc}{subsection}{item one}\\
Lots of text...
}

\newpage

Lots of text...
}


The problem is the link to item two link to the page just before item two (so just before the \newpage) instead of item two.

I also tried without the \newpage but it make the same mistake if the first line of the item two is on the next page.

The strange fact is that the page number in the TOC is right but the link isn't...

• Your are missing \phantomsection right before \addcontentsline. Do you really want to write \item content to the TOC? – user31729 Jul 16 '14 at 14:26
• Yes I really want to put my items (just a title for each item like in the example I gave) in the TOC and thanks a lot for your answer, it works well. :) (What should I do to say your comment is the answer of my question?) – Matthieu.P Jul 16 '14 at 14:46
• @Matthieu.P Wait until Christian writes something and accept it. If he doesn't, you may answer it by yourself or if you think, no one will need this information later on, you can just delete your post. – LaRiFaRi Jul 16 '14 at 14:53

As stated in the hyperref manual, for example here, ftp://ftp.rrzn.uni-hannover.de/pub/mirror/tex-archive/macros/latex/contrib/hyperref/doc/manual.html#x1-190005,

a \phantomsection command is needed right before \addcontentsline to guarantee correct linking.

\phantomsection
Lots of text...
}


This is a small document:

\documentclass{article}
\usepackage{blindtext}
\usepackage{hyperref}
\begin{document}
\tableofcontents

\clearpage

\begin{itemize}

\item{\textbf{item one}\phantomsection
\blindtext
}

\newpage
\item{\textbf{item two}\phantomsection

Since no further information is given on the code, there are some guesses about the class, the itemize environment etc.