File: glossaries-extra-manual-example097.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 (36 lines) | stat: -rw-r--r-- 1,394 bytes parent folder | download
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
% This file is embedded in glossaries-extra-manual.pdf
% Example 97 Link text styles: outer, middle, inner, hyperlinks and post-link hooks (custom and abbreviation style)
% arara: pdflatex
% arara: pdfcrop
\documentclass[14pt]{extarticle}
\pagestyle{empty}
 \usepackage{courier}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage{soul}
\usepackage[colorlinks]{hyperref}
\usepackage[nogroupskip]{glossaries-extra}
% outer formatting:
\renewcommand{\glstextformat}[1]{\texttt{#1}}
% middle formatting:
\renewcommand{\glsxtrregularfont}[1]{\textbf{#1}}
\renewcommand{\glsxtrabbreviationfont}[1]{\textit{#1}}
% inner formatting:
\renewcommand{\glsxtrdefaultentrytextfmt}[1]{\hl{#1}}
% post-link hook for 'general' category:
\glsdefpostlink{general}{\glsxtrifwasfirstuse{ (\glsentrydesc{\glslabel})}{}}
% this style sets the post-link hook for 'abbreviation' category:
\setabbreviationstyle{long-postshort-user}
% this style sets the post-link hook for 'acronym' category:
\setabbreviationstyle[acronym]{short-postfootnote}
% define entries:
\newglossaryentry{sample}{name={sample},description={an example}}
\newabbreviation{html}{HTML}{hypertext markup language}
\newacronym{nasa}{NASA}{National Aeronautics and Space Administration} 
\begin{document}
 First use: \gls{sample}, \gls{html}, \gls{nasa}. 

Next use: \gls{sample}, \gls{html}, \gls{nasa}. 

\printunsrtglossaries 
\end{document}