Using LaTeX in WordPress

This note records the basic setup I used for writing LaTeX equations in WordPress with the MathJax-LaTeX plugin.

1. Install the MathJax-LaTeX plugin

Install and activate the MathJax-LaTeX plugin from the WordPress plugin page. After activation, open the plugin settings and decide whether MathJax should be loaded on every page.

2. Choose whether to force-load MathJax

If you do not enable Force Load, MathJax is loaded only when the post explicitly asks for it. In that case, put this shortcode before the first LaTeX equation in the post:

[mathjax]

To disable MathJax processing in a post or section, use:

[nomathjax]

Also check the Use wp-latex syntax option. If that option is unticked, this syntax will not be available:

$your equation$

3. Test equation syntax

After the plugin is configured, test the common inline and display forms in a draft post:

$$E=mc^2$$
\[E=mc^2\]
\(E=mc^2\)
$latex E=mc^2$  % only if wp-latex syntax is enabled

The corresponding result should render as:

$$E=mc^2$$

\[E=mc^2\]

\(E=mc^2\)

$latex E=mc^2$

If the equations appear as plain text, check the following points:

  1. The MathJax-LaTeX plugin is active.
  2. The post contains [mathjax] when Force Load is disabled.
  3. The syntax you are using matches the plugin settings.
  4. Any page cache has been cleared after changing the plugin configuration.

Leave a Reply