# How do you make numbered equations in latex?

I would like to put in a code that automatically assigns a number to the equations in my documents preferably aligned on the right hand side.

\documentclass[a4paper,11pt]{article}
%\documentclass[a4paper,11pt]{scrartcl}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}

\begin{document}

$$\ddot{\underline{\mathbf{r}}} = \frac{d{^2}\underline{\mathbf{r}}}{dt^2}= 0$$.
\end{document}

-
has this question really not been asked before? –  Vivi Oct 8 '12 at 1:31

You can use display math environment such as equation:

# Notes:

• The d in dt should be upright as d is an operator, not a variable. Have defined a macro for that and corrected it below.

## Code:

\documentclass{article}

\newcommand{\dd}[1]{\mathrm{d}#1}

\begin{document}

$$\ddot{\underline{\mathbf{r}}} = \frac{\dd{}{^2}\underline{\mathbf{r}}}{\dd{t}^2} = 0$$
\end{document}

-
I think we don't need the trailing s in Voss's. –  I am who I say I am Oct 8 '12 at 2:02
@ガベージコレクタ: Have corrected that. –  Peter Grill Oct 8 '12 at 3:15
“See Why is $...$ prefereable to $$”; yeah, especially Harrold's and Hendrik's comments to the accepted answer. – morbusg Oct 8 '12 at 3:18 @morbusg: Thanks for pointing those comments out. Perhaps those should be added as an answer so that thy are not missed. But, then David Carlisle's answer about $$ not easily being re-definable might be a better reason. –  Peter Grill Oct 8 '12 at 3:22

You can also use the align environment:

\documentclass[a4paper,11pt]{article}
%\documentclass[a4paper,11pt]{scrartcl}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}

\begin{document}
%Equations with numbering
\begin{align}
\ddot{\underline{\mathbf{r}}} &= \frac{d{^2}\underline{\mathbf{r}}}{dt^2}\\
&= 0
\end{align}

%Equations with no numbering in specific line by using \nonumber
\begin{align}
\ddot{\underline{\mathbf{r}}} &= \frac{d{^2}\underline{\mathbf{r}}}{dt^2}\nonumber\\
&= 0
\end{align}

%Equations without numbering
\begin{align*}
\ddot{\underline{\mathbf{r}}} &= \frac{d{^2}\underline{\mathbf{r}}}{dt^2}\\
&= 0
\end{align*}
\end{document}


-
That is not working for me.EDIT sorry I didn't notice those \\ after the equation. –  Magpie Oct 8 '12 at 0:23
@Magpie Is everything working fine now? –  azetina Oct 8 '12 at 0:29
Yes, I was just having a sloppy moment. Thanks for your help. I selected the other answer because it does what I want more precisely but I appreciate your solution too. –  Magpie Oct 8 '12 at 0:35