I'm trying to add a tooltip to each inline citation. So far I've almost got it working using pdfcomment:
\documentclass{article}
\usepackage[colorlinks=true]{hyperref}
\usepackage{pdfcomment}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Bli74,
author = {Blinder, Alan S.},
year = {1974},
title = {The economics of brushing teeth},
}
\end{filecontents}
\usepackage{usebib}
\bibinput{\jobname}
\makeatletter
\let\@internalcite\cite
\renewcommand{\cite}[1]{%
\pdftooltip{\@internalcite{#1}}{\usebibentry{#1}{title}}}
\makeatother
\begin{document}
This is a citation: \cite{Bli74}.
\bibliographystyle{apalike}
\bibliography{\jobname}
\end{document}
But there seems to be a default tooltip because of the link in the citation "Go to page 1" in my mac's Preview.app. I see that my custom tooltip is working but only on the thin boundary of the citation (including the little brackets).
Is there a way to redefine the cite command to avoid this tooltip and use just my custom tip for the entire citation?
Meanwhile, I would also like to handle multiple citations: \cite{thing1,thing2}. How can I extract (split on comma) and add tooltips to both thing1 and thing2?
Best Answer
The problem is that you are having two so called PDF annotations defined at almost the same place. One for the tooltip and another one for the hyperlink, which is technically also a PDF annotation.
You can switch off the hyperlink with:
So in this case, you can only have the one without the other!
How about using PDF text annotations instead?
EDIT:
For a more subtle appearance, you can use empty and invisible PDF Markup Highlight annotations:
EDIT2:
For viewers without additional marker, you can use your own marker like a tiny question mark. You should also increase
opacity
.EDIT3:
Or the same again with a tooltip: