QuickLaTeX
QuickLaTeX is a plugin that allows users to write native LaTeX syntax directly into their books without wrapping shortcodes around every part of every equation. QuickLaTeX can be used as an optional replacement for MathJax.
Activating QuickLaTeX
To enable the QuickLaTeX plugin:
- Go to your book’s dashboard
- Click the Plugins tab on the left-hand menu of your screen
- Scroll to WP QuickLaTeX
- Click Activate
Once you’ve enabled the QuickLaTeX plugin, you can format equations with any of the following syntaxes:
- [ … ]
- ( … )
- …
- Environments: equation, align, displaymath, eqnarray, multline, flalign, gather, and alignat
The QuickLaTeX plugin also supports TikZ graphics and other commands that may not be supported using regular LaTeX. For more information about commands and notation in LaTeX, see
Writing with QuickLaTeX
Now that the plugin is activated, you can create formulas in the text window by using typed commands. Information about how to use QuickLaTeX can be found in the settings menu. You can also make several other adjustments for how you want your formulas to look.
Help with QuickLaTeX code
Here is a cheatsheet which lays out common symbols and how to write them.
Here is a comprehensive list of all LaTeX symbols and how to write them.
Inserting the Code into your Chapter
Add the shortcode to the top of your chapter. Once you’ve written at the top of a chapter, LaTeX is active for that entire chapter, and everything written in LaTeX syntax will be translated by QuickLaTeX. For example if you were to input the following:
QuickLateX would render this information like this.
You can insert formulas such as directly into the body of the text or on a separate line:
Doing that will create an un-numbered equation. If you want to number your equations so that you can easily refer to them, start and end your equation with “\begin {equation}” and “\end {equation}” (remove the spaces). This will result in the equation having a number to the right which you can reference in the text.
Customizing QuickLaTeX
To customize your QuickLaTex, navigate to Settings > QuickLaTeX on the left-hand menu of your book’s dashboard.
You can customize QuickLaTeX settings available from the Basic Settings tab or the Advanced tab.
Basic Settings:
- Font size
- Font color
- Background color
- Equation alignment
- Equation number position
Advanced Settings:
- Use LaTeX syntax sitewide
- Exclude $ from syntax interpretation
- Set LaTeX preambles
For more information on QuickLaTeX, visit the website for the plugin.
Other Uses for LaTeX
LaTeX can also be used for individual special characters. While Pressbooks supports as wide a range of special characters as possible, it may be that you find a character you need displaying as a question mark in your outputs. To fix this, find the character code you need and wrap it in the LaTeX shortcode.
Math Within Other Book Elements
Math in most syntaxes should be compatible with most elements in your book, including image captions, textboxes, body text, and more. Here are a few exceptions:
- Any shortcode within another shortcode. Shortcode elements will break when placed inside of another shortcode. This means that the shortcodes cannot be nested inside of footnotes, image captions, or any other shortcode element. See Shortcodes for a full list of elements in Pressbooks that are or can be created with shortcodes. However, both AsciiMath and LaTeX offer a non-shortcode syntax, which we recommend using if you’re placing math inside of a shortcode element.
- Titles. Equations won’t look good inside of a title because the style of the math will override the style of the heading. The code used to create the equation may also display in the table of contents.
- Running content. Similar to titles, the code used to create the equation may display in the running content.
Render LaTeX in H5P Activities
You can render LaTeX inside of H5P activities you’ve created in Pressbooks, but you’ll first need to add the mathematics library to your book’s H5P libraries page.
To do this:
- Activate the H5P plugin
- Download H5P’s mathematics library to your device
- Click H5P Content > Libraries from the left sidebar menu
- Click Choose File and select the H5P mathematics library file you downloaded in step 2.
- Click Upload
Feedback/Errata