MathJax

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. Pressbooks supports input provided using three different mathematical syntaxes for MathJax: while the focus here will be on LaTeX, it also supports AsciiMath, and MathML.

MathJax Tip

MathJax is activated and enabled as the default mathematics rendering solution for all hosted PressbooksEDU networks. This means it is automatically turned on if you do not enable the QuickLaTeX plugin.

Settings

Depending on which PressBooks installation you are working with, you may be able to adjust the settings on MathJax.

BCcampus Installation: the settings are locked down. Please contact BCcampus should you want to advocate for changes.

Institutional Installations: if your institution has it’s own installation of Pressbooks, you maybe be able to adjust the MathJax settings. You can find and change your MathJax settings by going to Settings > MathJax from the left sidebar menu.

You can change the text color of all equations in your book by insert the hex code for the color you’ve chosen into the form next to Text Color and saving your changes. The integral at the top of the page will refresh to reflect your changed settings.

Accessibility and Other Features

Within the webbook, readers can right click any equation rendered in MathJax to access additional display options and accessibility features.

MathJax settings menu from webbook

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.

Using LaTeX in MathJax

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$

Draft your LaTeX equations directly into the visual editor. 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.

REMEMBER: LaTeX expressions can be rendered with either MathJax or the QuickLaTeX plugin. Choose your method of rendering LaTeX based on which features you need for your book. Note that while MathJax and QuickLaTeX support similar syntaxes for creating mathematical expressions, there are some slight differences (detailed below).

For more details on how to use LaTeX, see LaTeX Project documentation.

Word Imports

If you are drafting in Microsoft Word before importing to Pressbooks, you may be interested in knowing how to format equations so that they can import correctly into Pressbooks. The following shortcodes can be used to convert your equations into MathJax-rendered expressions from imported Word docx files:

LaTeX

[la​tex]latex code here[/lat​ex]

OR

[equation]latex code here[/equation]

License

Icon for the Creative Commons Attribution 4.0 International License

LaTeX in Pressbooks: An Introduction and Workflow Copyright © by Caroline Daniels and Arianna is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book