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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 '14 at 14:10
    
In case someone else tries to follow this route: The approach of tex.stackexchange.com/a/84754/1871 does not work here. While the document compiles and shows the second line in the last example in red, the tooltip itself does not show up when hovering over the line. – cryingshadow Dec 4 '15 at 14:58

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.