8

I have the following example:

\begin{equation}
\[ 
\left \{
  \begin{tabular}{cccc}
  1 & 5 & 8 & a \\
  0 & 2 & 4 & a \\
  3 & 3 & -8 & a 
  \end{tabular}
\right \}
\]
\end{equation}

It should be a matrix, so I would like to have proper square brackets. I have tried the approach with setting them manually (\Bigg[) but the matrix is going to be larger so it needs to be set automatically. In the code above, I tried to use:

 \[ 
\left \[ 

but it didn't work. Any idea what's not working in the previous code?

  • 5
    \left[ and \right]. The characters { and } are special, so the must be escaped for getting printed braces, but [ and ] aren't special. However, with the package amsmath you can simply type \begin{bmatrix} 1& 5 & 8 & a \\...\end{bmatrix}. – egreg May 18 '15 at 17:38
12

There are many expanding delimiters available in TeX/LaTeX; the main ones are (round) parentheses, (square) brackets and braces. The only problematic ones among them are the braces, because { and } are special characters, used for grouping and for delimiting arguments.

So, \left(...\right), \left[...\right] and \left\{...\right\} are the “automatically expandable versions. The same for the manual \bigl(, \bigl[ and \bigl\{; similarly for \bigr and the other commands in the same family.

The commands \[ and \] mean a totally different thing: they delimit an unnumbered math equation.

So your case should be (with array, not tabular):

\begin{equation}
\left[
  \begin{array}{cccc}
  1 & 5 & 8 & a \\
  0 & 2 & 4 & a \\
  3 & 3 & -8 & a 
  \end{array}
\right]
\end{equation}

but upon loading amsmath you have a wealth of better constructions:

\begin{equation}
  \begin{bmatrix}
  1 & 5 & 8 & a \\
  0 & 2 & 4 & a \\
  3 & 3 & -8 & a 
  \end{bmatrix}
\end{equation}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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