5

I was trying to make this matrix delimited by brackets within another matrix. Here is what I've managed to do so far, but I'm not too sure if I'm using the right approach. I tried to use bmatrix earlier too but to no avail:

\begin{align}
\frac{\epsilon_{1}}{12h^2_{1}} 
    \begin{array}{c}
    \left[
    12 \\ -1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0
    \right.
    \end{array}
     \begin{array}{c c c c c c c}
     \left[
        -24 & 12 & 0 & 0 & 0 & 0 & 0 \\
        16 & -30 & 16 & -1 & 0 & 0 & 0 \\
        -1 & 16 & -30 & 16 & -1 & 0 & 0 \\
        0 & -1 & 16 & -30 & 16 & -1 & 0 \\
        0 & 0 & -1 & 16 & -30 & 16 & -1 \\
        0 & 0 & -1 & & 16 & -30 & 16 \\
        0 & 0 & 0 & 0 & 0 & 12 & -24 \\
      \right]
      \end{array} 
      \begin{array}{ c }
       \left.
    0 \\ 0 \\ 0 \\ 0 \\ 0 \\ -1 \\ 12 
       \right]
       \end{array} \notag 
\end{align}

Note: I'm also having problems with adding the descriptive curly braces at the bottom of the matrix. Would be grateful if someone could help me out with that.

Matrix

2
  • 1
    the \left and \right should be outside the arrays, not inside. where they are now, each is in a different cell, so it would need to be matched within the same cell. i don't think that's what you want. Jun 29, 2015 at 17:07
  • Just a minor point, but I'm guessing that on line 9 you want \left[ not \left]
    – Au101
    Jun 29, 2015 at 17:09

2 Answers 2

5

You can use nested matrices:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
\frac{\epsilon_{1}}{12h^2_{1}}
\begin{bmatrix}
\\[-2\jot]
\begin{matrix}
   12 \\ -1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0
\end{matrix}
\underbrace{%
\begin{bmatrix}
  -24 & 12 & 0 & 0 & 0 & 0 & 0 \\
   16 & -30 & 16 & -1 & 0 & 0 & 0 \\
   -1 & 16 & -30 & 16 & -1 & 0 & 0 \\
    0 & -1 & 16 & -30 & 16 & -1 & 0 \\
    0 & 0 & -1 & 16 & -30 & 16 & -1 \\
    0 & 0 & -1 & & 16 & -30 & 16 \\
    0 & 0 & 0 & 0 & 0 & 12 & -24 \\
\end{bmatrix}
}_{L_1}
\begin{matrix}
    0 \\ 0 \\ 0 \\ 0 \\ 0 \\ -1 \\ 12 
\end{matrix}
\end{bmatrix}
\end{equation*}

\end{document}

The empty row (with some negative vertical spacing) ensures that the outer brackets are larger than the inner ones.

Don't use align for single line displays.

enter image description here

0
5

Supplement to egreg's answer.

  • The columns can be right aligned by a trick. Package array allows the definition of a new column style. Thus locally c is redefined to r:

  • Some space is added around the left and right column.

  • The size of the outer brackets can be reduced by manipulating \delimiterfactor and \delimitershortfall. When TeX has calculated the size for the delimiters, it has then to choose the size for the glyphs. It multiplies the size with \delimiterfactor as per mille and compares it with the size minus \delimitershortfall and uses the larger value.

Example file:

\documentclass{article}
\usepackage{amsmath}
\usepackage{array}

\begin{document}
\[
  \frac{\varepsilon_1}{12h_1^2}
  \delimiterfactor=0 % use \delimitershortfall
  \setlength{\delimitershortfall}{10pt}
  \left[
    \delimiterfactor=901 % default value
    \setlength{\delimitershortfall}{5pt}% default value
    \newcolumntype{c}{r}
    \kern\arraycolsep
    \begin{matrix} 12 \\ -1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{matrix}
    \kern\arraycolsep
    \underbrace{\begin{bmatrix}
      -24 & 12 & 0 & 0 & 0 & 0 & 0 \\
       16 & -30 & 16 & -1 & 0 & 0 & 0 \\
       -1 & 16 & -30 & 16 & -1 & 0 & 0 \\
        0 & -1 & 16 & -30 & 16 & -1 & 0 \\
        0 & 0 & -1 & 16 & -30 & 16 & -1 \\
        0 & 0 & -1 & & 16 & -30 & 16 \\
        0 & 0 & 0 & 0 & 0 & 12 & -24
    \end{bmatrix}}_{\mathrm{L}_1}
    \kern\arraycolsep
    \begin{matrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ -1 \\ 12 \end{matrix}
    \kern\arraycolsep
  \right]
\]
\end{document}

Result

1
  • With mathtools, the different matrix` environments accept an optional argument: r, l orc (default).
    – Bernard
    Jun 29, 2015 at 19:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .