## LaTeX forum ⇒ Math & Science ⇒ Linear Programs Alignment Topic is solved

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
GommaFleX
Posts: 10
Joined: Tue Aug 16, 2011 12:19 pm

### Linear Programs Alignment

Hi all.

I'm trying to align an maximization program. I searched everywhere but nothing seems work. I want to have something like this (I use '_' because space is not displayed on this forum):

________max____f(x)
_________s.t.____x<M____________(1)
_______________x>Zi_____∀Zi_____(2)

I use \begin{align}
but i keep getting something like this:
________max_f(x)
_________s.t._x<M_______________(1)
____________x>Zi________∀Zi_____(2)
or this:
________max_________ f(x)
_________s.t.________x<M________(1)
___________________x>Zi_∀Zi_____(2)
This is the code I'm using:
\begin{align}\max_{\mathcal{V}_{\Theta}^{*},\delta}&\mathcal{V}_{\Theta}^{*} \notag \\\text{s.t.}&\mathcal{V}_{\Theta}^{*} \leq \mathcal{V}_{\Theta}(\delta,\sigma_{\Psi})&\forall \sigma_{\Psi} \in \Sigma_{\Psi} \\&\sum_{\sigma_{\Theta} \in \Sigma_{\Theta}}{\delta(\sigma_{\Theta})}=1\\&\delta(\sigma_{\Theta}) \in[0,1]&\forall \sigma_{\Theta} \in \Sigma_{\Theta}\end{align}

Stefan Kottwitz
Posts: 9445
Joined: Mon Mar 10, 2008 9:44 pm
Hi,

it's not completely clear what alignment do you mean. Perhaps post a screenshot where you shifted some elements to the desired position, with a simple graphics program, if it's hard to explain.

Note that align works with rl columns, which means one column is right aligned, the next one left aligned. More columns can be used, which works like rlrlrl. Sometimes it's good to align at several places. For this, use the alignat environment, described in the amsmath manual. This environment doesn't produce so much space between aligned columns.

For complicated constructions, which is not really aligning at relation symbols, perhaps use an {array} environment.

Stefan