Debian Codegraph @

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

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