在 tikz-qtree 中让屋顶变小

在 tikz-qtree 中让屋顶变小

有没有办法减小屋顶的尺寸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}

\结束{文档}

答案1

tikz-qtree.tex您可以通过模仿文件并根据当前量移动三角形角来定义自己的屋顶样式node inner sep,或者为每个节点手动指定屋顶节点选项。

\documentclass{article}
\usepackage{tikz-qtree}

\begin{document}

\begin{tikzpicture}[level 1+/.style={level distance=4\baselineskip},
frontier/.style={distance from root=16\baselineskip},
roof node/.append style={inner sep=0.1pt,text height=2ex,text depth=0.3ex}
]
\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]; \node[roof node]{ketābāro}; ]
               [.{V[\begin{tabular}[t]{@{}l}
                   {\sc comps} { {1}, {2} },\\
                   {\sc cont} {4}]\\
                   \end{tabular}}
                   [.{{3} PP{7}} \edge[roof]; \node[roof node]{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}

在此处输入图片描述

相关内容