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

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}
  • As you pointed, similar. But in fact, better, because make use of all first column with \vphantom. – Vitor Abella Aug 12 '16 at 20:23
2

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

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.