\frenchspacing not setting the space factor codes correctly?

When I type \showthe\frenchspacing, I get the following output:

> \frenchspacing=macro:
->\sfcode \.1006\sfcode \?1005\sfcode \!1004\sfcode \:1003\sfcode \;1002\sfcode \,1001 .

Shouldn't all of those numbers be exactly 1000? I've also checked each of the space factor codes individually with showthe\sfcode. etc. and gotten the same incorrect values. When \frenchspacing is not in effect, the six space factor codes are exactly correct: 3000 for ., ?, and !; 2000 for :; 1500 for ;; and 1250 for ,.

I'm using pdfTeX, Version 3.1415926-1.40.9 (MiKTeX 2.7) (preloaded format=latex 2010.12.14).

-

The package amsmath loads the package amsgen which redefines \frenchspacing as:

\def\frenchspacing{\sfcode\.1006\sfcode\?1005\sfcode\!1004%
\sfcode\:1003\sfcode\;1002\sfcode\,1001 }


The reason is explained in the file amsgen.dtx:

Change \frenchspacing to ensure that \@addpunct will continue to work properly even when ‘french’ spacing is in effect.

You can see the effect of this redefinition in the following code (comment/uncomment the lines with \def\frenchspacing to see the difference):

\documentclass{article}

\makeatletter
\def\frenchspacing{\sfcode\.1006\sfcode\?1005\sfcode\!1004  \sfcode\:1003\sfcode\;1002\sfcode\,1001 }
%\def\frenchspacing{\sfcode \.\@m \sfcode \?\@m \sfcode \!\@m \sfcode \:\@m \sfcode \;\@m \sfcode \,\@m}
\makeatother

\frenchspacing

\begin{document}

\texttt{\meaning\frenchspacing}\par

\makeatletter
\makeatother

\end{document}


The \@addpunct command only adds its argument if there wasn't a punctuation before it, which is useful to ensure that a punctuation is always present even if the user didn't provide it (in inline section titles, for example). This does not work if all the \sfcodes of the punctuation are equal to 1000 so amsgen.sty puts them to something bigger. The reason why the \sfcodes are all different instead of all equal to 1001 is to be able to differentiate between all the punctuation signs if needed.

-
@MSC: it's also worth remembering that the actual factor by which the space is multiplied is the spacefactor over 1000, so those changes are basically invisible. I think there are a few examples in the TeXbook where the last digit is used for some purpose (like distinguishing punctuation) other than to produce space. – Ryan Reich Feb 10 '11 at 22:42
I am using amsmath, so it must be the cause. I figured that the space difference was virtually undetectable; I just wanted to make sure there wasn't a bug somewhere. Thank you. – MSC Feb 11 '11 at 14:52
@Ryan: Knuth gives an example on p. 400 of the TeXbook: You can use penalties -10001, -10002 and so on to communicate with the output routine. – Hendrik Vogt Feb 12 '11 at 15:22

The original definition in latex.ltx is:

> \frenchspacing=macro:
->\sfcode \.\@m \sfcode \?\@m \sfcode \!\@m \sfcode \:\@m \sfcode \;\@m \s
fcode \,\@m .
l.6 \show\frenchspacing


As this minimal example shows:

\documentclass{article}
\begin{document}
\show\frenchspacing
\end{document}


Without a minimal example from you it is impossible to say why it is different for you.

-