[texhax] End of sentence space after parenthesis

Paul Isambert zappathustra at free.fr
Sun Aug 14 17:11:26 CEST 2011

Selon Steve Schwartz <s.schwartz at imperial.ac.uk>:

> I was surprised to find that latex (and presumably tex) treats a
> punctuation mark as an end of sentence even if it is followed by a
> parenthesis. When you typeset, for example,
> He didn't have much (any?) success at typesetting.
> latex will preferentially stretch after the ")" as though it were the
> end of a sentence, rather than insert a normal inter-word space. It is
> easy to fix this with a hard space \ , an explicit space \~, or a \@ to
> locally disable the end of sentence - or \frenchspacing. Some
> experimenting reveals that a square bracket also is treated this way,
> but not curly braces.
> I haven't found any documentation for this "feature", but I guess it is
> somewhere in the TeXbook.

Yes, although I can't tell you where right now. Look for \spacefactor and
\sfcode in the TeXbook (or chapter 20, "Spacing", of TeX by Topic).

> I guess is it designed for the case of an
> entire parenthetical sentence:
> I hate latex. (If your name was Bill Gates, wouldn't you?) Of
> course, ...
> I guess Knuth took the decision that this latter was more common than my
> first example, and made that the default behaviour(?).

Yes and now. The reason why parentheses are transparent is because their
\spacefactor (rather, their \sfcode) is 0; said \spacefactor is the reason why
spaces stretch; TeX does nothing hard-coded to the effect that "space is
stretched after strong marks".

Hope I was clear enough.


More information about the texhax mailing list