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

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} 
\usepackage[linktocpage]{hyperref}
\begin{document}
\tableofcontents
\section{First}
\blindtext[5]
\section{Second}
\blindtext[10]
\end{document}

enter image description here


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} 
\usepackage[linktoc=all]{hyperref}
\begin{document}
\tableofcontents
\section{First}
\blindtext[5]
\section{Second}
\blindtext[10]
\end{document}

MWE

MWE is based on the MWE by Christian Hupfer.