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.

David Carlisle
  • 757,742
nam
  • 1,105

1 Answers1

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:

Werner
  • 603,163
  • After reading yours and David's response, I'm inclined to use spacing over {...}. – nam Jul 25 '15 at 01:59