I am using the align* environment to write equations expanding several lines. I would like to define a command sequence in the preamble, such that the last equation of this block will always be numbered (while the others remain unnumbered). For example, the block
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
x & =2+2\\
& =3+1\\
& =4
\end{align*}
\end{document}
will visually look like:
x = 2+2
= 3+1
= 4 (1)





amsmathis my bread and butter, it's almost as easy for me to open a new article in my editor of choice, paste that equation, and then manually write the missing\usepackage{amsmath}which I know goes there anyway. For anything moderately complicated, or using many/obscure packages, I'd agree; but I grasp simple problems like this one more quickly when it's a code snippet whose context is obvious, than a compilable document (as in my recent revision) in which 60% of the content is something which I would have known goes there anyhow. – Niel de Beaudrap Aug 11 '12 at 12:36