summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries/samples/sample-nomathhyper.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/glossaries/samples/sample-nomathhyper.tex')
-rw-r--r--Master/texmf-dist/doc/latex/glossaries/samples/sample-nomathhyper.tex21
1 files changed, 8 insertions, 13 deletions
diff --git a/Master/texmf-dist/doc/latex/glossaries/samples/sample-nomathhyper.tex b/Master/texmf-dist/doc/latex/glossaries/samples/sample-nomathhyper.tex
index c1efc549d07..16cc511eee7 100644
--- a/Master/texmf-dist/doc/latex/glossaries/samples/sample-nomathhyper.tex
+++ b/Master/texmf-dist/doc/latex/glossaries/samples/sample-nomathhyper.tex
@@ -8,28 +8,22 @@
\usepackage[colorlinks]{hyperref}
\usepackage{glossaries}
-\makeglossaries
+\GlsDeclareNoHyperList{main}
- % switch off hyperlinks:
-\glsdisablehyper
+\makeglossaries
% redefine \glsentryfmt so that it adds a hyperlink
- % if not in math mode
+ % if not in math mode and the hyperlinks haven't been forced on
\renewcommand*{\glsentryfmt}{%
\ifmmode
\glsgenentryfmt
\else
- % Temporarily enable hyperlinks:
- \glsenablehyper
- \glshyperlink[\glsgenentryfmt]{\glslabel}%
- % Disable hyperlinks again
- \glsdisablehyper
+ \glsifhyperon
+ {\glsgenentryfmt}% hyperlink already on
+ {\glshyperlink[\glsgenentryfmt]{\glslabel}}%
\fi
}
-\renewcommand{\glossarypreamble}{\glsenablehyper}
-\renewcommand{\glossarypostamble}{\glsdisablehyper}
-
% define a sample entry:
\newglossaryentry{x}{name={x},description={sample entry}}
@@ -41,7 +35,8 @@ maths:
\gls{x}
\]
-Back to text mode again: \gls{x}.
+Back to text mode again: \gls{x}. Don't check the first use flag:
+\glstext{x}. Force on the hyperlink: \glstext+{x}.
\printglossaries
\end{document}