CTAN 中用于管理两个 LaTeX PDF 文件之间的超链接的基本 LaTeX 工具是什么?

CTAN 中用于管理两个 LaTeX PDF 文件之间的超链接的基本 LaTeX 工具是什么?

我感兴趣的是了解可用的工具,包括成功案例。诚然,CTAN 的某些工具得到了维护,而其他工具则没有。未请求的是下面概述的问题的解决方案。问题详细信息仅适用于解释如何使用超链接以及为什么需要超链接管理工具。

Martin J. Osborne 于 2019 年 12 月提出了一个相关问题:制作交叉引用超链接... 他的问题的答案适用于将一本书拆分成两个 PDF 文件:book.pdf 和 answers.pdf。此外,还出现了适用于当前问题的想法。这些想法适用于试图组织他们的 LaTeX 书以进行交叉引用的作者。这些信息很有价值,尽管在准备出版的已完成书籍上实施这项工作需要大量劳动力。

示例问题:数学教科书书籍1300 页的 PDF 或平装本包含 3500 多个练习,但没有答案和解决方案的附录。答案、解决方案和更正位于单独的文件中答案.tex在 GitHub 上发布答案.pdf附有练习来源、答案、解决方案和更正。两个 PDF 文件中都使用了超链接。亚马逊平装本是单个 PDF 版本的印刷版书籍.pdf

文件答案.tex对于 GitHub 仅包含\使用包\包括\输入命令。练习按部分放在单独的文件中,并交叉引用文本内容。GitHub 贡献者会动态更正和添加新内容。文件答案.pdf随着教科书的更新,练习陈述和答案的内容和参考位置预计会发生变化。

相关 CTAN 包. CTAN 上有一个工具是包解析线作者:Florent Chervet(2010):CTAN 解析线

他的软件包提供了一种可靠的方法,用于将一个 LaTeX 源中的辅助条目添加到第二个 LaTeX 源中的辅助条目中。书籍辅助条目用于定义两个 PDF 输出文件之间的一些超链接书籍.pdf答案.pdf

如果 PDF 阅读器显示答案.pdf显示超链接,那么它必须在平装书中有意义,但也要充当浏览器超链接书籍.pdf。练习中还有导航超链接答案.pdf

下面是一个最小示例,展示了 Chervet 的 CTAN 包如何应用于上面概述的数学书问题。

文件测试文件.aux是 answers,aux 中引用 book.tex 的 aux 条目文件。

% testfile.aux 
% CONTENT: Certain hyperlink labels extracted from the book PDF LaTeX source
%\newlabel{1-10.ex.solver-matlab}{{A.29}{1249}{Computer Algebra Methods}{ExampleA.A.29}{}}
%\newlabel{1-3.proof.newton-cooling}{{\relax }{14}{Details and Proofs}{subsection.1.1.11}{}}
%\newlabel{1-3.proof.logistic-solution}{{\relax }{14}{Details and Proofs}{subsection.1.1.11}{}}

文件测试写入辅助文件

% testwriteaux.tex: Uses two methods of Florent Chervet
%% TASK: append the aux file of the exercises PDF LaTeX source
%% UNEXPECTED: **Chervet** defines environment "parse lines" not "parselines"
%% The environment name contains a space char!
\documentclass{article}
\usepackage{hyperref}%  Require aux entries compatible with CTAN hyperref
\usepackage{parselines}% https://ctan.org/tex-archive/macros/latex/contrib/parselines
\makeatletter\long\def\addtoaux#1{\write\@mainaux{\protect#1}}\makeatother
\begin{document}
\tableofcontents
\section{Introduction}
The first key example is the exponential model
$$\frac{d}{dt}y=ky,\quad\mbox{with unique solution}\quad y(t)=y(0)e^{kt}$$
\section{Exponential Models}
See Example \ref{1-3.ex.compound-interest} on page \pageref{1-3.ex.compound-interest}
% First method:
\begin{parse lines}{\addtoaux{#1}}
\newlabel{1-10.ex.solver-maple}{{A.28}{1248}{Computer Algebra Methods}{ExampleA.A.28}{}}
\newlabel{1-3.ex.compound-interest}{{1.11}{28}{Examples}{ExampleA.1.11}{}}
\end{parse lines}
\let\do\addtoaux\dofilebyline{**testfile.aux**}%
\end{document}

教科书和练习示例仅使用最后一行测试写入辅助文件. 超链接\参考\pageref导致需要维护两个 PDF 输出,而这可以通过 LaTeX 之外的 Linux 工具来完成。笨拙且毫无乐趣。LaTeX 工具是更好的选择吗?

相关内容