latex - 在 Latex 文件的每一页上创建指向特定页面的链接

标签 latex tex

我想在 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

关于latex - 在 Latex 文件的每一页上创建指向特定页面的链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67057869/

相关文章:

vim - 在 Vim 中使用 latex-suite 映射 <C-j> 的问题

r - 在不同的文件位置从 R Markdown 创建 PDF

python - matplotlib 使日期的轴刻度标签变为粗体

Latex - 提取子字符串/忽略字符

latex - 段落行中过满\hbox(1.38991pt 太宽),即使生成 PDF,Latex 也会发出警告

latex - 无法使用自定义样式编织为 pdf

java - 如何生成电话簿的可打印输出

python - 以编程方式将 LaTeX 代码转换/解析为纯文本

svg - 如何将刻度中的文本的原始字符串从 matplotlib 导出到 svg?

latex - 如何在 OverLeaf 中将一张 LaTeX 纸张包含到另一张 LaTeX 纸张中?