Punctuation & brackets

To LaTeX a period is not a command to print a dot; it is a command that changes the width of the next space. The gap in Dr. Smith measures 3.33252pt, the gap in ends here. Next measures 4.44336pt — the same . on the keyboard, 1.11084pt apart in a 10pt document. And the deciding evidence is the character before the period: a lowercase letter means end of sentence, a capital means abbreviation. That one rule is behind the stretched gap after NASA. Next, the odd space in Fig. 1, and the wrongness you feel after e.g.. This page covers the mechanism (\sfcode), the fixes (\@, \ , ~, \frenchspacing), the difference between \ldots and \dots, the digit separator \,, and how to choose Japanese commas, periods and brackets.

Why the space after a period gets wider: the \sfcode mechanism

Because every character carries a space factor, and when the factor left by the previous character exceeds 2000 TeX adds \fontdimen7, the font’s “extra space”, to the following gap. Measured in a 10pt article, the ordinary interword space \fontdimen2 is 3.33252pt and the extra space is 1.11084pt, giving 4.44336pt in total — a sentence space is exactly 1.33 times an interword space. You can inspect any of the values by following \the\sfcode with a character; a period reports 3000. That 3000 is where everything starts.

CharacterDefault sfcodeEffect on the next space
. ? !3000sentence space; +1.11084pt at 10pt
:2000a slightly wider gap; sits right on the threshold
;1500only the stretch and shrink change slightly
,1250the same; never counts as a sentence end
)0transparent; carries the previous character’s value through
A B C999below 1000, which cancels the 3000 of a following .

Dr. Smith is tight, ends here. Next is wide: why capitals have sfcode 999

Because a capital letter’s sfcode is 999 — just under 1000. TeX’s rule is this: when the current space factor is below 1000, a following character with a factor above 1000 only raises it as far as 1000. So a . (3000) after an A actually leaves a factor of 1000, and no extra sentence space appears. A lowercase a, by contrast, is exactly 1000, so the 3000 of the following . passes straight through. Measured: A. a is 18.60657pt, and A.\ a — with the space written out explicitly — is exactly the same 18.60657pt. Meanwhile a. a is 17.21802pt and shrinks to 16.10718pt under \frenchspacing. That 1.11084pt difference is the extra sentence space itself.

This design simply encodes the English typesetting habit of the day TeX was written: sentences were set with a wider gap than words. To keep abbreviation periods — Dr., Ph.D., Mr. — from being mistaken for sentence ends, TeX adopted a one-line heuristic: “if it ends in a capital, it is an abbreviation.” Being a heuristic, it misses in both directions. NASA. Next really is a sentence end but is set tight, and Fig. 1 really is an abbreviation but is set wide. The next two sections fix each case.

Using \@ to say “this really is a sentence end”: NASA\@. Next

\@ means “treat the punctuation that follows as a sentence end”, and it goes before the period. Write He joined NASA\@. Then he left. and the 999 left by the capital A is cancelled, so the 3000 of the . passes through. Measured, A. a is 18.60657pt while A\@. a is 19.7174pt — a difference of 1.11083pt, exactly the extra sentence space. Putting it on the wrong side, NASA.\@ Next, does nothing. Remember it as \@ goes in front of the period. It is a tool you need a few times a year: only when a sentence ends on an acronym (NASA, USA, DNA) or a name that finishes with a capital.

After an abbreviation use \ or ~: e.g. and Fig.~1

The opposite misfire — an abbreviation ending in a lowercase letter being taken for a sentence end — is fixed by writing the space as a command. \ (backslash-space) means “put an ordinary interword space here” and ignores the space factor entirely. Measured, Fig. 1 is 26.5213pt and Fig.\ 1 is 25.41046pt: 1.11084pt narrower, which is the correct interword space. e.g., i.e., etc., cf., vs., Fig., Eq. and No. all fall into this trap.

For reference numbers like Fig. 1, however, ~ (tilde) is better than \ . A ~ is “a space the same width as an interword space, at which no line break may occur”; measured, Fig.~1 is the same 25.41046pt as Fig.\ 1. Same width, plus a ban on breaking. Since a figure number, equation number or initial that gets stranded across a line break is hard to read, the standard practice is Fig.~\ref{fig:one}, Eq.~\eqref{eq:main}, D.~E.~Knuth. Remember it as ~ for reference numbers, \ for other abbreviations and you will never hesitate.

latex
% a sentence really ending on a capital
He joined NASA\@. Then he left.

% abbreviations that must NOT get a sentence space
See, e.g.\ Knuth (1984); cf.\ the appendix.

% reference numbers: same width, but unbreakable
Fig.~\ref{fig:one} and Eq.~\eqref{eq:main}, after D.~E.~Knuth.

\frenchspacing: the one line almost every non-English document wants

\frenchspacing is a declaration that switches the extra sentence space off wholesale; one line in the preamble is all it takes. Its innards are startlingly simple: the definition in latex.ltx sets six sfcode values to 1000, so ., ?, !, :, ; and , are all treated like ordinary letters (the default \nonfrenchspacing restores 3000/3000/3000/2000/1500/1250). Measured, a. a shrinks from 17.21802pt to 16.10718pt while A. a stays put at 18.60657pt — places that never got the extra space are, naturally, unaffected.

Despite the name, the tighter spacing is not a French peculiarity. French, German, Spanish, Italian and most languages other than English do not set a wider gap between sentences than between words. Even modern English typesetting has largely settled on single spacing. Passing a language to babel often flips this for you, but declaring \frenchspacing yourself is the reliable route. LaTeX itself uses it inside the verbatim environment, incidentally — you do not want a stretched gap after a . inside code. Whether to keep the wide sentence space is a policy to agree with your co-authors up front; changing it midway spreads a diff across every page.

latex
\documentclass{article}
\usepackage[T1]{fontenc}
\frenchspacing          % . ? ! : ; , all behave like ordinary letters
\begin{document}
This ends here. Next sentence starts with an ordinary space.
\end{document}

An ellipsis is \ldots, not ... — and the difference between \ldots and \dots

Three typed periods, ..., measure 8.3313pt; \ldots measures 13.33008pt — 1.6 times wider. In ... the dots clot together and stop reading as an omission, whereas \ldots puts the correct gap between them. So always use \ldots or \dots for an ellipsis in running text. What, then, is the difference between the two? In plain LaTeX there is none. latex.ltx defines \dots and then says \let\ldots\dots, so they are literally the same command; measured in text mode both are 13.33008pt, matching \textellipsis exactly.

The difference appears only when amsmath is loaded, and only in math mode. amsmath re-declares both: \ldots becomes permanently the low dots, while \dots becomes a command that looks ahead and chooses the height of the dots from context. In a list of commas it picks low dots (\dotsc); between binary operators or relations it picks centred dots (\dotsb, which is \cdots); with integrals \dotsi, with multiplication \dotsm. Compile it and pull the text out with pdftotext: $a+\dots+b$ comes back as “a + · · · + b” and $a+\ldots+b$ as “a + . . . + b” — genuinely different characters. In text mode both still fall through to \textellipsis, so there is nothing to agonise over in prose.

CommandOutputWhen to use it
\ldots… (low, on the baseline)an ellipsis in prose; in math, always the low dots
\dotscontext-dependentunder amsmath it picks the height from context; the default in math
\cdots⋯ (centred)between operators, as in a+\cdots+b
\vdots⋮ (vertical)omitting rows in a matrix or a system of equations
\ddots⋱ (diagonal)omitting along the diagonal of a matrix
latex
\usepackage{amsmath}
% ...
He hesitated\ldots{} then went on.
\[
  x_1, x_2, \dots, x_n \qquad a_1 + a_2 + \dots + a_n
\]
\[
  \begin{pmatrix} a & \cdots & b \\ \vdots & \ddots & \vdots \end{pmatrix}
\]

Separating digits with \,: building “1 000” out of 1.6663pt

\, inserts a thin space and measures 1.6663pt — one sixth of an em. Measure 1\,000 and you get 21.66142pt against 19.99512pt for 1000: a difference of exactly 1.6663pt. Because the comma-versus-point convention for grouping digits is reversed between countries (English 1,000 is German 1.000), international practice has long recommended separating groups with a thin space instead. \, is precisely that space. The same command goes before a unit: 5\,\mathrm{kg}.

Scattering \, by hand stops paying off as the digit count grows, though. In a manuscript full of numbers and units, hand the job to siunitx and write \num{1000000} or \qty{5}{\kilogram}; the grouping, the space before the unit and even the treatment of the minus sign then stay consistent. Think of \, as the tool for the one number that happened to turn up in a sentence.

Japanese: 、。 or ,.? There is no class option in jsclasses

Which marks you get is decided by what you type into the source; no class option switches it. jsclasses — jsarticle, jsbook and the rest — has no option that changes the punctuation to ,.. If you want comma-period, the straightforward route is to type ,. directly in the body text. The style itself descends from JIS Z 8301, the standard governing the layout of Japanese Industrial Standards documents, which used ,and .in horizontal writing, and it is still widespread in mathematics books and science and engineering papers. On the other side, the 2022 report of the Council for Cultural Affairs on writing official documents settled on the Japanese comma 「、」 as the default, with ,permitted in horizontal writing as circumstances require. Follow your venue’s submission rules and your field’s custom, and be consistent within a single document — that is the whole of the decision.

latex
% comma-period style: just type the marks you want
\documentclass{ltjsarticle}
\begin{document}
本稿では,記法を次のように定める.まず,集合 $A$ を……
\end{document}

Japanese brackets 「」『』(): which one for what

Dialogue, quotation and setting off a phrase take corner brackets 「」; titles of books and works, and any quotation nested inside 「」, take double corner brackets 『』. Asides and readings take full-width (). Use full-width brackets in Japanese and do not mix in the half-width Western (): half-width brackets carry different surrounding space, so a single one floats visibly out of the line. Conversely, inside a Western (Latin) quotation, use the half-width ( ).

BracketNameTypical use
「 」kagi-kakko, corner bracketsdialogue, quotation, setting off a phrase; the primary Japanese quotes
『 』double corner bracketstitles of works, and nesting inside 「」
( )full-width parenthesesasides, notes, readings
[ ]full-width square bracketseditorial insertions and marked elisions
【 】lenticular bracketsheadings and labels that need strong emphasis
〔 〕tortoise-shell bracketsnotes and asides; an alternative to square brackets

How Japanese punctuation actually acquires its space — the widths recorded in the JFM, the kerning applied when closing brackets run together, \inhibitxspcode, the \xkanjiskip inserted automatically between Japanese and Latin, and the line-start and line-end prohibitions with their penalties — is covered on the Japanese typesetting details page. The one practical point to take away here is simple: do not type spaces of your own around punctuation. If you do, they land on top of the space the engine already provides and open an unnatural gap.

Grep the source before you submit: killing punctuation drift in one pass

Punctuation drift never raises a compile error; it shows up only as a wrongness in the PDF. So the reliable move is one mechanical sweep of the source at the end. In collaborative writing it is guaranteed that one chapter was written assuming \frenchspacing, another leaves a bare space after e.g., and a third mixes half-width brackets into Japanese. Run grep for these four things.

  • Bare spaces after abbreviations. Search for the space following e.g., i.e., cf., etc., Fig. and replace it with \ or ~ (unnecessary if you use \frenchspacing).
  • Sentences ending on a capital. Search for acronym-plus-. (NASA., USA., DNA.) and insert \@ wherever it really is a sentence end.
  • Ellipses. Search for three consecutive periods ... and change them to \ldots; inside mathematics, leave it to \dots from amsmath.
  • Half-width brackets in Japanese. Search for ( and ) sitting in Japanese lines and change them to full-width ( ). While you are there, check that no manual space has been typed around any punctuation mark.
terminal
# abbreviation followed by a bare space
grep -nE "(e\.g\.|i\.e\.|cf\.|etc\.|Fig\.) " *.tex

# a sentence that may end on an acronym
grep -nE "[A-Z]{2,}\." *.tex

# three typed periods instead of \ldots
grep -n "\.\.\." *.tex