[
LaTeX for Linguists, .dvi, .ps, .pdf, TestFile]
A number of excellent packages and other tools have been developed
which make drawing trees one of the easier tasks in LaTeX. Several
are described here. In some
ways, the main problem is the range of choice available. For what it
is worth, I recommend:
- the qtree package for general purposes (it
handles trees with up to five daughters, and to a depth of 20. For simple
trees (i.e. with atomic categories), the syntree
package, by Matijs van
Zuijlen looks very simple and easy to use.
- I very often use the parsetree package. It is
good so long as you want no more than ternary trees (i.e. you
want no more than three daughters for any node).
- For more power and flexibility, I recommend Ralf Vogel's
xyling package (see
below), e.g. this package supports labeling of branches as well as
nodes, `long distance movement arrows', and much more.
Otherwise, you will have to look around and make up your own mind and
choose one (or more) of these packages.
It is probably worth saying that there is no reason why you should only use one
package all the time - some things are easier to do, or get nicer results with
one package, other things with another. You may even want to use several packages within one
document (e.g. if you have very different kinds of tree).
A general note: several of these packages (marked "[PostScript]") use
what are called `PostScript Specials' to draw lines, rather than using
LaTeX's native apparatus. This should not be a problem with modern TeX
installations, but depending on the previewer you use, this may mean
that you will not be able to see the lines when you preview LaTeX's dvi
output. There may be a similar complication if you use pdftex
to
produce pdf output. If you have this problem, it seems that using normal
TeX/LaTeX to produce dvi, and then a tool like dvipdfm or ps2pdf to
produce the pdf works okay. (Thanks to Joost Kremers for pointing this last
point out).
Another general note: many of these packages provide very nice, intuitive,
ways of drawing trees (e.g. by essentially specifying labeled bracketing).
This is very nice, but it has a downside: you will not generally be able
to use these methods inside commands that you define yourself. For example,
if you have a particularly complicated piece of tree (perhaps it has lots
complicated semantics in the labels or something) which you need to appear
in several places, you might want to define a command to draw it, and just
repeat this command in different places. You will not be able to
do this with such packages (you may have to find out about the underlying
commands, or use a different package in addition to your normal one --
there is not reason why you have to restrict yourself to one package for everything).
Access to the documentation for the following packages is provided here, in some
fashion or other:
LaTeX for Linguists,
Doug Arnold,
doug@essex.ac.uk,
October 19, 2009.