summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries/samples/sampletree.tex
blob: dc8554504c8f61afbf5e3ef2a0beb2d1cd31a4d9 (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
% 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 }
%
%http://mirrors.ctan.org/macros/latex/contrib/glossaries/glossaries-user.html#sampletree
\documentclass{report}

\usepackage[colorlinks]{hyperref}
\usepackage[style=alttreehypergroup,nolong,nosuper]{glossaries}

% The alttree type of glossary styles need to know the
% widest entry name for each level
\glssetwidest{Roman letters} % level 0 widest name
\glssetwidest[1]{Sigma}      % level 1 widest name

\setglossarypreamble{This is a contrived example to demonstrate the
alttreehypergroup style.}

\makeglossaries

\newglossaryentry{greekletter}{name={Greek letters},
text={Greek letter},
description={\nopostdesc}}

\newglossaryentry{sigma}{name={Sigma},
text={\ensuremath{\Sigma}},
first={\ensuremath{\Sigma} (uppercase sigma)},
description={Used to indicate summation},
parent=greekletter}

\newglossaryentry{pi}{name={pi},
text={\ensuremath{\pi}},
first={\ensuremath{\pi} (lowercase pi)},
description={Transcendental number},
parent=greekletter}

\newglossaryentry{romanletter}{name={Roman letters},
text={Roman letter},
description={\nopostdesc}}

\newglossaryentry{e}{name={e},
description={Unique real number such that the derivative of
the function $e^x$ is the function itself},
parent=romanletter}

\newglossaryentry{C}{name={C},
description={Euler's constant},
parent=romanletter}

\begin{document}
This is a sample document illustrating hierarchical glossary
entries.

\chapter{Greek Letters Used in Mathematics}

Some information about \glspl{greekletter}.
The letter \gls{pi} is used to represent the ratio of a circle's
circumference to its diameter.
The letter \gls{sigma} is used to represent summation.

\chapter{Roman Letters Used in Mathematics}

Some information about \glspl{romanletter}.
The letter \gls{e} is the unique real number such that
the derivative of the function $e^x$ is the function itself.
The letter \gls{C} represents Euler's constant.

\printglossaries

\end{document}