Adding hover text (I believe the technical term is a tooltip) to any part of any LaTeX document can be accomplished using cooltooltips.sty
, as I have recently learned.
I would like to do something a little more large scale. I would like to compile my documents so that every instance of math mode or math display mode automatically puts the defining LaTeX code as a tooltip (text hovering over it). So for example, my nicely typeset $\frac{a}{b}$
can also show the user that very same code: "\frac{a}{b}
".
Ideally, I'd also like this to apply to math mode environments like align
.
I have two reasons for wanting to do this:
- Math accessibility to the visually impaired is becoming a big issue. Some universities have been sued in the last few years for not complying with the Americans with Disabilities act because visually impaired students have little or no way to read math - be it LaTeX, MathML, MS Equation Editor, or whatever. Rather than wait 20 years for a screen reader that can accurately verbalize math on a pdf, I want to let screen readers verbalize the LaTeX code and let the visually disabled student interpret that code. It is an effective way to communicate math to sight-affected students as long as we're not talking about something intense like nested fractions.
- For teaching others what code was used to typeset something, this would be a nice tool to have.
It doesn't look like there is a package for doing this after a search on CTAN. Does anyone have any ideas?