I want to have hyperlinks pointing to the ToC page. (In my MWE, the links are situated in the section titles, but it makes no difference for the discussion here). My MWE:
\documentclass{article}
\usepackage{hyperref}
\usepackage{blindtext}
\let\oldtableofcontents\tableofcontents
\renewcommand{\tableofcontents}[0]{\label{toc}\oldtableofcontents}
\begin{document}
First page\newpage
\tableofcontents\newpage
\section{Premier. Go to \hyperref[toc]{toc}}
\blindtext \blindtext
\section{deuxieme. Go to \hyperref[toc]{toc}}
\blindtext \blindtext
\section{Troisieme. Go to \hyperref[toc]{toc}}
\blindtext \blindtext
\end{document}
It works only partially: the links are there, but if I click on them, it goes to the "first page", instead of the ToC page.
I redefined \tableofcontents, in order to put a label juste before \tableofcontents, but I guess this is the problem. In the original command \tableofcontents, the must be at the beginning some initialisation, like \newpage or similar, which makes the problem.
\phantomsectionorhyperrlink. Use\phantomsection\label{toc}. – Marco Daniel Feb 24 '12 at 09:52\labelcreate a reference point, but actually, it can only refer to a section, and not to any point in the text, am i right ? – Loic Rosnay Feb 24 '12 at 10:12