Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I now switched to tikz-qtree and want to add more space between the two triangle nodes. I cannot figure out a way to do this, since the nodes are on different levels.

Is this possible?

\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}
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The spacing between the the triangles is determined by the width of the nodes that dominate them. You can wrap any node label in an explicit TikZ \node command and then specify a minimum width for the node. This will add some padding around the node and therefore increase the space between its daughters.

See How do I center this qtree? for a similar problem.

\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}

output of code

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.