2

When typesetting the LaTeX in Math mode is it safe to create a space (one carriage return) around a LaTeX symbol to isolate it from the surrounding character instead of enclosing the surrounding character with {..}. For example if I copy the following here it displays the same:

\hat T \\
\hat{T} \\
\sin x \\
\sin{x} \\
\int f(x)dx \\
\int{f(x)}dx

For readability the use of {..} seems a better choice but are there any examples where using the space option will cause an issue? I'm using amsmath package.

4
  • Related: When one should use spacing like \quad or \,
    – Werner
    Jul 23, 2015 at 17:00
  • Related/possible duplicate: Do spaces in $xy=1$ have differences between $x y = 1$?
    – Werner
    Jul 23, 2015 at 17:14
  • 2
    using {....} here is wrong and will in general adversely affect the spacing Jul 23, 2015 at 17:51
  • I'm interested more in cases where a symbol is defined with alpha characters, e.g. \hat (and not the symbols like ^ or _) and the character that follows is non-numeric. So, for instance, isolating symbol from the character that follows is not an issue for a^2 or \hat2 or \sin2. Hence, in my cases the preferred method would be to use a space and not {..} for isolation, correct?
    – nam
    Jul 23, 2015 at 18:35

1 Answer 1

3

Spaces (including a single carriage return) are gobbled under math mode. From the TeX Book, Chapter 18: Fine Points of Mathematics Typing (p 166):

[consider]

$$ F_n = F_{n-1} + F_{n-2}, \qquad n \ge 2. $$

It is perhaps worth reiterating that TeX ignores all the spaces in math mode (except, of course, the space after \qquad, which is needed to distinguish between \qquad n and \qquadn); so the same result would be obtained if you were to leave out all but one space:

$$F_n=F_{n-1}+F_{n-2},\qquad n\ge2.$$

Whenever you want spacing that differs from the normal conventions, you must specify it explicitly [...].

In fact, it's the preferred method for improving readability, as the use of {..} may influence the spacing necessarily - changing math elements into a ordinal atom \mathord.

So, instead of grouping elements to "improve readability", use spaces. Here is an example of using {..} which causes a problem:

1
  • After reading yours and David's response, I'm inclined to use spacing over {...}.
    – nam
    Jul 25, 2015 at 1:59

You must log in to answer this question.

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