根据1在 acro 版本 3 中,列表样式的定义发生了变化。我正在寻找一种解决方案,可以根据 acro 包的版本(版本 2 或 3)使用不同的定义。ifthen 包有意义吗?如何获取条件语句的 acro 包版本?
提前谢谢了!
编辑:这是我的实际解决方案,它适用于版本 3,但不幸的是不适用于版本 2(当使用选项“version=2”加载 acro 时):
% etoolbox:
\newcommand\ifacroversionThree{%
\ifnumequal{\csuse{c_acro_version_major_number_tl}}{3}%
}
\ifacroversionThree{%version 3
\newlength\myitemwidth
\setlength\myitemwidth{5em}
\newlist{listabbrev}{description}{1}
\setlist[listabbrev]{
labelindent = 0pt,
labelsep = 0pt,
leftmargin = \myitemwidth,
labelwidth = \myitemwidth,
format = \normalfont
}
\NewAcroTemplate[list]{styleabbrev}{%
\let\description\listabbrev
\let\enddescription\endlistabbrev
\UseAcroTemplate[list]{description}[0]%
}
\acsetup{
% list/template = styleabbrev,
make-links = true,
list/template = longtabu,
list/heading = section*,
list/sort = true,
list/name = {\IfLanguageName{ngerman}{Abkürzungen}{Acronyms}}
}
\printacronyms
\newpage
}
{%not version 3
%\input{mandatory/acronyms}
\DeclareAcroListStyle{longtabu}{table}{
table = longtabu ,
table-spec = @{}>{\bfseries}lX@{}
}
\acsetup{list-style=longtabu,
hyperref=true,
extra-style=comma}
\printacronyms[name={\IfLanguageName{ngerman}{Abkürzungen}{Acronyms}},
sort={true},
heading={section*}]
\newpage
}
有人能告诉我下面几行的作用吗?
\ExplSyntaxOn
\cs_undefine:N\__acro_declare_long:nn
\acro_declare_property:nnn {long} {long}
{
\acro_for_endings_do:n
{ \prop_put:cnn {l__acro_long_##1_form_prop} {#1} { \c_false_bool } }
\prop_put:NnV \l__acro_long_indefinite_prop
{#1}
\l__acro_default_indefinite_tl
\acro_for_endings_do:n
{
\bool_if_exist:cTF {l__acro_#1_long-##1_set_bool}
{
\bool_if:cF {l__acro_#1_long-##1_set_bool}
{
\prop_put:cnv {l__acro_long_##1_prop} {#1} {l__acro_default_long_##1_tl}
}
}
{
\prop_put:cnv {l__acro_long_##1_prop} {#1} {l__acro_default_long_##1_tl}
}
}
}
\ExplSyntaxOff