1

I would like to get popups for acronyms giving their meaning at mouse hover.

The following works with pdflatex when viewed with acroread:

\usepackage{pdfcomment} 
\usepackage{acronym} 
\def\acp#1{\pdftooltip{\acs{#1}}{\acl{#1}}}
\newacro{ADS}{NASA Astrophysics Data System}

Hovering over an acronym as \acp{ADS} indeed shows its meaning.

It doesn't work in evince. So be it.

My big problem is that in MacOS Preview it works, but one sees ugly bad frames around each acronym making the text quite unreadable. My readers are likely to be Mac types, making this no go.

Josef
  • 7,432
  • related: http://tex.stackexchange.com/q/155518/18228 and http://tex.stackexchange.com/q/34698/18228 – Herr K. Feb 05 '15 at 01:02

1 Answers1

2

Kevin C: many thanks! The final item in your first link pointed me to the following solution, using another command from pdfcomment.sty:

%% popup acronym expansion

\gdef\acp#1{\pdfmarkupcomment[markup=Underline,color={1 1 1},author={{#1}}]{{#1}}{{\acl{#1}}}}

which together with \newacro{acronym}{full expansion} of the acronym-package indeed does the job, when the PDF is viewed in acroread and Adobe reader for Mac OS X. It does not open the popup in evince, okular, or Preview (Mac OS X built-in tool), but at least it does not generate the ugly black boxes in Preview, that I had from \pdftooltip. So I can stick these popups now in any PDF I produce and if my readers are smart enough to use Acrobat, they will get the popup explanation at any acronym they hover over. Should be standard in scientific papers! If they use another viewer, at least there is no fatal interference.

I hesitated about underlining such hoverable acronyms in blue, but chose not to mark the pop-ability at all. Let the reader discover by herself. Hence defining the white color.

Apologies for not knowing how to typeset the LaTeX code above. Typing in this site is fighting my emacs habits.

naphaneal
  • 2,614
  • Acronyms should not have under lengths, so it should not be a problem. But in this case you better use opacity=0 – Josef Feb 05 '15 at 18:19
  • Next problem: \pdfmarkupcomment doesn't seem to work with \input or \include files. Apparently soul.sty then does not write a .upb file. So the above only works for simple files. – Rob Rutten Feb 07 '15 at 21:09
  • Yes, it's a known problem and reported to the author of soulpos, but not fixed yet – Josef Feb 08 '15 at 07:54
  • related: https://tex.stackexchange.com/questions/132973/pdfmarkupcomment-does-not-highlight-what-it-is-supposed-to/133169#133169 – Josef Feb 08 '15 at 08:05