# Table of content: link at the page number instead of the section body

I saw in some articles, the links in the table of content appear in the pages. For example, suppose the first section, Introduction, is at page 11 as the following:

1 Introduction 11

Then the box showing the link is at around number 11 (page number).

In my machine, however, when I use \tableofcontents, the box is around the section title, i.e. "Introduction".

What is the setting I'm missing here? Thanks.

• Try \usepackage[linktocpage=true]{hyperref} – user31729 Apr 13 '15 at 21:40
• @ChristianHupfer Hi, can you change your comment to an answer so that I can accept it. Thank you very much. – qsp Apr 13 '15 at 21:41

The standard setup of the package hyperref is to use the content titles (i.e. the section or chapter etc. names) in the ToC as link, however, the option linktocpage=true to hyperref or in \hypersetup will use the page number, saying linktocpage only will work as well (for the lazy ones ;-)

\documentclass{article}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\section{First}
\blindtext[5]
\section{Second}
\blindtext[10]
\end{document}


It is even possible to link both: The section label and the page number. Just pass linktoc=all.

\usepackage[linktoc=all]{hyperref}


## Full example:

\documentclass{article}
\usepackage{blindtext}