We can wrap MathJax equations!

We can wrap MathJax equations!

by Christopher Sangwin -
Number of replies: 3
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear all,

Just come across a very useful tip to wrap long MathJax equations.  See

http://docs.mathjax.org/en/latest/output.html?highlight=automatic%20line%20breaking#automatic-line-breaking

Add 

    CommonHTML: { linebreaks: { automatic: true } },
   "HTML-CSS": { linebreaks: { automatic: true } },
    SVG: { linebreaks: { automatic: true } }

to "filter_mathjaxloader | mathjaxconfig" in the filter settings: Dashboard > Site administration > Plugins > Filters > MathJax Seems to do the trick.  

Chris

Average of ratings: Useful (2)
In reply to Christopher Sangwin

Re: We can wrap MathJax equations!

by Ridge Amaro -

Hi Christopher, 

May I ask for a screenshot/copy of your MathJax configuration block code. I tried to insert this into my block but all it did was break the functionality of the Mathjax filter. 

Apologies in advance, I am completely out of my depth with regards to these types of settings. 

Warm regards,
Ridge

In reply to Christopher Sangwin

Re: We can wrap MathJax equations!

by Germán Valero -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

@Christopher,

Re: http://docs.mathjax.org/en/latest/output.html?highlight=automatic%20line%20breaking#automatic-line-breaking

The above link does not work. But

http://docs.mathjax.org/en/latest/output/linebreaks.html 

states

"Automatic line breaking has not yet been implemented in MathJax version 3, but is high on our list for inclusion in a future release.


Can you please have a look at https://docs.moodle.org/37/en/Using_TeX_Notation#How_to_wrap_long_MathJax_equations and add/remove/change as necessary.

T.I.A.

In reply to Germán Valero

Re: We can wrap MathJax equations!

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Sorry about the broken link.

I've just tested my suggestion above (again) and it seems to work, so I've no idea what is going on here.  We are using 

MathJax.Hub.Config({
    config: ["Accessible.js", "Safe.js"],
    errorSettings: { message: ["!"] },
    skipStartupTypeset: true,
    messageStyle: "none",
    CommonHTML: { linebreaks: { automatic: true } },
   "HTML-CSS": { linebreaks: { automatic: true } },
    SVG: { linebreaks: { automatic: true } }
});

Together with a local version of MathJax.