[texhax] End of sentence space after parenthesis

Steve Schwartz s.schwartz at imperial.ac.uk
Sun Aug 14 14:23:29 CEST 2011


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

I append a short, crude example that illustrates this should anyone want
to experiment.

Best wishes
Steve

\documentclass{article}
\usepackage[textwidth=3in]{geometry}
\parindent 0em
\sloppy
\begin{document}
\parbox{\textwidth}{Here is aa line with (anything?) that makes it
spill.}
\parbox{\textwidth}{Here is aa line with (anything?)\@ that makes it
spill.}
\parbox{\textwidth}{Here is aa line with (anything?)\ that makes it
spill.}
\parbox{\textwidth}{Here is aa line with (anything\phantom{?}) that
makes it spill.}
\parbox{\textwidth}{Here is aaaa line with [anything?] that makes it
spill.}
\parbox{\textwidth}{Here is aaa line with \{anything?\} that makes it
spill.}
\parbox{\textwidth}{Here is aa line with $|$anything?$|$ that makes it
spill.}
\end{document}

-- 
+-------------------------------------------------------------------+
Professor Steven J Schwartz        Phone: +44-(0)20-7594-7660
Head, Space & Atmospheric Physics  Fax:   +44-(0)20-7594-7772
The Blackett Laboratory            E-mail: s.schwartz at imperial.ac.uk
Imperial College London            Office: Huxley 6M67A 
London SW7 2AZ, U.K.               Web: www.sp.ph.ic.ac.uk/~sjs
+-------------------------------------------------------------------+



More information about the texhax mailing list