July 20th, 2024

What TeX Gets Right

TeX, developed in the 1970s, remains a potent tool for technical writing, especially in mathematics and complex structures. Despite historical limitations, its reliability, efficiency, and community support are praised. Suggestions for modernization are implied.

Read original articleLink Icon
What TeX Gets Right

The article discusses the relevance and strengths of the TeX language in modern technical writing. Despite being developed in the 1970s, TeX remains a powerful tool for typesetting mathematics and handling complex document structures like bibliographic references. TeX's open-ended nature allows for the creation of new blocks and seamless integration of extensions like BibTeX. The language's internal logic is particularly beneficial for technical documents with cross-references, equations, and code. While acknowledging TeX's historical baggage and imperfections, the author highlights its reliability, efficiency, and extensive community support. The article also hints at the need for improvements within the TeX ecosystem, emphasizing the language's potential to meet the demands of 21st-century document creation.

Link Icon 11 comments
By @virtualritz - 4 months
I studied typography and I used LaTeX occasionally but also for the 150+ page master thesis in archeology, of my brother.

Which required a special type of source reference/footnote formatting that I took from some legal/law-related LaTeX package. It also required sections typeset in Sanskrit and old Greek. Different package. There were issues when using them together. That was just the most headache-inducing bit I remember as this was way more than a decade ago.

I'm also a developer, most of my life was C/C++, now Rust. But also Tcl, Python, Lua, some projects in specialized functional languages etc.

Even with this BG, using LaTeX for the aformentioned thesis, a project where no good readymade template/package that covered all requirements was available, was painful.

I worked as a typographer and designer for a decade from my late teens to my late 20's. That was mostly PageMaker and then InDesign (I circumvented QuarkXPress where I could).

Using these desktop publishing packages was also often painful. Just in ways orthogonal to the painfulness of LaTeX.

I think a typsetting system needs to hit a sweet spot where you can do almost anything you can do in a desktop publishing software and almost anything you can do in a system like LaTeX.

I think typst (see [1], currently on HN front page) is on a good trajectory to be just that. Eventually.

I don't think (La)TeX was or ever will be able to hit that sweet spot.

[1] https://news.ycombinator.com/item?id=41014941

By @vouaobrasil - 4 months
I tried Typst, which everyone seems to be saying is a replacement for LaTeX. Yes, Typst does get some stuff right and is easier to use in some cases. But LaTeX works out of the box with some basic document styles without learning much, and doesn't give you the freedom of a blank document.

In the end I gave up Typst. Didn't like it. Yes, Typst might be better for some but for writing basic documents like an article or basic math paper, Typst didn't work for me.

By @JadeNB - 4 months
Are there any other mathematicians out there? I love TeX, while freely acknowledging that it has flaws, but maybe it's just because it is the water in which mathematical writers swim, so that we learn it from such an early age and it becomes essentially inconceivable to use anything else.

The author carefully notes that the blog is not typeset in TeX, but I was disappointed that someone who cares for typography would think that the point of math mode is to shove everything in an <em> (not even <i>) tag. TeX sets what it thinks of as variables in an appropriate slanted (not exactly italic) type, but it would not (unless specifically instructed to do so) put the exponent 2 in y = x^2 in that same slanted type.

(Incidentally, the Turing completeness that the author mentions was against Knuth's original vision for the language; as the mythology around TeX goes—although I can't find a source right now—he added the relevant extra power (I'm not sure what it was) only "reluctantly." At Guy Steele's request, by the way!)

By @WillAdams - 4 months
The big thing for me is macros and programmability.

Early on in my learning graphic design I found the interactive tools of the time (Aldus PageMaker, Quark XPress) quite primitive and limiting --- at one point in order to have the control I wanted I was using Altsys Virtuoso (basically Macromedia Freehand v4, a drawing program) to lay out books --- at least it would hang punctuation.

Finding TeX on my NeXT Cube and then learning it meant that I had access to a tool which rather than being limited by what features a corporation decided to implement for a given version, was only limited by computer processing power, storage space, and my facility to write macros.

A good example of this is: https://graphicdesign.stackexchange.com/questions/31088/any-...

In addition to a lot of books and so forth, I've used TeX to:

- write the typesetting back-end for "HS" ads for an interactive phone book production system

- measure all the ads for a country's phone book, check the dimensions against their nominal size, and then either correct them (so that they would fit correctly) or note that ad in a list (so that the ad could be re-designed at the correct size)

- implement the typesetting back-end for a customizable story book where the text was selected by the user and their choices would be implemented so as to set the desired appearance of images

More importantly, for general development, when making TeX, Dr. Donald E. Knuth created Literate Programming:

http://literateprogramming.com/

which programming style has allowed me to make larger and more complex programs more easily.

By @o11c - 4 months
What TeX gets right: flexible macros. Sometimes you really do need more control than most languages offer. A combination of XML documents with custom XSLT is probably the best alternative, but XML syntax is horrible to write.

What TeX gets wrong: flexible macros. There's a very good reason we shy away from "cannot be parsed, only executed" when designing a language these days. There's also the major issue of namespacing.

It's quite reminiscent of the Curse of Lisp, except somehow worse.

By @constantcrying - 4 months
The problem with TeX is that the programming language TeX is extremely bad. It is genuinely painful to use and so while the idea of using an open ended programming language to do typesetting is great the hurdles you have to move over make it very unpleasant.

Macro expansion just is not a good programming paradigm. And often when I was facing a problem which could have been handled programmatically in TeX, e.g. generation of a table, it turned out far more complex than expected. No doubt if I didn't have hundreds of hours typesetting LaTeX, but hundreds of hours programming TeX it would have been relatively easy. But my point is that having a good language at the core would make these tasks immediately obvious to someone with significant programming experience.

By @smitty1e - 4 months
Irrespective of the truth that TeX will never be bulletproof, it is beautifully open source.

I'm grinding on the thesis in emacs, zotero, texlive, and qgis.

Not a proprietary package in sight.

And I will use proprietary software when sensible: my Open Source leanings are not religious in nature.

But the public nature of the product is huge.

By @openrisk - 4 months
TeX/LaTex have a bit of a C/C++ relation. Instead of replacing TeX one could imagine an alternative higher level abstraction.
By @notPlancha - 4 months
> Now, it’s certainly possible that one could develop a new, generative typesetting language that captures the virtues that I’ve discussed above and is free of TeX’s historical baggage.

Like typst?