%!TEX root = istgame-doc.tex

%\begin{document}
\setcounter{section}{-1}

\section{Changes and remarks}

\subsection{Changes}

Some macros have been \textsc{changed} and \textsc{removed}.
Those who have used these changed and removed macros may want to \textsc{find} and \textsc{replace} the followings:

%\begin{center}
%\begin{tabu}  {X[l1.5]X[l1.5]}  \toprule %to .5\linewidth
%\makecell[l]{\textbf{ver. 1.0}} & \makecell[l]{\textbf{ver. 2.0 or later}} \\\midrule
%\cmd{\istb.} & \cmd{\istbt} \\\tabucline- 
%\cmd{\xtInfoset'} & \cmd{\xtInfoset} \\\tabucline- 
%\cmd{\xtInfosetO'} & \cmd{\xtInfosetO} \\\tabucline- 
%\cmd{\setistgrowkey} & \cmd{\setxtgrowkey} \\\tabucline- 
%\end{tabu} 
%\end{center}

\begin{center}
\begin{tabular}  {lll}  \toprule %to .5\linewidth
\makecell[l]{\textbf{ver. 1.0}} & \makecell[l]{\textbf{ver. 2.0 or later}} \\\midrule
\cmd{\istb.} & \cmd{\istbt} \\\cline{1-2} 
\cmd{\xtInfoset'} & \cmd{\xtInfoset} \\\cline{1-2} 
\cmd{\xtInfosetO'} & \cmd{\xtInfosetO} \\\cline{1-2} 
\cmd{\setistgrowkey} & \cmd{\setxtgrowkey} \\\cline{1-2} 
\end{tabular} 
\end{center}

\paragraph{Changed and removed macros}

\begin{itemize}\tightlist
  \item The macro name \cmd{\istb.}(terminal version) has been changed 
        to \cmd{\istbt} (terminal version).   
  \begin{itemize}
  \item This is the opportunity cost of having a new macro \cmd{\istB}.
  \end{itemize}
\item The two (unsatisfactory) macros \cmd{\xtInfoset'} and \cmd{\xtInfosetO'} have been removed.
  \begin{itemize}
  \item The macro \cmd{\xtInfosetO} is completely redesigned, 
        so that we do not need the macro \cmd{\xtInfosetO'} any more.
  \item No reasons could be found to keep (even for the backward compatibility) 
        the swap versions \cmd{\xtInfoset'} and \cmd{\xtInfosetO'}, 
        except for the inconvenience to do `find and replace.'
  \end{itemize}
\item To keep consistency in naming macros, \cmd{\setistgrowkey} is renamed as \cmd{\setxtgrowkey}.
\end{itemize}


\paragraph{Redesigned macros and the environment}

\begin{itemize}\firmlist
\item \cmd{\xtInfosetO}: completely redefined to improve its function
  \begin{itemize}
  \item Now a \emph{sloped} information set is possible.
  \item It connects two nodes like \cmd{\xtInfosetO(coor1)(coor2)}, 
        but if the two coordinates are identical it represents a \emph{singleton information set} 
        by a \emph{circle} by default.
  \item This change does not seem to cause much harm, but be aware that 
        the swap version \cmd{\xtInfosetO'} has been removed and replaced by \cmd{\xtInfosetO}.
  \item Be aware also that the way to change the \emph{height} (\xw{1em} by new default) 
        of an information set has been \emph{changed}, 
        though you might not see much difference if you have only used the default information sets.
  \item With \emph{new macros} \cmd{\xtCInfoset} and \cmd{\xtCInfosetO}, a curved (even skewed curved) information set is now possible.
  \end{itemize}
\item \env{istgame} environment: (internal change)
  \begin{itemize}
  \item Now the each value of the option of \xw{xscale} and \xw{yscale}, if exists, 
        is extracted and saved at \cmd{\xtxscale} and \cmd{\xtyscale}, respectively.
        The value of \xw{scale} is also saved at \cmd{\xtscale} 
        only when it is used without \xw{xscale} nor \xw{yscale}. 
        These values are internally used to get the best outputs of trees in many ways.
  \item If the \Tikz\ arrow option \xw{->} exists in the option list of an \env{istgame} environment, 
        you can globally control the arrow-end-shorten value (by default, \xw{shorten >=0pt}) 
        by using a new macro \cmd{\setistgameshorten}. 
        This is to get a better result of branches with arrows.
  \end{itemize}
\item Some changes that you might not notice have been made, including:
  \begin{itemize}
  \item The core macros \cmd{\istroot}, \cmd{\istb}, and \cmd{\endist} have literally been redefined 
        for some purposes, but this makes no difference to users.
  \item The options \xw{thin} and \xw{solid} have been added to the definitions of basic node styles.
  \item Some default values have been slightly changed.
  \end{itemize}
\end{itemize}

\subsection{What's new}

\paragraph{Some new functions}

\begin{itemize}\tightlist
\item \emph{input mode changer} (math or text) for important labels: owners, action labels, and payoffs
  \begin{itemize}\tightlist
  \item \cmd{\setistmathTF} as the input mode changer for the important labels
  \item \cmd{\setistmathTF*} having additional function as the \emph{text font style changer}
  \end{itemize}
\item \emph{curved} (even \emph{skewed}) \emph{information sets}
  \begin{itemize}\tightlist
  \item \cmd{\xtCInfoset} for curved information sets
  \item \cmd{\xtCInfosetO} for curved bubble type information sets
  \end{itemize}
\item enhanced \emph{continuum of branches} (making \cmd{\istcntm} and \cmd{\istcntmarc} obsolete)
  \begin{itemize}\tightlist
  \item \cmd{\istrootcntm} for a continuum triangle
  \item \cmd{\istrootcntmA} for a continuum arc (with \cmd{\istbA})
  \item \cmd{\cntmAInfoset} and \cmd{\cmtmAInfosetO} for information sets for a continuum of branches
  \end{itemize}
\item \emph{arrows} and \emph{middle arrows} on branches
  \begin{itemize}\tightlist
  \item controllable arrow option \xw{->-} with \cmd{\setxtarrowtips} and middle arrow tip styles
  \item \cmd{\xtShowMidArrows} and \cmd{\xtShowArrows}
  \end{itemize}
\item and some more
  \begin{itemize}
  \item \cmd{\istB} for dual action labels
  \item \cmd{\xtTimeLineH}, \cmd{\xtTimeLineV}, \cmd{\xtCommentTo}, \cmd{\xtCommentFrom}, etc.
  \end{itemize}
\end{itemize}

\paragraph{List of new macros}
\begin{itemize}\tightlist
\item \cmd{\istbt(*)}: terminal version of \cmd{\istb(*)} 
      (replacement of the removed macro \cmd{\istb.(*)})
\item \cmd{\istB(*)}: dual action label version of \cmd{\istb(*)}
\item \cmd{\istBt(*)}: terminal version of \cmd{\istB(*)}
\item \cmd{\istbA(*)}: alternative version of \cmd{\istb(*)} (intended to work with a continuum arc)
\item \cmd{\istbAt(*)}: terminal version of \cmd{\istbA(*)}
%
\listdivider

\item \cmd{\setistmathTF}: input mode changer (math or text) for owners, action labels, and payoffs
%  \begin{itemize}\tightlist
%  \item \cmd{\istownermathtrue}, \cmd{\istactionlabelmathtrue}, \cmd{\istpayoffmathtrue}: math mode
%  \item \cmd{\istownermathfalse}, \cmd{\istactionlabelmathfalse}, \cmd{\istpayoffmathfalse}: text mode
%  \end{itemize}
\item \cmd{\setistmathTF*}: input mode and font style changer for owners, action labels, and payoffs
%  \begin{itemize}\tightlist
%  \item \cmd{\istownertextfont}, \cmd{\istactionlabeltextfont}, \cmd{\istpayofftextfont}
%  \end{itemize}
%
\listdivider

\item \cmd{\xtCInfoset}: (curved version) curved information set
\item \cmd{\xtCInfosetO}: (curved oval version) curved oval type information set
\item \cmd{\xtCInfosetOTurnX}: turns \xw{X} circles of \cmd{\xtCInfosetO} (to use it just in case)
%
\listdivider

\item \cmd{\xtInfoset*}: prints owners according to the input mode as set by \cmd{\setistmathTF(*)}
\item \cmd{\xtInfosetO*}: prints owners according to the input mode as set by \cmd{\setistmathTF(*)}
\item \cmd{\xtCInfoset*}: prints owners according to the input mode as set by \cmd{\setistmathTF(*)}
\item \cmd{\xtCInfosetO*}: prints owners according to the input mode as set by \cmd{\setistmathTF(*)} 
\item \cmd{\xtOwner*}: prints owners according to the input mode as set by \cmd{\setistmathTF(*)}
\item \cmd{\xtActionLabel*}: prints action labels according to the input mode set by \cmd{\setistmathTF(*)}
\item \cmd{\xtPayoff*}: prints payoffs according to the input mode as set by \cmd{\setistmathTF(*)}
\item \cmd{\xtInfosetOwner*}: prints owners according to the input mode set by \cmd{\setistmathTF(*)}
%
\listdivider

\item \cmd{\setxtinfosetstyle}: changes line the style (line style, fill, etc.) for all information sets
\item \cmd{\setxtinfosetlayer}: changes the layer of information sets
\item \cmd{\setxtsubgamelayer}: changes the layer of \cmd{\xtSubgameBox} and \cmd{\xtSubgameOval}
\item \cmd{\setistgameshorten}: value of the key \xw{shorten >} in \env{istgame} environment option list
%
\listdivider

\item \cmd{\cntmdistance}: analogous to \cmd{\xtdistance}, for a continuum of branches
\item \cmd{\cntmdistance*}: incorporates \cmd{\cntmdistance} with \cmd{\xtdistance}
%\item \cmd{\cntmactsibdist}: sibling distance for action branches from \cmd{\istrootcntm} and its variants
\item \cmd{\istrootcntm}: \cmd{\istroot} \xw{+} \xw{cntm}, printing a continuum of branches
\item \cmd{\istrootcntm'}: swap version of \cmd{\istrootcntm}
\item \cmd{\istrootocntm}: (oval version) \cmd{\istrooto} \xw{+} \xw{cntm}, printing a continuum triangle
\item \cmd{\istrootocntm'}: swap version of \cmd{\istrootocntm}
\item \cmd{\cntmpreset}: controls a continuum of branches (line style, color, size, fill color)
\item \cmd{\cntmpreset*}: controls a simple triangle continuum of branches with no background color
\item \cmd{\cntmistb}: similar to \cmd{\istb} for the outermost branches of a continuum triangle
\item \cmd{\cntmistb*}: draws \xw{solid node}s at the ends of the continuum outermost branches
\item \cmd{\istrootcntmA}: \cmd{\istroot} \xw{+} \xw{cntmA}, printing a continuum arc
\item \cmd{\istrootcntmA'}: swap version of \cmd{\istrootcntmA}
\item \cmd{\istrootocntmA}: (oval version) \cmd{\istrooto} \xw{+} \xw{cntmA}, printing a continuum arc
\item \cmd{\istrootocntmA'}: swap version of \cmd{\istrootocntmA}
\item \cmd{\cntmApreset}: controls the features of a continuum arc
\item \cmd{\cntmAlayerpreset}: sets the layer of a continuum wedge (with fill color)
\item \cmd{\cntmAistb}: similar to \cmd{\istb} for the outermost branches of a continuum arc
\item \cmd{\cntmAistb*}: draws \xw{solid node}s at the ends of the continuum arc outermost branches
\item \cmd{\cntmAInfoset}: prints an information set for a continuum arc
\item \cmd{\cntmAInfosetO}: oval version of \cmd{\cntmAInfoset}
\item \cmd{\xtShowEndPoints*}: shows additionally the outermost endpoints of a continuum of branches
\item \cmd{\xtHideEnpPoints*}: turns off only the endpoints of a continuum of branches
\item \cmd{\cntmAexpostShowEndPoints}: shows the two endpoints of a continuum arc
%
\listdivider

\item \cmd{\setxtarrowtips}: works through \xw{->-} to control the features of middle arrow tips
\item \cmd{\xtShowMidArrows}: shows arrows in the middle of branches
\item \cmd{\xtHideMidArrows}: hides middle arrows drawn by \cmd{\xtShowMidArrows}
\item \cmd{\setxtshowmidarrows}: controls the middle arrows on branches in a simple tree 
\item \cmd{\xtShowArrows}: shows arrows at the ends of branches with endpoints
\item \cmd{\xtHideArrows}: hides arrows drawn by \cmd{\xtShowArrows}
\item \cmd{\xtHideArrows*}: hides arrows but with endpoints remained
\item \cmd{\setxtshowarrows}: controls the features of the arrows shown by \cmd{\xtShowArrows}
%
\listdivider

\item \cmd{\xtTimeLineH}: a horizontal time-line
\item \cmd{\xtTimeLineH'}: a horizontal time-line with a label at the other end
\item \cmd{\xtTimeLineV}: a vertical time-line
\item \cmd{\xtTimeLineV'}: a vertical time-line with a label at the other end
\item \cmd{\xtCommentTo}: to leave a comment \xw{to} a node \xw{from} a \emph{relative} coordinate
\item \cmd{\xtCommentFrom}: to leave a comment \xw{from} an \emph{absolute} coordinate \xw{to} a node
%
\listdivider

\item \cmd{\xtcureslopedlabelsNS}: cures the \TikZ\ issue of sloped labels with asymmetric scales
\item \cmd{\xtcureslopedlabelsEW}: same, for a tree growing eastwards or westwards\par
      The last two macros are for only temporary use and could be removed at any time.
\end{itemize}


\paragraph{List of new arrow styles}

\begin{itemize}\tightlist
\item \xw{->-}: (controllable) middle arrow tip, taking one optional argument
\item \xw{->>-}: double middle arrow tip
\item \xw{->>>-}: triple middle arrow tip
\item \xw{-o-}: circle middle arrow tip
\item \xw{-x-}: cross middle arrow tip
\end{itemize}

\subsection{How to read this document}

%First of all, since this package is just an application of \Tikz\ to draw game trees, not for learning \Tikz, you should have basic knowledge of using \Tikz\ to take a full advantage of this package.

As a \Tikz\ user, if this is your first read of this manual, \emph{all you need to read} is Section~\ref{sec:gettingstarted} entitled ``\emph{Getting started}."
That's only \emph{four} pages long. (You can find a little secret at the first part of Section~\ref{sec:desperateusers} entitled ``\emph{Complete examples for desperate users}.")
Every example in this document is provided with its complete codes you can copy to use.
Now you can go to Section~\ref{sec:gettingstarted} to get started!

If you are not urgent, you can continue to read sections on \emph{core macros} up to Section~\ref{sec:istb}. That's about \emph{twenty} pages total. Still more time? Then read Section~\ref{sec:corelabels} (entitiled ``\emph{Important labels: players, action labels, and payoffs}") and Section~\ref{sec:setistmathTF} (entitled ``\emph{Input mode and text font style changer}").
That's about \emph{thirty} pages all total.

Throughout the manual, just disregard the parts with marks including ``\emph{fine-tuning}" or ``\emph{not for most users}," if you are not an experienced user of this package. Just reading first part of each section will suffice most users to draw game trees in almost all cases, hopefully.

If you you are an experienced user of the \pkg{istgame} package, enjoy every detail of the package.

%\clearpage
\subsection{Remarks}

\paragraph{Rules of thumb for the usage of delimiters}

Though the rules are not strictly observed, it might be useful to go over the rules of thumb for the usage of delimiters.

\begin{itemize}\tightlist
\item \verb+{ }+: contents, texts, important dimensions (mandatory or optional)
\item \xw{[ ]}: usual options, positions or directions, node types, fill color
\item \xw{( )}: coordinate related arguments, dimension as the last optional argument, special purposes
\item \xw{< >}: angles (or directions), special purposes (mostly used right before \verb+{ }+)
\item \xw{+ .. +}: only for the local change of level and sibling distances with \cmd{\istroot} and its friends
\item \xw{! !}: \xw{midpoint factor} only for curved information sets
\end{itemize}

As for the order of delimiters, the (somewhat loose) rules are as follows:

\begin{itemize}\tightlist
\item Generally, all macros are designed to avoid leaving an empty argument like \xw{[][blue]}, as possible as they can do. (This is \emph{input minimalism} for lazy users including myself!)
\item \xw{< >} is used just before \verb+{ }+, except for \xw{\istb} and its friends.
\item \xw{( )} as the last optional argument is for dimensions, like \xw{(1em)} or \xw{(3pt)}.
\item The order mostly looks like \xw{<>\{\}[]} or \xw{<>\{\}[]()}, especially after a mandatory argument.
\end{itemize}

\paragraph{Optional versions of macros}

Some macros have a starred(\xw{*}) version or a swap(\xw{'}) version, for example, \cmd{\istb*} or \cmd{\istroot'}.

\begin{itemize}\tightlist
\item \xw{* version}: just another version with different functions (in some cases, it's quite different)
\item \xw{' version}: clockwise arrangement of branches or its related version
\end{itemize}


\paragraph{Global macros}

Some macros have global effects, so you can use them outside of the \env{istgame} environment or even in the preamble of your document, but \emph{with very great caution}.

The following macros, all prefixed by \cmd{\setist...}, can be used outside of the \env{istgame} environment, to change the default values of the options:

\begin{itemize}\tightlist
\item \icmd{\setistgamefontsize}\verb+{<text size>}+ \hfill (default: \cmd{\normalsize})
\item \icmd{\setistgameshorten}\verb+{<arrow end shorten dim>}+ \hfill (default: \xw{0pt})
  \begin{itemize}
  \item This works only when \xw{->} exists in the option list of the \env{istgame} environment.
  \end{itemize}
\end{itemize}

Though it is not recommended, you can use all the macros prefixed by \cmd{\setist...} inside or outside of the \env{istgame} environment to change the default values.

\begin{itemize}\tightlist
\item \icmd{\setistmathTF}, \icmd{\setistmathTF*} \hfill (initially: \xw{011})
\item \icmd{\setistdefaultnodeinnersep} \hfill (default: \xw{1pt})
\item \icmd{\setistdefaultnodeoutersep} \hfill (default: \xw{0pt})
\item \icmd{\setistdefaultnodedrawcolor} \hfill (default: \xw{black})
\item \icmd{\setistdefaultnodefillcolor} \hfill (default: \xw{white})
\item \icmd{\setist<...>NodeStyle}
\item \icmd{\setistgrowdirection}, \icmd{\setistgrowdirection'} \hfill (default: \xw{south}): 
  \begin{itemize}
  \item You may not want to use (but still can use) this outside of an \env{istgame} environment.
  \end{itemize}
\end{itemize}

You can even do, in the preamble of your document, like:

\begin{verbatim}
      \usepackage{istgame}
        \setistgamefontsize{\normalsize}
        \setistdefaultnodedrawcolor{black}
        \setistSolidNodeStyle{2.4pt}
        \setistgameshorten{.3pt}
        \setistmathTF011
\end{verbatim}

The node styles such as \xw{ellipse node} and \xw{rectangle node} has \xw{white} as the default background color.
This means that if the paper color of your document is not white, say, \xw{blue!16}, you might not satisfy the results because the nodes have \xw{white} background.
In this case you can resolve the conflict by adding the following two lines at the very first of your document:
\begin{verbatim}
     \papercolor{blue!16}
     \setistdefaultnodefillcolor{blue!16}
\end{verbatim}

The background color of the TeXShop preview in the dark mode of \xw{macOS} \xw{Mojave} is very similar to \xw{black!16}.


\paragraph{Known problem with the \pkg{tikz-qtree} package}

It seems that 
\pkg{tikz-qtree} changes node anchors.
So, with the \pkg{tikz-qtree} package uploaded, you will get unexpected results
when you draw a game tree by using the \xw{tree} library in \TikZ.
Since \pkg{istgame} is based on the \xw{tree} library, it is also affected by \pkg{tikz-qtree}, resulting in unexpected outputs.

The best way to resolve this problem is that you DO NOT LOAD \pkg{tikz-qtree} when you draw game trees with \TikZ.
If, for some reason, you need to load \pkg{tikz-qtree} when you draw a game tree by using the \pkg{istgame} package, a temporary solution to resolve the conflict is to add the \TikZ\ option \xw{edge from parent path} in the option list of \pkg{istgame} environment as follows:

\xbigskip1
\begin{tcblisting}{listing only}
  % tikz-qtree conflict resolution (only with \usepackage{tikz-qtree})
  [
    edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}
  ]
\end{tcblisting}
%\begin{tcblisting}{listing only}
%\begin{istgame}%
%  [ % tikz-qtree conflict resolution (only with \usepackage{tikz-qtree})
%    edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}
%  ]
%  < istgame codes >
%\end{istgame}
%\end{tcblisting}
%\xbigskip1

%\tmpclearpage
\subsection{Previous changes (up to version 1.0)}

A considerable number of macro names have been changed in the version 0.8 (Jan.\@ 17, 2017) of this package.\footnote{The \pkg{istgame} package of the version older than ver.\@ 1.0 had been distributed via the KTUG (Korean TeX Users Group) Private Repository.}
The following old macro names in any previously written documents using codes in \pkg{istgame} ver.\@ 0.7 or before, should be replaced by the new names, accordingly. 

Also, \cmd{\istroot*}, \cmd{\istcntm*}, and \cmd{\xtInfoset*} should be replaced by \cmd{\istrooto}, \cmd{\istcntmarc}, and \cmd{\xtInfoseto}, respectively, in the version 1.0 or later.

%\begin{center}
%\begin{tabu} {X[l4]X[l3]X[l2]}  \toprule  % to\linewidth
%\makecell[l]{\textbf{ver.\@ 0.7 or before}}  & \makecell[l]{\textbf{ver.\@ 0.8 or later}} & \makecell[l]{\textbf{ver.\@ 1.0 or later}}\\\midrule
%\cmd{\xdistance}     & \cmd{\xtdistance}     & \\\tabucline-
%\cmd{\xDot}          &\cmd{\xtNode}          & \\\tabucline-
%\cmd{\xInfoset}      &\cmd{\xtInfoset}       & \\\tabucline-
%\cmd{\xInfoset*}     &\cmd{\xtInfoset*}      & \cmd{\xtInfosetO} \\\tabucline-
%\cmd{\xInfosetOwner} &\cmd{\xtInfosetOwner}  & \\\tabucline-
%\cmd{\xActionLabel}  &\cmd{\xtActionLabel}   & \\\tabucline-
%\cmd{\xPayoff}       &\cmd{\xtPayoff}        & \\\tabucline-
%\cmd{\ShowTerminalNodes}         &\cmd{\xtShowTerminalNodes} & \\\tabucline-
%\cmd{\HideTerminalNodes}         &\cmd{\xtHideTerminalNodes} & \\\tabucline-
%\cmd{\levdist}       &\cmd{\xtlevdist}       & \\\tabucline-
%\cmd{\sibdist}       &\cmd{\xtsibdist}       & \\\tabucline-
%\cmd{\setistactionlabelshift}    &   ~       & \cmd{\xtALPush} \\\tabucline-
%\cmd{\setistactionlabelposition} &   ~       & \cmd{\xtALShift} \\\tabucline-
%\cmd{\istroot*}      &                       & \cmd{\istrooto} \\\tabucline- 
%\cmd{\istcntm*}      &                       & \cmd{\istcntmarc} \\\tabucline- 
%\end{tabu} 
%\end{center}

\begin{center}
\begin{tabular} {lll}  \toprule  % to\linewidth
\makecell[l]{\textbf{ver.\@ 0.7 or before}}  & \makecell[l]{\textbf{ver.\@ 0.8 or later}} & \makecell[l]{\textbf{ver.\@ 1.0 or later}}\\\midrule
\cmd{\xdistance}     & \cmd{\xtdistance}     & \\\cline{1-3}
\cmd{\xDot}          &\cmd{\xtNode}          & \\\cline{1-3}
\cmd{\xInfoset}      &\cmd{\xtInfoset}       & \\\cline{1-3}
\cmd{\xInfoset*}     &\cmd{\xtInfoset*}      & \cmd{\xtInfosetO} \\\cline{1-3}
\cmd{\xInfosetOwner} &\cmd{\xtInfosetOwner}  & \\\cline{1-3}
\cmd{\xActionLabel}  &\cmd{\xtActionLabel}   & \\\cline{1-3}
\cmd{\xPayoff}       &\cmd{\xtPayoff}        & \\\cline{1-3}
\cmd{\ShowTerminalNodes}         &\cmd{\xtShowTerminalNodes} & \\\cline{1-3}
\cmd{\HideTerminalNodes}         &\cmd{\xtHideTerminalNodes} & \\\cline{1-3}
\cmd{\levdist}       &\cmd{\xtlevdist}       & \\\cline{1-3}
\cmd{\sibdist}       &\cmd{\xtsibdist}       & \\\cline{1-3}
\cmd{\setistactionlabelshift}    &   ~       & \cmd{\xtALPush} \\\cline{1-3}
\cmd{\setistactionlabelposition} &   ~       & \cmd{\xtALShift} \\\cline{1-3}
\cmd{\istroot*}      &                       & \cmd{\istrooto} \\\cline{1-3} 
\cmd{\istcntm*}      &                       & \cmd{\istcntmarc} \\\cline{1-3} 
\end{tabular} 
\end{center}


%\clearpage

\section{Getting started}
\label{sec:gettingstarted}

The package \ipkg{istgame} provides macros built on \TikZ\ to draw game trees. The core macros provided with this package are \icmd{\istroot}, \icmd{\istb}, and \icmd{\endist}. 
\cmd{\istroot} pins down the root of a tree or a subtree, \cmd{\istb} represents a branch, and \cmd{\endist} indicates the end of drawing a simple tree. Without \cmd{\endist}, the tree is NOT actually drawn, with no error messages produced.
A tree drawn by the sequence of \cmd{\istroot-}\cmd{\istb-}\cmd{\endist} is a \ixsw{simple tree}. 
You can draw a whole game tree by repeatedly connecting these \emph{simple tree structures}.

\xbigskip1

Here, the prefix `ist' stands for `it's a simple tree.' You can also read it as `insung's simple tree' if you would like.

\xbigskip1

The package \pkg{istgame} depends on the packages \ipkg{tikz}, \ipkg{xparse}, and \ipkg{expl3}.

To use the \pkg{istgame} package you must load the package in the preamble of your document:
\begin{verbatim}
     \usepackage{istgame}
\end{verbatim}
The package uses the following \TikZ\ libraries:
\begin{verbatim}
     trees,calc,arrows,shapes,positioning,backgrounds,fit,decorations.markings,
\end{verbatim}
and also loads \xw{patterns} and \xw{intersections} for additional use.


\subsection{Getting-started example: a simple tree}

Let us get started with a simple self-explanatory example:

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
%% \usepackage{istgame}
% Example: a simple tree
\begin{istgame}
\istroot(0)(0,0) % names the root as (0) at (0,0)
  \istb % endpoint will be (0-1), automatically
  \istb % endpoint will be (0-2), automatically
  \istb % endpoint will be (0-3), automatically
  \endist % end of simple (parent-child) structure
\end{istgame}
\end{tcblisting}

The resulting tree has the \emph{height} of \xw{15mm} and 
the \emph{distance between two neighbor endpoints} (not shown) is also \xw{15mm} by default.
In \TikZ, the height is called the \ixw{level distance} and 
the distance between two neighbor endpoints is called the \ixw{sibling distance}.

If the second parenthesis argument of \cmd{\istroot} is omitted, it is regarded as \xw{(0,0)} by default, 
otherwise it is necessary to specify the coordinate from which a simple tree starts.

\subsection{Connecting simple tree structures}

Basically, in order to draw a whole game tree, we just repeat the simple \verb|\istroot-\istb-\endist| structure.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: connecting simple trees
\begin{istgame}
\istroot(0) % names the root (0) at (0,0)
  \istb % endpoint will be (0-1), automatically
  \istb % endpoint will be (0-2)
  \istb % endpoint will be (0-3)
  \endist % end of simple (parent-child) structure
\istroot(c)(0-3) % names the subroot (c) at (0-3)
  \istb % endpoint will be (c-1)
  \istb % endpoint will be (c-2)
  \endist
\end{istgame}
\end{tcblisting}

In the above example, the simple \emph{subtree} is rooted at \xw{(0-3)}, names the subroot \xw{(c)}, and has two branches whose endpoints are automatically named \xw{(c-1)} and \xw{(c-2)}, respectively. 

Note that the user-defined names of the (sub)roots and the names of endpoints are arranged \xw{counterclockwise} (from left to right) by \TikZ\ at the endpoints of branches, which can be used as coordinates in the usual \TikZ\ way.

\subsection{Complete examples for desperate users}
\label{sec:desperateusers}

Basically, \cmd{\istroot} designates a \emph{decision node} and its \emph{owner} (or a \emph{player}),
\cmd{\istb} prints a \emph{branch} coming out from the decision node with \emph{action labels} and \emph{payoffs}, and \cmd{\endist} actually draws the tree structures. (One secret is that I almost always use only the basic features of the \pkg{istgame} package, discussed in this subsection.)

\subsubsection{How to put a decision node and its owner}

\begin{tcblisting}{listing only}
\istroot(<decision node name>)(<root location>)<owner position>{<owner>}
\end{tcblisting}

The only \emph{mandatory} argument of \icmd{\istroot} is \xw{(<decision node name>)} and all others are \emph{optional}.
If the \xw{(<location>)} where the \emph{\isw{root}} or a \emph{decision node} is placed is omitted, it is regarded as \xw{(0,0)} by default.
The position of an \isw{owner} (or a \isw{player}) is \xw{<above>} (or equivalently, \xw{<90>} degree) by default.
The \emph{owner} of a node is printed in \emph{text mode} by default.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth,breakable}
% Example: first try
\begin{istgame}
\xtdistance{15mm}{30mm}
\istroot(0)(0,0){Child}
  \istb%{Good}[above left]{(0,2)}
  \istb%{Bad}[above right]
  \endist
\istroot(1)(0-2)<30>{Parent}
  \istb%{Forgive}[above left]{(1,1)}
  \istb%{Punish}[above right]{(-1,-1)}
  \endist 
\end{istgame}
\end{tcblisting}

In fact, \cmd{\istroot} and its variants have much more functions than these. Later, you can look into Section~\ref{sec:istroot} on page~\pageref{sec:istroot} for more details.

\subsubsection{How to print branches with action labels and payoffs}

\begin{tcblisting}{listing only}
\istb{<action label>}[<action label pos>]{<payoffs>}[<payoff pos>]
\end{tcblisting}

With the macro \icmd{\istb}, you can draw a \emph{\isw{branch}} and put an \emph{\isw{action}} label and \emph{\isw{payoff}}s as optional arguments.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth,breakable}
% Example: first try
\begin{istgame}
\xtdistance{15mm}{30mm}
\istroot(0){Child}
  \istb{Good}[above left]{(0,2)}
  \istb{Bad}[above right]
  \endist
\istroot(1)(0-2)<30>{Parent}
  \istb{Forgive}[al]{(1,1)}
  \istb{Punish}[ar]{(-1,-1)}
  \endist 
\end{istgame}
\end{tcblisting}

The positions of an action label and payoffs are specified as options right after each of the two.
When you omit the position of payoffs, the package prints them naturally, but still you can change the location using an option like \xw{[left]} or \xw{[above left]}. For the positions of action labels and payoffs, you can use an abbreviation \xw{[al]} for \xw{[above left]} and similarly \xw{[ar]}, \xw{[bl]}, and \xw{[br]}.
The abbreviations \xw{[a]}, \xw{[b]}, \xw{[l]}, and \xw{[r]} are also available.

Both of the \emph{action labels} and \emph{payoffs} are printed in \emph{math mode} by defualt. (You can change the input mode for owners, action labels, and payoffs using a very useful macro \cmd{\setistmathTF}, documented in Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}.)

In fact, \cmd{\istb} and its variants have much more functions than these. For more details, see Section~\ref{sec:istb}, on page~\pageref{sec:istb}. If this is your first read of this manual, however, you don't need to bother about all the details at the moment.

Following three sections are about an information set, a continuum of branches, and changing the direction of tree growing. If you do not need to use them now, the core macros \cmd{\istroot}, \cmd{\istb}, and \cmd{\endist} are \emph{all you need to know about} drawing game trees of any size, small or big.
Just connect simple trees to complete a whole tree.

\subsubsection{How to put information sets}

The macro \icmd{\xtInfoset} connects two nodes with a densely dotted line, by default, representing an information set.

\xbigskip1
\begin{tcblisting}{listing only}
\xtInfoset(<from coor>)(<end coor>){<owner>}[<owner pos>]
\end{tcblisting}


The two node coordinates are \emph{mandatory}.
You can put the owner of an information set as an optional argument. An owner is printed above (by default) the line in \emph{text mode}, which can be changed.
For more details about \cmd{\xtInfoset}, see Section~\ref{sec:infoset} on page~\pageref{sec:infoset}.

%\xbigskip1
In the example below, the macro \cmd{\xtInfoset} is used to show an \isw{information set}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
% Example: information set
\begin{istgame}
%\setistgrowdirection'{east}
\xtdistance{15mm}{30mm}
\istroot(0){Alice}
  \istb{A}[al]{(2,2)}
  \istb{D}[ar]
  \endist 
\istroot(1)(0-2)<above right>{Alice}
  \istb{L}[al]
  \istb{R}[ar]
  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)
  \istb{\ell}[al]{(4,2)}
  \istb{r}[ar]{(1,1)}
  \endist 
\istroot(3)(1-2)
  \istb{\ell}[al]{(3,2)}
  \istb{r}[ar]{(0,3)}
  \endist 
\xtInfoset(2)(3){Elaine}
\end{istgame}
\end{tcblisting}
\xsmallskip1

The package also provides the macro \cmd{\xtInfosetO} to draw a bubble type information set.
Just replace \cmd{\xtInfoset} with \cmd{\xtInfosetO} (see Section~\ref{ssec:xtInfosetO} on page~\pageref{ssec:xtInfosetO}).

You can also draw a curved information by using \cmd{\xtCInfoset} (Section~\ref{ssec:xtCInfoset}) and even a curved bubble type by using \cmd{\xtCInfosetO} (Section~\ref{ssec:xtCInfosetO}). You can try now.


\subsubsection{How to put a continuum of branches}

Just use \cmd{\istrootcntm} (\cmd{\istroot\ + cntm}), instead of \cmd{\istroot}, to draw a \isw{continuum} of branches.

\xbigskip1
\begin{tcblisting}{listing only}
\istrootcntm(<decision node name>)(<root location>)<owner position>{<owner>}
\end{tcblisting}

The macro \icmd{\istrootcntm} works just like \cmd{\istroot}, but it prints a background triangle in \xw{black!25}, by default, representing a continuum of branches.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
% Example: continuum of branches
\begin{istgame}[font=\scriptsize]
\istrootcntm(0){1} 
  \istb{x}[r] \istbm \endist
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)<120>{2}
  \istb{Y}[al]{x,1-x} \istb{N}[ar]{0,0} \endist
\end{istgame}
\end{tcblisting}
\xsmallskip1

Here, \cmd{\istbm} represents a missing (or an invisible) branch (see page~\pageref{page:istbm}).

%\xbigskip1
You can also change the color and size of the triangle representing a continuum of branches. 
For more details on \cmd{\istrootcntm} see Section~\ref{ssec:istrootcntm}, on page~\pageref{ssec:istrootcntm}.

The package also provides the macro \cmd{\istrootcntmA} to draw an arc to represent a continuum of branches.
You can just replace \cmd{\istrootcntm} by \cmd{\istrootcntmA} to do that, but let us not try this now. 
(If you really want to try this now, you should change the first \cmd{\istb} to \cmd{\istbA} and then take out \cmd{\istbm} in the above example. It is said not to try this now.)
For more details on \cmd{\istrootcntmA} see Section~\ref{ssec:istrootcntmA}, on page~\pageref{ssec:istrootcntmA}.

You can use every options and macros you can use for the \env{tikzpicture} environment with the \env{istgame} environment. In the above example, \verb+font=\scriptsize+ is used as an option.

\subsubsection{How to change the growing direction of a tree}

With \cmd{\setistgrowdirection} or \cmd{\setistgrowdirection'}, you can easily change the \isw{direction} (\xw{south} by default) to which a game tree grows, as shown in the example below.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
% Example: \setistgrowdirection(')
\begin{istgame}[scale=1.2]
\setistgrowdirection'{east}
\istroot(0)<180>{1} 
  \istb{a}[al]
  \istb{b}[a]
  \istb{c}[bl]
  \endist
\xtdistance{10mm}{20mm}
\istroot(1)(0-2)<135>{2}
  \istb{Y}[al]{x,1-x}
  \istb{N}[bl]{0,0}
  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

All you need to do is just to specify the direction you want, like \cmd{\setistgrowdirection\{west\}}, \cmd{\setistgrowdirection'\{east\}}, or \cmd{\setistgrowdirection'\{-45\}}. The prime version (\xw{'}) is just to arrange branches \xw{clockwise} (by default \xw{coutnerclockwise}). In the above example, if you use \cmd{\setistgrowdirection} without the prime, the branches will be arranged \xw{counterclockwise}, like $a$, $b$, and $c$ \emph{from bottom to top}.
When changing the direction of a tree, you may want to relocate the owner and action labels.
For more details, see Sections~\ref{sec:growing} (on page~\pageref{sec:growing}) and~\ref{sec:payoffdirection} (on page~\pageref{sec:payoffdirection}).

Now you are ready to draw any standard game trees such as all game trees in Osborne's book.


\section{Important distances: \protect\cmd{\xtdistance}}

\label{sec:xtdistance}

The length and direction of branches in a simple tree can be controlled by the macro \icmd{\xtdistance}. 
Here, the prefix \xw{xt} stands for \ixsw{extensive tree}.

\xbigskip1
\begin{tcblisting}{listing only}
% syntax: \xtdistance
  \xtdistance[<level depth>]{<level dist>}{<sibling dist>}
% defaults:
  [1]{15mm}{15mm}
\end{tcblisting}
\xbigskip1

The macro \cmd{\xtdistance} sets or resets the \xw{level distance} and the \xw{sibling distance}, respectively.
Note also that internally, for example, \cmd{\xtdistance\{20mm\}\{30mm\}} assigns \xw{20mm} to \icmd{\xtlevdist} and \xw{30mm} to \icmd{\xtsibdist}, which renew the default distances.
It is effective until you change the distances by using another \cmd{\xtdistance}. 

\begin{center}
\begin{istgame}[scale=2]
\istroot(0)
\istb* \istb* \istb* \endist
\coordinate (A) at ([xshift=-10pt]0-|0-1) ;
\coordinate (B) at ([xshift=-10pt]0-1) ;
\coordinate (C) at ([yshift=-10pt]0-1) ;
\coordinate (D) at ([yshift=-10pt]0-2) ;
\begin{scope}[blue]
\draw [|<->|] (A) -- (B) ;
\draw [|<->|] (C) -- (D) ;
\node at ($(A)!.5!(B)$) [left] {\makecell[c]{level distance\\\xw{\xtlevdist}}} ;
\node at ($(C)!.5!(D)$) [below] {\makecell[c]{sibling distance\\\xw{\xtsibdist}}} ;
\end{scope}
\end{istgame}
\end{center}

You can use \cmd{\xtdistance} at any time you want to change the length and the directions of branches.
Since we are dealing with simple \emph{parent-child} tree structures, \xw{<level depth>} is \xw{1} by default.
(The level depth number other than \xw{1} is not expected to be used.)

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \xtdistance
\begin{istgame}
\xtdistance{15mm} % default
\istroot(0) % names the root (0) at (0,0)
  \istb % endpoint will be (0-1), automatically
  \istb % endpoint will be (0-2)
  \istb % endpoint will be (0-3)
  \endist % end of simple (parent-child) structure
\xtdistance{15mm}{30mm} % changes sibling dist
\istroot(a)(0-1) % names the subroot (a) at (0-1)
  \istb % endpoint will be (a-1)
  \istb % endpoint will be (a-2)
  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1


%\xbigskip1
\remark

\begin{itemize}
\item Since \cmd{\xtlevdist} and \cmd{\xtsibdist} are assigned values by \cmd{\xtdistance}, you can use
these values to do some calculation, for example, like \verb+1.2*\xtlevdis+ or \verb+1.5*\xtsibdist+.
\item The starred version \icmd{\cntmdistance*} is provided to deal with a continuum of branches and \cmd{\xtdistances} together, which is not documented at the moment. 
See Section~\ref{sec:xtdistance*}, on page~\pageref{sec:xtdistance*},
for more details about \cmd{\cntmdistance*}.
\end{itemize}
%\xbigskip1

In fact, the core macros are much more powerful. \cmd{\istroot} controls the direction to which a simple parent-child tree grows, 
node styles, the node owner and its position, the height and sibling distance of a current simple tree, etc.
\cmd{\istb} specifies the growing direction of an individual branch, branch line styles, branch color, action labels, and payoffs and their position. 
Below we will see in more details on how the core macros and others work.


\section{The \env{istgame} environment and node styles}

\subsection{The \env{istgame} environment}

\label{ssec:envistgame}

The package provides the \ienv{istgame} environment, which is basically the sum of the \ienv{tikzpicture} environment plus some additional functions and different initial values.
So it accepts all the options and macros that can be used for the \env{tikzpicture} environment. (Note that most of the macros provided by the package work also in the \env{tikzpicture} environment, but some works only in the \env{istgame} environment.)

\xbigskip1
\begin{tcblisting}{listing only}
% istgame environment
% \def\istgame@default@fontsize{\normalsize}
\begin{istgame}[ <Tikz  options> ]
  < istgame contents >
  < tikzpicture contents >
\end{istgame}
% default options:
[ font=\normalsize , >=stealth ] 
\end{tcblisting}

The default font size is set as \verb|font=\normalsize|. 
You can globally change the default font size by using \icmd{\setistgamefontsize}, like 
\verb|\setistgamefontsize{\scriptsize}|.
Since the environment \env{istgame} is basically the same as \env{tikzpicture}, you can also locally change the font size by using the \xw{font} option key, like
\verb|\begin{istgame}[font=\scriptsize]...\end{istgame}|. 

\xbigskip1
\remark \textbf{(Not for most users)} What the \env{istgame} environment \emph{internally} does includes:
% more than \env{tikzpicture}:

\begin{itemize}
\item
In the newly designed \env{istgame} environment, it internally checks and extracts the optional values of \xw{xscale} and \xw{yscale} and, if exist, saves the values (\xw{1.0} by default) at \icmd{\xtxscale} and \icmd{\xtyscale}, respectively.
And If the optional value of \xw{scale} exists, it is saved at \icmd{\xtscale} only when neither \xw{xscale} nor \xw{yscale} exists.
You can use these values to calculate something you want, like \verb|5*1/\xtscale|. 
The extracted values are internally used to get the best results of the shapes of bubble type information sets.
\item
The \env{istgame} environment also checks if the arrow option \xw{[->]} exists in the option list for the environment. If it exists the \env{istgame} adds \xw{shorten >=<dim>} (by default \xw{0pt}) to the list as the first option together with \xw{[->]}.
You can change the default value, 
like \cmd{\setistgameshorten\{1.3pt\}}. (Though this is \emph{not for most users}, you can see some more details, in Section~\ref{sec:setistgamearrowendshorten}.)
\end{itemize}

%\tmpclearpage

\subsection{Node styles}
\label{sec:nodestyles}

\subsubsection{Basic node styles}

The \xw{tikzstyle}'s of the six basic node styles are predefined.

\begin{itemize}\tightlist
\item \ixw{plain node}: draws nothing 
      \hfill (default: \xw{inner sep=1pt})
\item \ixw{null node}: \begin{istgame}\istroot(0)[null node]\endist\end{istgame} (very small node) 
      \hfill (default: \xw{minimum size=0.2pt})
\item \ixw{solid node}: \begin{istgame}\istroot(0)[solid node]\endist\end{istgame} (default node style)
      \hfill (default: \xw{minimum size=2.4pt})
\item \ixw{hollow node}: \begin{istgame}\istroot(0)[hollow node]\endist\end{istgame}
      \hfill (default: \xw{minimum size=2.8pt})
\item \ixw{rectangle node}: \begin{istgame}\istroot(0)[rectangle node]\endist\end{istgame}
      \hfill (defaults: \xw{inner sep=2pt}, \xw{minimum size=4pt})
\item \ixw{ellipse node}: \begin{istgame}\istroot(0)[ellipse node]\endist\end{istgame}
      \hfill (defaults: \xw{inner sep=1.5pt}, \xw{minimum size=4.8pt})
\end{itemize}


For some special cases, you may want to change some node styles, including the minimum size. This can be done by \icmd{\setist<...>NodeStyle}, all of whose arguments are optional.

\begin{verbatim}
syntax:
  \setistPlainNodeStyle{<inner sep dim>}{<outer sep dim>}
  \setistNullNodeStyle[<draw color>]{<min-size dim>}[<bg color>][<opacity>]
  \setistSolidNodeStyle[<draw color>]{<min-size dim>}[<bg color>][<opacity>]
  \setistHollowNodeStyle[<draw color>]{<min-size dim>}[<bg color>][<opacity>]
  \setistRectangleNodeStyle[<draw color>]{<min-size dim>}[<bg color>][<opacity>]
  \setistEllipseNodeStyle[<draw color>]{<min-size dim>}[<bg color>][<opacity>]
\end{verbatim}


\begin{tcblisting}{listing outside text, righthand width=.1\linewidth}
% Examples:
\begin{istgame}\setistSolidNodeStyle[blue]{10pt}
    \istroot(0)[solid node]\endist\end{istgame}\\[1ex]
\begin{istgame}\setistHollowNodeStyle[blue]{10pt}[yellow]
    \istroot(0)[hollow node]\endist\end{istgame}\\[1ex]
\begin{istgame}\setistRectangleNodeStyle{10pt}[red][.5]
    \istroot(0)[rectangle node]\endist\end{istgame}\\[1ex]
\begin{istgame}\setistEllipseNodeStyle[blue]{10pt}[green]
    \istroot(0)[ellipse node]\endist\end{istgame}\\[1ex]
\begin{istgame}\setistNullNodeStyle[blue!20]{10pt}
    \istroot(0)[null node]\endist\end{istgame}
\end{tcblisting}

\xbigskip1

These basic node styles have their aliases, for convenience, for those who are familiar with game theoretic terminology.

\begin{tcblisting}{listing only,breakable}
% aliases for game theorists
\tikzset{decision node/.style=solid node}  % decision nodes
\tikzset{terminal node/.style=solid node}  % terminal nodes
\tikzset{initial node/.style=hollow node}
\tikzset{chance node/.style=hollow node}
\end{tcblisting}

The set of all nodes of a game tree can be partitioned into
the set of \ixw{decision nodes} and that of \ixw{terminal nodes}.
You can use \ixw{initial node}
to distinguish the \ixsw{root} (or the \xw{initial node}) of a game tree from decision nodes.
You can also use \ixw{chance node} to represent a chance node of a game tree.

%You can also change the node styles, like \verb|\setistDecisionNodeStyle[blue]{3pt}|.

\xbigskip1
Additional convenient node aliases are also provided: \ixw{box node}, \ixw{square node}, and \ixw{oval node}.

\begin{tcblisting}{listing only,breakable}
% some more aliases
\tikzset{box node/.style=rectangle node}
\tikzset{square node/.style=rectangle node}
\tikzset{oval node/.style=ellipse node}
\end{tcblisting}

For aliases, you can also change the node styles, like \verb|\setistDecisionNodeStyle[blue]{3pt}| or \verb|\setistBoxNodeStyle{3pt}[green][.5]|.

\subsubsection{Your own node styles: \protect\cmd{\setistNewNodeStyle}}

You can create your own node style by \icmd{\setistNewNodeStyle}.

\begin{tcblisting}{listing only}
% \setistNewNodeStyle
% syntax:
  \setistNewNodeStyle{<style name>}[<opt>]{<minimum size>}
% defaults:
  {<m>}[-,circle,draw=black,fill=white,inner sep=1pt]{6mm}
\end{tcblisting}

The first, mandatory denoted by \verb+{<m>}+, argument is \verb+{style name}+ to be used.
The second, optional, argument is \xw{[<options>]} to determine the style of a new node, with defaults.
The third, optional, argument should be \verb+{<minimum size>}+ only in dimension, which may be frequently used.

To define, for example, a circle (by default) node with the minimum size of \xw{3mm} filled with \xw{red}, you can do like this: \verb+\setistNewNodeStyle{new node}[fill=red]{3mm}+. In fact, this is an abbreviation of the following \TikZ\ macro:
\begin{verbatim}
   \tikzset{new node/.style={
             circle , draw=black , fill=red , innser sep=1pt , minimum size=3mm }
           }
\end{verbatim}

Here is an example of using \cmd{\setistNewNodeStyle}.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% Example: \setistNewNodeStyle
\begin{istgame}[scale=1.5]
\setistNewNodeStyle{new 1}
  [regular polygon,regular polygon sides=3,
   shape border rotate=180]
\setistNewNodeStyle{new 2}
  [regular polygon,regular polygon sides=3]
\setistNewNodeStyle{new 3}[star]
\xtdistance{15mm}{30mm}
\istroot(0)[new 1]<center>{I}
  \istb  \istb  \endist
\xtdistance{15mm}{15mm}
\istrooto(1)(0-1)[new 2]{II} % \istrooto
  \istb  \istb  \endist
\istroot(2)(0-2)[new 3]<center>{III}
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}     
\xbigskip1

\remark
From the above example, observe that when you use \cmd{\istroot} to put the owner of a node, you need to specify \xw{<center>} for the position of the node owner.
However, if you use the oval version \cmd{\istrooto}, you don't need that.
(About \cmd{\istroot} and \cmd{\istrooto}, see Section~\ref{sec:istroot}.)

\xbigskip1
\remark
In \TikZ, the shape of a node is independent of the \xw{scale} option in \env{tikzpicture}.
If you want to make the shape scaled according to the \xw{scale} option, you can use the \TikZ\ option \ixw{transform shape}, as shown below. (In this kind of case, \cmd{\istrooto} helps, rather than \cmd{\istroot}.)

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% Example: \setistrNewNodeStyle (scaled)
\begin{istgame}[scale=1.5]
\setistNewNodeStyle{new 1}
  [regular polygon,regular polygon sides=3,
   shape border rotate=180]
\setistNewNodeStyle{new 2}
  [regular polygon,regular polygon sides=3]
\setistNewNodeStyle{new 3}[star]
\xtdistance{15mm}{30mm}
\istroot(0)
  [new 1,transform shape]<center>{I}
  \istb  \istb  \endist
\xtdistance{15mm}{15mm}
\istrooto(1)(0-1)[new 2]{II} % \istrooto
  \istb  \istb  \endist
\istroot(2)(0-2)
  [new 3,transform shape]<center>{III}
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}


\section{Core macro: \protect\cmd{\istroot}}
\label{sec:istroot}

\subsection{\protect\cmd{\istroot}: basics}

\subsubsection{\protect\cmd{\istroot} -- counterclockwise: standard version}
\label{ssec:istroot}

The macro \icmd{\istroot} defines the \emph{\isw{root}} of a game or a subgame at a designated location, specifies the \emph{owner} of the root or the subroot, and does other functions.
In game theoretic terminology, \cmd{\istroot} designates a decision node and its \isw{owner} (or a \isw{player}).

\xbigskip1
\begin{tcblisting}{listing only}
% \istroot
% syntax: 
  \istroot[<grow keyval>,<tree opt>](<coor1>)(<coor2>)
          [<node style>,<node opt>]<[owner opt]owner label angle>{<owner>}
          +<lev-distance>..<sib-distance>+
% defaults: 
  [south](<m>)(0,0)[decision node]<above>{}+15mm..15mm+
% arguments: (coor1) is mandatory, all others are optional arguments
  [grow] % the direction of growing <default: south>
  (coor1) % name of the (sub)root: mandatory
  (coor2) % the (sub)root is at (coor2) <default: (0,0)>
  [node style] % node style <default: decision node> 
  <angle> % position of owner name <default: above> 
  {owner} % name of the owner of the (sub)root
  +level dist..sibling dist+ % <defaults: 15mm,15mm>
\end{tcblisting}
%\xbigskip1


\subsubsection*{the root}

The only mandatory argument, denoted by \xw{<m>}, of \cmd{\istroot} is \xw{(<coor1>)}, which gives the name of the root or subroot. All the other arguments are optional. The name of the (sub)root, \xw{(<coor1>)}, can be referred as a normal coordinate.
\xw{(coor2)} specifies the location where the (sub)root is placed.
If \xw{(coor2)} is omitted, it is regarded as \xw{(0,0)} by default.

The default node style of the root is a \xw{decision node}, which is just a \xw{solid node}. You can change the node style to any other node style such as \xw{initial node}, \xw{chance node}, \xw{oval node}, \xw{box node}, and so on.

\xbigskip1

Here is a simple example of drawing a tree structure.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \istroot
\begin{istgame}
\istroot(0)
  \istb  \istb  \istb  \endist
\istroot(a)(0-1)[chance node]
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}
%\xbigskip1


\subsubsection*{naming children: counterclockwise or clockwise}

In the previous example, the game tree has the root named \xw{(0)}, located at \xw{(0,0)} by default, which has three branches (by three \cmd{\istb}'s).
Since \TikZ\ arranges branches of a tree \xw{counterclockwise}, by default,
the endpoints of the three branches are automatically named \xw{(0-1)}, \xw{(0-2)}, and \xw{(0-3)} \emph{from left to right} (when a tree grows down).

The root of the subtree is named \xw{(a)}, located at \xw{(0-1)}, and has two children.
Its children are automatically named \xw{(a-1)} and \xw{(a-2)} \ixsw{counterclockwise} (or from left to right if the tree grows down).
See the following code example with explanatory labels to see what is going on.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \istroot (explained with labels)
\begin{istgame}[font=\scriptsize]
\istroot(0)
  \istb  \istb  \istb \endist
\istroot(a)(0-1)
  \istb  \istb  \endist
%% labels: (ignore the following lines at the moment)
\setistmathTF000
\xtOwner(0){(0)}
\xtOwner(a){(a)}[l]
\xtPayoff*(0-1){(0-1)}[r]
\xtPayoff*(0-2){(0-2)}[b]
\xtPayoff*(0-3){(0-3)}[b]
\xtPayoff*(a-1){(a-1)}[b]
\xtPayoff*(a-2){(a-2)}[b]
\draw [->,ultra thick,blue!20](-260:1.5) 
  arc (-260:80:1.5cm)
  node [above,blue!30] {counterclockwise};
\end{istgame}
\end{tcblisting}
\label{page:clockwise}


%\xbigskip1
\subsubsection*{owner (or player)}

The owner of a decision node (or a player) is expressed in curly braces, like \verb|{player 1}|, and printed in \emph{text mode}. The input mode and text font style of an owner can be changed by \cmd{\setistmathTF(*)} 
(see Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}, for more details).

The position of the owner of a decision node is specified in angle brackets, like \xw{<90>}, \xw{<above>}, or \xw{<north>}.
To specify the position of an owner you can use \xw{<degrees>}, or the compass directions such as \xw{<north>}, \xw{<south>}, \xw{<east>}, \xw{<west>}, and their valid combinations.
You can also use the positional words such as \xw{<above>}, \xw{<below>}, \xw{<left>}, \xw{<rigth>}, and their valid combinations.

%\xbigskip1
\subsubsection*{growing direction of a simple tree}

The first bracket option is mainly for the direction of a simple tree (\xw{[south]} by default).
Internally, \xw{[<grow keyval>]} typed in as the first option of \cmd{\istroot} renews the direction of tree growing by assigning its value to \icmd{\istgrowdirection}, whose default is \xw{south}.

\xsmallskip1
\begin{adjustwidth}{\parindent}{\parindent}
\remark 
\begin{itemize}
\item In fact, the first option of \cmd{\istroot} controls the features of an whole simple tree (but a node style), while the second bracket option controls a node style only.
\item In addition to the direction of a simple tree, you can add more options to control the whole branch styles and their labels (except a node sytle).
For example, if you want, at any reason, to draw a simple tree with all \emph{red dashes branches with red labels} growing south-eastwards, you can do like \xw{[south east,red,dashed]}.
(For examples in more detail, see Section~\ref{sec:firstthing} on page~\pageref{sec:firstthing}.)
\item Be aware that the first entry in the option list \emph{must} be a \emph{directional word} for a simple tree.
\end{itemize}
\end{adjustwidth}
\xsmallskip1

The tree growing direction can be specified by \xw{[<degrees>]} or by using the compass directions such as 
\xw{[north]}, \xw{[south]}, \xw{[east]}, \xw{[west]}, \xw{[north east]}, \xw{[north west]}, \xw{[south east]}, \xw{[south west]}.
You can also use positional words like \xw{[left]}, \xw{[rigth]}, \xw{[down]}, and \xw{[up]}, but you cannot use \xw{[above]} nor \xw{[below]}.

%\xsmallskip1
\label{page:onesimpletree}
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example 1: \istroot (one simple tree)
\begin{istgame}[font=\itshape]
\istroot[right](0)<left>{player 1}
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}
%\xsmallskip1


\remark One thing you should remember about this is that \cmd{\istgrowdirection} is internally used 
in the definition of \cmd{\istb} to control the label position for payoffs.
However, for the label position in \TikZ, \xw{[below]} and \xw{[above]} are good, 
but not \xw{[down]} nor \xw{[up]}.
So DO NOT USE \xw{[down]} nor \xw{[up]} to specify the tree growing direction.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example 2: \istroot (three simple trees connected)
\begin{istgame}
\xtdistance{20mm}{20mm}
\istroot[right](0)[oval node]<left>{player 1}
  \istb  \istb  \endist
\istroot(a)(0-1)<right>{player 2}+15mm..10mm+
  \istb  \istb  \endist
\istroot[right](b)(0-2)[box node]<135>{player 3}
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}
\label{page:threesimpletrees}
%\xbigskip1

\subsubsection*{local change of distances}

The last two options of \cmd{\istroot} specify the \xw{level distance} and the \xw{sibling distance}.
This \emph{local} change of distances is valid only for the corresponding simple tree, while the distances changed by \cmd{\xtdistance} are valid within the current \pkg{istgame} environment unless they are changed again by \cmd{\xtdistance}.
Do not forget, when you use decimal distances, to delimit the decimal dimensions with curly braces, like
\verb|+{15.5mm}..{10.5mm}+|.

\subsubsection{\protect\cmd{\istroot'} -- clockwise: swap version}

\label{ssec:istroot'}

The macro \icmd{\istroot'} is the swap version of \cmd{\istroot}.
\cmd{\istroot'} works just like \cmd{\istroot} but with one exception: going \emph{clockwise} instead of \emph{counterclockwise}.
\cmd{\istroot'} arranges its branches \ixsw{clockwise} (or from right to left if the tree grows down).

Compare the following example with that of \cmd{\istroot} above on page~\pageref{page:clockwise}.
The two examples have exactly the same codes as each other except for one thing: either \cmd{\istroot} or \cmd{\istroot'}.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \istroot' (explained with labels)
\begin{istgame}[font=\scriptsize]
\istroot'(0)
  \istb  \istb  \istb \endist
\istroot'(a)(0-1)
  \istb  \istb  \endist
%% labels: (ignore the following lines at the moment)
\setistmathTF000
\xtOwner(0){(0)}
\xtOwner(a){(a)}[l]
\xtPayoff*(0-1){(0-1)}[r]
\xtPayoff*(0-2){(0-2)}[b]
\xtPayoff*(0-3){(0-3)}[b]
\xtPayoff*(a-1){(a-1)}[b]
\xtPayoff*(a-2){(a-2)}[b]
\draw [<-,ultra thick,blue!20](-260:1.5) 
  arc (-260:80:1.5cm)
  node [above,blue!30] {clockwise};
\end{istgame}
\end{tcblisting}
\xbigskip1

We will look into this issue (of going counterclockwise or clockwise) in more detail in Section~\ref{sec:growing} (on page~\pageref{sec:growing}), where we discuss the tree growing direction.

If you draw a game tree growing south, you don't need to worry about the swap version \cmd{\istroot'}. Just use \cmd{\istroot}.

\subsection{\protect\cmd{\istrooto}: oval version}

\label{ssec:istrootstar}

\subsubsection{\protect\cmd{\istrooto} -- counterclockwise}

The macro \icmd{\istrooto} is the oval version of \cmd{\istroot}.
This allows us to draw a bubble (by default, \xw{oval node}) with a node owner (or a game player) in it. Except for this difference, \cmd{\istrooto} works just like \cmd{\istroot}. Since an owner is shown in a specified node with \cmd{\istrooto}, the option \xw{<owner label angle>} of the standard version \cmd{\istroot} is ignored.

\begin{tcblisting}{listing only,breakable}
% \istrooto
% syntax: 
  \istrooto[<grow keyval,tree opt>](<coor1>)(<coor2>)
           [<node style>,<node opt>]{<owner>}+<lev-distance>..<sib-distance>+
% default: only (coor1) is mandatory, <m>, all others optional
  [south](<m>)(0,0)[oval node]{}+15mm..15mm+
\end{tcblisting}

%\xbigskip1
The following two examples are the same as above with \cmd{\istroot} on pages~\pageref{page:onesimpletree} and \pageref{page:threesimpletrees}, respectively, but now with the oval version \cmd{\istrooto}.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example 1: \istrooto (one simple tree)
\begin{istgame}[font=\itshape]
\istrooto[right](0)<180>{player 1}
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}

%The following example is also the same as above with \cmd{\istroot} on page~\pageref{page:threesimpletrees} but now with the oval version \cmd{\istrooto}.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example 2: \istrooto (three simple trees connected)
\begin{istgame}
\xtdistance{20mm}{20mm}
\istrooto[right](0)[oval node]<left>{player 1}
  \istb  \istb  \endist
\istroot(a)(0-1)<right>{player 2}+15mm..10mm+
  \istb  \istb  \endist
\istrooto[right](b)(0-2)[box node]<135>{player 3}
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}

Observe that the angle \xw{<180>}, \xw{<left>}, \xw{<right>}, or \xw{<135>} specifying the position of an owner's name is redundant to \cmd{\istrooto}.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% Example 3: \istrooto (counterclockwise)
\begin{istgame}
\setistOvalNodeStyle{.6cm}
\istrooto(0){0}+{12.5mm}..{3.45cm}+
  \istb  \istb  \endist
\xtShowEndPoints[oval node]
\xtdistance{12.5mm}{11.5mm}
\istrooto(1)(0-1){1}
  \istb{}{3}[center]  \istb{}{4}[center]
  \istb{}{5}[center]  \endist
\istrooto(2)(0-2){2}
  \istb{}{6}[center]  \istb{}{7}[center]
  \istb{}{8}[center]  \endist
\istrooto(6)(2-1){6}
  \istb{}{9}[center]  \istb{}{10}[center]
  \endist
\draw [->,ultra thick,blue!20](-260:1.5) 
  arc (-260:80:1.5cm)
  node [above,blue!30] {counterclockwise};
\end{istgame}
\end{tcblisting}


%\xbigskip1
%\remark Note that, in \TikZ, a tree branch comes from the center of the parent node 
%and goes to the center of the child node.
%Now what if you want to have branches coming from some point of the circumference of, say, 
%an oval parent node to that of a child node.
%\cmd{\setistbranchanchors} specifies the anchors of parent node and child node. (experimental!)
%
%\begin{tcblisting}{listing only}
%% \setistbranchanchors (experimental!)
%% syntax: \setistbranchanchors
%    \setistbranchanchors{<parent anchor>}{<child anchor>}
%% defaults: <parent anchor> is mandatory
%    {}{center}    
%\end{tcblisting}

\xsmallskip1
The previous example shows how \cmd{\istrooto} arranges its branches: \ixsw{counterclockwise}, by default.



\subsubsection{\protect\cmd{\istrooto'} -- clockwise: swap version}

The swap version of the oval version, \icmd{\istrooto'}, works just like \cmd{\istroot'} with one exception that it puts an owner within an \xw{oval node}, by default.
%\xbigskip1


\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example 2: \istrooto' (clockwise)
\begin{istgame}
\xtdistance{20mm}{20mm}
\istrooto'[right](0)[oval node]<left>{player 1}
  \istb  \istb  \endist
\istrooto'[right](b)(0-1)[box node]<135>{player 2}
  \istb  \istb  \endist
\istroot(a)(0-2)<right>{player 3}+15mm..10mm+
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}

\xbigskip1
The swap version is useful when a tree grows northwards or eastwards.
The example below shows a tree rotated to the east by \icmd{\setistgrowdirection}.
Note that \cmd{\istrooto'} arranges its branches \ixsw{clockwise}.


%\xbigskip1
%\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
%% Example 3: \istrooto' (clockwise)
%\begin{istgame}
%\setistgrowdirection{north}
%\setistOvalNodeStyle{.6cm}
%\istrooto'(0){0}+{12.5mm}..{3.45cm}+
%  \istb  \istb  \endist
%\xtShowEndPoints[oval node]
%\xtdistance{12.5mm}{11.5mm}
%\istrooto'(1)(0-1){1}
%  \istb{}{3}[center]  \istb{}{4}[center]
%  \istb{}{5}[center]  \endist
%\istrooto'(2)(0-2){2}
%  \istb{}{6}[center]  \istb{}{7}[center]
%  \istb{}{8}[center]  \endist
%\istrooto'(6)(2-1){6}
%  \istb{}{9}[center]  \istb{}{10}[center]
%  \endist
%\draw [->,ultra thick,blue!20](260:1.5) 
%  arc (260:-80:1.5cm)
%  node [below,blue!30] {clockwise};
%\end{istgame}
%\end{tcblisting}


%\xbigskip1

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% Example 3: \istrooto' (clockwise)
\begin{istgame}
\setistgrowdirection'{east}
\setistOvalNodeStyle{.6cm}
\istrooto'(0){0}+{12.5mm}..{3.45cm}+
  \istb  \istb  \endist
\xtShowEndPoints[oval node]
\xtdistance{12.5mm}{11.5mm}
\istrooto(1)(0-1){1}
  \istb{}{3}[center]  \istb{}{4}[center]
  \istb{}{5}[center]  \endist
\istrooto(2)(0-2){2}
  \istb{}{6}[center]  \istb{}{7}[center]
  \istb{}{8}[center]  \endist
\istrooto(6)(2-1){6}
  \istb{}{9}[center]  \istb{}{10}[center]
  \endist
\draw [->,ultra thick,blue!20](260:1.5) 
  arc (260:-80:1.5cm)
  node [below,blue!30] {clockwise};
\end{istgame}
\end{tcblisting}

\xbigskip1
\remark
When you use the swap version \icmd{\setistgrowdirection'}, using either \cmd{\istroot} or \cmd{\istroot'} makes no difference. (For more details, see Section~\ref{sec:growing} on page~\pageref{sec:growing}.)


%\clearpage
\section{Core macro: \protect\cmd{\istb}}
\label{sec:istb}

\subsection{\protect\cmd{\istb}: basics}
\label{ssec:istb}

\subsubsection{Basics: branches, action labels, and payoffs}

The macro \icmd{\istb}, basically, prints a \emph{\isw{branch}}. 
Having all arguments as options, a simple \cmd{\istb} draws a branch from a parent node designated by \cmd{\istroot} to a child node (or endpoint of \cmd{\istb}).
If, for example, a parent node is named \xw{(A)} by \cmd{\istroot}, the first child node is automatically named \xw{(A-1)}, the second child node \xw{(A-2)}, and so on.

\xbigskip1
The macro \cmd{\istb} also puts an \emph{\isw{action}} label and \emph{\isw{payoff}\,}s along with a branch, and does other functions.
Note that the \emph{action labels} and \emph{payoffs} are to be typeset in \emph{math mode}. 
If you want to change the input mode to text mode, you can use the macro \cmd{\setistmathTF(*)}.
This issue is discussed in Section~\ref{ssec:setistmathTF} below. (You can also see Section~\ref{sec:setistmathTF}, on page~\pageref{sec:setistmathTF}, for more details).

\xbigskip1
\begin{tcblisting}{listing only,breakable}
% \istb
% syntax:
  \istb<grow, distance, missing>[<line style>]{<action>}[<pos>]{<payoff>}[<pos>]
% defaults: 
  <grow=south>{-}{}[center]{}[\istgrowdirection]
% arguments: all arguments are optional
  <grow=keyval> % the direction of a branch <default: south>
  [line style] % branch line style <default: solid>
  {action} % action label (in math mode)
  [action pos] % position of action label <default: center>
  {payoff} % payoffs (in math mode)
  [payoff pos] % position of payoffs <default: \istgrwodirection: south>
\end{tcblisting}

\remark The macro \cmd{\istb} has many variants including  
\cmd{\istb*} (starred version), \cmd{\istbt} (terminal version), and \cmd{\istbm} (missing version). 
It also has other very close friends: \cmd{\istB} (dual label version) and \cmd{\istbA} (alternative or arc version).
Each friend of \cmd{\istb} has its starred version and terminal version, of course, except \cmd{\istbm}.
\cmd{\cntmistb(*)} and \cmd{\cntmAistb(*)} are also friends only when a continuum of branches is in play.


\subsubsection*{branches}

In the example below, each \cmd{\istb} draws a branch.
With the option \ixw{missing}, \cmd{\istb} prints an \emph{invisible} branch.
Since the third child is \emph{missing}, the last child is named \xw{(0-4)}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \istb<missing> (simply, \istbm)
\begin{istgame}
\istroot(0)
  \istb  \istb  \istb<missing>  \istb  \endist
\istroot(D)(0-4)
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}

\xbigskip1
To make it simple, you can use the \emph{missing version} \icmd{\istbm} instead of \cmd{\istb<missing>}.
\label{page:istbm}

\begin{tcblisting}{listing only}
% \istbm
  \newcommand\istbm{\istb<missing>}
\end{tcblisting}

\xbigskip1
The macro \cmd{\istb} also has various options to control the line style of a branch, and the direction and length of a branch.
\cmd{\istb} can also place payoffs to the direction of tree growth by default. 

\xbigskip1
For various line styles of each branch, you can use any \TikZ\ options of arrows, line style, color, and so on.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \istb (branch line styles)
\begin{istgame}
\istroot(0)
  \istb[dashed,thick]
  \istb[->]
  \istb[draw=blue,thick]
  \endist
\end{istgame}
\end{tcblisting}
%\xbigskip1

\subsubsection*{action labels}

By default, an action label is put on the midpoint of the corresponding branch, in \emph{math} mode.
%\xbigskip1

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: action labels
\begin{istgame}
\istroot(0)
  \istb[dashed,thick]{A}
  \istb[->]{\beta}[right]
  \istb[draw=blue,thick]{Right}[ar]
  \endist
\end{istgame}
\end{tcblisting}

To specify the position of an action label,
you can use the positional words or their \emph{\isw{abbreviations}}:\par
\xw{[a]} for \xw{[above]}, \xw{[b]} for \xw{[below]}, \xw{[l]} for \xw{[left]}, \xw{[r]} for \xw{[right]},\par
\xw{[al]} for \xw{[above left]}, \xw{[ar]} for \xw{[above right]}, \par
\xw{[bl]} for \xw{[below left]}, and \xw{[br]} for \xw{[below right]}.

\xbigskip1
\remark 
Note that these abbreviations must be used with no other options, otherwise you will get a compile \emph{error}.
For example, when you want to print \isw{sloped labels} for actions, you should do like \xw{[above,sloped]} but not like \xw{[a,sloped]}.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: sloped labels
\begin{istgame}[font=\footnotesize]
\istroot(0)
  \istb[dashed,thick]{Left}[above,sloped]
  \istb[->]{Center}[above,sloped]
  \istb[draw=blue,thick]{Right}[above,sloped]
  \endist
\end{istgame}
\end{tcblisting}

\xbigskip1
\warning \label{page:slopedlabels-warning}
Issues in \emph{sloped labels} in \TikZ\ with \emph{asymmetric scales}:
\begin{itemize}\tightlist
\item The \xw{tree} library in \TikZ\ does not seem to treat sloped labels properly, when \xw{xscale} or \xw{yscale} is used asymmetrically.

\begin{tcblisting}{listing outside text, righthand width=.319\linewidth}
% Example: sloped labels problem
\begin{istgame}[xscale=2,font=\footnotesize]
%\xtcureslopedlabelsNS
\istroot(0)
  \istb[dashed,thick]{Left}[above,sloped]
  \istb[->]{Center}[above,sloped]
  \istb[draw=blue,thick]{Right}[above,sloped]
  \endist
\end{istgame}
\end{tcblisting}

\item This package provides a temporary solution to cure this issue: \icmd{\xtcureslopedlabelsNS} for trees growing northwards or southwards. If a tree grows eastwards or westwards, then use \icmd{\xtcureslopedlabelsEW}.
These must be used in a TeX group with caution.
\emph{These are only temporary solutions that have not been tested for every occasion}.

\begin{tcblisting}{listing outside text, righthand width=.319\linewidth}
% Example: sloped labels problem cured
\begin{istgame}[xscale=2,font=\footnotesize]
\xtcureslopedlabelsNS
\istroot(0)
  \istb[dashed,thick]{Left}[above,sloped]
  \istb[->]{Center}[above,sloped]
  \istb[draw=blue,thick]{Right}[above,sloped]
  \endist
\end{istgame}
\end{tcblisting}
\end{itemize}

%\xbigskip1
\subsubsection*{payoffs}

The second curly braces option of the macro \cmd{\istb} is for \emph{payoffs} and the last bracket option for the position of payoffs.

By default, \cmd{\istb} prints payoffs in \emph{math mode}, which can be changed by \cmd{\setistmathTF(*)}.
By default, payoffs are put in the direction of \cmd{\istgrowdirection} (\xw{[south]} by default).

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: payoffs
\begin{istgame}
\istroot(0)
  \istb[dashed,thick]{A}{(0,1)}
  \istb[->]{}{(1,-1)}
  \istb[draw=blue,thick]{\beta}[a]{u_1,u_2}
  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

\remark What is \icmd{\istgrowdirection} and what is it used for?
\begin{itemize}
\item \cmd{\istgrowdirection} has the value of \xw{[<grow keyval>]} typed in \cmd{\istroot} (default: \xw{south}).
\item The value of \cmd{\istgrowdirection} is (internally) used to determine the direction of putting \emph{payoffs} (\xw{south} by default).
\end{itemize}
\xbigskip1


In the following example, notice that the tree grows south-eastwards, so the payoffs are placed to the south-east of the endpoints.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: tree toward south east (or -45 degree)
\begin{istgame}
\istroot[-45](0)
  \istb[dashed,thick]{A}{(0,1)}
  \istb[->]{}{(1,-1)}
  \istb[draw=blue,thick]{\beta}[a]{u_1,u_2}
  \endist
\end{istgame}
\end{tcblisting}
%\xbigskip1

If you do not like the position of payoffs, you can change it by using degrees, the compass directions, or the positional words and their \emph{abbreviations} mentioned above.
In the example below, the tree grows south-westwards, but the position of payoffs at the end of the blue branch is changed to \xw{[below]} or \xw{[b]}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: tree toward south west (or 225 degree)
\begin{istgame}
\istroot[south west](0)
  \istb[dashed,thick]{A}{(0,1)}
  \istb[->]{}{(1,-1)}
  \istb[draw=blue,thick]{\beta}[r]{u_1,u_2}[below]
  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

\remark
\begin{itemize}\tightlist
\item \cmd{\istb} expects a \emph{directional word} to be input as the last optional argument (by default,
\cmd{\istgrowdirection}).
\item You can add more options to change the position of payoffs, but the first entry of the option list \emph{must} be a \emph{directional word}, like \xw{[below,xshift=5mm]}, but not like \xw{[xshift=5mm,below]}.
Otherwise, a compile \emph{error} will be produced.
\item Note also that you can do like \xw{[[xshift=5mm]below}, instead (see also page~\pageref{page:finetuningpayoffs}).
\end{itemize}

\subsubsection{Printing action labels in italics in text mode: \protect\cmd{\setistmathTF*}}
\label{ssec:setistmathTF}

By default, an owner is printed in \emph{text mode}, action labels and payoffs in \emph{math mode}.
With the macro \cmd{\setistmathTF(*)}, you can change the input mode for those labels.
These are discussed in Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}.

Here, it is briefly discussed how to change the input mode of action labels to \emph{text mode}.
To do that, just declare \cmd{\setistmathTF001}. 
The second zero means that the input mode for action labels is in text mode.
(The first number is for owners and the third one for payoffs.)

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
\begin{istgame}[font=\footnotesize]
\setistmathTF001
\istroot(0)
  \istb[dashed,thick]{Left}[above,sloped]{(0,1)}
  \istb[->]{Center}[above,sloped]{(1,-1)}
  \istb[draw=blue,thick]{Right}[above,sloped]{u_1,u_2}
  \endist
\end{istgame}
\end{tcblisting}

If you use the starred version, like \cmd{\setistmathTF*001}, action labels are printed in \emph{italics}, by default.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
\begin{istgame}[font=\footnotesize]
\setistmathTF*001
\istroot(0)
  \istb[dashed,thick]{Left}[above,sloped]{(0,1)}
  \istb[->]{Center}[above,sloped]{(1,-1)}
  \istb[draw=blue,thick]{Right}[above,sloped]{u_1,u_2}
  \endist
\end{istgame}
\end{tcblisting}

You can, of course, do the same thing in the default math mode.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
\begin{istgame}[font=\footnotesize]
%\setistmathTF011 (default modes)
\istroot(0)
  \istb[dashed,thick]
       {\textit{Left}}[above,sloped]{(0,1)}
  \istb[->]{\textit{Center}}[above,sloped]{(1,-1)}
  \istb[draw=blue,thick]
       {\textit{Right}}[above,sloped]{u_1,u_2}
  \endist
\end{istgame}
\end{tcblisting}


\subsection{\protect\cmd{\istb*}: starred version}
\label{ssec:istbstar}

\subsubsection{\protect\cmd{\istb*}: basics}

The starred version \icmd{\istb*} prints a \xw{solid node} at the end of the corresponding branch. 
This is the only difference between \cmd{\istb} and \cmd{\istb*}.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
\begin{istgame}
\istroot[east](0)
  \istb[dashed,thick]{A} 
  \istb*[->]{}{(1,-1)}
  \istb*[draw=blue,thick]{\beta}[a]
  \endist
\end{istgame}
\end{tcblisting}

\subsubsection{\protect\cmd{\xtShowEndPoints} and \protect\cmd{\xtHideEndPoints}}
\label{page:endpoint}

Each endpoint is printed by each execution of \cmd{\istb*}.
You can print solid nodes (by default) at \emph{all} the endpoints of \emph{simple trees} by the macro \icmd{\xtShowEndPoints}.
You can also change the style of nodes for all the endpoints of simple trees, by specifying it as an optional argument, like \cmd{\xtShowEndPoints[oval node]}.

\begin{tcblisting}{listing only,breakable}
% \xtShowEndPoints
% syntax: 
  \xtShowEndPoints[<node style>]
% default:
  [solid node]
\end{tcblisting}

\xbigskip1
The macro \icmd{\xtHideEndPoints} turns off the effects of \cmd{\xtShowEndPoints}.

It is too early to say that the starred version \icmd{\xtShowEndPoints*} additionally prints the two outermost endpoints of a continuum. 
\cmd{\xtHideEndPoints*} turns off only the outermost endpoints a continuum, but not the other endpoints. (See Section~\ref{ssec:xtShowEndPoints*} on page~\pageref{ssec:xtShowEndPoints*}, for more details.)

\xbigskip1
Here is an example of using \cmd{\xtShowEndPoints} and \cmd{\xtHideEndPoints}.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
\begin{istgame}
\xtShowEndPoints[oval node,minimum size=6pt]
\istroot(0)[solid node]
  \istb[dashed,thick]{A} 
  \istb
  \istb[very thick]{\beta}[ar]
  \endist
\xtShowEndPoints % default: solid nodes
\xtdistance{15mm}{10mm}
\istroot(b)(0-2) \istb  \istb  \endist
\xtHideEndPoints % \istb* overrides
\istroot(b)(0-3) \istb  \istb*  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

Note that \cmd{\xtShowEndPoints} and \cmd{\xtHideEndPoints} should be in an \env{istgame} environment to avoid unexpected results. 
Note also that \cmd{\istb*} overrides all the effects of these two macros by forcing to print a \pkg{solid node}.


\subsection{\protect\cmd{\istbt}: terminal version}
\label{ssec:istbperiod}

\subsubsection{\protect\cmd{\istbt}: basics}

The terminal version \icmd{\istbt}\ is designed to represent a \emph{terminal move} in a game tree.
Basically, \cmd{\istbt}\ works exactly the same way as \cmd{\istb} does. 
However, using \cmd{\istbt}\ together with the macro \cmd{\xtShowTerminalNodes} you can control the shape of the terminal nodes, \emph{all at once}.

\subsubsection{\protect\cmd{\xtShowTerminalNodes} and \protect\cmd{\xtHideTerminalNodes}}
\label{page:terminalnode}

The terminal version \cmd{\istbt}\ used  with \icmd{\xtShowTerminalNodes} prints a \xw{solid node} (by default). 
You can change the style of the terminal nodes, like \cmd{\xtShowTerminalNodes[oval node]}.
This effect can be turned off by \icmd{\xtHideTerminalNodes}.

%\xbigskip1
\begin{tcblisting}{listing only,breakable}
% \xtShowTerminalNodes (works only with \istbt and other terminal versions)
% syntax: 
  \xtShowTerminalNodes[<node style>]
% default: 
  [solid node]
\end{tcblisting}

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \xtShowTerminalNodes, \xtHideTerminalNodes
\begin{istgame}
\xtShowTerminalNodes[box node,fill=green]
\istroot(0)[solid node]
  \istbt[dashed,thick]{A} 
  \istb
  \istb[very thick]{\beta}[ar]
  \endist
\xtdistance{15mm}{10mm}
\istroot(b)(0-2) \istbt*  \istbt  \endist
\xtHideTerminalNodes
\istroot(b)(0-3) \istbt   \istbt  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

\remark
Note that controlling terminal nodes by using \cmd{\xtShowTerminalNodes} works only with the terminal versions \cmd{\istbt}, \cmd{\istBt} (documented below in Section~\ref{sec:istB}) and \cmd{\istbAt} (in Section~\ref{sec:istbA}), but there will be no effect and no harm with other versions.
Note also that \icmd{\istbt*} overrides the effects of \cmd{\xtShowTerminalNodes} and \cmd{\xtHideTerminalNodes}.

\subsection{\protect\cmd{\istB}: dual label version}
\label{sec:istB}

\subsubsection{\protect\cmd{\istB}: basics}

The macro \icmd{\istB}\ works just like \cmd{\istb}, except one thing: \cmd{\istB} prints \emph{dual labels}\index{dual labels} for a branch.

The starred version \icmd{\istB*} prints a solid node at the end of the corresponding branch, just like \cmd{\istb*}.
And the terminal versions \cmd{\istBt} and \icmd{\istBt*} work just like \cmd{\istbt} and \cmd{\istbt*}, respectively, except for dual labels.

%\xbigskip1
\begin{tcblisting}{listing only,breakable}
% \istB
% syntax:
  \istB<grow>[<opt>]{<action1>}[<pos1>]{<action2>}[<pos2>]{<payoff>}[<pos>]
% defaults: 
  <grow=south>{-}{}[center]{}[center]{}[\istgrowdirection]
% arguments: all arguments are optional
  <grow=keyval> % the direction of a branch <default: south>
  [line style] % branch line style <default: solid>
  {action label 1} % action label 1 (in math mode)
  [action pos 1] % position of action label 1 <default: center>
  {action 2} % action label 2 (in math mode)
  [action label pos 2] % position of action label 2 <default: center>
  {payoff} % payoffs (in math mode)
  [payoff pos] % position of payoffs <default: \istgrwodirection: south>
\end{tcblisting}
\xbigskip1

With \cmd{\istB}, do not forget to put two labels. Otherwise, you might get an unexpected result.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% \istB
\begin{istgame}[font=\footnotesize]
\xtdistance{15mm}{30mm}
\istroot(0)[chance node]
  \istB{Black}[al]{x}[br]
  \istB{Red}[ar]{1-x}[bl]
  \endist
\istroot(1)(0-1)[initial node]
  \istBt{Head}[al]{y}[br]
  \istBt[draw=blue,thick]{Tail}[ar]{1-y}[bl]
  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

\subsubsection{\protect\cmd{\xtActionLabel} and \protect\cmd{\xtActionLabel*}}
\label{ssec:istbandxtActionLabel}

You can also use the supplementary macro \icmd{\xtActionLabel} to print additional action labels (see also Section~\ref{sec:showmidarrows} on page~\pageref{sec:showmidarrows}).
The macro \cmd{\xtActionLabel} controls, from outside of a simple tree, a branch (by default \xw{draw=none}) with a label (in math mode by default), connecting two nodes.

\xbigskip1
\begin{tcblisting}{listing only,breakable}
% \xtActionLabel
% syntax: 
  \xtActionLabel*[<line opt>](<from>)(<to>){<action>}[<pos>,<node opt>]
% default:
  [-,draw=none](<m>)(<m>){}[black,text depth=.25]
\end{tcblisting}


\remark
In some cases, it is not a good idea to use \cmd{\istB} to print dual action labels.
\begin{itemize}\tightlist
\item With \cmd{\istB}, the features of \emph{middle arrows} provided by this package does not work well (see Section~\ref{sec:showmidarrows} on page~\pageref{sec:showmidarrows}).
\label{page:noistB}

\item With respect to a \emph{continuum} of branches, \cmd{\istB} has little role to play.
\end{itemize}

You can do the same thing as \cmd{\istB} does by using \cmd{\istb} and together with \cmd{\xtActionLabel}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \istb and \xtActionLabel
\begin{istgame}[font=\footnotesize]
\xtdistance{15mm}{30mm}
\istroot(0)[chance node]
  \istb{Left}[al]
  \istb{Right}[ar]
  \endist
\istroot(1)(0-1)[initial node]
  \istbt{Head}[al]
  \istbt{Tail}[ar]
  \endist
\xtActionLabel(0)(0-1){x}[br]
\xtActionLabel(0)(0-2){1-x}[bl]
\xtActionLabel(1)(1-1){y}[br]
\xtActionLabel[draw,blue,thick](1)(1-2){1-y}[bl]
\end{istgame}
\end{tcblisting}

The starred version \cmd{\xtActionLabel*} prints its label in the input mode as set by \cmd{\setistmathTF*} (see Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}, for more details on \cmd{\setistmatTF}).

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \istb and \xtActionLabel*
\begin{istgame}[font=\footnotesize]
\xtdistance{15mm}{30mm}
\istroot(0)[chance node]
  \istb{Left}[al]
  \istb{Right}[ar]
  \endist
\istroot(1)(0-1)[initial node]
  \istbt{Head}[al]
  \istbt{Tail}[ar]
  \endist
\xtActionLabel(0)(0-1){x}[br]
\xtActionLabel(0)(0-2){1-x}[bl]
\setistmathTF*001{texttt}
\xtActionLabel*(1)(1-1){y}[br]
\xtActionLabel*[draw,blue,thick](1)(1-2){1-y}[bl]
\end{istgame}
\end{tcblisting}


\subsection{\protect\cmd{\istbA}: alternative (or arc) version}
\label{sec:istbA}

\subsubsection{\protect\cmd{\istbA}: basics}

The macro \icmd{\istbA} is an alternative (or arc) version, doing one more thing than \cmd{\istb}. With \cmd{\istbA} you can \emph{easily change the level distance} of an individual branch using a factor (\xw{1}, by default) \emph{as the first optional argument} in parentheses. All other arguments are the same as in \cmd{\istb}.
For example, \cmd{\istbA(.5)} is an abbreviation of \cmd{\istb<level distance=.5*\textbackslash xtlevdist>},
as you can see in the example below: 

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \istbA
\begin{istgame}
\istroot(0)      \istb \istbA            \endist
\istroot(1)(0-1) \istb \istbA(.5){b}     \endist
\istroot(2)(0-2) \istb
 \istbA<level distance=.5*\xtlevdist>{b} \endist
\end{istgame}
\end{tcblisting}

You can interchangeably use \icmd{\istbA} and \cmd{\istb}, except for one case, in which you are working with  a continuum of branches.

\xbigskip1
\remark (too early to comment)
\begin{itemize}\tightlist
\item The macro \cmd{\istbA} is originally created to work with \cmd{\istrootcntmA} as an arc version.
\item \cmd{\istbA} draws, by default, a branch up to an arc when used with the continuum arc version \cmd{\istrootcntmA}, but \cmd{\istb} does not. (For more details, see Section~\ref{ssec:cntmA} on page~\pageref{ssec:cntmA}.)
\item Except for the case of using a continuum of branches, \cmd{\istbA} is equivalent to \cmd{\istb} for users.
\end{itemize}

Its terminal version \icmd{\istbAt} is also available, but the dual label version of \cmd{\istbA} is not provided.
The starred versions \icmd{\istbA*} and \icmd{\istbAt*} print an solid node (by default) at the end of the corresponding branch.

\subsubsection{\protect\cmd{\istbA}: application}
By specifying the \xw{grow} key of \cmd{\istb} you can draw a branch with the exact length you want.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \istbA
\begin{istgame}
\xtdistance{10mm}{15mm}
\istroot(0) \istb \istb \istb    \endist
\istroot(1)(0-1) 
  \istbA(.7)<grow=-120>  %  7mm long
  \istb                  % 10mm long
  \istbA(1)<grow=-30>{b} % 10mm long
  \endist
\istroot(2)(0-3) \istb \istbA{b} \endist
\draw [dashed] (1) circle (10mm);
\draw [dotted] (1) circle (7mm);
\end{istgame}
\end{tcblisting}

\xbigskip1
You can also apply \cmd{\istbA} to easily ruin your regular balanced trees.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \istbA
\begin{istgame}
\xtdistance{10mm}{15mm}
\istroot(0) \istbA(.2) \istbA(1.5) \istbA(1.2) \endist
\istroot(1)(0-1) 
  \istbA(.7) \istb \istbA(2)<grow=-60>{b} \endist
\istroot(2)(0-3) \istbA(.2) \istbA(-1){b} \endist
\end{istgame}
\end{tcblisting}


\section{Important labels: players, action labels, and payoffs}
\label{sec:corelabels}

\subsection{How to put players}

\subsubsection{Players: basics}

%As discussed in~\ref{ssec:istroot} on page~\pageref{ssec:istroot}, t
The macro \icmd{\istroot} specifies the (sub)root of a simple tree and puts its \isw{owner} (or a \isw{player}).
The direction to which a player label is put is set by the angle \xw{< >} option of \cmd{\istroot}, like \xw{<above>} (by default), \xw{<east>}, or \xw{<45>}.
To specify the direction you can use degrees, the compass directions, or positional words.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: node owner
\begin{istgame}
\istroot(0)<above>{Child} % default: <above>
  \istb  \istb  \endist
\istroot(1)(0-2)<45>{Parent}
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

\remark
\begin{itemize}
\item
The supplementary macro \cmd{\xtOwner} is provided as an extra way of putting owners of decision nodes (see Section~\ref{ssec:suppmac} on page~\pageref{ssec:suppmac}). 
\item
Though an owner is to be input in text mode, by default, it is also possible to change the input mode to math mode with \cmd{\setistmathTF(*)} (see below in Section~\ref{ssec:setistmathTF-owners} and Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}).
\end{itemize}

\xbigskip1
Note that the oval version \cmd{\istrooto} produces a bubble type node with an owner in it, so the directional option \xw{<angle>} is redundant with \cmd{\istrooto} (see Section~\ref{ssec:istrootstar} on page~\pageref{ssec:istrootstar}).

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: node owner (with \istrooto)
\begin{istgame}
\istrooto(0){Child}
  \istb  \istb  \endist
\istrooto(1)(0-2)<45>{\textbf{Parent}}
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}

\subsubsection{Coloring players or a whole simple tree using \protect\cmd{\istroot}}

\label{sec:firstthing}

You can change the color of a player's name by giving \xw{color} in the angle option of \cmd{\istroot}, like \xw{<[red]>} or \xw{<[blue]45>}.
(This is the \TikZ\ way of giving options for a node \xw{label}.)

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: coloring players
\begin{istgame}
\istroot(0)<[red]>{Child}
  \istb  
  \istb  
  \endist
\istroot(1)(0-2)<[blue]45>{\textsf{Parent}}
  \istb  
  \istb  
  \endist
\end{istgame}
\end{tcblisting}

%\xbigskip1
The example below shows how you color a whole simple tree: \xw{red} for the Child's simple tree and \xw{blue} for the Parent's simple tree.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: coloring a simple tree
\begin{istgame}
\istroot[south,red](0) % whole simple tree, but node
        [draw=red,fill=red] % for node only
        <[red]45>{Child}    % for onwer only
  \istb{l}[al]{0,2}[south]  
  \istb{r}[ar]
  \endist
\istroot[south,draw=blue](1)(0-2)<45>{\texttt{Parent}}
  \istb{l}[al]{1,-1}[south]  
  \istb{r}[ar]{1,1}[-90]  
  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1
\remark 
\begin{itemize}
\item In the above example, the first \cmd{\istroot} has three bracket \xw{[option]}'s: the first bracket option is for a \emph{whole simple tree} including \emph{branches} and \emph{labels} (except a node style), the second for a a \emph{node} style of a decision node, and the third for the \emph{owner} of the (sub)root.
  \begin{itemize}
  \item If you want to have all the branches, action labels, and payoffs in red, 
        just use the color name like \xw{[south,red]}.
        If you want to have just the branches in blue, use the \xw{draw} option key like \xw{[south,draw=blue]}.
        (This is what \TikZ\ does.)
  \end{itemize}
\item Note that the \emph{first entry} in the first \xw{[option]} list of \cmd{\istroot} \emph{must} be \emph{the growing direction of a simple tree}. So it should be input like \xw{[south,red]}, but never like \xw{[red,south]}.
(This is what \cmd{\istroot} requires.) Otherwise, you will get a compile \emph{error}.
\end{itemize}

\subsubsection{Decorating players or a whole simple tree using \protect\cmd{\istrooto}}

The oval version \icmd{\istrooto} puts an owner whithin a bubble type node.
With \cmd{\istrooto}, the color of a player can be changed by the second bracket \xw{[option]}, such as \xw{[red]} or \xw{[blue]}.
(This is the \TikZ\ way for giving options for a \xw{node}.)

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: decorating players (with \istrooto)
\begin{istgame}
\istrooto(0)[red]{Child}
  \istb{a}{B}[below]  \istb{c}  \endist
\istrooto(1)(0-2)[blue,dashed]{Parent}
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

The following example shows how you can color, with \cmd{\istrooto}, a whole simple tree including action labels and payoffs in \xw{red} or \xw{blue}, except for node styles.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: decorating players (with \istrooto)
\begin{istgame}
\istrooto[south,red](0)[draw=green,blue]{Child}
  \istb*{a}{B}[below]  \istb{c}  \endist
\istrooto[-90,blue](1)(0-2)[draw=blue,blue]{Parent}
  \istb*  \istb  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

What if you want to paint some color into the background of each oval node or box node? You can also do this simply by using the \TikZ\ way of giving options for nodes.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: decorating oval/box nodes
\begin{istgame}
\istrooto(0)[top color=white,
             bottom color=blue!80!black,yellow]{Child}
  \istb  \istb  \endist
\istrooto(1)(0-2)[box node,fill=red!20,blue]{Parent}
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}
%\xbigskip1

\subsubsection{Changing the input mode and text font style: \protect\cmd{\setistmathTF(*)}}
\label{ssec:setistmathTF-owners}

You can change the input mode for owners from text mode (by default) to math mode by using the macro \cmd{\setistmathTF111} which has three mandatory arguments.
The first number \xw{1} means that an owner is printed in \emph{math mode}.
(The second number \xw{1} and third number \xw{1} mean that action labels and payoffs are in math mode, respectively.)
\cmd{\setistmath011} means that an owner is printed in text mode (this is default).

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \setistmathTF
\begin{istgame}
\setistmathTF111   % owner: math mode
\istroot(0){\Omega_{\alpha}}+10mm..20mm+
                               \istb \istb \endist
\istroot(1)(0-1)<180>{Alpha 2} \istb \istb \endist
\setistmathTF011   % owner: text mode
\istroot(2)(0-2)<0>{Omega 2}   \istb \istb \endist
\end{istgame}
\end{tcblisting}
%\xbigskip1

The starred version, for example, \cmd{\setistmathTF*011}, enables you to change the font style of an owner.
Moreover, by specifying a text font style, like \cmd{\setistmathTF*011<texttt>}, in angle brackets, you can print an owner in typewriter font. (See Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}, for more details.)

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \setistmathTF(*)
\begin{istgame}
\setistmathTF111          % owner: math mode
\istroot(0){\Omega_{\alpha}}+10mm..20mm+
                               \istb  \istb  \endist
\setistmathTF011          % owner: text mode
\istroot(1)(0-1)<180>{Alpha 2} \istb \istb \endist
\setistmathTF*011<texttt> % owner: in texttt
\istroot(2)(0-2)<0>{Omega 2}   \istb \istb \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

The supplementary macro \cmd{\xtOwner} gives an alternative way of putting, outside of a simple tree, an owner in \emph{text mode} at a node.
The starred version \cmd{\xtOwner*} prints an owner as in the input mode set by \cmd{\setistmathTF*}.
(See Section~\ref{ssec:suppmac} on page~\pageref{ssec:suppmac}, for more details on \cmd{\xtOwner}.)

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \setistmathTF(*)
\begin{istgame}
\setistmathTF111 % owner: math mode
\istroot(0){\Omega_{\alpha}}+10mm..20mm+
                 \istb  \istb  \endist
\setistmathTF*011<textbf>   % owner: text mode
\istroot(1)(0-1) \istb \istb \endist
\istroot(2)(0-2) \istb \istb \endist
\xtOwner*(1){Alpha 2}[left] % owner: textbf
\xtOwner(2){Omega 2}[r]     % owner: normal font
\end{istgame}
\end{tcblisting}
%\xbigskip1


\subsection{How to put action labels}

\subsubsection{Action labels: basics}

The macro \icmd{\istb} prints a \isw{branch} and its \isw{action} label.
Note that action labels should be input in \emph{math mode}, by default.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: action labels
\begin{istgame}
\istroot(0)
  \istb{Good}[above left]  \istb{Bad}  \endist
\istroot(1)(0-2)
  \istb{\text{\fbox{$\alpha$}}}[above left]  
  \istb{\text{\fbox{$\beta$}}}[above right]  
  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

By default, \cmd{\istb} prints its action label on the midpoint of the corresponding branch.
You can specify the position of an action label with the positional words and their abbreviations but not by the compass directions or degrees.

In the following example, the abbreviations are used to place action labels.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: action labels with abbreviations
\begin{istgame}
\istroot(0)
  \istb{Good}[al]  \istb{Bad}  \endist
\istroot(1)(0-2)
  \istb{\text{\fbox{$\alpha$}}}[al]  
  \istb{\text{\fbox{$\beta$}}}[ar]  
  \endist
\end{istgame}
\end{tcblisting}
%\xbigskip1

Notice that with the \emph{abbreviations} the position of an action label is (internally) adjusted to get better result (for more details, see Section~\ref{sec:abb} on page~\pageref{sec:abb}).

\xbigskip1
\remark
\begin{itemize}\tightlist
\item
The supplementary macro \cmd{\xtActionLabel} is provided for an extra way of putting an action label (see Section~\ref{ssec:suppmac} on page~\pageref{ssec:suppmac}, for more details).
\item
By default, action labels are to be input in \emph{math mode}. You can change the input mode to text mode by using \cmd{\setistmathTF} or \cmd{\setistmathTF*} (see below in Section~\ref{ssec:setistmathTF-actionlabels} and  Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}).
\end{itemize}

\subsubsection{Decorating action labels}

You can change the color of action labels with \TikZ\ options. 
In the example below, the bracket options before an action label are for branches and those after are only for the action labels.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: color and line style
\begin{istgame}
\istroot(0)
  \istb[dashed,thick]{A}[al]
  \istb[blue,very thick]{B}[r]
  \istb[blue,very thick]{C}[above right,red]
  \endist
\end{istgame}
\end{tcblisting}

\xbigskip1
\remark It is \emph{important} to remember that you cannot use the abbreviations with additional options. For example, you can do like \cmd{\itsb\{C\}[ar]} but not like \cmd{\istb\{B\}[ar,red]}. Instead, you should do like \cmd{\istb\{C\}[above right,red]}.
\xbigskip1

You can also express action labels in a box or a circle, or other shapes with colors.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: decorating action labels
\begin{istgame}
\istroot(0)
  \istb{A}[above left,draw=black,circle,fill=red!20]
  \istb{B}[right,draw=black,fill=green,inner sep=0pt]
  \istb{\textbf{C}}[above right,fill=blue,yellow]
  \endist
\istroot(1)(0-2)
  \istb{D}[above left,xshift=-3pt,draw=blue,double]
  \istb{E}[above right,xshift=5pt,draw,star]
  \endist
\end{istgame}
\end{tcblisting}


\subsubsection{Sloped action labels}
\label{ssec:slopedlabels}

You can print \isw{sloped labels} for actions by using the \TikZ\ option \xw{sloped}. 
Still you should remember that you cannot use the abbreviations to place action labels with other options like \xw{sloped}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
\begin{istgame}
\istroot(0)
  \istb{Good}[above,sloped]
  \istb{Bad}[above,sloped]      \endist
\istroot(1)(0-2)
  \istb{\text{\fbox{$\alpha$}}}[above,sloped]  
  \istb{\text{\fbox{$\beta$}}}  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

\warning
Issues in \emph{sloped labels} in \TikZ\ with \emph{asymmetric scales}:
\begin{itemize}\tightlist
\item The \xw{tree} library in \TikZ\ does not seem to treat sloped labels properly, when \xw{xscale} or \xw{yscale} is used asymmetrically.

% Example: actions labels with abbreviations
\begin{tcblisting}{listing outside text, righthand width=.31\linewidth}
\begin{istgame}[xscale=2.5]
\istroot(0)
  \istb{Good}[above,sloped]
  \istb{Bad}[above,sloped]      \endist
\istroot(1)(0-2)
  \istb{\text{\fbox{$\alpha$}}}[above,sloped]  
  \istb{\text{\fbox{$\beta$}}}  \endist
\end{istgame}
\end{tcblisting}

\item A temporary solution to cure this issue is to declare the macro \cmd{\xtcureslopedlabelsNS}, provided with this package, in a TeX group with caution. 
For a tree growing eastwards or westwards, use \cmd{\xtcureslopelabelsEW}, instead.
(\emph{These solutions are only temporary. They have not been tested for every occasion.})

% Example: actions labels with abbreviations
\begin{tcblisting}{listing outside text, righthand width=.31\linewidth}
\begin{istgame}[xscale=2.5]
\xtcureslopedlabelsNS
\istroot(0)
  \istb{Good}[above,sloped]
  \istb{Bad}[above,sloped]      \endist
\istroot(1)(0-2)
  \istb{\text{\fbox{$\alpha$}}}[above,sloped]  
  \istb{\text{\fbox{$\beta$}}}  \endist
\end{istgame}
\end{tcblisting}
\end{itemize}


%\clearpage
\subsubsection{Dual action labels}

You can also express \isw{dual labels} for actions by using \icmd{\istB} or \icmd{\istBt}.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[sloped,font=\footnotesize]
\xtdistance{15mm}{25mm}
\istroot(0)[chance node]
  \istB{Black}[a]{x}[b]  
  \istB{Red}[a]{1-x}[b]    \endist
\istroot(1)(0-1)[chance node]
  \istBt{Head}[a]{y}[b]
  \istBt{Tail}[a]{1-y}[b]  \endist
\end{istgame}
\end{tcblisting}

You can do the same thing as \cmd{\istB} does by using \cmd{\istb} together with the supplementary macro \cmd{\xtActionLabel} (see Section~\ref{ssec:istbandxtActionLabel} for more details on dual action labels).

\subsubsection{Changing the input mode and text font style: \protect\cmd{\setistmathTF(*)}}
\label{ssec:setistmathTF-actionlabels}

By default the input mode for action labels is in \emph{math mode}. With \icmd{\setistmathTF}, you can change the input mode for labels. The package's default input mode is set as \cmd{\setistmathTF011}, meaning that the input mode for an owner is in text mode (denoted by the first \xw{0}), for action labels in math mode (denoted by the second number \xw{1}), and for payoffs in math mode (denoted by the third number \xw{1}).

So if do like \cmd{\setistmathTF001} (with the second number \xw{0}), action labels are in \emph{text mode}. 

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \setistmathTF001
\begin{istgame}[sloped,font=\footnotesize]
\istroot(0)[chance node]+15mm..25mm+
  \istB{Left}[a]{x}[b] \istB{Right}[a]{1-x}[b] \endist
\setistmathTF001         % action labels: in text mode
\istroot(1)(0-1)[chance node]
  \istBt{Left}[a]{y}[b] \istBt{Right}[a]{1-y}[b] \endist
\istroot(2)(0-2)[chance node]
  \istBt{Head}[a]{z}[b] \istBt{Tail}[a]{1-z}[b] \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

Moreover, if you use the starred vesrion, like \icmd{\setistmathTF*}\xw{001}, action labels automatically are printed in \emph{italics}. 
If you specify a font style in \emph{curly braces}, like \cmd{\setistmathTF*001\{texttt\}}, you can even print action labels in typewriter font.
For more details, see Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \setistmathTF*001 (in italics)
\begin{istgame}[sloped,font=\footnotesize]
\istroot(0)[chance node]+15mm..25mm+
  \istB{Left}[a]{x}[b] \istB{Right}[a]{1-x}[b] \endist
\setistmathTF*001         % action labels: in italics
\istroot(1)(0-1)[chance node]
  \istB{Left}[a]{y}[b] \istB{Right}[a]{1-y}[b] \endist
\setistmathTF*001{texttt} % action labels: in texttt
\istroot(2)(0-2)[chance node]
  \istB{Head}[a]{z}[b] \istB{Tail}[a]{1-z}[b] \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

The supplementary macro \cmd{\xtActionLabel} prints, from outside of a simple tree, an action label in \emph{math mode}.
The starred version \cmd{\xtActionLabel*} prints an action label in the input mode as set by \cmd{\setistmathTF*}.
For more details, see Section~\ref{ssec:istbandxtActionLabel} (on page~\pageref{ssec:istbandxtActionLabel}) and Section~\ref{sec:setistmathTF} (on page~\pageref{sec:setistmathTF}).

%\xbigskip1
%\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
%% Example: \xtActionLabel* (with \setistmathTF*)
%\begin{istgame}[sloped,font=\footnotesize]
%\istroot(0)[chance node]+15mm..25mm+
%  \istb{Left}[a] \istb{Right}[a] \endist
%\setistmathTF*001         % action labels: in italics
%\istroot(1)(0-1)[chance node]
%  \istb{Left}[a] \istb{Right}[a] \endist
%\setistmathTF*001{texttt} % action labels: in texttt
%\istroot(2)(0-2)[chance node]
%  \istb{Head}[a] \istb{Tail}[a] \endist
%\xtActionLabel*(0)(0-2){1-x}[b]  % in texttt
%\xtActionLabel(1)(1-2){1-y}[b]   % in math mode (default)
%\xtActionLabel*(2)(2-2){1-z}[b]  % in texttt
%\end{istgame}
%\end{tcblisting}
%\xbigskip1


%\clearpage
\subsection{How to put payoffs}

\subsubsection{Payoffs: basics}

The macro \icmd{\istb} can print a branch and also the corresponding payoffs, in \emph{math mode} by default, near at its endpoint.
The payoffs are put in the direction set by \icmd{\setistgrowdirection} (\xw{south}, by default), unless it is changed by \xw{<grow keyval>} of \cmd{\istroot}.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: payoffs
\begin{istgame}
\istroot(0)
  \istb{Good}[l]{0,2}  
  \istb{Bad}  
  \endist
\istroot(1)(0-2)
  \istb{\alpha}[al]{(1,1)}
  \istb{\beta}[ar]{-1,-1}
  \endist
\end{istgame}
\end{tcblisting}

\xbigskip1
\remark 
\begin{itemize}\tightlist
\item
The supplementary macro \cmd{\xtPayoff} is provided for an extra way of putting payoffs (see Section~\ref{ssec:suppmac} on page~\pageref{ssec:suppmac}).
\item
The payoffs are to be input in math mode, by default, you change the input mode to text mode by using \cmd{\setistmathTF(*)} (see Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}).
\end{itemize}

\subsubsection{Payoffs and \protect\xttw{\textbackslash istgrowdirection}}
\label{sec:payoffdirection}

The \isw{direction} of where payoffs are put from a terminal node follows \icmd{\istgrowdirection} typed in as the first optional argument of \cmd{\istroot}.
The default direction is \xw{south} and can be changed by \cmd{\setistgrowdirection}.
For example, \cmd{\setistgrwodirection\{north\}} changes the default direction to \xw{north}.

To specify the tree growing direction or the position of payoffs to be put, you can use degrees, the compass directions, or the positional words and their \emph{abbreviations}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: grow=south (default)
\begin{istgame}
\istroot(0)
  \istb[dashed,thick]{A}{\binom23}
  \istb*{}{(-2,3)}
  \istbt[blue,very thick]{B}[ar]{2,3}
  \endist
\end{istgame}
\end{tcblisting}
%\xbigskip1

By default, \xw{grow=south}, so \cmd{\istgrowdirection} is \xw{south} (or \xw{below} or \xw{-90}).
The above example shows payoffs at the south (by default) of terminal nodes.

\xbigskip1
\remark
  \begin{itemize}\tightlist
  \item 
  You can simply omit the position of payoffs. Then they are printed, by default, in the direction as set by \cmd{\istgrowdirection}.
  \item 
  However, if you use options other than the direction of payoffs, you must specify the direction with others.
  \item
  Moreover, the direction \emph{must} be the \emph{first} entry of the option list for payoffs and the abbreviations cannot be used.
  For example, \xw{[b,yshift=-3mm]} and \xw{[yshift=-3mm,below]} are not accetable. 
  It must be that \xw{[below,yshift=-3mm]}.
  \item Note also that you can do like \xw{[[yshift=-3mm]below}, instead (see also page~\pageref{page:finetuningpayoffs}).
  \end{itemize}

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: grow=south (default)
\begin{istgame}
\istroot(0)
  \istb[dashed,thick]{A}{\binom23}
  \istb*{}{(-2,3)}
  \istbt[blue,very thick]{B}[ar]{2,3}
        [below,yshift=-3mm,draw]
  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

You can see more examples, below, that show the positions of payoffs, by default, depend on the tree growing directions, unless you specify different directions.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: grow=right (or east or 0 degree)
\begin{istgame}
\istroot[right](0)
  \istb[dashed,thick]{A}{\binom23}
  \istb*{}{(-2,3)}
  \istbt[blue,very thick]{B}[al]{2,3}
  \endist
\xtHideTerminalNodes
\end{istgame}
\end{tcblisting}

\verb|grow=right=\istgrowdirection|, so payoffs are put on the right.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: grow=north
\begin{istgame}
\setistgrowdirection{north}
\istroot(0)
  \istb[dashed,thick]{A}{\binom23}
  \istb*{}{(-2,3)}
  \istbt[blue,very thick]{B}[bl]{2,3}
  \endist
\end{istgame}
\end{tcblisting}

\verb|grow=north=\istgrowdirection|, so payoffs are put above the terminal nodes.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: grow=south west
\begin{istgame}
\istroot[south west](0)
  \istb[dashed,thick]{A}{\binom23}
  \istb{}{(-2,3)}
  \istb[blue,very thick]{B}[right]{2,3}
  \endist
\end{istgame}
\end{tcblisting}

\verb|grow=south west=\istgrowdirection|, so payoffs are put below left of the terminal node.

\xbigskip1
You can adjust the direction of putting payoffs by specifying a directional word right after payoffs, like \verb|\istb[blue,very thick]{B}[right]{2,3}[below]|. 

You can use the \isw{abbreviations} \xw{[l]}, \xw{[r]}, \xw{[a]}, and \xw{[b]} for \xw{[left]}, \xw{[right]}, \xw{[above]}, and \xw{[below]}, respectively.
The abbreviations \xw{[al]}, \xw{[ar]}, \xw{[bl]}, and \xw{[br]} can also be used
for \xw{[above left]}, \xw{[above right]}, \xw{[below left]}, and \xw{[below right]}, respectively,
to put payoffs (for more details about abbreviations, see Section~\ref{sec:abb} on page~\pageref{sec:abb}). 

Notice also that, instead of the positional words, you can use the compass directions or degrees, like \verb|\istb[blue,very thick]{B}[right]{2,3}[-90]|.


\subsubsection{Decorating payoffs}

You can change the color of payoffs by giving \TikZ\ options right before the positional words for payoffs. 
For example you can do like \xw{\istb...\{(1,1)\}[[blue]below]}.
%This is the \TikZ\ way of giving options for \xw{label}.
Note that, in this case, you cannot use the abbreviation of the positional words.

\begin{tcblisting}{listing outside text, righthand width=.2\linewidth}
% Example: coloring payoffs
\begin{istgame}
\istroot(0)
  \istb{Good}[l]{0,2}  \istb{Bad}  \endist
\istroot(1)(0-2)
  \istb{\alpha}[al]{(1,1)}[[red]below]
  \istb{\beta}[ar]{-1,-1}[[blue]below]
  \endist
\end{istgame}
\end{tcblisting}

You can also put payoffs in a box, a circle, or other shapes, even with color in the background.

\begin{tcblisting}{listing outside text, righthand width=.2\linewidth}
% Example: decorating payoffs
\begin{istgame}
\istroot(0)
  \istb{Good}[l]{0,2}[[draw,circle,double,fill=green]below]
  \istb{Bad}  \endist
\istroot(1)(0-2)
  \istb{\alpha}[al]{(1,1)}[[red,draw=black]below]
  \istb{\beta}[ar]{\textbf{-1,-1}}
       [[draw,ellipse,fill=blue,yellow,inner sep=2pt]below]
  \endist
\end{istgame}
\end{tcblisting}


\subsubsection{Changing the input mode and text font style: \protect\cmd{\setistmathTF(*)}}
\label{ssec:setistmathTF-payoffs}

You can change the input mode for payoffs from math mode (by default) to text mode,
by using \cmd{\setistmathTF010}. The last \xw{0} means that payoffs are in text mode.

\begin{tcblisting}{listing outside text, righthand width=.2\linewidth}
% Example: \setistmathTF
\begin{istgame}
\istroot(0)
  \istb{Good}[l]{pizza 1}  \istb{Bad}  \endist
\setistmathTF010 % payoffs: in text mode
\istroot(1)(0-2)
  \istb{\alpha}[al]{out 1}  \istb{\beta}[ar]{in 1}  \endist
\end{istgame}
\end{tcblisting}

The starred version, for example, \cmd{\setistmathTF*010[texttt]}, with a font style specified in brackets, prints payoffs in typewriter font.

\begin{tcblisting}{listing outside text, righthand width=.2\linewidth}
% Example: \setistmathTF*
\begin{istgame}
\setistmathTF010 % payoffs: in text mode
\istroot(0)
  \istb{Good}[l]{pizza 1}  \istb{Bad}  \endist
\setistmathTF*010[texttt] % payoffs: in texttt
\istroot(1)(0-2)
  \istb{\alpha}[al]{out 1}  \istb{\beta}[ar]{in 1}  \endist
\end{istgame}
\end{tcblisting}

The supplementary macro \cmd{\xtPayoff} prints, outside of a simple tree, payoffs in \emph{math mode}.
The starred version \cmd{\xtPayoff*} prints payoffs in the input mode as set by \cmd{\setistmathTF*}.
See Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}.


\section{Input mode and text font style changer: \protect\cmd{\setistmathTF(*)}}
\label{sec:setistmathTF}

The macro \icmd{\setistmathTF} enables you to change the input mode for important labels: owners, action labels, and payoff.
It takes three numbers (\xw{0} or \xw{1}) as \emph{mandatory} arguments.  Here, \xw{1} (\xw{true}) means the input mode is in \emph{math mode} and \xw{0} (\xw{false}) in \emph{text mode}.
The three numbers represents the input mode for owners, action labels, and payoffs, respectively.
In this package, it is initially set as \verb|\setistmathTF{0}{1}{1}|, meaning that owners are to be input in text mode, and action labels and payoffs in math mode.

\begin{tcblisting}{listing only}
% \setistmathTF
% syntax: 
  \setistmathTF{<owner input mode>}{<action input mode>}{<payoff input mode>}
% initial values:
  {0}{1}{1} 
\end{tcblisting}

The starred version \icmd{\setistmathTF*} accepts (in addition to three \emph{mandatory} numbers) three \emph{optional} arguments, each of which is effective \emph{only when} the corresponding input mode is in \emph{text mode}.
The arguments are to be one of text font styles \emph{without a backslash} such as \xw{textrm}, \xw{textit}, \xw{itshape}, \xw{textbf}, \xw{scriptsize}, \xw{tiny}, and so on.
Each of the three optional arguments is ignored when used with \cmd{\setistmathTF} and when the corresponding input mode is in math mode.

\begin{tcblisting}{listing only}
% \setistmathTF
% syntax: 
  \setistmathTF{}{}{}<owner font>{<action label font>}[<payoff font>]
% defaults
  {0}{1}{1}<>{textit}[]
\end{tcblisting}

The first optional argument in \emph{angle brackets} is the font style for an owner, the second in \emph{curly braces} for action labels, and the third \emph{in brackets} for payoffs. By default action labels are printed in \emph{italics}.

For example, with \cmd{\setistmathTF*000<texttt>\{textit\}[tiny]} delared, an owner is printed in typewriter font, action labels in italics, and payoffs in the tiny size of normal text font (roman, upright).
With \cmd{\setistmathTF000<texttt>\{textit\}[tiny]}, all the optional arguments are ignored and all the labels are printed in normal text font.
Note also that with \cmd{\setistmathTF*001}, you can print action labels in \emph{italics} (by default).

\subsection{\protect\cmd{\setistmathTF}: input mode changer}

The macro \cmd{\setistmathTF} is an \emph{input mode changer}, taking three numbers as mandatory arguments.
The default input modes for important labels are set as \cmd{\setistmathTF011}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% Example: \setistmathTF
\begin{istgame}
%\setistmathTF011 % (default mode)
\xtdistance{20mm}{20mm}
\istroot(0){Alan 1}+20mm..40mm+
  \istb{left 1}[al]
  \istb{right 1}[ar]         \endist
\setistmathTF001 % mode: text,text,math
\istroot(1)(0-1)<180>{Bob 2}
  \istb{left 2}[al]{pie 1}
  \istb{right 2}[ar]{pie 2}  \endist
\setistmathTF100 % mode: math,text,text
\istroot(2)(0-2)<0>{Kim 3}
  \istb{left 3}[al]{pie 3}
  \istb{right 3}[ar]{pie 4}  \endist
\end{istgame}
\end{tcblisting}


\subsection{\protect\cmd{\setistmathTF*}: input mode and text font style changer}

The starred version \cmd{\setistmathTF*} is a \emph{text font style changer} as well as an \emph{input mode changer}. It takes three numbers as \emph{mandatory} arguments followed by three \emph{optional} arguments in the order of \verb+<>{}[]+. The first option \xw{<>} is for an owner, the second \verb+{}+ for action labels, and the third \xw{[]} for payoffs.

Each optional argument should be one of valid font shapes and sizes, but without a textbackslash (not as a command), 
such as \xw{textbf}, \xw{textsc}, \xw{textit}, \xw{large}, \xw{tiny}, and so on.
Each of the options is effective only when it is used with the starred version \cmd{\setistmathTF*} and the corresponding input mode is in text mode.

\xsmallskip1
\remark
Note that if the second optional argument is omitted when action labels are in text mode, for example, like \cmd{\setistmathTF*001}, \emph{action labels} are printed in \emph{italics} by default.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% Example: \setistmathTF*
\begin{istgame}
\xtdistance{20mm}{20mm}
\setistmathTF*011<textsc>{tiny}[textbf]
\istroot(0){Alan 1}+20mm..40mm+
  \istb{left 1}[al]
  \istb{right 1}[ar]         \endist
\setistmathTF*001<textsc>{tiny}[textbf]
\istroot(1)(0-1)<180>{Bob 2}
  \istb{left 2}[al]{pie 1}
  \istb{right 2}[ar]{pie 2}  \endist
\setistmathTF*100[textbf] % actions labels in italics (by default)
\istroot(2)(0-2)<0>{Kim 3}
  \istb{left 3}[al]{pie 3}
  \istb{right 3}[ar]{pie 4}  \endist
\end{istgame}
\end{tcblisting}

\subsection{\protect\cmd{\setistmathTF*} and supplementary macros \texttt{\textbackslash xtFoo*} printing labels}

Many supplementary macros, working outside of a simple tree, optionally print important labels: owners, action labels, and payoffs.
These include \icmd{\xtOwner}, \icmd{\xtActionLabel}, \icmd{\xtPayoff}, \icmd{\xtInfosetOwner} and many more.
All of the macros for information sets (except \cmd{\cntmAInfoset} and \cmd{\cntmAInfosetO}) such as \cmd{\xtInfoset} or \cmd{\xtCInfosetO} also print the owners of information sets.
With any supplementary macros, by default, an owner is printed in text mode and action labels and payoffs are printed in math mode.

All of these macros have their own \emph{starred} (\xw{*}) versions, which print the labels in the input mode as set by \icmd{\setistmathTF*} (but not by \cmd{\setistmathTF}). For example, \icmd{\xtActionLabel*} prints action labels in \emph{italics} with \cmd{\setistmathTF*001}, while \cmd{\xtActionLabel} prints action labels in \emph{math mode}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% Example: \setistmathTF*
\begin{istgame}
\xtdistance{20mm}{20mm}
\setistmathTF*000<textsc>{tiny}[textbf]
\istroot(0)+20mm..40mm+ \istb \istb \endist
\istroot(1)(0-1)        \istb \istb \endist
\xtOwner*(0){Alan 1}  \xtOwner(1){Bob 2}[l]
\xtActionLabel(0)(0-1){left 1}[al]
\xtActionLabel*(1)(1-1){left 2}[al]
\xtPayoff*(1-1){pie 1}
\end{istgame}
\end{tcblisting}

You can find more examples for supplementary macros in this regard that are scattered here and there throughout the manual in appropriate places. See Section~\ref{ssec:setistmathTF-owners} Section~\ref{ssec:setistmathTF-actionlabels} Section~\ref{ssec:setistmathTF-payoffs}.

\xbigskip1
Here are some more examples on owners of information sets (see Section~\ref{sec:infoset} for more details on information sets).

\label{page:xtInfoset*}
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}
\setistmathTF*011<textsf>
\istroot(0){Alice}+15mm..30mm+  \istb{A} \istb{B} \endist
\istroot(1)(0-1)<135>{Ben}  \istb{C} \istb{D} \endist
\istroot(2)(0-2)   \istb{a} \istb{b} \endist
\istroot(3)(1-2)   \istb{a} \istb{b} \endist
\setistmathTF*011<textbf>
\xtInfosetO(0)(0)
\xtInfosetO[rectangle,rounded corners=.2em](1)(1)
\xtInfosetO*[ellipse,fill=blue!60]
           (3)(2){Cate}[sloped,white](1.5em)
\end{istgame}
\end{tcblisting}


\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
\begin{istgame}
\setistmathTF*100{textsc}[texttt]
\istroot(0){\alpha}+15mm..30mm+
  \istb{Left}[al] \istb{Right}[ar] \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\xtdistance{10mm}{10mm}
\istroot(3)(1-1)  \istb \istb \endist
\istroot(4)(1-2)  \istb \istb \endist
\istroot(5)(2-1)  \istb \istb \endist
\istroot(6)(2-2) 
  \istb \istb{Go}[r]{omega} \endist
\xtInfoset*(1)(2)
\xtInfosetOwner*(1)(2){beta}[a]
\setistmathTF*011<textbf>
\xtCInfoset*(1-1)(2-1){Ben}
\xtCInfoset*(1-2)(2-2){Cate}
\end{istgame}
\end{tcblisting}


\label{page:xtCInfoset*}
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
\begin{istgame}
\setistmathTF*011<texttt>
\istroot(0){Alice}+15mm..30mm+
  \istb \istb \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\xtdistance{10mm}{10mm}
\istroot(3)(1-1)  \istb \istb \endist
\istroot(4)(1-2)  \istb \istb \endist
\istroot(5)(2-1)  \istb \istb \endist
\istroot(6)(2-2)  \istb \istb \endist
\xtCInfosetO*(1)(0){imperfect recall}[left]
\xtCInfosetO*[dashed,blue,thick](1)(2)<.7>{Blue}
\xtCInfosetO(1-1)(2-1){Ben}
\xtCInfosetO(1-2)(2-2){Cate}
\end{istgame}
\end{tcblisting}


%\clearpage
\section{Fine-tuning positions of players, action labels, and payoffs (experimental)}

\subsection{Fine-tuning positions: owners}

If you are not satisfied the position of an owner (or a player), you can change it by using the \TikZ\ options such as \xw{xshift}, \xw{yshift}, or \xw{label distance} with the angle option of \cmd{\istroot}.

Examples are \xw{<[xshift=10pt]above>\{Child\}} and \xw{<[label distance=-5pt]45>\{Parent\}}, as shown in the following: 

\begin{tcblisting}{listing outside text, righthand width=.2\linewidth}
% Example: node owner
\begin{istgame}
\istroot(0)<[xshift=10pt]above>{Child}
  \istb  
  \istb  
  \endist
\istroot(1)(0-2)<[label distance=-5pt]45>{Parent}
  \istb  
  \istb  
  \endist
\end{istgame}
\end{tcblisting}

%\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
%\begin{istgame}[scale=1.2]
%\istcntm(cntm)[green]+8mm..24mm+
%\istroot(0)(cntm){I}+8mm..8mm+
%  \istb{x}[r]
%  \istbm
%  \endist
%\xtdistance{10mm}{18mm}
%\istroot(1)(0-1)<[label distance=-3pt]120>{II}
%  \istb{Y}[l]{x,1-x}
%  \istb{N}[r]{0,0}
%  \endist
%\end{istgame}
%\end{tcblisting}


\subsection{Fine-tuning positions: action labels}

\subsubsection{Abbreviations: \xw{[l]}, \xw{[r]}, \xw{[a]}, and \xw{[b]}}

As discussed in~\ref{ssec:istb} on page~\pageref{ssec:istb}, the macro \cmd{\istb} deals with the action labels.

In order to determine the direction of action labels for branches to put, you can use degrees, the compass directions, or the positional words and their abbreviations as mentioned above.
(Internally, the \isw{abbreviations} for payoffs and those for action labels work slightly differently in terms of \xw{xshift} and \xw{yshift}.)

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.2\linewidth}
% Example: action labels (default position)
\begin{istgame}[scale=1.2]
\xtShowEndPoints
\xtdistance{12mm}{16mm}
\istroot(0)[initial node]
  \istb<grow=0>{\fbox{$a$}}[a]   \istb<grow=90>{\fbox{$l$}}[l]
  \istb<grow=180>{\fbox{$b$}}[b] \istb<grow=-90>{\fbox{$r$}}[r]
  \endist
\end{istgame}
\end{tcblisting}
%\captionof{figure}{action labels by defaults with \xw{l}, \xw{r}, \xw{a}, and \xw{b}}

\xbigskip1
When you use these abbreviations you can manipulate the horizontal and/or the vertical shifts toward branches by using \icmd{\xtALPush}. (This is experimental!)

\xbigskip1

\begin{tcblisting}{listing only}
% syntax: 
  \xtALPush{<xshift dim> for l and r}{<yshift dim> for a and b}
% default:
  {0pt}{0pt}
\end{tcblisting}

\xbigskip1
For example, \verb|\xtALPush{-3pt}{5pt}| draws the labels left and right by \xw{3pt} to the branch and push those put above and below \xw{5pt} away from the branch, as shown in the following:

\begin{tcblisting}{listing outside text, righthand width=.2\linewidth}
% Example: \xtALPush
\begin{istgame}[scale=1.2]
\xtShowEndPoints
\xtALPush{-3pt}{5pt} % look here
\xtdistance{12mm}{16mm}
\istroot(0)[initial node]
  \istb<grow=0>{\fbox{$a$}}[a]   \istb<grow=90>{\fbox{$l$}}[l]
  \istb<grow=180>{\fbox{$b$}}[b] \istb<grow=-90>{\fbox{$r$}}[r]
  \endist
\end{istgame}
\end{tcblisting}
%\captionof{figure}{action labels shifted: comparison}


\subsubsection{Abbreviations: \xw{[al]}, \xw{[ar]}, \xw{[bl]}, and \xw{[br]}}
\label{sec:abb}

You can also use the \isw{abbreviations} \xw{al}, \xw{ar}, \xw{bl}, and \xw{br} to represent
\xw{above left}, \xw{above right}, \xw{below left}, and \xw{below right}, respectively,
to position action labels. Precise representation of abbreviations is as follows:
\begin{itemize}\tightlist
\item \xw{[al]} represents \verb|[above left,xshift=1pt,yshift=-2pt,black]|
\item \xw{[ar]} represents \verb|[above right,xshift=-1pt,yshift=-2pt,black]|
\item \xw{[bl]} represents \verb|[below left,xshift=1pt,yshift=2pt,black]|
\item \xw{[br]} represents \verb|[below right,xshift=-1pt,yshift=2pt,black]|
\end{itemize}

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
%\begin{tcblisting}{listing above text}
% Example: action labels with abbreviations
\begin{istgame}[scale=1.1]
\xtShowTerminalNodes[oval node,line width=.3pt]
\def\xbox#1{\fbox{$#1$}}  \def\ybox#1{#1}
\xtdistance{12mm}{16mm}
\istroot(0)[initial node]
  \istb<grow=0>{\ybox{a}}[a]
  \istb<grow=90>{\ybox{l}}[l]
  \istb<grow=180>{\ybox{b}}[b]  
  \istb<grow=-90>{\ybox{r}}[r]
  \endist
\begin{scope}[line width=1.2]
\xtdistance{10mm}{20mm}
\istroot[90](N)(0-2)
  \istbt[red]{\xbox{br}}[br]{1,1}  
  \istbt[blue,dashed]{\xbox{bl}}[bl]{2,2}
  \endist
\istroot[180](W)(0-3)
  \istbt[green]{\xbox{ar}}[ar]{0,3}  
  \istbt[red]{\xbox{br}}[br]{2,1}
  \endist
\istroot[-90](S)(0-4)
  \istbt[dotted]{\xbox{al}}[al]{1,-1}  
  \istbt[green]{\xbox{ar}}[ar]{-1,1}
  \endist
\istroot[0](E)(0-1)
  \istbt[blue,dashed]{\xbox{bl}}[bl]{1,3}  
  \istbt[dotted]{\xbox{al}}[al]{2,0}
  \endist
\foreach \x in {1,...,4} {\xtNode(0-\x)}
\end{scope}
\end{istgame}
\end{tcblisting}
\captionof{figure}{positioning action labels with the abbreviations}\label{fig:actlabel3}

In Figure~\ref{fig:actlabel3}, \fbox{$al$}'s are put in the same position from dotted branches,
and so are the other labels from their corresponding branches, like \fbox{$bl$}'s from the blue dashed branches.

\xbigskip1
You can also use \icmd{\xtALShift} to put and push labels horizontally and vertically. (This is experimental!)

\xbigskip1
\begin{tcblisting}{listing only}
% syntax: 
  \xtALShift{<horizontal shift dim>}{<vertical shift dim>}
% defaults: 
  {1pt}{2pt}
\end{tcblisting}

\xbigskip1
When the dimensions get bigger than the defaults (\xw{1pt} and \xw{2pt}) the labels get closer to the midpoints of the corresponding branches, and when the numbers get smaller the labels get farther from their branches.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: node owner
\begin{istgame}
\xtALShift{4pt}{3pt}
\istroot(0)<above>{Child} % default: <above>
  \istb{A}[al]  \istb{B}[ar]  \endist
\istroot(1)(0-2)<45>{Parent}
  \istb{L}[al]  \istb{R}[ar]  \endist
\end{istgame}
\end{tcblisting}


\subsection{Fine-tuning positions: payoffs}

You can change the position of payoffs with \TikZ\ options: \xw{xshift} and \xw{yshift}.
For example, you can do as shown in the following:
\label{page:finetuningpayoffs}

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: payoffs
\begin{istgame}
\istroot(0)
  \istb{Good}[l]{0,2}  \istb{Bad}  \endist
\istroot(1)(0-2)
  \istb{\alpha}[al]{(1,1)}[[xshift=-10pt]below]
  \istb{\beta}[ar]{-1,-1}[[yshift=-10pt]below]
  \endist
\end{istgame}
\end{tcblisting}


\section{Growing direction of trees}
\label{sec:growing}

You can draw a game tree that grows in any \isw{direction}.
By default, a game tree grows down and the \xw{child} branches are arranged and named counterclockwise with respect to their parent node.
When a tree grows down, the branches are arranged from left to right.
When a tree grows to the right, the branches are arranged and named from below to above.

\xbigskip1
Sometimes you may want a tree with the branches arranged clockwise with respect to their parent node because it seems to look more natural, especially when a tree grows north or east.
In \TikZ, \xw{grow'=<direction>} enables you to draw a tree developed clockwise.

To deal with the direction of the tree growth and the order of arranging branches, this package provides \icmd{\setistgrowdirection'} as well as  \icmd{\setistgrowdirection}.

\xbigskip1
\begin{tcblisting}{listing only}
% default: growing south counterclockwise
  \def\xtgrow{grow}
  \def\istdefault@grow{south} % tree growing direction

% \setistgrowdirection(')
  \NewDocumentCommand\setistgrowdirection{t'm}
  {\IfBooleanTF {#1}
    { \renewcommand\xtgrow{grow'}
      \renewcommand\istdefault@grow{#2}
    }
    { \renewcommand\xtgrow{grow}
      \renewcommand\istdefault@grow{#2}
    }
  }
\end{tcblisting}


\subsection{\protect\cmd{\setistgrowdirection} -- counterclockwise}

Our first example is a tree drawn using the default values: growing \xw{south} with branches going \ixsw{counterclockwise} with respect to their parent nodes (from left to right).

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example 1: \setistgrowdirection{south}
\begin{istgame}
\setistOvalNodeStyle{.6cm}
\xtShowEndPoints[oval node]
\istrooto(0){0}+{12.5mm}..{3.45cm}+
  \istb  \istb  \endist
\xtdistance{12.5mm}{11.5mm}
\istrooto(1)(0-1){1}
  \istb{}{3}[center]  \istb{}{4}[center]
  \istb{}{5}[center]  \endist
\istrooto(2)(0-2){2}
  \istb{}{6}[center]  \istb{}{7}[center]  \endist
\end{istgame}
\end{tcblisting}

By default or with \cmd{\setistgrowdirection\{south\}}, the numbers written in the child nodes increase counterclockwise with respect to their parent nodes.

\subsection{\protect\cmd{\setistgrowdirection'} -- clockwise}

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example 2: \setistgrowdirection'{south}
\begin{istgame}
\setistgrowdirection'{south}
% same codes as in Example 1
\setistOvalNodeStyle{.6cm}
\xtShowEndPoints[oval node]
\istrooto(0){0}+{12.5mm}..{3.45cm}+
  \istb  \istb  \endist
\xtdistance{12.5mm}{11.5mm}
\istrooto(1)(0-1){1}
  \istb{}{3}[center]  \istb{}{4}[center]
  \istb{}{5}[center]  \endist
\istrooto(2)(0-2){2}
  \istb{}{6}[center]  \istb{}{7}[center]  \endist
\end{istgame}
\end{tcblisting}

With \cmd{\setistgrowdirection'\{south\}}, the numbers written in the child nodes increase \ixsw{clockwise} with respect to their parent nodes, which does not look natural.

\subsection{Examples of rotating trees with \protect\cmd{\setistgrowdirection}}

This macro allows you to to rotate a game tree.

When you rotate a game tree to the north or to the east, it is a good idea to use the swap version \icmd{\setistgrowdirection'}.


\xbigskip1

\noindent\textbf{Tips:} \label{page:growtips}
Though it is not necessary, it is suggested to use the following combinations of the macros and the directions.

\xw{\setistgrowdirection\{south\}}: branches going counterclockwise (from left to right)\par
\xw{\setistgrowdirection\{west\}}: branches going counterclockwise (downward)\par
\xw{\setistgrowdirection'\{north\}}: branches going clockwise (from left to right)\par
\xw{\setistgrowdirection'\{east\}}: branches going clockwise (downward)

\xbigskip1
\remark When you use the swap version \cmd{\setistgrowdirection'}, using either \cmd{\istroot} or \cmd{\istroot'} gives you the same result.

\subsubsection{A tree growing east -- counterclockwise}

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example 3: \setistgrowdirection{east}
\begin{istgame}
\setistgrowdirection{east}
% same codes as in Example 1
\setistOvalNodeStyle{.6cm}
\xtShowEndPoints[oval node]
\istrooto(0){0}+{12.5mm}..{3.45cm}+
  \istb  \istb  \endist
\xtdistance{12.5mm}{11.5mm}
\istrooto(1)(0-1){1}
  \istb{}{3}[center]  \istb{}{4}[center]
  \istb{}{5}[center]  \endist
\istrooto(2)(0-2){2}
  \istb{}{6}[center]  \istb{}{7}[center]
  \endist
\end{istgame}
\end{tcblisting}

Numbers increase upward (or counterclockwise).

\subsubsection{A tree growing east -- clockwise}

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example 4: \setistgrowdirection'{east}
\begin{istgame}
\setistgrowdirection'{east}
% same codes as in Example 1
\setistOvalNodeStyle{.6cm}
\xtShowEndPoints[oval node]
\istrooto(0){0}+{12.5mm}..{3.45cm}+
  \istb  \istb  \endist
\xtdistance{12.5mm}{11.5mm}
\istrooto(1)(0-1){1}
  \istb{}{3}[center]  \istb{}{4}[center]
  \istb{}{5}[center]  \endist
\istrooto(2)(0-2){2}
  \istb{}{6}[center]  \istb{}{7}[center]
  \endist
\end{istgame}
\end{tcblisting}

Here, numbers increase downward (or clockwise).
This looks more natural.

\subsubsection{A tree growing north -- counterclockwise}

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example 5: \setistgrowdirection{north}
\begin{istgame}
\setistgrowdirection{north}
% same codes as in Example 1
\setistOvalNodeStyle{.6cm}
\xtShowEndPoints[oval node]
\istrooto(0){0}+{12.5mm}..{3.45cm}+
  \istb  \istb  \endist
\xtdistance{12.5mm}{11.5mm}
\istrooto(1)(0-1){1}
  \istb{}{3}[center]  \istb{}{4}[center]
  \istb{}{5}[center]  \endist
\istrooto(2)(0-2){2}
  \istb{}{6}[center]  \istb{}{7}[center]
  \endist
\end{istgame}
\end{tcblisting}

Numbers increase from right to left (or counterclockwise).

\subsubsection{A tree growing north -- clockwise}

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example 6: \setistgrowdirection'{north}
\begin{istgame}
\setistgrowdirection'{north}
\setistOvalNodeStyle{.6cm}
\xtShowEndPoints[oval node]
\xtdistance{12.5mm}{11.5mm}
\istrooto(0){0}+{12.5mm}..{3.45cm}+
  \istb  \istb  \endist
\xtdistance{12.5mm}{11.5mm}
\istrooto(1)(0-1){1}
  \istb{}{3}[center]  \istb{}{4}[center]
  \istb{}{5}[center]  \endist
\istrooto(2)(0-2){2}
  \istb{}{6}[center]  \istb{}{7}[center]
  \endist
\end{istgame}
\end{tcblisting}

Numbers increase from left to right (or clockwise).
This looks more natural.

\subsubsection{\protect\cmd{\setxtgrowkey} for one simple tree}

\icmd{\setxtgrowkey} can be used to change the key between \xw{grow} and \xw{grow'}, which is useful especially for one simple tree, not a whole tree.

\xbigskip1
\begin{tcblisting}{listing only}
% \setxtgrowkey: definition
\NewDocumentCommand\setxtgrowkey{m}
{
   \renewcommand\xtgrow{#1}
}
% #1 is either grow or grow'
\end{tcblisting}
\xbigskip1

The example below shows that the branches are arranged clockwise by \cmd{\setistgrowdirection'}.
So you will need to use \cmd{\setistgrow\{grow\}} to locally get back to \emph{counterclockwise}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: using \setistgrowdirection' (swap version)
\begin{istgame}[scale=.7,font=\scriptsize]
\setistgrowdirection'{east}
\istroot(0)              \istb{a}[al] \istb{b}[bl] \endist
\istroot[north](1)(0-1)  \istb{c}[bl] \istb{d}[br] \endist
{\setxtgrowkey{grow}
\istroot[south](2)(0-2)  \istb{e}[al] \istb{f}[ar] \endist
}
\istroot'(3)(2-2)        \istb{g}[al] \istb{h}[bl] \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

You can do the same thing by using \cmd{\setistgrowdirection} and \cmd{\istroot'}. See the following example, in which
you do not need to use \cmd{\setxtgrowkey}.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: using \istroot' (swap version)
\begin{istgame}[scale=.7,font=\scriptsize]
\setistgrowdirection{east}
\istroot'(0)             \istb{a}[al] \istb{b}[bl] \endist
\istroot'[north](1)(0-1) \istb{c}[bl] \istb{d}[br] \endist
\istroot[south](2)(0-2)  \istb{e}[al] \istb{f}[ar] \endist
\istroot'(3)(2-2)        \istb{g}[al] \istb{h}[bl] \endist
\end{istgame}
\end{tcblisting}


\section{Information sets}

\label{sec:infoset}

\subsection{\protect\cmd{\xtInfoset}: standard version}
\label{ssec:xtInfoset}

The macro \icmd{\xtInfoset} draws an \isw{information set}, connecting two decision nodes.

The starred version \icmd{\xtInfoset*} prints the owner of an information set in input mode and text font style as set by \cmd{\setistmathTF(*)} (see page~\pageref{page:xtInfoset*} for examples).

\begin{tcblisting}{listing only}
% \xtInfoset
% syntax: from left to right
  \xtInfoset[<info line type>](<from>)(<to>){<owner>}[<pos>,<node opt>]
% defaults:
  [-,infoset style](<m>)(<m>){}[above]
% option style for (all) information sets
  infoset style={semithick,densely dotted}
\end{tcblisting}

The two coordinates \xw{(<from>)} and \xw{(<to>)} are mandatory and all other arguments are optional.

\xbigskip1
\remark
This package provides macros to draw various types of information sets. They all include an option style \xw{[}\ixw{infoset style}\xw{]}, which is equivalent to \xw{[semithick,densely dotted]}. You can change the style or add more options to it by using the macro \cmd{\setxtinfosetstyle}. For more details, see Section~\ref{ssec:setxtinfosetstyle} on page~\pageref{ssec:setxtinfosetstyle}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \xtInfoset
\begin{istgame}
\istroot(0){1}+15mm..30mm+
  \istb{a} \istb{b}   \endist
\istroot(1)(0-1)
  \istb{c} \istb{d}   \endist
\istroot(2)(0-2)
  \istb{c'} \istb{d'} \endist
\xtInfoset(1)(2){2}
\end{istgame}
\end{tcblisting}

When you specify the owner of an information set, it appears (by default) above the midpoint of the two nodes. To change the location of the information set owner, you can use the abbreviations of directional words like \xw{a}, \xw{l}, \xw{ar}, or \xw{bl}. However, when you use other options with the position you cannot use the abbreviations. If you want an owner in red on the left, you can do it like \xw{[left,red]} as shown below.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}
\setistgrowdirection'{east}
\setxtinfosetstyle{dashed} % changes line style
\istroot(0){1}+15mm..30mm+
  \istb{a}  \istb{b}  \endist
\istroot(1)(0-1)
  \istb{c}  \istb{d}  \endist
\istroot(2)(0-2)
  \istb{c'} \istb{d'} \endist
\xtInfoset(1)(2){2}[left,red]
\end{istgame}
\end{tcblisting}

\xbigskip1
For a curved information set, you can do, for example, like \cmd{\xtInfoset[bend left](1)(2)}.
However this depends on the direction of tree growing or swapping the arrangement of branches.
So, in order to draw a curved information set, it is recommended for you to use the curved version \cmd{\xtCInfoset}, documented in Section~\ref{ssec:xtCInfoset} on page~\pageref{ssec:xtCInfoset}.

\subsection{\protect\cmd{\xtInfosetO}: oval version}

\subsubsection{\protect\cmd{\xtInfosetO}: basics}
\label{ssec:xtInfosetO}

The oval version \icmd{\xtInfosetO} prints a bubble type (by default, a \xw{rounded rectangle}) \isw{information set} connecting two nodes, on the background layer by default.
However, when you specify two identical nodes, it prints a densely dotted \xw{circle} (by default) at the node to express a \emph{\isw{singleton information set}}.

Its starred version \icmd{\xtInfosetO*} prints the owner of an information set in input mode and text font style as set by \cmd{\setistmathTF(*)} (see page~\pageref{page:xtInfoset*} for examples).

%\xbigskip1
\begin{tcblisting}{listing only}
% \xtInfosetO (from left to right)
% syntax:
  \xtInfosetO[<bubble opt>](<from>)(<to>){<owner>}[<pos>,<owner opt>](min. height)
% defaults: connecting two nodes: \xtInfoset(coor1)(coor2)
  [ rectangle,rounded corners=.5*<minimum height>*<\xtscale>,
    minimum width=\n1+<minimum height>,minimum height=1em,inner sep=0pt,
    infoset style ]
  (<m>)(<m>){}[](1em)
% option style for (all) information sets
  infoset style={semithick,densely dotted}
\end{tcblisting}
\xbigskip1

Here is an example that shows a bubble type information set as a rounded rectangle and a singleton information set as a circle.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \xtInfsetO
\begin{istgame}
\istroot(0){1}+15mm..30mm+
  \istb{a} \istb{b} \endist
\istroot(1)(0-1)  \istb{c}  \istb{d}  \endist
\istroot(2)(0-2)  \istb{c'} \istb{d'} \endist
\xtInfosetO(0)(0)
\xtInfosetO(1)(2){2}
\end{istgame}
\end{tcblisting}
\xbigskip1

The the height (or thickness) of an information set does not depend on \xw{scale}, \xw{xscale}, nor \xw{yscale}.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \xtInfosetO with x-y-scale
\begin{istgame}[xscale=1.2,yscale=.7]
\istroot(0){1}+15mm..30mm+
  \istb{a} \istb{b} \endist
\istroot(1)(0-1)  \istb{c}  \istb{d}  \endist
\istroot(2)(0-2)  \istb{c'} \istb{d'} \endist
\xtInfosetO(0)(0)
\xtInfosetO(1)(2){2}
\end{istgame}
\end{tcblisting}
\xbigskip1

The size of an information set adjusts accordingly to the scale values.

\xbigskip1
\remark 

\begin{itemize}\firmlist
\item The (minimum) height of a bubble type information set is \xw{1em} by default. This can be changed by the last optional argument of \cmd{\xtInfosetO}, like \verb+\xtInfosetO(1)(2)(2em)+.
\item The width of a bubble information set is \xw{\n1+<minimum height>} by default, 
where \xw{\n1} is the Euclidean distance (measured by \TikZ) between two nodes in an information set.
\end{itemize}


%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \xtInfosetO: changing shape or color
\begin{istgame}
\setistgrowdirection'{east}
\istroot(0){1}+15mm..30mm+
  \istb{a} \istb{b} \endist
\istroot(1)(0-1)  \istb{c}  \istb{d}  \endist
\istroot(2)(0-2)  \istb{c'} \istb{d'} \endist
\xtInfosetO[fill=blue!20,minimum width=\n1+3em]
           (1)(2){2}(2em)
\xtInfosetO(0)(0)(3em)
\end{istgame}
\end{tcblisting}
\xbigskip1

The shape of an information set does not depend on the direction of tree growing, either.
You can change the shape to, for example, an ellipse by specifying it in the first bracket option list.
You can also change the color of the bubble representing an information set by specifying it in the option list.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: south east and yscale
\begin{istgame}[yscale=1.5]
\setistgrowdirection'{south east}
\istroot(0)    \istb \istb* \endist
\istroot(1)(0-1){2}  \istb* \istb* \endist
\setxtinfosetstyle{fill=red!20,ellipse}
\xtInfosetO(0)(0-2){1}
\setxtinfosetstyle{solid,fill=blue!40,opacity=.5}
\xtInfosetO(1-1)(1-2){3}
\setxtinfosetstyle % restore defaults
\xtInfosetO(1)(1)
\end{istgame}
\end{tcblisting}

Note that, in the above example, \cmd{\setxtinfosetstyle} is used to change the style of information sets.
In order to restore the option value to default (i.e., \xw{semithick,densely dotted}) just declare \cmd{\setxtinfosetstyle}. (See Section~\ref{ssec:setxtinfosetstyle} on page~\pageref{ssec:setxtinfosetstyle}.

%\clearpage
\subsubsection{Sloped information sets}

With the \pkg{istgame} package, a \isw{sloped information set} is not special. Just connect any two nodes using \cmd{\xtInfoset} or \cmd{\xtInfosetO}.


\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: sloped infoset
\begin{istgame}
\istroot(0){Alice}+15mm..30mm+
  \istb{A} \istb{B} \endist
\istroot(1)(0-1)<135>{Ben}  \istb{C} \istb{D} \endist
\istroot(2)(0-2)   \istb{a} \istb{b} \endist
\istroot(3)(1-2)   \istb{a} \istb{b} \endist
\xtInfosetO(0)(0)(2em)
\xtInfosetO[rectangle](1)(1)
\xtInfosetO(3)(2){Cate}
\end{istgame}
\end{tcblisting}

\xbigskip1
If you want to have an owner sloped too, you need the option \xw{[sloped]}, as shown below.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: sloped infoset with sloped text
\begin{istgame}
\setistgrowdirection'{east}
\istroot(0){Alice}+15mm..30mm+  \istb{A} \istb{B} \endist
\istroot(1)(0-1)<135>{Ben}  \istb{C} \istb{D} \endist
\istroot(2)(0-2)   \istb{a} \istb{b} \endist
\istroot(3)(1-2)   \istb{a} \istb{b} \endist
\setistmathTF*011<textbf>
\xtInfosetO(0)(0)
\xtInfosetO[rectangle,rounded corners=.2em](1)(1)
\xtInfosetO*[ellipse,fill=blue!60]
           (3)(2){Cate}[sloped,white](1.5em)
\end{istgame}
\end{tcblisting}

\xbigskip1
\warning
Issues in \emph{sloped labels} in \TikZ\ with \emph{asymmetric scales}:
\begin{itemize}\tightlist
\item The \xw{tree} library in \TikZ\ does not seem to treat sloped labels properly, when \xw{xscale} or \xw{yscale} is used asymmetrically.
\item To cure this problem you can use \cmd{\xtcureslopedlabelsNS} for trees growing northwards and southwards and \cmd{\xtcureslopedlabelsWS} for trees growing eastwards and westwards.
(See Section~\ref{ssec:slopedlabels} and page~\pageref{page:slopedlabels-warning}, for more details with examples.)
\item Note, however, that sloped labels for information owners printed by \cmd{\xtInfosetO} do not depend on scaling.
\end{itemize}

\subsubsection{\protect\cmd{\setxtinfosetstyle}}
\label{ssec:setxtinfosetstyle}

With the macro \icmd{\setxtinfosetstyle} you can change the style of all information sets, at once.
For this end, a simple new style \xw{infoset style} is defined as follows:
%\xbigskip1
\begin{tcblisting}{listing only}
% \setxtinfosetstyle
\NewDocumentCommand \setxtinfosetstyle { m }
{ \tikzset { infoset style/.style = { semithick , densely dotted , #1 } } }
\end{tcblisting}
\xbigskip1

You can change the line style of an information set or add more options to the option list, for example, like \cmd{\setxtinfosetstyle\{thin,dashed\}}, or, like \cmd{\setxtinfosetstyle\{blue\}}.

If you want get the option values back to the default values, then just declare \cmd{\setxtinfosetstyle}.

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
% Example: \setxtinfosetstyle
\begin{istgame}
\istroot(0){Alice}+15mm..30mm+
  \istb \istb \endist
\istroot(1)(0-1)  \istbA(1.3) \istb \endist
\istroot(2)(0-2)  \istbA(1.3) \istb \endist
\xtdistance{10mm}{8mm}
\istroot(3)(1-1)  \istb \istb \endist
\istroot(4)(1-2)  \istb \istb \endist
\istroot(5)(2-1)  \istb \istb \endist
\istroot(6)(2-2)  \istb \istb \endist
\setxtinfosetstyle{dashed,blue,thick}
\xtInfoset(1)(2){Blue}
\xtInfoset(1-1)(2-1)
\xtInfosetO(1-2)(2-2)
\setxtinfosetstyle % restore defaults
\xtInfosetO(0)(0)
\end{istgame}
\end{tcblisting}

\xbigskip1
With \cmd{\setxtinfosetstyle}, you can also change the background color of information sets.
\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
% Example: \setxtinfosetstyle
\begin{istgame}
\istroot(0){Alice}+15mm..30mm+
  \istb \istb \endist
\istroot(1)(0-1)  \istbA(1.3) \istb \endist
\istroot(2)(0-2)  \istbA(1.3) \istb \endist
\xtdistance{10mm}{8mm}
\istroot(3)(1-1)  \istb \istb \endist
\istroot(4)(1-2)  \istb \istb \endist
\istroot(5)(2-1)  \istb \istb \endist
\istroot(6)(2-2)  \istb \istb \endist
\setxtinfosetstyle{dashed,blue,thick,fill=blue!20}
\xtInfosetO(1)(2){Blue}
\xtInfosetO(1-1)(2-1)
\xtInfoset(1-2)(2-2)
\setxtinfosetstyle % restore defaults
\xtInfosetO(0)(0)
\end{istgame}
\end{tcblisting}


\subsubsection{\protect\cmd{\setxtinfosetlayer}}
\label{sec:setxtinfosetlayer}

You can use the macro \icmd{\setxtinfosetlayer} to change the \isw{layer} on which an information set lies from \xw{background} (by default) to \xw{behind}, \xw{main}, \xw{above}, or \xw{foreground}, in that order.
To go back to the default layer, just declare \cmd{\setxtinfosetlayer} or \cmd{\setxtinfosetlayer\{\}}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \setxtinfosetlayer
\begin{istgame}
\setistgrowdirection'{east}
\istroot(0){1}+15mm..30mm+  \istb{a}  \istb{b} \endist
\istroot(1)(0-1)  \istb{c}  \istb{d}  \endist
\istroot(2)(0-2)  \istb{c'} \istb{d'} \endist
\setxtinfosetlayer{behind}
\xtInfosetO[fill=red,ellipse,opacity=.2](0)(1)(1.5em)
\setxtinfosetlayer
\xtInfosetO[fill=blue!20](0-1)(0-2){2}(2em)
\end{istgame}
\end{tcblisting}


%\clearpage
\subsection{\protect\cmd{\xtCInfoset}: curved version}
\label{ssec:xtCInfoset}

With the macro \icmd{\xtCInfoset} you can draw, by default, a \emph{curved} information set and even a \emph{skewed curved} information set, on the \emph{background layer} by default. \index{curved information set}

Its starred version \icmd{\xtCInfoset*} prints the owner of an information set with the input mode and text font style as set by \cmd{\setistmathTF(*)} (see page~\pageref{page:xtCInfoset*} for examples).

\subsubsection{Curved information sets with \protect\cmd{\xtCInfoset}: basics}

The macro \icmd{\xtCInfoset} connects two nodes with a curved \isw{information set} like an arch that looks like a left-bent curve (by default) from start point to end point.
The basic usage of \cmd{\xtCInfoset} is the same as of \cmd{\xtInfoset}.

\xsmallskip1
\begin{tcblisting}{listing only}
% \xtCInfoset : basics
% syntax:
  \xtCInfoset[<bubble opt>](<from>)(<to>){<owner>}[<pos>,<owner opt>](min. height)
% defaults: connecting two nodes: \xtInfoset(coor1)(coor2)
  [ rectangle,rounded corners=.5*<minimum height>*<\xtscale>,
    minimum width=\n1+<minimum height>,minimum height=1em,inner sep=0pt,
    infoset style ] %  infoset style = { semithick , densely dotted }
  (<m>)(<m>){}[](1em)
\end{tcblisting}

Here is an example of drawing curved information sets.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% Example: \xtCInfoset
\begin{istgame}
\istroot(0){Alice}+15mm..30mm+
  \istb \istb \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\xtdistance{10mm}{10mm}
\istroot(3)(1-1)  \istb \istb \endist
\istroot(4)(1-2)  \istb \istb \endist
\istroot(5)(2-1)  \istb \istb \endist
\istroot(6)(2-2)  \istb \istb \endist
\xtCInfoset(1)(0){imperfect recall}[left]
\xtCInfoset[dashed,blue,thick](1)(2){Blue}
\xtCInfoset(1-1)(2-1){Ben}
\xtCInfoset(1-2)(2-2){Cate}
\end{istgame}
\end{tcblisting}


%\clearpage
\subsubsection{Skewed \protect\cmd{\xtCInfoset}: full function}

Besides the basic functions, \cmd{\xtCInfoset} has two additional optional arguments to control the shape of a curved information set.
With the macro \cmd{\xtCInfoset}, you can control the shape of an information set curve by using \ixw{plot factor} like \xw{<1.3>} or \xw{<0.7>} (by default \xw{<1.3>}) and \ixw{midpoint factor} like \xw{!.4!} or \xw{!.6!} (by default \xw{!.5!}).

\xsmallskip1
\begin{tcblisting}{listing only}
% \xtCInfoset : full defninition
% syntax:
  \xtCInfoset[<bubble opt>](<from>)!midpoint factor!(<to>)
             <plot factor>{<owner>}[<pos>,<owner opt>](min. height)
% defaults: connecting two nodes: \xtInfoset(coor1)(coor2)
  [ rectangle,rounded corners=.5*<minimum height>*<\xtscale>,
    minimum width=\n1+<minimum height>,minimum height=1em,inner sep=0pt,
    infoset stlye ]   % infoset style = {semithick , densely dotted}
  (<m>)(<m>){}[](1em)
\end{tcblisting}

\label{page:plotfactor}
By \ixw{plot factor}, we mean that it determines the maximum or minimum value of a curve.
If the \xw{plot factor} is greater than \xw{1} it prints a \emph{concave} curve, equal to \xw{1} a \emph{straight} line, and less than \xw{1} a \emph{convex} curve, connecting form left to right.
For example, \cmd{\xtCInfoset(1)(2)<.7>} (left to right) and \cmd{\xtCInfoset(2)(1)<1.3>} (right to left) will give the same result.

%\xbigskip1
% Example: sloped infoset
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
\begin{istgame}[scale=1.5,font=\scriptsize]
\istroot(0){Alice}+15mm..30mm+
  \istb \istb \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\setistmathTF*011<texttt>
\xtCInfoset*[dashed,blue](1)(2)<1.5>{1.5}
\xtCInfoset*[dashed,blue](1)(2)<1.3>{1.3}
\xtCInfoset*[dashed,blue](1)(2)<1>{1}
\setxtinfosetlayer{above}
\xtCInfoset*[dashed,blue](1)(2)<.7>{.7}
\setxtinfosetlayer{background}
\xtCInfoset*[solid,green,thick](2)(1)<1.3>
\xtCInfoset*[dashed,blue](1)(2)<.5>{.5}
\end{istgame}
\end{tcblisting}
\xbigskip1


By \ixw{midpoint factor}, we mean that, roughly speaking, it determines the maximum or minimum point of a curve. If the \xw{midpoint factor} is less than \xw{.5} the curve is positively skewed, and greater than \xw{.5} negatively skewed.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
\begin{istgame}[font=\scriptsize]
\istroot(0){Alice}+15mm..30mm+
                  \istb \istb \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\xtdistance{10mm}{10mm}
\istroot(3)(1-1)  \istb \istb \endist
\istroot(4)(1-2)  \istb \istb \endist
\istroot(5)(2-1)  \istb \istb \endist
\istroot(6)(2-2)  \istb \istb \endist
\xtCInfoset(0)(1)<.7>{imperfect recall}[left]
\xtCInfoset(1-1)!-.05!(2-1)<1.6>{Ben}
\xtCInfoset(1-2)!.9!(2-2)<1.4>{Cate}
\end{istgame}
\end{tcblisting}
\xbigskip1

A curved information set drawn by \cmd{\xtCInfoset} does not depend on the tree growing direction.
It does not depend on scaling nor swapping branches, either.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
\begin{istgame}[scale=.9,font=\scriptsize]
\setistgrowdirection'{east}
\istroot(0){Alice}+15mm..30mm+
                  \istb \istb \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\xtdistance{10mm}{10mm}
\istroot(3)(1-1)  \istb \istb \endist
\istroot(4)(1-2)  \istb \istb \endist
\istroot(5)(2-1)  \istb \istb \endist
\istroot(6)(2-2)  \istb \istb \endist
\xtCInfoset(0)(1)<.7>{imperfect recall}[left]
\xtCInfoset(1-1)!-.05!(2-1)<1.6>{Ben}
\xtCInfoset(1-2)!.9!(2-2)<1.4>{Cate}
\end{istgame}
\end{tcblisting}


\subsection{\protect\cmd{\xtCInfosetO}: curved oval version}
\label{ssec:xtCInfosetO}

The macro \icmd{\xtCInfosetO} enables you to draw a \emph{curved bubble type} \isw{information set} and even a \emph{skewed curved bubble type} information set on the \emph{background layer} by default.

Its starred version \icmd{\xtCInfosetO*} prints the owner of an information set in input mode and text font style in accordance with \cmd{\setistmathTF(*)} (see page~\pageref{page:xtCInfoset*} for examples).

\subsubsection{Curved bubble type information sets with \protect\cmd{\xtCInfosetO}: basics}

The basic usage of \cmd{\xtCInfosetO} is the same as of \cmd{\xtInfosetO}.
If the two mandatory coordinates are identical, a \emph{circle} is drawn to represent a \emph{\isw{singleton information set}}, like the case of \cmd{\xtInfosetO}.

\begin{tcblisting}{listing only}
% \xtCInfosetO : basics
% syntax:
  \xtCInfosetO[<bubble opt>](<from>)(<to>){<owner>}[<pos>,<owner opt>](min. height)
% defaults: connecting two nodes: \xtInfoset(coor1)(coor2)
  [ rectangle,rounded corners=.5*<minimum height>*<\xtscale>,
    minimum width=\n1+<minimum height>,minimum height=1em,inner sep=0pt,
    infoset stlye ]   % infoset style = { semithick , densely dotted }
  (<m>)(<m>){}[](1em)
\end{tcblisting}


\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
\begin{istgame}
\setistmathTF*011<texttt>
\istroot(0){Alice}+15mm..30mm+
                  \istb \istb \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\xtdistance{10mm}{10mm}
\istroot(3)(1-1)  \istb \istb \endist
\istroot(4)(1-2)  \istb \istb \endist
\istroot(5)(2-1)  \istb \istb \endist
\istroot(6)(2-2)  \istb \istb \endist
\xtCInfosetO*(1)(0){imperfect recall}[left]
\xtCInfosetO(1-1)(2-1){Ben}
\xtCInfosetO(1-2)(2-2){Cate}
\end{istgame}
\end{tcblisting}

\xbigskip1
The shape of information sets does not depend on the direction of tree growing.
You also can change the background color and the height, like \xw{(1.5em)} as the last option.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
\begin{istgame}[font=\scriptsize]
\setistgrowdirection'{east}
\istroot(0){Alice}+15mm..30mm+
                  \istb \istb \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\xtdistance{10mm}{10mm}
\istroot(3)(1-1)  \istb \istb \endist
\istroot(4)(1-2)  \istb \istb \endist
\istroot(5)(2-1)  \istb \istb \endist
\istroot(6)(2-2)  \istb \istb \endist
\xtCInfosetO[fill=blue!20]
   (1)(0){imperfect recall}[left](.7em)
\xtCInfosetO[fill=blue!20]
   (1-1)(2-1){Ben}
\xtCInfosetO[fill=red!40,opacity=.5]
   (1-2)(2-2)<1.3>{Cate}(1.5em)
\end{istgame}
\end{tcblisting}


\subsubsection{Skewed \protect\cmd{\xtCInfosetO}: full function}

Besides the basic functions, the macro \icmd{\xtCInfosetO} has two additional optional arguments to control the shape of a bubble representing a curved information set.
The two optional arguments are \ixw{plot factor} and \ixw{midpoint factor}. (The meanings are documented on page~\pageref{page:plotfactor}.)

The \xw{plot factor} makes a curved information set higher or lower and is used in angle brackets, like \xw{<1.5>} or \xw{<.7>} (by default \xw{<1.3>}), right after the two mandatory coordinates. The \xw{midpoint factor} controls skewness of a curved information set and is used in between the two mandatory arguments, like \xw{!.35!} (by defaut \xw{!.5!}). 

\begin{tcblisting}{listing only}
% \xtCInfosetO : full definition
% syntax:
  \xtCInfosetO[<bubble opt>](<from>)!<midpoint factor>!(<to>)
              <plot factor>{<owner>}[<pos>,<owner opt>](min. height)
% defaults: connecting two nodes: \xtInfoset(coor1)(coor2)
  [ rectangle,rounded corners=.5*<minimum height>*<\xtscale>,
    minimum width=\n1+<minimum height>,minimum height=1em,
    semithick,densely dotted,inner sep=0pt ]
  (<m>)(<m>){}[](1em)
\end{tcblisting}


\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% Example: \xtCInfosetO: skewed
\begin{istgame}[font=\scriptsize]
\istroot(0){Alice}+15mm..30mm+
                  \istb \istb \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\xtdistance{10mm}{10mm}
\istroot(3)(1-1)  \istb \istb \endist
\istroot(4)(1-2)  \istb \istb \endist
\istroot(5)(2-1)  \istb \istb \endist
\istroot(6)(2-2)  \istb \istb \endist
\xtCInfosetO[fill=blue!20]
   (1)(0){imperfect recall}[left]
\xtCInfosetO[dashed,blue](1)(2)<.7>{Blue}
\xtCInfosetO(1-1)!.35!(2-1){Ben}
\xtCInfosetO[fill=red!40,opacity=.5]
   (1-2)!.65!(2-2)<1.5>{Cate}
\end{istgame}
\end{tcblisting}


\xbigskip1
\remark

\begin{itemize}
\item When using \cmd{\xtCInfosetO}, the \emph{recommended range} of the \ixw{midpoint factor} is between \xw{.4} and \xw{.6}, at most between \xw{.35} and \xw{.65}, otherwise you might get a result with which you are not satisfied. (You can see below Section~\ref{ssec:extrememidpointfactor} on this issue, only when you are interested in.)
\item You do not need to bother if the tree is swapped, because the package internally takes care of that instead.
\item An information set drawn by \cmd{\xtCInfosetO} is appropriately adjusted with \xw{scale}, \xw{xscale}, or \xw{yscale}, but the height (or thickness) is independent of the scale values. (You can see below Section~\ref{ssec:scaleissue} on the issue of scaling, only when you are interested in.)
\end{itemize}


\subsection{Fine-tuning \protect\cmd{\xtCInfosetO}: Not for most users}

\subsubsection{\protect\cmd{\xtCInfosetOTurnX}: too high or too low \xw{midpoint factor}}
\label{ssec:extrememidpointfactor}

What if you really want to use the \xw{midpoint factor} close to \xw{0} or \xw{1}?
In this case, you will possibly get some unsatisfactory result as shown in the example below.
(Note that this being unsatisfied might not happen if you use the \xw{midpoint factor} within the recommended range.)

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% Example: \xtCInfoset (to be cured)
\begin{istgame}[yscale=1.5,font=\scriptsize]
\xtdistance{10mm}{10mm}
\istroot(0){Alice}+15mm..15mm+
      \istb \istb \istb \istb \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\istroot(3)(0-3)  \istb \istb \endist
\istroot(4)(0-4)  \istb \istb \endist
\xtCInfosetO[fill=blue!20]
   (1)!.2!(3)<1.4>{Ben}
\xtCInfosetO[fill=red!40,opacity=.5]
   (2)!.8!(4)<1.5>{Cate}
\tikzset{tmp/.style={draw,circle,opacity=.5,
                     minimum size=1em}}
\node at (1) [tmp,blue] {};
\node at (4) [tmp,red] {};
\end{istgame}
\end{tcblisting}

\xbigskip1
The package provides the macro \icmd{\xtCInfosetOTurnX} to make it straight.

\begin{tcblisting}{listing only}
% \xtCInfosetOTurnX
% syntax: X angle is mandatory
  \xtCInfosetOTurnX {turn X angle}{turn Y angle}
\end{tcblisting}

First, find the blue circle and the red circle in the above example.
Let us call by \xw{X} the (blue) circle at the beginning of an information set and by \xw{Y} at the end.
With \cmd{\xtCInfosetOTurnX} you can turn these circles to get a better result.

\xbigskip1
In the following example, \cmd{\xtCInfosetOTurnX\{45\}\{0\}} and \cmd{\xtCInfosetOTurnX\{0\}\{-45\}} are used to correct the result. If you omit the second angle like, for example, \cmd{\xtCInfosetOTurnX\{45\}}, it is equivalent to \cmd{\xtCInfosetOTurnX\{45\}\{-45\}}, meaning that it turns the both circles symmetrically.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
\begin{istgame}[yscale=1.5,font=\scriptsize]
\xtdistance{10mm}{10mm}
\istroot(0){Alice}+15mm..15mm+
      \istb \istb \istb \istb \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\istroot(3)(0-3)  \istb \istb \endist
\istroot(4)(0-4)  \istb \istb \endist
\setxtinfosetlayer{behind}
\xtCInfosetOTurnX{40}{0}
\xtCInfosetO[fill=blue!20]
   (1)!.3!(3)<1.4>{Ben}[left]
\setxtinfosetlayer{background}
\xtCInfosetOTurnX{0}{-45}
\xtCInfosetO[fill=red!40]
   (2)!.7!(4)<1.5>{Cate}
\end{istgame}
\end{tcblisting}

\xbigskip1
\remark
\begin{itemize}\tightlist
\item
\cmd{\xtCInfosetOTurnX} works just once only for the following \cmd{\xtCInfosetO}, without affecting any other.
\item
You can also change the layer of an information set, as shown in the previous example, by using \icmd{\setxtinfosetlayer} (see Secion~\ref{sec:setxtinfosetlayer}).
\end{itemize}


\subsubsection{Scaling information sets according to the value of \TikZ\ \xw{scale}}
\label{ssec:scaleissue}

The height (or thickness) of bubble type information sets drawn by \cmd{\xtInfosetO} and \cmd{\xtCInfosetO},
does not depend on the values of \TikZ\ scales.
What if you want to make them scaled according the value of \TikZ\ symmetric scale, for example, \xw{[scale=.5]}?
Then use, instead, \xw{[scale=.5,xscale=1]} or equivalently \xw{[yscale=1,scale=.5]} in any order of the options.

\xbigskip1
Here is an ordinary example of using \xw{[scale=.5]}.
%, where the heights (or thickness) of bubble type information sets are not affected by the value of \TikZ\ scale.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
\begin{istgame}[scale=.5]
\xtdistance{40mm}{30mm}
\istroot(0)+40mm..40mm+
            \istb \istb \istb \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\istroot(3)(0-3)  \istb \istb \endist
\xtCInfosetO(0)(0)(2em)
\xtInfosetO[fill=green](1)(2)[green]
\xtCInfosetO(1)(3){player}(1.5em)
\end{istgame}
\end{tcblisting}

Here is an example to use \xw{[scale=.5,xscale=1]}, where the height (or thickness) of information sets is scaled according to the value of \TikZ\ scale.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
\begin{istgame}[scale=.5,xscale=1]
\xtdistance{40mm}{30mm}
\istroot(0)+40mm..40mm+
            \istb \istb \istb \endist
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\istroot(3)(0-3)  \istb \istb \endist
\xtInfosetO(0)(0)(2em)
\xtInfosetO[fill=green](1)(2)
\xtCInfosetO(1)(3){player}(1.5em)
\end{istgame}
\end{tcblisting}


\xbigskip1
\remark (\textbf{Not for most users})
How the \env{istgame} environment works with the \Tikz\ scales, regarding oval type information sets.
\begin{itemize}\tightlist
\item 
In the \ipkg{istgame} package, it is intended that the height (or thickness) of any bubble type information set
is not affected by the values of \TikZ\ scale, unless users change it. (This is a desirable feature.)
\item 
The shapes of bubble type information sets work perfectly fine, as intended, when:
  \begin{itemize}
  \item \ixw{scale} only (not with \ixw{xscale} nor \ixw{yscale}) is used in the environment option list
  \item and either \xw{xscale} or \xw{yscale} or both (not with \xw{scale}) are used in the option list.
  \end{itemize}
\item
Now, this is how the \env{istgame} environment works when \xw{scale} is used with \xw{xscale} or \xw{yscale}.
  \begin{itemize}
  \item When this is the case, the value of \xw{scale} is not taken care of by the package. 
  Only the values of \xw{xscale} and \xw{yscale} are internally extracted and used to compensate the distortion of the shapes of information sets caused by the \emph{\isw{asymmetric scaling}}.
  \item For example, \xw{[scale=.5]} and \xw{[scale=.5,xscale=1]} are treated as different (with respect to bubble type information sets) by the \env{istgame} environment, while the \env{tikzpicture} environment treats them as equal. With the latter, the \env{istgame} environment does not extract the value of \xw{scale} to use it internally, but does only the value of \xw{xscale}. So \xw{scale} can affect the sizes of bubble type information sets.
  \item Still, the shapes of bubble type information sets drawn by this package are not distorted by the mixed (even asymmetrical) use of \TikZ\ scales. (In the case of asymmetric scaling, there is one exception for \cmd{\cntmAInfosetO}, which is equipped with an option to cure the distortion. See Section~\ref{sec:cntmAInfosetO} on page~\pageref{sec:cntmAInfosetO} for more details.)
  \end{itemize}
%\item
%You can also try using \icmd{\pgftransformscale} like \verb+\pgftransfromscale{1/\xtscale}+.
\end{itemize}

\section{Continuum of branches}

\label{sec:cntm}

The package \pkg{istgame} provides the macro \cmd{\istrootcntm} and its several variants (all prefixed by \cmd{\istroot} or \cmd{\istrooto}) to express a \isw{continuum} of branches and an action taken.
As you will see, all the supplemental macros to a continuum of branches are prefixed by \cmd{\cntm}.

Two types of graphic objects, a triangle type and an arc type, are provided in the package to represent a continuum of branches.
So you can start by choosing one type of a continuum of branches.

\subsection{\protect\cmd{\istrootcntm}:  standard continuum version}
\label{ssec:istrootcntm}

\subsubsection{\protect\cmd{\istrootcntm}: basics}

The standard version \icmd{\istrootcntm} prints a background triangle, in \xw{black!25} by default, representing a continuum of branches, on the \emph{background layer} by default. It works just like \cmd{\istroot}, for one exception: it controls, by the last two options \verb|+<cntmlevdist>..<cntmsibdist>+|, the distances for only the background triangle, but not the \cmd{\istb}'s following it.
You can regard \cmd{\istrootcntm} as the sum \cmd{\istroot} \xw{+} \xw{cntm}.

%\xbigskip1
\begin{tcblisting}{listing only,breakable}
% \istrootcntm
% syntax: 
  \istrootcntm[<grow keyval>,<opt>](<coor1>)(<coor2>)[<node style>,<opt>]%
               <owner label angle>{<owner>}+<cntm-levdist>..<cntm-sibdist>+
% defaults: 
  [south](<m>)(0,0)[decision node]<above>{}+8mm..24mm+
% arguments: (coor1) is mandatory, all others are optional arguments
  [grow] % the direction of growing <default: south>
  (coor1) % name of the (sub)root: mandatory
  (coor2) % the (sub)root is at (coor2) <default: (0,0)>
  [node style] % node style <default: decision node> 
  <angle> % position of owner name <default: above> 
  {owner} % name of the owner of the (sub)root
  +cntmlevdist..cntmsibdist+ % <defaults: 8mm,24mm>
\end{tcblisting}
%\xbigskip1

The background is a isosceles triangle, with the height of \icmd{\cntmlevdist} (\xw{8mm} by default) and the base length of \icmd{\cntmsibdist} (\xw{24mm} by default).

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \istrootcntm
\begin{istgame}[scale=1.2]
\cntmlevdist{10mm}
\istrootcntm(0){I}
  \istb{x}[r]  \istbm  \endist
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)<[label distance=-3pt]120>{II}
  \istb{Y}[al]{x,1-x}  \istb{N}[ar]{0,0}  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

The action taken by the owner of the root has the sibling distance (to a missing branch represented by \cmd{\istbm}, if exists) of one third (by default) of the base length of the continuum triangle. 

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: action sibling distance
\begin{istgame}[scale=1.2]
\xtdistance{10mm}{20mm}
\istrootcntm(0){I}+10mm..20mm+
  \istb{x}[r]  \istb*[dashed,white]  \endist
\istroot(1)(0-1)<[label distance=-3pt]120>{II}
  \istb{Y}[al]{x,1-x}  \istb{N}[ar]{0,0}  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

You can change the level and sibling distances of an individual continuum triangle by specifying the last two options of the macro \cmd{\istrootcntm} like, for example, \verb|+10mm..15mm+|.
Note that these options do not affect the action sibling distance.

\xbigskip1
\remark
Below we will see the convenient \emph{distance changers} \cmd{\cntmdistance} and \cmd{\cntmdistance*} to change the distances for all types of continua. These macros also have a control on the \emph{\isw{action sibling distance}.}

%The \emph{action sibling distance} can be controlled by the macro \icmd{\cntmactsibdist}. For this distance being \xw{3mm}, you can do like \verb|\cntmactsibdistance{3mm}| or \verb|\cntmactsibdist{2*1.5mm}|.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth,breakable}
\begin{istgame}[font=\scriptsize]
\xtdistance{10mm}{20mm}
\istrootcntm(1){1}                   % period 1
  \istb{x}[r] \istbm \endist
\istroot(A1)(1-1)<[label distance=-3pt]135>{2}
  \istb{A}[al]{x,1-x} \istb{R}[ar]      \endist
\istrootcntm(2)(A1-2){2}+10mm..15mm+ % period 2
  \istb{y}[r] \istbm \endist
\istroot(A2)(2-1)<[label distance=-3pt]135>{1}
  \istb{A}[al]{1-y,y} \istb{R}[ar]      \endist
\istrootcntm(3)(A2-2){1}             % period 3
  \istb{x}[r] \istbm \endist
\istroot(A1)(3-1)<[label distance=-3pt]135>{2}
  \istb{A}[al]{x,1-x} \istb{R}[ar]{0,0} \endist
\end{istgame}
\end{tcblisting}
%\xbigskip1

\xbigskip1
\remark
\begin{itemize}\tightlist
\item
Once the work of \cmd{\istrootcntm} is completed by \cmd{\endist}, \cmd{\istrootcntm} internally produces three node coordinates: \xw{(cntm)}, \xw{(cntm-1)}, and \xw{(cntm-2)}.
\item You can use these coordinates after \cmd{\istrootcntm} and before another \cmd{\istrootcntm} or one of its variant, like  \cmd{\istrootcntmA}, is used.
\end{itemize}


\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: using coordinates: (cntm),(cntm-1),(cntm-2)
\begin{istgame}[scale=1.2]
\istrootcntm(0){I}
  \istb{x}[r]  \istbm  \endist
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)<[label distance=-3pt]120>{II}
  \istb{Y}[al]{x,1-x}  \istb{N}[bl]{0,0}  \endist
\xtInfosetO(cntm)(cntm)
\xtInfosetO[draw=none,fill=red,opacity=.3](cntm-1)(cntm-2)
\end{istgame}
\end{tcblisting}
%\xbigskip1

\subsubsection*{\protect\cmd{\istrootcntm'}: swap version}

The swap version \icmd{\istrootcntm'} arranges branches clockwise just like \cmd{\istroot'} does.
With \cmd{\setistgrowdirection'}, both \cmd{\istrootcntm} and its swap version \cmd{\istrootcntm'} end up with the same result.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[scale=1.2]
\setistgrowdirection'{east}
\istrootcntm'(0){I}
  \istb{x}[b]  \istbm  \endist
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)<[label distance=-3pt]120>{II}
  \istb{Y}[al]{x,1-x}  \istb{N}[bl]{0,0}  \endist
\end{istgame}
\end{tcblisting}
%\xbigskip1

%The continuum level distance (or the height) and the continuum sibling distance (or the width), and the action sibling distance can be all controlled by the macro \cmd{\cntmdistance}, as discussed below in Section~\ref{page:cntmdistance} on page~\pageref{page:cntmdistance}.


\subsubsection{\protect\cmd{\cntmdistance}}
\label{page:cntmdistance}

The macro \icmd{\cntmdistance} working for \cmd{\istrootcntm} (and \cmd{\istrootcntmA}) is analogous to \cmd{\xdistance} working for \cmd{\istroot}.
As \cmd{\xtdistance} controls the height and width of a simple tree, \cmd{\cntmdistance} controls the height and width of a background triangle representing a continuum, but it has one more function.
With \icmd{\cntmdistance} you can also control the sibling distance of action branches (\emph{\isw{action sibling distance}})that are taken by the owner of the root.

%\xbigskip1
\begin{tcblisting}{listing only}
% \cntmdistance
% syntax:
  \cntmdistance{<cntm levdist>}{<cntm sibdist>}{<action sibdist>}
% defaults: <cntm levdist> is mandatory, and all others are optional
  {8mm}{3*<cntm lev dist>}{(1/3)*<cntm sib dist>}
\end{tcblisting}
%\xbigskip1

Note that the first argument of \cmd{\cntmdistance} is \emph{mandatory}, and all the others are optional.
For example, \verb+\cntmdistance{10mm}{20mm}+ means the followings:
\begin{verbatim}
    \cntmlevdist = 10mm, \cntmsibdist = 20mm, and
    \cntmactsibdist = (1/3)*\cntmsibdist, from now on.
\end{verbatim}

And \verb+\cntmdistance{10mm}{20mm}{3mm}+ means now \cmd{\cntmactsibdist\ = 3mm}.


\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \cntmdistance
\begin{istgame}[font=\scriptsize]
\xtdistance{10mm}{20mm}
\cntmdistance{10mm}{20mm}{3mm}
\istrootcntm(1){1} % period 1
  \istb{x}[r] \istbm \endist
\istroot(A1)(1-1)<[label distance=-3pt]135>{2}
  \istb{A}[al]{x,1-x} \istb{R}[ar] \endist
\istrootcntm(2)(A1-2){2} % period 2
  \istb{y}[r] \istbm \endist
\istroot(A2)(2-1)<[label distance=-3pt]135>{1}
  \istb{A}[al]{1-y,y} \istb{R}[ar] \endist
\istrootcntm(3)(A2-2){1} % period 3
  \istb{x}[r] \istbm \endist
\istroot(A1)(3-1)<[label distance=-3pt]135>{2}
  \istb{A}[al]{x,1-x} \istb{R}[ar]{0,0} \endist
\end{istgame}
\end{tcblisting}
%\xbigskip1


%\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
%% Example: 
%\begin{istgame}[scale=1.2]
%\cntmdistance{10mm}{3*\cntmlevdist}{1.5*10mm}
%\istrootcntm(0){I}
%  \istb*{x}[r]  \istbm  \endist
%\end{istgame}
%\end{tcblisting}


\subsubsection{\protect\cmd{\cntmdistance*}: combined with \protect\cmd{\xtdistance}}
\label{sec:xtdistance*}

The macro \icmd{\cntmdistance*} incorporates \cmd{\cntmdistance} with \cmd{\xtdistance}.

%\xbigskip1
\begin{tcblisting}{listing only}
% \cntmdistance*
% syntax:
  \cntmdistance*{<lev dist>}{<sib dist>}{<action sib dist>}
% defaults: 
  {15mm}{15mm}{(1/3)*<sib dist>}
\end{tcblisting}
%\xbigskip1

The macro \cmd{\cntmdistance} does not have anything to do with \cmd{\xdistance}, but the starred version \cmd{\cntmdistance*} does.
For example, \cmd{\cntmdistance*\{10mm\}\{20mm\}} means the followings:
\begin{verbatim}
      \cntmlevdist = \xtlevdist = 10mm, \cntmsibdist = \xtsibdist = 20mm, and
      \cntmdistance = (1/3)*\cntmdisdist, from now on.
\end{verbatim}
And \cmd{\cntmdistance*\{10mm\}\{20mm\}\{3mm\}} means now \cmd{\cntmactsibdist\ = 3mm}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \cntmdistance*: with \xtdistance
\begin{istgame}[scale=1.2]
\cntmdistance*{10mm}{20mm}{3mm}
\istrootcntm(0){I}
  \istb{x}[r]  \istbm  \endist
%\xtdistance{10mm}{20mm}
\istroot(1)(0-1)<[label distance=-3pt]120>{II}
  \istb{Y}[al]{x,1-x}  \istb{N}[ar]{0,0}  \endist
\end{istgame}
\end{tcblisting}


%%%You can use \cmd{\cntmpreset}, \cmd{\cntmactsibdist}, and \cmd{\cntmdistance} in any order, but whichever comes later overrides the previous effects.


\subsubsection{\protect\cmd{\cntmpreset}: controlling continuum triangles}
\label{ssec:cntmpreset}

The macro \icmd{\cntmpreset} controls the line style and color, size (via the \xw{shrink factor} with \xw{1} as default), and fill color of a continuum triangle drawn by \cmd{\istrootcntm}.

\begin{tcblisting}{listing only}
% \cntmpreset
% syntax:
  \cntmpreset[<line style>,<opts>]{<shrink factor>}[<fill color>]
% defaults 
  [-,solid,draw=black!25,fill=<draw color>]{1}[]
\end{tcblisting}

To change the background color you can do like, for example, either \xw{\cntmpreset[blue!20]} or \xw{\cntmpreset\{1\}[blue!20]}.
However, like \xw{\cntmpreset[blue!20][red!20]}, if you specify both of the bracket optional arguments, then the \emph{first one wins}. The second bracket option is just for your convenience to put \emph{fill color} easily.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\cntmdistance*{10mm}{20mm}{3mm}
\istrootcntm(1)
  \istb \istbm \endist
\istroot(A1)(1-1)
  \istb \istb  \endist
\cntmpreset[draw=blue,dashed][red!20]
\istrootcntm(2)(A1-2)
  \istb \istbm \endist
\istroot(A2)(2-1)
  \istb \istb  \endist
\cntmpreset[blue!20][red!20]
\istrootcntm(3)(A2-2)
  \istb \istbm \endist
\istroot(A1)(3-1)
  \istb \istb  \endist
\end{istgame}
\end{tcblisting}
%\xbigskip1


%% example with labels
%\xbigskip1
%\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
%\begin{istgame}[font=\scriptsize]
%\xtdistance{10mm}{20mm}
%\cntmdistance{10mm}{20mm}{3mm}
%\istrootcntm(1){1} % period 1
%  \istb{x}[r] \istbm \endist
%\istroot(A1)(1-1)<[label distance=-3pt]135>{2}
%  \istb{A}[al]{x,1-x} \istb{R}[ar] \endist
%\cntmpreset[draw=blue,dashed][red!20]
%\istrootcntm(2)(A1-2){2} % period 2
%  \istb{y}[r] \istbm \endist
%\istroot(A2)(2-1)<[label distance=-3pt]135>{1}
%  \istb{A}[al]{1-y,y} \istb{R}[ar] \endist
%\cntmpreset[blue!20][red!20]
%\istrootcntm(3)(A2-2){1} % period 3
%  \istb{x}[r] \istbm \endist
%\istroot(A1)(3-1)<[label distance=-3pt]135>{2}
%  \istb{A}[al]{x,1-x} \istb{R}[ar]{0,0} \endist
%\end{istgame}
%\end{tcblisting}
%%\xbigskip1


\xbigskip1
You can also draw a \emph{smaller} triangle, by specifying \ixw{shrink factor} as a decimal number in the curly braces.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\cntmdistance*{10mm}{20mm}
\cntmpreset{.7}
\istrootcntm(1)       \istb        \endist
\istroot(A1)(1-1)     \istb \istb  \endist
\cntmpreset[draw=blue,dashed]{.8}[red!20]
\istrootcntm(2)(A1-2) \istb \istbm \endist
\istroot(A2)(2-1)     \istb \istb  \endist
\end{istgame} 
\end{tcblisting}
%\xbigskip1


\subsubsection{\protect\cmd{\cntmpreset*}: simple triangles with no background color}
\label{ssec:cntmpreset*}

The macro \icmd{\cntmpreset*} works like \cmd{\cntmpreset}, for one exception: it prints, by default, a \emph{\isw{simple triangle} with sides drawn, but with no background color}.

\xbigskip1
\begin{tcblisting}{listing only}
% \cntmpreset
% syntax:
  \cntmpreset*[<line style>,<opts>]{<shrink factor>}[<fill color>]
% defaults 
  [-,solid,draw=black,fill=none]{1}[]
\end{tcblisting}
\xbigskip1

\remark
In order to restore the standard triangle options (i.e., \xw{[-,draw=none,black!25]}), you can just declare \cmd{\cntmpreset} followed by nothing. More precisely, if you use \cmd{\cntmpreset} without specifying the first bracket option, like \cmd{\cntmpreset\{.7\}}, the default options are restored.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \cntmpreset(*)
\begin{istgame}[font=\scriptsize]
\cntmdistance*{10mm}{20mm}
\cntmpreset*
\istrootcntm(1)
  \istb        \endist
\istroot(A1)(1-1)
  \istb \istb  \endist
\cntmpreset*[fill=blue!20]
\istrootcntm(2)(A1-2)
  \istb        \endist
\istroot(A2)(2-1)
  \istb \istb  \endist
\cntmpreset % restore default triangle options
\istrootcntm(3)(A2-2)
  \istb \istbm \endist
\istroot(A1)(3-1)
  \istb \istb  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1


You can also draw a \emph{smaller} triangle, by specifying \ixw{shrink factor} as a decimal number in the curly braces.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \cntmpreset(*)
\begin{istgame}[font=\scriptsize]
\cntmdistance*{10mm}{20mm}
\cntmpreset*{.5}
\istrootcntm(1)
  \istb        \endist
\istroot(A1)(1-1)
  \istb \istb  \endist
\istrootcntm(2)(A1-2)
  \istb        \endist
\istroot(A2)(2-1)
  \istb \istb  \endist
\cntmpreset{.7} % restore default triangle options
\istrootcntm(3)(A2-2)
  \istb \istbm \endist
\istroot(A1)(3-1)
  \istb \istb  \endist
\end{istgame}
\end{tcblisting}


\subsection{\protect\cmd{\istrootcntmA}: continuum arc version}
\label{ssec:istrootcntmA}

\subsubsection{\protect\cmd{\istrootcntmA}: basics}
\label{ssec:cntmA}

The macro \icmd{\istrootcntmA} works just like \cmd{\istroot}, but it draws an arc to express a continuum of branches. Here \xw{cntmA} is an abbreviation of \xw{cntmarc}. 
You can regard \cmd{\istrootcntmA} as the sum \cmd{\istroot} \xw{+} \xw{cntmA}.

\xbigskip1
\remark
\begin{itemize}\tightlist
\item
There is one important difference between \cmd{\istroot} and \cmd{\istrootcntmA}. By the last two options (for example, \xw{+10mm..20mm+}), the \cmd{\istrootcntmA} controls the level and sibling distances of a continuum arc, while \cmd{\istroot} controls the level and sibling distances of action branches (represented by the \cmd{\istb}) following it.
\item
Note that the distance changers \cmd{\cntmdistance} and \cmd{\cntmdistance*} work the same for \cmd{\istrootcntmA} as well as \cmd{\istrootcntm}. (\emph{There is no such thing as \cmd{\cntmAdistance}}.)
\end{itemize}
%\xbigskip1

\begin{tcblisting}{listing only,breakable}
% \istrootcntmA
% syntax: 
  \istrootcntmA[<grow keyval>,<opt>](<coor1>)(<coor2>)[<node style>,<opt>]%
               <arc pos>{<owner>}+<cntm levdist>..<cntm sibdist>+
% defaults: 
  [south](<m>)(0,0)[decision node]<above>{}+8mm..24mm+
% arguments: (coor1) is mandatory, all others are optional arguments
  [grow] % the direction of growing <default: south>
  (coor1) % name of the (sub)root: mandatory
  (coor2) % the (sub)root is at (coor2) <default: (0,0)>
  [node style] % node style <default: decision node> 
  <owner pos> % position of the ownter's name
  {owner} % name of the owner of the (sub)root
  +level dist..sibling dist+ % <defaults: 8mm,24mm>
\end{tcblisting}

The default level and sibling distance of a continuum of branches are \xw{8mm} and \xw{3*8mm}.
With the default distances, the distance between the root and the lowest point of the arc is one third longer (with all default values) than the continuum level distance.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[scale=1.2]
\istrootcntmA(0){I}  \istb{x}[r]  \endist
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)<120>{II}
  \istb{Y}[al]{x,1-x}  \istb{N}[ar]{0,0}  \endist
\draw [dashed,red] 
      ([xshift=-3mm]cntm-1) -- ([xshift=3mm]cntm-2);
\coordinate (C) at ($(cntm)!1.333!(0-1)$);
\draw [dashed,blue] (C-|{-1.5,0}) -- (C-|{1.5,0});
\end{istgame}
\end{tcblisting}

\xbigskip1
With the macro \icmd{\istbA} you can draw a single branch ending up with an endpoint on the continuum arc.
Just remember \cmd{\istb} always reaches the \emph{red dashed line} and \cmd{\istbA} the \emph{blue dashed line}.
For more details, see below Section~\ref{ssec:istbAfigure} (though it is not for first readers).

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[scale=1.2]
\istrootcntmA(0){I}
  \istbA{x}[r]  \endist
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)<120>{II}
  \istb{Y}[al]{x,1-x}  \istb{N}[ar]{0,0}  \endist
\xtTimeLineH[dashed,blue](0-1){-1.5}{1.5}
\end{istgame}
\end{tcblisting}


\subsubsection*{\protect\cmd{\istrootcntmA'}}

The swap version \icmd{\istrootcntmA'} arranges branches clockwise, like \cmd{\istroot'} does.
Note also that if you use \cmd{\setistgrowdirection'}, then 
using the swap version makes no difference in results.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \istrootcntmA' (growing east)
\begin{istgame}[scale=1.2]
\setistgrowdirection'{east}
\istrootcntmA'(0){I}
  \istb<level distance=1.3*\cntmlevdist>{x}[b]  \istbm \endist
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)<120>{II}
  \istb{Y}[al]{x,1-x}  \istb{N}[bl]{0,0}  \endist
\end{istgame}
\end{tcblisting}


\subsubsection{\protect\cmd{\istrootcntmA} and \protect\cmd{\istbA}}
\label{ssec:istbAfigure}

As discussed in Section~\ref{sec:istbA} on page~\pageref{sec:istbA} \cmd{\istb} and \cmd{\istbA} can be used interchangeably (but with one exception).
However, when it comes to \icmd{\istrootcntmA}, \icmd{\istbA} has a unique function: it reaches a continuum arc.

\begin{center}
%\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \istrootcntmA
\begin{istgame}[scale=2.2,font=\scriptsize]
%\cntmApreset<1.7>
\istrootcntmA(0)
  \istb*{\tiny\cmd{\istb}}[left,yshift=-1mm] \istbm \endist
\istrootcntmA(0)
  \istbm \istbA{\tiny\cmd{\istbA}}[right,xshift=-1mm,yshift=-1mm] \istbA*{\tiny\cmd{\istbA}}[right,yshift=-1mm]\endist
\xtdistance{6mm}{12mm}
\istroot(1)(0-2)
  \istb  \istb  \endist
\draw [dashed,red] 
      ([xshift=-3mm]cntm-1) -- ([xshift=3mm]cntm-2);
\coordinate (C) at ($(cntm)!1.333!(0-1)$);
\draw [dashed,blue]
      (C-|{-1.5,0}) -- (C-|{1.5,0});
\draw [|<->|,red] (0,0-|-1.5,0) -- ({0-1}-|-1.5,0);
\draw [|<->|,blue] (0,0-|1.5,0) -- (C-|1.5,0);
\node at (-1.5,-.2) [left] {\cmd{level distance of \textbackslash istb}};
\node at (1.5,-.2) [right] {\cmd{\istbA's level distance}};
\node at (-1.5,-.4) [left] {\cmd{= \textbackslash cntmlevdist}};
\node at (1.5,-.4) [right] {\cmd{= k*\textbackslash cntmlevdist}};
\node at (1.5,-.6) [right] {\xw{ (k=1.333 with default values)}};
\end{istgame}
%\end{tcblisting}
\end{center}

To be precise, \cmd{\istbA} reaches the \emph{blue dashed line}, as shown in the above picture, while \cmd{\istb} reaches the \emph{red dashed line}.
So when \cmd{\istbA} is the only child of the root, it arrives exactly at the continuum arc.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \istrootcntmA and \istbA
\begin{istgame}[scale=1.2]
\istrootcntmA(0)
  \istbA*
  \istbA* 
  \istbA*  
  \endist
\xtTimeLineH[dashed,blue](0-2){-1.5}{1.5}
\end{istgame}
\end{tcblisting}


Moreover, as also discussed in Section~\ref{sec:istbA} on page~\pageref{sec:istbA}, \cmd{\istbA} has one more function than \cmd{\istb}: it can easily change its level distance by using the first parenthesis option.
This allows you to make any \cmd{\istbA} reach the continuum arc, but after some trial and errors.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \istrootcntmA and \istbA
\begin{istgame}[scale=1.2]
\istrootcntmA(0)
  \istbA*(.89)  \istbA*     \istbA*(.89)
  \endist
\istrootcntmA(1)(0-1)
  \istbA*(.97) \istbA*(.97) \endist
\end{istgame}
\end{tcblisting}


\subsubsection{\protect\cmd{\cntmApreset}: controlling continuum arcs and wedges}

You can control the line style, position (via \xw{arc position factor}), and \emph{curvature} (via \xw{arc plot factor}) of a continuum arc with \icmd{\cntmApreset}.
You can also change the background color (by default \xw{transparent}) of the \emph{wedge} formed by a continuum arc.

%\xbigskip1
\begin{tcblisting}{listing only}
% syntax: \cntmApreset
  \cntmApreset*[<arc line opt>]<arc plot factor>{<arc pos factor>}[<fill color>]
% defaults: all arguments are optional
  [-,tension=1]<1.333>{1}[transparent]
\end{tcblisting}
\xbigskip1

You can change the line style or the color of a continuum arc, in the usual \TikZ\ way, like \xw{[dashed,thick,blue]}.
If you do not specify any optional argument, the corresponding argument will have the default values.
So, by declaring \cmd{\cntmApreset} followed by nothing, you can restore all the default values.

A continuum arc connects the two endpoints, by default, of the two outermost branches.
If the arc position factor (between zero and one) is less than \verb+{.5}+ the arc gets closer to the root, and if greater then it gets closer to the endpoints.
(What if the factor is greater than \xw{1}? You try!)

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}
\cntmdistance*{10mm}{20mm}
\cntmApreset[dashed,blue,thick]
\istrootcntmA(1)
  \istbA       \endist
\istroot(A1)(1-1)
  \istb \istb  \endist
\cntmApreset[dashed]{.6} 
\istrootcntmA(2)(A1-2)
  \istb        \endist
\istroot(A2)(2-1)
  \istb \istb  \endist
\cntmApreset % restore defaults
\istrootcntmA(3)(A2-2)
  \istbA       \endist
\istroot(A1)(3-1)
  \istb \istb  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

Note that \cmd{\istbA} (if it is the only child) always prints a branch with its endpoint on an arc .
Note also that the effect of \icmd{\cntmApreset} goes on until another \cmd{\cntmApreset}, which restores the values to defautls, is used.


%\xbigskip1
As for the curvature, if the factor (usually, greater than 1) typed in angle brackets is smaller than the default value \xw{<1.333>} the arc gets flatter, and if larger it gets sharper. (If the factor is \xw{1}, it becomes a straight line. What if the factor is less than \xw{1}? You guess!)

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}
\cntmdistance*{10mm}{20mm}
\cntmApreset<1.2>
\istrootcntmA(1)
  \istbA        \endist
\cntmApreset[tension=1.12]<1.508>
\istrootcntmA(2)(1-1)
  \istbA        \endist
\cntmApreset<1.7>[green]
\istrootcntmA(3)(2-1)
  \istbA*       \endist
\end{istgame}
\end{tcblisting}
\xbigskip1


In order to change the background color of the wedge formed by an arc, you should use the \emph{second bracket option}.
The first one is for a continuum arc line.
The color filled wedge lies on the \xw{behind} layer, by default. 
You can change the \isw{layer} by using \icmd{\cntmAlayerpreset}.
Available layers are: \xw{background}, \xw{behind}, \xw{main}, \xw{above}, and \xw{foreground}, in that order.
To restore the default layer (i.e., \xw{behind}), just declare \cmd{\cntmAlayerpreset}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}
\cntmdistance*{10mm}{20mm}
\cntmApreset{.5}[blue!20]
\cntmAlayerpreset{background}
\istrootcntmA(1)          \istbA \endist
\istroot(A1)(1-1)   \istb \istb  \endist
\istrootcntmA(2)(A1-2)    \istbA \endist
\istroot(A2)(2-1)   \istb \istb  \endist
\cntmApreset[dashed,blue,thick][red!20]
\cntmAlayerpreset % restore default (behind)
\istrootcntmA(3)(A2-2)    \istbA \endist
\istroot(A3)(3-1)   \istb \istb  \endist
\xtInfosetO[fill=green](A1)(A3)
\end{istgame}
\end{tcblisting}


\subsection{\protect\cmd{\istrootocntm} and \protect\cmd{\istrootocntmA}: oval continuum versions}

In some cases, you may want to use \icmd{\istrootocntmA}, the oval version of \cmd{\istrootcntmA}.
It can be regarded as the sum \cmd{\istrooto} \xw{+} \xw{cntmA}. The swap version \icmd{\istrootocntmA'} is also provided.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \istrooto+cntmA
\begin{istgame}
\setistEllipseNodeStyle[white]
\cntmdistance*{10mm}{20mm}
\cntmApreset[dashed]
\istrootocntmA(1){A}  \istbA{x}[r]        \istbm  \endist
\istrooto(1a)(1-1){B}
                      \istb{Y}[al]  \istb{N}[ar]  \endist
\istrootocntmA(2)(1a-2){B}  \istbA{y}[r]  \istbm  \endist
\istrooto(2a)(2-1){A}
                      \istb{Y}[al]  \istb{N}[ar]  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

It is anyway possible to use \icmd{\istrootocntm}, which is the oval version of \cmd{\istrootcntm}. 
It can be regarded as the sum \cmd{\istrooto} \xw{+} \xw{cntm}. 
You can also use its swap version \icmd{\istrootocntm'}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \istrooto+cntm
\begin{istgame}
\cntmdistance*{10mm}{20mm}
\cntmApreset[dashed]
\istrootocntm(1){A}  \istbA{x}[r]        \istbm  \endist
\istrooto(1a)(1-1){B}
                     \istb{Y}[al]  \istb{N}[ar]  \endist
\istrootocntm(2)(1a-2){B}  \istbA{y}[r]  \istbm  \endist
\istrooto(2a)(2-1){A}
                     \istb{Y}[al]  \istb{N}[ar]  \endist
\end{istgame}
\end{tcblisting}


\subsection{Doing some chores: not for most users}

\subsubsection{\protect\cmd{\cntmistb}: controlling outermost branches}

The macro \icmd{\cntmistb} controls the outermost branches of a continuum triangle.
This works similar to \cmd{\istb}, but you need to use this macro \emph{right before} the \cmd{\istrootcntm}.
And it works just \emph{once} only for the immediately following \cmd{\istrootcntm} and its close variants, but not for the continuum arc versions.

\xbigskip1
\remark
The macro \icmd{\cntmistb*} prints \xw{solid nodes} at the endpoints of the outermost branches.
\begin{itemize}\tightlist
\item The effect of printing \xw{solid nodes} affects \emph{all the following continua}.
It can be \emph{turned off} by the starred version \icmd{\xtHideEndPoints*} (see Section~\ref{ssec:xtShowEndPoints*}, for more details).
\end{itemize}

%\xbigskip1
\begin{tcblisting}{listing only}
% syntax: \cntmistb
  \cntmistb[<branch opt>]{<left action label>}[<pos>]{<right action label>}[<pos>]
% defaults: all arguments are optional
  [-,draw=none]{}[]{}[]
\end{tcblisting}

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\cntmdistance*{10mm}{20mm}{3mm}
\cntmistb[draw=blue,dashed]{x=0}[l]{x=1}[above,sloped]
\istrootcntm(1)
  \istb \istbm \endist
\istroot(A1)(1-1)
  \istb \istb \endist
\cntmistb*[blue]{x=0}[l]{x=1}[above,sloped]
\istrootcntm(2)(A1-2)
  \istb \istbm \endist
\istroot(A2)(2-1)
  \istb \istb \endist
\setistmathTF*000{texttt}
\cntmistb[red,draw=blue,thick]{x=0}[l]{x=1}[above,sloped]
\istrootcntm(3)(A2-2)
  \istb \istbm \endist
\istroot(A1)(3-1)
  \istb \istb \endist
\end{istgame}
\end{tcblisting}

\cmd{\cntmistb(*)} prints action labels in math mode by default, and the input mode can be changed by \cmd{\setistmathTF(*)}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\cntmpreset*[dashed]{.7}
\cntmdistance*{10mm}{20mm}{3mm}
\cntmistb{x=0}[l]{x=1}[above,sloped]
\istrootcntm(1)      \istb        \endist
\istroot(A1)(1-1)    \istb \istb  \endist
\cntmistb*[blue]{x=0}[l]{x=1}[above,sloped]
\istrootcntm(2)(A1-2) \istb       \endist
\istroot(A2)(2-1)     \istb \istb \endist
\setistmathTF*000{texttt}
\cntmpreset*{.9}[blue!20]
\cntmistb{x=0}[l]{x=1}[above,sloped]
\istrootcntm(3)(A2-2) \istb       \endist
\istroot(A1)(3-1)     \istb \istb \endist
\end{istgame}
\end{tcblisting}

\subsubsection{\protect\cmd{\cntmAistb}: controlling outermost branches}

The macro \icmd{\cntmAistb} controls the outermost branches of a continuum arc.
This works similar to \cmd{\istb}, but you need to use this macro \emph{right before} the \cmd{\istrootcntmA}.
And it works just \emph{once} only for the immediately following \cmd{\istrootcntmA} and its close variants, but not for the continuum triangle versions.

The macro \icmd{\cntmAistb*} prints \xw{solid nodes} at the endpoints of the outermost branches.
The effect of printing \xw{solid nodes} affects \emph{all the following continua}.
It can be \emph{turned off} by the starred version \icmd{\xtHideEndPoints*} (see Section~\ref{ssec:xtShowEndPoints*}, for more details).

\xbigskip1
\begin{tcblisting}{listing only}
% syntax: \cntmAistb
  \cntmistb[<branch opt>]{<left action label>}[<pos>]{<right action label>}[<pos>]
% defaults: all arguments are optional
  [-]{}[]{}[]
\end{tcblisting}
\xbigskip1

Note that \cmd{\cntmAistb} controls outermost branches of a continuum, while \cmd{\cntmApreset} controls the arc line.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\cntmdistance*{10mm}{20mm}
\cntmAistb[dotted]{x=0}[above,sloped]{x=1}[above,sloped]
\cntmApreset[dashed,blue,thick]{.7}
\istrootcntmA(1)      \istbA        \endist
\istroot(A1)(1-1)    \istbA \istbA  \endist
\end{istgame}
\end{tcblisting}

\xbigskip1

\cmd{\cntmAistb(*)} prints action labels in math mode by default, and the input mode can be changed by \cmd{\setistmathTF(*)}.

%\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\cntmdistance*{10mm}{20mm}
\cntmAistb[dashed]{x=0}[l]{x=1}[above,sloped]
\cntmApreset[dashed]{.7}
\istrootcntmA(1)      \istbA        \endist
\istroot(A1)(1-1)    \istbA \istbA  \endist
\cntmAistb*[red,draw=black]{x=0}[l]{x=1}[above,sloped]
\istrootcntmA(2)(A1-2) \istb       \endist
\istroot(A2)(2-1)     \istbA \istbA \endist
\setistmathTF*000{texttt}
\cntmAistb[draw=blue,thick]{x=0}[l]{x=1}[above,sloped]
\cntmApreset{.9}[blue!20]
\istrootcntmA(3)(A2-2) \istbA       \endist
\istroot(A1)(3-1)     \istbA \istbA \endist
\end{istgame}
\end{tcblisting}
\xbigskip1


It is not impossible to print two endpoints of a continuum arc, even thought it does not make any game theoretical sense. You can easily do that by using \icmd{\cntmAexpostShowEndPoints} right after \cmd{\istrootcntmA}.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\cntmAistb*
\cntmApreset{.7}
\istrootcntmA(1)        \istbA  \endist
\cntmAexpostShowEndPoints
\istrootcntmA(A1)(1-1)  \istbA*  \endist
\cntmAexpostShowEndPoints[oval node][box node]
\end{istgame}
\end{tcblisting}


\subsubsection{\protect\cmd{\xtShowEndPoints*}}
\label{ssec:xtShowEndPoints*}

The starred version \icmd{\xtShowEndPoints*} has additional control over the endpoints of outermost branches of a continuum, when it is used with \cmd{\cntmistb} or \cmd{\cntmAistb}. 
However, the starred versions \cmd{\cntmistb*} and \cmd{\cntmAistb*} do not obey \cmd{\xtShowEndPoints*}.
They anyway print solid nodes at the endpoints of outermost branches and the effect goes on until it is blocked by \cmd{\xtShowEndPoints*} or \cmd{\xtHidePoints*}.

\cmd{\xtShowEndPoints*} competes with each of the starred versions \cmd{\cntmistb*} and \cmd{\cntmAistb*} for the control over \cmd{\cntmistb} and \cmd{\cntmAistb} with respect to the endpoints of outermost branches.
Whichever comes later wins.

The starred version \cmd{\xtHideEndPoints*} works \emph{only for the endpoints of the outermost branches} to turn off the effects of \cmd{\xtShowEndPoints(*)}, \cmd{\cntmistb*}, and \cmd{\cntmAistb*}. But whichever comes later wins.

Note that the non-starred versions \cmd{\xtShowEndPoints} and \cmd{\xtHideEndPoints} have nothing to do with the outermost endpoints of a continuum.

\xbigskip1
In the example below, \cmd{\cntmistb*} overrides the effect of \cmd{\xtShowEndPoint*[oval node]}, with respect to the outermost endpoints of continua.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}
\cntmdistance*{8mm}{16mm}
\cntmpreset*
\xtShowEndPoints*[oval node]
\cntmistb
\istrootcntm(1)           \istb  \endist
\istroot(A1)(1-1)  \istb  \istb  \endist
\cntmistb
\istrootcntm(2)(A1-2)     \istb  \endist
\istroot(A2)(2-1)  \istb  \istb  \endist
\cntmistb*
\istrootcntm(3)(A2-2)     \istb  \endist
\istroot(A3)(3-1)  \istb  \istb  \endist
\cntmistb
\istrootcntm(4)(A3-2)     \istb  \endist
\istroot(A4)(4-1)  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}

\xbigskip1

In the example below, \cmd{\xtHideEndPoints} and \cmd{\xtHidePoints*} cooperatively turn off the effects of \cmd{\xtShowEndPoints*} and \cmd{\cntmAistb}*.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}
\cntmdistance*{8mm}{16mm}
\xtShowEndPoints*[oval node]
\cntmAistb*
\istrootcntmA(1)          \istbA \endist
\istroot(A1)(1-1)  \istb  \istb  \endist
\xtShowEndPoints*[box node]
\cntmAistb
\istrootcntmA(2)(A1-2)    \istbA \endist
\istroot(A2)(2-1)  \istb  \istb  \endist
\cntmAistb
\istrootcntmA(3)(A2-2)    \istbA \endist
\istroot(A3)(3-1)  \istb  \istb  \endist
\cntmAistb*
\xtHideEndPoints* % turns off only cntm endpoints
\xtHideEndPoints
\istrootcntmA(4)(A3-2)    \istbA \endist
\istroot(A4)(4-1)  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}


\subsection{Information sets for continua of branches}

\subsubsection{Information sets for continuum triangles}

It is not an issue to draw information sets for continuum triangles. You can just apply \cmd{\xtInfoset} or \cmd{\xtInfosetO}.
%This section is for drawing information sets for continuum arcs.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}
\cntmdistance*{8mm}
\cntmpreset{1}[green]
\istrootcntm(1)           \istb  \endist
\xtInfoset([yshift=-1mm]cntm-1)([yshift=-1mm]cntm-2)
\istroot(A1)(1-1)  \istb  \istb  \endist
\istrootcntm(2)(A1-2)     \istb  \endist
\xtInfosetO[fill=red,opacity=.4](cntm-1)(cntm-2)
\istroot(A2)(2-1)  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}


\subsubsection{\protect\cmd{\cntmAInfoset} for continuum arcs}

The macro \icmd{\cntmAInfoset} draws an arc to represent an \isw{information set} for an arc type continuum of branches,
on the background layer.
The default position of the arc information set is \xw{1+.1}, meaning that \xw{.1} (by default) is added to the position (\xw{1} by default) of a continuum arc.
It must be used \emph{right after} the corresponding \cmd{\istrootcntmA} whose root coordinate is its \emph{mandatory argument}. It does not have an option for an information set owner. (If needed, you can use supplementary macros such as \cmd{\xtInfosetOwner} and \cmd{\xtOwner}.)

%\xbigskip1
\begin{tcblisting}{listing only}
% syntax: \cntmAInfoset
  \cntmAInfoset*[<line opt>](<cntm root>)<plot factor>{<addto cntmApos>}
% defaults: (<cntm root>) is mandatory
  [](<m>)<1.333>{.1}
\end{tcblisting}
%\xbigskip1

You can change, if necessary, the curvature of an information set arc by using \ixw{plot factor} (\xw{<1.333>} by default).

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \cntmAInfoset
\begin{istgame}[scale=1.5]
\istrootcntmA(0)
  \istbA  \endist
\cntmAInfoset(0)<1.34>
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}

%\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
%% Example: \istrootcntmA
%\begin{istgame}[scale=1.2]
%\istrootcntmA(0){I}
%  \istbA{x}[r]  \endist
%\cntmAInfoset(0)
%\xtdistance{10mm}{20mm}
%\istroot(1)(0-1)<120>{II}
%  \istb{Y}[al]{x,1-x}  \istb{N}[ar]{0,0}  \endist
%\end{istgame}
%\end{tcblisting}

You can also change the position and the line style of an information set arc, as shown in the following example:

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \cntmAInfoset
\begin{istgame}[scale=1.5]
\istrootcntmA(0)
  \istbA  \endist
\cntmAInfoset[red,dashed,thick](0){-.1}
\cntmAInfoset(0)
\cntmAInfoset[blue,dashed,thick](0){.2}
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)
  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}

\subsubsection{\protect\cmd{\cntmAInfosetO}: oval version}
\label{sec:cntmAInfosetO}

The oval version \icmd{\cntmAInfosetO} enables you to draw a bubble type \isw{information set} for a continuum arc. It must be used right after a simple tree with the root produced by \cmd{\istrootcntmA} and accepts the root of the continuum as the mandatory argument. \cmd{\cntmAInfosetO} can control the style of the information set and height (or thickness), but it does not have an option for the owner of a information set.

\xbigskip1
\begin{tcblisting}{listing only}
% syntax: \cntmAInfosetO
  \cntmAInfosetO[<line opt>](<cntm root>)
                <plot factor>{<addto cntmApos>}[<turn X-ang>](<infoset height>)
% defaults: (<cntm root>) is mandatory
  [](<m>)<1.333>{.1}[0](1em)
\end{tcblisting}
\xbigskip1


\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[scale=1.2]
\istrootcntmA(0)  \istbA        \endist
\cntmAInfosetO(0)
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}

\xbigskip1
You can change the style of an information set by using usual \TikZ\ options.
You can also change its position and curvature via \cmd{\cntmApreset}.


\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[scale=1.2]
\cntmdistance*{10mm}{20mm}
\istrootcntmA(0)       \istbA  \endist
\cntmAInfosetO[blue,dashed,thick](0)
\cntmApreset{.6}
\istrootcntmA(1)(0-1)  \istbA  \endist
\cntmAInfosetO[solid,fill=green](1)(.5em)
\cntmApreset<1.8>{.6}
\istrootcntmA(2)(1-1)  \istbA  \endist
\cntmAInfosetO[fill=blue!20](2)
\end{istgame}
\end{tcblisting}
\xbigskip1

You do not need to bother if a tree is swapped or rotated.
Note also that the height (or thickness) of information set are not affected by \TikZ\ scaling.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[scale=.8]
\setistgrowdirection'{east}
\cntmdistance*{10mm}{20mm}
\istrootcntmA(0)       \istbA  \endist
\cntmAInfosetO[blue,dashed,thick](0)
\cntmApreset{.6}
\istrootcntmA(1)(0-1)  \istbA  \endist
\cntmAInfosetO[solid,fill=green](1)(.5em)
\cntmApreset<1.8>{.6}
\istrootcntmA(2)(1-1)  \istbA  \endist
\cntmAInfosetO[fill=blue!20](2)
\end{istgame}
\end{tcblisting}


\xbigskip1
If necessary, you can use the \xw{turn X-angle} option to get a better result (see the following Section~\ref{ssec:turnxangles} for this issue).

\subsubsection{Fine-tuning \protect\cmd{\cntmAInfosetO}: Not for most users}
\label{ssec:turnxangles}

\subsubsection*{turing X circles}

In the case of a severely asymmetrical \TikZ\ scale (using \xw{xsacle} and \xw{yscale} asymmetrically), an information set drawn by \cmd{\cntmAInfosetO} will probably be distorted, as shown in the upper part of the example below.
The bracket option to be used after the mandatory argument of \cmd{\cntmAInfosetO} can solve this problem by turning the \emph{blue circle} (called, an \xw{X} circle) drawn at the beginning point of the information set.
To do that, specify an appropriate degree of rotation in brackets, like \cmd{\cntmAInfosetO(2)[60]}, as shown below.
(See Section~\ref{ssec:extrememidpointfactor} for a related topic.)

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: fine-tunig \cntmAInfosetO
\begin{istgame}[xscale=4]
\cntmdistance*{15mm}{10mm}
\cntmApreset<1.8>
\istrootcntmA(1)       \istbA  \endist
\node at (cntm-1)
      [draw,circle,blue,opacity=.4,minimum size=1em]{};
\cntmAInfosetO(1)
\istrootcntmA(2)(1-1)  \istbA  \endist
\cntmAInfosetO(2)[60]
\end{istgame}
\end{tcblisting}


\subsubsection*{scaling \cmd{\cntmAInfosetO} according to \TikZ\ scales}
\label{page:scaleissue-cntm}

The height (or thickness) of an information set drawn by \cmd{\cntmAInfosetO} is not affected by \TikZ\ scales.
In some cases, you may want to change the height according to the values of \TikZ\ scales.

As discussed in Section~\ref{ssec:scaleissue}, the \env{istgame} environment treats, for example, \xw{[scale=.7]} and \xw{[scale=.7,xscale=1]} as different, while the \env{tikzpicture} environment treats them as equal.
With the package \pkg{istgame}, if you use \xw{[scale=.7,xscale=1]} then the value of \xw{scale} is not used to keep the height of an oval type information set unchanged, so that you can scale the information set accordingly.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[scale=.7,xscale=1]
\istrootcntmA(0)  \istbA         \endist
\cntmAInfosetO[fill=blue!20](0)
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)  \istb   \istb  \endist
\end{istgame}
\end{tcblisting}


\subsection{Transition from obsolete macros \protect\cmd{\istcntm} and \protect\cmd{\istcntmarc}}

It turned out to be inconvenient to use the two macros \cmd{\istcntm} and \cmd{\istcntmarc} to express a continuum of branches because it requires two steps. Use, instead, a one step method (if you use only default settings) with \cmd{\istrootcntm} and \cmd{\istrootcntmA} that combine the two steps. Anyway, the two \emph{obsolete} macros are provided only for backward compatibility with no maintenance and possible to be removed later.

\paragraph{\protect\cmd{\istcntm}}

The macro \cmd{\istcntm} draws only a background triangle for a continuum of branches.
And then you can draw an action taken using \cmd{\istroot}.

\begin{tcblisting}{listing only}
% \istcntm
% syntax: 
  \istcntm[<grow keyval>](<coor1>)(<coor2>)[<fill color>]+<levdist>..<sibdist>+
% defaults: [south]()(0,0)[black!25]+8mm..24mm+
\end{tcblisting}

%\xbigskip1

%Using \cmd{\istroot} with \cmd{\istcntm} draws a representative branch of a continuum of branches.
%Note, in the following example, that the second branch of \cmd{\istroot} is \xw{missing}\index{missing} to express the representative branch among a continuum of branches. Again, \cmd{\cntmlevdist} is \xw{8mm} by default.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \istcntm (obsolete)
\begin{istgame}[scale=1.2]
\istcntm(cntm)
\istroot(0)(cntm){I}+8mm..8mm+
  \istb{x}[r]  \istbm  \endist
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)<[label distance=-3pt]120>{II}
  \istb{Y}[al]{x,1-x}  \istb{N}[ar]{0,0}  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

The above old way can be switched to the following new way:

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \istrootcntm (new way)
\begin{istgame}[scale=1.2]
\istrootcntm(0){I}
  \istb{x}[r]  \istbm  \endist
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)<[label distance=-3pt]120>{II}
  \istb{Y}[al]{x,1-x}  \istb{N}[ar]{0,0}  \endist
\end{istgame}
\end{tcblisting}

%%%\subsubsection*{Changing the size and the color of a continuum of branches}
%%%
%%%You can change the height (or the level distance) and the base (or the sibling distance) of the background isosceles triangle by specifying them, for example, like \xw{+10mm..20mm+}.
%%%
%%%\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
%%%% Example: \istcntm (changing the size)
%%%\begin{istgame}
%%%\istcntm(cntm)+10mm..20mm+
%%%\istroot(0)(cntm){1}+10mm..10mm+
%%%  \istbm  \istb{x}[l]  \endist
%%%\end{istgame}
%%%\end{tcblisting}
%%%
%%%Once the distances are type in as options of \cmd{\istcntm}, they internally change the default values, which apply only to the corresponding triangle.
%%%For example, \xw{+10mm..20mm+} will result in \cmd{\cntmlevdist=10mm} and \cmd{\cntmsibdist=20mm}.
%%%So you can get exactly the same result as previous one by doing the following:
%%%
%%%\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
%%%% Example: \istcntm (changing the size)
%%%\begin{istgame}
%%%\istcntm(cntm)+10mm..20mm+
%%%\istroot(0)(cntm){1}+\cntmlevdist..\cntmlevdist+
%%%  \istbm  \istb{x}[l]  \endist
%%%\end{istgame}
%%%\end{tcblisting}
%%%
%%%You can change the color of the background triangle by using an option as you can see in the following example:
%%%
%%%\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
%%%\begin{istgame}
%%%\xtdistance{10mm}{20mm}
%%%\istroot(0){1}
%%%  \istb{A}[al]  \istb{B}[ar]{1,1}  \endist
%%%\istcntm(cntm)(0-1)[green]+10mm..20mm+
%%%\istroot(1)(cntm)<135>{2}+\cntmlevdist..\cntmlevdist+
%%%  \istbm  \istb{x}[l]  \endist
%%%\istroot(2)(1-2)<[label distance=-4pt]45>{1}
%%%  \istb{Y}[l]{3-x,x}  \istb{N}[r]{0,0}  \endist
%%%\end{istgame}
%%%\end{tcblisting}


\paragraph{\protect\cmd{\istcntmarc} (arc version)}

The macro \cmd{\istcntmarc} is the arc version, which draws a background arc to represent a continuum of branches.

\begin{tcblisting}{listing only}
% \istcntmarc
% syntax: 
  \istcntmarc[<grow keyval>](<coor1>)(<coor2>)[<color,opt>]{<num>}+levd..sibd+
% defaults: [south](<m>)(0,0)[bend right]{.5}+8mm..24mm+
\end{tcblisting}

%The option \xw{<num>} (\xw{0.5} by default) specifies 
%the convex combination of the root and each of the background child nodes.
%The smaller \xw{<num>} is, the closer is the connecting arc to the root.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \istcntmarc (obsolete)
\begin{istgame}[scale=1.2]
\istcntmarc(cntm)[green]
\istroot(0)(cntm){I}+8mm..8mm+
  \istb{x}[r]  \istbm  \endist
\xtdistance{10mm}{18mm}
\istroot(1)(0-1)<[label distance=-3pt]120>{II}
  \istb{Y}[al]{x,1-x}  \istb{N}[ar]{0,0}  \endist
\end{istgame}
\end{tcblisting}
\xbigskip1

The above old way can be switched to the following new way.
One difference is that the position of a continuum arc is now \xw{1} by default, while it was \xw{.5}.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \istrootcntmA (new way)
\begin{istgame}[scale=1.2]
\cntmApreset<1.44>{.5}[green]
\istrootcntmA(0){I}
  \istb{x}[r]  \istbm  \endist
\xtdistance{10mm}{18mm}
\istroot(1)(0-1)<[label distance=-3pt]120>{II}
  \istb{Y}[al]{x,1-x}  \istb{N}[ar]{0,0}  \endist
\end{istgame}
\end{tcblisting}


\section{Arrows}
\label{sec:arrows}

\subsection{Using \TikZ\ arrow options with \env{istgame}}


\subsubsection{\TikZ\ arrow option \xw{->}}

The simplest way of printing \isw{arrow}s in \emph{a whole game tree} is to use the \Tikz\ option \xw{->} as an option for the \env{istgame} environment. To get the best result, you may want to use \cmd{\xtShowEndPoints} together with the option \xw{->}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: arrows
\begin{istgame}[->,scale=.8]
\istroot(0)+15mm..30mm+  \istb \istb \endist
\xtShowEndPoints
\istroot(1)(0-1)         \istb \istb \endist
\istroot(2)(0-2)         \istb \istb \endist
\istroot(3)(1-2)         \istb \istb \endist
\end{istgame}
\end{tcblisting}

For an arrow on an individual branch, you can use arrow options with each \cmd{\istb}.

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: arrows
\begin{istgame}[scale=.8]
\istroot(0)+15mm..30mm+  \istb[->] \istb \endist
\xtShowEndPoints
\istroot(1)(0-1) \istb[->] \istb \endist
\xtHideEndPoints
\istroot(2)(0-2) \istb[-|<>|] \istb[->o>>>o>] \endist
\end{istgame}
\end{tcblisting}


\subsubsection{Fine-tuning with \protect\cmd{\setistgameshorten}: Not for most users}
\label{sec:setistgamearrowendshorten}
Assuming that you do not want the terminal points to be shown, in order to get the best result of arrows you can use the macro \icmd{\setistgameshorten},
like \cmd{\setistgameshorten\{1.3pt\}}, right \emph{before} the \env{istgame} environment.
Note that \cmd{\setistgameshorten} has a global effect. So, when necessary, you should use the macro within a TeX group.

\xbigskip1
\remark (not for most users)
\begin{itemize}\tightlist
\item Internally, the \env{istgame} environment checks the existence of the option \xw{->} and automatically adds \xw{shorten >=<keyval>} (by default, \xw{0pt}) to the option list as the first entry together with \xw{->}.
\item You can do the same thing, without using this macro, by manually adding, for example, \xw{[->,shorten >=1.3pt]} to the list of options.
\end{itemize}

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \setistgameshorten
\setistgameshorten{1.3pt} % use in a TeX group
\begin{istgame}[->,scale=.8]
%\xtShowEndPoints
\istroot(0)+15mm..30mm+  \istb \istb \endist
\istroot(1)(0-1)         \istb \istb \endist
\istroot(2)(0-2)         \istb \istb \endist
\istroot(3)(1-2)         \istb \istb \endist
\end{istgame}
\end{tcblisting}

You should also be aware that, in \Tikz, the options \xw{shorten} and \xw{->} affect any lines or curves in the current environment.


\subsection{Middle arrows for a branch}
\label{sec:showmidarrows}

\index{middle arrow}
With \cmd{\istb}, you can print an arrow tip in the middle of \emph{a branch} by using a new \emph{controllable} arrow tip style \ixttw{->-}, 
like \xw{\istb[->-]}.

\subsubsection{A middle arrow for each \protect\cmd{\istb}}

To print an arrow tip in the middle of a branch, you can use \xw{->-} as an option for \cmd{\istb}.
The \emph{controllable} middle arrow style \xw{->-} takes one optional value, which is a number between 0 and 1 (by default \xw{->-=.55}) determining a relative position from a parent node to a child node, where the end of an arrow tip is placed.
For example, \xw{\istb[->-=0.1]} prints an arrow tip near the parent node, and \xw{\istb[->-=0.9]} near the child node.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: new style: middle arrow tip
\begin{istgame}[scale=.8]
\istroot(0)+15mm..30mm+
  \istb[->-] \istb[->-] \endist
\istroot(1)(0-1)
  \istb[->-=.3] \istb[->-=.9] \endist
\istroot(2)(0-2)
  \istb[->-=.7,draw=blue] \istb[->-=.2,draw=red] \endist
\istroot(3)(1-2)
  \istb \istb[->-=1] \endist
\end{istgame}
\end{tcblisting}

\xbigskip1
\remark issues on middle arrows with \cmd{\istB}:
\begin{itemize}\tightlist
\item Middle arrows work well with \cmd{\istb}, but the exact position of a middle arrow tip does NOT work very well with \cmd{\istB}.
\item So, if you want to print dual labels for branches with middle arrows, it is recommended to use \cmd{\istb} together with \cmd{\xtActionLabel}, instead of \cmd{\istB} (see also page~\pageref{page:noistB}).
\end{itemize}

Except for \cmd{\istB}, all the other variants of \cmd{\istb} including \cmd{\istbA}, \cmd{\cntmistb}, and \cmd{\cntmAistb} work well with the middle arrow option \xw{->-}.


\subsubsection{Middle arrow tip styles}


The package also provides additional styles for middle arrow tips, which have a \emph{fixed} position and shape. 
(Note that the \ixw{single arrow tip} \xw{->-} is \emph{controllable}.)

\xbigskip1

  Additional \ixw{middle arrow tip style}\xw{s}:
\begin{itemize}\tightlist
\item \ixttw{->>-} : \ixw{double arrow tip} in the middle of a branch at the position of \xw{.6}
\item \ixttw{->>>-} : \ixw{triple arrow tip} in the middle of a branch at the position of \xw{.65}
\item \ixttw{-o-} : \ixw{circle arrow tip} in the middle of a branch at the position of \xw{.55}
\item \ixttw{-x-} : \ixw{cross arrow tip} in the middle of a branch at the position of \xw{.5}
\end{itemize}

\remark
All the middle arrow tips are printed in black, by default.
Their color can be changed by \cmd{\setxtarrowtips} (see the following Section~\ref{ssec:setxtarrowtips}).
\xbigskip1

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[xscale=.8]
\istroot(0)+15mm..30mm+
  \istb[->>-]    \istb[->>>-,red] \endist
\istroot(1)(0-1)
  \istb[-o-,red] \istb[-x-,blue]  \endist
\setxtarrowtips[blue,thick]
\istroot(2)(0-2)
  \istb[-o-]     \istb[-x-]       \endist
\end{istgame}
\end{tcblisting}


\subsubsection{\protect\cmd{\setxtarrowtips}: controlling middle arrow tips via \xw{->-}}
\label{ssec:setxtarrowtips}

The macro \icmd{\setxtarrowtips} controls the position and shape of a middle arrow tip, 
but only works through the \emph{controllable} middle arrow style \xw{->-}, not the other \emph{fixed} arrow styles.
However, it controls the color of \emph{all} the middle arrow tips. The effect of change by this macro continues until the end of the current environment unless it is changed again. To restore the default values, just declare \cmd{\setxtarrowtips} followed by nothing.

\xbigskip1
\begin{tcblisting}{listing only}
% \setxtarrowtips
% syntax: all arguments are optional
  \setxtarrowtips<midarrow tip pos>{<arrow shape>}[<arrow opt>]
% defaults: <.55>{>}[black,-,thin,solid,shorten >=0pt]
\end{tcblisting}
%\xbigskip1

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \setxtarrowtips
\begin{istgame}[scale=1]
\setxtarrowtips<.9>{>>}[blue,thick]
\istroot(0)+15mm..25mm+
  \istb[->-] \istb[->-] \endist
\istroot(1)(0-1)
  \istb[->-=.5] \istb[->-=.3] \endist
\setxtarrowtips<.9>{<*|o|>}[blue,thick,opacity=.4]
\istroot(2)(0-2)
  \istb[->-,green] \istb[->-,red] \endist
\setxtarrowtips<.7>
\istroot(3)(1-2)  \istb \istb[->-] \endist
\istroot(4)(2-2)  \istb[-o-] \istb[-x-] \endist
\end{istgame}
\end{tcblisting}

Note that, as seen in the example above, the position set individually by an option value of \cmd{\istb}, like \cmd{\istb[->-=.3]}, 
wins the position set by \cmd{\setxtarrowtips<.9>}.


\subsection{Middle arrow for simple tress}

\subsubsection{\protect\cmd{\xtShowMidArrows} and \protect\cmd{\xtHideMidArrows}}

The macro \icmd{\xtShowMidArrows} prints \emph{middle arrows} (a single arrow tip, by default) for \emph{all the branches} of a \emph{simple tree} (but not for a separate branch).
The effect of \cmd{\xtShowMidArrows} continues until it is changed by another \cmd{\xtShowMidArrows} or blocked by \icmd{\xtHideMidArrows}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \xtShowMidArrows, \xtHideMidArrows
\begin{istgame}
\xtShowMidArrows
\istroot(0)+15mm..30mm+  \istb[blue] \istb[red] \endist
\xtHideMidArrows
\istroot(1)(0-1)  \istb \istb \endist
\istroot(2)(0-2)  \istb \istb \endist
\xtShowMidArrows
\istroot(3)(1-2)  \istb \istb \endist
\end{istgame}
\end{tcblisting}

\xbigskip1

\remark
\begin{itemize}\firmlist
\item \cmd{\xtShowMidArrows} works for all branches of simple trees.
\item The middle arrow option styles work separately only for \cmd{\istb}'s having them and \cmd{\setxtarrowtips} works only for \cmd{\istb}'s having the option \xw{->-}.
\item Since the middle arrow tip styles and \cmd{\xtShowMidArrows} work completely independently, if you use both of them, they are all printed.
\item Note also that \cmd{\xtHideMidArrows} removes only the effect of \cmd{\xtShowMidArrows}.
\end{itemize}

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \xtShowMidArrows, \xtHideMidArrows
\begin{istgame}
\setxtarrowtips<.3>{*}[red]
\xtShowMidArrows
\istroot(0)+15mm..30mm+  \istb[blue] \istb[red] \endist
\xtHideMidArrows
\istroot(1)(0-1)  \istb[->-] \istb[-o-] \endist
\istroot(2)(0-2)  \istb \istb \endist
\xtShowMidArrows
\istroot(3)(1-2)  \istb[->-] \istb[-o-] \endist
\end{istgame}
\end{tcblisting}


\subsubsection{\protect\cmd{\setxtshowmidarrows}: controlling \protect\cmd{\xtShowMidArrows}}

The macro \icmd{\setxtshowmidarrows}, 
you can control the position, color, style, and shape of middle arrow tips, to be drawn by \cmd{\xtShowMidArrows}.

\xbigskip1
\begin{tcblisting}{listing only}
% \setxtshowmidarrows
% syntax: 
  \setxtshomidwarrows<midarrow tip relative pos>{<arrow shape>}[<arrow opt>]
% defaults: <.55>{>}[black]
\end{tcblisting}

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \setxtshowmidarrows
\begin{istgame}
\xtShowMidArrows
\istroot(0)+15mm..30mm+
  \istb \istb \endist
\xtHideMidArrows
\istroot(1)(0-1)  \istb \istb \endist
\xtShowMidArrows
\setxtshowmidarrows<.8>{>>>}[red,thick]
\istroot(2)(0-2)  \istb \istb \endist
\setxtshowmidarrows<1>
\istroot(3)(1-2)  \istb \istb \endist
%----- Remark ---------------------------------------
%\draw ([yshift=-5pt]2-1) -- ([yshift=-5pt]2-2); % NO!
\coordinate (A) at ([yshift=-5pt]2-1);
\coordinate (B) at ([yshift=-5pt]2-2);
\draw [|-|] (A) -- (B);
\end{istgame}
\end{tcblisting}

\xbigskip1
\remark issues in adding other graphic objects (not for most users)
\label{page:showarrows}
\begin{itemize}%\tightlist
\item As you can see in the above example, when \cmd{\xtShowMidArrows} is used, you should redefine coordinates for endpoints before you use them for other graphic objects.
\item This is because, in \Tikz, \xw{shift} or \xw{scope} does not work in this case. So, alternatively, you can use \verb+\draw [transform canvas={yshift=-5pt}] (2-1) -- (2-2);+ (See \TikZ\ manual about \xw{transform canvas}).
\item \cmd{\xtShowArrows} does not affect the \Tikz\ absolute coordinates.
\end{itemize}


\subsection{Arrows for simple trees}

\subsubsection{\protect\cmd{\xtShowArrows} and \protect\cmd{\xtHideArrows}}

In many cases you might not need to care about the position of arrow tips, just wanting to put them at the ends of branches for simple trees. For this purpose, the macro \cmd{\xtShowArrows} (accepting one bracket option for a node style) is provided.

\icmd{\xtShowArrows}, internally, calls \cmd{\xtShowEndPoints} (with \xw{solid node}, by default) first and then prints arrows in order to produce the best result of showing arrows.
So, for example, \cmd{\xtShowArrows[oval node]} is equivalent to \cmd{\xtShowEndPoints[oval node]} followed by printing of arrows (in black by default).

The macro \icmd{\xtHideArrows} turns off all the effect of \cmd{\xtShowArrows}, while \icmd{\xtHideArrows*} has the  endpoints remained. (\cmd{\xtShowArrows} does not have its starred version.)

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \xtShowArrows, \xtHideArrows
\begin{istgame}
\xtShowArrows
\istroot(0)+15mm..30mm+  \istb[blue] \istb[red] \endist
\xtHideArrows
\istroot(1)(0-1)  \istb{a} \istb \endist
\xtHideArrows* % endpoints remain
\istroot(2)(0-2)  \istb{b} \istb \endist
\xtShowArrows[oval node]
\istroot(3)(1-2)  \istb{c} \istb \endist
\end{istgame}
\end{tcblisting}

\xbigskip1
\remark issues in adding other graphic objects (not for most users)
\begin{itemize}\tightlist
\item Like \cmd{\xtShowMidArrows}, when \cmd{\xtShowArrows} is used, you should redefine coordinates for endpoints before you use them for other graphic objects, or use \xw{transform canvas}.
\end{itemize}


\subsubsection{\protect\cmd{\setxtshowarrows}: controlling \protect\cmd{\xtShowArrows}}

The macro \icmd{\setxtshowarrows} controls the color and shape of arrow tips.
You can even change the position of arrow tips by specifying the distance (\xw{1.2pt} by default) from the endpoint as the last parenthesis optional argument, like \xw{(5pt)}.

\xbigskip1
\begin{tcblisting}{listing only}
% \setxtshowarrows
% syntax: 
  \setxtshowarrows[<arrow opt>]{<arrow shape>}(<arrow end shorten dim>)
% defaults: []{>}(1.2pt)
\end{tcblisting}
\xbigskip1

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
% Example: \xtShowArrows, \xtHideArrows
\begin{istgame}
\setxtshowarrows{<|o|>}[blue,thick](5pt)
\xtShowArrows
\istroot(0)+15mm..30mm+  \istb[blue] \istb[red] \endist
\xtHideArrows
\istroot(1)(0-1)  \istb{a} \istb \endist
\xtHideArrows* % endpoints remain
\istroot(2)(0-2)  \istb{b} \istb \endist
\xtShowArrows[oval node]
\istroot(3)(1-2)  \istb{c} \istb \endist
\end{istgame}
\end{tcblisting}


\subsubsection{Arrows and continua of branches: examples (Not for most users)}

There is nothing special in using arrow tips in game trees having continua of branches.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\xtdistance{10mm}{20mm}
\xtShowArrows
\istrootcntm(0)(0,0){1}  \istb{x}[r]  \istbm  \endist
\istroot(1)(0-1)<[label distance=-3pt]120>{2}
  \istb{Y}[al]{x,1-x}    \istb{N}[ar]         \endist
\istrootcntm(2)(1-2){2}  \istb{y}[r]  \istbm  \endist
\istroot(3)(2-1)<[label distance=-3pt]120>{1}
  \istb[]{Y}[al]{1-y,y}  \istb{N}[ar]         \endist
\end{istgame}
\end{tcblisting}

\xbigskip1
It is not impossible to put arrow tips on the outermost branches of a continuum.
To do that, you can use \cmd{\cntmistb(*)} and \cmd{\cntmAistb(*)} together with the middle arrow tip styles and \cmd{\setxtarrowtips}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\xtdistance{10mm}{20mm}
\xtShowArrows
\setxtarrowtips<.97>
\cntmistb*[->-,draw]
\istrootcntm(0)(0,0){1}  \istb{x}[r]  \istbm  \endist
\istroot(1)(0-1)<[label distance=-3pt]120>{2}
  \istb{Y}[al]{x,1-x}    \istb{N}[ar]         \endist
\cntmistb*[->-,draw]
\istrootcntm(2)(1-2){2}  \istb{y}[r]  \istbm  \endist
\istroot(3)(2-1)<120>{1}
  \istb[]{Y}[al]{1-y,y}  \istb{N}[ar]         \endist
\end{istgame}
\end{tcblisting}

\xbigskip1
Here is one more example.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}
\cntmdistance*{8mm}{16mm}
\xtShowArrows
\xtShowEndPoints*[oval node]
\setxtarrowtips<.93>{>>}[red,thick]
\cntmAistb[->-]
\istrootcntmA(1)          \istbA[-x-] \endist
\istroot(A1)(1-1)  \istb  \istb  \endist
\cntmAistb[->-]
\istrootcntmA(2)(A1-2)    \istbA[-o-] \endist
\istroot(A2)(2-1)  \istb  \istb  \endist
\setxtarrowtips<.93>
\cntmAistb[->-]
\istrootcntmA(3)(A2-2)    \istbA[-x-] \endist
\istroot(A3)(3-1)  \istb  \istb  \endist
\cntmAistb[->-]
\istrootcntmA(4)(A3-2)    \istbA[-o-] \endist
\istroot(A4)(4-1)  \istb  \istb  \endist
\end{istgame}
\end{tcblisting}


\section{Supplementary macros}

\label{sec:suppmac}

\subsection{Supplementary macros to important labels}

\label{ssec:suppmac}

The \pkg{istgame} package also provides some supplementary macros to important labels: players, action labels, and payoffs. The supplementary macros work outside of simple trees.
%And the abbreviations of the position of labels are available for these supplemental macros.

\begin{description}\tightlist
\item \icmd{\xtOwner} puts the owner of a node (or a player), in text mode
\item \icmd{\xtOwner}* puts an owner in the input mode as set by \cmd{\setistmathTF(*)}\par
  syntax: \xw{\xtOwner(<coor>)\{<owner>\}[<pos>,<node opt>]}\par
  defaults: \verb+(<m>){}[above]+\par
  (abbreviations for \xw{<pos>} available)
  
\item \icmd{\xtActionLabel} puts an action label to a branch, in math mode
\item \icmd{\xtActionLabel*} puts an owner in the input mode as set by \cmd{\setistmathTF(*)}\par
  syntax: \xw{\xtActionLabel[<opt>](<from>)(<to>)\{<action>\}[<pos>,<node opt>]}\par
  defaults: \verb+[-,draw=none](<m>)(<m>){}[black,text depth=.25ex]+\par
  (abbreviations for \xw{<pos>} available)

\item \icmd{\xtPayoff} puts payoffs, in math mode
\item \icmd{\xtPayoff*} puts payoffs in the input mode as set by \cmd{\setistmathTF(*)}\par
  syntax: \xw{\xtPayoff(<coor>)\{<payoff>\}[<pos>,<node opt>]}\par
  defaults: \verb+(<m>){}[inner sep=0pt,outer sep=4pt,text depth=.25ex]+\par
  (abbreviations for \xw{<pos>} available)

\item \icmd{\xtInfosetOwner} puts the owner of an information set, in text mode
\item \icmd{\xtInfosetOwner*} puts an information set owner in the input mode as set by \cmd{\setistmathTF(*)}\par
  syntax: \xw{\xtInfosetOwner(<from>)(<to>)\{<owner>\}[<pos>,<node opt>]}\par
  defaults: \verb+(<m>)(<m>){}[]+\par
  (abbreviations for \xw{<pos>} available)

\item \icmd{\xtNode} puts `something,' say an owner, into a node\par
  syntax: \xw{\xtNode[<opt>](<coor>)[<node style>,<node opt>]\{<node text>\}}\par
  defaults: \verb+[-](<m>)[solid node]{}+

\item \icmd{\xtNode*} puts `something' into a \ixw{plain node}\par
  syntax: \xw{\xtNode*(<coor>)[<node style>,<node opt>]\{<node text>\}}\par
  defaults: \verb+(<m>)[plain node]{}+
\end{description}

%\xbigskip1
The supplementary macros depend on the coordinates defined 
in the sequence of \cmd{\istroot}--\cmd{\istb}--\cmd{\endist} 
and print their corresponding objects on or around the specified coordinates.
So, in the above supplementary macros, all the coordinates such as \xw{(<from>)}, \xw{(<to>)}, 
and \xw{(<coor>)} are mandatory arguments, denoted by \xw{<m>}.

\xbigskip1
\begin{tcblisting}{}
\begin{istgame}[scale=1.5]
\istroot(0)[chance node]
  \istb[dashed]{A}  \istb*
  \istb*[blue,very thick]{B}[right,xshift=2pt,yshift=2pt,red]  \endist
\xtInfosetO(0)(0)
\xtInfoset[thick](0-1)(0-2){1}
\xtInfosetO[thick,red,rounded corners=.5em](0-2)(0-3){2}
\xtInfoset[dashed,bend right=25](0-1)(0-3)
%-----------------
\xtActionLabel(0)(0-3){1-\epsilon}[below,sloped] % action label in math mode
\xtInfosetOwner(0-1)(0-3){3}[xshift=-25pt,yshift=-25pt]
\xtOwner(0){Nash}[xshift=-5pt,left]
\xtPayoff(0-3){(u_1,u_2)}[right,xshift=5pt] % payoffs in math mode
\xtNode[dotted](0-1)[box node,fill=blue!20]{Smith}
%-----------------
\istroot[east](a)(0)[chance node]  \istb \endist
\xtNode*(a-1){text}
\end{istgame}
\end{tcblisting}


To specify the \xw{[<pos>]} option for the above supplementary macros (other than \cmd{\xtNode}), 
you can use the \isw{abbreviations} 
\xw{[l]}, \xw{[r]}, \xw{[a]}, \xw{[b]}, \xw{[al]}, \xw{[ar]}, \xw{[bl]}, and \xw{[br]}.
Each of these abbreviations works only when used alone without any other option keys in the option list.
For example, the option \xw{[b]} or \xw{[below]} or \xw{[below,xshift=5pt]} works, but \xw{[b,xshift=5pt]} does not,  producing a compile error.

\subsection{More supplementary macros}

\subsubsection{\protect\cmd{\xtTimeLineH} and \protect\cmd{\xtTimeLineV}}

With the macro \icmd{\xtTimeLineH}, you can draw a horizontal time-line.

%\xbigskip1
\begin{tcblisting}{listing only}
% \xtTimeLineH (same logic for \xtTimeLineV)
% syntax:  %% if tree swapped, the following means -<from> -<to>
  \xtTimeLineH[<opt>](<coor>){<from>}{<to>}{<label>}[<pos>,<opt>]
% defaults: 
  [-,dotted,shorten <=0pt,shorten >=0pt](<m>){}{}[right]
\end{tcblisting}

For example, \verb+\xtTimeLineH(coor){-1.5}{3}+ draws a dotted (by default) horizontal time-line going through \xw{(coor)} from \xw{-1.5cm} to \xw{3cm} with a label on the \xw{right} (by default).
Recall that, by default, the root of a tree is located at \xw{(0,0)}. The two numbers determine the $x$-coordinates of a time-line. 
To change the position of the label, you can use the abbreviations, like \xw{[a]} or \xw{[ar]}.

The swap version \icmd{\xtTimeLineH'} simply puts the label on the other end of a time-line, \xw{left} by default.
That's the only difference to the normal version, \cmd{\xtTimeLineH}.

%\xbigskip1

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% Example: \xtTimeLineH('): not swapped
\begin{istgame}[font=\scriptsize]
\setistgrowdirection{south} % default
\xtdistance{10mm}{20mm}
\istrootcntm(1)       \istb \istbm \endist
\istroot(A1)(1-1)     \istb \istb  \endist
\istrootcntm(2)(A1-2) \istb \istbm \endist
\istroot(A2)(2-1)     \istb \istb  \endist
\istrootcntm(3)(A2-2) \istb \istbm \endist
\istroot(A3)(3-1)     \istb \istb  \endist
\xtTimeLineH[->](1){-1.5}{3}{period 1}
\xtTimeLineH(2){-1.5}{3}{period 2}
\xtTimeLineH'(3){-1.5}{3}{period 3}
\end{istgame}
\end{tcblisting}


\xbigskip1

\remark
The direction to which a time-line goes depends on whether a tree is swapped or not. 
\index{clockwise} \index{counterclockwise}
\begin{itemize}\tightlist
\item If branches are arranged \xw{counterclockwise} (by default), a time-line goes \emph{from left to right} or \emph{from below to above}. As to \cmd{\xtTimeLineH}, we take this as a standard case: \emph{left to right}.
\item If a tree is \emph{swapped}, so the branches are arranged \xw{clockwise}, \cmd{\xtTimeLineH} draws a line going to the opposite direction: \emph{from right to left} (for trees growing southwards). So, if a tree is swapped by \icmd{\setistgrowdirection}\xw{'}, for example, \verb+\xtTimeLine(coor){-1.5}{3}+ draws a time-line going the to the opposite direction: from \xw{1.5cm} to \xw{-3cm}.
\end{itemize}

The following codes are the same as the above, except that the tree is swapped.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% Example: \xtTimeLineH: swapped
\begin{istgame}[font=\scriptsize]
\setistgrowdirection'{south} % clockwise
\xtdistance{10mm}{20mm}
\istrootcntm(1)       \istb \istbm \endist
\istroot(A1)(1-1)     \istb \istb  \endist
\istrootcntm(2)(A1-2) \istb \istbm \endist
\istroot(A2)(2-1)     \istb \istb  \endist
\istrootcntm(3)(A2-2) \istb \istbm \endist
\istroot(A3)(3-1)     \istb \istb  \endist
\xtTimeLineH[->](1){-1.5}{3}{period 1}
\xtTimeLineH(2){-1.5}{3}{period 2}
\xtTimeLineH'(3){-1.5}{3}{period 3}
\end{istgame}
\end{tcblisting}
\xbigskip1

With the macro \icmd{\xtTimeLineV}, you can draw a vertical time-line with a label on the top right, by default.
As to \cmd{\xtTimeLineV}, we take a time-line going \emph{from above to below} as a standard case, because it is natural.
So, if a tree grows eastwards, the \emph{swapped tree} (arranging branches \emph{from above to below}) is taken as a standard case for \cmd{\xtTimeLineV}.

The swap version \icmd{\xtTimeLineV'} simply puts the label on the other side of a time-line.
That's the only difference to the normal version, \cmd{\xtTimeLineV}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% Example: \xtTimeLineV('): swapped
\begin{istgame}[font=\scriptsize]
\setistgrowdirection'{east} % clockwise
\xtdistance{10mm}{20mm}
\istrootcntm(1)       \istb \istbm \endist
\istroot(A1)(1-1)     \istb \istb  \endist
\istrootcntm(2)(A1-2) \istb \istbm \endist
\istroot(A2)(2-1)     \istb \istb  \endist
\istrootcntm(3)(A2-2) \istb \istbm \endist
\istroot(A3)(3-1)     \istb \istb  \endist
\xtTimeLineV[->](1){1.5}{-3}{period 1}
\xtTimeLineV(2){1.5}{-3}{period 2}
\xtTimeLineV'(3){1.5}{-3}{period 3}
\end{istgame}
\end{tcblisting}
\xbigskip1

The following codes are the same as the above, except that the tree is \emph{not} swapped.
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
\begin{istgame}[font=\scriptsize]
\setistgrowdirection{east} % counterclockwise
\xtdistance{10mm}{20mm}
\istrootcntm(1)       \istb \istbm \endist
\istroot(A1)(1-1)     \istb \istb  \endist
\istrootcntm(2)(A1-2) \istb \istbm \endist
\istroot(A2)(2-1)     \istb \istb  \endist
\istrootcntm(3)(A2-2) \istb \istbm \endist
\istroot(A3)(3-1)     \istb \istb  \endist
\xtTimeLineV[->](1){1.5}{-3}{period 1}
\xtTimeLineV(2){1.5}{-3}{period 2}
\xtTimeLineV'(3){1.5}{-3}{period 3}
\end{istgame}
\end{tcblisting}
\xbigskip1

In the example above, since the tree is not swapped, \verb+\xtTimeLineV(coor){1.5}{-3}+ draws a vertical time-line going to the opposite direction: from \xw{-1.5cm} to \xw{3cm}.

%Here is one more example of using \cmd{\xtTimeLineH}.
%
%\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
%% Example: \xtTimeLineH
%\begin{istgame}[font=\scriptsize]
%\xtShowMidArrows
%\xtdistance{10mm}{20mm}
%\istrootcntm(1){1} % period 1
%  \istb{x}[r] \istbm \endist
%\istroot(A1)(1-1)
%    <[label distance=-3pt]135>{2}
%  \istb{A}[al]{x,1-x} \istb{R}[ar] \endist
%\istrootcntm(2)(A1-2){2} % period 2
%  \istb{y}[r] \istbm \endist
%\istroot(A2)(2-1)
%    <[label distance=-3pt]135>{1}
%  \istb{A}[al]{1-y,y} \istb{R}[ar] \endist
%\istrootcntm(3)(A2-2){1} % period 3
%  \istb{x}[r] \istbm \endist
%\istroot(A3)(3-1)
%    <[label distance=-3pt]135>{2}
%  \istb{A}[al]{x,1-x}\istb{R}[ar]{0,0}\endist
%\xtTimeLineH[draw=none](1){-2}{3}{period 1}[l]
%\xtTimeLineH[draw=none](2){-2}{3}{period 2}
%\xtTimeLineH[draw=none](3){-2}{3}{period 3}
%\xtTimeLineH[draw=none](A2-1){2.5}{-2.5}
%  {$\left(\makecell{\delta\\\delta}
%    \right)\cdots$}[yshift=-.8em]
%\xtTimeLineH[draw=none](A3-1){2.5}{-2.5}
%  {$\left(\makecell{\delta^2\\\delta^2}
%    \right)\cdots$}[yshift=-.8em]
%\end{istgame}
%\end{tcblisting}
%\xbigskip1


\subsubsection{\protect\cmd{\xtCommentTo} and \protect\cmd{\xtCommentFrom}}

With the macro \icmd{\xtCommentTo}, you can attach a comment to a node from a coordinate \emph{relative} to the node with a densely dotted arrow line (by default).
Note that with \cmd{\xtCommentTo} you need to specify a \emph{target absolute} coordinate followed by a \emph{start \textbf{relative}} coordinate.

%\xbigskip1
\begin{tcblisting}{listing only}
% \xtCommentTo
% syntax: 
  \xtCommentTo[<line opt>](<absolute to-coor>)(<relative from-coor>){<comment>}
              [<pos>,<node opt>](<end-shorten dim>)
% defaults: 
  [densely dotted,->,>=stealth,shorten >=1pt](<m>)(<m>){}[above](1pt)
\end{tcblisting}
\xbigskip1

The last parenthesis option if for shortening arrow end.
You can use the abbreviations of the directional words, but not with other options in the option list.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \xtCommentTo
\begin{istgame}[->,scale=.7]
\xtShowEndPoints
\istroot(0)+15mm..30mm+       \istb \istb \endist
\istroot(1)(0-1)              \istb \istb \endist
\istroot(2)(0-2)[chance node] \istb \istb \endist
\xtCommentTo[bend right](0)(150:2){Alice moves}[l]
\xtCommentTo[bend right](1)(150:2){Ben moves}
\xtCommentTo[bend left](2)(0,2){Nature moves}[a](5pt)
\end{istgame}
\end{tcblisting}
\xbigskip1

The macro \icmd{\xtCommentFrom} enables you to attach a comment to one or more nodes from an \emph{absolute} coordinate with a densely dotted arrow line.
Note that with \cmd{\xtCommentFrom} you need to specify a \emph{start absolute} coordinate followed by a \emph{target absolute} coordinate.
The last parenthesis option if for shortening arrow end.
You can use the abbreviations of the directional words.

%\xbigskip1
\begin{tcblisting}{listing only}
% \xtCommentFrom
% syntax: 
  \xtCommentFrom[<line opt>](<from>)(<to>){<comment>}[<pos>,<node opt>]<arrow end shorten>
% defaults: 
  [densely dotted,->,>=stealth,shorten >=1pt](<m>)(<m>){}[above](1pt)
\end{tcblisting}


\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
% Example: \xtCommentFrom
\begin{istgame}[scale=.6]
\xtShowEndPoints
\istroot(0)+15mm..30mm+
  \istb \istb \endist
\istroot(1)(0-1)
  \istb \istb \endist
\istroot(2)(0-2)[chance node]
  \istb \istb \endist
\xtCommentFrom[bend right](-3,2)(0){decision nodes}
\xtCommentFrom[bend right](-3,2)(1)
\xtCommentFrom[bend right,solid,blue](-3,2)(2)
\xtCommentFrom[bend right](-3,-5)(1-1)
              {terminal nodes}[b]
\xtCommentFrom[bend right](-3,-5)(1-2)
\xtCommentFrom[bend right](-3,-5)(2-1)
\xtCommentFrom[bend right](-3,-5)(2-2)(5pt)
\end{istgame}
\end{tcblisting}

%\subsubsection{To show and hide end-points and terminal nodes}
%
%With the macro \icmd{\xtShowEndPoints}, you can control the node shape of every endpoint of every simple tree, all at once.
%(For more details, see page~\pageref{page:endpoint}.)
%
%\icmd{\xtHideEndPoints} turns off the effect of \cmd{\xtShowEndPoints}.
%
%\begin{tcblisting}{listing only}
%syntax: \xtShowEndPoints[<node style>]
%syntax: \xtHideEndPoints
%\end{tcblisting}
%
%
%The macro \icmd{\xtShowTerminalNodes} works only with \cmd{\istbt}\@ and \cmd{\istBt} to control the node shape of terminal nodes, all at once.
%(For more details, see page~\pageref{page:terminalnode}.)
%
%\icmd{\xtHideTerminalNodes} turns off the effect of \cmd{\xtShowTerminalNodes}.
%
%\begin{tcblisting}{listing only}
%syntax: \xtShowTerminalNodes[<node style>] % work only with \istbt and \istBt
%syntax: \xtHideTerminalNodes
%\end{tcblisting}

\section{Representing subgames}

Here is an example of a whole game tree.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth,breakable}
\begin{istgame}
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb{A}[a]{(2,2)}[l]           \istb{D}[r]  \endist 
\istroot(1)(0-2)<135>{1}
                   \istb{L}[al]  \istb{R}[ar]  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}  \istb{r}[ar]{(1,1)}  \endist 
\istroot(3)(1-2)<45>{2}
  \istb{\ell}[al]{(3,2)}  \istb{r}[ar]{(0,3)}  \endist 
\end{istgame}
\end{tcblisting}

\subsection{\protect\cmd{\xtSubgameBox} (experimental)}

\subsubsection{\protect\cmd{\xtSubgameBox}}

\icmd{\xtSubgameBox} is for indicating a \ixsw{subgame} by a box (or a rectangle) with rounded corners.

\begin{tcblisting}{listing only}
% \xtSubgameBox(*)
% syntax:
  \xtSubgame(*)(<subroot coor>){(<coor1>) (<coor2>) ... }[<opt>]
% options:
  *: filled box
  (<subroot coor>): the subroot of a subgame (mandatory)
  {(coor1) (coor2) ...}: coordinates of terminal nodes (mandatory)
  [<opt>]: color, line style
% defaults:
  (<m>){}[rectangle,dashed,inner sep=20pt,rounded corners=15pt,black!50]
  *(<m>){}[rectangle,inner sep=20pt,rounded corners=15pt,red!20]
\end{tcblisting}

\xbigskip1
The subgame box embraces the subroot indicated in parentheses and terminal nodes specified within curly braces.
The coordinates of terminal nodes are listed in curly braces without delimiters (spaces are allowed).
The default options for the subgame box are \xw{dashed}, \xw{inner sep=20pt}, \xw{rounded corners=15pt}, and \xw{black!50}.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth,breakable}
% subgame: rectangle
\begin{istgame}
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb{A}[a]{(2,2)}[l]           \istb{D}[r]  \endist 
\istroot(1)(0-2)<135>{1}
                   \istb{L}[al]  \istb{R}[ar]  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}  \istb{r}[ar]{(1,1)}  \endist 
\istroot(3)(1-2)<45>{2}
  \istb{\ell}[al]{(3,2)}  \istb{r}[ar]{(0,3)}  \endist 
\xtSubgameBox(1){(2-1)(3-2)}
\xtSubgameBox(2){(2-1)(2-2)}[solid,blue]
\end{istgame}
\end{tcblisting}

You can change the size of the box in two ways.
First, you can change it by using \xw{inner sep}, \xw{inner xsep}, or \xw{inner ysep}. Secondly, you can shift the subroot, like \xw{([xshift=5pt]1)} when the subroot is \xw{(1)}.
Of course, you can do the both at the same time.

% subgame: rectangle (inner sep,yshift)
\begin{tcblisting}{listing outside text, righthand width=.3\linewidth,breakable}
\begin{istgame}
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
           \istb{A}[a]{(2,2)}[l]  \istb{D}[r]  \endist 
\istroot(1)(0-2)<135>{1}
                   \istb{L}[al]  \istb{R}[ar]  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}  \istb{r}[ar]{(1,1)}  \endist 
\istroot(3)(1-2)<45>{2}
  \istb{\ell}[al]{(3,2)}  \istb{r}[ar]{(0,3)}  \endist 
\xtSubgameBox(1){(2-1)(3-2)}
\xtSubgameBox([yshift=5pt]2){(2-1)(2-2)}%
    [solid,blue,inner sep=10pt]
\end{istgame}
\end{tcblisting}


\subsubsection{\protect\cmd{\xtSubgameBox*}}

The starred version \icmd{\xtSubgameBox*} produces a subgame box with background color (by default \xw{red!20}).
In the following example, where the tree grows east, the size of the filled subgame box is adjusted by manipulating \xw{inner sep} and \xw{xshift}.

\begin{tcblisting}{listing outside text, righthand width=.3\linewidth,breakable}
% subgame: rectangle*
\begin{istgame}
\setistgrowdirection'{east}
\xtdistance{15mm}{30mm}
\istroot[45](0)[initial node]<180>{1}
          \istb{A}[l]{(2,2)}[a]  \istb{D}[b]   \endist 
\istroot(1)(0-2)<135>{1}
                   \istb{L}[al]  \istb{R}[bl]  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}  \istb{r}[bl]{(1,1)}  \endist 
\istroot(3)(1-2)<-135>{2}
  \istb{\ell}[al]{(3,2)}  \istb{r}[bl]{(0,3)}  \endist 
\xtSubgameBox*([xshift=20pt]1){(2-1)(3-2)}%
    [inner xsep=30pt]
\end{istgame}
\end{tcblisting}


\subsection{\protect\cmd{\xtSubgameOval} and \protect\cmd{\xtSubgameOval*} (experimental)}

\icmd{\xtSubgameOval} and \icmd{\xtSubgameOval*} are also provided.

\begin{tcblisting}{listing only}
% \xtSubgameOval(*)
% syntax:
  \xtSubgameOval(*)(<subroot coor>){(<coor1>) (<coor2>) ... }[<opt>]
% options:
  *: filled box
  (<subroot coor>): the subroot of a subgame (mandatory)
  {(coor1) (coor2) ...}: coordinates of terminal nodes (mandatory)
  [<opt>]: color, line style
% defaults:
  (<m>){}[ellipse,dashed,inner sep=20pt,rounded corners=15pt,black!50]
  *(<m>){}[ellipse,inner sep=20pt,rounded corners=15pt,red!20]
\end{tcblisting}


%\begin{tcblisting}{listing only}
%% \xtSubgameOval(*)
%% syntax:
%   \xtSubgame(*)(<subroot coor>){(<coor1>) (<coor2>) ... }[<opt>]
%%% \xtSubgameOval: definition
%\def\xtdefaultsubrootshiftoval{0,-.7}
%\DeclareDocumentCommand\xtSubgameOval{ s r() m O{}}
%{ \IfBooleanTF #1
%  {
%  \coordinate (xtsubroot) at ($(#2)+(\xtdefaultsubrootshiftoval)$);
%  \begin{scope}[on background layer]
%    \node [ellipse,fill=red!20,inner sep=15pt,#4] 
%              [fit=(xtsubroot) #3] {};
%  \end{scope}
%  }
%  {
%  \coordinate (xtsubroot) at ($(#2)+(0,-.7)$);
%  \begin{scope}[on background layer]
%  \node [ellipse,draw,dashed,inner sep=15pt,black!50,#4] 
%            [fit=(xtsubroot) #3] {};
%  \end{scope}
%  }
%}
%\end{tcblisting}

\cmd{\xtSubgameOval(*)} works just like \cmd{\xtSubgameBox(*)}, except for one thing: an oval instead of a rectangle.
\cmd{\xtSubgameOval} draws an oval (or an ellipse) to represent a subgame, and \cmd{\xtSubgameOval*} draws a filled oval with \xw{red!20} by default.


\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% subgame: ellipse
\begin{istgame}
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb{A}[a]{(2,2)}[l]
  \istb{D}[r]
  \endist 
\istroot(1)(0-2)<135>{1}
  \istb{L}[al]
  \istb{R}[ar]
  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}
  \istb{r}[ar]{(1,1)}
  \endist 
\istroot(3)(1-2)<45>{2}
  \istb{\ell}[al]{(3,2)}
  \istb{r}[ar]{(0,3)}
  \endist 
\xtSubgameOval(1){(2-1)(3-2)}
\xtSubgameOval(2){(2-1)(2-2)}
\end{istgame}
\end{tcblisting}
\xbigskip1

The way of changing the size of the subgame oval is the same as with \cmd{\xtSubgameBox}: first, changing inner sep, and secondly, shifting the subroot.
In the example below, the options \xw{inner xsep=25pt} and \xw{([xshift=30pt]1)} are used to change the size of the subgame oval. Its color is changed by \xw{blue!20}.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% subgame: ellipse*
\begin{istgame}
\setistgrowdirection'{east}
\xtdistance{15mm}{30mm}
\istroot[45](0)[initial node]<180>{1}
  \istb{A}[l]{(2,2)}[a]
  \istb{D}[b]
  \endist 
\istroot(1)(0-2)<135>{1}
  \istb{L}[al]
  \istb{R}[bl]
  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}
  \istb{r}[bl]{(1,1)}
  \endist 
\istroot(3)(1-2)<-135>{2}
  \istb{\ell}[al]{(3,2)}
  \istb{r}[bl]{(0,3)}
  \endist 
\xtSubgameOval*([xshift=30pt]1){(2-1)(3-2)}%
    [inner xsep=25pt,blue!20]
\end{istgame}
\end{tcblisting}

\subsection{\protect\cmd{\setxtsubgamelayer}}

You can change the shape of a subgame representation to other shapes such as \xw{semicircle} and \xw{circle} or even \xw{star}. You will need to change the size of the shape by using \xw{inner sep} and by shifting the subroot to get the result you want.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% subgame: half circle
\begin{istgame}
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb{A}[a]{(2,2)}[l]
  \istb{D}[r]   \endist 
\istroot(1)(0-2)<135>{1}
  \istb{L}[al]
  \istb{R}[ar]  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}
  \istb{r}[ar]{(1,1)}
  \endist 
\istroot(3)(1-2)<45>{2}
  \istb{\ell}[al]{(3,2)}
  \istb{r}[ar]{(0,3)}
  \endist 
\xtSubgameBox([yshift=-2cm]1){(2-1)(3-2)}%
    [semicircle,inner sep=15pt]
\end{istgame}
\end{tcblisting}


%\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
%% subgame: half circle*
%\begin{istgame}
%\setistgrowdirection'{east}
%\xtdistance{15mm}{30mm}
%\istroot[45](0)[initial node]<180>{1}
%  \istb{A}[l]{(2,2)}[a]
%  \istb{D}[b]
%  \endist 
%\istroot(1)(0-2)<135>{1}
%  \istb{L}[al]
%  \istb{R}[bl]
%  \endist 
%\xtdistance{10mm}{20mm}
%\istroot(2)(1-1)<135>{2}
%  \istb{\ell}[al]{(4,2)}
%  \istb{r}[bl]{(1,1)}
%  \endist 
%\istroot(3)(1-2)<-135>{2}
%  \istb{\ell}[al]{(3,2)}
%  \istb{r}[bl]{(0,3)}
%  \endist 
%\xtSubgameBox*([xshift=2cm]1){(2-1)(3-2)}%
%    [semicircle,rotate=90,inner sep=0pt]
%\end{istgame}
%\end{tcblisting}

Here are more examples showing how to draw a rectangle and circles to represent subgames.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% subgame: rectangle*
\begin{istgame}
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb{A}[a]{(2,2)}[l]
  \istb{D}[r]   \endist 
\istroot(1)(0-2)<135>{1}
  \istb{L}[al]
  \istb{R}[ar]  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}
  \istb{r}[ar]{(1,1)}
  \endist 
\istroot(3)(1-2)<45>{2}
  \istb{\ell}[al]{(3,2)}
  \istb{r}[ar]{(0,3)}
  \endist 
\xtSubgameBox*(1){(2-1)(3-2)}
\xtSubgameOval*(2){(2-1)(2-2)}%
  [circle,blue!20,inner xsep=9pt]
\xtSubgameOval(3){(3-1)(3-2)}%
  [circle,inner xsep=9pt]
\end{istgame}
\end{tcblisting}


You can use \icmd{\setxtsubgamelayer} to change the \isw{layer} of a subgame from \xw{background} to \xw{behind}, \xw{main}, \xw{above}, or \xw{foreground}, in that order. In order to go back to the default layer, you can just declare \cmd{\setxtsubgamelayer} or do \cmd{\setxtsubgamelayer\{\}}.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% subgame: \setxtsubgamelayer
\begin{istgame}
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb{A}[a]{(2,2)}[l]
  \istb{D}[r]   \endist 
\istroot(1)(0-2)<135>{1}
  \istb{L}[al]
  \istb{R}[ar]  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}
  \istb{r}[ar]{(1,1)}
  \endist 
\istroot(3)(1-2)<45>{2}
  \istb{\ell}[al]{(3,2)}
  \istb{r}[ar]{(0,3)}
  \endist 
\setxtsubgamelayer{behind}
\xtSubgameOval*(2){(2-1)(2-2)}%
  [circle,blue!80,inner xsep=9pt,opacity=.25]
\setxtsubgamelayer % restore defaults
\xtSubgameBox*(1){(2-1)(3-2)}
\xtSubgameOval(3){(3-1)(3-2)}%
  [circle,inner xsep=9pt]
\end{istgame}
\end{tcblisting}


\section{Miscellany}

\subsection{Various branch types, directions, and lengths} 

Here is an example of how to deal with various line types, directions, and lengths of branches.
You can do this using \cmd{\istbA} (see Section~\ref{sec:istbA}, for more details).
\xbigskip1
\begin{tcblisting}{breakable}
\begin{istgame}
\istroot(0)[chance node]<[blue]>{N}+10mm..30mm+
  \istb[->,shorten >=.8pt]{p}[above left,red]
  \istb[->,shorten >=.8pt]{1-p}[ar]  \endist
\istroot(1)(0-1)+15mm..30mm+
  \istb<level distance=7mm,sibling distance=14mm>{L}[al]
  \istb*[->>>]{R}[ar]  \endist
\istroot(2)(0-2)+10mm..15mm+
  \istb[->,dashed]{A}
  \istbA(2.5)<grow=30>[red]{a}[al]{(1,-1)}[[blue]right]
  \istb*<grow=-45>[blue,text=red,thick]{b}[ar]{(u_1,u_2)}[[green]-90]  \endist
\end{istgame}
\end{tcblisting}


\subsection{Code reuse}

\subsubsection{Drawing subgames}

Suppose that you have the following tree as a whole game.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% Example: a whole game
\begin{istgame}
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb{A}[a]{(2,2)}[l]
  \istb{D}[r]
  \endist 
\istroot(1)(0-2)<left>{1}
  \istb{L}[al]
  \istb{R}[ar]
  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}
  \istb{r}[ar]{(1,1)}
  \endist 
\istroot(3)(1-2)<45>{2}
  \istb{\ell}[al]{(3,2)}
  \istb{r}[ar]{(0,3)}
  \endist 
\end{istgame}
\end{tcblisting}

It is easy to draw a subgame if you use the existing codes for a whole game.
To get a subgame, just comment out the codes for the rest of the subgame.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% Example: a subgame
\begin{istgame}
\xtdistance{15mm}{30mm}
%\istroot[-135](0)[initial node]<0>{1}
%  \istb{A}[a]{(2,2)}[l]
%  \istb{D}[r]
%\endist 
\istroot(1)(0-2)<left>{1}
  \istb{L}[al]
  \istb{R}[ar]
  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}
  \istb{r}[ar]{(1,1)}
  \endist 
\istroot(3)(1-2)<45>{2}
  \istb{\ell}[al]{(3,2)}
  \istb{r}[ar]{(0,3)}
  \endist 
\end{istgame}
\end{tcblisting}

\xbigskip1
\remark If you copy and paste the previous codes alone and try to complie to get a subgame, you will get an error message: 

\verb+! Package pgf Error: No shape named 0-2 is known.+

\noindent 
This is because the first active \cmd{\istroot} refers to the undefined coordinate \xw(0-2). In this case you need to change the line as:

\verb+\istroot(1)(0,0)<left>{1}+

\noindent
However, if you have the codes for a whole game before the codes with some lines commented out for a subgame, you will not get the error message when you compile the file (because the coordinate \xw{(0-2)} is already defined in the whole game). 
Therefore, most of the time you will not get the error message by commenting out some lines to get a subgame.

\xbigskip1

A smaller subgame is also easy to get by commenting out the rest of the subgame you want.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% Example: a smaller subgame
\begin{istgame}
%\xtdistance{15mm}{30mm}
%\istroot[-135](0)[initial node]<0>{1}
%  \istb{A}[a]{(2,2)}[l]
%  \istb{D}[r]
%\endist 
%\istroot(1)(0-2)<left>{1}
%  \istb{L}[al]
%  \istb{R}[ar]
%\endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}
  \istb{r}[ar]{(1,1)}
  \endist 
%\istroot(3)(1-2)<45>{2}
%  \istb{\ell}[al]{(3,2)}
%  \istb{r}[ar]{(0,3)}
%\endist 
\end{istgame}
\end{tcblisting}

\xbigskip1
It is not possible to make a subgame stay put where it appears in a whole game. 
(Replace \xw{[black!5]} by \xw{[white]} to make the rest of the game disappear in the example below.)

\xbigskip1

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% Example: a subgame stays put
\begin{istgame}
\setistDecisionNodeStyle[black!5]
\xtdistance{15mm}{30mm}
\istroot[-135](0)%[initial node]<0>{1}
  \istb[black!5]%{A}[a]{(2,2)}[l]
  \istb[black!5]%{D}[r]
  \endist 
\istroot(1)(0-2)%<left>{1}
  \istb[black!5]%{L}[al]
  \istb[black!5]%{R}[ar]
  \endist 
\setistDecisionNodeStyle
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb{\ell}[al]{(4,2)}
  \istb{r}[ar]{(1,1)}
  \endist 
\setistDecisionNodeStyle[black!5]
\istroot(3)(1-2)%<45>{2}
  \istb[black!5]%{\ell}[al]{(3,2)}
  \istb[black!5]%{r}[ar]{(0,3)}
  \endist 
\end{istgame}
\end{tcblisting}


\subsubsection{Backward induction}

It is also easy to illustrate the procedure of \isw{backward induction}, when you analyze an extensive game.

\xbigskip1

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
\begin{istgame}[>=stealth]
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb[dashed]{A}[a]{(2,2)}[l]
  \istb[very thick]{D}[r]
\endist 
\istroot(1)(0-2)<left>{1}
  \istb[very thick]{L}[al]
  \istb<dashed>{R}[ar]
\endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb[->,very thick,blue]{\ell}[al]{(4,2)}
  \istb[thick,dotted]{r}[ar]{(1,1)}
\endist 
\istroot(3)(1-2)<45>{2}
  \istb[thick,dotted]{\ell}[al]{(3,2)}
  \istb[very thick,blue]{r}[ar]{(0,3)}
\endist 
\end{istgame}
\end{tcblisting}
\xbigskip1

By using \cmd{\istb} with options for the middle arrow tips, you can effectively express the backward induction procedure.
The command \cmd{\setxtarrowtips} controls the style of arrow tips and just declaring \cmd{\setxtarrowtips} followed by nothing restores defaults for the middle arrow tips styles. See Section~\ref{sec:arrows}, for more details.
change the color and the style of a line representing a branch and an arrow tip to it.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% Example: backward induction
\begin{istgame}
\setxtarrowtips[red,very thick,shorten >=-2pt,shorten <=-2pt]
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb[-x-,dashed,blue]{A}[a]{(2,2)}[l]
  \istb[-o-,very thick]{D}[r]
  \endist 
\istroot(1)(0-2)<left>{1}
  \istb[very thick]{L}[al]
  \istb[dashed,-x-]{R}[ar]
  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb[->>>-,very thick,draw=blue]{\ell}[al]{(4,2)}
  \istb[-x-,thick,dotted]{r}[ar]{(1,1)}
  \endist 
\setxtarrowtips % restore defaults
\istroot(3)(1-2)<45>{2}
  \istb[-x-,thick,dotted]{\ell}[al]{(3,2)}
  \istb[->-,draw=blue]{r}[ar]{(0,3)}
  \endist 
\end{istgame}
\end{tcblisting}


%\clearpage
\subsubsection{Code reusability}

Chen(2013)'s work is good to understand how drawing a game tree with \TikZ\ works.

\begin{tcblisting}{listing above text}
% Chen (2013)
\begin{tikzpicture}[scale=1,font=\footnotesize]
\tikzstyle{solid node}=[circle,draw,inner sep=1.5,fill=black]
\tikzstyle{hollow node}=[circle,draw,inner sep=1.5]
\tikzstyle{level 1}=[level distance=15mm,sibling distance=3.5cm]
\tikzstyle{level 2}=[level distance=15mm,sibling distance=1.5cm]
\tikzstyle{level 3}=[level distance=15mm,sibling distance=1cm]
\node(0)[solid node,label=above:{$P1$}]{}
child{node[solid node,label=above left:{$P2$}]{}
child{node[hollow node,label=below:{$(1,2)$}]{} edge from parent node[left]{$C$}}
child{node[hollow node,label=below:{$(1,-1)$}]{} edge from parent node[left]{$D$}}
child{node[hollow node,label=below:{$(0,2)$}]{} edge from parent node[right]{$E$}}
edge from parent node[left,xshift=-5]{$A$}
}
child{node[solid node,label=above right:{$P2$}]{}
child{node[hollow node,label=below:{$(2,2)$}]{} edge from parent node[left]{$F$}}
child{node[hollow node,label=below:{$(1,3)$}]{} edge from parent node[right]{$G$}}
edge from parent node[right,xshift=5]{$B$}
};
\end{tikzpicture}
\end{tcblisting}

%\xbigskip1

You can get a quite similar (actually the same) result by using the \pkg{istgame} package.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% istgame
\begin{istgame}[scale=1,font=\footnotesize]
\setistDecisionNodeStyle{4pt}
\xtdistance{15mm}{3.5cm}
\istroot(0){$P1$}
  \istb{A}[al]
  \istb{B}[ar]
  \endist
\xtShowEndPoints[oval node]
\xtdistance{15mm}{1.5cm}
\istroot(1)(0-1)<135>{$P2$}
  \istb{C}[l]{(1,2)}
  \istb{D}[l]{(1,-1)}
  \istb{E}[r]{(0,2)}
  \endist
\istroot(2)(0-2)<45>{$P2$}
  \istb{F}[l]{(2,2)}
  \istb{G}[r]{(1,3)}
  \endist
\end{istgame}
\end{tcblisting}


The \pkg{istgame} package enhances simplicity and readability, and hence it is easy to reuse codes. You can easily read and modify game tree codes even if you go over them after a while.

%\clearpage
\section{Game tree examples}

This section provides some examples of extensive games.
Before we start, let us change the default font size of the \env{istgame} environment by stating
\cmd{\setistgamefontsize\{\cmd{\footnotesize\}}} outside of the environment. (Right here!)

\setistgamefontsize{\footnotesize}

\subsection{Simple examples}

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth,breakable}
\begin{istgame}[->,shorten >=1.3pt]
\setistmathTF*001
\xtdistance{15mm}{30mm}
\istroot(0)[initial node]{Child}
  \istb{Good}[above left]{(0,2)}
  \istb{Bad}[above right]
  \endist
\istroot(1)(0-2)<30>{Parent}
  \istb{Forgive}[above left]{(1,1)}
  \istb{Punish}[above right]{(-1,-1)}
  \endist 
\end{istgame}
\end{tcblisting}

\medskip 

%\begin{tcblisting}{listing outside text, righthand width=.35\linewidth,breakable}
%% sloped action labels
%\begin{istgame}[->]
%\setistmathTF*001 % action labels in italics
%\xtShowEndPoints
%\xtdistance{15mm}{30mm}
%\istroot(0)[initial node]{Child}
%  \istb{Good}[above,sloped]{(0,2)}
%  \istb{Bad}[above,sloped]
%  \endist
%\istroot(1)(0-2)<30>{Parent}
%  \istb{Forgive}[above,sloped]{(1,1)}
%  \istb{Punish}[above,sloped]{(-1,-1)}
%  \endist 
%\end{istgame}
%\end{tcblisting}
%
%\medskip 

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth,breakable}
% dual sloped action labels (\istB)
\begin{istgame}
\setistmathTF*001 % action labels in italics
\xtShowArrows
\xtdistance{15mm}{30mm}
\istroot(0)[initial node]{Child}
  \istB{Good}[above,sloped]
       {$p$}[below, sloped]{(0,2)}
  \istB{Bad}[above,sloped]
       {$1-p$}[below, sloped]
  \endist
\istroot(1)(0-2)<30>{Parent}
  \istB{Forgive}[above,sloped]
       {$q$}[below, sloped]{(1,1)}
  \istB{Punish}[above,sloped]
       {$1-q$}[below, sloped]{(-1,-1)}
  \endist 
\end{istgame}
\end{tcblisting}

\medskip 

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
% IGT 218.1 (Osborne, 2004b)
\begin{istgame}[font=\normalsize]
\xtdistance{10mm}{20mm}
  \istroot(0){Vote}
  \istb{a}[al]{x}
  \istb{b}[ar]
  \endist
\istroot(1)([yshift=-1.5em]0-2){Vote}
  \istb{c}[al]{y}
  \istb{d}[ar]{z}
  \endist
\end{istgame}
\end{tcblisting}

\medskip

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
% information set
\begin{istgame}
\xtdistance{10mm}{30mm}
\istroot(0){1}
  \istb{L}[al]   \istb{R}[ar] 
  \endist
\xtdistance{7mm}{15mm}
\istroot(1a)(0-1)
  \istb{a}[al]{1,0} 
  \istb{b}[ar]{2,3}  
  \endist
\istroot(1b)(0-2)
  \istb{c}[al]{0,1}   \istb{d}[ar]{-1,0} 
  \endist
\xtInfoset(1a)(1b){2}
\end{istgame}
\end{tcblisting}

\medskip

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
% information set
\begin{istgame}
\xtShowEndPoints[oval node]
\xtdistance{10mm}{30mm}
\istroot(0){1}
  \istb{L}[al]   \istb{R}[ar] 
  \endist
\xtdistance{7mm}{15mm}
\istroot(1a)(0-1)
  \istb{a}[al]{1,0}   \istb{b}[ar]{2,3}  
  \endist
\istroot(1b)(0-2)
  \istb{c}[al]{0,1}   \istb{d}[ar]{-1,0} 
  \endist
\xtInfoset[bend left=30](1a)(1b){2}
\end{istgame}
\end{tcblisting}

\medskip 

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth,breakable}
% (oval) information set
\begin{istgame}
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb{A}[a]{(2,2)}[l]  \istb{D}[r]  
  \endist 
\istroot(1)(0-2)<left>{1}
  \istb{L}[al]    \istb{R}[ar]  
  \endist 
\xtInfosetO(1-1)(1-2){2}
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)
  \istb{\ell}[al]{(4,2)}  \istb{r}[ar]{(1,1)}
  \endist 
\istroot(3)(1-2)
  \istb{\ell}[al]{(3,2)}  \istb{r}[ar]{(0,3)}
  \endist 
\end{istgame}
\end{tcblisting}


\clearpage
\subsection{A game tree with a strategic game}

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
%\usepackage{tabu}
%\NewExpandableDocumentCommand\xcol{mO{c|}m}
%  {\multicolumn{#1}{#2}{\ensuremath{#3}}}
\def\strategicgame{
\begin{tabular}  {c|c|c|} % to 3cm
\xcol1[c]{~} & \xcol1[c]{$B$} & \xcol1[c]{$S$} \\\cline{2-3}
$B$   & $3,1$     & $0,0$    \\\cline{2-3}
$S$   & $0,0$     & $1,3$    \\\cline{2-3}
\end{tabular}
}
  \begin{istgame}
\setistmathTF*001
\xtdistance{10mm}{40mm}
\istroot(0)[initial node]{1}
  \istb{Book}[al]{2,2}
  \istb{Concert}[ar]
  \endist
\xtPayoff(0-2){\strategicgame}[below,xshift=-7pt]
\end{istgame}
\end{tcblisting}


%\clearpage
\subsection{Larger game trees with information sets}

\begin{tcblisting}{}
\begin{istgame}
\xtShowEndPoints
\xtdistance{10mm}{40mm}
\istroot(0)[initial node]{1}  \istb  \istb  \istb  \endist
\xtdistance{10mm}{10mm}
\istroot(1)(0-1)              \istb  \istb  \istb  \endist
\istroot(2)(0-2)              \istb  \istb  \istb  \endist
\xtdistance{10mm}{20mm}
\istroot(3)(0-3)              \istb  \istb  \endist
\xtdistance{10mm}{7mm}
\istroot(a)(1-3){3}           \istb  \istb  \istb  \endist
\xtdistance{10mm}{14mm}
\istroot(b)(2-3)              \istb  \istb  \endist
\istroot(c)(3-1){2}           \istb  \istb  \endist
\istroot(d)(3-2){2}           \istb  \istb  \endist
\xtInfosetO[fill=red!20](0)(0)
\xtInfoset(1)(2){2} 
\xtCInfosetO[fill=blue!20](a)(a)
\setxtinfosetstyle{blue,thick,dashed}
\xtInfosetO(b)(3){3}
\setxtinfosetstyle % restore defaults
\xtCInfosetO(d)(d)
\end{istgame}
\end{tcblisting}


\begin{tcblisting}{}
\begin{istgame}[scale=1]
\useasboundingbox (-7,-3) rectangle (7,.5);
\xtdistance{10mm}{40mm}
\istroot(0)[initial node]{1}  \istb  \istb  \istb  \istb \endist
\xtdistance{10mm}{10mm}
\istroot(1)(0-1)     \istb  \istb  \istb  \endist
\istroot(2)(0-2)  \istb  \istb  \istb  \endist
\xtdistance{10mm}{20mm}
\istroot(3)(0-3)  \istb  \istb  \endist
\istroot(4)(0-4)  \istb  \istb  \endist
\xtdistance{10mm}{7mm}
\istroot(a)(1-3)  \istb  \istb  \istb  \endist
\istroot(b)(2-3)  \istb  \istb  \endist
\istroot(c)(3-1)  \istb  \istb  \istb  \endist
\xtCInfosetO[fill=red!20](1)!.4!(3){2} 
\xtInfosetO(2)(2){1}[above]
\setxtinfosetlayer{behind}
\xtCInfoset[blue,thick,dashed](a)(c)<.85>{3}[below]
\setxtinfosetlayer % restore default layer (behnd)
\xtCInfosetO[fill=blue!20](b)(4)<.7>{2}
\end{istgame}
\end{tcblisting}


\subsection{A continuum of branches}

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\cntmdistance*{8mm}{16mm}
\cntmpreset*[dashed]{.7} % white triangle
\istrootcntm(0)(0,0){1}  \istb{x}[r]  \endist
\istroot(1)(0-1)<[label distance=-3pt]120>{2}
  \istb{Y}[al]{x,1-x}    \istb{N}[ar] \endist
\cntmpreset % restore defaults
\istrootcntm(2)(1-2){2}  \istb{y}[r]  \istbm  \endist
\istroot(3)(2-1)<[label distance=-3pt]120>{1}
  \istb[]{Y}[al]{1-y,y}  \istb{N}[ar] \endist
\end{istgame}
\end{tcblisting}

%\medskip

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\cntmdistance*{8mm}{16mm}
\istrootcntmA(0)(0,0){1} \istbA{x}[r]  \endist
\cntmAInfoset(0)
\istroot(1)(0-1)<[label distance=-3pt]120>{2}
  \istb{Y}[al]{x,1-x}    \istb{N}[ar]  \endist
\istrootcntmA(2)(1-2){2} \istbA{y}[r]  \endist
\cntmAInfosetO[fill=blue!20](2)
\istroot(3)(2-1)<[label distance=-3pt]120>{1}
  \istb[]{Y}[al]{1-y,y}  \istb{N}[ar]  \endist
\end{istgame}
\end{tcblisting}


%\clearpage
\subsection{Tic-tac-toe (sketch)}

% tic-tac-toe
\begin{tcblisting}{}
% tic-tac-toe (sketch)
\begin{istgame}[scale=1.8,font=\tiny]
\xtdistance{20mm}{7mm}
\istroot(0) \istb \istb \istb \istb \istb \istb{\dots} \istb \istb \istb{9}[r] \endist
\foreach \x in {1,...,4}
{\xtActionLabel(0)(0-\x){\x}[l]}
\xtdistance{10mm}{3mm}
\istroot(a1)(0-1) \istb{2}[l] \istb \istb \istb \istb \istb \istb \istb{9}[r] \endist
\istroot(a7)(0-7) \istb{1}[l] \istb \istb \istb \istb \istb \istb \istb{9}[r] \endist
\xtdistance{10mm}{2mm}
\istroot(A)(a1-3) \istb{2}[l] \istb \istb \istb \istb \istb \istb{9}[r] \endist
\istroot(B)(a1-8) \istb{2}[l] \istb \istb \istb \istb \istb \istb{8}[r] \endist
\istroot(C)(a7-8) \istb{1}[l] \istb \istb \istb \istb \istb \istb{8}[r] \endist
\istroot(Bx)(B-7) \istb{2}[l] \istb \istb \istb \istb \istb{7}[r] \endist
\istroot(By)(Bx-1) \istb{3}[l] \istb \istb \istb \istb{7}[r]  \endist
\istroot(Bz)(By-1) \istb{4}[l] \istb \istb \istb{7}[r]  \endist
\xtPayoff(Bz-4){\vdots}    \xtPayoff(Bz-4){\cdots}[right,xshift=10pt]
\end{istgame}
\end{tcblisting}


%\clearpage
\subsection{Selten's horse}

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% Selten's horse: IGT 331.2 (Osborne, 2004b)
\begin{istgame}
\xtdistance{8mm}{16mm}
\istroot[-45](0)[initial node]{1}
  \istb{D}[r]
  \istb<grow=east,level distance=30mm>{C}[a]
  \endist
\istroot(1)(0-1)+10mm..20mm+
  \istb{L}[al]{3,3,2}
  \istb{R}[ar]{0,0,0}
  \endist
\istroot[-45](a)(0-2){2}
  \istb{d}[r]
  \istb<grow=0,level distance=20mm>{c}[a]{1,1,1}[r]
  \endist
\istroot(a1)(a-1)+10mm..20mm+
  \istb{L}[al]{4,4,0}
  \istb{R}[ar]{0,0,1}
  \endist
\xtInfoset(1)(a1){3}
\end{istgame}
\captionof{figure}{IGT 331.2}
\end{tcblisting}


\subsection{Centipede game}

\begin{tcblisting}{}
% centipede
\begin{istgame}[scale=1.5]
\setistmathTF*001
\setistgrowdirection{south east}
\xtdistance{10mm}{20mm}
\istroot(0)[initial node]{1}
  \istb{Take}[r]{(2,0)}[b]  \istb{Pass}[a]  \endist
\istroot(1)(0-2){2}
  \istb{Take}[r]{(1,3)}[b]  \istb{Pass}[a]  \endist
\istroot(2)(1-2){1}
  \istb{Take}[r]{(4,2)}[b]  \istb{Pass}[a]  \endist
\xtInfoset(2-2)([xshift=5mm]2-2)
%-------------
\istroot(3)([xshift=5mm]2-2){2}
  \istb{Take}[r]{(97,99)}[b]  \istb{Pass}[a]  \endist
\istroot(4)(3-2){1}
  \istb{Take}[r]{(100,98)}[b]  \istb{Pass}[a]  \endist
\istroot(5)(4-2){2}
  \istb{Take}[r]{(99,101)}[b]  \istb{Pass}[a]{(100,100)}[r]  \endist
\end{istgame}
\end{tcblisting}


%\clearpage
\subsection{Poker game}

% poker
\begin{tcblisting}{}
% poker: growing south
\begin{istgame}[scale=1.7]
\setistmathTF*001
\xtShowEndPoints
\xtdistance{15mm}{30mm}
\istroot(0)[chance node]{N}
  \istB{Black}[al]{$\frac12$}[br]
  \istB{Red}[ar]{$\frac12$}[bl]
  \endist
\xtdistance{15mm}{30mm}
\istroot(1-1)(0-1){1}
  \istbA(.5)<grow=-135>{Fold}[al]{1,-1}
  \istb{Raise}[ar]
  \endist
\xtdistance{10mm}{20mm}
\istroot(1)(1-1-2)
  \istb{Pass}[al]{1,-1}
  \istb{Meet}[ar]{2,-2}
  \endist
\xtdistance{15mm}{30mm}
\istroot(1-2)(0-2){1}
  \istbA(.5)<grow=-135>{Fold}[al]{-1,1}
  \istb{Raise}[ar]
  \endist
\xtdistance{10mm}{20mm}
\istroot(2)(1-2-2){}
  \istb{Pass}[al]{1,-1}
  \istb{Meet}[ar]{-2,2}
  \endist
\xtInfoset(1)(2){2}
\end{istgame}
\end{tcblisting}


\subsection{Poker game: growing to the right}
\label{p:poker-right}

\begin{tcblisting}{}
% poker: growing east -- counterclockwise
\begin{istgame}[scale=1.3]
\setistmathTF*001
\setistgrowdirection{0}   % default grow-direction is 'east' from now on
\xtdistance{15mm}{30mm}
\istroot(0)[chance node]<left>{N}
  \istB{Black}[bl]{$\frac12$}[ar]
  \istB{Red}[al]{$ \frac12$}[br]
  \endist
\xtdistance{15mm}{30mm}
\istroot(1-1)(0-1)<left>{1}
  \istb<grow=-45,level distance=10mm>{Fold}[bl]{1,-1}
  \istb{Raise}[al]
  \endist
\xtdistance{12mm}{24mm}
\istroot(1)(1-1-2)
  \istb{Pass}[bl]{1,-1}
  \istb{Meet}[al]{2,-2}
  \endist
\xtdistance{15mm}{30mm}
\istroot(1-2)(0-2)<left>{1}
  \istb<grow=-45,level distance=10mm>{Fold}[bl]{-1,1}[[xshift=5pt]below]
  \istb{Raise}[al]
  \endist
\xtdistance{12mm}{24mm}
\istroot(2)(1-2-2)
  \istb{Pass}[bl]{1,-1}
  \istb{Meet}[al]{-2,2}
  \endist
\xtCInfosetO[fill=blue!20](1-1-2)(1-2-2){2}
\end{istgame}
\end{tcblisting}

\begin{tcblisting}{}
% poker: growing east -- clockwise (swap version)
\begin{istgame}[scale=1.3]
\setistmathTF*001
\setistgrowdirection'{0}   % \setistgrowdirection'
\xtdistance{15mm}{30mm}
\istroot(0)[chance node]<left>{N}
  \istB{Black}[al]{$\frac12$}[br]
  \istB{Red}[bl]{$\frac12$}[ar]
  \endist
\xtdistance{15mm}{30mm}
\istroot(1-1)(0-1)<left>{1}
  \istb<grow=45,level distance=10mm>{Fold}[al]{1,-1}
  \istb{Raise}[bl]
  \endist
\xtdistance{12mm}{24mm}
\istroot(1)(1-1-2)
  \istb{Pass}[al]{1,-1}
  \istb{Meet}[bl]{2,-2}
  \endist
\xtdistance{15mm}{30mm}
\istroot(1-2)(0-2)<left>{1}
  \istb<grow=45,level distance=10mm>{Fold}[al]{-1,1}
  \istb{Raise}[bl]
  \endist
\xtdistance{12mm}{24mm}
\istroot(2)(1-2-2)
  \istb{Pass}[al]{1,-1}
  \istb{Meet}[bl]{-2,2}
  \endist
\xtInfosetO[fill=red!20](1-1-2)(1-2-2){2}
\end{istgame}
\end{tcblisting}

\subsection{Signaling games}

\begin{tcblisting}{listing above text,halign lower=center}
% signaling game: IGT 337.1 (Osborne, 2004b)
\begin{istgame}
\setistgrowdirection'{right}
% game start: choice of chance
\xtdistance{20mm}{20mm}
\istroot(0)[chance node]<180>{Chance}
  \istB<grow=north>{H}[l]{\pi}[r]  \istB<grow=south>{L}[l]{1-\pi}[r]  \endist
\istroot(H0)(0-1)<180>{F}
  \istb{(p_1,E)}[a]  \endist
\istroot(L0)(0-2)<180>{F}
  \istb{(p_1,E)}[a]  \endist
\setistmathTF*001
\cntmdistance*{10mm}{20mm}{8mm}
% subtree after H is chosen
\istroot(H)(H0-1)
  \istb{Buy}[br]  \istb{Refrain}[ar]{-E,0}  \endist
\istrootcntm(H1)(H-1)
  \istb{$p_2^H$}[b]  \istbm  \endist
\istroot(CH)(H1-1)<[label distance=-4pt]135>{C}
  \istb{Buy}[br]{p_1-E-c_H+p_2^H-c_H, 2H-p_1-p_2^H}
  \istb{Refrain}[ar]{p_1-E-c_H, H-p_1}
  \endist
% subtree after L is chosen
\istroot(L)(L0-1)
  \istb{Buy}[br]  \istb{Refrain}[ar]{-E,0}  \endist
\istrootcntm(L1)(L-1)
  \istbm  \istb{$p_2^L$}[a]  \endist
\istroot(CL)(L1-2)<[label distance=-4pt]-135>{C}
  \istb{Buy}[br]{p_1-E-c_L+p_2^L-c_L, 2L-p_1-p_2^L}
  \istb{Refrain}[ar]{p_1-E-c_L, L-p_1}
  \endist
\xtInfoset(H)(L){C}[left]
\end{istgame}
\end{tcblisting}

\xbigskip2

\begin{tcblisting}{listing outside text, righthand width=.5\linewidth}
% signaling game
\begin{istgame}[scale=1.3]
\xtdistance{20mm}{20mm}
\istroot(0)[chance node]{$c$}
  \istb<grow=left>{\frac12}[a]
  \istb<grow=right>{\frac12}[a]
  \endist
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)<180>{1}
  \istb<grow=north>{a}[l]
  \istb<grow=south>{b}[l]
  \endist
\istroot(2)(0-2)<0>{1}
  \istb<grow=north>{a}[r]
  \istb<grow=south>{b}[r]
  \endist
\istroot'[north](a1)(1-1)
  \istb{L}[bl]{-1,0}
  \istb{R}[br]{0,-1}
  \endist
\istroot(b1)(1-2)
  \istb{L}[al]{2,0}
  \istb{R}[ar]{0,2}
  \endist
\istroot(a2)(2-2)
  \istb{L}[al]{3,0}
  \istb{R}[ar]{0,3}
  \endist
\istroot'[north](b2)(2-1)
  \istb{L}[bl]{1,0}
  \istb{R}[br]{0,1}
  \endist
\xtInfoset(a1)(b2){2}
\xtInfoset(b1)(a2){2}
\end{istgame}
\end{tcblisting}


%\clearpage
\setsecnumdepth{chapter}
\section{Version history}

\begin{itemize}
\item v\tmpversion (\tmpdate) to be upload to CTAN
  \begin{itemize}
  \item changed the title of the package to ``Draw Game Trees with \Tikz"
  \item package document done
  \end{itemize}
\item v2.0rc (2019/01/27)
  \begin{itemize}
  \item introduced \cmd{\setxtinfosetstyle}
    \begin{itemize}
    \item introduced \xw{infoset style}, a new style for information sets
    \item modified all definitions of information sets, accordingly
    \end{itemize}
  \item redefined macros related to layer, to easily restore default values
  \item modified the cross arrow tip options
  \item modified defaults of \cmd{\setxtarrowtips} not to depend on branch styles initially
  \item code refinement
  \end{itemize}
\item v2.0beta1 (2019/01/26)
  \begin{itemize}
%  \item beta test
  \item introduced \cmd{\xtshowXpoints} and \cmd{\xtshowXcircles} (for developer only, not documented)
  \end{itemize}
%\item v1.99x (2019/01/24)
%  \begin{itemize}
%  \item changed \xw{expl3} macros
%    \begin{itemize}
%    \item \verb+\str_case_x:nnTF+ to \verb+\str_case_e:nnTF+ and then to \verb+\str_case:nnTF+
%    \item \verb+\str_if_eq_x:nnTF+ to \verb+\str_if_eq:eeTF+ and then to \verb+\str_if_eq:nnTF+
%    \end{itemize}
%  \item modified macros on arrows and middle arrows
%  \item redefined \cmd{\xtTimeLineH} and \cmd{\xtTimeLineV} to deal with swap of branches
%  \item modified \cmd{\xtCommentTo} and \cmd{\xtCommentFrom} for the last option delimiters
%  \end{itemize}
%\item v1.99w (2019/01/21)
%  \begin{itemize}
%  \item fixed bug in \cmd{\xtInfosetO} regarding \cmd{\xtinfosetheihtvar} for \xw{rounded corner}
%  \item corrected \cmd{\cntmistb} and \cmd{\cntmAistb}
%    \begin{itemize}
%    \item separated options for \cmd{\cntmAistb} from those for \cmd{\cntmistb}
%    \item those two are independent to each other (except the way to deal with endpoints)
%    \end{itemize}
%  \item redefined \cmd{\endist} to restore initial values after each execution of the \verb+cntm(A)istb+ 
%    \begin{itemize}
%    \item but not for the effect of printing endpoints
%    \item (internally introduced) \cmd{\cntmistbVariablesRestore}
%    \item (internally introduced) \cmd{\cntmAistbVariablesRestore}
%    \end{itemize}
%  \item introduced \cmd{\xtHideEndPoints*} for extra work for continuum endpoints
%  \item introduced \cmd{\cntmAlayerpreset}, with \xw{behind} as default
%  \item redefined \cmd{\xtShowArrows} to add an option for a node style
%  \item changed the order of options for \cmd{\setxtshowarrows}
%  \item changed the order of options for \cmd{\setxtarrowtips}
%  \item renamed \cmd{\setxtmidarrows} to \cmd{\setxtarrowtips}
%  \end{itemize}
%\item v1.99v (2018/01/17)
%  \begin{itemize}
%  \item redefined the \env{istgame} environment and \cmd{\istgameScaleCallTestAndAdjust} 
%        to take care of simultaneous use of \xw{xscale} and \xw{yscale}.
%  \item modified macros to make singleton information sets scaled accordingly when needed
%    \begin{itemize}
%    \item \cmd{\xtInfosetO}, \cmd{\xtCInfosetO}, \cmd{\cntmAInfosetO}, \cmd{\istgameScaleCallTestAndAdjust}
%    \item (internally) added \cmd{\xtinfosetheightvar} and \cmd{\cntminfosetheightvar}
%    \end{itemize}
%  \end{itemize}
%\item v1.99u (2019/01/15)
%  \begin{itemize}
%  \item redefined macros to deal with local change of sibling distances
%    \begin{itemize}
%    \item redefined \cmd{\istrootcntm}, \cmd{\istrootcntmA}, \cmd{\istrootocntm}, \cmd{\istrootocntmA}, 
%    \item redefined \cmd{\istbA}, \cmd{\istbAt}
%    \item redefined \cmd{\cntmpreset}, \cmd{\cntmApreset}  -- NEED TO GO BACK (no need call test)
%    \end{itemize}
%  \item redefined \cmd{\xtCInfoset} to add abbreviations for the position of owners
%  \item redefined \cmd{\xtCInfoset} to print a singleton information set
%  \item modified \cmd{\xtCInfoset} to change the way of input for its position (\xw{add to \textbackslash cntmApos})
%  \end{itemize}\
%\item v1.99t (2019/01/13)
%  \begin{itemize}
%  \item redefined macros to deal with local change of level and sibling distances for \cmd{\istbA}
%    \begin{itemize}
%    \item code complication, inevitable to take care of too many cases
%    \item redefined \cmd{\istroot} and \cmd{\istrooto}
%    \item redefined \cmd{\istrootcntm} and its variants
%    \item redefined \cmd{\istbA} and \cmd{\istbAt}
%    \end{itemize}
%  \end{itemize}
%\item v1.99s (2019/01/10)
%  \begin{itemize}
%  \item modified \cmd{\xtCInfosetO} for better results when swapped with \xw{plotfactor} less than 1
%  \item modified \cmd{\istrootcntm} and its variants for better results of shrunken continua
%  \item redefined \cmd{\xtTimeLineH} (for a horizontal time-line)
%  \item introduced \cmd{\xtTimeLineH(')} for a vertical time-line
%  \item introduced \cmd{\xtCInfosetOTurnX} for turning X circles to use it just in case
%  \end{itemize}
%\item v1.99r (2019/01/07)
%  \begin{itemize}
%  \item redefined \cmd{\istrootcntm} and \cmd{\istrootocntm} for smaller triangle continua of branches 
%  \item introduced \cmd{\cntmpreset} and \cmd{\cntmpreset*}
%  \item put `call test' for cases of how to change level distance with \cmd{\istbA}
%  \item modified \cmd{\xtCInfosetO} and \cmd{\cntmAInfosetO} for coloring
%  \end{itemize}
%\item v1.99q (2019/01/05)
%  \begin{itemize}
%  \item modified \cmd{\xtInfosetO} to print a singleton information set by a circle.
%  \item finished fine-tuning \cmd{\cntmAInfosetO} (for tuning base circles)
%  \end{itemize}
%\item v1.99p (2019/01/02)
%  \begin{itemize}
%  \item redefined \cmd{\xtInfoset} and \cmd{\xtInfosetO} in accordance with new \cmd{\xtCInfosetO}
%  \item redefined completely \cmd{\cntmAInfoset} and \cmd{\cntmAInfsetO} in the way of \cmd{\xtCInfosetO}
%  \item redefined \cmd{\cntmAInfoset}, \cmd{\cntmAInfosetO}, \cmd{\istrootcntmA}, and \cmd{\istrootocntmA}
%    \begin{itemize}
%    \item to compensate the dependency of arcs on the ratio of \cmd{\cntmlevdist} to \cmd{\cntmsibdist}
%    \end{itemize}
%  \end{itemize}
%\item v1.99o (2018/12/31)
%  \begin{itemize}
%  \item redefined completely \cmd{\xtCInfosetO} and \cmd{\xtCInfoset} for enhancement
%    \begin{itemize}
%      \item (internally) added \cmd{\setxtCIAngleAccordingtoGrowswapCallForCI}
%      \item to make it possible for the control points to turn accordingly along the base circles 
%            for sides of curved information sets
%    \end{itemize}
%  \end{itemize}
%\item v1.99n (2018/12/27)
%  \begin{itemize}
%  \item redefined \cmd{\setistmathTF*} to make it work with basic text font styles
%    \begin{itemize}
%    \item \cmd{\istownertextfont}, \cmd{\istactionlabeltextfont}, \cmd{\istpayofftextfont}
%    \item all working only in text mode
%    \end{itemize}
%  \item introduced \cmd{\xtcureslopedlabelsNS} and \cmd{\xtcureslopedlabelsEW} to resolve a \Tikz\ conflict to sloped labels
%    \begin{itemize}
%    \item (internally) added \cmd{\xtlevdistadj} and \cmd{\xtsibdistadj}
%    \end{itemize}
%  \end{itemize}
%\item v1.99m (2018/12/21)
%  \begin{itemize}
%  \item added starred versions that work with \cmd{\setistmathTF}
%  \begin{itemize}
%  \item \cmd{\xtInfoset*}, \cmd{\xtInfosetO*}, \cmd{\xtCInfoset}, \cmd{\xtCInfosetO}
%  \item \cmd{\xtOwner*}, \cmd{\xtActionLabel*}, \cmd{\xtPayoff*}, \cmd{\xtInfosetOwner*}
%  \end{itemize}
%  \end{itemize}
%\item v1.99l (2018/12/18)
%  \begin{itemize}
%  \item changed the order and the type of argument delimiters for input consistency
%    \begin{itemize}
%    \item \cmd{\xtCInfosetO}, \cmd{\cmtmAinfosetO}, and their related macros
%    \item effective from \xw{v.1.99l}
%      \begin{itemize}
%      \item not consistent with the earlier versions of update
%      \item but intact with the \xw{version 1}
%      \end{itemize}
%    \end{itemize}
%  \end{itemize}
%\item v1.99k (2018/12/15)
%  \begin{itemize}
%  \item introduced \cmd{\xtCInfosetO} for bubble type curved information sets
%    \begin{itemize}
%    \item (internally) added \cmd{\xtPrototypeForCInfosetO} -- only for \cmd{\xtCInfosetO}
%    \end{itemize}
%  \end{itemize}
%\item v1.99j (2018/12/11)
%  \begin{itemize}
%  \item introduced \cmd{\xtCInfoset} for curved information sets
%    \begin{itemize}
%    \item (internally) added \cmd{\istgameScaleCallTestAndAdjust} (must be used in a group)
%    \item (internally) added \cmd{\setxtCIAngleAccordingtoGrowswapCall}
%    \end{itemize}
%  \end{itemize}
%\item v1.99i (2018/12/08)
%  \begin{itemize}
%  \item (macro name change,  effective from \xw{v1.99i}) all `\xw{cntmarc}' changed to `\xw{cntmA}'
%  \item introduced \cmd{\cntmAInfosetO}
%  \item introduced \cmd{\cntmAexpostShowEndPoints}
%  \item introduced \cmd{\istbA(*)} and \cmd{\istbAt(*)}
%  \end{itemize}
%\item v1.99h (2018/11/07)
%  \begin{itemize}
%  \item changed the default position of a continuum arc from \xw{.5} to \xw{1}
%  \item introduced \cmd{\cntmarcInfoset}
%  \end{itemize}
%\item v1.99g (2018/09/30)
%  \begin{itemize}
%  \item put \cmd{\xtShowArrows} and \cmd{\xtShowMidArrows} into \cmd{\istB}
%  \item found issues with \cmd{\xtShowArrows} and \cmd{\xtShowMidArrows} related to \xw{postaction}
%  \item added the arrow end shorten option to \cmd{\xtCommentTo} and \cmd{\xtCommentFrom}.
%  \item (internal) minor changes
%    \begin{itemize}
%    \item redefined \cmd{\setistSolidNodeStyle} to keep consistency with other node styles
%    \item redefined \cmd{\setistNullNodeStyle} to keep consistency with other node styles
%    \end{itemize}
%  \end{itemize}
%\item v1.99f (2018/09/19)
%  \begin{itemize}
%  \item (internally) redefined \cmd{\cntmistb} and \cmd{\cntmarcistb} to resolve endpoints problems
%  \begin{itemize}
%    \item (internally) added \cmd{\cntmOUTERistb} and \cmd{\cntmarcOUTERistb}
%    \item (internally) removed \cmd{\cntmendpointsShow} and \cmd{\cntmendpointsPrint}
%    \item (internally) redefined \cmd{\istrootcntm} and its variants accordingly
%  \end{itemize}
%  \end{itemize}
%\item v1.99e (2018/09/15)
%  \begin{itemize}
%  \item introduced \cmd{\xtShowArrows} and \cmd{\xtHideArrows(*)}
%  \item introduced \cmd{\setxtshowarrows}
%  \item introduced \cmd{\xtShowMidArrows} and \cmd{\xtHideMidArrows}
%  \end{itemize}
%\item v1.99d (2018/09/13)
%  \begin{itemize}
%  \item introduced \cmd{\setxtarrowtips} with a tikzstyle \xw{->-}
%  \item introduced new arrow styles: \xw{->>-}, \xw{->>>-}, \xw{-o-}, and \xw{-x-}
%  \end{itemize}
%\item v1.99c (2018/09/09)
%  \begin{itemize}
%  \item introduced \cmd{\cntmistb} and \cmd{\cntmarcistb}
%  \item redefined \cmd{\cntmdistance} to check if \cmd{\cntmactsibdist} is called or not
%  \item (internally) added \cmd{\cntmendpointsShow}
%    \begin{itemize}
%    \item redefined \cmd{\xtShowEndPoints} and \cmd{\xtHideEndPoints} accordingly
%    \item introduced \cmd{\xtShowEndPoints*} (for outermost branches of a continuum)
%    \end{itemize}
%  \item (internally) added \cmd{\cntmendpointsPrint}
%    \begin{itemize}
%    \item redefined \cmd{\istrootcntm} and its variants accordingly
%    \end{itemize}
%  \end{itemize}
%\item v1.99b (2018/09/07)
%  \begin{itemize}
%  \item redesigned \cmd{\istrootcntm} and its variants
%    \begin{itemize}
%    \item removed \cmd{\ISTCntm(')} and \cmd{\ISTCntmArc(')}
%    \end{itemize}
%  \item introduced \cmd{\cntmdraw}, \cmd{\cntmdrawset} and related macros
%  \item redfined \cmd{\cntmdistance} to check if \cmd{\cntmactsibdist} is called or not
%  \end{itemize}
%\item v1.99a (2018/09/05)
%  \begin{itemize}
%  \item introduced \cmd{\setistgameshorten} (for \env{istgame} environment option)
%  \end{itemize}
%\item v1.98 (2018/09/03)
%  \begin{itemize}
%  \item redefined \cmd{\istrootcntm(arc)} to make it work with \cmd{\setistmathTF(*)}
%  \item redefined \cmd{\istrootocntm(arc)} to make it work with \cmd{\setistmathTF(*)}
%  \end{itemize}
%\item v1.97 (2018/09/02)
%  \begin{itemize}
%  \item redefined \cmd{\istroot(o)} to resolve tex expansion problems
%  \item redefined \cmd{\istrootcntm(arc)} to resolve tex expansion problems
%  \item redefined \cmd{\istrootocntm(arc)} to resolve tex expansion problems
%  \item redefined the \env{istgame} environment to add \xw{[shorten >=0pt]} if \xw{[->]} exists
%  \end{itemize}
%\item 1.96 (2018/08/30)
%  \begin{itemize}
%  \item minor changes
%    \begin{itemize}
%    \item altered the default sibling distance of \cmd{\xtdistance} from \xw{15mm} to \xw{\levdist}
%    \item altered initial options for \xw{null}, \xw{solid}, and \xw{hollow} nodes (added \xw{thin}, \xw{solid})
%    \item added \xw{text depth=.25ex} for some definitions
%    \end{itemize}
%  \end{itemize}
%\item v1.95 (2018/08/27)
%  \begin{itemize}
%  \item resolved dimension issues for \cmd{\cntmdistance}
%  \item added \cmd{\xtOwner*}, \cmd{\xtActionLabel*}, \cmd{\xtPayoff*} (working with \cmd{\setistmathTF(*)})
%  \end{itemize}
%\item v1.94 (2018/08/22)
%  \begin{itemize}
%  \item resolved tex expansion issues in the macros for a continuum of branches
%  \end{itemize}
%\item v1.93 (2018/08/19)
%  \begin{itemize}
%  \item introduced \cmd{\setistmath} to set input mode for owners, action labels, and payoffs
%  \item introduced \cmd{\setistmath*} to print action labels in italics, in case of text mode
%  \item (internally) added \cmd{\istownerstyle}, \cmd{\istactionlabelstyle}, and \cmd{\istpayoffstyle}
%  \end{itemize}
%\item v1.92 (2018/08/17)
%  \begin{itemize}
%  \item redesigned the \env{istgame} environment
%    \begin{itemize}
%    \item to extract the number input from \xw{scale}, \xw{xscale}, or \xw{yscale}
%    \item added \cmd{\xtscale}, \cmd{\xtxscale}, and \cmd{\xtyscale} to save scale option values
%    \end{itemize}
%  \item tested to apply scale values to improve the result of \cmd{\xtInfosetO}
%  \end{itemize}
%\item v1.91 (2018/08/16)
%  \begin{itemize}
%  \item many changes to resolve expansion problems
%    \begin{itemize}
%    \item redefined \cmd{\cntmset}, \cmd{\cntmarcset}, and related macors
%    \item redifined \cmd{\cntmlevdist} and \cmd{\cntmsibdist} as lengths
%    \end{itemize}
%  \end{itemize}
%\item v1.9 (2018/08/11)
%  \begin{itemize}
%  \item introduced \cmd{\cntmarcplotfactorset}
%  \end{itemize}
%\item v1.8 (2018/08/09)
%  \begin{itemize}
%  \item made possible to use the directional abbreviations with \cmd{\xtInfoset}
%  \item introduced \cmd{\istrootocntm} and \cmd{\istrootocntmarc} (oval versions)
%  \end{itemize}
%\item v1.7 (2018/08/04)
%  \begin{itemize}
%  \item introduced \cmd{\istbm}
%  \item introduced \cmd{\setistNewNodeStyle}
%  \end{itemize}
%\item v1.6 (2018/08/01)
%  \begin{itemize}
%  \item resigned \cmd{\cntmdistance} (now ready for users)
%    \begin{itemize}
%    \item added \cmd{\cntmactsibdist} to distinguish it from \cmd{\cntmsibdist}
%    \end{itemize}
%  \item added \cmd{\cntmdistance*} to incorporate with \cmd{\xtdistance}
%  \item introduced \cmd{\istrootcntmA(')}
%    \begin{itemize}
%    \item added (internally) \cmd{\ISTCntmArc(')}
%    \item added \cmd{\cntmarcset}
%    \end{itemize}
%  \item introduced \cmd{\istrootcntm(')}
%    \begin{itemize}
%    \item added (internally) \cmd{\ISTCntm(')}
%    \end{itemize}
%  \item (internally) renamed \cmd{\istCntmRoot(Arc)} to \cmd{\obsoleteISTCntm(Arc)}
%  \end{itemize}  
%\item v1.5 (2018/07/26)
%  \begin{itemize}
%  \item introduced \cmd{\setxtinfosetlayer}
%  \item introduced \cmd{\setxtsubgamelayer}
%  \end{itemize}
%\item v1.4 (2018/07/12)
%  \begin{itemize}
%  \item completely rewrote \cmd{\xtInfosetO} to deal with sloped information sets
%    \begin{itemize}
%    \item removed \cmd{\xtInfosetO'} and \cmd{\xtInfoset'} (critical change for users!)
%    \end{itemize}
%  \end{itemize}
%\item v1.3 (2018/07/06)
%  \begin{itemize}
%  \item (internally) renamed some macros (such as \cmd{\xt@...})
%  \item (internally) renamed \cmd{\xtaction} to \cmd{\istaction}
%  \item (internally) renamed \cmd{\xtpayoff} to \cmd{\istpayoff}
%  \item (internally) renamed \cmd{\istRoot(O)} to \cmd{\ISTRoot(O)}
%  \end{itemize}
%\item v1.2 (2017/12/11)
%  \begin{itemize}
%  \item replaced \cmd{\istb.} by \cmd{\istbt} (critical change for users!)
%    \begin{itemize}
%    \item \cmd{\istb} redefined accordingly
%    \item this is the cost of introducing \cmd{\istB(*)}
%    \end{itemize}
%  \item introduced \cmd{\istB(*)} to deal with dual action labels
%  \item added \cmd{\istbt(*)} and \cmd{\istBt(*)}
%  \item added \xw{text depth=.25ex} as an option to \cmd{\istroot} and \cmd{\istrooto}
%  \end{itemize}
%\item v1.1 (2017/10/02)
%  \begin{itemize}
%  \item introduced \cmd{\xtCommentTo} and \cmd{\xtCommentFrom}
%  \item introduced \cmd{\xtTimeLineH(')}
%  \item redefined \cmd{\xtActionLabel} to deal with sloped labels
%  \item replaced \cmd{\tikzstyle} by \cmd{\tikzset}
%  \end{itemize}
\item v1.0 (2017/09/04)
  \begin{itemize}
  \item introduced \cmd{\cntmlevdist} and \cmd{\cntmsibdist}
  \item introduced \cmd{\cntmdistance}
  \item redefined related marcos
  \item package document done
  \end{itemize}
%%%\item v1.0 (2017/09/04) ready to submit to CTAN
%%%  \begin{itemize}
%%%  \item introduced \cmd{\cntmlevdist} and \cmd{\cntmsibdist}
%%%  \item introduced \cmd{\cntmdistance} (for internal use)
%%%  \item redefined related marcos.
%%%  \item package document done
%%%  \end{itemize}
%%%\item v0.99g (2017/08/21)
%%%  \begin{itemize}
%%%  \item redefined the \env{istgame} environment to add \xw{>=stealth} as default
%%%  \item added \xw{text depth=.25ex} as an option to \cmd{\istb} to get better alignment of action labels
%%%  \end{itemize}
%%%\item v0.99f (2017/08/02)
%%%  \begin{itemize}
%%%  \item redefined \cmd{\xtInfosetO(')}
%%%    \begin{itemize}
%%%    \item added \verb+\begin{scope}[on background layer]...\end{scope}+
%%%    \end{itemize}
%%%  \end{itemize}
%%%\item v0.99e (2017/08/01)
%%%  \begin{itemize}
%%%  \item introduced the prime(\xw{'}) versions to deal with \xw{grow'} (this is the swap version in \TikZ)
%%%  \item redefined \cmd{\istroot(')}
%%%  \item defined \cmd{\istrooto(')} to replace \cmd{\istroot*}
%%%    \begin{itemize}
%%%    \item \cmd{\istroot*} completely replaced by \cmd{\istrooto}
%%%    \end{itemize}
%%%  \item redefinde \cmd{\istcntm}
%%%  \item defined \cmd{\istcntmarc}
%%%    \begin{itemize}
%%%    \item \cmd{\istcntm*} completely replaced by \cmd{\istcntmarc}
%%%    \end{itemize}
%%%  \item redefined \cmd{\xtInfoset(')} and \cmd{\xtInfosetOwner(')}
%%%  \item introduced \cmd{\xtInfosetO(')}
%%%    \begin{itemize}
%%%    \item \cmd{\xtInfoset*} completely replaced by \cmd{\xtInfosetO}
%%%    \end{itemize}
%%%  \item introduced \cmd{\xt@growswap} introduced
%%%  \item redefined \cmd{\xtNode} accordingly
%%%  \end{itemize}
%%%\item v0.99d (2017/07/27)
%%%  \begin{itemize}
%%%  \item defined \cmd{\xtSubgameBox(*)} and \cmd{\xtSubgameOval(*)} to express a subgame
%%%  \end{itemize}
%%%\item v0.99c (2017/07/20)
%%%  \begin{itemize}
%%%  \item defined \cmd{\xtgrow} to deal with going `clockwise' of branch arrangement
%%%  \item defined \cmd{\setxtgrowkey} to change between \xw{grow} and \xw{grow'}
%%%  \item introduced \cmd{\setistgrowdirection'} by redefining \cmd{\setistgrowdirection}
%%%  \item updated `related macros' accordingly
%%%  \end{itemize}
%%%\item v0.99b (2017/07/16)
%%%  \begin{itemize}
%%%  \item renamed \xw{zero node} as \xw{plain node}
%%%  \item added \cmd{\setistPlainNodeStyle}
%%%  \item defined \cmd{\xtNode*} (for a terminal node text with a plain node)
%%%  \item redefined \cmd{\xt<...>NodeStyle} (now all arguments are optional)
%%%  \item renamed \cmd{\isthorizontallabelshift} as \cmd{\istactionlabelxshift}, with default \xw{1pt}
%%%  \item renamed \cmd{\istverticallabelshift} as \cmd{\istactionlabelyshift}, with default \xw{2pt}
%%%  \end{itemize}
%%%\item v0.99a (2017/03/10)
%%%  \begin{itemize}
%%%  \item started rewriting package manual
%%%  \item introduced \cmd{\istb.}\ (for terminal nodes)
%%%  \item redefined \cmd{\xtShowTerminalNodes}
%%%  \item introduced \cmd{\xtShowEndPoints} and \cmd{\xtHideEndPoints}
%%%  \item redefined \cmd{\xtInfoset*}, with \cmd{\xtdefaultinfosep} added
%%%  \end{itemize}
%%%\item v0.9 (2017/02/13)
%%%  \begin{itemize}
%%%  \item some internal macro names changed (\cmd{\xtnode}, \cmd{\xttnode},\cmd{\xtshowtnode})
%%%%  \item conflict with \pkg{tikz-qtree} resolved. (\env{istgame} differs from \env{tikzpicture} with \pkg{tikz-qtree})
%%%%  \item \cmd{\setistbranchanchors} added
%%%  \item added \xw{zero node}
%%%  \end{itemize}
%%%\item v0.8 (2017/01/17)
%%%  \begin{itemize}
%%%  \item macro names changed
%%%    \begin{itemize}
%%%      \item \cmd{\xtdistance}: prefix `\xw{x}' changed to `\xw{xt}' meaning `extensive tree'
%%%      \item \cmd{\xtInfoset(*)}, \cmd{\xtInfosetOwner}, \cmd{\xtActionLabel}, \cmd{xtOwner}, \cmd{\xtPayoff}, \cmd{\xtNode}
%%%      \item \cmd{\xtShowTerminalNodes}, \cmd{\xtHideTerminalNodes}
%%%      \item \cmd{\xtlevdist}, \cmd{\xtsibdist}
%%%    \end{itemize}
%%%  \item \cmd{\xtNode} redefined
%%%  \item some internal macro names changed (including \cmd{\xtpayff}, \cmd{\xtmove})
%%%  \item node styles redefined
%%%  \item \cmd{\setist<Solid>NodeStyle} added for <Various> node styles
%%%  \item \cmd{\setistdefaultnodecolor}, \cmd{setistdefaultnodebgcolor} added
%%%  \end{itemize}
\end{itemize}


\section{Acknowledgement}

The basic idea of the \pkg{istgame} package came from Osborne's \pkg{egameps} package and Chen (2013). 
The update of the package \pkg{istgame} to \xw{version 2.0} is partly motivated by the questions and discussions on the subject of \xw{game tree} at \url{https://tex.stackexchange.com/}, where Alan Munn is thanked for his kind interest in the \pkg{istgame} package.
Special thanks go to Kangsoo Kim of KTUG for his great help in using \pkg{expl3} to simplify the appearance and the usage of the macros, and to resolve the issues on \TeX's expansion.


\section{References}
\hpara{}Chen, H.~K.~(2013), ``Drawing Game Trees with \TikZ,'' \url{http://www.sfu.ca/~haiyunc/notes/Game_Trees_with_TikZ.pdf}.

\hpara{}Cho, I-S.~(2017), ``\pkg{istgame}: Drawing Game Trees with \TikZ,'' in Korean TeX Society, \emph{\TeX, Beyond the World of Typesetting}, Seoul: Kyungmoonsa, 203--237.

\hpara{}Osborne, M.~J.~(2004a), ``Manual for \pkg{egameps.sty},'' Version 1.1, \url{http://texdoc.net/texmf-dist/doc/latex/egameps/egameps.pdf}

\hpara{}\uline{\hphantom{Osborne, M.~J}}~(2004b), \emph{An Introduction to Game Theory}, New York: Oxford.

\hpara{}Tantau, T.~(2015), ``\TikZ\ and PGF: Manual for version 3.0.1a,'' \url{http://sourceforge.net/projects/pgf}.

%\section*{Discussions (in Korean) on KTUG board}
%
%\begin{itemize}
%\item Drawing Game Trees 1: \url{http://www.ktug.org/xe/index.php?document_srl=207287}
%
%\item Drawing Game Trees 1-1: \url{http://www.ktug.org/xe/index.php?document_srl=207513}
%
%\item Drawing Game Trees 1-2:
%\url{http://www.ktug.org/xe/index.php?document_srl=208286}
%
%\item Drawing Game Trees 2: \url{http://www.ktug.org/xe/index.php?document_srl=212043}
%
%\item Drawing Game Trees 2-1:
%\url{http://www.ktug.org/xe/index.php?document_srl=212225}
%
%\item Drawing Game Trees 2-2:
%\url{http://www.ktug.org/xe/index.php?document_srl=212319}
%\end{itemize}
