From Wikipedia:

TeX, ..., is a typesetting system (or a "formatting system") which was designed and mostly written by Donald Knuth and released in 1978.

Since TeX is also a Turing-Complete programming language as well, I'm curious if there is any original paper, proposal, language specification (syntax, sematics, primitives), etc. that described TeX.

For instance, in case of Python, I can find the original reference publication here; for C, I can read K&R- The C Programming Language. However, as a noob, I can't seem to find anything similar for TeX.


Since TeX is also a Turing-Complete programming language as well, …

Note that while indeed TeX macros turn out to be Turing complete, TeX was not initially designed as a programming language; this is more an instance of “accidentally Turing-complete” — it became so despite Knuth's original intention not to make it a programming language. I've written in other answers about this, so won't elaborate here.

…language specification (syntax, semantics, primitives), etc. that described TeX.

The “official” specification of TeX's syntax, semantics, primitives, etc., is the book called The TeXbook (the “definitive user manual and reference manual for TeX”), which is also available in hardcover as Volume A of Computers and Typesetting. You may also be able to find it in a library (including online at the Internet Archive's library, where usually there's a waiting list—only one person in the world can borrow the book at a time—but this is temporarily lifted).

But if your question is primarily historical:

  • Before there was The TeXbook, which documents the current TeX (written in WEB, also known as TeX82 to distinguish it from TeX78 which was written in the SAIL language), there was a manual for TeX78. It is very similar in contents to The TeXbook, and you can find it in, for instance, the book TeX and METAFONT: New Directions in Typesetting, along with the METAFONT manual and the article Mathematical Typography.

  • If you want to go back even further in history and just want the truly first TeX “proposal” or specification, then you're in luck! In May 1977, before a single line of code had been written, Knuth typed up a document called “Preliminary preliminary description of TEX”, and saved it as a file named TEXDR.AFT. In July he revised it to “Preliminary description of TEX” as the file TEX.ONE. Both of these have been published in the book Digital Typography, and are also available online at the SAILDART historical archive. Note that the first of these doesn't even have backlashes for control sequences (for example), and even the second of these is really preliminary: Knuth's intention was that a couple of his graduate students would code up TeX from this specification while he was away for the summer, but it turns out that the specification was really incomplete (but they got a prototype capable of printing a simple page anyway), so when he came back he spent the next several months writing the program, which became later known as TeX78 and is the one documented in the manual mentioned above.

  • There is also a scanned PDF of TEXDR.AFT somewhere online. Barbara posted a link on this site but I can't find it right now. – Henri Menke May 3 '20 at 9:48
  • @HenriMenke Possibly you're remembering this? An issue with the online SAILDART version is that it doesn't indicate page breaks (the editor used divided text into “pages”, not just lines of characters), but otherwise I guess not much is lost. – ShreevatsaR May 3 '20 at 9:52
  • @ShreevatsaR -- The scanned document referenced in the answer you listed doesn't include TEXDR.AFT, but it does include a very detailed list of differences between TeX78 and TeX82. Worth reading. Find it here: tug.org/TUGboat/tb04-2/texmferr-09sep1983.pdf – barbara beeton May 3 '20 at 16:32
  • @ShreevatsaR -- In trying to find a pdf rendition of TEXDR.AFT, I came across your answer here to the question "Has the semantics of TeX (as a programming language) ever been formalized?" Very good analysis! I can, by the way, confirm that Michael Spivak did not have previous programming experience before he undertook coding AMS-TeX. (I was a member of the same group sent to Stanford in 1979 to learn TeX; we lived together in a rented house on the Stanford campus for the duration.) – barbara beeton May 3 '20 at 17:11
  • @barbarabeeton Thanks! Come to think of it, maybe I learned that fact in the first place from something you had written somewhere :) – ShreevatsaR May 3 '20 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.