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!

LaTex for Linguists

So, I’ve had this itch lately. An itch to look at my old research from graduate school and see what I could do with it. I dug up my papers, indecipherable notes, and powerpoint presentations from graduate school and decided that my research idea might be worth exploring again. The only problem I encountered was that I didn’t like the way my paper looked. It is focused on morpho-syntax in AAE, and as such, I need to include syntax trees in my essay. But they are out of place, out of alignment, and it throws off the structure of my paper. I wanted to find software that would produce nicer looking essays – something you might see in a refereed journal.

Enter LaTex. I’d heard of it before – my brother uses it for his math courses – but never tried it myself. I downloaded MacTex, which comes with TexShop, an editor and previewer for MacOS, and Tex Live Utility, which (if I’m figuring this out right) tells me what packages are installed (??? – still figuring this out).

Anyway.

I’ve been using it for a few days, and I like it so far, but there’s a learning curve re: the syntax of LaTex. First, there’s understanding the preamble, which is where you essentially set up the document size, fonts, the type of document itself, and any packages you want LaText to load.

\documentclass[a4paper, 12pt]{article}

\usepackage{qtree}

\usepackage{gb4e}

\begin{document}

Above, the type of document (article), font size (12pt), and two packages are loaded. The two packages mentioned in the preamble are {qtree} and {gb4e}. The former is used to draw trees in LaTex; the former is used for examples, like glosses.

Understanding the syntax of this software is tricky, but I am slowly getting the hang of it. Besides, I enjoy a challenge!