In LaTeX align, I'm struggling to align polynomial terms and assume there's an easy way to do it. But I cannot find the simple/elegant solution. What I would like is something like this:
x1 + x2 ______ = 3
x1_______+ x3 = 4
etc with more lines and variables (the underlines are just for space/alignment). Any help appreciated.
UPDATE Here is the solution I found:
\begin{alignat*}{7}
8x_1 &{}+ 4x_2 &{}+ y_1 & & & &= 160 \\
4x_1 &{}+ 6x_2 & &{}+ y_2 & & &= 120 \\
x_1 & & & &{}+ y_3 & &= 34 \\
\phantom{{}+{}x_1}&{}+x_2&& & &{}+ y_4 &= 14 \\
x_1\geq0&x_2\geq0&y_1\geq0&y_2\geq0&y_3\geq0& y_4\geq0
\end{alignat*}
with result:




