4

Normally, when a sentence ends in a capital letter, the space following the period is treated like a normal space. To get an end-of-sentence space, you must put \@ before the period.

Is this also required if the capital letter is enclosed in a command, such as \emph{}, \texttt{}, or \textbf{}?

For example:

The pointer cannot be \texttt{NULL}. There is one exception:

vs.

The pointer cannot be \texttt{NULL}\@. There is one exception:
2
  • In this case yes, as you can see if you compare the two lines in your example (maybe more clearly in The pointer cannot be \texttt{NULL}.\the\spacefactor There is one exception:, where you can verify that the spacefactor is 1000 and not 3000 as you'd want after a period.) Of course it is easy to construct a command where it isn't needed (\newcommand*{\foo}[1]{#1\@} or \newcommand*{\goo}[1]{#1 goo}). Generally I'd expect the space factor to prevail unless the macro typesets additional text or explicitly changes the space factor.
    – moewe
    Commented Jul 24, 2020 at 17:08
  • 1
    The situation you're describing is not limited to all-caps letter groups being in the argument of some command; it also applies to all-caps letter groups being encased in () or []. E.g., compare the outputs of be (NULL). There is vs. be (NULL)\@. There is, or the outputs of be [NULL]. There is vs. be [NULL]\@. There is.
    – Mico
    Commented Jul 24, 2020 at 17:20

1 Answer 1

5

An image is worth many words.

enter image description here

The assignment of the space factor code is global, so whether or not you change fonts or use groups, after the last L the space factor code would be 999, meaning that the period would be interpreted as following an uppercase letter.

I set a very large \xspaceskip in order to emphasize the effect produced by the space factor after a period, which is 3000 if it was 1000 or more before it.

So \@ is necessary.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .