[Tex/LaTex] Aligned multline

alignamsmathmultline

I want to show the derivation of a formula where I encounter long formulae. Unfortunately the derivation is very complex, so I have to show some intermediate steps.

My problem is, that I want to mix the behaviour of multline with align. The first line should be aligned left and the whole rest should be aligned right with respect to the longest line. This block should be aligned at the =.

At the moment, I use the align environment. But in this case, the first line is still aligned left to the $ of the other lines.

Important note: I don't like magic numbers. So I prefer solutions which are completely automatic.


My approach so far:

\documentclass{scrartcl}
% Kodierung
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
% Sprache (neue deutsche Rechtschreibung)
\usepackage[ngerman]{babel}
% Mathematik
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}
    \begin{align}
        (a+b+c+d+e+f) \\ % aligned left
        % the following block should be aligned right
        &= a+b+c+d+e+f+g+h+i+j+k+l+m+n\\
    \begin{split}
        &= a+b+c+d+e+f+g+h+i+j+k+l+m+n \\
        & \quad +o+p+q+r+s+t+u+v+w+x+y+z+1+2+3+4
    \end{split}\\
        &= a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p
    \end{align}
\end{document}

Best Answer

Here is what I would do (require mathtools package)

\begin{align}
   \MoveEqLeft[3]  (a+b+c+d+e+f) \\ 
    ={}& a+b+c+d+e+f+g+h+i+j+k+l+m+n\\
\begin{split}
    ={}& a+b+c+d+e+f+g+h+i+j+k+l+m+n \\
    &  +o+p+q+r+s+t+u+v+w+x+y+z+1+2+3+4
\end{split}\\
    ={}& a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p
\end{align}

I would not want to start using multline effects in it, ends up looking strange. The above sort of follows the guides set out by the AMS.

enter image description here