I'd like to have multiple lines inside a single align cell like so:
\begin{alignat*}{1}
= & \begin{split}x+\\
y\end{split}
\end{alignat*}
But I get an error like:
\end{alignat*}
\An extra & here is so disastrous that you should probably exit
and fix things up.
What's the correct way to achieve this?
Best Answer
I don't know what you are trying to achieve. Your error message can be bypassed if you either increase the number of reference points in the
alignat
or if you use
aligned
instead ofsplit
With
split
, it tries to anchor its&
to line up with the ones outside (so multiplesplit
s inside oneequation
will line up). So implicitly you need one extra reference point if you usesplit
insidealignat
, which is just a glorified array. (I'm doing a horrible job explaining this, am I not?)aligned
doesn't try to do that (twoaligned
blocks inside oneequation
won't line up), and so you can get by with just one reference point.In anycase, either of this sets the broken expression
x+y
as one unit to the right, vertically centered, against the=
sign, which I suspect may not be what you want. If you want the=
to line up with thex+
and with they
in a line below, you should take Lev's suggestion.