I want to align some equations to the equal signs, so I wrote this:
\begin{align}
-3z &=-9\\
z &= 3\\
-3y-3*3 &= 3\\
y &=-4\\
2x+8*(-4)+4*3 &= 2\\
x &=11
\end{align}
However, because one equation is much longer than the others, all the equations appear somewhat at the right of the page:
How can I make the equal signs appear in the middle while still aligning all the equations to them?
Best Answer
A simple approach would be to duplicate the contents of the widest entry (either left or right) on the opposite side, accommodating for some overlap:
Alternatively, if you're not concerned about numbering the equations, then you can use the following construction:
This constructs an
align*
in the form of anarray
and places the contents on either side of the equal sign in a zero-width box. Consequently, then equations seem centred based on=
.Note that
\rlap
and\llap
uses\makebox
, which inserts its contents in text mode. Hence the switch back to math mode via$
in the automated construction of theL
andR
column types.