Chapter 1. The Big Picture
What Is TeX?
TeX is a typesetting system. It is a collection of programs, files, and procedures for producing professional quality documents with minimum effort.
TeX's job is to translate the text you type into a beautiful typeset page. The key word here is “beautiful,” and it is a very lofty goal.[1] What I mean by beautiful is that TeX, when presented with several paragraphs of plain text and left to its own devices, produces a remarkably aesthetic page. Despite the fact that TeX may have to contend with multiple fonts and mathematics, it still manages to typeset pages in which each of the following aesthetic principles hold simultaneously:
- The right margin is justified.
- Proper justification is achieved without letterspacing.
- Interword spacing is neither too tight nor too loose.
- The page is evenly gray.
- The baselines of multiple fonts are properly aligned.
- Hyphenation is automatic, if required, and usually correct.
- Ladders are avoided.
TeX processes documents a paragraph at a time, rather than a line at a time like most other programs. Internally, TeX computes a value called badness for each line of the paragraph. Anything that detracts from the appearance of a line (tight or loose spacing, a hyphen, etc.) increases the badness associated with that line. Every paragraph that TeX produces is optimal in terms of the total amount of badness present. Because TeX searches for an optimal solution, changing the last word of a paragraph can affect the spacing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access