This question already has an answer here:

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}
  \frametitle{Other matrix groups}
  \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 \\

However, I get an error

! Undefined control sequence.


l.307 \end{frame}

nonstop compilation yields

enter image description here

Any suggestions?

marked as duplicate by Andrew, Svend Tveskæg, Jesse, egreg amsmath Mar 25 '15 at 13:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    What did you try/see so far that you consider to be not simple enough? – Paul Gessler Mar 25 '15 at 11:56
  • where are the shadows? – percusse Mar 25 '15 at 11:57
  • 1
    Something like vertical lines in matrix using tikz package? To put delimiters around these matrices use the optional arguments left delimiter=(,right delimiter=\} etc. – Andrew Mar 25 '15 at 12:40
  • @PaulGessler I found some examples with lots of TikZ style definitions, but I found some simpler examples... so I edit the question because I get an error. – Dox Mar 25 '15 at 12:48
  • 2
    if using beamer ampersand replacement=\& and use \& in the matrix – percusse Mar 25 '15 at 12:51