Math & ScienceLinear Programs Alignment

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

Linear Programs Alignment

Post by GommaFleX »

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:

Code: Select all

\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}
Can somebody help me, please?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10337
Joined: Mon Mar 10, 2008 9:44 pm

Linear Programs Alignment

Post by Stefan Kottwitz »

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
LaTeX.org admin
GommaFleX
Posts: 10
Joined: Tue Aug 16, 2011 12:19 pm

Re: Linear Programs Alignment

Post by GommaFleX »

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.
Post Reply