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 create a tableau of vectors in LaTeX, like the one seen on Slide 7 in these slides.

enter image description here

But unlike in the slides, I want to have vectors like the one given by the code below

\begin{pmatrix}
1\\
0\\
-1
\end{pmatrix}

placed inside the cells. Is there an elegant way to do this, using either TikZ or tables?

share|improve this question
add comment

1 Answer

up vote 11 down vote accepted

The ytableau package could be an option:

\documentclass{article}
\usepackage{amsmath}
\usepackage[boxsize=5em]{ytableau}

\begin{document}

\begin{ytableau}
*(red!20)\begin{pmatrix}1 \\ 0 \\ -1 \end{pmatrix} 
  & *(red!20)\begin{pmatrix}-1 \\ 0 \\ -1 \end{pmatrix} 
  & *(red!20)\begin{pmatrix}0 \\ -1 \\ -1 \end{pmatrix} 
  & *(red!20)\begin{pmatrix}1 \\ -1 \\ 0 \end{pmatrix} 
  & *(red!20)\begin{pmatrix}0 \\ 0 \\ 0 \end{pmatrix} 
  & *(red!20)\begin{pmatrix}1 \\ 1 \\ -1 \end{pmatrix} \\
*(blue!20)\begin{pmatrix}-1 \\ -1 \\ -1 \end{pmatrix} 
  &*(blue!20)\begin{pmatrix}0 \\ 0 \\ -1 \end{pmatrix} 
  & *(blue!20)\begin{pmatrix}1 \\ 1 \\ -1 \end{pmatrix} \\
*(yellow!20)\begin{pmatrix}-1 \\ 0 \\ -1 \end{pmatrix}
  &*(yellow!20)\begin{pmatrix}1 \\ 0 \\ 0 \end{pmatrix}
\end{ytableau}

\end{document}

enter image description here

share|improve this answer
    
@RyanReich I don't know; we must be using different versions of your package. Can we meet in chat in 20 minutes to compare *File List*s? –  Gonzalo Medina Sep 17 '12 at 1:37
    
No, I figured it out. I'm just an idiot and didn't load amsmath...it's always loaded so why even think about it? –  Ryan Reich Sep 17 '12 at 1:38
    
@RyanReich ah, I see. –  Gonzalo Medina Sep 17 '12 at 1:40
    
I'm sort of surprised that pmatrix is defined with out it, actually. If I'd gotten an unknown environment error it would have been much more obvious. –  Ryan Reich Sep 17 '12 at 1:44
2  
@RyanReich the problem is that the command \pmatrix is defined in the LaTeX kernel: \def\pmatrix#1{\left(\matrix{#1}\right)}. –  Gonzalo Medina Sep 17 '12 at 2:01
add comment

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.