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.
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.
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:
- Shortcode syntax:
[latex]e^{i \pi} + 1 = 0[/latex] - 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.
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
[latex]latex code here[/latex]
OR
[equation]latex code here[/equation]