0

I've noticed that a capital letter followed by punctuation makes the following glue behave like the usual interword glue and does not change the space factor. This is mostly OK when a capital letter is followed by a period because initials are quite common (e.g. D. E. Knuth), but not OK when a capital letter is followed by an exclamation mark, question mark, comma, semicolon, or comma.

I've provided a MWE that displays the space factor when a punctuation mark (., !, ?, :, ;, ,) is followed by a ), ], or } for three cases: when the punctuation mark follows a (a) lowercase letter, (b) capital letter, (c) capital letter with \@ before the following punctuation. I am aware that the csquotes package already handles the space factor following a closing quotation mark.

Instead of adding \@ after each capital letter followed by the aforementioned punctuation marks, I am currently thinking about adding a macro to my documents that treats all capital letters like lowercase letters with respect to the space factor. See the code by egreg: Disabling interword spacing for periods following capital letters

I am interested in the LaTeX community's thoughts on this issue.

\documentclass{article}
\usepackage[fontsize=9pt]{fontsize}
\usepackage{geometry}
\usepackage{multicol}
\setlength{\columnseprule}{0.5pt}
\raggedright
\usepackage{stix2}
%
%The following macro makes all uppercase letters behave like the lowercase with respect to the space factor.
%Source: https://tex.stackexchange.com/questions/60876/disabling-interword-spacing-for-periods-following-capital-letters
%\count255=`A
%\loop
%   \ifnum\count255<`Z
%   \sfcode\count255=1000
%   \advance\count255 by 1
%\repeat
%
\begin{document}
%
\begin{multicols}{4}[\section*{LaTeX Space Factors After Punctuation}]
Period
\par
\verb|abc.|
abc.
\the\spacefactor
\par
\verb|ABC.|
ABC.
\the\spacefactor
\par
\verb|ABC\@.|
ABC\@.
\the\spacefactor
%
\par
\bigskip
Exclamation Mark
\par
\verb|abc!|
abc!
\the\spacefactor
\par
\verb|ABC!|
ABC!
\the\spacefactor
\par
\verb|ABC\@!|
ABC\@!
\the\spacefactor
%
\par
\bigskip
Question Mark
\par
\verb|abc?|
abc?
\the\spacefactor
\par
\verb|ABC?|
ABC?
\the\spacefactor
\par
\verb|ABC\@?|
ABC\@?
\the\spacefactor
%
\par
\bigskip
Colon
\par
\verb|abc:|
abc:
\the\spacefactor
\par
\verb|ABC:|
ABC:
\the\spacefactor
\par
\verb|ABC\@:|
ABC\@:
\the\spacefactor
%
\par
\bigskip
Semicolon
\par
\verb|abc;|
abc;
\the\spacefactor
\par
\verb|ABC;|
ABC;
\the\spacefactor
\par
\verb|ABC\@;|
ABC\@;
\the\spacefactor
%
\par
\bigskip
Comma
\par
\verb|abc,|
abc,
\the\spacefactor
\par
\verb|ABC,|
ABC,
\the\spacefactor
\par
\verb|ABC\@,|
ABC\@,
\the\spacefactor
%
\par
.)
\par
\verb|abc.)|
abc.)
\the\spacefactor
\par
\verb|ABC.)|
ABC.)
\the\spacefactor
\par
\verb|ABC\@.)|
ABC\@.)
\the\spacefactor
%
\par
\bigskip
!)
\par
\verb|abc!|
abc!
\the\spacefactor
\par
\verb|ABC!|
ABC!
\the\spacefactor
\par
\verb|ABC\@!|
ABC\@!
\the\spacefactor
%
\par
\bigskip
?)
\par
\verb|abc?)|
abc?)
\the\spacefactor
\par
\verb|ABC?)|
ABC?)
\the\spacefactor
\par
\verb|ABC\@?)|
ABC\@?)
\the\spacefactor
%
\par
\bigskip
:)
\par
\verb|abc:)|
abc:)
\the\spacefactor
\par
\verb|ABC:)|
ABC:)
\the\spacefactor
\par
\verb|ABC\@:)|
ABC\@:)
\the\spacefactor
%
\par
\bigskip
;)
\par
\verb|abc;)|
abc;)
\the\spacefactor
\par
\verb|ABC;)|
ABC;)
\the\spacefactor
\par
\verb|ABC\@;)|
ABC\@;)
\the\spacefactor
%
\par
\bigskip
,)
\par
\verb|abc,)|
abc,)
\the\spacefactor
\par
\verb|ABC,)|
ABC,)
\the\spacefactor
\par
\verb|ABC\@,)|
ABC\@,)
\the\spacefactor
%
\par
.]
\par
\verb|abc.]|
abc.]
\the\spacefactor
\par
\verb|ABC.]|
ABC.]
\the\spacefactor
\par
\verb|ABC\@.]|
ABC\@.]
\the\spacefactor
%
\par
\bigskip
!]
\par
\verb|abc!|
abc!
\the\spacefactor
\par
\verb|ABC!|
ABC!
\the\spacefactor
\par
\verb|ABC\@!|
ABC\@!
\the\spacefactor
%
\par
\bigskip
?]
\par
\verb|abc?]|
abc?]
\the\spacefactor
\par
\verb|ABC?]|
ABC?]
\the\spacefactor
\par
\verb|ABC\@?]|
ABC\@?]
\the\spacefactor
%
\par
\bigskip
:]
\par
\verb|abc:]|
abc:]
\the\spacefactor
\par
\verb|ABC:]|
ABC:]
\the\spacefactor
\par
\verb|ABC\@:]|
ABC\@:]
\the\spacefactor
%
\par
\bigskip
;]
\par
\verb|abc;]|
abc;]
\the\spacefactor
\par
\verb|ABC;]|
ABC;]
\the\spacefactor
\par
\verb|ABC\@;]|
ABC\@;]
\the\spacefactor
%
\par
\bigskip
,]
\par
\verb|abc,]|
abc,]
\the\spacefactor
\par
\verb|ABC,]|
ABC,]
\the\spacefactor
\par
\verb|ABC\@,]|
ABC\@,]
\the\spacefactor
%
\par
.\}
\par
\verb|abc.\}|
abc.\}
\the\spacefactor
\par
\verb|ABC.\}|
ABC.\}
\the\spacefactor
\par
\verb|ABC\@.\}|
ABC\@.\}
\the\spacefactor
%
\par
\bigskip
!\}
\par
\verb|abc!|
abc!
\the\spacefactor
\par
\verb|ABC!|
ABC!
\the\spacefactor
\par
\verb|ABC\@!|
ABC\@!
\the\spacefactor
%
\par
\bigskip
?\}
\par
\verb|abc?\}|
abc?\}
\the\spacefactor
\par
\verb|ABC?\}|
ABC?\}
\the\spacefactor
\par
\verb|ABC\@?\}|
ABC\@?\}
\the\spacefactor
%
\par
\bigskip
:\}
\par
\verb|abc:\}|
abc:\}
\the\spacefactor
\par
\verb|ABC:\}|
ABC:\}
\the\spacefactor
\par
\verb|ABC\@:\}|
ABC\@:\}
\the\spacefactor
%
\par
\bigskip
;\}
\par
\verb|abc;\}|
abc;\}
\the\spacefactor
\par
\verb|ABC;\}|
ABC;\}
\the\spacefactor
\par
\verb|ABC\@;\}|
ABC\@;\}
\the\spacefactor
%
\par
\bigskip
,\}
\par
\verb|abc,\}|
abc,\}
\the\spacefactor
\par
\verb|ABC,\}|
ABC,\}
\the\spacefactor
\par
\verb|ABC\@,\}|
ABC\@,\}
\the\spacefactor
\end{multicols}
%
\end{document}
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%

enter image description here

3
  • 3
    you don't say why you have enough capital letters to need this. the more common way to address this is to add \@ to whatever macro is making the uppercase eg latex adds \@ to \TeX so \TeX. gets end of sentence space Commented Mar 15, 2023 at 0:11
  • 1
    You should find more information here: What is the proper use of \@ (i.e., backslash-at)? Your proposal sounds plausible, but be careful. You should also consider situations where an end-of-sentence space is inserted erroneously, as in after "i.e.". Commented Mar 15, 2023 at 2:03
  • I feel like the capital letter exception is too complicated of a rule IMHO\@. It would be simpler to treat every punctuation mark the same regardless of whether it follows a lowercase or uppercase letter. I worry about two things primarily: (a) My suggestion would break other desirable LaTeX functionalities, document classes, and packages (b) My suggestion is not best practice (although perhaps my suggestion would be easier for new users) Commented Mar 15, 2023 at 20:38

1 Answer 1

2

I worry about two things primarily: (a) My suggestion would break other desirable LaTeX functionalities, document classes, and packages (b) My suggestion is not best practice (although perhaps my suggestion would be easier for new users)

Yes that is the main concern. If you make a document class that uses this convention then while you may consider the rule "simpler" the behavour will not be as described in any (la)tex tutorial, and any latex fragments copied from other documents or generated by standard bibliography styles will not have guards for A. N. Other so will get end of sentence space. So while technically what you suggest would work, I wouldn't consider it good practice for a document class for general use.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .