# uppercase and \spacefactor

Apparently, \uppercase forgets about the \spacefactor at the end. For example,

{What is the spacefactor?} \the\spacefactor.

returns

What is the spacefactor? 3000.

while

\uppercase{What is the spacefactor?} \the\spacefactor.

produces

WHAT IS THE SPACEFACTOR? 1000.

The TeXBook did not give me any clue about this behaviour, (but I did not try reading TeX - The program). Can anybody explain this ?

-

{What is the spacefactor?} \the\spacefactor.

\uppercase{What is the spacefactor?} \the\spacefactor

WHAT IS THE SPACEFACTOR? \the\spacefactor

\bye

produces 3000, 1000, 1000. That is the spacefactor after using \uppercase is the spacefactor you get from the uppercase letters not from the lowercase. Basically there is no interaction between the two, the uppercase instruction happens at the token level so by the time the spacefactor calculation is being done the original lower case letters are gone and the token stream consists of tokens corresponding to uppercase.

Note this is very different from using a small caps or full caps font where the tokens remain unchanged but the visual appearance of the glyphs is the uppercase form.

-
Thank you David, but why doesn't the question mark count ? Spacefactor \the\spacefactor and SPACEFACTOR \the\spacefactor return 1000 and 999 respectively. So does it mean that the 'uppercase question mark' has a \spacefactor of 1000 ? –  Antoine Chambert-Loir Sep 26 '12 at 1:07
Another comment, in the form of a question: does there exist a full caps version of the Latin Modern fonts? (Ten years ago, the answer would probably have been to use virtual fonts; is it stil the (upper or lower-) case? –  Antoine Chambert-Loir Sep 26 '12 at 1:14
It counts but the spacefactor gets set to 1000 because the texbook says: Each character has a space factor code, and when a character whose space factor code is g enters the current list the normal procedure is simply to assign g as the new space factor. However, if g is zero, f is not changed; and if f<1000<g, the space factor is set to 1000. (In other words, f doesn't jump from a value less than 1000 to a value greater than 1000 in a single step.) –  David Carlisle Sep 26 '12 at 1:27
The spacefactor (\sfcode) for the question mark is 3000. However TeX does not jump over 1000 in one step. The previous uppercase letter has 999, then the question mark with 3000 follows, the result is 1000. This supports abbreviations with uppercase letters. –  Heiko Oberdiek Sep 26 '12 at 1:33