28

Is there any way to have hyperlinks to the glossaries/acronyms (using glossaries package) in only one direction? What I want is a link to the page where an acronym is used, in the list of acronyms. But I would like to disable the links to the page of the list acronyms, which are currently everywhere an acronym is used.

I was not able to find an answer after trying a lot of things. Is there any other way than to add an asterisk at every reference? Any help is appreciated!

EDIT: MWE as suggested (reference: How to combine Acronym and Glossary)

\documentclass{article}
\usepackage{hyperref}
\usepackage[acronym]{glossaries}
\makeglossaries

\newacronym{cd}{CD}{compact disk}

\begin{document}
\noindent
First use \gls{cd}\\
subsequent \gls{cd}

\printglossaries

\end{document}

enter image description here

What I want would look like this:

enter image description here

A similar question is unanswered here: Disable hyperlinks in some entries for glossaries

David Carlisle
  • 757,742
RLOA
  • 403
  • 3
    Use \gls[hyper=false]{cd} or \gls*{cd}. – cgnieder Sep 23 '12 at 14:52
  • Thanks cgnieder! Is there any other way than to edit every reference with an asterisk? – RLOA Sep 23 '12 at 14:58
  • 8
    There is \glsdisablehyper. Just add that to your preabmle after \usepackage{glossaries} – cgnieder Sep 23 '12 at 15:14
  • is there a way to to create the hyperlink only for the first occurrence? I know, I can do it manually by using \gls{} first, and then only use the starred version. however, I want to avoid scanning my whole document manually and replace everything... – beta Feb 22 '16 at 21:33

1 Answers1

27

Putting my comments into an answer: the answer can be found in the user manual of glossaries. One can either turn off the hyperlinks of individual occurences by using \gls[hyper=false]{} or the shortcut \gls*{}. This is described in detail in section 6 “Links to Glossary Entries”.

If one wants to disable the links in general one can use the command \glsdisablehyper. (There is also \glsenablehyper which can be used to turn the links on again. Both commands act locally.) They are explaind in section 6.2 “Enabling and disabling hyperlinks to glossary entries”.

% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{article}
\usepackage{hyperref}
\usepackage[acronym]{glossaries}
\glsdisablehyper
\makeglossaries

\newacronym{cd}{CD}{compact disk}

\begin{document}
\noindent
First use \gls{cd} \\
subsequent \gls{cd} \\
linked {\glsenablehyper\gls{cd}} \\
not linked \gls{cd}

\printglossaries

\end{document}

enter image description here

cgnieder
  • 66,645
  • Thanks again cgnieder. I did go through the manual but misunderstood this command for disabling links in both ways. Hence never tried it. – RLOA Sep 23 '12 at 15:38
  • Sorry to reopen this but would any of you happen to know what mechanism is involved in the creation of such clickable boxes ? mine have completly dissapeared, I have no red box on the page number in the glossary nor with the actual word when I use \acrshrt{} – Maxime Bouhadana Jul 05 '22 at 10:36