When stating LP problems I usually use something along the following
\begin{tabular}{ l c p{1pt} c }
max & \multicolumn{3}{l}{$300x + 100y$} \\
s.t. & $6x + 3y$ & $\leq$ & $40$\\
& $x - 3y$ & $\leq$ & $0$ \\
& $x + \frac{1}{4}y$ & $\leq$ & $4$ \\
\end{tabular}
But this forces the use of inline math, and require me to adjust column width manually (and it's still not perfect since the spacing between the right hand side and left hand side of \leq
is wrong).
What I really would like was a solution that allowed for display math, with correct spacing and no need for manual formatting with p{}
.
How would I write a version that fixes this?
array
environment would probably suffice here (see the first answer on this question; I don’t have time for a full answer right now).