% 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) % Label: "ex:linktextstylescustom" % 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}