Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to reproduce the equation of the image below. I am using an array environment to create the first big curly brace. I have tried to nest a second array to produce a second curly brace, but I get an error.

enter image description here

This is the code that gave me an error:

DTW(A,B)=\left\{ \begin{array}{l}
    0 \quad \text{se $n$=0 ed $m$=0}\        \infty \quad \text{se $n$=0 o $m$=0}\        d(H(A),H(B))+\min\left\{
    \begin{array}{1}
        a\            b\            c\        \end{array}
    \right.
  \end{array} \right.

How can I write this equation?

share|improve this question
2  
Please give the code giving the error. –  Stephan Lehmke May 2 '12 at 15:25
2  
The {1} after the inner \begin{array} should be {l} (an "ell", not a "one"). The error was Illegal character in array arg. –  egreg May 2 '12 at 15:33
1  
Not tested, but you have 1 (one) instead of l (ell) in the second array spec. - Gah, Ninja'd. –  Stephan Lehmke May 2 '12 at 15:33
add comment

2 Answers

up vote 8 down vote accepted

You have a typo in your inner array

change

     \begin{array}{1}
                   %%%

to

   \begin{array}{l}
                %%%
share|improve this answer
add comment

To give you another possibility using cases from amsmath or mathtools.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
DTW(A,B)=\begin{cases}
    0 \quad \phantom{\infty}\text{if}\,\, n=0 \,\,\text{and}\,\, m=0  \\
    \infty \quad \phantom{0}  \text{if}\,\, n=0 \,\,\text{and}\,\, m=0 \\
    {d(H(A),H(B))+\min \begin{cases}
        a\\
        b\\
        c\\
    \end{cases}}
      \end{cases}
    \end{equation} 
  \end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.