Accessible Mathematical Equations in Drupal Lite

Setting up the MathJax module

Note: If you do not have access to these menu items, you may need to request OIT enable and setup the module for you.

Install the MathJax module

  1. Go to Manage > Extend
  2. Search for the MathJax module and check the box next to it
  3. Click Install

Enable the MathJax module for the text editor

  1. Go to Manage > Configuration > Content authoring > Text formats and editors
  2. Find "Folwell CKEditor 5" and click Configure
  3. In the "Enabled Filters" section, check the box for MathJax
  4. In the "Filter Processing Order" section, make sure MathJax is the last one in the list. You can click and drag the MathJax item to re-order it.
  5. Click Save Configuration

Using the MathJax module

To use LaTeX for math equations in MathJax, you must enclose your LaTeX code inside specific delimiters (special symbol or characters) so the MathJax JavaScript engine can identify and render it.

Inline math

Wraps the equation within the text flow. By default, MathJax uses \( ...equation here... \).

Inline Math Example


Display math

 Centers the equation on a new, standalone line. By default, MathJax uses $$ ... $$ or \[ ... \]

Display math example


Superscripts & Subscripts

Use ^ for exponents and _ for subscripts.

Use curly brackets {} for multi-character groups: 10^{25} renders as 1025.

Superscripts and subscripts example


Fractions

Use \frac{numerator}{denominator}

Fractions example


Roots

Use \sqrt{} or \sqrt[root]{}

Roots example


Greek letters

Type a backslash before the letter name.

Examples: \alpha, \beta, \pi, \Sigma

Greek letters example


Creating Multi-line Equations (Matrices & Alignment)

For complex equations or systems, MathJax supports standard LaTeX environments. You do not need outer $$ delimiters when using \begin and \end block structures.

Multiline examples

Equation alignment

Use the align environment to line up equations at the ampersand (&) symbol. Use double backslashes (\\) to break lines.

\begin{align}
y &= (x + 3)^2 \\
y &= x^2 + 6x + 9
\end{align}

Matrices

\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}