[Tex/LaTex] Multi line parentheses in latex

equations

I would like to have more than on line in a big paranthesis, how can I do that. I have test this code but doesnt work for me:

\begin{equation}
p \big[ i, j \big]=min\Bigg(

 p \big[i-1, j-1 \big] + 2 \times d \big ( i, j \big)\\
 p \big[ i, j-1 \big] + d \big( i, j \big) \\
 p \big[i-1, j \big]+d \big( i, j \big) \Bigg)

\end{equation}

Best Answer

You can use \left and \right to get automatically sized delimiters, however they have no effect in this situation. You can also use an array environment to have a grid in one line, and the pmatrix to have it wrapped in parentheses. If you have

\usepackage{amsmath}

in your preamble, you can use

\begin{equation}
  p[i,j] = \min
  \begin{pmatrix}
    p[i-1,j-1] + 2\times d(i,j) \\
    p[i,j-1] + d(i,j) \\
    p[i-1,j] + d(i,j)
  \end{pmatrix}
\end{equation}

I'm assuming you're using min as an operator.

Related Question