Want to take part in these discussions? Sign in if you have an account, or apply for one below
Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
I am making some tentative, experimental steps towards a new tex parser for the nLab, which will parse tex directly to HTML. MathJax does this, but I am not really happy with using it server-side, and in addition, as we have noted previously, we would probably need to tweak it to make it compatible with Itex2MML.
So far, I have used it only on the page set theory. If you usually use Firefox, where MathML was being rendered directly by the browser, you should not see an enormous difference from before. If you use any other browser, it should look a little different, because I am rendering the fonts using simply italicised normal fonts, and using a unicode symbol for the \mathcal as on this Wikipedia page.
Now, my question: does the calligraphic P look OK? If not, please suggest a different unicode symbol! I am convinced that using unicode symbols is the way forward. The symbol is slightly different from that which Firefox uses, but I have not succeeded in finding the latter yet.
Hmm, actually I think it might be a question of which font is chosen. On my mobile phone, I get a rather ornate calligraphic P, whereas on my computer I get a relatively simple one, and neither is the same as Firefox uses on my computer for rendering MathML, even though I think the same symbol is present in the MathML source.
I am tempted then to think that it is fine as it is, unless people think we should change font for the mathematics rendering.
With a Chromebook the symbols appear as squares.
Interesting, thanks very much. That is in Chrome, presumably? Do you have Firefox on that machine? If so, does the curly P at power set render in Firefox?
Yes, it’s Chrome. And no, one can’t have other OSes.
Thanks! Hopefully this might be able to be solved by specifying a font-family to be used that the ChromeBook does have, and which can render mathematical characters. Not ideal, but I can’t think of any other option for the moment. I’d rather avoid embedding fonts. Will experiment when I get the chance.
I will also be writing a parser which will export MathML, and so we could just keep MathJax on and output the same/similar MathML as Itex2MML; but I’d really like the HTML rendering to be done server-side, as this will improve the user experience greatly. It’d be a shame to have to use MathJax everywhere for the sake of a few relative corner cases. I’m sure we can come up with something.
Hi David, I’ve now embedded the STIX math fonts, so hopefully you should now see the power set symbol? I’m using the embedded fonts as a last resort; first it checks for DejaVu Math TeX Gyre, which seems to render quite nicely without affecting spacing much, then it looks for any serif font on your local machine which renders it; and then it uses the embedded font.
I think that most Linux users with an up to date system may have DejaVu Math Tex Gyre on their local system. On my machine DejaVu Sans is used as the font for rendering the surrounding text, and the Math font seems to harmonise well with it. If people are using some other font for the main text, things may not look too good!
The Stix fonts render fine but affect the spacing on my machine, no doubt because they are a different font to the surrounding text. I’ll not fix that for the moment, but will come back to it. The main thing is that the page is readable and the symbols recognisable.
Feedback will be greatly appreciated from as many as possible, as if I do not hear anything I will move on!
Remind me what is wrong with using mathjax server-side?
It’s up for debate whether it is wrong, I am open to changing my mind!
The following things are in my mind:
1) There are some incompatibilites between MathJax and Itex2MML. The latest one cropped up in #2 here, where MathJax cannot render what Urs is trying to do. I do not think it would be a good idea to try to modify the MathJax source.
2) MathJax is written in Javascript, and with client side in mind. Javascript can perfectly well be used nowadays as a server side language, but has limitations, say if we really wish to make the rendering as fast as possible. I would prefer something that is designed to be server side, and which either is very fast or could be optimised to be very fast.
3) MathJax does not have great support for diagrams, which are a quite fundamental part of the nLab.
4) MathJax is large and complex. I would prefer something that is as simple and lightweight as possible, even if it means sacrificing some functionality.
5) I am not quite sure whether MathJax works well with HTML output (which is the best quality, and what you probably see in your browser) when run server side, because I think it determines font sizes, etc, from the surrounding text. It might be that everything is actually fine on this particular point, I have not tested it in detail.
Maybe there are other arguments as well, but those are the ones which come to mind at the moment. In general, I think there is really room for a new server side renderer of mathematics directly to HTML (as well as to MathML, but I do not see the need to actually output MathML when it comes to a web page, which after all is about presentation; I see its value only in semantics, and I am not aware of any search engine, for instance, making significant use of these semantics at the moment). Of course, it is a significant undertaking and it may not be feasible in the end, but I thought we could try it out. Somehow I feel that presenting mathematics in HTML in the majority of cases should not really be all that difficult, as long as one does not expect perfection, and accepts that complex cases will be out of reach.
The idea would be to fallback to MathJax if a page cannot be rendered by the home-grown parser.
But we could certainly try MathJax server side if people would prefer that, just let me know.
I have by the way used the new tex renderer at foundation of mathematics as well now. A few LaTeX symbols (\kappa
, \times
, and a couple of arrows) are used at this page.
One of my first impressions is that these pages look much better than before on a mobile (Android). Maybe not the most important consideration, but not completely inconsequential either. I think it is because the Android browser was trying to render the MathML directly, so this is not an argument against MathJax (if MathJax were used to produce HTML directly server side rather than MathML).
On a computer, I am not yet sure. With DejaVu Sans as main font and DejaVu Math TeX Gyre as math font, things look OK to me; not perfect, but neither is MathJax, which produces rather large mathematics text which does not fully harmonise with the rest, nor MathML rendered in Firefox. I would be very interested to hear how things look in other fonts.
Those are reasonable arguments.
I don’t have time right now to do a lot of testing of how things look, unfortunately, but maybe others can.
No problem, just let me know if you see something that looks terrible.
I tested just now on Windows, and things look very good there, actually slightly better than on Linux at the moment I would say. I also noticed a slight positive that Google seems to be able to nicely display the mathematics if one searches for ’set theory’, say.
I’d be interested to hear from you again, David, when you get the chance to take a look at the above two pages on a ChromeBook. It might be better to embed DejaVu rather than Stix, but things should at least render now.
I’d also be very interested how things look if anyone has a Mac or an iPhone.
1 to 14 of 14