19

The multline environment does exactly what I want in splitting a long formula between lines by utilizing the horizontal space to the fullest. (I don't want the alignment features of the align environment.)

The problem is, I want to vertically center the equation number, as opposed to making it appear on the second line (as it does by default).

How do I do this?

lockstep
  • 250,273
meh
  • 599
  • I thought that maybe \raisetag could help, but it doesn't have any effect if the tag was not shifted from it's natural position... – Jellby Jun 26 '12 at 08:06

3 Answers3

17

What you want is the multlined environment provided by mathtools:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{equation}
\begin{multlined}
a+b+c+d+e+f+{}\\
g+h+i+j
\end{multlined}
\end{equation}

\end{document}

enter image description here

David Carlisle
  • 757,742
egreg
  • 1,121,712
  • Is there some update to have this output without mathtools, not necessarily aligning something? – Sigur Jan 15 '18 at 15:44
  • 1
    @Sigur multlined is only available with mathtools. – egreg Jan 15 '18 at 16:37
  • multlined doesn't use all the horizontal space as multline does. there is some alternative more similar to multline? – carlo Jan 30 '20 at 11:05
4

Try to use this:

\begin{equation}\label{xx}
\begin{split}
 a&= b+c-d\\
  & \quad +e-f\\
  &= g+h\\
  &= i
\end{split}
\end{equation}`
David Carlisle
  • 757,742
Sigur
  • 37,330
2

This answer is really just an addendum to/augmentation of the answer provided by @Thiago on the use of a split environment within an equation environment to get the vertical centering of the equation number.

  • Normally, one uses the split environment to align successive lines on a single common point -- frequently, not necessarily, an = sign.

  • However, by leaving off the align symbol, &, entirely from two (or more) consecutive lines, the resulting lines will simply be centered, one line after the other.

  • Other alignment possibilities exist too. For example, the following code,

    \begin{equation} \begin{split}
    a+b+c+{}&d=\\
    &e+f+g+h
    \end{split} \end{equation}
    

    serves to have the e of the second line be placed exactly below the d of the first line.

David Carlisle
  • 757,742
Mico
  • 506,678