Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

It is apparently possible to put a TikZ drawing inside a pdfcomment (but using mbox).

Is is possible to associate only part of a drawing (e.g. a line) to a pdfcomment? Below it is the suggested code.

I am open to use other interactive packages (similar to pdfcomment) if that can solve the problem. The final goal is to associate individual curves in a pgfplot to a tooltip when dragging the mouse.

\documentclass[]{article}
\usepackage{tikz}
\usepackage[]{pdfcomment}
\begin{document}

%ok
\pdfmarkupcomment[]{
    text
}{
    a paragraph
}

% ok but needs mbox
\pdfmarkupcomment[]{
    \mbox{
    \begin{tikzpicture}
    \draw(0,0)--(1,1);
    \draw(0,1)--(1,0);
    \end{tikzpicture}}
}{
    a drawing
}

%not ok (Error: Missing } inserted.)
\begin{tikzpicture}
    \pdfmarkupcomment[]{
        \draw(0,0)--(1,1);
    }{
        a line
    }
    \draw(0,1)--(1,0);
\end{tikzpicture}

\end{document}
share|improve this question
    
I think you will be interested in the ocgx package; on this site have a look to Explanatory bubbles in beamer the Interactive word explanation part, Interactive PDF, Latex and Article of the Future and tex.stackexchange.com/questions/65096/… –  Claudio Fiandrino Dec 27 '12 at 10:48
    
    
@ClaudioFiandrino, this method looks the most promising tex.stackexchange.com/a/84754/1871. While ocg is probably the most general, I am trying to avoid external scrips and Acrotex dependency. –  alfC Dec 28 '12 at 0:39
    
Please try the fancytooltips package. –  Malipivo Apr 14 at 14:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.