8

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

LaTeX Result

however, the result I'm aiming for is more like

Desired Result

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.

Moriambar
  • 11,466
Ozzah
  • 1,209

1 Answers1

9

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}) \\
  \text{s.t.} \quad &  \begin{aligned}[t]
     A \underline{x} & \leq \underline{b} \\
     \underline{x}   & \geq \underline{0}
  \end{aligned}
\end{alignat*}

\end{document}

which gives

enter image description here

David Carlisle
  • 757,742
Aditya
  • 62,301
  • 2
    (The amsmath package which is loaded by mathtools provides aligned.) – Qrrbrbirlbel Jul 29 '13 at 01: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. – Ozzah Jul 29 '13 at 03:19
  • @Qrrbrbirlbel: Thanks. For some reason I believed that aligned was part of mathtools. I have corrected the statement in the answer. – Aditya Jul 29 '13 at 06:35