Fraction inside radical problem

Fraction inside radical problem

by Steve Harper -
Number of replies: 17

I want to enter the square root of a fraction.  Something like sqrt(3/4), for example.  And of course I want MoodleTeX to display a nice tall radical symbol as high as the fraction it encloses.  Here is the generated DragMath code(enclosed in $'s of course): \sqrt{\frac{3}{4}}, which is exactly what I also entered manually.  What it displays is a short radical symbol that only encloses the numerator, as if it were sqrt(3)/4 instead (or \frac{\sqrt{3}}{4}).  I have read the documentation on LaTeX that I could find, and it says pretty clearly that it should size the radical automatically.  And I find no way to do it manually.

We are using Moodle 1.9.

Any ideas on how to fix it or even work around it?

Thanks,

Steve Harper

Average of ratings: -
In reply to Steve Harper

Re: Fraction inside radical problem

by Marc Grober -

Using DragMath, for example, I created this: $$\large \sqrt[x]{ \frac{a^{x}}{a^{y}} } $$

which inserts this:\large \sqrt[x]{ \frac{a^{x}}{a^{y}} }

In the past I saw situations such as you describe where people were using MathML without appropriate fonts loaded.....  What does your Tex environment look like and are your results being dispayed by Tex or by mimetex?

Hmmmmmm......  we seem to have lost somesize control:

$$\LARGE \sqrt{\frac{\alpha}{\Omega}}$$

In reply to Marc Grober

Re: Fraction inside radical problem

by Steve Harper -

Marc,

I notice that my fraction in a radical displays very nicely here $$\sqrt{\frac{3}{4}}$$, even though it doesn't on our system.  Our editor buttons look different, too (we have the "pi" button, instead of sqrt(alpha)).  Unfortunately, I am just the teacher, not the IT guy.  I will have to get him involved to answer your questions...

Thanks for now,

Steve

In reply to Steve Harper

Re: Fraction inside radical problem

by Marc Grober -

Well, the difference in symbol from dragmath results from using DragMath 0.7.8.2,  which is the current version,  but that should not be effecting the Tex display results, which is undoubtedly a font issue....

BTW,  while Moodle.org's mediawiki was doing fs6 and fs7 (huge and Huge, see http://docs.moodle.org/en/Using_TeX_Notation_2#Size_of_displays), The forums use the Moodle 2 tex filter which doesn't support those options - lol.....  One reason you may want to install your own version of TexLive, tyweak the Moodle code to use dvipng, and be able to easily manage macros, like polynomial division wink

$$\fontsize{80}{70}\Huge x \ = \ \frac{\sqrt{(y \ + \ 12)}}{q}$$

$$\fs7 x \ = \ \frac{\sqrt{(y \ + \ 12)}}{q}$$

$$\fs{7} x \ = \ \frac{\sqrt{(y \ + \ 12)}}{q}$$

In reply to Marc Grober

Re: Fraction inside radical problem

by Jean-Michel Védrine -

Hello Marc,

This thread made me aware of a  similar problem in my own setup :

I am using firefox 3.6.12 with Stix fonts version 1.0.0 (not beta) installed .

If i go to my Moodle site with asciimathml installed, the asciimathml formula sqrt(3/4) produce a wrong display in my browser (img fallback using GoogleTex is OK) I think it's a problem with my browser and not my website because if I go to the webpage https://eyeasme.com/Joe/MathML/MathML_browser_test.html the formula with multiple roots is not correctly displayed (seen image). Everything else on the page seems OK.

What can cause this problem with Stix fonts installed ?

wrong formula

In reply to Jean-Michel Védrine

Re: Fraction inside radical problem

by Steve Harper -

Jean-Michel,

Thanks for your reply.  I am seeing exactly the same thing on my brower (also FireFox 3.6.12), though I don't think I have any fonts installed.  Perhaps it is a browser problem.  I will see if my IT guy has some ideas.

Thanks,

Steve

In reply to Steve Harper

Re: Fraction inside radical problem

by Marc Grober -
Steve, Similar symptoms, different source as I think you said you were using Moodle Ted and mimetex fallback, while jean-Michel is doing asciimathml w google API fallback (where fallback working.) in j-m's case ASCIIMath is being used to convert directly to mathml, and FF is using STIX fonts to render raising the possibility that there is a bug in the current FF mathml engine. In your situation you are rendering via your local Tex and it's fonts or via your mimetex fallback, neither of which uses mathml.
In reply to Jean-Michel Védrine

Re: Fraction inside radical problem

by Marc Grober -
There three obvious possible candidates for the source of the errors wink I will try to find some time this week to run it down, but in the meantime, check your browser and make sure it is not set to use fonts other than the STIX 1.0 for math.
In reply to Marc Grober

Re: Fraction inside radical problem

by Jean-Michel Védrine -

Hello Marc,

I looked at the font.mathfont-family firefox setting, it' value is :
STIXNonUnicode, STIXSize1, STIXGeneral, Symbol, DejaVu Sans, Cambria Math

and it appear to be the default value because resetting it don't change anything.

Thank for looking at my problem.

In reply to Jean-Michel Védrine

Re: Fraction inside radical problem

by Jean-Michel Védrine -

Well, it seems it's definitely a browser issue because firefox 4 beta 7 don't exhibit the same problem on the same computer and the same pages

In reply to Jean-Michel Védrine

Re: Fraction inside radical problem Firefox 3.6 does not support STIX 1.0

by Marc Grober -
J-M Received response below from Frederick which was a bit surprising to me...... I upgraded to STIX 1 for Mathjax and did not realize that FF 3.6 did not yet support them "STIX fonts 1.0 are not supported by Firefox 3.6, you need to use the STIX beta fonts: https://developer.mozilla.org/en/Mozilla_MathML_Project/Fonts#STIX_Fonts Regarding Firefox 4, there is a workaround to stretch operators without STIX fonts installed (this works well for radicals) https://bugzilla.mozilla.org/show_bug.cgi?id=414277 and STIX fonts 1.0 are supported: https://bugzilla.mozilla.org/show_bug.cgi?id=569195 (it has been proposed to take the latter bug for Firefox 3.6 but this is waiting approval by the drivers)."
In reply to Jean-Michel Védrine

Re: Fraction inside radical problem

by Marc Grober -

First I can confirm that I am seeing the same thing with FF 3.6.12 and that I agree its likely a FF bug.

I also checked the W3C torture test and can confirm short rads on that re mrootB1.  I checked for a listed bug in the tracker and didn't find any with a quick scan, but that does not mean that it was not found, tracked and fixed (as you suggest it has been resolved in beta 4.) I posted the issue to the group http://groups.google.com/group/mozilla.dev.tech.mathml/browse_thread/thread/6328cfa7ca287b73# as I am not sure whether or not it was caught,  and if I don't hear back from Frederick or Roger I will add it to the bug tracker anyway....

The project website is here, https://developer.mozilla.org/en/Mozilla_MathML_Project, and Frederick Wang is always very helpful

In reply to Marc Grober

Re: Fraction inside radical problem

by Jean-Michel Védrine -

Using the link you provided and looking at this page : Fonts for MathML-enabled Mozilla

I was able to solve the problem installing some fonts of the STIX beta release

Excerpt from the page :

Users of Mozilla 1.9 (including Firefox 3) should download a Zip archive of STIX fonts 1.0 + additional fonts from STIX Beta. Even if STIX fonts 1.0 are already installed on your system, you need the  STIXSiz*.odf fonts provided in this archive. In future versions of Mozilla (including Minefield), one can simply use the Zip archive of STIX fonts 1.0.

So apparently the problem is known.

In reply to Marc Grober

Re: Fraction inside radical problem

by Eric Bryant -

This still leaves the question about how to fix it globally so students can what instructors are wanting them to see.  Any ideas there?  At our institution, we reccommend Firefox 3+, and definitely not IE.

What is the best way to roll out a fix to 20K students?

In reply to Eric Bryant

Re: Fraction inside radical problem

by Mauno Korpelainen -

All math renderes have some "bugs" so if you know that some special thing does not work with one renderer use some other renderers that can show it correct.

In this case MathML roots are not shown correct (Stix/MathML/FF bug) - however if you use for example MathJax with

jax: ["input/TeX", "output/HTML-CSS"]

and

preferredFont: "TeX"

all browsers show this example "almost correct" - there is only a tiny font size issue (depending on selected font size):

roots

In that case no Stix fonts are required. Or if you use different versions of Tex to render images you will notice that there are differences too:

Tex filter here is using TexLive and it renders

\frac{\sqrt{1+\sqrt[3]{2+\sqrt[5]{3+\sqrt[7]{4+\sqrt[11]{5+\sqrt[13]{6+\sqrt[17]{7+\sqrt[19]{A}}}}}}}}}{e^{\pi}}=x^{'''}

as

$$\frac{\sqrt{1+\sqrt[3]{2+\sqrt[5]{3+\sqrt[7]{4+\sqrt[11]{5+\sqrt[13]{6+\sqrt[17]{7+\sqrt[19]{A}}}}}}}}}{e^{\pi}}=x^{'''}$$

and for example external cgi Mimetex renders the same notation as

roots

or you can copy or upload any image from your MS Word equation editor, Open Office Math editor, MathType etc to moodledata / site files or use some public external renderer like Codecogs equation editor to render

roots

So summa summarium - no bullet proof method available - still lots of workarounds smile

In reply to Mauno Korpelainen

Re: Fraction inside radical problem

by Mauno Korpelainen -

Finally attached an image taken from MS Office 2010 Equation editor.

Well - I can't say which one of these roots looks most correct? I think they all have "something odd" smile

Attachment roots2.gif
In reply to Eric Bryant

Re: Fraction inside radical problem

by Eric Bryant -

Firefox 4.0 (Beta 8) correctly displays a fraction within a SqRt symbol.