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.

I wrote the code of the equation but i have an error while writing Jij, any help?

equation

\begin{equation}
J_i_j = \left\{ 
  \begin{array}{l l}
    \frac{1}{k}exp\left(-\frac{{||x_i - x_j||}^{2}}{{2a}^{2}}\right) \quad x_i is nearest neighbor of x_j,\\
    0 \quad \text{else}
  \end{array} \right.
\end{equation}
share|improve this question

closed as too localized by Werner, Thorsten, Qrrbrbirlbel, Marco Daniel, Hendrik Vogt Apr 6 '13 at 7:10

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.

4  
Use J_{ij}... –  Werner Apr 6 '13 at 4:28
    
Hi, it is better to visit our chat room first. –  stalking is prohibited Apr 6 '13 at 4:29
    
Thanks alot, it worked –  SMH Apr 6 '13 at 4:30

2 Answers 2

up vote 3 down vote accepted

I have to use J_{ij} instead of J_i_j thanks to Werner.

share|improve this answer
 \begin{equation}
 J_{ij} =           %   group subscript with braces
 \begin{cases}      %   use cases macro for piecewise functions
     \frac1K\exp    %   capital K, \exp, you don't have to type braces around single characters
        \left(-\dfrac{\|x_i - x_j\|^2}  {2a^2}\right)   %   \dfrac for display fraction bigger ,\| for double |, less braces   
        & x_i \text{ is nearest neighbour of } x_j,\\   %   use & in cases mode, 
     0  & \text{else}                                   %   \text{} 
 \end{cases}
 \end{equation}
share|improve this answer

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