Is it possible to direct the hyperlink created by \gls{term}
to the first use of the term in the main text instead of the glossary list?
I'm writing a thesis that uses a lot of abbreviations, but I don't want to include a glossary list in the document. Rather, I'd like to define each abbreviation on first use but provide a hyperlink to the first use during all subsequent uses of the abbreviation. Is this possible?
The following is an example of the code I'm currently using to set-up the glossaries
and hyperref
packages and define a term:
\documentclass{report}
\usepackage[acronym,hyperfirst=false,nonumberlist,nowarn]{glossaries}
\usepackage[hidelinks]{hyperref}
...
\newacronym{FEA}{FEA}{Finite Element Analysis}
...
\begin{document}
...this includes a \gls{FEA} tool to... % first use of term
...the \gls{FEA} tool... % subsequent uses of term, want to hyperlink to first use above within PDF
\end{document}
Best Answer
I recommend you upgrade to the latest version of
glossaries
(v4.01 at time of writing) and try the following:I've used the
colorlinks
option so you can see where the link is in the result:The link target is the first use. Be careful not to reset the acronyms (via
\glsreset
etc) or you'll end up with multiply defined targets.Edit: there's a simpler method with the
glossaries-extra
extension package:This will create a target when the hyperlink is suppressed. This can cause a problem if you reset the first use flag or if you want to use the starred version
\gls*
. A minor modification can keep track of whether the target has been set: