Complexity of HTML and LaTeX

Sometime around 1994, my office mate introduced me to HTML by saying it was 10 times simpler than LaTeX. At the time I thought he was right. Now I’m not so sure. Maybe he was right in 1994 when the expectations for HTML were very low.

It is easier to bang out a simple, ugly HTML page than to write your first LaTeX document. When you compare the time required to make an attractive document, the effort becomes more comparable. The more sophisticated you get, the simpler LaTeX becomes by comparison.

Of course the two languages are not exactly comparable. HTML targets a web browser while LaTeX targets paper. HTML would be much simpler if people only used it to create documents to print out on their own printer. A major challenge with HTML is not knowing how someone else will use your document. You don’t know what browser they will view it with, at what resolution, etc. For that matter, you don’t know whether they’re even going to view it at all — they may use a screen reader to listen to the document.

Writing HTML is much more complicated than writing LaTeX if you take a broad view of all that is required to do it well: learning about accessibility and internationalization, keeping track of browser capabilities and market shares, adapting to evolving standards, etc. The closer you look into it, the less HTML has in common with LaTeX. The two languages are not simply two systems of markup; they address different problems.

Related links:

9 thoughts on “Complexity of HTML and LaTeX

  1. Drop in a little css and some java script, plus all the behaviors (browsers) you described and it’s a h— of a lot harder. Although I have beaten my brain senseless with both of them.

  2. I certainly love LaTeX – I write most of my stuff in it. But I do wish it could be just a little more orthogonal.

  3. I have wondered about similarities and differences between the two as well. Their development has also been conducted very differently. In the case of LaTeX, a few people drove language development. It’s a remarkably portable, cohesive markup system. I believe few people code HTML from scratch nowadays. Conversely, a vast majority of people edit LaTeX source rather than using front-ends like LyX. Even if (La)TeX is much humbler in its goals, it is a remarkable success story.

  4. I think the relation goes the other way around: the larger and more complex your needs, the less reliable TeX variants become. Styles (read: arbitrary macros, really) interact in odd, unpredictable ways, and it’s very hard to determine where spacing comes from in a particular document – particularly if you’re deviating from the “default” latex a lot.

    Also, the more complex something becomes, the more reasonable some form of auto-generation and multi-authorship becomes. Indeed, TeX’s macro’s actively encourage that. Unfortunately, TeX deals with syntax and other errors very poorly, probably partially because it’s a self-modifying language: I doesn’t look to be possible to write a parser that’s not also an interpreter of the underlying semantics. So – when something “breaks” in (macro)generated code you may not get the error anywhere near the root cause, but possibly pretty much anywhere – which isn’t good for complex documents.

    Then there’s the fact that TeX is slow – this is a problem for complex documents because it implies discrete compilation steps – which in turn mean that any errors do not immediately become apparent, which exacerbates TeX’s inherent brittleness.

    So, TeX works best if you’re using prepackaged styles for as much as possible of your layout and only combining these from as few as possible sources. By contrast, html+css doesn’t suffer from these problems, but also lacks the small-scale (but no less valuable) handy math-markup.

  5. Eamon: You make some interesting points. You’re thinking about scaling in a different direction. I was just thinking about the complexity of typesetting a single document by a single author, but you’re looking at combining input from multiple sources.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>