MathJax and Ajax ...

MathJax and Ajax ...

by Baptiste Lhoste -
Number of replies: 6

Hi everybody,

In the tchat page, when you enter a new message, it is added to the page using Ajax.

My problem is that the MathJax filter is not applied to the new content.

I found the following trac (https://tracker.moodle.org/browse/MDL-50629) about this issue.

I read the specified documentation but I can not figure out how to correct it.

Could someone help me on this ?

Thanks in advance.

Baptiste

Average of ratings: -
In reply to Baptiste Lhoste

Re: MathJax and Ajax ...

by Baptiste Lhoste -

Hi everybody,

I am still stuck with this issue. Nobody has an idea ?

Baptiste


In reply to Baptiste Lhoste

Re: MathJax and Ajax ...

by Mauno Korpelainen -

Not exactly a solution to your problem but chat has also the "old" more accessible interface (gui_basic) that can be used instead of Ajax interface (gui_ajax)

chat

It renders MathJax just fine.

One solution might be to rewrite the whole chat module to use editor interface but then we could as well use normal discussion forums.

In reply to Baptiste Lhoste

Re: MathJax and Ajax ...

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

Another option would be to enable TeX notation filter instead of MathJax. Otherwise I would include MathJax in the header and add the MathJax Typeset command to the AJAX code.

In reply to Daniel Thies

Re: MathJax and Ajax ...

by Baptiste Lhoste -

First of all, thanks to both Mauno and Daniel.

Mauno: I have already notice that MathJax works with the old interface.

Daniel: MathJax is included in the header but I do not understand what you mean by "add the MathJax Typeset command to the AJAX code.". Could you give me more details about this part ?

Thanks in advance.

Baptiste Lhoste


In reply to Baptiste Lhoste

Re: MathJax and Ajax ...

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

Hi Baptiste,

The discussion where we did this for glossary is https://moodle.org/mod/forum/discuss.php?d=239658.  You will have to edited the javascript source probably in mod/chat/gui_ajax/module.js and add the MathJax.Hub.Queue(['Typeset', MathJax.Hub]); statement at the end of the callback function to update the chat.

Daniel

In reply to Daniel Thies

Re: MathJax and Ajax ...

by Baptiste Lhoste -

Hi Daniel,

Thanks for your answer.

I made the change that you suggest and it works !!!

Thanks again.

Baptiste

Average of ratings: Useful (1)