Question:
setlist{nosep} not work in the acronym package

Problem:

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

}


Solution: 

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}


Suggested blogs:

>How to Create an array based on two other arrays in Php

>How To Create Nested Table Structure In Angular?

>How to solve encoding issue when writing to a text file, with Python?

>Step by Step guide to Deploy Terraform in Azure using GitHub Actions

>Testing react components using Hooks and Mocks

>Use Firebase Realtime Database with ASP.NET MVC App

>Use of Singletons in .NET Core in AWS Lambda

>How to Create_function deprecated in PHP?

>How to delete duplicate names from Array in Typescript?

>How to do PHP Decryption from Node.js Encryption

>How to Set up the Android emulator?

>How to Set up the local environment for Angular development?


Ritu Singh

Ritu Singh

Submit
0 Answers