I am trying to reproduce this graph:
I've read in tikz-qtree
documentation that I need to compute the size from the root as a multiple of level distance, but I can get it to work. So far I have:
\documentclass[ twoside,openright,titlepage,numbers=noenddot,headinclude,%1headlines,% letterpaper a4paper
footinclude=true,cleardoublepage=empty,abstractoff, % <--- obsolete, remove (todo)
BCOR=5mm,paper=a4,fontsize=11pt,%11pt,a4paper,%
ngerman,american,%
]{scrreprt}
\usepackage{tikz-qtree,tikz-qtree-compat}
\usetikzlibrary{arrows,decorations.markings,babel}
\begin{document}
\begin{tikzpicture}[every node/.style={align=left}]
\tikzset{
edge from parent/.style={
draw,edge from parent
path={(\tikzparentnode.south)-- +(0,-8pt)-| (\tikzchildnode)}
},
% level 2/.style={level distance=50pt},
% frontier/.style={distance from root=150pt} % Align leaf nodes
}
\Tree [.S
[.NP
[.Rolls-Royce ] [.Motor ] [.Cars ] [.Inc ]
]
[.VP
[.said ]
[.SBAR
[.NONE ]
[.S
[.NP [.it ] ]
[. VP
[.expects ]
[.S
[.NP
[.its ] [.U.S ] [. sales ]
]
[.VP
[. to ]
[. VP
[.remain ]
[.ADJP [. steady ] ]
[.PP
[.at ]
[.NP
[.QP [.about ] [.1200 ] ]
[.cars ]
]
]
]
]
]
]
]
]
]
]
\end{tikzpicture}
\end{document}
But the result is this (does not fit the page):
What I am doing wrong?
So far I tried this recomendations:
Best Answer
May I suggest Forest for the tree and
sidewaysfigure
for the placement?First, the tree:
Even set sideways, the tree is too wide. Rather than scaling it, which should be a choice of last resort, it would be better to use a smaller font size, such as
\scriptsize
and to reduce the space between the nodes by changings sep
. Making these changes, the tree fits and will be more legible than one which was simply scaled. This is especially true if you are using optically sized fonts.