I'm trying to display in tooltips (using pdfcomment) the meaning of acronyms (using glossaries) in a memoir based class (similar to this question). To do that I created a newcommand named \glstip (see in the MWE below). Without using hyperref it works almost fine, except that the first use of the acronym is not accompanied by its definition. However, when using hyperref the acronym became clickable (when clicked it directs the pdf reader to the list of acronyms) and the tooltip is not shown. Although this might be seen as redundant, I would like to keep such behavior as a 'safeguard' to those pdf readers which does not render the tooltips.

Is there any way to keep the clickable acronym and also show the tooltip on mouse hoovering? Also, any thoughts on why the first use of the acronym is not correctly replaced? (I included in the MWE the expected behavior for 'spam' when using only \gls).

\documentclass{memoir}

\usepackage[noredefwarn, acronyms, symbols]{glossaries}
\usepackage{pdfcomment}
\PassOptionsToPackage{naturalnames}{hyperref}

\hypersetup{
    colorlinks=true,
    linkcolor=black
}

\setacronymstyle{long-short}
\newacronym{spam}{SPAM}{Spiced Ham}
\newacronym{gnu}{GNU}{GNU is Not Unix}

\makeglossaries
\newcommand{\glstip}[1]{\pdftooltip{\gls{#1}}{\glsentrydesc{#1}}}

\begin{document}

    \pdfbookmark[0]{Acronyms}{loa}%
    \printglossary[type=\acronymtype]

    \chapter{Testing}

    First use: \gls{spam}. Second use: \gls{spam}.

    First use is just like second use: \glstip{gnu}.

\end{document}

Desired 'tip' effect (left is SumatraPDF and right is Adobe Acrobat): Desired effect

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.