Use the Editor
Add Mathematical Notation
Pressbooks offers two different methods for rendering mathematical equations in your books: via a native MathJax integration and through the WP QuickLaTeX plugin. MathJax is highly accessible and sufficiently capable for most users. WP QuickLaTeX allows to display more complex math and science notation.
Display Math with MathJax
📌 Requirements: Enterprise plan
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 renders math expressions with MathJax in the webbook and creates accessible image versions of equations and other mathematical markup for its EPUB and PDF exports.
Use LaTeX Syntax
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$
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
MathJax is capable of rendering AsciiMath, a client-side markup language for mathematics. There are two ways to use AsciiMath syntax in MathJax:
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 an XML-based mathematical markup language. To render MathML with MathJax, input the relevant expression using the Text 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>
Configure MathJax Settings
Click Settings > MathJax to access your MathJax settings page. If you do not see a MathJax settings option, this usually means that your book is using the WP QuickLaTeX plugin.
The MathJax settings page provides examples of support syntax and allows you to to change the text color of all equations in your book and select the font used when generating images for use in EPUB and PDF exports.
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. Learn more about MathJax’s accessibility features from their documentation.
Render LaTeX with WP QuickLaTeX
WP QuickLaTeX is a plugin that allows you to write native LaTeX syntax directly into your books wi