Latest news 2021-06-05: New blog post: Dickimaw Books Site Account.

glossaries package FAQ

How can I make just the short form a hyperlink? 🔗

If you switch off the hyperlink on first use (using the hyperfirst=false package option), you can create a custom acronym style that inserts the link around just the short form:

\documentclass{article}

\usepackage[hyperfirst=false]{glossaries}

\makeglossaries

{%
% use the "long-short" display style:
\GlsUseAcrEntryDispStyle{long-short}%
}
{%
% use the "long-short" style definitions:
\GlsUseAcrStyleDefs{long-short}%
% adjust the full form so that it has a hyperlink for the short part:
\renewcommand*{\genacrfullformat}[2]{%
\glsentrylong{##1}##2\space
}%
% same for the plural form:
\renewcommand*{\genplacrfullformat}[2]{%
\glsentrylongpl{##1}##2\space
}%
}

% apply this new style

% now define the acronyms
\newacronym{gnu}{GNU}{Gnu is Not Unix}

\begin{document}

First use: \gls{gnu}. Next use: \gls{gnu}.

Full form: \acrfull*{gnu}.

\printglossaries
\end{document}



Note that if you are using glossaries-extra, it uses a completely different abbreviation mechanism so the above won’t work. However, you can simply use an abbreviation style such as short-postlong-user.

2020-06-27 16:45:13