I'm trying to typeset linear programs:
\usepackage{amsmath,amsthm,amssymb}
\usepackage{array}
\begin{document}
\begin{align*}
\text{maximize}\quad 3x + 2y &+ 3x + 2y \\
\text{subject to}\quad 2x + y &\leq 18 \\
2x + 3y &\leq 42 \qquad\forall x\\
3x + y &\leq 2 \qquad\forall y\\
x, y &\geq 0
\end{align*}
\begin{center}
\begin{tabular}{r>{\(\displaystyle}r<{\)}@{\(\;\)}>{\(\displaystyle}c<{\)}@{\(\;\)}>{\(\displaystyle}l<{\)}>{\(\displaystyle}l<{\)}}
maximize &\multicolumn{4}{>{\(\displaystyle}l<{\)}}{3x + 2y + 3x + 2y}\\
subject to& 2x + y & \leq & 18 \\
& 2x + 3y & \leq & 42 & \forall x\\
& 3x + y & \leq & 2 & \forall y\\
& x, y & \geq & 0 \\
\end{tabular}
\end{center}
\end{document}
tabular is easier to get aligned properly, but as you can see, it's more compact than align.
I'd like to get the same vertical spacing (or interline) as in display math for tables.
I've found the \arraystretch property, but I don't know what value I need to put.



alignat*solution (see @Bernard) is much more elegant. Your document, your choice! :) – Sam OT Jun 07 '19 at 10:32optidefpackage that I didn't know, and that I will probably use ;) – mrBen Jun 07 '19 at 12:37