1

enter image description hereI am trying to make the grey boxes larger, but cannot succeed (large enough to include the playoffs). Would really appreciate some help.

Here is my code:

[![\documentclass\[11pt\]{article}
\usepackage\[utf8\]{inputenc}
\usepackage{multirow}
\usepackage\[margin=1in\]{geometry} 
\usepackage{amsmath,amsthm,amssymb,amsfonts}
 \usepackage{tikz}   %for game theory stuff
 \usepackage\[skip=1ex\]{caption}
\usetikzlibrary{calc}
\usepackage{istgame} 
\def\vpay#1#2{\begin{matrix}#1\\#2\end{matrix}}

\begin{document}


   \begin{center}
    \begin{istgame}
    \xtShowEndPoints
    \xtdistance{25mm}{70mm}
    \istrooto(0){$\text{Firm} \ 1$}
      \istb{BIG}\[l\]
      \istb{small}\[r\]
      \endist
      \xtdistance{25mm}{35mm}
    \istrooto(1)(0-1){$\text{Firm} \ 2$}
      \istb{Low}\[l\]
      \istb{High}\[r\]
      \endist
      \istrooto(2)(0-2){$\text{Firm} \ 2$}
      \istb{low}\[l\]
      \istb{high}\[r\]
      \endist
    \xtdistance{20mm}{10mm}
      \istrooto(a)(1-1){$\text{Firm} \ 1$}
      \istb{L}\[l\]{\vpay{8}{8}}
      \istb{H}\[r\]{\vpay{7}{7}}
      \endist
      \istrooto(b)(1-2){$\text{Firm} \ 1$}
      \istb{L}\[l\]{\vpay{6}{10}}
      \istb{H}\[r\]{\vpay{6}{7}}
      \endist
    \istrooto(c)(2-1){$\text{Firm} \ 1$}
      \istb{l}\[l\]{\vpay{7}{8}}
      \istb{h}\[r\]{\vpay{10}{6}}
      \endist
      \istrooto(d)(2-2){$\text{Firm} \ 1$}
      \istb{l}\[l\]{\vpay{5}{11}}
      \istb{h}\[r\]{\vpay{8}{7}}
      \endist
      \setxtinfosetstyle{dashed}
    \xtInfoset(a)(b)
    \xtInfoset(c)(d)
    \xtSubgameBox(1){(a)(b)(a-1)(b-1)(a-1)(b-2)(a-2)}
    \xtSubgameBox(2){(c)(d)(c-1)}
    %\xtSubgameBox(2){(2-1)(2-2)}\[inner sep=16pt\]
    %\xtSubgameBox(2){(2-1)(2-2)}\[solid,rounded corners=0pt,inner sep=16pt\]
    \end{istgame}

    \end{center}
    \end{document}][1]][1]

2 Answers2

2

I followed the manual of istgame to where it talks about these experimental boxes. There it is suggested to move and enlarge the boxes. This is what I did, i.e. I added [yshift=-2ex] and [inner ysep=6ex]. I am not claiming this is elegant, but at least I can blame the manual for this choice.

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry} 
\usepackage{amsmath}
\usepackage{istgame} 
\def\vpay#1#2{\begin{matrix}#1\\#2\end{matrix}}

\begin{document}
\begin{center}
\begin{istgame}
    \xtShowEndPoints
    \xtdistance{25mm}{70mm}
    \istrooto(0){$\text{Firm} \ 1$}
      \istb{BIG}[l]
      \istb{small}[r]
      \endist
      \xtdistance{25mm}{35mm}
    \istrooto(1)(0-1){$\text{Firm} \ 2$}
      \istb{Low}[l]
      \istb{High}[r]
      \endist
      \istrooto(2)(0-2){$\text{Firm} \ 2$}
      \istb{low}[l]
      \istb{high}[r]
      \endist
    \xtdistance{20mm}{10mm}
      \istrooto(a)(1-1){$\text{Firm} \ 1$}
      \istb{L}[l]{\vpay{8}{8}}
      \istb{H}[r]{\vpay{7}{7}}
      \endist
      \istrooto(b)(1-2){$\text{Firm} \ 1$}
      \istb{L}[l]{\vpay{6}{10}}
      \istb{H}[r]{\vpay{6}{7}}
      \endist
    \istrooto(c)(2-1){$\text{Firm} \ 1$}
      \istb{l}[l]{\vpay{7}{8}}
      \istb{h}[r]{\vpay{10}{6}}
      \endist
      \istrooto(d)(2-2){$\text{Firm} \ 1$}
      \istb{l}[l]{\vpay{5}{11}}
      \istb{h}[r]{\vpay{8}{7}}
      \endist
      \setxtinfosetstyle{dashed}
    \xtInfoset(a)(b)
    \xtInfoset(c)(d)
    \xtSubgameBox([yshift=-2ex]1){(a)(b)(a-1)(b-1)(a-1)(b-2)(a-2)}[inner ysep=6ex]
    \xtSubgameBox([yshift=-2ex]2){(c)(d)(c-1)}[inner ysep=6ex]
    \end{istgame}
\end{center}
\end{document}

enter image description here

1

To represent a subgame of an extensive game with the istgame package, you need to specify the root of the subgame and outermost terminal nodes. Since it does not seem that there exists a general rule to control the size of a box representing a subgame, we need to adjust the size manually. To do this, you can adjust inner sep (or inner xsep or inner ysep) of a box and shift the subroot, as mentioned in the manual.

enter image description here

Please note that, in the following example, players are printed in text mode by default and that you don't need to write down all the terminal nodes.

\documentclass{standalone}
\usepackage{amsmath}
\def\vpay#1#2{\begin{matrix}#1\\#2\end{matrix}}
\usepackage{istgame}
\begin{document}
\begin{istgame}
\xtShowEndPoints
\xtdistance{25mm}{70mm}
\istrooto(0){Firm 1}
  \istb{BIG}[al]  \istb{small}[ar]  \endist
\xtdistance{25mm}{35mm}
\istrooto(1)(0-1){Firm 2}
  \istb{Low}[al]  \istb{High}[ar]   \endist
\istrooto(2)(0-2){Firm 2}
  \istb{low}[al]  \istb{high}[ar]   \endist
\xtdistance{20mm}{10mm}
\istrooto(a)(1-1){Firm 1}
  \istb{L}[l]{\vpay{8}{8}}   \istb{H}[r]{\vpay{7}{7}}   \endist
\istrooto(b)(1-2){Firm 1}
  \istb{L}[l]{\vpay{6}{10}}  \istb{H}[r]{\vpay{6}{7}}   \endist
\istrooto(c)(2-1){Firm 1}
  \istb{l}[l]{\vpay{7}{8}}   \istb{h}[r]{\vpay{10}{6}}  \endist
\istrooto(d)(2-2){Firm 1}
  \istb{l}[l]{\vpay{5}{11}}  \istb{h}[r]{\vpay{8}{7}}   \endist
% \setxtinfosetstyle{dashed}
\xtInfoset(a)(b)
\xtInfoset(c)(d)
\xtSubgameBox([yshift=-2ex]1){(a-1)(b-2)}[inner ysep=7ex]
\xtSubgameBox([yshift=-2ex]2){(c-1)(d-2)}[inner ysep=7ex]
\end{istgame}
\end{document}

You can do the same thing without using \xtSubgameBox.

For example, \xtSubgameBox([yshift=-2ex]2){(c-1)(d-2)}[inner ysep=7ex] is just an abbreviation of the following codes:

\coordinate (xtsubroot) at ($([yshift=-2ex]2)+(0,-.3)$);
\node [rectangle,draw,dashed,inner sep=20pt,rounded corners=15pt,black!50,inner ysep=7ex] 
      [fit=(xtsubroot)(c-1)(d-2)]{};

Whichever is used depends on your choice.

Just in case where you want to make your game tree grow eastwards, you need to adjust your subgame box accordingly. (I have not found any general pattern to control the size of the box no matter what the tree growing direction is.) See also another example.

enter image description here

\documentclass[border=1pt]{standalone}
\usepackage{amsmath}
\def\vpay#1#2{\begin{matrix}#1\\#2\end{matrix}}
\usepackage{istgame}
\begin{document}
\begin{istgame}
\setistgrowdirection'{east}
\xtShowEndPoints
\xtdistance{25mm}{70mm}
\istrooto(0){Firm 1}
  \istb{BIG}[al]  \istb{small}[bl]  \endist
\xtdistance{25mm}{35mm}
\istrooto(1)(0-1){Firm 2}
  \istb{Low}[al]  \istb{High}[bl]   \endist
\istrooto(2)(0-2){Firm 2}
  \istb{low}[al]  \istb{high}[bl]   \endist
\xtdistance{20mm}{10mm}
\istrooto(a)(1-1){Firm 1}
  \istb{L}[a]{\vpay{8}{8}}   \istb{H}[b]{\vpay{7}{7}}   \endist
\istrooto(b)(1-2){Firm 1}
  \istb{L}[a]{\vpay{6}{10}}  \istb{H}[b]{\vpay{6}{7}}   \endist
\istrooto(c)(2-1){Firm 1}
  \istb{l}[a]{\vpay{7}{8}}   \istb{h}[b]{\vpay{10}{6}}  \endist
\istrooto(d)(2-2){Firm 1}
  \istb{l}[a]{\vpay{5}{11}}  \istb{h}[b]{\vpay{8}{7}}   \endist
\xtInfoset(a)(b)
\xtInfoset(c)(d)
\xtSubgameBox([xshift=-2ex]1){(a-1)(b-2)}%[inner ysep=7ex]
\xtSubgameBox([xshift=-2ex]2){(c-1)(d-2)}%[inner ysep=7ex]
\end{istgame}
\end{document}
I. Cho
  • 2,985