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'd like to use TikZ to typeset some graphs like this one:

graph with interesting vertices

(Sorry for the crappy camera-phone pic)

I am familiar with \node, \path and edge, as well as with getting different arrowhead styles.

The bit that's tripping me up is getting the vertices of the graph to be these little triangular number diagrams. This one is relatively simple (the number diagrams are only 2x2), but I have others where the diagrams are 3x3 and bigger.

Would it be best to use an array environment inside each \node? Is that even possible?

Or is there a better way? Thanks!

share|improve this question
    
It is certainly possible to use array in a node. That sounds like a good idea for this graph. If you try this and have trouble, I suggest posting a MWE. –  mrc Nov 10 '13 at 17:55
add comment

1 Answer

The new graph drawing library in the CVS version of pgf can do this quite nicely. Exploiting the align key, and setting it to right means the node contents in this specific case can be given quite simply.

However, it does needs luatex to compile.

\documentclass[border=0.125cm]{standalone}

\usepackage{tikz}
\usetikzlibrary{graphdrawing}
\usetikzlibrary{graphs}
\usegdlibrary{layered}

\begin{document}

\begin{tikzpicture}[>=stealth, every node/.style={align=right}]

\graph [layered layout,grow=up, level distance=0.5in, sibling distance=0.5in]
    {
        "00\\0" -> "01\\0" -> {"01\\1", "11\\0"} -> "11\\1"
    };

\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
    
That's neat, and impressive. I may look into updating my system to try and use these new features. I appreciate your time. –  Harold Nov 10 '13 at 19:18
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.