The longevity of plain TeX

Microsoft Word was first released for MS DOS in Octo­ber, 1983. Some five months ear­li­er, Don­ald Knuth, a pro­fes­sor of com­put­ing at Stan­ford Uni­ver­si­ty, pub­lished “The TeX Book.” This was a jokey man­u­al for, and a deft demon­stra­tion of, his TeX pub­lish­ing pro­gram whose sta­ble ver­sion first appeared in 1982.

Each of these con­tem­po­rary works was an inno­va­tion in the use of com­put­ers to process and print text. But they could not be more dif­fer­ent.

MS Word is a com­plex word proces­sor. It is now up to its 16th ver­sion: utter­ly incom­pat­i­ble with the 1983 ver­sion. Only a muse­um could find the hard­ware (5 1/4 inch flop­py-discs; MS DOS; an 8086 sys­tem) nec­es­sary to run MS Office 1.

TeX is a sim­ple markup for fine pub­lish­ing. As of March 2014, Tex is up to ver­sion 11 or there­abouts (Knuth uses pi as a num­ber­ing scheme; TeX is offi­cial­ly up to ver­sion 3.14159265 ). Yet TeX (2014) is almost iden­ti­cal with TeX (1982). Every­thing writ­ten in TeX in 1983 still pub­lish­es as beau­ti­ful­ly as it did more than 30 years ago. The pro­grams that were includ­ed in the TeX book in 1983 still com­pile (see below). In fact, they work still bet­ter in 2014 because com­put­ers — almost any will run TeX — are much speed­i­er. Also, over the past 31 years, errors found in the code by bug ‘boun­ty-hunters’ have been removed. Knuth admit­ted to one bug in his most recent ver­sion (an omit­ted space in the code). He has issued his last (?) reward cheque ($327.68) to the bug reporter and spec­u­lates no oth­er bugs remain.

How many pro­grams can promise this? That in 30 years time, they will still work just as they used. That the doc­u­ments you cre­at­ed when you still had great hair/wore hot pants to college/watched “Cheers” every week on TV will be just as easy to change or print as they were then, and will look iden­ti­cal? Very few.

TeX is only text markup, like HTML, on its sur­face. But, at heart, it is a pro­gram­ming lan­guage. Knuth cre­at­ed it to pub­lish, beau­ti­ful­ly, his real work: the mon­u­men­tal The Art of Com­put­er Pro­gram­ming. It thus became the foun­da­tion for a heap of oth­er pro­grams (‘macros’ of TeX, in real­i­ty). LaTeX, Con­TeX, XeTeX… and ‘one of these days’ LaTeX3. But Knuth has rig­or­ous­ly refused to allow fur­ther devel­op­ment of his code.

I have for­mer­ly dab­bled only in the (deriv­a­tive) waters of these TeX descen­dents (LaTeX etc). They are ‘high­er lev­el abstrac­tions’ that offer great pow­er for rel­a­tive­ly lit­tle effort. But each of the many doc­u­ments writ­ten in these envi­ron­ments is vul­ner­a­ble to the improve­ments that the macro authors (or the LaTeX main­tain­ers) intro­duce. The main LaTeX ‘dis­tri­b­u­tions’ — giga­byte bun­dles of macros built on LaTeX and the like — change every year or so. Doc­u­ments only two and three years old may break. Recent­ly, one of mine, that I want­ed to update, did. It cost me a cou­ple of hours of fid­dling to find the prob­lem (a con­flict of two import­ed macros) and to fix it before I could apply my own text changes.

When I saw that Knuth had pub­lished his 2013 one-change ‘update’ (the next review of report­ed ‘bugs’ is sched­uled for 2021) I real­ized that I should have con­sid­ered the reli­a­bil­i­ty of plain TeX more care­ful­ly. I did not because… well, its like writ­ing code in Assem­bler. Pow­er­ful, but tedious and unsafe. It requires a craftsman’s expe­ri­ence (and tool-kit) to do it well.

But sim­ple things can be made sim­ply in TeX. As the TeX Book says, right at the start, you don’t need to know much to com­pose a page of prose, nice­ly laid out, with page num­bers and foot­notes. HTML has much more com­plex­i­ty than TeX at this lev­el.

So here, just for fun, is the first doc­u­ment I have ever com­piled in (plain) TeX. It’s a let­ter tak­en from Appen­dix E of the Tex Book. It’s source is two short files (cut-and-past­ed from the book). One con­tains the let­ter itself and one con­tains the page for­mat­ting instruc­tions.

Plain Tex Let­ter

No Comments

Leave a Reply

Your email is never shared.Required fields are marked *