TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

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


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

Use J_{ij}... – Werner Apr 6 '13 at 4:28
Hi, it is better to visit our chat room first. – kiss my armpit Apr 6 '13 at 4:29
Thanks alot, it worked – SMH Apr 6 '13 at 4:30
up vote 4 down vote accepted

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

share|improve this answer
 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{} 
share|improve this answer

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