[Tex/LaTex] braces over matrix

bordermatrixbracesmatrices

I want to make an overbrace and a side brace on my matrix in order to indicate its size. How can I achieve that.

  \begin{pmatrix}
  1 & 1 & 0 & .& . & . & 0 & 1  \\
  0 & 0 & 1 & .& . & . & 1 & 0 \\
 .\\
 .\\
 .\\
  0 & 1 & 1 & . & . & . & 1 & 1
 \end{pmatrix}

Best Answer

Here's one way... [EDITED, added \mkern to address barbara's concern; REEDITED to make use of \overbrace superscript]

\documentclass{article}
\usepackage{amsmath}
\usepackage{stackengine}
\begin{document}
\def\tmp{%
  \begin{pmatrix}
  1 & 1 & 0 & .& . & . & 0 & 1  \\
  0 & 0 & 1 & .& . & . & 1 & 0 \\
 .\\
 .\\
 .\\
  0 & 1 & 1 & . & . & . & 1 & 1
 \end{pmatrix}
}%
\[
\stackMath\def\stackalignment{r}%
  \stackon%
    {\mathrm{10~rows}\left\{\tmp\right.}%
    {\overbrace{\phantom{\smash{\tmp\mkern -36mu}}}^{\mathrm{\textstyle 12~columns}}\mkern 20mu}%
\]
\end{document}

enter image description here