19.5 Backslash-space: ‘\

This section is about the commands consisting of two characters, a backslash followed by a single whitespace character. Synopses:

\  % backslash space
\      % backslash tab
\
% backslash newline

Produce the normal interword glue, a rubber length. The value normally comes from the current font. With LaTeX’s default font, it produces the rubber length 3.33333pt plus 1.66666pt minus 1.11111pt.

When the input has one or more blanks between words, LaTeX outputs whitespace that is different than a fixed and explicit space character found in other systems. This illustrates (the tabular is just for easy comparison):

\begin{tabular}{rl}
One blank:& makes some space\\
Three space characters:&   in a row\\
Three backslash-space commands:&\ \ \ in a row\\
\end{tabular}

On the first line LaTeX puts some space after the colon. On the second line LaTeX collapses the three space characters in the input to output one interword space, so you end up with the same space as in the first line. However, the bottom line uses three backslash-space commands, so the output has three interword spaces. (You can create a horizontal space of any width at all with \hspace; see \hspace.)

The backslash-space command has two main (and frequent) uses.

  1. It is used after control words to keep them from gobbling the blank that follows (see Control sequence, control word and control symbol), as after \TeX in ‘\TeX\ (or \LaTeX)’. Aside: another common method for this is to use empty curly braces, ‘{}’. This has the advantage of working whether the next character is a blank or not, as in ‘\TeX{} (or \LaTeX{})’; the {} can be added after \LaTeX as well as after \TeX without trouble.
  2. The other common use is to avoid the insertion of extra space after a period or other punctuation, as in ‘Prof.\ Smith’ or ‘Jones et al.\ (1993)’. See \@.

The above talks about space characters, but LaTeX treats tabs and newlines like spaces in this regard. There are commands backslash-tab and backslash-newline just like backslash-space. All three (normally) do the same thing.

In order to allow source code indentation, under normal circumstances, TeX ignores leading blanks in a line. So the following prints ‘one word’ with a single normal interword space:

one
   word

The interword glue between ‘one’ and ‘word’ is produced by the newline after ‘one’ in the input; the space before ‘word’ is ignored.

If the xspace package is being used, as quite a few people like to do, that changes all the rules (see xspace package).


Unofficial LaTeX2e reference manual