latexdocumentmathematical-typesetting

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.

alt text

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.


Solution

  • 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}
    \]