I have modified the example from the tikz-qtree
documentation to form this LFG style c-tree, but am having difficulty balancing the binary branches in general, and the IP branches and roof/triangle DP 'the cat' in particular.
My question is how to control the vertical distance between each mother and daughter node so that branches can be made reasonably parallel to each other when comparing level to level? And how to fix the upside-down shorthand DP triangle, and also shorten the width of both triangles to better match the text width? Would very much appreciate suggestions.
\documentclass[12pt]{article}
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\begin{document}
\tikzset{level 1/.style={level distance=10pt,sibling distance=10pt}}
\tikzset{level 2/.style={level distance=20pt,sibling distance=10pt}}
\tikzset{level 3/.style={level distance=40pt,sibling distance=15pt}}
\begin{tikzpicture}[level 1,level 2,level 3]
\tikzset{every tree node/.style={align=center,anchor=north}}
\tikzset{inner ysep=3pt,outer ysep=0pt}
\Tree%
[. {IP} [.\node{Spec=|\\Subj=|\\[-2pt]DP}; \edge[roof]; {the cat} ]
[.\node{U=D\\VP}; \node{U=D\\V\0\\[-4pt]sat};
[.\node{Pcase=|\\PP}; [.\node{U=D\\P\0\\[-5pt]on}; ]
[.\node{Obj=|\\DP}; \edge[roof]; {the mat} ] ] ]
]%
\end{tikzpicture}
\end{document}
@Alan Munn: Yes, exactly. I would prefer to have the DP of 'the cat' lined up horizontally with the VP just as you say. In general what I would like to do is to make the left branch from IP to DP shorter but parallel with the other leftwards branches: that is, parallel to VP to V-zero and PP to P-zero leftwards branch and ditto with all the rightwards branches.
I guess my question is: how do you shorten or lengthen each single branch of the c-tree from each mother node to each daughter node?
The code [inner xsep=0pt] etc. works well in reducing the width of the bottom line of the triangle: thank you for that. But the DP triangle 'the cat' is still upside down. Unfortunately I am not allowed to upload a jpg to this site of the c-tree as MikTeX produces it on my computer. It appears that having multiple levels of lines in each node in the style of LFG syntactic theory plays havoc with the binary branches.
level distance
andsibling distance
from thelevel 3
style that is used for the entire tree. As it is, this doesn't provide enough space for theDP
triangle to grow upward. Increase thelevel distance
oflevel 3
to50pt
or60pt
and the triangle looks better. I don't know if/how it's possible to specify different level distances within a tree.tikz-qtree
uses a different mechanism for drawing the trees, as this doesn't work in your case.