News for hackers. Stuff that matters.
Re:MathML is a failed web standard by pcwalton on Thursday April 07, 2016 @03:22AM (#11445369)
> 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 and inline layout that doesn't allow for text wrapping around floats without hacks, requires multiple passes to compute various things like tables of contents, and wasn't designed for interactive-level performance. Something syntactically like TeX may well be the solution, but jamming TeX itself into the Web platform wouldn't end well.

Re:MathML is a failed web standard by MrManatee on Thursday April 07, 2016 @08:32AM (#11446704)
Yeah. The main thing people probably want is "TeX quality" typesetting of mathematical formulas inside web pages. Bundling the entirety of TeX inside a browser for this purpose would be kind of a hack, and suboptimal in many ways. I think that instead of just using TeX as a black box, it would be more interesting to actually learn what makes its formulas look good, and apply these lessons in modern software.

There's a related article called A Functional Description of TeX's Formula Layout [1] that describes a more modern reimplementation of a part of TeX.

[1] http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.39....

Re:MathML is a failed web standard by avian on Thursday April 07, 2016 @07:40AM (#11446439)
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 interactive-level performance.
Re:MathML is a failed web standard by pcwalton on Thursday April 07, 2016 @11:38AM (#11448096)
I don't see why, from a technical point of view. There's no reason we should throw out the benefits of the Web platform because TeX happens to do things a certain way. With MathJax and tools like it, we can bring the benefits of TeX to the Web platform in a way that actually meshes well with what the platform provides.
Re:MathML is a failed web standard by hansen on Thursday April 07, 2016 @07:51AM (#11446488)
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.
Re:MathML is a failed web standard by TeMPOraL on Thursday April 07, 2016 @09:09AM (#11446912)
Because TeX documents are usually made by people who have something valuable to say, and the tool reflects that. On the other hand most of the web is designed to sell you stuff, and the actual content is not important. The tool, again, reflects that.
Re:MathML is a failed web standard by pcwalton on Thursday April 07, 2016 @11:41AM (#11448121)
I don't think TeX output looks better than what Web browsers do if you enable all the high-quality text features like hyphenation and use modern OpenType fonts (in particular not the Core Fonts for the Web). The reason why the Web doesn't do this by default is backwards compatibility and performance: hyphenation is asymptotically more expensive.
Re:MathML is a failed web standard by Mikhail_Edoshin on Friday April 08, 2016 @03:25PM (#11457182)
TeX doesn't hyphenate every word, it only attempts hyphenation when it looks where to break a line. That said, I don't see why a document cannot be prehyphenated once on the server; I'd say this is the right thing to do. (Besides, in this case we don't have to rely solely on algorithms.)

It's not that CSS is still very far from professional typesetting; what amazes me is that at the same time it's much more complex. Look at all these possible 'display' values and box models! And you still cannot do a run-in header! Or automatic numeration! (You can do the latter natively with XSLT, but it's not cool.) By comparison TeX only has boxes, vertical and horizontal lists, glue, and a few lesser things like kerning. And it produces works of art.

Re:MathML is a failed web standard by ivan_ah on Thursday April 07, 2016 @09:15AM (#11446955)
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 by pcwalton on Thursday April 07, 2016 @11:33AM (#11448056)
Web browsers implement all of this nowadays. In fact, OpenType GSUB ligatures in particular go far beyond what TeX supports.
Re:MathML is a failed web standard by hansen on Thursday April 07, 2016 @09:23AM (#11447007)
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 by TeMPOraL on Thursday April 07, 2016 @11:11AM (#11447847)
The Web started as a tool for rendering text and occasional images pretty much as soon as it comes out of the wire. TeX on the other hand, was meant to be a typesetting package which compiles textual description of the document into a beautiful printable form. That compilation takes noticeable time even today, I imagine it was unacceptably slow for the web back before. Also in TeX you deal with paper sizes, in browsers you deal with adjustable viewports of unpredictable size.

I guess that the Web just started simple and evolved from that, and then nobody bothered to remake it for prettier text.

Re:MathML is a failed web standard by Mikhail_Edoshin on Saturday April 09, 2016 @03:14AM (#11460319)
I remember an old publishing package, Ventura Publisher; the first time I saw it was 1990 or 91 maybe and then it was at v3. It was a very versatile publishing tool (all the perks of a professional typesetting package, tables, equations, floating illustrations; lots).

What's interesting is that it could separate the content and the styling information, so you could load the same content into two or more publications with different styles and get two different typesetting from the same source (e.g. one column small page for a book and two or three column large page for an article in a journal). And it was very easy to change the format or paper size: just change it and it would reflow the content accordingly. It didn't even took much time, as far as I can remember, and I'm talking about IBM PC 286 here.

So, truly, it's not a technical obstacle; web could have a much better typesetting engine working at high speed (and I'd say that it would be much better to imitate paged media instead of scrolling; scrolling is really inconvenient for reading). It's just that it grows wildly and in all directions at once; it tries to be a "semantic" storage, a rendering medium, and an application engine at the same time, and is not particularly good at any of this.

Re:MathML is a failed web standard by sp332 on Thursday April 07, 2016 @11:00AM (#11447770)
I don't think HTML-typeset math has to look bad. e.g. http://www.deeplearningbook.org/contents/linear_algebra.html Well this particular example is auto-generated and the code looks terrible, but it's not hopeless to get nice math without TeX.
Re:MathML is a failed web standard by jahewson on Thursday April 07, 2016 @03:25PM (#11449898)
Compared to the amazing complexity of OpenType layout for complex scripts, mathematical typesetting is pretty simple. It's just not been a priority for the browser vendors, in the same way that we now have amazing technologies like WebRTC and WebGL but managing bookmarks still sucks.

It might "simply be" the case (well, in fact it is) that TeX is simply really old and doesn't lend itself well to concepts it predates such as dynamic reflow, etc...

Re:MathML is a failed web standard by IshKebab on Thursday April 07, 2016 @05:29AM (#11445947)
All good points, it would be insane to include a full TeX engine in the browser.

But for just rendering equations, I don't think you can beat TeX for ease of use. And most of the criticisms then don't apply - you can void the insane macro system, it doesn't require multiple passes, etc. I guess lack of CSS support could still be an issue.

Re:MathML is a failed web standard by PaulTopping on Thursday April 07, 2016 @11:18AM (#11447920)
Good answer. TeX is an input language and is fairly good at what it does for mathematicians. From a programming language and systems point of view, it is an ancient, ad hoc mess. TeX could be used as a computer representation, but it fails for that purpose for lots of reasons, several of which you mention here.
Re:MathML is a failed web standard by criddell on Thursday April 07, 2016 @10:15AM (#11447391)
> 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 by pcwalton on Thursday April 07, 2016 @02:31PM (#11449458)
There is no spec for TeX as far as I know: it's defined by its (effectively frozen) implementation.
Re:MathML is a failed web standard by ocschwar on Thursday April 07, 2016 @01:58PM (#11449203)
OMG.

If your equations require concurrency to render, you're either a genius or insane. Or both.

Re:MathML is a failed web standard by pcwalton on Thursday April 07, 2016 @02:30PM (#11449452)
It's not that we need parallelism for layout to work. Rather it's that, in 2016 with Moore's Law over, new standards for performance-critical things ought to consider parallelism so they can continue to scale in the future.
Re:MathML is a failed web standard by stshine on Thursday April 07, 2016 @05:55AM (#11446053)
Thanks, now I know I don't need to spend time to study the layout system of TeX.