summaryrefslogtreecommitdiff
path: root/info/forest-quickstart
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-06-29 03:03:16 +0000
committerNorbert Preining <norbert@preining.info>2020-06-29 03:03:16 +0000
commit0bab86b3e25de6a7fd454127e21a7074346e96d3 (patch)
tree996ce4d3e2b508d26d09bb44e905c7c0a018c1ed /info/forest-quickstart
parentb744c27771c8d669144b77ff52439d43a5596ff2 (diff)
CTAN sync 202006290303
Diffstat (limited to 'info/forest-quickstart')
-rw-r--r--info/forest-quickstart/ForestQuickstart.pdfbin499174 -> 0 bytes
-rw-r--r--info/forest-quickstart/README18
-rw-r--r--info/forest-quickstart/README.md3
-rw-r--r--info/forest-quickstart/forest-quickstart.pdfbin0 -> 102723 bytes
-rw-r--r--info/forest-quickstart/forest-quickstart.tex (renamed from info/forest-quickstart/ForestQuickstart.tex)239
5 files changed, 169 insertions, 91 deletions
diff --git a/info/forest-quickstart/ForestQuickstart.pdf b/info/forest-quickstart/ForestQuickstart.pdf
deleted file mode 100644
index c2c7ac5e3a..0000000000
--- a/info/forest-quickstart/ForestQuickstart.pdf
+++ /dev/null
Binary files differ
diff --git a/info/forest-quickstart/README b/info/forest-quickstart/README
deleted file mode 100644
index 3987ffb02f..0000000000
--- a/info/forest-quickstart/README
+++ /dev/null
@@ -1,18 +0,0 @@
-LaTeX package: Forest Quickstart Guide for Linguists
-[2016/11/12]
-
-Copyright (c) 2016 Guido Vanden Wyngaerd
-guido.vandenwyngaerd@kuleuven.be
-
-ABSTRACT
-
-`forest' is a pgf/tikz-based package for drawing linguistic (and other
-kinds of) trees. This manual provides a quickstart guide for linguists with just the essential things that you need to get started.
-
-LICENSE
-
-Ver­ba­tim copies of this work may be copied and dis­tributed under the conditions of the GNU Free Doc­u­men­ta­tion Li­cense, either version 1.3 of this license or (at your option) any later version.
-
-The latest version of this license is in
-
-https://www.ctan.org/license/fdl
diff --git a/info/forest-quickstart/README.md b/info/forest-quickstart/README.md
new file mode 100644
index 0000000000..5dacd5f14e
--- /dev/null
+++ b/info/forest-quickstart/README.md
@@ -0,0 +1,3 @@
+# forest-quickstart
+Quick and brief documentation for the forest package for drawing trees.
+Forest is a pgf/tikz-based package for drawing linguistic (and other kinds of) trees. This manual provides a quickstart guide for linguists with just the essential things that you need to get started.
diff --git a/info/forest-quickstart/forest-quickstart.pdf b/info/forest-quickstart/forest-quickstart.pdf
new file mode 100644
index 0000000000..7a3842cf18
--- /dev/null
+++ b/info/forest-quickstart/forest-quickstart.pdf
Binary files differ
diff --git a/info/forest-quickstart/ForestQuickstart.tex b/info/forest-quickstart/forest-quickstart.tex
index 9cef16032e..b2b3b7fb1f 100644
--- a/info/forest-quickstart/ForestQuickstart.tex
+++ b/info/forest-quickstart/forest-quickstart.tex
@@ -1,25 +1,30 @@
-\documentclass[12pt]{article}
-\usepackage[T1]{fontenc}
-\usepackage[utf8]{inputenc}
-\usepackage{tipa} %phonetic symbols
-%\usepackage{ulem}
+\documentclass[english,12pt]{article}
+\usepackage[bitstream-charter]{mathdesign} %math font close to Charis SIL
+\usepackage[no-math]{fontspec}
+\setmainfont{Charis SIL}
\usepackage{multirow}
\usepackage[authoryear]{natbib}
-\usepackage[dutch,english]{babel}
+\usepackage[english]{babel}
\usepackage{enumitem}
\usepackage{varioref}
-\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{subscript}
-\usepackage{xyling} % for trees
\usepackage{stmaryrd}
\usepackage{framed}
\usepackage{listings}
\usepackage{multicol}
\usepackage[normalem]{ulem}
-\usepackage{gentium}
+\usepackage{needspace}
\usepackage[colorlinks]{hyperref}
\usepackage[linguistics]{forest}
+\forestset{
+fairly nice empty nodes/.style={
+ delay={where content={}{shape=coordinate,
+ for siblings={anchor=north}}{}},
+ for tree={s sep=4mm}},
+}
+\usepackage{tikz}
+\usetikzlibrary{arrows}%load specific libraries for tikz
\usepackage{linguex} %for linguistic example numbers
\setlist{nolistsep} %reduce space between items in lists
\renewcommand{\firstrefdash}{} %no dash in example references eg (3a) not (3-a)
@@ -33,9 +38,11 @@ guido.vandenwyngaerd@kuleuven.be}
\maketitle
+\tableofcontents
+
\section{Introduction}
-\texttt{Forest} is a package for drawing linguistic trees developed by \href{http://spj.ff.uni-lj.si/zivanovic/}{Sašo Živanović}. This manual provides a quickstart guide for linguists with just the essential things that you need to get started. More extensive documentation is available from the \href{https://www.ctan.org/pkg/forest}{CTAN-archive}. \texttt{Forest} is based on the TikZ package; more information about its commands, in particular those controlling the appearance of the nodes, the arrows, and the highlighting can be found in the \href{https://sourceforge.net/projects/pgf/}{TikZ documentation}.
+\texttt{Forest} is a package for drawing linguistic (and other) tree diagrams developed by \href{http://spj.ff.uni-lj.si/zivanovic/}{Sašo Živanović}. This manual provides a quickstart guide for linguists with just the essential things that you need to get started. More extensive documentation is available from the \href{https://www.ctan.org/pkg/forest}{CTAN-archive}. \texttt{Forest} is based on the TikZ package; more information about its commands, in particular those controlling the appearance of the nodes, the arrows, and the highlighting can be found in the \href{https://sourceforge.net/projects/pgf/}{TikZ documentation}.
\section{Loading Forest}
@@ -64,7 +71,7 @@ The \texttt{linguistics} option makes for nice trees, in which the branches meet
[CP[C][IP[I][VP[V][NP]]]]
\end{forest}
\end{lstlisting}
-\texttt{Forest} will parse the above code without problem, but you will soon get lost in your labelled brackets with more complicated trees if you write the code this way. The better alternative is to arrange the nodes over multiple lines:
+\texttt{Forest} will parse the above code without problem, but you are likely to soon get lost in your labelled brackets with more complicated trees if you write the code this way. The better alternative is to arrange the nodes over multiple lines:
\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
\ex. \begin{forest}
@@ -92,7 +99,7 @@ One important caveat: be careful not to insert any empty lines in your code, as
]
[T$'$
[T [might] ]
- [AgrP [\ldots]]
+ [VP [fill your tree]]
]
]
\end{forest}
@@ -108,7 +115,7 @@ One important caveat: be careful not to insert any empty lines in your code, as
]
[T$'$
[T [might] ]
- [AgrP [\ldots]]
+ [VP [fill your tree ]]
]
]
\end{forest}
@@ -118,7 +125,7 @@ One important caveat: be careful not to insert any empty lines in your code, as
Although \texttt{forest} will arrange the nodes in the tree for you, you can still adjust both the horizontal and the vertical spacing, and the empty space around the nodes. The horizontal spacing is controlled by the \texttt{s sep} command, the vertical (or level) spacing by the \texttt{l} command. The \texttt{inner sep} command controls the empty space around the nodes.
-You can specify absolute values for these parameters, as in the example below, or increase or decrease their default values as calculated by \texttt{forest}. This is done either by multiplication (e.g. \texttt{l*=3} multiplies the default by 3), or by addition or subtraction (e.g. \texttt{l+=3mm} adds 3mm to the default, \texttt{l-=3mm} subtracts 3mm).
+You can specify absolute values for these parameters, as in the example below, or increase or decrease their default values as calculated by \texttt{forest}. This is done either by multiplication (e.g. \texttt{l*=3} multiplies the default level distance by 3), or by addition or subtraction (e.g. \texttt{l+=3mm} adds 3mm to the default level distance, \texttt{l-=3mm} subtracts 3mm).
These parameters can be applied globally, to the entire tree, as follows:
@@ -138,17 +145,31 @@ for tree={s sep=10mm, inner sep=0, l=0}
\ex. \begin{forest}
for tree={s sep=10mm, inner sep=0, l=0}
[CP [C]
- [IP [I]
+ [IP [I \\ {[\textsc{3sg}]} ]
[VP [V] [NP]
]
]
]
\end{forest}
-This tree has wider horizontal spacing, less level distance, and less empty space around the nodes than the tree in \ref{1}.
+This tree has wider horizontal spacing, less level distance, and less empty space around the nodes than the tree in \ref{1}.
+
+Also notice how we get square brackets in the tree, as in the [\textsc{3sg}] feature set under I. Normally, \texttt{forest} would interpret square brackets as instructions to create a new node, but by enclosing them between \verb|{ }| they will appear as such in the output.
+
+If you like this way the tree looks, you might want to use the \texttt{level}, \texttt{inner sep} and \texttt{s sep} settings for all your trees. This can be done by adding the relevant settings to your preamble (somewhere after the line with \verb|\usepackage[linguistics]{forest}|):
+
+\needspace{3\baselineskip}
+\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
+\forestset{
+default preamble={for tree={s sep=10mm, inner sep=0, l=0}
+}
+\end{lstlisting}
+
+\noindent More options can be added inside the \verb|\forestset| environment: just separate them by a comma.
-The commands that adjust horizontal and vertical spacing can also be applied locally, either to a single node, or to all the nodes dominated by a node (i.e. a subtree). Applying the parameter to a single node is done by putting a comma after the node label and then issuing the relevant command.
+The commands that adjust horizontal and vertical spacing can also be applied locally, either to a single node, or to all the nodes dominated by a node (i.e. a subtree). Applying the parameter to a single node is done by putting a comma after the node label and then issuing the relevant command, as shown in \Next.
+%\needspace{8\baselineskip}
\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
\ex. \begin{forest}
for tree={s sep=10mm, inner sep=0, l=0}
@@ -156,25 +177,29 @@ for tree={s sep=10mm, inner sep=0, l=0}
[C]
[IP
[I]
- [VP [V]]]]
+ [VP
+ [V][{NP, PP}]
+]]]
\end{forest}
\end{lstlisting}
+\noindent The comma following the node label CP is an instruction to \texttt{forest} that whatever follows it is not part of the node label, but an instruction for typesetting, in this case to adjust the value for the \texttt{s sep} at this node. We will come across such commas on multiple occasions later on. This means your node labels must be placed between \verb|{ }| if they contain commas.
+
\ex. \begin{forest}
for tree={s sep=10mm, inner sep=0, l=0}
[CP, s sep=20mm [C]
[IP [I]
- [VP [V]]
+ [VP [V][{NP, PP}]]
]
]
\end{forest}
-In \Last, the daughters of the CP node get an increased horizontal spacing; the setting at the CP node overrides the global setting for the rest of the tree. You can also apply the setting to a subtree by applying the \texttt{for tree} command to a particular node:
+In \Last, the daughters of the CP node get increased horizontal spacing; the setting at the CP node overrides the global setting for the rest of the tree. You can also apply the setting to a subtree by applying the \texttt{for tree} command to a particular node:
\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
\ex. \begin{forest}
for tree={s sep=10mm, inner sep=0, l=0}
-[CP
+[CP
[C]
[IP, for tree={s sep=20mm}
[I]
@@ -186,7 +211,7 @@ for tree={s sep=10mm, inner sep=0, l=0}
\ex. \begin{forest}
for tree={s sep=10mm, inner sep=0, l=0}
-[CP
+[CP
[C]
[IP, for tree={s sep=20mm} [I]
[VP [V] [NP]]
@@ -196,9 +221,8 @@ for tree={s sep=10mm, inner sep=0, l=0}
Here increased horizontal distance has been applied to the subtree dominated by IP.
-In order to produce a slanted rather than a vertical line under a nonbranching node, you can insert a phantom node. A phantom node has no label; the \texttt{phantom} command tells \texttt{forest} not to draw a line to this phantom node, as in the example below. Without the phantom node, a vertical line would connect CP to IP:
+In order to produce a slanted rather than a vertical line under a nonbranching node, you can insert a phantom node. A phantom node has no label; the \texttt{phantom} command tells \texttt{forest} not to draw a line to this phantom node, as in the example below. Without the phantom node, a vertical line would connect CP to IP.
-\pagebreak
\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
\ex. \begin{forest}
for tree={s sep=10mm, inner sep=0, l=0}
@@ -222,7 +246,7 @@ for tree={s sep=10mm, inner sep=0, l=0}
\section{Triangles}
-Triangles are easy to produce with the \texttt{roof} command, which you put before the closing bracket of the node that you want a triangle above.
+Triangles are easy to produce with the \texttt{roof} command, which you put after a comma which follows the node label of the node that you want a triangle above.
\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
\ex. \begin{forest}
@@ -251,7 +275,7 @@ for tree={s sep=10mm, inner sep=0, l=0}
]
\end{forest}
-Sometimes you may want to reduce the width of a triangle in order to get a more balanced tree. This is easily done by putting a double backslash before the terminals that you want to move to a line below:
+Sometimes you may want to reduce the width of a triangle in order to get a more balanced tree. This is achieved by putting a double backslash before the terminals that you want to move to a line below:
\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
\ex. \begin{forest}
@@ -269,7 +293,7 @@ for tree={s sep=10mm, inner sep=0, l=0}
\end{lstlisting}
\ex. \begin{forest}
-for tree={s sep=10mm, inner sep=0, l=0}
+for tree={s sep=4mm, inner sep=0, l=0}
[CP
[C]
[IP
@@ -282,7 +306,61 @@ for tree={s sep=10mm, inner sep=0, l=0}
]
\end{forest}
-\clearpage
+\section{Unlabelled nodes}
+
+Sometimes you want to leave nodes in the tree unlabelled. Just leaving out these labels is fine as far as the \texttt{forest} syntax is concerned, but the result shows a rather uncomfortable gap where the node label would normally be:
+
+\ex.
+\begin{forest}
+for tree={s sep=4mm, inner sep=0, l=0}
+[[A]
+ [[B]
+ [[C][D]]
+ ]
+]
+\end{forest}
+
+The solution is to define a style, which is called \texttt{fairly nice empty nodes}, and which you can put in the document preamble.
+
+\begin{verbatim}
+\forestset{
+fairly nice empty nodes/.style={
+delay={where content={}
+{shape=coordinate, for siblings={anchor=north}}{}},
+for tree={s sep=4mm}
+}
+}
+\end{verbatim}
+
+\noindent We can now specify this is style in the code of the above tree, as follows:
+
+\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
+\ex.
+\begin{forest}
+fairly nice empty nodes,
+for tree={inner sep=0, l=0}
+[[A]
+ [[B]
+ [[C][D]]
+ ]
+]
+\end{forest}
+\end{lstlisting}
+
+\noindent The result is shown in \Next.
+
+\ex.
+\begin{forest}
+fairly nice empty nodes,
+for tree={inner sep=0, l=0}
+[ [A]
+ [ [B]
+ [[C][D]]
+ ]
+]
+\end{forest}
+
+
\section{Horizontal alignment of terminals}
You can align all the terminals horizontally with the \texttt{tier=word} command.
@@ -317,7 +395,7 @@ for tree={s sep=10mm, inner sep=0, l=0}
\section{Arrows}
-Arrows are drawn using the \verb|\draw| command. This command takes two arguments, which specify the source and the target of the movement, respectively. The source and the target are defined by giving a name to the relevant nodes in the tree with the \texttt{name} command. In the example below, the target is named \texttt{tgt}, and the source \texttt{src}. The \verb|\draw| command tells \texttt{forest} to draw a line from \texttt{src} to \texttt{tgt}. Place the command following the final closing bracket of your tree.
+Arrows are made using the \verb|\draw| command, which follows TikZ syntax. This command takes two arguments, which specify the nodes in the tree that are the source and the target of the arrow, respectively. These nodes are defined by giving a name to them with the \texttt{name} command. In the example below, the target is named \texttt{tgt}, and the source \texttt{src}. The \verb|\draw| command tells \texttt{forest} to draw a line from \texttt{src} to \texttt{tgt}. Place the command following the final closing bracket of your tree.
The optional argument of \texttt{draw} is used to specify the placement of the arrow (up \texttt{[->]}, or down \texttt{[<-]}, both \texttt{[<->]}, or none \texttt{[-]}), and the line style (e.g. \texttt{dotted}). You can also specify where exactly at the source and target nodes the line should start and end by specifying this as an option with the \texttt{to} command; this is done using the option setting \texttt{south} for the bottom of the node, \texttt{north} for the top, \texttt{south west} for bottom left, etc.
@@ -353,11 +431,17 @@ for tree={s sep=10mm, inner sep=0, l=0}
\draw[->] (src) to[out=south west,in=south] (tgt);
\end{forest}
-Do not forget the semicolon at the end of the \verb|\draw| command. Note that the \verb|\sout| command (to produce strikeout in the moved DP) requires the following line in your preamble: \verb|\usepackage[normalem]{ulem}|.
+Do not forget the semicolon at the end of the \verb|\draw| command. Note that the \verb|\sout| command (to produce strikeout in the moved DP) requires the following line in your preamble: \verb|\usepackage[normalem]{ulem}|.
+
+The default arrow tips are rather tiny, which may be improved upon by specifying the \texttt{stealth'} option in the \verb|\draw| command, as shown in \Next below. The use of this option requires that you add the following lines to your preamble:
-The settings of the \texttt{in} and \texttt{out} options allow you to control the placement of arrows. This is shown in \Next, where the arrow appears at the right hand side of the tree.
+\begin{verbatim}
+\usepackage{tikz}
+\usetikzlibrary{arrows}
+\end{verbatim}
+
+\noindent The settings of the \texttt{in} and \texttt{out} options allow you to control the placement of arrows. This is shown in \Next, where the arrow appears at the right hand side of the tree, and with a curve that is the mirror image of the one in \Last.
-\pagebreak
\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
\ex.\begin{forest}
for tree={s sep=10mm, inner sep=0, l=0}
@@ -367,7 +451,8 @@ for tree={s sep=10mm, inner sep=0, l=0}
[DP]
[V$'$ [V] [\sout{DP},name=src]]]]
[DP,name=tgt]]
-\draw[->] (src) to[out=north east,in=south east] (tgt);
+\draw[->,>=stealth'] (src) to[out=north east,in=south east]
+node[pos=0.5,xshift=14mm]{DP-raising} (tgt);
\end{forest}
\end{lstlisting}
@@ -383,18 +468,41 @@ for tree={s sep=10mm, inner sep=0, l=0}
]
[DP,name=tgt]
]
-\draw[->] (src) to[out=north east,in=south east] (tgt);
+\draw[->,>=stealth'] (src) to[out=north east,in=south east] node[pos=0.5,xshift=14mm]{DP-raising} (tgt);
+\end{forest}
+
+This example also adds an annotation to the arrow, by adding a \texttt{node} preceding the target. The option \texttt{pos} lets you position the annotation nearer the source (0) or the target (1) of the arrow (\texttt{pos=0.5} places it in the middle), the \texttt{xshift} option controls horizontal placement. The default is that the annotation will be placed on the line, so you will probably want to shift it a bit to the left or right to put it beside the line. Vertical spacing is controlled with \texttt{yshift}. If you specify more than one option, they need to be separated by commas.
+
+You can also add annotations near nodes in the tree, as in \Next below. In this case, the \verb|\draw| command is put following the closing bracket of the node where you want the annotation to appear, and the entire command needs to be enclosed within \verb|{ }|. The option \texttt{node[right]} controls whether the annotation appears to the left or the right of the node. The option \texttt{(.west)} controls the point of attachment or anchor of the annotation.
+
+\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
+\ex. \begin{forest}
+for tree={s sep=10mm, inner sep=0}
+[CP
+[DP] { \draw (.west) node[left]{\textit{the subject} $\Leftarrow$}; }
+[TP]
+] { \draw (.east) node[right]{$\Rightarrow$ \textit{the clause}}; }
+\end{forest}
+
+\end{lstlisting}
+
+\ex. \begin{forest}
+for tree={s sep=10mm, inner sep=0}
+[CP [DP] { \draw (.west) node[left]{\textit{the subject} $\Leftarrow$}; }
+ [TP]
+] { \draw (.east) node[right]{$\Rightarrow$ \textit{the clause}}; }
\end{forest}
+Notice how \texttt{forest} automatically moves the entire tree to the right to make room for the annotation on the left hand side of the tree.
\section{Highlighting}
-The simplest type of highlighting of individual nodes is done by applying formatting (like bold or italic) to the node labels. Fancier forms of highlighting are achieved with the \texttt{draw} command, as in the following example:
+You can highlight either nodes in the tree, or subtrees. The simplest type of highlighting of the nodes is done by applying formatting (like bold or italic) to the node labels. Fancier forms of highlighting are achieved as in the example below. \verb|draw| is an instruction to draw a border around the node. The default shape of a node is a box, but this may be changed into a \verb|circle| or an \verb|ellipse|. The size of the node is controlled by \verb|inner sep|. You can also specify a \verb|fill| color of the node.
\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
\ex. \begin{forest}
for tree={s sep=10mm, inner sep=1mm, l=0}
-[VP,circle,draw,fill=lightgray
+[VP,circle,fill=lightgray
[\textbf{DP}]
[V$'$
[V]
@@ -406,61 +514,46 @@ for tree={s sep=10mm, inner sep=1mm, l=0}
\ex. \begin{forest}
for tree={s sep=10mm, inner sep=1mm, l=0}
-[VP,circle,draw,fill=lightgray
+[VP,circle,fill=lightgray
[\textbf{DP}] [V$'$
[V] [DP,draw,red] ]]
\end{forest}
-A subtree can be highlighted as follows:
+A subtree can be highlighted with a box, circle, or ellipse around it by specifying a TikZ command following the node label, as in the following example:
\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
\ex. \begin{forest}
for tree={s sep=10mm, inner sep=0mm, l=0}
[CP
- [XP] [IP
+[XP]
+[IP
+ [DP$_1$]
+ [VP,tikz={\node [draw,ellipse,inner sep=-1pt,fit to=tree,
+ label=below:\emph{the lexical layer}] {};}
+ [t$_1$]
+ [V$'$ [V] [DP$_2$]]
+]]]
+\end{forest}
+\end{lstlisting}
+
+\ex.
+\begin{forest}
+for tree={s sep=10mm, inner sep=0mm, l=0}
+[
+ [XP]
+ [IP
[DP$_1$]
- [VP,tikz={\node [draw,fit to=tree]{};}
+ [VP, tikz={\node [draw,ellipse,inner sep=-1pt,fit to=tree,label=below:\emph{the lexical layer}] {};}
[t$_1$]
[V$'$
- [V]
- [DP$_2$]
+ [V] [DP$_2$]
]
]
]
]
\end{forest}
-\end{lstlisting}
-
-\ex. \begin{forest}
-for tree={s sep=10mm, inner sep=0, l=0}
-[CP
- [XP] [IP
- [DP$_1$] [VP,tikz={\node [draw,fit to=tree]{};}
- [t$_1$] [V$'$
- [V] [DP$_2$] ]]]]
-\end{forest}
-
-Other types of highlighting include annotations near nodes in the tree, as in \Next below. In this case, the \verb|\draw| command is put following the closing bracket of the node where you want the annotation to appear, and the entire command needs to be enclosed within \verb|{ }|. The option \texttt{node[right]} controls whether the annotation appears to the left or the right of the node. The option \texttt{(.west)} controls the point of attachment or anchor of the annotation.
+The portion of the tree so highlighted may be accompanied by a label, as in the example. The positioning of the label may be controlled by \verb|below|, \verb|above|, \verb|left|, \verb|right|, or, more finely, by any positive or negative number between 0 and 360. This number specifies the angle with respect to a horizontal radius pointing from the center of the circle to the right (0, 360 and -360 place the label to the right of the circle, 90 and -270 place it above, 270 and -90 below, and so on).
-\begin{lstlisting}[basicstyle=\ttfamily,basewidth=0.5em]
-\ex. \begin{forest}
-for tree={s sep=10mm, inner sep=0, l=0}
-[NegP [Neg]
-{\draw (.west) node[left]{\textit{negation} $\Leftarrow$}; }
- [QP]
-]
-{ \draw (.east) node[right]{$\Rightarrow$ \textit{adjective}}; }
-\end{forest}
-\end{lstlisting}
-
-\ex. \begin{forest}
-for tree={s sep=10mm, inner sep=0}
-[NegP [Neg] { \draw (.west) node[left]{\textit{negation} $\Leftarrow$}; }
- [QP]
-] { \draw (.east) node[right]{$\Rightarrow$ \textit{adjective}}; }
-\end{forest}
-
-Notice how \texttt{forest} automatically moves the entire tree to the right to make room for the annotation on the left side of the tree.
\end{document}