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

Possible Duplicate:
How to make clickable links and cross-references in pdfs produced by LaTeX?

I need links for the Table of Contents, so that I can navigate fast to different sections. I apparently need some package.

I tried the package url unsuccessfully.

share|improve this question

migrated from stackoverflow.com Sep 24 '12 at 11:04

This question came from our site for professional and enthusiast programmers.

marked as duplicate by lockstep, percusse, diabonas, Werner, Paul Gaborit Sep 24 '12 at 14:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

It is hilarious that this question was given a duplicate badge when it was asked one year before than the other one. This question was also searchable in Google during the time when the other question was asked. There is also more thorough solution in this question than the other one. – Masi Aug 31 '13 at 8:32
Very ironic to tag it as hyperref ;-) – barto Sep 5 '14 at 17:34
up vote 112 down vote accepted

You can change the color of the links as above.

share|improve this answer
+1 Since this works great :) – Johan Aug 22 '09 at 15:01
+1 works very, very great! – Gary Tsui Oct 17 '13 at 7:11
A few tips: to simply avoid any visual indication of links, use option hidelinks. This can also be done like this: \usepackage[hidelinks]{hyperref}. To set all colors at once, use allcolors=black. colorlinks seems to work the same as colorlinks=true. – Cerran Mar 7 '14 at 17:28
The option hidelinks seems to be unnecessary in my XeLaTeX file. Not sure if this is because of XeLaTeX or that the lack of visual indication of links has been made default in hyperref. Somebody might want to investigate. – Taiki May 22 '14 at 12:22
Thank you sooo muuch :D – CSA Sep 5 '15 at 18:43

The way to go is the hyperref package.

share|improve this answer

The package listed is correct. This is a more detailed account of setup though:

\usepackage{color}   %May be necessary if you want to color links
    colorlinks=true, %set true if you want colored links
    linktoc=all,     %set to all if you want both sections and subsections linked
    linkcolor=blue,  %choose some color if you want links to stand out

Once this is all setup, you should just be able to include the


sometime after


and be all set

share|improve this answer
very clear answer – buzhidao Dec 16 '14 at 12:02

Don't miss out on the


option to only link the page numbers and not the entire table of contents; when links are being coloured the default behaviour can be a bit overwhelming.

Moreover, if you need to use dviaps+ps2pdf driver then in the default setting, the hyperlinks of long headers (that occupy more than one line) are scrambled due to a known incompatibility (README for hyperref, Section 7) and linking the page numbers resolves this issue.

share|improve this answer
Not true. It's better when the entire line links. – alamodey Feb 18 '09 at 1:13
As clickable links, it's better to have the entire line. But if you've got links printed in hot pink, then it looks mighty ugly to have an entire page coloured like that. – Will Robertson Feb 23 '09 at 23:08
A solution to keep the whole line a link (easier to click), while not having the whole TOC colored, is to change hyperref's linkcolor just for the TOC. – JW. May 28 '13 at 19:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.