How to use LaTeX with LifterLMS

Overview

# Top

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.

Harmonic series.
Harmonic series generated and displayed using LaTeX code.

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:

  1. Globally enable LaTeX support on your site
  2. Locally add LaTeX code to your content

Enable LaTeX support on your site

# Top

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.

Navigate to the Writing tab of Jetpack settings

Step 3. Scroll down to the “Composing” section and toggle on LaTeX support. Make sure that these settings are saved.

Scroll down to the “Composing” section and toggle on LaTeX support

Add LaTeX code to your content

# Top

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.

Harmonic series.
Harmonic series generated and displayed using LaTeX code.

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]
Using the [latex]...[/latex] syntax.

You can use these syntaxes either inside a paragraph or between paragraphs, as shown in the example below.

Example math problem
Problem. Assume that [latex]n, m[/latex] are positive natural numbers (e.g., [latex]1,2,3, \\hdots [/latex]). Show that if [latex]n^{2} + m^{2}[/latex] is divisible by [latex]nm+1[/latex], it follows that

[latex]\\frac{n^{2} + m^{2}}{nm+1} = p^{2}[/latex]

for some positive natural number [latex]p[/latex].

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.

Where to add LaTeX content in LifterLMS

# Top

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.

Other Resources

# Top
Last Updated on
Was this article helpful?