Debian Codegraph @

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

raw
1 % arara: pdflatex
2 % arara: makeglossaries
3 % arara: pdflatex
4 % arara: pdflatex
5 \documentclass{report}
6
7 \usepackage[T1]{fontenc}% provide bold small caps
8 \usepackage[utf8]{inputenc}
9 \usepackage{slantsc}% provide slanted small caps
10 \usepackage[colorlinks]{hyperref}
11 \usepackage{glossaries-extra}
12
13 \makeglossaries
14
15 \setabbreviationstyle{long-short-sc}
16 \newabbreviation{html}{html}{hypertext markup language}
17
18 \newglossaryentry{sample}{name=sample,
19 description={an example}}
20
21 \pagestyle{headings}
22
23 % entries with the headuc attribute set to "true"
24 % will ensure the \glsfmttext etc commands use the
25 % upper case version in page headers.
26 \glssetcategoryattribute{general}{headuc}{true}
27
28 % This attribute isn't set for the "abbreviation" category
29 % which keeps the abbreviation as small caps in the header.
30
31 % Uncomment the following to set the attribute for the
32 % abbreviations as well:
33 %\glssetcategoryattribute{abbreviation}{headuc}{true}
34
35 \begin{document}
36 \begin{abstract}
37 This is a sample document that tests the use of entries
38 in sectioning commands through commands like \verb|\glsfmtshort|
39 and \verb|\glsfmttext|.
40 \end{abstract}
41
42 \tableofcontents
43
44 \chapter{\Glsfmttext{sample} Chapter with \glsfmtshort{html} Abbreviation}
45 \label{ch:sample}
46
47 First use: \gls{html}. Next use: \gls{html}.
48 Note that the \gls{sample} entry that occurs at the start of
49 the chapter title appears in lower case in the PDF bookmarks, since
50 the case-changing command can't be used there.
51
52 \newpage
53
54 Page break to test header.
55
56 \chapter{Another
57 \texorpdfstring{\Glsfmttext{sample}}{Sample}
58 Chapter with \glsfmtshort{html} Abbreviation}
59
60 The case-changing commands can't be used in PDF bookmarks,
61 so this chapter has used \verb|\texorpdfstring| to provide
62 an alternative for the PDF bookmark. The first chapter
63 (\nameref{ch:sample})
64 didn't do this so ``\Gls{sample}'' appeared in lower case in
65 the PDF bookmark.
66
67 \newpage
68
69 Page break to test header.
70
71 \printglossaries
72
73 \end{document}