3

Possible Duplicate:
How to draw syntactical trees with parallel leafs for a natural language?

Consider page 4 in following paper: Pantcheva 2007

enter image description here

Which package can be used to draw a similar structure? (As elegant as possible)

Real Dreams
  • 8,298
  • 12
  • 56
  • 78

2 Answers2

4

There are several packages available: qtree, TikZ has built-in features to build trees, and tikz-qtree which combines features from the first two. Here's a simple example taken from the documenation of the tikz-qtree package:

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

\begin{document}

\begin{tikzpicture}
\tikzset{edge from parent/.append style={very thick}}
\Tree [.S [.NP [.Det the ] [.N cat ] ]
                 [.VP [.V sat ]
                          [.PP [.P on ]
                                   [.NP [.Det the ] [.N mat ] ] ] ] ]
\end{tikzpicture}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
1

Besides tikz you can also use pstricks, more specifically pst-tree. The syntax is \pstree{root}{successors}, where root and successors are one of the available node types, e.g. \TR, or another (nested) \pstree. More details are given in chapter 8 of the package documentation.

pstricks figures can be compiled by using latex=>PS=>PDF or any of the alternatives given on the PSTricks website.

Code for Gonzalo Medina's example:

\documentclass{article}
\usepackage{pst-tree}

\begin{document}
    %formatting
    \psset{levelsep=1.5cm,nodesepA=6pt,nodesepB=6pt,edge=\ncline}
    %main tree with root
    \pstree{\TR{S}}{
        %left subtree
        \pstree{\TR{NP}}{
            \pstree{\TR{Det}}{
                \TR{the}
            }
            \pstree{\TR{N}}{
                \TR{cat}
            }
        }
        %right subtree
        \pstree{\TR{VP}}{
            \pstree{\TR{V}}{
                \TR{sat}
            }
            \pstree{\TR{PP}}{
                \pstree{\TR{P}}{
                    \TR{on}
                }
                \pstree{\TR{NP}}{
                    \pstree{\TR{Det}}{
                        \TR{the}
                    }
                    \pstree{\TR{N}}{
                        \TR{mat}
                    }                               
                }                           
            }
        }
    }
\end{document}
dgs
  • 2,741
  • This is really not an ideal solution for linguistic trees, since there are much better solutions out there with respect to the input syntax. A better pstricks solution would be pst-qtree. It's by the same author as tikz-qtree. – Alan Munn May 22 '12 at 16:28
  • Thanks, I was not aware of the package. The brevity of the qtree syntax obviously is compelling. – dgs May 22 '12 at 16:45