4

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

When I write:

\begin{equation}

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

\end{equation}

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.

2
  • 1
    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
    Commented Jun 21, 2012 at 18:18
  • 3
    Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. I've added one in my "preliminary answer".
    – egreg
    Commented Jun 21, 2012 at 18:18

2 Answers 2

4

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

\begin{equation}
%
\ddot{\theta} + {\dfrac{g}{l}}\sin(\theta) = 0 
%
\end{equation}

but never leave a blank line there.

2

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}
\begin{equation}

\ddot{\theta} + {\dfrac{g}{l}}\sin(\theta) = 0 
\end{equation}

\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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .