I frequently use the aligned math environment in LyX to typeset my equations. However, if I want to save space on the page and set two equations simultaneously in the same aligned math environment, the second equation fails to "stay" straight (see image below).
What do I need to do in order to set the equalities in the right equation in a straight line, like the ones in the left equation?
I've tried the following: using other math environments, inserting blank spaces, adding more columns.
Best Answer
This is precisely what the
alignat
andalignat*
environments are designed for: they allow you to vertically align multiple columns. (Just as withalign
andalign*
,alignat
numbers each equation andalignat*
doesn't number them.)To align n columns, place them in
\begin{alignat*}{n}
...\end{alignat*}
, and align each column with an&
as usual. However, you also need an&
to separate each column (as in an array or table), and in the first row, you should insert any extra space you need before this separator.Here's the LaTeX code I have:
And here's the result.