2

I tried to put 2 braces, one at the top and one at the left, but I got an ugly effect. How to fit both braces with the array?

\documentclass[12pt]{report}
\begin{document}
\begin{equation}
  lines \overbrace{\left\{\begin{array}{|r|r|r|r|r|}
        \hline
        4 & 6 & 5 & 7  & 9  \\
        \hline
        3 & 5 & 7 & 8  & 10 \\
        \hline
        1 & 3 & 9 & 10 & 12 \\
        \hline
        2 & 4 & 3 & 9  & 11 \\
        \hline
    \end{array}\right.}^{columns}
\end{equation}
\end{document}

enter image description here

3
  • Instead \documentclass\[12pt\]{report} is correct \documentclass[12pt]{report}. Correcting this I obtain nice braces, only over on also consider left one ...
    – Zarko
    Commented Aug 12, 2016 at 19:59
  • Thank you for the correction @Zarko. Did you get nice braces with this code? the top brace takes the left brace. How to solve this problem? Commented Aug 12, 2016 at 20:04
  • 2
    this looks like what you want: How can I have a brace on the left and the top of a matrix without overlapping? Commented Aug 12, 2016 at 20:05

2 Answers 2

4

An rude solution, similar to solution which Barbara Beeton pointed in her comment:

enter image description here

\documentclass[12pt]{report}
\begin{document}
\begin{equation}  
lines \left\{\vphantom{\begin{array}{c}
        \hline
        4 \\
        \hline
        3 \\
        \hline
        1 \\
        \hline
        2 \\
        \hline
    \end{array}}\right.%
    \overbrace{\begin{array}{|r|r|r|r|r|}
        \hline
        4 & 6 & 5 & 7  & 9  \\
        \hline
        3 & 5 & 7 & 8  & 10 \\
        \hline
        1 & 3 & 9 & 10 & 12 \\
        \hline
        2 & 4 & 3 & 9  & 11 \\
        \hline
    \end{array}}^{columns}
\end{equation}
\end{document}
1
  • As you pointed, similar. But in fact, better, because make use of all first column with \vphantom. Commented Aug 12, 2016 at 20:23
3

Here is another solution, based on blkarray:

\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}%
\usepackage{blkarray, amsmath}

\begin{document}

\begin{equation}
\renewcommand\arraystretch{1.6}
    \overbrace{\mkern-8mu\begin{blockarray}{rrrrr}%
 \hphantom{10}& \hphantom{10} &\hphantom{10} & & \\[-4ex]
 \begin{block}{\Left{\footnotesize lines\,}{\{\hspace{0.8em}}|r|r|r|r|r|}
        \BAhline
        4 & 6 & 5 & 7 & 9 \\
        \BAhline
        3 & 5 & 7 & 8 & 10 \\
        \BAhline
        1 & 3 & 9 & 10 & 12 \\
        \BAhline
        2 & 4 & 3 & 9 & 11 \\
        \BAhline
\end{block}
    \end{blockarray}\mkern-8mu}^\text{columns}%
\end{equation}

\end{document} 

enter image description here

You must log in to answer this question.

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