# forest styling - Horizontal tree similar to a folder tree

I would like to obtain the following formatting for a tree with the excellent package forest only. Maybe the example in page 82 of the documentation or this other post could be a starting point.

Here is the code for a horizontal standard tree.

\documentclass[12pt,a4paper]{article}

\usepackage{forest}

\begin{document}

\begin{forest}
for tree = {%
grow'  = 0,
l      = 2.5cm,
parent anchor=east,
s sep  = 1.2cm,
},
[
[A
[B]
[C
[D]
[E]
]
]
[F]
]
\end{forest}
\end{document}


With plain tikz

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{positioning,calc}

\begin{document}
\begin{tikzpicture}
\draw[line width=2pt] (0,0)node(a){}--(12,0)node[fill=white](B){B};
\node[fill=white]at ($(a)!0.50!(B)$) (A) {A};
\node[fill=white, below=of A, yshift=-4cm] (F){F};
\draw[line width=2pt] ($(a)!0.10!(B)$) |-(F);
\node[fill=white, below=of B, yshift=-1cm] (C){C};
\draw[line width=2pt] ($(a)!0.60!(B)$) |-(C);
\node[fill=white, right=of C, xshift=2cm] (D){D};
\draw[line width=2pt] (C) --(D);
\node[fill=white, below=of D, yshift=-1cm] (E){E};
\draw[line width=2pt] ($(C)!0.20!(D)$) |-(E);
\end{tikzpicture}

\end{document}

• Thanks for this but I really need to do that with forest because this would be a way among another to display probabilistic trees. Jul 31 '20 at 14:14