I try to align multiple blocks of equations in such a way that the same alignment is used for the different blocks. I am currently using align
with an array
-environment for each line. By specifying the width of the columns, I can ensure the correct alignment. However, the equation number is now not correctly aligned. I prefer the alignment of the second attempt in the example below, but then with the vertical alignment of the equation number of the first attempt.
\section{attempt 1}
\begin{align}
&\text{s.t.} &\quad& \sum\limits_{i \in I_{j}^2} x_i \geq 1, &\qquad\qquad& \forall j \in J \label{myLabel}\\
&\text{s.t.} && \sum\limits_{i \in I_{j}^2} x_i \geq 1, && \forall j \in J
\end{align}
\text{Here is some text and possibly a new section}
\subsection{new subsection}
\begin{align}
&\text{s.t.} &\quad& \sum\limits_{i \in I_{j}^2} x_i + y_i + z_i\geq 1, &\qquad\qquad& \forall j \in J \label{myLabel}\\
&\text{s.t.} && \sum\limits_{i \in I_{j}^2} x_i \geq 1, && \forall j \in J
\end{align}
\section{attempt 2}
\begin{align}
\begin{array}{p{0.8 cm} p{6.2 cm} p{2 cm}}
s.t. & $\sum\limits_{i \in I_{j}^2} x_i \geq 1,$ & $ \forall j \in J$
\end{array}\\
\begin{array}{p{0.8 cm} p{6.2 cm} p{2 cm}}
s.t. & $\sum\limits_{i \in I_{j}^2} x_i \geq 1,$ & $ \forall j \in J$
\end{array}
\end{align}
\text{Here is some text and possibly a new section}
\subsection{new subsection}
\begin{align}
\begin{array}{p{0.8 cm} p{6.2 cm} p{2 cm}}
s.t. & $\sum\limits_{i \in I_{j}^2} x_i \geq 1,$ & $ \forall j \in J$
\end{array}\\
\begin{array}{p{0.8 cm} p{6.2 cm} p{2 cm}}
s.t. & $\sum\limits_{i \in I_{j}^2} x_i + y_j \geq 1,$ & $ \forall j \in J$
\end{array}
\end{align}
Is there a way to do this? Either by fixing the width of columns in align or by changing the vertical alignment of equation numbers in array.
cases
orrcases
without the braces, but i'm not imaginative enough to extend your one-line offering to anything useful. with a real example (compilable), something more useful might emerge.