2

The multline environment is great for long equations. For example,

\begin{multline}
First line of my long equation \\
second line of my long equation
\end{multline}

produces output in which the second equation is right-aligned:

First line of my long equation
      second line of my long equation

I would like to reproduce the same behaviour inside an align environment to align equalities but also right-align some lines. I.e. the output should look like

    A = first line of A
                     second line of A
other = first line of other
                 second line of other
  • i don't have an answer, but a related question. if these equations are numbered, where would you like the number to be placed if it's at the right -- on the last line of each equation, or centered between the lines? – barbara beeton May 10 '16 at 14:56
  • Ideally, centred for each set that belongs together but I am also happy to add the equation number to the last line. – Till Hoffmann May 10 '16 at 19:09
4

the multlined facility of mathtools can be used here:

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align}
 A &= \begin{multlined}[t]
     \text{first line of A}\\
     \text{second line of A}
     \end{multlined}\\
 \text{other} &= \begin{multlined}[t]
     \text{first line of other}\\
     \text{second line of other}
     \end{multlined}
\end{align}
\end{document}

it's necessary to specify top-alignment with the optional [t] so that the lines of the multlined expression aren't vertically centered on the left-hand side. unfortunately, this has the effect of putting the equation number on the first line; i don't have a workaround for that.

output of example code

|improve this answer|||||

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.