Live data from Hacker News

MathML is a failed web standard

peterkrautzberger.org

81–90 of 177 posts

Re: MathML is a failed web standard

#81

Since we're discussing various math rendering technologies for the web, I'd like to plug MathQuill [1]. The big advantage MathQuill has over other solutions is that the math is live editable in the browser in typeset form. We use it for input on the Desmos graphing calculator [2], and MathQuill is definitely the best WYSIWYG math editor that I have used anywhere, on the web or elsewhere. [1] http://mathquill.com/ [2]…

Desmos's MathQuill interface is great. By far the easiest to use math input I've encountered. I haven't tried to input anything really exotic, but it's extremely intuitive for the simple to intermediate level of complexity.

Thanks for your work on Desmos, it's a pleasure to use.

Re: MathML is a failed web standard

#82
post #77

Earlier quoted context omitted.

TeX has "{n \choose k}". (Replaced by "\binom{n}{k}" in LaTeX with amsmath.)

The fact that semantic commands are available in TeX doesn't change the fact that it is, unabashedly, a display rather than a semantic language. Knuth's goal was to create a language to facilitate beautiful typography, rather than one directly for expressing mathematical meaning.

Hence amsmath.

Re: MathML is a failed web standard

#83
post #22

It’s instructive to see how different MathML is from other math markup languages. Here’s the quadratic formula: In troff, x = {-b +- sqrt { b sup 2 - 4ac}} over 2a In TeX, x = {-b \pm \sqrt{b^2-4ac}} \over {2a} In plain Unicode, 𝑥 = (−𝑏 ± √(𝑏² − 4𝑎𝑐))⁄2𝑎 In MathML, x = − b ± b 2 − 4ac 2a MathML is simply unreasonable to write by hand. Most of the time it’s only ever used as an interchange format, automatically…

I audibly groaned at the XML version, but to be fair, it can be presented better:

  
    x
    =
    
      
        −
        b
        ±
        
          
            b2
            −
            4ac
          
        
      
      2a
    
  
Again, I'm not saying this is good. Compared to the brevity of TeX or troff, it's difficult to accept. But XML is easier to read when you give in to its heavyweight structure and format it appropriately.

By the way, on my system (OSX, Chrome), the unicode version is beautiful. I had not realized it was a good math option.

Re: MathML is a failed web standard

#84

Blargh. It annoys me that MathML was even a thing. We've already had a perfectly-fine and widely-used markup language for mathematical formulae; it's called TeX. Ideally, I'd prefer that HTML5 include a tag, or something similar, that takes TeX as input and produces formatted output. A side benefit would mean that every browser, and every system, in the world would have TeX installed! At least MathJax can take TeX as…

> A side benefit would mean that every browser, and every system, in the world would have TeX installed! TeX doesn't have dynamic reflow, is defined by a macro system that involves essentially monkey patching the parser as it goes, lacks anything resembling a DOM, wasn't designed with Unicode or internationalization in mind, is completely unparallelizable, doesn't interoperate with CSS, has its own concept of block a…

> TeX doesn't have...

Is that due to implementation or the specification?

I used TeX a few times back in the mid-90's and something about it really clicked with me. The documents I made with it are easily the most attractive documents I've made.

Since then, I've wondered why TeX isn't used for ebooks and thanks to your comment, now I know.

Re: MathML is a failed web standard

#85
I don't know how many of the people lamenting MathML ever came to exist are active math-on-the-web developers. I for one am dealing with third-party math equations on a daily basis and can only dream of the wonder of ubiquitous MathML support in all major browsers.

The details as to why are here: http://prodg.org/blog/mathml_please/2015-09-16/MathML%20on%2...!

As things stand, math handling on the web is inconvenient at best and a nightmare at worst.

Some quick points about the comments here:

- MathML as a spec is akin to SVG, it's meant for the browser/machine first, and not for direct human consumption. You don't read/write SVG by hand, and neither you should MathML.

- Calling MathML a "failed web standard" is fine by me, as long as you continue the remark with "the Chrome and IE browsers have failed mathematicians" and "the math-on-the-web developers have failed as a community".

Re: MathML is a failed web standard

#86
post #51
post #23

Earlier quoted context omitted.

Yeah. I think that's inevitable with an XML syntax. XML is good at some things, but representing math expressions clearly is not one of them.

> Yeah. I think that's inevitable with an XML syntax. XML is good at some things, but representing math expressions clearly is not one of them. What is XML good at? (by good I mean better than alternatives like JSON, YAML, HAML, etc) The only thing I that might qualify is a long term/archival quality document format like ODF/OOXML. The inherently embeddedable nature of XML does seem like a nice fit but it gets very b…

Why does this have to turn into an XML bashing thread? Writing the above equation in JSON would be just as terrible.

Re: MathML is a failed web standard

#87
post #6

Earlier quoted context omitted.

MathJax is very flexible and its output is certainly high-quality. However, it is difficult to configure and package in my experience, and it's pretty slow. We used it for a few years at Khan Academy before building KaTeX ( https://khan.github.io/KaTeX/ ) which is around 50x faster to render in our experience, not even counting download size. We ran an A/B test for MathJax vs. KaTeX on the Khan Academy site and peopl…

Why do you open the KaTeX source, but not the source for your mobile apps?

KaTeX is more likely to be useful out of the box to other developers, whereas the source of the mobile apps is not going to be a drop-in component that's useful; it'd have to be used more as a learning opportunity by interested devs. That's fine, but it's also a different market. In practical terms, the KA mobile apps also are much more KA-specific and need to be cleaned up before open-sourcing, and there's a worry that people would take the entire app and repackage it as their own (this happens all the time to open-sourced mobile apps, unfortunately). That said, open-sourcing the mobile apps is still something we want to do, so it may happen someday.

Re: MathML is a failed web standard

#88
post #51

Earlier quoted context omitted.

> Yeah. I think that's inevitable with an XML syntax. XML is good at some things, but representing math expressions clearly is not one of them. What is XML good at? (by good I mean better than alternatives like JSON, YAML, HAML, etc) The only thing I that might qualify is a long term/archival quality document format like ODF/OOXML. The inherently embeddedable nature of XML does seem like a nice fit but it gets very b…

XML grew out of SGML/HTML, and there's no denying that its age shows. It's kind of like going into a house built in the 90s and seeing all the little things that just scream "90s house - that looks so dated!" Did you know that web browsers have native support for XML? Try fetching an xml resource and pulling the responseXML value off the XHR - you have another DOM object right in your hands, that you can treat just l…

> Did you know that web browsers have native support for XML?

Not only that, browsers have support for XSLT 1.0, so you can format it and style it with CSS on the fly. Even mobile browsers support that, as far as I can tell.

Re: MathML is a failed web standard

#89

Blargh. It annoys me that MathML was even a thing. We've already had a perfectly-fine and widely-used markup language for mathematical formulae; it's called TeX. Ideally, I'd prefer that HTML5 include a tag, or something similar, that takes TeX as input and produces formatted output. A side benefit would mean that every browser, and every system, in the world would have TeX installed! At least MathJax can take TeX as…

You could put TeX code in a script tag

  
    ...TeX code...
  
and process it using a javascript TeX-to-DOM processor... seems likely somebody, somewhere, has done that?

Update: I just read the rest of the comments and discovered KaTeX.

Re: MathML is a failed web standard

#90
post #51

Earlier quoted context omitted.

> Yeah. I think that's inevitable with an XML syntax. XML is good at some things, but representing math expressions clearly is not one of them. What is XML good at? (by good I mean better than alternatives like JSON, YAML, HAML, etc) The only thing I that might qualify is a long term/archival quality document format like ODF/OOXML. The inherently embeddedable nature of XML does seem like a nice fit but it gets very b…

Why does this have to turn into an XML bashing thread? Writing the above equation in JSON would be just as terrible.

> Writing the above equation in JSON would be just as terrible

Not quite as bad as XML.. I think the problem is more the verbose, overly-nested format that was chosen for MathML than XML itself though.

  {
    "mrow": {
      "mi": [ "x", "=" ],
      "mfrac": {
        "mrow": {
          "mi": [ "−", "b", "±" ],
          "msqrt": {
            "mrow": {
              "msup": {
                "mi": [ "b", "2" ]
              },
              "mi": [ "−", "4ac" ]
            }
          }
        },
        "mi": "2a"
      }
    }
  }
Post reply on HN