LaTeX forum ⇒ Math & ScienceLinear 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

Postby GommaFleX » Fri Mar 30, 2012 9:43 am

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:
  1. \begin{align}
  2. \max_{\mathcal{V}_{\Theta}^{*},\delta}
  3. &\mathcal{V}_{\Theta}^{*}
  4. \notag \\
  5. \text{s.t.}
  6. &\mathcal{V}_{\Theta}^{*} \leq \mathcal{V}_{\Theta}(\delta,\sigma_{\Psi})
  7. &\forall \sigma_{\Psi} \in \Sigma_{\Psi} \\
  8. &\sum_{\sigma_{\Theta} \in \Sigma_{\Theta}}{\delta(\sigma_{\Theta})}=1\\
  9. &\delta(\sigma_{\Theta}) \in[0,1]
  10. &\forall \sigma_{\Theta} \in \Sigma_{\Theta}
  11. \end{align}


Can somebody help me, please?

User avatar
Stefan Kottwitz
Site Admin
Posts: 9444
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Fri Mar 30, 2012 5:35 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
Site admin

GommaFleX
Posts: 10
Joined: Tue Aug 16, 2011 12:19 pm

Postby GommaFleX » Sun Apr 01, 2012 9:08 am

Thank you, I resolved using "\begin{aligned}". The strange thing was that sometimes it aligned columns on left and other times on the right. But surfing the web I found that even columns are aligned to left and odd columns to right.


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 3 guests