开发者

Error while writing multi-valued function in LateX

I am creating a document in LateX and the following multivalued function has been giving me trouble for a while.

Error while writing multi-valued function in LateX

The Latex code for the above as I gave is

$\[delta \tau_{i,j}^{k}$ = $\left\{$
  \begin{array}{l l}
  \frac{1}{L_{k}} & \quad \mbox{if ant k travels on edge开发者_如何学运维 \textit{i,j}} \\
  0 & \quad \mbox{otherwise}
  \end{array} \right. \] 

While compiling it gives me the following error

    ! LaTeX Error: Bad math environment delimiter.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.52 $\[
        delta \tau_{i,j}^{k}$ = $\left\{$
? 

Any help on fixing this error would be much appreciated.


aschepler is right--it's the [ inside the $.

You may also want to consider the cases environment, which I think is easier for this sort of thing. For you example, you'd have:

\[
    \Delta\tau_{i,j}^k=
    \begin{cases}
        1/L_k & \text{if ant $k$ travels along edge $i,j$} \\
        0 & \text{otherwise}
    \end{cases}
\]


You can't use both $ $ and \[ \] like that. $ is for in-line equations (fit within a paragraph of text), so you should probably use just \[ \] around your equation and remove all the $s.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜