LaTeX Guide

LaTeX Acronyms

Define once, use everywhere with auto first-use expansion. Two packages: acronym (simple) or glossaries (powerful).

The simple way: acronym package

\usepackage{acronym}

% Define acronyms (typically in preamble or beginning of document)
\begin{acronym}
  \acro{NLP}{Natural Language Processing}
  \acro{ML}{Machine Learning}
  \acro{API}{Application Programming Interface}
\end{acronym}

\begin{document}

% In body text:
We use \ac{NLP} techniques.            % first use: "Natural Language Processing (NLP) techniques"
Our \ac{NLP} pipeline...               % later: "Our NLP pipeline..."

\acl{ML}                                % always long: "Machine Learning"
\acs{ML}                                % always short: "ML"
\acf{ML}                                % always full: "Machine Learning (ML)"
\acp{API}                               % plural: "APIs"

\end{document}

The powerful way: glossaries package

\usepackage{glossaries}
\makeglossaries

% Define
\newacronym{NLP}{NLP}{Natural Language Processing}
\newacronym{ML}{ML}{Machine Learning}

\begin{document}

% In body
\gls{NLP} works well.       % first: "Natural Language Processing (NLP) works well."
\gls{NLP} also...           % later: "NLP also..."

\printglossaries            % print the list

\end{document}

% Compile sequence:
% pdflatex → makeglossaries main → pdflatex → pdflatex

Acronym package commands reference

CommandOutput for \acro{NLP}{Natural Language Processing}
\ac{NLP}First use: "Natural Language Processing (NLP)"; later: "NLP"
\acs{NLP}Always: "NLP"
\acl{NLP}Always: "Natural Language Processing"
\acf{NLP}Always: "Natural Language Processing (NLP)"
\acp{NLP}Plural form: "NLPs"
\Ac{NLP}Capitalized first letter (sentence start)
\acresetallReset first-use tracking (next \\ac shows full form again)

Common patterns

List of acronyms at the front

% After abstract, before main body
\section*{List of Acronyms}
\begin{acronym}[XXXXX]      % XXXXX is the longest acronym for tab stop
  \acro{NLP}{Natural Language Processing}
  \acro{ML}{Machine Learning}
  \acro{API}{Application Programming Interface}
\end{acronym}

% Now \ac{NLP} works throughout the document and the list above is a reference

Reset per chapter

\chapter{Introduction}
% \ac{NLP} expands fully here on first use
\acresetall                 % reset for next chapter
\chapter{Methods}
% \ac{NLP} expands fully again on first use here

Common mistakes

  • Defining acronyms inline. Define once in preamble, use everywhere. Don't mix definitions and use.
  • Forgetting \makeglossaries. Required when using the glossaries package; without it, no list appears.
  • Mixing \ac and \gls. They're different packages — pick one.
  • Hard-coding the expansion. Don't write "Natural Language Processing (NLP)" manually each first use — defeats the point of automation.
  • Plural with manual 's'. Use \acp for plurals; don't write \ac{NLP}s (would render as "Natural Language Processings" on first use, which is wrong).
Acronyms in Typst

Typst doesn't have a built-in acronym package, but you can write a small function: #let acronym(short, long) = state(short, true).update(false). Or use the @preview/acrostiche community package.

Try TypeTeX free

Frequently Asked Questions

How do I handle acronyms in LaTeX?

Two main packages. (1) acronym (simpler): \usepackage{acronym}, \begin{acronym} \acro{NLP}{Natural Language Processing} \end{acronym}. Use with \ac{NLP}. (2) glossaries (more powerful): \newacronym{NLP}{NLP}{Natural Language Processing}, use with \gls{NLP}. Both auto-expand on first use.

How does first-use expansion work?

First time you write \ac{NLP} (acronym package) or \gls{NLP} (glossaries), it expands to 'Natural Language Processing (NLP)'. Subsequent uses produce just 'NLP'. The package tracks first use automatically — you don't manage the state yourself.

What's the simpler option for just acronyms?

The acronym package. \usepackage{acronym}, then \begin{acronym} \acro{NLP}{Natural Language Processing} \acro{ML}{Machine Learning} \end{acronym}. Use with \ac{NLP} in body text. Variants: \acs{NLP} (always short), \acl{NLP} (always long), \acf{NLP} (always full form). Less powerful than glossaries but enough for many papers.

How do I print a list of all acronyms used?

With acronym package: \printacronyms or wrap definitions in \begin{acronym}[longest_label] ... \end{acronym} where the list prints in document order. With glossaries: \printglossaries (after running makeglossaries). Lists appear sorted alphabetically by default with glossaries.

How do I make the same acronym appear differently in different sections?

Reset first-use tracking with \acresetall (acronym package) or \glsresetall (glossaries). Useful when each chapter should have its own first-use expansion. Place at chapter starts or before specific sections.

How do I pluralize acronyms?

acronym package: \acp{NLP} produces 'NLPs' (with s). \acfp{NLP} for full plural. glossaries: \glspl{NLP} for plural. For irregular plurals (acronyms ending in s), specify: \newacronym[plural=Mice]{mouse}{mice}{the rodent}.

What if my acronym contains LaTeX special characters?

Wrap in extra braces: \acro{H2SO4}{Sulfuric Acid (H\textsubscript{2}SO\textsubscript{4})}. For math content: \acro{D}{Distance ($d$)}. The expansion text accepts any LaTeX commands.

How do I format the printed acronym list?

acronym package: \begin{acronym}[XXXXX] where XXXXX is the longest expected acronym (sets indent). Gives clean tabbed list. glossaries: \setglossarystyle{altlist} or \setglossarystyle{long} for different layouts. Many built-in styles available.

Should I use acronym or glossaries package?

Quick rule: just acronyms? Use acronym. Acronyms PLUS terminology glossary PLUS symbol list? Use glossaries. acronym is one-package-one-purpose simple. glossaries is the swiss army knife. For a typical paper with 5-10 acronyms, acronym package is enough.

More LaTeX guides