[Tex/LaTex] How to create a matrix normal form

matricestikz-pgf

Is it possible to create a matrix like the following draft with LaTeX?

enter image description here

I have found this Tikzample, but I don't know how to get the dots on the diagonal.

edit: This is how far I got:
enter image description here

$$
\begin{pmatrix}
1 &  &   &    &  &      &              &                & &              \\
  &  &   &    &  &      &              &                & &              \\
  &  & 1 &    &  &      &              &                & &              \\
  &  &   & -1 &  &      &              &                & &              \\
  &  &   &    &  &      &              &                & &              \\
  &  &   &    &  & - 1  &              &                & &              \\
  &  &   &    &  &      & cos \omega_1 & -sin \omega_1  & &              \\
  &  &   &    &  &      & sin \omega_1 &  cos \omega_1  & &              \\
  &  &   &    &  &      &              &                & &              \\
  &  &   &    &  &      &              &                & & cos \omega_2 \\
  &  &   &    &  &      &              &                & & sin \omega_2 \\
\end{pmatrix}
$$  

The lime part is what I would like to have, but wasn't able to do with LaTeX.

Best Answer

If you need the vertical and horizontal lines around the matrix blocks, the following solution (which also doesn't require TikZ) may be of interest. (I've updated the example to reflect the update in your question, which appears to require an extra \ddots row/column.)

Note that I use the array environment rather than the matrix (or pmatrix) environment as it's necessary to right-align the contents of some columns.

\documentclass{article}
\usepackage{amsmath,array}
\renewcommand\arraycolsep{4pt} % default value: 6pt
% short-hand commands for multicolumn entries with vertical bar
% on left and right hand sides, respectively
\newcommand{\mcl}[1]{\multicolumn{1}{|r}{#1}}
\newcommand{\mcr}[1]{\multicolumn{1}{r|}{#1}}
\begin{document}
\begin{equation*}
\left( \,\begin{array}{rcr rcr rr c rr}
\cline{1-3}
 \mcl{1} &        & \mcr{}  \\
 \mcl{}  & \ddots & \mcr{}  \\
 \mcl{}  &        & \mcr{1} \\
\cline{1-6}
 & & & \mcl{-1} &        & \mcr{}  \\
 & & & \mcl{}   & \ddots & \mcr{}  \\
 & & & \mcl{}   &        & \mcr{-1}\\
\cline{4-8}
 & & & & & & \mcl{\cos \omega} & \mcr{-\sin \omega}\\
 & & & & & & \mcl{\sin \omega} & \mcr{ \cos \omega}\\
\cline{7-8} 
 & & & & & & & & \ddots\\
\cline{10-11}
 & & & & & & & & & \mcl{\cos \omega} & \mcr{-\sin \omega}\\
 & & & & & & & & & \mcl{\sin \omega} & \mcr{ \cos \omega}\\
\cline{10-11}
\end{array}\,\right)
\end{equation*}
\end{document}

enter image description here

Addendum: Using the \boxed macro, the code that sets up this matrix can be simplified considerably:

\documentclass{article}
\usepackage{amsmath,array}
\renewcommand\arraycolsep{4pt} % default value: 6pt
\begin{document}
\begin{equation*}
\left( \,
\begin{array}{r@{}r@{}r r r}  % @{} is used twice to suppress intercolumn whitespace
  \boxed{ \begin{array}{rrr}              % First block
    1 \\
    & \ddots\\
    & & 1 \\
  \end{array} } \\
  & \boxed{ \begin{array}{rrr}            % Second block
      -1 \\
      & \ddots\\
      & & -1\\
   \end{array} } \\
  & & \boxed{ \begin{array}{rr}           % Third block
        \cos \omega & -\sin \omega\\
        \sin \omega &  \cos \omega\\
      \end{array} } \\
  & & & \ddots\\                          % Fourth "block" -- not boxed
  & & & & \boxed{ \begin{array}{rr}       % Fifth block
            \cos \omega & -\sin \omega\\
            \sin \omega &  \cos \omega\\
          \end{array} } \\
\end{array}\,\right)
\end{equation*}
\end{document} 

enter image description here