summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries/samples/sampleSort.tex
blob: 960dc22f0f08ed09af89169ceb99945a2969378e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
% This file is public domain
% If you want to use arara, you need the following directives:
% arara: pdflatex: { synctex: on }
% arara: makeglossaries
% arara: pdflatex: { synctex: on }
% arara: pdflatex: { synctex: on }
\documentclass{report}

% If you want to add babel to this document, you may have to
% replace the : character in the labels if you are using a 
% language setting (e.g. french) that makes : active.

\usepackage[plainpages=false,colorlinks]{hyperref}
\usepackage[toc,acronym]{glossaries}

% Define a new glossary type called notation
\newglossary[nlg]{notation}{not}{ntn}{Notation}

\makeglossaries

\newcounter{sortcount}

\renewcommand{\glsprestandardsort}[3]{%
  \ifdefstring{#2}{notation}%
  {%
     \stepcounter{sortcount}%
     \edef#1{\glssortnumberfmt{\arabic{sortcount}}}%
  }%
  {%
     \glsdosanitizesort
  }%
}

% Notation definitions

\newglossaryentry{not:set}{type=notation, % glossary type
name={$\mathcal{S}$},
text={\mathcal{S}},
description={A set}}

\newglossaryentry{not:emptyset}{type=notation,
name={$\emptyset$},
text={\emptyset},
description={The empty set}}

\newglossaryentry{not:card}{type=notation,
name={$|\mathcal{S}|$},
text={|\mathcal{S}|},
description={cardinality of $\mathcal{S}$}}

% Main glossary definitions

\newglossaryentry{gls:set}{name=set,
description={A collection of distinct objects}}

\newglossaryentry{gls:card}{name=cardinality,
description={The number of elements in the specified set}}

% Acronym definitions

\newacronym{zfc}{ZFC}{Zermelo-Fraenkel set theory}

\newacronym{ad}{AD}{axiom of determinacy}

\newacronym{nf}{NF}{new foundations}

\begin{document}
\title{Sample Document using the glossaries Package}
\author{Nicola Talbot}
\pagenumbering{alph}
\maketitle

\begin{abstract}
%stop hyperref complaining about duplicate page identifiers:
\pagenumbering{Alph}
This is a sample document illustrating the use of the
\textsf{glossaries} package.  In this example, a new glossary type
called \texttt{notation} is defined, so that the document can have a 
separate glossary of terms, list of acronyms and index of notation.
\end{abstract}


\pagenumbering{roman}
\tableofcontents

\printglossaries

\chapter{Introduction}
\pagenumbering{arabic}

\Glspl{gls:set} are denoted by a calligraphic font 
e.g.\ $\gls{not:set}$.

The \gls{gls:card} of a set $\mathcal{S}$ is denoted 
$\gls{not:card}$. The empty set is denoted
$\gls{not:emptyset}$.

Here are some acronyms: \gls{nf}, \gls{zfc} and \gls{ad}.

\chapter{Another Chapter}

Another mention of the empty set $\gls{not:emptyset}$.

Here are the acronyms again: \gls{nf}, \gls{zfc} and \gls{ad}.

\end{document}