Debian Codegraph @

texmf-dist/doc/latex/glossaries/samples/sample-newkeys.tex

raw
1 % This file is public domain
2 % If you are using arara, you need the following directives:
3 % arara: pdflatex: { synctex: on }
4 % arara: makeglossaries
5 % arara: pdflatex: { synctex: on }
6 %
7 %http://mirrors.ctan.org/macros/latex/contrib/glossaries/glossaries-user.html#sample-newkeys
8 \documentclass{article}
9
10 \usepackage[colorlinks]{hyperref}
11 \usepackage[nopostdot,nogroupskip]{glossaries}
12
13 \glsaddkey*% star version needed as default value needs expanding
14 {ed}% key
15 {\glsentrytext{\glslabel}ed}% default value
16 {\glsentryed}% command analogous to \glsentrytext
17 {\Glsentryed}% command analogous to \Glsentrytext
18 {\glsed}% command analogous to \glstext
19 {\Glsed}% command analogous to \Glstext
20 {\GLSed}% command analogous to \GLStext
21
22 \glsaddkey*
23 {ing}% key
24 {\glsentrytext{\glslabel}ing}% default value
25 {\glsentrying}% command analogous to \glsentrytext
26 {\Glsentrying}% command analogous to \Glsentrytext
27 {\glsing}% command analogous to \glstext
28 {\Glsing}% command analogous to \Glstext
29 {\GLSing}% command analogous to \GLStext
30
31
32 \makeglossaries
33
34 \newglossaryentry{jump}{name={jump},description={}}
35
36 \newglossaryentry{run}{name={run},%
37 ed={ran},%
38 ing={running},
39 description={}}
40
41 \newglossaryentry{waddle}{name={waddle},%
42 ed={waddled},%
43 ing={waddling},%
44 description={}}
45
46 \begin{document}
47
48 This is a sample document illustrating how to add new glossary entry
49 keys.
50
51 The dog \glsed{jump} over the duck.
52
53 The duck was \glsing{waddle} round the dog.
54
55 The dog \glsed{run} away from the duck.
56
57 First letter uppercase: \Glsed{jump}, \Glsing{jump},
58 \Glsed{waddle}, \Glsing{waddle},
59 \Glsed{run}, \Glsing{run}.
60
61 All uppercase: \GLSed{jump}, \GLSing{jump},
62 \GLSed{waddle}, \GLSing{waddle},
63 \GLSed{run}, \GLSing{run}.
64
65 \printglossaries
66
67 \end{document}