[Tex/LaTex] Square brackets instead of curvy brackets

brackets

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?

Best Answer

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}
Related Question