TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I type in the code shown below for a displayed formula. However the output is not what it should be. Can you tell me what is the mistake over here?

$$ \frac{(1-a)\frac{$q_{f}$}{{$q_{n}$}^a}}{$p_{n}$} \cdot $q_{f}$ \cdot $\Delta p$ $$
share|improve this question
I removed the thanks (just the style here). Thanks is best expressed by upvoting helpful answers. – qubyte May 19 '12 at 12:28
up vote 8 down vote accepted

First of All, You can't nest $ in $$. Therefore your formula should be like

$$ \frac{(1-a)\frac{q_{f}}{{q_{n}}^a}}{p_{n}} \cdot q_{f} \cdot \Delta p $$
share|improve this answer
Great, thanks!! – Abhimanyu Arora May 19 '12 at 12:41

Building on Hassan Zakeri's answer, you have two potential problems. As Hassan says, you can't nest.

But it is also much better not to use $$ to start display maths. Here's a better solution:

\[ \frac{(1-a)\frac{q_{f}}{{q_{n}}^a}}{p_{n}} \cdot q_{f} \cdot \Delta p \]

For further explanation, please read this question and its answers: Why is [ … ] preferable to $$?

share|improve this answer

Your Answer


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.