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.

Having consulted this and this thread, I think the multipart feature of TikZ might just do what I need (see picture below). Is there any way to hide the vertical lines between node parts and still be able to access the multipart anchors (possibly even draw those circles)?

enter image description here

share|improve this question
4  
Yes, there's a key rectangle split draw splits=<true/false>. The multipart nodes are well described in the pgfmanual. –  Jake May 13 '12 at 19:20
    
No kidding. Before posting this question I checked the manual and seem to have successfully managed to overlook that specific key. Thanks. –  hauptbenutzer May 13 '12 at 19:31
    
@jake Can you write an answer so that I can reach my daily vote cap? :) –  percusse Jun 16 '12 at 0:21

1 Answer 1

up vote 5 down vote accepted

I tinkered a little with your problem and came up with a non-automatic version. The fact that the nodes are named with words ( one ) instead of numbers ( 1 ) didn't help my attepts to automate it ;)

If you have a splitnode called myname, then you need to call \drawdots with the two parameters node name and split count.

\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usepackage{xifthen}

\pgfmathsetmacro{\dotradius}{0.05}

\newcommand{\drawdots}[2]{% node, recparts
    \foreach \x/\n in {1/{one }, 2/{two }, 3/{three }, 4/{four }, 5/{five }, 6/{six }, 7/{seven }, 8/{eight }, 9/{nine }, 10/{ten }, 11/{eleven }, 12/{twelve }, 13/{thirteen }, 14/{fourteen }, 15/{fifteen }, 16/{sixteen }, 17/{seventeen }, 18/{eighteen }, 19/{nineteen }} 
    {\ifthenelse{#2>\x}{\fill (#1.\n split) circle (\dotradius);}{}}
}

\begin{document}

\begin{tikzpicture}
[   recspl/.style={rectangle split, rectangle split parts=#1, rectangle split horizontal, draw, anchor=center, rectangle split draw splits=false},
    conn/.style={out=270,in=90}]

\node[recspl=12] (a) at (0,0)
{   1
    \nodepart{two} 2
    \nodepart{three} 3
    \nodepart{four} 4
    \nodepart{five} 5
    \nodepart{six} 6
    \nodepart{seven} 7
    \nodepart{eight} 8
    \nodepart{nine} 9
    \nodepart{ten} 10
    \nodepart{eleven} 11
    \nodepart{twelve} 12
};
\drawdots{a}{12}

\node[recspl=3] (b1) at (-5,-2)
{   1
    \nodepart{two} 2
    \nodepart{three} 3
};
\drawdots{b1}{3}

\node[recspl=3] (b2) at (-1,-2)
{   1
    \nodepart{two} 2
    \nodepart{three} 3
};
\drawdots{b2}{3}

\node[recspl=3] (b3) at (2,-2)
{   1
    \nodepart{two} 2
    \nodepart{three} 3
};
\drawdots{b3}{3}

\node[recspl=3] (b4) at (6,-2)
{   1
    \nodepart{two} 2
    \nodepart{three} 3
};
\drawdots{b4}{3}

\node[recspl=20] (c) at (0,-4)
{   1
    \nodepart{two} 2
    \nodepart{three} 3
    \nodepart{four} 4
    \nodepart{five} 5
    \nodepart{six} 6
    \nodepart{seven} 7
    \nodepart{eight} 8
    \nodepart{nine} 9
    \nodepart{ten} 10
    \nodepart{eleven} 11
    \nodepart{twelve} 12
    \nodepart{thirteen} 13
    \nodepart{fourteen} 14
    \nodepart{fifteen} 15
    \nodepart{sixteen} 16
    \nodepart{seventeen} 17
    \nodepart{eighteen} 18
    \nodepart{nineteen} 19
    \nodepart{twenty} 20
};
\drawdots{c}{20}

\draw[conn] (a.one split) to (b1.one north);
\draw[conn] (a.four split) to (b2.two north);
\draw[conn] (a.six split) to (b3.two north);
\draw[conn] (a.ten split) to (b4.one north);

\draw[conn] (b1.one split) to (c.two north);
\draw[conn] (b2.one split) to (c.seven north);
\draw[conn] (b3.two split) to (c.nine north);
\draw[conn] (b4.one split) to (c.seventeen north);
\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer

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.