MathJax is an open-source JavaScript engine that automatically renders typeset mathematical notation in all modern web browsers.
When the MathJax module is enabled, LaTeX notation entered into the WYSIWYG editor will display as mathematical formulas in your content.
Mathematics inside specified delimiters will be rendered by MathJax. The default delimiters are $$...$$
and \[...\]
for mathematics that display on a separate line, and $...$
and \(...\)
for in-line mathematics.
Code Example: \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)
Rendered Example: \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)
Code Example: $\mathrm{A} \alpha \: \mathrm{B} \beta \: \Gamma \gamma \: \Delta \delta$
Rendered Example: $\mathrm{A} \alpha \: \mathrm{B} \beta \: \Gamma \gamma \: \Delta \delta$
Code Example: The following example renders on its own line, centered: $$f(n) =
\begin{cases}
n/2, & \text{if $n$ is even} \\
3n+1, & \text{if $n$ is odd}
\end{cases}$$
Rendered Example: The following example renders on its own line, centered: $$f(n) =
\begin{cases}
n/2, & \text{if $n$ is even} \\
3n+1, & \text{if $n$ is odd}
\end{cases}$$
When MathJax is active, if the page content includes multiple dollar amounts, the in-between text will try to render as a math formula. For this use case, you should escape the dollar sign with a backslash.
Code Example: Early-bird registration is \$250
. The normal registration price is \$300
.
Properly Rendered Example: Early-bird registration is \$250. The normal registration price is \$300.
Incorrectly Rendered Example: Early-bird registration is $250. The normal registration price is $300.
MathJax will not affect mathematics that are wrapped in a <code> tag.
If the $\LaTeX$ formulas render as raw code on your live site, it is likely that the MathJax module has not yet been enabled. This is a possible scenario following a site migration.
For more information, tutorials, and examples; check out this MathJax documentation page.