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 use the following:


\title{Some Title}

    bla afdsdjkh
        \textbf{INPUT:} Some input\\
        \textbf{OUTPUT:} Some Output
       \State Function $UpdateNodes($x$)$:
       \State   Set $AED_i$ = $\sum_{j=1}^{n}$  $DM_i_j$ / $n$  

Although I get the required result for the line:

\State  Set $AED_i$ = $\sum_{j=1}^{n}$  $DM_i_j$ / $n$  

I get an error message:

"Double subscript. ...ate Set $AED_i$ = $\sum_{j=1}^{n}$ $DM_i_"

Why do I get it? and how can I fix it?

share|improve this question
You should type $\mathit{AED}_{i}=\sum_{j=1}^{n}\mathit{DM}_{i_j}/n$, not going in and out from math mode. – egreg Jan 19 at 8:57

Perhaps, instead of $DM_i_j$ you need to type $DM_{i_j}$ or ${DM_i}_j$ depending of what you have in mind.

share|improve this answer
...or $D_{ij}$... – Werner Jan 19 at 6:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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