summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries-extra/samples/sample-onthefly.tex
blob: 8431c6abe26f3821172ae075f23da60345cb1dc9 (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
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{article}

\usepackage{glossaries-extra}

\makeglossaries

\GlsXtrEnableOnTheFly

\begin{document}
This is a \glsxtr{sample} document illustrating on-the-fly
simultaneous \glsxtr{definition} and \glsxtr{usage}
for \glsxtr[format=textbf][plural=glossaries]{glossary} 
\glsxtrpl[][plural=entries]{entry}. This has 
drawbacks and it's really much better to define entries in the 
\glsxtr{preamble}, but you may find it useful for simple 
indexing.

\newpage

\Glsxtr{preamble} \glsxtrpl{definition} are much better,
but here is a \glsxtr{sample} of what you can do.

\newpage
The \glsxtrpl{glossary} must come at the end of the document 
with this usage.

\newpage
Commands can't occur in the label. The ``name'' key has to be
used instead. Isn't this fiddly and not really worth the
effort. May as well just define all the \glspl{entry} in the
\glsxtr{preamble} instead.

The \glsxtr[][name={na\"{\i}ve}]{naive} 
\glsxtr[][plural={ph\oe nixes},name={ph\oe nix}]{phoenix} sent 
off its \glsxtr[][name={r\'esum\'e}]{resume} covered in 
\glsxtr[][name={p\^at\'e}]{pate} from
the \glsxtr[][name={soir\'ee}]{soiree}.

\newpage
The previous page presupposes the existence of 
\glsxtrpl{phoenix}.

\newpage

\printglossaries

\end{document}