43

Finally I came up with a \tooltip command that works across a small number of PDF viewers, among which is an Open-Source one. The tooltip command allows for TeX-formatted tip texts. \tooltip[*[*[*[*]]]] [<link colour>]{<link text>} [<tip box colour>]{<tip text>} [<x-offset>,<y-offset>] It ...


20

\tooltip[black]{foo}[blue!50]{Hint: What is the definition of foo?} If the mouse is moved over 'foo' the tip is shown and it disappears immediately when the mouse is moved out. In order to drag the tip around, 'foo' must be clicked. The tip remains visible. Move the mouse over the tip, click it and move it around. Click the tip once more to pin it down at ...


7

Something like this? You certainly don't need a regex to do this. Here's a solution using etoolbox's \docsvlist. I've given a simple definition of \tooltip, since you don't define it, and I assume it's not directly relevant for the problem. \documentclass{article} \usepackage[demo]{graphicx} \usepackage{etoolbox} \newcommand{\tooltip}[1]{#1} \newcommand{\...


6

LaTeX has a suitable loop already defined so you just need \documentclass{article} \def\tooltip#1{[ttip-#1]} \usepackage{graphicx} \makeatletter \def\zz#1{% \@tfor\tmp:=#1\do{% \tooltip{\tmp}% \includegraphics[width=1cm]{example-image-\tmp}% }} \begin{document} \zz{abc} \end{document} adjust the definition of \tooltip as required.


6

Tooltips in PDF documents are generally possible. I do know two packages; one of them you tagged yourself for your question, the other one I added, click on these tags to see, which questions were already asked in TeX.SX: fancytooltips & pdfcomment. But as Joseph Wright in a comment wrote: How PDF viewers show 'hover text' is down the them, not the ...


4

For multiline text, wrap the tip text into a \parbox of given width: \tooltip****{foo}{\parbox{0.8\linewidth}{... long text ...}} For rounded corners, replace \fcolorbox in the tooltip code with, e. g., \tcbox from package tcolorbox %\fcolorbox{black}{#7}{#8}% \tcbox[colframe=black,colback=#7,size=fbox,arc=1ex]{#8}% \documentclass{article} %%%%%...


4

When you are use \tooltips from LINE 3 then your \maincommand{A>A} invokes: \tooltips[height=17cm]{A\kern 1.037em} ... which calls: \tooltip*{A}{\includegraphics [height=17cm]{files/images/A}} \tooltip*{\kern }{\includegraphics [height=17cm]{files/images/\kern }} \tooltip*{1}{\includegraphics [height=17cm]{files/images/1}} \tooltip*{.}{\...


3

I would recommend the following: \newcommand\tooltip@textbf[9]{\textbf{#6}} \DeclareExpandableDocumentCommand{\tooltip}{% ssssO{\ifdefined\@linkcolor\@linkcolor\else black\fi}mO{yellow!20}O{0pt,0pt}m% }{{% \expandafter\let\csname tooltip code\endcsname\tooltip@textbf % ... rest of macro definition here % } This makes \tooltip define itself to ...


3

With the new version 2017/10/25 of the ↗\tooltip macro it should be possible to also place internal links and URLs into the tip box. We must, however, patch hyperref a little bit in order to also have the interactive link rectangle disappear when the tip is hidden. Here, we use the triply-starred \tooltip*** variant which toggles the tip box visibility on ...


3

Although there are other tooltip solutions (with more features), pdfcomment does not use Javascript. The relevant code is: \newcommand{\pc@annot@tooltip}% {% /TU (\pc@pdfenc@contents)\space% /T (tooltip \thezref@unique)\space% /C [ ]\space% /FT/Btn\space% /F 768\space% /Ff 65536\space% /H/N\space% /BS << /W 0 >>\space% }% That's ...


2

Not sure of what you're trying to do, but here's a fairly general approach, based on the code in https://tex.stackexchange.com/a/164186/4427 This doesn't support \tooltips**, but it would be easy to extend it. The first optional argument is for \includegraphics options to be passed to every picture; the trailing optional argument is for setting a ...


2

fellow newbie who is similarly frustrated here. Literally started yesterday but I figured out if you uncheck the "show preview as tooltip on formulas in editor" under the "preview" tab of configure it let the tooltips I wanted to see stick around. I don't know what specific tooltips you have but hope this helps.


2

\(...\) produces inline math, while \[ ... \], being a shorthand for \begin{displaymath} ... \end{displaymath}, produces an unnumbered displayed equation. The latter cannot be typeset into an LR box (what the \tooltip tries to do). If you want a displayed equation to be typeset as a tooltip, wrap it into a \parbox: \tooltip****{foo}{\parbox{1cm}{\[x=4\]}} ...


1

Options->Configure Texstudio-> Completion Uncheck "Automatically start completer when typing LaTex commands"


1

With the listofitems package. The list delimiter (default ,) can be reset with \setsepchar{<delimiter>}. Reset \tooltip as needed. \documentclass{article} \usepackage{listofitems,graphicx} \def\tooltip#1{[ttip-#1]} \newcommand\retool[1]{% \readlist\mylist{#1}% \foreachitem\i\in\mylist{% \tooltip{\i}% \includegraphics[width=1cm]{example-...


1

The tip text argument of the \tooltip macro is put in an LR box (in the same way as \makebox, \framebox, \savebox commands do with their text arguments). LR boxes do not support line breaks. For automatic or forced line breaks, the text must be put into a \parbox or minipage of definite width, such as: \tooltip{lipsum}{\parbox{\textwidth}{\lipsum[1]}} or ...


1

Your explanation gives more light to your problem. You want to write \maincommand{ABC,DE;FG:H} where ABCDEFGH are Chinese characters and ,;: are a special punctuations. And this example may do something like this: \chinchar{A}\chinchar{B}\chinchar{C}\specpunct{,}\chinchar{D}\chinchar{E} \specpunct{;}\chinchar{F}\chinchar{G}\specpunct{:}\chinchar{H} where ...


1

This example places pop-up boxes with embedded graphic files at the top-left page corner. The tikzpicture environment with options "rememberpicture, overlay" is used for absolute positioning. \documentclass[a5paper,12pt]{scrbook} \usepackage{graphicx} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % tooltips with LaTeX % %...


1

This is an example of a graphic as a tooltip. The number of PDF viewers that can be used is limited, though. The second tooltip opens on click and also works in Evince: \documentclass[a5paper,12pt]{scrbook} \usepackage{graphicx} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % tooltips with LaTeX v. 2017/11/28 % % \...


Only top voted, non community-wiki answers of a minimum length are eligible