In this answer, \@
is used after a period and before an \xspace
, presumably to indicate that the preceding period (in "etc.") was not sentence-final.
In these tips, \@
is used before a period and after capital letters, to indicate that the preceding capital letters are sentence final.
Since \@
is rather difficult to search for online, I thought I'd try to ask here: what exactly does \@
do, and how do you use it properly/consistently? For instance, how should you input the following farcical sentence?
Languages like JS, HTML, etc. were not used by King Henry III.
EDIT: I'm accepting Barbara's answer below as it (and the comments on it) indicate the initial intent of \@
: "the period which follows is sentence-final". Its counterpart is \
(slash-space), which says "the period which precedes is sentence-medial". Egreg's answer explains in far more detail exactly how \@
and \spacefactor
work to cause the effects seen by \@
and \
after lower- and upper-case letters and punctuation. Both are very helpful answers.
Two correct answers to my made-up sentence above is
Languages like JS, HTML, etc.\ were not used by King Henry III\@.
Languages like JS, HTML, etc.\@ were not used by King Henry III\@.
The former is arguably "better style", while the latter demonstrably produces the correct result even if it seems less consistent about placement of \@
versus periods. And a safe but slightly redundant answer blindly adds \@
before every comma:
Languages like JS\@, HTML\@, etc.\ were not used by King Henry III\@.
This last one is amenable to macro-izing: \def\acronym#1{\textbf{#1}\@\xspace}
(or whatever style you'd prefer), where the \xspace
disappears if the next character is punctuation, and the \@
ensures that subsequent punctuation thinks it follows a lowercase word and not an uppercase initial.
Best Answer
i find the cited answer rather confusing, if not out-and-out backwards.
\@
before punctuation says that the period does fall at the end of a sentence. to quote from the latex manual (p.170):so your farcical sentence is input as
only one
\@
, and that after a capital I.Update:
I have been reminded, rather ignominiously, that
\@
is not defined in classic TeX. If used, the result is "! Undefined control sequence." (The corresponding command for TeX to render an end-of-sentence space following a period following an uppercase letter is\null
.)\@
is LaTeX only.