# A Matrix with labels, dashed lines

I'm trying to TeX the following matrix, from Guillemin and Pollack (1.4 #13)

The best I've been able to do is get the dashed lines with

$\left( \begin{array}{c:c} B & C \\ \hdashline D & E \end{array} \right)$


If you want to test this try

\documentclass[11pt]{article}
\usepackage{arydshln}
\begin{document}
$\left( \begin{array}{c:c} B & C \\ \hdashline D & E \end{array} \right)$
\end{document}


Output looks like this:

-
Welcome to TeX.SE. While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill Oct 26 '12 at 4:48

Perhaps the following is more suitable:

\documentclass{article}
\usepackage{arydshln,leftidx,mathtools}% http://ctan.org/pkg/{arydshln,leftidx,mathtools}
\begin{document}
$\setlength{\dashlinegap}{2pt} \leftidx{_{m-r}^{\phantom{m-r}\llap{\scriptstyle r}}}{\left( \begin{array}{c:c} \smash{\overset{r}{B}} & \mathclap{\smash{\overset{n-r}{C}}} \\ \hdashline D & E \end{array} \right)}{}$
\end{document}


The gaps between the dashes of \hdashline has been shortened from 4pt down to 2pt. mathtools provides \mathclap (a zero-width box that is centred) and also loads amsmath, which provides \overset (a math accent-type macro). I've \smashed the elements in the first row to not let the array delimiters over the height of B or C.

leftidx is a super-small package that adds left indexing functionality. See Superscripts before a letter in math.

-
Interesting packages. First time am seeing them :-) Just put the A= to finish it up. –  azetina Oct 26 '12 at 5:05
That's exactly what I was looking for. Thanks! –  Frederick Oct 26 '12 at 7:29
@Werner -- the spacing around the parens (both inside and out) looks too wide to me. i'd also be inclined to raise the "overscripts" a tiny bit to avoid crashing into the right-hand paren if it's tightened (ah, yes, \smash wouldn't work in that case). otherwise, very nice. –  barbara beeton Oct 26 '12 at 12:37