summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries/glossaries-user-examples/glossaries-user-example002.tex
blob: f01559acdc36c0eb4f35a57c94bffb0d9f423af8 (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
% This file is embedded in glossaries-user.pdf 
% Example 2 Simple document with unsorted glossaries
% Label: "ex:simpleunsrt"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage[ sort=none,% no sorting or indexing required
 abbreviations,% create list of abbreviations
 symbols,% create list of symbols
 postdot, % append a full stop after the descriptions
 stylemods,style=index % set the default glossary style
 ]{glossaries-extra} 

\newglossaryentry % glossaries.sty
\par {cafe}% label
 {% definition:
 name={café},
 description={small restaurant selling refreshments}
} 

\setabbreviationstyle{long-short}% glossaries-extra.sty
\par \newabbreviation % glossaries-extra.sty
\par {html}% label
 {HTML}% short form
 {hypertext markup language}% long form
 % requires glossaries-extra.sty 'symbols' option
\par  \glsxtrnewsymbol [description={Archimedes' constant}]% options
 {pi}% label
 {\ensuremath{\pi}}% symbol
 % This is a trivial example. For a real document I recommend you use siunitx for units
 \newglossaryentry % glossaries.sty
\par {distance}% label
 {% definition:
 name={distance}, description={the length between two points}, symbol={m} } 
\begin{document}
First use: \gls{cafe}, \gls{html}, \gls{pi}. Next use: \gls{cafe}, \gls{html}, \gls{pi}. 

\Gls{distance} is measured in \glssymbol{distance}.
\printunsrtglossaries % list all defined entries
 
\end{document}