Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

How can I go about this?

\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}
share|improve this question
    
has this question really not been asked before? –  Vivi Oct 8 '12 at 1:31

2 Answers 2

up vote 6 down vote accepted

You can use display math environment such as equation:

enter image description here

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.

References:

Code:

\documentclass{article} 

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

\begin{document}

\begin{equation}
\ddot{\underline{\mathbf{r}}} = \frac{\dd{}{^2}\underline{\mathbf{r}}}{\dd{t}^2} = 0
\end{equation}
\end{document}
share|improve this answer
1  
I think we don't need the trailing s in Voss's. –  stalking is prohibited Oct 8 '12 at 2:02
    
@ガベージコレクタ: Have corrected that. –  Peter Grill Oct 8 '12 at 3:15
1  
“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}

enter image description here

share|improve this answer
    
That is not working for me.EDIT sorry I didn't notice those \\ after the equation. –  Magpie Oct 8 '12 at 0:23
1  
@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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.