9 ms·
Bringing MathML back to Chromium
- runarberg 4y agoCongratulations to the igalia team here for amazing work. I’ve been waiting to use MathML natively for years and thanks to a lot of hard work this is finally possible.
- owlbite 4y agoMathML always seemed like a waste of time. It was/is objectively worse on every axis (at least from a user perspective) compared to the long-established LaTeX notation.
- goosedragons 4y agoI don't think MathML is designed for human creation, it's somewhat human readable but I believe the main goal was to remove the possibility of ambiguities.
- cormacrelf 4y agoIt was designed explicitly to be written by other programs, to the point that they have an "error message" element for when your latex-like parse-and-output-mathml program failed, whose example in the spec is "Syntax error: \frac{1}": https://www.w3.org/TR/mathml-core/#error-message-merror https://www.w3.org/TR/mathml-core/#error-message-merror
- runarberg 4y agoThis is just wrong. MathML is not about notation, it is about rendering. Notation is secondary (as is evidence by the number of translators out there). Having native rendering yields numerous benefits including: * Less works for developers who no longer need to pick, integrate, and maintain a third party library for rendering. * Faster user experience, as the MathML code can be served directly and rendered by the browser (as opposed to parsed and rendered with the javascript engine). * More options. Maybe LaTeX is not the right choice of syntax (more people write math then professional mathematicians and PhD students). As translating to LaTeX is hard, translating to MathML is easier (I know, I’ve written one my self).
- neutrono 4y agoMaybe something similar to Troff eqn language? Or the formula language in Libreoffice Math? Both of these are a bit more approachable than LaTeX's math mode, IMO.
- runarberg 4y agoThe point is that MathML is easier to translate to then many of these other languages. I wrote a language my self a few years ago that translates to MathML (https://runarberg.github.io/mathup/ https://runarberg.github.io/mathup/) and MathML was an absolute joy to target. In mathup I included a second target to update the DOM directly .toDOM() and .updateDOM(oldMathNode) instead of .toString(). This would have been quite difficult if there wasn’t a nice mapping between the language and the DOM nodes. By implementing math in MathML browsers have made it easier for us software authors to write these other languages that serve different purpose then LaTeX. Our users benefit from this proliferation. Ultimately they don’t need to know which language is the native one, because all they write is: <math-up>ln x = int_1^x 1/t dt</math-up> And let the library translate to MathML for them.
- WorldMaker 4y agoI think UnicodeMath [1] is really interesting and approachable and is a standard that Unicode themselves have been keeping an eye on/helping maintain. It takes advantage of the richness of Unicode in interesting ways that makes the formula encodings in plain text better resemble their formatted counterparts. (You just have to forgive that the standard originated from the Microsoft Office team.) The interesting thing to me that UnicodeMath partly implies is the idea that math formatting could be considered similar to "regular font rendering" in a similar way to how ubiquitous emoji have become. [1] https://www.unicode.org/notes/tn28/UTN28-PlainTextMath-v3.1.pdf https://www.unicode.org/notes/tn28/UTN28-PlainTextMath-v3.1....
- wrp 4y agoI think the LO Math formula language is nearly an exact implementation of eqn. I prefer eqn to LaTeX because it is easier to remember/write/read, but complex equations tend to take some fiddling to avoid ambiguities.
- magicalist 4y agoUser as in reader? That's definitely not true. It becomes integrated into the document (vs a rasterized image), can copy/paste, etc. User as in author? That's true, but latex -> mathml conversion already exists and is decent, and will get increased attention now that the major browsers all support it to a baseline level.
- zamadatix 4y agoFWIW a rasterized image isn't LaTeX any more than a rasterized image is MathML. Both are markups and both can (and are able to) be rendered into the document in a way they are selectable, sharply resizable, and so on.
- owlbite 4y agoCharacterizing LaTeX as a rasterized image is really putting up a straw man - MathJax and similar have existed for a long time. As a reader of raw markup, LaTeX is much much more readable than MathML. As a human writing the stuff, MathML is basically unusable. If you're using some gui/whatever then the backend format is just a tooling issue - why opt for the one that is obtuse for humans to interact with? It's very similar to the reason why we've evolved from HTML to markdown and the like - XML is terrible to interact with if you're not a computer. And even if you are a computer, there's a seeming preference for json, yml and the like over XML as it's human readable/modifiable.
- BlueTemplar 4y agoThere are path dependance issues here. Sadly, TeX is (today) wedded way too much to the PDF format, which not only has tons of baggage, but also is not really appropriate for digital documents. HTML is probably the best digital document format we have, and hopefully more people will try again to make it into a self-contained document format : https://www.russellbeattie.com/notes/posts/the-decades-long-html-bundle-quagmire.html https://www.russellbeattie.com/notes/posts/the-decades-long-... The TeXmacs editor - not to be confused with TeX or emacs, exports and imports to HTML, thanks to MathML : https://www.texmacs.org/tmweb/help/faq.en.html#general-1 https://www.texmacs.org/tmweb/help/faq.en.html#general-1 For instance : http://www.texmacs.org/joris/naw/naw.html http://www.texmacs.org/joris/naw/naw.html (EDIT : oops, at least it used to use MathML, I guess they might have made it optional considering the lack of support by Chrome ?) Also, LaTeX specifically has the issue that a LOT of its tooling has poor Unicode support, though Lua(La)TeX and Xe(La)Tex are trying to make that better.
- vehemenz 4y agoMathML has more capabilities than the ad hoc notation of LateX simply in virtue of being XML-based. Whether these capabilities are ever realized is another question, but LaTeX had a pretty big head start and better tools.
- andyferris 4y agoThis confuses me... TeX and LaTeX by extension are entire programming languages, in terms of _capability_ MathML is to LaTeX what JSON is to Javascript - just a representation of the final output, rather than the logic to produce it. That said I think just having a universal "target" format for formulae will make things much better (much like JSON itself is an "advancement" in it's own right, because of the easy interoperability it unlocks).
- runarberg 4y agoIndeed. That’s the sense that I get as well. MathML is ultimately about rendering but not the language, but they had to pick a language, so they picked one that was easy to translate into, and had a nice mapping to the DOM structure.
- charlieyu1 4y agoLaTeX is nice to write until it is not, like you need an equation block or tables or wants to generate an equation programatically. And it goes through a mysterious backend engine that renders something that is correct 90% of the time.
- jraph 4y agoI was with you, especially with the "mysterious backend engine", until the 90% thing. Do you have examples where LaTeX's rendering is incorrect?
- charlieyu1 4y agoBad choices of my words, LaTeX always render correct but I can't be sure my input is going to give me what I actually want
- jraph 4y agookay, fully with you now :-)
- vehemenz 4y agoMathML's removal in 2013 in Chrome was a huge deal in the accessibility community. Fixing the bugs and vulnerabilities of MathML in blink would have been entirely possible with Google's resources. In hindsight, it's easy to see why—now we consider Google an ad company first—but back then it was truly bewildering, given that Firefox continued their support of MathML. There was a big push at the time for native presentational MathML, and Chrome basically undercut it completely. MathJax picked up some of the slack, but it was never a true replacement. Either way, it's nice see presentational MathML is back.
- whimsicalism 4y ago> it's easy to see why—now we consider Google an ad company first—but back then it was truly bewildering ?
- kabes 4y agoI get what he means. Back in the day I naively looked at Google like it was some kind of technology Santa Claus. Giving a decent email client to the people. Fighting of big bad Microsoft IE with a standard compliant browser etc. As a teenage programmer I hoped I could some day work for Google (or develop games). How things have changed... (still would like to create a game though)
- kmeisthax 4y agoYou'd be better off working at Google than developing games, IMO.
- josephg 4y agoThat might be the most pragmatic and convenient answer, but comfort is the death of joy. A life truly lived aught to include some decisions that from the outside might seem ridiculous.
- saagarjha 4y agoDepends on your value system, really. Some people would find working for an advertising company like Google to be unethical, even though it would probably pay more and have a better work-life balance.
- _the_inflator 4y agoI like it. Here you can have a look at the syntax as well as the corresponding results: https://www.w3.org/TR/mathml-core/ https://www.w3.org/TR/mathml-core/ Maybe a LaTeX to MathML converter would be decent.
- Jap2-0 4y agoLaTeX to MathML converters already exist: https://fred-wang.github.io/TeXZilla/ https://fred-wang.github.io/TeXZilla/
- Jabbles 4y agoThe first example just looks bad... is it supposed to? https://www.w3.org/TR/mathml-core/#the-top-level-math-element https://www.w3.org/TR/mathml-core/#the-top-level-math-elemen...
- yakubin 4y agopandoc has a built-in converter. Put your maths in Markdown between dollar signs and use the --mathml option to pandoc.
- SinePost 4y agoI'm a big believer of treating mathematical notation as a first-class citizen on the web. This won't make me jump ship to a Chromium-based browser, but I'm glad to see it happen.
- college_physics 4y ago100% this. Bit for bit math is the densest representation of knowledge invented by the human mind. Its a pity so many people switch off and never "get it" as they crawl in our current educational systems. Maybe making it easily available on the web will help at least a little.
- kccqzy 4y ago> “This is the first example I know of that a major, major feature is really coming to the Web despite there not really being a business case for the business that normally advance the Web,” said Rick Byers of the Chrome team at Google. Paraphrased: It doesn't make money, so why do it?
- rhn_mk1 4y agoThis makes me sad about the state of the Web. Worst thing is, it can't be fixed because the major money makers dictate where the 90% mindshare falls.
- t0xE8st 4y agoIgalia isn't a major money maker. It's barely a large company. But they were able to ship MathML in Chromium. Sure, they have over a decade of experience on working on web browsers, and I'm sure that played a role here, but is that the only reason they were able to work on something like this? Is Igalia special for being willing to put their own money towards improving the web, without an obvious return on investment?
- madeofpalk 4y ago> Is Igalia special for being willing to put their own money towards improving the web, without an obvious return on investment? Just to be clear: > monetary support from the National Information Standards Organization (NISO) via a grant from the Alfred P. Sloan Foundation, Pearson, and APS Physics
- t0xE8st 4y ago> [In Igalia] we have the ability to submit for investments for things that nobody is currently funding but we think deserve funding and deserve to move forward somehow. [...] Initially this came up about doing some work on MathML in WebKit [sic; Blink presumably]. That was years ago. We sponsored all that work, funded all that work, got it done. And then, there was another effort there to try to drive something forward enough to make a proposal and maybe fund it through grants and crowdfunding. So we did an initial thing based on also writing a grant and getting initial money for the project from the National Institute of Standards Organizations and the Alfred P Sloan Foundation. [...] Then we also got small amounts of funding, few thousands from Pearson and APS Physics. And then there was a period where there was no more funding to be had for about a year, year and a half. And so Igalia stepped back in and funded the work. It slowed down slightly toward the end there, but we kept it going the whole time. And then we started Open Collective. (https://www.igalia.com/chats/mathml-release https://www.igalia.com/chats/mathml-release) It seems like some of the work that Igalia did was externally funded, but far from all of it.
- sideeffffect 4y agoThe history of that ticket is really mind-blowing https://bugs.chromium.org/p/chromium/issues/detail?id=6606 https://bugs.chromium.org/p/chromium/issues/detail?id=6606
- deleted 4y ago[deleted]
- garganzol 4y agoI'm in for MathML, but could it be just a loadable JavaScript component instead? Considering the usage frequency of MathML, a built-in browser implementation looks kind of wasteful.
- dginev 4y agoLet's revisit your comment in a couple of years, when people actually have had the incentive to publish enough <math> elements out there. If no one uses it, it will eventually get phased out. I have just about a billion <math> elements in the arXiv preview site I develop: https://ar5iv.labs.arxiv.org/ https://ar5iv.labs.arxiv.org/ And that is just one site. PubMed will likely have more than that at some point: https://pubmed.ncbi.nlm.nih.gov/ https://pubmed.ncbi.nlm.nih.gov/
- rhdunn 4y agoMathJax is that, but it has issues with being an additional downloadable script, not fully integrating with accessibility, css, copying, etc. There are also some things like stretchable brackets that are hard to implement outside the browser.
- miohtama 4y agoThis crossed my mind a well. However if you read here https://mathml.igalia.com/ https://mathml.igalia.com/ There are obvious benefits to have it in the core - Native implementation for efficient layout and automatic reflow. - No external resources required except for purely stylistic information. - Cross-compatible and high-quality rendering possible using TeX and OpenType MATH rules. - Visual rendering fully controlled by font and CSS styling. - Compatible with the other HTML5 technologies for best user and developer experience. - Formula content works well with browser UI: zooming, select, copy & paste, find text, etc. - Information properly exposed to assistive technologies Is it wasteful? Maybe. Is it better? Sure. Also there is the question because MathML is a niche other browsers need to have fallbacks / polyfills.
- mindcrime 4y ago- Formula content works well with browser UI: zooming, select, copy & paste, find text, etc. This alone, to me, is good enough reason to be excited for the return of native MathML rendering to Chrome. Now let's just hope this work gets propagated to Edge as well. Firefox, Chrome and Safari will now all have at least decent MathML support and since Edge is based on the same underlying engine as Chrome, there doesn't seem to be any obvious reason why MS wouldn't enable such support as well. fingers crossed
- atishay811 4y agoI really long a WebSQL core coming back to the web. Get us back a good SQL implementation in browsers. WASM SQL over IndexDB should not be the future.
- est31 4y agoThe issue with WebSQL was, and still is, that it is basically impossible to standardize, as you wouldn't get multiple different implementations, but just one that all browsers use as a library. The main task of a browser is not to provide an SQL API client side, but to display interactive documents, so you won't find the bandwidth for browsers to build multiple SQL implementations, and the existing ones have quite big incompatibilities to each other.
- int_19h 4y agoIt's a manufactured issue that is rather absurd on its face. If SQLite is so popular that literally everyone ships it and nobody even wants to talk about writing an alternative, then take it and standardize it as is, or at least some sensible subset of it. It's probably the most open and portable codebase of notable size in widespread use worldwide, so any portability concerns are extremely hypothetical, while the productivity losses from not having a portable relational store in the browser are very real.
- lloydatkinson 4y agoIs this the first time a major feature has been removed and then added back, with such a long period between?
- shihn 4y agoI implemented MathML as web components a few years ago as a work around. It wasn't super hard, but a native implementation provides so much better accessibility (and, likely, perf) https://github.com/pshihn/math-ml https://github.com/pshihn/math-ml
- simoneau 4y agojsMath, now MathJax, took all the wind out of MathML’s sails by rendering LaTeX equations in the client. I know that MathML is better in some ways, but the combination of downloading custom fonts and JavaScript-based layout solved the problem well enough.
- WorldMaker 4y agoMy understanding was that the early versions of jsMath/MathJax started by converting LaTeX to MathML in the brief few years of relatively common browser MathML support and still uses something very like MathML for internal representations and still supports MathML as the output format.
- bfgeek 4y agoOne important aspect the work Igalia/Fred/etc did here was defining how MathML should render in browsers. Previously was this undefined[1], and working through all the integration points with CSS/HTML in the new MathML Core spec[2]. The next largest part was writing all the tests for this work, e.g. making sure that margin/border/padding worked consistently between all the MathML elements[3]. Arguably the implementation in Chromium was the "smallest" part of the work required here. Congrats to Fred/Igalia/MathML-CG and all those involved. :) [1] https://www.w3.org/TR/MathML3/chapter2.html#fund.renderingmodel https://www.w3.org/TR/MathML3/chapter2.html#fund.renderingmo... [2] https://www.w3.org/TR/mathml-core https://www.w3.org/TR/mathml-core [3] https://wpt.fyi/results/mathml/relations/css-styling/padding-border-margin https://wpt.fyi/results/mathml/relations/css-styling/padding...
- raydiatian 4y agoAny demos?
- yakubin 4y agoGreat news. Kudos to Igalia!