该包xassoccnt
现在似乎导致了 \LaTeX3 错误,如下面的 MWE 所示。
\documentclass{article} % same error with memoir
\usepackage{xassoccnt}
% not used in this test document, but seems to cause error
% (it's used int the "real" document, together with zref ,
% to allow reference to the part of a section number after decimal point)
\begin{document}
hello
\end{document}
日志包括:
./test.tex:10: Undefined control sequence.
<argument> \LaTeX3 error:
Use 1 not \c_one deprecated on 2020-01-01.
l.10 \end{document}
确实,xassoccnt.sty
(版本 1.7,日期为 2018/12/28)确实使用了\c_one
几次(以及c_zero
。
一两天前我还没有遇到过这个错误xassoccnt
,而且似乎包最近没有改变,所以原因似乎是 LaTeX/LaTeX3 中最近更新的东西。
该错误似乎与 documentclass 无关(与book
或相同memoir
)。无论使用 pdflatex 还是 xelatex 都会发生这种情况。
这里该如何修复?
以下是日志中的较长内容:
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex 2020.7.18) 18 JUL 2020 11:50
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**test.tex
(./test.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-07-17>
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
...
(/usr/local/texlive/2020/texmf-dist/tex/latex/xassoccnt/xassoccnt.sty
Package: xassoccnt 2018/12/28 - v1.7
(/usr/local/texlive/2020/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2020/07/15 v2.5i e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count176
)
(/usr/local/texlive/2020/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty
Package: letltxmacro 2019/12/03 v1.6 Let assignment for LaTeX macros (HO)
)
(/usr/local/texlive/2020/texmf-dist/tex/latex/xcolor/xcolor.sty
Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK)
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: pdftex.def on input line 225.
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-def/pdftex.def
File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex
...
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3kernel/expl3.sty
Package: expl3 2020-07-17 L3 programming layer (loader)
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def
File: l3backend-pdfmode.def 2020-06-29 L3 backend support: PDF mode
\l__kernel_color_stack_int=\count177
\l__pdf_internal_box=\box45
))
Package: xparse 2020-05-15 L3 Experimental document command parser
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse-generic.
tex
...)
)
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty
Package: l3keys2e 2020-05-15 LaTeX2e option processing using LaTeX3 keys
)
...
Package xassoccnt Info: 2018/12/28-v1.7--steppingcounterssimultaneouslyandother
features on input line 7.
...
{/Users/me/Library/texlive/2020/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
./test.tex:10: Undefined control sequence.
<argument> \LaTeX3 error:
Use 1 not \c_one deprecated on 2020-01-01.
l.10 \end{document}
答案1
正如评论中指出的那样,正确的“修复”是更新软件包(更多内容见下文)。作为紧迫的修复,可以做
\RequirePackage{expl3}
\ExplSyntaxOn
\cs_undefine:N \c_one
\int_const:Nn \c_one { 1 }
\ExplSyntaxOff
加载之前xassoccnt
。
一般来说,expl3
随着语言的发展,使用的软件包预计会定期更新:这在宽广地发行版的稳定性和弃用信息。在 的情况下xassoccnt
,有两个问题
- 该软件包的作者已退出软件包维护,并退出了社交媒体
- 该包由作者维护
我们将找到解决方案,但可能不会立即实现。