Live data from Hacker News

MathML is a failed web standard

peterkrautzberger.org

71–80 of 177 posts

Re: MathML is a failed web standard

#71
post #57
post #55

Earlier quoted context omitted.

Considering amount of expertise that went into making TeX and the fact that (in my experience at least) it far surpasses other solutions, it might simply be that mathematical notation typesetting doesn't lend itself to dynamic reflow, internationalization, parallelization, DOM representation, interoperability with CSS and its concept of blocks and inline layouts, wrapping around floats, single pass processing and int…

This is about how I feel. Can someone who’s actually competent explain why (La)TeX output looks so much better than what web browsers do? I’m not talking about childish colors, sticky headers, and all the other annoying “modern web features”, just the relevant content: some text and inline images.

A few things that make LaTeX docs look good:

    - quality justified paragraphs making use of inter-word spacing and hyphenation
    - font ligatures (tex uses quality fonts have special characters for sequences like fi fi fl ffi ffl ft etc)
    - good heuristics about where to cut pages (e.g. flexible spacing around heading)

Re: MathML is a failed web standard

#72
post #70
post #54

Earlier quoted context omitted.

TeX's bug bounty and the credentials of its author are good reasons why it's probably one of the most reliable pieces of such code that you might have.

Knuth has an older and more narrow concept of 'bug' than the current common definition.

A "bug" in relation to the functionality of a layout software is also vastly different from battle-hardened code in the field of security.

Re: MathML is a failed web standard

#73
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…

"What is XML good at?"

(For the purposes of this post, I'm including HTML in the XML family.)

XML/HTML is good when:

1. You have two dimensions of markup you want to do. That is, you have a clear distinction between what is a new "tag" and what is an attribute on that tag. If you can't almost instantly decide whether some feature you want to add works as an attribute or a tag, you probably shouldn't be in XML.

2. Almost every tag one way or another contains some text, the third dimension that XML supports. A proliferation of tags that never contain any text is a bad sign. A handful may not be a problem, e.g. "hr" in HTML, but they should be the exception.

3. You have a really good use case for XML namespacing, the fourth dimension of information that XML supports, in which case there's almost no competition for a well-standardized format, as long as you're also using the previous three dimensions.

There's sort of this popular myth that XML is useless, which I think isn't because it's true or that XML is bad, I think it's because in general, most times you want to dump out a data structure #1 isn't true, let alone #2 or #3. In a lot of data sets, you've only got the two dimensions of "simple structure" and "text", not annotations on the structure itself. (Or, perhaps even more accurately, they end up implicit in the format itself, and the format is constant enough for that to be just fine.) A lot of stuff in the 1990s and 200xs used XML "because XML" even though it clearly failed #1. XML is really klunky when you don't want that second dimension because the XML APIs generally can't let you ignore it, or they wouldn't actually be XML APIs.

On the other hand, when you learn this distinction, you do come across the occasional JSON-based format that clearly really ought to be XML instead. You can embed anything you want into JSON, but when you're manually embedding a second structure dimension into your JSON document, it loses its advantages over XML fast. If you've ever seen any of the various attempts to fully embed HTML into JSON, without leaving any features behind, you can begin to see why XML or XML-esque standards like HTML aren't a bad idea. HTML is much easier to read for humans than HTML-in-JSON-with-no-compromises.

And if you've truly got the four-dimensional use case, XML is really quite nice. When you need all the features, suddenly the libraries, completely standardized serialization, and XPath support and such are all actually convenient and surprisingly easy to use, for what you're getting.

Some examples: HTML is a generally good idea. SVG is a middling idea; it passes #1 and #3 but fails #2. SOAP and XML-RPC is generally a bad idea; SOAP fails #1 and #2 but sort of uses #3 and XML-RPC fails all three. XMPP I actually think is pretty solid as an XML format (mere network verbosity problems can be solved with an alternate encoding, though admittedly that becomes non-standard), and in a lot of ways, the real problem with XMPP isn't so much the format itself as that people are not used to dealing with the four-dimensional data structures that result. People expecting IRC-esque flat text are not expecting such detail. Using the fourth dimension of namespaces for extensibility is neat, but few developers understand it, or want to.

Re: MathML is a failed web standard

#74
post #57

Earlier quoted context omitted.

This is about how I feel. Can someone who’s actually competent explain why (La)TeX output looks so much better than what web browsers do? I’m not talking about childish colors, sticky headers, and all the other annoying “modern web features”, just the relevant content: some text and inline images.

A few things that make LaTeX docs look good: - quality justified paragraphs making use of inter-word spacing and hyphenation - font ligatures (tex uses quality fonts have special characters for sequences like fi fi fl ffi ffl ft etc) - good heuristics about where to cut pages (e.g. flexible spacing around heading)

But that begs the question why web browsers don’t implement this. Is there a technical reason or did at some point some people decided that decent text rendering is irrelevant one should focus on other gimmicks?

Re: MathML is a failed web standard

#75

Earlier quoted context omitted.

Wikipedia seems to be using a mechanism where TeX code is rendered into images, but on marking and copying into an editor becomes TeX again, wouldn't that be a sufficient solution for copying?

Isn't it the default behaviour when you put alt-text in the image tag?

That makes sense, I just mentioned it as an example of how the result is easy to achieve.

Re: MathML is a failed web standard

#76
post #48

Earlier quoted context omitted.

In a more liberal sense the opposite of "open standard".

Why not use closed standard than, it is not ambiguous and exactly expresses what you would like to convey. Thanks for clarifying though.

I don't think that it's a closed standard either. Rather, like Perl 5, it seems to be a non-standardised, or, perhaps less pejoratively, implementation-defined language.

On the other hand, somewhat like Perl, it is also a language intended from its beginning to be extended. Knuth has said that he never expected things like LaTeX to be built on top of TeX; he rather thought that people would hack directly on the TeX source as necessary.

Re: MathML is a failed web standard

#77
post #5

Earlier quoted context omitted.

TeX is analogous to Presentation MathML but doesn't solve the accessibility concerns because the semantic intent of the TeX source isn't always clear. (How do you read a \phantom{}? Or how can you know that "\left( 7 \atop 3 \right)" should be read as "7 choose 3"?)

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.

Re: MathML is a failed web standard

#78

Many standards have failed for the web. Anybody remember VRML? Actually I like it that we have not a broad big big standard which includes MathML which only ~0,1% of people care about in the browser. MathML can stand on its own (encapsulated with JS like PDFs in Firefox) or you can abandon it entirely. You are free to choose. It's the best way for everybody.

We still use VRML at work, lord knows why.

Re: MathML is a failed web standard

#79
post #5

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…

TeX is analogous to Presentation MathML but doesn't solve the accessibility concerns because the semantic intent of the TeX source isn't always clear. (How do you read a \phantom{}? Or how can you know that "\left( 7 \atop 3 \right)" should be read as "7 choose 3"?)

You should define your own commands and then use them, in preference to directly using markup. For example, at the start of my essay on non-standard analysis, I define some commands:

- "\near" as a synonym for "\simeq"

- \newcommand{\hyp}[1][\mathbb{R}]{\prescript{*}{}{#1}}

- \newcommand{\powerset}{\mathcal{P}}

This way you can change the notation easily and all-at-once if you need to, as well as making the semantics clear to the source-reader.

Re: MathML is a failed web standard

#80
post #48

Earlier quoted context omitted.

I don't think that proprietary applies here. proprietary adjective 1. relating to an owner or ownership. 2.(of a product) marketed under and protected by a registered trade name. None of the above is true to TeX. What am I missing?

In a more liberal sense the opposite of "open standard".

I wouldn't describe TeX as a "standard", but it's pretty hard to argue that it's "closed": TeX is arguably the best documented program in history!

Knuth wrote it using his novel "literate programming" technique in which the source code is embedded in the documentation. Every 4-5 lines of source code has roughly a paragraph of explanation. That source/documentation is published for anyone to read as Knuth's "TeX: The Program" book, accompanied by his "TeXBook", a couple hundred pages each.

That documentation has definitely encouraged all the people reimplementing the TeX layout algorithms, for example MathJax and matplotlib for math layout, as well as a number of alternative tex implementations.

Post reply on HN