I can't figure out how to align the following tree properly. The tree itself is not centered within the page and the branches are not aligned vertically nor horizontally.
I'd like the nodes to be aligned on some sort of invisible grid, and the whole thing to be centered in one single page.
Edited for clarification:
- The pink circle shows that the tree should be centered.
- The green lines show that these boxes are not aligned horizontally.
- The blue lines area: these attempt to show the invisible grid along which the nodes should be aligned vertically. In other words, the space between the blue lines should be the same throughout. Right now, for instance, the 8th Level nodes are not aligned with each other. Moreover, the space between the 7th level node and the 8th Level nodes is not the same as the space between the 8th Level nodes and the 9th Level node. Ideally, all of these spaces should be the same throughout. I've tried to adjust the space between the various Levels manually (by adding a centimeter here or 4.5 cm there), but it's not working
\documentclass{book}
\usepackage[linguistics,edges]{forest}
\begin{document}
\begin{forest}
for tree={s sep=8mm,
inner sep=4,
l=0,
forked edge,
edge={->,>=latex}}
[Priest,rounded rectangle,draw
[Matador\\ \textit{\small 1st Level},rounded rectangle,draw
[\textbf{Green Branch},rectangle,draw
[Junior Junior\\ \textit{\small 2nd Level},rounded rectangle,draw,
[Chief Eater Booster\\ \textit{\small 8th Level},rounded rectangle,draw,l=130pt
[High Chief\\ \textit{\small 10th Level},rounded rectangle,draw,l=2cm
[Grand Cookie Horsey\\ \textit{\small 12th Level},rounded rectangle,draw,l=2cm
[Obvious Receptacle\\ \textit{\small 15th Level},rounded rectangle,draw,]]]]]]
[\textbf{Ecclesiastical Branch},rectangle,draw,calign with current
[Junior Driver\\ \textit{\small 2nd Level},rounded rectangle,draw,
[Library Leader\\ \textit{\small 8th Level},rounded rectangle,draw,l=4.5cm
[Hotel Commandant\\ \textit{\small 10th Level},rounded rectangle,draw,l=2cm
[Senior Ant-eater\\ \textit{\small 12th Level},rounded rectangle,draw,l=2cm
[Administrative Daddy\\ \textit{\small 15th Level},rounded rectangle,draw,
[Mommy\\ \textit{\small 16th-17th Level},rounded rectangle,draw,l=1cm
[Grand Lord\\ \textit{\small 19th-20th Level},rounded rectangle,draw,l=1cm
[Grand Grandiose\\ \textit{\small 20th Level \& up},rounded rectangle,draw]]]]]]]]]
[\textbf{Military Branch},rectangle,draw
[Walker\\ \textit{\small 2nd Level},rounded rectangle,draw,
[Senior Walker\\ \textit{\small 5th Level},rounded rectangle,draw,
[Ranking Interviewer\\ \textit{\small 7th Level},rounded rectangle,draw,
[Astronaut\\ \textit{\small 9th Level},rounded rectangle,draw,l=2.3cm
[Doctor\\ \textit{\small 11th Level},rounded rectangle,draw,l=2cm
[Great Doctor\\ \textit{\small 16th Level},rounded rectangle,draw,l=3.5cm]]]]]]]
]
]
\end{forest}
\end{document}


l=x cmfor each node, which puts the nth Level nodes consistently vertically spaced, is this not what you want? – Marijn Aug 15 '17 at 12:49bookthe page layout itself is asymmetric (the outer margin is larger than the inner), and in addition the tree is wider than the textblock, so it sticks out in the right margin. To center the too wide tree on the textblock, you can useadjustboxor a\makebox, see e.g. https://tex.stackexchange.com/questions/39435 – Torbjørn T. Aug 15 '17 at 13:17