如何使用 acro 包设置首字母缩略词的第二次及后续出现

如何使用 acro 包设置首字母缩略词的第二次及后续出现

我正在使用该acro软件包来处理我的首字母缩略词。我的主管不喜欢在文本中使用首字母缩略词,所以我必须将它们全部放在长格式中,但保留第一种样式,如“首字母缩略词 (AC)”,其余使用“首字母缩略词”。我如何配置软件包acro以在第二次及后续使用中打印长格式?

\documentclass{article}
\usepackage{acro}
\DeclareAcronym{TIAE}{
short=TIAE,
long=this is an example,
}
\begin{document}
Firt use \ac{TIAE},
then second use \ac{TIAE},  %<--- must be "this is an example"
third use \ac{TIAE} and     %<--- must be "this is an example"
last use \ac{TIAE}.\par     %<--- must be "this is an example"
%
\printacronyms
\end{document}

答案1

您可以创建一个宏,其中包含\acifused测试该首字母缩略词是否已被使用,\acl如果为真则使用,\ac如果为假则使用:

\documentclass{article}
\usepackage{acro}
\DeclareAcronym{TIAE}{
short=TIAE,
long=this is an example,
}
\newcommand{\myac}[1]{\acifused{#1}{\acl{#1}}{\ac{#1}}}
\begin{document}
Firt use \myac{TIAE},
then second use \myac{TIAE},  %<--- must be "this is an example"
third use \myac{TIAE} and     %<--- must be "this is an example"
last use \myac{TIAE}.\par     %<--- must be "this is an example"
%
\printacronyms
\end{document}

在此处输入图片描述

答案2

\ac您可以使用 键设置第一个之后的所有类似用法的首字母缩略词模板subsequent-style。类似first-stylesubsequent-style接受任何定义的首字母缩略词模板,并且可以通过 全局设置\acsetup或按每个首字母缩略词设置\DeclareAcronym

\documentclass{article}
\usepackage{acro}
\acsetup{subsequent-style=long}
\DeclareAcronym{TIAE}{
short=TIAE,
long=this is an example,
subsequent-style=long,
}
\begin{document}
Firt use \ac{TIAE},
then second use \ac{TIAE},  %<--- must be "this is an example"
third use \ac{TIAE} and     %<--- must be "this is an example"
last use \ac{TIAE}.\par     %<--- must be "this is an example"
%
\printacronyms
\end{document}

相关内容