Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The Guide to LaTeX (4e) states that \␣ is a "[n]ormal space between words after a command without arguments or after a period that is not the end of a sentence" (p. 467).

For the former case (\somecommand\ nextword), there is {} (\somecommand{} nextword), and for the latter case, there is \@ (used as .\@, not \@.!). So why would one use \␣ at all? Is \␣ perhaps not needed in LaTeX? When is \␣ really the best macro to use (better than the alternatives {} and \@)?

Note: ~ is for creating an interword space that cannot be line-broken, such as in Dr.~Smith; there are a number of other use cases (figure~\ref{...} and such), and they have been enumerated elsewhere, but the precise list is not important here (see links below).

Related:

share|improve this question
    
Most common use is after a macro \LaTeX\ something else. –  Yiannis Lazarides Feb 23 '13 at 5:00
3  
There are some expansion cases where you need \ rather than {} (following a command), but in most typesetting contexts the two are identical. So I'm not sure there is a 'right' answer here: it's a style thing. (Note \@ does not insert a space at all: it sets the space factor.) –  Joseph Wright Feb 23 '13 at 8:39
    
@JosephWright The reason why I find {} cleaner than \␣ is that the latter seems like a hack to terminate the space-eating property of a zero-argument macro (if it's thought of as a zero-argument macro terminator, the additional space created by it is sort of a side effect), whereas the former ({}) performs only one function with the user still having the option to add a ({}␣). This looks like better separation of functionality to me. –  Lover of Structure Feb 23 '13 at 14:04
1  
I prefer {\LaTeX} over \LaTeX\ or \LaTeX{} myself. –  John Wickerson May 21 '13 at 15:48
add comment

2 Answers

up vote 16 down vote accepted

The following two constructions,

This is the 1.{} sentence.

and

This is the 1.\ sentence.

have different results. You get a sentential space in the first case and the interword space in the second. Why? In the first case {} begins and ends a group, but in the end, the effect is null: the last item in the horizontal box is a . and spacefactor still has the sentential-space value (3000 by default), so the following space in appended with the sentential spacefactor value. In the second case, \␣, a primitive TeX command, directly appends glue to the horizontal box, "using the same amount that a space token inserts when the space factor is 1000" (TeXbook p. 285).

To extend the example to \␣ vs. {} to usage after an argumentless command, imagine a macro that might expand to something ending with ..

\def\macro{1.}

Then, for the same reason as above, the effect of the following two chunks of code is different.

This is the \macro{} sentence.

This is the \macro\ sentence.

In this case, I would use the second construction, because the assumption is that the result of \macro is a non-sentential phrase, like a single word. If, however, \macro might expand to something sentential, using the first construction would be better since then the ending punctuation of the macro (if any) would control the width of the space following it.

EDIT: As Bruno Le Floch pointed out in a comment, a well-written macro should be defined as \def\macro{1.\@}, "to avoid hiding a change in space factor inside a macro". Thus, in a perfect world, the difference between \macro{} and \macro\␣ disappears.

Regarding \␣ vs. \@␣, I know of no difference between them (barring the pathological situations like some macro tearing apart \@ and or somebody changing the value of \@m which \@ depends on). Thus I'd agree with the comments that using one or another is truly a matter of style. (By the way, I find it somewhat funny that \␣, which seems more complex on the surface, is actually a primitive TeX command.)

share|improve this answer
    
I definitely agree with your example of a macro expanding to something ending in a .. For ordinary/"visible" ., isn't \@ the standard choice (This is the 1\@. sentence.)? (Beside the point: "num." for ordinals is a German thing, not used in English grammar/style.) –  Lover of Structure Feb 23 '13 at 14:47
    
I think you're right: I don't know of a difference between \@ vs. \ ; I've updated the answer. Btw, I think you meant 1.\@ sentence in the comment above. And I have used "num." for an ordinal because this is what we do in Slovenia as well ... it was just the 1st ;-) example that came to my mind; otherwise I of course fully agree with your comment on the usage in English! –  Sašo Živanović Feb 23 '13 at 16:34
    
You're right that I meant .\@␣, not \@.. –  Lover of Structure Feb 23 '13 at 16:36
2  
One should add that text.\ and text.{} are only different when \nonfrenchspacing (the default, which some also call English spacing) is active. If you use \frenchspacing they are the same. This also means that it depends on the currently active babel language as this sets \frenchspacing for some languages like for example ngerman. –  cgnieder Feb 23 '13 at 16:42
1  
Btw, how do I write a (without copy-pasting)? –  Sašo Živanović Feb 23 '13 at 16:51
show 3 more comments

Nice answer from Sašo Živanović so just a couple of extra comments.

Funny you say

The reason why I find {} cleaner than \␣ is that the latter seems like a hack

as I normally think of it the other way round if I think about it at all. {} is a complex pair of commands opening a local group and closing it again, with the affect on white space being a side effect of the parsing rules. In comparison \␣ is a single TeX primitive specifically for adding space.

There are other places where it can be useful \␣ often isn't the most appropriate space in math mode, however it does work, unlike {} which makes an empty math atom which may affect spacing but not in the same way or \@ which generates an error.

Also \␣ being a primitive survives \typeout or \edef rather better than \@␣

\documentclass{article}

\begin{document}

$a\ b$

$a{} b$

$a\@ b$

\typeout{a\ b}

\typeout{a\@ b}

\typeout{a{} b}

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.