Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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).

share|improve this question
add comment

2 Answers 2

up vote 15 down vote accepted

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\@addpunct#1{\ifnum\spacefactor>\@m \else#1\fi}
\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
Title\@addpunct{.} Text\par
Title.\@addpunct{.} Text\par
Title,\@addpunct{.} Text\par
Title?\@addpunct{.} Text\par
Title!\@addpunct{.} Text\par
Title:\@addpunct{.} Text\par
Title;\@addpunct{.} Text\par
\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.

share|improve this answer
2  
@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
4  
@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
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.