使用 acro 时出错:类型为“acro-first”的“long-short”是(xtemplate)未知

使用 acro 时出错:类型为“acro-first”的“long-short”是(xtemplate)未知

我刚刚从 overleaf 切换到使用 vim 来处理 latex,并在命令行上执行所有操作。我之前在 Overleaf 中编译代码时没有错误,但现在我在使用 acro 时遇到了问题。MWE:

\documentclass[12pt]{article}
\usepackage{acro}

\DeclareAcronym{cond}{
    short=Cond.\@,
    long=Condition,
    first-style=long-short,
}

\begin{document}
\ac{cond}
\end{document}

我执行pdflatex test.tex并得到以下错误:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texlive/texmf-dist/tex/latex/acro/acro.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def))
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty)
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty)
(/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/share/texlive/texmf-dist/tex/latex/zref/zref-abspage.sty
(/usr/share/texlive/texmf-dist/tex/latex/zref/zref-base.sty
(/usr/share/texlive/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)
(/usr/share/texlive/texmf-dist/tex/generic/infwarerr/infwarerr.sty)
(/usr/share/texlive/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty)
(/usr/share/texlive/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty)
(/usr/share/texlive/texmf-dist/tex/latex/pdftexcmds/pdftexcmds.sty
(/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty))
(/usr/share/texlive/texmf-dist/tex/generic/etexcmds/etexcmds.sty)
(/usr/share/texlive/texmf-dist/tex/latex/auxhook/auxhook.sty))
(/usr/share/texlive/texmf-dist/tex/generic/atbegshi/atbegshi.sty))
(/usr/share/texlive/texmf-dist/tex/latex/translations/translations.sty
(/usr/share/texlive/texmf-dist/tex/latex/koma-script/scrlfile.sty))
(/usr/share/texlive/texmf-dist/tex/latex/acro/acro.definitions.tex))
(./test.aux)
(/usr/share/texlive/texmf-dist/tex/latex/translations/translations-basic-dictio
nary-english.trsl)

! Package xtemplate Error: The instance 'long-short' of type 'acro-first' is
(xtemplate)                unknown.

我删除并重新安装了 texlive,我正在使用 Ubuntu 22.04。如能得到任何帮助我将不胜感激。

答案1

您安装的 Ubuntu 打包的 TeX Live 是 TeX Live 2019,它几乎肯定包含 acro v2(给定发布日期并且注意/acro/acro.definitions.tex在日志中加载),而不是 acro v3。

在 acro 2.x 中,long-shortfirst-style 不存在(正如错误所指示的那样),您可能需要defaultfirst-style,毫无疑问,它是默认的并且不需要指定(对于 acro v3 而言),除非在全局级别设置了long-short不同的样式。first-style

为了访问已安装包的特定版本文档,您可以texdoc acro在终端中运行,搜索first-style会带来允许的first-styles。

相关内容