Success! Drawing Trees in LaTex with tikz

It took me several long, long days, but at last, I have figured out a way to draw syntax trees in LaTex. Hallelujer.

A nice, simple tree – suitable for qtree. Source: me

I wound up having to move away from using the <code>qtree</code> package to draw my syntax trees in LaTex. In my opinion, it’s a great package to use for drawing simple trees, or for beginners (such as myself – I’m not trying to claim I’m an expert after two weeks of this).

But if you need to show movement in your trees – as in the example below – you might be better off using the tikz package in LaTex.

A bit more complex – showing case assignment. Source: “Drawing syntactic trees with tikz-qtree” by Andrew Murphy.

The syntax of the package is mostly similar to qtree. The learning curve comes when you need to show movement, drawing triangles, and adding labels to your trees. Thankfully, there are a lot of tutorials and videos out there to help you learn the basics.

The syntax for drawing a simple tree in tikz involves writing your trees in bracket notation. For example:

\Tree [.AuxP [.Aux' [.Aux ] [.AspP [.Asp' [.Asp ] [.VP ] ] ] ] ]

\Tree tells LaTex to begin drawing a tree with tikz. Each node is labelled (AuxP, Aux’, Aux, AspP, Asp’, Asp, and VP) and written after a dot (.). I learned the hard way that forgetting the dot can lead to seeing error messages in LaTex.

A tree showing how verbs get tense. Source: me

My trees aren’t perfect, which is hard for me to accept, because I’m a perfectionist at heart, but my trees show movement, so I consider that a win. Eventually, I’ll look up methods to center my trees, as they are left-aligned, and I’d rather have them centered (see right).

I hope to continue working on and revise this paper, and submit an abstract for an upcoming conference or two later this fall!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.