currently I have an optimization problem defined in {equation} environment:

enter image description here

I want to add a label (P) before equation (6).

Currently, I had to use the first line "Optimization problem (P)" as a workaround.

Ideally, I'd like it to look like this:

enter image description here

I tried to use {IEEEeqnarray}, but it didn't work well. Also tried to google, but couldn't find an answer.

Any help is much appreciated!

  • 1
    In case you don't need the label (6), you could use the command \tag{(P)} together with \label for your equation. It will change the (6) by (P), and each time you call the equation it compiler put a (P). Note: the package amsmath needs to be loaded.
    – Dox
    Commented Feb 11, 2014 at 11:30
  • @Dox Thanks - I tried to use \tag{P}, but ideally, I still want the label (6) to be there because I need to cross-reference it elsewhere in the paper with (6), not with (P).
    – Chang
    Commented Feb 11, 2014 at 11:36
  • I have a feeling that you're going to seriously confuse your reader by this (P) and (6) schizophreny, but do as you wish :)
    – yo'
    Commented Feb 11, 2014 at 12:09
  • @tohecz Actually...(P) refers to the entire optimization problem including (6) and a bunch of other constraints (7)(8)..., where (6) is only the objective equation of (P). That's how I'll cross-reference them in the context. Do you think this is not a good idea? :)
    – Chang
    Commented Feb 11, 2014 at 12:22

1 Answer 1


Following the method described in Formula label outside of formula

\noindent text
\text{(P)}&&\min_{x_{ij},\delta_i} \sum_{i=1}^m (P_i^{svr} + P_i^{cool})&&\phantom{\text{(P)}}

enter image description here

As daleif points out in the comments, the textual superscripts like "svr" and "cool" should be in upright, not italic, text. I left them italic, mimicking the OP's original effort, since they had nothing to do with placing the label on the left. More properly, one should use \mathrm{} or one of the several other ways to force those superscripts upright.

And here is another way to achieve the leftward label, using my stackengine package instead of amsmath (the only quirk is the \rule that I added because the vertical space above the equation was otherwise too short).

\noindent text
\stackon[0pt]{$\displaystyle\min_{x_{ij},\delta_i} \sum_{i=1}^m (P_i^{svr} + P_i^{cool})

enter image description here

One flexibility of this approach is that you could make the \makebox of width, for example, [.9\textwidth] which would provide for a constant indent of the label with respect to the left margin.

Finally, If one didn't need the label left-aligned, but merely offset to the left (let's say a fixed amount), a third approach could use \llap{(P)\hspace{1in}} at the beginning of the equation in the equation environment.

  • Better than my suggestion! Thank you for the trick!
    – Dox
    Commented Feb 11, 2014 at 11:39
  • Remember to put the named indices in upright font
    – daleif
    Commented Feb 11, 2014 at 12:46
  • @daleif Are you referring to "svr" and "cool"? I mimicked the OP's code, but I agree that these should be upright. Commented Feb 11, 2014 at 12:48
  • Yes, those indices, basically just to let others coming by know, that that is what they should remember to do
    – daleif
    Commented Feb 11, 2014 at 20:33
  • @daleif I added some parenthetical remarks admonishing the user to do what I say, not what I do. Thanks for the tip. Commented Feb 11, 2014 at 20:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .