# Problem with equation format when starting equation with \dot and \ddot

I am having problems with equation formatting inside the equation environment when the equations begin with \dot or \ddot

When I write:

$$\ddot{\theta} + \frac{g}{l}\sin(\theta) = 0$$


The theta with the dots in the equation does not appear, the formula begins at the left margin and the number appears on the line below.

I am using the book document class with the ams packages and the spanish babel package as well. I am using pdflatex to compile via Texmaker.

-
The equation looks fine on my computer. If you create a MWE it will make it easier for people to figure out what's gone wrong. –  DJP Jun 21 '12 at 18:18
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. I've added one in my "preliminary answer". –  egreg Jun 21 '12 at 18:18

A blank line in a display math environment is always disallowed and certainly produces error messages and, possibly, wrong output.

If you prefer to have space in the input, type

$$% \ddot{\theta} + {\dfrac{g}{l}}\sin(\theta) = 0 %$$


but never leave a blank line there.

-

I've managed to locate the problem, It happens when I leave a blank line between the begin equation command and the actual equation:

\documentclass[12pt,a4paper,twoside,openright,titlepage]{book}
\usepackage{amsmath}

\begin{document}
$$\ddot{\theta} + {\dfrac{g}{l}}\sin(\theta) = 0$$

\end{document}


It happens whether I'm using the book or article document class. It might have to do with the amsmath package but that's not the whole problem.

Since when I use \frac instead of \dfrac and do not include the amsmath package the character with the \ddot does appear but the equation is not centered and the number of the equation is not right aligned.

When using the article document class, the error is slightly different, the equation does not appear centered but the number of the equation appears on the same line yet without any spaces after the end of the equation.

In summary: Do not leave a blank line after beginning the equation environment whether you are using \frac or \dfrac.

-
A blank line in a display environment is always prohibited. You get also an error message, not only incorrect output. –  egreg Jun 23 '12 at 18:08
Yes, I've stopped getting some error messages that have had me wondering for a long time –  mr.ae Jun 23 '12 at 19:03