0

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.

enter image description here

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}

projetmbc
  • 13,315

1 Answers1

-1

With plain tikz

enter image description here

\documentclass{article}

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

\begin{document} \begin{tikzpicture} \draw[line width=2pt] (0,0)node(a){}--(12,0)nodefill=white{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}

js bibra
  • 21,280
  • 1
    Thanks for this but I really need to do that with forest because this would be a way among another to display probabilistic trees. – projetmbc Jul 31 '20 at 14:14