Previous: , Up: Front/back matter   [Contents][Index]

### 25.3 Glossaries

Synopsis:

\usepackage{glossaries} \makeglossaries
...
\newglossaryentry{label}{settings}
...
\gls{label}.
...
\printglossaries


The glossaries package allows you to make glossaries, including multiple glossaries, as well as lists of acronyms.

To get the output from this example, compile the document (for instance with pdflatex filename), then run the command line command makeglossaries filename, and then compile the document again.

\documentclass{...}
\usepackage{glossaries} \makeglossaries
\newglossaryentry{tm}{%
name={Turing machine},
description={A model of a machine that computes.  The model is simple
but can compute anything any existing device can compute.
It is the standard model used in Computer Science.},
}
\begin{document}
Everything begins with the definition of a \gls{tm}.
...
\printglossaries
\end{document}


That gives two things. In the main text it outputs ‘... definition of a Turing machine’. In addition, in a separate sectional unit headed ‘Glossary’ there appears a description list. In boldface it says ‘Turing machine’ and the rest of the item says in normal type ‘A model of a machine … Computer Science’.

The command \makeglossary opens the file that will contain the entry information, root-file.glo. Put the \printglossaries command where you want the glossaries to appear in your document.

The glossaries package is very powerful. For instance, besides the commands \newglossaryentry and \gls, there are similar commands for a list of acronyms. See the package documentations on CTAN.