summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries-extra/sample-trans.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-05-02 22:49:50 +0000
committerKarl Berry <karl@freefriends.org>2016-05-02 22:49:50 +0000
commitc970e86904ff1076f46506d6df9fa4a06a30ceab (patch)
treedefbd547d713da8ed65c879b7f4cdaa18b71df1e /Master/texmf-dist/doc/latex/glossaries-extra/sample-trans.tex
parent9d63d20b395741946482b9029e072ae7ebff21f0 (diff)
glossaries-extra (2may16)
git-svn-id: svn://tug.org/texlive/trunk@40839 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/glossaries-extra/sample-trans.tex')
-rw-r--r--Master/texmf-dist/doc/latex/glossaries-extra/sample-trans.tex54
1 files changed, 54 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/glossaries-extra/sample-trans.tex b/Master/texmf-dist/doc/latex/glossaries-extra/sample-trans.tex
new file mode 100644
index 00000000000..041dc24e48c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/glossaries-extra/sample-trans.tex
@@ -0,0 +1,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}
+