3

I am trying to use the cases environment but I get the message, missing $ inserted.

    \begin{cases} 
      deg(u_i)  \textrm{ if u_i on primary diagonal} \\
     -1 & \textrm{ if u_i u_j adjacent} \\
      0 & \textrm{otherwise}
    \end{cases}

Is the use of subscript, the problem? Any solutions?

2
  • 1
    That is because you have subscripted term u_i inside a \textrm argument, which nullifies the math mode. Commented May 26, 2014 at 18:40
  • So what is the solution? I tried u\sb{i} without success. Any ideas?
    – Paramar
    Commented May 26, 2014 at 18:43

1 Answer 1

4

You have to place a math environment and add $ inside \textrm.

\[
\begin{cases} 
      deg(u_i)  \textrm{if $u_i$ on primary diagonal} \\
     -1 & \textrm{if $u_i$ $u_j$ adjacent} \\
      0 & \textrm{otherwise}
    \end{cases}
\]
1
  • 1
    I'd use \text instead of \textrm.
    – egreg
    Commented May 26, 2014 at 20:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .