| 1 |
% This file is public domain |
| 2 |
% If you want to use arara, you need the following directives: |
| 3 |
% arara: pdflatex: { synctex: on } |
| 4 |
% arara: makeglossaries |
| 5 |
% arara: pdflatex: { synctex: on } |
| 6 |
% arara: pdflatex: { synctex: on } |
| 7 |
% |
| 8 |
%http://mirrors.ctan.org/macros/latex/contrib/glossaries/glossaries-user.html#sampleNtn |
| 9 |
\documentclass{report} |
| 10 |
|
| 11 |
% If you want to add babel to this document, you may have to |
| 12 |
% replace the : character in the labels if you are using a |
| 13 |
% language setting (e.g. french) that makes : active. |
| 14 |
|
| 15 |
\usepackage[plainpages=false,colorlinks]{hyperref} |
| 16 |
\usepackage[toc]{glossaries} |
| 17 |
|
| 18 |
% Define a new glossary type called notation |
| 19 |
\newglossary[nlg]{notation}{not}{ntn}{Notation} |
| 20 |
|
| 21 |
\makeglossaries |
| 22 |
|
| 23 |
% Notation definitions |
| 24 |
|
| 25 |
\newglossaryentry{not:set}{type=notation, % glossary type |
| 26 |
name={\ensuremath{\mathcal{S}}}, |
| 27 |
description={A \gls{gls:set}}, |
| 28 |
sort={S}} |
| 29 |
|
| 30 |
\newglossaryentry{not:U}{type=notation, |
| 31 |
name={\ensuremath{\mathcal{U}}}, |
| 32 |
description={The universal \gls{gls:set}}, |
| 33 |
sort=U} |
| 34 |
|
| 35 |
\newglossaryentry{not:card}{type=notation, |
| 36 |
name={\ensuremath{\mid\mathcal{S}\mid}}, |
| 37 |
description={The \gls{gls:card} of $\mathcal{S}$}, |
| 38 |
sort=cardinality} |
| 39 |
|
| 40 |
\newglossaryentry{not:fact}{type=notation, |
| 41 |
name={\ensuremath{!}}, |
| 42 |
description={factorial}, |
| 43 |
sort=factorial} |
| 44 |
|
| 45 |
% Main glossary definitions |
| 46 |
|
| 47 |
\newglossaryentry{gls:set}{name=set, |
| 48 |
description={A collection of distinct objects}} |
| 49 |
|
| 50 |
\newglossaryentry{gls:card}{name=cardinality, |
| 51 |
description={The number of elements in the specified set}} |
| 52 |
|
| 53 |
\begin{document} |
| 54 |
\title{Sample Document using the glossaries Package} |
| 55 |
\author{Nicola Talbot} |
| 56 |
\pagenumbering{alph} |
| 57 |
\maketitle |
| 58 |
|
| 59 |
\begin{abstract} |
| 60 |
%stop hyperref complaining about duplicate page identifiers: |
| 61 |
\pagenumbering{Alph} |
| 62 |
This is a sample document illustrating the use of the |
| 63 |
\textsf{glossaries} package. In this example, a new glossary type |
| 64 |
called \texttt{notation} is defined, so that the document can have a |
| 65 |
separate glossary of terms and index of notation. |
| 66 |
\end{abstract} |
| 67 |
|
| 68 |
|
| 69 |
\pagenumbering{roman} |
| 70 |
\tableofcontents |
| 71 |
|
| 72 |
\printglossaries |
| 73 |
|
| 74 |
\chapter{Introduction} |
| 75 |
\pagenumbering{arabic} |
| 76 |
|
| 77 |
\Glspl{gls:set} are denoted by a calligraphic font |
| 78 |
e.g.\ \gls{not:set}. |
| 79 |
|
| 80 |
Let \gls[format=hyperit]{not:U} denote the universal set. |
| 81 |
|
| 82 |
The \gls{gls:card} of a set $\mathcal{S}$ is denoted |
| 83 |
\gls{not:card}. |
| 84 |
|
| 85 |
\chapter{Another Chapter} |
| 86 |
|
| 87 |
Another mention of the universal set \gls{not:U}. |
| 88 |
|
| 89 |
The factorial symbol: \gls{not:fact}. |
| 90 |
|
| 91 |
\end{document} |