在每一页乳胶文件上创建指向特定页面的链接

问题描述

我想在 Latex 文件的每一页上创建一个链接,并且此链接应导航到文档中的特定页面。例如,为每个页面上的 \listoftodos 命令创建一个链接,以便人们可以轻松导航到该链接

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}

解决方法

一种可能性:使用 fancyhdr 包并添加指向头部或脚注的链接:

\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