begin{matrix*} and mathtools package

begin{matrix*} and mathtools package

by Marinda Faasen -
Number of replies: 3

Hi

I would like to use the begin{matrix*} command, but it is part of the mathtools package and not the amsmath package. Is it possible to also import the mathtools package and how?

I have to be honest here and confess that I only sort of understand how the whole Tex  / Mathjax and everything else works.  I'm still investigating the whole Mathematics tools setup.  I have a Moodle 2.7 installation and I use the equation editor which is part of the Atto editor. I am using Mathjax, but I also have Tex enabled. I usually just type the Latex, but the equation editor is quite cool and does save time. 

Marinda



Average of ratings: -
In reply to Marinda Faasen

Re: begin{matrix*} and mathtools package

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

Hello Marinda,

This is easy to do with the TeX notation filter as long as the package is part of your systems TeX distribution.  Go to Site settings->filters-TeX notation page and enter \usepackage{mathtools} under \uspackage{amsmath} in the Preamble area.

With MathJax. standard Latex packages like this can not be simply imported.  It normally requires having an extension written in javascript. There are some standard extensions available and some contributions you may be interested in.

There is not currently an advantage for running both filters at the same, but this a good example for having both available for use. On pages on which you use mathtools you would need to disable MathJax and enable TeX notation on the Course administration menu.

It is possible to change some of the code modification to allow MathJax and TeX notation on to work together, but this is not integrated into Moodle currently.

In reply to Marinda Faasen

Re: begin{matrix*} and mathtools package

by Marc Grober -

Yes, there are limitations to MathJax,  which is why I think the TeX filter needs updating,  but there may be other ways to address what you are trying to display using MathJax...

In any event, once upon a time managing simulataneous use of TeX and MathJax  was easily done, lol, by way of changing the tokens that MathJax uses, and there are a number of discussions in the forum explaining how to invoke and tweak those settings in AdditionalHtml.  Moodle HQ argued that the current MathJax filter was heads and shoulders over the previously used methods and pushed through the MathJax filter so I would post a question to Damyon Wiese asking how the filter provides for changing the MathJax tokens wink  Then..... you may wish to turn OFF the MathJax filter, add the text appropriate for your MathJax installation to additionalhtml (you will note that the CDN location may have changed for MathJax) and tweak your tokens (for example, using @i for inline and using @d for display.  see the MathJax docs for more info.  This will also allow you to easily add MathJax macros.

Now you can add what packages you want to the TeX installation,  though some usages may still be impeded by Moodle in some cases.  The TeX filter will parse the tokens identified in that filter, and MathJax will employ the tokens you have chosen in Additional HTML.

btw,  it was unclear to me when Moodle rolled out 2.7 for Moodle.org whether use of both filters together had been fully resolved. You may want to ask someone at Moodle HQ where the docs are on how those filters interact in as much as I have been given to understand that be default they are set to use the same tokens.....  which would suggest that the first filter in order of application would arguably suck up all the tokens and leave nothing for the second filter (unless of course the tokens employed were different.)

As far as construction tools, Moodle devs keep tying constructor tools to display technology, which has been deplored by most on this forum.  In other words, constructor tools should be available in the editor without regard to what display tools you are using.

If Moodle devs made use of the new equation editor dependent on use of the MathJax filter then I recommend creating a tracker issue asking that they be decoupled (much as we had to do with dragmath when they did the same thing with respect to the TeX filter.) I am sorry that I don't have the specifics of that,  but frankly I won't be bothered with that anymore.

Average of ratings: Useful (1)
In reply to Marc Grober

Re: begin{matrix*} and mathtools package

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

One additional note concerning the use of non standard delimiters with the Moodle 2.7 MathJaxloader filter is needed.  In addition to adding something like TeX:{inline: ['%i','%i'],display:['display:['%d','%d']} to the MathJax configuration the settings, one also has to add ;%i, %d to the 'Additional delimiters' box near the bottom of the page.  Entering only one or the other does not help any.