I would like to get a nonstandard alignment in the following code:
\begin{align}
\text{First left hand side} & = \text{First right hand side} \\
\text{Second left hand side} & = \text{Second right hand side} \\
& = \text{Loooooooooooooooooooooooooooooooong expanded right hand side}
\end{align}
where the last line should not be aligned with the first two lines. I know that I could split the last line to form multiple right hand sides, but I would rather avoid it, as it would fill four equations in my case.
I found an evil way of doing it by nesting align and gather:
\begin{gather}
\begin{align}
\text{First left hand side} & = \text{First right hand side} \\ %% \label{} does not work here
\text{Second left hand side} & = \text{Second right hand side}
\end{align}\\
= \text{Loooooooooooooooooooooooooooooooong expanded right hand side} \label{eq3}
\end{gather}
but alas, while this gives the visual output I want, I can not use labels to refer to the equations within the align.
I also don't want to place &
somewhere in the middle of the third line due to spacing issues, and because it is a fragile way of doing that.
So how can I type that
- the first and second line align at
=
- the third line is not aligned ot the first two lines (preferably flushed right)
- all three lines are numbered, and can be referenced
- all three lines are in one equation group (for the semantics and the spacing)?
Best Answer
A bit of a low-level trick:
The above left aligns the last line. If you want the last line to be flush right, use (note order of the expression and
\omit\span
has changed)which gives