Debian Codegraph @

texmf-dist/doc/latex/glossaries-extra/samples/sample-onthefly.tex

raw
1 % arara: pdflatex
2 % arara: makeglossaries
3 % arara: pdflatex
4 \documentclass{article}
5
6 \usepackage{glossaries-extra}
7
8 \makeglossaries
9
10 \GlsXtrEnableOnTheFly
11
12 \begin{document}
13 This is a \glsxtr{sample} document illustrating on-the-fly
14 simultaneous \glsxtr{definition} and \glsxtr{usage}
15 for \glsxtr[format=textbf][plural=glossaries]{glossary}
16 \glsxtrpl[][plural=entries]{entry}. This has
17 drawbacks and it's really much better to define entries in the
18 \glsxtr{preamble}, but you may find it useful for simple
19 indexing.
20
21 \newpage
22
23 \Glsxtr{preamble} \glsxtrpl{definition} are much better,
24 but here is a \glsxtr{sample} of what you can do.
25
26 \newpage
27 The \glsxtrpl{glossary} must come at the end of the document
28 with this usage.
29
30 \newpage
31 Commands can't occur in the label. The ``name'' key has to be
32 used instead. Isn't this fiddly and not really worth the
33 effort. May as well just define all the \glspl{entry} in the
34 \glsxtr{preamble} instead.
35
36 The \glsxtr[][name={na\"{\i}ve}]{naive}
37 \glsxtr[][plural={ph\oe nixes},name={ph\oe nix}]{phoenix} sent
38 off its \glsxtr[][name={r\'esum\'e}]{resume} covered in
39 \glsxtr[][name={p\^at\'e}]{pate} from
40 the \glsxtr[][name={soir\'ee}]{soiree}.
41
42 \newpage
43 The previous page presupposes the existence of
44 \glsxtrpl{phoenix}.
45
46 \newpage
47
48 \printglossaries
49
50 \end{document}