Debian Codegraph @

texmf-dist/doc/latex/glossaries/samples/sample-noidxapp.tex

raw
1 % This file is public domain
2 % If you want to use arara, you need the following directives:
3 % arara: pdflatex
4 % arara: pdflatex
5 %
6 %http://mirrors.ctan.org/macros/latex/contrib/glossaries/glossaries-user.html#sample-noidxapp
7 \documentclass{report}
8
9 \usepackage[colorlinks]{hyperref}
10 \usepackage[index,symbols,nohypertypes={index}]{glossaries}
11 \usepackage{glossary-mcols}
12
13 \makenoidxglossaries
14
15 \renewcommand{\theHequation}{\theequation}
16
17 % main entries
18
19 \newglossaryentry{elite}{%
20 % With old LaTeX kernels and old versions of glossaries.sty and
21 % mfirstuc.sty, it was necessary to group the first letter if
22 % it isn't a single character in order for the sentence-case commands
23 % (\Gls etc) to work.
24 name={{\'e}lite}, % mfirstuc.sty v2.07 and lower
25 %name={\'elite},% mfirstuc.sty v2.08+
26 description={select group of people}
27 }
28
29 \newglossaryentry{elephant}{%
30 name={elephant},
31 description={very large mammal with tusks}
32 }
33
34 \newglossaryentry{elk}{%
35 name={elk},
36 description={large northern deer}
37 }
38
39 \newglossaryentry{emigre}{%
40 name={{\'e}migr\'e},
41 description={person who has emigrated to another country,
42 especially for political reasons}
43 }
44
45 % Symbols
46
47 \newglossaryentry{set}{%
48 type=symbols,
49 name={$\mathcal{S}$},
50 text={\mathcal{S}},
51 sort={S},
52 description={A set}}
53
54 \newglossaryentry{U}{%
55 type=symbols,
56 name={$\mathcal{U}$},
57 text={\mathcal{U}},
58 sort={U},
59 description={The universal set}}
60
61 \newglossaryentry{card}{%
62 type=symbols,
63 name={$|\glsentrytext{set}|$},
64 text={|\glsentrytext{set}|},
65 sort={|},
66 description={cardinality of $\gls{set}$}}
67
68 \newglossaryentry{factorial}{%
69 type=symbols,
70 name={$!$},
71 text={!},
72 sort={!},
73 description={factorial}}
74
75 % index entries
76
77 \newterm{seal}
78
79 \newterm{dinosaur}
80
81 \newterm[parent=dinosaur]{ceratopsidae}
82
83 \newterm[parent=dinosaur,plural={stegosauruses}]{stegosaurus}
84 \newterm[parent=ceratopsidae,plural={triceratopses}]{triceratops}
85 \newterm[parent=ceratopsidae,plural={styracosauruses}]{styracosaurus}
86 \newterm[parent=dinosaur,plural={apatosauruses}]{apatosaurus}
87
88 \newterm{Triassic}
89
90 \newterm{Devonian}
91
92 \newterm[see={[see also]seal}]{sea lion}
93
94 \begin{document}
95
96 \chapter{Mathematical Notation}
97
98 The cardinality of a set $\gls{set}$ is denoted $\gls{card}$
99 The $\gls{factorial}$ symbol indicates factorial.
100 $\gls{U}$ is the universal set.
101
102 \glsaddall[types=main]
103
104 \chapter{Dinosaurs}
105
106 \Glspl{dinosaur} are now extinct. They first appeared during the
107 \gls{Triassic} period. Examples of \glspl{dinosaur} include the
108 \gls{triceratops}, the \gls{styracosaurus}, the \gls{apatosaurus} and the \gls{stegosaurus}.
109
110 \Glspl{seal} and \glspl{sea lion} are marine mammals.
111 The \gls{Devonian} period was the age of fish.
112
113 \glsaddall[types=main]
114
115 \chapter{Location Lists}
116
117 Dinosaur: \glsdisplaynumberlist{dinosaur}.
118
119 Set: \glsdisplaynumberlist{set}.
120
121 \Gls{elite}: \glsdisplaynumberlist{elite}.
122
123 \begin{equation}
124 3\gls[counter=equation]{factorial} = 3 \times 2 \times 1
125 \end{equation}
126
127 \newcommand{\myhandler}[4]{%
128 Prefix: #1.
129 Counter: #2.
130 Format: #3.
131 Value: #4.
132 Link: \setentrycounter[#1]{#2}%
133 \csuse{#3}{#4}.
134 \par
135 }
136 \newcommand{\myxrhandler}[2][]{XR (#1): #2. }
137
138 Factorial locations:
139 \glsnumberlistloop{factorial}{\myhandler}{\myxrhandler}
140
141 Sea lion locations:
142 \glsnumberlistloop{sea lion}{\myhandler}{\myxrhandler}
143
144 \printnoidxglossary[type=main,sort=word]
145
146 \printnoidxglossary[type=symbols,sort=use]
147
148 \renewcommand*{\glsnamefont}[1]{\textmd{#1}}
149
150 \printnoidxglossary[type=index,style=mcolindexgroup,sort=letter]
151
152 \end{document}