bor.borygmus

A programming weblog by Hao Lian. • A long walk through an angry forest. • A series of memory leaks brought on by senility.

You want fame and possible fortune? Save me from LaTeX.

I love LaTeX for its typography, its math rendering, and its bibliographical system. But that’s about it. You too have a list like mine; if you go down any further, you’ll soon find that the things you love about LaTeX exponentially diminish in size while its flaws magnify.

It has an abysmal compilation system. LaTeX spits out a morass of temporary files, and recompiles throw away most of the work anyhow. At least one compiler (pdfLaTeX) generates verbose, repetitive, and archaic error messages for syntax mistakes. With incorrect line numbers. It’s a system built on fragile functions (called macros) with no system in place for reasonably communicating errors to users.

If you throw in BiBTeX and figures, break out the Makefiles.

The documentation is awful. For LaTeX itself, the definitive manual is a monolith of a book. Without it, you will spend hours piecing together tips and tutorials from online sources. For the most popular packages, you can expect decent docs with memoir as the bastion of light, coming in with a 4 MB dissertation about the theory and practice of book layouts. For lesser packages, authors mistake “pasting the source code” for “helpful information”. It’s a torrential nightmare whirlpool of tips-and-tricks with no centralization.

Aside: Here’s a plug for LaTeX wikia. If you are planning on posting a LaTeX tip to a forum or writing the (n+1)th LaTeX FAQ, stop. Put it on the wiki and link to it.

Someone can do better. (And don’t look at me with those eyes with that look: I love using LaTeX but I would gladly watch Madagascar again before I ever implemented any part of a document renderer. And if everybody else feels the same, then this is just me shouting at trees.) The tools are here: We have HTML, CSS, and JavaScript. Three languages with a wide user base and an enormous set of tools built to support, debug, create, and massage them. But browsers ignore print layout with an enormously prolific set of zero rendering engines supporting hyphenation, justification, columns, footnotes, and all the other detritus that make a LaTeX document beautiful. Web pages simply don’t need any of it, but of course the goal is to grow Web markup into document markup. And for now, I’m forced to constantly choose between two document creation systems: One is beautiful, has a math engine, and is a usability nightmare. The other is ubiquitous, usable, and ugly.

If you hooked this Platonic engine up to HTML, CSS, and JavaScript, we could push LaTeX into a lake and walk away. Margins on the document? Throw out the geometry package, just write a few lines of CSS. You want to align equations? JavaScript: process the text into a layout table. Want to parse your document HTML for your own tools? Throw a rock, hit an HTML parser, and drag it back to the cave.

And I would gladly give up all the packages in CTAN for this. That’s a short-term loss the size of a fly at a distance compared to what we would gain.

Yesterday, a Hacker News thread asked what software you would pay immediately if it were available. This is mine. I would pay for a rendering engine that can replace LaTeX after thirty years of mediocrity.

Hello! In this article, we wrote “LaTeX” when at times we really might have meant “TeX”. You’re welcome for my having intellectually stimulated your confusion cortex.

[(April 10, 2009) .]

There’s also DocBook.

Anyway, I completely agree. TeX is semi-decent, but in this day and age, something better is long overdue. If you ask me, it’s become a hack job, more than anything else. And I’m convinced that, even with years of LaTeX experience, you can never really be sure how your document is going to turn out, which totally defies the purpose.

Tim, 2009.04.13 (6 am)

Ha, I can’t agree enough.

I’ve never tried DocBook, but it looks great for non-mathematic work at least. I’d probably struggle with not being able to type the syntax as quickly as LaTeX (or switching to a DocBook-oriented editor environment).

But it’d be awesome if the “XSL-FO to PDF” rendering software eventually got good enough (or already is) to replace LaTeX, which is something I haven’t even considered.

Hao, 2009.04.13 (4 pm)

Abandon your ideas.

Use Markdown+, but not HTML. In code blocks, beware angle brackets.