Hi, I want to write this equation in latex. I've write the following lines but there is no space between "j" and "and". Please tell me how to fix it. Thanks.
\begin{align}
Y_{ij} = \left\{\begin{array}{lr}
\sum_{k \sim i}y_{ij}, & \text{if } i = j,\\
{-y_{ij}}, & \text{if } i \ne j \text{and } i \sim j,\\
0, & \text{otherwise.}
\end{array}
\end{align}
Best Answer
You can have a simpler typing with the
dcases*
environment frommathtools
: Thed
in the name of the environment means it will typed in\displaystyle
and the star means the second column will be in text mode: