1

The following will produce 3 lines numbered (1), (2) and (3) on the right:

\begin{align}
x = 1\\
y = 1\\ 
z = x + y    
\end{align}

while using \begin{align*} ... \end{align*} will produce the same lines without numbers.

What if I want to produce the same three lines but with only the last one numbered, or only the first and second lines numbered, etc ?

Mico
  • 506,678
rims
  • 113

1 Answers1

4

Taken from this and this and knowing about \notag from amsmath you can have:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\newcommand*\tageq{\refstepcounter{equation}\tag{\theequation}}
\begin{document}
\begin{align}
x = 1\\ 
y = 1\\ 
z = x + y   \notag 
\end{align}
\begin{align*}
x = 1\\ 
y = 1\\  \tageq
z = x + y   
\end{align*}
\end{document}
oliversm
  • 2,717