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

share|improve this question
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 Jun 21 '12 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 Jun 21 '12 at 18:18
add comment

2 Answers 2

up vote 4 down vote accepted

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.

share|improve this answer
add comment

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.

share|improve this answer
3  
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
add comment

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.