"

31 Formulas

In this section, we review how to add accessible formulas to content.

What are formulas?

Formulas refer to math equations and science formulas.

File types used:  LaTex, MathType

Who are you doing this for?

This work supports students who:

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

What do you need to do?

There are several ways to handle equations, from images with alt tags to MathML. Having access to an equation editor such as MathType or MathMagic can streamline processing and converting equations. These tools are similar to equation editors found in Microsoft Office.

Display Math with MathJax

MathJax is an open source JavaScript display engine that translates mathematical markup into accessible equations on the web. Pressbooks features a native integration with MathJax that uses MathJax to render LaTeX expressions, AsciiMath and MathML input in the webbook and creates accessible image versions of these expressions in EPUB and PDF exports.

Use LaTeX Syntax

There are four ways to use LaTeX syntax with our native MathJax solution:

Shortcode syntax:

[latex]e^{i \pi} + 1 = 0[/latex]

Inline math delimiter:

\( e^{i \pi} + 1 = 0 \)

Display math delimiter (centers math on its own line):

\[ e^{i \pi} + 1 = 0 \]

Dollar sign syntax (centers math on its own line):

$$ e^{i \pi} + 1 = 0 $$

There are two ways to add LaTeX:

  • You can use the Insert LaTeX button in the visual editor. This will add LaTeX with the shortcode syntax.
  • You can add the syntax delimiters to an expression manually.

Note that equations will not display fully formatted in the editor. However, you can view the webbook or export your files at any time to see how the equations appear. Learn more about LaTeX from their documentation.

Use AsciiMath Syntax

The native Pressbooks solution is also capable of rendering AsciiMath, a client-side markup language for mathematics. There are two ways to use AsciiMath syntax with the built-in Pressbooks MathJax renderer:

Shortcode syntax:

[asciimath]e^{i \pi} + 1 = 0[/asciimath]

Dollar sign syntax:

$asciimath e^{i \pi} + 1 = 0$

AsciiMath can be drafted directly in the visual editor. Learn more about AsciiMath from their website.

Use MathML Syntax

MathML is a text-based XML (short for “extensible markup language”) designed for math equations. Browsers that support MathML are able to translate the XML into a formatted equation. Since MathML with MathJax can be rendered in many systems, including HTML, Angel, and Drupal, it is considered the best choice for accessibility.

Here is information about creating and viewing MathML.

MathML may vary from system to system and the content can change rapidly.

To render MathML with MathJax, input the relevant expression using the Code Editor:

Example:

<math><mrow><mrow><msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo><mrow><mn>4</mn><mo>⁢</mo><mi>x</mi></mrow><mo>+</mo><mn>4</mn></mrow><mo>=</mo><mn>0</mn></mrow></math>

Learn more about MathML from the W3C's documentation page.

Configure MathJax Settings

Click Settings > MathJax to access your MathJax settings page. The MathJax settings page provides examples of support syntax and allows you to change the text color of all equations in your book.

Use MathJax's Accessibility Features

Within the webbook, readers can right click any 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.

Image with an alt tag

A safe option is to create an image of an equation (or export it from an equation editor) and then insert the image into a document with an alt tag.

Note: Alt tags can be written in Nemeth MathSpeak for students who have learned that system.

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”

LaTeX

LaTeX is a math markup language familiar to many in the science and math community. Unfortunately, it is not currently supported by screen reader technology. It is, however, fairly simple to convert LaTeX to an image or MathML in most equation editors.

To import LaTeX, follow these steps in MathMagic and MathType:

  1. Copy a piece of LaTeX code such as
    m &= \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}
    into an equation editor’s main editing window.
  2. The equation should appear fully formatted. Make minor adjustments as needed.

Additional resources

Math accessibility at Portland Community College

In 2012, Portland Community College departments took a closer look at making math accessible to blind students. Read more about the math accessibility study.

Watch Math Accessibility at Portland Community College. (This video is an open educational resource.)

Text attributions

This chapter is a derivative of Equations: MathML, Images and LaTeX by Penn State. Penn State has provided permission to the authors to use this information under the license of the toolkit.

This chapter is adapted from the BCcampus Open Textbook Accessibility Toolkit, Chapter 8: Formulas, authored by Amanda Coolidge, Sue Doner, and Tara Robertson, published under a Creative Commons Attribution 4.0 International License.

Sections on MathJax in Pressbooks are adapted from the Pressbooks User Guide, chapter Add Mathematical Notation, published under a Creative Commons Attribution 4.0 International License.

License

Icon for the Creative Commons Attribution 4.0 International License

Getting Started with Open Educational Resources Copyright © 2019 by Mahrya Burnett, Jenay Solomon, Heather Healy is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.