# Align multiple numbered aligned blocks

There are many discussions over how to align multiple align environments with interspersed texts. However, I want to label multiple aligned blocks such that each number will center vertically for each aligned blocks and at the same time align across blocks.

Here is a MWE that achieves either at one time. The first part simply uses one giant align environment with some \nonumber directive. The second one use equation to wrap aligned but lose alignment info. How should I achieve the best of both worlds?

\documentclass{article}
\usepackage{amsmath}
\begin{document}
% Part I
\begin{align}
x^2 + y^2 &= 1 \\
z^2 &= 0 \nonumber \\
x^2 + y^2 + z^2 &= 1
\end{align}

% Part II
\begin{aligned} x^2 + y^2 &= 1 \\ z^2 &= 0 \\ \end{aligned}
\begin{aligned} x^2 + y^2 + z^2 &= 1 \end{aligned}
\end{document}


I'm not sure, if I understood you correctly, but seems that split environment is what you looking for:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align}
\begin{split}
x^2 + y^2 &= 1 \\
z^2 &= 0
\end{split}             \\
x^2 + y^2 + z^2 &= 1
\end{align}
\end{document}


gives

• Thanks. If anything I learned, it would be that I should read amsmath's documentation rather than googling around! Commented Jan 10, 2017 at 19:09

Here are two ways of correcting for the alignment:

1. If the equations are fairly similar (with some terms missing), you can use \phantom.

2. If the equations are very different, use a \phantom of the widest element, together with a math overlap.

\documentclass{article}

\usepackage{mathtools}

\begin{document}

% Part I
\begin{align}
x^2 + y^2 &= 1 \\
z^2 &= 0 \nonumber \\
x^2 + y^2 + z^2 &= 1
\end{align}

% Part II
% \!\begin{aligned} x^2 + y^2 &= 1 \\ \phantom{x^2 + y^2 + {}}z^2 &= 0 \end{aligned}%

% Part II
% \!\begin{aligned} x^2 + y^2 &= 1 \\ \phantom{x^2 + y^2 + z^2}\mathllap{a^2 - b^2} &= 0 \end{aligned}%

$$x^2 + y^2 + z^2 = 1$$

\end{document}


A minor \! correction is required in front of aligned.

• Thank, you, very helpfull Commented Oct 3, 2019 at 14:24