[Tex/LaTex] How to obtain multline-type alignment within a group of equations

equationshorizontal alignmentmultline

I want to achieve something like the following (for now achieved using Microsoft Paint):

alt text

That is, I want to group a number of multi-line equations within a single equation-type environment (i.e. they have the same number) and have each one aligned like in the "multline"-environment (first line left-aligned, last line right-aligned). Is this possible?

Best Answer

The \shoveleft and \shoveright commands allow to flush left or right the equations of a multline environment.

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}
\begin{document}
    \lipsum[1]
    \begin{multline}
      a_1 + b_1 + c_1 + d_1 + e_1 + f_1\\ 
      \shoveright{g_1 + h_1 + i_1 + j_1 + k_1 + l_1}\\
        \shoveleft{a_2 + b_2 + c_2 + d_2 + e_2 + f_2}\\ 
      g_2 + h_2 + i_2 + j_2 + k_2 + l_2
    \end{multline}
    \lipsum[2]  
\end{document}

enter image description here

Addendum

As pointed out by @barbara beeton, the position of the equation number is ambiguous. This can be solved by using the subsidiary environment multlined provided by mathtools inside an equation (first proposed by @egreg). This approach also benefits from the improved spacing of the equation environment.

enter image description here

\usepackage{mathtools}

\begin{equation}
\begin{multlined}[.7\textwidth]
    a_1 + b_1 + c_1 + d_1 + e_1 + f_1\\ 
    \shoveright{g_1 + h_1 + i_1 + j_1 + k_1 + l_1}\\
    \shoveleft{a_2 + b_2 + c_2 + d_2 + e_2 + f_2}\\ 
    g_2 + h_2 + i_2 + j_2 + k_2 + l_2
\end{multlined}
\end{equation}