3

I am using the acro package to generate a list of abbreviations for acronyms used in my thesis. Specifically, the \printacronyms command in the acro package prints the list. I am also using the chemmacros package to typeset chemical formulas.

With inspiration from this code, here is a MWE:

\documentclass{article}
\usepackage{chemmacros}

\usepackage{acro} \acsetup{ barriers/use, barriers/reset, use-id-as-short, }

\DeclareAcronym{CH3CN}{ short = \ch{CH3CN}, long-indefinite = an, long = \iupac{aceto|nitrile}, }

\DeclareAcronym{EMI+BF4-}{ short = \ch{EMI+ BF4-}, short-indefinite = an, long = \iupac{1-ethyl-3-methyl|imida|zolium tetra|fluoro|borate}, }

\DeclareAcronym{DFT}{ long = density functional theory, }

\begin{document}

\acuseall

\cleardoublepage \addcontentsline{toc}{section}{\protect\numberline{}List of Abbreviations} \printacronyms[heading=none,sort=true]

\end{document}

output

Why does "DFT" come after "EMI+BF4-"? According to this answer, "The first argument to \DeclareAcronym is used for sorting." If that were the case, wouldn't "DFT" come before "EMI+BF4-"?

How can I fix this?

Andrew
  • 1,249

1 Answers1

6

In order to determine the order in which acronyms are sorted, the acro package takes into account the value of short. Since the short form of the first two acronyms contains a command (namely \ch), they are placed in the "special caracter" section of the list of acronyms, which means at the very beginning (even before the letter "a"). In order to sort them alphabetically, you can use the sort key with values as shown in the following example:

enter image description here

\documentclass{article}
\usepackage{chemmacros}

\usepackage{acro} \acsetup{ barriers/use, barriers/reset, use-id-as-short, }

\DeclareAcronym{CH3CN}{ short = \ch{CH3CN}, sort = CH3CN, long-indefinite = an, long = \iupac{aceto|nitrile}, }

\DeclareAcronym{EMI+BF4-}{ short = \ch{EMI+ BF4-}, sort = EMI+BF4-, short-indefinite = an, long = \iupac{1-ethyl-3-methyl|imida|zolium tetra|fluoro|borate}, }

\DeclareAcronym{DFT}{ long = density functional theory, }

\begin{document}

\acuseall

\cleardoublepage \addcontentsline{toc}{section}{\protect\numberline{}List of Abbreviations} \printacronyms[heading=none,sort=true]

\end{document}

leandriis
  • 62,593