5

By default, LaTex inserts a longer, intersentence space after a period. The exception is if the period follows a capital letter, in which case an interword space is assumed. This thread describes the situation (and how to work around it) nicely:

When should I use intersentence spacing \@?

However, I never follow acronyms with periods, so this behavior is a constant source of annoyance. It means that I always have to carefully proofread my document to make sure that I haven't forgotten the critical \@ between my uppercase acronyms and trailing periods. Not only does this waste my time, it violates the very good idea that content and the busywork of formatting should be kept separate.

Is there any way to modify this default behavior? If the string ". " occurs in my document, I always want LaTex to use an intersentence space.

5
  • 3
    Not a direct answer, but instead of manually proofing, you can just use a simple regex to find the possible problematic instances: [A-Z]\.
    – badroit
    Commented Jun 22, 2012 at 18:57
  • Sorry, but it's unclear to me why this should be a problem if you never follow acronyms with periods.
    – egreg
    Commented Jun 22, 2012 at 20:00
  • I saw the deletion, but my previous question stands: according to your words the problem never appears.
    – egreg
    Commented Jun 22, 2012 at 21:01
  • 1
    egreg, you are right, I was not entirely precise in my question. I do not use periods to denote an acronym (e.g., "NASA" rather than "N.A.S.A."). If an acronym ends a sentence, it naturally is followed by a period. ("I work for NASA. Therefore I use too many acronyms.") Barbara brings up initials, which is an exception that I hadn't thought of. That may make this problem too complex for a simple solution like I'd envisioned. Commented Jun 22, 2012 at 21:01
  • No, it's easy: acronyms are a logical unit, so write \acro{NASA} where \acro is defined as barbarabeeton suggests. You'll have the possibility of changing completely the appearance of acronyms by simply redefining \acro.
    – egreg
    Commented Jun 22, 2012 at 21:17

4 Answers 4

10

why don't you define a command for acronyms that puts the \@ in automatically?

\newcommand{\acro}[1]{#1\@}

this does, of course, assume that you don't want \frenchspacing to get rid of end-of-sentence spaces entirely.

(the tugboat macros have a rather more elaborate definition that uses "large small caps" for acronyms. these are just regular caps stepped down a size, and require that the argument to the macro be entered in all uppercase; we find the regular small caps too small for acronyms. the code is in the file ltugcomn.sty which can be found on ctan.)

it might be observed that some of us find the wider spaces after "Dr." or "No." even more annoying (and frequently occurring) than narrower spaces after acronyms, and the solution to that isn't so uniformly addressable.

1
  • This solution would work, though I'd recommend putting in an \xspace to avoid yet another spacing annoyance. Unfortunately, I use enough acronyms in my work that it becomes a bit burdensome. Alternatively, I could define individual acronyms via newcommand, but again, it winds up adding formatting bulk to my document. Commented Jun 22, 2012 at 21:08
8

The following code in the preamble will make all uppercase letters behave like the lowercase with respect to the space factor, so that a period after an uppercase letter will be considered as end of sentence.

\count255=`A
\loop
  \ifnum\count255<`Z
  \sfcode\count255=1000
  \advance\count255 by 1
\repeat
5
  • 1
    but this would make people's initials be treated like an automatic end of sentence; this is not what one usually wants. Commented Jun 22, 2012 at 20:22
  • 1
    @barbarabeeton I know, but it seems to be what Jake wants, see his last sentence.
    – egreg
    Commented Jun 22, 2012 at 20:23
  • 1
    oh, yeah, the last sentence. well, i can't believe he really means it ... Commented Jun 22, 2012 at 20:26
  • 1
    I don't know; if you're writing a paper in which you constantly have, say, "1D" ("one dimension"), "2D", "3D", and other random abbreviations like "PDE" immediately followed by sentence punctuation, but almost never use people's initials or abbreviations like "U.S.", it might be simplest to set the space factor codes of all the uppercase letters to 1000. The bibliography would probably contain a lot of people's initials, but it would ideally use \frenchspacing so that you don't have to worry about getting the spacing right in journal abbreviations like "Proc. Amer. Math. Soc.".
    – MSC
    Commented Oct 24, 2013 at 21:46
  • 1
    @MSC The thebibliography environment generally does \frenchspacing (at least in the most common classes). The real solution is always using \frenchspacing and forget about the problem.
    – egreg
    Commented Oct 24, 2013 at 21:57
5

You can use the microtype package to implement your own inter-sentence spacing.

\documentclass{standalone}
\frenchspacing
\usepackage[spacing=true]{microtype}

\SetExtraSpacing
  { font = * }
  {
   .  = {500,500,500}
  }

\begin{document}
 HellO, World.

 HellO. World.

 HellO\@. World.
\end{document}

Setting \frenchspacing removes the inter-line difference. Then you manually set the extra-spacing after the '.' character (without the preceding caps rule).

An open question is precisely what dimensions you should pass to the \SetExtraSpace command, but {500,500,500} appears quite close to the default.

code above compiled

1

Barbara Beeton’s suggestion of an acronym macro is probably the way to go. If, however, you insist on using plain text as input, you can adjust the space factors instead; here’s how:

To quote from the TeXbook:

When INITEX creates a brand new TeX, all characters have a space factor code of 1000, except that the uppercase letters ‘A’ through ‘Z’ have code 999. (This slight difference is what makes punctuation act differently after an uppercase letter; do you see why?)

You can therefore put the lines

\sfcode`\A=1000
…
\sfcode`\Z=1000

into your preamble to make upper-case letters behave no differently from lower-case ones.

1
  • This will use enlarged space also after initials, of course. I've undeleted my answer, but you should also undelete your last sentence in the question.
    – egreg
    Commented Jul 5, 2012 at 23:14

You must log in to answer this question.

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