In this chapter…
We’ve touched several times on the ability of LATEX to be reprogrammed. This is one of its central features, and one that still, after nearly a quarter of a century, puts it well above many other typesetting systems, even those with programming systems of their own. It’s also the one that needs most foreknowledge, which is why this chapter is in this position.
TEX is basically a programming language for typesetting. As such, it allows you to define macros, which are little (or large) program-like sequences of commands with a name which can be used as a command itself. This in effect makes a macro a shorthand for a sequence of operation you wish to perform more than once. LATEX is in fact just a large collection of such macros.
Macros can be arbitrarily complex. Many of the ones used in the standard LATEX packages are several pages long, but as we will see, even short one-liners can very simply automate otherwise tedious chores and allow the author to concentrate on the most important thing; writing.