syntree is a Typst package for rendering syntax trees / parse trees (the kind linguists use).
Add #import "@preview/syntree:0.3.1: * somewhere in the preamble. This will add both the latest version of the package, and import the tree, syntree, and listtree functions from the library.
The name and default syntax are inspired by Miles Shang’s syntree. Here’s an example to get started:
|
|
There’s full support for formulas inside nodes; for example, #syntree[[DP$zws_i$ this]] or #syntree[[C $diameter$]]. For more flexible tree-drawing, tree can be used directly:
|
|
In addition to standard syntree bracket syntax, a list-based syntax is also provided:
|
|
And tree, syntree, and listtree all can compose with each other.
|
|
syntree aims to be a relatively minimal package and so does not provide any utilities for displaying movement or dependency relationships. However, syntree composes freely with external packages such as larrow:
|
|