The package fancytooltips allows for layers, where a rollover by mouse over a target brings up a box of comments. I want the target to contain extended mathematical objects such as aligned equations or matrices. To restate, this is somewhat similar to having a Base and an Exponent. Base is part of the main page and Exponent is the layer that shows up if you hover on Base. I want the Base to be a set of aligned equations or a matrix.
- 9,059
1 Answers
The tool-tips can contain mathematical expressions. Below there's an example. I used the file following mathtips.tex document
\documentclass{article}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{framed}
\usepackage[createtips]{fancytooltips}
\colorlet{shadecolor}{blue!20}
\begin{document}
\keytip{distrib}\begin{shaded}
\begin{align}
a ( b + c ) &= ab + ac \\
&= ba + ca \\
&= ( b + c) a
\end{align}
\end{shaded}
\clearpage
\keytip{matrix}\begin{shaded}
\[
I_3 = \begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix}
\]
\end{shaded}
\end{document}
to produce a file mathtips.pdf containing the tips (I used the framed package to place the tips inside a colored box, but you can style your tips as you wish), and then, using this file c.tex
\documentclass{article}
\usepackage{xcolor}
\usepackage[filename=mathtips,mouseover]{fancytooltips}
\begin{document}
\tooltip{Distributivity}{distrib}
\tooltip{An identity matrix}{matrix}
\end{document}
I got the document with the fancy tool-tips; some images:

and the tool-tips:


The \tooltip{<stuff>}{<keyword>} command uses an \hbox for <stuff>, so if you want to use displayed math in <stuff> (a set of aligned equations obtained using amsmath's align environment, for example), you will need to use the starred version \tooltip* (for in-line math material you can still use the non-starred version); consider the following simple example using the same mathtips.pdf file as before:
\documentclass{article}
\usepackage{amsmath}
\usepackage{xcolor}
\usepackage[filename=mathtips,mouseover]{fancytooltips}
\begin{document}
\tooltip{$I_3 = \begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix}$}{distrib}
\tooltip*{\begin{align}
a ( b + c ) &= ab + ac \\
&= ba + ca \\
&= ( b + c) a
\end{align}}{matrix}
\end{document}


As a remark, the noextratext package option doesn't seem to work when using displayed mathematical expressions (such as those produced by align) in the first argument of \tooltips*.
- 11,466
- 505,128
noextratextoption) and will reupload the right images. Please let me know if things now work for you. – Gonzalo Medina May 17 '12 at 01:56