How can I align the terms of this equation nicely?

I have the following alignat segment:

\begin{alignat*}{3}
\text{max}_{\underline{\lambda}} \text{min}_{\underline{x}} \quad & \underline{c}^T \underline{x} + \underline{\lambda}^T(\underline{d} - D\underline{x}) \\
\text{s.t.} \quad & A \underline{x} & \leq \underline{b} \\
& \underline{x}   & \geq \underline{0}
\end{alignat*}

which gives however, the result I'm aiming for is more like Note that:

• the 'max/min' is right-aligned with the 's.t.', the left-most character in the list of 's.t.' terms (the A) is aligned with the left-most term in the objective function (the c).

• the rest of the LHS in the 's.t.' section is right-aligned, and the inequalities are aligned.

I'm not sure if I'm being too fussy here, but anything is better than what I already have.

• Why use \text{max} instead of \max and \min? Jul 29 '13 at 1:25
• Because I didn't know about \max and \min :) But now that I know about them, I will start using them! Jul 29 '13 at 1:42
• Here are four other ideas: How to edit the linear programming in LaTeX? And here are five others: Multicol layout for systems of (linear) equations. Jul 29 '13 at 1:46
• @Ozzah Then you should probably also learn about \log, \exp, \sin, \cos, etc. Also, if you want to define a new math operator, simply use \DeclareMathOperator. Jul 29 '13 at 8:51
• Other log-like symbols (pdf) are \arccos, \arcsin, \arctan, \arg, \cos, \cosh, \cot, \coth, \csc, \deg, \det, \dim, \exp, \gcd, \hom, \inf, \ker, \lg, \lim, \liminf, \limsup, \ln, \log, \max, \min, \Pr, \sec, \sin, \sinh, \sup, \tan, \tanh. Jul 29 '13 at 8:55

One option is to use aligned environment from amsmath package:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{alignat*}{2}
\max_{\underline{\lambda}} \min_{\underline{x}} \quad & \underline{c}^T \underline{x} + \underline{\lambda}^T(\underline{d} - D\underline{x}) \\
A \underline{x} & \leq \underline{b} \\
\underline{x}   & \geq \underline{0}
\end{aligned}
\end{alignat*}

\end{document}

which gives • (The amsmath package which is loaded by mathtools provides aligned.) Jul 29 '13 at 1:48
• @Qrrbrbirlbel thanks for that. I was having trouble compiling when I added that package, and couldn't see it in my MiKTeX package repository. Jul 29 '13 at 3:19
• @Qrrbrbirlbel: Thanks. For some reason I believed that aligned was part of mathtools. I have corrected the statement in the answer. Jul 29 '13 at 6:35