# \sum not coming out right

I am trying to write this:

Using

$$p_{\Theta | X} = \frac{p_{\Theta}(\theta) p_{X|\Theta}(x\,|\,\theta)}{\sum_{\theta ‘} p_{\Theta}(\theta ‘) p_{X|\Theta}(x\,|\,\theta ‘)}$$


However, what I get is this instead:

The theta prime of the summation does not come out right. Please help.

• note you should not use $$ in latex, and it is not a case of wrong or right, the subscript position is quote standard layout in compressed contexts like inline math or fractions. Commented Jan 14, 2020 at 7:54 ## 1 Answer Must use \limits after \sum $$p_{\Theta | X} = \frac{p_{\Theta}(\theta) p_{X|\Theta}(x\,|\,\theta)}{\sum\limits_{\theta '} p_{\Theta}(\theta ') p_{X|\Theta}(x\,|\,\theta ')}$$ • Thank you! How come it still came out right with out limit when it is not inside a fraction? Commented Jan 14, 2020 at 3:50 • $$p_{\Theta | X} = \frac{p_{\Theta}(\theta) p_{X|\Theta}(x\,|\,\theta)}{\displaystyle\sum_{\theta '} p_{\Theta}(\theta ') p_{X|\Theta}(x\,|\,\theta ')} Use \displaystyle inside the \frac Commented Jan 14, 2020 at 3:53
• The \frac command, which is in the basic command set of LATEX, takes two arguments—numerator and denominator—and typesets them in normal fraction form. The amsmath package provides also \dfrac and \tfrac as convenient abbreviations for {\displaystyle\frac ... } and {\textstyle\frac ... }. Commented Jan 14, 2020 at 4:20
• That's "\limits", not "\limit". Commented Jan 14, 2020 at 19:37
• Peraphs, for my humble opinion, it is better \mid instead of |. Commented Jan 14, 2020 at 22:18