LaTeX vocabulary is confusing not because the words are hard, but because they wear everyday faces over different meanings. A “package” is not an npm package, a “class” is not an object-oriented class, and “glue” is not adhesive. Better still, the leading characters in this glossary — engine and format, class and package, box and glue and kern — can all be checked on your own machine. On TeX Live 2024, pdflatex turns out to be nothing but a symbolic link to pdftex, and latex points at that same pdftex. This glossary explains each term starting from the place newcomers reliably get it wrong.
Engine vs format: why pdflatex is pdftex
An engine is the program that actually runs; a format is a lump of macros pre-loaded into that program. This is not an abstraction — you can see it in the filesystem. In the bin directory of TeX Live 2024, pdflatex is a symbolic link to pdftex, and latex points at that same pdftex. Likewise xelatex → xetex, lualatex → luahbtex, and both platex and uplatex are euptex. Six “LaTeX commands”, in other words, are really only four binaries. What then separates latex from pdflatex? Only the .fmt file each loads at startup — a pre-digested dump of macros. latex.fmt is 8,221,690 bytes and pdflatex.fmt is 8,221,444: two nearly identical objects 246 bytes apart.
# TeX Live 2024: six commands, four binaries
$ ls -l latex pdflatex xelatex lualatex platex uplatex
latex -> pdftex
pdflatex -> pdftex
xelatex -> xetex
lualatex -> luahbtex
platex -> euptex
uplatex -> euptex| Term | What it means, and what gets confused |
|---|---|
engine | The program that runs (tex, pdftex, xetex, luatex, euptex). Output format, font technology and character handling are decided here |
format | A pre-loaded body of macros (plain TeX, LaTeX, ConTeXt), frozen into a .fmt file |
.fmt | The format dump, stored under texmf-var/web2c/<engine>/ and built by fmtutil |
pdfLaTeX | The combination of engine pdftex with the LaTeX format. There is no program called pdfLaTeX |
LaTeX2e | The current LaTeX, in place since 1994. Plain “LaTeX” normally means this |
LaTeX3 | The long-running project to rewrite the kernel. It already ships inside current LaTeX as expl3, and many packages use it |
Class vs package: the difference between .cls and .sty
A class decides what the document is; a package adds capability to it — and one document takes exactly one class but any number of packages. That is the whole difference. Technically both are text files full of macro definitions, and there is no intrinsic distinction between what lives in a .cls and what lives in a .sty. The only thing that separates them is how they are loaded, and the syntax states the rule outright: \documentclass{article} once, \usepackage{...} as often as you like. So when you cannot decide whether “two columns” is a class matter (\documentclass[twocolumn]) or a package matter (multicol), ask whether the kind of document changes or a capability is merely added. Related: a .dtx is a package’s manuscript (source and documentation interleaved) and a .ins is the recipe that extracts the .sty from it.
| Extension | What it holds, and when it appears |
|---|---|
.tex | The manuscript you write. This is the one file that belongs in version control |
.cls | A class, loaded exactly once by \documentclass |
.sty | A package, loaded any number of times by \usepackage |
.dtx / .ins | A package author’s manuscript, and the recipe that generates the .sty from it |
.aux | Notes on cross-references, contents and citations. This is why you compile twice |
.log | The full record of the run. Warnings such as Missing character sometimes appear nowhere else |
.bib / .bbl | The bibliography database, and the formatted list built from it |
Macro, token, catcode: the order in which TeX reads characters
TeX does not read characters as characters. It stamps each one with a “category code” (catcode), a role number from 0 to 15, and works with that. \ is 0 (start of a command), { is 1, } is 2, $ is 3, & is 4, # is 6, ^ is 7, _ is 8, a space is 10, letters are 11, digits and most symbols are 12 (“other”), ~ is 13 (active) and % is 14 (comment). A character plus its catcode is a token, the smallest unit TeX handles, and a macro is nothing more than a name attached to a list of tokens. One place this bites: in the body of a document the catcode of @ is 12, an ordinary symbol that cannot form part of a command name. Internal commands like \@ifnextchar are therefore unreachable from the body, and \makeatletter exists to flip @ to 11 for a while. Inside a package (.sty) it is 11 already, which is why the incantation is not needed there.
% Ask TeX for the catcode of a character; the answer lands in the log.
\showthe\catcode`\@ % > 12. (in the document body: "other")
\showthe\catcode`\A % > 11. (letter)
\showthe\catcode`\~ % > 13. (active)
\makeatletter
\showthe\catcode`\@ % > 11. (now a letter, so \@ifnextchar works)
\makeatother| Term | What it means, and what gets confused |
|---|---|
token | A character together with its catcode: TeX’s smallest unit. Same glyph, different catcode, different token |
catcode | A role number from 0 to 15, rewritable with \catcode; verbatim uses exactly this to disarm commands |
macro | A name for a token list, defined with \newcommand. It is substitution, not a function call: arguments are pasted in unevaluated |
expansion | Replacing a macro by its body. This is why an error is reported at the line where it expanded, not where it was defined |
robust / fragile | Robust commands survive places where content is written out and re-read (moving arguments: headings, footnotes); fragile ones break. Modern LaTeX has made most of them robust |
Box, glue, kern: the three parts typesetting is made of
To TeX a finished page is not made of characters or paragraphs but of exactly three things: boxes, and the glue and kerns that fill the space between them. A character is a small box with a width, a height and a depth; a line is a box holding boxes side by side (\hbox); a page is a box stacking lines vertically (\vbox). What goes between boxes is glue — space that can stretch and shrink. It is not a width but a triple of natural width, stretch and shrink: in 10pt Computer Modern the interword space is 3.33333pt natural, with 1.66666pt of stretch and 1.11111pt of shrink. That elasticity is what makes justification possible, and what lets TeX score how tight or loose a line is (its “badness”). A kern, by contrast, is a rigid gap that cannot stretch — and cannot be a line break either. So \hbox to 60pt{a\kern 10pt b} cannot fill its width and reports Underfull \hbox (badness 10000), while the same box with stretchable glue settles in silently.
| Term | What it means, and what gets confused |
|---|---|
box | A rectangle with width, height and depth. \hbox sets side by side, \vbox stacks. Keeping depth (below the baseline) separate is a TeX signature |
glue | Stretchable, shrinkable space: a triple of natural width, stretch and shrink. It also marks a legal place to break a line or a page |
kern | A fixed-width gap: it neither stretches nor offers a break point. Used for letter fitting, such as the negative kerns inside \TeX |
badness | A measure of how hard the glue had to be stretched or squeezed, from 0 to 10000 (worst). It is the number in Underfull \hbox (badness 10000) |
sp | The scaled point, TeX’s internal atom: 1pt = 65536sp. Every length is held as one of these integers, so rounding errors never accumulate |
What DVI is: why “device-independent” carries no fonts
DVI (device-independent) is the output TeX was designed to produce: a list of instructions saying which character, in which font, goes at which coordinate — and nothing about the shapes of the letters. Measure the difference and it is dramatic. Typeset the same one-line document on TeX Live 2024 and the DVI from latex is 300 bytes while the PDF from pdflatex is 17,081 — more than fifty-seven times larger. Look inside the DVI and you find fntdef1 27: cmr10: the font is referred to by name only. Run pdffonts on the PDF and CMR10 comes back as emb yes sub yes — outlines embedded, and subset down to the characters actually used. That is why a DVI cannot be viewed reliably on its own; it becomes something you can distribute only after dvipdfmx or dvips resolves the fonts. That same lightness, and the freedom it leaves the later stage, is why the Japanese upLaTeX → dvipdfmx route is still in daily use.
| Term | What it means, and what gets confused |
|---|---|
DVI | Device-independent: an intermediate format that only names its fonts. Viewing or distributing it requires a converter |
PDF | The final form for distribution and print: fonts embedded, plus bookmarks, links and metadata |
PostScript | A page-description language, produced from DVI by dvips and still used for print submission |
pt / bp | TeX’s pt is the printer’s point: 1in = 72.26999pt. The PDF and PostScript point is bp (big point), 1bp = 1.00374pt. It is bp, not pt, that runs 72 to the inch |
MWE | Minimal working example: the smallest document that still reproduces the problem. The first thing you will be asked for |
CTAN, TDS, texmf, kpathsea: where the files actually live
CTAN is the world’s warehouse, TDS is how it is shelved, texmf is your local copy, and kpathsea is what finds things in it — the four are links in one chain. Packages gathered on CTAN (the Comprehensive TeX Archive Network) are unpacked into a texmf tree according to a shared layout rule called TDS (TeX Directory Structure): a .sty goes to tex/latex/<package>/, its documentation to doc/latex/<package>/. Because that rule holds, files sit in the same place in every distribution. But texmf-dist in TeX Live 2024 holds 276,953 files, and walking directories on every run is out of the question. So kpathsea reads an index called ls-R first. When you have installed a package by hand and LaTeX still cannot see it, that index is usually just stale — rebuild it with mktexlsr. To find out which file is actually being used, kpsewhich article.cls answers in one line.
| Term | What it means, and what gets confused |
|---|---|
CTAN | The central package archive (ctan.org), mirrored around the world |
TDS | TeX Directory Structure: the convention that fixes the layout inside texmf. Follow it when placing files by hand |
texmf | The tree holding the actual files. There are several, and texmf-local takes precedence over texmf-dist |
kpathsea / ls-R | The file-search library and its index. Query it with kpsewhich; rebuild the index with mktexlsr |
TeX Live / MiKTeX | The two main distributions. TeX Live ships a full annual release; MiKTeX is known for fetching missing packages on the fly |
tlmgr | TeX Live’s package manager, used to update individual packages or install extra ones |
Japanese typesetting terms: JFM, wabun and obun, kinsoku
Japanese TeX carries a vocabulary you never meet while setting only Western text. At its centre is a design decision: Japanese and Western text are handled as two entirely separate streams. Engines of the pTeX family set kanji and kana in a wabun (Japanese) font and Latin letters in an obun (Western) font, and automatically insert a quarter-em space (\xkanjiskip) at the boundary between them. The metrics of a Japanese font are described by a JFM (Japanese Font Metric), which records not only character widths but how much to close up when two punctuation marks meet. The rules that forbid a closing comma at the start of a line or an opening bracket at its end are kinsoku (line-breaking prohibition), expressed in TeX as penalty values. Ruby (phonetic gloss above the base text) and vertical writing are further Japanese-specific demands, both handled by the class or a package. How to choose between these tools in practice belongs to the Japanese typesetting pages.
| Term | What it means, and what gets confused |
|---|---|
JFM | Japanese Font Metric: the dimension file for a Japanese font, covering character widths and the rules for closing up punctuation |
pTeX / upTeX | TeX engines extended for Japanese typesetting; upTeX is the successor with a Unicode-based internal representation |
kinsoku | Line-breaking prohibition: the rules about which characters may not open or close a line, expressed in TeX as penalties |
\xkanjiskip | The space inserted automatically where Japanese meets Western text; roughly a quarter em by default, and adjustable |
ruby | A phonetic gloss set small above the base text (to its right in vertical writing), provided by a class or package |