Debian Codegraph @

texmf-dist/doc/latex/glossaries/samples/minimalgls.tex

raw
1 % This file is public domain.
2 %
3 % For further details about this file, see
4 %http://mirrors.ctan.org/macros/latex/contrib/glossaries/glossaries-user.html#minimalgls
5 %
6 % This is a minimal file for testing and debugging
7 % the glossaries package. Change the class file as
8 % desired, and add the relevant package options to
9 % both the class file and the glossaries package.
10 % Change the sample glossary entry and acronym if
11 % required. If the problem occurs with an additional
12 % glossary, add in the relevant \newglossary command
13 % and a sample entry.
14 %
15 % Only add extra packages or commands if they
16 % contribute to whatever problem you are trying to
17 % test.
18 %
19 % Remember that the document will not be complete
20 % until you have successfully completed all of the
21 % following steps:
22 % 1. latex minimalgls
23 % 2. makeglossaries minimalgls (note no extension)
24 % 3. latex minimalgls
25 %
26 % Alternatively:
27 % 1. latex minimalgls
28 % 2. makeglossaries-lite minimalgls (note no extension)
29 % 3. latex minimalgls
30 %
31 % A further run through LaTeX will be required to ensure that
32 % the table of contents is up to date if the toc option
33 % is used.
34 % Alternatively, if you use arara, you can add the following
35 % directives in your document:
36 %
37 % arara: pdflatex: { synctex: on }
38 % arara: makeglossaries
39 % arara: pdflatex: { synctex: on }
40 %
41 % (Alternatively replace "makeglossaries" with "makeglossaries-lite")
42
43 % If you require multilingual support you must also install
44 % the appropriate glossaries language module. The language
45 % modules are distributed separately.
46
47 \documentclass{article}
48 \listfiles
49
50 \usepackage[colorlinks]{hyperref}
51 \usepackage[
52 % acronym % make a separate list of acronyms
53 ]{glossaries}
54
55 \makeglossaries
56
57 \longnewglossaryentry{par}{name={par}}%
58 {%
59 A long description with a paragraph break.
60
61 This is the next paragraph.
62 }
63
64 \newglossaryentry{sample}{name={sample},
65 description={a sample entry}}
66
67 % set the acronym style:
68 \setacronymstyle{long-short}
69
70 % This contrived acronym has non-standard plural forms.
71 % These are specified in the optional argument.
72 % Remove the optional argument to revert to the default
73 % plurals.
74 \newacronym[shortplural=cas,longplural=contrived acronyms]{aca}{aca}{a contrived acronym}
75
76 % Keep all definitions in the preamble!
77
78 \begin{document}
79
80 A \gls{sample} entry and \gls{aca}. Second use: \gls{aca}.
81
82 Plurals: \glspl{sample}. Reset acronym\glsreset{aca}.
83 First use: \glspl{aca}. Second use: \glspl{aca}.
84
85 \glsresetall
86 First letter upper case: \Gls{sample}. First use: \Gls{aca}.
87 Subsequent use: \Gls{aca}.
88 \glsresetall
89 Plurals: \Glspl{sample}. First use: \Glspl{aca}. Next: \Glspl{aca}.
90
91 If you want paragraph breaks in the description use
92 \verb|\longnewglossaryentry|, as with entry \gls{par}.
93
94 Title case a particular field:
95 \glslink{sample}{\glsentrytitlecase{sample}{desc}}.
96
97 \printglossaries
98 \end{document}