summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries-extra/sample-onthefly-utf8.tex
blob: 51b91b2530e765f45318653294858c2b875dbc55 (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
51
52
53
54
55
56
57
58
59
60
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[xindy]{glossaries-extra}

\makeglossaries

% The starred version will attempt to allow UTF8 characters
% in the label, but this may fail!
\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, but the starred version of
\verb|\GlsXtrEnableOnTheFly| attempts to allow non-ASCII 
characters in the label, but this may break some commands,
so take care! 

The \glsxtr{naïve} 
\glsxtr[][plural={phœnixes}]{phœnix} sent 
off its \glsxtr{résumé} covered in 
\glsxtr{pâté} from the \glsxtr{soirée}.

Terms that contain commands must have the ``name'' set and the 
command removed from the label 
\glsxtr[][name={\emph{e.g.}}]{eg} like this, but
really it's much better to define the entry in the preamble
and use the standard \verb|\gls| instead.

\newpage
The previous page presupposes the existence of 
\glsxtrpl{phœnix}.

\newpage

\printglossaries

\end{document}