summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-01-28 22:03:56 +0000
committerKarl Berry <karl@freefriends.org>2019-01-28 22:03:56 +0000
commit3e868961dcbbe4a5ef7f395e1d9cb824100e0046 (patch)
treeb211cd5588ed1f66779b8730e3e6a2d4ada9467c
parent25539f77aa9790ea19ad9b861876fd112294bbca (diff)
istgame (28jan19)
git-svn-id: svn://tug.org/texlive/trunk@49848 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/istgame/README.txt26
-rw-r--r--Master/texmf-dist/doc/latex/istgame/istgame-doc-v1.0.tex3327
-rw-r--r--Master/texmf-dist/doc/latex/istgame/istgame-doc-v2.0.tex7464
-rw-r--r--Master/texmf-dist/doc/latex/istgame/istgame-doc.pdfbin364222 -> 707432 bytes
-rw-r--r--Master/texmf-dist/doc/latex/istgame/istgame-doc.tex119
-rw-r--r--Master/texmf-dist/doc/latex/istgame/istgame.ist2
-rw-r--r--Master/texmf-dist/tex/latex/istgame/istgame.sty3677
7 files changed, 10726 insertions, 3889 deletions
diff --git a/Master/texmf-dist/doc/latex/istgame/README.txt b/Master/texmf-dist/doc/latex/istgame/README.txt
index e802d590109..38155f274a2 100644
--- a/Master/texmf-dist/doc/latex/istgame/README.txt
+++ b/Master/texmf-dist/doc/latex/istgame/README.txt
@@ -1,31 +1,31 @@
istgame.sty: Drawing Game Trees with TikZ
-=====================================
+=========================================
Author: In-Sung Cho
-Introduction:
+Introduction:
-This is a LaTeX package that provides macros based on TikZ to draw a game tree.
-The main idea underlying the core macros here is the completion of a whole tree
-by using a sequence of simple ‘parent-child’ tree structures,
-with no longer nested relations involved
+This is a LaTeX package that provides macros based on TikZ to draw a game tree.
+The main idea underlying the core macros here is the completion of a whole tree
+by using a sequence of simple 'parent-child' tree structures,
+with no longer relations involved
like the use of grandchildren or great-grandchildren.
-With the istgame package, you can draw a game tree
-as if you were drawing a game tree with a pen and paper.
+With the istgame package, you can draw a game tree
+as easily as drawing a game tree with pen and paper.
Dependencies:
The package istgame depends on the packages tikz, xparse, and expl3.
-License:
+License:
-This work may be distributed and/or modified
-under the conditions of the LaTeX Project Public License,
+This work may be distributed and/or modified
+under the conditions of the LaTeX Project Public License,
either version 1.3c of this license or any later version.
-The latest version of this license is in
+The latest version of this license is in
http://www.latex-project.org/lppl.txt.
Contacts:
Please report any errors or suggestions to the author,
-In-Sung Cho at <ischo at tug.org>. \ No newline at end of file
+In-Sung Cho at <ischo at ktug.org>. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/istgame/istgame-doc-v1.0.tex b/Master/texmf-dist/doc/latex/istgame/istgame-doc-v1.0.tex
deleted file mode 100644
index 8aaf825d665..00000000000
--- a/Master/texmf-dist/doc/latex/istgame/istgame-doc-v1.0.tex
+++ /dev/null
@@ -1,3327 +0,0 @@
-%!TEX root = istgame-doc.tex
-
-%\begin{document}
-\setcounter{section}{-1}
-
-\section{Changes}
-
-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 which is older than ver.\@ 1.0 had been distributed in the KTUG (Koran TeX Users Group).}
-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}to\linewidth{X[l4]X[l3]X[l2]} \toprule
-\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*} & \\\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-
-\cmd{\xtInfoset*} & & \cmd{\xtInfosetO} \\\bottomrule
-\end{tabu}
-\end{center}
-
-Here, the prefix `xt' stands for `extensive tree,'
-so \cmd{\xtdiatnace} can be read as `extensive tree distance.'
-
-
-\bigskip
-\bigskip
-
-\remark A known problem with the \pkg{tikz-qtree} package:
-
-It seems that
-\pkg{tikz-qtree} changes node anchors.
-So, with the \pkg{tikz-qtree} 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 redefine the \pkg{istgame} environment as follows:
-
-\begin{tcblisting}{listing only}
-\RenewDocumentEnvironment{istgame}{O{}} % accepts tikzpicture options
- {\begin{tikzpicture}[%
- edge from parent path={(\tikzparentnode\istparentanchor) --
- (\tikzchildnode\istchildanchor)}, % tikz-qtree conflict resolved
- font=\istgamefontsize,>=stealth,#1
- ]
- }
- {\end{tikzpicture}
- }
-\end{tcblisting}
-
-\clearpage
-
-\section{Getting started}
-
-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 \ixw{simple tree}.
-You can draw a whole game tree by repeatedly connecting these `simple tree structures.'
-
-\mbigskip1
-
-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.
-
-\mbigskip1
-
-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:
-
-\quad \cmd{\usepackage\{istgame\}}
-
-The package loads the following \tikz\ libraries:
-
-\quad \verb+calc,arrows,shapes,positioning,patterns,trees,fit,backgrounds,quotes+
-
-
-\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 height of 15mm and
-the distance between two neighbor endpoints (not shown) is also 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 (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 previous example, the simple `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 given names of the (sub)roots and the names of endpoints are given counterclockwise (from the left to the 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}
-
-Basically, \cmd{\istroot} designates a decision node and its owner (or a player),
-\cmd{\istb} prints a branch coming from the decision node with action labels and payoffs, and \cmd{\endist} actually draws the tree structures.
-
-\mbigskip1
-
-\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}
-
-\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 mandatory argument of \icmd{\istroot} is \xw{(<decision node name>)} and all others are optional.
-If the \xw{(<location>)} where a decision node is placed is omitted, it is regarded as \xw{(0,0)} by default.
-The position of the owner is \xw{<above>} (or equivalently, \xw{<90>}) degree by default.
-
-In fact, \cmd{\istroot} and its variations have much more functions than these. Later, you can look into section \ref{sec:istroot} for more details.
-
-\subsubsection{How to put action labels and payoffs}
-
-\begin{tcblisting}{listing only}
-\istb{<action label>}[<action pos>]{<payoffs>}[<payoff pos>]
-\end{tcblisting}
-
-With the macro \icmd{\istb}, you can put a action label and payoffs as optional arguments.
-The positions of an action label and payoffs are specified as options right after each of the two.
-
-In fact, \cmd{\istb} and its variations have much more functions than these. See section \ref{sec:istb} for more details. If this is your first reading this manual, however, you don't need to bother about all the details at the moment.
-
-\subsubsection{How to put information sets}
-
-\begin{tcblisting}{listing only}
-\xtInfoset(<from coor>)(<end coor>){<owner>}
-\end{tcblisting}
-
-
-The macro \icmd{\xtInfoset} connects two nodes with a dotted line.
-The two node coordinates are mandatory.
-For more details about \cmd{\xtInfoset}, see section \ref{sec:infoset}.
-
-\mbigskip1
-In the following example, the macro \cmd{\xtInfoset} is used to show a information set.
-\xw{[al]} is an abbreviation of \xw{[above left]}, and similarly for \xw{[ar]}, \xw{[bl]}, and \xw{[br]}.
-
-\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
-% Example: information set
-\begin{istgame}
-\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}
-
-
-
-
-\section{Important distances: \protect\cmd{\xtdistance}}
-
-\label{sec:xtdistance}
-
-The length and the direction of branches in a simple tree can be controlled by the macro \icmd{\xtdistance}.
-Here, the prefix `xt' stands for `extensive tree.'
-
-\begin{tcblisting}{listing only}
-% syntax: \xtdistance
- \xtdistance[<level depth>]{<level dist>}{<sibling dist>}
-% defaults: <level dist> is the only mandatory argument
- [1]{15mm}{15mm}
-\end{tcblisting}
-
-\cmd{\xtdistance} sets or resets the level and sibling distances.
-You can use \cmd{\xtdistance} at any time you want to change the length and the direction of branches.
-Since we are dealing with simple `parent-child' tree structures, \xw{<level depth>} is \xw{1} by default.
-However, the level depth number other than 1 is not expected to be used.
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: \xtdistance
-\begin{istgame}
-\xtdistance{15mm}{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
-\istroot(a)
-\end{istgame}
-\end{tcblisting}
-
-For example, \cmd{\xtdistance\{20mm\}\{30mm\}} internally assigns \xw{20mm} to \icmd{\xtlevdist} and \xw{30mm} to \icmd{\xtsibdist}, which renews the default distances.
-
-\mbigskip1
-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, the label of action, and the payoffs and their positions.
-Below we will see in more detail how the core macros and others work.
-
-
-\section{The \env{istgame} environment and node styles}
-
-\subsection{The \env{istgame} environment}
-
-\label{ssec:envistgame}
-
-This package provides the \ienv{istgame} environment, which is almost the sane as \ienv{tikzpicture} environment,
-so this accepts all the options of the \env{tikzpicture} environment.
-
-\mbigskip1
-\begin{tcblisting}{listing only}
-% definition: istgame environment
-\def\istgamefontsize{\normalsize}
-\NewDocumentCommand\setistgamefontsize {m}
- {\renewcommand*{\istgamefontsize}{#1}
- }
-\NewDocumentEnvironment{istgame}{O{}} % accepts tikzpicture options
- {\begin{tikzpicture}[font=\istgamefontsize,>=stealth,#1]
- }
- {\end{tikzpicture}
- }
-\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}|.
-
-
-\subsection{Node styles}
-
-\label{sec:nodestyles}
-
-The \cmd{tikzstyle}'s of the six basic node styles are predefined.
-
-\begin{itemize}\tightlist
-\item \ixw{plain node}: draws nothing (defaults: \xw{inner sep=1pt}, \xw{outer sep=0pt})
-\item \ixw{null node}: \begin{istgame}\istroot(0)[null node]\endist\end{istgame} (very small node, not expected to be used)
-\item \ixw{solid node}: \begin{istgame}\istroot(0)[solid node]\endist\end{istgame} (default node style)
-\item \ixw{hollow node}: \begin{istgame}\istroot(0)[hollow node]\endist\end{istgame}
-\item \ixw{rectangle node}: \begin{istgame}\istroot(0)[rectangle node]\endist\end{istgame}
-\item \ixw{ellipse node}: \begin{istgame}\istroot(0)[ellipse node]\endist\end{istgame}
-\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}
-
-\mbigskip1
-
-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
-\tikzstyle{decision node}=[solid node] % decision nodes
-\tikzstyle{terminal node}=[solid node] % terminal nodes
-\tikzstyle{initial node}=[hollow node]
-\tikzstyle{chance node}=[hollow node]
-\end{tcblisting}
-
-The set of all nodes of a game tree can be partitioned into
-the set of \xw{decision nodes}\index{decision node} and that of \xw{terminal nodes}\index{terminal node}.
-You can use \ixw{initial node}
-to distinguish the \ixw{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}|.
-
-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
-\tikzstyle{box node}=[rectangle node]
-\tikzstyle{square node}=[rectangle node]
-\tikzstyle{oval node}=[ellipse node]
-\end{tcblisting}
-
-For aliases, you can also change the node styles, like \verb|\setistDecisionNodeStyle[blue]{3pt}| or \verb|\setistBoxNodeStyle{3pt}[green][.5]|.
-
-\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 \cmd{\istroot} defines the root of a game or a subgame at a designated location, specifies the owner of the (sub)root, and does other functions.
-In game theoretic terminology, \cmd{\istroot} designates a decision node and its owner (or a player).
-
-\begin{tcblisting}{listing only,breakable}
-% \istroot
-% syntax:
- \istroot[<grow keyval>,<opt>](<coor1>)(<coor2>)[<node style>,<opt>]%
- <owner label angle>{<owner>}+<lev-distance>..<sib-distance>+
-% defaults:
- [south]()(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}
-
-The only mandatory argument 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 solid node. You can change the node style to, for example, an \xw{oval node} or a \xw{box node}.
-
-The owner of a decision node (or a player) is expressed with curly braces.
-The position of the owner of a decision node is specified with angle brackets, like \xw{<90>}, \xw{<above>}, or \xw{<north>}.
-To specify the position of the 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.
-
-%\mbigskip1
-
-Here is a simple example of drawing a tree structure.
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: \istroot
-\begin{istgame}
-\istroot(0)
- \istb \istb \istb \endist
-\istroot(a)(0-1)
- \istb \istb \endist
-\end{istgame}
-\end{tcblisting}
-
-In the previous example, the game tree has the root named \xw{(0)}, located at \xw{(0,0)} by default, which has three branches.
-Since \tikz\ arranges branches of a tree counterclockwise, by default,
-the endpoints of the three branches are automatically named \xw{(0-1)}, \xw{(0-2)}, and \xw{(0-3)} from left to right or counterclockwise.
-
-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)} \ixw{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.
-
-\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)
-\xtOwner(0){(0)}
-\xtOwner(0-1){(0-1)}[r]
-\xtOwner(0-2){(0-2)}[b]
-\xtOwner(0-3){(0-3)}[b]
-\xtOwner(a){(a)}[l]
-\xtOwner(a-1){(a-1)}[b]
-\xtOwner(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}
-
-
-\mbigskip1
-
-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}.
-
-\mbigskip1
-
-\remark For some cases, you may want to use options other than the grow direction, in the bracket before \xw{(coor1)}. In this case, the first thing in the bracket must be \xw{<grow keyval>}, like \xw{[south,blue,dashed]} (see section \ref{sec:firstthing} on page \pageref{sec:firstthing}).
-
-\mbigskip1
-
-\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}
-\label{page:onesimpletree}
-
-
-\mbigskip1
-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 \xw{[above]} nor \xw{[below]}.
-
-\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, \xw{[below]} and \xw{[above]} are good,
-but not \xw{[down]} nor \xw{[up]}.
-So DO NOT USE \xw{[down]} and \xw{[up]} to specify the tree growing direction.
-
-\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}
-
-The last two options of \cmd{\istroot} specify the \xw{level distance} and the \xw{sibling distance}.
-This change of distances is valid only for the corresponding simple tree, while distance change by \cmd{\xtdistance} is valid within the current \pkg{istgame} environment unless it is 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 clockwise instead of counterclockwise.
-\cmd{\istroot'} arranges its branches \ixw{clockwise} (or from right to left if the tree grows down).
-
-Compare the following example with that of \cmd{\istroot} 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)
-\xtOwner(0){(0)}
-\xtOwner(0-1){(0-1)}[r]
-\xtOwner(0-2){(0-2)}[b]
-\xtOwner(0-3){(0-3)}[b]
-\xtOwner(a){(a)}[l]
-\xtOwner(a-1){(a-1)}[b]
-\xtOwner(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}
-
-
-We will look into this issue (of going counterclockwise or clockwise) in more detail in section \ref{sec:growing}, where we examine the tree growing direction.
-
-If you draw a game tree growing south, you don't need to worry about the swap version \cmd{\istroot'} and 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. With one exception to this, \cmd{\istrooto} works just like \cmd{\istroot}. Since the owner is shown in the specified node in \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>](<coor1>)(<coor2>)[<node style>]{<player>}+levd..sibd+
-% default: only (coor1) is mandatory, all others optional
- [south]()(0,0)[oval node]{}+15mm..15mm+
-\end{tcblisting}
-
-\mbigskip1
-
-The following example is the same as above with \cmd{\istroot} on page \pageref{page:onesimpletree}, but now with the oval version.
-
-\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.
-
-\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}
-
-Notice that the angle \xw{<180>}, \xw{<left>}, \xw{<right>}, or \xw{<135>} specifying the position of the owner's name is redundant to \cmd{\istrooto}.
-
-\mbigskip1
-
-\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}
-
-Note also that \cmd{\istrooto} arranges its branches \ixw{counterclockwise}.
-
-\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}
-
-
-\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 the owner within an oval node, by default.
-\mbigskip1
-
-
-\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
-\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}
-
-\mbigskip1
-The swap version is useful when a tree grows north or east.
-The following example shows the tree rotating to the north by using \icmd{\setistgrowdirection}.
-Note that \cmd{\istrooto'} arranges its branches \ixw{clockwise}.
-
-
-\mbigskip1
-\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}
-
-\mbigskip1
-
-%\noindent
-%* Known Problem: Two examples above show that \cmd{\setistbranchanchors} does not work as expected for the first child node anchor.
-
-
-
-%\clearpage
-
-\section{Core macro: \protect\cmd{\istb}}
-
-\label{sec:istb}
-
-\subsection{\protect\cmd{\istb}: basics}
-
-\label{ssec:istb}
-
-The macro \icmd{\istb}, basically, prints a 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 name \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.
-
-\mbigskip1
-The macro \cmd{\istb} also puts an action label and payoffs along with a branch, and does other functions.
-Note that the action labels and payoffs are defined to be typeset in the math mode,
-so you can use \verb|\text{...}| when you want to typeset them in the text mode.
-
-\mbigskip1
-\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}
-
-In the following example, each \cmd{\istb} draws a branch.
-With the option \xw{<missing>}\index{missing}, \cmd{\istb} prints an invisible branch.
-Since the third child is missing the last child was named \xw{(0-4)}.
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: \istb<missing>
-\begin{istgame}
-\istroot(0)
- \istb \istb \istb<missing> \istb \endist
-\istroot(D)(0-4)
- \istb \istb \endist
-\end{istgame}
-\end{tcblisting}
-
-\mbigskip1
-
-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.
-
-\mbigskip1
-
-\remark What is \icmd{\istgrowdirection} and what is it used for?\par
-
-\cmd{\istgrowdirection} has the value of \xw{[<grow keyval>]} typed in \cmd{\istroot} (default: \xw{south}).\par
-The value of \cmd{\istgrowdirection} specifies the direction of putting `payoffs' with \xw{south} by default.
-We will see this in more detail below.
-
-\mbigskip1
-
-For various line styles of a branch, you can use any options in \tikz\ of arrows, linewidth, color, and so on.
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: \istb (branch line styles)
-\begin{istgame}
-\istroot(0)
- \istb[dashed,thick]{A}{(0,1)}
- \istb[->]{}{(1,-1)}
- \istb[blue,very thick]{B}[above]{(1,2)}
- \endist
-\end{istgame}
-\end{tcblisting}
-
-\mbigskip1
-
-By default, an action label is put on the mid point of the corresponding branch.
-\mbigskip1
-
-To specify the position of an action label,
-you can use the positional words or their abbreviations below:\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]}.
-
-\remark Note that these abbreviations must be used with no other options, otherwise you will get a compile error.
-
-\mbigskip1
-
-In the following example, notice that the tree grows south east and the payoffs are placed south east.
-
-\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[blue,very thick]{B}[above]{(1,2)}
- \endist
-\end{istgame}
-\end{tcblisting}
-
-\mbigskip1
-
-If you do not like the position of the payoffs, you can change it by using degrees, the compass directions, or the positional words and their abbreviations mentioned above.
-In the following example, the tree grows south west, but the position of the payoffs at the end of the blue branch is changed to \xw{[below]}
-
-\mbigskip1
-
-\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[blue,very thick]{B}[right]{(1,2)}[below]
- \endist
-\end{istgame}
-\end{tcblisting}
-
-\subsection{\protect\cmd{\istb*} (starred version)}
-
-\label{ssec:istbstar}
-
-The starred version \icmd{\istb*} prints a solid node (by default) at the end of the corresponding branch.
-This is the only difference between \cmd{\istb} and \cmd{\istb*}.
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: \istb*
-\begin{istgame}
-\istroot[east](0)
- \istb[dashed,thick]{A}
- \istb*[->]{}{(1,-1)}
- \istb[blue,very thick]{B}[above]
- \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 `all' the endpoints of `simple trees' by \icmd{\xtShowEndPoints}.
-You can also change the shape of nodes of endpoints of simple trees by specifying it as an optional argument, like
-\cmd{\xtShowEndPoints[oval node]}.
-\icmd{\xtHideEndPoints} turns off the effect of \cmd{\xtShowEndPoints}.
-
-\mbigskip1
-
-\begin{tcblisting}{listing only,breakable}
-% \xtShowEndPoints
-% syntax:
- \xtShowEndPoints[<node style>]
-% default:
- [solid node]
-\end{tcblisting}
-
-\mbigskip1
-
-Here is an example of using \cmd{\xtShowEndPoints} and \cmd{\xtHideEndPoints}.
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: \xtShowEndPoints, \xtHideEndPoints
-\begin{istgame}
-\xtShowEndPoints[oval node]
-\istroot(0)[solid node]
- \istb[dashed,thick]{A}
- \istb
- \istb[very thick]{B}[ar]
- \endist
-\xtdistance{15mm}{10mm}
-\istroot(b)(0-2) \istb \istb \endist
-\xtHideEndPoints
-\istroot(b)(0-3) \istb \istb \endist
-\end{istgame}
-\end{tcblisting}
-
-
-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 printing a \pkg{solid node}.
-
-
-\subsection{\protect\cmd{\istb.}~(period version)}
-
-\label{ssec:istbperiod}
-
-The period version \icmd{\istb.}\ is designed to represent a `terminal move' in a game tree.
-Basically, \cmd{\istb.}\ works exactly the same way as \cmd{\istb} does.
-However, using \cmd{\istb.}\ together with \cmd{\xtShowTerminalNodes} can control the shape of all the terminal nodes at once.
-
-\subsubsection*{\protect\cmd{\xtShowTerminalNodes} and \protect\cmd{\xtHideTerminalNodes}}
-
-\label{page:terminalnode}
-
-The period version \cmd{\istb.}\ used with \icmd{\xtShowTerminalNodes} prints a 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}.
-
-\begin{tcblisting}{listing only,breakable}
-% \xtShowTerminalNodes (works only with \istb.)
-% syntax:
- \xtShowTerminalNodes[<node style>]
-% default:
- [solid node]
-\end{tcblisting}
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: \xtShowTerminalNodes, \xtHideTerminalNodes
-\begin{istgame}
-\xtShowTerminalNodes[oval node]
-\istroot(0)[solid node]
- \istb.[dashed,thick]{A}
- \istb
- \istb[very thick]{B}[ar]
- \endist
-\xtdistance{15mm}{10mm}
-\istroot(b)(0-2) \istb. \istb. \endist
-\xtHideTerminalNodes
-\istroot(b)(0-3) \istb. \istb. \endist
-\end{istgame}
-\end{tcblisting}
-
-
-
-\section{Players, action labels, and payoffs}
-
-\subsection{How to put players}
-
-\subsubsection{Players: basics}
-
-As discussed in \ref{ssec:istroot}, the macro \cmd{\istroot} specifies the (sub)root and puts its owner (or a 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{<0>}, or \xw{<45>}.
-To specify the direction you can use degrees, the compass directions, or the positional words.
-
-\mbigskip1
-
-\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}
-
-\remark
-The auxiliary macro \cmd{\xtOwner} is provided for an extra way of putting owners of decision nodes (see section \ref{sec:auxmac}).
-
-\mbigskip1
-Note that \cmd{\istrooto} produces a bubble type node with the owner in it, so the directional option \xw{<angle>} is redundant with \cmd{\istrooto} (see section \ref{ssec:istrootstar}).
-
-\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>{Parent}
- \istb \istb \endist
-\end{istgame}
-\end{tcblisting}
-
-\subsubsection{Coloring players or a whole simple tree: \protect\cmd{\istroot}}
-
-\label{sec:firstthing}
-
-You can change the color of a player's name by giving \xw{color} with the angle option of \cmd{\istroot}, like \xw{<[red]>} or \xw{<[blue]45>}.
-(This is the \tikz\ way for giving options for \xw{label}.)
-
-\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>{Parent}
- \istb \istb \endist
-\end{istgame}
-\end{tcblisting}
-
-\mbigskip1
-The following example 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.
-
-\mbigskip1
-\remark Note that the first thing in the \xw{[option]} of \cmd{\istroot} must be `the direction of tree growing,' so it should be set as \xw{[south,red]} or \xw{[-90,blue]}.
-\mbigskip1
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: coloring a simple tree
-\begin{istgame}
-\istroot[south,red](0)% all branches will be red
- [fill=red,draw=red]<[red]>{Child} % node/owner
- \istb \istb \endist
-\istroot[-90,blue](1)(0-2)% all, blue branches
- [blue]<[blue]45>{Parent}
- \istb \istb \endist
-\end{istgame}
-\end{tcblisting}
-
-\subsubsection{Decorating players or a whole simple tree: \protect\cmd{\istrooto}}
-
-With \cmd{\istrooto} the color of a player can be changed by \xw{[option]}, such as \xw{[red]} or \xw{[blue]}.
-(This is the \tikz\ way for giving options for \xw{node}.)
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: coloring players (with \istrooto)
-\begin{istgame}
-\istrooto(0)[red]{Child}
- \istb \istb \endist
-\istrooto(1)(0-2)[blue]{Parent}
- \istb \istb \endist
-\end{istgame}
-\end{tcblisting}
-
-The next example shows how you can color a whole simple tree \xw{red} or \xw{blue}.
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: coloring a simple tree (with \istrooto)
-\begin{istgame}
-\istrooto[south,red](0)[draw=green,blue]{Child}
- \istb \istb \endist
-\istrooto[-90,blue](1)(0-2)[draw=blue,blue]{Parent}
- \istb \istb \endist
-\end{istgame}
-\end{tcblisting}
-
-
-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 for giving options for nodes.
-
-\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}
-
-
-\subsection{How to put action labels}
-
-
-\subsubsection{Action labels: basics}
-
-The macro \cmd{\istb} prints a branch and its action label.
-Note that action labels are printed in the math mode.
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: actions labels
-\begin{istgame}
-\istroot(0)
- \istb{Good}[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}
-
-By default, \cmd{\istb} prints its action label on the mid point 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.
-
-Notice that with the abbreviations the position of the action labels are (internally) adjusted to get better result (for more details, see section \ref{sec:abb}).
-In the following example, the abbreviations are used.
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: actions labels with abbreviations
-\begin{istgame}
-\istroot(0)
- \istb{Good}[l] \istb{Bad} \endist
-\istroot(1)(0-2)
- \istb{\text{\fbox{$\alpha$}}}[al]
- \istb{\text{\fbox{$\beta$}}}[ar]
- \endist
-\end{istgame}
-\end{tcblisting}
-
-\mbigskip1
-
-\remark
-The auxiliary macro \cmd{\xtActionLabel} is provided for an extra way of putting an action label (see section \ref{sec:auxmac}).
-
-\subsubsection{Changing the color of action labels and the style of branches}
-
-You can change the color of action labels with \tikz\ options.
-In the following example, the bracket options before an action label are for a branch and those after are only for the action label.
-
-\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}
-
-\mbigskip1
-\remark It is important to remember that you cannot use the abbreviations with additional options. For example, you can do like \cmd{\itsb\{C\}[ar]}, but not \cmd{\istb\{B\}[ar,red]}. Instead, you should do \cmd{\istb\{C\}[above right,red]}.
-
-\subsection{How to put payoffs}
-
-\subsubsection{Payoffs: basics}
-
-The macro \cmd{\istb} can also print a branch and the corresponding payoffs near at its endpoint.
-Note also that payoffs are printed in the math mode. The payoffs are put in the direction set by \cmd{\setistgrowdirection} (\xw{south}, by default), unless it is changed by \xw{<grow keyval>} of \cmd{\istroot}.
-
-\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}
-
-\subsubsection{Payoffs and \protect\cmd{\istgrowdirection}}
-
-The direction of where payoffs are put from a terminal node follows \cmd{\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 the payoffs to put, you can use degrees, the compass words, or the positional words and their abbreviations.
-
-\mbigskip1
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: grow=south (default)
-\begin{istgame}
-\xtShowEndPoints[box node]
-\istroot(0)
- \istb[dashed,thick]{A}{\binom23}
- \istb*{}{(-2,3)}
- \istb.[blue,very thick]{B}[ar]{2,3}
- \endist
-\end{istgame}
-\end{tcblisting}
-
-By default, \xw{grow=south}, so \cmd{\istgrowdirection} is \xw{south} (or \xw{below} or \xw{-90}).\par
-This example shows payoffs at the south of terminal nodes.
-
-%\mbigskip1
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example: grow=right (or east or 0 degree)
-\begin{istgame}
-\xtShowTerminalNodes[oval node]
-\istroot[right](0)
- \istb[dashed,thick]{A}{\binom23}
- \istb*{}{(-2,3)}
- \istb.[blue,very thick]{B}[al]{2,3}
- \endist
-\xtHideTerminalNodes
-\end{istgame}
-\end{tcblisting}
-
-\verb|grow=right=\istgrowdirection|, so the payoffs are put on the right.
-%
-
-\mbigskip1
-\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)}
- \istb.[blue,very thick]{B}[bl]{2,3}
- \endist
-\end{istgame}
-\end{tcblisting}
-
-\verb|grow=north=\istgrowdirection|, so the payoffs are put above the terminal nodes.
-
-\mbigskip1
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-\begin{istgame}
-\istroot[south west](0)
- \istb[dashed,thick]{A}{\binom23}
- \istb{}{(-2,3)}
- \istb[blue,very thick]{B}[right]{2,3}[b]
- \endist
-\end{istgame}
-\end{tcblisting}
-
-\verb|grow=south west=\istgrowdirection|, so the payoffs are put below left of the terminal node.
-
-\mbigskip1
-You can adjust the direction of putting any payoff by specifying an option right after the payoff, like \verb|\istb[blue,very thick]{B}[right]{2,3}[below]|.
-
-You can use the 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}).
-
-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{Coloring payoffs}
-
-You can change the color of the payoffs by giving options with the positional words.
-For example you can do like \xw{\istb...\{(1,1)\}[[blue]below]}.
-This is the \tikz\ way of giving options for \xw{label}.
-Notice that, in this case, you should not use the abbreviation of the positional words.
-
-\begin{tcblisting}{listing outside text, righthand width=.2\linewidth}
-% Example: 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}
-
-%\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 the 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(ctm)[green]+8mm..24mm+
-%\istroot(0)(ctm){I}+8mm..8mm+
-% \istb{x}[r]
-% \istb<missing>
-% \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}, 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 abbreviations for payoffs and those for action labels work slightly differently in terms of \xw{xshift} and \xw{yshift}.)
-
-
-\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}}
-
-When you use these abbreviations you can manipulate the horizontal and/or the vertical shifts toward branches by using \icmd{\xtALPush}. (This is experimental!)
-
-%\mbigskip1
-
-\begin{tcblisting}{listing only}
-% syntax:
- \xtALPush{<xshift dim> for l and r}{<yshift dim> for a and b}
-% default:
- {0pt}{0pt}
-\end{tcblisting}
-
-\mbigskip1
-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 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}
-
-\mbigskip1
-
-%\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)
- \istb.[red]{\xbox{br}}[br]{1,1}
- \istb.[blue,dashed]{\xbox{bl}}[bl]{2,2}
- \endist
-\istroot[180](W)(0-3)
- \istb.[green]{\xbox{ar}}[ar]{0,3}
- \istb.[red]{\xbox{br}}[br]{2,1}
- \endist
-\istroot[-90](S)(0-4)
- \istb.[dotted]{\xbox{al}}[al]{1,-1}
- \istb.[green]{\xbox{ar}}[ar]{-1,1}
- \endist
-\istroot[0](E)(0-1)
- \istb.[blue,dashed]{\xbox{bl}}[bl]{1,3}
- \istb.[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.
-
-\mbigskip1
-
-You can also use \icmd{\xtALShift} to put and push labels horizontally and vertically. (This is experimental!)
-
-\begin{tcblisting}{listing only}
-% syntax:
- \xtALShift{<horizontal shift dim>}{<vertical shift dim>}
-% defaults:
- {1pt}{2pt}
-\end{tcblisting}
-
-\mbigskip1
-
-When the dimensions get bigger than the defaults (\xw{1pt} and \xw{2pt}) the labels get closer to the mid points of the corresponding branches, and when the numbers get smaller the labels get farther from their branches.
-
-\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:
-
-\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 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.
-
-\mbigskip1
-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}.
-
-\mbigskip1
-\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 \ixw{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 code 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 \ixw{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'}.
-
-
-\mbigskip1
-
-\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)
-
-\subsubsection{A tree growing east -- counterclockwise}
-
-\begin{tcblisting}{listing outside text, righthand width=.3\linewidth}
-% Example 3: \setistgrowdirection{east}
-\begin{istgame}
-\setistgrowdirection{east}
-% same code 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 code 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 code 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{\setistgrowkey} for one simple tree}
-
-\icmd{\setistgrowkey} 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.
-
-
-\begin{tcblisting}{listing only}
-% \setistgrowkey: definition
-\NewDocumentCommand\setistgrowkey{m}
-{ \renewcommand\xtgrow{#1}
-}
-% #1 is either grow or grow'
-\end{tcblisting}
-
-In the following example, by using \cmd{\setistgrowdirection'} the branches are arranged clockwise.
-So you will need to use \cmd{\setistgrow\{grow\}} to locally get back to `counterclockwise.'
-
-\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
-% Example: using \setistgrowdirection' (swap version)
-\begin{istgame}
-\setistgrowdirection'{east}
-\istroot(0)
- \istb{a}[al] \istb{b}[bl] \endist
-\istroot[north](1)(0-1)
- \istb{c}[bl] \istb{d}[br] \endist
-{\setistgrowkey{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}
-
-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{\setistgrowkey}.
-
-\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
-% Example: using \istroot' (swap version)
-\begin{istgame}
-\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{Information sets: \protect\cmd{\xtInfoset(')}}
-
-The macro \icmd{\xtInfoset} draws an information set, connecting two decision nodes.
-
-\begin{tcblisting}{listing only}
-% \xtInfoset
-% syntax: from left to right
-\xtInfoset[<info line type>](<from>)(<to>){<owner>}[<pos>,<node opt>]
-% defaults:
-[semithick,dotted]()(){}[above]
-\end{tcblisting}
-
-\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}
-
-\mbigskip1
-The swap version \icmd{\xtInfoset'} is provided, which is not very interested.
-
-\begin{tcblisting}{listing only}
-% \xtInfoset' (from right to left)
-% syntax:
-\xtInfoset'[<info line type>](<from>)(<to>){<owner>}[<pos>,<node opt>]
-% defaults:
-[semithick,dotted]()(){}[above]
-\end{tcblisting}
-
-\cmd{\xtInfoset'} connects two nodes from the coordinate \xw{(<to>)} to the coordinate \xw{(<from>)}, while \cmd{\xtInfoset} from the coordinate \xw{(<from>)} to the coordinate \xw{(<to>)}. So, basically, the two macros give the same result, without arrow tips.
-
-\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
-% Example: \xtInfoset'
-\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
-\xtInfoset'[->,very thick,red](1)(2){2}[left,blue]
-\end{istgame}
-\end{tcblisting}
-
-
-\subsection{Information sets: \protect\cmd{\xtInfosetO(')} (experimental)}
-
-The oval version \icmd{\xtInfosetO} prints a bubble type information set. (experimental!)
-
-
-\begin{tcblisting}{listing only}
-% \stInfosetO (from left to right)
-% syntax:
-\xtInfosetO[<info line type>](<from>)(<to>){<owner>}[<pos>,<node opt>](<sep>)
-\end{tcblisting}
-
-\cmd{\xtInfosetO} prints a dotted rectangle with rounded corners, connecting two nodes.
-The size of the information set can be changes by the \xw{(<sep>)} option, whose default value is \xw{4pt}.
-
-
-\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
-% Example: \setistgrowdirection{south} -- default
-\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(1)(2){2}
-\end{istgame}
-\end{tcblisting}
-
-
-\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
-% Example: \setistgrowdirection'{east}
-\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(1)(2){2}
-\end{istgame}
-\end{tcblisting}
-
-You can change the color or the size of the information set by using options, as shown in the following example:
-
-\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
-% Example: \setistgrowdirection'{north}
-\begin{istgame}
-\setistgrowdirection'{north}
-\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](1)(2){2}(6pt){1pt}
-\end{istgame}
-\end{tcblisting}
-
-
-\mbigskip2
-
-The swap version \icmd{\xtInfosetO'} is also provided, which you should be aware of.
-
-\begin{tcblisting}{listing only}
-% \xtInfosetO' (from right to left)
-% syntax:
-\xtInfosetO'[<info line type>](<from>)(<to>){<owner>}[<pos>,<node opt>](<sep>)
-% defaults:
-[semithick,densely dotted]()(){}[](4pt)
-\end{tcblisting}
-
-When do we need the swap version \cmd{\xtInfosetO'}?
-Let's look at the following example, where you would not be satisfied with how the information sets look.
-
-\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
-% Example: \setistgrowdirection{north}
-\begin{istgame}
-\setistgrowdirection{north}
-\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(1)(2){2}
-\xtInfosetO'(1-1)(1-2){1}(6pt)
-\end{istgame}
-\end{tcblisting}
-
-
-The rule of thumb for using \cmd{\xtInfosetO'} is this: whenever the bubbled information set turns out to be short,
-use the swap version. You can use \cmd{\xtInfosetO} and \cmd{\xtInfosetO'} interchangeably, to get correct results.
-
-More precisely, if you follow the tips about the combinations of \cmd{\setistgrowdirection(')} and the compass directions, as suggested on page \pageref{page:growtips}, you will get correct results.
-However, if you use the combinations other than the suggestions, you will probably get the short information set. Then, use \cmd{\xtInfosetO'}.
-
-%\clearpage
-
-\section{Continuum of branches}
-
-The package \pkg{istgame} provides two types of macros to represent a \ixw{continuum of branches}: \cmd{\istcntm} and \cmd{\istcntmarc}. Each of the two macros, basically, works like \cmd{\istroot}, but just draws a background to express a continuum of branches.
-
-\subsection{\protect\cmd{\istcntm} (standard version)}
-
-\subsubsection{Basics}
-
-The first type macro \icmd{\istcntm} is the standard version. This, in fact, draws a background with the optional color filled representing a continuum of branches (the default color is \verb|black!25|).
-The shape of the background is a isosceles triangle, with the height of \icmd{\cntmlevdist} (\xw{8mm} by default) and the base of \icmd{\cntmsibdist} (initially \xw{3*8mm} or \xw{24mm} by default).
-
-
-\begin{tcblisting}{listing only}
-% \istcntm
-% syntax:
-\istcntm[<grow keyval>](<coor1>)(<coor2>)[<fill color>]+<levdist>..<sibdist>+
-% defaults:
-[south]()(0,0)[black!25]+8mm..3*8mm+
-\end{tcblisting}
-
-%\mbigskip1
-
-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} 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
-\begin{istgame}[scale=1.2]
-\istcntm(ctm)
-\istroot(0)(ctm){I}+\cntmlevdist..\cntmlevdist+
- \istb{x}[r] \istb<missing> \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+
- \istb<missing> \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+
- \istb<missing> \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+
- \istb<missing> \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}
-
-
-
-\subsection{\protect\cmd{\istcntmarc} (arc version)}
-
-The second type macro \icmd{\istcntmarc} is the arc version, which draws a background of two branches connected with an arc to represent a continuum of branches.
-
-\begin{tcblisting}{listing only}
-% \istcntmarc
-% syntax:
-\istcntmarc[<grow keyval>](<coor1>)(<coor2>)[<color,opt>]{<num>}+levdist..sibdist+
-% defaults:
-[south]()(0,0)[bend right]{.5}+8mm..3*8mm+
-\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.
-
-
-\mbigskip1
-
-\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
-% Example: \istcntmarc
-\begin{istgame}[scale=1.2]
-\istcntmarc(ctm)
-\istroot(0)(ctm){I}+\cntmlevdist..\cntmlevdist+
- \istb{x}[r] \istb<missing> \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}
-
-\mbigskip1
-
-You can also change the line style and the curvature of the arc by options such as \xw{very thick}, \xw{red}, \xw{dotted}, and \xw{bend right=45}.
-
-
-\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
-% Example: \istcntmarc
-\begin{istgame}[scale=1.2]
-\istcntmarc(ctm)[bend right=45,very thick,red,dotted]{.65}
-\istroot(0)(ctm){I}+\cntmlevdist..\cntmlevdist+
- \istb{x}[r] \istb<missing> \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}
-
-You can change the length of background branches connected by an arc in the same manner as used in \cmd{\istcntm}.
-
-
-\subsection{Examples}
-
-In the following example, the base angle of the background isosceles triangle is 30\textdegree.
-
-\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
-% Example: \istcntm and \istcntmarc
-\begin{istgame}[scale=1.2]
-\istcntm(period1)[green]+8mm..2*sqrt(3)*8mm+
-\istroot(0)(period1){I}+\cntmlevdist..\cntmlevdist+
- \istb{x}[r]
- \istb<missing>
- \endist
-\xtdistance{10mm}{20mm}
-\istroot(1)(0-1)<[label distance=-3pt]120>{II}
- \istb{Y}[al]{x,1-x}
- \istb{N}[ar]
- \endist
-%---------------------------------------------------------
-\istcntmarc(period2)(1-2)%
- [thick,dashed,red]+8mm..2*sqrt(3)*8mm+
-\istroot(2)(period2){II}+\cntmlevdist..\cntmlevdist+
- \istb{y}[r]
- \istb<missing>
- \endist
-\xtdistance{10mm}{20mm}
-\istroot(3)(2-1)<[label distance=-3pt]120>{I}
- \istb{Y}[al]{1-y,y}
- \istb{N}[ar]{0,0}
- \endist
-\end{istgame}
-\end{tcblisting}
-
-\mbigskip1
-
-You can also rotate a tree with a continuum of branches.
-When it is necessary, you should use \xw{[bend left]} to get a correct result as shown in the following example:
-
-\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
-% Example: tree growing east
-\begin{istgame}[scale=1.2]
-\setistgrowdirection'{east}
-\istcntm(period1)[green]+8mm..2*sqrt(3)*8mm+
-\istroot(0)(period1)<180>{I}+\cntmlevdist..\cntmlevdist+
- \istb{x}[b]
- \istb<missing>
- \endist
-\xtdistance{10mm}{20mm}
-\istroot(1)(0-1)<[label distance=-3pt]120>{II}
- \istb{Y}[al]{x,1-x}
- \istb{N}[bl]
- \endist
-%---------------------------------------------------------
-\istcntmarc(period2)(1-2)%
- [bend left=45,thick,dashed,red]+8mm..2*sqrt(3)*8mm+
-\istroot(2)(period2)<180>{II}+\cntmlevdist..\cntmlevdist+
- \istb{y}[b]
- \istb<missing>
- \endist
-\xtdistance{10mm}{20mm}
-\istroot(3)(2-1)<[label distance=-3pt]120>{I}
- \istb{Y}[al]{1-y,y}
- \istb{N}[bl]{0,0}
- \endist
-\end{istgame}
-\end{tcblisting}
-
-
-\section{Auxiliary macros}
-
-\label{sec:auxmac}
-
-The \pkg{istgame} package also provides some auxiliary macors, which enable you to add players, action labels, payoffs, and others to your tree.
-
-\begin{description}\tightlist
-\item
-\icmd{\xtInfosetOwner} is an auxiliary tool for putting the owner of an information set.
-\item
-\icmd{\xtActionLabel} is an auxiliary tool for putting an action label to a branch.
-\item
-\icmd{\xtOwner} is an auxiliary tool for putting the owner of a node (or a player).
-\item
-\icmd{\xtPayoff} is an auxiliary tool for putting payoffs.
-\item
-\icmd{\xtNode} is another tool for putting `something' into a node. This `something' could be the owner of a node.
-\item
-\icmd{\xtNode*} puts `something' into a \ixw{plain node}.
-\end{description}
-
-syntax: \xw{\xtInfosetOwner(<from>)(<to>){<owner>}[<pos>,<node opt>]}
-
-syntax: \xw{\xtActionLabel(<from>)(<to>){<action>}[<pos>,<node opt>]}
-
-syntax: \xw{\xtOwner(<coor>){<owner>}[<pos>,<node opt>]}
-
-syntax: \xw{\xtPayoff(<coor>){<payoff>}[<pos>,<node opt>]}
-
-syntax: \xw{\xtNode[<opt>](<coor>)[<node style>,<node opt>]\{owner\}}
-
-syntax: \xw{\xtNode*(<coor>)\{owner\}}
-
-\mbigskip1
-The auxiliary 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 auxiliary macros, all the coordinates such as \xw{(<from>)}, \xw{(<to>)}, and \xw{(<coor>)} are mandatory arguments.
-
-\begin{tcblisting}{}
-% Example: auxiliary macros
-\begin{istgame}[scale=2]
-\istroot(0)[chance node]
- \istb[dashed]{A}
- \istb*
- \istb*[blue,very thick]{B}[right,xshift=2pt,yshift=2pt,red]
- \endist
-\xtInfosetO(0)(0)(2.5pt)
-\xtInfoset[thick](0-1)(0-2){1}
-\xtInfosetO[thick,red](0-2)(0-3){2}
-\xtInfoset[dashed,bend right=25](0-1)(0-3)
-%-----------------
-\xtActionLabel(0)(0-3){\epsilon}[bl] % 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 auxiliary macros (other than \cmd{\xtNode}),
-you can use the 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 within brackets.
-For example, the option \xw{[b]} or \xw{[below]} or \xw{[below,xshift=5pt]} works, but not \xw{[b,xshift=5pt]}.
-
-\mbigskip1
-
-\begin{tcblisting}{listing above text, righthand width=.3\linewidth,breakable}
-% Example:
-\begin{istgame}[font=\scriptsize]
-\xtdistance{10mm}{20mm}
-\istcntm(ctm) % period 1
-\istroot(1)(ctm){1}+\cntmlevdist..10mm+
- \istb{x}[r]
- \istb<missing>
- \endist
-\istroot(A1)(1-1)<[label distance=-3pt]135>{2}
- \istb{A}[al]{x,1-x}
- \istb{R}[ar]
- \endist
-\xtOwner(1){period 1}[xshift=30mm]
-\istcntm(ctm)(A1-2) % period 2
-\istroot(2)(ctm){2}+\cntmlevdist..10mm+
- \istb{y}[r]
- \istb<missing>
- \endist
-\istroot(A2)(2-1)<[label distance=-3pt]135>{1}
- \istb{A}[al]{1-y,y}
- \istb{R}[ar]
- \endist
-\xtOwner(2){period 2}[xshift=25mm]
-\xtPayoff(A2-1){\left(\makecell{\delta\\\delta}\right)\cdots}[below,xshift=-40pt]
-\istcntm(ctm)(A2-2) % period 3
-\istroot(3)(ctm){1}+\cntmlevdist..10mm+
- \istb{x}[r]
- \istb<missing>
- \endist
-\istroot(A3)(3-1)<[label distance=-3pt]135>{2}
- \istb{A}[al]{x,1-x}
- \istb{R}[ar]{0,0}
- \endist
-\xtOwner(3){period 3}[xshift=20mm]
-\xtPayoff(A3-1){\left(\makecell{\delta^2\\\delta^2}\right)\cdots}[below,xshift=-50pt]
-\end{istgame}
-\end{tcblisting}
-
-%\subsection{More supplement macros}
-%
-%\indent\indent
-%syntax: \xw{\xtShowEndPoints[<node style>]}
-%
-%syntax: \xw{\xtHideEndPoints[<node style>]}
-%
-%syntax: \xw{\xtShowTerminalNodes[<node style>]} % work with \istb.
-%
-%syntax: \xw{\xtHideTerminalNodes[<node style>]}
-%
-%\mbigskip2
-%
-%\icmd{\xtShowEndPoints} is to control the node shape of every endpoint of every simple tree.
-%(For more details, see page \pageref{page:endpoint}.)
-%
-%\icmd{\xtHideEndPoints} turns off the effect of \cmd{\xtShowEndPoints}.
-%
-%\icmd{\xtShowTerminalNodes} works only with \cmd{\istb.}\@ to control the node shape of terminal nodes.
-%(For more details, see page \pageref{page:terminalnode}.)
-%
-%\icmd{\xtHideTerminalNodes} turns off the effect of \cmd{\xtShowTerminalNodes}.
-
-\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 \ixw{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:
- (){}[rectangle,dashed,inner sep=20pt,rounded corners=15pt,black!50]
- *(){}[rectangle,inner sep=20pt,rounded corners=15pt,red!20]
-\end{tcblisting}
-
-
-%\begin{tcblisting}{listing only}
-%% \xtSubgameBox(*)
-%% syntax:
-% \xtSubgame(*)(<subroot coor>){(<coor1>) (<coor2>) ... }[<opt>]
-%%% \xtSubgameBox: definition
-%\def\xtdefaultsubrootshiftoval{0,-.3}
-%\NewDocumentCommand\xtSubgameBox{ s r() m O{} }
-%{ \IfBooleanTF #1
-% {
-% \coordinate (xtsubroot) at ($(#2)+(\xtdefaultsubrootshiftoval)$);
-% \begin{scope}[on background layer]
-% \node [rectangle,fill=red!20,inner sep=20pt,rounded corners=15pt,#4]
-% [fit=(xtsubroot) #3] {};
-% \end{scope}
-% }
-% {
-% \coordinate (xtsubroot) at ($(#2)+(0,-.3)$);
-% \begin{scope}[on background layer]
-% \node [rectangle,draw,dashed,inner sep=20pt,rounded corners=15pt,black!50,#4]
-% [fit=(xtsubroot) #3] {};
-% \end{scope}
-% }
-%}
-%\end{tcblisting}
-
-
-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}.
-
-\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(*)} (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:
- (){}[ellipse,dashed,inner sep=20pt,rounded corners=15pt,black!50]
- *(){}[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}
-
-\mbigskip1
-
-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 following example, 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{More examples}
-
-You can change the shape of a subgame repesentation 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 is one more example, which shows 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}
-
-
-
-\section{Miscellany}
-
-\subsection{Various branch types, directions, and lengths}
-
-What follows is an example of how to deal with various line types, directions, and lengths of branches.
-
-\mbigskip1
-\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}
- \istb<grow=30,level distance=30mm>[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}
-
-\mbigskip1
-
-\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.
-
-\mbigskip1
-
-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}
-
-
-It is not possible to make a subgame stay put where it appears in a whole game.
-(Repalce \xw{[black!5]} with \xw{[white]} to make the rest of the game disappear in the following example.)
-
-\mbigskip1
-
-\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 backward induction, when you analyze an extensive game.
-By using \cmd{\istb} with options, you can change the color and the style of a line representing a branch and an arrow tip to it.
-
-\mbigskip1
-
-\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
-% Example: backward induction
-\begin{istgame}
-\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}
-
-
-%\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}
-
-%\mbigskip1
-
-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 fontsize 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=.4\linewidth,breakable}
-\begin{istgame}[->,>=stealth,shorten >=.8pt]
-\xtdistance{15mm}{30mm}
-\istroot(0)[initial node]{Child}
- \istb{Good}[left]{(0,2)}
- \istb{Bad}[right]
- \endist
-\istroot(1)(0-2)<30>{Parent}
- \istb{Forgive}[left]{(1,1)}
- \istb{Punish}[right]{(-1,-1)}
- \endist
-\end{istgame}
-\end{tcblisting}
-
-\medskip
-
-\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
-\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}
-
-\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
-\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=.4\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)<left>{1}
- \istb{L}[al]
- \istb{R}[ar]
- \endist
-\xtInfosetO(1-1)(1-2){2}(6pt)
-\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}
-
-
-\begin{tcblisting}{listing outside text, righthand width=.4\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}
-
-
-
-\subsection{A game tree with a strategic game}
-
-\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
-%\usepackage{tabu}
-%\NewExpandableDocumentCommand\xcol{mO{c|}m}
-% {\multicolumn{#1}{#2}{\ensuremath{#3}}}
-\begin{istgame}
-\xtdistance{10mm}{40mm}
-\istroot(0)[initial node]{1}
- \istb{Book}[al]{2,2}
- \istb{Concert}[ar]
- \endist
-\xtPayoff(0-2){
- \begin{tabu}spread0pt{X[$c1]*2{|X[$c2]}|}
- \xcol1[c]{~} & \xcol1[c]{B} & \xcol1[c]{S} \\\tabucline{2-}
- B & 3,1 & 0,0 \\\tabucline{2-}
- S & 0,0 & 1,3 \\\tabucline{2-}
- \end{tabu}
- }
-\end{istgame}
-\end{tcblisting}
-
-
-%\clearpage
-
-\subsection{Larger game trees}
-
-\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){2} \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) \istb \istb \endist
-\istroot(d)(3-2){3} \istb \istb \endist
-\xtInfoset(1)(2){2}
-\xtInfosetO(2-3)(3-1){3}
-\xtInfosetO(3-2)(3-2)
-\end{istgame}
-\end{tcblisting}
-
-
-\begin{tcblisting}{}
-\begin{istgame}
-\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){2} \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
-\istroot(d)(0-4) \istb \istb \endist
-\xtInfosetO(1)(2){2}
-\xtInfoset[bend right=10](a)(c){3}[below,yshift=-8pt]
-\xtInfoset[bend left=10](b)(d){3}[xshift=20pt,yshift=13pt]
-\end{istgame}
-\end{tcblisting}
-
-
-
-%\clearpage
-\subsection{Tic-tac-toe (sketch)}
-
-% tic-tac-toe
-\begin{tcblisting}{}
-% tic-tac-toe (sketch)
-\begin{istgame}[scale=1.7,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}[xshift=10pt,right]
-\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]
-\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]
-\xtShowEndPoints
-\xtdistance{15mm}{30mm}
-\istroot(0)[chance node]{N}
- \istb{Black}[al]
- \istb{Red}[ar]
- \endist
-\xtdistance{15mm}{30mm}
-\istroot(1-1)(0-1){1}
- \istb<grow=-135,level distance=10mm>{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}
- \istb<grow=-135,level distance=10mm>{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}
-\xtActionLabel(0)(0-1){[\frac12]}[br]
-\xtActionLabel(0)(0-2){[\frac12]}[bl]
-\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]
-\setistgrowdirection{0} % default grow-direction is 'east' from now on
-\xtdistance{15mm}{30mm}
-\istroot(0)[chance node]<left>{N}
- \istb{Black}[bl]
- \istb{Red}[al]
- \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
-\xtInfosetO'(1-1-2)(1-2-2){2} % \xtInfosetO'
-\xtActionLabel(0)(0-1){[\frac12]}[ar]
-\xtActionLabel(0)(0-2){[\frac12]}[br]
-\end{istgame}
-\end{tcblisting}
-
-\begin{tcblisting}{}
-% poker: growing east -- clockwise (swap version)
-\begin{istgame}[scale=1.3]
-\setistgrowdirection'{0} % \setistgrowdirection'
-\xtdistance{15mm}{30mm}
-\istroot(0)[chance node]<left>{N}
- \istb{Black}[al]
- \istb{Red}[bl]
- \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}
-\xtActionLabel(0)(0-1){[\frac12]}[br]
-\xtActionLabel(0)(0-2){[\frac12]}[ar]
-\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]
- \istb<grow=south>{L}[l]
- \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
-\xtdistance{10mm}{20mm}
-% subtree after H is chosen
-\istroot(H)(H0-1)
- \istb{Buy}[br]
- \istb{Refrain}[ar]{-E,0}
- \endist
-\istcntm(cntm)(H-1)+10mm..20mm+
-\istroot(H1)(cntm)+10mm..8mm+
- \istb{p_2^H}[b]
- \istb<missing>
- \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
-\istcntm(cntm)(L-1)+10mm..20mm+
-\istroot(L1)(cntm)+10mm..8mm+
- \istb<missing>
- \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]
-\xtActionLabel(0)(0-1){\pi}[r]
-\xtActionLabel(0)(0-2){1-\pi}[r]
-\end{istgame}
-\end{tcblisting}
-
-\mbigskip2
-
-\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) This version, to be submitted 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 an option
- \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{\xtgrowprime} 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{\setistgrowkey} 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). A special thanks goes to Kangsoo Kim from KTUG for his great help in using \pkg{expl3} to simplify the appearance and the usage of the macros.
-
-
-\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, \textit{\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), \textit{An Introduction of 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}
diff --git a/Master/texmf-dist/doc/latex/istgame/istgame-doc-v2.0.tex b/Master/texmf-dist/doc/latex/istgame/istgame-doc-v2.0.tex
new file mode 100644
index 00000000000..aa91c4d8076
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/istgame/istgame-doc-v2.0.tex
@@ -0,0 +1,7464 @@
+%!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}
diff --git a/Master/texmf-dist/doc/latex/istgame/istgame-doc.pdf b/Master/texmf-dist/doc/latex/istgame/istgame-doc.pdf
index 9afa27d0302..5c0dcfea078 100644
--- a/Master/texmf-dist/doc/latex/istgame/istgame-doc.pdf
+++ b/Master/texmf-dist/doc/latex/istgame/istgame-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/istgame/istgame-doc.tex b/Master/texmf-dist/doc/latex/istgame/istgame-doc.tex
index eec92b2280b..af88f6a5d22 100644
--- a/Master/texmf-dist/doc/latex/istgame/istgame-doc.tex
+++ b/Master/texmf-dist/doc/latex/istgame/istgame-doc.tex
@@ -5,14 +5,22 @@
% arara: xelatex: {synctex: yes}
% arara: xelatex: {synctex: yes}
-% 2017/09/04 v1.0
-\def\tmpdate{2017/09/04}
-\def\tmpversion{1.0}
+\def\tmpdate{2019/01/27} % final
+\def\tmpversion{2.0}
-\documentclass[a4paper]{oblivoir}
+\def\printtikztreetest{}
+\def\printtest{}
+\def\printdoc{}
+%\renewcommand\printtikztreetest{\input{istgame_test_tree}}
+%\renewcommand\printtest{\input{istgame_test}}
+\renewcommand\printdoc{\include{istgame-doc-v2.0}}
+
+\documentclass[a4paper,amsmath]{oblivoir}
+
+\usepackage{istgame}
\usepackage{fapapersize}
-\usefapapersize{*,*,30mm,*,28mm,28mm}
+\usefapapersize{*,*,30mm,*,28mm,*}
\setsecnumdepth{subsubsection}
\settocdepth{subsubsection}
\setlength\cftsubsubsectionindent{4.5em}
@@ -24,63 +32,74 @@
\renewcommand\indexname{Index}
\renewcommand\pagerefname{\kern-4pt}
-\usepackage{tabu}
+\hypersetup{pdfborder={0 0 0}} % to suppress the hyperlink red box
+
\usepackage{mathtools}
-%\usepackage{xparse} %% oblivoir will load xparse
-%\usepackage{tikz} %% istgame will load tikz
+%\usepackage{xparse} %% oblivoir loads xparse
+%\usepackage{tikz} %% istgame loads tikz
\usepackage{makecell}
\usepackage{capt-of}
\usepackage{multido}
-\usepackage{ulem}
+\usepackage[normalem]{ulem} % [normalem] to correct the pdf bookmark broken characters
\usepackage{idxlayout}
+%\usepackage{url}
-\usepackage{istgame}
+%\setistdefaultnodedrawcolor{red} % test
+%\setistdefaultnodefillcolor{black!16} % (try for macos mohave dark mode, TeXShop background color)
\usepackage{tcolorbox}
\tcbuselibrary{listings,breakable}
- \tcbset{breakable,listing above text,center upper,sidebyside gap=10pt,lower separated=true,center lower,
+ \tcbset{breakable,listing above text,center upper,sidebyside gap=10pt,
+ lower separated=true,center lower,
listing options={
style=tcblatex,
keywordstyle=\color{blue},
commentstyle=\color{black!20!green},
- morekeywords={istgame,istroot,istrooto,istb,endist,xtdistance,
- istcntm,istcntmarc,setistgrowdirection,istgrowdirection,
+ morekeywords={
+ istgamefontsize,setistgamefontsize,setistgamearrowendshorten,
+ istgame,istroot,istrooto,istb,endist,xtdistance,istbm,
+ istbt,istB,istBt,istbA,cntmAInfoset,cntmAInfosetO,
+ istrootcntm,istrootcntmA,istrootocntm,istrootocntmA,
+ setistgrowdirection,istgrowdirection,
+ setistmathTF,istownerlmathtrue,istownermathfalse,istactioinlabelmathtrue,
+ istactionlabelmathfalse,istpayoffmathtrue,istpayoffmathfalse,
+ cntmdistance,cntmlevdist,cntmsibdist,
+ cntmApreset,cntmistb,cntmAistb,cntmAexpostShowEndPoints,
xtInfoset,xtInfosetO,xtActionLabel,
- xtSubgame,xtSubgameBox,xtSubgameOval,istgamefontsize,setistgamefontsize,
- xtgrow,setistgrowkey,xtInfosetOwner,xtOwner,xtPayoff,xtNode,
+ xtSubgame,xtSubgameBox,xtSubgameOval,
+ xtgrow,setxtgrowkey,xtInfosetOwner,xtOwner,xtPayoff,xtNode,
+ xtALPush,xtALShift,
xtShowEndPoints,xtHideEndPoints,
xtShowTerminalNodes,xtHideTerminalNodes,
+ xtTimeLineH,xtTimeLineV,xtCommentTo,xtCommentFrom,xtShowArrows,xtHideArrows,
xtlevdist,xtsibdist,
+ xtShowArrows,xtHideArrows,xtShowMidArrows,xtHideMidArrows,
+ setxtshowarrows,setxtmidarrows,setxtshowmidarrows,
+ setxtinfosetlayer,setxtsubgamelayer,
+ setistNewNodeStyle,
setistDecisionNodeStyle,setistOvalNodeStyle,
setistSolidNodeStyle,setistHollowNodeStyle,
setistEllipseNodeStyle,setistNullNodeStyle,setistRectangleNodeStyle,
- cntmdistance,cntmlevdist,cntmsibdist,
xtALpush,xtALshift,
xtdefaultsubrootshiftoval,
- \tikzstyle,\draw,\node,\coordinate,\foreach,
- NewDocumentCommand,NewDocumentEnvironment,IfBooleanTF
+ tikzstyle,draw,coordinate,foreach,setlength,
+ NewDocumentCommand,NewDocumentEnvironment,IfBooleanTF,tikzset,
+ xtCInfoset,xtCInfosetO,xtCInfosetOTurnX,
+ cntmpreset,cntmApreset,cntmAlayerpreset
+ setxtinfosetstyle,setxtarrowtips,setxtinfosetstyle
}
}
}
%\usepackage{tikz-qtree} %%% DO NOT USE
-
-%%% to resolve the conflict with tikz-qtree
-%\RenewDocumentEnvironment{istgame}{O{}} % accepts tikzpicture options
-% {\begin{tikzpicture}[%
-% edge from parent path={(\tikzparentnode\istparentanchor) --
-% (\tikzchildnode\istchildanchor)}, % tikz-qtree conflict resolved
-% font=\istgamefontsize,>=stealth,#1
-% ]
-% }
-% {\end{tikzpicture}
-% }
+% or, add the following in the option
+% [ edge from parent path={(\tikzparentnode) -- (\tikzchildnode)} ]
\linespread{1}
\newcommand*\Tikz{Ti\textit{k}Z}
-\let\tikz\Tikz
+\let\TikZ\Tikz
\newenvironment{keywords}{%
\par\vskip2pt
@@ -99,19 +118,34 @@
{\multicolumn{#1}{#2}{\ensuremath{#3}}}
%% more lazy macros
-\newcommand\mbigskip[1]{\multido{}{#1}\bigskip}
+\newcommand\xbigskip[1]{\multido{}{#1}\bigskip}
+\newcommand\xmedskip[1]{\multido{}{#1}\bigskip}
+\newcommand\xsmallskip[1]{\multido{}{#1}\bigskip}
\def\hpara{\hangpara{1.52em}{1}}
+\def\listdivider{\leavevmode\smallskip\hrule width 1.5em\smallskip}
\newcommand\remark{\noindent \textbf{Remark: }}
+\newcommand\warning{\noindent \textbf{Warning: }}
%% index
-\renewcommand\cmd[1]{\cmdprint{#1}}
-\newcommand\xword[1]{\cmd{#1}}
+%\renewcommand\cmd[1]{\cmdprint{#1}}
+\ExplSyntaxOn
+\renewcommand \cmd [1]
+{
+ \texorpdfstring
+ { \cmdprint {#1} }
+ { \textbackslash \cs_to_str:N #1 }
+}
+\ExplSyntaxOff
+
\newcommand\xw[1]{\cmd{#1}}
+\newcommand\xttw[1]{\texttt{#1}}
\newcommand\pkg[1]{\textsf{#1}}
\newcommand\env[1]{\textsf{#1}}
-\newcommand\ixw[1]{\cmd{#1}\index{#1}}
-\newcommand\isw[1]{#1\index{#1}}
+\newcommand\isw[1]{#1\index{#1}} % simple word in text/index
+\newcommand\ixsw[1]{\cmd{#1}\index{#1}} % texttt in text, simple word in index
+\newcommand\ixw[1]{\textsf{#1}\index{#1@\textsf{#1}}} % textsf in text/index
+\newcommand\ixttw[1]{\texttt{#1}\index{#1@\texttt{#1}}} % texttt in text/index
\newcommand\ipkg[1]{\textsf{#1}\index{#1@\textsf{#1}}}
\newcommand\ienv[1]{\textsf{#1}\index{#1@\textsf{#1}}}
@@ -123,22 +157,25 @@
\makeindex
\title{\texttt{istgame.sty} \\
-Drawing Game Trees with \tikz}
+Draw Game Trees with \Tikz}
\author{In-Sung Cho \\ \texttt{ischo <at> ktug.org}}
\date{Economics, Kongju National University\\[3pt] \tmpdate\quad version \tmpversion}
+\def\tmpclearpage{\clearpage}
+
%%=======================================================================
\begin{document}
\frontmatter
\maketitle
+\renewcommand{\abstracttextfont}{\normalfont\small\noindent\ignorespaces}
\begin{abstract}
This is a \LaTeX{} package that provides macros based on \Tikz\ to draw a game tree. The main idea underlying the core macros here is the completion of a whole tree by using a sequence of simple `parent-child' tree structures, with no longer nested relations involved like the use of grandchildren or great-grandchildren.
-With the \ipkg{istgame} package, you can draw a game tree as if you were drawing a game tree with a pen and paper.
+With the \ipkg{istgame} package, you can draw a game tree as easily as drawing a game tree with pen and paper.
\begin{keywords}
-game trees, nodes, branches, information sets, subgames
+game trees, nodes, branches, information sets, continuum of branches, subgames
\end{keywords}
\end{abstract}
@@ -146,8 +183,10 @@ game trees, nodes, branches, information sets, subgames
\mainmatter
-%\input{istgame_test}
-\include{istgame-doc-v1.0}
+
+\printtikztreetest
+\printtest
+\printdoc
\printindex
diff --git a/Master/texmf-dist/doc/latex/istgame/istgame.ist b/Master/texmf-dist/doc/latex/istgame/istgame.ist
index 2ab21a67f2c..813fdbce596 100644
--- a/Master/texmf-dist/doc/latex/istgame/istgame.ist
+++ b/Master/texmf-dist/doc/latex/istgame/istgame.ist
@@ -13,4 +13,4 @@ heading_suffix " 】}\\nopagebreak\n"
%numhead_positive "Numbers"
delim_0 "\\quad "
delim_1 "\\quad "
-delim_2 "\\quad "
+delim_2 "\\quad " \ No newline at end of file
diff --git a/Master/texmf-dist/tex/latex/istgame/istgame.sty b/Master/texmf-dist/tex/latex/istgame/istgame.sty
index f7fdd51d801..04d00fc4448 100644
--- a/Master/texmf-dist/tex/latex/istgame/istgame.sty
+++ b/Master/texmf-dist/tex/latex/istgame/istgame.sty
@@ -2,7 +2,7 @@
%%
%% Drawing Game Trees with TikZ
%%
-%% (C) Copyright 2015-2017 In-Sung Cho <ischo at ktug.org>
+%% (C) Copyright 2015-2019 In-Sung Cho <ischo at ktug.org>
%%
%% This work may be distributed and/or modified
%% under the conditions of the LaTeX Project Public License,
@@ -11,483 +11,803 @@
%% http://www.latex-project.org/lppl.txt.
%%
%% -------------------------------------------------
-\ProvidesPackage{istgame-ktug}[2017/09/04 v1.0]
+\ProvidesPackage{istgame}[2019/01/27 v2.0 Draw Game Trees with TikZ]
% expl3,xparse: LPPL
% tikz: LPPL and/or GNU GPL
\RequirePackage{expl3,xparse,tikz}
-\usetikzlibrary{calc,arrows,shapes,positioning,patterns,trees,fit,backgrounds,quotes}
+\usetikzlibrary
+{
+ trees , calc , arrows , shapes , positioning ,
+ backgrounds , % for information sets and subgames
+ fit , % for \xtSubgameBox(Oval)
+ decorations.markings , % for \xtShowArrows and middle arrows
+ patterns , intersections % for additional use
+}
+
+% backgrounds
+\pgfdeclarelayer{background}
+\pgfdeclarelayer{behind}
+\pgfdeclarelayer{above}
+\pgfdeclarelayer{foreground}
+
+\pgfsetlayers{background,behind,main,above,foreground}
%% prefixes for macros and defaults
% \ist<...> stands for "an insung's simple tree" (or "it's a simple tree")
% \xt<...> stands for "extensive tree"
+% \xtCI stands for "curved information set"
+% \cntm<...> stands for "continuum"
+% \cntmA<...> stands for "continuum arc"
% \istdefault@<...>
% \xtdefault@<...>
+% \xtCI@default@<...>
+% \cntm@default@<...>
+% \cntmA@default@<...>
%% node styles
+\ExplSyntaxOn
+
% basics (in node styles)
-\def\istdefault@nodeinnersep{1pt} %% default node inner sep
-\def\istdefault@nodeoutersep{0pt} %% default node outer sep
-\def\istdefault@nodedrawcolor{black} %% default node color
-\def\istdefault@nodebgcolor{white} %% default node background color
-\newcommand*\setistdefaultnodeinnersep[1]{\renewcommand*\istdefault@nodeinnersep{#1}}
-\newcommand*\setistdefaultnodeoutersep[1]{\renewcommand*\istdefault@nodeoutersep{#1}}
-\newcommand*\setistdefaultnodebgcolor[1]{\renewcommand*\istdefault@nodebgcolor{#1}}
-\newcommand*\setistdefaultnodedrawcolor[1]{\renewcommand*\istdefault@nodedrawcolor{#1}}
+\def\istdefault@node@innersep{1pt} %% default node inner sep
+\def\istdefault@node@outersep{0pt} %% default node outer sep
+\def\istdefault@node@drawcolor{black} %% default node color
+\def\istdefault@node@fillcolor{white} %% default node background color
+% (can be used in preamble)
+\newcommand*\setistdefaultnodeinnersep[1]{\renewcommand*\istdefault@node@innersep{#1}}
+\newcommand*\setistdefaultnodeoutersep[1]{\renewcommand*\istdefault@node@outersep{#1}}
+\newcommand*\setistdefaultnodefillcolor[1]{\renewcommand*\istdefault@node@fillcolor{#1}}
+\newcommand*\setistdefaultnodedrawcolor[1]{\renewcommand*\istdefault@node@drawcolor{#1}}
% plain node: definition
-\def\istplainnodeinnersep{\istdefault@nodeinnersep} % 1pt by default
-\def\istplainnodeoutersep{\istdefault@nodeoutersep} % 0pt by default
+\newcommand*\istplainnodeinnersep { \istdefault@node@innersep } % 1pt by default
+\newcommand*\istplainnodeoutersep { \istdefault@node@outersep } % 0pt by default
-\NewDocumentCommand\setistPlainNodeStyle
- {G{\istdefault@nodeinnersep}G{\istdefault@nodeinnersep}}
- {
- \renewcommand*\istplainnodeinnersep{#1} % 0pt (mandatory)
- \renewcommand*\istplainnodeoutersep{#2}
- }
-\tikzstyle{plain node}=[%
- inner sep=\istplainnodeinnersep,outer sep=\istplainnodeoutersep,
- draw=none]
+% {inner sep} {outer sep}
+\NewDocumentCommand \setistPlainNodeStyle
+{ G{\istdefault@node@innersep} G{\istdefault@node@outersep} }
+{
+ \renewcommand*\istplainnodeinnersep {#1} % 1pt by default
+ \renewcommand*\istplainnodeoutersep {#2} % 0pt by default
+}
+\tikzset{ plain~node /.style =
+ {
+ draw = none ,
+ inner~sep = \istplainnodeinnersep , outer~sep = \istplainnodeoutersep
+ }
+}
% null node: definition
-\def\istnullnodedrawcolor{\istdefault@nodedrawcolor} % (#1) black
-\def\istnullnodebgcolor{\istdefault@nodedrawcolor} % (#2) <= black
-\def\istdefault@nullnodesize{.2pt} % null node defaultsize
-\def\istnullnodesize{\istdefault@nullnodesize} % (#3)
-\def\istnullnodebgopacity{1} % (#4)
-
-\NewDocumentCommand\setistNullNodeStyle
- {O{\istdefault@nodedrawcolor}mO{\istdefault@nodedrawcolor}O{1}}
+\newcommand*\istnullnodedrawcolor { \istdefault@node@drawcolor } % (#1) black
+\def\istdefault@null@nodesize { .2pt } % default of (#2)
+\def\istdefault@null@node@fillcolor { \istnullnodedrawcolor } % fill color = draw color
+\newcommand*\istnullnodesize { \istdefault@null@nodesize } % (#2)
+\newcommand*\istnullnodefillcolor { \istdefault@node@drawcolor } % (#3) <= black (o.k.)
+\newcommand*\istnullnodefillopacity { 1 } % (#4)
+
+% [draw color] {minimum size} [fill color] [fill opacity]
+\NewDocumentCommand \setistNullNodeStyle
+{ O{\istdefault@node@drawcolor} G{\istdefault@null@nodesize} O{\istdefault@null@node@fillcolor} O{1} }
+{
+ \renewcommand*\istnullnodedrawcolor{#1}
+ \renewcommand*\istnullnodesize{#2} % .2pt by default
+ \IfNoValueTF {#3}
{
- \renewcommand*\istnullnodedrawcolor{#1}
- \renewcommand*\istnullnodesize{#2} % mandatory
- \renewcommand*\istnullnodebgcolor{#3} % same as {#1}
- \renewcommand*\istnullnodebgopacity{#4}
+ \renewcommand*\istnullnodefillcolor{#1} % same as {#1} with default black
}
-\tikzstyle{null node}=[circle,draw,minimum size=\istnullnodesize,%
- draw=\istnullnodedrawcolor,fill=\istnullnodedrawcolor,fill opacity=\istnullnodebgopacity,%
- inner sep=0pt,outer sep=\istdefault@nodeoutersep]
+ {
+ \renewcommand*\istnullnodefillcolor{#3}
+ }
+ \renewcommand*\istnullnodefillopacity{#4}
+}
+\tikzset{ null~node /.style =
+ {
+ circle , draw , thin , solid ,
+ inner~sep = 0pt , outer~sep = \istdefault@node@outersep ,
+ minimum~size = \istnullnodesize ,
+ draw = \istnullnodedrawcolor ,
+ fill = \istnullnodedrawcolor ,
+ fill~opacity = \istnullnodefillopacity
+ }
+}
% solid node: definition
-\def\istsolidnodedrawcolor{\istdefault@nodedrawcolor} % (#1) black
-\def\istsolidnodebgcolor{\istdefault@nodedrawcolor} % (#2) <= black
-\def\istdefault@solidnodesize{2.4pt} % (#3)
-\def\istsolidnodesize{\istdefault@solidnodesize} % (#3)
-\def\istsolidnodebgopacity{1} % (#4)
-
-\NewDocumentCommand\setistSolidNodeStyle
- {O{\istdefault@nodedrawcolor}G{\istdefault@solidnodesize}O{\istdefault@nodedrawcolor}O{1}}
+\newcommand*\istsolidnodedrawcolor { \istdefault@node@drawcolor } % (#1) black
+\def\istdefault@solid@node@size { 2.4pt } % default of (#2)
+\def\istdefault@solid@node@fillcolor { \istsolidnodedrawcolor }
+\newcommand*\istsolidnodesize { \istdefault@solid@node@size } % (#2)
+\newcommand*\istsolidnodefillcolor { \istdefault@solid@node@fillcolor } % (#3) <= black (o.k.)
+\newcommand*\istsolidnodefillopacity { 1 } % (#4)
+
+% [draw color] {minimum size} [fill color] [fill opacity]
+\NewDocumentCommand \setistSolidNodeStyle
+{ O{\istdefault@node@drawcolor} G{\istdefault@solid@node@size} O{\istdefault@solid@node@fillcolor} O{1} }
+{
+ \renewcommand*\istsolidnodedrawcolor{#1}
+ \renewcommand*\istsolidnodesize{#2}
+ \IfNoValueTF {#3}
+ {
+ \renewcommand*\istsolidnodefillcolor{#1} % same as {#1} with default black
+ }
+ {
+ \renewcommand*\istsolidnodefillcolor{#3}
+ }
+ \renewcommand*\istsolidnodefillopacity{#4}
+}
+\tikzset{ solid~node /.style =
{
- \renewcommand*\istsolidnodedrawcolor{#1}
- \renewcommand*\istsolidnodesize{#2} % mandatory
- \renewcommand*\istsolidnodebgcolor{#3} % same as {#1}
- \renewcommand*\istsolidnodebgopacity{#4}
+ circle , draw , thin , solid ,
+ inner~sep = 0pt , outer~sep = \istdefault@node@outersep ,
+ minimum~size = \istsolidnodesize ,
+ draw = \istsolidnodedrawcolor ,
+ fill = \istsolidnodefillcolor ,
+ fill~opacity = \istsolidnodefillopacity
}
-\tikzstyle{solid node}=[circle,draw,minimum size=\istsolidnodesize,%
- draw=\istsolidnodedrawcolor,fill=\istsolidnodedrawcolor,fill opacity=\istsolidnodebgopacity,%
- inner sep=0pt,outer sep=\istdefault@nodeoutersep]
+}
% decision node & terminal node
\let\setistDecisionNodeStyle\setistSolidNodeStyle
\let\setistTerminalNodeStyle\setistSolidNodeStyle
% hollow node: definition
-\def\isthollownodedrawcolor{\istdefault@nodedrawcolor} % (#1) black
-\def\isthollownodebgcolor{\istdefault@nodebgcolor} % (#2) white
-\def\istdefault@hollownodesize{2.8pt} % (#3)
-\def\isthollownodesize{\istdefault@hollownodesize} % (#3)
-\def\isthollownodebgopacity{1} % (#4)
-
-\NewDocumentCommand\setistHollowNodeStyle
- {O{\istdefault@nodedrawcolor}G{\istdefault@hollownodesize}O{\istdefault@nodebgcolor}O{1}}
+\newcommand*\isthollownodedrawcolor { \istdefault@node@drawcolor } % (#1) black
+\def\istdefault@hollow@node@size { 2.8pt } % default of (#2)
+\newcommand*\isthollownodesize { \istdefault@hollow@node@size } % (#2)
+\newcommand*\isthollownodefillcolor { \istdefault@node@fillcolor } % (#3) white
+\newcommand*\isthollownodefillopacity { 1 } % (#4)
+
+% [draw color] {minimum size} [fill color] [fill opacity]
+\NewDocumentCommand \setistHollowNodeStyle
+{ O{\istdefault@node@drawcolor} G{\istdefault@hollow@node@size} O{\istdefault@node@fillcolor} O{1} }
+{
+ \renewcommand*\isthollownodedrawcolor{#1}
+ \renewcommand*\isthollownodesize{#2}
+ \renewcommand*\isthollownodefillcolor{#3}
+ \renewcommand*\isthollownodefillopacity{#4}
+}
+\tikzset{ hollow~node /.style =
{
- \renewcommand*\isthollownodedrawcolor{#1}
- \renewcommand*\isthollownodesize{#2} % mandatory
- \renewcommand*\isthollownodebgcolor{#3}
- \renewcommand*\isthollownodebgopacity{#4}
+ circle , draw , thin , solid ,
+ inner~sep = 0pt , outer~sep = \istdefault@node@outersep ,
+ minimum~size = \isthollownodesize ,
+ draw = \isthollownodedrawcolor ,
+ fill = \isthollownodefillcolor ,
+ fill~opacity = \isthollownodefillopacity
}
-\tikzstyle{hollow node}=[circle,draw,minimum size=\isthollownodesize,%
- draw=\isthollownodedrawcolor,fill=\isthollownodebgcolor,fill opacity=\isthollownodebgopacity,%
- inner sep=0pt,outer sep=\istdefault@nodeoutersep]
+}
% initial node & chance node
\let\setistInitialNodeStyle\setistHollowNodeStyle
\let\setistChanceNodeStyle\setistHollowNodeStyle
% rectangle node: definition
-\def\istrectanglenodedrawcolor{\istdefault@nodedrawcolor} %(#1) black
-\def\istdefault@rectanglenodesize{4pt} % (#2)
-\def\istrectanglenodesize{\istdefault@rectanglenodesize} % (#2)
-\def\istrectanglenodebgcolor{\istdefault@nodebgcolor} % (#3) white
-\def\istrectanglenodebgopacity{1} % (#4)
-
-\NewDocumentCommand\setistRectangleNodeStyle
- {O{\istdefault@nodedrawcolor}G{\istdefault@rectanglenodesize}O{\istdefault@nodebgcolor}O{1}}
- {
+\newcommand*\istrectanglenodedrawcolor { \istdefault@node@drawcolor } %(#1) black
+\def\istdefault@rectangle@node@size { 4pt } % default of (#2)
+\newcommand*\istrectanglenodesize { \istdefault@rectangle@node@size } % (#2)
+\newcommand*\istrectanglenodefillcolor { \istdefault@node@fillcolor } % (#3) white
+\newcommand*\istrectanglenodefillopacity { 1 } % (#4)
+
+% [draw color] {minimum size} [fill color] [fill opacity]
+\NewDocumentCommand \setistRectangleNodeStyle
+{ O{\istdefault@node@drawcolor} G{\istdefault@rectangle@node@size} O{\istdefault@node@fillcolor} O{1} }
+{
\renewcommand*\istrectanglenodedrawcolor{#1}
- \renewcommand*\istrectanglenodesize{#2} % mandatory
- \renewcommand*\istrectanglenodebgcolor{#3}
- \renewcommand*\istrectanglenodebgopacity{#4}
+ \renewcommand*\istrectanglenodesize{#2}
+ \renewcommand*\istrectanglenodefillcolor{#3}
+ \renewcommand*\istrectanglenodefillopacity{#4}
+}
+\tikzset{ rectangle~node /.style =
+ {
+ rectangle , draw , thin , solid ,
+ inner~sep = 2pt , outer~sep = \istdefault@node@outersep ,
+ minimum~size = \istrectanglenodesize ,
+ draw = \istrectanglenodedrawcolor ,
+ fill = \istrectanglenodefillcolor ,
+ fill~opacity = \istrectanglenodefillopacity
}
-\tikzstyle{rectangle node}=[rectangle,draw,minimum size=\istrectanglenodesize,%
- draw=\istrectanglenodedrawcolor,fill=\istrectanglenodebgcolor,fill opacity=\istrectanglenodebgopacity,%
- inner sep=2pt,outer sep=\istdefault@nodeoutersep]
+}
% box node & square node
\let\setistBoxNodeStyle\setistRectangleNodeStyle
\let\setistSquareNodeStyle\setistRectangleNodeStyle
% ellipse node: definition
-\def\istellipsenodedrawcolor{\istdefault@nodedrawcolor} % (#1) black
-\def\istdefault@ellipsenodesize{5pt} % (#2)
-\def\istellipsenodesize{\istdefault@ellipsenodesize} % (#2)
-\def\istellipsenodebgcolor{\istdefault@nodebgcolor} % (#3) white
-\def\istellipsenodebgopacity{1} % (#4)
-
-\NewDocumentCommand\setistEllipseNodeStyle
- {O{\istdefault@nodedrawcolor}G{\istdefault@ellipsenodesize}O{\istdefault@nodebgcolor}O{1}}
- {
+\newcommand*\istellipsenodedrawcolor { \istdefault@node@drawcolor } % (#1) black
+\def\istdefault@ellipse@node@size { 4.8pt } % default of (#2)
+\newcommand*\istellipsenodesize { \istdefault@ellipse@node@size } % (#2)
+\newcommand*\istellipsenodefillcolor { \istdefault@node@fillcolor } % (#3) white
+\newcommand*\istellipsenodefillopacity { 1 } % (#4)
+
+\NewDocumentCommand \setistEllipseNodeStyle
+{ O{\istdefault@node@drawcolor} G{\istdefault@ellipse@node@size} O{\istdefault@node@fillcolor} O{1} }
+{
\renewcommand*\istellipsenodedrawcolor{#1}
- \renewcommand*\istellipsenodesize{#2} % mandatory
- \renewcommand*\istellipsenodebgcolor{#3}
- \renewcommand*\istellipsenodebgopacity{#4}
+ \renewcommand*\istellipsenodesize{#2}
+ \renewcommand*\istellipsenodefillcolor{#3}
+ \renewcommand*\istellipsenodefillopacity{#4}
+}
+\tikzset{ ellipse~node /.style =
+ {
+ ellipse , draw , thin , solid ,
+ inner~sep = 1.5pt , outer~sep = \istdefault@node@outersep ,
+ minimum~size = \istellipsenodesize ,
+ draw = \istellipsenodedrawcolor ,
+ fill = \istellipsenodefillcolor ,
+ fill~opacity = \istellipsenodefillopacity
}
-\tikzstyle{ellipse node}=[ellipse,draw,minimum size=\istellipsenodesize,%
- draw=\istellipsenodedrawcolor,fill=\istellipsenodebgcolor,fill opacity=\istellipsenodebgopacity,%
- inner sep=1.5pt,outer sep=\istdefault@nodeoutersep]
+}
% oval node
\let\setistOvalNodeStyle\setistEllipseNodeStyle
%% aliases: node styles
-\tikzstyle{initial node}=[hollow node]
-\tikzstyle{chance node}=[hollow node]
-\tikzstyle{decision node}=[solid node] % decision nodes
-\tikzstyle{terminal node}=[solid node] % terminal nodes
-\tikzstyle{box node}=[rectangle node]
-\tikzstyle{square node}=[rectangle node]
-\tikzstyle{oval node}=[ellipse node]
+\tikzset{ initial~node /.style = hollow~node }
+\tikzset{ chance~node /.style = hollow~node }
+\tikzset{ decision~node /.style = solid~node } % decision nodes
+\tikzset{ terminal~node /.style = solid~node } % terminal nodes
+\tikzset{ box~node /.style = rectangle~node }
+\tikzset{ square~node /.style = rectangle~node }
+\tikzset{ oval~node /.style = ellipse~node }
+
+
+% \setistNewNodeStyle
+% {node name} [node opt] {minimum size}
+\NewDocumentCommand \setistNewNodeStyle { m O{} G{6mm} }
+{
+ \tikzset
+ { #1 /.style =
+ {
+ - , circle , thin , solid ,
+ inner~sep = \istdefault@node@innersep ,
+ minimum~size = #3 ,
+ draw = \istdefault@node@drawcolor ,
+ fill = \istdefault@node@fillcolor ,
+ #2
+ }
+ }
+}
-% node anchors
-\let\istparentanchor\tikzparentanchor % empty by default
-\let\istchildanchor\tikzchildanchor % empty by default
-\newcommand*\setistparentanchor[1]{\renewcommand*\istparentanchor{.#1}}
-\newcommand*\setistchildanchor[1]{\renewcommand*\istchildanchor{.#1}}
+%% input mode changer: (math mode True/False) - owner, action labels, payoff
-\NewDocumentCommand\setistbranchanchors{mG{center}}
- {\def\istparentanchor{.#1} \def\istchildanchor{.#2}
- }
+% owner: (default: mathfalse)
+\newcount\istmathflagowner
+\def\istownermathtrue { \istmathflagowner = 1 }
+\def\istownermathfalse { \istmathflagowner = 0 }
+\istownermathfalse % default declared : mathfalse
-% istgame environment
-\def\istgamefontsize{\normalsize}
-\NewDocumentCommand\setistgamefontsize {m}
- {\renewcommand*{\istgamefontsize}{#1}
- }
+% owner text font
+\newcommand*\istownertextfont [1] { \def\ist@owner@text@font {#1} }
+\istownertextfont { }
-\NewDocumentEnvironment{istgame}{O{}} % accepts tikzpicture options
- {\begin{tikzpicture}[font=\istgamefontsize,>=stealth,#1]
- }
- {\end{tikzpicture}
- }
+% \istownerstyle
+\NewDocumentCommand \istownerstyle { m }
+{
+ \ifnum 1 = \istmathflagowner
+ \ensuremath {#1}
+ \else
+ \expandafter \csname \ist@owner@text@font \endcsname {#1} % owner text font
+ \fi
+}
-%% to resolve a conflict with tikz-qtree
-%\RenewDocumentEnvironment{istgame}{O{}} % accepts tikzpicture options
-% {\begin{tikzpicture}[%
-% edge from parent path={(\tikzparentnode\istparentanchor) --
-% (\tikzchildnode\istchildanchor)}, % tikz-qtree conflict resolved
-% font=\istgamefontsize,>=stealth,#1
-% ]
-% }
-% {\end{tikzpicture}
-% }
+% action labels: (default: mathtrue)
+\newcount\istmathflagactionlabel
+\newcommand*\istactionlabelmathtrue { \istmathflagactionlabel = 1 }
+\newcommand*\istactionlabelmathfalse { \istmathflagactionlabel = 0 }
+\istactionlabelmathtrue % default declared : mathtrue
-%% istgame macros
+% action labels text font
+% used for automatic "italics" for action labels (with \setistmathTF*001 -- second zero)
+\newcommand*\istactionlabeltextfont [1] { \def\ist@actionlabel@text@font {#1} }
+\istactionlabeltextfont { }
+% \istactionlabelstyle
+\NewDocumentCommand \istactionlabelstyle{m}
+{
+ \ifnum 1 = \istmathflagactionlabel
+ \ensuremath {#1}
+ \else
+ \expandafter \csname \ist@actionlabel@text@font \endcsname {#1} % AL text font
+ \fi
+}
-%% basics (in child)
-% -- used in the definition of \istb
-\def\xtndot{node[solid node]{}} %% within child (node dot)
-\def\xttndot{node[terminal node]{}} %% within child (terminal node dot)
-\def\xtshowtndot{} %% (default: no terminal nodes printed)
-\def\xtshowendpoint{} %% (default: no endpoints printed)
+% payoffs: (default: mathtrue)
-% show and hide endpoints
-\NewDocumentCommand\xtShowEndPoints{O{solid node}}
- {
- \def\xtshowendpoint{node[#1]{}}
- \def\xtshowtndot{node[#1]{}}
- }
-\NewDocumentCommand\xtHideEndPoints{}
+\newcount\istmathflagpayoff
+\newcommand*\istpayoffmathtrue { \istmathflagpayoff = 1 }
+\newcommand*\istpayoffmathfalse { \istmathflagpayoff = 0 }
+\istpayoffmathtrue % default declared : mathtrue
+
+% payoff text font
+% (not used)
+\newcommand*\istpayofftextfont [1] { \def\ist@payoff@text@font {#1} }
+\istpayofftextfont { }
+
+% \istpayoffstyle
+\NewDocumentCommand \istpayoffstyle{m}
+{
+ \ifnum 1 = \istmathflagpayoff
+ \ensuremath {#1}
+ \else
+ \expandafter \csname \ist@payoff@text@font \endcsname {#1} % payoff text font
+ \fi
+}
+
+% \setistmathTF(*)
+% * {} {} {} <owner font> [action labels font] {payoff font]
+\NewDocumentCommand \setistmathTF{ s m m m D<>{} G{textit} O{} }
+{
+ \ifnum #2 = 1 \istownermathtrue \else \istownermathfalse \fi
+ \ifnum #3 = 1 \istactionlabelmathtrue \else \istactionlabelmathfalse \fi
+ \ifnum #4 = 1 \istpayoffmathtrue \else \istpayoffmathfalse \fi
+ \IfBooleanT {#1}
{
- \renewcommand*\xtshowendpoint{}
- \renewcommand*\xtshowtndot{}
+ \istownertextfont { #5 }
+ \istactionlabeltextfont { #6 }
+ \istpayofftextfont { #7 }
}
+}
+
+
+%% fine tuning: labels (experimental)
+\newcommand*\xtALxShift{0pt} % default xshift
+\newcommand*\xtALyShift{0pt} % default yshift
-% show and hide terminal nodes
-\NewDocumentCommand\xtShowTerminalNodes{O{terminal node}}
+\NewDocumentCommand \xtALPush { m m }
+{
+ \renewcommand*\xtALxShift{#1}
+ \renewcommand*\xtALyShift{#2}
+}
+
+\newcommand*\istactionlabelxshift{1pt} % default horizontal push (alternatively, .67pt)
+\newcommand*\istactionlabelyshift{2pt} % default vertical push (alternatively, 2.5pt)
+
+\NewDocumentCommand \xtALShift { G{\istactionlabelxshift} G{\istactionlabelyshift} }
+{
+ \renewcommand*\istactionlabelxshift{#1}
+ \renewcommand*\istactionlabelyshift{#2}
+}
+
+
+%% node anchors (experimental, used only in test, not documented)
+\let\istparentanchor\tikzparentanchor % empty by default
+\let\istchildanchor\tikzchildanchor % empty by default
+\newcommand*\setistparentanchor [1] { \renewcommand*\istparentanchor{.#1} }
+\newcommand*\setistchildanchor [1] { \renewcommand*\istchildanchor{.#1} }
+
+\NewDocumentCommand \setistbranchanchors{ m G{center} }
+{
+ \renewcommand*\istparentanchor {.#1}
+ \renewcommand \istchildanchor {.#2}
+}
+
+
+%%%%%%%%%%%%%%%%%
+%% istgame macros
+%%%%%%%%%%%%%%%%%
+
+%% basics (in child)
+% -- used in the definition of \istb and its variants
+\def\xt@ndot{node[solid~node]{}} % (within child) default node dot: decision node
+\def\xt@show@tndot{} % default: no terminal nodes printed
+\def\xt@show@endpoint{} % default: no endpoints printed
+\def\cntm@ndot{} % default: no cntm node dot printed
+\def\cntm@show@endpoint{} % default: no cntm endpoint printed
+
+
+\ExplSyntaxOff
+
+%%-----------------
+%% expl3 up to here (paused, because of colon problem)
+%%-----------------
+
+
+%% payoffs
+
+
+%---syntaxoff-----
+% remark: label={[opt]pos:{text}} (needed this form for \istgrowdirection to put payoffs)
+\NewDocumentCommand \istpayoff{ m +m }
+{
+ node [ inner sep = 0pt , text depth = .25ex ,
+ label = {#1:\istpayoffstyle{#2} } ] {} % colon here
+}
+
+%---syntaxoff-----
+% \ISTRoot
+% (used in \istroot)
+% ' [grow] (root) (at) [node] <angle> {owner} +levdis..sibdist+
+\NewDocumentCommand \ISTRoot
+{ t' O{south} r() D(){0,0} O{} D<>{} G{} D+.{\xtlevdist} D.+{\xtsibdist} }
+{
+ \IfBooleanTF {#1}
{
- \def\xtshowtndot{node[#1]{}}
+ \tikzset{level 1/.style = { level distance = #8 , sibling distance = #9 } } % colon here
+ \node (#3) at (#4) [decision node , #5 , label = {#6:{#7} } ]
+ {} [ \xt@growswap=#2 ]
}
-\NewDocumentCommand\xtHideTerminalNodes{}
{
- \renewcommand*\xtshowtndot{}
+ \tikzset{level 1/.style = { level distance = #8 , sibling distance = #9 } } % colon here
+ \node (#3) at (#4) [ decision node , #5 , label = {#6:{#7} } ]
+ {} [ \xt@grow=#2 ]
}
+}
-% moves and payoffs
-\def\xtpayoffstyle#1{$#1$}
-\newcommand*\xtpayoff[2]{node [inner sep=0pt, outer sep=0pt, label={#1:{\xtpayoffstyle{#2}}}] {}}
-\def\xtactionstyle#1{$#1$}
-\newcommand*\xtmove[3]{edge from parent [#1] node [#2] {\xtactionstyle{#3}}}
+%%-----------------
+%% expl3 from here again
+%%-----------------
+\ExplSyntaxOn
-%% main macros: \xtdistance, \istRoot, \istCntmRoot
-% \xtdistance
-\def\xtdefault@levdist{15mm} %% (default) level distance
-\def\xtdefault@sibdist{15mm} %% (default) sibling distance
-\newcommand*\xtlevdist{\xtdefault@levdist}
-\newcommand*\xtsibdist{\xtdefault@sibdist}
+%% main macros: \xtdistance, \ISTRoot(O), \ISTCntm(Arc)
+
+\def\xtdefault@levdist {15mm} %% (default) level distance : 15mm
+\def\xtdefault@sibdist {\xtdefault@levdist} %% (default) sibling distance : 15mm
+\newcommand*\xtlevdist {\xtdefault@levdist}
+\newcommand*\xtsibdist {\xtdefault@sibdist}
+
+\NewDocumentCommand \xtdistance
+{ O{1} m G{\xtdefault@sibdist} }
+{
+ \renewcommand*\xtlevdist {#2}
+ \renewcommand*\xtsibdist {#3}
+ \tikzset{ level~#1/.style = {level~distance = \xtlevdist , sibling~distance = \xtsibdist } }
+}
-%\NewDocumentCommand\xtdistance{O{1}mG{\setdefaultsibdist}}
-\NewDocumentCommand\xtdistance{O{1}mG{\xtdefault@sibdist}}
- {
- \renewcommand*\xtlevdist{#2}
- \renewcommand*\xtsibdist{#3}
- \tikzstyle{level #1}= [level distance=\xtlevdist,sibling distance=\xtsibdist]
- }
%% counterclockwise (grow=) or clockwise (grow'=)
% default: growing south counterclockwise
-\def\xtgrow{grow}
-\def\xtgrowprime{grow'}
-\def\istdefault@grow{south} % tree growing direction
-
-% \setistgrowkey
-\NewDocumentCommand\setistgrowkey{m}
-{ \renewcommand*\xtgrow{#1}
-}
+\def\xt@grow { grow }
+\def\xt@growswap { 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}
- }
+% \setxtgrowkey %% just for one simple tree
+\NewDocumentCommand \setxtgrowkey { m }
+{
+ \renewcommand*\xt@grow {#1}
}
+% growsawp call test
+\bool_new:N \xt_growswap_call_bool
+\bool_set_false:N \xt_growswap_call_bool
-% \istRoot
-\NewDocumentCommand\istRoot{t'O{south}r()D(){0,0}O{}D<>{}G{}D+.{\xtlevdist}D.+{\xtsibdist}}
-{
- \IfBooleanTF {#1}
+% \setistgrowdirection %% for whole tree
+\NewDocumentCommand \setistgrowdirection{ t' m }
+{ \IfBooleanTF {#1}
{
- \tikzstyle{level 1}=[level distance=#8,sibling distance=#9]
- \node (#3) at (#4) [decision node,#5,{label={#6:{#7}}}] {} [\xtgrowprime=#2]
+ \bool_set_true:N \xt_growswap_call_bool
+ \renewcommand*\xt@grow { grow' }
+ \renewcommand*\istdefault@grow {#2}
}
{
- \tikzstyle{level 1}=[level distance=#8,sibling distance=#9]
- \node (#3) at (#4) [decision node,#5,{label={#6:{#7}}}] {} [\xtgrow=#2]
+ \renewcommand*\xt@grow { grow }
+ \renewcommand*\istdefault@grow {#2}
}
}
-% \istRootO (oval version)
-\NewDocumentCommand\istRootO{t'O{south}r()D(){0,0}O{}D<>{}G{}D+.{\xtlevdist}D.+{\xtsibdist}}
+
+% \ISTRootO (oval version)
+% (used in \istrooto)
+% ' [grow] (root) (at) [node] <angle> {owner} +levdis..sibdist+
+\NewDocumentCommand \ISTRootO
+{ t' O{south} r() D(){0,0} O{} D<>{} G{} D+.{\xtlevdist} D.+{\xtsibdist} }
{
\IfBooleanTF {#1}
{
- \tikzstyle{level 1}=[level distance=#8,sibling distance=#9]
- \node (#3) at (#4) [oval node,#5] {#7} [\xtgrowprime=#2]
+ \tikzset { level~1/.style = { level~distance = #8 , sibling~distance = #9} }
+ \node (#3) at (#4) [ oval~node , #5 ] {#7} [ \xt@growswap = #2 ]
}
{
- \tikzstyle{level 1}=[level distance=#8,sibling distance=#9]
- \node (#3) at (#4) [oval node,#5] {#7} [\xtgrow=#2]
+ \tikzset { level~1/.style = { level~distance = #8 , sibling~distance = #9 } }
+ \node (#3) at (#4) [ oval~node , #5 ] {#7} [ \xt@grow = #2 ]
}
}
+%% istgame environment
-%% continuum of branches
+\def\istgame@default@fontsize { \normalsize }
+\def\istgame@default@arrowend@shorten { 0pt } % 0pt needed, otherwise affects all the lines
-\def\cntmdefault@levdist{8mm}
-\def\cntmdefault@sibdist{3*\cntmdefault@levdist}
-\newcommand*\cntmlevdist{\cntmdefault@levdist}
-\newcommand*\cntmsibdist{\cntmdefault@sibdist}
+\NewDocumentCommand \setistgamefontsize { m }
+{
+ \renewcommand*{\istgame@default@fontsize} {#1}
+}
-% \cntmdistance (internal use only)
-\NewDocumentCommand\cntmdistance{mG{\cntmdefault@sibdist}}
+\NewDocumentCommand \setistgameshorten { m }
{
-\renewcommand*\cntmlevdist{#1}
-\renewcommand*\cntmsibdist{#2}
+ \renewcommand*{\istgame@default@arrowend@shorten} {#1}
}
+% get ready for checking (x)(y)scale option
+\clist_new:N \l_parseopt_clist
-% \istCntmRoot
-\NewDocumentCommand\istCntmRoot{t'O{south}r()D(){0,0}O{black!25}G{.5}D+.{\cntmdefault@levdist}D.+{\cntmdefault@sibdist}}
+% \xtxscale
+\cs_new_nopar:Npn \get_xscale_option_string:n #1
{
- \IfBooleanTF {#1}
- {
- \cntmdistance{#7}{#8}
- \tikzstyle{level 1}=[level distance=\cntmlevdist,sibling distance=\cntmsibdist]
- \setistNullNodeStyle[#5]{\istdefault@nullnodesize}[#5]
- \node (#3) at (#4) [null node] {} [\xtgrowprime=#2] child child;
- \draw [#5,fill=#5] (#3) -- (#3-1) -- (#3-2) -- (#3);
- \setistNullNodeStyle{\istdefault@nullnodesize}
- }
- {
- \cntmdistance{#7}{#8}
- \tikzstyle{level 1}=[level distance=\cntmlevdist,sibling distance=\cntmsibdist]
- \setistNullNodeStyle[#5]{\istdefault@nullnodesize}[#5]
- \node (#3) at (#4) [null node] {} [\xtgrow=#2] child child;
- \draw [#5,fill=#5] (#3) -- (#3-1) -- (#3-2) -- (#3);
- \setistNullNodeStyle{\istdefault@nullnodesize}
- }
+ \get_opt_xvalue:w #1\q_stop
+}
+\cs_new_nopar:Npn \get_opt_xvalue:w #1=#2\q_stop
+{
+ % keep the value of xscale
+ \tl_gset:Nn \xtxscale { #2 }
}
+% \xtyscale
+\cs_new_nopar:Npn \get_yscale_option_string:n #1
+{
+ \get_opt_yvalue:w #1\q_stop
+}
+\cs_new_nopar:Npn \get_opt_yvalue:w #1=#2\q_stop
+{
+ % keep the value of yscale
+ \tl_gset:Nn \xtyscale { #2 }
+}
-% \istCntmRootArc (arc version)
-\NewDocumentCommand\istCntmRootArc{t'O{south}r()D(){0,0}O{}G{.5}D+.{\cntmdefault@levdist}D.+{\cntmdefault@sibdist}}
+% \xtscale
+\cs_new_nopar:Npn \get_scale_option_string:n #1
{
- \IfBooleanTF {#1}
- {
- \cntmdistance{#7}{#8}
- \tikzstyle{level 1}=[level distance=\cntmlevdist,sibling distance=\cntmsibdist]
- \node (#3) at (#4) [null node] {} [\xtgrowprime=#2] child child;
- \draw [bend right,#5] ($(#3)!#6!(#3-1)$) to ($(#3)!#6!(#3-2)$);
- }
- {
- \cntmdistance{#7}{#8}
- \tikzstyle{level 1}=[level distance=\cntmlevdist,sibling distance=\cntmsibdist]
- \node (#3) at (#4) [null node] {} [\xtgrow=#2] child child;
- \draw [bend right,#5] ($(#3)!#6!(#3-1)$) to ($(#3)!#6!(#3-2)$);
- }
+ \get_opt_value:w #1\q_stop
+}
+\cs_new_nopar:Npn \get_opt_value:w #1=#2\q_stop
+{
+ % keep the value of scale
+ \tl_gset:Nn \xtscale { #2 }
}
-%% subgames
+\DeclareDocumentEnvironment {istgame} { O{} } % accepts tikzpicture options
+{
+ % call set (false)
+ \bool_set_false:N \cntm_distance_call_bool % to distinguish cntm sibdist
+ \bool_set_false:N \cntm_act_sibdist_call_bool % from cntm action sibdist
+ \bool_set_false:N \xt_xscale_call_bool % for InfosetO, CInfosetO, and more
+ \bool_set_false:N \xt_yscale_call_bool % for InfosetO, CInfosetO, and more
+ \bool_set_false:N \xt_scale_call_bool % for InfosetO, CInfosetO, and more
+ \bool_set_false:N \_arrow_option_exist_bool % for arrow shorten
+ \bool_set_false:N \xt_growswap_call_bool % for CInfoset(O)
+ \bool_set_false:N \_istroot_cntmA_call_bool % for \istbA
+ \bool_set_false:N \_istroot_cntm_call_bool % for \istbA
+ \bool_set_false:N \_xt_levdist_local_call_bool % for \istbA
+ \bool_set_false:N \_cntm_distance_local_call_bool % for \istbA
+ \bool_set_false:N \_cntmA_distance_local_call_bool % for \istbA
+
+ % extract the value of xscale/yscale/scale
+ % (extract scale value, only if it is used alone)
+ \clist_set:Nn \l_parseopt_clist { #1 }
+ \tl_gset:Nn \xtxscale {1.0}
+ \tl_gset:Nn \xtyscale {1.0}
+ \tl_gset:Nn \xtscale {1.0}
+ \clist_map_inline:Nn \l_parseopt_clist
+ {
+ \str_if_in:nnTF { ##1 } { xscale }
+ {
+ \bool_set_true:N \xt_xscale_call_bool
+ \get_xscale_option_string:n { ##1 }
+ \str_if_in:nnT { ##1 } {yscale}
+ {
+ \bool_set_true:N \xt_yscale_call_bool
+ \get_yscale_option_string:n { ##1 }
+ }
+ }
+ {
+ \str_if_in:nnTF { ##1 } { yscale }
+ {
+ \bool_set_true:N \xt_yscale_call_bool
+ \get_yscale_option_string:n { ##1 }
+ \str_if_in:nnT {##1} { xscale }
+ {
+ \bool_set_true:N \xt_xscale_call_bool
+ \get_xscale_option_string:n { ##1 }
+ }
+ }
+ { % xscale:false, yscale:false
+ \str_if_in:nnT { ##1 } { scale }
+ {
+ \bool_set_true:N \xt_scale_call_bool
+ \get_scale_option_string:n { ##1 }
+ }
+ }
+ }
+ }
-% \xtSubgameBox
-\def\xtdefaultsubrootshiftbox{0,-.3}
-\NewDocumentCommand\xtSubgameBox{ s r() m O{} }
-{ \IfBooleanTF #1
- {
- \coordinate (xtsubroot) at ($(#2)+(\xtdefaultsubrootshiftbox)$);
- \begin{scope}[on background layer]
- \node [rectangle,fill,red!20,inner sep=20pt,rounded corners=15pt,#4]
- [fit=(xtsubroot) #3] {};
- \end{scope}
- }
- {
- \coordinate (xtsubroot) at ($(#2)+(0,-.3)$);
- \begin{scope}[on background layer]
- \node [rectangle,draw,dashed,inner sep=20pt,rounded corners=15pt,black!50,#4]
- [fit=(xtsubroot) #3] {};
- \end{scope}
- }
+ \clist_if_in:NnT \l_parseopt_clist { -> } % check if [->] exists
+ {
+ \bool_set_true:N \_arrow_option_exist_bool
+ \clist_remove_all:Nn \l_parseopt_clist { -> }
+ \clist_put_left:Nn \l_parseopt_clist { -> , shorten~> = \istgame@default@arrowend@shorten }
+ }
+
+ \tl_set:Nn \l_tmpa_tl { font = \istgame@default@fontsize , > = stealth , }
+ \tl_put_right:Nx \l_tmpa_tl { \clist_use:Nn \l_parseopt_clist { , } }
+
+ \exp_last_unbraced:NnNo
+ \begin{tikzpicture} [ \l_tmpa_tl ]
}
-
-% \xtSubgameOval
-\def\xtdefaultsubrootshiftoval{0,-.7}
-\NewDocumentCommand\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{tikzpicture}
}
+%%% % add the following as env option: tikz-qtree conflict resolution
+%%% edge~from~parent~path = { (\tikzparentnode) -- (\tikzchildnode) }
-%% fine tuning: labels
-\newcommand*\xtALxShift{0pt} % default xshift
-\newcommand*\xtALyShift{0pt} % default yshift
-\NewDocumentCommand\xtALPush{mm}
- {
- \renewcommand*\xtALxShift{#1}
- \renewcommand*\xtALyShift{#2}
- }
+%% scale call test and adjust
-\newcommand*\istactionlabelxshift{1pt} % default horizontal push (alternatively, .67pt)
-\newcommand*\istactionlabelyshift{2pt} % default vertical push (alternatively, 2.5pt)
+\def\xtinfosetheightvar {\xtinfosetheight}
+\def\cntminfosetheightvar {\cntminfosetheight}
-\NewDocumentCommand\xtALShift{G{\istactionlabelxshift}G{\istactionlabelyshift}}
+% \istgameScaleCallTestAndAdjust
+% use this only in a GROUP
+\NewExpandableDocumentCommand \istgameScaleCallTestAndAdjust { }
+{
+ \bool_if:NTF \xt_xscale_call_bool
+ {
+ \pgftransformxscale{1/\xtxscale}
+ % keep going for yscale
+ \bool_if:NT \xt_yscale_call_bool
+ {
+ \pgftransformyscale{1/\xtyscale}
+ }
+ % for scaling infosetO if scaled together with x-y-scale
+ \renewcommand*\xtinfosetheightvar {\xtinfosetheight*\xtscale}
+ \renewcommand*\cntminfosetheightvar {\cntminfosetheight*\xtscale}
+ }
{
- \renewcommand*\istactionlabelxshift{#1}
- \renewcommand*\istactionlabelyshift{#2}
+ \bool_if:NTF \xt_yscale_call_bool
+ {
+ \pgftransformyscale{1/\xtyscale}
+ % keep going for xscale
+ \bool_if:NT \xt_xscale_call_bool
+ {
+ \pgftransformxscale{1/\xtxscale}
+ }
+ % for scaling infosetO if scaled together with x-y-scale
+ \renewcommand*\xtinfosetheightvar {\xtinfosetheight*\xtscale}
+ \renewcommand*\cntminfosetheightvar {\cntminfosetheight*\xtscale}
+ }
+ {
+ \bool_if:NT \xt_scale_call_bool
+ {
+ % no scaling infosetO if scaled without x-y-scale
+ \pgftransformscale{1/\xtscale}
+ }
+ }
}
+}
+% to resolve TikZ problem: sloped label conflict with x-y-scale
+% temporary solution (experimental)
-%% xparse so far
-%%
-%% expl3 from here
+% \xtcureslopedlabelsNS (for north and south growing tree)
+\NewDocumentCommand \xtcureslopedlabelsNS { }
+{
+ \istgameScaleCallTestAndAdjust
+ \bool_if:NTF \xt_xscale_call_bool
+ {
+ \pgfmathsetmacro\xtsibdistadj {\xtxscale*\xtsibdist}
+ \pgfmathsetmacro\xtlevdistadj {1*\xtlevdist}
+ }
+ {
+ \bool_if:NT \xt_yscale_call_bool
+ {
+ \pgfmathsetmacro\xtsibdistadj {1*\xtsibdist}
+ \pgfmathsetmacro\xtlevdistadj {\xtyscale*\xtlevdist}
+ }
+ }
+ \xtdistance{\xtlevdistadj}{\xtsibdistadj}
+}
+% \xtcureslopedlabelsEW (for east and west growing tree)
+\NewDocumentCommand \xtcureslopedlabelsEW { }
+{
+ \istgameScaleCallTestAndAdjust
+ \bool_if:NTF \xt_xscale_call_bool
+ {
+ \pgfmathsetmacro\xtsibdistadj {1*\xtsibdist}
+ \pgfmathsetmacro\xtlevdistadj {\xtxscale*\xtlevdist}
+ }
+ {
+ \bool_if:NT \xt_yscale_call_bool
+ {
+ \pgfmathsetmacro\xtsibdistadj {\xtyscale*\xtsibdist}
+ \pgfmathsetmacro\xtlevdistadj {1*\xtlevdist}
+ }
+ }
+ \xtdistance{\xtlevdistadj}{\xtsibdistadj}
+}
-\ExplSyntaxOn
+%% ---------------
+%% core macro part
+%% ---------------
+% get ready
\tl_new:N \ischo_game_tl
-% action
+% action (with abbreviations)
+% BE CAREFUL: each case has different options (do not try to shorten)
+% {#1: branch line style} {#2: position} {#3: action labels}
\cs_new:Npn \ist_move:nnn #1 #2 #3
{
+% \str_case_e:nnF { #2 }
\str_case:nnF { #2 }
{
- { al } { edge~from~parent [#1] node
- [above~left,xshift=\istactionlabelxshift,yshift=-\istactionlabelyshift,text~depth=.25ex] { $#3$ }
- }
- { ar } { edge~from~parent [#1] node
- [above~right,xshift=-\istactionlabelxshift,yshift=-\istactionlabelyshift,text~depth=.25ex] { $#3$ }
- }
- { bl } { edge~from~parent [#1] node
- [below~left,xshift=\istactionlabelxshift,yshift=\istactionlabelyshift,text~depth=.25ex] { $#3$ }
- }
- { br } { edge~from~parent [#1] node
- [below~right,xshift=-\istactionlabelxshift,yshift=\istactionlabelyshift,text~depth=.25ex] { $#3$ }
- }
- { l } { edge~from~parent [#1] node [left,xshift=-\xtALxShift,text~depth=.25ex] { $#3$ } }
- { r } { edge~from~parent [#1] node [right,xshift=\xtALxShift,text~depth=.25ex] { $#3$ } }
- { a } { edge~from~parent [#1] node [above,yshift=\xtALyShift,text~depth=.25ex] { $#3$ } }
- { b } { edge~from~parent [#1] node [below,yshift=-\xtALyShift,text~depth=.25ex] { $#3$ } }
+ { al } {
+ edge~from~parent [ #1 ]
+ node [ above~left , text~depth = .25ex ,
+ xshift = \istactionlabelxshift , yshift = -\istactionlabelyshift ]
+ {\istactionlabelstyle{#3} }
+ }
+ { ar } {
+ edge~from~parent [ #1 ]
+ node [ above~right , text~depth = .25ex ,
+ xshift = -\istactionlabelxshift , yshift = -\istactionlabelyshift ]
+ { \istactionlabelstyle{#3} }
+ }
+ { bl } {
+ edge~from~parent [ #1 ]
+ node [ below~left , text~depth = .25ex ,
+ xshift = \istactionlabelxshift , yshift = \istactionlabelyshift ]
+ { \istactionlabelstyle{#3} }
+ }
+ { br } {
+ edge~from~parent [ #1 ]
+ node [ below~right , text~depth = .25ex ,
+ xshift = -\istactionlabelxshift , yshift = \istactionlabelyshift ]
+ { \istactionlabelstyle{#3} }
+ }
+ { l } {
+ edge~from~parent [ #1 ]
+ node [ left , text~depth = .25ex , xshift = -\xtALxShift ]
+ { \istactionlabelstyle{#3} }
+ }
+ { r } {
+ edge~from~parent [ #1 ]
+ node [ right , text~depth = .25ex , xshift = \xtALxShift ]
+ { \istactionlabelstyle{#3} }
+ }
+ { a } {
+ edge~from~parent [ #1 ]
+ node [ above , text~depth = .25ex , yshift = \xtALyShift ]
+ { \istactionlabelstyle{#3} }
+ }
+ { b } {
+ edge~from~parent [ #1 ]
+ node [ below , text~depth = .25ex , yshift = -\xtALyShift ]
+ { \istactionlabelstyle{#3} }
+ }
}
{
- edge~from~parent [#1] node [text~depth=.25ex,#2] {$#3$} % \xtmove{#1}{#2}{#3}
+ edge~from~parent [ #1 ]
+ node [ text~depth = .25ex , #2 ] { \istactionlabelstyle{#3} } % was \istmove{#1}{#2}{#3}
}
}
-% payoff
+% payoff (with abbreviations)
+% {#1: position} {#2: payoffs}
\cs_new:Npn \ist_payoff:nn #1 #2
{
- \str_case_x:nnF { #1 }
+% \str_case_e:nnF { #1 }
+ \str_case:nnF { #1 }
{
- { al } { \xtpayoff { above~left } { #2 } }
- { ar } { \xtpayoff { above~right } { #2 } }
- { bl } { \xtpayoff { below~left } { #2 } }
- { br } { \xtpayoff { below~right } { #2 } }
- { l } { \xtpayoff { left } { #2 } }
- { r } { \xtpayoff { right } { #2 } }
- { a } { \xtpayoff { above} { #2 } }
- { b } { \xtpayoff { below } { #2 } }
+ { al } { \istpayoff { above~left } { #2 } }
+ { ar } { \istpayoff { above~right } { #2 } }
+ { bl } { \istpayoff { below~left } { #2 } }
+ { br } { \istpayoff { below~right } { #2 } }
+ { l } { \istpayoff { left } { #2 } }
+ { r } { \istpayoff { right } { #2 } }
+ { a } { \istpayoff { above } { #2 } }
+ { b } { \istpayoff { below } { #2 } }
}
{
- \xtpayoff {#1}{#2}
+ \istpayoff { #1 } { #2 }
}
}
@@ -495,296 +815,2637 @@
%% core macros: \istroot, \istb, \endist
% \istroot(') -- standard version
+% ' [grow, tree opt] (root) (at) [node style] <angle> {owner} +levdis..sibdist+
\NewDocumentCommand \istroot
-{ t' O{\istdefault@grow} r() D(){0,0} O{} D<>{above} G{} D+.{\xtlevdist} D.+{\xtsibdist} }
+{ t' O{\istdefault@grow} r() D(){0,0} O{} D<>{above} G{} d+. D.+{\xtsibdist} }
{
+ % for \istbA
+ \IfNoValueTF {#8}
+ { % if the third option exists in \cntmdistance(*)
+ \bool_set_false:N \_xt_levdist_local_call_bool
+ \tl_set:Nn \_xt_levdist_local_tl { \xtlevdist }
+ \tl_set:Nn \_xt_sibdist_local_tl { \xtsibdist }
+ }
+ {
+ \bool_set_true:N \_xt_levdist_local_call_bool
+ \tl_set:Nn \_xt_levdist_local_tl { #8 }
+ \tl_set:Nn \_xt_sibdist_local_tl { #9 }
+ }
+ % normal process
\tl_clear:N \ischo_game_tl
\xdef\istgrowdirection{#2} % used in \istb to specify [payoff direction]
\IfBooleanTF {#1}
{
- \tl_put_right:Nx \ischo_game_tl
- { % { } needed for #8 and #9 with decimal dim
- \istRoot' [ \istgrowdirection ] ( #3 ) ( #4 ) [ #5 ] { #7 } + {#8} .. {#9} +
- }
+ \tl_put_right:Nn \ischo_game_tl { \ISTRoot' }
}
{
- \tl_put_right:Nx \ischo_game_tl
- { % { } needed for #8 and #9 with decimal dim
- \istRoot [ \istgrowdirection ] ( #3 ) ( #4 ) [ #5 ] < #6 > { #7 } + {#8} .. {#9} +
- }
+ \tl_put_right:Nn \ischo_game_tl { \ISTRoot }
}
+
+ \tl_put_right:Nx \ischo_game_tl { [ \istgrowdirection ] ( #3 ) ( #4 ) [ #5 ] < #6 > }
+ \tl_put_right:Nn \ischo_game_tl { { \istownerstyle{ #7 } } }
+ \tl_put_right:Nx \ischo_game_tl { + { \_xt_levdist_local_tl } .. { #9 } + }
+ % { } needed for #8 and #9 with decimal dim
}
% \istrooto(') -- oval version
+% ' [grow] (root) (at) [node style] <angle> {owner} +levdis..sibdist+ --- <angle>: redundant
\NewDocumentCommand \istrooto
-{ t' O{\istdefault@grow} r() D(){0,0} O{} D<>{above} G{} D+.{\xtlevdist} D.+{\xtsibdist} }
+{ t' O{\istdefault@grow} r() D(){0,0} O{} D<>{above} G{} d+. D.+{\xtsibdist} }
{
+ % for \istbA
+ \IfNoValueTF {#8}
+ {
+ \bool_set_false:N \_xt_levdist_local_call_bool
+ \tl_set:Nn \_xt_levdist_local_tl { \xtlevdist }
+ \tl_set:Nn \_xt_sibdist_local_tl { \xtsibdist }
+ }
+ {
+ \bool_set_true:N \_xt_levdist_local_call_bool
+ \tl_set:Nn \_xt_levdist_local_tl { #8 }
+ \tl_set:Nn \_xt_sibdist_local_tl { #9 }
+ }
+ % normal process
\tl_clear:N \ischo_game_tl
\xdef\istgrowdirection{#2} % used in \istb to specify [payoff direction]
\IfBooleanTF {#1}
{
- \tl_put_right:Nx \ischo_game_tl
- { % { } needed for #8 and #9 with decimal dim
- \istRootO' [ \istgrowdirection ] ( #3 ) ( #4 ) [ #5 ] { #7 } + {#8} .. {#9} +
- }
+ \tl_put_right:Nn \ischo_game_tl { \ISTRootO' }
}
{
- \tl_put_right:Nx \ischo_game_tl
- { % { } needed for #8 and #9 with decimal dim
- \istRootO [ \istgrowdirection ] ( #3 ) ( #4 ) [ #5 ] { #7 } + {#8} .. {#9} +
- }
+ \tl_put_right:Nn \ischo_game_tl { \ISTRootO }
}
+
+ \tl_put_right:Nx \ischo_game_tl { [ \istgrowdirection ] ( #3 ) ( #4 ) [ #5 ] }
+ \tl_put_right:Nn \ischo_game_tl { { \istownerstyle { #7 } } }
+ \tl_put_right:Nx \ischo_game_tl { + { \_xt_levdist_local_tl } .. { #9 } + }
+ % { } needed for #8 and #9 with decimal dim
}
-% \istb(*)(.)
+% \istbm % missing version
+\NewDocumentCommand \istbm { }
+{
+ \istb<missing>
+}
+
+% \istbm % missing version (just in case)
+\NewDocumentCommand \istbAm { }
+{
+ \istbA<missing>
+}
+
+
+% \istb(*)
+% * (redundant) <grow,xtdistances> [line style] {action labels} [pos] {payoffs} [pos]
+% second option is redundant (this helps not getting errors when playing with \istbA)
+% default payoff postion: \istgrowdirection
\NewDocumentCommand \istb
-{ s t. D<>{} O{} G{} O{} g O{\istgrowdirection} }
-{ % \istb* (starred version)
- \IfBooleanTF {#1} % (starred version T/F)
+{ s D(){1} D<>{} O{} +G{} O{} +g O{\istgrowdirection} }
+{
+ \tl_put_right:Nn \ischo_game_tl
+ {
+ child [ #3 ]
+ {
+ \IfBooleanTF { #1 } { \xt@ndot } { \xt@show@endpoint }
+ \IfValueT { #7 } { \ist_payoff:nn { #8 } { #7 } }
+ \ist_move:nnn { \xt@show@midarrow , \xt@show@arrow , #4 } { #6 } { #5 }
+ }
+ }
+}
+
+% \istbt(*) % terminal version
+% this is the replacement of \istb.(*)
+% * (redundant) <grow,xtdistances> [line style] {action labels} [pos] {payoffs} [pos]
+% second option is redundant (this helps not getting errors when playing with \istbA)
+\NewDocumentCommand \istbt
+{ s D(){1} D<>{} O{} +G{} O{} +g O{\istgrowdirection} }
+{
+ \tl_put_right:Nn \ischo_game_tl
+ {
+ child [ #3 ]
+ {
+ \IfBooleanTF { #1 } { \xt@ndot } { \xt@show@tndot }
+ \IfValueT { #7 } { \ist_payoff:nn { #8 } { #7 } }
+ \ist_move:nnn { \xt@show@midarrow , \xt@show@arrow , #4 } { #6 } { #5 }
+ }
+ }
+}
+
+
+% \istB(*) % dual version
+% * <grow,xtdistances> [line style] {AL 1} [pos 1] {AL 2} [pos 2] {payoffs} [pos]
+\NewDocumentCommand \istB
+{ s D<>{} O{} +G{} O{} +G{} O{} +g O{\istgrowdirection} }
+{
+ \tl_put_right:Nn \ischo_game_tl
+ {
+ child [ #2 ]
+ {
+ \IfBooleanTF { #1 } { \xt@ndot } { \xt@show@endpoint }
+ \IfValueT { #8 } { \ist_payoff:nn { #9 } { #8 } }
+ \ist_move:nnn { \xt@show@midarrow , \xt@show@arrow } { #7 } { #6 }
+ \ist_move:nnn { #3 } { #5 } { #4 }
+ }
+ }
+}
+
+
+% \istBt(*) % dual terminal version
+% * <grow,xt-distances> [line style] {AL 1} [pos 1] {AL 2} [pos 2] {payoffs} [pos]
+\NewDocumentCommand \istBt
+{ s D<>{} O{} +G{} O{} +G{} O{} +g O{\istgrowdirection} }
+{
+ \tl_put_right:Nn \ischo_game_tl
{
- \IfValueTF { #7 } % if payoff exists
- {%*
- \tl_put_right:Nn \ischo_game_tl
- { child [ #3 ] { \xtndot
- \ist_payoff:nn { #8 } { #7 }
- \ist_move:nnn { #4 } { #6 } { #5 } }
- }
+ child [ #2 ]
+ {
+ \IfBooleanTF { #1 } { \xt@ndot } { \xt@show@tndot }
+ \IfValueT { #8 } { \ist_payoff:nn { #9 } { #8 } }
+ \ist_move:nnn { \xt@show@midarrow , \xt@show@arrow } { #7 } { #6 }
+ \ist_move:nnn { #3 } { #5 } { #4 }
+ }
+ }
+}
+
+
+% \istbA (arc version) -- to work with \istrootcntmA and variants
+% * (Xpoint adj factor) <grow,xt-distances> [line style] {action labels} [pos] {payoffs} [pos]
+% code complication, inevitable to take care of too many cases
+\NewDocumentCommand \istbA
+{ s D(){1} D<>{} O{} +G{} O{} +g O{\istgrowdirection} }
+{
+ %% to toss adjusted levdist and sibdist for every case
+ \bool_if:NTF \_istroot_cntmA_call_bool
+ { % with \istrootcntmA
+ % adjust levdist (to make longer branch only for \istrootcntmA and its oval version)
+ \pgfmathsetmacro \xtlevdistVarA { \cntmApos * \_cntmA_levdist_local_tl * \cntmAplotfactorAdj }
+ \pgfmathsetmacro \xtsibdistVarA { \cntmApos * \_cntm_act_sibdist_local_tl } % better not mul \...Adj
+ % this is correct (there is no \_cntmA_act_sibdist_local_tl)
+ }
+ {
+ \bool_if:NTF \_istroot_cntm_call_bool
+ { % with \istrootcntm
+ \pgfmathsetmacro \xtlevdistVarA { \cntmpos * \_cntm_levdist_local_tl }
+ \pgfmathsetmacro \xtsibdistVarA { \cntmpos * \_cntm_act_sibdist_local_tl }
+ }
+ {
+ \bool_if:NTF \_xt_levdist_local_call_bool
+ { % if +#8..#9+ exists ( \_xt_levdist_local_tl defined in \istroot )
+ \pgfmathsetmacro \xtlevdistVarA { \_xt_levdist_local_tl }
+ \pgfmathsetmacro \xtsibdistVarA { \_xt_sibdist_local_tl }
}
- {%*
- \tl_put_right:Nn \ischo_game_tl
- { child [ #3 ] { \xtndot
- \ist_move:nnn { #4 } { #6 } { #5 } }
- }
+ { % ordinary case
+ \pgfmathsetmacro \xtlevdistVarA { \xtlevdist }
+ \pgfmathsetmacro \xtsibdistVarA { \xtsibdist }
}
- } % end of Boolean True {#1}
- {
- \IfBooleanTF {#2} % (dot version T/F)
- { % \istb. (period version)
- \IfValueTF { #7 } % if payoff exists
- {%.
- \tl_put_right:Nn \ischo_game_tl
- { child [ #3 ] { \xtshowtndot
- \ist_payoff:nn { #8 } { #7 }
- \ist_move:nnn { #4 } { #6 } { #5 } }
- }
- }
- {%.
- \tl_put_right:Nn \ischo_game_tl
- { child [ #3 ] { \xtshowtndot
- \ist_move:nnn { #4 } { #6 } { #5 } }
- }
- }
- } % end of Boolean True {#2}
- { % \istb
- \IfValueTF { #7 } % if payoff exists
- {
- \tl_put_right:Nn \ischo_game_tl
- { child [ #3 ] { \xtshowendpoint
- \ist_payoff:nn { #8 } { #7 }
- \ist_move:nnn { #4 } { #6 } { #5 } }
- }
+ }
+ }
+ %% draw branch
+ \tl_put_right:Nn \ischo_game_tl
+ {
+ child [ level~distance = #2 * \xtlevdistVarA , sibling~distance = \xtsibdistVarA , #3 ]
+ {
+ \IfBooleanTF { #1 } { \xt@ndot } { \xt@show@endpoint }
+ \IfValueT { #7 } { \ist_payoff:nn { #8 } { #7 } }
+ \ist_move:nnn { \xt@show@midarrow , \xt@show@arrow , #4 } { #6 } { #5 }
+ }
+ }
+}
+
+
+% \istbAt (arc terminal version)
+% * (Xpoint adj factor) <grow,xt-distances> [line style] {action labels} [pos] {payoffs} [pos]
+\NewDocumentCommand \istbAt
+{ s D(){1} D<>{} O{} +G{} O{} +g O{\istgrowdirection} }
+{
+ %% to toss adjusted levdist and sibdist for every case
+ \bool_if:NTF \_istroot_cntmA_call_bool
+ { % with \istrootcntmA
+ % adjust levdist (to make longer branch only for \istrootcntmA and its oval version)
+ \pgfmathsetmacro \xtlevdistVarA { \cntmApos * \_cntmA_levdist_local_tl * \cntmAplotfactorAdj }
+ \pgfmathsetmacro \xtsibdistVarA { \cntmApos * \_cntm_act_sibdist_local_tl } % better not mul \...Adj
+ % this is correct (there is no \_cntmA_act_sibdist_local_tl)
+ }
+ {
+ \bool_if:NTF \_istroot_cntm_call_bool
+ { % with \istrootcntm
+ \pgfmathsetmacro \xtlevdistVarA { \cntmpos * \_cntm_levdist_local_tl }
+ \pgfmathsetmacro \xtsibdistVarA { \cntmpos * \_cntm_act_sibdist_local_tl }
+ }
+ {
+ \bool_if:NTF \_xt_levdist_local_call_bool
+ { % if +#8..#9+ exists ( \_xt_levdist_local_tl defined in \istroot )
+ \pgfmathsetmacro \xtlevdistVarA { \_xt_levdist_local_tl }
+ \pgfmathsetmacro \xtsibdistVarA { \_xt_sibdist_local_tl }
+ }
+ { % ordinary case
+ \pgfmathsetmacro \xtlevdistVarA { \xtlevdist }
+ \pgfmathsetmacro \xtsibdistVarA { \xtsibdist }
+ }
+ }
+ }
+ %% draw branch
+ \tl_put_right:Nn \ischo_game_tl
+ {
+ child [ level~distance = #2 * \xtlevdistVarA , sibling~distance = \xtsibdistVarA , #3 ]
+ {
+ \IfBooleanTF { #1 } { \xt@ndot } { \xt@show@tndot }
+ \IfValueT { #7 } { \ist_payoff:nn { #8 } { #7 } }
+ \ist_move:nnn { \xt@show@midarrow , \xt@show@arrow , #4 } { #6 } { #5 }
+ }
+ }
+}
+
+
+% \printist (to use \istrootcntm and all its variants)
+\NewDocumentCommand \printist { }
+{
+ \tl_use:N \ischo_game_tl
+}
+
+% \endist
+\NewDocumentCommand \endist { }
+{
+ % call set false for changing branch lengths with \istbA
+ \bool_set_false:N \_istroot_cntm_call_bool
+ \bool_set_false:N \_istroot_cntmA_call_bool
+ % final print of simple tree
+ \printist ;
+ % restore initial values for \cntmistb and \cntmAistb
+ \cntmistbVariablesRestore
+ \cntmAistbVariablesRestore
+}
+
+
+%%% continuum of branches %%%
+
+
+%% preset for continuum of branches (used in \ISTCntm, \ISTCntmArc)
+
+%% cntm distances
+\def\cntmdefaultlevdist{8mm}
+%\def\cntmdefaultsibdist{3*\cntmdefaultlevdist}
+\def\cntmdefaultsibdist{24mm}
+\newcommand*\cntmlevdist{\cntmdefaultlevdist}
+\pgfmathsetmacro\tmpcntmsibdist{3*\cntmlevdist} % this detour is safer
+\newcommand*\cntmsibdist{\tmpcntmsibdist}
+
+% cntm action sibling distance (used in \ISTCntm, \ISTCntmArc)
+\def\cntm@default@actsibdist{\cntmsibdist/3}
+\newcommand*\cntmACTsibdist{\cntm@default@actsibdist}
+\NewDocumentCommand \cntmactsibdist{m}
+{
+ \renewcommand*\cntmACTsibdist{#1}
+}
+
+% \cntmdistance call test
+\bool_new:N \cntm_distance_call_bool
+\bool_set_false:N \cntm_distance_call_bool
+\bool_new:N \cntm_act_sibdist_call_bool
+\bool_set_false:N \cntm_act_sibdist_call_bool
+
+% \cntmdistance
+% use this BEFORE \istrootcntm and \istrootcntmA
+% * {cntmlevdist} {cntmsibdist} {cntm act sibdist} [cntm color]
+\NewDocumentCommand \cntmdistance
+{ s m G{ \cntmdefaultsibdist } g }
+{
+ \IfBooleanT {#1}
+ {
+ \renewcommand*\xtlevdist { \cntmlevdist }
+ \renewcommand*\xtsibdist { \cntmsibdist }
+ }
+
+ \renewcommand*\cntmlevdist {#2}
+ \renewcommand*\cntmsibdist {#3}
+
+ \IfValueTF {#4}
+ { % this call set is used in \istrootcntm and its variants
+ % distinguish \cntmactsibdist from \cntmsibdist, the latter used only for cntm
+ \bool_set_true:N \cntm_act_sibdist_call_bool
+ \cntmactsibdist {#4}
+ }
+ {
+ \cntmactsibdist { \cntm@default@actsibdist }
+ }
+
+ \bool_set_true:N \cntm_distance_call_bool
+% \tikzset{level~1/.style={level~distance=\cntmlevdist,sibling~distance=\cntmsibdist}}
+}
+
+%===========================================
+%===========================================
+
+%% information sets
+
+% infoset layer (for every infoset)
+\def\xtdefault@infosetlayer{background}
+\newcommand*\xtinfosetlayer{\xtdefault@infosetlayer}
+\NewDocumentCommand \setxtinfosetlayer{ G{ \xtdefault@infosetlayer } }
+{
+ \renewcommand*\xtinfosetlayer {#1}
+}
+
+% infoset style (for every infoset)
+\def\xtdefault@infoset@style{}
+\newcommand*\xtdefaultinfosetstyle{\xtdefault@infoset@style}
+
+\NewDocumentCommand \setxtinfosetstyle { G{} }
+{
+ \tikzset { infoset~style/.style = { semithick, densely~dotted, #1 } }
+}
+% initial set (as infoset style = {semithick,densely dotted})
+\setxtinfosetstyle
+
+% infoset height (for oval type)
+\def\xtdefault@infosetheight { 1em } % 1em=12pt
+\newcommand*\xtinfosetheight { \xtdefault@infosetheight }
+
+
+% \xtInfoset
+% * [opt] (from) (to) {owner} [pos]
+\NewDocumentCommand \xtInfoset { s O{} r() r() +G{} O{} }
+{
+ \begin{pgfonlayer}{\xtinfosetlayer}
+ \draw [ - , infoset~style , #2 ] (#3) to (#4) ;
+ \IfBooleanTF {#1} { } { \setistmathTF011 \istownertextfont{} } % must be in group
+% \str_case_e:nnF {#6}
+ \str_case:nnF {#6}
+ {
+ {al} { \node at ( $ (#3) ! .5 ! (#4) $ ) [ above~left ] { \istownerstyle{#5} } ; }
+ {ar} { \node at ( $ (#3) ! .5 ! (#4) $ ) [ above~right ] { \istownerstyle{#5} } ; }
+ {bl} { \node at ( $ (#3) ! .5 ! (#4) $ ) [ below~left ] { \istownerstyle{#5} } ; }
+ {br} { \node at ( $ (#3) ! .5 ! (#4) $ ) [ below~right ] { \istownerstyle{#5} } ; }
+ {l} { \node at ( $ (#3) ! .5 ! (#4) $ ) [ left ] { \istownerstyle{#5} } ; }
+ {r} { \node at ( $ (#3) ! .5 ! (#4) $ ) [ right ] { \istownerstyle{#5} } ; }
+ {a} { \node at ( $ (#3) ! .5 ! (#4) $ ) [ above ] { \istownerstyle{#5} } ; }
+ {b} { \node at ( $ (#3) ! .5 ! (#4) $ ) [ below ] { \istownerstyle{#5} } ; }
+ }
+ {
+ \node at ( $ (#3) ! .5 ! (#4) $ ) [ above , #6 ] { \istownerstyle{#5} } ;
+ }
+ \end{pgfonlayer}
+}
+
+% \xtInfosetO -- oval version
+
+% * [opt] (from) (to) {owner} [pos] (height dim)
+\NewDocumentCommand \xtInfosetO { s O{} r() r() +G{} O{} D(){\xtdefault@infosetheight} }
+{
+ \begin{scope} % in group: to make \setistmathT011 local
+ \IfBooleanTF {#1} { } { \setistmathTF011 \istownertextfont{} }
+ \coordinate (xtinfoA) at (#3) ;
+ \coordinate (xtinfoB) at (#4) ;
+ \renewcommand*\xtinfosetheight {#7}
+
+ \istgameScaleCallTestAndAdjust % (must be in a GROUP) % this determines \xsinfosetheightvar
+
+% \str_if_eq:eeTF { #3 } { #4 }
+ \str_if_eq:nnTF { #3 } { #4 }
+ {% singleton infoset with a circle
+ \begin{pgfonlayer}{\xtinfosetlayer}
+ \draw (xtinfoA) node [ - , draw , circle , samples=500 , inner~sep = 0pt,
+ minimum~size = \xtinfosetheightvar , infoset~style , #2 ] {} ; % -var needed for scaling
+ \end{pgfonlayer}
+ \draw [ draw = none ] (#3) node [ #6 ] { \istownerstyle{#5} } ;
+ }
+ {% connecting two nodes
+ \renewcommand*\xtinfosetheight {#7}
+ \begin{pgfonlayer}{\xtinfosetlayer}
+ \path
+ let
+ \p1 = ( $ (xtinfoA.center) - (xtinfoB.center) $ ) ,
+ \n1 = { veclen(\x1,\y1) }
+ in
+ (xtinfoA) -- (xtinfoB)
+ node [ - , draw , rectangle , samples = 500 , inner~sep = 0pt ,
+ transform~shape , sloped , midway ,
+ rounded~corners = .5*\xtinfosetheightvar , % var needed for scaling
+ minimum~width = \n1 + \xtinfosetheight ,
+ minimum~height = \xtinfosetheight , infoset~style , #2 ] { } ;
+ \draw [ draw = none ] (xtinfoA) to
+ [ edge~node = { node [ #6 ] { \istownerstyle{#5} } } ] (xtinfoB) ; % (in group)
+ \end{pgfonlayer}
+ }
+ \end{scope}
+}
+
+
+%===========================================
+
+%% CI(curve infoset) defaults
+\def\xtCI@default@opt { } % CI line option
+\def\xtCI@default@pos { 1 } % CI position
+\def\xtCI@default@plotfactor { 1.3 } % CI curvature
+\def\xtCInfosetplotfactor { \xtCI@default@plotfactor }
+\newcommand*\xtCIopt { \xtCI@default@opt }
+\newcommand*\xtCIpos { \xtCI@default@pos }
+\newcommand*\xtCIplotfactor { \xtCI@default@plotfactor }
+\def\xtcimidvarfactor { .5 }
+
+% base distance to CI-root and mid-point (used in \xtCInfosetO)
+\def\xtCI@default@rootdist { 25mm }
+
+% xtCI default positions (used in \xtCInfosetO)
+\def\xtCIdefaultpos { 0 }
+\def\xtCIdefaultposA { -1 }
+\def\xtCIdefaultposB { 1 }
+
+% \setxtCIplotfactor
+% use this before \istrootcntmA
+\NewDocumentCommand \setxtCIplotfactor { m }
+{
+ \renewcommand*\xtCIplotfactor {#1}
+ \edef\xtCInfosetplotfactor {#1}
+}
+
+% detouring colon problem
+\NewExpandableDocumentCommand \setxtCIAngleAccordingtoGrowswapCall { }
+{
+ \bool_if:NTF \xt_growswap_call_bool
+ { \tl_set:Nn \xtCIang { 90 } }
+ { \tl_set:Nn \xtCIang { -90 } }
+}
+
+% detouring colon problem
+\def\xtciang@adjusted { 35 }
+\def\xtciang@adjustedLessThanOne { -15 }
+
+% #1 : \xtciplotfactor
+% #2 : midvarfactor
+\NewExpandableDocumentCommand \setxtCIAngleAccordingtoGrowswapCallForCI { m m }
+{
+ \bool_if:NTF \xt_growswap_call_bool
+ { % growswap true
+ \tl_set:Nn \xtCIangNew { 90 }
+ \tl_set:Nn \xtcisign { -1 }
+ \pgfmathsetmacro \xtciangA { 45-45*(#1-1)/.6 }
+ \pgfmathsetmacro \xtciangB { -45+45*(#1-1)/.6 }
+ \tl_if_novalue:nF { #2 } %% equivalent to \IfNoValueTF
+ {
+ \fp_compare:nTF { .5 > #2 }
+ {
+ \fp_compare:nTF { 1 > #1 }
+ {
+ \pgfmathsetmacro \xtciangA { \xtciangA + 60 - \xtciang@adjusted }
+ }
+ {
+ \pgfmathsetmacro \xtciangA { \xtciangA - \xtciang@adjusted }
+ }
+ }
+ {
+ \fp_compare:nT { .5 < #2 }
+ {
+ \fp_compare:nTF { 1 > #1 }
+ {
+ \pgfmathsetmacro \xtciangB { \xtciangB - 60 + \xtciang@adjusted }
}
- {
- \tl_put_right:Nn \ischo_game_tl
- { child [ #3 ] { \xtshowendpoint
- \ist_move:nnn { #4 } { #6 } { #5 } }
- }
+ {
+ \pgfmathsetmacro \xtciangB { \xtciangB + \xtciang@adjusted }
}
- } % end of Boolean False {#2}
- } % end of Boolean False {#1}
+ }
+ }
+ }
+ }
+ { % growswap false (no problem)
+ \tl_set:Nn \xtCIangNew { -90 }
+ \tl_set:Nn \xtcisign { 1 }
+ \pgfmathsetmacro\xtciangA{ -45+45*(#1-1)/.6 }
+ \pgfmathsetmacro\xtciangB{ 45-45*(#1-1)/.6 }
+ \fp_compare:nT { 1.0 > #1 } { \edef\xtciang@adjusted { \xtciang@adjustedLessThanOne } }
+ \tl_if_novalue:nF { #2 } %% equivalent to \IfNoValueTF
+ {
+ \fp_compare:nTF { .5 > #2 }
+ {
+ \pgfmathsetmacro \xtciangA { \xtciangA + \xtciang@adjusted } % if midvarfactor < .5
+ }
+ {
+ \fp_compare:nT { .5 < #2 }
+ {
+ \pgfmathsetmacro \xtciangB { \xtciangB - \xtciang@adjusted } % if midvarfactor > .5
+ }
+ }
+ }
+ }
}
-% \endist
-\NewDocumentCommand \endist { }
+
+%% detouring colon problem
+\def\ciang@adjusted { 35 }
+\def\ciang@adjustedLessThanOne { -15 }
+
+\let \cntminfosetheight \xtinfosetheight
+% #1 : \ciplotfactor
+\NewExpandableDocumentCommand \setciAngleAccordingtoGrowswapCallForCntmAI { m }
+{
+ \bool_if:NTF \xt_growswap_call_bool
+ { % growswap true
+ \tl_set:Nn \ciangNew { 90 }
+ \tl_set:Nn \cisign { -1 }
+ \pgfmathsetmacro \ciangA { -45+45*(#1-1)/.9 }
+ \pgfmathsetmacro \ciangB { 45-45*(#1-1)/.9 }
+ }
+ { % growswap false
+ \tl_set:Nn \ciangNew { -90 }
+ \tl_set:Nn \cisign { 1 }
+ \pgfmathsetmacro \ciangA { 45-45*(#1-1)/.9 }
+ \pgfmathsetmacro \ciangB { -45+45*(#1-1)/.9 }
+ }
+}
+
+%% detouring abbreviations (used in \xtCInfoset)
+\NewDocumentCommand \xtCInfosetAbbreviations { m }
+{
+% \str_case_e:nnF {#1}
+ \str_case:nnF {#1}
+ {
+ {l} { \def\xtciowner@pos { left } }
+ {r} { \def\xtciowner@pos { right} }
+ {a} { \def\xtciowner@pos { above} }
+ {b} { \def\xtciowner@pos { below} }
+ {al} { \def\xtciowner@pos { above~left } }
+ {ar} { \def\xtciowner@pos { above~right } }
+ {bl} { \def\xtciowner@pos { below~left } }
+ {br} { \def\xtciowner@pos { below~right } }
+ }
+ {
+ \def\xtciowner@pos {#1}
+ }
+ \tl_set:Nx \xtcioptionstring { at (xtC) [ above , \xtciowner@pos ] }
+}
+
+% detouring colon problem (for comparing two node being identical or not)
+% \xtCITestCoordinates (used in \xtCInfoset)
+\newif \ifxtCIsamecoordinates
+\NewDocumentCommand \xtCITestCoordinates { m m }
+{
+% \str_if_eq:eeTF {#1} {#2}
+ \str_if_eq:nnTF {#1} {#2}
{
- \tl_put_right:Nn \ischo_game_tl { ; }
- \tl_use:N \ischo_game_tl
+ \xtCIsamecoordinatestrue
}
+ {
+ \xtCIsamecoordinatesfalse
+ }
+}
-%% continuum of branches
+%++++++++++++++++++++++++++++++++++++
+%% +++ ONLY FOR DEVELOPER +++++++++++
+%% to show X points and X circles (this is used in definition of \xtCInfosetO and \cntmAInfosetO)
+
+% getting ready to show X points
+\newif \ifxtXpoints
+\newif \ifxtXpointsONE
+\newif \ifxtXpointsTWO
+\newif \ifxtXpointsTHREE
+\newif \ifxtXpointsFOUR
+\newif \ifxtXpointsLabel
+% getting ready to show X circles
+\newif \ifxtXcircles
+\newif \ifxtXcircleX
+\newif \ifxtXcircleY
+
+% showing X circles
+% used in \xtshowXpoints
+% can be used independently
+\NewDocumentCommand \xtshowXcircles { m }
+{
+ \xtXcircleXfalse
+ \xtXcircleYfalse
+ \xtXcirclestrue
+ \int_compare:nTF { #1 >= 3 }
+ {
+ \xtXcircleXtrue
+ \xtXcircleYtrue
+ }
+ {
+ \int_compare:nTF { #1 >= 2 }
+ {
+ \xtXcircleXfalse
+ \xtXcircleYtrue
+ }
+ {
+ \int_compare:nT { #1 >= 1 }
+ {
+ \xtXcircleXtrue
+ \xtXcircleYfalse
+ }
+ }
+ }
+}
-% \istcntm(')
-\NewDocumentCommand \istcntm
-{ t' O{\istdefault@grow} r() D(){0,0} O{black!25} G{} D+.{\cntmdefault@levdist}D.+{\cntmdefault@sibdist} }
-{
+% hide X circles
+\NewDocumentCommand \xthideXcircles { }
+{
+ \xtXcirclesfalse
+}
+
+% to control point size
+\def\xtXpoint@sizeA { \istsolidnodesize }
+\def\xtXpoint@sizeB { 5/3 * \istsolidnodesize }
+\newcommand*\xtXpointsizeA { \xtXpoint@sizeA }
+\newcommand*\xtXpointsizeB { \xtXpoint@sizeB }
+
+% showing X points
+% \xtshowXpoints
+% * {point choice num}{circle choice num}(points size dim)(basic points size dim)
+% usage: \xtshowXpoints33(2pt)(3pt)
+% point choice number: 0,1,2,3,4
+% circle choice number: 0,1,2,3
+% this serves \xtCInfosetO as well as \cntmAInfosetO
+\NewDocumentCommand \xtshowXpoints { s m m D(){\xtXpoint@sizeA} D(){\xtXpoint@sizeB} }
+{
+ \renewcommand*\xtXpointsizeA {#4}
+ \renewcommand\xtXpointsizeB {#5}
+ \xtXpointsLabelfalse
+ \IfBooleanTF {#1} { \xtXpointsLabeltrue } { \xtXpointsLabelfalse }
+ \xtXpointsONEfalse
+ \xtXpointsTWOfalse
+ \xtXpointsTHREEfalse
+ \xtXpointsFOURfalse
+ \xtXpointstrue
+ \int_compare:nTF { #2 >= 4 }
+ {
+ \xtXpointsTHREEtrue
+ \xtXpointsTWOtrue
+ \xtXpointsONEtrue
+ }
+ {
+ \int_compare:nTF { #2 >= 3 }
+ {
+ \xtXpointsONEfalse
+ \xtXpointsTWOtrue
+ \xtXpointsTHREEtrue
+ }
+ {
+ \int_compare:nTF { #2 >= 2 }
+ {
+ \xtXpointsONEtrue
+ \xtXpointsTWOtrue
+ \xtXpointsTHREEfalse
+ }
+ {
+ \int_compare:nT { #2 >= 1 }
+ {
+ \xtXpointsONEtrue
+ \xtXpointsTWOfalse
+ \xtXpointsTHREEfalse
+ }
+ }
+ }
+ }
+ \xtshowXcircles{#3}
+}
+
+% hide X points
+\NewDocumentCommand \xthideXpoints {}
+{
+ \xtXpointsfalse
+}
+%++++++++++++++++++++++++++++++++++++
+
+
+\ExplSyntaxOff
+
+%%-----------------
+%% expl3 up to here (paused, because of colon problem)
+%%-----------------
+
+%---syntaxoff-----
+% \xtCInfoset
+% * [line opt] (beg-coor) !offmid weight! (end-coor) <plotfactor> +G{} O{} (info height dim)
+\NewDocumentCommand \xtCInfoset
+{ s O{} r() d!! r() D<>{\xtCIplotfactor} +G{} O{} }
+{
+\begin{scope}
+\istgameScaleCallTestAndAdjust % (must be in a GROUP)
+ \IfBooleanTF {#1} { } { \setistmathTF011 \istownertextfont{} } % must be in a group
+
+ \coordinate (xtA) at (#3) ;
+ \coordinate (xtB) at (#5) ;
+ \edef\xtciplotfactor {#6}
+ \def\xtcitension { 1 }
+
+ \IfValueT {#4} { \edef\xtcimidvarfactor {#4} }
+ \setxtCIAngleAccordingtoGrowswapCallForCI {#6} {#4}
+
+ \path
+ let \p1 = ($(xtA)-(xtB)$) , \n1 = { veclen(\p1) }
+ in \pgfextra{ \xdef\xtcidist {\n1} } ;
+
+ \coordinate (xtcimid) at ( $ (xtA) ! .5 ! (xtB) $ ) ;
+ \coordinate (xtciroot) at ( $ (xtcimid) ! .5 * \xtcidist ! \xtCIangNew:(xtB) $ ) ;
+ \coordinate (xtcimid-var) at ( $ (xtA) ! \xtcimidvarfactor ! (xtB) $ ) ;
+ \coordinate (xtC) at ( $ (xtciroot) ! \xtciplotfactor ! (xtcimid-var) $ ) ;
+
+ \begin{pgfonlayer}{\xtinfosetlayer}
+ \draw [ - , samples=500 , tension = \xtcitension , infoset style , #2 ]
+ plot [ smooth ] coordinates { (xtA) (xtC) (xtB) } ;
+ % detoured abbreviations (\node at (xtC) [ above , #8 ] { \istownerstyle{#7} } ;)
+ \xtCInfosetAbbreviations {#8}
+ \expandafter \node \xtcioptionstring { \istownerstyle{#7} };
+ \end{pgfonlayer}
+\end{scope}
+}
+
+%++++++++++++++++++++++++++++++++++++
+%% +++ ONLY FOR DEVELOPER +++++++++++
+%---syntaxoff-----
+% for controlling X points
+\tikzset { nodedot/.style =
+ { - , draw , fill , circle , inner sep = 0pt , minimum size = 2pt }
+ }
+
+%---syntaxoff-----
+% * [node opt] (coor) <pos> {label} (min size dim)
+\NewDocumentCommand \xtXnodedot { s O{} r() D<>{above} G{} D(){\istsolidnodesize} }
+{
\IfBooleanTF {#1}
{
- \istCntmRoot' [ #2 ] ( #3 ) ( #4 ) [ #5 ] + #7 .. #8 +
+ \node at (#3) [ nodedot , minimum size = #6 ,
+ label={[label distance=-2pt]#4:{\tiny\ttfamily #5}} , #2 ] {} ;
}
{
- \istCntmRoot [ #2 ] ( #3 ) ( #4 ) [ #5 ] + #7 .. #8 +
+ \node at (#3) [ nodedot , minimum size = #6 , #2 ] {} ;
}
}
+%++++++++++++++++++++++++++++++++++++
-% \istcntmarc(') -- arc version
-\NewDocumentCommand \istcntmarc
-{ t' O{\istdefault@grow} r() D(){0,0} O{} G{.5} D+.{\cntmdefault@levdist}D.+{\cntmdefault@sibdist} }
+%---syntaxoff-----
+% initial values
+\def\xtcibegang {0}
+\def\xtciendang {0}
+
+\NewDocumentCommand \xtCInfosetOTurnX { m g }
+{
+ \renewcommand*\xtcibegang{#1}
+ \IfNoValueTF {#2}
+ { \renewcommand*\xtciendang{-\xtcibegang} }
+ { \renewcommand*\xtciendang{#2} }
+}
+
+%---syntaxoff-----
+% \xtCInfosetO
+% * [line opt] (beg-coor) !offmid weight! (end-coor) <plotfactor> +G{} O{} (info height dim)
+\NewDocumentCommand \xtCInfosetO
+{ s O{} r() d!! r() D<>{\xtCIplotfactor} +G{} O{} D(){\xtdefault@infosetheight} }
+{
+ \begin{scope}
+ \IfBooleanTF {#1} { } { \setistmathTF011 \istownertextfont{} } % must be in a group
+
+ \coordinate (xtA) at (#3) ;
+ \coordinate (xtB) at (#5) ;
+ \renewcommand*\xtinfosetheight{#9}
+
+ \istgameScaleCallTestAndAdjust % (must be in a GROUP) % this determines \xsinfosetheightvar
+ \xtCITestCoordinates{#3}{#5}
+ \ifxtCIsamecoordinates
+ \begin{pgfonlayer}{\xtinfosetlayer}
+ \draw (xtA) node [ draw , circle , samples = 500 , inner sep = 0pt ,
+ minimum size=\xtinfosetheightvar , % var needed for scaling
+ infoset style , #2] {} ;
+ \end{pgfonlayer}
+ \node at (#3) [ #8 ] { \istownerstyle{#7} } ;
+ \else
+ \edef\xtciplotfactor{#6}
+ \def\xtcitension{1}
+ \def\xradius{ .5*\xtinfosetheight }
+ \xdef\tosstoxtXcircles{\xtinfosetheightvar} % +++ for developer (see below) +++
+
+ \IfValueT {#4} {\edef\xtcimidvarfactor{#4}}
+ \setxtCIAngleAccordingtoGrowswapCallForCI{#6}{#4}
+
+ \path
+ let \p1 = ($(xtA)-(xtB)$) , \n1 = {veclen(\p1)}
+ in \pgfextra{\xdef\xtcidist{\n1}} ;
+
+ \pgfmathsetmacro\xratio{ scalar(\xtCI@default@rootdist/\xtcidist) }
+
+ \coordinate (xtcimid) at ($(xtA)!.5!(xtB)$) ;
+ \coordinate (xtciroot) at ($(xtcimid)!.5*\xtcidist!\xtCIangNew:(xtB)$) ;
+ \coordinate (xtcimid-var) at ($(xtA)!\xtcimidvarfactor!(xtB)$) ;
+ \coordinate (xtC) at ($(xtciroot)!\xtciplotfactor!(xtcimid-var)$) ;
+
+ \path (xtciroot) -- (xtA) -- ( [turn] \xtciangA+\xtcibegang:\xradius) coordinate (xtAA1) ;
+ \path (xtciroot) -- (xtB) -- ( [turn] \xtciangB+\xtciendang:\xradius) coordinate (xtBB1) ;
+
+ \coordinate (xtAA2) at ($(xtAA1)!2!(xtA)$) ;
+ \coordinate (xtBB2) at ($(xtBB1)!2!(xtB)$) ;
+
+ \draw [draw=none] (xtciroot) -- (xtC) -- ([turn]0:\xradius) coordinate (xtCC1) ;
+ \draw [draw=none] (xtciroot) -- (xtC) -- ([turn]180:\xradius) coordinate (xtCC2) ;
+
+ \coordinate (XpointA) at ($(xtA)!\xradius!-\xtCIangNew:(xtAA1)$) ;
+ \coordinate (XpointB) at ($(xtB)!\xradius! \xtCIangNew:(xtBB1)$) ;
+
+ \begin{pgfonlayer}{\xtinfosetlayer}
+ \draw [ - , samples = 500 , tension = \xtcitension , infoset style , #2 ]
+ plot [smooth] coordinates {(xtAA1)(xtCC1)(xtBB1)} --
+ plot [smooth,tension=1.75] coordinates {(xtBB1)(XpointB)(xtBB2)} --
+ plot [smooth] coordinates {(xtBB2)(xtCC2)(xtAA2)} --
+ plot [smooth,tension=1.75] coordinates {(xtAA2)(XpointA)(xtAA1)} -- cycle ;
+ \node at (xtC) [ #8 ] { \istownerstyle{#7} } ;
+ \end{pgfonlayer}
+ \fi
+ \end{scope}
+ % back to initial values
+ \def\xtcibegang{0}
+ \def\xtciendang{0}
+ %++++++++++++++++++++++++++++++++++++
+ %% +++ ONLY FOR DEVELOPER +++++++++++
+ %% control points
+ \ifxtXpoints
+ \ifxtXpointsONE
+ \ifxtXpointsLabel
+ \xtXnodedot*[fill=green](xtA)<right>{A}(\xtXpointsizeB)
+ \xtXnodedot*[fill=green](xtB)<left>{B}(\xtXpointsizeB)
+ \xtXnodedot*[green](xtC)<right>{C}(\xtXpointsizeB)
+ \xtXnodedot*[fill=blue!40](xtciroot)<right>{root}(\xtXpointsizeB)
+ \xtXnodedot*[fill=green](xtcimid-var)<right>{m}(\xtXpointsizeB)
+ \else
+ \xtXnodedot[fill=green](xtA)<right>{A}(\xtXpointsizeB)
+ \xtXnodedot[fill=green](xtB)<left>{B}(\xtXpointsizeB)
+ \xtXnodedot[green](xtC)<right>{C}(\xtXpointsizeB)
+ \xtXnodedot[fill=blue!40](xtciroot)<right>{root}(\xtXpointsizeB)
+ \xtXnodedot[fill=green](xtcimid-var)<right>{m}(\xtXpointsizeB)
+ \fi
+ \fi
+ \ifxtXpointsTWO
+ \ifxtXpointsLabel
+ \xtXnodedot*[blue](xtAA1){a1}(\xtXpointsizeA)
+ \xtXnodedot*[red](xtAA2)<below>{a2}(\xtXpointsizeA)
+ \xtXnodedot*[blue](xtBB1){b1}
+ \xtXnodedot*[red](xtBB2)<below>{b2}(\xtXpointsizeA)
+ \xtXnodedot*[blue](xtCC1){c1}(\xtXpointsizeA)
+ \xtXnodedot*[red](xtCC2)<below>{c2}(\xtXpointsizeA)
+ \else
+ \xtXnodedot[blue](xtAA1){a1}(\xtXpointsizeA)
+ \xtXnodedot[red](xtAA2)<below>{a2}(\xtXpointsizeA)
+ \xtXnodedot[blue](xtBB1){b1}(\xtXpointsizeA)
+ \xtXnodedot[red](xtBB2)<below>{b2}(\xtXpointsizeA)
+ \xtXnodedot[blue](xtCC1){c1}(\xtXpointsizeA)
+ \xtXnodedot[red](xtCC2)<below>{c2}(\xtXpointsizeA)
+ \fi
+ \fi
+ \ifxtXpointsTHREE
+ \ifxtXpointsLabel
+ \xtXnodedot*[blue](XpointA)<left>{x}(\xtXpointsizeA)
+ \xtXnodedot*[red](XpointB)<right>{y}(\xtXpointsizeA)
+ \else
+ \xtXnodedot[blue](XpointA)<left>{x}(\xtXpointsizeA)
+ \xtXnodedot[red](XpointB)<right>{y}(\xtXpointsizeA)
+ \fi
+ \fi
+ \fi
+ % X circles
+ \ifxtXcircles
+ \ifxtXcircleX
+ \node at (xtA) [-,circle,draw=blue,opacity=.5,minimum size=\tosstoxtXcircles ] {} ;
+ \fi
+ \ifxtXcircleY
+ \node at (xtB) [-,circle,draw=red,opacity=.5,minimum size=\tosstoxtXcircles ] {} ;
+ \fi
+ \fi
+ %++++++++++++++++++++++++++++++++++++
+}
+
+
+%% continuum of branches : information sets
+
+%---syntaxoff-----
+%% cntmA defaults (used in \ISTCntmArc)
+\def\cntmA@default@opt {} % arc line option
+\def\cntmA@default@pos {1} % arc position %% default was .5
+\def\cntmA@default@plotfactor {1.333} % arc curvature
+\def\cntmAInfosetplotfactor {\cntmA@default@plotfactor}
+\def\cntmA@default@fillcolor {transparent} % no white
+\newcommand*\cntmAopt {\cntmA@default@opt}
+\newcommand*\cntmApos {\cntmA@default@pos}
+\newcommand*\cntmAplotfactor {\cntmA@default@plotfactor}
+\newcommand*\cntmAfillcolor {\cntmA@default@fillcolor}
+
+%---syntaxoff-----
+% \cntmAplotfactorset
+% use this before \istrootcntmA
+\NewDocumentCommand \cntmAplotfactorset { m }
+{
+ \renewcommand*\cntmAplotfactor {#1}
+ \edef\cntmAInfosetplotfactor {#1}
+}
+
+%---syntaxoff-----
+% \cntmApreset
+% use this before \istrootcntmA
+% \cntmApreset
+% [Aopt]<plotfactor>{Apos}[fill color]
+% use fill color only at the second bracket option (not first)
+\NewDocumentCommand \cntmApreset
+{ O{\cntmA@default@opt} D<>{\cntmA@default@plotfactor} g O{\cntmA@default@fillcolor} }
+{
+ \IfNoValueTF {#3}
+ {
+ \renewcommand*\cntmApos {\cntmA@default@pos}
+ }
+ {
+ \renewcommand*\cntmApos {#3}
+ }
+ \renewcommand*\cntmAopt {#1}
+ \cntmAplotfactorset {#2}
+ \renewcommand*\cntmAfillcolor {#4}
+}
+
+
+%---syntaxoff-----
+% cntm layer
+\def\cntm@default@layer{background} % better than behind
+\NewDocumentCommand \cntmlayerset{ m }
+{
+ \renewcommand*\cntm@default@layer{#1}
+}
+
+%---syntaxoff-----
+% cntmA layer
+\def\cntmA@default@layer{behind} % better than background
+\newcommand*\cntmAdefaultlayer{\cntmA@default@layer}
+\NewDocumentCommand \cntmAlayerpreset{ G{\cntmA@default@layer} }
+{
+ \renewcommand*\cntmAdefaultlayer{#1}
+}
+
+
+%---syntaxoff-----
+% \cntmAInfoset
+% [Aopt] (cntm-root) <\xtCIplotfactor> {addto cntmApos}
+\NewDocumentCommand \cntmAInfoset
+{ O{\cntmA@default@opt} r() D<>{\cntmAInfosetplotfactor} G{.1} }
+{
+ % save arc options and position
+ \let\tmpAIpos\cntmApos
+ \let\tmpAIopt\cntmAopt
+ \pgfmathsetmacro{\cntmAInfosetpos}{\cntmApos+#4}
+
+ \coordinate (ciroot) at (#2) ;
+ \coordinate (ciA) at ($(ciroot)!\cntmAInfosetpos!(cntm-1)$) ;
+ \coordinate (ciB) at ($(ciroot)!\cntmAInfosetpos!(cntm-2)$) ;
+ \edef\ciplotfactor{#3}
+ \def\citension{1}
+
+ \pgfmathsetmacro\cidistratio{ scalar(\cntmlevdist/\cntmsibdist) }
+ \pgfmathsetmacro\ciplotfactorVal{ 1 + (\ciplotfactor-1) * sqrt(1/3) / sqrt(\cidistratio) }
+
+ \coordinate (cimid) at ($(ciA)!.5!(ciB)$) ;
+ \coordinate (ciC) at ($(ciroot)!\ciplotfactorVal!(cimid)$) ;
+
+ \begin{pgfonlayer}{\xtinfosetlayer}
+ \draw [ - , samples=500 , tension = \citension , infoset style , #1 ]
+ plot [smooth] coordinates {(ciA)(ciC)(ciB)} ;
+ \end{pgfonlayer}
+ \let\cntmApos\tmpAIpos
+ \let\cntmAopt\tmpAIopt
+}
+
+
+%---syntaxoff-----
+% \cntmAInfosetO
+% [Aopt] (cntm-root) <plot factor> {Apos} [turn X-ang] (infoset height)
+\NewDocumentCommand \cntmAInfosetO
+{ O{\cntmA@default@opt} r() D<>{\cntmAInfosetplotfactor} G{\cntmApos} O{0} D(){\xtdefault@infosetheight} }
+{
+ \begin{scope}
+ \coordinate (ciroot) at (#2) ;
+ \coordinate (ciA) at ($(ciroot)!#4!(cntm-1)$) ;
+ \coordinate (ciB) at ($(ciroot)!#4!(cntm-2)$) ;
+ \edef\ciplotfactor{#3}
+ \def\ciAdjXang{#5}
+ \def\cntminfosetheight{#6}
+ \def\citension{1}
+
+ \istgameScaleCallTestAndAdjust % (must be in a GROUP)
+ \def\ciradius{ .5*\cntminfosetheight } % not -var
+ \xdef\tosstocntmXcircles{\cntminfosetheightvar} % +++ for developer (see below) +++
+ \setciAngleAccordingtoGrowswapCallForCntmAI{#3}
+
+ \pgfmathsetmacro\cidistratio{ scalar(\cntmlevdist/\cntmsibdist) }
+ % to ease the curvature (using \cidistratio)
+ \pgfmathsetmacro\ciplotfactorVal{ 1 + (\ciplotfactor-1)*sqrt(1/3)/sqrt(\cidistratio) }
+ % adjust Xangle
+ \ifdim .5pt <\cidistratio pt
+ \pgfmathsetmacro\ciDefaultAdjXang{ -5 + 30*\cidistratio } % (10 if ratio=1/2 )
+ \else
+ \pgfmathsetmacro\ciDefaultAdjXang{ -10 + 30*\cidistratio } % (0 if ratio=1/3 )
+ \fi
+ \pgfmathsetmacro\ciXadj{ \cisign * (\ciDefaultAdjXang - \ciAdjXang) }
+
+ % defining coordinates
+ \coordinate (cimid) at ($(ciA)!.5!(ciB)$) ;
+ \coordinate (ciC) at ($(ciroot)!\ciplotfactorVal!(cimid)$) ;
+
+ \path (ciroot) -- (ciA) -- ( [turn] \ciangA-\ciXadj:\ciradius) coordinate (ciAA1) ;
+ \path (ciroot) -- (ciB) -- ( [turn] \ciangB+\ciXadj:\ciradius) coordinate (ciBB1) ;
+
+ \coordinate (ciAA2) at ($(ciAA1)!2!(ciA)$) ;
+ \coordinate (ciBB2) at ($(ciBB1)!2!(ciB)$) ;
+
+ \draw [draw=none] (ciroot) -- (ciC) -- ([turn]0:\ciradius) coordinate (ciCC1) ;
+ \draw [draw=none] (ciroot) -- (ciC) -- ([turn]180:\ciradius) coordinate (ciCC2) ;
+
+ \coordinate (ciXpointA) at ($(ciA)!\ciradius! \ciangNew:(ciAA1)$) ;
+ \coordinate (ciXpointB) at ($(ciB)!\ciradius!-\ciangNew:(ciBB1)$) ;
+
+ \begin{pgfonlayer}{\xtinfosetlayer}
+ \draw [ - , samples=500 , tension = \citension , infoset style , #1 ]
+ plot [smooth] coordinates {(ciAA1)(ciCC1)(ciBB1)} --
+ plot [smooth,tension=1.75] coordinates {(ciBB1)(ciXpointB)(ciBB2)} --
+ plot [smooth] coordinates {(ciBB2)(ciCC2)(ciAA2)} --
+ plot [smooth,tension=1.75] coordinates {(ciAA2)(ciXpointA)(ciAA1)} -- cycle ;
+ \end{pgfonlayer}
+ \end{scope}
+ %++++++++++++++++++++++++++++++++++++
+ %% +++ ONLY FOR DEVELOPER +++++++++++
+ %% control points
+ \ifxtXpoints
+ \ifxtXpointsONE
+ \ifxtXpointsLabel
+ \xtXnodedot*[fill=green](ciA)<right>{A}(\xtXpointsizeB)
+ \xtXnodedot*[fill=green](ciB)<left>{B}(\xtXpointsizeB)
+ \xtXnodedot*[green](ciC)<right>{A}(\xtXpointsizeB)
+ \xtXnodedot*[fill=green](ciroot)(\xtXpointsizeB)
+ \xtXnodedot*[fill=green](cimid)<right>{m}(\xtXpointsizeB)
+ \else
+ \xtXnodedot[fill=green](ciA)<right>{A}(\xtXpointsizeB)
+ \xtXnodedot[fill=green](ciB)<left>{B}(\xtXpointsizeB)
+ \xtXnodedot[green](ciC)<right>{A}(\xtXpointsizeB)
+ \xtXnodedot[fill=green](ciroot)(\xtXpointsizeB)
+ \xtXnodedot[fill=green](cimid)<right>{m}(\xtXpointsizeB)
+ \fi
+ \fi
+ \ifxtXpointsTWO
+ \ifxtXpointsLabel
+ \xtXnodedot*[blue](ciAA1)<below>{a1}(\xtXpointsizeA)
+ \xtXnodedot*[red](ciAA2)<above>{a2}(\xtXpointsizeA)
+ \xtXnodedot*[blue](ciBB1)<below>{b1}(\xtXpointsizeA)
+ \xtXnodedot*[red](ciBB2)<above>{b2}(\xtXpointsizeA)
+ \xtXnodedot*[blue](ciCC1)<below>{c1}(\xtXpointsizeA)
+ \xtXnodedot*[red](ciCC2)<above>{c2}(\xtXpointsizeA)
+ \else
+ \xtXnodedot[blue](ciAA1)<below>{a1}(\xtXpointsizeA)
+ \xtXnodedot[red](ciAA2)<above>{a2}(\xtXpointsizeA)
+ \xtXnodedot[blue](ciBB1)<below>{b1}(\xtXpointsizeA)
+ \xtXnodedot[red](ciBB2)<above>{b2}(\xtXpointsizeA)
+ \xtXnodedot[blue](ciCC1)<below>{c1}(\xtXpointsizeA)
+ \xtXnodedot[red](ciCC2)<above>{c2}(\xtXpointsizeA)
+ \fi
+ \fi
+ \ifxtXpointsTHREE
+ \ifxtXpointsLabel
+ \xtXnodedot*[blue](ciXpointA)<left>{x}(\xtXpointsizeA)
+ \xtXnodedot*[red](ciXpointB)<right>{y}(\xtXpointsizeA)
+ \else
+ \xtXnodedot[blue](ciXpointA)<left>{x}(\xtXpointsizeA)
+ \xtXnodedot[red](ciXpointB)<right>{y}(\xtXpointsizeA)
+ \fi
+ \fi
+ \fi
+ % X circles
+ \ifxtXcircles
+ \ifxtXcircleX
+ \node at (ciA) [-,circle,draw=blue,opacity=.5,minimum size=\tosstocntmXcircles ] {} ;
+ \fi
+ \ifxtXcircleY
+ \node at (ciB) [-,circle,draw=red,opacity=.5,minimum size=\tosstocntmXcircles ] {} ;
+ \fi
+ \fi
+ %++++++++++++++++++++++++++++++++++++
+}
+
+
+%%-----------------
+%% expl3 from here again
+%%-----------------
+
+\ExplSyntaxOn
+
+%% preset for \istb (for outermost branches) for "cntm triangle" and "cntm arc"
+% cntmA stands for "cntm arc"
+
+% cntm color
+
+\def\cntm@default@opt { }
+\newcommand*\cntmopt { \cntm@default@opt }
+
+\def\cntm@default@drawcolor { black!25 }
+\newcommand*\cntmdrawcolor { \cntm@default@drawcolor }
+\def\cntm@default@fillcolor { \cntm@default@drawcolor }
+\newcommand*\cntmfillcolor { \cntm@default@fillcolor }
+\def\cntm@default@pos { 1 }
+\newcommand*\cntmpos { \cntm@default@pos }
+
+% cntm outermost draw options
+\def\cntm@default@branchopt { draw = none } % "draw=none" needed to keep cntm "triangle" default
+\newcommand*\cntmbranchopt { \cntm@default@branchopt }
+
+\def\cntmLeftAL { } % leftmost AL
+\def\cntmLeftALpos { } % leftmost AL position
+\def\cntmRightAL { } % rightmost AL
+\def\cntmRightALpos { } % rightmost AL position
+
+% cntmA outermost draw options
+\def\cntmAbranchdrawopt { } % "empty" needed for cntmA outermost "branch" control
+
+\def\cntmALeftAL { } % leftmost AL
+\def\cntmALeftALpos { } % leftmost AL position
+\def\cntmARightAL { } % rightmost AL
+\def\cntmARightALpos { } % rightmost AL position
+
+
+\bool_set_false:N \_cntm_pos_call_bool
+
+% \cntmpreset
+% * [ draw, color, fill ] { shrink factor } [ fill color ]
+% the first, if exists, [ fill=color ] wins the second [ fill color ]
+% that is, \cntmopt (with fill=color) wins \cntmfillcolor
+\NewDocumentCommand \cntmpreset { s O{} g o }
+{
+ \IfNoValueTF {#3}
+ {
+ \renewcommand*\cntmpos{\cntm@default@pos}
+ }
+ {
+ \renewcommand*\cntmpos{#3}
+ \bool_set_true:N \_cntm_pos_call_bool
+ }
+ \IfBooleanTF {#1}
+ {
+ \IfValueTF {#4}
+ {
+ \renewcommand*\cntmfillcolor{#4}
+ \renewcommand*\cntmopt{ - , solid , draw = black , fill = \cntmfillcolor , #2 }
+ }
+ {
+ \renewcommand*\cntmopt{ - , solid , draw = black , fill = none , #2 }
+ }
+ }
+ {
+ \IfValueT {#4}
+ {
+ \renewcommand*\cntmdrawcolor{#4}
+ \let\cntmfillcolor\cntmdrawcolor
+ }
+ \renewcommand*\cntmopt{ - , solid, draw = \cntmdrawcolor , fill = \cntmfillcolor, #2}
+ }
+}
+
+
+% ============
+% complication needed to resolve tex expansion issues
+% ------------
+
+% \cntmistb
+% complication:
+ % controls options for outermost branches via \l_cntm_left/rightmost_branch_opt_tl
+ % finally used in \istrootcntm and \istrootocntm
+% USE this BEFORE \istrootcntm
+% * [ line opt ] { LEFT AL } [ LEFT pos ] { RIGHT AL } [ RIGHT pos ]
+\NewDocumentCommand \cntmistb{ s O{} +G{} O{} +G{} O{} }
+{
+ \renewcommand*\cntmbranchopt { - , draw=none, #2 }
+ \renewcommand*\cntmLeftAL {#3}
+ \renewcommand*\cntmRightAL {#5}
+ \renewcommand*\cntmLeftALpos
+ {
+% \str_case_e:nnF {#4}
+ \str_case:nnF {#4}
+ {
+ {al} { above~left , text~depth = .25ex ,
+ xshift = \istactionlabelxshift , yshift = -\istactionlabelyshift }
+ {ar} { above~right , text~depth = .25ex ,
+ xshift = -\istactionlabelxshift , yshift = -\istactionlabelyshift }
+ {bl} { below~left , text~depth = .25ex ,
+ xshift = \istactionlabelxshift , yshift = \istactionlabelyshift }
+ {br} { below~right , text~depth = .25ex ,
+ xshift = -\istactionlabelxshift , yshift = \istactionlabelyshift }
+ {l} { left , text~depth = .25ex , xshift = -\xtALxShift }
+ {r} { right , text~depth = .25ex , xshift = \xtALxShift }
+ {a} { above , text~depth = .25ex , xshift = \xtALxShift }
+ {b} { below , text~depth = .25ex , xshift = -\xtALxShift }
+ }
+ {
+ #4
+ }
+ }
+ \renewcommand*\cntmRightALpos
+ {
+% \str_case_e:nnF {#6}
+ \str_case:nnF {#6}
+ {
+ {al} { above~left , text~depth = .25ex ,
+ xshift = \istactionlabelxshift , yshift = -\istactionlabelyshift }
+ {ar} { above~right , text~depth = .25ex ,
+ xshift = -\istactionlabelxshift , yshift = -\istactionlabelyshift }
+ {bl} { below~left , text~depth = .25ex ,
+ xshift = \istactionlabelxshift , yshift = \istactionlabelyshift }
+ {br} { below~right , text~depth = .25ex ,
+ xshift = -\istactionlabelxshift , yshift = \istactionlabelyshift }
+ {l} { left , text~depth = .25ex , xshift = -\xtALxShift }
+ {r} { right , text~depth = .25ex , xshift = \xtALxShift }
+ {a} { above , text~depth = .25ex , xshift = \xtALxShift }
+ {b} { below , text~depth = .25ex , xshift = -\xtALxShift }
+ }
+ {
+ #6
+ }
+ }
+ \IfBooleanTF {#1}
+ { % disobey \xtShowEndPoints* -- force to print solid node
+ \renewcommand*\cntm@show@endpoint { node [ at~end , solid~node ] {} }
+ }
+ { % obey \xtShowEndPoints* and toss the value to \istrootntm(A) via \cntmOUTERistb
+ \cntm@show@endpoint
+ }
+}
+
+
+% \cntmAistb
+% complication:
+ % controls options for outermost branches via \l_cntmA_left/rightmost_branch_opt_tl
+ % finally used in \istrootcntmA and \istrootocntmA
+% USE this BEFORE \istrootcntmA
+% * [ line opt ] { LEFT AL } [ LEFT pos ] { RIGHT AL } [ RIGHT pos ]
+\NewDocumentCommand \cntmAistb { s O{-} +G{} O{} +G{} O{} }
+{
+ \renewcommand*\cntmAbranchdrawopt {#2}
+ \renewcommand*\cntmALeftAL {#3}
+ \renewcommand*\cntmARightAL {#5}
+ \renewcommand*\cntmALeftALpos
+ {
+% \str_case_e:nnF {#4}
+ \str_case:nnF {#4}
+ {
+ {al} { above~left , text~depth = .25ex ,
+ xshift = \istactionlabelxshift , yshift = -\istactionlabelyshift }
+ {ar} { above~right , text~depth = .25ex ,
+ xshift = -\istactionlabelxshift , yshift = -\istactionlabelyshift }
+ {bl} { below~left , text~depth = .25ex ,
+ xshift = \istactionlabelxshift , yshift = \istactionlabelyshift }
+ {br} { below~right , text~depth = .25ex ,
+ xshift = -\istactionlabelxshift , yshift = \istactionlabelyshift }
+ {l} { left , text~depth = .25ex , xshift = -\xtALxShift }
+ {r} { right , text~depth = .25ex , xshift = \xtALxShift }
+ {a} { above , text~depth = .25ex , xshift = \xtALxShift }
+ {b} { below , text~depth = .25ex , xshift = -\xtALxShift }
+ }
+ {
+ #4
+ }
+ }
+ \renewcommand*\cntmARightALpos
+ {
+% \str_case_e:nnF {#6}
+ \str_case:nnF {#6}
+ {
+ {al} { above~left , text~depth = .25ex ,
+ xshift = \istactionlabelxshift , yshift = -\istactionlabelyshift }
+ {ar} { above~right , text~depth = .25ex ,
+ xshift = -\istactionlabelxshift , yshift = -\istactionlabelyshift }
+ {bl} { below~left , text~depth = .25ex ,
+ xshift = \istactionlabelxshift , yshift = \istactionlabelyshift }
+ {br} { below~right , text~depth = .25ex ,
+ xshift = -\istactionlabelxshift , yshift = \istactionlabelyshift }
+ {l} { left , text~depth = .25ex , xshift = -\xtALxShift }
+ {r} { right , text~depth = .25ex , xshift = \xtALxShift }
+ {a} { above , text~depth = .25ex , xshift = \xtALxShift }
+ {b} { below , text~depth = .25ex , xshift = -\xtALxShift }
+ }
+ {
+ #6
+ }
+ }
+ \IfBooleanTF {#1}
+ { % disobey \xtShowEndPoints* -- force to print solid node
+ \renewcommand*\cntm@show@endpoint { node [ at~end , solid~node ] {} }
+ }
+ { % obey \xtShowEndPoints* and toss the value to \istrootntm(A) via \cntmOUTERistb
+ \cntm@show@endpoint
+ }
+}
+
+% to restore initial values after \cntmistb
+% (restore is done by \endist)
+\def\cntmistbVariablesRestore
+{
+ \renewcommand*\cntmbranchopt { \cntm@default@branchopt }
+ \renewcommand*\cntmLeftAL { }
+ \renewcommand*\cntmRightAL { }
+ \renewcommand*\cntmLeftALpos { }
+ \renewcommand*\cntmRightALpos { }
+}
+
+% to restore initial values after \cntmistb
+% (restore is done by \endist)
+\def\cntmAistbVariablesRestore
+{
+ \renewcommand*\cntmAbranchdrawopt { }
+ \renewcommand*\cntmALeftAL { }
+ \renewcommand*\cntmARightAL { }
+ \renewcommand*\cntmALeftALpos { }
+ \renewcommand*\cntmARightALpos { }
+}
+
+% \cntmistb LEFT/RIGHT options:
+% (still in the complication) collecting branch options input by \cntmistb
+% the collected token list will be used in \istrootcntm and \istrootocntm
+% [ - , \cntmAbranchdrawopt ] { LEFT AL } [ LEFT pos ] { RIGHT AL } [ RIGHT pos ]
+\cs_new:Npn \_collect_cntm_leftmost_branch_opts:
+{
+ \tl_set:Nn \l_cntm_leftmost_branch_opt_tl { [ - , }
+ \tl_put_right:Nx \l_cntm_leftmost_branch_opt_tl { \cntmbranchopt ] }
+ \tl_put_right:Nn \l_cntm_leftmost_branch_opt_tl { { \istactionlabelstyle { \cntmLeftAL } } }
+ \tl_put_right:Nx \l_cntm_leftmost_branch_opt_tl { [ \cntmLeftALpos ] }
+}
+
+\cs_new:Npn \_collect_cntm_rightmost_branch_opts:
+{
+ \tl_set:Nn \l_cntm_rightmost_branch_opt_tl { [ - , }
+ \tl_put_right:Nx \l_cntm_rightmost_branch_opt_tl { \cntmbranchopt ] }
+ \tl_put_right:Nn \l_cntm_rightmost_branch_opt_tl { { \istactionlabelstyle { \cntmRightAL } } }
+ \tl_put_right:Nx \l_cntm_rightmost_branch_opt_tl { [ \cntmRightALpos ] }
+}
+
+
+% \cntmAistb LEFT/RIGHT options:
+% (still in the complication) collecting branch options input by \cntmAistb
+% the collected token list will be used in \istrootcntmA and \istrootocntmA
+% [ - , \cntmAbranchdrawopt ] { LEFT AL } [ LEFT pos ] { RIGHT AL } [ RIGHT pos ]
+\cs_new:Npn \_collect_cntmA_leftmost_branch_opts:
+{
+ \tl_set:Nn \l_cntmA_leftmost_branch_opt_tl { [ - , }
+ \tl_put_right:Nx \l_cntmA_leftmost_branch_opt_tl { \cntmAbranchdrawopt ] }
+ \tl_put_right:Nn \l_cntmA_leftmost_branch_opt_tl { { \istactionlabelstyle { \cntmALeftAL } } }
+ \tl_put_right:Nx \l_cntmA_leftmost_branch_opt_tl { [ \cntmALeftALpos ] }
+}
+
+\cs_new:Npn \_collect_cntmA_rightmost_branch_opts:
+{
+ \tl_set:Nn \l_cntmA_rightmost_branch_opt_tl { [ - , }
+ \tl_put_right:Nx \l_cntmA_rightmost_branch_opt_tl { \cntmAbranchdrawopt ] }
+ \tl_put_right:Nn \l_cntmA_rightmost_branch_opt_tl { { \istactionlabelstyle { \cntmARightAL } } }
+ \tl_put_right:Nx \l_cntmA_rightmost_branch_opt_tl { [ \cntmARightALpos ] }
+}
+
+
+% complication needed to resolve tex expansion issues (for cntm triangle)
+% this will be used to draw cntm triangle in \istrootcntm and \istrootcntmo
+% [ - , draw = \cntmdrawcolor , fill = \cntmfillcolor ]
+\cs_new:Npn \_collect_cntm_triangle_cmdstr:
+{
+ \tl_set:Nn \l_tmp_option_str_tl { [ - , }
+ \tl_put_right:Nn \l_tmp_option_str_tl { draw = }
+ \tl_put_right:Nx \l_tmp_option_str_tl { \cntmdrawcolor , }
+ \tl_put_right:Nn \l_tmp_option_str_tl { fill = }
+ \tl_put_right:Nx \l_tmp_option_str_tl { \cntmfillcolor , }
+ \tl_put_right:Nx \l_tmp_option_str_tl { \cntmopt ] }
+}
+
+
+% \cntmOUTERistb
+% modification of \istb for cntm outermost branches with NO PAYOFF
+% this actually draws outermost branches (used in \istrootcntm and \istrootocntm)
+\NewDocumentCommand \cntmOUTERistb
+{ s D<>{} O{} +G{} O{} }
{
+ \tl_put_right:Nn \ischo_game_tl
+ {
+ child [ #2 ]
+ {
+ \ist_move:nnn { \xt@show@midarrow , \xt@show@arrow , #3 } { #5 } { #4 }
+ % the next must NOT go BEFORE \ist_move:nnn : PROBLEMatic (possibly TikZ problem)
+ \IfBooleanTF { #1 } { \cntm@ndot } { \cntm@show@endpoint }
+ }
+ }
+}
+
+
+% \cntmAOUTERistb
+% modification of \istb for cntmA outermost branches with NO PAYOFF
+% this actually draws outermost branches (used in \istrootcntmA and \istrootocntmA)
+\NewDocumentCommand \cntmAOUTERistb
+{ s D<>{} O{} +G{} O{} +g O{\istgrowdirection} }
+{
+ \tl_put_right:Nn \ischo_game_tl
+ {
+ child [ #2 ]
+ {
+ \ist_move:nnn { \xt@show@midarrow , \xt@show@arrow , #3 } { #5 } { #4 }
+ % the next must NOT go BEFORE \ist_move:nnn : PROBLEMatic (possibly TikZ problem)
+ \IfBooleanTF { #1 } { \cntm@ndot } { \cntm@show@endpoint }
+ }
+ }
+}
+
+% ------------
+% complication so far needed to resolve tex expansion issues
+% still more complication below
+% ============
+
+
+%% main macros: continuum of branches
+
+% \istrootcntm -- standard cntm version
+% ' [grow] (root) (at) [node style] <angle> {owner} +cntmlevdist..cntmsibdist+
+\NewDocumentCommand \istrootcntm
+{ t' O{\istdefault@grow} r() D(){0,0} O{} D<>{above} G{} d+. d.+ }
+{
+ % to suppress \xtShowArrows for cntm
+ \let\tmp@xt@show@arrow\xt@show@arrow
+ \def\xt@show@arrow { }
+ \let\tmp@xt@show@midarrow\xt@show@midarrow
+ \def\xt@show@midarrow { }
+
+ % Now \_cntm_levdist_local_tl and \_cntm_sibdist_local_tl is the bases
+ \IfNoValueTF {#8}
+ {
+ \bool_set_false:N \_cntm_distance_local_call_bool
+ \tl_set:Nn \_cntm_levdist_local_tl { \cntmlevdist }
+ \tl_set:Nn \_cntm_sibdist_local_tl { \cntmsibdist }
+ }
+ {
+ \bool_set_true:N \_cntm_distance_local_call_bool
+ \tl_set:Nn \_cntm_levdist_local_tl { #8 }
+ \tl_set:Nn \_cntm_sibdist_local_tl { #9 }
+ }
+
+ % Now \_cntm_act_sibdist_tl is the base
+ \bool_if:NTF \cntm_act_sibdist_call_bool
+ {
+ \tl_set:Nn \_cntm_act_sibdist_local_tl { \cntmACTsibdist }
+ }
+ {
+ \tl_set:Nn \_cntm_act_sibdist_local_tl { 1/3 * \_cntm_sibdist_local_tl }
+ }
+
+ % adjust \cntm position for smaller triangle
+ \pgfmathsetmacro \cntmlevdistVar { \cntmpos * \_cntm_levdist_local_tl }
+ \pgfmathsetmacro \cntmsibdistVar { \cntmpos * \_cntm_sibdist_local_tl }
+
+ %% \istroot(') : cntm outermost branches
+ \tl_clear:N \ischo_game_tl
+ \xdef\istgrowdirection{#2}
+
+ % execute \ISTRoot [\istgrowdirection] (cntm) (#4) [null node] +{#8}..{#9}+
+ % this defines (cntm)
\IfBooleanTF {#1}
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRoot' } }
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRoot } }
+ % collect arguments
+ \tl_put_right:Nx \ischo_game_tl
+ {
+ [ \istgrowdirection ] (cntm) (#4) [ null~node ]
+ + { \cntmlevdistVar } .. { \cntmsibdistVar } +
+ }
+
+ %% (before executing \istb) call options collected from above complication
+ \_collect_cntm_leftmost_branch_opts:
+ \_collect_cntm_rightmost_branch_opts:
+
+ % execute \istb \istb for cntm LEFT/RIGHT outermost branches
+ % this defines (cntm-1) and (cntm-2)
+ \exp_last_unbraced:NV \cntmOUTERistb \l_cntm_leftmost_branch_opt_tl
+ \exp_last_unbraced:NV \cntmOUTERistb \l_cntm_rightmost_branch_opt_tl
+ \printist ;
+
+ %% draw cntm triangle, using (cntm), (cntm-1), (cntm-2)
+ \begin{scope}[ shorten~< = 0pt , shorten~> = 0pt ]
+ % call (draw and fill) options collected from above complication
+ \_collect_cntm_triangle_cmdstr:
+ % and finally draw "cntm triangle"
+ % \draw [opts] (cntm) -- (cntm-1) -- (cntm-2) - (cntm) ;
+ \begin{pgfonlayer}{\cntm@default@layer} % default: background
+ \exp_last_unbraced:No \draw \l_tmp_option_str_tl (cntm)--(cntm-1)--(cntm-2)--(cntm) ;
+ \end{pgfonlayer}
+ \end{scope}
+
+ %% cntm action (actually taken by a player)
+ % this is normal \istroot(')
+ \tl_clear:N \ischo_game_tl
+
+ \IfBooleanTF {#1}
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRoot' } }
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRoot } }
+ % collect arguments
+ \tl_put_right:Nx \ischo_game_tl { [ \istgrowdirection ] (#3) (cntm) [#5] <#6> }
+ \tl_put_right:Nn \ischo_game_tl { { \istownerstyle{ #7 } } }
+ \tl_put_right:Nx \ischo_game_tl { +{ \_cntm_levdist_local_tl }..{ 1*\_cntm_act_sibdist_local_tl }+ }
+
+ % call set (for \istbA)
+ \bool_set_true:N \_istroot_cntm_call_bool % for \istbA
+
+ % back to normal \xtShowArrows
+ \let\xt@show@arrow\tmp@xt@show@arrow
+ \let\xt@show@midarrow\tmp@xt@show@midarrow
+}
+
+
+% resolving expansion issue (for cntmA)
+% [ - , tension=1 , \cntmAopt ]
+\cs_new:Npn \_collect_cntmA_cmdstr:
+{
+ \tl_set:Nn \l_tmp_arc_option_str_tl { [ - , tension=1 , }
+ \tl_put_right:Nx \l_tmp_arc_option_str_tl { \cntmAopt ] }
+}
+
+% [ - , tension=1 , \cntmAfillcolor ]
+\cs_new:Npn \_collect_cntmA_color_cmdstr:
+{
+ \tl_set:Nn \l_tmp_arc_color_str_tl { [ - , tension=1 , }
+ \tl_put_right:Nx \l_tmp_arc_color_str_tl { \cntmAfillcolor ] }
+}
+
+% \istrootcntmA -- cntm arc version
+% ' [grow] (root) (at) [node style] <angle> {owner} +cntmlevdist..cntmsibdist+
+\NewDocumentCommand \istrootcntmA
+{ t' O{\istdefault@grow} r() D(){0,0} O{} D<>{above} G{} d+. d.+ }
+{
+ % to suppress \xtShowArrows for cntm
+ \let\tmp@xt@show@arrow\xt@show@arrow
+ \def\xt@show@arrow { }
+ \let\tmp@xt@show@midarrow\xt@show@midarrow
+ \def\xt@show@midarrow { }
+
+ % Now \_cntm_levdist_local_tl and \_cntm_sibdist_local_tl is the bases
+ \IfNoValueTF {#8}
+ {
+ \bool_set_false:N \_cntmA_distance_local_call_bool
+ \tl_set:Nn \_cntmA_levdist_local_tl { \cntmlevdist }
+ \tl_set:Nn \_cntmA_sibdist_local_tl { \cntmsibdist }
+ }
+ {
+ \bool_set_true:N \_cntmA_distance_local_call_bool
+ \tl_set:Nn \_cntmA_levdist_local_tl { #8 }
+ \tl_set:Nn \_cntmA_sibdist_local_tl { #9 }
+ }
+
+ % Now \_cntm_act_sibdist_tl is the base
+ \bool_if:NTF \cntm_act_sibdist_call_bool
{
- \istCntmRootArc' [ #2 ] ( #3 ) ( #4 ) [ #5 ] { #6 } + #7 .. #8 +
+ \tl_set:Nn \_cntm_act_sibdist_local_tl {\cntmACTsibdist}
}
{
- \istCntmRootArc [ #2 ] ( #3 ) ( #4 ) [ #5 ] { #6 }+ #7 .. #8 +
+ \tl_set:Nn \_cntm_act_sibdist_local_tl {1/3*\_cntmA_sibdist_local_tl}
}
+
+ %% \ISTRoot(') : for drawing cntmA outermost branches
+ \tl_clear:N \ischo_game_tl
+ \xdef\istgrowdirection{#2}
+
+ % execute \ISTRoot
+ % this defines (cntm)
+ \IfBooleanTF {#1}
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRoot' } }
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRoot } }
+ % collect arguments
+ \tl_put_right:Nx \ischo_game_tl
+ { [ \istgrowdirection ] (cntm) (#4) [ null~node ]
+ +{\_cntmA_levdist_local_tl}..{\_cntmA_sibdist_local_tl}+ }
+
+ %% (before executing \istb) call options collected from above complication
+ \_collect_cntmA_leftmost_branch_opts:
+ \_collect_cntmA_rightmost_branch_opts:
+
+ % execute \istb \istb for cntmA LEFT/RIGHT outermost branches
+ % this defines (cntm-1) and (cntm-2)
+ \exp_last_unbraced:NV \cntmAOUTERistb \l_cntmA_leftmost_branch_opt_tl
+ \exp_last_unbraced:NV \cntmAOUTERistb \l_cntmA_rightmost_branch_opt_tl
+ \printist ;
+
+ %% defining cntmA points
+ % First, adjust plot vertex to compensate dependency of tree shape
+ \pgfmathsetmacro\cntmdistratio{ scalar (\_cntmA_levdist_local_tl/\_cntmA_sibdist_local_tl) }
+ % sqrt(1/3) is to make the cntmdist ratio 1/3 as standard
+ \pgfmathsetmacro\cntmAplotfactorVal
+ { 1 + (\cntmAplotfactor-1) * sqrt(1/3) / sqrt(\cntmdistratio) }
+ \pgfextra{\xdef\cntmAplotfactorAdj{\cntmAplotfactorVal}} % used also in \istbA(t)
+ \coordinate (cntmA-beg) at ( $ (cntm) ! \cntmApos ! (cntm-1) $ ) ; % begin point
+ \coordinate (cntmA-end) at ( $ (cntm) ! \cntmApos ! (cntm-2) $ ) ; % end point
+ \coordinate (cntmA-mid-base) at ( $ (cntm-1) ! .5 ! (cntm-2)$) ; % base midpoint
+ % defines "compensated" plot vertex
+ \coordinate (cntmA-vertex)
+ at ( $ (cntm) ! \cntmAplotfactorAdj*\cntmApos ! (cntmA-mid-base) $ ) ;
+ % (for expost/outside use)
+ \coordinate (cntmAi-begpoint) at ( $ (cntm) ! \cntmApos ! (cntm-1) $ ) ;
+ \coordinate (cntmAi-endpoint) at ( $ (cntm) ! \cntmApos ! (cntm-2) $ ) ;
+
+ %% plot cntmA
+ % \draw [ \cntmAopt , - , <opts> , tension=1 ]
+ \_collect_cntmA_cmdstr:
+ \_collect_cntmA_color_cmdstr:
+
+ \begin{scope}[ shorten~< = 0pt , shorten~> = 0pt ]
+ \begin{pgfonlayer}{\cntmAdefaultlayer} % default: behind
+ \exp_last_unbraced:No \fill \l_tmp_arc_color_str_tl
+ (cntm) -- plot [ smooth ] coordinates { (cntmA-beg) (cntmA-vertex) (cntmA-end) } -- cycle ;
+ \exp_last_unbraced:No \draw \l_tmp_arc_option_str_tl
+ plot [ smooth ] coordinates { (cntmA-beg) (cntmA-vertex) (cntmA-end) } ;
+ \end{pgfonlayer}
+ \end{scope}
+
+ %% cntmA action (actually taken by a player)
+ % this is normal \istroot(')
+ \tl_clear:N \ischo_game_tl
+
+ \IfBooleanTF {#1}
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRoot' } }
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRoot } }
+ % collect arguments
+ \tl_put_right:Nx \ischo_game_tl { [ \istgrowdirection ] (#3) (cntm) [#5] <#6> }
+ \tl_put_right:Nn \ischo_game_tl { { \istownerstyle{ #7 } } }
+ \tl_put_right:Nx \ischo_game_tl { +{ \_cntmA_levdist_local_tl }..{ 1*\_cntm_act_sibdist_local_tl }+ }
+
+ % call set (for \istbA)
+ \bool_set_true:N \_istroot_cntmA_call_bool
+
+ % back to normal \xtShowArrows
+ \let\xt@show@arrow\tmp@xt@show@arrow
+ \let\xt@show@midarrow\tmp@xt@show@midarrow
}
+% \cntmAexpostShowEndPoints
+% use this right after \istrootcntmA and \istrootocntmA
+% (before \cntmAInfoset and \cntmAInfosetO)
+\NewDocumentCommand \cntmAexpostShowEndPoints
+{ O{} O{} }
+{
+%\begin{pgfonlayer}{above} % main is ok
+\node [ solid~node , #1 ] at (cntmAi-begpoint) {} ;
+\node [ solid~node , #2 ] at (cntmAi-endpoint) {} ;
+%\end{pgfonlayer}
+}
-%% supplement macros
-% \xtInfoset
-\def\xtdefault@infosep{4pt}
-\newcommand*\setxtdefaultinfosep[1]{\renewcommand*\xtdefault@infosep{#1}}
+% \istrootocntm -- oval cntm version
+% ' [grow] (root) (at) [node style] <angle> {owner} +cntmlevdist..cntmsibdist+
+\NewDocumentCommand \istrootocntm
+{ t' O{\istdefault@grow} r() D(){0,0} O{} D<>{above} G{} d+. d.+ }
+{
+ % to suppress \xtShowArrows for cntm
+ \let\tmp@xt@show@arrow\xt@show@arrow
+ \def\xt@show@arrow { }
+ \let\tmp@xt@show@midarrow\xt@show@midarrow
+ \def\xt@show@midarrow { }
+
+ % Now \_cntm_levdist_local_tl and \_cntm_sibdist_local_tl is the bases
+ \IfNoValueTF {#8}
+ {
+ \bool_set_false:N \_cntm_distance_local_call_bool
+ \tl_set:Nn \_cntm_levdist_local_tl { \cntmlevdist }
+ \tl_set:Nn \_cntm_sibdist_local_tl { \cntmsibdist }
+ }
+ {
+ \bool_set_true:N \_cntm_distance_local_call_bool
+ \tl_set:Nn \_cntm_levdist_local_tl { #8 }
+ \tl_set:Nn \_cntm_sibdist_local_tl { #9 }
+ }
+
+ % Now \_cntm_act_sibdist_tl is the base
+ \bool_if:NTF \cntm_act_sibdist_call_bool
+ {
+ \tl_set:Nn \_cntm_act_sibdist_local_tl {\cntmACTsibdist}
+ }
+ {
+ \tl_set:Nn \_cntm_act_sibdist_local_tl {1/3*\_cntm_sibdist_local_tl}
+ }
+
+ % adjust \cntm position for smaller triangle
+ \pgfmathsetmacro\cntmlevdistVar{\cntmpos*\_cntm_levdist_local_tl}
+ \pgfmathsetmacro\cntmsibdistVar{\cntmpos*\_cntm_sibdist_local_tl}
+
+ %% \istrooto(') : cntm outermost branches
+ \tl_clear:N \ischo_game_tl
+ \xdef\istgrowdirection{#2}
+
+ % execute \ISTRoot [\istgrowdirection] (cntm) (#4) [null node] +{#8}..{#9}+
+ % this defines (cntm)
+ \IfBooleanTF {#1}
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRootO' } }
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRootO } }
+ % collect arguments
+ \tl_put_right:Nx \ischo_game_tl
+ {
+ [ \istgrowdirection ] (cntm) (#4) [ null~node ]
+ +{\cntmlevdistVar}..{\cntmsibdistVar}+
+ }
+
+ %% (before executing \istb) call options collected from above complication
+ \_collect_cntm_leftmost_branch_opts:
+ \_collect_cntm_rightmost_branch_opts:
+
+ % execute \istb \istb for cntm LEFT/RIGHT outermost branches
+ % this defines (cntm-1) and (cntm-2)
+ \exp_last_unbraced:NV \cntmOUTERistb \l_cntm_leftmost_branch_opt_tl
+ \exp_last_unbraced:NV \cntmOUTERistb \l_cntm_rightmost_branch_opt_tl
+ \printist ;
+
+ %% draw cntm triangle, using (cntm), (cntm-1), (cntm-2)
+ \begin{scope}[ shorten~< = 0pt , shorten~> = 0pt ]
+ % call (draw and fill) options collected from above complication
+ \_collect_cntm_triangle_cmdstr:
+ % and finally draw "cntm triangle"
+ % \draw [opts] (cntm) -- (cntm-1) -- (cntm-2) - (cntm) ;
+ \begin{pgfonlayer}{\cntm@default@layer} % default: background
+ \exp_last_unbraced:No \draw \l_tmp_option_str_tl (cntm)--(cntm-1)--(cntm-2)--(cntm) ;
+ \end{pgfonlayer}
+ \end{scope}
+
+ %% cntm action (actually taken by a player)
+ % this is normal \istrooto(')
+ \tl_clear:N \ischo_game_tl
+
+ \IfBooleanTF {#1}
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRootO' } }
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRootO } }
+ % collect arguments
+ \tl_put_right:Nx \ischo_game_tl { [ \istgrowdirection ] (#3) (cntm) [#5] <#6> }
+ \tl_put_right:Nn \ischo_game_tl { { \istownerstyle{ #7 } } }
+ \tl_put_right:Nx \ischo_game_tl { +{ \_cntm_levdist_local_tl }..{ 1*\_cntm_act_sibdist_local_tl }+ }
+
+ % call set (for \istbA)
+ \bool_set_true:N \_istroot_cntm_call_bool % for \istbA (HERE, USE \_istroot_ but not \_istrooto_ )
+
+ % back to normal \xtShowArrows
+ \let\xt@show@arrow\tmp@xt@show@arrow
+ \let\xt@show@midarrow\tmp@xt@show@midarrow
+}
+
+% \istrootocntmA -- oval cntm arc version
+% ' [grow] (root) (at) [node style] <angle> {owner} +cntmlevdist..cntmsibdist+
+\NewDocumentCommand \istrootocntmA
+{ t' O{\istdefault@grow} r() D(){0,0} O{} D<>{above} G{} d+. d.+ }
+{
+ % to suppress \xtShowArrows for cntm
+ \let\tmp@xt@show@arrow\xt@show@arrow
+ \def\xt@show@arrow { }
+ \let\tmp@xt@show@midarrow\xt@show@midarrow
+ \def\xt@show@midarrow { }
+
+ % Now \_cntm_levdist_local_tl and \_cntm_sibdist_local_tl is the bases
+ \IfNoValueTF {#8}
+ {
+ \bool_set_false:N \_cntmA_distance_local_call_bool
+ \tl_set:Nn \_cntmA_levdist_local_tl { \cntmlevdist }
+ \tl_set:Nn \_cntmA_sibdist_local_tl { \cntmsibdist }
+ }
+ {
+ \bool_set_true:N \_cntmA_distance_local_call_bool
+ \tl_set:Nn \_cntmA_levdist_local_tl { #8 }
+ \tl_set:Nn \_cntmA_sibdist_local_tl { #9 }
+ }
-\NewDocumentCommand\xtInfoset{t'O{}r()r()G{}O{}D(){\xtdefault@infosep}}
+ % Now \_cntm_act_sibdist_tl is the base
+ \bool_if:NTF \cntm_act_sibdist_call_bool
+ {
+ \tl_set:Nn \_cntm_act_sibdist_local_tl {\cntmACTsibdist}
+ }
+ {
+ \tl_set:Nn \_cntm_act_sibdist_local_tl {1/3*\_cntmA_sibdist_local_tl}
+ }
+
+ %% \ISTRootO(') : for drawing cntmA outermost branches
+ \tl_clear:N \ischo_game_tl
+ \xdef\istgrowdirection{#2}
+
+ % execute \ISTRootO
+ % this defines (cntm)
+ \IfBooleanTF {#1}
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRootO' } }
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRootO } }
+ % collect arguments
+ \tl_put_right:Nx \ischo_game_tl
+ { [ \istgrowdirection ] (cntm) (#4) [ null~node ]
+ +{\_cntmA_levdist_local_tl}..{\_cntmA_sibdist_local_tl}+ }
+
+ %% (before executing \istb) call options collected from above complication
+ \_collect_cntmA_leftmost_branch_opts:
+ \_collect_cntmA_rightmost_branch_opts:
+
+ % execute \istb \istb for cntmA LEFT/RIGHT outermost branches
+ % this defines (cntm-1) and (cntm-2)
+ \exp_last_unbraced:NV \cntmAOUTERistb \l_cntmA_leftmost_branch_opt_tl
+ \exp_last_unbraced:NV \cntmAOUTERistb \l_cntmA_rightmost_branch_opt_tl
+ \printist ;
+
+ %% defining cntmA points
+ % First, adjust plot vertex to compensate dependency of tree shape
+ \pgfmathsetmacro\cntmdistratio{ scalar (\_cntmA_levdist_local_tl/\_cntmA_sibdist_local_tl) }
+ % sqrt(1/3) is to make the cntmdist ratio 1/3 as standard
+ \pgfmathsetmacro\cntmAplotfactorVal
+ { 1 + (\cntmAplotfactor-1) * sqrt(1/3) / sqrt(\cntmdistratio) }
+ \pgfextra{\xdef\cntmAplotfactorAdj{\cntmAplotfactorVal}} % used also in \istbA(t)
+ \coordinate (cntmA-beg) at ( $ (cntm) ! \cntmApos ! (cntm-1) $ ) ; % begin point
+ \coordinate (cntmA-end) at ( $ (cntm) ! \cntmApos ! (cntm-2) $ ) ; % end point
+ \coordinate (cntmA-mid-base) at ( $ (cntm-1) ! .5 ! (cntm-2)$) ; % base midpoint
+ % defines "compensated" plot vertex
+ \coordinate (cntmA-vertex)
+ at ( $ (cntm) ! \cntmAplotfactorAdj*\cntmApos ! (cntmA-mid-base) $ ) ;
+ % (for expost/outside use)
+ \coordinate (cntmAi-begpoint) at ( $ (cntm) ! \cntmApos ! (cntm-1) $ ) ;
+ \coordinate (cntmAi-endpoint) at ( $ (cntm) ! \cntmApos ! (cntm-2) $ ) ;
+
+ %% plot cntmA
+ % \draw [ \cntmAopt , - , <opts> , tension=1 ]
+ \_collect_cntmA_cmdstr:
+ \_collect_cntmA_color_cmdstr:
+
+ \begin{scope}[ shorten~< = 0pt , shorten~> = 0pt ]
+ \begin{pgfonlayer}{\cntmAdefaultlayer} % default: behind
+ \exp_last_unbraced:No \fill \l_tmp_arc_color_str_tl
+ (cntm) -- plot [ smooth ] coordinates { (cntmA-beg) (cntmA-vertex) (cntmA-end) } -- cycle ;
+ \exp_last_unbraced:No \draw \l_tmp_arc_option_str_tl
+ plot [ smooth ] coordinates { (cntmA-beg) (cntmA-vertex) (cntmA-end) } ;
+ \end{pgfonlayer}
+ \end{scope}
+
+ %% cntmA action (actually taken by a player)
+ % this is normal \istrooto(')
+ \tl_clear:N \ischo_game_tl
+
+ \IfBooleanTF {#1}
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRootO' } }
+ { \tl_put_right:Nn \ischo_game_tl { \ISTRootO } }
+ % collect arguments
+ \tl_put_right:Nx \ischo_game_tl { [ \istgrowdirection ] (#3) (cntm) [#5] <#6> }
+ \tl_put_right:Nn \ischo_game_tl { { \istownerstyle{ #7 } } }
+ \tl_put_right:Nx \ischo_game_tl { +{ \_cntmA_levdist_local_tl }..{ 1*\_cntm_act_sibdist_local_tl }+ }
+
+ % call set (for \istbA)
+ \bool_set_true:N \_istroot_cntmA_call_bool
+
+ % back to normal \xtShowArrows
+ \let\xt@show@arrow\tmp@xt@show@arrow
+ \let\xt@show@midarrow\tmp@xt@show@midarrow
+}
+
+
+%% OBSOLETE macros - backward compatibility (to be removed next update)
+
+% \obsoleteISTCntm (obsolete) - backward compatibility
+% (used in \istcntm)
+\NewDocumentCommand \obsoleteISTCntm
+{ t' O{south} r() D(){0,0} O{\cntm@default@drawcolor} G{.5}
+ D+.{\cntmdefaultlevdist} D.+{\cntmdefaultsibdist} }
{
+ \cntmdistance{#7}{#8}
+ \tikzset{level~1/.style={level~distance=\cntmlevdist,sibling~distance=\cntmsibdist}}
+ %
\IfBooleanTF {#1}
- {%'
- \draw [semithick, dotted,#2]
- (#4) to (#3)
- node at ($(#4)!.5!(#3)$) [above,#6] {#5};
+ {
+ \setistNullNodeStyle[#5]{\istdefault@null@nodesize}[#5]
+ \begin{pgfonlayer}{background}
+ \node (#3) at (#4) [ null~node ] { } [ \xt@growswap = #2 ] child child ;
+ \draw [ #5 , fill = #5 ] (#3) -- (#3-1) -- (#3-2) -- (#3) ;
+ \end{pgfonlayer}
+ \setistNullNodeStyle{\istdefault@null@nodesize}
}
{
- \draw [semithick, dotted,#2]
- (#3) to (#4)
- node~at ($(#3)!.5!(#4)$) [above,#6] {#5};
+ \setistNullNodeStyle[#5]{\istdefault@null@nodesize}[#5]
+ \begin{pgfonlayer}{background}
+ \node (#3) at (#4) [ null~node ] { } [ \xt@grow = #2 ] child child ;
+ \draw [ #5 , fill = #5 ] (#3) -- (#3-1) -- (#3-2) -- (#3) ;
+ \end{pgfonlayer}
+ \setistNullNodeStyle{\istdefault@null@nodesize}
}
}
+% \obsoleteISTCntmArc (arc version) (obsolete) - backward compatibility
+% (used in \istcntmA)
+\NewDocumentCommand \obsoleteISTCntmArc
+{ t' O{south} r() D(){0,0} O{} G{.5} D+.{\cntmdefaultlevdist} D.+{\cntmdefaultsibdist} }
+{
+ \cntmdistance{#7}{#8}
+ \tikzset{level~1/.style={level~distance=\cntmlevdist,sibling~distance=\cntmsibdist}}
+ %
+ \IfBooleanTF {#1}
+ {
+ \begin{pgfonlayer}{background}
+ \node (#3) at (#4) [ null~node ] { } [\xt@growswap=#2] child child ;
+ \draw [ bend~left , #5 ] ( $ (#3) ! #6 ! (#3-1) $ ) to ( $ (#3) ! #6 ! (#3-2) $ ) ;
+ \end{pgfonlayer}
+ }
+ {
+ \begin{pgfonlayer}{background}
+ \node (#3) at (#4) [ null~node ] { } [\xt@grow=#2] child child ;
+ \draw [ bend~right , #5 ] ( $ (#3) ! #6 ! (#3-1) $ ) to ( $ (#3) ! #6 ! (#3-2) $ ) ;
+ \end{pgfonlayer}
+ }
+}
-% \xtInfosetO -- oval version
-\NewDocumentCommand\xtInfosetO{t'O{}r()r()G{}O{}D(){\xtdefault@infosep}}
+
+% \istcntm(') (obsolete) - backward compatibility
+\NewDocumentCommand \istcntm
+{ t' O{\istdefault@grow} r() D(){0,0} O{\cntm@default@drawcolor} G{}
+ D+.{\cntmdefaultlevdist} D.+{\cntmdefaultsibdist} }
{
+ \xdef\istgrowdirection{#2} % used in \istb to specify [payoff direction]
+ \IfBooleanTF {#1}
+ {
+ \obsoleteISTCntm' [ \istgrowdirection ] ( #3 ) ( #4 ) [ #5 ] + #7 .. #8 +
+ }
+ {
+ \obsoleteISTCntm [ \istgrowdirection ] ( #3 ) ( #4 ) [ #5 ] + #7 .. #8 +
+ }
+}
+
+% \istcntmarc(') (obsolete) - backward compatibility
+\NewDocumentCommand \istcntmarc
+{ t' O{\istdefault@grow} r() D(){0,0} O{} G{.5} D+.{\cntmdefaultlevdist} D.+{\cntmdefaultsibdist} }
+{
+ \xdef\istgrowdirection{#2} % used in \istb to specify [payoff direction]
\IfBooleanTF {#1}
- {%'
- \begin{scope}[on~background~layer]
- \draw [-,semithick,densely~dotted,rounded~corners=#7,#2]
- ($(#4)+(-#7,#7)$) rectangle ($(#3)+(#7,-#7)$)
- node at ($(#4)!.5!(#3)$) [#6] {#5};
+ {
+ \obsoleteISTCntmArc' [ \istgrowdirection ] ( #3 ) ( #4 ) [ #5 ] { #6 } + #7 .. #8 +
+ }
+ {
+ \obsoleteISTCntmArc [ \istgrowdirection ] ( #3 ) ( #4 ) [ #5 ] { #6 }+ #7 .. #8 +
+ }
+}
+
+
+%% supplementary macros
+
+%% \xInfosetOwner (with abbreviations)
+% * (from) (to) {owner} [pos]
+\NewDocumentCommand \xtInfosetOwner{ s r() r() +m O{} }
+{
+ \begin{scope} % in group: to make \setistmathTF011 local
+ \IfBooleanTF { #1 } { } { \setistmathTF011 \istownertextfont{} }
+% \str_case_e:nnF { #5 }
+ \str_case:nnF { #5 }
+ {
+ { al } { \node [ above~left ] at ( $ (#2)!.5!(#3) $ ) { \istownerstyle{#4} } ; }
+ { ar } { \node [ above~right ] at ( $ (#2)!.5!(#3) $ ) { \istownerstyle{#4} } ; }
+ { bl } { \node [ below~left ] at ( $ (#2)!.5!(#3) $ ) { \istownerstyle{#4} } ; }
+ { br } { \node [ below~right ] at ( $ (#2)!.5!(#3) $ ) { \istownerstyle{#4} } ; }
+ { l } { \node [ left ] at ( $ (#2)!.5!(#3) $ ) { \istownerstyle{#4} } ; }
+ { r } { \node [ right ] at ( $ (#2)!.5!(#3) $ ) { \istownerstyle{#4} } ; }
+ { a } { \node [ above ] at ( $ (#2)!.5!(#3) $ ) { \istownerstyle{#4} } ; }
+ { b } { \node [ below ] at ( $ (#2)!.5!(#3) $ ) { \istownerstyle{#4} } ; }
+ }
+ {
+ \node [ #5 ] at ( $ (#2)!.5!(#3) $ ) { \istownerstyle{#4} } ;
+ }
\end{scope}
+}
+
+% \xtOwner (with abbreviations)
+% * (coor) {owner} [pos]
+\NewDocumentCommand \xtOwner{ s r() +m O{} }
+{
+ \begin{scope} % in group: to make \setistmathTF011 local
+ \IfBooleanTF { #1 } { } { \setistmathTF011 \istownertextfont{} }
+% \str_case_e:nnF { #4 }
+ \str_case:nnF { #4 }
+ {
+ { al } { \node [ above~left ] at (#2) { \istownerstyle{#3} } ; }
+ { ar } { \node [ above~right ] at (#2) { \istownerstyle{#3} } ; }
+ { bl } { \node [ below~left ] at (#2) { \istownerstyle{#3} } ; }
+ { br } { \node [ below~right ] at (#2) { \istownerstyle{#3} } ; }
+ { l } { \node [ left ] at (#2) { \istownerstyle{#3} } ; }
+ { r } { \node [ right ] at (#2) { \istownerstyle{#3} } ; }
+ { a } { \node [ above ] at (#2) { \istownerstyle{#3} } ; }
+ { b } { \node [ below ] at (#2) { \istownerstyle{#3} } ; }
+ }
+ {
+ \node [ above , #4 ] at (#2) { \istownerstyle{#3} } ;
}
- {%
- \begin{scope}[on~background~layer]
- \draw [-,semithick,densely~dotted,rounded~corners=#7,#2]
- ($(#3)+(-#7,#7)$) rectangle ($(#4)+(#7,-#7)$)
- node at ($(#3)!.5!(#4)$) [#6] {#5};
\end{scope}
+}
+
+% \xtActionLabel
+% BE CAREFUL: each case has different options (do not try to shorten)
+% * [opt] (parent) (child) {action label} [pos]
+\NewDocumentCommand \xtActionLabel{ s O{} r() r() G{} O{} }
+{
+ \begin{scope} % in group: to make \setistmathTF011 local
+ \IfBooleanTF { #1 } { } { \setistmathTF011 \istactionlabeltextfont{} }
+% \str_case_e:nnF { #6 }
+ \str_case:nnF { #6 }
+ {
+ { al } {
+ \draw [ - , draw = none , #2 ] (#3) to
+ [ edge~node = { node [ above~left , black , text~depth = .25ex ,
+ xshift = \istactionlabelxshift ,
+ yshift = -\istactionlabelyshift ]
+ { \istactionlabelstyle{#5} } } ] (#4) ;
+ }
+ { ar } {
+ \draw [ - , draw = none , #2 ] (#3) to
+ [ edge~node = { node [ above~right , black , text~depth = .25ex ,
+ xshift = -\istactionlabelxshift ,
+ yshift = -\istactionlabelyshift ]
+ { \istactionlabelstyle{#5} } } ] (#4) ;
+ }
+ { bl } {
+ \draw [ - , draw = none , #2 ] (#3) to
+ [ edge~node = { node [ below~left , black , text~depth = .25ex ,
+ xshift = \istactionlabelxshift ,
+ yshift = \istactionlabelyshift ]
+ { \istactionlabelstyle{#5} } } ] (#4) ;
+ }
+ { br } {
+ \draw [ - , draw = none , #2 ] (#3) to
+ [ edge~node = { node [ below~right , black , text~depth = .25ex ,
+ xshift = -\istactionlabelxshift ,
+ yshift = \istactionlabelyshift ]
+ { \istactionlabelstyle{#5} } } ] (#4) ;
+ }
+ { l } {
+ \draw [ - , draw = none , #2 ] (#3) to
+ [ edge~node = { node [ left , black , text~depth = .25ex ,
+ yshift = -\xtALyShift ]
+ { \istactionlabelstyle{#5} } } ] (#4) ;
+ }
+ { r } {
+ \draw [ - , draw = none , #2 ] (#3) to
+ [ edge~node = { node [ right , black , text~depth = .25ex ,
+ yshift = \xtALyShift ]
+ { \istactionlabelstyle{#5} } } ] (#4) ;
+ }
+ { a } {
+ \draw [ - , draw = none , #2 ] (#3) to
+ [ edge~node = { node [ above , black , text~depth = .25ex ,
+ yshift = \xtALyShift ]
+ { \istactionlabelstyle{#5} } } ] (#4) ;
+ }
+ { b } {
+ \draw [ - , draw = none , #2 ] (#3) to
+ [ edge~node = { node [ below , black , text~depth = .25ex ,
+ yshift = -\xtALyShift ]
+ { \istactionlabelstyle{#5} } } ] (#4) ;
+ }
}
+ {
+ \draw [ - , draw = none , #2] (#3) to
+ [ edge~node = { node [ black , text~depth = .25ex , #6 ]
+ { \istactionlabelstyle{#5} } } ] (#4) ;
+ }
+ \end{scope}
}
-% \xInfosetOwner (with abbreviations)
-\NewDocumentCommand\xtInfosetOwner{t'r()r()mO{}}
-{\IfBooleanTF{#1}
- { \str_case_x:nnF { #5 }
+\def\xtdefault@xtpayoff@outersep{4pt}
+% \xtPayoff (with abbreviations)
+% * (coor) {payoffs} [pos]
+\NewDocumentCommand \xtPayoff{ s r() +m O{below} }
+{
+ \begin{scope} % in group: to make \setistmathTF011 local
+ \IfBooleanTF { #1 } { } { \setistmathTF011 \istpayofftextfont{} }
+% \str_case_e:nnF { #4 }
+ \str_case:nnF { #4 }
{
- { al } { \draw [draw=none] (#3) to (#2) node at ($(#3)!.5!(#2)$) [above~left] {#4}; }
- { ar } { \draw [draw=none] (#3) to (#2) node at ($(#3)!.5!(#2)$) [above~right] {#4}; }
- { bl } { \draw [draw=none] (#3) to (#2) node at ($(#3)!.5!(#2)$) [below~left] {#4}; }
- { br } { \draw [draw=none] (#3) to (#2) node at ($(#3)!.5!(#2)$) [below~right] {#4}; }
- { l } { \draw [draw=none] (#3) to (#2) node at ($(#3)!.5!(#2)$) [left] {#4}; }
- { r } { \draw [draw=none] (#3) to (#2) node at ($(#3)!.5!(#2)$) [right] {#4}; }
- { a } { \draw [draw=none] (#3) to (#2) node at ($(#3)!.5!(#2)$) [above] {#4}; }
- { b } { \draw [draw=none] (#3) to (#2) node at ($(#3)!.5!(#2)$) [below] {#4}; }
+ { al } {
+ \node [ above~left , inner~sep = 0pt ,
+ outer~sep = \xtdefault@xtpayoff@outersep , text~depth = .25ex ]
+ at (#2) { \istpayoffstyle{#3} } ;
+ }
+ { ar } {
+ \node [ above~right , inner~sep = 0pt ,
+ outer~sep = \xtdefault@xtpayoff@outersep , text~depth = .25ex ]
+ at (#2) { \istpayoffstyle{#3} } ;
+ }
+ { bl } {
+ \node [ below~left , inner~sep = 0pt ,
+ outer~sep = \xtdefault@xtpayoff@outersep , text~depth = .25ex ]
+ at (#2) { \istpayoffstyle{#3} } ;
+ }
+ { br } {
+ \node [ below~right , inner~sep = 0pt ,
+ outer~sep = \xtdefault@xtpayoff@outersep , text~depth = .25ex ]
+ at (#2) { \istpayoffstyle{#3} } ;
+ }
+ { l } {
+ \node [ left , inner~sep = 0pt ,
+ outer~sep = \xtdefault@xtpayoff@outersep , text~depth = .25ex ]
+ at (#2) { \istpayoffstyle{#3} } ;
+ }
+ { r } {
+ \node [ right , inner~sep = 0pt ,
+ outer~sep = \xtdefault@xtpayoff@outersep , text~depth = .25ex ]
+ at (#2) { \istpayoffstyle{#3} } ; }
+ { a } {
+ \node [ above , inner~sep = 0pt ,
+ outer~sep = \xtdefault@xtpayoff@outersep , text~depth = .25ex ]
+ at (#2) { \istpayoffstyle{#3} } ; }
+ { b } {
+ \node [ below , inner~sep = 0pt ,
+ outer~sep = \xtdefault@xtpayoff@outersep , text~depth = .25ex ]
+ at (#2) { \istpayoffstyle{#3} } ; }
}
{
- \draw [draw=none] (#3) to (#2) node at ($(#3)!.5!(#2)$) [#5] {#4};
+ \node [ inner~sep = 0pt , outer~sep = \xtdefault@xtpayoff@outersep ,
+ text~depth = .25ex , #4 ]
+ at (#2) { \istpayoffstyle{#3} } ;
}
- }
- { \str_case_x:nnF { #5 }
+ \end{scope}
+}
+
+
+% \xtNode(*)
+% * [opt] (coor) [node style] {text}
+\NewDocumentCommand \xtNode{ s O{} r() O{} +G{} }
+{ \IfBooleanTF {#1}
{
- { al } { \draw [draw=none] (#2) to (#3) node at ($(#2)!.5!(#3)$) [above~left] {#4}; }
- { ar } { \draw [draw=none] (#2) to (#3) node at ($(#2)!.5!(#3)$) [above~right] {#4}; }
- { bl } { \draw [draw=none] (#2) to (#3) node at ($(#2)!.5!(#3)$) [below~left] {#4}; }
- { br } { \draw [draw=none] (#2) to (#3) node at ($(#2)!.5!(#3)$) [below~right] {#4}; }
- { l } { \draw [draw=none] (#2) to (#3) node at ($(#2)!.5!(#3)$) [left] {#4}; }
- { r } { \draw [draw=none] (#2) to (#3) node at ($(#2)!.5!(#3)$) [right] {#4}; }
- { a } { \draw [draw=none] (#2) to (#3) node at ($(#2)!.5!(#3)$) [above] {#4}; }
- { b } { \draw [draw=none] (#2) to (#3) node at ($(#2)!.5!(#3)$) [below] {#4}; }
+ \istrooto (#3) (#3) [ plain~node , #4 ] {#5} \printist ;
}
{
- \draw [draw=none] (#2) to (#3) node at ($(#2)!.5!(#3)$) [#5] {#4};
+ \node [ - , #2 ] at (#3) [ solid~node , #4 ] {#5} ;
}
- }
}
-% \xtOwner (with abbreviations)
-\NewDocumentCommand\xtOwner{ r() m O{above} }
+
+%% show and hide endpoints
+
+\NewDocumentCommand \xtShowEndPoints{ s O{solid~node} }
+{ \IfBooleanTF {#1}
+ {
+ \def\xt@show@endpoint{node[#2]{}}
+ \def\xt@show@tndot{node[#2]{}}
+ \def\cntm@show@endpoint{node[at~end,#2]{}} %% PROBLEMatic: node [#2] (ref. \cntmOUTERistb)
+ }
+ {
+ \def\xt@show@endpoint{node[#2]{}}
+ \def\xt@show@tndot{node[#2]{}}
+ }
+}
+
+\NewDocumentCommand \xtHideEndPoints{s}
+{
+ \IfBooleanTF {#1}
+ { % works only for cntm
+ \renewcommand*\cntm@show@endpoint{}
+ }
+ {
+ \renewcommand*\xt@show@endpoint{}
+ \renewcommand*\xt@show@tndot{}
+ }
+}
+
+%% show and hide terminal nodes
+
+\NewDocumentCommand \xtShowTerminalNodes{ O{terminal~node} }
+{
+ \def\xt@show@tndot{node[#1]{}}
+}
+
+\NewDocumentCommand \xtHideTerminalNodes{}
+{
+ \renewcommand*\xt@show@tndot{}
+}
+
+
+%% subgames
+
+% subgame box/oval layer
+\def\xtdefault@subgamelayer { background }
+\newcommand*\xtsubgamelayer{ \xtdefault@subgamelayer }
+\NewDocumentCommand \setxtsubgamelayer { G{\xtdefault@subgamelayer} }
+{
+ \renewcommand \xtsubgamelayer { #1 }
+}
+
+\def\xtdefault@subrootshiftbox { 0 , -.3 }
+% \xtSubgameBox
+% * (root coor) { (coor1) (coor2)... } [additional opt]
+\NewDocumentCommand \xtSubgameBox { s r() m O{} }
{
- \str_case_x:nnF { #3 }
+ \IfBooleanTF {#1}
{
- { al } { \node [ above~left ] at (#1) {#2}; }
- { ar } { \node [ above~right ] at (#1) {#2}; }
- { bl } { \node [ below~left ] at (#1) {#2}; }
- { br } { \node [ below~right ] at (#1) {#2}; }
- { l } { \node [ left ] at (#1) {#2}; }
- { r } { \node [ right ] at (#1) {#2}; }
- { a } { \node [ above ] at (#1) {#2}; }
- { b } { \node [ below ] at (#1) {#2}; }
+ \coordinate (xtsubroot) at ( $ (#2) + (\xtdefault@subrootshiftbox) $ ) ;
+ \begin{pgfonlayer}{\xtsubgamelayer}
+ \node [ rectangle , fill , red!20 , inner~sep = 20pt , rounded~corners = 15pt , #4 ]
+ [ fit = (xtsubroot) #3 ] { } ;
+ \end{pgfonlayer}
}
{
- \node [#3] at (#1) {#2};
+ \coordinate (xtsubroot) at ( $ (#2) + ( 0 , -.3 ) $ ) ;
+ \begin{pgfonlayer}{\xtsubgamelayer}
+ \node [ rectangle , draw , dashed , inner~sep = 20pt , rounded~corners = 15pt , black!50 , #4 ]
+ [ fit = (xtsubroot) #3 ] {} ;
+ \end{pgfonlayer}
}
}
-% \xtActionLabel (with abbreviations)
-\NewDocumentCommand\xtActionLabel{ r() r() m O{} }
+\def\xtdefault@subrootshiftoval { 0 , -.7 }
+% \xtSubgameOval
+% * (root coor) { (coor1) (coor2)... } [additional opt]
+\NewDocumentCommand \xtSubgameOval { s r() m O{} }
{
- \str_case_x:nnF { #4 }
+ \IfBooleanTF {#1}
{
- { al } { \draw [draw=none] (#1) to (#2) node at ($(#1)!.5!(#2)$)
- [above~left,xshift=\istactionlabelxshift,yshift=-\istactionlabelyshift,black] { $#3$ }; }
- { ar } { \draw [draw=none] (#1) to (#2) node at ($(#1)!.5!(#2)$)
- [above~right,xshift=-\istactionlabelxshift,yshift=-\istactionlabelyshift,black] { $#3$} ; }
- { bl } { \draw [draw=none] (#1) to (#2) node at ($(#1)!.5!(#2)$)
- [below~left,xshift=\istactionlabelxshift,yshift=\istactionlabelyshift,black] { $#3$ }; }
- { br } { \draw [draw=none] (#1) to (#2) node at ($(#1)!.5!(#2)$)
- [below~right,xshift=-\istactionlabelxshift,yshift=\istactionlabelyshift,black] { $#3$ }; }
- { l } { \draw [draw=none] (#1) to (#2) node at ($(#1)!.5!(#2)$) [left,xshift=-\xtALxShift,black] { $#3$ }; }
- { r } { \draw [draw=none] (#1) to (#2) node at ($(#1)!.5!(#2)$) [right,xshift=\xtALxShift,black] { $#3$ }; }
- { a } { \draw [draw=none] (#1) to (#2) node at ($(#1)!.5!(#2)$) [above,yshift=\xtALyShift,black] { $#3$ }; }
- { b } { \draw [draw=none] (#1) to (#2) node at ($(#1)!.5!(#2)$) [below,yshift=-\xtALyShift,black] { $#3$ }; }
+ \coordinate (xtsubroot) at ( $ (#2) + (\xtdefault@subrootshiftoval) $ ) ;
+ \begin{pgfonlayer}{\xtsubgamelayer}
+ \node [ ellipse , fill , red!20 , inner~sep = 15pt , #4 ]
+ [ fit = (xtsubroot) #3 ] { } ;
+ \end{pgfonlayer}
}
{
- \draw [draw=none] (#1) to (#2) node at ($(#1)!.5!(#2)$) [#4] ~{ $#3$ };
+ \coordinate (xtsubroot) at ( $ (#2) + ( 0 , -.7 ) $ ) ;
+ \begin{pgfonlayer}{\xtsubgamelayer} % borrowed from infoset
+ \node [ ellipse , draw , dashed , inner~sep = 15pt , black!50 , #4 ]
+ [ fit = (xtsubroot) #3 ] { } ;
+ \end{pgfonlayer}
}
}
-% \xtPayoff (with abbreviations)
-\NewDocumentCommand\xtPayoff{ r() m O{below} }
+% \xtTimeLineH
+% ' [line opt] (passing point) {from dim} {to dim} {label} [pos]
+\NewDocumentCommand \xtTimeLineH { t' O{} r() m m G{} O{}}
{
- \str_case_x:nnF { #3 }
+ \bool_if:NTF \xt_growswap_call_bool
+ { % if swapped, go opposite direction
+ \pgfmathsetmacro \tlhAA { -1 * #4 }
+ \pgfmathsetmacro \tlhBB { -1 * #5 }
+ \IfBooleanTF { #1 }
+ {
+ \coordinate (tlhCC) at ( #3 -| { \tlhBB , \tlhAA } ) ;
+ \tl_set:Nn \_TH_label_pos_tl { left }
+ }
+ {
+ \coordinate (tlhCC) at ( #3 -| { \tlhAA , \tlhBB } ) ;
+ \tl_set:Nn \_TH_label_pos_tl { right }
+ }
+ }
{
- { al } { \node [ above~left ] at (#1) {$#2$}; }
- { ar } { \node [ above~right ] at (#1) {$#2$}; }
- { bl } { \node [ below~left ] at (#1) {$#2$}; }
- { br } { \node [ below~right ] at (#1) {$#2$}; }
- { l } { \node [ left ] at (#1) {$#2$}; }
- { r } { \node [ right ] at (#1) {$#2$}; }
- { a } { \node [ above ] at (#1) {$#2$}; }
- { b } { \node [ below ] at (#1) {$#2$}; }
+ \def \tlhAA { #4 }
+ \def \tlhBB { #5 }
+ \IfBooleanTF {#1}
+ {
+ \coordinate (tlhCC) at ( #3 -| { \tlhAA , \tlhBB } ) ;
+ \tl_set:Nn \_TH_label_pos_tl { left }
+ }
+ {
+ \coordinate (tlhCC) at ( #3 -| { \tlhBB , \tlhAA } ) ;
+ \tl_set:Nn \_TH_label_pos_tl { right }
+ }
}
+ \begin{pgfonlayer}{\xtsubgamelayer}
+% \str_case_e:nnF {#7}
+ \str_case:nnF {#7}
+ {
+ {al} { \node at (tlhCC) [ above~left ] {#6} ; }
+ {ar} { \node at (tlhCC) [ above~right ] {#6} ; }
+ {bl} { \node at (tlhCC) [ below~left ] {#6} ; }
+ {br} { \node at (tlhCC) [ below~right ] {#6} ; }
+ {l} { \node at (tlhCC) [ left ] {#6} ; }
+ {r} { \node at (tlhCC) [ right ] {#6} ; }
+ {a} { \node at (tlhCC) [ above ] {#6} ; }
+ {b} { \node at (tlhCC) [ below ] {#6} ; }
+ }
+ {
+ \node at ( tlhCC ) [ \_TH_label_pos_tl , #7 ] {#6} ;
+ }
+ \draw [ - , dotted , shorten~< = 0pt, shorten~> = 0pt , #2 ]
+ ( #3 -| { \tlhAA , \tlhBB } ) -- ( #3 -| { \tlhBB , \tlhAA } ) ;
+ \end{pgfonlayer}
+}
+
+
+% \xtTimeLineV
+% ' [line opt] (passing point) {from dim} {to dim} {label} [pos]
+\NewDocumentCommand \xtTimeLineV { t' O{} r() m m G{} O{}}
+{
+ \bool_if:NTF \xt_growswap_call_bool
{
- \node [#3] at (#1) {$#2$};
+ \def\tlvAA{#4}
+ \def\tlvBB{#5}
+ \IfBooleanTF {#1}
+ {
+ \coordinate (tlvCC) at ( #3 |- { \tlvAA , \tlvBB } ) ;
+ \tl_set:Nn \_TH_label_pos_tl { right }
+ }
+ {
+ \coordinate (tlvCC) at ( #3 |- { \tlvBB , \tlvAA } ) ;
+ \tl_set:Nn \_TH_label_pos_tl { right }
+ }
}
+ { % if not swapped, go opposite direction
+ \pgfmathsetmacro\tlvAA{-1*#4}
+ \pgfmathsetmacro\tlvBB{-1*#5}
+ \IfBooleanTF {#1}
+ {
+ \coordinate (tlvCC) at ( #3 |- { \tlvBB , \tlvAA } ) ;
+ \tl_set:Nn \_TH_label_pos_tl { right }
+ }
+ {
+ \coordinate (tlvCC) at ( #3 |- { \tlvAA , \tlvBB } ) ;
+ \tl_set:Nn \_TH_label_pos_tl { right }
+ }
+ }
+
+ \begin{pgfonlayer}{\xtsubgamelayer}
+% \str_case_e:nnF {#7}
+ \str_case:nnF {#7}
+ {
+ {al} { \node at (tlvCC) [ above~left ] {#6} ; }
+ {ar} { \node at (tlvCC) [ above~right ] {#6} ; }
+ {bl} { \node at (tlvCC) [ below~left ] {#6} ; }
+ {br} { \node at (tlvCC) [ below~right ] {#6} ; }
+ {l} { \node at (tlvCC) [ left ] {#6} ; }
+ {r} { \node at (tlvCC) [ right ] {#6} ; }
+ {a} { \node at (tlvCC) [ above ] {#6} ; }
+ {b} { \node at (tlvCC) [ below ] {#6} ; }
+ }
+ {
+ \node at ( tlvCC ) [ \_TH_label_pos_tl , #7 ] {#6} ;
+ }
+ \draw [ - , dotted , shorten~< = 0pt, shorten~> = 0pt , #2 ]
+ ( #3 |- { \tlvBB , \tlvAA } ) -- ( #3 |- { \tlvAA , \tlvBB } ) ;
+ \end{pgfonlayer}
}
-%% \xtNode(*)
-\NewDocumentCommand\xtNode{ s O{} r() O{} G{} }
-{\IfBooleanTF #1
+%% \xtCommentTo
+% [line opt] (absolute to-coor) (relative from-coor) {text} [pos] (arrow end shorten dim)
+\NewDocumentCommand \xtCommentTo { O{} r() r() G{} O{} D(){1pt} }
+{
+ \draw [ -> , densely~dotted , shorten~< = 0pt , shorten~> = #6 , #1 ]
+ ( $ (#2) + (#3) $ ) to (#2) ;
+% \str_case_e:nnF {#5}
+ \str_case:nnF {#5}
{
- \istrooto (#3) (#3) [plain~node] {#5} \endist
+ {al} { \node at ( $ (#2) + (#3) $ ) [ above~left ] {#4} ; }
+ {ar} { \node at ( $ (#2) + (#3) $ ) [ above~right ] {#4} ; }
+ {bl} { \node at ( $ (#2) + (#3) $ ) [ below~left ] {#4} ; }
+ {br} { \node at ( $ (#2) + (#3) $ ) [ below~right ] {#4} ; }
+ {l} { \node at ( $ (#2) + (#3) $ ) [ left ] {#4} ; }
+ {r} { \node at ( $ (#2) + (#3) $ ) [ right ] {#4} ; }
+ {a} { \node at ( $ (#2) + (#3) $ ) [ above ] {#4} ; }
+ {b} { \node at ( $ (#2) + (#3) $ ) [ below ] {#4} ; }
}
{
- \node [-,#2] at (#3) [solid~node,#4] {#5};
+ \node at ( $ (#2) + (#3) $ ) [ above, #5 ] {#4} ;
}
}
-\ExplSyntaxOff
+%% \xtCommentFrom
+% [line opt] (absolute from-coor) (absolute from-coor) {text} [pos] (arrow end shorten dim)
+\NewDocumentCommand \xtCommentFrom{ O{} r() r() G{} O{} D(){1pt}}
+{
+ \draw [ -> , densely~dotted , shorten~< = 0pt , shorten~> = #6 , #1 ] (#2) to (#3) ;
+% \str_case_e:nnF {#5}
+ \str_case:nnF {#5}
+ {
+ {al} { \node at (#2) [ above~left ] {#4} ; }
+ {ar} { \node at (#2) [ above~right ] {#4} ; }
+ {bl} { \node at (#2) [ below~left ] {#4} ; }
+ {br} { \node at (#2) [ below~right ] {#4} ; }
+ {l} { \node at (#2) [ left ] {#4} ; }
+ {r} { \node at (#2) [ right ] {#4} ; }
+ {a} { \node at (#2) [ above ] {#4} ; }
+ {b} { \node at (#2) [ below ] {#4} ; }
+ }
+ {
+ \node at (#2) [ above , #5 ] {#4} ;
+ }
+}
+
+%% mid arrow styles: basics
+% \xt@default... used
+
+\def\xt@default@arrow@pos { .55 }
+\def\xt@arrow@pos { \xt@default@arrow@pos }
+\def\xt@default@arrow@opt { black } % black needed here (not to depend on branch color)
+\def\xt@arrow@opt { \xt@default@arrow@opt }
+\def\xt@default@arrow@shape { > }
+\def\xt@arrow@shape { \xt@default@arrow@shape }
+\newcommand*\xtarrowpos { \xt@arrow@pos }
+\newcommand*\xtarrowopt { \xt@arrow@opt }
+\newcommand*\xtarrowshape { \xt@arrow@shape }
+
+
+% \setxtarrowtips
+% to toss values to arrow tip styls
+\NewDocumentCommand \setxtarrowtips
+{
+ D<>{ \xt@default@arrow@pos }
+ G{ \xt@default@arrow@shape }
+ O{ \xt@default@arrow@opt }
+}
+{
+ \renewcommand*\xt@arrow@pos {#1}
+ \renewcommand*\xt@arrow@shape {#2}
+ \renewcommand*\xtarrowopt { - , thin , solid , shorten~> = 0 , #3}
+}
+% initial set for defaults
+\setxtarrowtips
+
+% variable style [->]:
+% accepts an option value changed by \xtarrowopt (this is better)
+% alternative choice: use original value \xt@arrow@opt by default
+\tikzset
+{ ->- /.style =
+ {
+ decoration =
+ {
+ markings ,
+ mark = at~position~ #1 ~with~
+ { \exp_last_unbraced:NNV \arrow [ \xtarrowopt ] { \xtarrowshape } }
+ } ,
+ postaction = {decorate}
+ } ,
+ ->-/.default = \xt@arrow@pos
+}
+
+\tikzset
+{ ->>- /.style =
+ {
+ decoration =
+ {
+ markings ,
+ mark = at~position~ #1 ~with~
+ { \exp_last_unbraced:NNo \arrow [ \xtarrowopt ] { >> } }
+ } ,
+ postaction = {decorate}
+ } ,
+ ->>-/.default = .6
+}
+\tikzset
+{ ->>>- /.style =
+ {
+ decoration =
+ {
+ markings ,
+ mark = at~position~ #1 ~with~
+ { \exp_last_unbraced:NNo \arrow [ \xtarrowopt ] { >>> } }
+ } ,
+ postaction = {decorate}
+ } ,
+ ->>>-/.default = .65
+}
+
+\tikzset
+{ -o- /.style =
+ {
+ decoration =
+ {
+ markings ,
+ mark = at~position~ #1 ~with~
+ { \exp_last_unbraced:NNo \arrow [ \xtarrowopt ] { o } }
+ } ,
+ postaction = {decorate}
+ } ,
+ -o-/.default = .55
+}
+
+\tikzset
+{ -x- /.style =
+ {
+ decoration =
+ {
+ markings ,
+ mark
+ = at~position~ #1 ~with~
+ {
+ \exp_last_unbraced:NNo \draw [ \xtarrowopt ]
+ (-2pt,-2pt) -- (2pt,2pt);
+ \exp_last_unbraced:NNo \draw [ \xtarrowopt ]
+ (2pt,-2pt) -- (-2pt,2pt);
+ }
+ } ,
+ postaction = {decorate}
+ } ,
+ -x-/.default = .5
+}
+
+
+%% show midarrows
+
+\def\xt@show@midarrow { }
+\def\xt@default@show@midarrow@pos { .55 }
+\def\xt@show@midarrow@pos { \xt@default@show@midarrow@pos }
+\def\xt@default@show@midarrow@opt { black }
+\def\xt@show@midarrow@opt { \xt@default@show@midarrow@opt }
+\def\xt@default@show@midarrow@shape { >}
+\def\xt@show@midarrow@shape { \xt@default@show@midarrow@shape }
+\newcommand*\xtshowmidarrowpos { \xt@show@midarrow@pos }
+\newcommand*\xtshowmidarrowopt { \xt@show@midarrow@opt }
+\newcommand*\xtshowmidarrowshape { \xt@show@midarrow@shape }
+
+% \setxtshowmidarrows (for simple tree)
+% to toss values to [show~midarrow]
+\NewDocumentCommand \setxtshowmidarrows
+{
+ D<>{ \xt@default@show@midarrow@pos }
+ G{ \xt@default@show@midarrow@shape }
+ O{ \xt@default@show@midarrow@opt }
+}
+{
+ \renewcommand*\xt@show@midarrow@pos {#1} % default: .55
+ \renewcommand*\xt@show@midarrow@shape {#2}
+ \renewcommand*\xtshowmidarrowopt {#3}
+}
+
+
+% show midarrow style
+\tikzset { stoppostaction/.code = { \let \tikz@postactions \pgfutil@empty } }
+\tikzset
+{ show~midarrow /.style =
+ {
+ decoration =
+ {
+ markings ,
+ mark = { at~position~ #1 ~with~
+ { \exp_last_unbraced:NNV
+ \arrow [ \xtshowmidarrowopt ] { \xt@show@midarrow@shape } }
+ }
+ } ,
+ postaction = { stoppostaction , decorate }
+ } ,
+ show~midarrow/.default = \xt@show@midarrow@pos % default: .55
+}
+
+
+% \xtShowMidArrows
+% on [show~midarrow]
+\NewDocumentCommand \xtShowMidArrows{ }
+{
+ \renewcommand*\xt@show@midarrow { show~midarrow }
+}
+
+% \xtHideMidArrows
+% off [show~midarrow]
+\NewDocumentCommand \xtHideMidArrows { }
+{
+ \renewcommand \xt@show@midarrow { }
+}
+
+
+%% show arrows
+
+\def\xt@show@arrow { }
+\def\xt@default@show@arrow@pos { .55 }
+\def\xt@show@arrow@pos { \xt@default@show@arrow@pos }
+\def\xt@default@show@arrow@opt { black }
+\def\xt@show@arrow@opt { \xt@default@show@arrow@opt }
+\def\xt@default@show@arrow@shape { > }
+\def\xt@show@arrow@shape { \xt@default@show@arrow@shape }
+\def\xt@default@show@arrow@shorten { 1.2pt }
+\def\xt@show@arrow@shorten { \xt@default@show@arrow@shorten }
+\newcommand*\xtshowarrowpos { \xt@show@arrow@pos }
+\newcommand*\xtshowarrowopt { \xt@show@arrow@opt }
+\newcommand*\xtshowarrowshape { \xt@show@arrow@shape }
+\newcommand*\xtshowarrowshorten { \xt@show@arrow@shorten }
+
+% \setxtshowarrows
+% to toss values to [show~arrow]
+\NewDocumentCommand \setxtshowarrows
+{
+ G{>}
+ O{\xt@default@show@arrow@opt}
+ D(){\xt@default@show@arrow@shorten}
+}
+{
+ \renewcommand*\xt@show@arrow@shape{#1} % default: >
+ \renewcommand*\xtshowarrowopt{#2} % default: black
+ \renewcommand*\xt@show@arrow@shorten{#3} % default: 1.2pt
+}
+
+% show arrow style
+\tikzset{stoppostaction/.code={\let\tikz@postactions\pgfutil@empty}}
+\tikzset
+{ show~arrow /.style =
+ {
+ decoration =
+ {
+ markings ,
+ mark = {
+ at~position~ 1 + - \pgf@shorten@end@additional + - #1 ~with~
+ { \exp_last_unbraced:NNV
+ \arrow [ \xtshowarrowopt ] { \xt@show@arrow@shape } }
+ }
+ } ,
+ postaction = { stoppostaction , decorate }
+ } ,
+ show~arrow/.default = \xt@show@arrow@shorten % default: 1.2pt
+}
+
+% \xtShowArrows
+% on [show~arrow]
+\NewDocumentCommand \xtShowArrows { O{solid~node} }
+{
+ \xtShowEndPoints[#1]
+ \renewcommand*\xt@show@arrow { show~arrow }
+}
+
+% \xtHideArrows
+% off [show~arrow]
+\NewDocumentCommand \xtHideArrows { s }
+{
+ \IfBooleanTF {#1} { \xtShowEndPoints } { \xtHideEndPoints }
+ \renewcommand\xt@show@arrow { }
+}
+
+\ExplSyntaxOff
\endinput \ No newline at end of file