This refers to Moodle 4.1 from December 2023 onward
Making use of MathJax in Moodle
MathJax is an open-source Javascript display engine for LaTeX and other formats that can represent mathematical notation. The University of Nottingham currently has the MaxJax filter installed in our Moodle VLE to enable mathematical notation to be displayed within module pages.
MathJax can be used to display mathematical notation within Moodle by using the text editor. This is particularly useful for:
- Adding mathematical notation to Moodle quiz question;
- Adding mathematical notation in a Moodle label;
- Adding mathematical notation in a Moodle book resource.
How to use MathJax in Moodle
The following example will show how to add an equation in a Moodle Label. However, the principle remains the same for quizzes and other resources. If you are able to use the text editor within Moodle then you will be able to add mathematical notation via the equation editor.
- Under the module title click on the 'More' tab
2. Once the More page loads press Filters from the list.
3. A new page will load, ensure that the "Active?" column for "MathJax" is set to 'Default (On)'. Then press 'Save changes' and click on the module tab to go back to the module page.
You will only need to do steps 1 - 3 once for each module. If the "MathJax" filter is turned on then it will display mathematical notation.
4. On the module page at the top right of the page click editing toggle so editing is on
5. Then press the Add an activity or resource link in the area you wish to add your content. Click the label resource.
6. You will be taken into the settings of a Label. Within the text editor you can write some text but when you come to write a mathematical equation click on the 'Calculator' icon button to launch the 'Equation editor'
7. The equation editor will launch. This editor is split into 3 sections.
The top section provides you with a list of characters separated by tabs to assist in writing mathematical notation.
The middle section is where you can build your equation by entering TeX syntax. For example:
More information about basic TeX commands can be found here by clicking this link. Below are some simple examples:
- Capital Greek letter e.g.\Delta = Δ
- Lower case Greek letter e.g. \alpha = α
- Superscript (on keyboard as Shift/6) is ^ e.g. x^2 gives x2
- Subscript (on keyboard as Shift/-) is _ e.g. x_7 gives x7
- Fraction is \frac e.g. \frac {1} {2} will give a half
The final section is the Equation preview. If you have written your equation correctly then you will see it displayed how it will look like in Moodle. If it looks incorrect then the equation will not display correctly and you will need to amend it.
8. If you are happy with how your equation looks press Save equation.
You will be taken back to the text editor and will see your Tex notation.
- If you wanted to you could then add another equation within the same text box using the same previous steps (6 - 7).
9. Once you are happy with your equation press 'Save and return to module'.
Finally you should see your equation displayed in Moodle.