# Formula reproduction in latex [closed]

This is the formula I'd like to reproduce:

And here is my poorly working MWE:

\documentclass{book}
\usepackage{amsmath}
\usepackage{fixltx2e}
\usepackage[english]{babel}
\usepackage[bitstream-charter]{mathdesign}
\usepackage[T1]{fontenc}

\begin{document}

$$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.$$

\end{document}


Any help is appreciated.

-

## closed as too localized by doncherry, Tom Bombadil, clemens, Claudio Fiandrino, lockstepSep 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

\documentclass{book}
\usepackage{amsmath}

\begin{document}

$$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.$$

\end{document}


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

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.

-
@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