Take the 2-minute tour ×
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.

This is the formula I'd like to reproduce:

To be reproduced

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}

\begin{equation}
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{equation}

\end{document}

Any help is appreciated.

share|improve this question
3  
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
add comment

closed as too localized by doncherry, Tom Bombadil, cgnieder, 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.

1 Answer

up vote 7 down vote accepted

How about this

screenshot

\documentclass{book}
\usepackage{amsmath}


\begin{document}

   \begin{equation}
        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{equation}

\end{document}

Following the comment, you could also try

\begin{equation}
        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.
\end{equation}

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
add comment

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