> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/document-structure/06-nomenclatures.md).

# Nomenclatures

## Introduction

A list of abbreviations and symbols is common in many scientific documents. These types of lists can be created with LaTeX by means on the `nomencl` package. This article explains how to create nomenclatures, customizing the ordering and subgrouping of the symbols.

Nomenclature entries work pretty much like index entries:

```latex
\documentclass{article}
\usepackage{nomencl}
\makenomenclature

\begin{document}
Here is an example:
\nomenclature{\(c\)}{Speed of light in a vacuum}
\nomenclature{\(h\)}{Planck constant}

\printnomenclature
\end{document}
```

[Open this `nomencl` example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=nomencl+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bnomencl%7D%0A%5Cmakenomenclature%0A%0A%5Cbegin%7Bdocument%7D%0AHere+is+an+example%3A%0A%5Cnomenclature%7B%5C%28c%5C%29%7D%7BSpeed+of+light+in+a+vacuum%7D%0A%5Cnomenclature%7B%5C%28h%5C%29%7D%7BPlanck+constant%7D%0A%0A%5Cprintnomenclature%0A%5Cend%7Bdocument%7D)

![Nomenclatures01OLV2.png](/files/47l3xRpravk9hW2Dge2s)

As usual the package is imported in the preamble by `\usepackage{nomencl}`. The three basic commands to produce the nomenclatures are:

* `\makenomenclature`. Usually put right after importing the package.
* `\nomenclature`. Used to define the nomenclature entries themselves. Takes two arguments, the symbol and the corresponding description.
* `\printnomenclatures`. This command will print the nomenclatures list.

## Basic Syntax

Additional options can be used when importing the `nomencl` package. The next example shows how to add the nomenclature to the table of contents and how to change the default language:

```latex
\documentclass{article}
\usepackage[spanish]{babel}
\usepackage[intoc, spanish]{nomencl}
\makenomenclature

\begin{document}
\tableofcontents

\section{Primera Sección}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortisfacilisis sem. Nullam nec mi et neque pharetra sollicitudin. Praesent imperdie...

\nomenclature{\(c\)}{Speed of light in a vacuum}
\nomenclature{\(h\)}{Planck constant}

\printnomenclature
\end{document}
```

[Open this `nomencl` example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=nomencl+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5Bspanish%5D%7Bbabel%7D%0A%5Cusepackage%5Bintoc%2C+spanish%5D%7Bnomencl%7D%0A%5Cmakenomenclature%0A%0A%5Cbegin%7Bdocument%7D%0A%5Ctableofcontents%0A%0A%5Csection%7BPrimera+Secci%C3%B3n%7D%0A%0ALorem+ipsum+dolor+sit+amet%2C+consectetuer+adipiscing+elit.+Etiam+lobortisfacilisis+sem.+Nullam+nec+mi+et+neque+pharetra+sollicitudin.+Praesent+imperdie...%0A%0A%5Cnomenclature%7B%5C%28c%5C%29%7D%7BSpeed+of+light+in+a+vacuum%7D%0A%5Cnomenclature%7B%5C%28h%5C%29%7D%7BPlanck+constant%7D%0A%0A%5Cprintnomenclature%0A%5Cend%7Bdocument%7D)

![Nomenclatures02OLV2.png](/files/hEWtO8AzXnyPnXa5FFng)

The additional options used here in when importing the package are:

* `intoc` Adds the **Nomenclature** to the table of contents.
* `spanish` Changes the language, translating the default title *Nomenclatures* accordingly. The supported languages are: `croatian`, `danish`, `english`, `french`, `german`, `italian`, `polish`, `portuguese`, `russian`, `spanish` and `ukranian`.

Other useful features of the `nomencl` package are the possibility of manually setting the nomenclature title, and adding an additional annotation.

```latex
\documentclass{article}
\usepackage{nomencl}
\makenomenclature

\renewcommand{\nomname}{List of Symbols}

\renewcommand{\nompreamble}{The next list describes several symbols that will be later used within the body of the document}

\begin{document}
Here is an example:

\nomenclature{\(c\)}{Speed of light in a vacuum}
\nomenclature{\(h\)}{Planck constant}

\printnomenclature
\end{document}
```

[Open this `nomencl` example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=nomencl+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bnomencl%7D%0A%5Cmakenomenclature%0A%0A%5Crenewcommand%7B%5Cnomname%7D%7BList+of+Symbols%7D%0A%0A%5Crenewcommand%7B%5Cnompreamble%7D%7BThe+next+list+describes+several+symbols+that+will+be+later+used+within+the+body+of+the+document%7D%0A%0A%5Cbegin%7Bdocument%7D%0AHere+is+an+example%3A%0A%0A%5Cnomenclature%7B%5C%28c%5C%29%7D%7BSpeed+of+light+in+a+vacuum%7D%0A%5Cnomenclature%7B%5C%28h%5C%29%7D%7BPlanck+constant%7D%0A%0A%5Cprintnomenclature%0A%5Cend%7Bdocument%7D)

![Nomenclatures03verbOLV2.png](/files/Ms9vbANsH2aPvqvd7kRZ)

The line

```
\renewcommand{\nomname}{List of Symbols}
```

changes the default title.

The command

```
\renewcommand{\nompreamble}{The next list...}
```

inserts some text in between the title and the list symbols.

## Grouping

To group the symbols depending on their type some additional work is needed. We add a prefix to each symbol and use the `etoolbox` package to compare the prefixes.

```latex
\documentclass{article}
\usepackage{amssymb}
\usepackage{nomencl}
\makenomenclature

%% This code creates the groups
% -----------------------------------------
\usepackage{etoolbox}
\renewcommand\nomgroup[1]{%
  \item[\bfseries
  \ifstrequal{#1}{P}{Physics constants}{%
  \ifstrequal{#1}{N}{Number sets}{%
  \ifstrequal{#1}{O}{Other symbols}{}}}%
]}
% -----------------------------------------

\begin{document}
Here is an example:

\nomenclature[P]{\(c\)}{Speed of light in a vacuum}
\nomenclature[P]{\(h\)}{Planck constant}
\nomenclature[P]{\(G\)}{Gravitational constant}
\nomenclature[N]{\(\mathbb{R}\)}{Real numbers}
\nomenclature[N]{\(\mathbb{C}\)}{Complex numbers}
\nomenclature[N]{\(\mathbb{H}\)}{Quaternions}
\nomenclature[O]{\(V\)}{Constant volume}
\nomenclature[O]{\(\rho\)}{Friction index}

\printnomenclature
\end{document}
```

[Open this `nomencl` example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=nomencl+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamssymb%7D%0A%5Cusepackage%7Bnomencl%7D%0A%5Cmakenomenclature%0A%0A%25%25+This+code+creates+the+groups%0A%25+-----------------------------------------%0A%5Cusepackage%7Betoolbox%7D%0A%5Crenewcommand%5Cnomgroup%5B1%5D%7B%25%0A++%5Citem%5B%5Cbfseries%0A++%5Cifstrequal%7B%231%7D%7BP%7D%7BPhysics+constants%7D%7B%25%0A++%5Cifstrequal%7B%231%7D%7BN%7D%7BNumber+sets%7D%7B%25%0A++%5Cifstrequal%7B%231%7D%7BO%7D%7BOther+symbols%7D%7B%7D%7D%7D%25%0A%5D%7D%0A%25+-----------------------------------------%0A%0A%5Cbegin%7Bdocument%7D%0AHere+is+an+example%3A%0A%0A%5Cnomenclature%5BP%5D%7B%5C%28c%5C%29%7D%7BSpeed+of+light+in+a+vacuum%7D%0A%5Cnomenclature%5BP%5D%7B%5C%28h%5C%29%7D%7BPlanck+constant%7D%0A%5Cnomenclature%5BP%5D%7B%5C%28G%5C%29%7D%7BGravitational+constant%7D%0A%5Cnomenclature%5BN%5D%7B%5C%28%5Cmathbb%7BR%7D%5C%29%7D%7BReal+numbers%7D%0A%5Cnomenclature%5BN%5D%7B%5C%28%5Cmathbb%7BC%7D%5C%29%7D%7BComplex+numbers%7D%0A%5Cnomenclature%5BN%5D%7B%5C%28%5Cmathbb%7BH%7D%5C%29%7D%7BQuaternions%7D%0A%5Cnomenclature%5BO%5D%7B%5C%28V%5C%29%7D%7BConstant+volume%7D%0A%5Cnomenclature%5BO%5D%7B%5C%28%5Crho%5C%29%7D%7BFriction+index%7D%0A%0A%5Cprintnomenclature%0A%5Cend%7Bdocument%7D)

![Nomenclatures04OLV2.png](/files/TBfgg61iyZGgktrXfneJ)

Some extra groups are added. The code for this is not that simple, it uses the command `\ifstrequal{}{}{}{}`, the first two arguments are the strings to compare, if they are equal the term is added to the group, otherwise the next nested condition is checked.

Notice that now each `\nomenclature` command has an additional argument, the prefix, inside brackets; which is used in the grouping code.

If `etoolbox` is not available one can use the `ifthen` package instead, which provides the conditional `\ifthenelse{}{}{}`, but the syntax is slightly more complex:

```latex
\usepackage{ifthen}
  \renewcommand{\nomgroup}[1]{%
  \item[\bfseries
  \ifthenelse{\equal{#1}{P}}{Physics constants}{%
  \ifthenelse{\equal{#1}{O}}{Other symbols}{%
  \ifthenelse{\equal{#1}{N}}{Number sets}{}}}%
  ]}
```

This will produce the same nomenclature groups.

## Adding units for physical constants

Another interesting feature is using the `siunitx` package to add units, aligning them to the right of the corresponding entries. For this, one has to define the `nomunit` macro as shown in the following example:

```latex
\documentclass{article}
\usepackage{amssymb}
\usepackage{nomencl}
\usepackage{siunitx}
\usepackage{hyperref}
\makenomenclature
\hypersetup{
    colorlinks=true,
    urlcolor=blue,
}
%% This will add the subgroups
%----------------------------------------------
\usepackage{etoolbox}
\renewcommand\nomgroup[1]{%
  \item[\bfseries
  \ifstrequal{#1}{A}{Physics Constants}{%
  \ifstrequal{#1}{B}{Number Sets}{%
  \ifstrequal{#1}{C}{Other Symbols}{}}}%
]}
%----------------------------------------------

%% This will add the units
%----------------------------------------------
\newcommand{\nomunit}[1]{%
\renewcommand{\nomentryend}{\hspace*{\fill}#1}}
%----------------------------------------------

\title{Nomenclatures Example}
\author{Overleaf Team}
\date{\today}

\begin{document}
\maketitle

\noindent This is an example to show how the \texttt{nomencl} package works, with units typeset via the \texttt{siunitx} package. \href{https://www.nist.gov/pml/fundamental-physical-constants}{NIST} was referenced to provide the values of physical constants, and their corresponding units---links are provided via the \texttt{hyperref} package:

\nomenclature[A, 02]{\(c\)}{\href{https://physics.nist.gov/cgi-bin/cuu/Value?c}
{Speed of light in a vacuum}
\nomunit{\SI{299792458}{\meter\per\second}}}
\nomenclature[A, 03]{\(h\)}{\href{https://physics.nist.gov/cgi-bin/cuu/Value?h}
{Planck constant}
\nomunit{\SI[group-digits=false]{6.62607015e-34}{\joule\per\hertz}}}
\nomenclature[A, 01]{\(G\)}{\href{https://physics.nist.gov/cgi-bin/cuu/Value?bg}
{Gravitational constant}
\nomunit{\SI[group-digits=false]{6.67430e-11}{\meter\cubed\per\kilogram\per\second\squared}}}
\nomenclature[B, 03]{\(\mathbb{R}\)}{Real numbers}
\nomenclature[B, 02]{\(\mathbb{C}\)}{Complex numbers}
\nomenclature[B, 01]{\(\mathbb{H}\)}{Quaternions}
\nomenclature[C]{\(V\)}{Constant volume}
\nomenclature[C]{\(\rho\)}{Friction index}

\printnomenclature

\end{document}
```

[Open in Overleaf (example using `nomencl` and `siunitx` packages).](/latex/document-structure/06-nomenclatures.md)

![Nomcomplex.png](/files/A5oKuj4Hw84F7NOhDy42)

## Sorting the Entries

This is the default sorting order:

```latex
\documentclass{article}
\usepackage{nomencl}

\makenomenclature

\begin{document}
Here is an example:

\nomenclature{\(+a\)}{Operator}
\nomenclature{\(2a\)}{Number}
\nomenclature{\(:a\)}{Punctuation symbol}
\nomenclature{\(Aa\)}{Uppercase letter}
\nomenclature{\(aa\)}{Lowercase letter}
\nomenclature{\(\alpha\)}{Greek character}

\printnomenclature

\end{document}
```

[Open this `nomencl` example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=nomencl+default+sort+order\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bnomencl%7D%0A%0A%5Cmakenomenclature%0A%0A%5Cbegin%7Bdocument%7D%0AHere+is+an+example%3A%0A%0A%5Cnomenclature%7B%5C%28%2Ba%5C%29%7D%7BOperator%7D%0A%5Cnomenclature%7B%5C%282a%5C%29%7D%7BNumber%7D%0A%5Cnomenclature%7B%5C%28%3Aa%5C%29%7D%7BPunctuation+symbol%7D%0A%5Cnomenclature%7B%5C%28Aa%5C%29%7D%7BUppercase+letter%7D%0A%5Cnomenclature%7B%5C%28aa%5C%29%7D%7BLowercase+letter%7D%0A%5Cnomenclature%7B%5C%28%5Calpha%5C%29%7D%7BGreek+character%7D%0A%0A%5Cprintnomenclature%0A%0A%5Cend%7Bdocument%7D)

![Nomenclatures05OLV2.png](/files/0baCQLGVtFDlsE3tqOwB)

Notice that the Greek character showed up before the alphabetic characters because of the backslash `\` in `\alpha`.

Just like for grouping, it is possible to use a prefix to manually sort the nomenclature entries:

```latex
\documentclass{article}
\usepackage{nomencl}

\makenomenclature

\begin{document}
Here is an example:

\nomenclature[06]{\(+a\)}{Operator}
\nomenclature[03]{\(2a\)}{Number}
\nomenclature[05]{\(:a\)}{Punctuation symbol}
\nomenclature[04]{\(Aa\)}{Uppercase letter}
\nomenclature[01]{\(aa\)}{Lowercase letter}
\nomenclature[02]{\(\alpha\)}{Greek character}

\printnomenclature

\end{document}
```

[Open this `nomencl` example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Sorting+nomencl+entries\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bnomencl%7D%0A%0A%5Cmakenomenclature%0A%0A%5Cbegin%7Bdocument%7D%0AHere+is+an+example%3A%0A%0A%5Cnomenclature%5B06%5D%7B%5C%28%2Ba%5C%29%7D%7BOperator%7D%0A%5Cnomenclature%5B03%5D%7B%5C%282a%5C%29%7D%7BNumber%7D%0A%5Cnomenclature%5B05%5D%7B%5C%28%3Aa%5C%29%7D%7BPunctuation+symbol%7D%0A%5Cnomenclature%5B04%5D%7B%5C%28Aa%5C%29%7D%7BUppercase+letter%7D%0A%5Cnomenclature%5B01%5D%7B%5C%28aa%5C%29%7D%7BLowercase+letter%7D%0A%5Cnomenclature%5B02%5D%7B%5C%28%5Calpha%5C%29%7D%7BGreek+character%7D%0A%0A%5Cprintnomenclature%0A%0A%5Cend%7Bdocument%7D)

![Nomenclatures06OLV2.png](/files/UtIVVdGnq6f5oJVdcmOM)

The number inside the brackets determines the order to print the corresponding symbol. One can also combine grouping and manually sorting:

```latex
\documentclass{article}
\usepackage{amssymb}
\usepackage{nomencl}
\makenomenclature

\usepackage{etoolbox}
\renewcommand\nomgroup[1]{%
  \item[\bfseries
  \ifstrequal{#1}{A}{Physics Constants}{%
  \ifstrequal{#1}{B}{Number Sets}{%
  \ifstrequal{#1}{C}{Other Symbols}{}}}%
]}

\begin{document}
Here is an example:

\nomenclature[A, 02]{\(c\)}{Speed of light in a vacuum}
\nomenclature[A, 03]{\(h\)}{Planck constant}
\nomenclature[A, 01]{\(G\)}{Gravitational constant}
\nomenclature[B, 03]{\(\mathbb{R}\)}{Real numbers}
\nomenclature[B, 02]{\(\mathbb{C}\)}{Complex numbers}
\nomenclature[B, 01]{\(\mathbb{H}\)}{Octonions}
\nomenclature[C]{\(V\)}{Constant volume}
\nomenclature[C]{\(\rho\)}{Friction index}

\printnomenclature

\end{document}
```

[Open this `nomencl` example in Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Grouping+and+sorting+with+nomencl\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamssymb%7D%0A%5Cusepackage%7Bnomencl%7D%0A%5Cmakenomenclature%0A%0A%5Cusepackage%7Betoolbox%7D%0A%5Crenewcommand%5Cnomgroup%5B1%5D%7B%25%0A++%5Citem%5B%5Cbfseries%0A++%5Cifstrequal%7B%231%7D%7BA%7D%7BPhysics+Constants%7D%7B%25%0A++%5Cifstrequal%7B%231%7D%7BB%7D%7BNumber+Sets%7D%7B%25%0A++%5Cifstrequal%7B%231%7D%7BC%7D%7BOther+Symbols%7D%7B%7D%7D%7D%25%0A%5D%7D%0A%0A%5Cbegin%7Bdocument%7D%0AHere+is+an+example%3A%0A%0A%5Cnomenclature%5BA%2C+02%5D%7B%5C%28c%5C%29%7D%7BSpeed+of+light+in+a+vacuum%7D%0A%5Cnomenclature%5BA%2C+03%5D%7B%5C%28h%5C%29%7D%7BPlanck+constant%7D%0A%5Cnomenclature%5BA%2C+01%5D%7B%5C%28G%5C%29%7D%7BGravitational+constant%7D%0A%5Cnomenclature%5BB%2C+03%5D%7B%5C%28%5Cmathbb%7BR%7D%5C%29%7D%7BReal+numbers%7D%0A%5Cnomenclature%5BB%2C+02%5D%7B%5C%28%5Cmathbb%7BC%7D%5C%29%7D%7BComplex+numbers%7D%0A%5Cnomenclature%5BB%2C+01%5D%7B%5C%28%5Cmathbb%7BH%7D%5C%29%7D%7BOctonions%7D%0A%5Cnomenclature%5BC%5D%7B%5C%28V%5C%29%7D%7BConstant+volume%7D%0A%5Cnomenclature%5BC%5D%7B%5C%28%5Crho%5C%29%7D%7BFriction+index%7D%0A%0A%5Cprintnomenclature%0A%0A%5Cend%7Bdocument%7D)

![Nomenclatures07OLV2.png](/files/RdNVlC6mgkPtBQf9MBbh)

Notice that the capital letters used for grouping are different from the ones used in the example at previous section, because that letter is used to sort the groups.

## Further Reading

For more information see:

* [Glossaries](/latex/document-structure/05-glossaries.md)
* [Multi-file LaTeX projects](/latex/document-structure/08-multi-file-latex-projects.md)
* [Text alignment](/latex/formatting/06-text-alignment.md)
* [Bold, italics and underlining](/latex/latex-basics/03-bold-italics-and-underlining.md)
* [Mathematical expressions](/latex/mathematics/01-mathematical-expressions.md)
* [Creating and Redefining Macros](/latex/commands/01-commands.md)
* [`nomencl` package documentation](http://mirror.jmu.edu/pub/CTAN/macros/latex/contrib/nomencl/nomencl.pdf)
* [`ifthen` package documentation](http://texdoc.net/texmf-dist/doc/latex/base/ifthen.pdf)
* [`etoolbox` package documentation](http://mirror.math.ku.edu/tex-archive/macros/latex/contrib/etoolbox/etoolbox.pdf)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/document-structure/06-nomenclatures.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
