Debian Codegraph @

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

raw
1 % arara: pdflatex
2 % arara: makeglossaries
3 % arara: pdflatex
4 \documentclass{article}
5
6 \usepackage[utf8]{inputenc}
7 \usepackage[T1]{fontenc}
8 \usepackage[xindy]{glossaries-extra}
9
10 \makeglossaries
11
12 % The starred version will attempt to allow UTF8 characters
13 % in the label, but this may fail!
14 \GlsXtrEnableOnTheFly*
15
16 \begin{document}
17 This is a \glsxtr{sample} document illustrating on-the-fly
18 simultaneous \glsxtr{definition} and \glsxtr{usage}
19 for \glsxtr[format=textbf][plural=glossaries]{glossary}
20 \glsxtrpl[][plural=entries]{entry}. This has
21 drawbacks and it's really much better to define entries in the
22 \glsxtr{preamble}, but you may find it useful for simple
23 indexing.
24
25 \newpage
26
27 \Glsxtr{preamble} \glsxtrpl{definition} are much better,
28 but here is a \glsxtr{sample} of what you can do.
29
30 \newpage
31 The \glsxtrpl{glossary} must come at the end of the document
32 with this usage.
33
34 \newpage
35 Commands can't occur in the label. The ``name'' key has to be
36 used instead, but the starred version of
37 \verb|\GlsXtrEnableOnTheFly| attempts to allow non-ASCII
38 characters in the label, but this may break some commands,
39 so take care!
40
41 The \glsxtr{naïve}
42 \glsxtr[][plural={phœnixes}]{phœnix} sent
43 off its \glsxtr{résumé} covered in
44 \glsxtr{pâté} from the \glsxtr{soirée}.
45
46 Terms that contain commands must have the ``name'' set and the
47 command removed from the label
48 \glsxtr[][name={\emph{e.g.}}]{eg} like this, but
49 really it's much better to define the entry in the preamble
50 and use the standard \verb|\gls| instead.
51
52 \newpage
53 The previous page presupposes the existence of
54 \glsxtrpl{phœnix}.
55
56 \newpage
57
58 \printglossaries
59
60 \end{document}