Control Sequences

or commands, are what you use to make TeX do what you want it to do. Here is a list of the 960 or so control sequences of primitive and Plain TeX which I found on the Internet: csname.tex, csname.pdf. (Original file here.)

For those who aren’t interested in typesetting mathematics I made a shorter version with the math-related commands taken out: csname-text.tex, csname-text.pdf. ‘csname-math’ contains all the missing math commands: csname-math.tex, csname-math.pdf.

The file ‘keywords’ contains some other things worth knowing about: special characters, keywords, dimensions, catcodes: keywords.tex, keywords.pdf.

If you look at ‘csname’ you will see that about a third of the control sequences are primitives, i.e. they are built into the TeX program. The remainder are defined in the file plain.tex (see here , or search your TeX installation).

plain.tex:
1. sets up code tables: \catcodes, \mathcodes, \sfcodes, \delcodes
2. allocates registers: \count, \dimen, \skip, \muskip, \box, \toks, input streams, output streams, math families, languages, insertions
3. sets parameters (e.g. \tolerance, \hbadness, \parindent, \parskip, etc.)
4. loads information about fonts
5. then come text macros, e.g. \frenchspacing, \normalbaselines, \enspace, \break, \centerline, tabbing macros
6. macros for math
7. macros for output e.g. \folio, \raggedbottom, \footnote, \topinsert, \midinsert, \pageinsert
8. hyphenation and everything else.

This list is from Appendix B of the TeXbook, which begins with a table showing commonly used Plain TeX control sequences with an example of their use, followed by a description of the macros contained in plain.tex.

Some macros are used as auxiliary macros in the construction of other macros, e.g. \textindent which is used in \item, \itemitem and \vfootnote. Or \joinrel, which is used to join math symbols together to make new ones, e.g. \bowtie is constructed like this:
\def\bowtie{\mathrel\triangleright\joinrel\mathrel\triangleleft}.

The private macros (those with ‘@’ in them) are also auxiliary macros used by plain.tex e.g. \f@@t, \f@t and \@foot are used in building the \footnote macro, \m@g is used in the \magnification macro. The idea of having ‘@’ in the control sequences is so that they will not be accidentally overwritten by user-defined macros.

David Bausum’s webpage () lists and gives definitions of all the TeX primitives. The appendix of ‘TeX by Topic’ also has a list of the primitives. ‘TeX for the Impatient’ has a ‘Capsule summary of commands’ which gives short definitions of the primitives and Plain TeX commands. If you read German ‘Einführung in TeX’ has a very full glossary of Plain and primitive TeX commands and the private macros too. (See below for links to these books.)

Resources and materials for learning TeX

Web links:

Getting Started with TeX, LaTeX, and Friends: help page for those new to TeX.

TeX Reference Manual by David Bausum: list of TeX primitive control sequences with definitions and examples. Also available as a PDF:

Plain TeX Reference by Norman Walsh: The ‘parameters’ section at the end lists the default settings of Plain TeX.

TeX Reference Card by J.H. Silverman:

A page in French with information about typesetting French in plain XeTeX:
This site seems to be defunct, but the files can be accessed via the Internet Archive: https://web.archive.org/web/*/http://visuel.ouvaton.org/*
The file Velene.pdf contains most of the information that was on the web page.

A Summary of Common TeX Control Sequences by Daniel J. Plonsey:

Other resources on the same server:

Plain TeX quick reference from New Mexico Tech (seems to be a précis of the non-mathematical chapters of the TeXbook):

Big collection of TeX links, from Alan Kennington’s page:


Longer resources (books) arranged roughly beginner to advanced.

(Those followed by ‘→’ are available for free from the internet.)

Getting Started with Plain TeX by D. R. Wilkins
Summary of Commonly-Used Features of Plain TeX by the same author

A Gentle Introduction to TeX by Michael Doob Available as a PDF and .tex file.

TeX for the Impatient (Abrahams, Hargreaves, Berry)

Einführung in TeX by Norbert Schwarz (sehr gutes Buch)
English version: Introduction to TeX by Krieger/Schwarz

A Plain TeX Primer by Malcolm Clark

TeX in a Nutshell by Petr Olšák. Deals mainly with the primitive commands, but it also gives a summary of the Plain TeX macros

Notes On Programming in TeX from Christian Feursänger

TeX by Topic by Victor Eijkhout
By the same author: The Computer Science of TeX and LaTeX

The Advanced Texbook by David Salomon

The TeXbook by D. E. Knuth
This page has the source file of the TeXbook (texbook.tex). You can’t run it, but you can read it to see how it’s done.
See also this page which has a link to manmac.tex, macros written by Knuth to aid in typesetting the TeXbook.

TeX: The Program, volume B of ‘Computers and Typesetting’ (volume A is the TeXbook) contains the Pascal source code of the TeX program, mixed with descriptive text. (Knuth calls this ‘literate programming’.)


Macro collections:

Some collections of macros I found on the internet.

Paragraphing macros:

Stanford macros. Huge collection of TeX macros from Stanford University:

Petr Olšák’s TeX macros: OPmac and OpTeX (for use with LuaTeX)

Eplain: a set of macros that extends the capabilities of Plain TeX, covering (among other things) cross-references (with hyperlinks), double-, triple-, quadruple-columns, a verbatim command, indexing, table of contents. A few LaTeX packages can also be loaded.