3

I'm having a problem with the Acronyms' list. The acronyms mentioned in a table are not printed in the list of acronyms.

I'm using the acro package and calling the acronyms with \acs because I only want the short format in the text. But this does not have any effect on the problem. I'm creating the list by using \printacronyms.

I've already tested this by placing the acronyms outside the table. In this case they're printed in the list.

Here's an example:

\documentclass[10pt, a4paper]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[ngerman]{babel}
    \usepackage[T1]{fontenc}
    \usepackage{adjustbox}
    \usepackage{makecell}
    \usepackage{numprint}
    \selectlanguage{ngerman}
    \usepackage{float}
    \usepackage{tikz}
    \usepackage[linewidth=1pt]{mdframed}
    \usepackage{graphicx}
    
    \usepackage{acro}
    \DeclareAcronym{gesch}{
     short = gesch. ,
     long  = Geschätzt,
     class = abbrev
                          }
    
    \DeclareAcronym{tsd}{
     short = Tsd. ,
     long  = Tousend,
     class = abbrev
                          }
    \DeclareAcronym{utaut}{
     short = UTAUT ,
     long  = Unified Theory of Acceptance and Use of Technology ,
     class = abbrev
                          }                       
    \DeclareAcronym{usw}{
     short = usw. ,
     long  = Und so weiter ,
     class = abbrev
                          }

\begin{document}
    \pagenumbering{roman}

\newpage
\printacronyms
\newpage

    \pagenumbering{arabic}

\section{Theoretischer Hintergrund}

Test the acronyms \acs{usw}. The Theory is \acs{utaut}.

\begin{table}[H]
    \centering
        \begin{mdframed}
            \begin{adjustbox}{max width=0.99\textwidth,center}
                \begin{tabular}{llccc}
\hline 
\textbf{Stadt} & \textbf{Land} & \textbf{Bevölkerungsanzahl} & \makecell{\textbf{\acs{gesch}} \\ \textbf{Nutzer}} & \makecell{\textbf{\acs{gesch}} \\ \textbf{Nutzer in $\%$}} \\ 
 & & & & \\
Poznan & PL & \numprint{530} \acs{tsd} & \numprint{450} \acs{tsd} & 84,9$\%$ \\ 
Madrid & SP & \numprint{173} \acs{tsd} & \numprint{170} \acs{tsd} & 97,8$\%$ \\ 
& & & & \\ 
\hline
\hline
& & & & \\
Berlin & DE & \numprint{222} \acs{tsd} & \emph{\numprint{173}} \acs{tsd} & \emph{80,8$\%$}  \\
& & & & \\
\hline 
                \end{tabular}
            \end{adjustbox}
        \end{mdframed}
\caption[Geschätzte Anteile]{Geschätzte Anteile (Quelle: Eigene Verarbeitung)}
\label{tabi}
\end{table}

\end{document}

This is what I get (also after compiling multiple times): enter image description here

while this is what I need (I get this after placing the acronyms outside the table environment as such : Test the acronyms \acs{usw}. The Theory is \acs{utaut}. \textbf{\acs{gesch}} \numprint{450} \acs{tsd}): enter image description here

Any suggestions how to show all acronyms in the list wherever they're mentioned in the document?

7
  • Entirely unrelated to the problem itself, but please don't use adjustbox to make a table fits into the textwidth. With this aproach you will end up with inconsistent font sized throughout your document. As an alternative, you could take a look at either tabular* or the tabular package.
    – leandriis
    Commented Aug 3, 2020 at 15:37
  • Regarding the issue itself: Which version of the acro package did you use?
    – leandriis
    Commented Aug 3, 2020 at 15:37
  • The issue is not reproducible using acro version 2. With this version I get the expected output in which acronyms that are only used inside of a table environment are included in the list of acronyms as well. If I use acro version 3 (3.2 to be precise), I can reproduce the issue. (Additionally, I receive 4 warnings informing about the "class" key having been replaced with the "tag" key.)
    – leandriis
    Commented Aug 3, 2020 at 17:38
  • The manual of acroversion 3.2 mentions: "In a number of contexts all acronym commands act as if their starred form is used: in the table of contents, in the list of figures, and in the list of tables. The same is true for floats and the measuring phase of common table environments like tabularx or ltxtable." as well as "...a starred form which means “don’t count this as usage”."
    – leandriis
    Commented Aug 3, 2020 at 17:41
  • Yes, I use the 3.2 version. Do you recommend downgrading? Or just using another package?
    – dataminor
    Commented Aug 3, 2020 at 21:12

1 Answer 1

1

A better title for the question would probably be Acronyms used only in a table environment are not shown in the list of acronyms and a minimal example reproducing the behavior might be:

\documentclass{article}
\usepackage{acro}

\DeclareAcronym{a}{
  short = a ,
  long  = the letter a
}

\begin{document}

\printacronyms

\begin{table}
  \ac{a}
\end{table}

\end{document}

enter image description here

This leads to an empty list of acronyms. The reason is that inside floats acro turns off the mechanism which marks acronyms as used. That is because the placement of floats usually is somewhat independent from the surrounding text and otherwise acronyms might be marked as used too early. It is assumed that users use and explain the acronyms in the running text anyway.

However, unfortunately this behavior is not documented prior to v3.2a (2020/11/08) and obviously it might be preferable to users to revert acro's behavior in floats. v3.2a and greater provide the option patch/floats = true|false to turn it off and on. You can also use \acswitchon at the beginning of floats to turn the behaviour off only for certain floats (this also works in earlier versions).

\documentclass{article}
\usepackage{acro}

\DeclareAcronym{a}{
  short = a ,
  long  = the letter a
}

\acsetup{patch/floats=false}

\begin{document}

\printacronyms

\begin{table}
  \ac{a}
\end{table}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .