enotez 和 \includeonly 的问题

enotez 和 \includeonly 的问题

使用 enotez 包编译乳胶文档\includeonly可能会导致文档出现不正确的结束注释。

例如,如果我的文档 (main.tex) 包含 chap1.tex 和 chap2.tex,每个文档都使用结尾注释,当我编译仅包含第二个文件的文档,然后再次编译仅包含第一个文件的文档时,我将获得一个包含 chap1.tex 内容但包含 chap2.tex 结尾注释的 pdf 文档(即使更改了 tex 文件)。纠正此问题的唯一方法是编译一次包含所有内容。

有没有办法自动强制更新尾注?请注意,使用 endnotes 包时,问题就会消失。

谢谢你的帮助!祝好,Mathieu

文件 main.tex:

\documentclass[titlepage,a4paper]{book}

\usepackage{enotez}
\setenotez{reset = true, list-heading = \section*{#1}}

\includeonly{chap1}
% \includeonly{chap2}

\begin{document}
\include{chap1}
\include{chap2}
\end{document}

文件 chap1.tex

Chapter 1: Text text \endnote{End note of chapter 1!}. Text text Text text Text text
\printendnotes

文件 chap2.tex 与 chap1.tex 类似(但正文和注释中用 2 代替 1)。

汇编:latexmk -pdf main.tex

相关内容