by pcwalton · 10y ago · 0 comments
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.
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....
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.
- 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)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...
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.
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.
If your equations require concurrency to render, you're either a genius or insane. Or both.