如何在方程模式下使用数组左侧和顶部的括号?

如何在方程模式下使用数组左侧和顶部的括号?

我尝试放置 2 个括号,一个在顶部,一个在左侧,但效果不太好。如何将两个括号都放入数组中?

\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

答案1

这是一个粗鲁的解决方案,类似于 Barbara Beeton 在她的评论中指出的解决方案:

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}

答案2

这是另一个解决方案,基于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

相关内容