The fancytooltip
package provides a bit more advanced capabilities than does the cooltooltips
package. As an example, the second paragraph of the package documentation shows the inclusion of regular (fixed) tooltip text, as well as animated tooltip text on mouseover.
The documentation states that it is limited to the (free) Adobe Reader or Adobe Acrobat suite. This restriction may be prohibitive, but Adobe's integration with web browsers counts towards it's abundant usage. Additionally, since the tooltips may be "fancy", they are typically created in a separate document from your source.
Another alternative would be to use the pdfcomment
package that provides similar functionality within your source document. Here is a minimal example of how it may be used within an align
environment of amsmath
:
\documentclass{article}
\usepackage{pdfcomment}% http://ctan.org/pkg/pdfcomment
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\begin{document}
% \pdftooltip{<text>}{<tooltip>}
\begin{align*}
\mathrlap{\pdftooltip[mathstyle=\displaystyle]{\phantom{\sum_{i=1}^n i=\frac{n}{2}(n+1)}}{sum\string_\{i=1\}\string^n i=tfrac\{n\}\{2\}(n+1)}}%
\sum_{i=1}^n i &= \tfrac{n}{2}(n+1) \\
\mathrlap{\pdftooltip[mathstyle=\displaystyle]{\phantom{E=mc^2}}{E=mc\textasciicircum 2}}%
E &= mc^2
\end{align*}
\end{document}
Since the internal align
structure cannot be broken across &
within the \pdfcomment
, it is possible to use some mathtools
overlap magic (via \mathrlap
).
For completeness, here is an elaboration on the functionality provided by the cooltooltips
package, since it may be useful to others. It provides
\cooltooltip[<popup color>][<link color>]{<subject>}{<message>}{<url>}{<tooltip>}{<text>}
that prints a box of colour <link color>
around <text>
. Additionally, a popup of colour <popup color>
is displayed with a title <subject>
and text <message>
Hovering over <text>
also brings up the tooltip <tooltip>
and clicking the link takes you to <url>
. Here's a very minimal example illustrating this:
\documentclass{article}
\usepackage{cooltooltips}% http://ctan.org/pkg/cooltooltips
\begin{document}
\section{Introduction}
Have you ever wondered what is \cooltooltip[0 0 1]{Einstein}{E=mc^2}%
{http://en.wikipedia.org/wiki/Albert_Einstein}{Einstein on the web}{$E=mc^2$}?
\end{document}
The implementation of cooltooltips
is fairly limited and fragile. For example, movement of the popup is not possible since it is activated/deactivated by means of the hover. Also, depending on the resolution of view, it may actually impede viewing. Popups can be disabled by the viewer by incorporating a "toggle button" (say <text>
)in the document by using
\cooltooltiptoggle{<text>}
Pressing <text>
suppresses all popups in the document. Pressing it again re-enables popups. Some control over the display of border in the actual text is possible by setting the lengths \fboxrule
and \fboxsep
via a \setlength
command.
Best Answer
Using my new
tokcycle
package (https://www.ctan.org/pkg/tokcycle )...I find the result pleasingly legible, when read audibly via the Adobe Reader.This MWE relies on you having a new enough LaTeX installation to support the new
\expanded
primitive. If not, you can, for the time being, change the\tcremap[x]
in the\speakifytext
definition to\tcremap[1]
and also change the\noexpand\pauseafter
(2 instances) to\pauseafter
. The net effect of this change is that the token register\cytoks
that holds the transformed text, will contain things like\tcmapto^
rather than, raised to the power
. That is to say, the transformation occurs when the token register is typeset, rather than before being placed into the token register.Just remove the two lines,
\speakifytext
and\endspeakifytext
, and recover the original output.See also this question, which I find related: In which way have fake spaces made it to actual use?