我现在切换到tikz-qtree
并想在两个三角形节点之间添加更多空间。我无法找到方法来实现这一点,因为节点位于不同的级别。
这可能吗?
\documentclass{scrbook}
\usepackage{tikz}
\usepackage{tikz-qtree}
\begin{document}
\begin{tikzpicture}
\tikzset{level 1+/.style={level distance=4\baselineskip}}
\tikzset{frontier/.style={distance from root=16\baselineskip}}
\Tree[.{V[\begin{tabular}[t]{@{}l}
{\sc comps} { },\\
{\sc cont} {4}]\\
\end{tabular}}
[.{{1} NP{5}} man ]
[.{V[\begin{tabular}[t]{@{}l}
{\sc comps} { 1 },\\
{\sc cont} {4}]\\
\end{tabular}}
[.{{2} NP{6}} \edge[roof]; ketābāro ]
[.{V[\begin{tabular}[t]{@{}l}
{\sc comps} { {1}, {2} },\\
{\sc cont} {4}]\\
\end{tabular}}
[.{{3} PP{7}} \edge[roof]; {be Sepide} ]
[.{V[\begin{tabular}[t]{@{}l}
{\sc comps} { {1} NP{5}, {2} NP{6}, {3} PP{7}},\\
{\sc cont} {4} give({5}, {6}, {7})]\\
\end{tabular}} dādam ]
]
]
]
\end{tikzpicture}
\end{document}
答案1
三角形之间的间距由控制它们的节点的宽度决定。您可以在显式 TikZ\node
命令中包装任何节点标签,然后为该节点指定最小宽度。这将在节点周围添加一些填充,从而增加其子节点之间的空间。
看如何使该 qtree 居中?对于类似的问题。
\documentclass{scrbook}
\usepackage{tikz}
\usepackage{tikz-qtree}
\begin{document}
\begin{tikzpicture}
\tikzset{level 1+/.style={level distance=4\baselineskip}}
\tikzset{frontier/.style={distance from root=16\baselineskip}}
\Tree[.{V[\begin{tabular}[t]{@{}l}
{\sc comps} { },\\
{\sc cont} {4}]\\
\end{tabular}}
[.{{1} NP{5}} man ]
[.{V[\begin{tabular}[t]{@{}l}
{\sc comps} { 1 },\\
{\sc cont} {4}]\\
\end{tabular}}
[.\node[minimum width=2cm] (N) {{2} NP{6}}; \edge[roof]; ketābāro ]
[.{V[\begin{tabular}[t]{@{}l}
{\sc comps} { {1}, {2} },\\
{\sc cont} {4}]\\
\end{tabular}}
[.{{3} PP{7}} \edge[roof]; {be Sepide} ]
[.{V[\begin{tabular}[t]{@{}l}
{\sc comps} { {1} NP{5}, {2} NP{6}, {3} PP{7}},\\
{\sc cont} {4} give({5}, {6}, {7})]\\
\end{tabular}} dādam ]
]
]
]
\end{tikzpicture}
\end{document}