2

I need a pop-up to appear above my in-text references. The pop-up should display the page number where the citation can be found on (i.e. so the reader can check that the cited article actually siad what my paper claims it said). I've achieved this using one of the codes on this page (pdftooltip from pdfcomment package: Using LaTeX code in tooltip).

HOWEVER, I am now no longer able to CLICK on the in-text reference anymore. Clicking on the in-text reference would normally take me to the corresponding reference on my reference list.

It seems the pop-up solution 'shields' the in-text reference with a film that makes it no longer clickable. Please can you help?

Sample text:

"According to \cite{RefWorks:1172} \tooltip[black]{\cite{RefWorks:1172}}[blue!50]{See:Page 2, paragraph 2} patients would rather prefer it if all technologies designed to support their daily living in Smart environments are  non-obtrusive."

The first citation can still be clicked and it will take you to the reference list. The second one has the pop-up but cannot be clicked.

Hello Christian H.

Thank you for responding to my query. You've probably rightly guessed from that previous error that I'm new here (I consult the site a lot for tips but I've never posted before).

Okay, here's the 'code'. I hope this is what you mean? It's not mine but a cut and paste from the site I referred to in my earlier posting.

Thanks again.

\usepackage{media9}[2014/03/25]
\usepackage{xcolor} %Package already included elsewehere on this page
\usepackage{calc}
\usetikzlibrary{calc}

\ExplSyntaxOn
\let\tpPdfLink\mix_pdflink:nn
\let\tpPdfAnnot\mix_pdfannot:nnnn\def\tpPdfLastAnn{\g_mix_pdflastann_tl}
\let\tpPdfXform\mix_pdfxform:n\def\tpPdfLastXform{\g_mix_pdflastxform_tl}
\ExplSyntaxOff

\makeatletter
\NewDocumentCommand{\tooltip}{sO{blue}mO{yellow!20}m}{{%
  \leavevmode%
  \tpPdfLink{%      
    /Subtype/Screen%                    
    /AA<<%
      /E<</S/JavaScript/JS(%
        var fd=this.getField('tip.\thetcnt');%
        \IfBooleanF{#1}{%
          if(typeof(click\thetcnt)=='undefined'){%
            var click\thetcnt=false;%
            var fdor\thetcnt=fd.rect;var dragging\thetcnt=false;%
          }%
        }%
        if(fd.display==display.hidden){%
          fd.delay=true;fd.display=display.visible;fd.delay=false;%
        }%
        this.dirty=false;%
      )>>%     
      /X<</S/JavaScript/JS(%
        \IfBooleanTF{#1}{fd.display=display.hidden;}{%
          if(!click\thetcnt&&!dragging\thetcnt){fd.display=display.hidden;}%
          if(!dragging\thetcnt){click\thetcnt=false;}%
        }%
        this.dirty=false;%
      )>>%
      \IfBooleanTF{#1}{%
        /PC<</S/JavaScript/JS(this.dirty=false;)>>%                                       
      }{%
        /U<</S/JavaScript/JS(click\thetcnt=true;this.dirty=false;)>>%
        /PC<</S/JavaScript/JS (%
          var fd=this.getField('tip.\thetcnt');%
          try{fd.rect=fdor\thetcnt;}catch(e){}%                     
          fd.display=display.hidden;this.dirty=false;%
        )>>%
      }%
      /PO<</S/JavaScript/JS(this.dirty=false;)>>%
    >>%
  }{{\color{#2}#3}}%
  \sbox\tiptext{\fcolorbox{black}{#4}{#5}}%
  \edef\twd{\the\wd\tiptext}%
  \edef\tht{\the\ht\tiptext}%
  \edef\tdp{\the\dp\tiptext}%
  \measureremainder{\whatsleft}%
  \tipshift=0pt%
  \ifdim\whatsleft<\twd\setlength\tipshift{\whatsleft-\twd}\fi%
  \tpPdfXform{\tiptext}%
  \raisebox{\heightof{#3}}[0pt][0pt]{\makebox[0pt][l]{\hspace{\tipshift}%
    \tpPdfAnnot{\twd}{\tht}{\tdp}{%
      /Subtype/Widget/FT/Btn/Ff 65536/T (tip.\thetcnt)/F 3%
      /MK<</TP 1/I \tpPdfLastXform/IF<</S/A/FB true/A [0.0 0.0]>>>>%
      \IfBooleanF{#1}{%
        /AA <<%
          /U <<%
            /S/JavaScript/JS(%
              var fd=event.target;%
              var mX=this.mouseX;var mY=this.mouseY;%
              var drag=function(){%
                var nX=this.mouseX;var nY=this.mouseY;%
                var dX=nX-mX;var dY=nY-mY;%
                var fdr=fd.rect;%
                fdr[0]+=dX;fdr[1]+=dY;fdr[2]+=dX;fdr[3]+=dY;%
                fd.rect=fdr;mX=nX;mY=nY;%
              };%
              if(!dragging\thetcnt){%
                dragging\thetcnt=true;Int=app.setInterval("drag()",1);%
              }%
              else{app.clearInterval(Int);dragging\thetcnt=false;}%
              this.dirty=false;%
            )%
          >>%
        >>%
      }%
    }%
    \xdef\@anim@fields{\@anim@fields\space\tpPdfLastAnn}%
  }}%
  \stepcounter{tcnt}%
}}
\makeatother
\newsavebox\tiptext\newcounter{tcnt}
\newlength{\whatsleft}\newlength{\tipshift}
\newcommand{\measureremainder}[1]{%
  \begin{tikzpicture}[overlay,remember picture]
    \path let \p0 = (0,0), \p1 = (current page.east) in
      [/utils/exec={\pgfmathsetlength#1{\x1-\x0}\global#1=#1}];
  \end{tikzpicture}%
}

Please does anyone have a suggestion as to how I might go about resolving this issue? Thank you.

Dhaivid3
  • 201
  • Welcome to TeX.SX! Nice that you refer to the very first question of mine here on TeX.SX! ;-) Please provide more information, i.e. your code –  Apr 12 '15 at 11:26
  • Please, not below. Just add it to the question above ;-) –  Apr 13 '15 at 12:26

0 Answers0