[Tex/LaTex] Equation number in aligned environment after last line

alignequationsnumbering

I'm using aligned inside align as follows


\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
x =&22+2 \nonumber\\
  =& \begin{aligned}[t]
    &5+3\\
    &-3+4\\
    &+15-0
  \end{aligned}
\end{align}
\end{document}

I want to have just one equation number after the very last line.
However, I'm getting the number at the beginning of the first split line (after the second = ),

and I cannot figure out how to move this equation number to the bottom. Any help will be appreciated.

Best Answer

You may want to use split, along with the tbtags option to amsmath.

\documentclass{article}
\usepackage[tbtags]{amsmath}

\begin{document}

\begin{equation}
\begin{split}
x ={} & 22+2 \\
  ={} &5+3\\
      &-3+4\\
      &+15-0
\end{split}
\end{equation}

\end{document}

enter image description here

If you want two numbers, then use split inside align: the alignment point will be inherited in the inner environment:

\documentclass{article}
\usepackage[tbtags]{amsmath}

\begin{document}

\begin{align}
x ={} & 22+2 \\
\begin{split}
  ={} & 5+3\\
      &-3+4\\
      &+15-0
\end{split}
\end{align}

\end{document}

enter image description here