"

Accessibility in Your OER

5.7 Accessible Formulas in Pressbooks

Theresa Huff

Accessibility Standard – Formulas

Plain text equations use proper symbols and interpretation, and complex equations either use MathML rendered in MathJax for stand-alone equations or LaTeX rendered in MathJax if used within paragraphs or sentences.

What are formulas?

Formulas refer to math equations and science formulas.

File types used:  MathML, LaTeX

For whom are you doing this?

This work supports students who:

  • Are blind or have low vision
  • Have a form of cognitive disability
  • Have a physical disability

Why is this important?

For learners who are using screen readers or are blind or low vision, math and chemical equations can be very difficult to understand or visualize. Additionally, when using LaTeX or other equation formatting tools, some screen readers cannot read the equations at all. By taking a few extra steps, OER authors and editors can ensure all users have access and understanding of the content.

What do you need to do?

Accessibility Checklist – Formulas

o Equations written in plain text use proper symbols (i.e., −, ×, ÷).[1]

o For complex equations, one of the following is true:

  • They were written using MathML and are rendered with MathJax (Pressbooks).
  • If placed within paragraphs or sentences, they were written using LaTeX and are rendered with MathJax (Pressbooks).

o Written equations are properly interpreted by text-to-speech tools.[2]

There are a few things to know in order to make formulas and equations accessible in your OER Pressbook.

MathJax

MathJax is an open source JavaScript display engine that translates mathematical markup into accessible, high resolution equations that can be rendered in any supported book format on Pressbooks.

Options available from MathJax by right-clickingWithin a Pressbook, readers can right click an equation rendered in MathJax to access additional display options and accessibility features. Options include the ability to magnify any equation on click or hover, the ability to display the math in HTML, SVG, and other formats, and more. For more information on the accessibility features and other settings available from MathJax, check out MathJax’s documentation

Pressbooks has MathJax already integrated in all Pressbooks, so you do not need to activate it. It is ready to go. While this is great news, MathJax will only interpret the equations that are in a math language, such as MathML or LaTeX. So, it is up to the author of the OER to use a math language to input their equations in their Pressbook. It is also up to the author to use the most accessible math language. For example, while LaTeX can be rendered with MathJax, some screen readers cannot read the LaTeX math language.

If you are new to using math languages, or unsure which to use and how to input the equations to ensure they are accessible in your OER Pressbook, have no fear. The options below provide scenarios, step-by-step guidance, and walk through videos to support your work.

View the video or read the text below the video for the steps in making formulas accessible in your OER Pressbook.

Best Choice: Use MathJax with MathML format

MathJax supports input provided by both LaTeX and MathML math languages. However, while LaTeX allows for many accessible features, it is not readable by a screen reader. Therefore, the best choice for accessibility is to create your formula or equation in MathML and then copy and paste it into your Pressbook’s html. 

Exception: If your formula or equation is in the middle of a paragraph or sentence, using the LaTeX math language might be the better choice. Since equations using MathML include a buffer of white space around them, it can disrupt the reading within a paragraph or sentence. In these rare cases, using LaTeX might be the better option.

Creating Your Formulas

You do not need to know html, LaTeX, or MathML languages to create a formula or equation. You can use your favorite AI tool or the free-for-30-days Google Chrome extension, Equatio, to easily create your math or chemical formulas.

Using an AI Tool

You can use your favorite free AI tool, such as ChatGPT, to translate your formula from one code language to another. Simply give the AI tool a prompt such as:

You are a math language and coding expert. Translate this formula into MathML language:

Keq=[H2][F2][HF]2

or

You are a math language and coding expert. Translate this formula into LaTeX language:

Keq=[H2][F2][HF]2

and select the return or enter arrow.

AI translated formula in MathML and copy code
A copyable ChatGPT-generated translation of a math formula into MathML

The AI tool will translate your formula into the requested language [1]. Then, you can copy the code [2] to be used where you like.

Using Equatio

Equatio is used as a Google extension in a Chrome browser, which means, as long as you are using your Chrome browser to work on your Pressbook, Equatio will pop up at the bottom of your screen while you edit your Pressbook. Note that Equatio has recently moved to a subscription model, but you can use it free for 30 days.

Step 1: Get the Equatio Google Chrome Extension

Once you have installed the Equatio Google Chrome extension, select it from your Google extensions. You’ll see the Equatio editor appear at the bottom of your screen.

Equatio tool bar

Step 2: Export as MathML formula

Equatio editor

In the MathML formula editor, type, speak, write, or use another math language to input the formula you wish to create [1]. Equatio will offer suggestions as you type, which you can accept by selecting Enter on your keyboard. Once your formula is ready, select the export icon at the bottom right [2], and select MathML. 

Equatio copied pop up

A notice will appear stating that your formula has been placed on your clipboard and can be pasted where you wish using CTRL + V. Select OK.

Step 3: Place the MathML formula in your Pressbook.

Pressbooks Text editor

In Pressbooks, place your cursor on the page where you would like the formula to appear [1]. Then, select the Text (html) version of the page [2].

Pressbooks html editor

You will see your cursor blinking before a piece of code   [1]. On your keyboard, select Ctrl + V to paste the MathML code for your formula [2]. Then select the Visual version of your page [3] to return to your editor.

Pressbooks editor with pasted MathML formula

You will now see your formula which is accessible and able to be read by a screen reader.

More Equatio Resources

Revising an OER with LaTeX Equations

If you are revising an OER in which the equations used LaTeX, you can easily translate the LaTeX to MathML using MathJax.

Step 1

Right-click on the equation. Hover over Show Math As and then select MathML Code.

MathML code

Step 2

A pop-up box with the equation in the MathML math language will appear. Copy all of the text from the pop-up box.

Step 3

Continue from Step 3 above to place the MathML version of the equation in your Pressbooks chapter.

Step 4

Delete the LaTeX equation from the page.

 

Second Choice: LaTeX for Special Cases

In some cases, it may be best to use LaTeX rather than MathML. MathML will force extra padding or space around the equation in your Pressbook chapter. If you are using an equation in the middle of a paragraph or sentence, this added white space may disrupt the paragraph or sentence for the reader. In this case, you could opt to use the LaTeX math language. Because MathJax is integrated with Pressbooks, users can right-click on the LaTeX equation and translate the equation into MathML code. Then, the screen reader can read the MathML math language. Because it adds an extra step to the user, it is not the first choice, but in order to make it work in a sentence or paragraph, it is the next best thing.

steps for inputing latex

Step 1: Create your formula

If you do not know LaTeX math language, you can use the Equatio tool described in the above section to translate your equation into the LaTeX math language.

Step 2: Input LaTeX into Pressbooks

steps for inputing latex

Place your cursor in your Pressbooks chapter where you want the equation to appear [1]. Select the Insert LaTeX icon from the visual editor [2]. Copy and paste or draft your LaTeX equations directly into the visual editor [3]. Select OK [4].

Note: There are two ways to use LaTeX syntax in MathJax:

      1. Shortcode syntax: 
        [la​tex]e^{i \pi} + 1 = 0[/lat​ex]
      2. Dollar sign syntax:
        $latex e^{i \pi} + 1 = 0$

Step 3: View the equation

LaTeX equations display the LaTeX language in the visual editor. However, when you Preview your Pressbook chapter, you will be able to see how they would appear to a user.

Resources for writing in LaTeX:

Last Choice: Use An Image with an alt tag

Though theoretically using a screenshot of an equation with an alt tag that explains its purpose to the user sounds like a viable option, we do not recommend using images and alt tags for equations in your OER Pressbook for several reasons:

  1. When users enlarge the image, it can be blurry. Using MathJax with MathML or LaTeX allows users to enlarge and clearly inspect the equation. Therefore, using an image instead of MathJax may create a barrier for accessibility.
  2. The alt text should be only about 1-2 sentences long. This is not usually long enough to explain a complex equation. Since a screen reader can read MathML equations, it is a better alternative than using alt text.

Example 1: An equation in HTML

m equals begin fraction m sub 0 over begin square root 1 minus begin fraction v sup 2 over c sup 2 end fraction end square root end fraction

View the alt tag:

alt = “m equals begin fraction m sub 0 over begin square root 1 minus begin fraction v sup 2 over c sup 2 end fraction end square root end fraction”

Self-Comprehension Check

After reviewing this page, test your knowledge with the questions below.

Licenses and Attributions

“Accessible Formulas in Pressbooks” by Theresa Huff is adapted from “Formulas- Accessibility Toolkit – 2nd Edition” by Amanda Coolidge, Sue Doner, Tara Robertson, and Josie Gray for BCcampus, used under a CC BY 4.0 license and MathJax – LaTeX in Pressbooks: An Introduction and Workflow” by Caroline Daniels and Arianna under a CC BY 4.0 license. “Accessible Formulas in Pressbooks” is licensed under CC BY 4.0.

 


  1. For example, a hyphen (-) may look like a minus sign (−), but it will not be read out correctly by text-to-speech tools
  2. Written equations should prioritize semantic markup over visual markup so text-to-speech tools will read out an equation in a way that makes sense to auditory learners.

License

Icon for the Creative Commons Attribution 4.0 International License

Open Voices, Just Choices: OER for Social Justice Faculty Handbook Copyright © by Karna Younger and Theresa Huff is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.