Brackets after \qquad {}
Regarding your first question: In general it is necessary to follow this advice and simulate the first operand by {}
, to allow TeX to distinguish between unary and binary operators. It is just that the align
environment treats operators differently; \qquad
does not simulate an operand. So if you don't know otherwise, I'd follow the advice.
The following document demonstrates the effect (or non-effect) of a pair of braces.
\documentclass{article}
\usepackage[fleqn]{amsmath}
\begin{document}
$+10x$
${}+10x$
$\qquad+10x$
$\qquad{}+10x$
\begin{align*}
&+10x\\
&{}+10x\\
&\qquad+10x\\
&\qquad{}+10x
\end{align*}
\end{document}
Your source is incorrect, but the additional {}
doesn't hurt.
Let me explain what happens. The align
environment builds pairs of aligned columns, with cells in math mode that are right aligned in the odd-numbered columns and left aligned in the even-numbered ones.
Each cell in an even-numbered cell begins with an implicit {}
, which makes for an empty Ord atom.
The processing of math mode material is quite complex, but not really too complicated.
Each item can be a math atom or “other”; spacing commands are in the “other” category. Subscripts and superscripts are attached to the math atom they belong to, so they are not of a concern here. Math atoms can be of several types:
- Ord (ordinary symbol)
- Op (operator)
- Bin (binary operation symbol)
- Rel (relation symbol)
- Punct (punctuation symbol)
- Open (opening delimiter)
- Close (closing delimiter)
and some others that, however, are basically transformed into Ord; in order to keep it simple, I'll not analyze them.
The formula TeX finds when processing the & \qquad + 10x
line is
{} \qquad + 1 0 x
(because &
implies it belongs in an even-numbered column) that translates in the following sequence of atoms and other items (denoted by “X”)
Ord X Bin Ord Ord Ord
The sequence of math atoms determines the spacings that are automatically added. If a Bin atom is preceded and followed by Ord atoms, TeX inserts around it a medium space, independently of “other items” in between; no space is inserted between Ord atoms. You find the complete list at https://tex.stackexchange.com/a/240579/4427
After automatically inserted spaces are dealt with, TeX builds a horizontal box with the items, this time keeping into account the “other items”, so you get
(empty)
\qquad
(medium space)+
(medium space)1
0
x
(the spaces above are just for separating items)
If the line had been & \qquad {} + 10x
, the formula would become {} \qquad {} + 10x
and the sequence of atoms and other items would be
Ord X Ord Bin Ord Ord Ord
that would add spaces so to get
(empty)
\qquad
(empty) (medium space)+
1
0
x
and the result would be the same, because an empty atom produces nothing (apart possibly from triggering an automatic insertion of spaces).
This has been the behavior of amsmath
since its release, even when it was called amslatex
, so 1992 or so.
The purpose of the implicity empty Ord atom is to get correct spacing in a typical align
:
\begin{align}
A &= B+C \\
D &= E+F
\end{align}
where B+C
is not really typical, but is used by way of example. The sequence of atoms when processing the second cell in the first row would come from
{} = B + C
so translated into
Ord Rel Ord Bin Ord
and, since TeX inserts a thick space between either Ord-Rel or Rel-Ord, we get
(empty) (thick space)
=
B
(medium space)+
(medium space)C
This is to allow the result to be the same as if it had been A=B+C
as far as automatically inserted spacing is concerned.
Actually, there is a place where to be careful: if a cell in an even-numbered column starts with an Op
atom (such as \sum
or \log
), a thin space would be inserted, because TeX automatically adds it between Ord and Op.
Is there a difference between \qquad{}
and \qquad {}
? No. Spaces after a control word are ignored.