at saving LaTeX preamble, extra backslash is added

at saving LaTeX preamble, extra backslash is added

by Atsuhito Kohda -
Number of replies: 5
I recently upgraded moodle from 1.6.3 to 1.7.1 and it worked almost fine but I encountered a strange problem. When I changed LaTeX preamble settings and saved it then extra (unnecessary) backslash was added. Even if I pressed default setting button it never got corrected and there were two backslashes in front of each lines. Further, if I saved it again then I got 4 backslashes.

I'd like to know if anyone encountered the same problem and how I can fix the problem.

Thanks in advance.
Average of ratings: -
In reply to Atsuhito Kohda

Re: at saving LaTeX preamble, extra backslash is added

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Yes, I have heard of this as an issue in the quiz module. From what I understand, when editing a question with latex in it, the backslashes have to be proceeded with a backslash; however, I am not 100% certain on this. I believe that John Isner touched on this at the recent MoodleMoot in Albuquerque when he spoke about Math and Science uses of Moodle.
In reply to Atsuhito Kohda

Re: at saving LaTeX preamble, extra backslash is added

by Gustav W Delius -
That sounds like a bug in the code due to incorrect use of addslashes(). If you put a bug report in to the tracker which says exactly on which page this is happening and assign the bug to me then I should be able to fix it.
In reply to Gustav W Delius

Re: at saving LaTeX preamble, extra backslash is added

by Atsuhito Kohda -
Hi, I just put the bug report in to the tracker but I can't assign the bug to Gustav. I don't know tracker system so well but it is MDL-8586. Thanks for your help.
In reply to Atsuhito Kohda

Re: at saving LaTeX preamble, extra backslash is added

by C Lopez -
I ran into this problem also. It turns out that, counterintuitively, you do not need to press "Save" after you press "Reset to defaults". Just press "Reset to defaults" and then leave the page.

This is still a bug, and it still needs to be fixed, since it prevents people from using a custom preamble, but at least there is this workaround for people who need the default preamble.
In reply to C Lopez

Re: at saving LaTeX preamble, extra backslash is added

by Atsuhito Kohda -
Hi, yes you are right and pressing "Reset to defaults" only works fine. I can't use LaTeX but mimetex these days but now I can enjoy LaTeX again. Thanks for your help.