So what are control symbols and words?

In typing a document, we can think of ourselves as being in one of two distinct modes. We are either typing literal text (which will just be set into neat paragraphs for us) or we are typing text that will be interpreted by LATEX as an instruction to insert a special symbol or to perform some action. Thus we are either typing material that will go straight into the document (with some beautification), or we are giving commands to LATEX.

Some commands are implicit, in that we don't have to do anything much extra. For instance, we command LATEX to end the present sentence by typing a period (that doesn't follow a capital letter). These are no so much commands as part of having to describe the logical structure of a document.

A control word is something of the form \commandname, where the command name is a word made up only of the letters a to z and A to Z. A control symbol consists of a \ followed by single symbol that is not a letter.

Here are some examples:

These examples show that control sequences can be used to access symbols not available from the keyboard, do some typesetting tricks like setting the word LATEX the way it does, and change the appearance of whole chunks of text as with \em. We'll be meeting many more of these type of control sequences.

Another enormously powerful class of control sequences is those that accept arguments. They tell LATEX to take the parts of text you supply and do something with them—like make a fraction by setting the first argument over the second and drawing a line of the appropriate length between them. These are part of what makes LATEX so powerful, and here are some examples.

Mandatory arguments are given enclosed by braces, and optional arguments enclosed by square brackets. Each command knows how many arguments to expect, so you don't have to provide any indication of that.

We have actually jumped the gun a little. The above examples include examples of mathematical typesetting, and we haven't yet seen how to tell LATEX that it is typesetting maths as opposed to some other random string of symbols that it doesn't understand either. We'll come to mathematical typesetting in good time.

We need to dwell on a TEXnicality for a moment. How does LATEX know where the name of a control sequence ends? Will it accept both \pounds3 and \pounds 3 in order to set £3, and will \emWalrus and \em Walrus both be acceptable in order to get Walrus? The answer is easy when you remember that a control word consists only of alphabetic characters, and a control symbol consists of exactly one nonalphabetic character.

So to determine which control sequence you typed, LATEX does the following:

  1. when a \ character is encountered, LATEX knows that either a control symbol or a control word will follow.
  2. If the \ is followed by a nonalphabetic character, then LATEX knows that it is a control symbol that you have typed. It then recognises which one it was, typesets it, and goes on to read the character which follows the symbol you typed.
  3. If the \ is followed by an alphabetic character, then LATEX knows that it is a control word that you have typed. But it has to work out where the name of the control word ends and where the ensuing text takes over again. Since only alphabetic characters are allowed, LATEX reads everything up to just before that first nonalphabetic character as the control sequence name. Since it is common to delimit the end of a control word by a space, LATEX will ignore any space that follows a control word, since you want that space treated as end-of-control-word space rather than interword space.

This has one important consequence: The character in the input file immediately after a control symbol will be ``seen'' by LATEX, but any space following a control word will be discarded and never processed. This does not affect one much if you adopt the convention of always typing a space after a control sequence name.

There is a rare circumstance where this necessitates a little extra work and thought, which we illustrate by example:

0.1

If we type a control word like \LaTeX in the running text
then we must be cautious, because the string of spaces that
come after it will be discarded by the \LaTeX\ system.
which produces the output

0.10.8If we type a control word like LATEXin the running text then we must be cautious, because the string of spaces that come after it will be discarded by the LATEX system.