Tex filter or MathJax filter?

Tex filter or MathJax filter?

by Susana L. -
Number of replies: 8

Hi!

I'm not able to find significant reasons why choose MathJax filter instead of the core Tex notation filter to render tex expressions.
I'm sure I may be missing something... Can anyone please give me some reasons?

Thank you!
Best regards,
susana 

Average of ratings: -
In reply to Susana L.

Re: Tex filter or MathJax filter?

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Good question Susana, and for me, it is only a personal choice. I have become a little familiar with TeX over the years and I actually find it easier to just code things, but having said that, for anyone not familiar with TeX, or coding standards, building expressions and equations using MathJax is a lot less of a learning curve. 

I found that a lot of other Maths and Science teachers want easy, less time consuming tools to do things, so have them using MathJax rather than try and teach them TeX. Saves me a lot of argument, ego wrestling and dummy spitting. 

In reply to Susana L.

Re: Tex filter or MathJax filter?

by Mauno Korpelainen -

For typical user it does not matter (a lot) which filter you select - if you need to use a filter - both filters allow some features of (La)TeX and restrict many advanced features of Latex and MathJax. In both filters you have options to change many default settings in administration menu so you can also enable Tex filter and use MathJax with any configuration (and custom delimiters) through Additional HTML (Site administration > Appearance > Additional HTML). Some advantages of MathJax are reported in http://www.mathjax.org/ and you can also check pages like http://www.math.union.edu/~dpvc/talks/2013-01-11.jmm/TOC.html - note however that default settings of MathJax filter do not use all the features of those small demos.

For example you can use colors in syntax: \[ \bbox[#FD9,border:2px solid purple,10px]{ \bbox[red]{r} + \bbox[green,5px]{\color{yellow}{g}} + \bbox[border:2px dashed blue,3px]{b} } \]
Typically MathJax takes font color from surrounding text (HTML elements) $$ x = {-b\pm\sqrt{b^2-4ac}\over 2a} $$ so you can use normal html tags to style or scale mathematical elements or even unicode characters with styles

$$ \unicode{10086} $$

Average of ratings: Useful (1)
In reply to Mauno Korpelainen

Re: Tex filter or MathJax filter?

by Geoffrey Rowland -
Picture of Plugin developers

As detailed in a parallel thread, with Moodle 2.8 it is now possible to have both the MathJax and TeX filters enabled.

All other things being equal, I prefer MathJax for better accessibility and better quality of rendering (though the new SVG TeX rendering, in Moodle 2.8 is also good). Also, it is relatively easy to add MathJax support to other Moodle-linked e-Learning applications such as Mahara. So, you can give your users a reasonably consistent experience in rendering equations etc on different systems. Since Google Chrome/Chromium dropped support for MathML, MathJax has become the de facto standard for Maths display on the Web.

That said, for complex content MathJax rendering can be slow. Having (cached) SVG/PNG TeX rendering as well can help with this. Also, the recently released MathJax 2.5 is reported to have significant performance improvements.

On occasion, you may encounter MathJax clashes with other JavaScript/AJAX libraries, e.g. perhaps with some third-party Moodle modules. In such cases just using the TeX filter alone may provide a useful workaround.

Average of ratings: Useful (1)
In reply to Susana L.

Re: Tex filter or MathJax filter?

by Susana L. -

Thank you for your input!

We will use Moodle 2.7 on the next academic year... and it is very important for us to keep backward compatibility in formulas. We use Moodle since 2006, and we have teachers that have hundreds of quiz questions using tex formulas. My fear is that only enabling MathJax (and even enabling "TeX filter compatibility") we may loose some backward compatibility...

I read on the parallel thread mentioned by Geoffrey, something like enabling both filters. I wonder if we can use MathJax on top (svg output, better accessibility, better rendering) and Tex filter for backward compatibility. Does this make sense?

Thank you!
susana

In reply to Susana L.

Re: Tex filter or MathJax filter?

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

Perhaps the best way to do this with Moodle 2.7 is to have MathJax filter enabled with backward compatibility on, and to have TeX filter configured as before, but set by the admin to 'Off, but available' in the Manage filters settings.  Teachers would then be able to switch to TeX filter whenever needed if a compatability issue appears.

Average of ratings: Useful (2)
In reply to Daniel Thies

Re: Tex filter or MathJax filter?

by Susana L. -

Thanks Daniel. That may be a good approach. I will set it that way.

In reply to Susana L.

Re: Tex filter or MathJax filter?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Test it. Make a copy of your site (Moodle migration) where you can test the upgrade to 2.8, or any other change, and then see if all your quizzes still work there.

In reply to Tim Hunt

Re: Tex filter or MathJax filter?

by Susana L. -

Hi Tim. We will make a fresh moodle (2.7) install (no upgrades). 2015/16 courses are automatically created and then teachers backup/restore their content in their new courses.

We will test some restored questions as you recommend.

Thank you,
susana