Debian Codegraph @

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

raw
1 % This file is public domain
2 % If you want to use 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#sampleaccsupp
8 %
9 % Note that this document isn't fully accessible as it's not tagged.
10 % See the accessibility or tagpdf packages for examples of how to tag the document.
11 \documentclass[a4paper]{article}
12
13 \usepackage[includemp,marginpar=1.5in,textwidth=5in]{geometry}
14 \usepackage{graphicx}
15 % use debug=showaccsupp to show replacement text in the margin
16 \usepackage[acronym]{glossaries-accsupp}
17
18 \makeglossaries
19
20 \setacronymstyle{long-short}
21
22 % These will use 'ActualText' rather than 'E' because the
23 % abbreviation is in the 'name' field.
24 \newglossaryentry{Doctor}{name=Dr,description={Doctor},access={Doctor}}
25
26 \newglossaryentry{Drive}{name={Dr.},description={Drive},access={Drive},
27 plural={Drvs}}
28
29 % These will use 'E'
30 \newacronym{eg}{e.g.}{for example}
31
32 \newacronym[shortaccess={TiKZ ist kein Zeichenprogramm}]
33 {tikz}{Ti\emph{k}Z}{Ti\emph{k}Z ist \emph{kein} Zeichenprogramm}
34
35
36 % The symbol key needs to use 'ActualText' but the replacement text
37 % needs to be supplied as the hexadecimal character code.
38
39 \newcommand{\glssymbolaccsupp}[2]{%
40 \glsaccessibility[method=hex,unicode]{ActualText}{#1}{#2}%
41 }
42
43 \newglossaryentry{int}{name={int},description={integral},
44 symbol={\ensuremath{\int}},symbolaccess={222B}
45 }
46
47 % The user1 key needs to use 'Alt':
48 \newcommand{\glsuseriaccsupp}[2]{%
49 \glsaccessibility{Alt}{#1}{#2}%
50 }
51
52 \newglossaryentry{sampleimage}{name={sample image},
53 description={an example image},
54 % \protect is needed unless \glsnoexpandfields has been used
55 user1={\protect\includegraphics[height=20pt]{example-image}},
56 user1access={a boilerplate image used in examples}
57 }
58
59 \begin{document}
60
61 \section{General Terms}
62
63 Testing general terms that are really abbreviations.
64
65 \gls{Doctor} Smith lives at 2, Blueberry \gls{Drive}
66
67 \section{Symbols and Images}
68
69 Symbol: \glssymbol{int} (\gls{int}).
70
71 Image: \glsuseri{sampleimage} (\gls{sampleimage}).
72
73 \section{Abbreviations}
74
75 First use: \gls{eg}, \gls{tikz}.
76
77 Next use: \gls{eg}, \gls{tikz}.
78
79 Short: \acrshort{eg}, \acrshort{tikz}.
80
81 Long: \acrlong{eg}, \acrlong{tikz}.
82
83 Full: \acrfull{eg}, \acrfull{tikz}.
84
85 \printglossaries
86 \end{document}