I thought it would be useful to have bibliographic entries displayed as a tooltip so readers are not interrupted by following hyperlinks or trying to find the Bibliography, so I created the following command:
\newcommand\annocite[1]{\pdfmarkupcomment[markup=Underline,subject=Citation]
{\parencite{#1}}{\fullcite{#1}}}
Unfortunately this does not work. Instead of showing the bibliographic entry in the popup, it merely displays the citation key; i.e., the \fullcite
command seems to have no effect. I believe the problem is related to argument expansion. Here is a MWE:
\documentclass{article}
\usepackage{biblatex,pdfcomment,filecontents}
\bibliography{\jobname}
\newcommand\annocite[1]{\pdfmarkupcomment[markup=Underline,subject=Citation]
{\parencite{#1}}{\fullcite{#1}}}
\begin{filecontents}{\jobname.bib}
@article{Bli74,
author = {Blinder, Alan S.},
year = {1974},
title = {The economics of brushing teeth},
journaltitle = {Journal of Political Economy},
volume = {82},
number = {4},
pages = {887--891},
}
\end{filecontents}
\begin{document}
Hover over this citation: \annocite{Bli74}
The tooltip should contain the following text: \fullcite{Bli74}
\end{document}
Can anyone think of a solution, or better, a way to redefine biblatex' citation commands (e.g., \parencite
, \cite
) to do this automatically?
Best Answer
The idea is to use the fancytooltips package. I will show schematically the process: to make my example compilable for everyone, I'll use the following bibliographical database (called
biblio.bib
):First you need to create a .pdf file containing the
\keytip
s commands and the text for the tooltips that will be used by thefancytooltips
package. To create this.pdf
document you can use LaTeX: in this example I used a file (calledbibtips.tex
) having the following aspect:You need to use the
\MyTip
command for every bibliographical entry that will have a tooltip in your final document.Compile this file in the standard way:
pdflatex+bibtex+pdflatex+pdflatex
to generate the references, one on each page, nicely framed, and with the corresponding\keytip
command. The resulting.pdf
file has to be in the same directory containing your main.tex
file.Now, your main document has to be something like the following (note that the value for the
filename
key is exactly the name of the.pdf
file obtained in the previous step):Compile this file in the standard way:
pdflatex+bibtex+pdflatex+pdflatex
and you'll see your citations with a blue balloon; if you move the mouse pointer to the active area, a tooltip will open displaying the complete bibliographical information corresponding to the citation.Some remarks:
Of course, you can obtain fancyer tooltips by changing the aspect of the references in the file
bibtips.pdf
.This approach doesn't work in all PDF viewers, since it requires cooperation with JavaScripts; you have to use Adobe Reader or Adobe Acrobat to see the tooltips.