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.

If I draw the following node, I'd expect to get four squares:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
\begin{document}
\begin{tikzpicture}[multibox/.style={draw,
  rectangle split,
  inner sep=0cm,
  rectangle split empty part width=0.3cm,
  rectangle split empty part height=0.3cm}]
\node[multibox] {};
\end{tikzpicture}
\end{document}

But the resulting rectangles are wider than expected. What parameter am I missing?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

Quoting from the manual p.450 (v.2.10)

When split vertically, the rectangle split will observe any minimum width requirements but any minimum height will be ignored. Conversely when split horizontally, minimum height requirements will be observed, but any minimum width will be ignored.

So, following this advice, the following gives 4 squares.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
\begin{document}
\begin{tikzpicture}[multibox/.style={draw,
  rectangle split,
  inner sep=0cm,
  minimum width=3mm,
  rectangle split empty part height=3mm}]
\node[multibox] {};
\end{tikzpicture}
\end{document}

My guess is that one of the options is for the vertical mode and the other is for the horizontal. However, you provided both in the vertical mode.

share|improve this answer
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.