13

I'm using the multlined environment inside an align environment and want have the = aligned at the top and the equation numbering at the bottom. Is this possible?

Here my MWE:

\documentclass{article}
\usepackage{mathtools,amsmath}
\begin{document}
\begin{align}
y &= a+b+c \\
&= \begin{multlined}[t]
a+b+ \\
c
\end{multlined}
\end{align}
\begin{align}
y &= a+b+c \\
&= \begin{multlined}[b]
a+b+ \\
c
\end{multlined}
\end{align}
\end{document}

enter image description here

1 Answer 1

15

You have to place the = inside multlined; in order to get alignment, though, a \! is necessary (multlined does the same as aligned and gathered that add \, at their left border).

\documentclass{article}
\usepackage{amsmath,mathtools}

\begin{document}

\begin{align}
y &= a+b+c \\
  &  \!\begin{multlined}[b]
     = a+b+{} \\
          c
     \end{multlined}
\end{align}

\end{document}

enter image description here

9
  • thanks! also for the comment about the negative spacing. Can you explain to me why the {} is needed? And one off-topic question: is it more common to place the last operator in the first or in the second line? Meaning: a+b+\\c or a+b\\+c ?
    – bonanza
    May 27, 2014 at 7:04
  • 2
    @bonanza The {} is necessary to get correct spacing of +: a binary operator needs to have operands on both sides. You can compare with your output and see that b and + are next to each other without any space. Whether having the operand on the top or bottom line is a stylistic decision; in general I prefer to have it at the end of the top line, which makes clearer that the formula is not finished.
    – egreg
    May 27, 2014 at 7:49
  • 1
    for more information about the {} see Why is there a \, space at the beginning of the “aligned” environment? May 27, 2014 at 12:18
  • @egreg Is there an easy solution for the case when the first line (the one with $y$) spans two lines?
    – Luca Citi
    Aug 26, 2017 at 13:03
  • @LucaCiti Can't you do the same?
    – egreg
    Aug 27, 2017 at 8:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .