I’m trying to make a horizontal probability tree as pictured below using the Forest package.
Currently, I am able to get a regular forest tree using the following code
\usepackage{forest}
\begin{document}
\begin{forest}
[A
[B[D][E]]
[C[F][G]]
]
\end{forest}
\end{document}
I also know that you can add edge labels manually by specifying, for instance:
[D;edge label = {node[midway,above]{$\frac{3}{5}$}}]
However, since I will be making these trees quite frequently, I was hoping to have the edge labels automatically placed either above or below. As well, there may be more than two branches per node, in which the edge label should default to the top.
I’ve seen code like:
[D;$\frac{3}{5}$]
But I’m not too sure how to achieve that.