Warning

Alternative approaches for providing math descriptions are currently under development. This guide will be updated once they are ready for use. See the Explanation section for a description of the issues with current approaches.

Summary

Provide a description for MathML equations for user agents that do not support their rendering.

Techniques

Examples

Example 1 — Adding a description using the aria-label attribute
<div role="math"
     aria-label="Frac Root a EndRoot Over b EndFrac">
   <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mfrac>
         <msqrt>
            <mtext>a</mtext>
         </msqrt>
         <mi>b</mi>
      </mfrac>
   </math>
</div>
Example 2 — Adding a description using the MathML alttext attribute
<math xmlns="http://www.w3.org/1998/Math/MathML"
      alttext="Frac Root a EndRoot Over b EndFrac">
   <mfrac>
      <msqrt>
         <mtext>a</mtext>
      </msqrt>
      <mi>b</mi>
   </mfrac>
</math>
Example 3 — Adding a description using an annotation-xml element
<math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
      <mfrac>
         <msqrt>
            <mtext>a</mtext>
         </msqrt>
         <mi>b</mi>
      </mfrac>
      <annotation-xml encoding="application/xhtml+xml">
         <img xmlns="http://www.w3.org/1999/xhtml
              src="math.jpg"
              alt="Frac Root a EndRoot Over b EndFrac" />
      </annotation-xml>
    </semantics>
</math>

Explanation

Although a benefit of native MathML support in XHTML content documents is the ability to provide voicing based on the markup, user agents capable of such voicings are rare. It is consequently recommended to include a fallback description.

The provision of accessible fallback descriptions is unfortunately as problematic as support for MathML in user agents:

It is recommended to use MathSpeak to write math descriptions. Users already familiar with math-voicing programs will recognize the conventions used in MathSpeak, and the language removes the potential for ambiguity that natural language can introduce.

References

Frequently Asked Questions

Why aren't natural language descriptions advisable?

Consider the simple equation presented in Example 1 above. A reasonable natural language description might be "the square root of a over b". But consider that there are two ways that this statement could be interpreted:

  1. to take the square root of the value a and then divide the resulting value by b.
  2. to divide a by b and then take the square root of the resulting value.

A user who cannot see the visual presentation of the equation is not going to be able to determine which is the correct interpretation with only the description to go by. MathSpeak takes the ambiguity out of the equation by clearly breaking down the components of the equation in a way that doesn't leave ambiguity.

Is MathSpeak the only option for describing MathML?

No, but it is an openly documented format. Although some MathML applications take slightly different approaches to voicing equations, MathSpeak is a good reflection of the typical grammar.

Should I use the verbose, brief or super-brief syntaxes?

The different levels reflect the expected age and proficiency of the user. A math book geared towards younger users, or users new to the topic, would typically employ the verbose grammar. More advanced users already proficient in math and familiar with the grammar will likely find the verbose syntax a nuisance, so either the brief or super-brief grammars can be employed.