3

I have an align environment inside of which I use a split environment to split the second long equation:

enter image description here

I would like to ask how to push + h and + k to the right such that their right ends are the same as that of f+g. In this particular case, g, h and k are aligned vertically. Thank you so much for your elaboration!

\documentclass{article}
\usepackage{amssymb,amsthm,amsmath}

\begin{document}

\begin{align}
a &= b+c-d \\
\begin{split}
e &= f + g \\
& +h \\
& +k
\end{split} \\
l &= m.
\end{align}

\end{document}

1 Answer 1

4

split is by far the most complicated AMS alignment, it is designed to do exactly what you show: carrying the alignment from an outer alignment into an inner one. Here you just want to wrap the right hand side, so you want one of the ...ed environments.

I'd use multlined even though that uses left, then centered then right rather than left then right alignment. But you could use aligned

enter image description here

\documentclass{article}
\usepackage{amssymb,amsthm,mathtools}

\begin{document}

\begin{align}
a &= b+c-d \\
\begin{split}
e &= f + g \\
& +h \\
& +k
\end{split} \\
l &= m.
\end{align}

\bigskip


\begin{align}
a &= b+c-d \\
e &\begin{multlined}[t]
= f + g \\
 +h \\
 +k
\end{multlined} \\
l &= m.
\end{align}


\bigskip


\begin{align}
a &= b+c-d \\
e &=\begin{aligned}[t]
f + g \\
{} +h \\
{} +k
\end{aligned} \\
l &= m.
\end{align}


\bigskip


\begin{alignat}{-1}
a &= b+c-d \\
e &= f + g \nonumber\\
&&{} +h \\
&&{} +k\nonumber\\
l &= m.
\end{alignat}

\end{document}
5
  • For the non-initiated: \begin{alignat}{-1} is basically the same as \begin{align} but without intercolumn space. (Is that documented somewhere?)
    – campa
    Apr 19 at 9:21
  • @campa for people too lazy to count how many columns are needed for the better documented positive number:-) Apr 19 at 9:24
  • Could you add the code using multlined?
    – Analyst
    Apr 19 at 9:42
  • @Analyst it's there (the second one) Apr 19 at 9:50
  • Thank you so much for your help!
    – Analyst
    Apr 19 at 9:56

You must log in to answer this question.

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