19.7.1 Space factor description

While LaTeX is typesetting a paragraph, it may stretch or shrink the gaps between words. This space is not a character; it is called the interword glue (see \hspace), and is defined by the current font.

The \spacefactor parameter allows you to, for instance, have the space after a period stretch more than the space after a word-ending letter. A related table defines the space factor value for every character. \spacefactor and the associated table is a TeX primitive; LaTeX inherits all its space factor-related behavior from the TeX program and the plain TeX format.

After LaTeX places each character, or rule or other box, it sets this space factor value. If the next thing in the input is a space then this parameter affects how much that space can stretch or shrink. A space factor that is larger than the normal value means that the glue can stretch more and shrink less. Normally, the space factor is 1000; this is the value following most characters, and any non-character box or math formula.

The exceptions: the space factor is, by default, 3000 after a period, exclamation mark, or question mark, 2000 after a colon, 1500 after a semicolon, 1250 after a comma, and 0 after a right parenthesis or bracket or closing double quote or single quote. Finally, it is 999 after the 26 capital letters A–Z.

TeX’s basic behavior is this:

  1. If the space factor is 1000 then the glue amount will be the font’s normal space value (for Computer Modern Roman 10 point, cmr10, this is 3.3333pt).
  2. If the space factor is greater than 2000 then TeX adds the font’s “extra space” value (for cmr10 this is 1.11111pt).
  3. For any space factor f other than 1000, the font’s normal stretch value is multiplied by f/1000 and the normal shrink value is multiplied by 1000/f (for cmr10 these are 1.66666pt and 1.11111pt, respectively).

For example, consider the period ending the sentence after ‘dog’ in ‘My best friend is my dog. Let me explain…’. Since a the period is followed by a space, TeX sets \spacefactor to 3000 and inserts the fixed extra space (item 2 above), and also allows the glue to stretch 3 times as much and shrink 1/3 as much as the glue after any of the other words (item 3 above), since they are not followed by punctuation.

The full space factor rules are more complex. We won’t spell out every TeXnical detail here (see any plain TeX reference). In practice, there are two consequences:


Unofficial LaTeX2e reference manual