Description
When using MathJax 4.1.1 to process the LaTeX mhchem expression \ce{NH3 <-[N2 + 3H2][Fe\text{ catalyst}] 2 NH3}, MathCAT 0.7.6-beta.1's ClearSpeak speech text returns "henrys" for the hydrogen element in the expression over the reaction arrow.
| Image of MathJax rendering |
MathCAT ClearSpeak Verbose (en) |
 |
cap n, cap h; sub 3; long left arrow with Fe catalyst below and cap n subscript 2 plus 3 henrys; subscript 2 above; 2, cap n, cap h; subscript 3 |
Question
I tried adding intent=":chemical-element" to any <mi mathvariant="normal"> that had child text content matching an element, but that did not prevent the element from sometimes being interpreted as a unit even when it has a <mrow intent=":chemical-formula"> ancestor.
Is intent=":literal" the best solution? It seems like a hack.
If I apply intent=":literal" to any <mi mathvariant="normal">, then unit inference appears to be suppressed and they are spoken correctly.
Context
We are trying to find ways to get chemical equations/formulas to speak half-way intelligently in tinyMCE generated content that get's rendered by MathJax. For example, the Instructure Canvas Learning Management System (LMS)'s Rich Content Editor.
Other Workarounds Tried
I tried to figure out a way to automatically apply intent attributes to the MathML returned from MathML and then store that MathML in a web page (also rendered by MathJax) so MathCAT can be used (in NVDA or JAWS) to speak it as chemistry and not interpret the chemical elements as units. However, the MathML structure produced by the mhchem extension for MathJax is rather awkward and suitable <mrow> or other hierarchal elements are not available:
- multiple elements are returned as a single
<mi>, for example the <mi data-mjx-auto-op="false">NH</mi> below. This makes it hard to mark them up individually with intent=":chemical-element".
- I cannot determine how to apply
intent=":chemical-formula" automatically to each side of the reaction arrow
I tried adding intent=":chemical-element" to any <mi mathvariant="normal"> that had child text content matching an element, but that did not prevent the element from sometimes being interpreted as a unit.
For example, this MathML still produces the "henrys" for <mi mathvariant="normal" intent=":chemical-element">H</mi> even though it has a <mrow intent=":chemical-formula"> ancestor:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block" intent=":chemical-equation">
<semantics>
<mrow data-mjx-texclass="ORD">
<mrow>
<mrow data-mjx-texclass="ORD" intent=":chemical-formula">
<mrow>
<mi data-mjx-auto-op="false">NH</mi>
</mrow>
</mrow>
<msub>
<mrow data-mjx-texclass="ORD">
<mrow data-mjx-texclass="ORD">
<mpadded width="0">
<mphantom>
<mi>A</mi>
</mphantom>
</mpadded>
</mrow>
</mrow>
<mrow data-mjx-texclass="ORD">
<mrow data-mjx-texclass="ORD">
<mpadded height="0">
<mn>3</mn>
</mpadded>
</mrow>
</mrow>
</msub>
<mrow data-mjx-texclass="ORD"></mrow>
<mrow data-mjx-texclass="REL">
<mrow data-mjx-texclass="REL">
<mrow data-mjx-texclass="NONE"></mrow>
<munderover>
<mo data-mjx-texclass="ORD" stretchy="true"></mo>
<mpadded width="+0.778em" lspace="0.5em" voffset=".15em" depth="-.15em">
<mrow data-mjx-texclass="ORD">
<mrow data-mjx-texclass="ORD">
<mi data-mjx-auto-op="false">Fe</mi>
</mrow>
<mtext> catalyst</mtext>
<mo>​</mo>
</mrow>
<mspace height=".75em"></mspace>
</mpadded>
<mpadded width="+0.778em" lspace="0.5em" voffset="-.2em" height="-.2em">
<mrow intent=":chemical-formula">
<mrow data-mjx-texclass="ORD">
<mrow>
<mi mathvariant="normal" intent=":chemical-element">N</mi>
</mrow>
</mrow>
<msub>
<mrow data-mjx-texclass="ORD">
<mrow data-mjx-texclass="ORD">
<mpadded width="0">
<mphantom>
<mi>A</mi>
</mphantom>
</mpadded>
</mrow>
</mrow>
<mrow data-mjx-texclass="ORD">
<mrow data-mjx-texclass="ORD">
<mpadded height="0">
<mn>2</mn>
</mpadded>
</mrow>
</mrow>
</msub>
<mrow data-mjx-texclass="ORD"></mrow>
<mo>+</mo>
<mrow data-mjx-texclass="ORD"></mrow>
<mrow>
<mn>3</mn>
<mstyle scriptlevel="0">
<mspace width="0.167em"></mspace>
</mstyle>
<mrow data-mjx-texclass="ORD">
<mrow>
<mi mathvariant="normal" intent=":chemical-element">H</mi>
</mrow>
</mrow>
</mrow>
</mrow>
<msub>
<mrow data-mjx-texclass="ORD">
<mrow data-mjx-texclass="ORD">
<mpadded width="0">
<mphantom>
<mi>A</mi>
</mphantom>
</mpadded>
</mrow>
</mrow>
<mrow data-mjx-texclass="ORD">
<mrow data-mjx-texclass="ORD">
<mpadded height="0">
<mn>2</mn>
</mpadded>
</mrow>
</mrow>
</msub>
<mspace depth=".2em"></mspace>
</mpadded>
</munderover>
</mrow>
</mrow>
<mrow data-mjx-texclass="ORD"></mrow>
<mrow intent=":chemical-formula">
<mn>2</mn>
<mspace width="0.167em"></mspace>
<mrow data-mjx-texclass="ORD">
<mrow>
<mi data-mjx-auto-op="false">NH</mi>
</mrow>
</mrow>
</mrow>
</mrow>
<msub>
<mrow data-mjx-texclass="ORD">
<mrow data-mjx-texclass="ORD">
<mpadded width="0">
<mphantom>
<mi>A</mi>
</mphantom>
</mpadded>
</mrow>
</mrow>
<mrow data-mjx-texclass="ORD">
<mrow data-mjx-texclass="ORD">
<mpadded height="0">
<mn>3</mn>
</mpadded>
</mrow>
</mrow>
</msub>
</mrow>
<annotation encoding="application/x-tex">\ce{NH3 <-[N2 + 3H2][Fe\text{ catalyst}] 2 NH3}</annotation>
</semantics>
</math>
Description
When using MathJax 4.1.1 to process the LaTeX mhchem expression
\ce{NH3 <-[N2 + 3H2][Fe\text{ catalyst}] 2 NH3}, MathCAT 0.7.6-beta.1's ClearSpeak speech text returns "henrys" for the hydrogen element in the expression over the reaction arrow.Question
I tried adding
intent=":chemical-element"to any<mi mathvariant="normal">that had child text content matching an element, but that did not prevent the element from sometimes being interpreted as a unit even when it has a<mrow intent=":chemical-formula">ancestor.Is
intent=":literal"the best solution? It seems like a hack.If I apply
intent=":literal"to any<mi mathvariant="normal">, then unit inference appears to be suppressed and they are spoken correctly.Context
We are trying to find ways to get chemical equations/formulas to speak half-way intelligently in tinyMCE generated content that get's rendered by MathJax. For example, the Instructure Canvas Learning Management System (LMS)'s Rich Content Editor.
Other Workarounds Tried
I tried to figure out a way to automatically apply intent attributes to the MathML returned from MathML and then store that MathML in a web page (also rendered by MathJax) so MathCAT can be used (in NVDA or JAWS) to speak it as chemistry and not interpret the chemical elements as units. However, the MathML structure produced by the mhchem extension for MathJax is rather awkward and suitable
<mrow>or other hierarchal elements are not available:<mi>, for example the<mi data-mjx-auto-op="false">NH</mi>below. This makes it hard to mark them up individually withintent=":chemical-element".intent=":chemical-formula"automatically to each side of the reaction arrowI tried adding
intent=":chemical-element"to any<mi mathvariant="normal">that had child text content matching an element, but that did not prevent the element from sometimes being interpreted as a unit.For example, this MathML still produces the "henrys" for
<mi mathvariant="normal" intent=":chemical-element">H</mi>even though it has a<mrow intent=":chemical-formula">ancestor: