[texhax] Aligning a Linear Program

Steve Schwartz s.schwartz at imperial.ac.uk
Tue Jan 2 16:19:44 CET 2007


Zac,

On Tue, 2007-01-02 at 21:12 +0800, Zachary Leung wrote:
> Dear all,
> 
> How do I align a linear program as in
> http://deutsixfive.googlepages.com/linear-program.jpg ? I've been
> using LaTeX for three years, but haven't figured this out yet. 

Hmm. I'd have thoought either a simple eqnarray or using the array
package would do what you want, unless I'm missing the point. See the
appended code.

Happy 2007.

Steve

--------

\documentclass{article}
\usepackage{array}
\begin{document}

Hello.

\begin{eqnarray*}
\textrm{Maximise}\quad    c^T x &   &    \\
\textrm{subject to}\quad  Ax    & =& b   \\
                     x     & \geq &0
\end{eqnarray*}

or in an array environment

\[
	\begin{array}{lrcl}
	\textrm{Maximise}   & c^T x &      &   \\
	\textrm{subject to} & Ax    & =    & b \\
			    & x     & \geq & 0
	\end{array}
\]

\end{document}

> 

-- 
+-------------------------------------------------------------------+
Professor Steven J Schwartz      Phone: +44-(0)20-7594-7660
Space and Atmospheric Physics    Fax:   +44-(0)20-7594-7772
The Blackett Laboratory          E-mail: s.schwartz at imperial.ac.uk
Imperial College London          Office: Huxley 6M70 
London SW7 2BW, U.K.             Web: http://www.sp.ph.ic.ac.uk/~sjs
+-------------------------------------------------------------------+



More information about the texhax mailing list