Debian Codegraph @

texmf-dist/doc/latex/glossaries/glossaries-user-examples/glossaries-user-example002.tex

raw
1 % This file is embedded in glossaries-user.pdf
2 % Example 2 Simple document with unsorted glossaries
3 % Label: "ex:simpleunsrt"
4 % arara: pdflatex
5 % arara: pdfcrop
6 \documentclass[12pt]{article}
7 \pagestyle{empty}
8 \usepackage[ sort=none,% no sorting or indexing required
9 abbreviations,% create list of abbreviations
10 symbols,% create list of symbols
11 postdot, % append a full stop after the descriptions
12 stylemods,style=index % set the default glossary style
13 ]{glossaries-extra}
14
15 \newglossaryentry % glossaries.sty
16 {cafe}% label
17 {% definition:
18 name={café},
19 description={small restaurant selling refreshments}
20 }
21
22 \setabbreviationstyle{long-short}% glossaries-extra.sty
23 \newabbreviation % glossaries-extra.sty
24 {html}% label
25 {HTML}% short form
26 {hypertext markup language}% long form
27 % requires glossaries-extra.sty 'symbols' option
28 \glsxtrnewsymbol [description={Archimedes' constant}]% options
29 {pi}% label
30 {\ensuremath{\pi}}% symbol
31 % This is a trivial example. For a real document I recommend you use siunitx for units
32 \newglossaryentry % glossaries.sty
33 {distance}% label
34 {% definition:
35 name={distance}, description={the length between two points}, symbol={m} }
36 \begin{document}
37 First use: \gls{cafe}, \gls{html}, \gls{pi}. Next use: \gls{cafe}, \gls{html}, \gls{pi}.
38
39 \Gls{distance} is measured in \glssymbol{distance}.
40 \printunsrtglossaries % list all defined entries
41
42 \end{document}