TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

This is the formula I'd like to reproduce:

To be reproduced

And here is my poorly working MWE:



G_i(d) = \displaystyle\frac{\displaystyle\sum_j w_{ij} (d) x_j - W_i\bar{x}(i)} 
{s(i)\{[(n - 1) S_{1i} - W_i^2]}}/{{(n - 2)}^{1/2}}, j\neq i.


Any help is appreciated.

share|improve this question

closed as too localized by doncherry, Tom Bombadil, clemens, Claudio Fiandrino, lockstep Sep 6 '12 at 14:17

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Please specify in words in your question as well as the title what exactly you're struggling with. A picture of your current output would be helpful, too. As it is, your question is way too localized and should be closed. It is highly unlikely that anybody needs to reproduce the exact same formula as you do. And even if somebody did, they probably wouldn't find this question because of its lack of description. – doncherry Sep 5 '12 at 19:08
up vote 7 down vote accepted

How about this




        G_i(d) = \frac{\sum_j w_{ij} (d) x_j - W_i\bar{x}(i)} 
                      {s(i)\{[(n - 1) S_{1i} - W_i^2]/{{(n - 2)}\}^{1/2}}},\qquad  j\neq i.


Following the comment, you could also try

        G_i(d) = \frac{\displaystyle\sum_j w_{ij} (d) x_j - W_i\bar{x}(i)} 
                      {s(i)\{[(n - 1) S_{1i} - W_i^2]/{{(n - 2)}\}^\frac{1}{2}}},\qquad  j\neq i.

which gives

enter image description here

The error I got with your code is

! Extra }, or forgotten $.
l.8 {s(i)\{[(n - 1) S_{1i} - W_i^2]}}
                                     /{{(n - 2)}^{1/2}}, j\neq i.

which is one of TeX's more helpful errors. I find that in these situations it is helpful to copy the offending line, comment out the original, and then strip the copy down to a bare minimum. You can then build it back up slowly to try and avoid the errors.

One particularly useful piece of advice is always open and close grouping parenthesis/brackets/braces at the same time.

share|improve this answer
@cmhuges: thank you, that sort of solves it. But I would like to se a big \sum symbol and the superscript fraction in vertical style. – Costanza Sep 5 '12 at 17:36
@Costi use \tfrac{1}{2} – mythealias Sep 5 '12 at 18:02
For larger summation sign, see here – mythealias Sep 5 '12 at 18:08
@Costi see my update :) you might like \dfrac from the amsmath package for displaystyle fractions – cmhughes Sep 5 '12 at 18:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.