## LaTeX forum ⇒ Math & Science ⇒ flalign

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
jonathan webley
Posts: 11
Joined: Sun May 03, 2009 8:28 am

### flalign

I have a couple of equations, with text that I want to align. However flalign works like a table with columns, with no overlap between columns.

I would like my output to look like, which fits easily on an A4 page:
lots of text from left margin  x = 1 lots of text to right margin
34x + y = 5x + y


This is what I have tried:
\documentclass{amsart}
\begin{document}
\begin{flalign*}
& \text{lots of text from left margin} & x &= 1  & \text{lots of text to right margin} \\
&& u + 2v + w + 34x + y + 4z &= 3u + v + 2w + 5x + y + 3z \\
\end{flalign*}
\end{document}


Stefan Kottwitz
Posts: 9679
Joined: Mon Mar 10, 2008 9:44 pm
Hi Jonathan,

that's intended ... but you can try overlapping with workarounds by \rlap and \llap for instance:
\begin{flalign*}
& \rlap{lots of text from left margin\ } & x &= 1  &
\llap{\ lots of text to right margin} \\
&& u + 2v + w + 34x + y + 4z &= 3u + v + 2w + 5x + y + 3z \\
\end{flalign*}

Stefan

yiorgosb
Posts: 30
Joined: Mon Aug 02, 2010 11:56 pm
I've tried the above suggested solution and worked like a charm!

However, when the text (that inside rlap{} )is two long it overlaps
the result is really a mesh. Both equation and number are overlapped by text. How could I force the text to break (preferred automatically or manually otherwise)

yiorgosb
Posts: 30
Joined: Mon Aug 02, 2010 11:56 pm
Stefan_K wrote:Hi Jonathan,

that's intended ... but you can try overlapping with workarounds by \rlap and \llap for instance:
\begin{flalign*}
& \rlap{lots of text from left margin\ } & x &= 1  &
\llap{\ lots of text to right margin} \\
&& u + 2v + w + 34x + y + 4z &= 3u + v + 2w + 5x + y + 3z \\
\end{flalign*}

Stefan

When the above code is used with {flalign} instead of {flalign*} the text inside \llap overlaps with the equation number. I found a fix that I would like to share.
Simply put a \: (or bigger space like \quad at the end of \llap
Then the above code would be
\begin{flalign}
& \rlap{lots of text from left margin\ } & x &= 1  &
\llap{\ lots of text to right margin} \: \\
&& u + 2v + w + 34x + y + 4z &= 3u + v + 2w + 5x + y + 3z \\
\end{flalign}