The nomencl package
Builds a list of symbols: \nomenclature{symbol}{description} records an entry where the symbol is introduced, and \printnomenclature prints the sorted list.
Loading the package
\usepackage{nomencl}You write each \nomenclature entry next to the formula that introduces the symbol. The command prints nothing at that place. The entries are collected in a file with the extension .nlo.
The program MakeIndex sorts this file, but it needs the style file of the package and other file names than for an index: makeindex main.nlo -s nomencl.ist -o main.nls. The next LaTeX run reads main.nls and prints the list. Without this step the document compiles and \printnomenclature prints nothing; the example below shows its list only after it.
Main commands
\makenomenclature | Preamble: switches on the .nlo file. |
\nomenclature{$F$}{Force} | Records a symbol and its description. |
\nomenclature[G]{$\alpha$}{Angle} | The optional argument is a sort key that is put in front of the symbol, here to move Greek letters behind the Latin ones. |
\nomunit{N} | Inside the description: prints a unit at the right margin of the entry. |
\printnomenclature[2cm] | Prints the list; the optional argument is the width of the symbol column. |
\renewcommand{\nomname}{List of symbols} | Heading of the list; the default is "Nomenclature". |
\usepackage[intoc]{nomencl} | Adds the list to the table of contents. |
Complete example
\documentclass{article}
\usepackage{nomencl}
\makenomenclature
\renewcommand{\nomname}{List of symbols}
\begin{document}
\section{Motion}
Newton's second law reads $F = m a$.%
\nomenclature{$F$}{Force \nomunit{N}}%
\nomenclature{$m$}{Mass \nomunit{kg}}%
\nomenclature{$a$}{Acceleration}
The angle $\alpha$ is measured against the horizontal.%
\nomenclature[G]{$\alpha$}{Angle}
\printnomenclature[1.5cm]
\end{document}Compiled with pdfLaTeX from TeX Live 2023.
Pitfalls
- A plain
makeindex mainprocesses the index filemain.idxand leaves the list of symbols empty. The three argumentsmain.nlo,-s nomencl.istand-o main.nlsare all needed. - MakeIndex sorts by the source text of the symbol, so
$\alpha$is sorted by its backslash and not as the letter a. Set the position with the optional sort key. - Each
\nomenclatureline between two sentences adds a space to the text. End the lines with%, as in the example, so that only one space remains. - For acronyms and terms with a description,
glossariesandacronymare the better fit.
Related pages
- How-to Glossary and list of acronyms in LaTeX
- Package
glossaries - Package
imakeidx - Package
siunitx