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'm using

child {node {1 \nodepart{two} 2 \nodepart{three} 3 \nodepart{four} 4 \nodepart{five} 5 \nodepart{six} 7}}

to create a node in btree. However it seems that \nodepart{five} and \nodepart{six} get ignored and the rest gets cut off (KVP 5 and 6 do not show up).

How do I draw more than 4 KVPs?

share|improve this question
3  
Can you turn your code into a complete compilable example? –  Alan Munn Jun 15 '11 at 0:57
add comment

1 Answer

up vote 4 down vote accepted

When using multi-part rectangular nodes with the shapes.multipart library, the shape can be split into a maximum of twenty parts. However, only four boxes are allocated by default.

To use the rectangle split shape with more than four boxes, the extra boxes must be allocated first, and this can be done using the key rectangle split parts=<number>.

A little example: on the left the wrong result (only the default four parts are shown and the last two are lost); on the right, the correct output (after using rectangle split parts=6):

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}

\begin{document} 

\begin{tikzpicture}
\node[draw,rectangle split] 
  at (0,0)
  {a\nodepart{two}b\nodepart{three}c\nodepart{four}d\nodepart{five}e\nodepart{six}f};
\node[draw,rectangle split,rectangle split parts=6] 
  at (2,0)
  {a\nodepart{two}b\nodepart{three}c\nodepart{four}d\nodepart{five}e\nodepart{six}f};
\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
    
Your wording suggests the example is going to demonstrate rectangle split allocate boxes, but there's no mention of that key in the example. –  Rob Kennedy Apr 17 at 16:33
    
@RobKennedy You're right. I've corrected the example. Thnaks. –  Gonzalo Medina Apr 17 at 18:48
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.