pressbooks / pb-mathjax

A replacement for wp.com/latex.php but instead of LaTeX, it uses MathJax.
GNU General Public License v3.0
4 stars 1 forks source link

Use MathJax AssistiveMML extension on Print exports to embed hidden MathML #39

Open beckej13820 opened 4 years ago

beckej13820 commented 4 years ago

Feature Description

Currently in exports using MathJax, we are using the SVG output, with LaTeX being added in as an alt, but not displayed to sighted users. Math PDFs may be considered more accessible if we continue to use the SVG output, but add in the HTML the MathML instead of the LaTeX.

Screen Shot 2019-12-17 at 8 38 25 AM This screenshot shows the current Pressbooks PDF export, where the LaTeX is used as the alt text.

Screen Shot 2019-12-17 at 8 45 22 AM XHTML output showing alt, title, and class.

Other systems I am familiar with (Blackboard) embed the mathml into the code under data-mathml

<img alt="x equals fraction numerator negative b plus-or-minus square root of b squared minus 4 a c end root over denominator 2 a end fraction" class="Wirisformula" data-mathml="«math xmlns=¨http://www.w3.org/1998/Math/MathML¨»«mi»x«/mi»«mo»=«/mo»«mfrac»«mrow»«mo»-«/mo»«mi»b«/mi»«mo»§#177;«/mo»«msqrt»«msup»«mi»b«/mi»«mn»2«/mn»«/msup»«mo»-«/mo»«mn»4«/mn»«mi»a«/mi»«mi»c«/mi»«/msqrt»«/mrow»«mrow»«mn»2«/mn»«mi»a«/mi»«/mrow»«/mfrac»«/math»" />

This MathJax Github thread from 2014 when Assistive MathML was implemented may shed light on best practices and their thought process. They discuss in the thread whether to embed as data-mathml or just as math tags, and compare implementation with Khan Academy, Wikipedia, and discuss which assistive technology it will work with and it won't. https://github.com/mathjax/MathJax/issues/938

This documentation page may or may not help, but has a discussion on adding assistive MathML to a math expression by adding a new render action to be called as part of the rendering process. http://docs.mathjax.org/en/latest/output/mathml.html

Feature Use Case

To make the math expressions usable by assistive technology in export formats.

Other Notes

SteelWagstaff commented 4 years ago

Thanks for the idea @beckej13820 -- it's a good one. I'd like us to do a handful of tweaks to our MathJax solution in 2020, and this would be a good one to consider alongside of that work.

VTOpenLib commented 4 years ago

Plus several from VT on this. This would be extremely helpful in making math-intensive OER publications more accessible.

SteelWagstaff commented 4 years ago

@pkra has recommended that we explore the use of https://github.com/zorkow/speech-rule-engine -- looks very promising to us

josieg commented 4 years ago

Popping in to give this a +1 :)

beckej13820 commented 3 years ago

I must admit that I really don't deeply understand MathJax and how it works, but I was looking at changes in MathJax v3 and MathJax v3.1, and it seems like they have incorporated more speech options in the last 6-9 months.

Is it possible that upgrading to a newer version of MathJax might also help accessible alternative formats?

(I am reading that MathJax 3 was a complete rewrite of the program, so that any exploration will probably not be an inconsequential change)

Link to a github repository of MathJax demos: tex2speech https://github.com/mathjax/MathJax-demos-node/tree/master/speech