Dragmath - problem with backslash

Dragmath - problem with backslash

by Erick Fonseca -
Number of replies: 6
I have installed DragMath and enabled Tex Filter.
However, when a formula is rendered, the backslashes seem to be parsed as escape characters, and the rendering doesn't appear as desired.

For example:
I inserted, via DragMath: $$ \sin \left( \alpha \right)$$
If I later choose to edit, the text that appears is $$ sin left( alpha ight)$$
(Notice the initial r in "right" also disappeared.)
The image rendered was basically all these words concatenated.

Any help?
Average of ratings: -
In reply to Erick Fonseca

Re: Dragmath - problem with backslash

by Marc Grober -
What do the two text expressions look like? DragmatH is only inserting a text expression inside tokens. My guess is that in editing something was jostled, but we can't know till we see text expression, as in this:
$$\sin(\alpha)$$
is how this \sin(\alpha) is rendered if enclosed in doubledollars

since it appeared correctly the first time it is not a dragmath issue. More likely operator error or some artifact of js that is running
In reply to Marc Grober

Re: Dragmath - problem with backslash

by Erick Fonseca -
I didn't realize the filters on this forum would render the expressions I entered.
After inputting "\sin \left( \alpha \right)" in my Moodle, what appears is $$ sin left( alpha ight)$$.
If I try to edit it, it appears as if it were originally "sin left( alpha ight)".

If I'm quite sure this is not a DragMath issue, but could be related do the TeX filter.

In reply to Erick Fonseca

Re: Dragmath - problem with backslash

by Marc Grober -

$$\sin \left( \alpha \right)$$ \sin \left( \alpha \right)
$$\sin\left( \alpha \right)$$ \sin\left( \alpha \right)
$$\sin\left(\alpha \right)$$ \sin\left(\alpha \right)
$$\sin\left(\alpha\right)$$ \sin\left(\alpha\right)

Notice that if the slashes do not immediately precede the keyword you get the kind of results you are seeing
$$\sin\ left( \alpha \right)$$ \sin\ left( \alpha \right)

Now I see what you mean....

you are not getting the benefit of any backslash as the backslash is being interpreted as universal escape (as you initially stated). This is not a dragmath error but an issue with moodle and I recall there was an issue and a resolution and I will look for it....
In reply to Erick Fonseca

Re: Dragmath - problem with backslash

by Marc Grober -
This appears to be a magic quotes issue. Check this and let me know if that help.
http://moodle.org/mod/forum/discuss.php?d=136248
In reply to Marc Grober

Re: Dragmath - problem with backslash

by Erick Fonseca -
Yes, that solved my problem, thank you!
We made an htaccess file to override the php.ini configuration on Apache.
In reply to Erick Fonseca

magic quotes setting stripping backslash from tex expression explained

by Marc Grober -
An explanation of how magic quotes works:
http://www.tizag.com/phpT/php-magic-quotes.php

I supposed someone should add something about this to the tex filter documentation..... if we had some kind of active search this would be an example of where it could come in handy....