![词汇表-额外 (bib2gls) 和 totcount (\newtotcounter) 之间可能不兼容](https://linux22.com/image/414767/%E8%AF%8D%E6%B1%87%E8%A1%A8-%E9%A2%9D%E5%A4%96%20(bib2gls)%20%E5%92%8C%20totcount%20(%5Cnewtotcounter)%20%E4%B9%8B%E9%97%B4%E5%8F%AF%E8%83%BD%E4%B8%8D%E5%85%BC%E5%AE%B9.png)
在当前的 MiKTeX 发行版(包括发行版和预发行版)中,java.lang.StackOverflowError
根据bib2gls
手册,编译以下代码会导致无限循环。
平均能量损失
\documentclass{article}
\begin{filecontents*}{entries.bib}
@entry{bird,
name={bird},
description = {feathered animal}
}
\end{filecontents*}
\usepackage[record]{glossaries-extra}
\GlsXtrLoadResources[src=entries]
\usepackage{totcount}
\newtotcounter{tc}
\begin{document}
\gls{bird}
\printunsrtglossaries
\end{document}
消息
Process started: bib2gls "document" bib2gls version 2.3 (2020-03-23) Reading document.aux Exception in thread "main" java.lang.StackOverflowError at java.util.Vector.iterator(Unknown Source) at com.dickimawbooks.texparserlib.TeXObjectList.clone(TeXObjectList.java:1392) at com.dickimawbooks.texparserlib.TeXObjectList.expandfully(TeXObjectList.java:1514) at com.dickimawbooks.texparserlib.Group.expandfully(Group.java:222) at com.dickimawbooks.texparserlib.primitives.If.doTruePart(If.java:175) at com.dickimawbooks.texparserlib.primitives.If.doTruePart(If.java:211) at com.dickimawbooks.texparserlib.primitives.If.doTruePart(If.java:211) ⋮ [1017 more nestings] at com.dickimawbooks.texparserlib.primitives.If.doTruePart(If.java:211) Process exited with errors Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "document".tex Process exited normally
该问题表明它调用的或其他一些宏/包之间可能存在不兼容bib2gls 2.3 2020-03-23
。\newtotcounter{}
totcount 1.2
这似乎与AUX文件的第二行有关:
\expandafter\ifx\csname c@tc@totc\endcsname\relax\newcounter{tc@totc}\fi\setcounter{tc@totc}{0}
将其更改为:
\newcounter{tc@totc}\setcounter{tc@totc}{0}
恢复 的正常操作bib2gls
。
此外,重新排序前言中的命令并不能阻止这些错误的发生。