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
- Go to Manage > Extend
- Search for the MathJax module and check the box next to it
- Click Install
Enable the MathJax module for the text editor
- Go to Manage > Configuration > Content authoring > Text formats and editors
- Find "Folwell CKEditor 5" and click Configure
- In the "Enabled Filters" section, check the box for MathJax
- 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.
- 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... \).
Display math
Centers the equation on a new, standalone line. By default, MathJax uses $$ ... $$ or \[ ... \]
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}
Roots
Use \sqrt{} or \sqrt[root]{}
Greek letters
Type a backslash before the letter name.
Examples: \alpha, \beta, \pi, \Sigma
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.
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}