# Linear Programming in LaTeX

Currently I am doing a project in Linear Programming. In connection with this I want to explain some theory (very short) but I am having a hard time making the expression below. Can anyone help me doing this.

• I see no reason for aligning the terms in the objective function with the terms in the conditions. – egreg Feb 27 '17 at 14:25

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

\begin{equation*}
\begin{array}{lr@{}c@{}r@{}l}
\text{maximize }   & c_1 x_1   & {}+{\dots}+{} & c_n x_n   &           \\
\text{subject to } & a_{11}x_1 & {}+{\dots}+{} & a_{1n}x_n & {}\le b_1 \\
&           &     \vdots    &           &           \\
& a_{m1}x_1 & {}+{\dots}+{} & a_{mn}x_n & {}\le b_m
\end{array}
\end{equation*}

\end{document}


• Thats great! How can I make the \vdots right under the \cdots? – Alim Teacher Feb 27 '17 at 14:13
• @AlimTeacher : Please see my edit. – AboAmmar Feb 27 '17 at 15:29

To get you started...

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{aligned} \text{maximize } \quad & c_1 x_1 + \dots + c_n x_n \\ \text{subject to }\quad & \begin{array}{c} a_{11} x_1 + \dots + a_{1n} x_n \leq b_1 \\ \vdots \\ a_{m1} x_1 + \dots + a_{mn} x_n \leq b_m \end{array} \end{aligned}

\end{document}