Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  

    MathJax 1.0 is due to be released very soon (in a week or so?). I think there are good reasons for switching from jsMath to MathJax when that happens. MathJax seems to be more stable and have more uniform behavior across browsers. Also, it allows for the option of converting to MathML in browsers that can handle it.

    I've implemented MathJax on faketestsite and I invite you to go try it out.

    • It's configured to try to convert to MathML, but to use HTML-CSS if the browser doesn't support MathML (what browsers aside from Firefox support MML?).
    • All macros that work on MO should work on faketestsite.
    • The live preview should work.
    • Math in the comments should work properly.

    One issue I've encountered is that when I use Firefox and get MathML output, it looks like I don't have enough fonts installed. For example, \mathfrak and \mathcal both come out as upright roman font. Does anybody know how to solve this?

    It's likely to feel a bit slow right now. There are two reasons for this. One is that I'm hosting MathJax on my home computer, so fetching the scripts and fonts may be slow. The other is that MathJax is still being optimized for speed. Both of these will be resolved by the time we start using MathJax on MO.

    • CommentAuthorHarry Gindi
    • CommentTimeJun 24th 2010 edited
     

    The STIX project released v 1.0 of their fonts (the ones that were previously going around were incomplete beta versions).

    Edit: It must be an issue with mathjax (I just tested it myself), since the STIX fonts work fine on the nLab with fraktur.

    Also, by the way, is there any way for us to turn of mathml serving? Opera claims to support MML, but the support is awful (and it looks better the other way).

  2.  

    Edit: It must be an issue with mathjax (I just tested it myself), since the STIX fonts work fine on the nLab with fraktur.

    hmmm ...

    Also, by the way, is there any way for us to turn of mathml serving? Opera claims to support MML, but the support is awful (and it looks better the other way).

    I think the answer is currently no, but I did email the MathJax team to tell them that I'm really looking forward to the addition of a control panel (similar to the jsMath control panel) which would allow users to set such preferences.

  3.  

    MathML capable browsers:

    • Firefox and its derivatives, so you need to look for 'Gecko' in the user agent except that WebKit also reports 'Gecko'. There's some punctuation that follows the 'Gecko' in proper Gecko browsers (don't remember it off the top of my head) or you can exclude anything that matches 'webkit'
    • IE with the MathPlayer plugin installed (do a regexp on 'mathplayer' in the user agent (case insensitive or look up the capitilisation))
    • Amaya

    You will need a decent unicode font, such as the STIX fonts. Exactly what's going on with the alphabets depends a bit on which glyphs are being chosen (I haven't looked yet).

  4.  

    Okay, I installed Google Chrome with the express purpose of testing out the non-mathml rendering.

    A.) Fraktur renders fine

    B.) It is just as fast if not faster than mathml rendering (significantly faster than jsMath)

    C.) It looks better

    Proposal: Anton, could you totally disable mathml rendering until the bugs are worked out, then just put mathJax on the main MO site? The output is faster and nicer (even non-mathml) than the jsMath output.

    • CommentAuthorHarry Gindi
    • CommentTimeJun 25th 2010 edited
     

    Found two bugs:

    To get math to render, you have to reload the page in google chrome.

    When not using mathml, the \prod symbol renders below the line.

    However, at the moment, non-mathml output is definitely the nicest looking.

  5.  

    I've thrown the iTeX torture test at it and I think I know why the fonts aren't rendering correctly. More details over at the fake test site.

  6.  

    Harry, when you were testing MathML were you using Opera? In which case, the correct solution is to correctly recognise that Opera doesn't cope with MathML and serve it the alternative rather than disable MathML for browsers that can cope with it.

    • CommentAuthorHarry Gindi
    • CommentTimeJun 25th 2010 edited
     

    No, I've been testing with firefox and chrome. Testing with opera wouldn't really give you important information!

    More bugs!

    Using Andrew's giant list of symbols (granted, many of them didn't render at all), I saw that all of the oversized symbols (direct sum, product, bigcup, bigcap, all integrals) are getting mangled in chrome (which is not receiving mathml from the software).

    If someone has access to a macintosh computer, would you mind checking to see if the \prod gets sunk below the bottom of the line at this post?

  7.  

    I just tested it in Safari on a computer in the department. It now appears to be working fine for some strange reason.

  8.  

    Can somebody say some more about \prod's please? They render below the baseline for me, but they look correct:
    chromejax : produced by MathJax in Chrome
    jsmath : produced by jsMath in Chrome
    texprod : produced by LaTeX

    @Andrew: can you explain exactly what problem the CSS you posted solves? Don't bold and italics work just fine already? I tried adding the CSS VA listed in this answer:

    [mathvariant="double-struck"] {font-family: MathJax_AMS; } 
    [mathvariant="script"] {font-family: MathJax_Script; } 
    [mathvariant="fraktur"] {font-family: MathJax_Fraktur;} 
    [mathvariant="-tex-caligraphic"] {font-family: MathJax_Caligraphic; } 
    [mathvariant="bold-script"] {font-family: MathJax_Script; font-weight: bold;} 
    [mathvariant="bold-fraktur"] {font-family: MathJax_Fraktur; font-weight: bold;} 
    [mathvariant="monospace"] {font-family: monospace} 
    

    it looks like it's supposed to get things like fraktur working, but it looks the same for me (yes, I cleared my cache). Does MathML mathfrak look right for anybody right now? Changing my font.mathfont-family variable in about:config didn't help.

    Edit: there's a discussion about this on the MathJax Help forum, but as far as I can tell, it hasn't really been resolved.

    • CommentAuthorHarry Gindi
    • CommentTimeJun 25th 2010 edited
     

    Here's what I'm getting in Google chrome:

  9.  

    Bold in mathematics produced by itex uses the mathvariant to render as bold but it doesn't display correctly on firefox without the CSS tweaks. There's a mozilla bug number (which is in the CSS that I posted) that deals with it. As this is something I just imported from the nLab to the nForum, I don't actually know much about it beyond that.

    Regarding the fonts and VA's CSS, that would only work if you have the fonts already downloaded. Does MathJax do the same font stuff as jsMath? If so, it might not know that it needs to send MathJax_XYZ because the need is expressed in the CSS and not in what MathJax looks at. Try installing the fonts on your computer and having another look.

    If that works, you could try using the @font-face directive to make the fonts available to browsers that support that, or simply say that everyone has to download these fonts to use MO!

  10.  
    I tried the MathJax site on Opera on an old slow computer. It froze completely. (On the other hand, it sometimes does this with several tabs of mathoverflow open anyway).

    [edit] Actually, Opera on a fast computer freezes just as badly at
    http://faketestsite.stackexchange.com/questions/92/maths-torture-test
  11.  
    Also, I keep wondering: is there any way of seeing the LaTeX source of something that's been rendered by MathJax? It's not the most crucial feature, but it is quite useful, especially when there is a typo in the LaTeX.
  12.  

    Well, at least for text within a question or answer, once you gain the ability to edit at 2000 rep, it's easy to just copy the source. However, this does not work for comments.

  13.  

    I'm using the latest (5.0.375.86, as of this writing) version of Google Chrome on the latest version (10.6.4, as of this writing) of Mac OS X and I don't get any of the maths in http://faketestsite.stackexchange.com/questions/90/stress-test-using-mathjax/91#91 to render! All I see is the latex code. What am I missing?

  14.  

    @figueroa, others (me too!) have had to click reload a few times before it renders. I'm not sure why, or how to fix this. When we were first setting up jsMath we had this problem too, and solved it by arbitrarily permuting the order we loaded various jsMath libraries in.

  15.  

    When we were first setting up jsMath we had this problem too, and solved it by arbitrarily permuting the order we loaded various jsMath libraries in.

    I think it was basically that we had to introduce some delay between when we loaded something and when we called it, because it would try to load asynchronously and end up stepping on its own toes. In this case there's only one script being loaded, and it's already being loaded after all the content is up, so I don't know what to do about it. As a hack, I could try something like setting a timer which attempts to process the page again after half a second.

    I could also try messing around with this test page, which never seems to have that problem. But the math not processing happens pretty rarely for me. I don't have a way to intentionally reproduce it, which makes debugging tough.

  16.  

    OK -- thanks, I now got it. I had to reload twice more. I guess I'm not used to websites behaving so temperamentally :)

    The \prod's seem correctly (Thanks to Harald for pointing this out!) aligned: along the centre and not along the baseline.

  17.  

    I don't get it. Everybody seems to say \prod should be aligned on the baseline. But TeX surely centers it (and \sum too), and this looks right to me too.

    • CommentAuthorHarry Gindi
    • CommentTimeJun 27th 2010 edited
     

    @Harald: I posted a picture of how it displays for me. It's rather clear that it is incorrect (half of the symbol is cut off).

  18.  

    @Harry: Yes, your pictures clearly show a problem, but Anton posted pictures just before yours, and I thought he was complaining about those. (Or did I misread his post? It's been edited, I don't know what it said when I responded.)

    • CommentAuthorVA
    • CommentTimeJul 1st 2010
     
    There are several reasons NOT to use MathML output with MathJax:

    1. It does not seem to be any faster than HTML-CSS output. This reason alone should be enough.

    2. The MathJax developers only guarantee a high-quality output for HTML-CSS, not for MathML, see these threads:

    https://sourceforge.net/tracker/?func=detail&atid=1240827&aid=3001291&group_id=261188
    https://sourceforge.net/tracker/?func=detail&atid=1240827&aid=3001307&group_id=261188

    Essentially, the MathML output is only as good as the browser's implementation. Firefox is buggy, and other browsers are worse.

    3. The infamous 9-year old Mozilla bug preventing correct display of \mathbb, \mathfrac, \mathcal characters. The only solution I know is to use CSS. But it depends on which fonts the user has on its machine (MathJax or STIX) and it is very non user friendly, so that defeats the whole purpose. MathJax is not going to be of much help here any time soon, cf. this discussion:

    https://sourceforge.net/tracker/?func=detail&atid=1240827&aid=3001677&group_id=261188

    So my advice is to set
    jax: ["input/TeX","output/HTML-CSS"],
    in config/MathJax.js

    By the way, looking at the characters failed to be displayed in http://faketestsite.stackexchange.com/questions/92/maths-torture-test, I see that you probably did not load the extensions AMSmath and AMSsymbols in your config/MathJax.js

    They must be loaded explicitly, for example:

    extensions: ["tex2jax.js", "TeX/noErrors.js", "TeX/noUndefined.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],

    Finally, I would not rush with switching to MathJax until after it is optimized for speed. Not having an equation cache yet may not be a big problem for MO, but in general MathJax seems to be significantly slower than jsMath. I understand this will be addressed later, for now the focus is on features.
  19.  

    @VA: thanks for your detailed feedback. I tried explicitly loading those extensions, but I don't see any difference. In non-MML browsers, the fonts display correctly (as they did before), and in MML browsers, they still don't display correctly.

    MathJax v1.0 is supposed to be optimized for speed. If it's still slower than jsMath, then I agree we should wait to switch.

    If MML support in browsers is really as dodgy as you've described, then we should certainly use HTML-CSS by default. I'll look into the possibility of setting a preference cookie to use MML ... I'd like Andrew Stacey to be happy.

    I got an email from Davide Cervone (the hero behind jsMath and, as I understand it, the driving force behind MathJax). He says that after MathJax 1.0 is out, he's willing to help us better integrate MathJax into MO. Woohoo! Between bugs being fixed in the latest svn updates and his help with implementation, I expect we'll be able to iron out most problems.

    (Edit: corrected my misspelling of Andrew's name ... sorry.)

  20.  

    I'd like Andrew Stac[e]y to be happy.

    This sounds a worthy aim!

    More seriously, can the fonts used by MathJax be configured? Could it use the STIX fonts?

    In my experience, MathML is well supported by firefox. The issue regarding the bold fonts is annoying, but easily surmountable depending on how easy the script is to modify (I've no experience with javascript, and no particular desire to gain any!).

  21.  

    Update

    MathJax 1.0 is now out! I've been in touch with Davide, who has been extremely helpful. Faketestsite is now running MathJax "for real" ... if we were to switch now, that's how fast/slow and robust/buggy it would be. I think it looks very good, but I wanted to get in one last round of public testing/suggestions before pushing the changes to MO. Two things worth pointing out:

    1. (on MathML) Faketestsite will render math with HTML-CSS by default, but MathJax now allows you to change this to MathML by setting a cookie. Just right click on some math (except in the live preview because of how I've implemented it) and go to Settings > Math Renderer > MathML.
    2. (on speed) MathJax does not (yet) have an equation cache like jsMath does, so if the same equation shows up many times, it has to reprocess it every time. For browsing, it should be at least as fast as jsMath, but the live preview is slower than you might otherwise expect.

    My guess is that if people have complaints, it will be about the live preview. We could also do the live preview in the same way that math.SE does it (you have to wait a few seconds for before any math renders), but I like the approach on faketestsite much better. It has MathJax work in the background on a hidden div, after which it copies the html into the actual preview div. The result is that the preview is less responsive than the current jsMath version, but I think it's quite usable. Since the html is copied from another div, you can't get the MathJax control panel by right clicking. It also messes up MathML for some reason. I've emailed Davide to ask if it's possible to fix that. I'll try to remember to post a banner at the top of the site if I'm tinkering.

    Please head over to faketestsite and give it a try.

  22.  

    I've tweaked the live preview so you should now get MathML rendering properly and you should be able to get the MathJax context menu by right clicking.

    • CommentAuthorVA
    • CommentTimeSep 2nd 2010
     
    The current math preview on MO is unbearably slow for longer posts. I don't know how it is implemented in MO's javascript, or how it was before switching from jsMath to MathJax. But my impression is that currently a new typeset of the whole post happens on each keystroke.

    As some may remember, I asked about the MO's implementation of the math preview way back, and Scott's reply was to the effect that "there is something in the MO code about this, go and investigate it yourself" (http://mathoverflow.net/questions/22141/how-do-i-see-latex-math-on-any-web-page-and-in-email/22219#22219).

    Anyway, the approach I ended up using in gmailtex is this: split a long email (resp. post) into paragraphs, and typeset only the paragraphs which are changed on the last keystroke (usually, a single, relatively short paragraph).

    What I gleaned from the MO's javascript, without understanding details, is that MO has a concept of Chunks, and the live preview is supposed to work with these Chunks separately, not remaking the whole post on each keystroke. So perhaps this functionality is already in the MO code, you just need to coordinate it with MathJax.
  23.  

    MathJax has some very strange bugs in preview. I haven't taken any screens, but let's just say that there are circumstances where it breaks it completely (on more than just math).

  24.  
    I think this is related to VA's comment about math preview, but I feel like it's taken a lot longer to vertical scroll through a page with lots of equations than it used to.

    Also, it's new that a lot of equations no longer fit in the margins of one answer window, right?