3 A Brief History of Typesetting
Before there were fonts, there were hands. For most of human history, if you wanted a copy of a document, you found someone with good handwriting and sufficient patience and you waited. The result was beautiful, often — medieval illuminated manuscripts rank among the finest visual artifacts ever produced — but it was also slow, expensive, and error-prone. Every copy introduced new mistakes. Every scriptorium was a bottleneck. Knowledge moved at the speed of a quill.
What Johannes Gutenberg did in Mainz around 1450 was not, strictly speaking, invent printing. Woodblock printing had existed in China for centuries. What he invented was a system: individual metal letters, cast from an alloy of lead, tin, and antimony, that could be arranged into words, locked into frames, inked, and pressed against paper — then broken apart and rearranged for the next page. The key insight was reusability. Each letter was a small machine, manufactured once and used thousands of times.
This system gave us most of the vocabulary we still use today. The type case was a wooden tray divided into compartments, one per character. Capital letters were stored in the upper case; small letters in the lower — which is why we call them uppercase and lowercase to this day. Leading was the thin strip of lead placed between lines to create vertical spacing. The em was the width of the letter M, used as a unit of horizontal measure because M was the widest character in most typefaces; the en was half that. Points and picas were standardized units of measurement developed over the following centuries to let printers specify type sizes and column widths with precision.
These terms did not fade away when the technology changed. They migrated into every subsequent system — phototypesetting, desktop publishing, CSS, LaTeX, Pandoc — and you will encounter them throughout this book. When you write font-size: 12pt in CSS or \setlength{\parindent}{1em} in LaTeX, you are using units invented to describe the dimensions of metal objects that haven’t been manufactured for fifty years. The history is embedded in the syntax.
For four centuries, hot metal type was how the world’s text was made. The craft evolved — typefaces multiplied, presses grew more powerful, paper became cheaper — but the fundamental process stayed the same: a compositor stood at a type case and assembled text by hand, one letter at a time. A skilled compositor could set perhaps 1,500 characters per hour. A single page of a novel might contain 3,000. It was exacting, physical work.
The Linotype machine, patented by Ottmar Mergenthaler in 1886, changed the speed of composition without changing its material nature. The operator sat at a keyboard — the first time in the history of printing that you typed to produce type — and the machine cast entire lines of text in a single slug of hot metal. Hence the name: line-o’-type. A Linotype operator could set five or six times faster than a hand compositor. Newspapers, which needed to produce thousands of words of fresh text every night, adopted it immediately. The Linotype hum became the sound of the press room.
What is worth holding onto from this era — worth holding onto for the whole book — is the attitude it engendered toward the text on the page. A printer who had physically assembled each line of a paragraph, who had chosen each piece of metal and placed it by hand, who had locked the forme and pulled the proof and corrected it and reprinted it, had a relationship with the text that was intimate and exacting. Every decision about spacing, every choice of typeface, every adjustment of leading was a deliberate act performed by a person who understood its consequences. The tools made thoughtlessness expensive.
3.1 Phototypesetting and the desktop revolution
The first phototypesetting machines appeared in the 1940s and became widespread through the 1950s and 60s. The principle was simple: instead of casting metal, you projected light through a negative of each character onto photosensitive paper. The paper was then used to make printing plates. Metal, with its weight and heat and physical constraints, was gone.
This mattered for typography because it removed the physical limits that had governed type for five centuries. In metal, you could not easily overlap characters, because they were solid objects. In photo, you could. In metal, scaling a typeface required cutting new punches at every size. In photo, you turned a dial. The new freedom was real, but it was also dangerous: the optical corrections that type designers had built into metal fonts at each size — the way a 6-point typeface is subtly different in proportion from its 72-point version, adjusted for how the eye reads at different scales — were now routinely ignored. Designers scaled a single master up and down indiscriminately. The results were technically acceptable and often visually inferior.
The real rupture came in 1984 and 1985 in rapid succession. Apple released the Macintosh in January 1984. Adobe published the PostScript page description language in 1985. Apple released the LaserWriter printer, which contained a PostScript interpreter, also in 1985. Aldus released PageMaker, the first desktop publishing application, the same year.
PostScript was the pivot. It was a programming language whose output was a printed page — a way of describing, in mathematical terms, exactly where every shape and character on a page should appear. It meant that a computer could, for the first time, describe a page with the same precision as a professional typesetting system. The LaserWriter made that description physical. PageMaker gave ordinary users a graphical interface to drive it. And the Macintosh — with its then-revolutionary graphical interface and screen fonts that actually resembled what would print — put the whole system on a desktop that anyone could buy.
The desktop publishing revolution democratized access to type and layout. It also, immediately and catastrophically, democratized bad typography. Suddenly anyone with a Macintosh and a copy of PageMaker could produce a newsletter, a flyer, a business card, a book. Most of them could not. The result was a decade of documents set in too many typefaces, at inconsistent sizes, with arbitrary spacing and no underlying grid, printed on laser printers and photocopied until the halftones fell apart. The tools arrived before the education. In some circles, this period is still spoken of with a shudder.
This is not a trivial point. It is the central problem this book exists to address. Access to powerful tools for arranging text on a page does not automatically produce good typography. It never has. The Linotype operator who set six lines a minute still needed to know about rivers, rags, widows, and the correct way to space small capitals. The PageMaker user who discovered they could apply seventeen fonts to a single paragraph needed — badly — to know why they shouldn’t. The CLI typographer who can generate a PDF from Markdown in a single command needs to know enough about typography to make that PDF worth reading.
Tools are not enough. They are never enough. That is the lesson of 1985.
3.2 Knuth, TeX, and why it matters
In the 1970s, Donald Knuth was a computer scientist at Stanford working on a multi-volume work called The Art of Computer Programming, a monumental reference on algorithms that he had begun in 1962 and was still — decades later, volumes still incomplete — working on. In 1976, he received the galley proofs for the second edition of Volume 2. They had been set using the new phototypesetting systems that had displaced hot metal. He was appalled.
The mathematical notation — the core of the work, the thing that made it valuable — looked wrong. The spacing was inconsistent. The symbols were poorly positioned. The overall appearance was, by his judgment, substantially worse than the first edition, which had been set in hot metal. He sent the proofs back.
Then he did something that very few people, confronted with a tool that does not work to their satisfaction, actually do: he built a better one.
Knuth spent from 1977 to 1989 developing TeX (pronounced tech, from the Greek τεχνή — art, craft, skill). It was not a minor project undertaken on the side. He took a sabbatical from Stanford. He developed not just the typesetting system but a companion system called METAFONT for designing the letterforms themselves, and a family of typefaces called Computer Modern to go with it. He wrote three books documenting the work. The total effort was, by any measure, extraordinary — a decade of one of the finest computer scientists alive, dedicated to the problem of how mathematical text should look on a page.
What Knuth built was different from everything that had come before in a way that repays careful attention.
Previous typesetting systems — and most subsequent ones — set type greedily: they filled a line with as many words as would fit, then moved to the next line. TeX does not do this. TeX’s line-breaking algorithm looks at the entire paragraph at once. It considers all the possible ways the paragraph could be broken into lines, assigns each a numerical “badness” score based on how stretched or compressed the word spacing would need to be, and finds the combination that minimizes total badness across all lines. A line that looks acceptable in isolation might be rejected because it forces a worse outcome two lines later.
This is a fundamentally different philosophy. It is the difference between local optimization — make each decision look reasonable in context — and global optimization — find the arrangement that produces the best result for the whole. It is why paragraphs set in TeX look different from paragraphs set in Word. Not always dramatically different, but consistently, cumulatively different in a way that the eye registers as quality without necessarily being able to name it.
TeX is also, famously, stable. Its version numbers converge to π: 3, 3.1, 3.14, 3.141, and so on. Knuth has specified that on his death, the version number should be set to π exactly and the program frozen forever. No new features, no updates, no security patches. The rationale is that TeX is used to typeset scientific and mathematical literature that must remain reproducible over centuries, and that instability in the typesetting system would be a disservice to that literature. A document set in TeX in 1985 should produce identical output in 2085. This is an unusual position in software, where obsolescence is the default assumption, and it reflects a set of values — about permanence, about craft, about the responsibilities of toolmakers — that are worth sitting with.
In 1985, Leslie Lamport released LaTeX, a collection of macros built on top of TeX that made it dramatically more accessible to ordinary authors. Where TeX required you to understand its underlying mechanisms, LaTeX gave you higher-level commands: \section{} instead of formatting instructions, \begin{itemize} instead of manual list construction. LaTeX separated the concerns of content and presentation in a way that anticipated what CSS would later do for HTML. You wrote a document and specified its structure; a document class handled the appearance.
LaTeX became, and remains, the standard for scientific and mathematical publishing. If you submit a paper to a physics journal, an economics journal, or a computer science conference, you will almost certainly be submitting a LaTeX document. The major publishers — Springer, Elsevier, the ACM, the IEEE — maintain LaTeX document classes for their house styles. The majority of mathematical notation you read in academic papers was set by TeX.
It is also, by modern standards, difficult to use. The syntax is verbose. Error messages are opaque. Debugging a complex LaTeX document can require significant expertise. The learning curve is steep. These are real costs, and the book you are reading will not pretend otherwise. But understanding why TeX works the way it does — understanding the philosophy that Knuth built into it — will make you a better typographer regardless of which tool you ultimately use most. The questions TeX asks about text are the right questions.
3.3 The web and the fracturing of print
Tim Berners-Lee wrote the original proposal for the World Wide Web at CERN in 1989. The context matters: CERN was a large international physics laboratory, full of researchers who needed to share technical documents across different computers running different operating systems. The need was for something that worked everywhere, that required no special software beyond a basic browser, and that could be read on screen without regard for how it might look printed. Precise typographic control was not on the requirements list.
HTML — Hypertext Markup Language — reflected these priorities. Its markup described the structure and meaning of a document (<h1> means “this is a first-level heading”; <p> means “this is a paragraph”) but said almost nothing about its appearance. What a heading looked like was up to the browser. What font a paragraph used was up to the browser. This was a feature, not a bug: it meant a document could be read on a text-only terminal, a graphical workstation, a phone, a screen reader for the visually impaired.
Early web typography was, by any classical standard, terrible. Documents were set in whatever fonts the user had installed — in practice, Times New Roman, Arial, and Courier on Windows; Times, Helvetica, and Courier on the Mac. There was no control over leading, no optical margin alignment, no microtypographic adjustment of any kind. The line-breaking was greedy in the crudest sense. Pages looked like typewriter output, formatted loosely.
Cascading Style Sheets, introduced in 1996 and gradually implemented (unevenly, incompletely, contentiously) over the following decade, began to restore typographic control to web documents. By the mid-2000s it was possible to set reasonable type on the web: to specify font sizes in relative units, to control line-height, to use font-variant for small capitals. Web fonts, via @font-face, became widely supported around 2009, which meant designers were no longer confined to system fonts. Google Fonts, launched in 2010, put hundreds of quality typefaces in the hands of any web developer at no cost.
By the 2010s, web typography had matured into a genuine discipline with its own literature, its own tooling, and its own aesthetics. But it had done so while preserving HTML’s foundational assumption: text reflows. Make the browser window narrower and the lines get shorter. Increase the user’s default font size and the whole layout shifts. The document does not have a fixed canvas. The designer proposes; the browser disposes.
This is the fundamental tension that runs through everything in this book. Print typography — the tradition that runs from Gutenberg through hot metal through TeX — assumes a fixed canvas. You know the page size. You know the margins. You know exactly how wide the text column is and exactly how many characters will fit on a line. Every typographic decision is made with full knowledge of the physical constraints.
Web typography assumes a variable canvas. The text column might be 400 pixels wide or 1200 pixels wide. The user might have changed the default font size. The device might not even have a screen in the usual sense. Typographic decisions must be robust to a range of conditions you cannot fully control or predict.
When you generate a PDF from Markdown using Pandoc and a LaTeX backend, you are working in the print tradition: fixed canvas, precise control, every detail in your hands. When you generate HTML from the same Markdown file, you are working in the web tradition: reflow, approximation, deference to the reader’s environment. Both are legitimate. They are not the same.
The proliferation of formats that defines the current landscape — HTML, PDF, EPUB, DOCX, man pages, slides — is a direct consequence of this fracture. Each format embodies a set of assumptions about where and how the text will be read. EPUB is HTML that pretends, imperfectly, to be a book. DOCX is a format that tries to preserve some print-style layout while remaining editable. PDF is PostScript’s descendant: a fixed-canvas, device-independent representation of a page, designed to look identical everywhere it is opened. Each has its place. None is universally best.
The CLI tools you will learn in this book — Pandoc, LaTeX, Typst, Quarto, and others — are largely tools for navigating this landscape: for taking a single source document and producing appropriate output for different contexts. The authoring format (usually Markdown) is neutral. The output formats embody specific assumptions. Your job, as a CLI typographer, is to understand those assumptions well enough to make the right choices and to apply enough typographic knowledge to each output to make the result worth reading.
That knowledge begins with the history. The units come from metal type. The concept of a document class comes from Knuth. The separation of content and presentation comes from both Lamport and Berners-Lee. The tension between fixed and reflow canvases comes from the collision of five centuries of print with three decades of the web. None of it is arbitrary. All of it is knowable.
That is what this book is for.