I have a few equations, and I would like to align the forall statements of these equations to the right-hand side as below:
However, when I add a new equation (eq19), I have no idea why I cannot get a result as above. Would you please help me to resolve this problem using a similar notation as above (since I do not want to change all equations in my main file)?
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{flalign}
& o_{cs} \leq mO
& \forall c \in \mathcal{C}; s \in \mathcal{S} \label{eq18}\\
% & a_{jcs} - a_{jbs} \geq
% (\sum_{i \in \mathcal{T} \cup \alpha}
% x_{ijcs} +
% \sum_{i \in \mathcal{T} \cup \alpha}
% x_{ijbs} - 2)\Omega \nonumber \\
% &
% & \forall j \in \mathcal{T}; b, c \in \mathcal{C}; s \in \mathcal{S}; NC_{js} > 1 \label{eq19}\\
& \sum_{i \in \mathcal{T} \cup \alpha}
\sum_{j \in \mathcal{T}}
x_{ijcs} \: T_{js} \leq (ES_s-BS_s) \: {fR_c}
& \forall c \in \mathcal{C}; s \in \mathcal{S} \label{eq19a}
\end{flalign}
\end{document}
Best Answer
The problem is that your longest left aligned equation + longest right aligned equation + number will be wider than your total available width.
Here, the equations will fit:
But as soon as you add the
\in
or more to the right hand equation, the total width will be overfull and theflalign
environment won't be able to section it up into two good boxes and thereby can't have the equations and numbering on the same line:Thereby you either have to use another environment than
flalign
or widen the text width using thegeometry
package.Which will adjust the widths for your case to work, but the widths of the page can still be set manually with the
geometry
package.