In general, &
is the cell separator in tabulars and similar constructions. TeX computes the column widths dynamically, although it's possible to fix a column width. A double &
has no special meaning: a single &
means “go to the next cell of the alignment”, so &&
means “the next cell is empty, go to the following one”.
A generic tabular should be thought as a set of cells organized by rows and columns; the alignment is determined column by column (but can be overridden for single cells, in some cases).
The most common alignments are obtained with tabular
or array
(the difference is that the latter must go in math mode and the cells are typeset as math formulas). In tabular
one must specify the column alignments, with input such as
\begin{tabular}{rcl}
which means “three columns, one right aligned, one centered, one left aligned”. Actually this adds some space next on either side of each column, so really we're specifying
<space><right alignment><space><space><center alignment><space><space><left alignment><space>
The space is fixed (\tabcolsep
), but this can be modified in various ways.
With align
the same idea applies, but the number of columns is unspecified; rather the pattern
<right alignment><left alignment><dynamic space>
is repeated as much as necessary. The <dynamic space>
is not added at the end. So an input such as
\begin{align*}
\frac{3x + y}{7} &= 9 && \text{given} \\
3x + y &= 63 && \text{multiply by 7} \\
3x &= 63 - y && \text{subtract y} \\
x &= 21 - \frac{y}{3} && \text{divide by 3} \\
\end{align*}
which has a maximum of three &
in the rows, builds an alignment according to the scheme
<right alignment><left alignment><dynamic space><right alignment><left alignment>
No space is added between the r
and the l
column in each pair (but special precautions are taken so that the =
is correctly spaced.
An empty cell is reserved no space; for each column, the widest cell determines the reserved space; so in that alignment the third column occupies no space because all the cells in it are empty.
The “dynamic space” is determined based on the width of the columns, so as to avoid overfull lines as much as possible.
In your first example, the \text{...}
entries end up in the third column, which is right aligned; in the above example, instead, they belong to the fourth column, which is left aligned.
In your third example, the cells starting with =
belong to the third column, while the \text{...}
ones are in the fifth: the alignment is (in abbreviated form)
<right><left><dynspace><right><left><dynspace><right><left>
where the second, fourth and sixth columns all have empty cells.