Nomenclatures
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.
Introduction
Nomenclature entries work pretty much like index entries.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{nomencl}
\makenomenclature
\begin{document}
\mbox{}
\nomenclature{$c$}{Speed of light in a vacuum inertial frame}
\nomenclature{$h$}{Planck constant}
\printnomenclature
\end{document}
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.
Open an example of the nomencl package in Overleaf
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:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\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...
\clearpage
\mbox{}
\nomenclature{$c$}{Speed of light in a vacuum inertial frame}
\nomenclature{$h$}{Planck constant}
\printnomenclature
\end{document}
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
andukranian
.
Other useful features of the nomencl
package are the possibility of manually setting the nomenclature title, and adding an additional annotation.
\documentclass{article}
\usepackage[utf8]{inputenc}
\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}
\mbox{}
\nomenclature{$c$}{Speed of light in a vacuum inertial frame}
\nomenclature{$h$}{Planck constant}
\printnomenclature
\end{document}
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.
Open an example of the nomencl package in Overleaf
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.
\documentclass{article}
\usepackage[utf8]{inputenc}
\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}
\mbox{}
\nomenclature[P]{$c$}{Speed of light in a vacuum inertial system}
\nomenclature[P]{$h$}{Plank 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}
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 \nomenclture
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:
\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.
Open an example of the nomencl package in Overleaf
Sorting the Entries
This is the default sorting order:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{nomencl}
\makenomenclature
\begin{document}
\mbox{}
\nomenclature{$+a$}{Operator}
\nomenclature{$2a$}{Number}
\nomenclature{$:a$}{Punctuation Symbol}
\nomenclature{$Aa$}{Upper Case Letter}
\nomenclature{$aa$}{Lower Case Letter}
\nomenclature{$\alpha$}{Greek Character}
\printnomenclature
\end{document}
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:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{nomencl}
\makenomenclature
\begin{document}
\mbox{}
\nomenclature[06]{$+a$}{Operator}
\nomenclature[03]{$2a$}{Number}
\nomenclature[05]{$:a$}{Punctuation Symbol}
\nomenclature[04]{$Aa$}{Upper Case Letter}
\nomenclature[01]{$aa$}{Lower Case Letter}
\nomenclature[02]{$\alpha$}{Greek Character}
\printnomenclature
\end{document}
The number inside the brackets determines the order to print the corresponding symbol. One can also combine grouping and manually sorting:
\documentclass{article}
\usepackage[utf8]{inputenc}
\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}
\mbox{}
\nomenclature[A, 02]{$c$}{Speed of light in a vacuum inertial system}
\nomenclature[A, 03]{$h$}{Plank 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}
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.
Open an example of the nomencl package in Overleaf
Units
Another interesting feature is the possibility of adding units, aligned to the right of the corresponding entries. For this, one has to define the nomunit
macro:
\documentclass{article}
\usepackage[utf8]{inputenc}
\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}{}}}%
]}
% This will add the units
%----------------------------------------------
\newcommand{\nomunit}[1]{%
\renewcommand{\nomentryend}{\hspace*{\fill}#1}}
%----------------------------------------------
\begin{document}
\mbox{}
\nomenclature[A, 02]{$c$}{Speed of light in a vacuum inertial system
\nomunit{$299,792,458\, m/s$}}
\nomenclature[A, 03]{$h$}{Plank Constant
\nomunit{$6.62607 \times 10^{-34}\, Js$}}
\nomenclature[A, 01]{$g$}{Gravitational Constant
\nomunit{$6.67384 \times 10^{-11}\, N \cdot m^2/kg^2$}}
\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}
Once the macro is defined, one just have to use \nomunit{}
to add the corresponding units.
Open an example of the nomencl package in Overleaf
Further Reading
For more information see:
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Debugging Compilation timeout errors
- How-to guides
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Fractions and Binomials
- Aligning Equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
Figures and tables
- Inserting Images
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Bibliography management in LaTeX
- Bibliography management with biblatex
- Biblatex bibliography styles
- Biblatex citation styles
- Bibliography management with natbib
- Natbib bibliography styles
- Natbib citation styles
- Bibliography management with bibtex
- Bibtex bibliography styles
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections and equations
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in LaTeX
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
Fonts
Presentations
Commands
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typing exams in LaTeX
- Knitr
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class
- Tips