Home / what to draw generator / Treedrawingtutorial - Massachusetts Institute of Technology

Treedrawingtutorial - Massachusetts Institute of Technology - what to draw generator


Treedrawingtutorial - Massachusetts Institute of Technology-what to draw generator

Tree drawing tutorial
Suzana Fong | Syntax 24.902
sznfong@mit.edu
September, 2016
The goal here is to provide a very short and practical tutorial to get things done when it comes to drawing
syntactic trees. I try to summarize the workings of one online generator and two LaTeX packages, so this
is by no means intended as an exhaustive list of resources.
1 An online tree-generator: RSyntaxTree
? You can access it through this link.
? As the title says, this is an online generator. One of its advantages is that you don't have to install
anything on your computer and you can use it from any computer. It is also free.
? A further advantage is that it creates tree diagrams from linear representations using brackets. These
representations are often used in syntax papers and books, so this is something you will know any-
way. If not, don't worry! Bracket representations are pretty straightforward.
? The generator also provides resources to format the tree (e.g., color vs. black and white trees, differ-
ent fonts and sizes, output formats etc).
1.1 How to use it
? Here is a tree diagram for the DP the cake:1
? How to draw this DP:
Brackets represent tree nodes and branching.
The label is inserted after the left bracket, e.g., [DP
This is the very first tutorial I am writing. If you have any suggestions, complaints or comments, I will be very happy to hear
from you! Also, should you have any question, feel free to ask.
1Regarding the trees here, maybe you will be familiar with other labels, conventions and presuppositions. The point here is to
see how a tree diagram can be drawn with RSyntaxTree.
1
Tree drawing tutorial 24.902 (Fall/2016)
Suppose you want DP to be a binary branching node. Then, insert a pair of brackets for each
of the intended daughters: [DP [][]]
- More generally: if you want a given node to be an X -ary branching node, then insert X
pairs of brackets inside this node.
- You can try exercise 1 below.
Now, [DP [][]] won't give us anything. We have to add labels to the brackets: [DP [D ][NP]]
Suppose we want NP to have a single child, as we see in our target representation. Just apply
the general rule, i.e., insert a single pair of brackets: [DP [D ][NP [N ]]]
The last step is to add the lexical entries as the terminal nodes. Add a single space after the
label, insert the lexical entry and then hit the space bar again. Once we add the and cake, this
is the final result: [DP [D the ][NP [N cake ]]]
- NB: This is the order that I thought would be the easiest way to present what there must be
in the bracket representation to generate a tree. Once you get used to the generator, you
will have your own way of drawing trees.
? We can also use triangles to summarize chunks of the tree whenever we don't want to show its in-
ternal structure.
This is good to know, but not good practice for your homework!
Suppose we want to draw the DP the conclusion that syntax is fabulous.
The conclusion with a placeholder for its complement looks like this:
[DP [D the ][NP [N conclusion ][CP ]]]
Just write the longer phrase inside the CP bracket. The longer phrase will be automatically
converted into a triangle.
[DP [D the ][NP [N conclusion ][CP that syntax is fabulous]]]
Exercises
1. Draw a ternary-branching mini-tree with A as the mother and B, C and D as the daughters.
2. Work out the syntax to generate the following tree:
2
Tree drawing tutorial 24.902 (Fall/2016)
? Tip: the syntax for subscripted indexes is _i, where i is the index.
2 Drawing trees with LATEX
Before getting to trees:
? This is a short and very useful tutorial for all things linguistics if you use LaTeX. It summarizes in a
very direct way some of the most used packages that linguists use.
? Packages that may be particularly useful for linguists are those used to number examples. Linguex
is the easiest option. Gb4e is a little more complex, but is also more refined.
2.1 Qtree
? Qtree is possibly the most straightforward package to draw syntactic trees with LaTeX.
? It also generates trees from bracket representations.
2.1.1 How to use it
? Let's start with our cake example again:
DP
D NP
the N
cake
? This is what you need in your preamble: \usepackage{qtree}
? Here is the syntax: \Tree [.DP [.D the ] [.NP [.N cake ] ] ]
If you're following this tutorial linearly: notice how the notation is similar to that used in RSyn-
taxTree. But also pay attention to the crucial differences below.
Notice the use of dots before the labels. Things go wrong if you forget them.
Notice also the space between either a label or a terminal node and the left bracket. If you
forget it, it could even be the case that no file will be generated.
3