# Parameter to the acronym environment changes the font of the acronym column

If I add a parameter to the acronym environment in order to set the width of the acronym column, the font of the text in the acronym column automatically changes. How can I prevent (or at least control) that? Below is a MWE with a parameter [PdL] loaded:

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage[babel]{csquotes}

\usepackage{acronym}

\begin{document}
\begin{acronym}[PdL]
\acro{PD}{Democratic Party (\textit{Partito Democratico})}
\acro{PdL}{The People of Freedom (\textit{Il Popolo della Libertà})}
\end{acronym}
\end{document}


And below is the output of the same example, but without the parameter [PdL] loaded:

-
Wow, that's random! And I didn't believe it ... –  Hendrik Vogt Jun 28 '12 at 14:20
So, is it a bug? –  looreenzoo Jun 28 '12 at 15:01
I just did exactly the same fix as in the answer below before starting to post an almost identical question. This seems to be an inexplicable decision to hard-code, especially as it's unique to the case of a defined width. With my paranoid hat on I might be inclined to think it was designed to catch out those who leave such tidying until the deadline is looming! –  Chris H Jun 4 '14 at 16:54

It seems to be a precise choice by the package author. If no optional argument to acronym is specified, the list is typeset as a plain description environment. Otherwise the optional argument sets the label width and \bflabel is used to typeset the acronym.

Of course \bflabel can be redefined in the preamble; the default definition is

\def\bflabel#1{{\textbf{\textsf{#1}}\hfill}}


However the implementation is not well done, as the width is set using

\settowidth{\labelwidth}{\textbf{\textsf{#1}}}


anyway, instead of the correct

\settowidth{\labelwidth}{\bflabel{#1}}


A "more correct" implementation that uses \bflabel also without an optional argument is here:

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage[babel]{csquotes}

\usepackage{acronym}
\makeatletter
\renewenvironment{AC@deflist}[1]%
{\ifAC@nolist
\else
\raggedright
\begin{list}{}{\settowidth{\labelwidth}{\bflabel{#1}}%
\setlength{\leftmargin}{\labelwidth}%
\let\makelabel\bflabel}%
\fi}
{\ifAC@nolist
\else
\end{list}%
\fi}
\renewenvironment{acronym}[1][1]
{%
\providecommand*{\acro}{\AC@acro}%
\providecommand*{\acroplural}{\AC@acroplural}%
\long\def\acroextra##1{##1}%
\def\@tempa{1}\def\@tempb{#1}%
\ifx\@tempa\@tempb
\global\expandafter\let\csname ac@des@mark\endcsname\AC@used
\ifAC@nolist
\else
\begin{description}\let\makelabel\bflabel
\fi
\else
\begin{AC@deflist}{#1}%
\fi
}
{%
\ifx\AC@populated\AC@used
\else
\ifAC@nolist
\else
\item[]\relax%
\fi
\fi
\expandafter\ifx\csname ac@des@mark\endcsname\AC@used
\ifAC@nolist
\else
\end{description}%
\fi
\else
\end{AC@deflist}%
\fi}
\makeatother

% Provide here a new definition for \bflabel if desired
%\def\bflabel#1{{\textbf{\textsf{#1}}\hfill}}

\begin{document}
\begin{acronym}[PdL]
\acro{PD}{Democratic Party (\textit{Partito Democratico})}
\acro{PdL}{The People of Freedom (\textit{Il Popolo della Libert√†})}
\end{acronym}
\end{document}

-
Weird choice by the package author (I think), but great explanation! –  Hendrik Vogt Jun 29 '12 at 8:15