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?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityI 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?
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.
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.