# Aligned equation environment with number at bottom that allows for page breaking

I'm looking for a better way of using aligned equations in my documents that allows for pagebreaks and numbers only the bottom equation like this: Although, I would prefer to be able to have the same sort of numbering as with the aligned environment where you can specify where the number of the equation goes (e.g., \begin{aligned}[c] places the number of the equation at the center of the aligned environment). So far the only solution I've made use of is defining a command that numbers the equation,

    \newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}}


and using the align* environment as follows:

    \begin{align*}
&= -\frac{A}{r^2}\ud{}{r}\left(\frac{re^{-r/\lambda}}{\lambda}+e^{-r/\lambda}\right)\\
&= -\frac{A}{r^2}\left(\frac{e^{-r/\lambda}}{\lambda}-\frac{re^{-r/\lambda}}{\lambda^2}-\frac{e^{-r/\lambda}}{\lambda}\right)\\
&= \frac{Ae^{-r/\lambda}}{\lambda^2r}.
\numberthis
\end{align*}


I've tried looking all over the place and so far I haven't found something that does what I want without having to resort to inserting the number manually, which gets bothersome pretty quickly in a long document with a lot of aligned equations. I also tried defining a new environment called aligneq

    \newenvironment{aligneq}{\begin{align*}}{\numberthis\end{align*}}


which would give me a compile error. Is there already an existing environment that has these capabilities that I just haven't found yet?

• i think what you may be looking for is the [tbtags] option to amsmath that places the equation number at the last line if the equation numbers are on the right, or at the top line if the numbers are on the left. – barbara beeton Apr 1 '16 at 0:14
• Welcome to TeX.SX!! It is better to post a full minimal working example that starts with a \documentclass command, has a minimal preamble and then \begin{document}...\end{document}. Unless the problem is a compilation error, the code should compile and be as small as possible to demonstrate your problem. This makes it much easier for people to help you --- and much more likely that they will! – user30471 Apr 1 '16 at 4:13
• Also remember amsmath has \allowdisplaybreaks – Andrew Swann Apr 1 '16 at 7:44

I think it's clearer to use a numbered display and supress the numbers on lines where you don't want a number.

\documentclass{article}
\usepackage{amsmath}
\allowdisplaybreaks

\def\ud{u}

\def\nl{\notag\\}

\begin{document}

Zzzz

\vspace{35\baselineskip}

zzzzzzz
\begin{align}
&= -\frac{A}{r^2}\ud{}{r}\left(\frac{re^{-r/\lambda}}{\lambda}+e^{-r/\lambda}\right)\nl
&= -\frac{A}{r^2}\left(\frac{e^{-r/\lambda}}{\lambda}-\frac{re^{-r/\lambda}}{\lambda^2}-\frac{e^{-r/\lambda}}{\lambda}\right)\nl
&= \frac{Ae^{-r/\lambda}}{\lambda^2r}.
\end{align}

\end{document}