I want to label a block of equations like that:

Label as I want it

The "AB" should not inflict the central alignment of the formula. I saw it a lot, but do not succeed on my own. Do I need to build boxes?

I used the alignat environment for the formula.


amsmath's flalign environment stretches out the contents to be flush left and right. Here's how you can obtain your required output:

enter image description here

\usepackage{amsmath}% http://ctan.org/pkg/amsmath
(\text{AB}) && z_{\text{LP}} = \min \sum_{p \in P} c_p\lambda_p & & \phantom{(\text{AB})} \\
            && \text{subject to\quad} \sum_{p \in P} \mathbf{a}_b\lambda_b &\geq \mathbf{b} \\
            && \sum_{p \in P} \lambda_p &= 1 \\
            && \lambda_p &\geq 0

The additional \phantom{..} on the right side is to obtain the required centered position of the other equation components (as a counterpart to the left (AB)).

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.