summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries/glossaries-user-examples/glossaries-user-example001.tex
blob: 11a689fbc9c9643c5670cb9b2162548d3ad654d5 (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
% This file is embedded in glossaries-user.pdf 
% Example 1 Simple document with no glossary
% Label: "ex:simplenogloss"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage[
 sort=none % no sorting or indexing required
 ] {glossaries} 

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

\setacronymstyle{long-short} \newacronym
{html}% label
 {HTML}% short form
 {hypertext markup language}% long form
 

\newglossaryentry
{pi}% label
 {% definition:
 name={\ensuremath{\pi}},
 description={Archimedes' Constant}
} 

% This is a trivial example. For a real document I recommend you use siunitx for units
 \newglossaryentry
 {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} (\glsentrydesc{distance}) is measured in \glssymbol{distance}. 
\end{document}