You can use the edge
key to change the default edge style for the desired childs. A little example:
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{palatino}
\usepackage{forest}
\begin{document}
\forestset{
my tier/.style={% align all nodes on a given level
tier/.wrap pgfmath arg={level##1}{level()},
},
}
\begin{forest}
for tree={
grow'=0,
child anchor=west,
parent anchor=south,
anchor=west,
calign=first,
s sep+=-5pt,
inner sep=2.5pt,
edge path={
\noexpand\path [draw, \forestoption{edge}]
(!u.south west) +(7.5pt,0) |- (.child anchor)\forestoption{edge label};
},
before typesetting nodes={
if n=1{
insert before={[, phantom, my tier]},
}{},
},
my tier,
fit=band,
before computing xy={% change the value of l to alter the distance between levels
l=30pt,
},
}
[Grandma+Steve. Steve later remarried with Betty
[Child of Grandma+Steve
[Grandchild]
[Grandchild]
]
[Child of Grandma+Steve,edge={densely dashed}
[Grandchild of Grandma+Steve]
[Half brother/sister,edge={densely dashed}]
]
[Child of Steve+Betty]
]
\end{forest}
\end{document}
The output:

That's because you're setting the caption as a node, which is also not the standard way of doing this. Captions are added to figures in a Latex document externally to the picture, i.e. they are not part of it.
Also, you're manually assigning a number to your figure and this makes the use of Latex a bit pointless, because one of the great advantages of using Latex is that captions are automatically numbered.
You can customize them, but they are automatic, so if you add another figure, they are all automatically fixed, while in your case, you'd have to fix each one manually. And that is not good in a long document.
You can add \renewcommand{\thefigure}{\Roman{figure}}
to your preamble to make figure numbering with uppercase Roman numerals, and \usepackage[labelfont=bf]{caption}
to make it bold.
Output

Code
\documentclass{article}
\usepackage{forest}
\usepackage[labelfont=bf]{caption}
\renewcommand{\thefigure}{\Roman{figure}}
\begin{document}
\begin{figure}
\centering
\caption{Extensive Form of a Centipede Game Variant}
\medskip
\begin{forest} for tree={l sep=4em, s sep=8em, anchor=center}
[$P_1$, circle, draw,
[{2, 2}, edge label={node[midway,left]{$D$}}]
[$P_2$, edge label={node[midway,right]{$A$}}, circle, draw,
[{1, 1}, edge label={node[midway,left]{$d$}}]
[$P_1$, edge label={node[midway,right]{$a$}}, circle, draw,
[{0, 0}, edge label={node[midway,left]{$D$}}]
[{3, 3}, edge label={node[midway,right]{$A$}}]]]]
\end{forest}
\end{figure}
\end{document}
Best Answer
New Answer
Use this version if you have relatively recent versions of Forest and/or TikZ. The clash described below when using
triangle
no longer applies becausetriangle
and nor do any of its libraries;shapes.geometric
no longer definestriangle
.Hence, attempting to use
triangle
will not work at all, but not because there are two competing definitions. The problem now is that there is no definition at all. However, you can useisosceles triangle
to define a newtriangle
option.I've also updated the definition of
tria
for the polygon case and tried to maketriangle
work somewhat sensibly if there are siblings. It is no longer necessary to insert empty nodes in this case, as they are inserted automatically.Current result of
triangle
[left] andtria
[right]:Code:
Original Answer
Use this version if you have older versions of Forest and TikZ and, for some reason, you cannot update.
Normally, you could specify the shape by just passing the shape's name as an option to the node. For example, this works with
ellipse
as shown on page 27 of the manual:However,
triangle
is interpreted specially byforest
as specifying a triangular edge path from parent to child:I came up with two possibilities for a triangular node shape. The first is the same as Ignasi's solution: use the
shapes.geometric
library. My version draws the edge to the triangle's apex, however, rather than to the middle of the side. The second is to useforest
's triangular edges with an empty node.Possibility 1
Possibility 2
Note that the second solution will not work well with a sibling - hence the use of two empty nodes. However, it does look somewhat neater to me. On the other hand, I'm not sure how well it will work in practice whereas the polygon solution should be relatively resilient.