# \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:

• 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. – David Carlisle Jan 14 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? – J. Doe Jan 14 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 – Saravanan Jan 14 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 ... }. – Saravanan Jan 14 at 4:20
• That's "\limits", not "\limit". – barbara beeton Jan 14 at 19:37
• Peraphs, for my humble opinion, it is better \mid instead of |. – Sebastiano Jan 14 at 22:18