Skip to content

Instantly share code, notes, and snippets.

@adodge
Created November 30, 2012 04:30

Revisions

  1. adodge created this gist Nov 30, 2012.
    57 changes: 57 additions & 0 deletions qtree_example.tex
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    % Example x-bar tree with movement
    % Alex Dodge, [email protected]

    \documentclass[12pt]{article}
    \usepackage{qtree,tree-dvips}

    % Macros for styling the leaf nodes and traces
    \newcommand{\word}[2]{#1\\#2}
    \newcommand{\trace}[1]{\emph{t$_{#1}$}}

    \begin{document}

    % Tree (qtree)
    % http://www.ling.upenn.edu/advice/latex/qtree/qtreenotes.pdf
    \Tree
    [.CP
    [.\node{topic}{DP} [.D\1
    \word{D}{die}
    [.NP [.N\1 \word{N}{Kinder} ] ]
    ] ]
    [.C\1
    \word{C}{\node{haben}{haben}}
    [.TP
    [.T\1
    [.VP
    [.V\1
    [.VP
    \word{DP}{ \node{ttopic}{ \trace{topic} } }
    [.V\1
    [.DP [.D\1
    \word{D}{diesen}
    [.NP [.N\1 \word{N}{Film} ] ]
    ] ]
    \word{V}{gesehen}
    ]
    ]
    \word{V}{\node{thaben1}{ \trace{} }}
    ]
    ]
    \word{T}{\node{thaben2}{ \trace{} }}
    ]
    ]
    ]
    ]

    % Movement (tree-dvips)
    % http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/tree-dvips/index.pdf
    \anodecurve[r]{thaben1}[b]{thaben2}{20px}
    \anodecurve[tr]{thaben2}[tr]{haben}{150px}
    \nodeoval{thaben1}
    \nodeoval{thaben2}
    {\makedash{4pt}
    \anodecurve[l]{ttopic}[bl]{topic}{100px}
    \nodeoval{ttopic}
    }

    \end{document}