IE6 equation spaghetti

37 views
Skip to first unread message

Leo Trottier

unread,
Mar 7, 2012, 1:03:31 PM3/7/12
to MathJax Users
Hi,

For some reason, as of 2.0 IE6 renders equations (in the words of one
of our users) "explosed".

E.g. http://www.scholarpedia.org/article/Hartline-Ratliff_model

Since I've not yet seen anyone else raise this issue, I'm guessing it
may have something to do with the configuration customizations we're
using (below).

It's not clear what in the configuration below might be causing such
dramatic problems with equation rendering in the new MathJax.

========== Custom configuration ===================

MathJax.Hub.Config({
styles: {
".MathJax_Display": {
display: "table-cell ! important",
padding: "1em 0 ! important",
width: (MathJax.Hub.Browser.isMSIE &&
(document.documentMode||0) < 8 ?
"100% ! important" : "1000em ! important")
}
},
MMLorHTML: { prefer: { Firefox: "HTML" } },
extensions: ["tex2jax.js","TeX/noErrors.js", "TeX/
AMSmath.js","TeX/AMSsymbols.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: false,
element: "content",
ignoreClass: "(tex2jax_ignore|mw-search-results|
searchresults)", /* note: this is part of a regex, check the docs! */
skipTags: ["script","noscript","style","textarea","code"] /
* removed pre as wikimedia renders math in there */
},
(... etc.)

Davide P. Cervone

unread,
Mar 7, 2012, 2:08:23 PM3/7/12
to mathja...@googlegroups.com
The issue is not the MathJax configuration, it is the CSS on the
page. MathJax tries hard to protect itself from the page's CSS, but
it is impossible to rule out ever interaction, and in your case, the
interaction comes from the CSS for images in the local-screen.css
file. The "reset" CSS sets the image font-size to 0, but for IE,
MathJax needs to use blank images to help do some positioning, and
since all its sizes are in em's this is in relation to the current
font. Setting that to size 0 means the images are all 0 by 0 pixels,
and so the positioning is thrown off.

If you add

".MathJax img": {
"font-size": "100%"
}

to the styles section of your configuration, that should take care of
the problem, I think.

Davide

PS, the MMLorHTML preference for Firefox is now HTML by default, so
there is no need to set that explicitly any longer. Also, the styles
you have currently set for MathJax_Display (to work around the problem
with tags overlapping floating elements) is now part of the handle-
floats extension. So if you add "HTML-CSS/handle-floats.js" to the
extensions array, you can remove the style setting for .MathJax_Display.

Leo Trottier

unread,
Mar 7, 2012, 2:22:44 PM3/7/12
to MathJax Users
Davide,

Many thanks for your quick solution.

Great work, all around!

Leo
> > E.g.http://www.scholarpedia.org/article/Hartline-Ratliff_model

Leo Trottier

unread,
Mar 9, 2012, 1:58:15 PM3/9/12
to mathja...@googlegroups.com
Davide, 

We have tested out the handle-floats.js extension, but it appears to slow down page loading considerably, and have reverted to using the previous method. 

Is handle-floats particularly computationally intensive? 

Leo

Davide P. Cervone

unread,
Mar 11, 2012, 9:58:05 AM3/11/12
to mathja...@googlegroups.com
> We have tested out the handle-floats.js extension, but it appears to
> slow down page loading considerably, and have reverted to using the
> previous method.
>
> Is handle-floats particularly computationally intensive?

No, it is a small file that only sets up the style and replaces one
routine in the HTML-CSS output. But there was a typo in the file that
caused it to not compile, and that means MathJax will wait for it to
complete but that never happens, so it times out after 15 seconds.
That was the cause of your delay.

I have fixed the file, but it will take a while for it to propagate to
the CDN. (Probably around a day.) So you could try it again say
Monday afternoon and see if that doesn't work properly for you. You
may need to clear your browser cache as well as wait until then.

Davide

osh...@gmail.com

unread,
May 2, 2016, 7:02:27 PM5/2/16
to MathJax Users
Hi.

MathJax formulas layout renders broken in IE 6.
And the problem reproduces even on test page without any CSS.

Is there any easy cure possible for this case?

среда, 7 марта 2012 г., 22:08:23 UTC+3 пользователь Davide Cervone написал:

osh...@gmail.com

unread,
May 2, 2016, 7:23:41 PM5/2/16
to MathJax Users, osh...@gmail.com
I've tested that older versions of MathJax until 2.5.3 inclusive do render the page correctly.
But layout becomes broken since 2.6.0.

вторник, 3 мая 2016 г., 2:02:27 UTC+3 пользователь osh...@gmail.com написал:

Peter Krautzberger

unread,
May 3, 2016, 7:45:45 AM5/3/16
to mathja...@googlegroups.com
Hi,

I'm afraid I cannot reproduce the issue on your page using a clean IE6 VM.

Could you share a screenshot of what you're seeing? 

Regards,
Peter.

--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

osh...@gmail.com

unread,
May 3, 2016, 5:39:15 PM5/3/16
to MathJax Users
Sure: https://www.dropbox.com/s/dnbtn6szv3t5iog/usaco_mathjax_broken_in_ie6.png?dl=0
It's default IE of w2k3 ee sp2.

вторник, 3 мая 2016 г., 14:45:45 UTC+3 пользователь Peter Krautzberger написал:

Davide P. Cervone

unread,
May 3, 2016, 6:22:48 PM5/3/16
to mathja...@googlegroups.com
Try adding

.math > span {top: 0px}

to the CSS for your page, and see if that helps.

Davide

vkopi...@gmail.com

unread,
May 4, 2016, 1:06:04 PM5/4/16
to MathJax Users, dp...@union.edu
No. It didn't help. 
Here is test page I tried: http://dl.gsu.by/javascript/usaco_mathjax26_broken_in_ie6.html

среда, 4 мая 2016 г., 1:22:48 UTC+3 пользователь Davide P. Cervone написал:

Davide P. Cervone

unread,
May 4, 2016, 1:54:08 PM5/4/16
to vkopi...@gmail.com, MathJax Users
OK, thanks for the trimmed-down version of the file.

The HTML produced by MathJax is actually correct, but IE6 seems to be confused about it, and you need to give it a kick in the pants before it will display it properly.  If you add the following right after the MathJax.Hub.Config() call, it will force IE to redraw the page correctly.

if (MathJax.Hub.Browser.isMSIE && !MathJax.Hub.Browser.versionAtLeast("7.0")) {
  MathJax.Hub.Queue(
    ["Delay",MathJax.Callback,0],
    function () {
      document.styleSheets[0].disabled = true;
      document.styleSheets[0].disabled = false;
    }
  );
}

I'm not sure why it gets confused, but changing the disabled status of one of the stylesheets tells it it needs to rethink the display, and then it gets it right.

So you can remove the style I gave you before (the reason it worked for me was because I was entering it by hand on your page, and that cause the page to be redrawn; any style change would have done that, but having the style in pace original fails to cause the redraw that is needed).

Also, I should point out that your configuration is in the wrong place.  You should move the script that configures MathJax to be BEFORE the script that loads MathJax.js itself, and you should set the script to have type="text/x-mathjax-config".  So 

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    "HTML-CSS": {
scale: 85,
preferredFont: "STIX"
    },
  tex2jax: {
    inlineMath: [['$','$'],['\\(','\\)']],
    processEscapes: true,
    skipTags: ['pre'],
    processClass: "mathjax",
    ignoreClass: "no-mathjax"
  }
});
if (MathJax.Hub.Browser.isMSIE && !MathJax.Hub.Browser.versionAtLeast("7.0")) {
  MathJax.Hub.Queue(
    ["Delay",MathJax.Callback,0],
    function () {
      document.styleSheets[0].disabled = true;
      document.styleSheets[0].disabled = false;
    }
  );
}
</script>

would do it.  Finally, I would not set skipTags to just 'pre', as that will allow MathJax to look for math inside <script>, <noscript>, <style>, <textarea>, and other tags.  If you are trying to remove <code> from the list, you should leave the others.

Davide

Ольга Копиченко

unread,
May 4, 2016, 3:32:05 PM5/4/16
to mathja...@googlegroups.com, Вадим Копиченко
Thank you very much for the insights and provided workaround.

But this workaround leaves noticable flickering of wrongly positioned math on page load.

We'll stick with version 2.5.3 by now which just works correctly without any workarounds needed.
Having shared secondary config like this:

It appears that mathjax.org now says that IE6 is still supported but it's not the case since 2.6.0.
It would be fair to state this on site or to try to nail down and fix breaking change after 2.5.3.



--
You received this message because you are subscribed to a topic in the Google Groups "MathJax Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathjax-users/Cuz5OEZusic/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathjax-user...@googlegroups.com.

Davide P. Cervone

unread,
May 4, 2016, 4:14:00 PM5/4/16
to mathja...@googlegroups.com
We'll stick with version 2.5.3 by now which just works correctly without any workarounds needed.
Having shared secondary config like this:

Note that you can also get 2.5.3 from the MathJax CDN at


It appears that mathjax.org now says that IE6 is still supported but it's not the case since 2.6.0.
It would be fair to state this on site or to try to nail down and fix breaking change after 2.5.3.

I didn't say I was not going to try to resolve the issue within MathJax itself, but only wanted to give you a work around in the meantime.  Should we decide not to put any more time into the issue (quite likely), the documentation should be adjusted, as you say.

Can I ask why you have such a need for IE6?  It is now 15 years old (and I think not updated in 10 years), and it is quite broken in many fundamental ways.  I can't imagine that your users are having a reasonable web experience with it.  Why do you have a need to continue to support this ancient browser?

Davide

vkopi...@gmail.com

unread,
May 4, 2016, 5:59:12 PM5/4/16
to MathJax Users, dp...@union.edu
We run on-site classes and programming contest trainings in local school classrooms with ancient Win XP PCs that were not upgraded for years and have limited internet access.
Testing mathjax version compatibility and finding sensible workaround was easier than forcing alternative browser across classrooms.

I hope need for IE support would vanish with next PCs upgrade. )

Thanks for the help!

среда, 4 мая 2016 г., 23:14:00 UTC+3 пользователь Davide P. Cervone написал:
Reply all
Reply to author
Forward
0 new messages