3

I would like to write a linear program as follows:

enter image description here

The text above and below is shown only to indicate the position of the system on the page.

I wrote

\documentclass[a4paper,11pt]{report}
\usepackage[italian]{babel}
\usepackage{amsmath}

\begin{document}

\begin{align}
& \text{max (o min)} & c_1 x_1 &+ \dots + c_n x_n \\
& \text{soggetto a} & a_{11} x_1 &+ \dots + a_{1n} x_n \sim b_1 \\
&& a_{m1} x_1 &+ \dots + a_{mn} x_n \sim b_m,
\end{align}

\end{document}

but I hadn't the same result. In particular to the space between words and system, and I do not know how to insert the dots vertical.

1 Answers1

4

Use \vdots for the vertical dots, and I'd recommend using an alignat to achieve the desired result:

enter image description here

You can also get the variables right aligned with a bit more work:

enter image description here

Notes:

Code:

\documentclass{report}
\usepackage{amsmath}

\begin{document} \begin{alignat}{5} & \text{max (o min) } &c_1 x_1 &{}+ \dotsb &&{}+ c_n x_n \ & \text{soggetto a } &a_{11} x_1 &{}+ \dotsb &&{}+ a_{1n} x_n &&{}\sim b_1 \\nonumber & & \vdots \ & & a_{m1} x_1 &{}+ \dots &&{}+ a_{mn} x_n &&{}\sim b_m \end{alignat} If you want the variables right aligned: \begin{alignat}{6} & \text{max (o min) } &c_1 x_1 &&{}+ \dotsb &&{}+{} &&c_n x_n \ & \text{soggetto a } &a_{11} x_1 &&{}+ \dotsb &&{}+{} &&a_{1n} x_n &{}\sim b_1 \\nonumber & && \vdots \ & & a_{m1} x_1 &&{}+ \dotsb &&{}+{} &&a_{mn} x_n &{}\sim b_m \end{alignat} \end{document}

Peter Grill
  • 223,288