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 have a tree structure consisting of many unlabelled nodes. However, for some reason the nodes are far larger than I would like and appear to have a minimum size below which the minimum size key is ignored:

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
  \begin{tikzpicture}[root/.style={draw,diamond, minimum size=1mm},
                      branch/.style={draw,rectangle},
                      leaf/.style={draw,circle, minimum size=1mm},
                      level 1/.style={sibling distance=5.5em, level distance=1.5em},
                      level 2/.style={sibling distance=2em},
                      level 3/.style={sibling distance=1.5em}]
 \node [root] {}
  child { node[branch] {}
   child { node[leaf] {} }
   child { node[branch] {}
    child { node[leaf] {} }
    child { node[leaf] {} }
   }
  }
  child { node[branch] {}
   child { node[leaf] {} }
   child { node[leaf] {} }
   child { node[leaf] {} }
  }
  child { node[branch] {}
   child { node[branch] {}
    child { node[leaf] {} }
    child { node[leaf] {} }
    child { node[leaf] {} }
   }
   child { node[leaf] {} }
   child { node[leaf] {} }
  }
  child { node[branch] {}
   child { node[leaf] {} }
   child { node[branch] {}
    child { node[leaf] {} }
    child { node[leaf] {} }
   }
   child { node[leaf] {} }
 };
\end{tikzpicture}
\end{document}

Although the minimum size for the root and leaf keys is tiny the nodes are still relatively large.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You also need to adjust inner sep=2pt, depending on how small you want them.

So adjusting your styles as follows:

  \begin{tikzpicture}[root/.style={draw,diamond, minimum size=1mm,inner sep=2pt},
                      branch/.style={draw,rectangle,inner sep=2pt},
                      leaf/.style={draw,circle, minimum size=1mm,inner sep=2pt},
                      level 1/.style={sibling distance=5.5em, level distance=1.5em},
                      level 2/.style={sibling distance=2em},
                      level 3/.style={sibling distance=1.5em}]
  ...

enter image description here

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.