TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to recreate this image

enter image description here

using tikz matrices in a tree. I can create the first node and can hook up to children, but I can't get the syntax for including more matrices as child nodes of the first matrix node. Can anyone give an example of a matrix node as a child in a tikzpicture?

share|improve this question
Thanks for adding the actual image. – seandavi Mar 4 '12 at 2:04
up vote 5 down vote accepted

Here is one option that you can further modify:

\begin{tikzpicture}[level distance=2cm,
  level 1/.style={sibling distance=2cm}]
  \node[matrix,matrix of nodes,ampersand replacement=\&] {root \& beer\\is \& good\\}
    child {
        node[matrix,matrix of nodes,ampersand replacement=\&] {first \& row \\another \& row\\} 
  child {node {Write}}
  child {node {Wright}}
    child {node {right}};

enter image description here

I had some difficulty with the ampersand in QTikZ environment so I changed it to something else for next column trigger. It might not be needed for other media.

share|improve this answer
I guess I should have added the grow=right option. – percusse Mar 4 '12 at 1:56
Thanks. The ampersand replacement=\& seems to be a common idiom; that is what I was missing. – seandavi Mar 4 '12 at 2:03

Your Answer


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.