# break long equation into lines (combine {align} and {multline})

Is it possible to have aligned equations which one can split up if they are too long, but such that they are still aligned? I mean a single environment that combines align (equations remain aligned) and multline (if they are too long they may be split in a nice way)

If there is some math counterpart of the \hfill it will be great!

In the following the two vertical bars denote the default width of the math mode, and the minus signs denote empty space

|------------------------------------|

|aaa-=-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|

|---=-cccccccccccccccc-+-dddddddddddddddd


It must be somehow turned into

|------------------------------------|

|aaa-=-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|

|----=-cccccccccccccccc--------------|

|------------------+-dddddddddddddddd|


that is the second line when broken its other part must be

1. set in the third line but pushed to the right end and

2. that end is the farthest end of all lines (on the left) and

3. the equal signs are still aligned,

• The answer: Yes. It would be better if you give a concrete example of what you have and what you want to achieve. Otherwise the question is too generic.
– Werner
Commented Jan 22, 2021 at 20:04
• I guess split does what you want.
– Sam
Commented Jan 22, 2021 at 20:56
• @Werner I editied the post so I hope it is better now! Commented Jan 22, 2021 at 22:04
• This is essentially the same as tex.stackexchange.com/q/312487 using multlined. Commented Jan 22, 2021 at 23:14

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{align*}
aaa & = bbbbbbbb           \\
& = \begin{multlined}[t]
cccccccccccccccc    \\
+ dddddddddddddddd
\end{multlined}
\end{align*}
\end{document}


and one more example

\documentclass{article}
\usepackage{mathtools}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
\begin{align}
aaa & = bbbbbbbb           \\
& \begin{multlined}[b][0.35\linewidth]
= cccccccccccccccc    \\
+ dddddddddddddddd
\end{multlined}
\end{align}
\end{document}


(red lines show borders of text)

I think the first form, using a fixed indent such as \qquad is most common, but the second form, using multlined is closest to what you ask for.

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{align*}
aaa&=bbb\\
&=cccc\\
\end{align*}

with multlined
\begin{align*}
aaa&=bbb\\
&=\begin{multlined}[t]
ccc\\
{}+ ddd
\end{multlined}
\end{align*}
\end{document}


• @Physor as you see code in comments doesn't display well. every question really should have a complete test document as in this answer that shows the problem, but I'll add your code and see what it does..... Commented Jan 22, 2021 at 22:22
• @Physor impossible to say anything about that it has undefined commands and so produces no output. Please edit your question to add a usable test and I'll have a look. Commented Jan 22, 2021 at 22:24
• I'm sorry it depends on other commands that are defined by me, so it want work if you try it Commented Jan 22, 2021 at 22:24
• I'll edit my question later and I let you know, thanks a lot! and I'm sorry for any trouble Commented Jan 22, 2021 at 22:25
• @Physor I can't run it but I would guess V_\tx{eff}^{ll'} is in error and should be V_{\tx{eff}^{ll'}} Commented Jan 22, 2021 at 22:38