0

I used the acronym package (usepackage{acronym}) to create acronyms in my thesis. In the beginning of the document, I define the acronym as, for example, \acrodef{USA}{United States of America}. And then later to use this abbreviation I call it as \ac{USA}. How do we generate a list of Abbreviations (acronyms) as a list of figures and list of tables in LaTeX?

2

From the acronym package documentation:

Acronyms can either defined from an environment specifically introduced for that purpose or by direct definitions.The acronym environment allows one to define all the acronyms needed by a document at a single place and is self-documenting, since a table of acronyms is automatically produced.

And

If one does not want an acronym list to be produced at all, acronyms can bedefined directly thanks to the two commands

\newacro{〈acronym〉}[〈short name〉]{〈full> name〉}

\acrodef{〈acronym〉}[〈short name〉]{〈full name〉}

Therefore, use the acronym environment and the \acro command instead of \acrodef if you want to have a list of acronyms.

\documentclass{article}
\usepackage[colorlinks]{hyperref}
\usepackage[printonlyused,withpage]{acronym}
\begin{document}

Some text \ac{USA}

\section{List of Acronyms}
\begin{acronym}
 \acro{USA}{United States of America}
\end{acronym}
\end{document}

Compiling twice, you will get the following result:

enter image description here


For automated sorting and a lot more (formating) options, I'd recommend the glossaries or the glossaries-extra package.

| improve this answer | |
  • Thank you for your answer but why did you use \begin{acronym} \acro{USA}{United States of America} \end{acronym}? Can't we use acrodef as I included in my question? yes, I have also read glossaries is powerful but how can we use it together with acronym? Because I have a huge document and all my abbreviations have been defined using acrodef and used with \ac{} command. – Brown May 22 '19 at 20:33
  • @Brown: As the quoted parts of the acronym manual show, the \acrodef command can be used if you don't want to have a list of abbreviations. In order to create the MWE in my answer, I just followed the example file on page 7 of the documentation where the arconym environment and the \acro command are used. – leandriis May 22 '19 at 20:43
  • Ok thank you again. But is it common to use page numbers with acronyms? – Brown May 22 '19 at 20:46
  • @Brown: I don't know, but you can remove the page numbers form the list of acronyms if you remove the withpage option from the acronym package. – leandriis May 22 '19 at 20:48
1

I suggest the powerful acro package.

\documentclass{article}
\usepackage{acro}

\DeclareAcronym{usa}{
  short=USA,
  long=United States of America,
}
\DeclareAcronym{eu}{
  short=EU,
  long=European Union,
}
\DeclareAcronym{ussr}{
  short=USSR,
  long=Union of Soviet Socialist Republics,
}

\begin{document}

\ac{usa}, \ac{usa}

\ac{eu}, \ac{eu}

\ac{ussr}, \ac{ussr}

\printacronyms

\end{document}

enter image description here

| improve this answer | |
  • Thank you but I am getting an error LaTeX3 Error: Command '\acresetall' already defined! – Brown May 23 '19 at 12:48
  • @Brown You shouldn't load also acronym. – egreg May 23 '19 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.