How would I code something like this
I've got the code
\begin{equation}
L =
\begin{cases}
1 & \text{if $i = j$ and $deg_j \neq 0 $} \\
stuff & \text{if $(i, j) \in E$} \\
0 & \text{otherwise}
\end{cases}
\end{equation}
but where stuff
is I want to use -\frac{1}{\sqrt{deg_ideg_j}}
and where L
is I want the Laplacian symbol \mathcal{L}
. Whenever I try to put them in I get an error message that says "Missing $ inserted" and I'm not exactly sure what it means, or how to fix it.
Any help would be greatly appreciated.
$
in stuff. You are already in math mode at that time. The$
are required if you have math within\text{}
as then you are in text mode, not math mode.