词汇表-额外 (bib2gls) 和 totcount (\newtotcounter) 之间可能不兼容

词汇表-额外 (bib2gls) 和 totcount (\newtotcounter) 之间可能不兼容

在当前的 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

此外,重新排序前言中的命令并不能阻止这些错误的发生。

相关内容