1

I'm using multlined (from mathtools) inside align to show a chain of equivalences between expressions, some of which may not fit in a line. I would like to align the equation numbering at the bottom (or centre) of the lines that are part of the same expression. Edited: Because I have other multline elsewhere, for consistency, I would like the broken lines to be aligned as if they were standalone multline equations, i.e. first line left, middle lines centre, last line right.

While an answer to Multlined in align enviromnent: alignment of = and equation numbering provides a solution for the lines after the first one, that solution does not work for the first line because the RHS of the first equality is misaligned.

mwe

\documentclass{article}
\usepackage[width=7.00cm, height=17.00cm]{geometry}
\usepackage{amsmath,mathtools}

\begin{document}

    \begin{align}
        y &  \begin{multlined}[b]
        = a+b+{} \\
        c+d+{} \\
        e+f+g+h+i+j+k+l
        \end{multlined} \\
        &= a+b+c
    \end{align}

\end{document}

The only solution that I found involves the use of phantom and is a bit hacky. I wonder if a better solution (Edited: which does not require phantoms or manual spacing) exists.

  • Why not use \begin{multlined}[t] instead of c? – Aditya Aug 27 '17 at 23:07
  • @Aditya That would also move the equation number to the top, while I would like it to be centred. – Luca Citi Aug 28 '17 at 9:29
  • from the appearance of the example, it's not really clear what you would want the expression to look like if the last line was quite a bit longer than either the first or middle lines. if you would make that clear, i'll try to come up with something that works there. also, i thin you mentioned in a comment that you preferred that the positioning would be automatic, and not require either manual spacing or phantoms. that is best also mentioned in the question. – barbara beeton Aug 28 '17 at 12:15
  • 1
    You can put the tag on any line by using the command \taghere from John Kormylo's answer to my question here: tex.stackexchange.com/a/299988/100861 (and if you don't want the tag to be exactly on a line, then you can move it up or down using the optional argument of that command.) – wea0 Aug 29 '17 at 23:47
  • @wea0 Thanks for linking to that question, it has a lot of useful information. – Luca Citi Aug 30 '17 at 12:39
4

try this, using \split within the align:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

    \begin{align}
      \begin{split}
        y &= a+b+{} \\
          &\qquad c+d+e
      \end{split} \\
        &= a+b+c
    \end{align}

\end{document}

output of example code

  • 1
    @DavidCarlisle -- very gracious, sir! – barbara beeton Aug 27 '17 at 20:33
  • @barbarabeeton Thanks for posting this solution. This was my first attempt but it requires manual alignment of the lines. I wanted the broken lines to be aligned as if they were standalone multline equations, i.e. first line left, middle lines centre, last line right. – Luca Citi Aug 27 '17 at 21:08
  • @LucaCiti - The example code you provided only mentioned two lines in the multlined environment. It would have been helpful if you'd mentioned up front that the environment might contain 3 or more lines. – Mico Aug 28 '17 at 5:31
  • @Mico Good, point. I have edited the question as you suggest. – Luca Citi Aug 28 '17 at 9:18
0

My solution involves changing the alignment point of align to the beginning of the line (rather than at the equal sign) and then using a phantom to add an empty space corresponding to the RHS to all the subsequent lines.

\documentclass{article}
\usepackage[width=7.00cm, height=11.00cm]{geometry}
\usepackage{amsmath,mathtools}

\begin{document}

    \begin{align}
        &\begin{multlined}[b]
        y = a+b+{} \\
        \phantom{y=}c+d+{}\\
        \phantom{y=}e+f+g+h+i+j+k+l
        \end{multlined} \\
        &\phantom{y} = a+b+c
    \end{align}

\end{document}

This gives the desired behaviour (Eqs 1 and 2 in the question).

As I try to use phantoms as last resort, I wonder if someone can come up with a better solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.