I am struggling trying to align a set of equations of very different lengths. All equations shell be aligned to the comma between the formula and the variable declaration.
Despite the use of split
, formula 3 is still too long. If I do another line break between \left(
and \right)
, I get an error "Extra }, or forgotten right"
.
As soon as the splitting is done, I would like to arrange the first line of such a multiline formula left aligned, the next lines left aligned with a small skip in front, and only the last line right aligned to the comma. Is there a possibility to do this? Or any other sugesstions of presenting many of such long formulas together in one environment in a pretty way?
I found solutions for arranging one long formula in many lines OR to arrange many formulas together around a comma or something else OR to leftalign one formula like I described (mathtools
' \MoveEqLeft
), but I have no idea how to do all at the same time.
\documentclass[]{scrreprt}
\usepackage{amsmath}
\begin{document}
\begin{align}
\sum_{k=K_1+1}^{K_{21}-1} s_{ik} \tilde{h}_{k+1}
\leq h_i
\leq \sum_{k=K_1+1}^{K_{21}} s_{ik} \tilde{h}_k
+ \sum_{k=K_1+1}^{K_{21}-1} \bar{s}_{ik} \tilde{h}_{k+1}
& , i \in \mathcal{I}_{21}
\label{eq_1} \\
%
\begin{split}
\sum_{l=K_{21}+1}^{K_{22}} \alpha_{lk} (s_{il} + \bar{s}_{il}) \left( 1 + \varepsilon \right)
+ w_i + \sum_{j=I_1+1}^{I_2} \alpha_{ji} (s_{jk} + \bar{s}_{jk}) w_j
& \\
\geq (1 + \varepsilon)(1-s_{ik}-\bar{s}_{ik})
& , i \in \mathcal{I}_{22}, k \in \mathcal{K}_{22}
\end{split}
\label{eq_2} \\
%
\begin{split}
\left( 1- \sum_{j=I_1+1}^{I_2}\alpha_{ji}t_{jk}\right)
\cdot \left( w_i - \frac{1}{m+2} - \varepsilon -|w_i - \frac{1}{m+2} - \varepsilon|\right) \cdot \ldots
& \\
\ldots \cdot \left( h_i + \sum_{l=K_1+1}^{K_2} \alpha_{lk} \tilde{h}_l - H_{12} - \varepsilon -
| h_i + \sum_{l=K_1+1}^{K_2} \alpha_{lk} \tilde{h}_l - H_{12} - \varepsilon | \right)
= 0
& , i \in \mathcal{I}_{22}, k \in\mathcal{K}_{21}
\end{split}
\label{eq_3} \\
%
H_{21} = H_{12}
&
\label{eq_4}
\end{align}
\end{document}
Addition:
Until now I used the old eqnarray-environment. Using that, it looks nearly the way it should:
\documentclass{scrreprt}
\begin{document}
\begin{eqnarray}
\sum_{k=K_1+1}^{K_{21}-1} s_{ik} \tilde{h}_{k+1}
\leq h_i
\leq \sum_{k=K_1+1}^{K_{21}} s_{ik} \tilde{h}_k + \sum_{k=K_1+1}^{K_{21}-1} \bar{s}_{ik} \tilde{h}_{k+1}
& , {} & i \in \mathcal{I}_{21}
\label{eq:sf_height_fits_levelheight_i21}\\
%
\left( 1- \sum_{j=I_1+1}^{I_2}\alpha_{ji}t_{jk}\right)
\times \left( w_i - \frac{1}{m+2} - \varepsilon -|w_i - \frac{1}{m+2} - \varepsilon|\right) \qquad \qquad \quad
& & \nonumber \\
\qquad \times \left( h_i + \sum_{l=K_1+1}^{K_2} \alpha_{lk} \tilde{h}_l - H_{12} - \varepsilon - | h_i + \sum_{l=K_1+1}^{K_2} \alpha_{lk} \tilde{h}_l - H_{12} - \varepsilon |\right)
\geq 0
%
& , & i \in \mathcal{I}_{22}, k \in\mathcal{K}_{21} \qquad \quad
\label{eq:sf_I22_not_in_new_I21} \\
H_{21} = H_{12}
& &
\label{eq:sf_def_H21}
\end{eqnarray}
\end{document}
Only problem: formular 3 is too wide, and formula numbers run out of text area (and eqnarray-environment is not the first choice).