我正在使用该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-style
,subsequent-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}