blob: 4b004c02458b25650ccea8304f6e2e4e8f7ce0cd (
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
61
62
63
64
65
66
67
68
69
70
71
72
73
|
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
% arara: pdflatex
\documentclass{report}
\usepackage[T1]{fontenc}% provide bold small caps
\usepackage[utf8]{inputenc}
\usepackage{slantsc}% provide slanted small caps
\usepackage[colorlinks]{hyperref}
\usepackage{glossaries-extra}
\makeglossaries
\setabbreviationstyle{long-short-sc}
\newabbreviation{html}{html}{hypertext markup language}
\newglossaryentry{sample}{name=sample,
description={an example}}
\pagestyle{headings}
% entries with the headuc attribute set to "true"
% will ensure the \glsfmttext etc commands use the
% upper case version in page headers.
\glssetcategoryattribute{general}{headuc}{true}
% This attribute isn't set for the "abbreviation" category
% which keeps the abbreviation as small caps in the header.
% Uncomment the following to set the attribute for the
% abbreviations as well:
%\glssetcategoryattribute{abbreviation}{headuc}{true}
\begin{document}
\begin{abstract}
This is a sample document that tests the use of entries
in sectioning commands through commands like \verb|\glsfmtshort|
and \verb|\glsfmttext|.
\end{abstract}
\tableofcontents
\chapter{\Glsfmttext{sample} Chapter with \glsfmtshort{html} Abbreviation}
\label{ch:sample}
First use: \gls{html}. Next use: \gls{html}.
Note that the \gls{sample} entry that occurs at the start of
the chapter title appears in lower case in the PDF bookmarks, since
the case-changing command can't be used there.
\newpage
Page break to test header.
\chapter{Another
\texorpdfstring{\Glsfmttext{sample}}{Sample}
Chapter with \glsfmtshort{html} Abbreviation}
The case-changing commands can't be used in PDF bookmarks,
so this chapter has used \verb|\texorpdfstring| to provide
an alternative for the PDF bookmark. The first chapter
(\nameref{ch:sample})
didn't do this so ``\Gls{sample}'' appeared in lower case in
the PDF bookmark.
\newpage
Page break to test header.
\printglossaries
\end{document}
|