[Tex/LaTex] Multiple align points and multiple equations

alignmath-mode

I have 2 equations, both have to be numbered and aligned. Equations' numbers should be vertically centered. But equations are long and have to be broken into 2 or 3 lines each. It would be great to have 2 alignment points in each line. But I cannot achieve that using split. Or can I? Here is the MWE:

\begin{align}
\begin{split}
z_1^{i,j}
    & = a_1 \, x_1^{i,j} + b_1 \, \delta_1^{i,j} \\
    & + \sum_k y_k^{i,j} \qquad \forall ~i,j
\end{split}
\\
\begin{split}
z_2^{i,j}
    & = a_2 \, x_2^{i,j} + b_2 \, \delta_2^{i,j} + c_2 \\
    & + z_1^{i,j} \qquad \forall ~i,j
\end{split}
\end{align}

Basically, I want the same output as produced with this code, especially equations' numbers vertically centered. In addition, I want \forall ~i,j from both equations to be also aligned, i.e. below each other. Solution with alignat instead align would be even better for me.

Best Answer

I believe you're using a two column format.

The environment split only accepts one alignment point; you can use \mathmakebox from mathtools (that also loads amsmath) and calc:

\documentclass[twocolumn]{article}
\usepackage{mathtools}
\usepackage{calc}

\begin{document}
\begin{align}
\begin{split}
z_1^{i,j}
    & = a_1^{} x_1^{i,j} + b_1^{} \delta_1^{i,j} \\
    & \qquad+ \sum_k y_k^{i,j}
      \qquad \forall i,j
\end{split}
\\
\begin{split}
z_2^{i,j}
    & = a_2^{} x_2^{i,j} + b_2^{} \delta_2^{i,j} + c_2^{} \\
    & \qquad + \mathmakebox[\widthof{$\displaystyle\sum_k y_k^{i,j}$}][l]{z_1^{i,j}}
      \qquad \forall i,j
\end{split}
\end{align}
\end{document}

Note that \, between factors is not used, while ^{} is recommended in order to push subscripts at the same level. The + on the second line shouldn't be under the equals sign, as it belongs to the right hand side of the expression.

enter image description here

However, the subscripts are not really level, because of j at the exponent, so you might want a slightly more complex adjustment:

\documentclass[twocolumn]{article}
\usepackage{mathtools}
\usepackage{calc}

\newcommand{\adjs}[1]{^{\vphantom{#1}}}

\begin{document}
\begin{align}
\begin{split}
z_1^{i,j}
    & = a_1\adjs{j} x_1^{i,j} + b_1\adjs{j} \delta_1^{i,j} \\
    & \qquad+ \sum_k y_k^{i,j}
      \qquad \forall i,j
\end{split}
\\
\begin{split}
z_2^{i,j}
    & = a_2\adjs{j} x_2^{i,j} + b_2\adjs{j} \delta_2^{i,j} + c_2\adjs{j} \\
    & \qquad + \mathmakebox[\widthof{$\displaystyle\sum_k y_k^{i,j}$}][l]{z_1^{i,j}}
      \qquad \forall i,j
\end{split}
\end{align}
\end{document}

enter image description here

Related Question