Skip to main content
To create a glossary and an acronym list in LaTeX, load hyperref (optional) before \usepackage[acronym]{glossaries}, call \makeglossaries in the preamble, define entries with \newglossaryentry and \newacronym, cite them in the text with \gls{key}, and print the lists with \printglossary and \printglossary[type=\acronymtype,title=Acronyms]. Compile with pdflatex, run makeglossaries, and run pdflatex twice more—or use \makenoidxglossaries or the acronym package when you want to avoid an external tool pass.

Basic glossary and acronym list

Pass the acronym option to glossaries to create a separate acronym list alongside the main glossary. (Without [acronym], \newacronym still works, but entries go into the main glossary and \acronymtype refers to main.) When using hyperlinks, load hyperref before glossaries so \gls{...} references become clickable links to the glossary.
glossary-basic.tex
Ready to use this syntax? Continue in the browser editor when you want to adapt the example in a real project.Open LaTeX Cloud Studio
On first use, \gls{api} prints the long form followed by the short form in parentheses: Application Programming Interface (API). Subsequent \gls{api} calls print only API. Each printed list sorts entries alphabetically and appends the page numbers where each entry appeared.

Defining and referencing entries

Define glossary terms in the preamble with \newglossaryentry{label}{name={...}, description={...}}. Add plural={...} whenever the plural does not follow the default rule of appending s (for example, name=matrix, plural=matrices). Define abbreviations with \newacronym{label}{short}{long}. In the document body, choose the command that matches the case, number, or expansion you need: With [acronym], you can print the acronym list with \printacronyms (equivalent to \printglossary[type=\acronymtype], titled Acronyms), or print every defined glossary in one call with \printglossaries. Pass package options nonumberlist to omit page numbers and nopostdot to remove the trailing period after each description.
glossary-commands.tex

Build sequence and sorting without makeglossaries

With \makeglossaries and \printglossary, run four commands locally on the command line:
The first pdflatex run writes the unsorted glossary files (.glo, .acn) and style file (.ist). makeglossaries (a Perl script; makeglossaries-lite is a Lua alternative when Perl is not installed) runs makeindex on each glossary to produce .gls and .acr. The two follow-up pdflatex passes insert the formatted lists and settle page numbers and hyperlinks. If your build environment does not run makeglossaries, replace \makeglossaries with \makenoidxglossaries and \printglossary with \printnoidxglossary. TeX then sorts the entries itself across normal pdflatex passes with no external tool required (slower on large glossaries and limited to basic ASCII alphabetical order rather than locale collation, so accented letters such as é sort after z):
glossary-noidx.tex
LaTeX Cloud Studio compiles with TeX Live 2026 (full distribution), so glossaries and acronym are pre-installed. Because LaTeX Cloud Studio does not configure an automatic makeglossaries rule in its build pipeline, use \makenoidxglossaries with \printnoidxglossary—or the acronym package below—when compiling directly in the browser editor.

Lightweight alternative: the acronym package

When a paper or thesis only needs an abbreviation list (no separate term definitions and no automatic sorting), the acronym package requires only two pdflatex passes and no external tool. List your abbreviations in display order inside \begin{acronym}[WIDEST], where WIDEST sets the label column width. Pass [printonlyused] to hide entries that are never referenced in the text (below, HTML is defined to set the column width but omitted from the printed list).
acronym-package.tex

Common mistakes

  • Loading hyperref after glossaries: glossaries checks whether hyperref is already loaded when \usepackage{glossaries} executes. Loading hyperref afterwards produces no error, but silently disables clickable glossary links. Always load hyperref before glossaries.
  • Forgetting \makeglossaries: Without \makeglossaries, no .ist or .glo file is written and makeglossaries fails with No \@istfilename found in 'main.aux'. and Did you remember to use \makeglossaries?.
  • Unused entries missing from the glossary: glossaries only prints entries referenced via \gls{...} (or its variants). Add \glsadd{key} for a specific term or \glsaddall to include every defined entry.
  • Forgetting to run makeglossaries: Running pdflatex alone with \makeglossaries completes without error, but omits the glossary because .gls and .acr do not exist. Run makeglossaries <jobname> followed by pdflatex twice, or switch to \makenoidxglossaries.
Ready to add a glossary or abbreviation list to a thesis? Start from the Master’s Thesis template in LaTeX Cloud Studio and replace main.tex with the complete example (glossary-noidx.tex or acronym-package.tex).