# emacs/LaTeX error for first time LaTeX user

I am using LaTeX with Emacs for the first time. I am getting the following error message:

! Missing $inserted  This is the code I put in: center$Q(t) = Pi a^2 \sqrt{2gh}  ] What am I doing wrong? ## 2 Answers As far as I understand, you would like to achieve something like the following: \[ Q(t) = \Pi a^2 \sqrt{2gh}$  I replaced the $$in your code with $ and $ respectively. Please see e.g. this thread for some detailed explanations on why the use of $ and $ is preferable to $$ in LaTeX. • However, I do agree with @jjlin that tex.stackexchange.com would be a better place for your question. Mar 3, 2016 at 8:20 It's only a single '$' at each side. Although if you're trying to center the equation anyway, your best bet would be to use

\begin{equation*}
Q(t) = \Pi a^2 \sqrt{2gh}
\end{equation*}


This will center it on its own line, and the * simply says not to number the equation.