Create linguistic diagram (in TikZ?)

I want to create a dependency diagram such as the following:

So far, I have done this using TikZ:

\documentclass{article}
\usepackage{tikz}
\usepackage{calc}

\begin{document}
\def\mytext{The man}

\newlength{\basewidth}
\setlength{\basewidth}{\widthof{\mytext}}

\begin{tikzpicture}[
firstnode/.style={
shape = rectangle,
inner sep = 2pt,
anchor=south west,
}
]
\draw[thin] (0,0) -- (\basewidth + 2ex,0);
\draw[thin] (0,0) -- (0, 1.5em);
draw (0,0) \node[firstnode,
minimum width = \basewidth] {\mytext};
\end{tikzpicture}
\end{document}


Which gives me the following output:

How may I complete the diagram (in repeatable, efficient way)?

• Welcome! Did you have a look at the forest package?
– user121799
Feb 25, 2019 at 2:21
• Thanks! Yes, but those aren't the kind of diagrams I want. I need this other kind to help my students easily grasp the sentence syntax. Feb 25, 2019 at 2:28

\documentclass{article}
\usepackage[edges]{forest}
\forestset{students/.style={folder,
grow'=0,edge = {semithick},
edge path'={(!u.south-|.south west) |- (.south east)},
anchor=west,l sep=2.5em,s sep=0em}}
\begin{document}
\begin{tabular}{lll}
\begin{forest}
for tree={students}
[The man
[big]
[who lept
[nimbly]
[over the wall]
]
]
for tree={students}
[sends
[always]
[to mother
[his]
]
[because he loves her
[truly,xshift=3em]]
]
for tree={students}
[flowers
[expansive]
]
\end{forest}
\end{tabular}
\end{document}


In this update, I added the second tree for illustration and packed all the definitions in a style that you can recycle, and which allows you to make changes globally. The relative vertical alignment is adapted from this nice answer.

• That's great! But is there a way of reducing the vertical space of the nodes? Feb 25, 2019 at 2:44
• @p.lugan Of course/ Just add s sep=0em after l sep=2.5em.
– user121799
Feb 25, 2019 at 2:45
• Perfect. Just a side question: how can I manage to learn to do that by myself? The PGF/TikZ manual is simple overwhelming! Feb 25, 2019 at 2:48
• @p.lugan For this you may want to look at the forest manual first. (I will add an update. The most important thing there, apart from forest, will be this post.)
– user121799
Feb 25, 2019 at 2:52