4

I'm currently writing a Lab-Report, using a lot of acronyms and tables.

What I have so far looks like this:

\documentclass{standalone}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage{booktabs}
\usepackage[allowlitunits]{siunitx}
\DeclareSIUnit{\pH}{pH}
\usepackage{chemmacros}
\sisetup{locale=DE}
\usepackage{acronym}

\begin{document}%
    \begin{tabular}{cp{26em}}
        \toprule%
        Lösung & \multicolumn{1}{c}{Beschreibung} \\%
        \midrule%
        1 & \SI{0.1}{\textsc{n}-Acetatpuffer} \pH \SI{5.0}{} : \SI{70.5}{\milli\liter}
        \SI{1}{\Molar} \ch{NaOH +}\SI{100}{\milli\liter} \SI{1}{\Molar} Essigsäure, auf
        \SI{1}{\liter} mit destilliertem Wasser auffüllen.\\%        
        2 &\acl{tcl}--Lösung \SI{0.38}{\gram\per\liter} in \ac{dmso} bzw.
        \SI{189}{\milli\gram} auf \SI{5}{\milli\liter}\\%    
        3 &\ac{act}--Lösung \SI{37.8}{\milli\gram\per\milli\liter} in
        \SI{1}{\milli\Molar} \ch{HCl} bzw. \SI{189}{\milli\gram} auf
        \SI{5}{\milli\liter}\\%         
        \bottomrule%
    \end{tabular}
\end{document}

enter image description here

After changing \ac to \acl and (\acs) it works fine:

\begin{document}%
    \begin{tabular}{cp{26em}}
        \toprule%
        Lösung & \multicolumn{1}{c}{Beschreibung} \\%
        \midrule%
        1 & \SI{0.1}{\textsc{n}-Acetatpuffer} \pH \SI{5.0}{} : \SI{70.5}{\milli\liter}
        \SI{1}{\Molar} \ch{NaOH +}\SI{100}{\milli\liter} \SI{1}{\Molar} Essigsäure, auf
        \SI{1}{\liter} mit destilliertem Wasser auffüllen.\\%        
        2 &\acl{tcl}--Lösung \SI{0.38}{\gram\per\liter} in \ac{dmso} bzw.
        \SI{189}{\milli\gram} auf \SI{5}{\milli\liter}\\%    
        3 &\acl{act}--Lösung (\acs{act}) \SI{37.8}{\milli\gram\per\milli\liter} in
        \SI{1}{\milli\Molar} \ch{HCl} bzw. \SI{189}{\milli\gram} auf
        \SI{5}{\milli\liter}\\%         
        \bottomrule%
    \end{tabular}
\end{document}

enter image description here

I found a workaround, but still I would like to know what causes this problem.

I'm including this standalone in my main document, therefore its not a problem those acronyms aren't defined.

5
  • Why are you defining \pH as a unit when you're loading chemmacros which provides \pH?
    – cgnieder
    Jun 16, 2013 at 16:01
  • @cgnieder: Oh, looks like I defined it before I considered using the chemmacros package and forgot to remove it.
    – Rico
    Jun 16, 2013 at 16:04
  • there's an easy fix: \usepackage{etoolbox} and then \preto\ac{\leavevmode}. Why the spacing is affected if it's missing I don't know. BTW: I'd change \SI{0.1}{\textsc{n}-Acetatpuffer} into \SI{0.1}{\normal} Acetatpuffer
    – cgnieder
    Jun 16, 2013 at 16:25
  • @cgnieder One must be cautious about using etoolbox for patching acronym macros, because the package uses suffix. Nonetheless, in this case it works. Note that the problem doesn't show when the acronym is not typeset in expanded form.
    – egreg
    Jun 16, 2013 at 21:10
  • @cgnieder Would you add an answer?
    – egreg
    Jun 20, 2013 at 16:07

1 Answer 1

4

The \ac command misses to leave vertical mode (which it should as it is going to typeset something). A quick fix is to load etoolbox and to add

\preto\ac{\leavevmode}

to the preamble. Although this works one must be cautious using etoolbox's patching with acronym's commands as they are defined with the help of the suffix package which might cause the patching to fail. One could also “patch” \ac without another package (as proposed by @egreg in the chat):

\expandafter\def\expandafter\ac\expandafter{\expandafter\leavevmode\ac}

This redefines \ac to the first expansion of \ac with a \leavevmode added in front.

You must log in to answer this question.

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