# Default behavior of align environment regarding flush and white space

I have the following code

\begin{matrix}
& u & = u_{-\frac{1}{2}} + u_0 \\
& v_0 \cdot u & = v_0 \cdot u_{-\frac{1}{2}}\\
& f\partial^{[1]} - \partial^{[0]} & = -\frac{1}{2} u_{-\frac{1}{2}}\\
\therefore & w_{-\frac{1}{2}} & = -2 f \partial^{[1]} + 2 \partial^{[0]}
\end{matrix}


I want the equals signs to be aligned. So, I try the alignment environment instead:

\begin{align*}
& u & = u_{-\frac{1}{2}} + u_0 \\
& v_0 \cdot u & = v_0 \cdot u_{-\frac{1}{2}} \\
& f\partial^{[1]} - \partial^{[0]} & = -\frac{1}{2} u_{-\frac{1}{2}} \\
\therefore & w_{-\frac{1}{2}} & = -2 f \partial^{[1]} + 2 \partial^{[0]}
\end{align*}


I don't know why it aligns flush right rather than flush left for the third column, but I know this tends to fix it:

\begin{align*}
& u && = u_{-\frac{1}{2}} + u_0 \\
& v_0 \cdot u && = v_0 \cdot u_{-\frac{1}{2}} \\
& f\partial^{[1]} - \partial^{[0]} && = -\frac{1}{2} u_{-\frac{1}{2}} \\
\therefore & w_{-\frac{1}{2}} && = -2 f \partial^{[1]} + 2 \partial^{[0]}
\end{align*}


All right. What if I use alignat instead of align?

\begin{alignat*}{3}
& u && = u_{-\frac{1}{2}} + u_0 \\
& v_0 \cdot u && = v_0 \cdot u_{-\frac{1}{2}} \\
& f\partial^{[1]} - \partial^{[0]} && = -\frac{1}{2} u_{-\frac{1}{2}} \\
\therefore & w_{-\frac{1}{2}} && = -2 f \partial^{[1]} + 2 \partial^{[0]}
\end{alignat*}


Awesome.

My questions: Why does the align environment behave the way it does with single and double column separators? Is it actually alternating flush left/right in some weird way, or am I mistaking it for something else? Is there some reason align can't/shouldn't minimize wasteful horizontal white space on its own? What is the pattern to where it decides to add that space?

• Why are you using && before the = symbols?
– Mico
Feb 18, 2023 at 8:40
• it alternates right and left why do you have & at the start of every row? there are examples of all these layouts in the amsmath guide. texdoc amsmath Feb 18, 2023 at 9:05

My main recommendation to you would be to peruse section 3, "Displayed equations", of the user guide of the amsmath package to learn more about the multi-row display-math environments provided by this package.

If there's but a single alignment point per row, I suggest you use an align* environment with a single alignment point indicator, &, per row. To create a bit of horizontal spacing after \therefore in row 4, just insert instructions such as \qquad\qquad or \hspace{15mm}.

If it's really important to you to remove any semblance of visual formatting activity (see the \qquad\qquad or \hspace{15mm} instruction in the preceding paragraph) from your code, use an {alignat*}{2} environment, insert && at the start of rows 1 thru 3, and replace \therefore \hspace{15mm} with \therefore &\quad& at the start of row 4. Otherwise, keep the align* setup of the preceding paragraph.

Unless your document is very hard pressed for vertical space, do also consider replacing the in-line symbol \therefore with the word "Therefore", on a text line of its own; see the third example below for how this may be implemented. Your readers may truly appreciate you making an effor to provide such an easy-to-spot sign post.

\documentclass{article}
\usepackage{mathtools} % for \shortintertext macro; load amsmath package automatically
\usepackage{amssymb}   % for \therefore macro
\newcommand\onehalf{\smash[t]{-\frac{1}{2}}} % \smash[t] for a smaller vertical offset

\begin{document}

\begin{align*}
u & = u_{\onehalf} + u_0 \\
v_0 \cdot u & = v_0 \cdot u_{\onehalf} \\
f\partial^{[1]} - \partial^{[0]} & = -\tfrac{1}{2} u_{\onehalf} \\
\therefore \hspace{15mm}
w_{\onehalf} & = -2 f \partial^{[1]} + 2 \partial^{[0]}
\end{align*}

\begin{alignat*}{2}
&&  u & = u_{\onehalf} + u_0 \\
&&  v_0 \cdot u & = v_0 \cdot u_{\onehalf} \\
&&  f\partial^{[1]} - \partial^{[0]} & = -\tfrac{1}{2} u_{\onehalf} \\
w_{\onehalf} & = -2 f \partial^{[1]} + 2 \partial^{[0]}
\end{alignat*}

\begin{align*}
u & = u_{\onehalf} + u_0 \\
v_0 \cdot u & = v_0 \cdot u_{\onehalf} \\
f\partial^{[1]} - \partial^{[0]} & = -\tfrac{1}{2} u_{\onehalf} \\
\shortintertext{Therefore,}
w_{\onehalf} & = -2 f \partial^{[1]} + 2 \partial^{[0]}
\end{align*}

\end{document}

• +1, but i’d also recommend u_{-1/2} Feb 18, 2023 at 9:11
• @egreg - I was thinking about just this issue as well! I decided not to mention the u_{-1/2} possibility in my answer, as I have no idea whether or not it's important to write _{-\frac{1}{2}} instead of _{-1/2}. (I felt safe about the \smash[t] idea, though...) Maybe somebody with deeper knowledge of physics-related typographical practice will weigh in with some more information on this. :-)
– Mico
Feb 18, 2023 at 9:29