summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glossaries-extra/glossaries-extra-manual-examples/glossaries-extra-manual-example117.tex
blob: 1af44967865e07b3e9429032fdf6af30a8a6b468 (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
% This file is embedded in glossaries-extra-manual.pdf
% Example 117 Alternatives to buffering
% Label: "ex:protectinnertextformat"
% arara: pdflatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage[T1]{fontenc}
\usepackage{soul}
\usepackage{glossaries-extra}


\newabbreviation{html}{HTML}{hypertext markup language}
% custom command to expand content before using \ul:
 \newrobustcmd{\xpul}[1]{\GlsXtrExpandedFmt{\ul}{#1}} 


\begin{document}
First approach (inner formatting):
{% scope
 \renewcommand{\glsxtrdefaultentrytextfmt}[1]{\ul{#1}}%
 \ul{Some text about \protect\gls{html}.
 Next use: \protect\gls{html}}
}


Next use: \gls{html}.


Second approach (middle formatting with expanded link text):
\glsresetall
{% scope
 \renewcommand{\glsxtrabbreviationfont}[1]{\xpul{#1}}%
 \renewcommand{\glsxtrregularfont}[1]{\xpul{#1}}%
 \ul{Some text about \protect\gls{html}. Next use: \gls{html}.}
} 

Next use: \gls{html}. 
\end{document}