I am having the same issue when editing questions. This is only an issue when the Atto Equation Editor has been added to the editing menu. If I remove the equation editor (and type LaTex directly) there is no issue. This is fine for me but will be an issue for my students who do not know LaTex and need the equation editor when creating posts involving mathematics.
I am currently using the MathJax filter in Moodle 3.1. Can the MathJax preview be disabled in the editor?
Now, when I edit a question I see the LaTex embedded in the question (not a preview). Additionally, if I select the LaTex and then click on the Atto Equation Editor, it opens the editor and displays the LaTex and the preview. When I exit the Equation Editor, the updated LaTex is embedded in the question. Perfect!
Thank you.
Sorry. I was overly optimistic. If the Atto Equation Editor is used when editing an existing question the equation is shown as a preview and you are unable to edit the equation (unless you want to go into the HTML and wade through the MathJax tags). The only real solution is delete the equation and reenter - which is very annoying if you only want to make simple LaTex updates.
It would be really nice to be able to disable the MathJax preview and edit he LaTex directly OR be able to select the MathJax preview and open in the Atto Equation Editor for editing. I can do neither at this point.
Robert,
There is not suppose to be a preview of mathematics within the Atto editor field. It is only supposed to be previewed within the equation editor. I have had this happen on occasion, and it usually has something to do with a misconfiguration of MathJax. MathJax is rendering the TeX expression in the editor when it is not suppose to.
Are you using the MathJax filter that came with Moodle or are you including MathJax in the headers so how? If you are using the filter, have you changed the default configuration? Does this happen everywhere in Moodle or just editing questions? or even a particular question type?
You may try configuring and using the TeX notation filter instead of MathJax. This is compatible with the Atto equatiion editor and will not process the editor content accidentally. You may also try adding tex2jax: {ignoreClass: "editor_atto_content"}
to your MathJax configuration. (see MathJax Documentation)
Daniel, thank you for your response. I ended getting things to work but not sure that I fully understand what I have done. Additionally, I needed to include the MathJax included in Additional HTML to get formatted equations to appear in multiple choice question answers. I needed to have the MathJax filter enabled in order to get the Atto Equation editor to appear in the editing window.
Here are the final version of the configurations that seem to work for me.
The Additional HTML is what is causing the problem with the editor. A better solution might be using the embedded answer (cloze) question using MULTICHOICE_V subquestion. This question type is compatible with the MathJax filter.
All of my multi-choice questions are "calculated" multi-choice questions with multiple variants. So, I do not think the cloze question is a workable alternative (I don't want to create 20 versions of the same question).
This configuration WORKS (the Atto Equation Editor is behaving correctly and the answers for the calculated multi-choice questions are being properly formatted with MathJax) . Originally, when it was not working, I was trying one or the other. So, for now, my problem seems to be solved.
I had the same Problem with Atto and the MathJax filter. I configured the filter as proposed by the Stack Documentation for theire question type plugin. But instead of using additional HTML, like propesed by doc, I used the filter settings:
MathJax.Hub.Config({ MMLorHTML: { prefer: "HTML" }, tex2jax: { displayMath: \[', '\\]'">'\\[', '\\]', inlineMath: \(', '\\)'">'\\(', '\\)', processEscapes: true }, TeX: { extensions: ['enclose.js'] } });
Thanks Daniel, your suggestion fixes the problem, except that the preview of the equation editor doesnt work anymore:
MathJax.Hub.Config({ MMLorHTML: { prefer: "HTML" }, tex2jax: { displayMath: \[', '\\]'">'\\[', '\\]', inlineMath: \(', '\\)'">'\\(', '\\)', processEscapes: true, ignoreClass: "editor_atto_content" }, TeX: { extensions: ['enclose.js'] } });
I believe that Robert configured MathJax in the header and also in the filter. There is some code in the equation editor that tells MathJax to update that may not work if the filter is not configured.
Alternatively one could configure the TeX notation filter for use in the equation editor. One could also try Mathslate for Atto if you can install a plugin. It is compatible with MathJax in additional HTML. No filter is required.