Debian Codegraph @

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

raw
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: makeglossaries
7 % arara: pdflatex: { synctex: on }
8 %
9 %http://mirrors.ctan.org/macros/latex/contrib/glossaries/glossaries-user.html#sample-index
10 \documentclass{report}
11
12 \usepackage[colorlinks]{hyperref}
13 \usepackage[toc,index,nohypertypes={index}]{glossaries}
14 \usepackage{glossary-mcols}
15
16 \makeglossaries
17
18 % define terms for the index
19
20 \newterm[plural={stegosauruses}]{stegosaurus}
21 \newterm[plural={triceratopses}]{triceratops}
22 \newterm[plural={apatosauruses}]{apatosaurus}
23
24 % To avoid labels conflicting with the same name in the main glossary
25 % prefix the index label with "ind-". (This means that the name must
26 % be set independently.)
27 \newterm[name={dinosaur}]{ind-dinosaur}
28 \newterm[name={Triassic}]{ind-triassic}
29
30 % define terms for the main glossary
31
32 \newglossaryentry{dinosaur}%
33 {%
34 name={dinosaur\glsadd{ind-dinosaur}},%
35 description={One of a group of dinosauria}%
36 }
37
38 \newglossaryentry{Triassic}%
39 {%
40 name={Triassic\glsadd{ind-triassic}},%
41 description={The first period of the Mesozoic Era}
42 }
43
44 \begin{document}
45 \tableofcontents
46
47 \chapter{Dinosaurs}
48
49 \Glspl{dinosaur} are now extinct. They first appeared during the
50 \gls{Triassic} period. Examples of \glspl{dinosaur} include the
51 \gls{triceratops}, the \gls{apatosaurus} and the \gls{stegosaurus}.
52
53 Indexed term: \gls{ind-dinosaur}.
54
55 \renewcommand*{\glsnamefont}[1]{\textbf{\makefirstuc{#1}}}
56
57 \printglossary[style=long,nogroupskip]
58
59 \renewcommand*{\glsnamefont}[1]{\textmd{#1}}
60
61 \printindex[style=mcolindexgroup]
62
63 \end{document}