Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
1  
See here tex.stackexchange.com/a/129775/31093 It is not exactly your situation but I think you can use it to achieve what you want. –  Red Aug 30 '13 at 11:55

2 Answers 2

up vote 7 down vote accepted

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

share|improve this answer
    
the horizontal brace seems somewhat wider than necessary. –  barbara beeton Aug 30 '13 at 16:08
    
you've made a nice fix. –  barbara beeton Aug 30 '13 at 16:53

The following requires some \nulldelimiterspace corrections, but only uses amsmath:

enter image description here

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\def\matriximg{%
  \begin{matrix}
    1 & 1 & 0 & \cdot & \cdot & \cdot & 0 & 1  \\
    0 & 0 & 1 & \cdot & \cdot & \cdot & 1 & 0 \\
    \cdot \\
    \cdot \\
    \cdot \\
    0 & 1 & 1 & \cdot & \cdot & \cdot & 1 & 1
   \end{matrix}
}%
\[
  \text{\scriptsize 10~rows}\left\{\left(\vphantom{\matriximg}\right.\right.\kern-2\nulldelimiterspace
  \overbrace{\matriximg}^{\text{12 rows}}\kern-\nulldelimiterspace\left.\vphantom{\matriximg}\right)
\]
\end{document}

For raising the \overbrace slightly, you could use

\vphantom{\raisebox{.25\baselineskip}{$\matriximg$}}\matriximg
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.