# Alignment of formular after linebreak in amsmath (flalign)

I am trying to achieve something like this:

in amsmath. The best I could come up with so far is the following MWE:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{flalign*}
\text{This is the first part } & \\ \text{of a longer text } & = \text{ } \dfrac{\text{One rather long Thing}}{\text{Other Thing}} &
\end{flalign*}

\end{document}


This however does produce only the following:

I am using flalign for a reason not shown in the MWE. The line break has to be there because otherwise the formula would not fit on one line.

• Avoid using flalign, in particular for single equations; for multiline displays, use align, unless flalign is really needed (which is rare). May 14 '15 at 21:29

This is the stackengine (by our fellow user Steven B. Segletes) version of linebreaking

There are some macros, but for this purpose, \Centerstack seems to be quite useful. The optional argument contains the alignment character, r is used for right justified stacking. There is a \Vectorstack command for math content too. The vertical spacing between the stacked items can be set with the \setstackgap{L}{gap height} command.

Please change the gap value to the actual needs. I've given a reasonable and a completely exaggerated example ;-)

\documentclass{article}
\usepackage{amsmath}
\usepackage{stackengine}

\begin{document}

\begin{flalign*}
\setstackgap{L}{10pt}
\Centerstack[r]{{\text{This is the first part}} {\text{of a longer text}}} & = \text{ } \dfrac{\text{One rather long Thing}}{\text{Other Thing}} &
\end{flalign*}

Exaggerated gap
\begin{flalign*}
\setstackgap{L}{50pt}
\Vectorstack[r]{{\text{This is the first part}} {\text{of a longer text}}} & = \text{ } \dfrac{\text{One rather long Thing}}{\text{Other Thing}} &
\end{flalign*}

\end{document}


• Thank you. Do you know if there is an easy way to adjust the spacing between "This is the first part" and "of a longer text"? May 14 '15 at 21:12
• @Thomas: See the update please
– user31729
May 14 '15 at 21:22

You can enclose it in a \parbox.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{flalign*}
\text{\parbox{3cm}{This is the first part of a longer text}} = \dfrac{\text{One rather long Thing}}{\text{Other Thing}} \\
\end{flalign*}

\end{document}

• although it's somewhat implied that the text should be flush left on the page, it's not explicitly required. if flush left isn't required, this could as well be put between $...$ as an unnumbered equation. May 14 '15 at 21:28

Just use a tabular:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
\begin{tabular}{@{}r@{}}
This is the first part\\
of a longer text
\end{tabular} =
\dfrac{\text{One rather long Thing}}{\text{Other Thing}}
\end{equation*}

\end{document}