0

Since the acronym package is built with the description environment, and the description environment works with Enumitem \setlist{nosep}, why is the Acronym package not affected by this command? I needed to reset the AC@deflist environment to have a similar effect, which is a much more complex solution than a simple command. Is it possible to configure Acronym to react to the \setlist{nosep} command?

\renewenvironment{AC@deflist}[1]{
    \ifAC@nolist%
    \else%
    \raggedright\begin{list}{}{
        \settowidth{\labelwidth}{\AC@makelabel{\aclabelfont{#1}}}%
        \setlength{\leftmargin}{\labelwidth}%
        \addtolength{\leftmargin}{\labelsep}%
        \setlength{\itemsep}{0pt}
        \setlength{\parsep}{0pt}
        \setlength{\parskip}{0pt}
        \renewcommand{\makelabel}{\AC@makelabel}
    }
    \fi
}{
    \ifAC@nolist%
    \else%
    \end{list}%
    \fi
}
3
  • 2
    as your own code snippet shows, acronym does not use description but the general list command and that is not changed by enumitem. Jul 21, 2023 at 16:29
  • You may want to consider using the acro package instead. It's default list is a regular description that can be modified using enumitem.
    – Alan Munn
    Jul 21, 2023 at 17:36
  • The acro package is very complex and verbose. The acronym package is simpler to use. Jul 22, 2023 at 15:32

1 Answer 1

0

It is possible to redefine the AC@deflist environment to use description instead of list with the code below. This way the \setlist{nosep} command will also be applied to the acronym list.

\documentclass{article}
\usepackage{acronym}
\usepackage{enumitem}
\setlist{nosep}

\makeatletter
\renewenvironment{AC@deflist}[1]%
{\begin{description}[leftmargin=!, labelwidth=3cm, labelsep=0pt, itemindent=0pt]}%
{\end{description}}
\makeatother

\begin{document}

\begin{acronym}
    \acro{AI}{Artificial Intelligence}
    \acro{ML}{Machine Learning}
\end{acronym}

\end{document}
1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jul 22, 2023 at 15:39

You must log in to answer this question.

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