How to use LaTeX with LifterLMS
One way to typeset mathematical expressions/statements, and then display them beautifully on the browser is to encode them as LaTeX code. For example, to display the output below, instead of typing 1 + 1/2 + 1/3 + 1/4 + 1/5 + …
, you would type this in LaTeX code as 1 + \\frac{1}{2} + \\frac{1}{3} + \\frac{1}{4} + \\frac{1}{5} + \\hdots
.
LifterLMS does not offer built-in support for typesetting mathematical expressions and statements using LaTeX code. As a result, you need to install a third-party plugin in order to do that.
The free Jetpack plugin is a popular choice for adding support for LaTeX in a WordPress website. In this help document, you’ll learn how to use the Jetpack plugin to add LaTeX code to your LifterLMS content (e.g., lesson pages, course pages, quiz questions, assignments, etc.).
In general, there are only two steps that you need to follow:
- Globally enable LaTeX support on your site
- Locally add LaTeX code to your content
Step 1. Install and activate the Jetpack plugin. You can follow our how-to guide on installing WordPress plugins if you are not sure how.
Step 2. In the WordPress admin go to Jetpack > Settings > Writing.
Step 3. Scroll down to the “Composing” section and toggle on LaTeX support. Make sure that these settings are saved.
Your LaTeX code must be enclosed in an opening [latex]
shortcode tag and a closing [/latex]
shortcode tag. For example, suppose you want to output the following image below using LaTeX.
In this case, either one of the following codes will be fine. However, to avoid any potential conflicts with third party plugins which might be putting a special meaning on the $ symbol, we recommend using the [latex] … [/latex]
shortcode syntax when trying to add content inside LifterLMS instead of the $latex … $
syntax.
[latex]1 + \\frac{1}{2} + \\frac{1}{3} + \\frac{1}{4} + \\frac{1}{5} + \\hdots[/latex]
[latex]...[/latex]
syntax.You can use these syntaxes either inside a paragraph or between paragraphs, as shown in the example below.
If this is your first time using LaTeX and you are unfamiliar with what to put between [latex]
and [/latex]
, you can start with this free online introduction to LaTeX from overleaf.com.
Any area that renders a WordPress shortcode should be able to display LaTeX content when you use the [latex]...[/latex]
shortcode syntax.
For example, you can add LaTeX code in the following areas in LifterLMS. Note that this is not an exhaustive list, so you might find other areas not listed here.
- Inside lesson pages, course pages, and membership pages when using either the default block editor or the classic editor.
- Inside the quiz description.
- Inside a question description.
- Inside the assignment description. To add assignments to your lessons, you need to first install the LifterLMS Assignments add-on.