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?
\fullcite
is a\protected
command. It cannot be expanded, because it contains something that isn't expandable, namely macro definitions.\blx@citei@fullcite
except save the text produced rather than typeset it and then use\pdfmarkupcomment
. I don't have time to try it right now, myself. Maybe someone else can give it a go.