According to 1 with version 3 of acro there were changes in the definition of list styles. I'm looking for a solution that allows different definitions depending on the version of the acro package (version 2 or 3). Does the ifthen package make sense? How do I get the version of the acro package for a conditional statement?
Many thanks in advance!
Edit: this is my actual solution which is working for version 3 but unfortunately not for version 2 (when loading acro with option "version=2"):
% 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
}
Can also someone tell me what the following lines do?
\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