# In fancytooltips, how to have a set of aligned equations or matrix

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.

-

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}

\begin{document}

\begin{align}
a ( b + c ) &= ab + ac \\
&= ba + ca \\
&= ( b + c) a
\end{align}

\clearpage

$I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}$

\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*.

-
Thanks, can we have the BASE, as the item in \tooltip{BASE}, be a collection of equations or a mtrix. So for example when you mouseover/click on that set of equations or matrix then the additional (exponent) layer shows up. I have been only able to put simple text or simple formula as BASE but not a set of equations with alignment etc. – Maesumi May 16 '12 at 5:33
@Maesumi Ah, now I see what you meant. The answer is yes; please see my updated answer. – Gonzalo Medina May 16 '12 at 13:30
Great. Except the second base/tooltip* with the \begin{align} does not seem to work. (The first one with the base the identity matrix works for me as in the picture you posted.) – Maesumi May 16 '12 at 19:56
@Maesumi: it works for me, as you can see from the image... are you perhaps using outdated packages? – Gonzalo Medina May 16 '12 at 22:05
When I hover on the second formula I do not see any popup. (Also notice that in the text of your program when you hover on matrix the distributive law is supposed to come up and when you hover on distributive laws the matrix is supposed to show.) – Maesumi May 17 '12 at 1:30