In early 1977, Donald Knuth decided to write his own typesetting program, the system that became TeX, because the new edition of his book The Art of Computer Programming looked so bad he could not stand it. He expected the detour to take a year. It was 1986 before he had fonts he could be happy with.
The trouble had started with the proofs for the second edition of Volume 2. Printing, Knuth recalled in a 2007 oral history for the Computer History Museum, “was done with hot lead in the ’60s, but they switched over to using film in the ’70s.” His whole book had been retypeset with the new technology. “The new fonts looked terrible!” The subscripts were in a different style from the large letters, and the spacing was “very bad.”
“I couldn’t stand to see my books so ugly,” he said. “I spent all this time working on it, and you can’t be proud of something that looks hopeless.”
The publisher tried again, with fonts made in Poland to imitate the ones from the hot-lead days. That version, which came back “at the beginning of ’77,” was in Knuth’s words “just hopelessly bad.”
That February, while serving on Stanford’s comprehensive-exam committee, he saw the galley proofs of Patrick Winston’s new book on artificial intelligence. They had been produced at Information International, Inc. (III) with a new process that was, as Knuth put it, “all digital, all dots of ink.” Instead of photographic images and lenses, III used algorithms and bits.
“I knew it was just bits, but they looked gorgeous,” Knuth said.
Why enough dots per inch changed Knuth’s mind
Knuth grew up in Wisconsin, where, as he put it, “we never eat margarine.” He had assumed that digital typography “would have to be like margarine. It couldn’t be the real thing.” At the Stanford Artificial Intelligence Laboratory, where he worked, the Xerox Graphics Printer put down far coarser dots, and its output “didn’t look beautiful by any stretch of the imagination.” At III, which by his recollection printed about 1,000 dots per inch, “you couldn’t tell the difference.”
Knuth’s conclusion: at a high enough resolution, a printed page is a grid of dots, and a grid of dots is something a program can compute. A week later, he flew to Southern California to find out what was going on at III.
He had planned to spend his 1977–78 sabbatical in Chile, working on Volume 4. He cancelled the Chile plan and, by his account, wrote to his hosts there that he would work on typography instead. His reasoning, as he recalled it: “It’s only zeros and ones. I can get those dots on the page, and I’ve got to write this program.”
“As far as I knew, though, it was going to take me a year,” he said. The program was meant for two users: himself and his secretary, Phyllis.
TeX outgrew its two users
Knuth’s first design memo for TeX is dated May 13, 1977, and its first example is text from Volume 2. “I didn’t have two users,” Knuth said. “First I had 10, and then I had 100, and then I had 1000. Every time it went to another order of magnitude I had to change the system.” By his account, the first version, later called TeX78, had been ported to 200 different environments by 1981.
The book he built TeX for still disappointed him
The new edition of Volume 2 came out, by Knuth’s recollection, in 1981, set in fonts he had designed himself. He had, as he put it, “the best typesetting equipment,” a machine with roughly 5,000 dots per inch, and he had written a program for its 8-bit microprocessor. All of his proofs looked good on it.
Then the printed book arrived in the mail. Knuth called that day “one of the greatest disappointments in my whole life.” The book was supposed to be “the crowning moment of my life,” proof that the TeX project had succeeded.
“It doesn’t look the same as my other books,” he said. The first and second editions of Volume 2 were supposed to look alike, and all the measurements seemed to agree. “But a lot of distortion goes on, and our optic nerves aren’t linear.” Some people, he added, noticed no difference at all. The worst part was the numerals: he had not realized that page numbers are one of the things a reader’s eyes focus on most, and his 2 “was really ugly.”
“It became much more difficult to do fonts than I had expected,” Knuth said. At the AI lab he had to measure letters with a TV camera that had “a great amount of distortion”: if you turned the light up slightly, “the width of the letters on the screen would grow by 25%.” He brought in the type designer Matthew Carter for an academic quarter.
“Finally by 1986 I was ready,” Knuth said. “I had type that I could be happy with.” People in the type industry told him that was “the normal five years’ apprentice as a type designer.”
How long did TeX take? It depends where you stop the clock
Retellings disagree on the length. The Jargon File, an old hacker dictionary, says Knuth “thought he would finish it on his sabbatical in 1978; he was wrong by only about 8 years.” In the 2007 oral history, the interviewer, Ed Feigenbaum, put it at “ten years, not one year.”
Knuth’s own milestones show why. TeX82 was “the complete rewrite and incompatible break with TeX ’78.” To keep it portable, Knuth maintained master files that nobody else was allowed to touch, and each system adapted them through a separate change file. He called that work “the genesis of literate programming,” his method of writing a program and its explanation as one document.
By 1986, all five volumes of Computers & Typesetting were out: “that was to be the end,” he said. Stop the clock there, and the one-year job took roughly a decade. Then came a major revision in 1989 and 1990, “changing everything from 7-bit to 8-bit.” In 1990 he wrote that his work on TeX had “come to an end” and that he would make no further changes “except to correct extremely serious bugs.” Any corrected versions would be numbered 3.14, 3.141, 3.1415 and so on, converging to pi. The current version is 3.141592653.
Knuth estimated the program, not the craft
Knuth’s “one year” was an estimate for writing a program for himself and his secretary. The job he had actually taken on was making his book look as good as it had in the days of hot lead. That required digital type that looked right to the eye in the printed book, not just in the proofs from his typesetting machine. Knuth had thought the fonts were “just going to be a matter of making a few measurements and taking a few numbers.” They took a type designer’s apprenticeship.
When you decide to build the tool instead of tolerating its output, ask what craft the tool has to encode, and budget for learning that craft, not just for writing the code.
Related stories
Sources
- Computer History Museum, “Oral History of Donald Knuth,” interviewed by Edward Feigenbaum, 2007
- Donald E. Knuth, “Mathematical Typography,” Bulletin of the American Mathematical Society 1(2), 1979 (Josiah Willard Gibbs Lecture, January 1978)
- SAIL archive: Donald Knuth’s first TeX design memo, dated May 13, 1977
- Web of Stories, Donald Knuth: “Poor quality typesetting on the second edition of my book”
- Donald E. Knuth, “Computers and Typesetting” (Stanford): the five volumes and the current TeX version
- Donald E. Knuth, “The New Versions of TeX and METAFONT,” TUGboat 10(3), 1989
- Donald E. Knuth, “The Future of TeX and METAFONT,” TUGboat 11(4), 1990
- The Jargon File (Hacker’s Dictionary), entry “TeX”
- Featured image: Donald Knuth at the opening of the Computer History Museum’s Revolution exhibition, January 2011 (cropped). Photograph by Alex Handy, via Wikimedia Commons, CC BY-SA 2.0

Leave a Reply