Debian Codegraph @

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