First of all, I want to thank the community for the help I obtained in my first question, some days ago. Having said that, I want to ask you for some help again, if I may. Essentially, I am currently using the powerful package Forest to draw Game Theory trees and, so far, so good. But now, I am faced with something that I do not know how to do and that is not explained in the (rather complex) manual of the Forest package. Essentially, I have a game (tree) with three nodes, each node being the beginning of a sub-game. I basically need to make clear that there are three sub-games in the tree. The graphical representation of what I am looking for is something like this: enter image description here

The tree that I have drawn looks like this one (and I would like to keep it): enter image description here

In a nutshell, I would like to draw the red squares of the first tree (Picture 1) on my tree (Picture 2). However, I probably need rhombus, given the form of my tree. Finally, I provide you with the code I am currently using for my tree:

\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$}}]]]]
\node[above=30pt,align=center,anchor=center] {\textbf{Figure IV.} Extensive Form of a Centipede Game Variant};

What do I need to add/change to include these squares?

Thank you all in advance.

Best Regards, Héctor.

  • 2
    Related: tex.stackexchange.com/a/233767/1952
    – Ignasi
    Commented Feb 10, 2016 at 16:56
  • 1
    @Ignasi That's very related (kind of a duplicate, I'd say).
    – Alenanno
    Commented Feb 10, 2016 at 17:04
  • Thank you both. I have been searching, but I did not come up with that one. If this is duplicate, how can I delete this question, then?
    – EoDmnFOr3q
    Commented Feb 10, 2016 at 17:18
  • 1
    Well, it may not be a duplicate if you want a rhombus.
    – cfr
    Commented Feb 11, 2016 at 3:01
  • I have finally managed to draw the squares. I also figured out how to rotate them 45º, but they look awful because the branches of the tree do not form 45º angles. I have also tried your solution and it works nicely.
    – EoDmnFOr3q
    Commented Feb 11, 2016 at 8:00

2 Answers 2


Not exactly a rhombus, but you can modify the angles and distances if that matters.

\documentclass[tikz, border=10pt, multi]{standalone}
  /tikz/my edge label/.style={inner sep=5pt, midway},
  /tikz/rhombus/.style={trapezium, trapezium left angle=105, trapezium right angle=75, draw=red},
  my rhombus/.style n args=2{
    tikz={\node [fit=#1, rhombus, inner sep=#2] {};},
  for tree={
    l sep=4em,
    s sep=11em,
    calign=fixed edge angles,
    before typesetting nodes={
      if n'=1{
        edge label/.wrap value={\noexpand node [my edge label,right] {$#1$} }
        edge label/.wrap value={\noexpand node [my edge label,left] {$#1$} }
    if n children=0{}{
  [$P_1$, my rhombus={() (current bounding box.west) (current bounding box.south east)}{12.5pt}
    [{2, 2}, edge label=D]
    [$P_2$, edge label=A, my rhombus={() (!1) (!2 2)}{7.5pt}
      [{1, 1}, edge label=d]
      [$P_1$, edge label=a, my rhombus={() (!1) (!2)}{2.5pt}
        [{0, 0}, edge label=D]
        [{3, 3}, edge label=A]


  • Thank you very much! This works nicely and it is a good alternative to the simple squares.
    – EoDmnFOr3q
    Commented Feb 11, 2016 at 8:00

A solution to use the istgame package:

enter image description here



\xtSubgameBox(1){(1-1)(2-2)}[inner sep=18pt]
\xtSubgameBox(2){(2-1)(2-2)}[inner sep=16pt]
%\xtSubgameBox(2){(2-1)(2-2)}[solid,rounded corners=0pt,inner sep=16pt]


It is your choice whether to add options like [solid,rounded corners=0pt] or color.

  • 1
    I think the OP wanted a rhombus. I didn't exactly get rhombuses, but yours are definitely rectangles!
    – cfr
    Commented Dec 16, 2017 at 16:54
  • You are right. I missed the 'rhombus' part.
    – I. Cho
    Commented Dec 18, 2017 at 1:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .