Help > Forum > Topics & Posts > Formatting math equations with MathJax
Formatting math equations with MathJax
You can automatically format math equations in your forum posts by adding a MathJax script. This ensures that any LaTeX-style equations posted by members are rendered in a clean, readable format.
Follow these steps to add the MathJax script to your forum:
- Log in to your Website Toolbox account.
- Click the Integrate link.
- Click HTML.
- In the Forum Head Tag HTML Code text box, add the following script:
- Save your changes.
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script>
window.addEventListener("DOMContentLoaded", function(){
jQ(window).on('replyPosted postEdited', function() {
MathJax.typesetPromise();
});
MathJax.typesetPromise(); // ensures rendering on page load
});
</script>
Common LaTeX commands for MathJax
You can use the following LaTeX commands to format equations:
| LaTeX Code | Description |
|---|---|
x^2 |
Superscript (exponent) |
x_1 |
Subscript |
\frac{a}{b} |
Fraction |
\sqrt{x} |
Square root |
\sqrt[3]{x} |
Cube root (or other roots) |
\sum_{i=1}^n i |
Summation |
\int_a^b f(x) dx |
Integral |
\pi \approx 3.14159 |
Greek symbols |
x = {-b \pm \sqrt{b^2-4ac} \over 2a} |
Quadratic formula (block equation) |
If you still need help, please contact us.