Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-85155

MathJax fonts do not load if loaded from local hosted instance, with Moodle 5 only

XMLWordPrintable

    • MOODLE_500_STABLE
    • MOODLE_500_STABLE
    • MDL-85155-main
    • Hide

      MathJax via CDN:

      1. Log in as admin
      2. Navigate to Admin -> Plugin > Filters -> MathJax.
      3. Set the MathJax URL to: https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-mml-chtml.js
      4. Save changes.
      5. Turn on Browser developer tool. Switch to Console tab.
      6. Edit profile.
      7. Try to insert text with Equations. For example:

        When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
        $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
        

      8. Update profile.
      9. Verify that you will see the rendered Equations.
      10. Verify that you will not see any errors in the Console related to woff files

      MathJax locally:

      1. Download the MathJax-3.2.2.zip file.
      2. Extract and copy all the content inside to lib/mathjax
      3. Log in as admin
      4. Navigate to Admin -> Plugin > Filters -> MathJax.
      5. Set the MathJax URL to: /lib/mathjax/es5/tex-mml-chtml.js
      6. Save changes.
      7. Turn on the Browser developer tool. Switch to Console tab.
      8. Edit profile.
      9. Try to insert Equations.
      10. Update profile.
      11. Verify that you will see the rendered Equations.
      12. Verify that you will not see any errors in the Console related to woff files
      Show
      MathJax via CDN: Log in as admin Navigate to Admin -> Plugin > Filters -> MathJax. Set the MathJax URL to: https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-mml-chtml.js Save changes. Turn on Browser developer tool. Switch to Console tab. Edit profile. Try to insert text with Equations. For example: When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ Update profile. Verify that you will see the rendered Equations. Verify that you will not see any errors in the Console related to woff files MathJax locally: Download the MathJax-3.2.2.zip file. Extract and copy all the content inside to lib/mathjax Log in as admin Navigate to Admin -> Plugin > Filters -> MathJax. Set the MathJax URL to: /lib/mathjax/es5/tex-mml-chtml.js Save changes. Turn on the Browser developer tool. Switch to Console tab. Edit profile. Try to insert Equations. Update profile. Verify that you will see the rendered Equations. Verify that you will not see any errors in the Console related to woff files
    • Hide

      Code verified against automated checks.

      Checked MDL-85155 using repository: https://github.com/HuongNV13/moodle.git

      More information about this report

      Built on: Fri Apr 11 05:29:55 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-85155 using repository: https://github.com/HuongNV13/moodle.git main (0 errors / 0 warnings) [branch: MDL-85155-main | CI Job ] More information about this report Built on: Fri Apr 11 05:29:55 UTC 2025
    • 2
    • Team Hedgehogs 2025 Sprint 1.4

      MathJax fonts do not load, console shows 404 error, and manual loading of font URL (e.g. http://<Moodle URL>/lib/javascript.php/1744220663/lib/MathJax/es5/output/chtml/fonts/woff-v2/MathJax_Zero.woff) output "No valid javascript files found".

      Steps to reproduce:

      1. Install a fresh Moodle 5 rc2 instance
      2. Download MathJax and install it into /lib/MathJax
      3. Update MathJax plugin setting httpsurl to /lib/MathJax/es5/tex-mml-chtml.js
      4. Save
      5. Using the text editor, write an equation anywhere in Moodle
      6. Observe that MathJax displays the equation, but MathJax fonts aren't loaded. Open the console to see the 404 errors mentioned above.

      Note: These same steps on a freshly installed Moodle 4.5.3+ do not present this faulty behaviour. This issue occurs only with Moodle 5 version.

      This is a big problem for offline versions of Moodle (e.g. MoodleBox), that notably cannot provide Math quiz.

        1. Errors in console.png
          Errors in console.png
          204 kB
        2. MathJax-3.2.2.zip
          5.96 MB
        3. MDL-85155_OK.png
          MDL-85155_OK.png
          95 kB
        4. MDL-85155.png
          MDL-85155.png
          213 kB
        5. No fonts in math.png
          No fonts in math.png
          52 kB
        6. Plugin settings.png
          Plugin settings.png
          190 kB

            huongn@moodle.com Huong Nguyen
            mina Nicolas Martignoni
            Raquel Ortega Raquel Ortega
            Jun Pataleta Jun Pataleta
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            8 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours, 38 minutes
                6h 38m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.