# Minimal working example on how to use acronyms package in LaTeX

Many people use the glossaries package for creating a list of acronyms or use acronyms in the text. However, there exists a (from my perspective) much more convenient way of implementing acronyms into you LaTeX documents by using the acronym package . The following minimal working example gives a brief overview on the most important features for simple use cases of acronyms. Please note that this package is designed for acronyms. In case you want or need a glossary or nomenclature, please use the appropriate packages.
$$\documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} % Step 1: Load package \usepackage[printonlyused,withpage]{acronym} \title{Minimal Working Example} \subtitle{Using Acronyms with the “acronym” Package} \author{Robin} \begin{document} \maketitle % Step 3: Use the defined (step 2 below) acronyms in your text \section{Some Chapter} A small network with local distributed machines is called a \ac{LAN}. In case you spread the network over a certain distance, e.g. to interconnect several branches of your company, it is called a \ac{WAN}. Often, many \acp{LAN} are interconnected using a \ac{WAN}. \section*{List of Acronyms} % Step 2: Setup available acronyms % Environment option is the longest entry in the table \begin{acronym}[WAN] \acro{LAN}{Local Area Network} \acro{WAN}{Wide Area Network} \acro{DNA}{Deoxyribonucleic Acid} \acrodefplural{DNA}[DNA]{Deoxyribonucleic Acid} \end{acronym} \end{document}$$
The common behavior of the package is to show the full text on the first occurrence of the acronym, e.g. “Local Area Network (LAN)”. All other occurrences of the same acronym are then printed only in the short form (“LAN”). Therefore, every time you use the acronym (either short or long form), you specify it using the markup \ac{XYZ} (e.g. \ac{LAN}). The LaTeX suite creating your document will then decide when to print which form of your acronym (which is very convenient in case you restructure your document and the order of occurrences changes!). There are some other command to enforce long/short/.. formats as well, which I will neglect here (see documentation of the package).
The acronym  “DNA” will not appear in the final list of acronyms, as it was not used in the text. If you want all acronyms from your acronym list to appear in the final list of acronyms in your document, remove the option “printonlyused” from the package declaration. In case you do not require the page number of the first occurrence of the acronym in the final acronym list, remove the “withpage” option. If your acronym has a plural form which differs from simply adding an “s” at the end, you can define it in the acronyms list using the command
$$\acrodefplural{single-short-form}[plural-short-form]{single-long-form}$$
As the document becomes very messy after adding a bunch of acronyms, my best practice is to define all acronyms in a separate document and include it as necessary using
$$\input{acronyms}$$
in case the filename is “acronyms.tex”.
You build your document using the following commandline (this example works in Debian jessie and the texlive suite). The filename is “acronyms.tex”.
[bash]
$> pdflatex acronyms.tex$> pdflatex acronyms.tex
[/bash]
As usual, the pdflatex command must be run twice in order to organize the cross references in the document. The final document is shown in the following document: acronyms.
For further information on the use of the acronyms package, see here.