create link on every page of latex file to a specific page

Viewed 255

I want to create a link on every page of a latex file, and this link should navigate to a specific page in the documents. Like, create a link for \listoftodos command on every page, so that one can easily navigate to it.

MWE

\documentclass[]{article}

%opening
\title{}
\author{}
\usepackage[draft, colorinlistoftodos]{todonotes}
\begin{document}
\section{one}
\todo[inline]{todo 1}

\newpage
\section{two}
\todo[inline]{todo 2}

\newpage
\listoftodos
\end{document}
1 Answers

One possibility: use the fancyhdr package and add a link to the head or footline:

\documentclass[]{article}

%opening
\title{}
\author{}
\usepackage[draft, colorinlistoftodos]{todonotes}

\usepackage{fancyhdr}
\pagestyle{fancy} 
\fancyhf{} 
\fancypagestyle{plain}[fancy]{}
\renewcommand{\headrulewidth}{0pt}
\cfoot{\protect\hyperlink{todolist}{jump to todo list}}

\usepackage{hyperref}
\begin{document}
\section{one}
\todo[inline]{todo 1}

\newpage
\section{two}
\todo[inline]{todo 2}

\newpage
\phantomsection
\hypertarget{todolist}{}
\listoftodos
\end{document}

enter image description here

Related