Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-4769

Use MathJax 3.2 in the app

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • DEV backlog
    • Filters
    • Hide

      Test this issue in 1 Android and 1 iOS device.

      Just test that, in general, MathJax continues working as it used to. We have some MathJax in our "4.4 site > Dev test course > Page with MathJax" and also in our "master site > Dev test course > Filters" section.

      There can be some small visual differences, like a different font or the text being a bit smaller, but that's normal. Unless the text is a lot smaller and cannot be read.

      Also test that there's horizontal scrolling when the formula is wider than the screen. You can test this in our "Page with MathJax" in 4.4 site mentioned above.

      Please notice that now we load the MathJax library the first time we need to treat an equation (instead of loading it on app start as we used to), to avoid loading it when it isn't needed. This means that, for slow devices, the first time an equation is loaded you could see the original text a bit before the final equations are rendered. In my tests this took between 20ms and 100ms to load, so you barely noticed it but my devices are quite fast.

      Show
      Test this issue in 1 Android and 1 iOS device. Just test that, in general, MathJax continues working as it used to. We have some MathJax in our "4.4 site > Dev test course > Page with MathJax" and also in our "master site > Dev test course > Filters" section. There can be some small visual differences, like a different font or the text being a bit smaller, but that's normal. Unless the text is a lot smaller and cannot be read. Also test that there's horizontal scrolling when the formula is wider than the screen. You can test this in our "Page with MathJax" in 4.4 site mentioned above. Please notice that now we load the MathJax library the first time we need to treat an equation (instead of loading it on app start as we used to), to avoid loading it when it isn't needed. This means that, for slow devices, the first time an equation is loaded you could see the original text a bit before the final equations are rendered. In my tests this took between 20ms and 100ms to load, so you barely noticed it but my devices are quite fast.
    • Moodle Apps Sprint 2025-I1.4

      In MDL-75486 the MathJax version is being upgraded to 3.2.

      I've been looking at the documentation to upgrade from v2 to v3 and it seems most of the breaking changes affect configuration, API and output, they aren't changes that affect end users. I think the only breaking changes that affect end users are the ones described in the "Input Changes" section:

      • The \color macro has changed. This means that, after upgrading to v3, some text might appear with the wrong color.  E.g. $$\color{red}Test$$ displays the word "Test" in red in v3, but in v2 it only displays the letter T in red. This is just a visual problem, and there is some syntax that works in both versions (e.g. $${\color{red} Text}\$$ works for both versions).
      • Some extensions names have changed when using the \require macro. E.g. in v3 it's \require{amscd} while in v2 it's \require{AMScd}. This seems a quite advanced feature, and I guess users could put both requires in the content so it works in both versions of MathJax, but this is just a guess. EDIT: This workaround is not valid, please see the comments.

      Besides those, there are few things that haven't been ported to v3 yet but will be added in the future. These limitations also affect Moodle LMS:

      • Localization is now in English only. In the app we disabled the menus opened when right clicking formulas, so I guess this could only affect a11y (I'm not sure if it affects or not). 
      • Automatic line breaking support is not supported in v3 yet, it will be added in the future.
      • Now the MathJax output only supports one font. This is just a visual limitation.
      • The begingroup and mediawiki-texvc TeX extensions haven’t been ported to version 3 yet, but should be in the future.
      • The auto-collapse assistive extension is not yet available for version 3. 

      Since the 2 first breaking changes are either visual or advanced, and the rest of limitations are temporary and also affect Moodle LMS, we decided that in the app we will always use MathJax v3.2, no matter which site the app is connecting to. Of course we can re-evaluate this in the future if we detect this is causing problems to end users.

        1. MOBILE-4769_Filter_pageTitle1_app.png
          213 kB
          Isabel Renedo Rouco
        2. MOBILE-4769_Filter_pageTitle2_app.png
          98 kB
          Isabel Renedo Rouco
        3. MOBILE-4769_Filter_pageTitle1_browser.png
          18 kB
          Isabel Renedo Rouco
        4. MOBILE-4769_Filter_pageTitle2_browser.png
          20 kB
          Isabel Renedo Rouco
        5. MOBILE-4769_Filter_pageTitle_courseIndex_app.png
          188 kB
          Isabel Renedo Rouco
        6. image-2025-05-05-20-22-52-548.png
          48 kB
          Isabel Renedo Rouco

            dpalou Dani Palou
            jleyva Juan Leyva
            Pau Ferrer Pau Ferrer
            Isabel Renedo Rouco Isabel Renedo Rouco
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 25 minutes
                25m

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