I'm using qtree
and a tree with five children works perfectly:
\documentclass{standalone}
\usepackage{qtree}
\begin{document}
\Tree[.n 1 2 3 4 5 ]
\end{document}
But when I add another node:
\documentclass{standalone}
\usepackage{qtree}
\begin{document}
\Tree[.n 1 2 3 4 5 6 ]
\end{document}
It prints a single 6
. Checking the package documentation (warning: pdf) there seems to be a constraint of 5 children per node, and the reason eludes me.
What is the correct way to build such a tree?
Best Answer
If you do not object to using
tikz
, you have a number of more flexible options.tikz
has atrees
library but you will probably prefer something with a brackets-type syntax.tikz-qtree
is one option.forest
is another.tikz-qtree
This option lets you keep using just the same syntax as
qtree
.forest
This option requires you to use a different syntax but it should nonetheless be rather familiar in many respects. The pay-off comes in the form of greater power and flexibility. While that's not needed for this example, it would be worth switching if you have more demanding trees to draw.
Or perhaps: