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

I'd like to link the Table of Contents in the footer of each page.

I can achieve this thanks to this hint like so:

# In the hyperref section of the document preamble

But if I change my document so that it has a title page, and the TOC moves to page two, I'll need to change this. Is there a better way to link to the TOC? Adding a \label{} and then using a ref{} does not seem to work.

share|improve this question
up vote 7 down vote accepted

You could use \hypertarget to create an anchor on the toc page, for example at the beginning of the TOC page or turning the TOC heading into an anchor. Here's an example how you could do it:

\renewcommand{\headrulewidth}{0pt}% removes header line
\fancypagestyle{plain}{% for chapter starting pages
  \fancyhf{}% clears header fields
\cfoot{\hyperlink{contents}{TOC}}% links the TOC at the center of the page footer
Title page
share|improve this answer
Can you say why I get the "TOC" link only in the foot of the first page? – Hendrik Vogt Feb 19 '11 at 12:59
@Hendrik: that's a good observation! It's because only the first page has fancy page style, the other pages automatically got plain as they are chapter starting pages. It can be fixed using \fancypagestyle{plain}{...}. I'll add it to my example. – Stefan Kottwitz Feb 19 '11 at 13:17

There are several ways to do this. One would be to write the page number of the TOC directly into the .aux file as shown below. I'm sure there is a nicer, more higher-interface solution for that, but just right now (1am) I can't get it. The code below assumes that you want to link to the first ToC page and not to the title of it.


\def\tocpage{1}% Default value will be set to correct one at \begin{document}



\cleardoublepage % Important to get the page number right
% Write directly to the `.aux` file:


share|improve this answer

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.