summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries/samples/sample-index.tex
blob: c33ca87c1606402044c9bcc8ea0ddc6841417b15 (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
 % 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: makeglossaries
 % arara: pdflatex: { synctex: on }
\documentclass{report}

\usepackage[colorlinks]{hyperref}
\usepackage[toc]{glossaries}
\usepackage{glossary-mcols}

\newglossary[ilg]{index}{ind}{idx}{\indexname}

\makeglossaries

\newcommand*{\newterm}[2][]{%
  \newglossaryentry{#2}{type={index},name={#2},description={\nopostdesc},#1}%
}


\newterm[plural={stegosauruses}]{stegosaurus}
\newterm[plural={triceratopses}]{triceratops}
\newterm[plural={apatosauruses}]{apatosaurus}

\newterm[name={dinosaur}]{ind-dinosaur}
\newterm[name={Triassic}]{ind-triassic}


\newglossaryentry{dinosaur}%
{%
  name={dinosaur\glsadd{ind-dinosaur}},%
  description={One of a group of dinosauria}%
}

\newglossaryentry{Triassic}%
{%
  name={Triassic\glsadd{ind-triassic}},%
  description={The first period of the Mesozoic Era}
}

\begin{document}
\tableofcontents

\chapter{Dinosaurs}

\Glspl{dinosaur} are now extinct. They first appeared during the
\gls{Triassic} period. Examples of \glspl{dinosaur} include the
\gls{triceratops}, the \gls{apatosaurus} and the \gls{stegosaurus}.

\renewcommand*{\glsnamefont}[1]{\textbf{\makefirstuc{#1}}}

\printglossary[style=long,nogroupskip]

\renewcommand*{\glsnamefont}[1]{\textmd{#1}}

\printglossary[type=index,style=mcolindexgroup]

\end{document}