# Constituency tree with triangles

> A parse tree that collapses a phrase under a roof, as linguistics papers draw it. A forest example with its LaTeX source.

A forest example in the TeXeR TikZ library: https://texer.org/library/forest/roof-tree

Package: [forest](https://texer.org/library/forest.md), on CTAN at https://ctan.org/pkg/forest.

Tags: syntax, linguistics, parse tree, roof

## Source

```latex
\usepackage[linguistics]{forest}

\begin{forest}
  for tree={font=\small}
  [S
    [NP
      [Det [every]]
      [N [student]]
    ]
    [VP
      [V [read]]
      [NP [two long papers, roof]]
    ]
  ]
\end{forest}
```

## As a complete document

The same example in a document that compiles on its own with pdfLaTeX:

```latex
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[linguistics]{forest}

\begin{document}

\begin{forest}
  for tree={font=\small}
  [S
    [NP
      [Det [every]]
      [N [student]]
    ]
    [VP
      [V [read]]
      [NP [two long papers, roof]]
    ]
  ]
\end{forest}
\end{document}
```
