LaTeX forum ⇒ Math & Scienceflalign

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

Postby jonathan webley » Tue May 19, 2009 10:13 pm

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}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9679
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Tue May 19, 2009 10:46 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
LaTeX.org admin

yiorgosb
Posts: 30
Joined: Mon Aug 02, 2010 11:56 pm

Postby yiorgosb » Fri Feb 25, 2011 3:23 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

Postby yiorgosb » Sun Mar 13, 2011 2:34 am

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}


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 5 guests