# Can TeX files from 1978 still be compiled today?

I recently happened to be looking at the history of TeX and notice that Knuth originally released it in 1978 (according to Wikipedia).

Are there TeX files around from this time? Can they still be compiled with current builds of TeX?

I stumbled across this, which has TeX files dating from 1978, but they don't all seem self contained and have some odd symbols in them (↑, ←) as well as some kind of file header.

• the symbols are not a problem plain tex still has some odd default mathcode assignments from the keyboard he was using in that era, but tex82 isn't really the same language as tex7[89]. DEK is at TUG2019 at the moment, perhaps someone could ask him if he has any old files to try:-), writing a convertor to tex82 probably can't be that hard.... – David Carlisle Aug 11 '19 at 9:52
• @naphaneal no it is a completely different language, it has some similarities in design and of course written by the same author, but it's like comparing basic and fortran or c# and java, or ... there are some similarities and some fragments would be legal in both languages but basically it's a different language. Of course one can write parsers for all kinds of things in tex82 (I wrote an xml parser at one time), so it might be possible to write a tex79 parser but tex itself wouldn't help much with that. – David Carlisle Aug 11 '19 at 10:14
• @DavidCarlisle You are about 4h late. DEK only attended on Saturday. – Henri Menke Aug 11 '19 at 16:44
• Believe @DavidCarlisle. TeX78 had (in a number of details) both different vocabulary and syntax. It was written in SAIL, never in Pascal, and I don't know of any extant SAiL compilers or emulators. It might be possible to redefine some macros, but if I remember correctly, the syntax for \hbox is different, and that's a pretty important primitive. I have a copy of the original manual, and when I can dig it up, I can check that, but it'll take a while. – barbara beeton Aug 12 '19 at 4:40
• @barbarabeeton, The page offers it as a PDF too: stacks.stanford.edu/file/jy605yq4819/jy605yq4819.pdf – David Purton Aug 12 '19 at 5:35

The SAILDART archive cited in the question does indeed contain files from the days of TeX78. A TeX78 job, like a current one, can be "modular", that is, it can be composed of multiple input files instead of just a single file; that is likely the reason that some of the files you looked at are not self-contained.

Both the "vocabulary" and syntax of TeX78 differ from that of the current program. The original manual for TeX78 was published as a Stanford Computer Science report; a scanned pdf file can be found here (thanks to David Purton for finding it). Some early changes that moved in the direction of TeX82 are included in the scan (file "ERRATA.TEX; see physical page 117 of the scanned file); these changes were incorporated in the program and the original "public" manual published by the American Mathematical Society.

Here are some of the significant differences.

The original program was written in SAIL; the keyboard for the SAIL computer had different non-alphameric characters than were on the standard U.S. "qwerty" keyboard. In particular, there were arrows pointing up and down (assigned to do the same things now done by the ^ and _ keys). There was no &; instead, there was a circled times (called familiarly "splat") that was used as a table column divider. (There may be more.)

As for command names, the first character was required to be a letter, but after that, any other character was permitted (TeX82 allows only letters). The initial letter could be either upper- or lowercase, but after that, the case was not distinguished; thus, \TeX = \TEx = \Tex = \TEX, although consistency was recommended.

Some basic control sequence names were different: \chcode instead of \catcode; \hjust instead of \hbox (although that was changed before the AMS manual was released), and the syntax was different from that of TeX82 -- \hbox to <dimen>.

Font access was defined by \:x, where "x" represents any letter; since the length was uniform, no space was required between the font directive and the text, so \:bbold would be treated the same as \:b bold.

No list of primitives is given in the manual, but primitives can be inferred from the definitions shown in appendix B ("basic.tex", which corresponds to "plain.tex" of TeX82). These are also not referred to as "primitives", so it's not productive to search for "primitive" in the file.

It might be possible to define a parsing mechanism to recognize and process the old syntax, but it wouldn't be easy; it would likely be easier to edit in the necessary changes if a document really needs to be reconstructed.

• Thank you for following up on my request to write an answer :) – Henri Menke Aug 16 '19 at 0:29