Debian Codegraph @

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

raw
1 % arara: pdflatex
2 % arara: makeglossaries
3 % arara: pdflatex
4 \documentclass{article}
5
6 \usepackage[T1]{fontenc}
7 \usepackage[colorlinks]{hyperref}
8 \usepackage[nogroupskip]{glossaries-extra}
9
10 \makeglossaries
11
12 \setabbreviationstyle[acronym]{long-short-user}
13
14 % Translations are stored in the user1 key in the sample file
15 % (loaded below).
16 % This is the default for the long-short-user style so
17 % \glsxtruserfield doesn't need changing, but let's illustrate
18 % changing the font style for the short form:
19
20 \renewcommand{\glsabbrvuserfont}[1]{\textsc{\MakeLowercase{#1}}}
21 \renewcommand*{\glsxtrusersuffix}{\glsxtrscsuffix}
22
23 \loadglsentries{example-glossaries-acronyms-lang}
24
25 % The entries in the above file are all defined using
26 % \newacronym, which automatically sets the category
27 % to "acronym" (which is why the abbreviation style needs
28 % to use "acronym" in the optional argument). The glossary
29 % can be adapted by using the post-description hook for this
30 % category.
31
32 % \glscurrentfieldvalue only works with glossaries v4.23 (and above)
33 \renewcommand{\glsxtrpostdescacronym}{%
34 \ifglshasfield{\glsxtruserfield}{\glscurrententrylabel}%
35 { (English: \glscurrentfieldvalue)}%
36 {}%
37 }
38
39 \begin{document}
40
41 \section{Sample}
42
43 First use:
44
45 \forglsentries{\thislabel}{\gls{\thislabel}. }
46
47 Next use:
48
49 \forglsentries{\thislabel}{\gls{\thislabel}. }
50
51 \printglossaries
52
53 \end{document}
54