File: sample-trans.tex

package info (click to toggle)
texlive-extra 2022.20230122-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,466,588 kB
  • sloc: perl: 398,710; xml: 35,871; python: 29,125; cs: 25,850; sh: 17,610; makefile: 17,304; ansic: 15,490; java: 12,811; javascript: 9,898; lisp: 1,755; csh: 1,129; ruby: 1,072; awk: 151; tcl: 142; pascal: 138; cpp: 41; sed: 36; haskell: 5
file content (54 lines) | stat: -rw-r--r-- 1,367 bytes parent folder | download | duplicates (6)
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
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[colorlinks]{hyperref}
\usepackage[nogroupskip]{glossaries-extra}

\makeglossaries

\setabbreviationstyle[acronym]{long-short-user}

% Translations are stored in the user1 key in the sample file
% (loaded below).
% This is the default for the long-short-user style so
% \glsxtruserfield doesn't need changing, but let's illustrate
% changing the font style for the short form:

\renewcommand{\glsabbrvuserfont}[1]{\textsc{\MakeLowercase{#1}}}
\renewcommand*{\glsxtrusersuffix}{\glsxtrscsuffix}

\loadglsentries{example-glossaries-acronyms-lang}

% The entries in the above file are all defined using
% \newacronym, which automatically sets the category
% to "acronym" (which is why the abbreviation style needs
% to use "acronym" in the optional argument). The glossary
% can be adapted by using the post-description hook for this
% category.

% \glscurrentfieldvalue only works with glossaries v4.23 (and above)
\renewcommand{\glsxtrpostdescacronym}{%
 \ifglshasfield{\glsxtruserfield}{\glscurrententrylabel}%
 { (English: \glscurrentfieldvalue)}%
 {}%
}

\begin{document}

\section{Sample}

First use:

\forglsentries{\thislabel}{\gls{\thislabel}. }

Next use:

\forglsentries{\thislabel}{\gls{\thislabel}. }

\printglossaries

\end{document}