1

Is there a simple way of drawing matrices with shadowed blocks like the ones in the picture?

enter image description here

I've tried something like Gonzalo Medina's proposal:

%% with these packages loaded
%% \usepackage{tikz}
%% \usetikzlibrary{matrix}
\begin{frame}
  \frametitle{Other matrix groups}
  \begin{itemize}
  \item Upper triangular $UT(p,q)$:

    \begin{tikzpicture}[every node/.style={anchor=base,text depth=.5ex,text height=2ex,text width=1em}]
      \matrix [matrix of nodes,nodes in empty cells]
              {
                |[fill=black]| a  & |[fill=black]| b \\
                |[fill=white]| 0  & |[fill=black]| c \\
              };
    \end{tikzpicture}
  \end{itemize}
\end{frame}

However, I get an error

! Undefined control sequence.

\pgf@matrix@last@nextcell@options

l.307 \end{frame}

nonstop compilation yields

enter image description here

Any suggestions?

Dox
  • 5,729

0 Answers0