1

I have a nice equation that is correctly aligned, but the spacing is still incorrect. The equation is

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{flalign}
       P(1) \quad \text{ minimize: } &&   \sum\limits_{s \in \rho} x_s &&&&& \\
 \text{subject to: }&&   \sum\limits_{s \in \rho} a_{ts}x_s &\geq b_t, &&\text{for } t \in T, && (\lambda) \nonumber \\
                       && \sum\limits_{s \in \overline{\rho}} y_{s} &\leq \overline{\eta}. &&&& (\pi) \nonumber
\end{flalign}

\end{document}

I like the results but why is there a space of two \quad's between minimize text and subject to rows. I would like to keep the symbols lambda and pi flushed to right (like it is), but move the equation body closer to minimize and subject to text or vice versa. It it even possible?

1
1

Not sure quite what alignment you want but perhaps simpler markup such as:

enter image description here

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\noindent X\dotfill text\dotfill X
\begin{align*}
      P(1) \quad &&\text{ minimize: }&  \sum\limits_{s \in \rho} x_s \\
 &&\text{subject to: }&  \sum\limits_{s \in \rho} a_{ts}x_s \geq b_t, \text{for } t \in T, \tag{$\lambda$}\\
                      &&& \sum\limits_{s \in \overline{\rho}} y_{s} \leq \overline{\eta}. \tag{$\pi$}
\end{align*}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.