How to make math accessible using Mathpix

How to Use LaTeX for Accessible Math in PDFs

Share this post on:

Ensuring that all users, regardless of their abilities, can access and understand content is crucial in today’s digital world. Mathematics, in particular, poses unique challenges when presented digitally, especially for users who rely on screen readers. PDFs, one of the most common document formats, don’t natively support MathML, the ideal standard for representing mathematical notations in a way that screen readers can interpret and navigate. This article explains how to use LaTeX descriptions in alt text to make math equations accessible in PDFs.

Video Guide

Get accessible now - schedule a free 15 minute call with The Accessibility Guy

The Accessibility Challenge of Math in PDFs

Screen readers are essential for users who are visually impaired, but they struggle to interpret and articulate complex mathematical equations in PDFs. For example, a simple equation like the quadratic formula often sounds unintelligible when read aloud. Instead of hearing the equation, users might hear garbled sequences of characters, like “242 BBA, CA, dash plus minus dash,” which provides no clarity.

Why PDFs Create This Problem

The core issue comes from the fact that PDFs, while useful for displaying static documents, don’t support MathML. MathML, an XML-based language, describes mathematical notations in a way that both humans and machines can read, making it ideal for screen readers to navigate and understand equations.

The Solution: Using LaTeX Descriptions in Alt Text

Without MathML support, you can still make math accessible by using LaTeX descriptions in the alt text of figure tags in PDFs. Although LaTeX isn’t as user-friendly as MathML, it’s widely used for formatting mathematical content and screen readers like JAWS recognize and interpret it.

Step-by-Step Guide

Here’s how you can make math equations in PDFs more accessible using LaTeX descriptions:

1. Identify the Math Content in the PDF

First, locate the math content that you want to make accessible. In our video guide, we used the quadratic formula as an example.

2. Use an OCR Tool to Extract LaTeX

To convert the equation into LaTeX, use an OCR tool like the Mathpix Snipping Tool. This tool lets you “snip” an equation from the screen and automatically generate its LaTeX, MathML, or other formats.

  • Open the Mathpix Snipping Tool.
  • Create a new “snip” by dragging a box around the equation.
  • The tool will generate a LaTeX representation of the equation, which might look something like this:
latexCopy code\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Although Mathpix offers several options, including LaTeX, MathML, ASCII Math, and SVG, you’ll select LaTeX for this purpose.

3. Add LaTeX to Alt Text in the PDF

Once you have the LaTeX description, you can add it to the alt text of the corresponding figure tag in the PDF.

  • Right-click the figure that contains the math equation in Adobe Acrobat.
  • Select “Properties” from the menu.
  • Paste the LaTeX description into the “Alt Text” field.
  • Click “Close” to save your changes.

4. Test with a Screen Reader (JAWS)

After adding the LaTeX description, you should test it with a screen reader to ensure it works correctly.

When tested with JAWS, the screen reader will read something like this:

arduinoCopy code"Graphic: backslash, frac, left brace, negative b, plus minus, sqrt, left brace, b squared minus 4ac, right brace, right brace, over 2a."

Although this isn’t perfect, it’s much more understandable than the default output, and it helps users make sense of the equation.

Limitations of This Approach

Using LaTeX in alt text is a helpful workaround, but it has its drawbacks. Screen readers read the entire equation at once, preventing users from easily navigating through different parts of the equation, such as the numerator or the square root. This limitation highlights the need for better solutions, like MathML, which allows users to interact with equations more flexibly.

Alternative Solutions for Accessible Math

MathML in HTML and Word Documents

Though PDFs are widely used, HTML documents and Word files provide better alternatives for accessible math. Both formats support MathML, which allows screen readers to navigate equations step-by-step. For instance, a user reading the quadratic formula in an HTML document with MathML can explore different components of the equation, such as “numerator,” “denominator,” and “square root,” at their own pace.

However, PDFs are sometimes unavoidable, and that’s where the LaTeX alt text method becomes necessary.

Conclusion

While PDFs don’t support accessible math content natively, you can make math equations more accessible by embedding LaTeX descriptions in alt text. By using tools like Mathpix to extract LaTeX and add it to figure tags, you help screen readers interpret complex equations. Though this method is not perfect and alternatives like MathML in HTML or Word offer a better experience, the LaTeX method is a practical solution for accessible math in PDFs.

As digital accessibility continues to evolve, content creators must adopt these methods to ensure inclusivity for all users, especially in math-heavy content.

Let me be your champion for inclusion. I offer tailored solutions (and self-paced courses!) to ensure your documents meet and exceed compliance expectations. For more detailed insights, tutorials, and in-depth discussions on accessibility and related topics, don’t forget to check out my YouTube channel: The Accessibility Guy on YouTube. Subscribe for regular updates!


References

Share this post on:

Leave a Reply

Discover more from The Accessibility Guy

Subscribe now to keep reading and get access to the full archive.

Continue reading