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…
Does anyone else prefer writing troff/tbl/pic/eqn? I always felt that the language of TeX/LaTex was a step backward in user-friendliness.
MathML is a failed web standard
121–130 of 177 posts
Re: MathML is a failed web standard
#122Earlier quoted context omitted.
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" } } }
JSON is great at many things, but polymorphic substructures are AFAIK only really possible with everything being an object defining the "type" that it is. And that looks significantly uglier than what you have above:
{
"type": "mrow",
"children": [
{
"type": "mi",
"identifier": "x"
},
{
"type": "mo",
"operator": "="
},
{
"type": "mfrac",
"rows": [
{
"type": "mrow",
"children": [
{
"type": "mo",
"operator": "-"
},
{
"type": "mi",
"identifier": "b"
},
{
"type": "mo",
"operator": "±"
},
{
"type": "sqrt",
"expression": {
"type": "mrow",
"children": [
{
"type": "mi",
"identifier": "b"
},
{
"type": "msup",
"expression": {
"type": "mi",
"identifier": 2
}
},
{
"type": "mo",
"operator": "-"
},
{
"type": "mi",
"identifier": "4ac"
}
]
}
}
]
},
{
"type": "mi",
"identifier": "2a"
}
]
}
]
}Re: MathML is a failed web standard
#123It’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…
Does anyone else prefer writing troff/tbl/pic/eqn? I always felt that the language of TeX/LaTex was a step backward in user-friendliness.
Re: MathML is a failed web standard
#124It’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…
Shouldn't the '=' and the minus and the other signs be inside , rather than , because they are binary operators, not identifiers? TeX for example, makes a clear distinction in terms of how much whitespace it would surround operators with, vs. identifiers. In any case, I suspect MathML was intended as an intermediate computer-readable representation, not something that anyone would write by hand (MathJax can compile y…
You’re right; I should have marked those up with instead.
Re: MathML is a failed web standard
#125Earlier quoted context omitted.
MathJax works reasonably well, but I can almost read the TeX source out loud faster than the browser renders it (together with PDF.js, this has been my go-to counterexample whenever someone claims that JavaScript is performant). With formula-heavy text, I'm forced to split documents artificially into multiple short pages to make rendering reasonably fast. KaTeX looks quite promising, but it was missing support for qu…
Is there a way to pre-render MathJax, say, for static blogs?
Re: MathML is a failed web standard
#126It’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…
In AsciiMath[1], x = (-b +- sqrt(b^2 - 4ac)) / (2a) [1]: http://asciimath.org/
Re: MathML is a failed web standard
#127It’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…
In AsciiMath[1], x = (-b +- sqrt(b^2 - 4ac)) / (2a) [1]: http://asciimath.org/
Re: MathML is a failed web standard
#128Blargh. 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…
If your equations require concurrency to render, you're either a genius or insane. Or both.
Re: MathML is a failed web standard
#129Earlier quoted context omitted.
> 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" } } }
What you have doesn't work. What if I have "mi, mo, mfrac, mo, mi" at the top level? So something like "a - b/c + d". You can't specify the same key twice in JSON. Also, keys are technically unordered, so there's no guarantee that a parser will put that top-level "mi" before the "mfrac". JSON is great at many things, but polymorphic substructures are AFAIK only really possible with everything being an object defining…
{ "mrow": [
{ "mi": "x" },
{ "mo": "=" },
{ "mfrac": [
{ "mrow": [
{ "mo": "-" },
{ "mi": "b" },
{ "mo": "±" },
{ "sqrt": {
{ "mrow": [
{"mi": "b"},
{"msup": { "mi": 2 }},
{"mo": "-"},
{"mi", "4ac"}
]}
}}
},
{ "mrow": [
{"mi": "2a"}
]}
]}
}
It's not as general, but works if you know your syntax is similarly bounded. I don't know how certain static languages would handle serial/deserializing, but makes construction via javascript literals much more pleasant.Re: MathML is a failed web standard
#130It’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…
Does anyone else prefer writing troff/tbl/pic/eqn? I always felt that the language of TeX/LaTex was a step backward in user-friendliness.