# Increase size of square brackets

How can I increase the size of the brackets? They are not enclosing the whole matrix.

\documentclass{article}
\usepackage{blkarray}
\begin{document}

\begin{figure}[htbp]

\begin{spacing}{0.5}
\usepackage{amsmath}
\usepackage{setspace}

$\mathbf{\hat R }= \begin{blockarray}{r*{5}{ >{\color{black}}c}} & A & B & C & D & E \\ \begin{block}{ >{\scriptstyle}r!{\,}[ccccc]} 1 & 5 & 3.09 & 4.90 & - & \textbf{4.62} \\ 2 & - & 2.89 & 4.69 & \textbf{3.49} & 4.42 \\ 3 & 4.10 & 2.19 & - & \textbf{2.78} & 3.71 \\ 4 & - & \textbf{1.00} & 2.49 & 1.29 & 2.22 \\ 5 & 4.90 & - & \textbf{4.79} & 3.58 & 4.51 \\ 6 & \textbf{4.88} & 2.96 & - & 3.56 & 4.48 \\ 7 & 3.15 & \textbf{1.23} & 3.03 & 1.82 & - \\ 8 & 4.84 & \textbf{2.92} & 4.72 & - & 4.61 \\ 9 & \textbf{4.84} & 2.92 & 4.72 & 3.51 & - \\ 10& \textbf{4.61} & - & 4.49 & 3.29 & 4.22 \\ \end{block} \end{blockarray}$%

\end{spacing}
\caption{}

\end{figure}
\end{document}

• How or where is the spacing environment defined? – Mico Oct 14 at 19:01
• I have edited the OP – Delan Oct 14 at 19:03
\end{document}


There's a workaround for the brackets size: use \bigtrut[t] in a cell of the first row and \bigstrut[b] in the last row. I added a simplication of the code for the first column, using the BAenum row counter defined by the package Last, I removed the unnecessary colon after the figure label, since there's no caption text.

\documentclass{article}
\usepackage{xcolor}
\usepackage{blkarray, bigstrut}
\usepackage{caption}

\usepackage{amsmath}

\begin{document}

\begin{figure}[htbp]\bigstrutjot=1ex \captionsetup{labelsep=none, skip=0pt}
\mathbf{\widehat R }=\begin{blockarray}{r*{5}{ >{\color{black}}c}} & A & B & C & D & E \\\noalign{\setcounter{BAenumi}{1}} \begin{block}{ >{\scriptstyle\theBAenumi}r!{\,}[ccccc]} & 5 & 3.09 & 4.90 & - & \mathbf{4.62}\bigstrut[t] \\ & - & 2.89 & 4.69 & \mathbf{3.49} & 4.42 \\ & 4.10 & 2.19 & - & \mathbf{2.78} & 3.71 \\ & - & \mathbf{1.00} & 2.49 & 1.29 & 2.22 \\ & 4.90 & - & \mathbf{4.79} & 3.58 & 4.51 \\ & \mathbf{4.88} & 2.96 & - & 3.56 & 4.48 \\ & 3.15 & \mathbf{1.23} & 3.03 & 1.82 & - \\ & 4.84 & \mathbf{2.92} & 4.72 & - & 4.61 \\ & \mathbf{4.84} & 2.92 & 4.72 & 3.51 & - \\ & \mathbf{4.61} & - & 4.49 & 3.29 & 4.22 \bigstrut[b]\\ \end{block} \end{blockarray}%
\caption{}
\end{figure}

\end{document}


You could consider using kbordermatrix:

\documentclass{article}

\usepackage{kbordermatrix}

\begin{document}

$\renewcommand{\bfdefault}{b} % use bold, not bold-extended \widehat{\mathbf{R}} = \kbordermatrix{% & A & B & C & D & E \\ 1 & 5.00 & 3.09 & 4.90 & - & \textbf{4.62} \\ 2 & - & 2.89 & 4.69 & \textbf{3.49} & 4.42 \\ 3 & 4.10 & 2.19 & - & \textbf{2.78} & 3.71 \\ 4 & - & \textbf{1.00} & 2.49 & 1.29 & 2.22 \\ 5 & 4.90 & - & \textbf{4.79} & 3.58 & 4.51 \\ 6 & \textbf{4.88} & 2.96 & - & 3.56 & 4.48 \\ 7 & 3.15 & \textbf{1.23} & 3.03 & 1.82 & - \\ 8 & 4.84 & \textbf{2.92} & 4.72 & - & 4.61 \\ 9 & \textbf{4.84} & 2.92 & 4.72 & 3.51 & - \\ 10 & \textbf{4.61} & - & 4.49 & 3.29 & 4.22 }$

\end{document}


The above code is taken partially from Mico's answer.

• When I run it, it throws this error File kbordermatrix.sty' not found. ^^M – Delan Oct 15 at 20:27
• @Delan: Download kbordermatrix.sty and store it in C:\texlive\texmf-local\tex\latex\local - do you have TeX Live? Then run texhash from the command prompt. Alternatively, just download kbordermatrix.sty` and place it in your working folder. – Werner Oct 15 at 20:30