词汇表:由于不断改变页面引用而导致无限编译循环

词汇表:由于不断改变页面引用而导致无限编译循环

我正在使用latexmk自定义规则来调用处理词汇表glossaries的包(使用)。还使用了首字母缩略词。此处理最终陷入无限循环,直到达到最大迭代次数。makeglossariesxindylatexmk

我在文件中的规则latexmkrc是:

add_cus_dep('glo', 'gls', 0, 'makeglossaries');
add_cus_dep('acn', 'acr', 0, 'makeglossaries');
sub makeglossaries {
    system("makeglossaries \"$_[0]\"");
}

在完成实际构建正确文档所需的所有步骤之后,我在日志中看到的是以下模式:

------------
Run number 5 of rule 'pdflatex'
------------
------------
Running 'pdflatex -shell-escape -interaction=nonstopmode  -recorder  "thesis.tex"'
------------
Latexmk: applying rule 'pdflatex'...
...
Latexmk: Log file says output to 'thesis.pdf'
Latexmk: Found biber source file(s) [thesis.bcf thesis.bib]
Rule 'cusdep glo gls thesis': File changes, etc:
   Changed files, or newly in use since previous run(s):
      'thesis.glo'
------------
Run number 5 of rule 'cusdep glo gls thesis'
------------
=== TeX engine is 'pdfTeX'
Latexmk: applying rule 'cusdep glo gls thesis'...
For rule 'cusdep glo gls thesis', running '&do_cusdep( makeglossaries )' ...
makeglossaries version 2.20 (2016-12-16)
...
Markup written into file "thesis.acr".
...
Markup written into file "thesis.gls".
Rule 'pdflatex': File changes, etc:
   Changed files, or newly in use since previous run(s):
      'thesis.gls'
------------
Run number 6 of rule 'pdflatex'
------------
------------
Running 'pdflatex -shell-escape -interaction=nonstopmode  -recorder  "thesis.tex"'
------------
Latexmk: applying rule 'pdflatex'...
...
Latexmk: Log file says output to 'thesis.pdf'
Latexmk: Found biber source file(s) [thesis.bcf thesis.bib]
Rule 'cusdep glo gls thesis': File changes, etc:
   Changed files, or newly in use since previous run(s):
      'thesis.glo'
------------
Run number 6 of rule 'cusdep glo gls thesis'
------------
=== TeX engine is 'pdfTeX'
Latexmk: applying rule 'cusdep glo gls thesis'...
For rule 'cusdep glo gls thesis', running '&do_cusdep( makeglossaries )' ...
...
Markup written into file "thesis.acr".
...
Markup written into file "thesis.gls".
Rule 'pdflatex': File changes, etc:
   Changed files, or newly in use since previous run(s):
      'thesis.gls'

latexmk看到glo文件已更改,重新运行makeglossaries,这会更改gls文件,重新运行pdflatex等等......

当手动执行重复步骤并检查文件校验和时,我看到以下模式:

languitar@jaco ~/thesis (master)> pdflatex -shell-escape -interaction=nonstopmode  -recorder  "thesis.tex" > /dev/null
languitar@jaco ~/thesis (master)> md5sum thesis.glo thesis.gls
bb535a43a7b428821282a726370b52a7  thesis.glo
d31c2154df7d635bdc5340f78416b182  thesis.gls
languitar@jaco ~/thesis (master)> makeglossaries thesis > /dev/null
languitar@jaco ~/thesis (master)> md5sum thesis.glo thesis.gls
bb535a43a7b428821282a726370b52a7  thesis.glo
48b2f195a653372cec8ba2aa5657f021  thesis.gls
languitar@jaco ~/thesis (master)> pdflatex -shell-escape -interaction=nonstopmode  -recorder  "thesis.tex" > /dev/null
languitar@jaco ~/thesis (master)> md5sum thesis.glo thesis.gls
a773f7fa5296db7f65f9c5dada9160df  thesis.glo
48b2f195a653372cec8ba2aa5657f021  thesis.gls
languitar@jaco ~/thesis (master)> makeglossaries thesis > /dev/null
languitar@jaco ~/thesis (master)> md5sum thesis.glo thesis.gls
a773f7fa5296db7f65f9c5dada9160df  thesis.glo
d31c2154df7d635bdc5340f78416b182  thesis.gls
languitar@jaco ~/thesis (master)> pdflatex -shell-escape -interaction=nonstopmode  -recorder  "thesis.tex" > /dev/null
languitar@jaco ~/thesis (master)> md5sum thesis.glo thesis.gls
bb535a43a7b428821282a726370b52a7  thesis.glo
d31c2154df7d635bdc5340f78416b182  thesis.gls
languitar@jaco ~/thesis (master)> makeglossaries thesis > /dev/null
languitar@jaco ~/thesis (master)> md5sum thesis.glo thesis.gls
bb535a43a7b428821282a726370b52a7  thesis.glo
48b2f195a653372cec8ba2aa5657f021  thesis.gls
languitar@jaco ~/thesis (master)> pdflatex -shell-escape -interaction=nonstopmode  -recorder  "thesis.tex" > /dev/null
languitar@jaco ~/thesis (master)> md5sum thesis.glo thesis.gls
a773f7fa5296db7f65f9c5dada9160df  thesis.glo
48b2f195a653372cec8ba2aa5657f021  thesis.gls

编辑: 哎呀,这是由词汇表和页面引用的极端情况引起的。以下屏幕截图说明了这个问题:

在文档的词汇表中,事情最终以这样的情况结束: 在此处输入图片描述

因此,“系统资源”的页面引用是错误的,因为在“虚拟资源”的描述中使用该术语。因此 LaTeX 请求重新运行,之后makeglossariespdflatex得到:

在此处输入图片描述

现在,由于从范围到单个页面的变化,“虚拟资源”的文本被以不同的方式重新布局,因此页码发生变化并且循环再次开始。

除了重新措辞段落以避免增加/删除换行符之外,还有其他真正的解决方案吗?

相关内容