1

I would like to use Knitr to generate plots in R that have hover-over tooltips. Here is a working example without an R tooltip:

    \documentclass{article}
    \usepackage{pdfcomment}
    \begin{document}
    No tooltip here. {\pdftooltip{Hover here for a tooltip!}{I am a tooltip.}}
    <<>>=
    library(knitr)
    plot(c(runif(10),runif(10)))
    @
    \end{document}

Here is an example that does not work but that demonstrates what I have in mind:

    \documentclass{article}
    \usepackage{pdfcomment}
    \begin{document}
    No tooltip here. {\pdftooltip{Hover here for a tooltip!}{I am a tooltip.}}
    {\pdftooltip{
    <<>>=
    library(knitr)
    plot(c(runif(10),runif(10)))
    @
    }{Tooltip for graphic.}}
    \end{document}

The issue seems to be the \begin{knitrout} and \end{knitrout} environment tags. Is anyone aware of a work around?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.