diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/istgame/README.txt | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/istgame/istgame-doc-v2.1.tex (renamed from Master/texmf-dist/doc/latex/istgame/istgame-doc-v2.0.tex) | 5747 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/istgame/istgame-doc.pdf | bin | 707432 -> 808805 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/istgame/istgame-doc.tex | 718 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/istgame/istgame.sty | 337 |
5 files changed, 4057 insertions, 2753 deletions
diff --git a/Master/texmf-dist/doc/latex/istgame/README.txt b/Master/texmf-dist/doc/latex/istgame/README.txt index 38155f274a2..2c12b0f6683 100644 --- a/Master/texmf-dist/doc/latex/istgame/README.txt +++ b/Master/texmf-dist/doc/latex/istgame/README.txt @@ -1,17 +1,17 @@ -istgame.sty: Drawing Game Trees with TikZ +istgame.sty: Draw Game Trees with TikZ ========================================= Author: In-Sung Cho Introduction: -This is a LaTeX package that provides macros based on TikZ to draw a game tree. +This is a LaTeX package that provides macros based on TikZ to draw game trees. 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 easily as drawing a game tree with pen and paper. +With the istgame package, you can draw game trees +as easily as drawing game trees with pen and paper. Dependencies: diff --git a/Master/texmf-dist/doc/latex/istgame/istgame-doc-v2.0.tex b/Master/texmf-dist/doc/latex/istgame/istgame-doc-v2.1.tex index aa91c4d8076..f8b815ce402 100644 --- a/Master/texmf-dist/doc/latex/istgame/istgame-doc-v2.0.tex +++ b/Master/texmf-dist/doc/latex/istgame/istgame-doc-v2.1.tex @@ -1,221 +1,332 @@ %!TEX root = istgame-doc.tex - %\begin{document} + \setcounter{section}{-1} \section{Changes and remarks} -\subsection{Changes} +\subsection{Changes in version 2.1} +\label{ssec:changes2.1} + +Version 2.1 of the \pkg{istgame} package introduces a starred version of the \env{istgame} environment, some new macros, and some examples added to the documentation. + +\paragraph {The starred version of \env{istgame} environment:} The \emph{new} starred version of the \env{istgame} environment is essentially the same as the \env{tikzpicture} environment. +\begin{itemize} +\item The standard version of \env{istgame} environment checks the existence of \Tikz\ scaling and the arrow option |->|, and uses the collected information to automatically get the best results. (See Section~\ref{ssec:envistgame} on page~\pageref{ssec:envistgame} for more details.) +\item |\begin{istgame}*| may be slightly faster than |\begin{istgame}| as it does not collect this information. +\item However, using |\begin{istgame}*| may require some manual work to get desired results, especially for asymmetric \Tikz\ scaling (i.e. when |xscale| is not the same as |yscale|). +\item With |\begin{istgame}*|: + \begin{itemize} + \item |\xtxscale|, |\xtyscale|, and |\xtscale| have no effect. + \item |\xtcureslopedlabelsNS| and |\xtcureslopedlabelsEW| do nothing. + \item The oval type information sets |\xtInfosetO|, |\xtCIfnosetO|, and |\cntmAInfosetO| may be distorted. + \item |\setistgamefontsize| and |\setistgameshorten| have no effect. + \item The initial \Tikz\ arrow style (but not |>=stealth|) is used. + \end{itemize} +%\end{istgame} +%\end{tikzpicture} +%\end{istgame} +%\end{istgame} +%\end{istgame} +\end{itemize} + +It is recommended to use the standard \env{istgame} environment, +when you use the oval type information sets and sloped labels with \Tikz\ scaling. +\emph{In all other cases}, |\begin{istgame}*| and |\begin{istgame}| will give you the \emph{same results} in drawing tree structures (except for the default arrow style). + +\xbigskip1 +Here are some examples to show that the \env{istgame} environment can automatically achieve the best results. -Some macros have been \textsc{changed} and \textsc{removed}. +\begin{doccode}{.3} +% asymmetric scaling: distorted oval information sets +\begin{istgame}*[xscale=1.5,yscale=.9] % starred +\setistgrowdirection'{south east} +\istroot(0) \istb \istb* \endist +\istroot(1)(0-1){2} \istb* \istb* \endist +\xtInfosetO[fill=red!20,ellipse](0)(0-2){1} +\xtInfosetO(1)(1) +\xtInfosetO[fill=blue!40,opacity=.5] + (1-1)(1-2){3}(1.5em) +\end{istgame} +\end{doccode} + +\begin{doccode}{.3} +% Oval information sets do not depend on scaling +\begin{istgame}[xscale=1.5,yscale=.9] +\setistgrowdirection'{south east} +\istroot(0) \istb \istb* \endist +\istroot(1)(0-1){2} \istb* \istb* \endist +\xtInfosetO[fill=red!20,ellipse](0)(0-2){1} +\xtInfosetO(1)(1) +\xtInfosetO[fill=blue!40,opacity=.5] + (1-1)(1-2){3}(1.5em) +\end{istgame} +\end{doccode} + + +The \Tikz's |tree| library does not seem to deal with the sloped labels correctly in the case of asymmetric scaling. (See page~\pageref{page:slopedlabels-warning} for more details.) + +\begin{doccode}{.3} +% tikz tree's sloped labels problem: +\begin{istgame}*[xscale=2,font=\footnotesize] % starred +\xtcureslopedlabelsNS % does nothing +\istroot(0) + \istb[dashed,thick]{Left}[above,sloped] + \istb[->]{Center}[above,sloped] + \istb[draw=blue,thick]{Right}[above,sloped] + \endist +\end{istgame} +\end{doccode} + +The macro |\xtcureslopedlabelsNS| solves this problem only when you use the standard version of \env{istgame}. + +\begin{doccode}{.3} +% tikz tree's sloped labels problem: solved +\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{doccode} + +\paragraph{New macros to set the default node sizes:} +In order to change the size of basic nodes, new macros \icmd{\setistsolidnodesize}, \icmd{\setisthollownodesize}, \icmd{\setistellipsenodesize}, and \icmd{\setistrectanglenodesize} are introduced. You can use these macros outside of the \env{istgame} environment (or in the preamble) to change the default node size globally. + +In the following example you can see the effect of |\setistsolidnodesize{.5\pgflinewidth}|. The default size of a |solid| node is |2.4pt|. + +\begin{doccode}[text above listing] +% \setistsolidnodesize +\begin{istgame} +\istroot(0)(0,0) \istb* \istb* \istb* \endist +\istroot(c)(0-3) \istb* \istb* \endist +\setistsolidnodesize{.5\pgflinewidth} % solid node size changed +\istroot(0)(6,0) \istb* \istb* \istb* \endist +\istroot(c)(0-3) \istb* \istb* \endist +\end{istgame} +\end{doccode} + + +\paragraph{Some more:} +The update to version 2.1 includes a few bug fixes and minor changes. +(See the version history on page~\pageref{version-history}.) + +The \Tikz\ libraries |arrows.meta| and |bending| are added to the the list of preloaded |tikz| libraries. You can see some examples of arrow tips from |arrows.meta| in Section~\ref{ssec:setxtarrowtips} on page~\pageref{ssec:setxtarrowtips}. + +\subsection{Changes in version 2.0} + +Some macros have been \textsc{changed} and \textsc{removed} in version 2.0. 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- +%|\istb.| & |\istbt| \\\tabucline- +%|\xtInfoset'| & |\xtInfoset| \\\tabucline- +%|\xtInfosetO'| & |\xtInfosetO| \\\tabucline- +%|\setistgrowkey| & |\setxtgrowkey| \\\tabucline- %\end{tabu} %\end{center} \begin{center} -\begin{tabular} {lll} \toprule %to .5\linewidth +\begin{tabular} {lll} \toprule \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} +|\istb.| & |\istbt| \\\cline{1-2} +|\xtInfoset'| & |\xtInfoset| \\\cline{1-2} +|\xtInfosetO'| & |\xtInfosetO| \\\cline{1-2} +|\setistgrowkey| & |\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). + \item The macro name |\istb.|(terminal version) has been changed + to |\istbt| (terminal version). \begin{itemize} - \item This is the opportunity cost of having a new macro \cmd{\istB}. + \item This is the opportunity cost of having a new macro |\istB| (dual action label version). \end{itemize} -\item The two (unsatisfactory) macros \cmd{\xtInfoset'} and \cmd{\xtInfosetO'} have been removed. +\item The two (unsatisfactory) macros |\xtInfoset'| and |\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 The macro |\xtInfosetO| is completely redesigned, + so that we do not need the macro |\xtInfosetO'| any more. \item No reasons could be found to keep (even for the backward compatibility) - the swap versions \cmd{\xtInfoset'} and \cmd{\xtInfosetO'}, + the swap versions |\xtInfoset'| and |\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}. +\item|\setistgrowkey| is renamed to |\setxtgrowkey| for consistency in macro naming. \end{itemize} \paragraph{Redesigned macros and the environment} \begin{itemize}\firmlist -\item \cmd{\xtInfosetO}: completely redefined to improve its function +\item |\xtInfosetO| is 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)}, + \item It connects two nodes like |\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) + the swap version |\xtInfosetO'| has been removed and replaced by |\xtInfosetO|. + \item Be aware also that the way to change the \emph{height} (|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. + \item With \emph{new macros} |\xtCInfoset| and |\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}. + \item Now the each value of the option of |xscale| and |yscale|, if exists, + is extracted and saved at |\xtxscale| and |\xtyscale|, respectively. + The value of |scale| is also saved at |\xtscale| + only when it is used without |xscale| nor |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}. + \item If the \Tikz\ arrow option |->| exists in the option list of an \env{istgame} environment, + you can globally control the arrow-end-shorten value (by default, |shorten >=0pt|) + by using a new macro |\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 + \item The core macros |\istroot|, |\istb|, and |\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 The options |thin| and |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} + +\subsection{What's new in version 2.0} \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} + \item |\setistmathTF| as an input mode changer for the important labels + \item |\setistmathTF*| having additional functions as a \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 + \item |\xtCInfoset| for curved information sets + \item |\xtCInfosetO| for curved bubble type information sets \end{itemize} -\item enhanced \emph{continuum of branches} (making \cmd{\istcntm} and \cmd{\istcntmarc} obsolete) +\item enhanced \emph{continuum of branches} (making |\istcntm| and |\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 + \item |\istrootcntm| for a continuum triangle + \item |\istrootcntmA| for a continuum arc (with |\istbA|) + \item |\cntmAInfoset| and |\cntmAInfosetO| 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} + \item controllable arrow option |->-| with |\setxtarrowtips| and middle arrow tip styles + \item |\xtShowMidArrows| and |\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. + \item |\istB| for dual action labels + \item |\xtTimeLineH|, |\xtTimeLineV|, |\xtCommentTo|, |\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(*)} +\item |\istbt(*)|: terminal version of |\istb(*)| + (replacement of the removed macro |\istb.(*)|) +\item |\istB(*)|: dual action label version of |\istb(*)| +\item |\istBt(*)|: terminal version of |\istB(*)| +\item |\istbA(*)|: alternative version of |\istb(*)| (intended to work with a continuum arc) +\item |\istbAt(*)|: terminal version of |\istbA(*)| % \listdivider -\item \cmd{\setistmathTF}: input mode changer (math or text) for owners, action labels, and payoffs +\item |\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 +% \item |\istownermathtrue|, |\istactionlabelmathtrue|, |\istpayoffmathtrue|: math mode +% \item |\istownermathfalse|, |\istactionlabelmathfalse|, |\istpayoffmathfalse|: text mode % \end{itemize} -\item \cmd{\setistmathTF*}: input mode and font style changer for owners, action labels, and payoffs +\item |\setistmathTF*|: input mode and font style changer for owners, action labels, and payoffs % \begin{itemize}\tightlist -% \item \cmd{\istownertextfont}, \cmd{\istactionlabeltextfont}, \cmd{\istpayofftextfont} +% \item |\istownertextfont|, |\istactionlabeltextfont|, |\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) +\item |\xtCInfoset|: (curved version) curved information set +\item |\xtCInfosetO|: (curved oval version) curved oval type information set +\item |\xtCInfosetOTurnX|: turns |X| circles of |\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(*)} +\item |\xtInfoset*|: prints owners according to the input mode as set by |\setistmathTF(*)| +\item |\xtInfosetO*|: prints owners according to the input mode as set by |\setistmathTF(*)| +\item |\xtCInfoset*|: prints owners according to the input mode as set by |\setistmathTF(*)| +\item |\xtCInfosetO*|: prints owners according to the input mode as set by |\setistmathTF(*)| +\item |\xtOwner*|: prints owners according to the input mode as set by |\setistmathTF(*)| +\item |\xtActionLabel*|: prints action labels according to the input mode set by |\setistmathTF(*)| +\item |\xtPayoff*|: prints payoffs according to the input mode as set by |\setistmathTF(*)| +\item |\xtInfosetOwner*|: prints owners according to the input mode set by |\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 +\item |\setxtinfosetstyle|: changes line the style (line style, fill, etc.) for all information sets +\item |\setxtinfosetlayer|: changes the layer of information sets +\item |\setxtsubgamelayer|: changes the layer of |\xtSubgameBox| and |\xtSubgameOval| +\item |\setistgameshorten|: value of the key |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 +\item |\cntmdistance|: analogous to |\xtdistance|, for a continuum of branches +\item |\cntmdistance*|: incorporates |\cntmdistance| with |\xtdistance| +%\item |\cntmactsibdist|: sibling distance for action branches from |\istrootcntm| and its variants +\item |\istrootcntm|: |\istroot| |+| |cntm|, printing a continuum of branches +\item |\istrootcntm'|: swap version of |\istrootcntm| +\item |\istrootocntm|: (oval version) |\istrooto| |+| |cntm|, printing a continuum triangle +\item |\istrootocntm'|: swap version of |\istrootocntm| +\item |\cntmpreset|: controls a continuum of branches (line style, color, size, fill color) +\item |\cntmpreset*|: controls a simple triangle continuum of branches with no background color +\item |\cntmistb|: similar to |\istb| for the outermost branches of a continuum triangle +\item |\cntmistb*|: draws |solid node|s at the ends of the continuum outermost branches +\item |\istrootcntmA|: |\istroot| |+| |cntmA|, printing a continuum arc +\item |\istrootcntmA'|: swap version of |\istrootcntmA| +\item |\istrootocntmA|: (oval version) |\istrooto| |+| |cntmA|, printing a continuum arc +\item |\istrootocntmA'|: swap version of |\istrootocntmA| +\item |\cntmApreset|: controls the features of a continuum arc +\item |\cntmAlayerpreset|: sets the layer of a continuum wedge (with fill color) +\item |\cntmAistb|: similar to |\istb| for the outermost branches of a continuum arc +\item |\cntmAistb*|: draws |solid node|s at the ends of the continuum arc outermost branches +\item |\cntmAInfoset|: prints an information set for a continuum arc +\item |\cntmAInfosetO|: oval version of |\cntmAInfoset| +\item |\xtShowEndPoints*|: shows additionally the outermost endpoints of a continuum of branches +\item |\xtHideEndPoints*|: turns off only the endpoints of a continuum of branches +\item |\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} +\item |\setxtarrowtips|: works through |->-| to control the features of middle arrow tips +\item |\xtShowMidArrows|: shows arrows in the middle of branches +\item |\xtHideMidArrows|: hides middle arrows drawn by |\xtShowMidArrows| +\item |\setxtshowmidarrows|: controls the middle arrows on branches in a simple tree +\item |\xtShowArrows|: shows arrows at the ends of branches with endpoints +\item |\xtHideArrows|: hides arrows drawn by |\xtShowArrows| +\item |\xtHideArrows*|: hides arrows but with endpoints remained +\item |\setxtshowarrows|: controls the features of the arrows shown by |\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 +\item |\xtTimeLineH|: a horizontal time-line +\item |\xtTimeLineH'|: a horizontal time-line with a label at the other end +\item |\xtTimeLineV|: a vertical time-line +\item |\xtTimeLineV'|: a vertical time-line with a label at the other end +\item |\xtCommentTo|: to leave a comment |to| a node |from| a \emph{relative} coordinate +\item |\xtCommentFrom|: to leave a comment |from| an \emph{absolute} coordinate |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 +\item |\xtcureslopedlabelsNS|: cures the \TikZ\ issue of sloped labels with asymmetric scales +\item |\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} @@ -223,11 +334,11 @@ Those who have used these changed and removed macros may want to \textsc{find} a \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 +\item |->-|: (controllable) middle arrow tip, taking one optional argument +\item |->>-|: double middle arrow tip +\item |->>>-|: triple middle arrow tip +\item |-o-|: circle middle arrow tip +\item |-x-|: cross middle arrow tip \end{itemize} \subsection{How to read this document} @@ -239,7 +350,7 @@ That's only \emph{four} pages long. (You can find a little secret at the first p 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}"). +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} (entitled ``\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. @@ -254,30 +365,30 @@ If you you are an experienced user of the \pkg{istgame} package, enjoy every det 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 +\item |{ }|: contents, texts, important dimensions (mandatory or optional) +\item |[ ]|: usual options, positions or directions, node types, fill color +\item |( )|: coordinate related arguments, dimension as the last optional argument, special purposes +\item |< >|: angles (or directions), special purposes (mostly used right before |{ }|) +\item |+ .. +|: only for the local change of level and sibling distances with |\istroot| and its friends +\item |! !|: |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. +\item Generally, all macros are designed to avoid leaving an empty argument like |[][blue]|, as possible as they can do. (This is \emph{input minimalism} for lazy users including myself!) +\item |< >| is used just before |{ }|, except for |\istb| and its friends. +\item |( )| as the last optional argument is for dimensions, like |(1em)| or |(3pt)|. +\item The order mostly looks like |<>{}[]| or |<>{}[]()|, 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'}. +Some macros have a starred(|*|) version or a swap(|'|) version, for example, |\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 +\item |* version|: just another version with different functions (in some cases, it's quite different) +\item |' version|: clockwise arrangement of branches or its related version \end{itemize} @@ -285,51 +396,61 @@ Some macros have a starred(\xw{*}) version or a swap(\xw{'}) version, for exampl 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: +The following macros, all prefixed by |\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}) +\item \icmd{\setistgamefontsize}|{<text size>}| \hfill (default: |\normalsize|) +\item \icmd{\setistgameshorten}|{<arrow end shorten dim>}| \hfill (default: |0pt|) \begin{itemize} - \item This works only when \xw{->} exists in the option list of the \env{istgame} environment. + \item This works only when |->| 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. +Though it is not recommended, you can use all the macros prefixed by |\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{\setistmathTF}, \icmd{\setistmathTF*} \hfill (initially: |011|) +\item \icmd{\setistdefaultnodeinnersep} \hfill (default: |1pt|) +\item \icmd{\setistdefaultnodeoutersep} \hfill (default: |0pt|) +\item \icmd{\setistdefaultnodedrawcolor} \hfill (default: |black|) +\item \icmd{\setistdefaultnodefillcolor} \hfill (default: |white|) \item \icmd{\setist<...>NodeStyle} -\item \icmd{\setistgrowdirection}, \icmd{\setistgrowdirection'} \hfill (default: \xw{south}): +\item \icmd{\setistgrowdirection}, \icmd{\setistgrowdirection'} \hfill (default: |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: +%You can also use (from the version 2.1): +% +%\begin{itemize}\tightlist +%\item \icmd{\setistsolidnodesize} \hfill (default: |2.4pt|) +%\item \icmd{\setisthollownodesize} \hfill (default: |2.8pt|) +%\item \icmd{\setistellipsenodesize} \hfill (default: |4.8pt|) +%\item \icmd{\setistrectanglenodesize} \hfill (default: |4pt|) +%\end{itemize} + +So, for example, you can do, in the preamble of your document, like: \begin{verbatim} \usepackage{istgame} \setistgamefontsize{\normalsize} \setistdefaultnodedrawcolor{black} - \setistSolidNodeStyle{2.4pt} + \setistsolidnodesize{2.4pt} % (new in version 2.1) + \setistellipsenodesize{2.8pt} % (new in version 2.1) \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. +The node styles such as |ellipse node| and |rectangle node| has |white| as the default background color. +This means that if the paper color of your document is not white, say, |blue!16|, you might not satisfy the results because the nodes have |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}. +%The background color of the TeXShop preview in the dark mode of |macOS| |Mojave| is very similar to |black!16|. \paragraph{Known problem with the \pkg{tikz-qtree} package} @@ -337,28 +458,28 @@ The background color of the TeXShop preview in the dark mode of \xw{macOS} \xw{M 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. +when you draw a game tree by using the native |tree| library in \TikZ. +Since the \pkg{istgame} package is based on the |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: +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 |edge from parent path| in the option list of \env{istgame} environment as follows: \xbigskip1 -\begin{tcblisting}{listing only} +\begin{docplain} % tikz-qtree conflict resolution (only with \usepackage{tikz-qtree}) [ edge from parent path={(\tikzparentnode) -- (\tikzchildnode)} ] -\end{tcblisting} -%\begin{tcblisting}{listing only} +\end{docplain} +%\begin{docsty} %\begin{istgame}% % [ % tikz-qtree conflict resolution (only with \usepackage{tikz-qtree}) % edge from parent path={(\tikzparentnode) -- (\tikzchildnode)} % ] % < istgame codes > %\end{istgame} -%\end{tcblisting} -%\xbigskip1 +%\end{docsty} + %\tmpclearpage \subsection{Previous changes (up to version 1.0)} @@ -366,66 +487,62 @@ If, for some reason, you need to load \pkg{tikz-qtree} when you draw a game tree 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. +Also, |\istroot*|, |\istcntm*|, and |\xtInfoset*| must be replaced by |\istrooto|, |\istcntmarc|, and |\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- +%|\xdistance| & |\xtdistance| & \\\tabucline- +%|\xDot| &|\xtNode| & \\\tabucline- +%|\xInfoset| &|\xtInfoset| & \\\tabucline- +%|\xInfoset*| &|\xtInfoset*| & |\xtInfosetO| \\\tabucline- +%|\xInfosetOwner| &|\xtInfosetOwner| & \\\tabucline- +%|\xActionLabel| &|\xtActionLabel| & \\\tabucline- +%|\xPayoff| &|\xtPayoff| & \\\tabucline- +%|\ShowTerminalNodes| &|\xtShowTerminalNodes| & \\\tabucline- +%|\HideTerminalNodes| &|\xtHideTerminalNodes| & \\\tabucline- +%|\levdist| &|\xtlevdist| & \\\tabucline- +%|\sibdist| &|\xtsibdist| & \\\tabucline- +%|\setistactionlabelshift| & ~ & |\xtALPush| \\\tabucline- +%|\setistactionlabelposition| & ~ & |\xtALShift| \\\tabucline- +%|\istroot*| & & |\istrooto| \\\tabucline- +%|\istcntm*| & & |\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} +|\xdistance| & |\xtdistance| & \\\cline{1-3} +|\xDot| &|\xtNode| & \\\cline{1-3} +|\xInfoset| &|\xtInfoset| & \\\cline{1-3} +|\xInfoset*| &|\xtInfoset*| & |\xtInfosetO| \\\cline{1-3} +|\xInfosetOwner| &|\xtInfosetOwner| & \\\cline{1-3} +|\xActionLabel| &|\xtActionLabel| & \\\cline{1-3} +|\xPayoff| &|\xtPayoff| & \\\cline{1-3} +|\ShowTerminalNodes| &|\xtShowTerminalNodes| & \\\cline{1-3} +|\HideTerminalNodes| &|\xtHideTerminalNodes| & \\\cline{1-3} +|\levdist| &|\xtlevdist| & \\\cline{1-3} +|\sibdist| &|\xtsibdist| & \\\cline{1-3} +|\setistactionlabelshift| & ~ & |\xtALPush| \\\cline{1-3} +|\setistactionlabelposition| & ~ & |\xtALShift| \\\cline{1-3} +|\istroot*| & & |\istrooto| \\\cline{1-3} +|\istcntm*| & & |\istcntmarc| \\\cline{1-3} \end{tabular} \end{center} -%\clearpage +\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}. +|\istroot| pins down the root of a tree or a subtree, |\istb| represents a branch, and |\endist| indicates the end of drawing a simple tree. Without |\endist|, the tree is NOT actually drawn, with no error messages produced. +A tree drawn by the sequence of |\istroot-||\istb-||\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 +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. The package \pkg{istgame} depends on the packages \ipkg{tikz}, \ipkg{xparse}, and \ipkg{expl3}. @@ -433,18 +550,19 @@ To use the \pkg{istgame} package you must load the package in the preamble of yo \begin{verbatim} \usepackage{istgame} \end{verbatim} -The package uses the following \TikZ\ libraries: +The package preloads the following \TikZ\ libraries: \begin{verbatim} trees,calc,arrows,shapes,positioning,backgrounds,fit,decorations.markings, + arrows.meta,bending, \end{verbatim} -and also loads \xw{patterns} and \xw{intersections} for additional use. +and also preloads |patterns| and |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} +\begin{doccode}{.3} %% \usepackage{istgame} % Example: a simple tree \begin{istgame} @@ -454,21 +572,21 @@ Let us get started with a simple self-explanatory example: \istb % endpoint will be (0-3), automatically \endist % end of simple (parent-child) structure \end{istgame} -\end{tcblisting} +\end{doccode} -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. +The resulting tree has the \emph{height} of |15mm| and +the \emph{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 \xw{(0,0)} by default, +If the second parenthesis argument of |\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. +Basically, in order to draw a whole game tree, we just repeat the simple |\istroot-\istb-\endist| structure. -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: connecting simple trees \begin{istgame} \istroot(0) % names the root (0) at (0,0) @@ -481,57 +599,51 @@ Basically, in order to draw a whole game tree, we just repeat the simple \verb|\ \istb % endpoint will be (c-2) \endist \end{istgame} -\end{tcblisting} +\end{doccode} -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. +In the above example, the simple \emph{subtree} is rooted at |(0-3)|, names the subroot |(c)|, and has two branches whose endpoints are automatically named |(c-1)| and |(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.) +Basically, |\istroot| designates a \emph{decision node} and its \emph{owner} (or a \emph{player}), +|\istb| prints a \emph{branch} coming out from the decision node with \emph{action labels} and \emph{payoffs}, and |\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} +\begin{docstx} \istroot(<decision node name>)(<root location>)<owner position>{<owner>} -\end{tcblisting} +\end{docstx} -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 only \emph{mandatory} argument of \icmd{\istroot} is |(<decision node name>)| and all others are \emph{optional}. +If the |(<location>)| where the \emph{\isw{root}} or a \emph{decision node} is placed is omitted, it is regarded as |(0,0)| by default. +The position of an \isw{owner} (or a \isw{player}) is |<above>| (or equivalently, |<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} +\begin{doccode}{.3} % Example: first try \begin{istgame} \xtdistance{15mm}{30mm} \istroot(0)(0,0){Child} - \istb%{Good}[above left]{(0,2)} - \istb%{Bad}[above right] - \endist + \istb \istb \endist \istroot(1)(0-2)<30>{Parent} - \istb%{Forgive}[above left]{(1,1)} - \istb%{Punish}[above right]{(-1,-1)} - \endist + \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -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. +In fact, |\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} +\begin{docstx} \istb{<action label>}[<action label pos>]{<payoffs>}[<payoff pos>] -\end{tcblisting} +\end{docstx} 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} +\begin{doccode}{.3} % Example: first try \begin{istgame} \xtdistance{15mm}{30mm} @@ -544,38 +656,35 @@ With the macro \icmd{\istb}, you can draw a \emph{\isw{branch}} and put an \emph \istb{Punish}[ar]{(-1,-1)} \endist \end{istgame} -\end{tcblisting} +\end{doccode} 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. +When you omit the position of payoffs, the package prints them naturally, but still you can change the location using an option like |[left]| or |[above left]|. For the positions of action labels and payoffs, you can use an abbreviation |[al]| for |[above left]| and similarly |[ar]|, |[bl]|, and |[br]|. +The abbreviations |[a]|, |[b]|, |[l]|, and |[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}.) +Both of the \emph{action labels} and \emph{payoffs} are printed in \emph{math mode} by default. (You can change the input mode for owners, action labels, and payoffs using a very useful macro |\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. +In fact, |\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. +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 |\istroot|, |\istb|, and |\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} +\begin{docstx} \xtInfoset(<from coor>)(<end coor>){<owner>}[<owner pos>] -\end{tcblisting} +\end{docstx} 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}. +For more details about |\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}. +In the example below, the macro |\xtInfoset| is used to show an \isw{information set}. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.35\linewidth} +\begin{doccode}{.35} % Example: information set \begin{istgame} %\setistgrowdirection'{east} @@ -599,28 +708,25 @@ In the example below, the macro \cmd{\xtInfoset} is used to show an \isw{informa \endist \xtInfoset(2)(3){Elaine} \end{istgame} -\end{tcblisting} -\xsmallskip1 +\end{doccode} -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}). +The package also provides the macro |\xtInfosetO| to draw a bubble type information set. +Just replace |\xtInfoset| with |\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. +You can also draw a curved information by using |\xtCInfoset| (Section~\ref{ssec:xtCInfoset}) and even a curved bubble type by using |\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. +Just use |\istrootcntm| (|\istroot + cntm|), instead of |\istroot|, to draw a \isw{continuum} of branches. -\xbigskip1 -\begin{tcblisting}{listing only} +\begin{docstx} \istrootcntm(<decision node name>)(<root location>)<owner position>{<owner>} -\end{tcblisting} +\end{docstx} -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. +The macro \icmd{\istrootcntm} works just like |\istroot|, but it prints a background triangle in |black!25|, by default, representing a continuum of branches. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.35\linewidth} +\begin{doccode}{.35} % Example: continuum of branches \begin{istgame}[font=\scriptsize] \istrootcntm(0){1} @@ -629,28 +735,25 @@ The macro \icmd{\istrootcntm} works just like \cmd{\istroot}, but it prints a ba \istroot(1)(0-1)<120>{2} \istb{Y}[al]{x,1-x} \istb{N}[ar]{0,0} \endist \end{istgame} -\end{tcblisting} -\xsmallskip1 +\end{doccode} -Here, \cmd{\istbm} represents a missing (or an invisible) branch (see page~\pageref{page:istbm}). +Here, |\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}. +For more details on |\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}. +The package also provides the macro |\istrootcntmA| to draw an arc to represent a continuum of branches. +You can just replace |\istrootcntm| by |\istrootcntmA| to do that, but let us not try this now. +(If you really want to try this now, you should change the first |\istb| to |\istbA| and then take out |\istbm| in the above example. It is said not to try this now.) +For more details on |\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. +You can use every options and macros you can use for the \env{tikzpicture} environment with the \env{istgame} environment. In the above example, |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. +With |\setistgrowdirection| or \cmd{\setistgrowdirection'}, you can easily change the \isw{direction} (|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} +\begin{doccode}{.35} % Example: \setistgrowdirection(') \begin{istgame}[scale=1.2] \setistgrowdirection'{east} @@ -663,37 +766,34 @@ With \cmd{\setistgrowdirection} or \cmd{\setistgrowdirection'}, you can easily c \istroot(1)(0-2)<135>{2} \istb{Y}[al]{x,1-x} \istb{N}[bl]{0,0} - \endist +% \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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}. +All you need to do is just to specify the direction you want, like |\setistgrowdirection{west}|, \cmd{\setistgrowdirection'}|{east}|, or \cmd{\setistgrowdirection'}|{-45}|. The prime version (|'|) is just to arrange branches \xw{clockwise} (by default \xw{counterclockwise}). In the above example, if you use |\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}} +\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}. +Here, the prefix `|xt|' stands for \ixsw{extensive tree}. -\xbigskip1 -\begin{tcblisting}{listing only} +\begin{docstx} % syntax: \xtdistance \xtdistance[<level depth>]{<level dist>}{<sibling dist>} % defaults: [1]{15mm}{15mm} -\end{tcblisting} -\xbigskip1 +\end{docstx} -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}. +The macro |\xtdistance| sets or resets the \xw{level distance} and the \xw{sibling distance}, respectively. +Note also that internally, for example, |\xtdistance{20mm}{30mm}| assigns |20mm| to \icmd{\xtlevdist} and |30mm| to \icmd{\xtsibdist}, which renew the default distances. +It is effective until you change the distances by using another |\xtdistance|. \begin{center} \begin{istgame}[scale=2] @@ -712,45 +812,35 @@ It is effective until you change the distances by using another \cmd{\xtdistance \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.) +You can use |\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, |<level depth>| is |1| by default. +(The level depth number other than |1| is not expected to be used.) -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} -% Example: \xtdistance +\begin{doccode}{.3} +% \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 +\istroot(0) + \istb \istb \istb \endist \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) +\istroot(a)(0-1) + \istb \istb \endist \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -%\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. +\item Since |\xtlevdist| and |\xtsibdist| are assigned values by |\xtdistance|, you can use these values to do some calculation like, for example, |1.2*\xtlevdist| or |1.5*\xtsibdist|. +\item The starred version \icmd{\cntmdistance*} is provided to deal with a continuum of branches and |\xtdistance| together, which is not documented at the moment. See Section~\ref{sec:xtdistance*}, on page~\pageref{sec:xtdistance*}, -for more details about \cmd{\cntmdistance*}. +for more details about |\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, +In fact, the core macros are much more powerful. |\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. +|\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. @@ -763,8 +853,7 @@ Below we will see in more details on how the core macros and others work. 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} +\begin{docsty} % istgame environment % \def\istgame@default@fontsize{\normalsize} \begin{istgame}[ <Tikz options> ] @@ -773,56 +862,55 @@ So it accepts all the options and macros that can be used for the \env{tikzpictu \end{istgame} % default options: [ font=\normalsize , >=stealth ] -\end{tcblisting} +\end{docsty} -The default font size is set as \verb|font=\normalsize|. +The default font size is set as |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}|. +|\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 |font| option key, like +|\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 \env{istgame} environment internally checks and extracts the optional values of |xscale| and |yscale| and, if exist, saves the values (|1.0| by default) at \icmd{\xtxscale} and \icmd{\xtyscale}, respectively. +And if the optional value of |scale| exists, it is saved at \icmd{\xtscale} only when neither |xscale| nor |yscale| exists. +You can use these values to calculate something you want, like |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}.) +The \env{istgame} environment also checks if the arrow option |[->]| exists in the option list of the environment. If it exists the \env{istgame} adds |shorten >=<dim>| (by default |0pt|) to the list as the first option together with |[->]|. +You can change the arrow shortening default value, +like |\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 +\paragraph{Starred version \xw{\begin\{istgame\}*}:} The \emph{starred version} of \env{istgame} environment is essentially the same as the \env{tikzpicture} environment. It means that if you start with |\begin{istgame}*|, the environment does not check what is said in the description above. +(See the discussion on page~\pageref{ssec:changes2.1} for more details on what happens in this case.) + \subsection{Node styles} \label{sec:nodestyles} \subsubsection{Basic node styles} -The \xw{tikzstyle}'s of the six basic node styles are predefined. +The |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}) + \hfill (default: |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}) + \hfill (default: |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}) + \hfill (default: |minimum size=2.4pt|) \item \ixw{hollow node}: \begin{istgame}\istroot(0)[hollow node]\endist\end{istgame} - \hfill (default: \xw{minimum size=2.8pt}) + \hfill (default: |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}) + \hfill (defaults: |inner sep=2pt|, |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}) + \hfill (defaults: |inner sep=1.5pt|, |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. +In 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: @@ -835,7 +923,7 @@ syntax: \end{verbatim} -\begin{tcblisting}{listing outside text, righthand width=.1\linewidth} +\begin{doccode}{.1} % Examples: \begin{istgame}\setistSolidNodeStyle[blue]{10pt} \istroot(0)[solid node]\endist\end{istgame}\\[1ex] @@ -847,68 +935,64 @@ syntax: \istroot(0)[ellipse node]\endist\end{istgame}\\[1ex] \begin{istgame}\setistNullNodeStyle[blue!20]{10pt} \istroot(0)[null node]\endist\end{istgame} -\end{tcblisting} +\end{doccode} -\xbigskip1 These basic node styles have their aliases, for convenience, for those who are familiar with game theoretic terminology. -\begin{tcblisting}{listing only,breakable} +\begin{docsty} % 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} +\end{docsty} 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. +to distinguish the \ixsw{root} (or the |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}|. +%You can also change the node styles, like |\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} +\begin{docsty} % some more aliases \tikzset{box node/.style=rectangle node} \tikzset{square node/.style=rectangle node} \tikzset{oval node/.style=ellipse node} -\end{tcblisting} +\end{docsty} -For aliases, you can also change the node styles, like \verb|\setistDecisionNodeStyle[blue]{3pt}| or \verb|\setistBoxNodeStyle{3pt}[green][.5]|. +For aliases, you can also change the node styles, like |\setistDecisionNodeStyle[blue]{3pt}| or |\setistBoxNodeStyle{3pt}[green][.5]|. -\subsubsection{Your own node styles: \protect\cmd{\setistNewNodeStyle}} +\subsubsection{Your own node styles: \protect\CMD{\setistNewNodeStyle}} You can create your own node style by \icmd{\setistNewNodeStyle}. -\begin{tcblisting}{listing only} +\begin{docstx} % \setistNewNodeStyle % syntax: \setistNewNodeStyle{<style name>}[<opt>]{<minimum size>} % defaults: {<m>}[-,circle,draw=black,fill=white,inner sep=1pt]{6mm} -\end{tcblisting} +\end{docstx} -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. +The first, mandatory denoted by |{<m>}|, argument is |{style name}| to be used. +The second, optional, argument is |[<options>]| to determine the style of a new node, with defaults. +The third, optional, argument should be |{<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} +To define, for example, a circle (by default) node with the minimum size of |3mm| filled with |red|, you can do like this: |\setistNewNodeStyle{new node}[fill=red]{3mm}|. In fact, this is an abbreviation of the following \TikZ\ macro: +\begin{docplain} \tikzset{new node/.style={ - circle , draw=black , fill=red , innser sep=1pt , minimum size=3mm } - } -\end{verbatim} + circle , draw=black , fill=red , inner sep=1pt , minimum size=3mm } } +\end{docplain} -Here is an example of using \cmd{\setistNewNodeStyle}. +Here is an example of using |\setistNewNodeStyle|. -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} % Example: \setistNewNodeStyle +\begin{doccode}{.4} \begin{istgame}[scale=1.5] \setistNewNodeStyle{new 1} [regular polygon,regular polygon sides=3, @@ -925,22 +1009,19 @@ Here is an example of using \cmd{\setistNewNodeStyle}. \istroot(2)(0-2)[new 3]<center>{III} \istb \istb \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} \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}.) +From the above example, observe that when you use |\istroot| to put the owner of a node, you need to specify |<center>| for the position of the node owner. +However, if you use the oval version |\istrooto|, you don't need that. +(See Section~\ref{sec:istroot} on page~\pageref{sec:istroot} for more details on |\istroot| and |\istrooto|.) -\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}.) +In \TikZ, the shape of a node is independent of the |scale| option in \env{tikzpicture}. +If you want to make the shape scaled according to the |scale| option, you can use the \TikZ\ option \ixw{transform shape}, as shown below. (In this kind of case, |\istrooto| helps, rather than |\istroot|.) -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} % Example: \setistrNewNodeStyle (scaled) +\begin{doccode}{.4} \begin{istgame}[scale=1.5] \setistNewNodeStyle{new 1} [regular polygon,regular polygon sides=3, @@ -959,22 +1040,21 @@ If you want to make the shape scaled according to the \xw{scale} option, you can [new 3,transform shape]<center>{III} \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\section{Core macro: \protect\cmd{\istroot}} +\section{Core macro: \protect\CMD{\istroot}} \label{sec:istroot} -\subsection{\protect\cmd{\istroot}: basics} +\subsection{\protect\CMD{\istroot}: basics} -\subsubsection{\protect\cmd{\istroot} -- counterclockwise: standard version} +\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}). +In game theoretic terminology, |\istroot| designates a decision node and its \isw{owner} (or a \isw{player}). -\xbigskip1 -\begin{tcblisting}{listing only} +\begin{docstx} % \istroot % syntax: \istroot[<grow keyval>,<tree opt>](<coor1>)(<coor2>) @@ -990,48 +1070,47 @@ In game theoretic terminology, \cmd{\istroot} designates a decision node and its <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 +\end{docstx} \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 only mandatory argument, denoted by |<m>|, of |\istroot| is |(<coor1>)|, which gives the name of the root or subroot. All the other arguments are optional. The name of the (sub)root, |(<coor1>)|, can be referred as a normal coordinate. +|(coor2)| specifies the location where the (sub)root is placed. +If |(coor2)| is omitted, it is regarded as |(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 +The default node style of the root is a |decision node|, which is just a |solid node|. You can change the node style to any other node style such as |initial node|, |chance node|, |oval node|, |box node|, and so on. Here is a simple example of drawing a tree structure. -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} -% Example: \istroot +\begin{doccode}{.3} +% \istroot \begin{istgame} \istroot(0) - \istb \istb \istb \endist + \istb + \istb + \istb + \endist \istroot(a)(0-1)[chance node] - \istb \istb \endist + \istb + \istb + \endist \end{istgame} -\end{tcblisting} -%\xbigskip1 +\end{doccode} \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). +In the previous example, the game tree has the root named |(0)|, located at |(0,0)| by default, which has three branches (by three |\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 endpoints of the three branches are automatically named |(0-1)|, |(0-2)|, and |(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). +The root of the subtree is named |(a)|, located at |(0-1)|, and has two children. +Its children are automatically named |(a-1)| and |(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{doccode}{.3} +% \istroot (explained with labels) \begin{istgame}[font=\scriptsize] \istroot(0) \istb \istb \istb \endist @@ -1050,63 +1129,57 @@ See the following code example with explanatory labels to see what is going on. arc (-260:80:1.5cm) node [above,blue!30] {counterclockwise}; \end{istgame} -\end{tcblisting} +\end{doccode} \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(*)} +The owner of a decision node (or a player) is expressed in curly braces, like |{player 1}|, and printed in \emph{text mode}. The input mode and text font style of an owner can be changed by |\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. +The position of the owner of a decision node is specified in angle brackets, like |<90>|, |<above>|, or |<north>|. +To specify the position of an owner you can use |<degrees>|, or the compass directions such as |<north>|, |<south>|, |<east>|, |<west>|, and their valid combinations. +You can also use the positional words such as |<above>|, |<below>|, |<left>|, |<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}. +The first bracket option is mainly for the direction of a simple tree (|[south]| by default). +Internally, |[<grow keyval>]| typed in as the first option of |\istroot| renews the direction of tree growing by assigning its value to \icmd{\istgrowdirection}, whose default is |south|. -\xsmallskip1 \begin{adjustwidth}{\parindent}{\parindent} -\remark +\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]}. +\item In fact, the first option of |\istroot| controls the features of a 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 style). +For example, if you want, at any reason, to draw a simple tree with all \emph{red dashed branches with red labels} growing south-eastwards, you can do like |[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]}. +The tree growing direction can be specified by |[<degrees>]| or by using the compass directions such as +|[north]|, |[south]|, |[east]|, |[west]|, |[north east]|, |[north west]|, |[south east]|, |[south west]|. +You can also use positional words like |[left]|, |[rigth]|, |[down]|, and |[up]|, but you cannot use |[above]| nor |[below]|. -%\xsmallskip1 \label{page:onesimpletree} -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example 1: \istroot (one simple tree) \begin{istgame}[font=\itshape] \istroot[right](0)<left>{player 1} \istb \istb \endist \end{istgame} -\end{tcblisting} -%\xsmallskip1 +\end{doccode} -\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. +\remark One thing you should remember about this is that |\istgrowdirection| is internally used +in the definition of |\istb| to control the label position for payoffs. +However, for the label position in \TikZ, |[below]| and |[above]| are good, +but not |[down]| nor |[up]|. +So DO NOT USE |[down]| nor |[up]| to specify the tree growing direction. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example 2: \istroot (three simple trees connected) \begin{istgame} \xtdistance{20mm}{20mm} @@ -1117,35 +1190,33 @@ So DO NOT USE \xw{[down]} nor \xw{[up]} to specify the tree growing direction. \istroot[right](b)(0-2)[box node]<135>{player 3} \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} \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}. +The last two options of |\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 |\xtdistance| are valid within the current \pkg{istgame} environment unless they are changed again by |\xtdistance|. Do not forget, when you use decimal distances, to delimit the decimal dimensions with curly braces, like -\verb|+{15.5mm}..{10.5mm}+|. +|+{15.5mm}..{10.5mm}+|. -\subsubsection{\protect\cmd{\istroot'} -- clockwise: swap version} +\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}. +The macro \icmd{\istroot'} is the \emph{swap version} of |\istroot|. +\cmd{\istroot'} works just like |\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'}. +Compare the following example with that of |\istroot| above on page~\pageref{page:clockwise}. +The two examples have exactly the same codes as each other except for one thing: either |\istroot| or \cmd{\istroot'}. -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} -% Example: \istroot' (explained with labels) +\begin{doccode}{.3} +% \istroot' (explained with labels) \begin{istgame}[font=\scriptsize] -\istroot'(0) - \istb \istb \istb \endist -\istroot'(a)(0-1) - \istb \istb \endist +\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)} @@ -1156,48 +1227,46 @@ The two examples have exactly the same codes as each other except for one thing: \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}; + arc (-260:80:1.5cm) node [above,blue!30] {clockwise}; \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} 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}. +If you draw a game tree growing south, you don't need to worry about the swap version \cmd{\istroot'}. Just use |\istroot|. -\subsection{\protect\cmd{\istrooto}: oval version} +\subsection{\protect\CMD{\istrooto}: oval version} \label{ssec:istrootstar} -\subsubsection{\protect\cmd{\istrooto} -- counterclockwise} +\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. +The macro \icmd{\istrooto} is the oval version of |\istroot|. +This allows us to draw a bubble (by default, |oval node|) with a node owner (or a game player) in it. Except for this difference, |\istrooto| works just like |\istroot|. Since an owner is shown in a specified node with |\istrooto|, the option |<owner label angle>| of the standard version |\istroot| is ignored. -\begin{tcblisting}{listing only,breakable} +\begin{docstx} % \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} +\end{docstx} + -%\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}. +The following two examples are the same as above with |\istroot| on pages~\pageref{page:onesimpletree} and \pageref{page:threesimpletrees}, respectively, but now with the oval version |\istrooto|. -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example 1: \istrooto (one simple tree) \begin{istgame}[font=\itshape] \istrooto[right](0)<180>{player 1} \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -%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}. +%The following example is also the same as above with |\istroot| on page~\pageref{page:threesimpletrees} but now with the oval version |\istrooto|. -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example 2: \istrooto (three simple trees connected) \begin{istgame} \xtdistance{20mm}{20mm} @@ -1208,12 +1277,26 @@ The following two examples are the same as above with \cmd{\istroot} on pages~\p \istrooto[right](b)(0-2)[box node]<135>{player 3} \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -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}. +Observe that the angle |<180>|, |<left>|, |<right>|, or |<135>| specifying the position of an owner's name is redundant to |\istrooto|. -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} -% Example 3: \istrooto (counterclockwise) +\begin{doccode}{.3} +% Example 3: \istroot (counterclockwise) +\begin{istgame} +\xtdistance{15mm}{30mm} +\istrooto(0){player 1} + \istb \istb \endist +\xtdistance{15mm}{15mm} +\istroot(a)(0-1)<right>{player 2} + \istb \istb \endist +\istrooto(b)(0-2)[box node]{player 3} + \istb \istb \endist +\end{istgame} +\end{doccode} + +\begin{doccode}{.3} +% Example 4: \istrooto (counterclockwise) \begin{istgame} \setistOvalNodeStyle{.6cm} \istrooto(0){0}+{12.5mm}..{3.45cm}+ @@ -1233,36 +1316,33 @@ Observe that the angle \xw{<180>}, \xw{<left>}, \xw{<right>}, or \xw{<135>} spec arc (-260:80:1.5cm) node [above,blue!30] {counterclockwise}; \end{istgame} -\end{tcblisting} +\end{doccode} -%\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!) +%|\setistbranchanchors| specifies the anchors of parent node and child node. (experimental!) % -%\begin{tcblisting}{listing only} +%\begin{docstx} %% \setistbranchanchors (experimental!) %% syntax: \setistbranchanchors % \setistbranchanchors{<parent anchor>}{<child anchor>} %% defaults: <parent anchor> is mandatory % {}{center} -%\end{tcblisting} +%\end{docstx} -\xsmallskip1 -The previous example shows how \cmd{\istrooto} arranges its branches: \ixsw{counterclockwise}, by default. +The previous example shows how |\istrooto| arranges its branches: \ixsw{counterclockwise}, by default. +\subsubsection{\protect\CMD{\istrooto'} -- clockwise: swap version} -\subsubsection{\protect\cmd{\istrooto'} -- clockwise: swap version} +The \emph{swap version} of the oval version, \icmd{\istrooto'}, works just like \cmd{\istroot'} with one exception that it puts an owner within an |oval node|, by default. -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} +\begin{doccode}{.3} % Example 2: \istrooto' (clockwise) \begin{istgame} \xtdistance{20mm}{20mm} @@ -1273,16 +1353,28 @@ The swap version of the oval version, \icmd{\istrooto'}, works just like \cmd{\i \istroot(a)(0-2)<right>{player 3}+15mm..10mm+ \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} + +\begin{doccode}{.3} +% Example 3: \istrooto (clockwise) +\begin{istgame} +\xtdistance{15mm}{30mm} +\istrooto'(0){player 1} + \istb \istb \endist +\xtdistance{15mm}{15mm} +\istroot(a)(0-1)<right>{player 2} + \istb \istb \endist +\istrooto(b)(0-2)[box node]{player 3} + \istb \istb \endist +\end{istgame} +\end{doccode} -\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} +%\begin{doccode}{.4} %% Example 3: \istrooto' (clockwise) %\begin{istgame} %\setistgrowdirection{north} @@ -1304,13 +1396,12 @@ Note that \cmd{\istrooto'} arranges its branches \ixsw{clockwise}. % arc (260:-80:1.5cm) % node [below,blue!30] {clockwise}; %\end{istgame} -%\end{tcblisting} +%\end{doccode} -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} -% Example 3: \istrooto' (clockwise) +\begin{doccode}{.4} +% Example 4: \istrooto' (clockwise) \begin{istgame} \setistgrowdirection'{east} \setistOvalNodeStyle{.6cm} @@ -1331,34 +1422,30 @@ Note that \cmd{\istrooto'} arranges its branches \ixsw{clockwise}. arc (260:-80:1.5cm) node [below,blue!30] {clockwise}; \end{istgame} -\end{tcblisting} +\end{doccode} -\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}.) +When you use the swap version \icmd{\setistgrowdirection'}, using either |\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}} +\section{Core macro: \protect\CMD{\istb}} \label{sec:istb} -\subsection{\protect\cmd{\istb}: basics} +\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. +Having all arguments as options, a simple |\istb| draws a branch from a parent node designated by |\istroot| to a child node (or endpoint of |\istb|). +If, for example, a parent node is named |(A)| by |\istroot|, the first child node is automatically named |(A-1)|, the second child node |(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. +The macro |\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(*)}. +If you want to change the input mode to text mode, you can use the macro |\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} +\begin{docstx} % \istb % syntax: \istb<grow, distance, missing>[<line style>]{<action>}[<pos>]{<payoff>}[<pos>] @@ -1371,89 +1458,79 @@ This issue is discussed in Section~\ref{ssec:setistmathTF} below. (You can also [action pos] % position of action label <default: center> {payoff} % payoffs (in math mode) [payoff pos] % position of payoffs <default: \istgrwodirection: south> -\end{tcblisting} +\end{docstx} -\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. +\remark The macro |\istb| has many variants including +|\istb*| (starred version), |\istbt| (terminal version), and |\istbm| (missing version). +It also has other very close friends: |\istB| (dual action label version) and |\istbA| (alternative or arc version). +Each friend of |\istb| has its starred version and terminal version, of course, except |\istbm|. +|\cntmistb(*)| and |\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)}. +In the example below, each |\istb| draws a branch. +With the option \ixw{missing}, |\istb| prints an \emph{invisible} branch. +Since the third child is \emph{missing}, the last child is named |(0-4)|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} -% Example: \istb<missing> (simply, \istbm) +\begin{doccode}{.3} +% \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} +\end{doccode} -\xbigskip1 -To make it simple, you can use the \emph{missing version} \icmd{\istbm} instead of \cmd{\istb<missing>}. +To make it simple, you can use the \emph{missing version} \icmd{\istbm} instead of |\istb<missing>|. \label{page:istbm} -\begin{tcblisting}{listing only} +\begin{docsty} % \istbm \newcommand\istbm{\istb<missing>} -\end{tcblisting} +\end{docsty} -\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. +The macro |\istb| also has various options to control the line style of a branch, and the direction and length of a branch. +|\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} +\begin{doccode}{.3} % Example: \istb (branch line styles) \begin{istgame} \istroot(0) \istb[dashed,thick] \istb[->] - \istb[draw=blue,thick] - \endist + \istb[draw=blue,thick] \endist \end{istgame} -\end{tcblisting} -%\xbigskip1 +\end{doccode} \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} +\begin{doccode}{.3} % Example: action labels \begin{istgame} \istroot(0) \istb[dashed,thick]{A} \istb[->]{\beta}[right] - \istb[draw=blue,thick]{Right}[ar] - \endist + \istb[draw=blue,thick]{Right}[ar] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -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]}. +To specify the position of action labels, +you can use the positional words or the \emph{\isw{abbreviations}}:\par +|[a]| for |[above]|, |[b]| for |[below]|, |[l]| for |[left]|, |[r]| for |[right]|,\par +|[al]| for |[above left]|, |[ar]| for |[above right]|, \par +|[bl]| for |[below left]|, and |[br]| for |[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]}. +Note that these abbreviations \emph{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 |[above,sloped]| but not like |[a,sloped]|. -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: sloped labels \begin{istgame}[font=\footnotesize] \istroot(0) @@ -1462,15 +1539,14 @@ For example, when you want to print \isw{sloped labels} for actions, you should \istb[draw=blue,thick]{Right}[above,sloped] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\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{itemize} +\item The |tree| library in \TikZ\ does not seem to treat sloped labels properly, when |xscale| or |yscale| is used asymmetrically. -\begin{tcblisting}{listing outside text, righthand width=.319\linewidth} +\begin{doccode}{.319} % Example: sloped labels problem \begin{istgame}[xscale=2,font=\footnotesize] %\xtcureslopedlabelsNS @@ -1480,13 +1556,13 @@ Issues in \emph{sloped labels} in \TikZ\ with \emph{asymmetric scales}: \istb[draw=blue,thick]{Right}[above,sloped] \endist \end{istgame} -\end{tcblisting} +\end{doccode} \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} +\begin{doccode}{.319} % Example: sloped labels problem cured \begin{istgame}[xscale=2,font=\footnotesize] \xtcureslopedlabelsNS @@ -1496,19 +1572,18 @@ These must be used in a TeX group with caution. \istb[draw=blue,thick]{Right}[above,sloped] \endist \end{istgame} -\end{tcblisting} +\end{doccode} \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. +The second curly braces option of the macro |\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). +By default, |\istb| prints payoffs in \emph{math mode}, which can be changed by |\setistmathTF(*)|. +By default, payoffs are put in the direction of |\istgrowdirection| (|[south]| by default). -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: payoffs \begin{istgame} \istroot(0) @@ -1517,20 +1592,18 @@ By default, payoffs are put in the direction of \cmd{\istgrowdirection} (\xw{[so \istb[draw=blue,thick]{\beta}[a]{u_1,u_2} \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} \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). +\item |\istgrowdirection| has the value of |[<grow keyval>]| typed in |\istroot| (default: |south|). +\item The value of |\istgrowdirection| is (internally) used to determine the direction of putting \emph{payoffs} (|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} +\begin{doccode}{.3} % Example: tree toward south east (or -45 degree) \begin{istgame} \istroot[-45](0) @@ -1539,14 +1612,12 @@ In the following example, notice that the tree grows south-eastwards, so the pay \istb[draw=blue,thick]{\beta}[a]{u_1,u_2} \endist \end{istgame} -\end{tcblisting} -%\xbigskip1 +\end{doccode} 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]}. +In the example below, the tree grows south-westwards, but the position of payoffs at the end of the blue branch is changed to |[below]| or |[b]|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: tree toward south west (or 225 degree) \begin{istgame} \istroot[south west](0) @@ -1555,31 +1626,31 @@ In the example below, the tree grows south-westwards, but the position of payoff \istb[draw=blue,thick]{\beta}[r]{u_1,u_2}[below] \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} \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]}. +\begin{itemize} +\item |\istb| expects a \emph{directional word} to be input as the last optional argument (by default, +|\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 |[below,xshift=5mm]|, but not like |[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}). +\item Note also that you can do like |[[xshift=5mm]below]|, instead (see also page~\pageref{page:finetuningpayoffs}). \end{itemize} -\subsubsection{Printing action labels in italics in text mode: \protect\cmd{\setistmathTF*}} +\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. +With the macro |\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}. +To do that, just declare |\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{doccode}{.3} +% \setistmathTF011 (default modes) \begin{istgame}[font=\footnotesize] \setistmathTF001 \istroot(0) @@ -1588,11 +1659,11 @@ The second zero means that the input mode for action labels is in text mode. \istb[draw=blue,thick]{Right}[above,sloped]{u_1,u_2} \endist \end{istgame} -\end{tcblisting} +\end{doccode} -If you use the starred version, like \cmd{\setistmathTF*001}, action labels are printed in \emph{italics}, by default. +If you use the starred version, like |\setistmathTF*001|, action labels are printed in \emph{italics}, by default. -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} \begin{istgame}[font=\footnotesize] \setistmathTF*001 \istroot(0) @@ -1601,13 +1672,12 @@ If you use the starred version, like \cmd{\setistmathTF*001}, action labels are \istb[draw=blue,thick]{Right}[above,sloped]{u_1,u_2} \endist \end{istgame} -\end{tcblisting} +\end{doccode} You can, of course, do the same thing in the default math mode. -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} \begin{istgame}[font=\footnotesize] -%\setistmathTF011 (default modes) \istroot(0) \istb[dashed,thick] {\textit{Left}}[above,sloped]{(0,1)} @@ -1616,19 +1686,19 @@ You can, of course, do the same thing in the default math mode. {\textit{Right}}[above,sloped]{u_1,u_2} \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsection{\protect\cmd{\istb*}: starred version} +\subsection{\protect\CMD{\istb*}: starred version} \label{ssec:istbstar} -\subsubsection{\protect\cmd{\istb*}: basics} +\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*}. +The starred version \icmd{\istb*} prints a |solid node| at the end of the corresponding branch. +This is the only difference between |\istb| and |\istb*|. -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} +% \istb* (starred version) \begin{istgame} \istroot[east](0) \istb[dashed,thick]{A} @@ -1636,33 +1706,32 @@ This is the only difference between \cmd{\istb} and \cmd{\istb*}. \istb*[draw=blue,thick]{\beta}[a] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{\protect\cmd{\xtShowEndPoints} and \protect\cmd{\xtHideEndPoints}} +\subsubsection{\protect\CMD{\xtShowEndPoints} and \protect\CMD{\xtHideEndPoints}} \label{page:endpoint} -Each endpoint is printed by each execution of \cmd{\istb*}. +Each endpoint is printed by each execution of |\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]}. +You can also change the style of nodes for all the endpoints of simple trees, by specifying it as an optional argument, like |\xtShowEndPoints[oval node]|. -\begin{tcblisting}{listing only,breakable} +\begin{docstx} % \xtShowEndPoints % syntax: \xtShowEndPoints[<node style>] % default: [solid node] -\end{tcblisting} +\end{docstx} -\xbigskip1 -The macro \icmd{\xtHideEndPoints} turns off the effects of \cmd{\xtShowEndPoints}. +The macro \icmd{\xtHideEndPoints} turns off the effects of |\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.) +|\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}. +Here is an example of using |\xtShowEndPoints| and |\xtHideEndPoints|. -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} +% \xtShowEndPoints and \xtHideEndPoints \begin{istgame} \xtShowEndPoints[oval node,minimum size=6pt] \istroot(0)[solid node] @@ -1672,75 +1741,77 @@ Here is an example of using \cmd{\xtShowEndPoints} and \cmd{\xtHideEndPoints}. \endist \xtShowEndPoints % default: solid nodes \xtdistance{15mm}{10mm} -\istroot(b)(0-2) \istb \istb \endist +\istroot(b)(0-2) + \istb + \istb + \endist \xtHideEndPoints % \istb* overrides -\istroot(b)(0-3) \istb \istb* \endist +\istroot(b)(0-3) + \istb + \istb* + \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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}. +Note that |\xtShowEndPoints| and |\xtHideEndPoints| should be in an \env{istgame} environment to avoid unexpected results. +Note also that |\istb*| overrides all the effects of these two macros by forcing to print a \pkg{solid node}. -\subsection{\protect\cmd{\istbt}: terminal version} +\subsection{\protect\CMD{\istbt}: terminal version} \label{ssec:istbperiod} -\subsubsection{\protect\cmd{\istbt}: basics} +\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}. +Basically, |\istbt|\ works exactly the same way as |\istb| does. +However, using |\istbt|\ together with the macro |\xtShowTerminalNodes| you can control the shape of the terminal nodes, \emph{all at once}. -\subsubsection{\protect\cmd{\xtShowTerminalNodes} and \protect\cmd{\xtHideTerminalNodes}} +\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]}. +The terminal version |\istbt|\ used with \icmd{\xtShowTerminalNodes} prints a |solid node| (by default). +You can change the style of the terminal nodes, like |\xtShowTerminalNodes[oval node]|. This effect can be turned off by \icmd{\xtHideTerminalNodes}. -%\xbigskip1 -\begin{tcblisting}{listing only,breakable} + +\begin{docstx} % \xtShowTerminalNodes (works only with \istbt and other terminal versions) % syntax: \xtShowTerminalNodes[<node style>] % default: [solid node] -\end{tcblisting} +\end{docstx} -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} -% Example: \xtShowTerminalNodes, \xtHideTerminalNodes +\begin{doccode}{.3} +% \xtShowTerminalNodes and \xtHideTerminalNodes \begin{istgame} \xtShowTerminalNodes[box node,fill=green] \istroot(0)[solid node] - \istbt[dashed,thick]{A} - \istb - \istb[very thick]{\beta}[ar] - \endist + \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 +\end{doccode} \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}. +Note that controlling terminal nodes by using |\xtShowTerminalNodes| works only with the terminal versions |\istbt|, |\istBt| (documented below in Section~\ref{sec:istB}) and |\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 |\xtShowTerminalNodes| and |\xtHideTerminalNodes|. -\subsection{\protect\cmd{\istB}: dual label version} +\subsection{\protect\CMD{\istB}: dual action label version} \label{sec:istB} -\subsubsection{\protect\cmd{\istB}: basics} +\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 macro \icmd{\istB}\ works just like |\istb|, except one thing: |\istB| prints \emph{dual action labels}\index{dual action 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. +The starred version \icmd{\istB*} prints a solid node at the end of the corresponding branch, just like |\istb*|. +And the terminal versions |\istBt| and \icmd{\istBt*} work just like |\istbt| and |\istbt*|, respectively, except for dual action labels. -%\xbigskip1 -\begin{tcblisting}{listing only,breakable} + +\begin{docstx} % \istB % syntax: \istB<grow>[<opt>]{<action1>}[<pos1>]{<action2>}[<pos2>]{<payoff>}[<pos>] @@ -1755,14 +1826,12 @@ And the terminal versions \cmd{\istBt} and \icmd{\istBt*} work just like \cmd{\i [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 +\end{docstx} -With \cmd{\istB}, do not forget to put two labels. Otherwise, you might get an unexpected result. +With |\istB|, do not forget to put \emph{two labels}. Otherwise, you might get an unexpected result. -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} -% \istB +\begin{doccode}{.3} +% \istB (dual action label version) \begin{istgame}[font=\footnotesize] \xtdistance{15mm}{30mm} \istroot(0)[chance node] @@ -1774,39 +1843,36 @@ With \cmd{\istB}, do not forget to put two labels. Otherwise, you might get an u \istBt[draw=blue,thick]{Tail}[ar]{1-y}[bl] \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -\subsubsection{\protect\cmd{\xtActionLabel} and \protect\cmd{\xtActionLabel*}} +\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. +The macro |\xtActionLabel| controls, from outside of a simple tree, a branch (by default |draw=none|) with a label (in math mode by default), connecting two nodes. -\xbigskip1 -\begin{tcblisting}{listing only,breakable} +\begin{docstx} % \xtActionLabel % syntax: \xtActionLabel*[<line opt>](<from>)(<to>){<action>}[<pos>,<node opt>] % default: [-,draw=none](<m>)(<m>){}[black,text depth=.25] -\end{tcblisting} +\end{docstx} \remark -In some cases, it is not a good idea to use \cmd{\istB} to print dual action labels. +In some cases, it is not a good idea to use |\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}). +\item With |\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. +\item With respect to a \emph{continuum} of branches, |\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}. +You can do the same thing as |\istB| does using |\istb| together with |\xtActionLabel|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} -% Example: \istb and \xtActionLabel +\begin{doccode}{.3} +% \istb and \xtActionLabel \begin{istgame}[font=\footnotesize] \xtdistance{15mm}{30mm} \istroot(0)[chance node] @@ -1822,13 +1888,12 @@ You can do the same thing as \cmd{\istB} does by using \cmd{\istb} and together \xtActionLabel(1)(1-1){y}[br] \xtActionLabel[draw,blue,thick](1)(1-2){1-y}[bl] \end{istgame} -\end{tcblisting} +\end{doccode} -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}). +The starred version |\xtActionLabel*| prints its label in the input mode as set by |\setistmathTF*| (see Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}, for more details on |\setistmathTF|). -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} -% Example: \istb and \xtActionLabel* +\begin{doccode}{.3} +% \istb and \xtActionLabel* \begin{istgame}[font=\footnotesize] \xtdistance{15mm}{30mm} \istroot(0)[chance node] @@ -1845,64 +1910,60 @@ The starred version \cmd{\xtActionLabel*} prints its label in the input mode as \xtActionLabel*(1)(1-1){y}[br] \xtActionLabel*[draw,blue,thick](1)(1-2){1-y}[bl] \end{istgame} -\end{tcblisting} +\end{doccode} -\subsection{\protect\cmd{\istbA}: alternative (or arc) version} +\subsection{\protect\CMD{\istbA}: alternative (or arc) version} \label{sec:istbA} -\subsubsection{\protect\cmd{\istbA}: basics} +\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>}, +The macro \icmd{\istbA} is an alternative (or arc) version, doing one more thing than |\istb|. With |\istbA| you can \emph{easily change the level distance} of an individual branch using a factor (|1|, by default) \emph{as the first optional argument} in parentheses. All other arguments are the same as in |\istb|. +For example, |\istbA(.5)| is an abbreviation of |\istb<level distance=.5*\xtlevdist>|, as you can see in the example below: -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} -% Example: \istbA +\begin{doccode}{.3} +% \istbA (alternative or arc version) \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} +\end{doccode} -You can interchangeably use \icmd{\istbA} and \cmd{\istb}, except for one case, in which you are working with a continuum of branches. +You can interchangeably use \icmd{\istbA} and |\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. +\item The macro |\istbA| is originally created to work with |\istrootcntmA| as an arc version. +\item |\istbA| draws, by default, a branch up to an arc when used with the continuum arc version |\istrootcntmA|, but |\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, |\istbA| is equivalent to |\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. +Its terminal version \icmd{\istbAt} is also available, but the dual action label version of |\istbA| is not provided. +The starred versions \icmd{\istbA*} and \icmd{\istbAt*} print a 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. +\subsubsection{\protect\CMD{\istbA}: applications} +By specifying the |grow| key of |\istb| you can draw a branch with the exact length you want. -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: \istbA \begin{istgame} \xtdistance{10mm}{15mm} -\istroot(0) \istb \istb \istb \endist +\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 + \istbA(.7)<grow=-120> \istb + \istbA(1)<grow=-30>{b} \endist \istroot(2)(0-3) \istb \istbA{b} \endist \draw [dashed] (1) circle (10mm); \draw [dotted] (1) circle (7mm); \end{istgame} -\end{tcblisting} +\end{doccode} -\xbigskip1 -You can also apply \cmd{\istbA} to easily ruin your regular balanced trees. +You can also apply |\istbA| to easily ruin your regular balanced trees. -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: \istbA \begin{istgame} \xtdistance{10mm}{15mm} @@ -1911,7 +1972,7 @@ You can also apply \cmd{\istbA} to easily ruin your regular balanced trees. \istbA(.7) \istb \istbA(2)<grow=-60>{b} \endist \istroot(2)(0-3) \istbA(.2) \istbA(-1){b} \endist \end{istgame} -\end{tcblisting} +\end{doccode} \section{Important labels: players, action labels, and payoffs} @@ -1921,13 +1982,11 @@ You can also apply \cmd{\istbA} to easily ruin your regular balanced trees. \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>}. +The direction to which a player label is put is set by the angle |< >| option of |\istroot|, like |<above>| (by default), |<east>|, or |<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} +\begin{doccode}{.3} % Example: node owner \begin{istgame} \istroot(0)<above>{Child} % default: <above> @@ -1935,22 +1994,19 @@ To specify the direction you can use degrees, the compass directions, or positio \istroot(1)(0-2)<45>{Parent} \istb \istb \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} \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}). +The supplementary macro |\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}). +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 |\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}). +Note that the oval version |\istrooto| produces a bubble type node with an owner in it, so the directional option |<angle>| is redundant with |\istrooto| (see Section~\ref{ssec:istrootstar} on page~\pageref{ssec:istrootstar}). -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: node owner (with \istrooto) \begin{istgame} \istrooto(0){Child} @@ -1958,17 +2014,16 @@ Note that the oval version \cmd{\istrooto} produces a bubble type node with an o \istrooto(1)(0-2)<45>{\textbf{Parent}} \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{Coloring players or a whole simple tree using \protect\cmd{\istroot}} +\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}.) +You can change the color of a player's name by giving |color| in the angle option of |\istroot|, like |<[red]>| or |<[blue]45>|. +(This is the \TikZ\ way of giving options for the |label| nodes.) -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: coloring players \begin{istgame} \istroot(0)<[red]>{Child} @@ -1980,18 +2035,16 @@ You can change the color of a player's name by giving \xw{color} in the angle op \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -%\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. +The example below shows how you color a whole simple tree: |red| for the Child's simple tree and |blue| for the Parent's simple tree. -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % 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 + <[red]45>{Child} % for owner only \istb{l}[al]{0,2}[south] \istb{r}[ar] \endist @@ -2000,127 +2053,121 @@ The example below shows how you color a whole simple tree: \xw{red} for the Chil \istb{r}[ar]{1,1}[-90] \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} + \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. +\item In the above example, the first |\istroot| has three bracket |[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 one is for a \emph{node} style of a decision node, and the third one is 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]}. + just use the color name like |[south,red]|. + If you want to have just the branches in blue, use the |draw| option key like |[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}. +\item Note that the \emph{first entry} in the first |[option]| list of |\istroot| \emph{must} be \emph{the growing direction of a simple tree}. So it should be input like |[south,red]|, but never like |[red,south]|. +(This is what |\istroot| requires.) Otherwise, you will get a compile \emph{error}. \end{itemize} -\subsubsection{Decorating players or a whole simple tree using \protect\cmd{\istrooto}} +\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}.) +The oval version \icmd{\istrooto} puts an owner within a bubble type node. +With |\istrooto|, the color of a player can be changed by the second bracket |[option]|, such as |[red]| or |[blue]|. +(This is the \TikZ\ way for giving options for the main |node|s.) -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: decorating players (with \istrooto) \begin{istgame} -\istrooto(0)[red]{Child} +\istrooto(0)[text=red]{Child} \istb{a}{B}[below] \istb{c} \endist -\istrooto(1)(0-2)[blue,dashed]{Parent} +\istrooto(1)(0-2)[fill=white,text=blue,dashed]{Parent} \istb \istb \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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. +The following example shows how you can color, with |\istrooto|, a whole simple tree including action labels and payoffs in |red| or |blue|, except for node styles. -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: decorating players (with \istrooto) \begin{istgame} -\istrooto[south,red](0)[draw=green,blue]{Child} +\istrooto[south,red](0)[draw=green,text=blue]{Child} \istb*{a}{B}[below] \istb{c} \endist -\istrooto[-90,blue](1)(0-2)[draw=blue,blue]{Parent} +\istrooto[-90,blue](1)(0-2)[draw=blue,text=blue]{Parent} \istb* \istb \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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. +What if you want to paint some color into the background of each oval node or box node? You can also do this by simply using the \TikZ\ way of giving options for nodes. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: decorating oval/box nodes \begin{istgame} \istrooto(0)[top color=white, - bottom color=blue!80!black,yellow]{Child} + bottom color=blue!80!black,text=yellow]{Child} \istb \istb \endist -\istrooto(1)(0-2)[box node,fill=red!20,blue]{Parent} +\istrooto(1)(0-2) + [box node,fill=red!20,text=blue]{Parent} \istb \istb \endist \end{istgame} -\end{tcblisting} -%\xbigskip1 +\end{doccode} -\subsubsection{Changing the input mode and text font style: \protect\cmd{\setistmathTF(*)}} +\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). +You can change the input mode for owners from text mode (by default) to math mode by using the macro |\setistmathTF111| which has three mandatory arguments. +The first number |1| means that an owner is printed in \emph{math mode}. +(The second number |1| and third number |1| mean that action labels and payoffs are in math mode, respectively.) +|\setistmathTF011| means that an owner is printed in text mode (this is default). -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % 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 + \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 +\istroot(2)(0-2)<0>{Omega 2} \istb \istb \endist \end{istgame} -\end{tcblisting} -%\xbigskip1 +\end{doccode} -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.) +The starred version, for example, |\setistmathTF*011|, enables you to change the font style of an owner. +Moreover, by specifying a text font style, like |\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 on |\setistmathTF*|.) -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: \setistmathTF(*) \begin{istgame} \setistmathTF111 % owner: math mode \istroot(0){\Omega_{\alpha}}+10mm..20mm+ - \istb \istb \endist + \istb \istb \endist \setistmathTF011 % owner: text mode -\istroot(1)(0-1)<180>{Alpha 2} \istb \istb \endist +\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 +\istroot(2)(0-2)<0>{Omega 2} + \istb \istb \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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}.) +The supplementary macro |\xtOwner| gives an alternative way of putting, outside of a simple tree, an owner in \emph{text mode} at a node. +The starred version |\xtOwner*| prints an owner as in the input mode set by |\setistmathTF*|. +(See Section~\ref{ssec:suppmac} on page~\pageref{ssec:suppmac}, for more details on |\xtOwner|.) -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: \setistmathTF(*) \begin{istgame} \setistmathTF111 % owner: math mode \istroot(0){\Omega_{\alpha}}+10mm..20mm+ - \istb \istb \endist + \istb \istb \endist \setistmathTF*011<textbf> % owner: text mode -\istroot(1)(0-1) \istb \istb \endist -\istroot(2)(0-2) \istb \istb \endist +\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 +\end{doccode} \subsection{How to put action labels} @@ -2130,8 +2177,7 @@ The starred version \cmd{\xtOwner*} prints an owner as in the input mode set by 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} +\begin{doccode}{.3} % Example: action labels \begin{istgame} \istroot(0) @@ -2141,15 +2187,14 @@ Note that action labels should be input in \emph{math mode}, by default. \istb{\text{\fbox{$\beta$}}}[above right] \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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. +By default, |\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 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} +\begin{doccode}{.3} % Example: action labels with abbreviations \begin{istgame} \istroot(0) @@ -2159,26 +2204,25 @@ In the following example, the abbreviations are used to place action labels. \istb{\text{\fbox{$\beta$}}}[ar] \endist \end{istgame} -\end{tcblisting} -%\xbigskip1 +\end{doccode} 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). +The supplementary macro |\xtActionLabel| is provided as an alternative way to put action labels (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}). +By default, action labels are to be input in \emph{math mode}. You can change the input mode to text mode by using |\setistmathTF| or |\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} +\begin{doccode}{.3} % Example: color and line style \begin{istgame} \istroot(0) @@ -2187,92 +2231,95 @@ In the example below, the bracket options before an action label are for branche \istb[blue,very thick]{C}[above right,red] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\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 +\remark It is \emph{important} to remember that you cannot use the abbreviations with additional options. For example, you can do like |\istb{C}[ar]| but not like |\istb{B}[ar,red]|. Instead, you should do like |\istb{C}[above right,red]|. 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} +\begin{doccode}{.3} % 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] + \istb{\textbf{C}}[above right,fill=blue,text=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} +\end{doccode} \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}. +You can print \isw{sloped labels} for actions by using the \TikZ\ option |sloped|. +Still you should remember that you cannot use the abbreviations to place action labels with other options like |sloped|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} +% Example: sloped action labels \begin{istgame} \istroot(0) \istb{Good}[above,sloped] - \istb{Bad}[above,sloped] \endist + \istb{Bad}[above,sloped] + \endist \istroot(1)(0-2) \istb{\text{\fbox{$\alpha$}}}[above,sloped] - \istb{\text{\fbox{$\beta$}}} \endist + \istb{\text{\fbox{$\beta$}}} + \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} \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 The |tree| library in \TikZ\ does not seem to treat sloped labels properly, when |xscale| or |yscale| is used asymmetrically. % Example: actions labels with abbreviations -\begin{tcblisting}{listing outside text, righthand width=.31\linewidth} +\begin{doccode}{.31} \begin{istgame}[xscale=2.5] \istroot(0) \istb{Good}[above,sloped] - \istb{Bad}[above,sloped] \endist + \istb{Bad}[above,sloped] + \endist \istroot(1)(0-2) \istb{\text{\fbox{$\alpha$}}}[above,sloped] - \istb{\text{\fbox{$\beta$}}} \endist + \istb{\text{\fbox{$\beta$}}} + \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\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. +\item A temporary solution to cure this issue is to declare the macro |\xtcureslopedlabelsNS|, provided with this package, in a TeX group with caution. +For a tree growing eastwards or westwards, use |\xtcureslopedlabelsEW|, 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{doccode}{.31} \begin{istgame}[xscale=2.5] \xtcureslopedlabelsNS \istroot(0) \istb{Good}[above,sloped] - \istb{Bad}[above,sloped] \endist + \istb{Bad}[above,sloped] + \endist \istroot(1)(0-2) \istb{\text{\fbox{$\alpha$}}}[above,sloped] - \istb{\text{\fbox{$\beta$}}} \endist + \istb{\text{\fbox{$\beta$}}} + \endist \end{istgame} -\end{tcblisting} +\end{doccode} \end{itemize} %\clearpage \subsubsection{Dual action labels} -You can also express \isw{dual labels} for actions by using \icmd{\istB} or \icmd{\istBt}. +You can also express \isw{dual action labels} for actions by using \icmd{\istB} or \icmd{\istBt}. -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} +% dual action labels: \istB and \istBt \begin{istgame}[sloped,font=\footnotesize] \xtdistance{15mm}{25mm} \istroot(0)[chance node] @@ -2282,19 +2329,18 @@ You can also express \isw{dual labels} for actions by using \icmd{\istB} or \icm \istBt{Head}[a]{y}[b] \istBt{Tail}[a]{1-y}[b] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -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). +You can do the same thing as |\istB| does by using |\istb| together with the supplementary macro |\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(*)}} +\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}). +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 |\setistmathTF011|, meaning that the input mode for an owner is in text mode (denoted by the first |0|), for action labels in math mode (denoted by the second number |1|), and for payoffs in math mode (denoted by the third number |1|). -So if do like \cmd{\setistmathTF001} (with the second number \xw{0}), action labels are in \emph{text mode}. +So if you do like |\setistmathTF001| (with the second number |0|), action labels are in \emph{text mode}. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} % Example: \setistmathTF001 \begin{istgame}[sloped,font=\footnotesize] \istroot(0)[chance node]+15mm..25mm+ @@ -2305,15 +2351,13 @@ So if do like \cmd{\setistmathTF001} (with the second number \xw{0}), action lab \istroot(2)(0-2)[chance node] \istBt{Head}[a]{z}[b] \istBt{Tail}[a]{1-z}[b] \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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. +Moreover, if you use the \emph{starred version}, like \icmd{\setistmathTF*}|001|, action labels automatically are printed in \emph{italics}. +If you specify a font style in \emph{curly braces}, like |\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} +\begin{doccode}{.25} % Example: \setistmathTF*001 (in italics) \begin{istgame}[sloped,font=\footnotesize] \istroot(0)[chance node]+15mm..25mm+ @@ -2325,15 +2369,13 @@ For more details, see Section~\ref{sec:setistmathTF} on page~\pageref{sec:setist \istroot(2)(0-2)[chance node] \istB{Head}[a]{z}[b] \istB{Tail}[a]{1-z}[b] \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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*}. +The supplementary macro |\xtActionLabel| prints, from outside of a simple tree, an action label in \emph{math mode}. +The starred version |\xtActionLabel*| prints an action label in the input mode as set by |\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} +%\begin{doccode}{.25} %% Example: \xtActionLabel* (with \setistmathTF*) %\begin{istgame}[sloped,font=\footnotesize] %\istroot(0)[chance node]+15mm..25mm+ @@ -2348,54 +2390,47 @@ For more details, see Section~\ref{ssec:istbandxtActionLabel} (on page~\pageref{ %\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 +%\end{doccode} -%\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}. +The payoffs are put in the direction set by \icmd{\setistgrowdirection} (|south|, by default), unless it is changed by |<grow keyval>| of |\istroot|. -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: payoffs \begin{istgame} \istroot(0) \istb{Good}[l]{0,2} - \istb{Bad} - \endist + \istb{Bad} \endist \istroot(1)(0-2) \istb{\alpha}[al]{(1,1)} - \istb{\beta}[ar]{-1,-1} - \endist + \istb{\beta}[ar]{-1,-1} \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\xbigskip1 \remark -\begin{itemize}\tightlist +\begin{itemize} \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}). +The supplementary macro |\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}). +The payoffs are to be input in math mode, by default, you change the input mode to text mode by using |\setistmathTF(*)| (see Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}). \end{itemize} -\subsubsection{Payoffs and \protect\xttw{\textbackslash istgrowdirection}} +\subsubsection{Payoffs and \protect\cmd{\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}. +The \isw{direction} of where payoffs are put from a terminal node follows \icmd{\istgrowdirection} typed in as the first optional argument of |\istroot|. +The default direction is |south| and can be changed by |\setistgrowdirection|. +For example, |\setistgrowdirection{north}| changes the default direction to |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{doccode}{.3} +% grow=south (default) \begin{istgame} \istroot(0) \istb[dashed,thick]{A}{\binom23} @@ -2403,28 +2438,25 @@ To specify the tree growing direction or the position of payoffs to be put, you \istbt[blue,very thick]{B}[ar]{2,3} \endist \end{istgame} -\end{tcblisting} -%\xbigskip1 +\end{doccode} -By default, \xw{grow=south}, so \cmd{\istgrowdirection} is \xw{south} (or \xw{below} or \xw{-90}). +By default, |grow=south|, so |\istgrowdirection| is |south| (or |below| or |-90|). The above example shows payoffs at the south (by default) of terminal nodes. -\xbigskip1 \remark - \begin{itemize}\tightlist + \begin{itemize} \item - You can simply omit the position of payoffs. Then they are printed, by default, in the direction as set by \cmd{\istgrowdirection}. + You can simply omit the position of payoffs. Then they are printed, by default, in the direction as set by |\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}). + For example, |[b,yshift=-3mm]| and |[yshift=-3mm,below]| are not acceptable. + It must be that |[below,yshift=-3mm]|. + \item Note also that you can do like |[[yshift=-3mm]below]|, instead (see also page~\pageref{page:finetuningpayoffs}). \end{itemize} -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: grow=south (default) \begin{istgame} \istroot(0) @@ -2434,13 +2466,11 @@ The above example shows payoffs at the south (by default) of terminal nodes. [below,yshift=-3mm,draw] \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} 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} +\begin{doccode}{.3} % Example: grow=right (or east or 0 degree) \begin{istgame} \istroot[right](0) @@ -2450,12 +2480,11 @@ You can see more examples, below, that show the positions of payoffs, by default \endist \xtHideTerminalNodes \end{istgame} -\end{tcblisting} +\end{doccode} -\verb|grow=right=\istgrowdirection|, so payoffs are put on the right. +|grow=right=\istgrowdirection|, so payoffs are put on the right. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: grow=north \begin{istgame} \setistgrowdirection{north} @@ -2465,12 +2494,11 @@ You can see more examples, below, that show the positions of payoffs, by default \istbt[blue,very thick]{B}[bl]{2,3} \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\verb|grow=north=\istgrowdirection|, so payoffs are put above the terminal nodes. +|grow=north=\istgrowdirection|, so payoffs are put above the terminal nodes. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: grow=south west \begin{istgame} \istroot[south west](0) @@ -2479,43 +2507,47 @@ You can see more examples, below, that show the positions of payoffs, by default \istb[blue,very thick]{B}[right]{2,3} \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\verb|grow=south west=\istgrowdirection|, so payoffs are put below left of the terminal node. +|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]|. +\remark +You can adjust the direction of putting payoffs by specifying a directional word right after payoffs, like |\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, +\remark +You can use the \isw{abbreviations} |[l]|, |[r]|, |[a]|, and |[b]| for |[left]|, |[right]|, |[above]|, and |[below]|, respectively. +The abbreviations |[al]|, |[ar]|, |[bl]|, and |[br]| can also be used +for |[above left]|, |[above right]|, |[below left]|, and |[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]|. +\remark +Notice also that, instead of the positional words, you can use the compass directions or degrees, like |\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}. +For example you can do like |\istb...{(1,1)}[[blue]below]|. +%This is the \TikZ\ way of giving options for |label|. Note that, in this case, you cannot use the abbreviation of the positional words. -\begin{tcblisting}{listing outside text, righthand width=.2\linewidth} +\begin{doccode}{.2} % Example: coloring payoffs \begin{istgame} \istroot(0) - \istb{Good}[l]{0,2} \istb{Bad} \endist + \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} +\end{doccode} 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} +\begin{doccode}{.2} % Example: decorating payoffs \begin{istgame} \istroot(0) @@ -2524,90 +2556,97 @@ You can also put payoffs in a box, a circle, or other shapes, even with color in \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] + [[draw,ellipse,fill=blue,text=yellow,inner sep=2pt]below] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{Changing the input mode and text font style: \protect\cmd{\setistmathTF(*)}} +\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. +by using |\setistmathTF010|. The last |0| means that payoffs are in text mode. -\begin{tcblisting}{listing outside text, righthand width=.2\linewidth} +\begin{doccode}{.2} % Example: \setistmathTF \begin{istgame} \istroot(0) - \istb{Good}[l]{pizza 1} \istb{Bad} \endist + \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 + \istb{\alpha}[al]{out 1} + \istb{\beta}[ar]{in 1} + \endist \end{istgame} -\end{tcblisting} +\end{doccode} -The starred version, for example, \cmd{\setistmathTF*010[texttt]}, with a font style specified in brackets, prints payoffs in typewriter font. +The starred version, for example, |\setistmathTF*010[texttt]|, with a font style specified in brackets, prints payoffs in typewriter font. -\begin{tcblisting}{listing outside text, righthand width=.2\linewidth} +\begin{doccode}{.2} % Example: \setistmathTF* \begin{istgame} \setistmathTF010 % payoffs: in text mode \istroot(0) - \istb{Good}[l]{pizza 1} \istb{Bad} \endist + \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 + \istb{\alpha}[al]{out 1} + \istb{\beta}[ar]{in 1} + \endist \end{istgame} -\end{tcblisting} +\end{doccode} -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*}. +The supplementary macro |\xtPayoff| prints, outside of a simple tree, payoffs in \emph{math mode}. +The starred version |\xtPayoff*| prints payoffs in the input mode as set by |\setistmathTF*|. See Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}. -\section{Input mode and text font style changer: \protect\cmd{\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}. +It takes three numbers (|0| or |1|) as \emph{mandatory} arguments. Here, |1| (|true|) means the input mode is in \emph{math mode} and |0| (|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. +In this package, it is initially set as |\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} +\begin{docstx} % \setistmathTF % syntax: \setistmathTF{<owner input mode>}{<action input mode>}{<payoff input mode>} % initial values: {0}{1}{1} -\end{tcblisting} +\end{docstx} 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. +The arguments must be one of text font styles \emph{without a backslash} such as |textrm|, |textit|, |itshape|, |textbf|, |scriptsize|, |tiny|, and so on. +Each of the three optional arguments is ignored when used with |\setistmathTF| and when the corresponding input mode is in math mode. -\begin{tcblisting}{listing only} +\begin{docstx} % \setistmathTF % syntax: \setistmathTF{}{}{}<owner font>{<action label font>}[<payoff font>] % defaults {0}{1}{1}<>{textit}[] -\end{tcblisting} +\end{docstx} 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). +For example, with |\setistmathTF*000<texttt>{textit}[tiny]| declared, an owner is printed in typewriter font, action labels in italics, and payoffs in the tiny size of normal text font (roman, upright). +With |\setistmathTF000<texttt>{textit}[tiny]|, all the optional arguments are ignored and all the labels are printed in normal text font. +Note also that with |\setistmathTF*001|, you can print action labels in \emph{italics} (by default). -\subsection{\protect\cmd{\setistmathTF}: input mode changer} +\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}. +The macro |\setistmathTF| is an \emph{input mode changer}, taking three numbers as mandatory arguments. +The default input modes for important labels are set as |\setistmathTF011|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} -% Example: \setistmathTF +\begin{doccode}{.4} +% \setistmathTF \begin{istgame} %\setistmathTF011 % (default mode) \xtdistance{20mm}{20mm} @@ -2623,24 +2662,22 @@ The default input modes for important labels are set as \cmd{\setistmathTF011}. \istb{left 3}[al]{pie 3} \istb{right 3}[ar]{pie 4} \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsection{\protect\cmd{\setistmathTF*}: input mode and text font style changer} +\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. +The starred version |\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 |<>{}[]|. The first option |<>| is for an owner, the second |{}| for action labels, and the third |[]| 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. +such as |textbf|, |textsc|, |textit|, |large|, |tiny|, and so on. +Each of the options is effective only when it is used with the starred version |\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. +Note that if the second optional argument is omitted when action labels are in text mode like, for example, |\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{doccode}{.4} +% \setistmathTF* \begin{istgame} \xtdistance{20mm}{20mm} \setistmathTF*011<textsc>{tiny}[textbf] @@ -2656,20 +2693,19 @@ Note that if the second optional argument is omitted when action labels are in t \istb{left 3}[al]{pie 3} \istb{right 3}[ar]{pie 4} \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsection{\protect\cmd{\setistmathTF*} and supplementary macros \texttt{\textbackslash xtFoo*} printing labels} +\subsection{\protect\CMD{\setistmathTF*} and supplementary macros \texttt{\bs 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. +All of the macros for information sets (except |\cntmAInfoset| and |\cntmAInfosetO|) such as |\xtInfoset| or |\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}. +All of these macros have their own \emph{starred} (|*|) versions, which print the labels in the input mode as set by \icmd{\setistmathTF*} (but not by |\setistmathTF|). For example, \icmd{\xtActionLabel*} prints action labels in \emph{italics} with |\setistmathTF*001|, while |\xtActionLabel| prints action labels in \emph{math mode}. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} -% Example: \setistmathTF* +\begin{doccode}{.4} +% Example: \setistmathTF* and \xtActionLabel* \begin{istgame} \xtdistance{20mm}{20mm} \setistmathTF*000<textsc>{tiny}[textbf] @@ -2680,31 +2716,31 @@ All of these macros have their own \emph{starred} (\xw{*}) versions, which print \xtActionLabel*(1)(1-1){left 2}[al] \xtPayoff*(1-1){pie 1} \end{istgame} -\end{tcblisting} +\end{doccode} -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}. +In this regard, you can find more examples of supplementary macros scattered here and there in appropriate places throughout the manual. 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{doccode}{.25} +% Example: owners of information sets \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 +\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} +\end{doccode} -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} +\begin{doccode}{.4} \begin{istgame} \setistmathTF*100{textsc}[texttt] \istroot(0){\alpha}+15mm..30mm+ @@ -2716,22 +2752,22 @@ Here are some more examples on owners of information sets (see Section~\ref{sec: \istroot(4)(1-2) \istb \istb \endist \istroot(5)(2-1) \istb \istb \endist \istroot(6)(2-2) - \istb \istb{Go}[r]{omega} \endist + \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} +\end{doccode} \label{page:xtCInfoset*} -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} +\begin{doccode}{.4} \begin{istgame} \setistmathTF*011<texttt> \istroot(0){Alice}+15mm..30mm+ - \istb \istb \endist + \istb \istb \endist \istroot(1)(0-1) \istb \istb \endist \istroot(2)(0-2) \istb \istb \endist \xtdistance{10mm}{10mm} @@ -2740,23 +2776,23 @@ Here are some more examples on owners of information sets (see Section~\ref{sec: \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*[dashed,blue,thick] + (1)(2)<.7>{Blue} \xtCInfosetO(1-1)(2-1){Ben} \xtCInfosetO(1-2)(2-2){Cate} \end{istgame} -\end{tcblisting} +\end{doccode} -%\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}. +If you are not satisfied the position of an owner (or a player), you can change it by using the \TikZ\ options such as |xshift|, |yshift|, or |label distance| with the angle option of |\istroot|. -Examples are \xw{<[xshift=10pt]above>\{Child\}} and \xw{<[label distance=-5pt]45>\{Parent\}}, as shown in the following: +Examples are |<[xshift=10pt]above>{Child}| and |<[label distance=-5pt]45>{Parent}|, as shown in the following: -\begin{tcblisting}{listing outside text, righthand width=.2\linewidth} +\begin{doccode}{.2} % Example: node owner \begin{istgame} \istroot(0)<[xshift=10pt]above>{Child} @@ -2768,9 +2804,9 @@ Examples are \xw{<[xshift=10pt]above>\{Child\}} and \xw{<[label distance=-5pt]45 \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -%\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +%\begin{doccode}{.3} %\begin{istgame}[scale=1.2] %\istcntm(cntm)[green]+8mm..24mm+ %\istroot(0)(cntm){I}+8mm..8mm+ @@ -2783,20 +2819,19 @@ Examples are \xw{<[xshift=10pt]above>\{Child\}} and \xw{<[label distance=-5pt]45 % \istb{N}[r]{0,0} % \endist %\end{istgame} -%\end{tcblisting} +%\end{doccode} \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. +As discussed in~\ref{ssec:istb} on page~\pageref{ssec:istb}, the macro |\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}.) +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 the abbreviations as mentioned above. +(Internally, the \isw{abbreviations} for payoffs and those for action labels work slightly differently in terms of |xshift| and |yshift|.) -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.2\linewidth} +\begin{doccode}{.2} % Example: action labels (default position) \begin{istgame}[scale=1.2] \xtShowEndPoints @@ -2806,26 +2841,23 @@ In order to determine the direction of action labels for branches to put, you ca \istb<grow=180>{\fbox{$b$}}[b] \istb<grow=-90>{\fbox{$r$}}[r] \endist \end{istgame} -\end{tcblisting} +\end{doccode} %\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} +\begin{docstx} % syntax: \xtALPush{<xshift dim> for l and r}{<yshift dim> for a and b} % default: {0pt}{0pt} -\end{tcblisting} +\end{docstx} -\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: +For example, |\xtALPush{-3pt}{5pt}| draws the labels left and right by |3pt| to the branch and push those put above and below |5pt| away from the branch, as shown in the following: -\begin{tcblisting}{listing outside text, righthand width=.2\linewidth} -% Example: \xtALPush +\begin{doccode}{.2} +% \xtALPush \begin{istgame}[scale=1.2] \xtShowEndPoints \xtALPush{-3pt}{5pt} % look here @@ -2835,26 +2867,24 @@ For example, \verb|\xtALPush{-3pt}{5pt}| draws the labels left and right by \xw{ \istb<grow=180>{\fbox{$b$}}[b] \istb<grow=-90>{\fbox{$r$}}[r] \endist \end{istgame} -\end{tcblisting} +\end{doccode} %\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, +You can also use the \isw{abbreviations} |al|, |ar|, |bl|, and |br| to represent +|above left|, |above right|, |below left|, and |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]| +\item |[al]| represents |[above left,xshift=1pt,yshift=-2pt,black]| +\item |[ar]| represents |[above right,xshift=-1pt,yshift=-2pt,black]| +\item |[bl]| represents |[below left,xshift=1pt,yshift=2pt,black]| +\item |[br]| represents |[below right,xshift=-1pt,yshift=2pt,black]| \end{itemize} -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.35\linewidth} -%\begin{tcblisting}{listing above text} +\begin{doccode}{.35} % Example: action labels with abbreviations \begin{istgame}[scale=1.1] \xtShowTerminalNodes[oval node,line width=.3pt] @@ -2881,34 +2911,30 @@ to position action labels. Precise representation of abbreviations is as follows \istbt[green]{\xbox{ar}}[ar]{-1,1} \endist \istroot[0](E)(0-1) - \istbt[blue,dashed]{\xbox{bl}}[bl]{1,3} + \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} +\end{doccode} \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} +\begin{docstx} % syntax: \xtALShift{<horizontal shift dim>}{<vertical shift dim>} % defaults: {1pt}{2pt} -\end{tcblisting} +\end{docstx} -\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. +When the dimensions get bigger than the defaults (|1pt| and |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} +\begin{doccode}{.3} % Example: node owner \begin{istgame} \xtALShift{4pt}{3pt} @@ -2917,17 +2943,16 @@ When the dimensions get bigger than the defaults (\xw{1pt} and \xw{2pt}) the lab \istroot(1)(0-2)<45>{Parent} \istb{L}[al] \istb{R}[ar] \endist \end{istgame} -\end{tcblisting} +\end{doccode} \subsection{Fine-tuning positions: payoffs} -You can change the position of payoffs with \TikZ\ options: \xw{xshift} and \xw{yshift}. +You can change the position of payoffs with \TikZ\ options: |xshift| and |yshift|. For example, you can do as shown in the following: \label{page:finetuningpayoffs} -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example: payoffs \begin{istgame} \istroot(0) @@ -2937,25 +2962,23 @@ For example, you can do as shown in the following: \istb{\beta}[ar]{-1,-1}[[yshift=-10pt]below] \endist \end{istgame} -\end{tcblisting} +\end{doccode} \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. +By default, a game tree grows down and the |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. +When a tree grows to the right, the branches are arranged and named from bottom to top. -\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. +In \TikZ, |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} +\begin{docsty} % default: growing south counterclockwise \def\xtgrow{grow} \def\istdefault@grow{south} % tree growing direction @@ -2970,14 +2993,14 @@ To deal with the direction of the tree growth and the order of arranging branche \renewcommand\istdefault@grow{#2} } } -\end{tcblisting} +\end{docsty} -\subsection{\protect\cmd{\setistgrowdirection} -- counterclockwise} +\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). +Our first example is a tree drawn using the default values: growing |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} +\begin{doccode}{.3} % Example 1: \setistgrowdirection{south} \begin{istgame} \setistOvalNodeStyle{.6cm} @@ -2991,13 +3014,13 @@ Our first example is a tree drawn using the default values: growing \xw{south} w \istrooto(2)(0-2){2} \istb{}{6}[center] \istb{}{7}[center] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -By default or with \cmd{\setistgrowdirection\{south\}}, the numbers written in the child nodes increase counterclockwise with respect to their parent nodes. +By default or with |\setistgrowdirection{south}|, the numbers written in the child nodes increase counterclockwise with respect to their parent nodes. -\subsection{\protect\cmd{\setistgrowdirection'} -- clockwise} +\subsection{\protect\CMD{\setistgrowdirection'} -- clockwise} -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example 2: \setistgrowdirection'{south} \begin{istgame} \setistgrowdirection'{south} @@ -3013,33 +3036,31 @@ By default or with \cmd{\setistgrowdirection\{south\}}, the numbers written in t \istrooto(2)(0-2){2} \istb{}{6}[center] \istb{}{7}[center] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -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. +With |\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}} +\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} +\xmedskip1\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) +|\setistgrowdirection{south}|: branches going counterclockwise (from left to right)\par +|\setistgrowdirection{west}|: branches going counterclockwise (downward)\par +\cmd{\setistgrowdirection'}|{north}|: branches going clockwise (from left to right)\par +\cmd{\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. +\remark When you use the swap version \cmd{\setistgrowdirection'}, using either |\istroot| or \cmd{\istroot'} gives you the same result. \subsubsection{A tree growing east -- counterclockwise} -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example 3: \setistgrowdirection{east} \begin{istgame} \setistgrowdirection{east} @@ -3056,13 +3077,13 @@ Though it is not necessary, it is suggested to use the following combinations of \istb{}{6}[center] \istb{}{7}[center] \endist \end{istgame} -\end{tcblisting} +\end{doccode} Numbers increase upward (or counterclockwise). \subsubsection{A tree growing east -- clockwise} -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example 4: \setistgrowdirection'{east} \begin{istgame} \setistgrowdirection'{east} @@ -3079,14 +3100,14 @@ Numbers increase upward (or counterclockwise). \istb{}{6}[center] \istb{}{7}[center] \endist \end{istgame} -\end{tcblisting} +\end{doccode} 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} +\begin{doccode}{.3} % Example 5: \setistgrowdirection{north} \begin{istgame} \setistgrowdirection{north} @@ -3103,13 +3124,13 @@ This looks more natural. \istb{}{6}[center] \istb{}{7}[center] \endist \end{istgame} -\end{tcblisting} +\end{doccode} Numbers increase from right to left (or counterclockwise). \subsubsection{A tree growing north -- clockwise} -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} +\begin{doccode}{.3} % Example 6: \setistgrowdirection'{north} \begin{istgame} \setistgrowdirection'{north} @@ -3126,31 +3147,28 @@ Numbers increase from right to left (or counterclockwise). \istb{}{6}[center] \istb{}{7}[center] \endist \end{istgame} -\end{tcblisting} +\end{doccode} Numbers increase from left to right (or clockwise). This looks more natural. -\subsubsection{\protect\cmd{\setxtgrowkey} for one simple tree} +\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. +\icmd{\setxtgrowkey} can be used to change the key between |grow| and |grow'|, which is useful especially for one simple tree, not a whole tree. -\xbigskip1 -\begin{tcblisting}{listing only} +\begin{docsty} % \setxtgrowkey: definition \NewDocumentCommand\setxtgrowkey{m} { \renewcommand\xtgrow{#1} } % #1 is either grow or grow' -\end{tcblisting} -\xbigskip1 +\end{docsty} 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}. +So you will need to use |\setistgrow{grow}| to locally get back to \emph{counterclockwise}. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} % Example: using \setistgrowdirection' (swap version) \begin{istgame}[scale=.7,font=\scriptsize] \setistgrowdirection'{east} @@ -3161,13 +3179,12 @@ So you will need to use \cmd{\setistgrow\{grow\}} to locally get back to \emph{c } \istroot'(3)(2-2) \istb{g}[al] \istb{h}[bl] \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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}. +You can do the same thing by using |\setistgrowdirection| and \cmd{\istroot'}. See the following example, in which +you do not need to use |\setxtgrowkey|. -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} % Example: using \istroot' (swap version) \begin{istgame}[scale=.7,font=\scriptsize] \setistgrowdirection{east} @@ -3176,21 +3193,21 @@ you do not need to use \cmd{\setxtgrowkey}. \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} +\end{doccode} \section{Information sets} \label{sec:infoset} -\subsection{\protect\cmd{\xtInfoset}: standard version} +\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). +The starred version \icmd{\xtInfoset*} prints the owner of an information set in input mode and text font style as set by |\setistmathTF(*)| (see page~\pageref{page:xtInfoset*} for examples). -\begin{tcblisting}{listing only} +\begin{docstx} % \xtInfoset % syntax: from left to right \xtInfoset[<info line type>](<from>)(<to>){<owner>}[<pos>,<node opt>] @@ -3198,80 +3215,68 @@ The starred version \icmd{\xtInfoset*} prints the owner of an information set in [-,infoset style](<m>)(<m>){}[above] % option style for (all) information sets infoset style={semithick,densely dotted} -\end{tcblisting} +\end{docstx} -The two coordinates \xw{(<from>)} and \xw{(<to>)} are mandatory and all other arguments are optional. +The two coordinates |(<from>)| and |(<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}. +This package provides macros to draw various types of information sets. They all include an option style |[|\ixw{infoset style}|]|, which is equivalent to |[semithick,densely dotted]|. You can change the style or add more options to it by using the macro |\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{doccode}{.25} +% \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 +\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} +\end{doccode} -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. +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 |a|, |l|, |ar|, or |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 |[left,red]| as shown below. -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} \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 +\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} +\end{doccode} -\xbigskip1 -For a curved information set, you can do, for example, like \cmd{\xtInfoset[bend left](1)(2)}. +For a curved information set, you can do like, for example, |\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}. +So, in order to draw a curved information set, it is recommended for you to use the curved version |\xtCInfoset|, documented in Section~\ref{ssec:xtCInfoset} on page~\pageref{ssec:xtCInfoset}. -\subsection{\protect\cmd{\xtInfosetO}: oval version} +\subsection{\protect\CMD{\xtInfosetO}: oval version} -\subsubsection{\protect\cmd{\xtInfosetO}: basics} +\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}}. +The oval version \icmd{\xtInfosetO} prints a bubble type (by default, a |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 |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). +Its starred version \icmd{\xtInfosetO*} prints the owner of an information set in input mode and text font style as set by |\setistmathTF(*)| (see page~\pageref{page:xtInfoset*} for examples). -%\xbigskip1 -\begin{tcblisting}{listing only} +\begin{docstx} % \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 ] + [ -,draw,rectangle,samples,inner sep=0pt,transform shape,sloped,midway, + 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 +\end{docstx} 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{doccode}{.25} +% \xtInfosetO \begin{istgame} \istroot(0){1}+15mm..30mm+ \istb{a} \istb{b} \endist @@ -3280,13 +3285,11 @@ Here is an example that shows a bubble type information set as a rounded rectang \xtInfosetO(0)(0) \xtInfosetO(1)(2){2} \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -The the height (or thickness) of an information set does not depend on \xw{scale}, \xw{xscale}, nor \xw{yscale}. +The the height (or thickness) of an information set does not depend on |scale|, |xscale|, nor |yscale|. -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} % Example: \xtInfosetO with x-y-scale \begin{istgame}[xscale=1.2,yscale=.7] \istroot(0){1}+15mm..30mm+ @@ -3296,23 +3299,19 @@ The the height (or thickness) of an information set does not depend on \xw{scale \xtInfosetO(0)(0) \xtInfosetO(1)(2){2} \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} 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. +\item The (minimum) height of a bubble type information set is |1em| by default. This can be changed by the last optional argument of |\xtInfosetO|, like |\xtInfosetO(1)(2)(2em)|. +\item The width of a bubble information set is |\n1+<minimum height>| by default, +where |\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} +\begin{doccode}{.25} % Example: \xtInfosetO: changing shape or color \begin{istgame} \setistgrowdirection'{east} @@ -3324,15 +3323,13 @@ where \xw{\n1} is the Euclidean distance (measured by \TikZ) between two nodes i (1)(2){2}(2em) \xtInfosetO(0)(0)(3em) \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} 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} +\begin{doccode}{.25} % Example: south east and yscale \begin{istgame}[yscale=1.5] \setistgrowdirection'{south east} @@ -3345,19 +3342,17 @@ You can also change the color of the bubble representing an information set by s \setxtinfosetstyle % restore defaults \xtInfosetO(1)(1) \end{istgame} -\end{tcblisting} +\end{doccode} -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}. +Note that, in the above example, |\setxtinfosetstyle| is used to change the style of information sets. +In order to restore the option value to default (i.e., |semithick,densely dotted|) just declare |\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}. +\subsubsection{Sloped information sets} +With the \pkg{istgame} package, a \isw{sloped information set} is not special. Just connect any two nodes using |\xtInfoset| or |\xtInfosetO|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} % Example: sloped infoset \begin{istgame} \istroot(0){Alice}+15mm..30mm+ @@ -3369,12 +3364,11 @@ With the \pkg{istgame} package, a \isw{sloped information set} is not special. J \xtInfosetO[rectangle](1)(1) \xtInfosetO(3)(2){Cate} \end{istgame} -\end{tcblisting} +\end{doccode} -\xbigskip1 -If you want to have an owner sloped too, you need the option \xw{[sloped]}, as shown below. +If you want to have an owner sloped too, you need the option |[sloped]|, as shown below. -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} % Example: sloped infoset with sloped text \begin{istgame} \setistgrowdirection'{east} @@ -3388,37 +3382,35 @@ If you want to have an owner sloped too, you need the option \xw{[sloped]}, as s \xtInfosetO*[ellipse,fill=blue!60] (3)(2){Cate}[sloped,white](1.5em) \end{istgame} -\end{tcblisting} +\end{doccode} -\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. +\item The |tree| library in \TikZ\ does not seem to treat sloped labels properly, when |xscale| or |yscale| is used asymmetrically. +\item To cure this problem you can use |\xtcureslopedlabelsNS| for trees growing northwards and southwards and |\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. +\item Note, however, that sloped labels for information owners printed by |\xtInfosetO| do not depend on scaling. \end{itemize} -\subsubsection{\protect\cmd{\setxtinfosetstyle}} +\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} +For this end, a simple new style |infoset style| is defined as follows: + +\begin{docsty} % \setxtinfosetstyle \NewDocumentCommand \setxtinfosetstyle { m } { \tikzset { infoset style/.style = { semithick , densely dotted , #1 } } } -\end{tcblisting} -\xbigskip1 +\end{docsty} -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\}}. +You can change the line style of an information set or add more options to the option list like, for example, |\setxtinfosetstyle{thin,dashed}| or |\setxtinfosetstyle{blue}|. -If you want get the option values back to the default values, then just declare \cmd{\setxtinfosetstyle}. +If you want get the option values back to the default, then just declare |\setxtinfosetstyle|. -\begin{tcblisting}{listing outside text, righthand width=.35\linewidth} -% Example: \setxtinfosetstyle +\begin{doccode}{.35} +% \setxtinfosetstyle \begin{istgame} \istroot(0){Alice}+15mm..30mm+ \istb \istb \endist @@ -3436,11 +3428,10 @@ If you want get the option values back to the default values, then just declare \setxtinfosetstyle % restore defaults \xtInfosetO(0)(0) \end{istgame} -\end{tcblisting} +\end{doccode} -\xbigskip1 -With \cmd{\setxtinfosetstyle}, you can also change the background color of information sets. -\begin{tcblisting}{listing outside text, righthand width=.35\linewidth} +With |\setxtinfosetstyle|, you can also change the background color of information sets. +\begin{doccode}{.35} % Example: \setxtinfosetstyle \begin{istgame} \istroot(0){Alice}+15mm..30mm+ @@ -3459,18 +3450,17 @@ With \cmd{\setxtinfosetstyle}, you can also change the background color of infor \setxtinfosetstyle % restore defaults \xtInfosetO(0)(0) \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{\protect\cmd{\setxtinfosetlayer}} +\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\{\}}. +You can use the macro \icmd{\setxtinfosetlayer} to change the \isw{layer} on which an information set lies from |background| (by default) to |behind|, |main|, |above|, or |foreground|, in that order. +To go back to the default layer, just declare |\setxtinfosetlayer| or |\setxtinfosetlayer{}|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \setxtinfosetlayer +\begin{doccode}{.25} +% \setxtinfosetlayer \begin{istgame} \setistgrowdirection'{east} \istroot(0){1}+15mm..30mm+ \istb{a} \istb{b} \endist @@ -3481,41 +3471,38 @@ To go back to the default layer, just declare \cmd{\setxtinfosetlayer} or \cmd{\ \setxtinfosetlayer \xtInfosetO[fill=blue!20](0-1)(0-2){2}(2em) \end{istgame} -\end{tcblisting} +\end{doccode} -%\clearpage -\subsection{\protect\cmd{\xtCInfoset}: curved version} + +\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). +Its starred version \icmd{\xtCInfoset*} prints the owner of an information set with the input mode and text font style as set by |\setistmathTF(*)| (see page~\pageref{page:xtCInfoset*} for examples). -\subsubsection{Curved information sets with \protect\cmd{\xtCInfoset}: basics} +\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}. +The basic usage of |\xtCInfoset| is the same as of |\xtInfoset|. -\xsmallskip1 -\begin{tcblisting}{listing only} +\begin{docstx} % \xtCInfoset : basics % syntax: - \xtCInfoset[<bubble opt>](<from>)(<to>){<owner>}[<pos>,<owner opt>](min. height) + \xtCInfoset[<bubble opt>](<from>)(<to>){<owner>}[<pos>,<owner opt>] % 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} + [ -,samples=500,tension=1,infoset style](<m>)(<m>){}[] +% infoset style = { semithick , densely dotted } +\end{docstx} Here is an example of drawing curved information sets. -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} -% Example: \xtCInfoset +\begin{doccode}{.4} +% \xtCInfoset \begin{istgame} -\istroot(0){Alice}+15mm..30mm+ - \istb \istb \endist +\istroot(0){Ace}+15mm..30mm+ + \istb\istb\endist \istroot(1)(0-1) \istb \istb \endist \istroot(2)(0-2) \istb \istb \endist \xtdistance{10mm}{10mm} @@ -3523,44 +3510,41 @@ Here is an example of drawing curved information sets. \istroot(4)(1-2) \istb \istb \endist \istroot(5)(2-1) \istb \istb \endist \istroot(6)(2-2) \istb \istb \endist +% curved information sets \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} +\end{doccode} -%\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!}). +\subsubsection{Skewed \protect\CMD{\xtCInfoset}: full functions} -\xsmallskip1 -\begin{tcblisting}{listing only} -% \xtCInfoset : full defninition +Besides the basic functions, |\xtCInfoset| has two additional optional arguments to control the shape of a curved information set. +With the macro |\xtCInfoset|, you can control the shape of an information set curve by using \ixw{plot factor} like |<1.3>| or |<0.7>| (by default |<1.3>|) and \ixw{midpoint factor} like |!.4!| or |!.6!| (by default |!.5!|). + +\begin{docstx} +% \xtCInfoset : full definition % syntax: - \xtCInfoset[<bubble opt>](<from>)!midpoint factor!(<to>) - <plot factor>{<owner>}[<pos>,<owner opt>](min. height) + \xtCInfoset[<opt>](<from>)!midpoint factor!(<to>) + <plot factor> + {<owner>}[<pos>,<owner opt>] % 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} + [ -,samples=500,tension=1,infoset style](<m>)!.5!(<m>)<1.3>{}[] +% infoset style = { semithick , densely dotted } +\end{docstx} \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. +If the |plot factor| is greater than |1| it prints a \emph{concave} curve, equal to |1| a \emph{straight} line, and less than |1| a \emph{convex} curve, connecting form left to right. +For example, |\xtCInfoset(1)(2)<.7>| (left to right) and |\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{doccode}{.4} +% \xtCIfoset: plot factor \begin{istgame}[scale=1.5,font=\scriptsize] -\istroot(0){Alice}+15mm..30mm+ - \istb \istb \endist +\istroot(0){Ace}+15mm..30mm+\istb\istb\endist \istroot(1)(0-1) \istb \istb \endist \istroot(2)(0-2) \istb \istb \endist \setistmathTF*011<texttt> @@ -3573,17 +3557,15 @@ For example, \cmd{\xtCInfoset(1)(2)<.7>} (left to right) and \cmd{\xtCInfoset(2) \xtCInfoset*[solid,green,thick](2)(1)<1.3> \xtCInfoset*[dashed,blue](1)(2)<.5>{.5} \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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. +By \ixw{midpoint factor}, we mean that, roughly speaking, it determines the maximum or minimum point of a curve. If the |midpoint factor| is less than |.5| the curve is positively skewed, and greater than |.5| negatively skewed. -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} +\begin{doccode}{.4} +% \xtCInfoset: midpoint factor (skewed) \begin{istgame}[font=\scriptsize] -\istroot(0){Alice}+15mm..30mm+ - \istb \istb \endist +\istroot(0){Ace}+15mm..30mm+\istb\istb\endist \istroot(1)(0-1) \istb \istb \endist \istroot(2)(0-2) \istb \istb \endist \xtdistance{10mm}{10mm} @@ -3595,17 +3577,15 @@ By \ixw{midpoint factor}, we mean that, roughly speaking, it determines the maxi \xtCInfoset(1-1)!-.05!(2-1)<1.6>{Ben} \xtCInfoset(1-2)!.9!(2-2)<1.4>{Cate} \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -A curved information set drawn by \cmd{\xtCInfoset} does not depend on the tree growing direction. +A curved information set drawn by |\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] +\begin{doccode}{.4} +\begin{istgame}[scale=.85,font=\scriptsize] \setistgrowdirection'{east} -\istroot(0){Alice}+15mm..30mm+ - \istb \istb \endist +\istroot(0){Ace}+15mm..30mm+\istb\istb\endist \istroot(1)(0-1) \istb \istb \endist \istroot(2)(0-2) \istb \istb \endist \xtdistance{10mm}{10mm} @@ -3617,38 +3597,37 @@ It does not depend on scaling nor swapping branches, either. \xtCInfoset(1-1)!-.05!(2-1)<1.6>{Ben} \xtCInfoset(1-2)!.9!(2-2)<1.4>{Cate} \end{istgame} -\end{tcblisting} +\end{doccode} -\subsection{\protect\cmd{\xtCInfosetO}: curved oval version} +\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). +Its starred version \icmd{\xtCInfosetO*} prints the owner of an information set in input mode and text font style in accordance with |\setistmathTF(*)| (see page~\pageref{page:xtCInfoset*} for examples). -\subsubsection{Curved bubble type information sets with \protect\cmd{\xtCInfosetO}: basics} +\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}. +The basic usage of |\xtCInfosetO| is the same as of |\xtInfosetO|. +If the two mandatory coordinates are \emph{identical}, a \emph{circle} (bud not a rectangle) is drawn to represent a \emph{\isw{singleton information set}}, like the case of |\xtInfosetO|. -\begin{tcblisting}{listing only} +\begin{docstx} % \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 } + [ -,draw,samples=500,inner sep=0pt,minimum height=1em,infoset style ] (<m>)(<m>){}[](1em) -\end{tcblisting} +% infoset style = { semithick , densely dotted } +\end{docstx} -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} +\begin{doccode}{.4} +% \xtCInfosetO: curved \begin{istgame} \setistmathTF*011<texttt> -\istroot(0){Alice}+15mm..30mm+ - \istb \istb \endist +\istroot(0){Ace}+15mm..30mm+\istb\istb\endist \istroot(1)(0-1) \istb \istb \endist \istroot(2)(0-2) \istb \istb \endist \xtdistance{10mm}{10mm} @@ -3660,17 +3639,15 @@ If the two mandatory coordinates are identical, a \emph{circle} is drawn to repr \xtCInfosetO(1-1)(2-1){Ben} \xtCInfosetO(1-2)(2-2){Cate} \end{istgame} -\end{tcblisting} +\end{doccode} -\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. +You also can change the background color and the height, like |(1.5em)| as the last option. -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} +\begin{doccode}{.4} \begin{istgame}[font=\scriptsize] \setistgrowdirection'{east} -\istroot(0){Alice}+15mm..30mm+ - \istb \istb \endist +\istroot(0){Ace}+15mm..30mm+\istb\istb\endist \istroot(1)(0-1) \istb \istb \endist \istroot(2)(0-2) \istb \istb \endist \xtdistance{10mm}{10mm} @@ -3685,34 +3662,33 @@ You also can change the background color and the height, like \xw{(1.5em)} as th \xtCInfosetO[fill=red!40,opacity=.5] (1-2)(2-2)<1.3>{Cate}(1.5em) \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{Skewed \protect\cmd{\xtCInfosetO}: full function} +\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!}). +The |plot factor| makes a curved information set higher or lower and is used in angle brackets, like |<1.5>| or |<.7>| (by default |<1.3>|), right after the two mandatory coordinates. The |midpoint factor| controls skewness of a curved information set and is used in between the two mandatory arguments, like |!.35!| (by default |!.5!|). -\begin{tcblisting}{listing only} +\begin{docstx} % \xtCInfosetO : full definition % syntax: \xtCInfosetO[<bubble opt>](<from>)!<midpoint factor>!(<to>) - <plot factor>{<owner>}[<pos>,<owner opt>](min. height) + <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} + [ -,draw,samples,inner sep=0pt, minimum size=1em, infoset style] + (<m>)!.5!(<m>)<1.3>{}[](1em) +% infoset style = { semithick , densely dotted } +\end{docstx} -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} -% Example: \xtCInfosetO: skewed +\begin{doccode}{.4} +% \xtCInfosetO: skewed \begin{istgame}[font=\scriptsize] -\istroot(0){Alice}+15mm..30mm+ - \istb \istb \endist +\istroot(0){Ace}+15mm..30mm+\istb\istb\endist \istroot(1)(0-1) \istb \istb \endist \istroot(2)(0-2) \istb \istb \endist \xtdistance{10mm}{10mm} @@ -3727,33 +3703,31 @@ The \xw{plot factor} makes a curved information set higher or lower and is used \xtCInfosetO[fill=red!40,opacity=.5] (1-2)!.65!(2-2)<1.5>{Cate} \end{istgame} -\end{tcblisting} +\end{doccode} -\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 When using |\xtCInfosetO|, the \emph{recommended range} of the \ixw{midpoint factor} is between |.4| and |.6|, at most between |.35| and |.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.) +\item An information set drawn by |\xtCInfosetO| is appropriately adjusted with |scale|, |xscale|, or |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} +\subsection{Fine-tuning \protect\CMD{\xtCInfosetO}: Not for most users} -\subsubsection{\protect\cmd{\xtCInfosetOTurnX}: too high or too low \xw{midpoint factor}} +\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}? +What if you really want to use the |midpoint factor| close to |0| or |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.) +(Note that this being unsatisfied might not happen if you use the |midpoint factor| within the recommended range.) -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} +\begin{doccode}{.4} % Example: \xtCInfoset (to be cured) \begin{istgame}[yscale=1.5,font=\scriptsize] \xtdistance{10mm}{10mm} -\istroot(0){Alice}+15mm..15mm+ +\istroot(0){Ace}+15mm..15mm+ \istb \istb \istb \istb \endist \istroot(1)(0-1) \istb \istb \endist \istroot(2)(0-2) \istb \istb \endist @@ -3768,28 +3742,26 @@ In this case, you will possibly get some unsatisfactory result as shown in the e \node at (1) [tmp,blue] {}; \node at (4) [tmp,red] {}; \end{istgame} -\end{tcblisting} +\end{doccode} -\xbigskip1 The package provides the macro \icmd{\xtCInfosetOTurnX} to make it straight. -\begin{tcblisting}{listing only} +\begin{docstx} % \xtCInfosetOTurnX % syntax: X angle is mandatory \xtCInfosetOTurnX {turn X angle}{turn Y angle} -\end{tcblisting} +\end{docstx} 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. +With |\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. +In the following example, |\xtCInfosetOTurnX{45}{0}| and |\xtCInfosetOTurnX{0}{-45}| are used to correct the result. If you omit the second angle like, for example, |\xtCInfosetOTurnX{45}|, it is equivalent to |\xtCInfosetOTurnX{45}{-45}|, meaning that it turns the both circles symmetrically. -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} +\begin{doccode}{.4} \begin{istgame}[yscale=1.5,font=\scriptsize] \xtdistance{10mm}{10mm} -\istroot(0){Alice}+15mm..15mm+ +\istroot(0){Ace}+15mm..15mm+ \istb \istb \istb \istb \endist \istroot(1)(0-1) \istb \istb \endist \istroot(2)(0-2) \istb \istb \endist @@ -3804,31 +3776,29 @@ In the following example, \cmd{\xtCInfosetOTurnX\{45\}\{0\}} and \cmd{\xtCInfose \xtCInfosetO[fill=red!40] (2)!.7!(4)<1.5>{Cate} \end{istgame} -\end{tcblisting} +\end{doccode} -\xbigskip1 \remark \begin{itemize}\tightlist \item -\cmd{\xtCInfosetOTurnX} works just once only for the following \cmd{\xtCInfosetO}, without affecting any other. +|\xtCInfosetOTurnX| works just once only for the following |\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}). +You can also change the layer of an information set, as shown in the previous example, by using \icmd{\setxtinfosetlayer} (see Section~\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}, +The height (or thickness) of bubble type information sets drawn by |\xtInfosetO| and |\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. +What if you want to make them scaled according the value of \TikZ\ symmetric scale, for example, |[scale=.5]|? +Then use, instead, |[scale=.5,xscale=1]| or equivalently |[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{doccode}{.4} \begin{istgame}[scale=.5] \xtdistance{40mm}{30mm} \istroot(0)+40mm..40mm+ @@ -3840,12 +3810,11 @@ Here is an ordinary example of using \xw{[scale=.5]}. \xtInfosetO[fill=green](1)(2)[green] \xtCInfosetO(1)(3){player}(1.5em) \end{istgame} -\end{tcblisting} +\end{doccode} -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. +Here is an example to use |[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{doccode}{.4} \begin{istgame}[scale=.5,xscale=1] \xtdistance{40mm}{30mm} \istroot(0)+40mm..40mm+ @@ -3857,10 +3826,9 @@ Here is an example to use \xw{[scale=.5,xscale=1]}, where the height (or thickne \xtInfosetO[fill=green](1)(2) \xtCInfosetO(1)(3){player}(1.5em) \end{istgame} -\end{tcblisting} +\end{doccode} -\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 @@ -3871,40 +3839,39 @@ is not affected by the values of \TikZ\ scale, unless users change it. (This is 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. + \item and either |xscale| or |yscale| or both (not with |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}. +Now, this is how the \env{istgame} environment works when |scale| is used with |xscale| or |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.) + \item When this is the case, the value of |scale| is not taken care of by the package. + Only the values of |xscale| and |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, |[scale=.5]| and |[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 |scale| to use it internally, but does only the value of |xscale|. So |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 |\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}+. +%You can also try using \icmd{\pgftransformscale} like |\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}. +The package \pkg{istgame} provides the macro |\istrootcntm| and its several variants (all prefixed by |\istroot| or |\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 |\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} +\subsection{\protect\CMD{\istrootcntm}: standard continuum version} \label{ssec:istrootcntm} -\subsubsection{\protect\cmd{\istrootcntm}: basics} +\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}. +The standard version \icmd{\istrootcntm} prints a background triangle, in |black!25| by default, representing a continuum of branches, on the \emph{background layer} by default. It works just like |\istroot|, for one exception: it controls, by the last two options |+<cntmlevdist>..<cntmsibdist>+|, the distances for only the background triangle, but not the |\istb|'s following it. +You can regard |\istrootcntm| as the sum |\istroot| |+| |cntm|. -%\xbigskip1 -\begin{tcblisting}{listing only,breakable} +\begin{docstx} % \istrootcntm % syntax: \istrootcntm[<grow keyval>,<opt>](<coor1>)(<coor2>)[<node style>,<opt>]% @@ -3919,50 +3886,50 @@ You can regard \cmd{\istrootcntm} as the sum \cmd{\istroot} \xw{+} \xw{cntm}. <angle> % position of owner name <default: above> {owner} % name of the owner of the (sub)root +cntmlevdist..cntmsibdist+ % <defaults: 8mm,24mm> -\end{tcblisting} -%\xbigskip1 +\end{docstx} -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). +The background is an isosceles triangle, with the height of \icmd{\cntmlevdist} (|8mm| by default) and the base length of \icmd{\cntmsibdist} (|24mm| by default). -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \istrootcntm +\begin{doccode}{.25} +% \istrootcntm (\istroot + cntm) \begin{istgame}[scale=1.2] -\cntmlevdist{10mm} +\cntmdistance{8mm} \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 + \istb{Y}[al]{x,1-x} + \istb{N}[ar]{0,0} + \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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. +The action taken by the owner of the root has the sibling distance (to a missing branch represented by |\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} +\begin{doccode}{.25} % Example: action sibling distance \begin{istgame}[scale=1.2] \xtdistance{10mm}{20mm} \istrootcntm(0){I}+10mm..20mm+ - \istb{x}[r] \istb*[dashed,white] \endist + \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 + \istb{Y}[al]{x,1-x} + \istb{N}[ar]{0,0} + \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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+|. +You can change the level and sibling distances of an individual continuum triangle by specifying the last two options of the macro |\istrootcntm| like, for example, |+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}.} +Below we will see the convenient \emph{distance changers} |\cntmdistance| and |\cntmdistance*| that can be used 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}|. +%The \emph{action sibling distance} can be controlled by the macro \icmd{\cntmactsibdist}. For this distance being \xw{3mm}, you can do like |\cntmactsibdistance{3mm}| or |\cntmactsibdist{2*1.5mm}|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth,breakable} +\begin{doccode}{.25} \begin{istgame}[font=\scriptsize] \xtdistance{10mm}{20mm} \istrootcntm(1){1} % period 1 @@ -3978,20 +3945,17 @@ Below we will see the convenient \emph{distance changers} \cmd{\cntmdistance} an \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 +\end{doccode} -\xbigskip1 \remark -\begin{itemize}\tightlist +\begin{itemize} \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. +Once the work of |\istrootcntm| is completed by |\endist|, |\istrootcntm| internally produces three node coordinates: |(cntm)|, |(cntm-1)|, and |(cntm-2)|. +\item You can use these coordinates after |\istrootcntm| and before another |\istrootcntm| or one of its variant, like |\istrootcntmA|, is used. \end{itemize} -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} % Example: using coordinates: (cntm),(cntm-1),(cntm-2) \begin{istgame}[scale=1.2] \istrootcntm(0){I} @@ -4002,16 +3966,15 @@ Once the work of \cmd{\istrootcntm} is completed by \cmd{\endist}, \cmd{\istroot \xtInfosetO(cntm)(cntm) \xtInfosetO[draw=none,fill=red,opacity=.3](cntm-1)(cntm-2) \end{istgame} -\end{tcblisting} -%\xbigskip1 +\end{doccode} -\subsubsection*{\protect\cmd{\istrootcntm'}: swap version} +\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. +With \cmd{\setistgrowdirection'}, both |\istrootcntm| and its swap version \cmd{\istrootcntm'} end up with the same result. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} +% \istrootcntm' (swap version) \begin{istgame}[scale=1.2] \setistgrowdirection'{east} \istrootcntm'(0){I} @@ -4020,42 +3983,40 @@ With \cmd{\setistgrowdirection'}, both \cmd{\istrootcntm} and its swap version \ \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 +\end{doccode} -%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}. +%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 |\cntmdistance|, as discussed below in Section~\ref{page:cntmdistance} on page~\pageref{page:cntmdistance}. -\subsubsection{\protect\cmd{\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. +\icmd{\cntmdistance} working for |\istrootcntm| (and |\istrootcntmA|) is analogous to |\xtdistance| working for |\istroot|. +%As |\xtdistance| controls the height and width of a simple tree, +|\cntmdistance| controls the height and width of a background triangle representing a continuum, but it has one more function than |\xtdistance|. +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} +\begin{docstx} % \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 +\end{docstx} -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: +Note that the first argument of |\cntmdistance| is \emph{mandatory}, and all the others are optional. +For example, |\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}. +And |\cntmdistance{10mm}{20mm}{3mm}| means now |\cntmactsibdist = 3mm|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \cntmdistance + +\begin{doccode}{.25} +% \cntmdistance \begin{istgame}[font=\scriptsize] \xtdistance{10mm}{20mm} \cntmdistance{10mm}{20mm}{3mm} @@ -4072,46 +4033,46 @@ And \verb+\cntmdistance{10mm}{20mm}{3mm}+ means now \cmd{\cntmactsibdist\ = 3mm} \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 +\end{doccode} -%\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} + +%\begin{doccode}{.25} %% 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} +%\end{doccode} -\subsubsection{\protect\cmd{\cntmdistance*}: combined with \protect\cmd{\xtdistance}} +\subsubsection{\protect\CMD{\cntmdistance*}: combined with \protect\CMD{\xtdistance}} \label{sec:xtdistance*} -The macro \icmd{\cntmdistance*} incorporates \cmd{\cntmdistance} with \cmd{\xtdistance}. +The macro \icmd{\cntmdistance*} incorporates |\cntmdistance| with |\xtdistance|. + -%\xbigskip1 -\begin{tcblisting}{listing only} +\begin{docstx} % \cntmdistance* % syntax: \cntmdistance*{<lev dist>}{<sib dist>}{<action sib dist>} % defaults: {15mm}{15mm}{(1/3)*<sib dist>} -\end{tcblisting} -%\xbigskip1 +\end{docstx} -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: + +The macro |\cntmdistance| does not have anything to do with |\xtdistance|, but the starred version |\cntmdistance*| does. +For example, |\cntmdistance*{10mm}{20mm}| means the followings: \begin{verbatim} \cntmlevdist = \xtlevdist = 10mm, \cntmsibdist = \xtsibdist = 20mm, and - \cntmdistance = (1/3)*\cntmdisdist, from now on. + \cntmactsibdist = (1/3)*\cntmsibdist, from now on. \end{verbatim} -And \cmd{\cntmdistance*\{10mm\}\{20mm\}\{3mm\}} means now \cmd{\cntmactsibdist\ = 3mm}. +And |\cntmdistance*{10mm}{20mm}{3mm}| means now |\cntmactsibdist = 3mm|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \cntmdistance*: with \xtdistance + +\begin{doccode}{.25} +% \cntmdistance* and \xtdistance \begin{istgame}[scale=1.2] \cntmdistance*{10mm}{20mm}{3mm} \istrootcntm(0){I} @@ -4120,54 +4081,48 @@ And \cmd{\cntmdistance*\{10mm\}\{20mm\}\{3mm\}} means now \cmd{\cntmactsibdist\ \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} +\end{doccode} -%%%You can use \cmd{\cntmpreset}, \cmd{\cntmactsibdist}, and \cmd{\cntmdistance} in any order, but whichever comes later overrides the previous effects. +%%%You can use |\cntmpreset|, |\cntmactsibdist|, and |\cntmdistance| in any order, but whichever comes later overrides the previous effects. -\subsubsection{\protect\cmd{\cntmpreset}: controlling continuum triangles} +\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}. +The macro \icmd{\cntmpreset} controls the line style and color, size (via the |shrink factor| with |1| as default), and fill color of a continuum triangle drawn by |\istrootcntm|. -\begin{tcblisting}{listing only} +\begin{docstx} % \cntmpreset % syntax: \cntmpreset[<line style>,<opts>]{<shrink factor>}[<fill color>] % defaults [-,solid,draw=black!25,fill=<draw color>]{1}[] -\end{tcblisting} +\end{docstx} -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. +To change the background color you can do like, for example, either |\cntmpreset[blue!20]| or |\cntmpreset{1}[blue!20]|. +However, like |\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] + +\begin{doccode}{.25} +\begin{istgame}[scale=.8,font=\scriptsize] \cntmdistance*{10mm}{20mm}{3mm} -\istrootcntm(1) - \istb \istbm \endist -\istroot(A1)(1-1) - \istb \istb \endist +\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 +\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 +\istrootcntm(3)(A2-2) \istb \istbm \endist +\istroot(A1)(3-1) \istb \istb \endist \end{istgame} -\end{tcblisting} -%\xbigskip1 +\end{doccode} + %% example with labels -%\xbigskip1 -%\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} + +%\begin{doccode}{.25} %\begin{istgame}[font=\scriptsize] %\xtdistance{10mm}{20mm} %\cntmdistance{10mm}{20mm}{3mm} @@ -4186,49 +4141,53 @@ However, like \xw{\cntmpreset[blue!20][red!20]}, if you specify both of the brac %\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 +%\end{doccode} + -\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{doccode}{.25} +% \cntmpreset{<shrink factor>} \begin{istgame}[font=\scriptsize] \cntmdistance*{10mm}{20mm} \cntmpreset{.7} -\istrootcntm(1) \istb \endist -\istroot(A1)(1-1) \istb \istb \endist +\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 +\istrootcntm(2)(A1-2) + \istb \istbm \endist +\istroot(A2)(2-1) + \istb \istb \endist \end{istgame} -\end{tcblisting} -%\xbigskip1 +\end{doccode} + -\subsubsection{\protect\cmd{\cntmpreset*}: simple triangles with no background color} +\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}. +The macro \icmd{\cntmpreset*} works like |\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} + +\begin{docstx} % \cntmpreset % syntax: \cntmpreset*[<line style>,<opts>]{<shrink factor>}[<fill color>] % defaults [-,solid,draw=black,fill=none]{1}[] -\end{tcblisting} -\xbigskip1 +\end{doccode} +\end{docstx} \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. +In order to restore the standard triangle options (i.e., |[-,draw=none,black!25]|), you can just declare |\cntmpreset| followed by nothing. More precisely, if you use |\cntmpreset| without specifying the first bracket option, like |\cntmpreset{.7}|, the default options are restored. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \cntmpreset(*) + +\begin{doccode}{.25} +% \cntmpreset* \begin{istgame}[font=\scriptsize] \cntmdistance*{10mm}{20mm} \cntmpreset* @@ -4247,14 +4206,14 @@ In order to restore the standard triangle options (i.e., \xw{[-,draw=none,black! \istroot(A1)(3-1) \istb \istb \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} + 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{doccode}{.25} % Example: \cntmpreset(*) \begin{istgame}[font=\scriptsize] \cntmdistance*{10mm}{20mm} @@ -4273,32 +4232,32 @@ You can also draw a \emph{smaller} triangle, by specifying \ixw{shrink factor} a \istroot(A1)(3-1) \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsection{\protect\cmd{\istrootcntmA}: continuum arc version} +\subsection{\protect\CMD{\istrootcntmA}: continuum arc version} \label{ssec:istrootcntmA} -\subsubsection{\protect\cmd{\istrootcntmA}: basics} +\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}. +The macro \icmd{\istrootcntmA} works just like |\istroot|, but it draws an arc to express a continuum of branches. Here |cntmA| is an abbreviation of |cntmarc|. +You can regard |\istrootcntmA| as the sum |\istroot| |+| |cntmA|. + -\xbigskip1 \remark -\begin{itemize}\tightlist +\begin{itemize} \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. +There is one important difference between |\istroot| and |\istrootcntmA|. By the last two options (for example, |+10mm..20mm+|), the |\istrootcntmA| controls the level and sibling distances of a continuum arc, while |\istroot| controls the level and sibling distances of action branches (represented by the |\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}}.) +Note that the distance changers |\cntmdistance| and |\cntmdistance*| work the same for |\istrootcntmA| as well as |\istrootcntm|. (\emph{There is no such thing as \texttt{\bs cntmAdistance}}.) \end{itemize} -%\xbigskip1 -\begin{tcblisting}{listing only,breakable} + +\begin{docstx} % \istrootcntmA % syntax: - \istrootcntmA[<grow keyval>,<opt>](<coor1>)(<coor2>)[<node style>,<opt>]% + \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+ @@ -4307,78 +4266,95 @@ Note that the distance changers \cmd{\cntmdistance} and \cmd{\cntmdistance*} wor (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 pos> % position of the owner's name {owner} % name of the owner of the (sub)root +level dist..sibling dist+ % <defaults: 8mm,24mm> -\end{tcblisting} +\end{docstx} -The default level and sibling distance of a continuum of branches are \xw{8mm} and \xw{3*8mm}. +The default level and sibling distance of a continuum of branches are |8mm| and |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{doccode}{.25} +% \istrootcntmA (\istroot + cntmA) \begin{istgame}[scale=1.2] -\istrootcntmA(0){I} \istb{x}[r] \endist +\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 + \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} +\end{doccode} + -\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}. +Just remember |\istb| always reaches the \emph{red dashed line} and |\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{doccode}{.25} +% \istrootcntmA and \istbA \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 + \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} +\end{doccode} -\subsubsection*{\protect\cmd{\istrootcntmA'}} +\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{doccode}{.25} +% \istrootcntmA' (swap version: growing east) \begin{istgame}[scale=1.2] \setistgrowdirection'{east} \istrootcntmA'(0){I} - \istb<level distance=1.3*\cntmlevdist>{x}[b] \istbm \endist + \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 + \istb{Y}[al]{x,1-x} + \istb{N}[bl]{0,0} + \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{\protect\cmd{\istrootcntmA} and \protect\cmd{\istbA}} +\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). +As discussed in Section~\ref{sec:istbA} on page~\pageref{sec:istbA} |\istb| and |\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} +%\begin{doccode}{.25} % Example: \istrootcntmA \begin{istgame}[scale=2.2,font=\scriptsize] %\cntmApreset<1.7> +\setistmathTF*000{texttt} \istrootcntmA(0) - \istb*{\tiny\cmd{\istb}}[left,yshift=-1mm] \istbm \endist + \istb*{\bs 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 + \istbm + \istbA{\bs istbA}[right,xshift=-1mm,yshift=-1mm] + \istbA*{\bs istbA}[right,yshift=-1mm] + \endist \xtdistance{6mm}{12mm} \istroot(1)(0-2) \istb \istb \endist @@ -4389,19 +4365,19 @@ However, when it comes to \icmd{\istrootcntmA}, \icmd{\istbA} has a unique funct (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)}}; +\node at (-1.5,-.2) [left] {|level distance of \istb|}; +\node at (1.5,-.2) [right] {|\istbA's level distance|}; +\node at (-1.5,-.4) [left] {|= \cntmlevdist|}; +\node at (1.5,-.4) [right] {|= k*\cntmlevdist|}; +\node at (1.5,-.6) [right] {| (k=1.333 with default values)|}; \end{istgame} -%\end{tcblisting} +%\end{doccode} \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. +To be precise, |\istbA| reaches the \emph{blue dashed line}, as shown in the above picture, while |\istb| reaches the \emph{red dashed line}. +So when |\istbA| is the only child of the root, it arrives exactly at the continuum arc. -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} % Example: \istrootcntmA and \istbA \begin{istgame}[scale=1.2] \istrootcntmA(0) @@ -4411,48 +4387,58 @@ So when \cmd{\istbA} is the only child of the root, it arrives exactly at the co \endist \xtTimeLineH[dashed,blue](0-2){-1.5}{1.5} \end{istgame} -\end{tcblisting} +\end{doccode} -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. +Moreover, as also discussed in Section~\ref{sec:istbA} on page~\pageref{sec:istbA}, |\istbA| has one more function than |\istb|: it can easily change its level distance by using the first parenthesis option. +This allows you to make any |\istbA| reach the continuum arc, but after some trial and errors. -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} % Example: \istrootcntmA and \istbA \begin{istgame}[scale=1.2] \istrootcntmA(0) - \istbA*(.89) \istbA* \istbA*(.89) + \istbA*(.89) + \istbA* + \istbA*(.89) \endist \istrootcntmA(1)(0-1) - \istbA*(.97) \istbA*(.97) \endist + \istbA*(.97) + \istbA*(.97) + \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{\protect\cmd{\cntmApreset}: controlling continuum arcs and wedges} +\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. +With \icmd{\cntmApreset}, you can control the line style, position (via |arc position factor|), and \emph{curvature} (via |arc plot factor|) of a continuum arc. +You can also change the background color (by default |transparent|) of the \emph{wedge} formed by a continuum arc. -%\xbigskip1 -\begin{tcblisting}{listing only} + +\begin{docstx} % 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 +\end{docstx} -You can change the line style or the color of a continuum arc, in the usual \TikZ\ way, like \xw{[dashed,thick,blue]}. + +You can change the line style or the color of a continuum arc, in the usual \TikZ\ way, like |[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. +So, by declaring |\cntmApreset| followed by nothing, you can restore all the default values. +\remark +\begin{itemize} +\item 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!) +If the arc position factor (between zero and one) is less than |{.5}| the arc gets closer to the root, and if greater, then it gets closer to the endpoints. +\item +What if the factor is greater than |1|? You try! +\end{itemize} -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} + +\begin{doccode}{.25} +% \cntmApreset (with \istrootcntmA and \istbA) \begin{istgame} \cntmdistance*{10mm}{20mm} \cntmApreset[dashed,blue,thick] @@ -4471,43 +4457,57 @@ If the arc position factor (between zero and one) is less than \verb+{.5}+ the a \istroot(A1)(3-1) \istb \istb \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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. +Note that |\istbA| (if it is the only child) always prints a branch with its endpoint exactly on the arc. +Note also that the effect of \icmd{\cntmApreset} goes on until another |\cntmApreset|, which restores the values to defaults, 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} +\remark +\begin{itemize} +\item +As for the curvature, if the factor (usually, greater than 1) typed in angle brackets is smaller than the default value |<1.333>| the arc gets flatter, and if larger it gets sharper. +\item +If the factor is |1|, it becomes a straight line. What if the factor is less than |1|? You guess! +\end{itemize} + + +\begin{doccode}{.25} +% \cntmApreset<plot factor> \begin{istgame} \cntmdistance*{10mm}{20mm} \cntmApreset<1.2> \istrootcntmA(1) - \istbA \endist + \istbA + \endist \cntmApreset[tension=1.12]<1.508> \istrootcntmA(2)(1-1) - \istbA \endist + \istbA + \endist \cntmApreset<1.7>[green] \istrootcntmA(3)(2-1) - \istbA* \endist + \istbA* + \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} + 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} + +\subsubsection*{\protect\CMD{\cntmAlayerpreset}: continuum arc layers} + +The color filled wedge lies on the |behind| layer, by default. +You can change the \emph{\isw{layer}} by using \icmd{\cntmAlayerpreset}. +Available layers are: |background|, |behind|, |main|, |above|, and |foreground|, in that order. +To restore the default layer (i.e., |behind|), just declare |\cntmAlayerpreset|. + + +\begin{doccode}{.25} +% \cntmAlayerpreset \begin{istgame} \cntmdistance*{10mm}{20mm} \cntmApreset{.5}[blue!20] @@ -4522,17 +4522,17 @@ To restore the default layer (i.e., \xw{behind}), just declare \cmd{\cntmAlayerp \istroot(A3)(3-1) \istb \istb \endist \xtInfosetO[fill=green](A1)(A3) \end{istgame} -\end{tcblisting} +\end{doccode} -\subsection{\protect\cmd{\istrootocntm} and \protect\cmd{\istrootocntmA}: oval continuum versions} +\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. +In some cases, you may want to use \icmd{\istrootocntmA}, the oval version of |\istrootcntmA|. +It can be regarded as the sum |\istrooto| |+| |cntmA|. The swap version \icmd{\istrootocntmA'} is also provided. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \istrooto+cntmA + +\begin{doccode}{.25} +% \istrootocntmA (oval version: \istrooto + cntmA) \begin{istgame} \setistEllipseNodeStyle[white] \cntmdistance*{10mm}{20mm} @@ -4544,16 +4544,16 @@ It can be regarded as the sum \cmd{\istrooto} \xw{+} \xw{cntmA}. The swap versio \istrooto(2a)(2-1){A} \istb{Y}[al] \istb{N}[ar] \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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}. + +It is anyway possible to use \icmd{\istrootocntm}, which is the oval version of |\istrootcntm|. +It can be regarded as the sum |\istrooto| |+| |cntm|. You can also use its swap version \icmd{\istrootocntm'}. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \istrooto+cntm + +\begin{doccode}{.25} +% Example: \istrootocntm \begin{istgame} \cntmdistance*{10mm}{20mm} \cntmApreset[dashed] @@ -4564,18 +4564,18 @@ You can also use its swap version \icmd{\istrootocntm'}. \istrooto(2a)(2-1){A} \istb{Y}[al] \istb{N}[ar] \endist \end{istgame} -\end{tcblisting} +\end{doccode} \subsection{Doing some chores: not for most users} -\subsubsection{\protect\cmd{\cntmistb}: controlling outermost branches} +\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. +This works similar to |\istb|, but you need to use this macro \emph{right before} the |\istrootcntm|. +And it works just \emph{once} only for the immediately following |\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 @@ -4583,15 +4583,16 @@ The macro \icmd{\cntmistb*} prints \xw{solid nodes} at the endpoints of the oute 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} + +\begin{docstx} % syntax: \cntmistb \cntmistb[<branch opt>]{<left action label>}[<pos>]{<right action label>}[<pos>] % defaults: all arguments are optional [-,draw=none]{}[]{}[] -\end{tcblisting} +\end{docstx} -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} +% \cntmistb (cntm outermost branches) \begin{istgame}[font=\scriptsize] \cntmdistance*{10mm}{20mm}{3mm} \cntmistb[draw=blue,dashed]{x=0}[l]{x=1}[above,sloped] @@ -4608,15 +4609,14 @@ It can be \emph{turned off} by the starred version \icmd{\xtHideEndPoints*} (see \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 +\istroot(A1)(3-1) \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\cmd{\cntmistb(*)} prints action labels in math mode by default, and the input mode can be changed by \cmd{\setistmathTF(*)}. +|\cntmistb(*)| prints action labels in math mode by default, and the input mode can be changed by |\setistmathTF(*)|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} + +\begin{doccode}{.25} \begin{istgame}[font=\scriptsize] \cntmpreset*[dashed]{.7} \cntmdistance*{10mm}{20mm}{3mm} @@ -4632,97 +4632,98 @@ It can be \emph{turned off} by the starred version \icmd{\xtHideEndPoints*} (see \istrootcntm(3)(A2-2) \istb \endist \istroot(A1)(3-1) \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{\protect\cmd{\cntmAistb}: controlling outermost branches} +\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. +This works similar to |\istb|, but you need to use this macro \emph{right before} the |\istrootcntmA|. +And it works just \emph{once} only for the immediately following |\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}. +The macro \icmd{\cntmAistb*} prints |solid nodes| at the endpoints of the outermost branches. +The effect of printing |solid node|s 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} + +\begin{docstx} % syntax: \cntmAistb \cntmistb[<branch opt>]{<left action label>}[<pos>]{<right action label>}[<pos>] % defaults: all arguments are optional [-]{}[]{}[] -\end{tcblisting} -\xbigskip1 +\end{docstx} -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} +Note that |\cntmAistb| controls outermost branches of a continuum, while |\cntmApreset| controls the arc line. + + +\begin{doccode}{.25} \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 +\istrootcntmA(1) \istbA \endist \istroot(A1)(1-1) \istbA \istbA \endist \end{istgame} -\end{tcblisting} +\end{doccode} + -\xbigskip1 -\cmd{\cntmAistb(*)} prints action labels in math mode by default, and the input mode can be changed by \cmd{\setistmathTF(*)}. +|\cntmAistb(*)| prints action labels in math mode by default, and the input mode can be changed by |\setistmathTF(*)|. -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} + +\begin{doccode}{.25} \begin{istgame}[font=\scriptsize] \cntmdistance*{10mm}{20mm} \cntmAistb[dashed]{x=0}[l]{x=1}[above,sloped] \cntmApreset[dashed]{.7} -\istrootcntmA(1) \istbA \endist +\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 +\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 +\istrootcntmA(3)(A2-2) \istbA \endist \istroot(A1)(3-1) \istbA \istbA \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} + -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}. +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 |\istrootcntmA|. -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} \begin{istgame}[font=\scriptsize] \cntmAistb* \cntmApreset{.7} -\istrootcntmA(1) \istbA \endist +\istrootcntmA(1) \istbA \endist \cntmAexpostShowEndPoints \istrootcntmA(A1)(1-1) \istbA* \endist \cntmAexpostShowEndPoints[oval node][box node] \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{\protect\cmd{\xtShowEndPoints*}} +\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*}. +The starred version \icmd{\xtShowEndPoints*} has additional control over the endpoints of outermost branches of a continuum, when it is used with |\cntmistb| or |\cntmAistb|. +However, the starred versions |\cntmistb*| and |\cntmAistb*| do not obey |\xtShowEndPoints*|. +They anyway print solid nodes at the endpoints of outermost branches and the effect goes on until it is blocked by |\xtShowEndPoints*| or |\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. +|\xtShowEndPoints*| competes with each of the starred versions |\cntmistb*| and |\cntmAistb*| for the control over |\cntmistb| and |\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. +The starred version |\xtHideEndPoints*| works \emph{only for the endpoints of the outermost branches} to turn off the effects of |\xtShowEndPoints(*)|, |\cntmistb*|, and |\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. +\remark +Note that the non-starred versions |\xtShowEndPoints| and |\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} +In the example below, |\cntmistb*| overrides the effect of |\xtShowEndPoint*[oval node]|, with respect to the outermost endpoints of continua. + +\begin{doccode}{.25} \begin{istgame} \cntmdistance*{8mm}{16mm} \cntmpreset* @@ -4740,13 +4741,13 @@ In the example below, \cmd{\cntmistb*} overrides the effect of \cmd{\xtShowEndPo \istrootcntm(4)(A3-2) \istb \endist \istroot(A4)(4-1) \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\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} +In the example below, |\xtHideEndPoints| and |\xtHidePoints*| cooperatively turn off the effects of |\xtShowEndPoints*| and |\cntmAistb|*. + +\begin{doccode}{.25} \begin{istgame} \cntmdistance*{8mm}{16mm} \xtShowEndPoints*[oval node] @@ -4766,17 +4767,17 @@ In the example below, \cmd{\xtHideEndPoints} and \cmd{\xtHidePoints*} cooperativ \istrootcntmA(4)(A3-2) \istbA \endist \istroot(A4)(4-1) \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} \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}. +It is not an issue to draw information sets for continuum triangles. You can just apply |\xtInfoset| or |\xtInfosetO|. %This section is for drawing information sets for continuum arcs. -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} \begin{istgame} \cntmdistance*{8mm} \cntmpreset{1}[green] @@ -4787,40 +4788,38 @@ It is not an issue to draw information sets for continuum triangles. You can jus \xtInfosetO[fill=red,opacity=.4](cntm-1)(cntm-2) \istroot(A2)(2-1) \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{\protect\cmd{\cntmAInfoset} for continuum arcs} +\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}.) +The default position of the arc information set is |1+.1|, meaning that |.1| (by default) is added to the position (|1| by default) of a continuum arc. +It must be used \emph{right after} the corresponding |\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 |\xtInfosetOwner| and |\xtOwner|.) + -%\xbigskip1 -\begin{tcblisting}{listing only} +\begin{docstx} % syntax: \cntmAInfoset - \cntmAInfoset*[<line opt>](<cntm root>)<plot factor>{<addto cntmApos>} + \cntmAInfoset*[<line opt>](<cntm root>)<plot factor>{<add-to cntmApos>} % defaults: (<cntm root>) is mandatory - [](<m>)<1.333>{.1} -\end{tcblisting} -%\xbigskip1 + [-,samples=500,tension=1,infoset style](<m>)<1.333>{.1} +\end{docstx} -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 +You can change, if necessary, the curvature of an information set arc by using \ixw{plot factor} (|<1.333>| by default). + +\begin{doccode}{.25} +% \cntmAInfoset \begin{istgame}[scale=1.5] -\istrootcntmA(0) - \istbA \endist +\istrootcntmA(0) \istbA \endist \cntmAInfoset(0)<1.34> \xtdistance{10mm}{20mm} -\istroot(1)(0-1) - \istb \istb \endist +\istroot(1)(0-1) \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -%\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +%\begin{doccode}{.25} %% Example: \istrootcntmA %\begin{istgame}[scale=1.2] %\istrootcntmA(0){I} @@ -4830,55 +4829,55 @@ You can change, if necessary, the curvature of an information set arc by using \ %\istroot(1)(0-1)<120>{II} % \istb{Y}[al]{x,1-x} \istb{N}[ar]{0,0} \endist %\end{istgame} -%\end{tcblisting} +%\end{doccode} 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} +\begin{doccode}{.25} % Example: \cntmAInfoset \begin{istgame}[scale=1.5] -\istrootcntmA(0) - \istbA \endist +\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 +\istroot(1)(0-1) \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{\protect\cmd{\cntmAInfosetO}: oval version} +\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. +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 |\istrootcntmA| and accepts the root of the continuum as the mandatory argument. |\cntmAInfosetO| can control the style of the information set and height (or thickness), but it does not have an option for the owner of an information set. -\xbigskip1 -\begin{tcblisting}{listing only} + +\begin{docstx} % syntax: \cntmAInfosetO \cntmAInfosetO[<line opt>](<cntm root>) - <plot factor>{<addto cntmApos>}[<turn X-ang>](<infoset height>) + <plot factor>{<add-to cntmApos>}[<turn X-ang>](<infoset height>) % defaults: (<cntm root>) is mandatory - [](<m>)<1.333>{.1}[0](1em) -\end{tcblisting} -\xbigskip1 + [-,samples=500,tension=1,infoset style](<m>)<1.333>{.1}[0](1em) +\end{docstx} + -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} +% \cntmAinfosetO \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} +\end{doccode} + -\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}. +You can also change its position and curvature via |\cntmApreset|. -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} +% \cntmAInfosetO and \cntmApreset<plot factor> \begin{istgame}[scale=1.2] \cntmdistance*{10mm}{20mm} \istrootcntmA(0) \istbA \endist @@ -4890,13 +4889,13 @@ You can also change its position and curvature via \cmd{\cntmApreset}. \istrootcntmA(2)(1-1) \istbA \endist \cntmAInfosetO[fill=blue!20](2) \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} + 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{doccode}{.25} \begin{istgame}[scale=.8] \setistgrowdirection'{east} \cntmdistance*{10mm}{20mm} @@ -4909,25 +4908,25 @@ Note also that the height (or thickness) of information set are not affected by \istrootcntmA(2)(1-1) \istbA \endist \cntmAInfosetO[fill=blue!20](2) \end{istgame} -\end{tcblisting} +\end{doccode} + -\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} +\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. +In the case of a severely asymmetrical \TikZ\ scale (using |xscale| and |yscale| asymmetrically), an information set drawn by |\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 |\cntmAInfosetO| can solve this problem by turning the \emph{blue circle} (called, an |X| circle) drawn at the beginning point of the information set. +To do that, specify an appropriate degree of rotation in brackets, like |\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{doccode}{.25} +% \cntmAInfosetO: fine-tuning \begin{istgame}[xscale=4] \cntmdistance*{15mm}{10mm} \cntmApreset<1.8> @@ -4938,51 +4937,62 @@ To do that, specify an appropriate degree of rotation in brackets, like \cmd{\cn \istrootcntmA(2)(1-1) \istbA \endist \cntmAInfosetO(2)[60] \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection*{scaling \cmd{\cntmAInfosetO} according to \TikZ\ scales} +\subsubsection*{scaling \protect\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. +The height (or thickness) of an information set drawn by |\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. +\remark +\begin{itemize} +\item +As discussed in Section~\ref{ssec:scaleissue}, the \env{istgame} environment treats, for example, |[scale=.7]| and |[scale=.7,xscale=1]| as different, while the \env{tikzpicture} environment treats them as equal. +\item +With the package \pkg{istgame}, if you use |[scale=.7,xscale=1]| then the value of |scale| is not used to keep the height of an oval type information set unchanged, so that you can scale the information set accordingly. +\end{itemize} -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} +% \cntmAInfosetO: scaling \begin{istgame}[scale=.7,xscale=1] -\istrootcntmA(0) \istbA \endist +\istrootcntmA(0) + \istbA + \endist \cntmAInfosetO[fill=blue!20](0) \xtdistance{10mm}{20mm} -\istroot(1)(0-1) \istb \istb \endist +\istroot(1)(0-1) + \istb + \istb + \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsection{Transition from obsolete macros \protect\cmd{\istcntm} and \protect\cmd{\istcntmarc}} +\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. +It turned out to be inconvenient to use the two macros |\istcntm| and |\istcntmarc| to express a continuum of branches because it requires two steps. Use, instead, a one step method (if you use only default settings) that combines the two steps with |\istrootcntm| and |\istrootcntmA|. 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}} +\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}. +The macro |\istcntm| draws only a background triangle for a continuum of branches. +And then you can draw an action taken using |\istroot|. -\begin{tcblisting}{listing only} +\begin{docstx} % \istcntm % syntax: \istcntm[<grow keyval>](<coor1>)(<coor2>)[<fill color>]+<levdist>..<sibdist>+ % defaults: [south]()(0,0)[black!25]+8mm..24mm+ -\end{tcblisting} +\end{docstx} + -%\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. +%Using |\istroot| with |\istcntm| draws a representative branch of a continuum of branches. +%Note, in the following example, that the second branch of |\istroot| is |missing|\index{missing} to express the representative branch among a continuum of branches. Again, |\cntmlevdist| is |8mm| by default. -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \istcntm (obsolete) +\begin{doccode}{.25} +% \istcntm (obsolete) \begin{istgame}[scale=1.2] \istcntm(cntm) \istroot(0)(cntm){I}+8mm..8mm+ @@ -4991,13 +5001,13 @@ And then you can draw an action taken using \cmd{\istroot}. \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 +\end{doccode} + 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{doccode}{.25} +% \istrootcntm (new way) \begin{istgame}[scale=1.2] \istrootcntm(0){I} \istb{x}[r] \istbm \endist @@ -5005,37 +5015,37 @@ The above old way can be switched to the following new way: \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} +\end{doccode} %%%\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+}. +%%%You can change the height (or the level distance) and the base (or the sibling distance) of the background isosceles triangle by specifying them like, for example, \xw{+10mm..20mm+}. %%% -%%%\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +%%%\begin{doccode}{.25} %%%% 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} +%%%\end{doccode} %%% -%%%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}. +%%%Once the distances are type in as options of |\istcntm|, they internally change the default values, which apply only to the corresponding triangle. +%%%For example, |+10mm..20mm+| will result in |\cntmlevdist=10mm| and |\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} +%%%\begin{doccode}{.25} %%%% 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} +%%%\end{doccode} %%% %%%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{doccode}{.25} %%%\begin{istgame} %%%\xtdistance{10mm}{20mm} %%%\istroot(0){1} @@ -5046,26 +5056,26 @@ The above old way can be switched to the following new way: %%%\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} +%%%\end{doccode} -\paragraph{\protect\cmd{\istcntmarc} (arc version)} +\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. +The macro |\istcntmarc| is the arc version, which draws a background arc to represent a continuum of branches. -\begin{tcblisting}{listing only} +\begin{docstx} % \istcntmarc % syntax: \istcntmarc[<grow keyval>](<coor1>)(<coor2>)[<color,opt>]{<num>}+levd..sibd+ % defaults: [south](<m>)(0,0)[bend right]{.5}+8mm..24mm+ -\end{tcblisting} +\end{docstx} %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{doccode}{.25} +% \istcntmarc (obsolete) \begin{istgame}[scale=1.2] \istcntmarc(cntm)[green] \istroot(0)(cntm){I}+8mm..8mm+ @@ -5074,14 +5084,14 @@ The macro \cmd{\istcntmarc} is the arc version, which draws a background arc to \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 +\end{doccode} + 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}. +One difference is that the position of a continuum arc is now |1| by default, while it was |.5|. -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \istrootcntmA (new way) +\begin{doccode}{.25} +% \istrootcntmA (new way) \begin{istgame}[scale=1.2] \cntmApreset<1.44>{.5}[green] \istrootcntmA(0){I} @@ -5090,7 +5100,7 @@ One difference is that the position of a continuum arc is now \xw{1} by default, \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} +\end{doccode} \section{Arrows} @@ -5101,10 +5111,10 @@ One difference is that the position of a continuum arc is now \xw{1} by default, \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{->}. +The simplest way of printing \isw{arrow}s in \emph{a whole game tree} is to use the \Tikz\ option |->| as an option for the \env{istgame} environment. To get the best result, you may want to use |\xtShowEndPoints| together with the option |->|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} + +\begin{doccode}{.25} % Example: arrows \begin{istgame}[->,scale=.8] \istroot(0)+15mm..30mm+ \istb \istb \endist @@ -5113,11 +5123,11 @@ The simplest way of printing \isw{arrow}s in \emph{a whole game tree} is to use \istroot(2)(0-2) \istb \istb \endist \istroot(3)(1-2) \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} -For an arrow on an individual branch, you can use arrow options with each \cmd{\istb}. +For an arrow on an individual branch, you can use arrow options with each |\istb|. -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} % Example: arrows \begin{istgame}[scale=.8] \istroot(0)+15mm..30mm+ \istb[->] \istb \endist @@ -5126,24 +5136,24 @@ For an arrow on an individual branch, you can use arrow options with each \cmd{\ \xtHideEndPoints \istroot(2)(0-2) \istb[-|<>|] \istb[->o>>>o>] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{Fine-tuning with \protect\cmd{\setistgameshorten}: Not for most users} +\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. +like |\setistgameshorten{1.3pt}|, right \emph{before} the \env{istgame} environment. +Note that |\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. +\item Internally, the \env{istgame} environment checks the existence of the option |->| and automatically adds |shorten >=<keyval>| (by default, |0pt|) to the option list as the first entry together with |->|. +\item You can do the same thing, without using this macro, by manually adding, for example, |[->,shorten >=1.3pt]| to the list of options. \end{itemize} -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \setistgameshorten +\begin{doccode}{.25} +% \setistgameshorten \setistgameshorten{1.3pt} % use in a TeX group \begin{istgame}[->,scale=.8] %\xtShowEndPoints @@ -5152,7 +5162,7 @@ Note that \cmd{\setistgameshorten} has a global effect. So, when necessary, you \istroot(2)(0-2) \istb \istb \endist \istroot(3)(1-2) \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} You should also be aware that, in \Tikz, the options \xw{shorten} and \xw{->} affect any lines or curves in the current environment. @@ -5161,18 +5171,18 @@ You should also be aware that, in \Tikz, the options \xw{shorten} and \xw{->} af \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[->-]}. +With |\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 |\istb[->-]|. -\subsubsection{A middle arrow for each \protect\cmd{\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. +To print an arrow tip in the middle of a branch, you can use |->-| as an option for |\istb|. +The \emph{controllable} middle arrow style |->-| takes one optional value, which is a number between 0 and 1 (by default |->-=.55|) determining a relative position from a parent node to a child node, where the end of an arrow tip is placed. +For example, |\istb[->-=0.1]| prints an arrow tip near the parent node, and |\istb[->-=0.9]| near the child node. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: new style: middle arrow tip + +\begin{doccode}{.25} +% middle arrow tip styles \begin{istgame}[scale=.8] \istroot(0)+15mm..30mm+ \istb[->-] \istb[->-] \endist @@ -5183,16 +5193,16 @@ For example, \xw{\istb[->-=0.1]} prints an arrow tip near the parent node, and \ \istroot(3)(1-2) \istb \istb[->-=1] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\xbigskip1 -\remark issues on middle arrows with \cmd{\istB}: + +\remark issues on middle arrows with |\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}). +\item Middle arrows work well with |\istb|, but the exact position of a middle arrow tip does NOT work very well with |\istB|. +\item So, if you want to print dual action labels for branches with middle arrows, it is recommended to use |\istb| together with |\xtActionLabel|, instead of |\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{->-}. +Except for |\istB|, all the other variants of |\istb| including |\istbA|, |\cntmistb|, and |\cntmAistb| work well with the middle arrow option |->-|. \subsubsection{Middle arrow tip styles} @@ -5201,22 +5211,23 @@ Except for \cmd{\istB}, all the other variants of \cmd{\istb} including \cmd{\is 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}: + +Additional \ixw{middle arrow tip style}|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} +\item \ixttw{->>-} : \ixw{double arrow tip} in the middle of a branch at the position of |.6| +\item \ixttw{->>>-} : \ixw{triple arrow tip} in the middle of a branch at the position of |.65| +\item \ixttw{-o-} : \ixw{circle arrow tip} in the middle of a branch at the position of |.55| +\item \ixttw{-x-} : \ixw{cross arrow tip} in the middle of a branch at the position of |.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 +Their color can be changed by |\setxtarrowtips| (see the following Section~\ref{ssec:setxtarrowtips}). -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} + +\begin{doccode}{.25} +% Example: middle arrow tips \begin{istgame}[xscale=.8] \istroot(0)+15mm..30mm+ \istb[->>-] \istb[->>>-,red] \endist @@ -5226,107 +5237,117 @@ Their color can be changed by \cmd{\setxtarrowtips} (see the following Section~\ \istroot(2)(0-2) \istb[-o-] \istb[-x-] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{\protect\cmd{\setxtarrowtips}: controlling middle arrow tips via \xw{->-}} +\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. +but only works through the \emph{controllable} middle arrow style |->-|, 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 |\setxtarrowtips| followed by nothing. -\xbigskip1 -\begin{tcblisting}{listing only} + +\begin{docstx} % \setxtarrowtips % syntax: all arguments are optional - \setxtarrowtips<midarrow tip pos>{<arrow shape>}[<arrow opt>] + \setxtarrowtips<midarrow tip pos>{<arrow tip shape>}[<arrow opt>] % defaults: <.55>{>}[black,-,thin,solid,shorten >=0pt] -\end{tcblisting} -%\xbigskip1 +\end{docstx} + -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \setxtarrowtips +\begin{doccode}{.25} +% \setxtarrowtips \begin{istgame}[scale=1] -\setxtarrowtips<.9>{>>}[blue,thick] +\setxtarrowtips<.7>{Bar}[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] +\setxtarrowtips<.8>{Rays}[red,thick] \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 +\istroot(3)(1-2) + \istb \istb[->>-] \endist +\istroot(4)(2-2) + \istb[-o-] \istb[-x-] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -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>}. +Note that, as seen in the example above, the position set individually by an option value of |\istb|, like |\istb[->-=.3]|, +wins the position set by |\setxtarrowtips<.9>|. -\subsection{Middle arrow for simple tress} +\subsection{Middle arrows for simple trees} -\subsubsection{\protect\cmd{\xtShowMidArrows} and \protect\cmd{\xtHideMidArrows}} +\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}. +The effect of |\xtShowMidArrows| continues until it is changed by another |\xtShowMidArrows| or blocked by \icmd{\xtHideMidArrows}. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} + +\begin{doccode}{.25} % Example: \xtShowMidArrows, \xtHideMidArrows \begin{istgame} \xtShowMidArrows -\istroot(0)+15mm..30mm+ \istb[blue] \istb[red] \endist +\istroot(0)+15mm..30mm+ + \istb[blue] \istb[red] \endist \xtHideMidArrows -\istroot(1)(0-1) \istb \istb \endist -\istroot(2)(0-2) \istb \istb \endist +\istroot(1)(0-1) + \istb \istb \endist +\istroot(2)(0-2) + \istb \istb \endist \xtShowMidArrows -\istroot(3)(1-2) \istb \istb \endist +\istroot(3)(1-2) + \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} + -\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}. +\begin{itemize} +\item |\xtShowMidArrows| works for all branches of simple trees. +\item The middle arrow option styles work separately only for |\istb|'s having them and |\setxtarrowtips| works only for |\istb|'s having the option |->-|. +\item Since the middle arrow tip styles and |\xtShowMidArrows| work completely independently, if you use both of them, they are all printed. +\item Note also that |\xtHideMidArrows| removes only the effect of |\xtShowMidArrows|. \end{itemize} -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} % Example: \xtShowMidArrows, \xtHideMidArrows \begin{istgame} -\setxtarrowtips<.3>{*}[red] +\setxtarrowtips<.3>{Rays[n=2,sep]Rays[n=2]}[red,thick] \xtShowMidArrows -\istroot(0)+15mm..30mm+ \istb[blue] \istb[red] \endist +\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 +\istroot(1)(0-1) + \istb[->-] \istb[-o-] \endist +\istroot(2)(0-2) + \istb \istb \endist \xtShowMidArrows -\istroot(3)(1-2) \istb[->-] \istb[-o-] \endist +\istroot(3)(1-2) + \istb[->-] \istb[-o-] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{\protect\cmd{\setxtshowmidarrows}: controlling \protect\cmd{\xtShowMidArrows}} +\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}. +you can control the position, color, style, and shape of middle arrow tips, to be drawn by |\xtShowMidArrows|. -\xbigskip1 -\begin{tcblisting}{listing only} + +\begin{docstx} % \setxtshowmidarrows % syntax: - \setxtshomidwarrows<midarrow tip relative pos>{<arrow shape>}[<arrow opt>] + \setxtshowmidarrows<midarrow tip relative pos>{<arrow shape>}[<arrow opt>] % defaults: <.55>{>}[black] -\end{tcblisting} +\end{docstx} -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \setxtshowmidarrows +\begin{doccode}{.25} +% \setxtshowmidarrows \begin{istgame} \xtShowMidArrows \istroot(0)+15mm..30mm+ @@ -5344,125 +5365,140 @@ you can control the position, color, style, and shape of middle arrow tips, to b \coordinate (B) at ([yshift=-5pt]2-2); \draw [|-|] (A) -- (B); \end{istgame} -\end{tcblisting} +\end{doccode} + -\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. +\item As you can see in the above example, when |\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 |\draw [transform canvas={yshift=-5pt}] (2-1) -- (2-2);| (See \TikZ\ manual about \xw{transform canvas}). +\item |\xtShowArrows| does not affect the \Tikz\ absolute coordinates. \end{itemize} \subsection{Arrows for simple trees} -\subsubsection{\protect\cmd{\xtShowArrows} and \protect\cmd{\xtHideArrows}} +\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. +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 |\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). +\icmd{\xtShowArrows}, internally, calls |\xtShowEndPoints| (with |solid node|, by default) first and then prints arrows in order to produce the best result of showing arrows. +Therefore, for example, |\xtShowArrows[oval node]| is equivalent to |\xtShowEndPoints[oval node]| followed by printing 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.) +The macro \icmd{\xtHideArrows} turns off all the effect of |\xtShowArrows|, while \icmd{\xtHideArrows*} has the endpoints remained. (|\xtShowArrows| does not have its starred version.) -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \xtShowArrows, \xtHideArrows + +\begin{doccode}{.25} +% \xtShowArrows and \xtHideArrows \begin{istgame} \xtShowArrows -\istroot(0)+15mm..30mm+ \istb[blue] \istb[red] \endist +\istroot(0)+15mm..30mm+ + \istb[blue] \istb[red] \endist \xtHideArrows -\istroot(1)(0-1) \istb{a} \istb \endist +\istroot(1)(0-1) + \istb{a} \istb \endist \xtHideArrows* % endpoints remain -\istroot(2)(0-2) \istb{b} \istb \endist +\istroot(2)(0-2) + \istb{b} \istb \endist \xtShowArrows[oval node] -\istroot(3)(1-2) \istb{c} \istb \endist +\istroot(3)(1-2) + \istb{c} \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} + -\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}. +\item Like |\xtShowMidArrows|, when |\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}} +\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)}. +You can even change the position of arrow tips by specifying the distance (|1.2pt| by default) from the endpoint as the last parenthesis optional argument, like \xw{(5pt)}. -\xbigskip1 -\begin{tcblisting}{listing only} + +\begin{docstx} % \setxtshowarrows % syntax: - \setxtshowarrows[<arrow opt>]{<arrow shape>}(<arrow end shorten dim>) -% defaults: []{>}(1.2pt) -\end{tcblisting} -\xbigskip1 + \setxtshowarrows{<arrow shape>}[<arrow opt>](<arrow end shorten dim>) +% defaults: {>}[](1.2pt) +\end{docstx} + -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} -% Example: \xtShowArrows, \xtHideArrows +\begin{doccode}{.25} +% \setxtshowarrows (with \xtShowArrows and \xtHideArrows) \begin{istgame} -\setxtshowarrows{<|o|>}[blue,thick](5pt) +\setxtshowarrows{Stealth[open]}[blue](5pt) \xtShowArrows -\istroot(0)+15mm..30mm+ \istb[blue] \istb[red] \endist +\istroot(0)+15mm..30mm+ + \istb[blue] \istb[red] \endist \xtHideArrows -\istroot(1)(0-1) \istb{a} \istb \endist +\istroot(1)(0-1) + \istb{a} \istb \endist \xtHideArrows* % endpoints remain -\istroot(2)(0-2) \istb{b} \istb \endist +\istroot(2)(0-2) + \istb{b} \istb \endist \xtShowArrows[oval node] -\istroot(3)(1-2) \istb{c} \istb \endist +\istroot(3)(1-2) + \istb{c} \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} \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{doccode}{.25} +% Example: cntm and arrows \begin{istgame}[font=\scriptsize] \xtdistance{10mm}{20mm} \xtShowArrows -\istrootcntm(0)(0,0){1} \istb{x}[r] \istbm \endist +\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 +\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} +\end{doccode} + -\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}. +To do that, you can use |\cntmistb(*)| and |\cntmAistb(*)| together with the middle arrow tip styles and |\setxtarrowtips|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} + +\begin{doccode}{.25} +% Example: cntm, \setxtarrowtips \begin{istgame}[font=\scriptsize] \xtdistance{10mm}{20mm} \xtShowArrows \setxtarrowtips<.97> \cntmistb*[->-,draw] -\istrootcntm(0)(0,0){1} \istb{x}[r] \istbm \endist +\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 +\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} +\end{doccode} + -\xbigskip1 Here is one more example. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} + +\begin{doccode}{.25} +% Example: cntmA, \setxtarrowtips \begin{istgame} \cntmdistance*{8mm}{16mm} \xtShowArrows @@ -5482,15 +5518,13 @@ Here is one more example. \istrootcntmA(4)(A3-2) \istbA[-o-] \endist \istroot(A4)(4-1) \istb \istb \endist \end{istgame} -\end{tcblisting} +\end{doccode} \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. @@ -5498,54 +5532,58 @@ The \pkg{istgame} package also provides some supplementary macros to important l \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{\xtOwner}* puts an owner in the input mode as set by |\setistmathTF(*)|\par + syntax: |\xtOwner(<coor>){<owner>}[<pos>,<node opt>]|\par + defaults: |(<m>){}[above]|\par + (abbreviations for |<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{\xtActionLabel*} puts an owner in the input mode as set by |\setistmathTF(*)|\par + syntax: |\xtActionLabel[<opt>](<from>)(<to>){<action>}[<pos>,<node opt>]|\par + defaults: |[-,draw=none](<m>)(<m>){}[black,text depth=.25ex]|\par + (abbreviations for |<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{\xtPayoff*} puts payoffs in the input mode as set by |\setistmathTF(*)|\par + syntax: |\xtPayoff(<coor>){<payoff>}[<pos>,<node opt>]|\par + defaults: |(<m>){}[below,inner sep=0pt,outer sep=4pt,text depth=.25ex]|\par + (abbreviations for |<pos>| available) +% (corrected) below added (2019/11/19) +% remark: position of xtPayoff is not automatized, because "south" cannot be used for node position. + \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{\xtInfosetOwner*} puts an information set owner in the input mode as set by |\setistmathTF(*)|\par + syntax: |\xtInfosetOwner(<from>)(<to>){<owner>}[<pos>,<node opt>]|\par + defaults: |(<m>)(<m>){}[]|\par + (abbreviations for |<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,' say, an owner into a node\par + syntax: |\xtNode[<opt>](<coor>)[<node style>,<node opt>]{<node text>}|\par + defaults: |[-](<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]{}+ + syntax: |\xtNode*(<coor>)[<node style>,<node opt>]{<node text>}|\par + defaults: |(<m>)[plain node]{}| \end{description} -%\xbigskip1 + The supplementary macros depend on the coordinates defined -in the sequence of \cmd{\istroot}--\cmd{\istb}--\cmd{\endist} +in the sequence of |\istroot|--|\istb|--|\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>}. +So, in the above supplementary macros, all the coordinates such as |(<from>)|, |(<to>)|, +and |(<coor>)| are mandatory arguments, denoted by |<m>|. -\xbigskip1 -\begin{tcblisting}{} -\begin{istgame}[scale=1.5] + +\begin{doccode}[listing above text] +% Example: various supplement macros +\begin{istgame}[scale=3] \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} +\xtInfosetO[thick,red,rounded corners=1em](0-2)(0-3){2}(2em) \xtInfoset[dashed,bend right=25](0-1)(0-3) %----------------- \xtActionLabel(0)(0-3){1-\epsilon}[below,sloped] % action label in math mode @@ -5557,41 +5595,41 @@ and \xw{(<coor>)} are mandatory arguments, denoted by \xw{<m>}. \istroot[east](a)(0)[chance node] \istb \endist \xtNode*(a-1){text} \end{istgame} -\end{tcblisting} +\end{doccode} -To specify the \xw{[<pos>]} option for the above supplementary macros (other than \cmd{\xtNode}), +To specify the |[<pos>]| option for the above supplementary macros (other than |\xtNode|), you can use the \isw{abbreviations} -\xw{[l]}, \xw{[r]}, \xw{[a]}, \xw{[b]}, \xw{[al]}, \xw{[ar]}, \xw{[bl]}, and \xw{[br]}. +|[l]|, |[r]|, |[a]|, |[b]|, |[al]|, |[ar]|, |[bl]|, and |[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. +For example, the option |[b]| or |[below]| or |[below,xshift=5pt]| works, but |[b,xshift=5pt]| does not, producing a compile error. \subsection{More supplementary macros} -\subsubsection{\protect\cmd{\xtTimeLineH} and \protect\cmd{\xtTimeLineV}} +\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} + +\begin{docstx} % \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} +\end{docstx} -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]}. +For example, |\xtTimeLineH(coor){-1.5}{3}| draws a dotted (by default) horizontal time-line going through |(coor)| from |-1.5cm| to |3cm| with a label on the |right| (by default). +Recall that, by default, the root of a tree is located at |(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 |[a]| or |[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}. +The swap version \icmd{\xtTimeLineH'} simply puts the label on the other end of a time-line, |left| by default. +That's the only difference from the normal version, |\xtTimeLineH|. -%\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable} -% Example: \xtTimeLineH('): not swapped + +\begin{doccode}{.4} +% \xtTimeLineH('): tree not swapped \begin{istgame}[font=\scriptsize] \setistgrowdirection{south} % default \xtdistance{10mm}{20mm} @@ -5605,23 +5643,23 @@ That's the only difference to the normal version, \cmd{\xtTimeLineH}. \xtTimeLineH(2){-1.5}{3}{period 2} \xtTimeLineH'(3){-1.5}{3}{period 3} \end{istgame} -\end{tcblisting} +\end{doccode} + -\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}. +\item If branches are arranged |counterclockwise| (by default), a time-line goes \emph{from left to right} or \emph{from below to above}. As to |\xtTimeLineH|, we take this as a standard case: \emph{left to right}. +\item If a tree is \emph{swapped}, so the branches are arranged |clockwise|, |\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'}, for example, |\xtTimeLineH(coor){-1.5}{3}| draws a time-line going the to the opposite direction: from |1.5cm| to |-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{doccode}{.4} +% \xtTimeLineH('): tree swapped \begin{istgame}[font=\scriptsize] \setistgrowdirection'{south} % clockwise \xtdistance{10mm}{20mm} @@ -5635,19 +5673,19 @@ The following codes are the same as the above, except that the tree is swapped. \xtTimeLineH(2){-1.5}{3}{period 2} \xtTimeLineH'(3){-1.5}{3}{period 3} \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} + 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}. +As to |\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 |\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}. +That's the only difference to the normal version, |\xtTimeLineV|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable} -% Example: \xtTimeLineV('): swapped + +\begin{doccode}{.4} +% \xtTimeLineV('): tree swapped \begin{istgame}[font=\scriptsize] \setistgrowdirection'{east} % clockwise \xtdistance{10mm}{20mm} @@ -5661,11 +5699,12 @@ That's the only difference to the normal version, \cmd{\xtTimeLineV}. \xtTimeLineV(2){1.5}{-3}{period 2} \xtTimeLineV'(3){1.5}{-3}{period 3} \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} + 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{doccode}{.4} +% \xtTimeLineV('): tree not swapped \begin{istgame}[font=\scriptsize] \setistgrowdirection{east} % counterclockwise \xtdistance{10mm}{20mm} @@ -5679,14 +5718,14 @@ The following codes are the same as the above, except that the tree is \emph{not \xtTimeLineV(2){1.5}{-3}{period 2} \xtTimeLineV'(3){1.5}{-3}{period 3} \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} + -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}. +In the example above, since the tree is not swapped, |\xtTimeLineV(coor){1.5}{-3}| draws a vertical time-line going to the opposite direction: from |-1.5cm| to |3cm|. -%Here is one more example of using \cmd{\xtTimeLineH}. +%Here is one more example of using |\xtTimeLineH|. % -%\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable} +%\begin{doccode}{.4} %% Example: \xtTimeLineH %\begin{istgame}[font=\scriptsize] %\xtShowMidArrows @@ -5716,31 +5755,31 @@ In the example above, since the tree is not swapped, \verb+\xtTimeLineV(coor){1. % {$\left(\makecell{\delta^2\\\delta^2} % \right)\cdots$}[yshift=-.8em] %\end{istgame} -%\end{tcblisting} -%\xbigskip1 +%\end{doccode} -\subsubsection{\protect\cmd{\xtCommentTo} and \protect\cmd{\xtCommentFrom}} + +\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. +Note that with |\xtCommentTo| you need to specify a \emph{target absolute} coordinate followed by a \emph{start \textbf{relative}} coordinate. + -%\xbigskip1 -\begin{tcblisting}{listing only} +\begin{docstx} % \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 +\end{docstx} + 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{doccode}{.3} +% \xtCommentTo \begin{istgame}[->,scale=.7] \xtShowEndPoints \istroot(0)+15mm..30mm+ \istb \istb \endist @@ -5750,34 +5789,31 @@ You can use the abbreviations of the directional words, but not with other optio \xtCommentTo[bend right](1)(150:2){Ben moves} \xtCommentTo[bend left](2)(0,2){Nature moves}[a](5pt) \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} + 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. +Note that with |\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} + +\begin{docstx} % \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} +\end{docstx} -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth} -% Example: \xtCommentFrom +\begin{doccode}{.3} +% \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 +\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) @@ -5787,36 +5823,36 @@ You can use the abbreviations of the directional words. \xtCommentFrom[bend right](-3,-5)(2-1) \xtCommentFrom[bend right](-3,-5)(2-2)(5pt) \end{istgame} -\end{tcblisting} +\end{doccode} %\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}. +%\icmd{\xtHideEndPoints} turns off the effect of |\xtShowEndPoints|. % -%\begin{tcblisting}{listing only} +%\begin{docstx} %syntax: \xtShowEndPoints[<node style>] %syntax: \xtHideEndPoints -%\end{tcblisting} +%\end{docstx} % % -%The macro \icmd{\xtShowTerminalNodes} works only with \cmd{\istbt}\@ and \cmd{\istBt} to control the node shape of terminal nodes, all at once. +%The macro \icmd{\xtShowTerminalNodes} works only with |\istbt|\@ and |\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}. +%\icmd{\xtHideTerminalNodes} turns off the effect of |\xtShowTerminalNodes|. % -%\begin{tcblisting}{listing only} +%\begin{docstx} %syntax: \xtShowTerminalNodes[<node style>] % work only with \istbt and \istBt %syntax: \xtHideTerminalNodes -%\end{tcblisting} +%\end{docstx} \section{Representing subgames} Here is an example of a whole game tree. -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth,breakable} +\begin{doccode}{.3} \begin{istgame} \xtdistance{15mm}{30mm} \istroot[-135](0)[initial node]<0>{1} @@ -5829,15 +5865,15 @@ Here is an example of a whole game tree. \istroot(3)(1-2)<45>{2} \istb{\ell}[al]{(3,2)} \istb{r}[ar]{(0,3)} \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\subsection{\protect\cmd{\xtSubgameBox} (experimental)} +\subsection{\protect\CMD{\xtSubgameBox} (experimental)} -\subsubsection{\protect\cmd{\xtSubgameBox}} +\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} +\begin{docstx} % \xtSubgameBox(*) % syntax: \xtSubgame(*)(<subroot coor>){(<coor1>) (<coor2>) ... }[<opt>] @@ -5849,19 +5885,19 @@ Here is an example of a whole game tree. % defaults: (<m>){}[rectangle,dashed,inner sep=20pt,rounded corners=15pt,black!50] *(<m>){}[rectangle,inner sep=20pt,rounded corners=15pt,red!20] -\end{tcblisting} +\end{docstx} + -\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}. +The default options for the subgame box are |dashed|, |inner sep=20pt|, |rounded corners=15pt|, and |black!50|. -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth,breakable} -% subgame: rectangle + +\begin{doccode}{.3} +% \xtSubgameBox \begin{istgame} \xtdistance{15mm}{30mm} -\istroot[-135](0)[initial node]<0>{1} +\istroot[-135](0)[initial node]<center>{1} \istb{A}[a]{(2,2)}[l] \istb{D}[r] \endist \istroot(1)(0-2)<135>{1} \istb{L}[al] \istb{R}[ar] \endist @@ -5873,20 +5909,19 @@ The default options for the subgame box are \xw{dashed}, \xw{inner sep=20pt}, \x \xtSubgameBox(1){(2-1)(3-2)} \xtSubgameBox(2){(2-1)(2-2)}[solid,blue] \end{istgame} -\end{tcblisting} +\end{doccode} 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)}. +First, you can change it by using |inner sep|, |inner xsep|, or |inner ysep|. Secondly, you can shift the subroot, like |([xshift=5pt]1)| when the subroot is |(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{doccode}{.3} \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 +\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 @@ -5896,23 +5931,22 @@ Of course, you can do the both at the same time. \xtSubgameBox([yshift=5pt]2){(2-1)(2-2)}% [solid,blue,inner sep=10pt] \end{istgame} -\end{tcblisting} +\end{doccode} -\subsubsection{\protect\cmd{\xtSubgameBox*}} +\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}. +The starred version \icmd{\xtSubgameBox*} produces a subgame box with background color (by default |red!20|). +In the following example, where the tree grows east, the size of the filled subgame box is adjusted by manipulating |inner sep| and |xshift|. -\begin{tcblisting}{listing outside text, righthand width=.3\linewidth,breakable} -% subgame: rectangle* +\begin{doccode}{.3} +% \xtSubgameBox* \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 +\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 @@ -5921,14 +5955,14 @@ In the following example, where the tree grows east, the size of the filled subg \xtSubgameBox*([xshift=20pt]1){(2-1)(3-2)}% [inner xsep=30pt] \end{istgame} -\end{tcblisting} +\end{doccode} -\subsection{\protect\cmd{\xtSubgameOval} and \protect\cmd{\xtSubgameOval*} (experimental)} +\subsection{\protect\CMD{\xtSubgameOval} and \protect\CMD{\xtSubgameOval*} (experimental)} \icmd{\xtSubgameOval} and \icmd{\xtSubgameOval*} are also provided. -\begin{tcblisting}{listing only} +\begin{docstx} % \xtSubgameOval(*) % syntax: \xtSubgameOval(*)(<subroot coor>){(<coor1>) (<coor2>) ... }[<opt>] @@ -5940,10 +5974,10 @@ In the following example, where the tree grows east, the size of the filled subg % defaults: (<m>){}[ellipse,dashed,inner sep=20pt,rounded corners=15pt,black!50] *(<m>){}[ellipse,inner sep=20pt,rounded corners=15pt,red!20] -\end{tcblisting} +\end{docstx} -%\begin{tcblisting}{listing only} +%\begin{docstx} %% \xtSubgameOval(*) %% syntax: % \xtSubgame(*)(<subroot coor>){(<coor1>) (<coor2>) ... }[<opt>] @@ -5966,14 +6000,14 @@ In the following example, where the tree grows east, the size of the filled subg % \end{scope} % } %} -%\end{tcblisting} +%\end{docstx} -\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. +|\xtSubgameOval(*)| works just like |\xtSubgameBox(*)|, except for one thing: an oval instead of a rectangle. +|\xtSubgameOval| draws an oval (or an ellipse) to represent a subgame, and |\xtSubgameOval*| draws a filled oval with |red!20| by default. -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable} -% subgame: ellipse +\begin{doccode}{.4} +% \xtSubgameOval \begin{istgame} \xtdistance{15mm}{30mm} \istroot[-135](0)[initial node]<0>{1} @@ -5996,14 +6030,14 @@ In the following example, where the tree grows east, the size of the filled subg \xtSubgameOval(1){(2-1)(3-2)} \xtSubgameOval(2){(2-1)(2-2)} \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} + -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}. +The way of changing the size of the subgame oval is the same as with |\xtSubgameBox|: first, changing inner sep, and secondly, shifting the subroot. +In the example below, the options |inner xsep=25pt| and |([xshift=30pt]1)| are used to change the size of the subgame oval. Its color is changed by |blue!20|. -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable} -% subgame: ellipse* +\begin{doccode}{.4} +% \xtSubgameOval* \begin{istgame} \setistgrowdirection'{east} \xtdistance{15mm}{30mm} @@ -6027,13 +6061,13 @@ In the example below, the options \xw{inner xsep=25pt} and \xw{([xshift=30pt]1)} \xtSubgameOval*([xshift=30pt]1){(2-1)(3-2)}% [inner xsep=25pt,blue!20] \end{istgame} -\end{tcblisting} +\end{doccode} -\subsection{\protect\cmd{\setxtsubgamelayer}} +\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. +You can change the shape of a subgame representation to other shapes such as |semicircle| and |circle| or even |star|. You will need to change the size of the shape by using |inner sep| and by shifting the subroot to get the result you want. -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable} +\begin{doccode}{.4} % subgame: half circle \begin{istgame} \xtdistance{15mm}{30mm} @@ -6055,10 +6089,10 @@ You can change the shape of a subgame representation to other shapes such as \xw \xtSubgameBox([yshift=-2cm]1){(2-1)(3-2)}% [semicircle,inner sep=15pt] \end{istgame} -\end{tcblisting} +\end{doccode} -%\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable} +%\begin{doccode}{.4} %% subgame: half circle* %\begin{istgame} %\setistgrowdirection'{east} @@ -6083,12 +6117,12 @@ You can change the shape of a subgame representation to other shapes such as \xw %\xtSubgameBox*([xshift=2cm]1){(2-1)(3-2)}% % [semicircle,rotate=90,inner sep=0pt] %\end{istgame} -%\end{tcblisting} +%\end{doccode} 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{doccode}{.4} +% subgame: circle \begin{istgame} \xtdistance{15mm}{30mm} \istroot[-135](0)[initial node]<0>{1} @@ -6112,13 +6146,13 @@ Here are more examples showing how to draw a rectangle and circles to represent \xtSubgameOval(3){(3-1)(3-2)}% [circle,inner xsep=9pt] \end{istgame} -\end{tcblisting} +\end{doccode} -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\{\}}. +You can use \icmd{\setxtsubgamelayer} to change the \isw{layer} of a subgame from |background| to |behind|, |main|, |above|, or |foreground|, in that order. In order to go back to the default layer, you can just declare |\setxtsubgamelayer| or do |\setxtsubgamelayer{}|. -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable} -% subgame: \setxtsubgamelayer +\begin{doccode}{.4} +% \setxtsubgamelayer \begin{istgame} \xtdistance{15mm}{30mm} \istroot[-135](0)[initial node]<0>{1} @@ -6144,7 +6178,7 @@ You can use \icmd{\setxtsubgamelayer} to change the \isw{layer} of a subgame fro \xtSubgameOval(3){(3-1)(3-2)}% [circle,inner xsep=9pt] \end{istgame} -\end{tcblisting} +\end{doccode} \section{Miscellany} @@ -6152,10 +6186,11 @@ You can use \icmd{\setxtsubgamelayer} to change the \isw{layer} of a subgame fro \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} +You can do this using |\istbA| (see Section~\ref{sec:istbA}, for more details). + +\begin{doccode}[listing above text] +% various branches +\begin{istgame}[scale=1.3] \istroot(0)[chance node]<[blue]>{N}+10mm..30mm+ \istb[->,shorten >=.8pt]{p}[above left,red] \istb[->,shorten >=.8pt]{1-p}[ar] \endist @@ -6167,7 +6202,7 @@ You can do this using \cmd{\istbA} (see Section~\ref{sec:istbA}, for more detail \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} +\end{doccode} \subsection{Code reuse} @@ -6176,7 +6211,7 @@ You can do this using \cmd{\istbA} (see Section~\ref{sec:istbA}, for more detail Suppose that you have the following tree as a whole game. -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable} +\begin{doccode}{.4} % Example: a whole game \begin{istgame} \xtdistance{15mm}{30mm} @@ -6198,12 +6233,12 @@ Suppose that you have the following tree as a whole game. \istb{r}[ar]{(0,3)} \endist \end{istgame} -\end{tcblisting} +\end{doccode} 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} +\begin{doccode}{.4} % Example: a subgame \begin{istgame} \xtdistance{15mm}{30mm} @@ -6225,27 +6260,27 @@ To get a subgame, just comment out the codes for the rest of the subgame. \istb{r}[ar]{(0,3)} \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\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.+ +\remark If you copy and paste the previous codes alone and try to compile to get a subgame, you will get an error message: + +|! 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: +This is because the first active |\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}+ +|\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} +\begin{doccode}{.4} % Example: a smaller subgame \begin{istgame} %\xtdistance{15mm}{30mm} @@ -6267,15 +6302,15 @@ A smaller subgame is also easy to get by commenting out the rest of the subgame % \istb{r}[ar]{(0,3)} %\endist \end{istgame} -\end{tcblisting} +\end{doccode} + -\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.) +(Replace |[black!5]| by |[white]| to make the rest of the game disappear in the example below.) -\xbigskip1 -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable} + +\begin{doccode}{.4} % Example: a subgame stays put \begin{istgame} \setistDecisionNodeStyle[black!5] @@ -6300,16 +6335,16 @@ It is not possible to make a subgame stay put where it appears in a whole game. \istb[black!5]%{r}[ar]{(0,3)} \endist \end{istgame} -\end{tcblisting} +\end{doccode} \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{doccode}{.4} \begin{istgame}[>=stealth] \xtdistance{15mm}{30mm} \istroot[-135](0)[initial node]<0>{1} @@ -6330,15 +6365,15 @@ It is also easy to illustrate the procedure of \isw{backward induction}, when yo \istb[very thick,blue]{r}[ar]{(0,3)} \endist \end{istgame} -\end{tcblisting} -\xbigskip1 +\end{doccode} -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. + +By using |\istb| with options for the middle arrow tips, you can effectively express the backward induction procedure. +The command |\setxtarrowtips| controls the style of arrow tips and just declaring |\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} + +\begin{doccode}{.4} % Example: backward induction \begin{istgame} \setxtarrowtips[red,very thick,shorten >=-2pt,shorten <=-2pt] @@ -6362,7 +6397,7 @@ change the color and the style of a line representing a branch and an arrow tip \istb[->-,draw=blue]{r}[ar]{(0,3)} \endist \end{istgame} -\end{tcblisting} +\end{doccode} %\clearpage @@ -6370,7 +6405,7 @@ change the color and the style of a line representing a branch and an arrow tip Chen(2013)'s work is good to understand how drawing a game tree with \TikZ\ works. -\begin{tcblisting}{listing above text} +\begin{doccode}[listing above text] % Chen (2013) \begin{tikzpicture}[scale=1,font=\footnotesize] \tikzstyle{solid node}=[circle,draw,inner sep=1.5,fill=black] @@ -6391,50 +6426,47 @@ 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} +\end{doccode} + -%\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} +\begin{doccode}{.4} % istgame \begin{istgame}[scale=1,font=\footnotesize] \setistDecisionNodeStyle{4pt} \xtdistance{15mm}{3.5cm} \istroot(0){$P1$} \istb{A}[al] - \istb{B}[ar] - \endist + \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 + \istb{E}[r]{(0,2)} \endist \istroot(2)(0-2)<45>{$P2$} \istb{F}[l]{(2,2)} - \istb{G}[r]{(1,3)} - \endist + \istb{G}[r]{(1,3)} \endist \end{istgame} -\end{tcblisting} +\end{doccode} 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{|\cmd{\footnotesize}|}| outside of the environment. (Right here!) \setistgamefontsize{\footnotesize} \subsection{Simple examples} -\begin{tcblisting}{listing outside text, righthand width=.35\linewidth,breakable} +\begin{doccode}{.35} \begin{istgame}[->,shorten >=1.3pt] \setistmathTF*001 \xtdistance{15mm}{30mm} @@ -6447,11 +6479,11 @@ Before we start, let us change the default font size of the \env{istgame} enviro \istb{Punish}[above right]{(-1,-1)} \endist \end{istgame} -\end{tcblisting} +\end{doccode} \medskip -%\begin{tcblisting}{listing outside text, righthand width=.35\linewidth,breakable} +%\begin{doccode}{.35} %% sloped action labels %\begin{istgame}[->] %\setistmathTF*001 % action labels in italics @@ -6466,11 +6498,11 @@ Before we start, let us change the default font size of the \env{istgame} enviro % \istb{Punish}[above,sloped]{(-1,-1)} % \endist %\end{istgame} -%\end{tcblisting} +%\end{doccode} % %\medskip -\begin{tcblisting}{listing outside text, righthand width=.35\linewidth,breakable} +\begin{doccode}{.35} % dual sloped action labels (\istB) \begin{istgame} \setistmathTF*001 % action labels in italics @@ -6489,11 +6521,11 @@ Before we start, let us change the default font size of the \env{istgame} enviro {$1-q$}[below, sloped]{(-1,-1)} \endist \end{istgame} -\end{tcblisting} +\end{doccode} \medskip -\begin{tcblisting}{listing outside text, righthand width=.35\linewidth} +\begin{doccode}{.35} % IGT 218.1 (Osborne, 2004b) \begin{istgame}[font=\normalsize] \xtdistance{10mm}{20mm} @@ -6506,11 +6538,11 @@ Before we start, let us change the default font size of the \env{istgame} enviro \istb{d}[ar]{z} \endist \end{istgame} -\end{tcblisting} +\end{doccode} \medskip -\begin{tcblisting}{listing outside text, righthand width=.35\linewidth} +\begin{doccode}{.35} % information set \begin{istgame} \xtdistance{10mm}{30mm} @@ -6527,11 +6559,11 @@ Before we start, let us change the default font size of the \env{istgame} enviro \endist \xtInfoset(1a)(1b){2} \end{istgame} -\end{tcblisting} +\end{doccode} \medskip -\begin{tcblisting}{listing outside text, righthand width=.35\linewidth} +\begin{doccode}{.35} % information set \begin{istgame} \xtShowEndPoints[oval node] @@ -6548,11 +6580,11 @@ Before we start, let us change the default font size of the \env{istgame} enviro \endist \xtInfoset[bend left=30](1a)(1b){2} \end{istgame} -\end{tcblisting} +\end{doccode} \medskip -\begin{tcblisting}{listing outside text, righthand width=.35\linewidth,breakable} +\begin{doccode}{.35} % (oval) information set \begin{istgame} \xtdistance{15mm}{30mm} @@ -6571,39 +6603,37 @@ Before we start, let us change the default font size of the \env{istgame} enviro \istb{\ell}[al]{(3,2)} \istb{r}[ar]{(0,3)} \endist \end{istgame} -\end{tcblisting} +\end{doccode} -\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{doccode}{.35} +\DeclareExpandableDocumentCommand\xcol{O{c|}m} + {\multicolumn{1}{#1}{\ensuremath{#2}}} +\def\strategicgame{% + \begin{tabular} {c|c|c|} + \xcol[c]{~} & \xcol[c]{B} & \xcol[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} + +\begin{istgame} \setistmathTF*001 \xtdistance{10mm}{40mm} \istroot(0)[initial node]{1} - \istb{Book}[al]{2,2} - \istb{Concert}[ar] - \endist + \istb{Book}[al]{2,2} \istb{Concert}[ar] \endist \xtPayoff(0-2){\strategicgame}[below,xshift=-7pt] \end{istgame} -\end{tcblisting} +\end{doccode} %\clearpage \subsection{Larger game trees with information sets} -\begin{tcblisting}{} +\begin{doccode}[text above listing] \begin{istgame} \xtShowEndPoints \xtdistance{10mm}{40mm} @@ -6627,11 +6657,11 @@ $S$ & $0,0$ & $1,3$ \\\cline{2-3} \setxtinfosetstyle % restore defaults \xtCInfosetO(d)(d) \end{istgame} -\end{tcblisting} +\end{doccode} -\begin{tcblisting}{} -\begin{istgame}[scale=1] +\begin{doccode}[text above listing] +\begin{istgame}[scale=.8] \useasboundingbox (-7,-3) rectangle (7,.5); \xtdistance{10mm}{40mm} \istroot(0)[initial node]{1} \istb \istb \istb \istb \endist @@ -6649,15 +6679,15 @@ $S$ & $0,0$ & $1,3$ \\\cline{2-3} \xtInfosetO(2)(2){1}[above] \setxtinfosetlayer{behind} \xtCInfoset[blue,thick,dashed](a)(c)<.85>{3}[below] -\setxtinfosetlayer % restore default layer (behnd) +\setxtinfosetlayer % restore default layer (behind) \xtCInfosetO[fill=blue!20](b)(4)<.7>{2} \end{istgame} -\end{tcblisting} +\end{doccode} \subsection{A continuum of branches} -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} \begin{istgame}[font=\scriptsize] \cntmdistance*{8mm}{16mm} \cntmpreset*[dashed]{.7} % white triangle @@ -6669,11 +6699,11 @@ $S$ & $0,0$ & $1,3$ \\\cline{2-3} \istroot(3)(2-1)<[label distance=-3pt]120>{1} \istb[]{Y}[al]{1-y,y} \istb{N}[ar] \endist \end{istgame} -\end{tcblisting} +\end{doccode} %\medskip -\begin{tcblisting}{listing outside text, righthand width=.25\linewidth} +\begin{doccode}{.25} \begin{istgame}[font=\scriptsize] \cntmdistance*{8mm}{16mm} \istrootcntmA(0)(0,0){1} \istbA{x}[r] \endist @@ -6685,14 +6715,77 @@ $S$ & $0,0$ & $1,3$ \\\cline{2-3} \istroot(3)(2-1)<[label distance=-3pt]120>{1} \istb[]{Y}[al]{1-y,y} \istb{N}[ar] \endist \end{istgame} -\end{tcblisting} +\end{doccode} -%\clearpage +\leavevmode +\vfill + +\href{https://economics.stackexchange.com/questions/16465/how-to-visually-present-a-simultaneous-game-with-continuous-strategies/33039#33039}{\sourcelink{how-to-visually-present-a-simultaneous-game-with-continuous-strategies}} + +\xbigskip1 + +\begin{doccode}{.4} +\DeclareDocumentCommand\vpay{ m } +{\begin{matrix} #1 \end{matrix}} + +\begin{istgame}[scale=1.5,font=\scriptsize] +\cntmApreset{.9} +\cntmdistance{15mm}{20mm} +\istrootcntmA(0)[null node]{1} + \istbA(.977)[->,thick]{q_1}[r] + \istbm + \endist +\cntmAInfosetO[thick,dashed](0)[-11](2em) +\istrootcntmA(1)(0-1)[null node]<180>{2} + \istbm + \istbA(.977)[->,thick]{q_2}[r] + {\vpay{\pi_1(q_1,q_2)\\\pi_2(q_1,q_2)}} + \endist +\end{istgame} +\end{doccode} + +\vfill + +\href{https://economics.stackexchange.com/questions/16465/how-to-visually-present-a-simultaneous-game-with-continuous-strategies/33039#33039}{\sourcelink{how-to-visually-present-a-simultaneous-game-with-continuous-strategies}} + +\xbigskip1 + +\begin{doccode}{.4} +\DeclareDocumentCommand\vpay{ m } +{\begin{matrix} #1 \end{matrix}} + +\begin{istgame} +\xtdistance{15mm}{40mm} +\cntmdistance{15mm}{30mm} +\cntmApreset[draw=none]{1}[red!50,opacity=.2] +\istroot(0){Challenger} + \istb{In}[al] \istb{Out}[ar] \endist +\cntmAistb[draw=none] +\istrootcntmA(1)(0-1)<135>{Incumbent} + \istbA{q_I}[left] \endist +\cntmAInfosetO(1) +\cntmAistb[draw=none] +\istrootcntmA(2)(0-2)<45>{Incumbent} + \istbA*{q_I}[left] + {\vpay{\pi_C(0,q_I)\\\pi_I(0,q_I)}} + \endist +\cntmApreset[draw=none]{1}[blue!50,opacity=.2] +\cntmAistb[draw=none] +\istrootcntmA(3)(1-1)<180>{Challenger} + \istbA*{q_C}[midway,left] + {\vpay{\pi_C(q_C,q_I)\\ \pi_I(q_C,q_I)}} + \endist +\end{istgame} +\end{doccode} + +\vfill + +\clearpage \subsection{Tic-tac-toe (sketch)} % tic-tac-toe -\begin{tcblisting}{} +\begin{doccode}[text above listing] % tic-tac-toe (sketch) \begin{istgame}[scale=1.8,font=\tiny] \xtdistance{20mm}{7mm} @@ -6711,13 +6804,13 @@ $S$ & $0,0$ & $1,3$ \\\cline{2-3} \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} +\end{doccode} %\clearpage \subsection{Selten's horse} -\begin{tcblisting}{listing outside text, righthand width=.4\linewidth} +\begin{doccode}{.4} % Selten's horse: IGT 331.2 (Osborne, 2004b) \begin{istgame} \xtdistance{8mm}{16mm} @@ -6740,12 +6833,12 @@ $S$ & $0,0$ & $1,3$ \\\cline{2-3} \xtInfoset(1)(a1){3} \end{istgame} \captionof{figure}{IGT 331.2} -\end{tcblisting} +\end{doccode} \subsection{Centipede game} -\begin{tcblisting}{} +\begin{doccode}[text above listing] % centipede \begin{istgame}[scale=1.5] \setistmathTF*001 @@ -6766,14 +6859,14 @@ $S$ & $0,0$ & $1,3$ \\\cline{2-3} \istroot(5)(4-2){2} \istb{Take}[r]{(99,101)}[b] \istb{Pass}[a]{(100,100)}[r] \endist \end{istgame} -\end{tcblisting} +\end{doccode} %\clearpage \subsection{Poker game} % poker -\begin{tcblisting}{} +\begin{doccode}[text above listing] % poker: growing south \begin{istgame}[scale=1.7] \setistmathTF*001 @@ -6805,13 +6898,13 @@ $S$ & $0,0$ & $1,3$ \\\cline{2-3} \endist \xtInfoset(1)(2){2} \end{istgame} -\end{tcblisting} +\end{doccode} \subsection{Poker game: growing to the right} \label{p:poker-right} -\begin{tcblisting}{} +\begin{doccode}[text above listing] % poker: growing east -- counterclockwise \begin{istgame}[scale=1.3] \setistmathTF*001 @@ -6843,9 +6936,9 @@ $S$ & $0,0$ & $1,3$ \\\cline{2-3} \endist \xtCInfosetO[fill=blue!20](1-1-2)(1-2-2){2} \end{istgame} -\end{tcblisting} +\end{doccode} -\begin{tcblisting}{} +\begin{doccode}[text above listing] % poker: growing east -- clockwise (swap version) \begin{istgame}[scale=1.3] \setistmathTF*001 @@ -6877,11 +6970,11 @@ $S$ & $0,0$ & $1,3$ \\\cline{2-3} \endist \xtInfosetO[fill=red!20](1-1-2)(1-2-2){2} \end{istgame} -\end{tcblisting} +\end{doccode} \subsection{Signaling games} -\begin{tcblisting}{listing above text,halign lower=center} +\begin{doccode}[text above listing,halign lower=center] % signaling game: IGT 337.1 (Osborne, 2004b) \begin{istgame} \setistgrowdirection'{right} @@ -6915,11 +7008,11 @@ $S$ & $0,0$ & $1,3$ \\\cline{2-3} \endist \xtInfoset(H)(L){C}[left] \end{istgame} -\end{tcblisting} +\end{doccode} \xbigskip2 -\begin{tcblisting}{listing outside text, righthand width=.5\linewidth} +\begin{doccode}{.5} % signaling game \begin{istgame}[scale=1.3] \xtdistance{20mm}{20mm} @@ -6955,510 +7048,1062 @@ $S$ & $0,0$ & $1,3$ \\\cline{2-3} \xtInfoset(a1)(b2){2} \xtInfoset(b1)(a2){2} \end{istgame} -\end{tcblisting} +\end{doccode} -%\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} +\clearpage +\section{Selected examples from \texttt{tex.stackexchange.com}} + +In this section |\setistgamefontsize{|\cmd{\normalsize}|}|. +\setistgamefontsize{\normalsize} +\subsection{Subgames: \protect\CMD{\xtSubgameBox}} -\section{Acknowledgement} +\vfill -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. +\href{https://tex.stackexchange.com/questions/482883/game-theory-subgame-box/488559#488559}{\sourcelink{game-theory-subgame-box}} +\vfill -\section{References} -\hpara{}Chen, H.~K.~(2013), ``Drawing Game Trees with \TikZ,'' \url{http://www.sfu.ca/~haiyunc/notes/Game_Trees_with_TikZ.pdf}. +\begin{doccode}[text above listing] +\begin{istgame} +\xtShowEndPoints +\xtdistance{25mm}{70mm} +\istrooto(0){Firm 1} + \istb{BIG}[al] \istb{small}[ar] \endist +\xtdistance{25mm}{35mm} +\istrooto(1)(0-1){Firm 2} + \istb{Low}[al] \istb{High}[ar] \endist +\istrooto(2)(0-2){Firm 2} \istb{low}[al] \istb{high}[ar] \endist +\xtdistance{20mm}{10mm} +\istrooto(a)(1-1){Firm 1} + \istb{L}[l]{\parbox{1em}{$u_1$\\$u_2$}} \istb{H}[r] \endist +\istrooto(b)(1-2){Firm 1} + \istb{L}[l] \istb{H}[r] \endist +\istrooto(c)(2-1){Firm 1} + \istb{l}[l] \istb{h}[r] \endist +\istrooto(d)(2-2){Firm 1} + \istb{l}[l] \istb{h}[r] \endist +\setxtinfosetstyle{dashed} +\xtInfoset(a)(b) +\xtInfoset(c)(d) +\xtSubgameBox([yshift=-2ex]1){(a-1)(b-2)}[inner ysep=7ex] +\xtSubgameBox([yshift=-2ex]2){(c-1)(d-2)}[inner ysep=7ex] +\end{istgame} +\end{doccode} + +\vfill -\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. +\clearpage +\subsection{Information sets: \protect\CMD{\xtInfosetO}, \protect\CMD{\xtCInfosetO}, and \protect\CMD{\cntmAInfosetO}} -\hpara{}Osborne, M.~J.~(2004a), ``Manual for \pkg{egameps.sty},'' Version 1.1, \url{http://texdoc.net/texmf-dist/doc/latex/egameps/egameps.pdf} +\vfill + +\href{https://tex.stackexchange.com/questions/430077/game-theory-forest-tree-dashed-ellipse-between-various-nodes/478240#478240}{\sourcelink{game-theory-forest-tree-dashed-ellipse-between-various-nodes}} + +\vfill + +\begin{doccode}[text above listing] +\begin{istgame}[scale=1.2] +\setistgrowdirection'{east} +\tikzset{oval node/.style={ellipse node,draw=none}} +\tikzset{move/.style={red,fill=white}} +\xtdistance{25mm}{25mm} +\istroot(0)[null node]<180>{1}+25mm..40mm+ + \istb{1}[move] \istb{2}[move] \endist +\istrooto(1)(0-1){2} + \istb{1}[move] \istb{2}[move] \endist +\istrooto(2)(0-2){2} + \istb{1}[move] \istb{2}[move]{(-1,1)} \endist +\istrooto(3)(1-1){1} + \istb{1}[move] \istb{2}[move]{(-1,1)} \endist +\istrooto(4)(1-2){1} + \istb{1}[move]{(-1,1)} \endist +\istrooto(5)(2-1){1} + \istb{1}[move]{(-1,1)} \endist +\istrooto(6)(3-1){2} + \istb{1}[move]{(-1,1)} \endist +\setxtinfosetlayer{main} +\xtInfosetO[dashed,thick](3)(4)(1.5em) +\xtInfosetO[ellipse,dashed,thick](2)(5)(2em) +\end{istgame} +\end{doccode} + +\vfill + +\clearpage +\href{https://tex.stackexchange.com/questions/497214/follow-up-drawing-game-tree-with-curved-informational-sets-and-several-nodes-u/497333#497333}{\sourcelink{drawing-game-tree-with-curved-informational-sets}} + +\begin{doccode}[text above listing] +\begin{istgame}[scale=.55,font=\footnotesize] +\setistmathTF*001 +% top part +\xtdistance{25mm}{120mm} +\istroot(0)[chance node]{Nature} \istb \istb \endist +\xtdistance{25mm}{50mm} +\istroot(A)(0-1) \istb \endist +\istroot(B)(0-2) \istb \endist +% left part +\xtdistance{25mm}{60mm} +\istroot(A0)(A-1)<180>{2} \istb \istb \endist +\xtdistance{25mm}{30mm} +\istroot(A1)(A0-1) \istb \istb \endist +\istroot(A2)(A0-2) \istb \istb \endist +\xtdistance{25mm}{15mm} +\istroot(A3)(A1-1)<180>{2} \istb{G}[l] \istb{S}[r] \endist +\istroot(A4)(A1-2)<180>{2} \istb{G}[l] \istb{S}[r] \endist +\istroot(A5)(A2-1)<180>{2} \istb{G}[l] \istb{S}[r] \endist +\istroot(A6)(A2-2)<180>{2} \istb{G}[l] \istb{S}[r] \endist +% right part +\xtdistance{25mm}{60mm} +\istroot(B0)(B-1)<180>{2} \istb \istb \endist +\xtdistance{25mm}{30mm} +\istroot(B1)(B0-1) \istb \istb \endist +\istroot(B2)(B0-2) \istb \istb \endist +\xtdistance{25mm}{15mm} +\istroot(B3)(B1-1)<180>{2} \istb{G}[l] \istb{S}[r] \endist +\istroot(B4)(B1-2)<180>{2} \istb{G}[l] \istb{S}[r] \endist +\istroot(B5)(B2-1)<180>{2} \istb{G}[l] \istb{S}[r] \endist +\istroot(B6)(B2-2)<180>{2} \istb{G}[l] \istb{S}[r] \endist +% information sets +\setxtinfosetstyle{dashed} +\xtInfosetO[fill=black!15](A)(B){1} +\xtCInfosetO[blue,fill=blue!15](A1)!.35!(B1)<1.15>{1} +\xtCInfosetO[red,fill=red!15](A2)!.5!(B2)<.75>{1} +\end{istgame} +\end{doccode} + + +\href{https://tex.stackexchange.com/questions/622934/how-to-design-a-game-in-a-tree/623249#623249}{\sourcelink{how-to-design-a-game-in-a-tree}} + +\vfill + +%\begin{doccode}[text only] +\begin{istgame}[scale=1.5] +\setistgrowdirection'{east} +%% root +\xtdistance{20mm}{32mm} +\istroot(0)[chance node]{0} + \istb \istb \istb \istb \endist +%% extending branches +\istroot(0a)(0-1)[null node] + \istb{\frac13(TL)}[above,near start] \endist +\istroot(0b)(0-2)[null node] + \istb{\frac13(BL)}[above,near start] \endist +\istroot(0c)(0-3)[null node] + \istb{\frac13(TR)}[below,near start] \endist +\istroot(0d)(0-4)[null node] + \istb{0(BR)}[below,near start] \endist +%\xtShowEndPoints +%% player I +\xtdistance{15mm}{16mm} +\istroot(1a)(0a-1) + \istb{T_1}[a] \istb{B_1}[b] \endist +\istroot(1b)(0b-1) + \istb{T_2}[a] \istb{B_2}[b] \endist +\istroot(1c)(0c-1) + \istb{T_1}[a] \istb{B_1}[b] \endist +\istroot(1d)(0d-1) + \istb{T_2}[a] \istb{B_2}[b] \endist +\xtdistance{15mm}{8mm} +%% player II +\istroot(2Aa)(1a-1) + \istb{L_1}[a]{6,6} \istb{R_1}[b]{2,7} \endist +\istroot(2Ab)(1a-2) + \istb{L_1}[a]{7,2} \istb{R_1}[b]{0,0} \endist +\istroot(2Ac)(1b-1) + \istb{L_1}[a]{6,6} \istb{R_1}[b]{2,7} \endist +\istroot(2Ad)(1b-2) + \istb{L_1}[a]{7,2} \istb{R_1}[b]{0,0} \endist +\istroot(2Ba)(1c-1) + \istb{L_2}[a]{6,6} \istb{R_2}[b]{2,7} \endist +\istroot(2Bb)(1c-2) + \istb{L_2}[a]{7,2} \istb{R_2}[b]{0,0} \endist +\istroot(2Bc)(1d-1) + \istb{L_2}[a]{6,6} \istb{R_2}[b]{2,7} \endist +\istroot(2Bd)(1d-2) + \istb{L_2}[a]{7,2} \istb{R_2}[b]{0,0} \endist +% information sets +\xtInfosetO(0)(0) +\xtCInfosetO[fill=red!20,fill opacity=.3](1a)!.4!(1c)<1.2>{I} +\xtCInfosetO[fill=blue!20,fill opacity=.3](1b)!.6!(1d)<1.15>{I} +\xtInfosetO(2Aa)(2Ad){II} +\xtInfosetO(2Ba)(2Bd){II} + +\end{istgame} +%\end{doccode} + +\vfill + +\clearpage + +\leavevmode +\vfill + +\begin{doccode}[listing only] +\begin{istgame}[scale=1.5] +\setistgrowdirection'{east} +%% root +\xtdistance{20mm}{32mm} +\istroot(0)[chance node]{0} + \istb \istb \istb \istb \endist +%% extending branches +\istroot(0a)(0-1)[null node] + \istb{\frac13(TL)}[above,near start] \endist +\istroot(0b)(0-2)[null node] + \istb{\frac13(BL)}[above,near start] \endist +\istroot(0c)(0-3)[null node] + \istb{\frac13(TR)}[below,near start] \endist +\istroot(0d)(0-4)[null node] + \istb{0(BR)}[below,near start] \endist +%\xtShowEndPoints +%% player I +\xtdistance{15mm}{16mm} +\istroot(1a)(0a-1) + \istb{T_1}[a] \istb{B_1}[b] \endist +\istroot(1b)(0b-1) + \istb{T_2}[a] \istb{B_2}[b] \endist +\istroot(1c)(0c-1) + \istb{T_1}[a] \istb{B_1}[b] \endist +\istroot(1d)(0d-1) + \istb{T_2}[a] \istb{B_2}[b] \endist +\xtdistance{15mm}{8mm} +%% player II +\istroot(2Aa)(1a-1) + \istb{L_1}[a]{6,6} \istb{R_1}[b]{2,7} \endist +\istroot(2Ab)(1a-2) + \istb{L_1}[a]{7,2} \istb{R_1}[b]{0,0} \endist +\istroot(2Ac)(1b-1) + \istb{L_1}[a]{6,6} \istb{R_1}[b]{2,7} \endist +\istroot(2Ad)(1b-2) + \istb{L_1}[a]{7,2} \istb{R_1}[b]{0,0} \endist +\istroot(2Ba)(1c-1) + \istb{L_2}[a]{6,6} \istb{R_2}[b]{2,7} \endist +\istroot(2Bb)(1c-2) + \istb{L_2}[a]{7,2} \istb{R_2}[b]{0,0} \endist +\istroot(2Bc)(1d-1) + \istb{L_2}[a]{6,6} \istb{R_2}[b]{2,7} \endist +\istroot(2Bd)(1d-2) + \istb{L_2}[a]{7,2} \istb{R_2}[b]{0,0} \endist +% information sets +\xtInfosetO(0)(0) +\xtCInfosetO[fill=red!20,fill opacity=.3](1a)!.4!(1c)<1.2>{I} +\xtCInfosetO[fill=blue!20,fill opacity=.3](1b)!.6!(1d)<1.15>{I} +\xtInfosetO(2Aa)(2Ad){II} +\xtInfosetO(2Ba)(2Bd){II} + +\end{istgame} +\end{doccode} + +\vfill +\vfill +\vfill + +\clearpage + +\subsection{Continuum of moves: \protect\CMD{\istrootcntm} and \protect\CMD{\istrootcntmA}} + +\leavevmode +\vfill + +\href{https://tex.stackexchange.com/questions/468397/draw-tree-in-tikz/468703#468703}{\sourcelink{draw-tree-in-tikz}} + +\vfill + +\begin{doccode}[text above listing] +\begin{istgame}[scale=.8,font=\scriptsize] +% presets +\tikzset{odd node/.style={decision node,minimum size=6pt}} +\tikzset{even node/.style={oval node,fill=cyan!50,minimum size=6pt}} +% game tree +\cntmdistance*{20mm}{35mm} +\cntmpreset*[densely dashed]{.6} +\istrootcntm(1a)[odd node]<15>{$x_1$} + \istb{(a^0,1-a^0)}[right,near end] \endist +\istroot(2)(1a-1)[even node]<-90>{$x_2$} + \istb{acc}[al]{\left(a^0,1-a^0\right)} + \istb{not}[ar] + \endist +\istrootcntm(2a)(2-2)[even node]<0>{$x_3$} + \istb{(a^1,1-a^1)}[right,near end] \endist +\istroot(3)(2a-1)[odd node]<-90>{$x_4$} + \istb{acc}[al]{\left(\delta_1 a^1,\delta_2(1-a^1)\right)} + \istb{not}[ar] + \endist +\istrootcntm(3a)(3-2)[odd node]<0>{$x_5$} + \istb{(a^2,1-a^2)}[right,near end] \endist +\istroot(4)(3a-1)[even node]<-90>{$x_6$} + \istb{acc}[al]{\left((\delta_1)^2a^2,(\delta_2)^2(1-a^2)\right)} + \istb{not}[ar]{(0,0)} + \endist +\end{istgame} +\end{doccode} + +\vfill + +\clearpage + +\vfill + +\href{https://tex.stackexchange.com/questions/594222/tikz-game-tree-help-drawing/594552#594552}{\sourcelink{tikz-game-tree-help-drawing}} + +\vfill + +\begin{doccode}[text above listing] +\begin{istgame}[scale=1.3] +% nodes +\tikzset{p1/.style={oval node,minimum size=3pt}} +\tikzset{p2/.style={oval node,fill=black,minimum size=3pt}} +% tree +\xtdistance{20mm}{45mm} +\cntmdistance{10mm}{20mm} +\istroot(1)[p1] \istb \istb \endist +\istrootcntmA(2a)(1-1)[p2] \istbA[draw=none] \endist +\istrootcntmA(2b)(1-2)[p2] \istbA[draw=none] \endist +\xtdistance{15mm}{30mm} +\istroot(1a)(2a-1)[p1] \istb \istb \endist +\istroot(1b)(2b-1)[p1] \istb \endist +\istrootcntmA(2c)(1a-1)[p2] \istbA[draw=none] \endist +\istrootcntmA(2d)(1a-2)[p2] \istbA[draw=none] \endist +\istrootcntmA(2e)(1b-1)[p2] \istbA[draw=none] \endist +\istroot(1c)(2c-1)[p1] \istb \endist +\istroot(1d)(2d-1)[p1] \istb \endist +\istroot(1e)(2e-1)[p1] \istb \endist +% information sets +\xtInfosetO[solid,thin,fill=blue!10](2a)(2b) +\xtInfosetO[solid,thin,fill=blue!10](2d)(2e) +\end{istgame} +\end{doccode} + +\vfill + +\clearpage + +\vfill + +\href{https://tex.stackexchange.com/questions/203052/a-gametree-with-variable-choices/472415#472415}{\sourcelink{a-gametree-with-variable-choices}} + +\vfill + +\begin{doccode}[text above listing] +\begin{istgame}[scale=1.3,semithick] +\tikzset{oval node/.style={box node,draw=none,minimum size=5mm}} +\cntmdistance*{20mm}{25mm} +\istrooto(0)[plain node]{Firm 1}+15mm..50mm+ + \istb \istb \endist +\setistmathTF111 +\cntmApreset[dashed,thick]{.6} +\istrootocntmA(E2)(0-1){E_2} \istb[thin] \endist +\xtNode*(cntm-1){0} \xtNode*(cntm-2){\infty} +\istrootocntmA(E3)(0-2){E_3} \istb[thin] \endist +\xtNode*(cntm-1){0} \xtNode*(cntm-2){\infty} +\istrootocntmA(11)(E2-1){q_1} \istb[thin] \endist +\xtNode*(cntm-1){0} \xtNode*(cntm-2){\infty} +\istrootocntmA(21)(E3-1){q_1} \istb[thin] \endist +\xtNode*(cntm-1){0} \xtNode*(cntm-2){\infty} +\istrooto(3a)(11-1){q_2} \istb[thin] \endist +\xtNode*(3a-1){\big(\prod\big)_1^{c_2}\prod_2^c\prod_3^m} +\istrooto(3b)(21-1){q_3} \istb[thin] \endist +\xtNode*(3b-1){\big(\prod\big)_1^{c_3}\prod_2^m\prod_3^c} +\end{istgame} +\end{doccode} + + +\vfill + +\clearpage + + + +\subsection{Signaling games} + +\leavevmode +\vfill + +\href{https://tex.stackexchange.com/questions/594771/how-draw-this-game-in-tikz/610845#610845}{\sourcelink{how-draw-this-game-in-tikz}} + +\vfill + +\begin{doccode}[text above listing] +\begin{istgame} +\setistNewNodeStyle{solid node}[null node] +\setistmathTF001 +\setxtshowarrows[thick] +\xtShowArrows +\xtHideEndPoints +% game start +\setistgrowdirection'{east} +\xtdistance{10mm}{40mm} +\istroot(0)[chance node]<[xshift=2mm]200>{Nature} + \istb{[.5]1}[l] \istb{[.5]2}[l] \endist +% right part +\xtdistance{30mm}{20mm} +\istroot(Ra)(0-1)<-45>{$x_1$} \istb{Average}[a] \endist +\istroot(Rb)(0-2)<45>{$x_2$} \istb{Average}[b] \endist +\xtdistance{20mm}{20mm} +\istroot(T1a)(Ra-1)<-135>{$x_3$} + \istb{Hunk}[above,sloped]{2,3} \istb{Average}[below,sloped]{2,2} \endist +\istroot(T1b)(Rb-1)<135>{$x_4$} + \istb{Hunk}[above,sloped]{2,3} \istb{Average}[below,sloped]{2,2} \endist +\xtInfoset[dashed](0-1)(0-2){$h_G$}[l] +\xtInfosetOwner(0-1)(0-2){Gina}[r] +\xtInfoset[dashed](T1a)(T1b){$h_{T1}$}[l] +\xtInfosetOwner(T1a)(T1b){Tina}[r] +% left part +\setistgrowdirection{west} +\xtdistance{30mm}{20mm} +\istroot(La)(0-1) \istb{Hunk}[a] \endist +\istroot(Lb)(0-2) \istb{Hunk}[b] \endist +\xtdistance{20mm}{20mm} +\istroot(T2a)(La-1)<-45>{$x_5$} + \istb{Hunk}[above,sloped]{3,0} \istb{Average}[below,sloped]{3,2} \endist +\istroot(T2b)(Lb-1)<45>{$x_6$} + \istb{Hunk}[above,sloped]{0,3} \istb{Average}[below,sloped]{3,2} \endist +% information set +\xtInfoset[dashed](T2a)(T2b){$h_{T2}$}[r] +\xtInfosetOwner(T2a)(T2b){Tina}[l] +\end{istgame} +\end{doccode} + +\vfill + +\clearpage + +\subsection{Cross out nodes} + +\leavevmode +\vfill + +\href{https://tex.stackexchange.com/questions/374600/problem-with-dashed-edges-and-cross-nodes/402407#402407}{\sourcelink{problem-with-dashed-edges-and-cross-nodes}} + +\vfill + +\begin{doccode}[text above listing] +\begin{istgame} +\setistNewNodeStyle{cross node}[cross out,ultra thick]{4pt} +\xtdistance{15mm}{55mm} +\istroot(1a){1.1} + \istb{L_1}[al] \istb{R_1}[ar] \endist +\xtdistance{15mm}{27mm} +\istroot(2a)(1a-1)<135>{2.1} + \istb[dashdotted]{l_1}[l] \istb{r_1}[r] \endist +\istroot(2b)(1a-2)<45>{2.2} + \istb{l_2}[l] \istb*{r_1}[r] \endist +\xtdistance{15mm}{17mm} +\istroot(1b)(2a-1)[cross node]<135>{1.2} + \istb[dashdotted]{L_2}[l] \istb*[dashdotted]{R_2}[r] \endist +\istroot(1c)(2a-2)<45>{1.3} + \istb{L_3}[l] \istb{R_3}[r] \endist +\istroot(1d)(2b-1)<135>{1.4} + \istb*{L_4}[l] \istb{R_4}[r] \endist +\xtShowEndPoints +\xtdistance{18mm}{10mm} +\istroot(2c)(1b-1)[cross node]<135>{2.3} + \istb[dashdotted]{l_3}[l] \istb[dashdotted]{r_3}[r] \endist +\istroot(2d)(1c-1)<135>{2.4} + \istb{l_4}[l] \istb{r_4}[r] \endist +\istroot(2e)(1c-2)<45>{2.5} + \istb{l_5}[l] \istb{r_5}[r] \endist +\istroot(2f)(1d-2)<45>{2.6} + \istb{l_6}[l] \istb{r_6}[r] \endist +\end{istgame} +\end{doccode} + +\vfill + +\clearpage + +\subsection{Large game trees} + +%\leavevmode +\vfill + +\href{https://tex.stackexchange.com/questions/482040/game-theory-trees-solid-node-size/482610#482610}{\sourcelink{game-theory-trees-solid-node-siz}} + +\vfill +\vfill +\vfill + +%\begin{doccode}[text above listing] +\def\vpay#1#2{\begin{matrix}#1\\#2\end{matrix}} + +\begin{istgame}[scale=.8,font=\footnotesize] +\xtShowEndPoints % solid nodes +\setistEllipseNodeStyle{6mm} % minimum circle size for players +\xtdistance{30mm}{30mm} +\istrooto(0){Nature} + \istB{JQK}[l]{p_1}[left,near start,xshift=-5pt] + \istB{JKQ}[l]{p}[left,near start] + \istB{QJK}[l]{p}[left,near start] + \istB{QJK}[r]{p}[right,near start] + \istB{KJQ}[r]{p}[right,near start,xshift=5pt] + \istB{KQJ}[r]{p}[right,near start,xshift=5pt] + \endist +\xtdistance{25mm}{10mm} +\istrooto(1)(0-1){$P_1$} + \istb{c}[l]{\vpay{-1}{1}} \istb<grow=-70,level distance=90mm>{r}[r] \endist +\istrooto(2)(0-2){$P_1$} + \istb{c}[l]{\vpay{-1}{1}} \istb{r}[r] \endist +\istrooto(3)(0-3){$P_1$} + \istb{r}[l] \istb{c}[r]{\vpay{-1}{1}} \endist +\istrooto(4)(0-4){$P_1$} + \istb{c}[l]{\vpay{1}{-1}} \istb{r}[r] \endist +\istrooto(5)(0-5){$P_1$} + \istb{r}[l] \istb{c}[r]{\vpay{1}{-1}} \endist +\istrooto(6)(0-6){$P_1$} + \istb<grow=-110,level distance=90mm>{r}[l] \istb{c}[r]{\vpay{1}{-1}} \endist +\xtdistance{20mm}{10mm} +\istrooto(a)(2-2){$P_2$} + \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{-2}{2}} \endist +\istrooto(b)(3-1){$P_2$} + \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{-2}{2}} \endist +\istrooto(c)(4-2){$P_2$} + \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{2}{-2}} \endist +\istrooto(d)(5-1){$P_2$} + \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{2}{-2}} \endist +\xtdistance{28mm}{25mm} +\istrooto(A)(1-2){$P_2$} + \istb[draw=red]{f}[l]{\vpay{1}{-1}} \istb[draw=blue]{c}[r]{\vpay{-2}{2}} \endist +\istrooto(B)(6-1){$P_2$} + \istb[double]{r}[l]{\vpay{1}{-1}} \istb[ultra thick]{c}[r]{\vpay{2}{-2}} \endist +% information sets +\setxtinfosetstyle{dashed} +\xtInfoset(1)(2) +\xtInfoset(3)(4) +\xtInfoset(5)(6) +\xtInfoset(a)(b) +\xtInfoset(c)(d) +\xtInfoset(A)(B) +\end{istgame} +%\end{doccode} + +\vfill +\vfill +\vfill + +\clearpage + +\leavevmode +\vfill + +\begin{doccode}[listing only] +\def\vpay#1#2{\begin{matrix}#1\\#2\end{matrix}} + +\begin{istgame}[scale=.8,font=\footnotesize] +\xtShowEndPoints % solid nodes +\setistEllipseNodeStyle{6mm} % minimum circle size for players +\xtdistance{30mm}{30mm} +\istrooto(0){Nature} + \istB{JQK}[l]{p_1}[left,near start,xshift=-5pt] + \istB{JKQ}[l]{p}[left,near start] + \istB{QJK}[l]{p}[left,near start] + \istB{QJK}[r]{p}[right,near start] + \istB{KJQ}[r]{p}[right,near start,xshift=5pt] + \istB{KQJ}[r]{p}[right,near start,xshift=5pt] + \endist +\xtdistance{25mm}{10mm} +\istrooto(1)(0-1){$P_1$} + \istb{c}[l]{\vpay{-1}{1}} \istb<grow=-70,level distance=90mm>{r}[r] \endist +\istrooto(2)(0-2){$P_1$} + \istb{c}[l]{\vpay{-1}{1}} \istb{r}[r] \endist +\istrooto(3)(0-3){$P_1$} + \istb{r}[l] \istb{c}[r]{\vpay{-1}{1}} \endist +\istrooto(4)(0-4){$P_1$} + \istb{c}[l]{\vpay{1}{-1}} \istb{r}[r] \endist +\istrooto(5)(0-5){$P_1$} + \istb{r}[l] \istb{c}[r]{\vpay{1}{-1}} \endist +\istrooto(6)(0-6){$P_1$} + \istb<grow=-110,level distance=90mm>{r}[l] \istb{c}[r]{\vpay{1}{-1}} \endist +\xtdistance{20mm}{10mm} +\istrooto(a)(2-2){$P_2$} + \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{-2}{2}} \endist +\istrooto(b)(3-1){$P_2$} + \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{-2}{2}} \endist +\istrooto(c)(4-2){$P_2$} + \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{2}{-2}} \endist +\istrooto(d)(5-1){$P_2$} + \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{2}{-2}} \endist +\xtdistance{28mm}{25mm} +\istrooto(A)(1-2){$P_2$} + \istb[draw=red]{f}[l]{\vpay{1}{-1}} \istb[draw=blue]{c}[r]{\vpay{-2}{2}} \endist +\istrooto(B)(6-1){$P_2$} + \istb[double]{r}[l]{\vpay{1}{-1}} \istb[ultra thick]{c}[r]{\vpay{2}{-2}} \endist +% information sets +\setxtinfosetstyle{dashed} +\xtInfoset(1)(2) +\xtInfoset(3)(4) +\xtInfoset(5)(6) +\xtInfoset(a)(b) +\xtInfoset(c)(d) +\xtInfoset(A)(B) +\end{istgame} +\end{doccode} + +\vfill +\vfill +\vfill + +\clearpage + + +\subsection{Probability trees} + +\vfill + +\href{https://tex.stackexchange.com/questions/563364/draw-a-counting-tree-with-grow-right-and-then-placed-on-the-right-or-left-of-p/564322#564322}{\sourcelink{draw-a-counting-tree-with-grow-right-and-then-placed-on-the-right-or-left-of-p}} + +\vfill + +\begin{doccode}{.25} +\begin{istgame}[scale=.7] +\tikzset{oval node/.style={ellipse node,draw=none}} +\setistgrowdirection'{east} +\xtdistance{14mm}{60mm} +\istrooto(A){start} + \istb \istb \istb \endist +\xtdistance{12mm}{20mm} +\istrooto(0)(A-1){0} \istb \istb \istb \endist +\istrooto(1)(A-2){1} \istb \istb \istb \endist +\istrooto(2)(A-3){2} \istb \istb \istb \endist +\xtdistance{10mm}{10mm} +\istrooto(00)(0-1){0} + \istb{}{0 \quad 2^03^07^0=1} + \istb{}{1 \quad 2^03^07^1=7} + \endist +\istrooto(01)(0-2){1} + \istb{}{0} + \istb{}{1} + \endist +\istrooto(02)(0-3){2} + \istb{}{0} + \istb{}{1} + \endist +\istrooto(10)(1-1){0} + \istb{}{0} + \istb{}{1} + \endist +\istrooto(11)(1-2){1} + \istb{}{0} + \istb{}{1} + \endist +\istrooto(12)(1-3){2} + \istb{}{0} + \istb{}{1} + \endist +\istrooto(20)(2-1){0} + \istb{}{0} + \istb{}{1} + \endist +\istrooto(21)(2-2){1} + \istb{}{0} + \istb{}{1} + \endist +\istrooto(22)(2-3){2} + \istb{}{0 \quad 2^23^27^0=36} + \istb{}{1 \quad 2^23^27^1=252} + \endist +\xtNode*([yshift=-1.3cm,xshift=-1.2cm]22)[anchor=mid]{$a$} +\xtNode*([yshift=-1.3cm]22) [anchor=mid]{$b$} +\xtNode*([yshift=-1.3cm,xshift=1.3cm]22) [anchor=mid]{$c$} +\end{istgame} +\end{doccode} + + +\vfill + +\clearpage + +\subsection{More tree examples} + +\vfill + +\href{https://tex.stackexchange.com/questions/544753/game-tree-in-microeconomics/546141#546141}{\sourcelink{game-tree-in-microeconomics}} + +\xbigskip1 + +\begin{doccode}{.4} +% This is a game tree +% imbalanced branch: \istbA +\begin{istgame}[->] +\tikzset{oval node/.style= + {ellipse node,draw=none}} +\xtdistance{20mm}{40mm} +\istrooto'[90](0){\{a,b\}} + \istb{(U,L)}[bl]{(5,5,2)} + \istb{(U,R)}[br]{(4,4,1)} + \endist +\istrooto(0){\{a,b\}} + \istb[->-=.92]{(D,L)}[al] + \istb{(D,R)}[ar]{(5,5,2)} + \endist +\istrooto(1)(0-1){P} + \istb{N}[al]{(4,4,1)} + \istb{P}[ar]{(6,0,0)} + \endist +\end{istgame} +\end{doccode} + +\vfill +\vfill + + +\href{https://tex.stackexchange.com/questions/619273/constructing-a-tree-in-latex-using-tikz/619681#619681}{\sourcelink{constructing-a-tree-in-latex-using-tikz}} + +\xbigskip1 + + +\begin{doccode}{.4} +% This is not a game tree. +\begin{istgame}[scale=1.2] +\setistNewNodeStyle{ellipse node}{2em} +\setxtinfosetstyle{thin,solid} +\setistmathTF*011<sffamily> +\istrooto(0){A} + \istb + \istbA(1.3) + \istbA(1.6) + \istb + \endist +\istrooto(1)(0-1){B} \endist +\istrooto(2)(0-2){C} \endist +\istrooto(3)(0-3){D} \endist +\istrooto(4)(0-4){E} \endist +\xtInfoset(1)(2) +\xtInfoset(2)(4) +\xtCInfoset(3)(1)<1.5> +\end{istgame} +\end{doccode} + +\vfill +\vfill + +\clearpage + +\vfill + +\href{https://tex.stackexchange.com/questions/530161/how-to-rearrange-forest-tree/557463#557463}{\sourcelink{how-to-rearrange-forest-tree}} + +\vfill +\vfill + +%\begin{doccode}[text above listing] +\begin{istgame}[scale=1.5,draw=blue,text=blue,font=\sffamily] +\tikzset{every node/.style={fill=white}} % action labels with white background +\tikzset{every ellipse node/.style={circle,draw=blue,minimum size=2.5em}} +\tikzset{xx/.style={circle,draw,fill,minimum size=2.5em,text=black}} % color node +\tikzset{lev/.style={level distance=#1}} +\setistmathTF*000{sffamily} +\setistgrowdirection'{east} +\xtShowEndPoints[oval node] +\def\xdist{50mm} +%% root +\istrooto(A){Root} + \istb<grow=0,lev=.4*\xdist>{1} \istb<grow=-90,lev=.7*\xdist>{0}[pos=.7] \endist +\xtdistance{.4*\xdist}{.4*\xdist} +\istrooto(Aa)(A-1) \istb{1} \istb{0} \endist +\xtdistance{.4*\xdist}{.2*\xdist} +\istrooto(Ab)(Aa-1) \istb{1} \istb{0} \endist +\istrooto(Ac)(Aa-2) \istb{1} \istb{0} \endist +%% level 1 +\istrooto(0)(A-2) + \istb<grow=0,lev=.4*\xdist>{1} \istb<grow=-90,lev=.4*\xdist>{0}[pos=.6] \endist +\xtdistance{.4*\xdist}{.2*\xdist} +\istrooto(0a)(0-1) + \istb{1}{c4}[[yellow,xx]center] % c4 + \istb{0}{c3}[[teal!50!white,xx]center] % c3 + \endist +%% level 2 & level 3 +%\xtdistance{.4*\xdist}{.4*\xdist} +\istrooto(00)(0-2) + \istb<grow=0,lev=.4*\xdist>{1}{c2}[[teal!70!white,xx]center] % c2 + \istb<grow=-90,lev=.35*\xdist>{0}{c1}[[orange,xx]center] % c1 + \endist +%% level lines +\coordinate(X0)at($(A)!.66!(0)$); +\coordinate(X1)at($(0)!.57!(00)$); +\coordinate(X2)at($(00)!.5!(00-2)$); +\xtTimeLineH'[solid](X0){1}{-8} +\xtTimeLineH'[solid](X1){1}{-8} +\xtTimeLineH'[solid,->](X2){1}{-8} +%% level texts +\xtTimeLineH'[draw=none](A){1}{-8}{root}[r] +\xtTimeLineH'[draw=none](0){1}{-8}{level 1}[r] +\xtTimeLineH'[draw=none](00){1}{-8}{level 2}[r] +\xtTimeLineH'[draw=none](00-2){1}{-8}{level 3}[r] +\end{istgame} +%\end{doccode} + +\vfill +\vfill + +\clearpage + +\leavevmode +\vfill + +\begin{doccode}[listing only] +\begin{istgame}[scale=1.5,draw=blue,text=blue,font=\sffamily] +\tikzset{every node/.style={fill=white}} % action labels with white background +\tikzset{every ellipse node/.style={circle,draw=blue,minimum size=2.5em}} +\tikzset{xx/.style={circle,draw,fill,minimum size=2.5em,text=black}} % color node +\tikzset{lev/.style={level distance=#1}} +\setistmathTF*000{sffamily} +\setistgrowdirection'{east} +\xtShowEndPoints[oval node] +\def\xdist{50mm} +%% root +\istrooto(A){Root} + \istb<grow=0,lev=.4*\xdist>{1} \istb<grow=-90,lev=.7*\xdist>{0}[pos=.7] \endist +\xtdistance{.4*\xdist}{.4*\xdist} +\istrooto(Aa)(A-1) \istb{1} \istb{0} \endist +\xtdistance{.4*\xdist}{.2*\xdist} +\istrooto(Ab)(Aa-1) \istb{1} \istb{0} \endist +\istrooto(Ac)(Aa-2) \istb{1} \istb{0} \endist +%% level 1 +\istrooto(0)(A-2) + \istb<grow=0,lev=.4*\xdist>{1} \istb<grow=-90,lev=.4*\xdist>{0}[pos=.6] \endist +\xtdistance{.4*\xdist}{.2*\xdist} +\istrooto(0a)(0-1) + \istb{1}{c4}[[yellow,xx]center] % c4 + \istb{0}{c3}[[teal!50!white,xx]center] % c3 + \endist +%% level 2 & level 3 +%\xtdistance{.4*\xdist}{.4*\xdist} +\istrooto(00)(0-2) + \istb<grow=0,lev=.4*\xdist>{1}{c2}[[teal!70!white,xx]center] % c2 + \istb<grow=-90,lev=.35*\xdist>{0}{c1}[[orange,xx]center] % c1 + \endist +%% level lines +\coordinate(X0)at($(A)!.66!(0)$); +\coordinate(X1)at($(0)!.57!(00)$); +\coordinate(X2)at($(00)!.5!(00-2)$); +\xtTimeLineH'[solid](X0){1}{-8} +\xtTimeLineH'[solid](X1){1}{-8} +\xtTimeLineH'[solid,->](X2){1}{-8} +%% level texts +\xtTimeLineH'[draw=none](A){1}{-8}{root}[r] +\xtTimeLineH'[draw=none](0){1}{-8}{level 1}[r] +\xtTimeLineH'[draw=none](00){1}{-8}{level 2}[r] +\xtTimeLineH'[draw=none](00-2){1}{-8}{level 3}[r] +\end{istgame} +\end{doccode} + +\vfill +\vfill +\vfill + +\clearpage + +\href{https://tex.stackexchange.com/questions/583804/how-to-draw-this-tree-of-extensive-game-model/583895#583895}{\sourcelink{how-to-draw-this-tree-of-extensive-game-model}} + +\vfill + +\begin{doccode}[text above listing] +\begin{istgame}[edge from parent path={(\tikzparentnode) |- (\tikzchildnode.west)}] +\setistgrowdirection'{east} +\setistmathTF001 +\setxtarrowtips{latex}[very thick] +\setistNewNodeStyle{init}[rectangle,fill=gray]{1cm} +\setistNewNodeStyle{rect}[rectangle]{1cm} +\setistNewNodeStyle{circ}{1cm} +\tikzset{RR/.style={% + edge from parent path={(\tikzparentnode.east)--(\tikzchildnode.west)}}} +% tree +\xtdistance{25mm}{30mm} +\istroot(0)[init]<[xshift=3mm]-90>{\makecell[l]{Retailer\\announces\\$P$ and $T$}} + \istb<RR>[->-=.75] \endist % \usepackage{makecell} +\istrooto(1)(0-1)[rect] + \istb<grow=0,RR>[->-=.75]{Buy}[above,pos=.3] + \istb<sibling distance=60mm,level distance=65mm>{Don't buy}[above,pos=.57]{0} + \endist +\xtdistance{25mm}{30mm} +\istrooto(2)(1-1)[circ] + \istB[->-=.93]{Match}[above,pos=.72]{$m$}[below,pos=.72] + \istB[->-=.93]{Mismatch}[below,pos=.72]{$1-m$}[above,pos=.72] \endist +\xtdistance{15mm}{15mm} +\istrooto(3a)(2-1)[rect] + \istb{Keep}[above,pos=.75]{v-P} \istb{Return}[below,pos=.75]{vc-h} \endist +\istrooto(3b)(2-2)[rect] + \istb{Keep}[above,pos=.75]{s-P} \istb{Return}[below,pos=.75]{-h} \endist +% time-lines +\xtTimeLineV[dashed]([xshift=-7mm]1){3.5}{-4}{Stage I}[left=5mm] +\xtTimeLineV[dashed]([xshift=-7mm]2){3.5}{-4}{Stage II}[left=5mm] +\xtTimeLineV[dashed]([xshift=-1.5mm]3a-1){3.5}{-4}{Stage III}[left=15mm] +\xtTimeLineV[draw=none]([xshift=-1.5mm]3a-1){3.5}{-4}{\underline{Utility}}[right=2mm] +\xtTimeLineV'[draw=none]([xshift=-7mm]1){3.5}{-4}{Retailer}[left=5mm] +\xtTimeLineV'[draw=none]([xshift=-7mm]2){3.5}{-4}{Consumer}[left=5mm] +\xtTimeLineV'[draw=none]([xshift=-1.5mm]3a-1){3.5}{-4}{Consumer}[left=15mm] +\end{istgame} +\end{doccode} + +\vfill +\vfill + +\clearpage + +\vfill +\href{https://tex.stackexchange.com/questions/540711/terminal-leaf-node-circle/557469#557469}{\sourcelink{terminal-leaf-node-circle}} + +\vfill +\vfill + +\begin{doccode}[text above listing] +\begin{istgame} +\setistNewNodeStyle{max} + [regular polygon, regular polygon sides = 3]{1.5cm} +\setistNewNodeStyle{min} + [regular polygon, regular polygon sides = 3, shape border rotate = 180]{1.5cm} +\setistNewNodeStyle{chance} + [circle]{1.2cm} +\def\distFactor{20}; +\xtdistance{\distFactor mm}{4*\distFactor mm} +\setxtarrowtips[blue, thick] +\istroot(0)[max]<center, blue>{1.5} + \istb[blue, ->-] \istb \endist +\xtdistance{\distFactor mm}{2*\distFactor mm} +\istroot(1)(0-1)[chance]<center, purple>{1.5} + \istb{0.5}[al] \istb{0.5}[ar] \endist +\istroot(2)(0-2)[chance]<center, purple>{$\leq 1$} + \istb{0.5}[al] \istb{0.5}[ar] \endist +%% terminal nodes with or without circles (TRICK!!) +\xtShowEndPoints[circle,draw,minimum size=1.1cm] % before \xtShowTerminalNodes +\xtShowTerminalNodes[circle,draw=none,minimum size=1.1cm] +\xtdistance{\distFactor mm}{\distFactor mm} +\istroot(3)(1-1)[min]<center, red>{2} + \istbt{}{2}[center] \istb{}{5000}[center] \endist +\istroot(4)(1-2)[min]<center, red>{1} + \istbt{}{1}[center] \istb{}{100}[center] \endist +\istroot(5)(2-1)[min]<center, red>{0} + \istbt{}{0}[center] \istb{}{2}[center] \endist +\istroot(6)(2-2)[min] + \istb{}{-1}[center] \istb{}{0}[center] \endist +\end{istgame} +\end{doccode} + +\vfill +\vfill + +\clearpage + +\vfill + +\href{https://tex.stackexchange.com/questions/438376/game-tree-in-tikz-edge-from-parent-node-to-label-branches/438505#438505}{\sourcelink{game-tree-in-tikz-edge-from-parent-node-to-label-branches}} + +\vfill + +%\begin{doccode}[text above listing] +\begin{istgame}[font=\footnotesize] +\def\Rcar{{R_{cartel}}} +\def\Rcom{{R_{comp}}} +% tree +\tikzset{oval node/.style={box node,draw=none,outer sep=1pt}} +\xtdistance{15mm}{50mm} +\istrooto(0){Deviate or Collude} \istb \istb \endist +\istrooto(D)(0-1){Deviate} \istb \endist +\istrooto(Da)(D-1){$R_{dev}-\mbox{EDC}$} \istb \endist +\istrooto(Db)(Da-1){$\Rcom*\delta$} \istb \endist +\istrooto(Dc)(Db-1){$\Rcom*\delta^2$} \istb \endist +\istrooto(Dd)(Dc-1){$\Rcom*\delta^3$} \istb{}{\cdots} \endist + +\xtdistance{15mm}{50mm} +\istrooto(C)(0-2){Collude} \istb{\alpha}[al] \istb{1-\alpha}[ar] \endist +\istrooto(Ca)(C-1){$\Rcar-\mbox{EDC}-\mbox{F}$} \istb \endist +\istrooto(Cb)(Ca-1){$\Rcom*\delta$} \istb \endist +\istrooto(Cc)(Cb-1){$\Rcom*\delta^2$} \istb \endist +\istrooto(Cd)(Cc-1){$\Rcom*\delta^3$} \istb{}{\cdots} \endist + +\xtdistance{15mm}{50mm} +\istrooto(RC0)(C-2){$R_{cartel}$} \istb{\alpha}[al] + \istb{1-\alpha}[ar] \endist +\istrooto(RC0a)(RC0-1){$(\Rcar-\mbox{EDC}-\mbox{F})*\delta$} + \istb{}{\cdots} \endist +\istrooto(RC0b)(RC0a-1){$\Rcom*\delta^2$} + \istb \endist +\istrooto(RC0c)(RC0b-1){$\Rcom*\delta^3$} + \istb{}{\cdots} \endist + +\xtdistance{15mm}{40mm} +\istrooto(RC1)(RC0-2){$\Rcar*\delta$} + \istb{\alpha}[al] \istb{1-\alpha}[ar] \endist +\istrooto(RC1a)(RC1-1){$(\Rcar-\mbox{EDC}-\mbox{F})*\delta^2$} + \istb{}{\cdots} \endist +\istrooto(RC1b)(RC1a-1){$\Rcom*\delta^3$} + \istb{}{\cdots} \endist + +\xtdistance{15mm}{30mm} +\istrooto(RC2)(RC1-2){$\Rcar*\delta^2$} \istb{\alpha}[al] + \istb{1-\alpha}[ar] \endist +\istrooto(RC2a)(RC2-1){$(\Rcar-\mbox{EDC}-\mbox{F})*\delta^3$} + \istb{}{\cdots} \endist + +\xtdistance{15mm}{20mm} +\istrooto(RC3)(RC2-2){$\Rcar*\delta^3$} + \istb{\alpha}[al]{\cdots} \istb{1-\alpha}[ar]{\cdots} \endist +\end{istgame} +%\end{doccode} + +\vfill + +\clearpage + +\leavevmode +\vfill + +\begin{doccode}[listing only] +\begin{istgame}[font=\footnotesize] +\def\Rcar{{R_{cartel}}} +\def\Rcom{{R_{comp}}} +% tree +\tikzset{oval node/.style={box node,draw=none,outer sep=1pt}} +\xtdistance{15mm}{50mm} +\istrooto(0){Deviate or Collude} \istb \istb \endist +\istrooto(D)(0-1){Deviate} \istb \endist +\istrooto(Da)(D-1){$R_{dev}-\mbox{EDC}$} \istb \endist +\istrooto(Db)(Da-1){$\Rcom*\delta$} \istb \endist +\istrooto(Dc)(Db-1){$\Rcom*\delta^2$} \istb \endist +\istrooto(Dd)(Dc-1){$\Rcom*\delta^3$} \istb{}{\cdots} \endist + +\xtdistance{15mm}{50mm} +\istrooto(C)(0-2){Collude} \istb{\alpha}[al] \istb{1-\alpha}[ar] \endist +\istrooto(Ca)(C-1){$\Rcar-\mbox{EDC}-\mbox{F}$} \istb \endist +\istrooto(Cb)(Ca-1){$\Rcom*\delta$} \istb \endist +\istrooto(Cc)(Cb-1){$\Rcom*\delta^2$} \istb \endist +\istrooto(Cd)(Cc-1){$\Rcom*\delta^3$} \istb{}{\cdots} \endist + +\xtdistance{15mm}{50mm} +\istrooto(RC0)(C-2){$R_{cartel}$} \istb{\alpha}[al] + \istb{1-\alpha}[ar] \endist +\istrooto(RC0a)(RC0-1){$(\Rcar-\mbox{EDC}-\mbox{F})*\delta$} + \istb{}{\cdots} \endist +\istrooto(RC0b)(RC0a-1){$\Rcom*\delta^2$} + \istb \endist +\istrooto(RC0c)(RC0b-1){$\Rcom*\delta^3$} + \istb{}{\cdots} \endist + +\xtdistance{15mm}{40mm} +\istrooto(RC1)(RC0-2){$\Rcar*\delta$} + \istb{\alpha}[al] \istb{1-\alpha}[ar] \endist +\istrooto(RC1a)(RC1-1){$(\Rcar-\mbox{EDC}-\mbox{F})*\delta^2$} + \istb{}{\cdots} \endist +\istrooto(RC1b)(RC1a-1){$\Rcom*\delta^3$} + \istb{}{\cdots} \endist + +\xtdistance{15mm}{30mm} +\istrooto(RC2)(RC1-2){$\Rcar*\delta^2$} \istb{\alpha}[al] + \istb{1-\alpha}[ar] \endist +\istrooto(RC2a)(RC2-1){$(\Rcar-\mbox{EDC}-\mbox{F})*\delta^3$} + \istb{}{\cdots} \endist + +\xtdistance{15mm}{20mm} +\istrooto(RC3)(RC2-2){$\Rcar*\delta^3$} + \istb{\alpha}[al]{\cdots} \istb{1-\alpha}[ar]{\cdots} \endist +\end{istgame} +\end{doccode} + +\vfill +\vfill +\vfill -\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 Binary files differindex 5c0dcfea078..ea1cc7c4c57 100644 --- a/Master/texmf-dist/doc/latex/istgame/istgame-doc.pdf +++ b/Master/texmf-dist/doc/latex/istgame/istgame-doc.pdf diff --git a/Master/texmf-dist/doc/latex/istgame/istgame-doc.tex b/Master/texmf-dist/doc/latex/istgame/istgame-doc.tex index af88f6a5d22..52ec5a61497 100644 --- a/Master/texmf-dist/doc/latex/istgame/istgame-doc.tex +++ b/Master/texmf-dist/doc/latex/istgame/istgame-doc.tex @@ -1,22 +1,30 @@ %!TEX program = arara -% arara: xelatex: {synctex: yes} -% arara: xelatex: {synctex: yes} +% arara: pdflatex: {shell: yes, synctex: yes} +% arara: xelatex: {shell: yes, synctex: yes} % arara: makeindex: {style: istgame} -% arara: xelatex: {synctex: yes} -% arara: xelatex: {synctex: yes} +% arara: xelatex: {shell: yes, synctex: yes} +% arara: xelatex: {shell: yes, synctex: yes} -\def\tmpdate{2019/01/27} % final -\def\tmpversion{2.0} +\def\tmpdate{2022/03/22} +\def\tmpdate{\today} +\def\tmpversion{2.1} \def\printtikztreetest{} \def\printtest{} +\def\printteststar{} \def\printdoc{} %\renewcommand\printtikztreetest{\input{istgame_test_tree}} -%\renewcommand\printtest{\input{istgame_test}} -\renewcommand\printdoc{\include{istgame-doc-v2.0}} +%\renewcommand\printtest{\clearpage\input{istgame_test}} +%\renewcommand\printteststar{\clearpage\input{istgame_test-star}} +\renewcommand\printdoc{\include{istgame-doc-v\tmpversion}} +%% ====================================================== \documentclass[a4paper,amsmath]{oblivoir} +%% ====================================================== +%\documentclass[a4paper,article]{memoir} +%\renewcommand\thesection{\arabic{section}} +%\usepackage{istgame-v\tmpversion} \usepackage{istgame} \usepackage{fapapersize} @@ -25,16 +33,25 @@ \settocdepth{subsubsection} \setlength\cftsubsubsectionindent{4.5em} +%% us date +\usepackage{datetime} +\usdate \let\mytoday\today +\AtBeginDocument{\let\today\mytoday} + +\AtBeginDocument{% \renewcommand\contentsname{Table of Contents} \renewcommand\figurename{Figure} \renewcommand\tablename{Table} \renewcommand\abstractname{Abstract} \renewcommand\indexname{Index} -\renewcommand\pagerefname{\kern-4pt} +\renewcommand\pagerefname{\kern-4pt}% +} + +%\usepackage[hidelinks]{hyperref} % (memoir) \hypersetup{pdfborder={0 0 0}} % to suppress the hyperlink red box -\usepackage{mathtools} +%\usepackage{amsmath,mathtools} %\usepackage{xparse} %% oblivoir loads xparse %\usepackage{tikz} %% istgame loads tikz \usepackage{makecell} @@ -45,51 +62,73 @@ %\usepackage{url} %\setistdefaultnodedrawcolor{red} % test -%\setistdefaultnodefillcolor{black!16} % (try for macos mohave dark mode, TeXShop background color) +%\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, - listing options={ - style=tcblatex, - keywordstyle=\color{blue}, - commentstyle=\color{black!20!green}, - 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, - 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, - xtALpush,xtALshift, - xtdefaultsubrootshiftoval, - tikzstyle,draw,coordinate,foreach,setlength, - NewDocumentCommand,NewDocumentEnvironment,IfBooleanTF,tikzset, - xtCInfoset,xtCInfosetO,xtCInfosetOTurnX, - cntmpreset,cntmApreset,cntmAlayerpreset - setxtinfosetstyle,setxtarrowtips,setxtinfosetstyle - } - } - } +\tcbuselibrary{minted,xparse,listings,breakable} +\tcbset{% + listing engine=minted,breakable, +% minted language=latex, + after={\par\vspace{.5\baselineskip}\noindent} +} +\tcbset{% + colback=yellow!5!white, + colframe=blue!30, + listing outside text, + righthand width=.3\linewidth, + center upper, + center lower, + sidebyside gap=5pt, + minted style=igor, %tango, **igor, xcode, ***manni, *autumn, colorful, + listing options={% + style=tcblatex, +% keywordstyle={\color{blue}}, + commentstyle=\color{black!20!green}, +% 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, +% 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, +% xtALpush,xtALshift, +% xtdefaultsubrootshiftoval, +% tikzstyle,draw,coordinate,foreach,setlength, +% NewDocumentCommand,NewDocumentEnvironment,IfBooleanTF,tikzset, +% xtCInfoset,xtCInfosetO,xtCInfosetOTurnX, +% cntmpreset,cntmApreset,cntmAlayerpreset +% setxtinfosetstyle,setxtarrowtips,setxtinfosetstyle +% }, + }, % end of listing options +} + +\DeclareTCBListing{docstx}{ !O{} } + {colback=blue!5!white,listing only,#1} +\DeclareTCBListing{docsty}{ !O{} } + {colback=red!5!white,listing only,#1} +\DeclareTCBListing{docplain}{ !O{} } + {colback=white,colframe=gray!15,listing only,#1} +\DeclareTCBListing{doccode}{ !G{1} !O{} } + {righthand width=\expandafter#1\linewidth,#2} + %\usepackage{tikz-qtree} %%% DO NOT USE % or, add the following in the option @@ -106,14 +145,6 @@ \noindent\hangfrom{\textsc{Keywords: }}% } -\NewDocumentEnvironment{mytcblisting}{O{}} -{ \medskip - \begin{tcblisting}{#1} -} -{ \end{tcblisting} - \medskip -} - \NewExpandableDocumentCommand\xcol{mO{c|}m} {\multicolumn{#1}{#2}{\ensuremath{#3}}} @@ -124,10 +155,14 @@ \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 +\NewDocumentCommand\remark{ O{1} } + {\xmedskip{#1}\noindent \textbf{Remark: }} +\NewDocumentCommand\warning{ O{1} } + {\xmedskip{#1}\noindent \textbf{Warning: }} +% +\newcommand\sourcelink[1]{\ttfamily\color{blue}\uline{#1}} +% +%%% index %\renewcommand\cmd[1]{\cmdprint{#1}} \ExplSyntaxOn \renewcommand \cmd [1] @@ -136,6 +171,7 @@ { \cmdprint {#1} } { \textbackslash \cs_to_str:N #1 } } +\let\CMD\cmd \ExplSyntaxOff \newcommand\xw[1]{\cmd{#1}} @@ -149,9 +185,10 @@ \newcommand\ipkg[1]{\textsf{#1}\index{#1@\textsf{#1}}} \newcommand\ienv[1]{\textsf{#1}\index{#1@\textsf{#1}}} + \makeatletter \newcommand{\icmd}[1]{\cmdprint{#1}% - \index{\expandafter\@gobble\string#1@\string\cmdprint{\string#1}}} + \index{\expandafter\@gobble\string#1(@\string\cmdprint{\string#1}}} \makeatother \makeindex @@ -163,6 +200,8 @@ Draw Game Trees with \Tikz} \def\tmpclearpage{\clearpage} +\AtBeginDocument{\MakeShortVerb{\|}} + %%======================================================================= \begin{document} @@ -171,9 +210,8 @@ Draw Game Trees with \Tikz} \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 easily as drawing a game tree with pen and paper. - +This is a \LaTeX{} package that provides \Tikz-based macros to draw game trees. 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 game trees as easily as drawing game trees with pen and paper. \begin{keywords} game trees, nodes, branches, information sets, continuum of branches, subgames \end{keywords} @@ -186,8 +224,550 @@ game trees, nodes, branches, information sets, continuum of branches, subgames \printtikztreetest \printtest +\printteststar \printdoc + +%\clearpage +\setsecnumdepth{chapter} +\section{Version history} +\label{version-history} + +\begin{itemize} +%\item v\tmpversion (\tmpdate) to be uploaded to CTAN +% \begin{itemize} +% \item +% \end{itemize} +\item v2.1 (2022/03/22) uploaded to CTAN + \begin{itemize} + \item document done! + \end{itemize} +\item v2.092 (2022/03/21) + \begin{itemize} + \item working on the documentation + \item added |arrows.meta| and |bending| to the list of preloaded |tikz| libraries + \begin{itemize} + \item applied |arrows.meta| arrow tips to the related examples + \end{itemize} + \end{itemize} +\item v2.091 (2022/03/16) + \begin{itemize} + \item modified |istgame| environment to add its starred version + \begin{itemize} + \item |\begin{istgame}*| is essentially the same as |\begin{tikzpicture}| + \item but loses some feature of the \pkg{istgame} package + \end{itemize} + \item fixed all macros related information sets to remove arrow tips + \item touched |\AtBeginDocument{\setxtarrowtips}| + \item rewrote |\setistmathTF(*)| and related macros to avoid a possible conflict + \end{itemize} +\item v2.09 (2021/04/05) + \begin{itemize} + \item removed |\pgfextra| from |\istrootcntm| and |\istrootcntmA| (debugging) + \item resolved the null font problem in |\cntmistb| and |\cntmAistb| using |\l_nullfont_tl| (debugging) + \item added |\setist<...>nodesize| for |solid|, |hollow|, |ellipse|, and |rectangle| (for global setting in the preamble) + \end{itemize} +\item v2.0 (2019/01/27) uploaded 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 |\setxtinfosetstyle| + \begin{itemize} + \item introduced |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 |\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 |\xtshowXpoints| and |\xtshowXcircles| (for developer only, not documented) + \end{itemize} +%%%\item v1.99x (2019/01/24) +%%% \begin{itemize} +%%% \item changed |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 |\xtTimeLineH| and |\xtTimeLineV| to deal with swap of branches +%%% \item modified |\xtCommentTo| and |\xtCommentFrom| for the last option delimiters +%%% \end{itemize} +%%%\item v1.99w (2019/01/21) +%%% \begin{itemize} +%%% \item fixed bug in |\xtInfosetO| regarding |\xtinfosetheihtvar| for |rounded corner| +%%% \item corrected |\cntmistb| and |\cntmAistb| +%%% \begin{itemize} +%%% \item separated options for |\cntmAistb| from those for |\cntmistb| +%%% \item those two are independent to each other (except the way to deal with endpoints) +%%% \end{itemize} +%%% \item redefined |\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) |\cntmistbVariablesRestore| +%%% \item (internally introduced) |\cntmAistbVariablesRestore| +%%% \end{itemize} +%%% \item introduced |\xtHideEndPoints*| for extra work for continuum endpoints +%%% \item introduced |\cntmAlayerpreset|, with |behind| as default +%%% \item redefined |\xtShowArrows| to add an option for a node style +%%% \item changed the order of options for |\setxtshowarrows| +%%% \item changed the order of options for |\setxtarrowtips| +%%% \item renamed |\setxtmidarrows| to |\setxtarrowtips| +%%% \end{itemize} +%%%\item v1.99v (2018/01/17) +%%% \begin{itemize} +%%% \item redefined the \env{istgame} environment and |\istgameScaleCallTestAndAdjust| +%%% to take care of simultaneous use of |xscale| and |yscale|. +%%% \item modified macros to make singleton information sets scaled accordingly when needed +%%% \begin{itemize} +%%% \item |\xtInfosetO|, |\xtCInfosetO|, |\cntmAInfosetO|, |\istgameScaleCallTestAndAdjust| +%%% \item (internally) added |\xtinfosetheightvar| and |\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 |\istrootcntm|, |\istrootcntmA|, |\istrootocntm|, |\istrootocntmA|, +%%% \item redefined |\istbA|, |\istbAt| +%%% \item redefined |\cntmpreset|, |\cntmApreset| -- NEED TO GO BACK (no need call test) +%%% \end{itemize} +%%% \item redefined |\xtCInfoset| to add abbreviations for the position of owners +%%% \item redefined |\xtCInfoset| to print a singleton information set +%%% \item modified |\xtCInfoset| to change the way of input for its position (|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 |\istbA| +%%% \begin{itemize} +%%% \item code complication, inevitable to take care of too many cases +%%% \item redefined |\istroot| and |\istrooto| +%%% \item redefined |\istrootcntm| and its variants +%%% \item redefined |\istbA| and |\istbAt| +%%% \end{itemize} +%%% \end{itemize} +%%%\item v1.99s (2019/01/10) +%%% \begin{itemize} +%%% \item modified |\xtCInfosetO| for better results when swapped with \xw{plotfactor} less than 1 +%%% \item modified |\istrootcntm| and its variants for better results of shrunken continua +%%% \item redefined |\xtTimeLineH| (for a horizontal time-line) +%%% \item introduced |\xtTimeLineH(')| for a vertical time-line +%%% \item introduced |\xtCInfosetOTurnX| for turning X circles to use it just in case +%%% \end{itemize} +%%%\item v1.99r (2019/01/07) +%%% \begin{itemize} +%%% \item redefined |\istrootcntm| and |\istrootocntm| for smaller triangle continua of branches +%%% \item introduced |\cntmpreset| and |\cntmpreset*| +%%% \item put `call test' for cases of how to change level distance with |\istbA| +%%% \item modified |\xtCInfosetO| and |\cntmAInfosetO| for coloring +%%% \end{itemize} +%%%\item v1.99q (2019/01/05) +%%% \begin{itemize} +%%% \item modified |\xtInfosetO| to print a singleton information set by a circle. +%%% \item finished fine-tuning |\cntmAInfosetO| (for tuning base circles) +%%% \end{itemize} +%%%\item v1.99p (2019/01/02) +%%% \begin{itemize} +%%% \item redefined |\xtInfoset| and |\xtInfosetO| in accordance with new |\xtCInfosetO| +%%% \item redefined completely |\cntmAInfoset| and |\cntmAInfsetO| in the way of |\xtCInfosetO| +%%% \item redefined |\cntmAInfoset|, |\cntmAInfosetO|, |\istrootcntmA|, and |\istrootocntmA| +%%% \begin{itemize} +%%% \item to compensate the dependency of arcs on the ratio of |\cntmlevdist| to |\cntmsibdist| +%%% \end{itemize} +%%% \end{itemize} +%%%\item v1.99o (2018/12/31) +%%% \begin{itemize} +%%% \item redefined completely |\xtCInfosetO| and |\xtCInfoset| for enhancement +%%% \begin{itemize} +%%% \item (internally) added |\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 |\setistmathTF*| to make it work with basic text font styles +%%% \begin{itemize} +%%% \item |\istownertextfont|, |\istactionlabeltextfont|, |\istpayofftextfont| +%%% \item all working only in text mode +%%% \end{itemize} +%%% \item introduced |\xtcureslopedlabelsNS| and |\xtcureslopedlabelsEW| to resolve a \Tikz\ conflict to sloped labels +%%% \begin{itemize} +%%% \item (internally) added |\xtlevdistadj| and |\xtsibdistadj| +%%% \end{itemize} +%%% \end{itemize} +%%%\item v1.99m (2018/12/21) +%%% \begin{itemize} +%%% \item added starred versions that work with |\setistmathTF| +%%% \begin{itemize} +%%% \item |\xtInfoset*|, |\xtInfosetO*|, |\xtCInfoset|, |\xtCInfosetO| +%%% \item |\xtOwner*|, |\xtActionLabel*|, |\xtPayoff*|, |\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 |\xtCInfosetO|, |\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 |\xtCInfosetO| for bubble type curved information sets +%%% \begin{itemize} +%%% \item (internally) added |\xtPrototypeForCInfosetO| -- only for |\xtCInfosetO| +%%% \end{itemize} +%%% \end{itemize} +%%%\item v1.99j (2018/12/11) +%%% \begin{itemize} +%%% \item introduced |\xtCInfoset| for curved information sets +%%% \begin{itemize} +%%% \item (internally) added |\istgameScaleCallTestAndAdjust| (must be used in a group) +%%% \item (internally) added |\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 |\cntmAInfosetO| +%%% \item introduced |\cntmAexpostShowEndPoints| +%%% \item introduced |\istbA(*)| and |\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 |\cntmarcInfoset| +%%% \end{itemize} +%%%\item v1.99g (2018/09/30) +%%% \begin{itemize} +%%% \item put |\xtShowArrows| and |\xtShowMidArrows| into |\istB| +%%% \item found issues with |\xtShowArrows| and |\xtShowMidArrows| related to \xw{postaction} +%%% \item added the arrow end shorten option to |\xtCommentTo| and |\xtCommentFrom|. +%%% \item (internal) minor changes +%%% \begin{itemize} +%%% \item redefined |\setistSolidNodeStyle| to keep consistency with other node styles +%%% \item redefined |\setistNullNodeStyle| to keep consistency with other node styles +%%% \end{itemize} +%%% \end{itemize} +%%%\item v1.99f (2018/09/19) +%%% \begin{itemize} +%%% \item (internally) redefined |\cntmistb| and |\cntmarcistb| to resolve endpoints problems +%%% \begin{itemize} +%%% \item (internally) added |\cntmOUTERistb| and |\cntmarcOUTERistb| +%%% \item (internally) removed |\cntmendpointsShow| and |\cntmendpointsPrint| +%%% \item (internally) redefined |\istrootcntm| and its variants accordingly +%%% \end{itemize} +%%% \end{itemize} +%%%\item v1.99e (2018/09/15) +%%% \begin{itemize} +%%% \item introduced |\xtShowArrows| and |\xtHideArrows(*)| +%%% \item introduced |\setxtshowarrows| +%%% \item introduced |\xtShowMidArrows| and |\xtHideMidArrows| +%%% \end{itemize} +%%%\item v1.99d (2018/09/13) +%%% \begin{itemize} +%%% \item introduced |\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 |\cntmistb| and |\cntmarcistb| +%%% \item redefined |\cntmdistance| to check if |\cntmactsibdist| is called or not +%%% \item (internally) added |\cntmendpointsShow| +%%% \begin{itemize} +%%% \item redefined |\xtShowEndPoints| and |\xtHideEndPoints| accordingly +%%% \item introduced |\xtShowEndPoints*| (for outermost branches of a continuum) +%%% \end{itemize} +%%% \item (internally) added |\cntmendpointsPrint| +%%% \begin{itemize} +%%% \item redefined |\istrootcntm| and its variants accordingly +%%% \end{itemize} +%%% \end{itemize} +%%%\item v1.99b (2018/09/07) +%%% \begin{itemize} +%%% \item redesigned |\istrootcntm| and its variants +%%% \begin{itemize} +%%% \item removed |\ISTCntm(')| and |\ISTCntmArc(')| +%%% \end{itemize} +%%% \item introduced |\cntmdraw|, |\cntmdrawset| and related macros +%%% \item redfined |\cntmdistance| to check if |\cntmactsibdist| is called or not +%%% \end{itemize} +%%%\item v1.99a (2018/09/05) +%%% \begin{itemize} +%%% \item introduced |\setistgameshorten| (for \env{istgame} environment option) +%%% \end{itemize} +%%%\item v1.98 (2018/09/03) +%%% \begin{itemize} +%%% \item redefined |\istrootcntm(arc)| to make it work with |\setistmathTF(*)| +%%% \item redefined |\istrootocntm(arc)| to make it work with |\setistmathTF(*)| +%%% \end{itemize} +%%%\item v1.97 (2018/09/02) +%%% \begin{itemize} +%%% \item redefined |\istroot(o)| to resolve tex expansion problems +%%% \item redefined |\istrootcntm(arc)| to resolve tex expansion problems +%%% \item redefined |\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 |\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 |\cntmdistance| +%%% \item added |\xtOwner*|, |\xtActionLabel*|, |\xtPayoff*| (working with |\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 |\setistmath| to set input mode for owners, action labels, and payoffs +%%% \item introduced |\setistmath*| to print action labels in italics, in case of text mode +%%% \item (internally) added |\istownerstyle|, |\istactionlabelstyle|, and |\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 |\xtscale|, |\xtxscale|, and |\xtyscale| to save scale option values +%%% \end{itemize} +%%% \item tested to apply scale values to improve the result of |\xtInfosetO| +%%% \end{itemize} +%%%\item v1.91 (2018/08/16) +%%% \begin{itemize} +%%% \item many changes to resolve expansion problems +%%% \begin{itemize} +%%% \item redefined |\cntmset|, |\cntmarcset|, and related macors +%%% \item redifined |\cntmlevdist| and |\cntmsibdist| as lengths +%%% \end{itemize} +%%% \end{itemize} +%%%\item v1.9 (2018/08/11) +%%% \begin{itemize} +%%% \item introduced |\cntmarcplotfactorset| +%%% \end{itemize} +%%%\item v1.8 (2018/08/09) +%%% \begin{itemize} +%%% \item made possible to use the directional abbreviations with |\xtInfoset| +%%% \item introduced |\istrootocntm| and |\istrootocntmarc| (oval versions) +%%% \end{itemize} +%%%\item v1.7 (2018/08/04) +%%% \begin{itemize} +%%% \item introduced |\istbm| +%%% \item introduced |\setistNewNodeStyle| +%%% \end{itemize} +%%%\item v1.6 (2018/08/01) +%%% \begin{itemize} +%%% \item resigned |\cntmdistance| (now ready for users) +%%% \begin{itemize} +%%% \item added |\cntmactsibdist| to distinguish it from |\cntmsibdist| +%%% \end{itemize} +%%% \item added |\cntmdistance*| to incorporate with |\xtdistance| +%%% \item introduced |\istrootcntmA(')| +%%% \begin{itemize} +%%% \item added (internally) |\ISTCntmArc(')| +%%% \item added |\cntmarcset| +%%% \end{itemize} +%%% \item introduced |\istrootcntm(')| +%%% \begin{itemize} +%%% \item added (internally) |\ISTCntm(')| +%%% \end{itemize} +%%% \item (internally) renamed |\istCntmRoot(Arc)| to |\obsoleteISTCntm(Arc)| +%%% \end{itemize} +%%%\item v1.5 (2018/07/26) +%%% \begin{itemize} +%%% \item introduced |\setxtinfosetlayer| +%%% \item introduced |\setxtsubgamelayer| +%%% \end{itemize} +%%%\item v1.4 (2018/07/12) +%%% \begin{itemize} +%%% \item completely rewrote |\xtInfosetO| to deal with sloped information sets +%%% \begin{itemize} +%%% \item removed |\xtInfosetO'| and |\xtInfoset'| (critical change for users!) +%%% \end{itemize} +%%% \end{itemize} +%%%\item v1.3 (2018/07/06) +%%% \begin{itemize} +%%% \item (internally) renamed some macros (such as |\xt@...|) +%%% \item (internally) renamed |\xtaction| to |\istaction| +%%% \item (internally) renamed |\xtpayoff| to |\istpayoff| +%%% \item (internally) renamed |\istRoot(O)| to |\ISTRoot(O)| +%%% \end{itemize} +%%%\item v1.2 (2017/12/11) +%%% \begin{itemize} +%%% \item replaced |\istb.| by |\istbt| (critical change for users!) +%%% \begin{itemize} +%%% \item |\istb| redefined accordingly +%%% \item this is the cost of introducing |\istB(*)| +%%% \end{itemize} +%%% \item introduced |\istB(*)| to deal with dual action labels +%%% \item added |\istbt(*)| and |\istBt(*)| +%%% \item added \xw{text depth=.25ex} as an option to |\istroot| and |\istrooto| +%%% \end{itemize} +%%%\item v1.1 (2017/10/02) +%%% \begin{itemize} +%%% \item introduced |\xtCommentTo| and |\xtCommentFrom| +%%% \item introduced |\xtTimeLineH(')| +%%% \item redefined |\xtActionLabel| to deal with sloped labels +%%% \item replaced |\tikzstyle| by |\tikzset| +%%% \end{itemize} +\item v1.0 (2017/09/04) + \begin{itemize} + \item introduced |\cntmlevdist| and |\cntmsibdist| + \item introduced |\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 |\cntmlevdist| and |\cntmsibdist| +%%% \item introduced |\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 |\istb| to get better alignment of action labels +%%% \end{itemize} +%%%\item v0.99f (2017/08/02) +%%% \begin{itemize} +%%% \item redefined |\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 |\istroot(')| +%%% \item defined |\istrooto(')| to replace |\istroot*| +%%% \begin{itemize} +%%% \item |\istroot*| completely replaced by |\istrooto| +%%% \end{itemize} +%%% \item redefinde |\istcntm| +%%% \item defined |\istcntmarc| +%%% \begin{itemize} +%%% \item |\istcntm*| completely replaced by |\istcntmarc| +%%% \end{itemize} +%%% \item redefined |\xtInfoset(')| and |\xtInfosetOwner(')| +%%% \item introduced |\xtInfosetO(')| +%%% \begin{itemize} +%%% \item |\xtInfoset*| completely replaced by |\xtInfosetO| +%%% \end{itemize} +%%% \item introduced |\xt@growswap| introduced +%%% \item redefined |\xtNode| accordingly +%%% \end{itemize} +%%%\item v0.99d (2017/07/27) +%%% \begin{itemize} +%%% \item defined |\xtSubgameBox(*)| and |\xtSubgameOval(*)| to express a subgame +%%% \end{itemize} +%%%\item v0.99c (2017/07/20) +%%% \begin{itemize} +%%% \item defined |\xtgrow| to deal with going `clockwise' of branch arrangement +%%% \item defined |\setxtgrowkey| to change between \xw{grow} and \xw{grow'} +%%% \item introduced |\setistgrowdirection'| by redefining |\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 |\setistPlainNodeStyle| +%%% \item defined |\xtNode*| (for a terminal node text with a plain node) +%%% \item redefined |\xt<...>NodeStyle| (now all arguments are optional) +%%% \item renamed |\isthorizontallabelshift| as |\istactionlabelxshift|, with default \xw{1pt} +%%% \item renamed |\istverticallabelshift| as |\istactionlabelyshift|, with default \xw{2pt} +%%% \end{itemize} +%%%\item v0.99a (2017/03/10) +%%% \begin{itemize} +%%% \item started rewriting package manual +%%% \item introduced |\istb.|\ (for terminal nodes) +%%% \item redefined |\xtShowTerminalNodes| +%%% \item introduced |\xtShowEndPoints| and |\xtHideEndPoints| +%%% \item redefined |\xtInfoset*|, with |\xtdefaultinfosep| added +%%% \end{itemize} +%%%\item v0.9 (2017/02/13) +%%% \begin{itemize} +%%% \item some internal macro names changed (|\xtnode|, |\xttnode|,|\xtshowtnode|) +%%%% \item conflict with \pkg{tikz-qtree} resolved. (\env{istgame} differs from \env{tikzpicture} with \pkg{tikz-qtree}) +%%%% \item |\setistbranchanchors| added +%%% \item added \xw{zero node} +%%% \end{itemize} +%%%\item v0.8 (2017/01/17) +%%% \begin{itemize} +%%% \item macro names changed +%%% \begin{itemize} +%%% \item |\xtdistance|: prefix `\xw{x}' changed to `\xw{xt}' meaning `extensive tree' +%%% \item |\xtInfoset(*)|, |\xtInfosetOwner|, |\xtActionLabel|, |xtOwner|, |\xtPayoff|, |\xtNode| +%%% \item |\xtShowTerminalNodes|, |\xtHideTerminalNodes| +%%% \item |\xtlevdist|, |\xtsibdist| +%%% \end{itemize} +%%% \item |\xtNode| redefined +%%% \item some internal macro names changed (including |\xtpayff|, |\xtmove|) +%%% \item node styles redefined +%%% \item |\setist<Solid>NodeStyle| added for <Various> node styles +%%% \item |\setistdefaultnodecolor|, |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 \xw{game tree} topic at \url{https://tex.stackexchange.com/}. +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.~(2021), ``\TikZ\ and PGF: Manual for version 3.1.9a,'' \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} + +\clearpage \printindex \end{document} diff --git a/Master/texmf-dist/tex/latex/istgame/istgame.sty b/Master/texmf-dist/tex/latex/istgame/istgame.sty index 04d00fc4448..aedda3a86c7 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-2019 In-Sung Cho <ischo at ktug.org> +%% (C) Copyright 2015-2022 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,7 +11,7 @@ %% http://www.latex-project.org/lppl.txt. %% %% ------------------------------------------------- -\ProvidesPackage{istgame}[2019/01/27 v2.0 Draw Game Trees with TikZ] +\ProvidesPackage{istgame}[2022/03/22 v2.1 Draw Game Trees with TikZ] % expl3,xparse: LPPL % tikz: LPPL and/or GNU GPL @@ -19,10 +19,11 @@ \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 , % for information sets and subgames + fit , % for \xtSubgameBox(Oval) + decorations.markings , % for \xtShowArrows and middle arrows + patterns , intersections , % for additional use + arrows.meta , bending % added in version 2.1 } % backgrounds @@ -288,14 +289,14 @@ % \istownerstyle \NewDocumentCommand \istownerstyle { m } { - \ifnum 1 = \istmathflagowner - \ensuremath {#1} - \else - \expandafter \csname \ist@owner@text@font \endcsname {#1} % owner text font - \fi + \int_compare:nTF { \istmathflagowner == 1 } + { \ensuremath {#1} } + { + \tl_if_empty:NF \ist@owner@text@font + { \exp_args:No \use:c { \ist@owner@text@font } } {#1} % owner text font + } } - % action labels: (default: mathtrue) \newcount\istmathflagactionlabel @@ -311,11 +312,12 @@ % \istactionlabelstyle \NewDocumentCommand \istactionlabelstyle{m} { - \ifnum 1 = \istmathflagactionlabel - \ensuremath {#1} - \else - \expandafter \csname \ist@actionlabel@text@font \endcsname {#1} % AL text font - \fi + \int_compare:nTF { \istmathflagactionlabel == 1 } + { \ensuremath {#1} } + { + \tl_if_empty:NF \ist@actionlabel@text@font + { \exp_args:No \use:c { \ist@actionlabel@text@font } } {#1} % AL text font + } } % payoffs: (default: mathtrue) @@ -333,26 +335,27 @@ % \istpayoffstyle \NewDocumentCommand \istpayoffstyle{m} { - \ifnum 1 = \istmathflagpayoff - \ensuremath {#1} - \else - \expandafter \csname \ist@payoff@text@font \endcsname {#1} % payoff text font - \fi + \int_compare:nTF { \istmathflagpayoff == 1 } + { \ensuremath {#1} } + { + \tl_if_empty:NF \ist@payoff@text@font + { \exp_args:No \use:c { \ist@payoff@text@font } } {#1} % payoff text font + } } % \setistmathTF(*) -% * {} {} {} <owner font> [action labels font] {payoff font] +% * {} {} {} <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} - { - \istownertextfont { #5 } - \istactionlabeltextfont { #6 } - \istpayofftextfont { #7 } - } + \int_compare:nTF { #2 == 1 } { \istownermathtrue } { \istownermathfalse } + \int_compare:nTF { #3 == 1 } { \istactionlabelmathtrue } { \istactionlabelmathfalse } + \int_compare:nTF { #4 == 1 } { \istpayoffmathtrue } { \istpayoffmathfalse } + \IfBooleanT {#1} + { + \istownertextfont { #5 } + \istactionlabeltextfont { #6 } + \istpayofftextfont { #7 } + } } @@ -423,7 +426,7 @@ %---syntaxoff----- % \ISTRoot % (used in \istroot) -% ' [grow] (root) (at) [node] <angle> {owner} +levdis..sibdist+ +% ' [grow] (root) (at) [node] <angle> {owner} +levdist..sibdist+ \NewDocumentCommand \ISTRoot { t' O{south} r() D(){0,0} O{} D<>{} G{} D+.{\xtlevdist} D.+{\xtsibdist} } { @@ -512,7 +515,7 @@ } } -%% istgame environment +%% istgame environment (can be used in the preamble) \def\istgame@default@fontsize { \normalsize } \def\istgame@default@arrowend@shorten { 0pt } % 0pt needed, otherwise affects all the lines @@ -527,6 +530,31 @@ \renewcommand*{\istgame@default@arrowend@shorten} {#1} } +%% (2021/04/09) +%% more global macros (can be used in the preamble) + +\NewDocumentCommand \setistsolidnodesize { m } +{ + \renewcommand*{\istdefault@solid@node@size} {#1} +} + +\NewDocumentCommand \setisthollownodesize { m } +{ + \renewcommand*{\istdefault@hollow@node@size} {#1} +} + +\NewDocumentCommand \setistellipsenodesize { m } +{ +% \renewcommand*{\istdefault@ellipse@node@size} {#1} + \renewcommand*{\istellipsenodesize} {#1} +} + +\NewDocumentCommand \setistrectagnlenodesize { m } +{ + \renewcommand*{\istdefault@rectangle@node@size} {#1} +} + + % get ready for checking (x)(y)scale option \clist_new:N \l_parseopt_clist @@ -564,7 +592,50 @@ } -\DeclareDocumentEnvironment {istgame} { O{} } % accepts tikzpicture options +% to resolve TikZ problem: sloped label conflict with x-y-scale +% temporary solution (experimental) + +% \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} +} + + +%%% istgame: main environment +\DeclareDocumentEnvironment {istgame} { s O{} } % accepts tikzpicture options { % call set (false) \bool_set_false:N \cntm_distance_call_bool % to distinguish cntm sibdist @@ -580,9 +651,21 @@ \bool_set_false:N \_cntm_distance_local_call_bool % for \istbA \bool_set_false:N \_cntmA_distance_local_call_bool % for \istbA + \IfBooleanTF { #1 } + { + \def\xtxscale{1} + \def\xtyscale{1} + \def\xtscale{1} + + \def\xtcureslopedlabelsNS{} + \def\xtcureslopedlabelsEW{} + + \begin{tikzpicture} [ #2 ] + } + { % extract the value of xscale/yscale/scale % (extract scale value, only if it is used alone) - \clist_set:Nn \l_parseopt_clist { #1 } + \clist_set:Nn \l_parseopt_clist { #2 } \tl_gset:Nn \xtxscale {1.0} \tl_gset:Nn \xtyscale {1.0} \tl_gset:Nn \xtscale {1.0} @@ -623,14 +706,15 @@ { \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 } + \clist_put_left:No \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 ] + } } { \end{tikzpicture} @@ -683,46 +767,6 @@ } } -% to resolve TikZ problem: sloped label conflict with x-y-scale -% temporary solution (experimental) - -% \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} -} %% --------------- %% core macro part @@ -743,7 +787,7 @@ edge~from~parent [ #1 ] node [ above~left , text~depth = .25ex , xshift = \istactionlabelxshift , yshift = -\istactionlabelyshift ] - {\istactionlabelstyle{#3} } + { \istactionlabelstyle{#3} } } { ar } { edge~from~parent [ #1 ] @@ -1174,17 +1218,26 @@ % \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} } ; + {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} } @@ -1206,10 +1259,10 @@ \str_if_eq:nnTF { #3 } { #4 } {% singleton infoset with a circle \begin{pgfonlayer}{\xtinfosetlayer} - \draw (xtinfoA) node [ - , draw , circle , samples=500 , inner~sep = 0pt, + \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} } ; + \draw [ draw = none , - ] (#3) node [ - , #6 ] { \istownerstyle{#5} } ; } {% connecting two nodes \renewcommand*\xtinfosetheight {#7} @@ -1225,8 +1278,8 @@ 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) + \draw [ draw = none , - ] (xtinfoA) to + [ edge~node = { node [ - , #6 ] { \istownerstyle{#5} } } ] (xtinfoB) ; % (in group) \end{pgfonlayer} } \end{scope} @@ -1546,7 +1599,7 @@ plot [ smooth ] coordinates { (xtA) (xtC) (xtB) } ; % detoured abbreviations (\node at (xtC) [ above , #8 ] { \istownerstyle{#7} } ;) \xtCInfosetAbbreviations {#8} - \expandafter \node \xtcioptionstring { \istownerstyle{#7} }; + \expandafter \node \xtcioptionstring [-] { \istownerstyle{#7} }; \end{pgfonlayer} \end{scope} } @@ -1604,11 +1657,13 @@ \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] {} ; + \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} } ; + \node at (#3) [ - , #8 ] { \istownerstyle{#7} } ; \else \edef\xtciplotfactor{#6} \def\xtcitension{1} @@ -1629,25 +1684,31 @@ \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) ; + \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) ; + \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} } ; + 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} @@ -1703,10 +1764,12 @@ % X circles \ifxtXcircles \ifxtXcircleX - \node at (xtA) [-,circle,draw=blue,opacity=.5,minimum size=\tosstoxtXcircles ] {} ; + \node at (xtA) [ - , circle , draw=blue , opacity=.5 , + minimum size=\tosstoxtXcircles ] {} ; \fi \ifxtXcircleY - \node at (xtB) [-,circle,draw=red,opacity=.5,minimum size=\tosstoxtXcircles ] {} ; + \node at (xtB) [ - , circle , draw=red , opacity=.5 , + minimum size=\tosstoxtXcircles ] {} ; \fi \fi %++++++++++++++++++++++++++++++++++++ @@ -1843,24 +1906,32 @@ \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) ; + \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) ; + \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 ; + 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} %++++++++++++++++++++++++++++++++++++ @@ -1912,10 +1983,12 @@ % X circles \ifxtXcircles \ifxtXcircleX - \node at (ciA) [-,circle,draw=blue,opacity=.5,minimum size=\tosstocntmXcircles ] {} ; + \node at (ciA) [ - , circle , draw=blue , opacity=.5, + minimum size=\tosstocntmXcircles ] {} ; \fi \ifxtXcircleY - \node at (ciB) [-,circle,draw=red,opacity=.5,minimum size=\tosstocntmXcircles ] {} ; + \node at (ciB) [ - , circle , draw=red , opacity=.5 , + minimum size=\tosstocntmXcircles ] {} ; \fi \fi %++++++++++++++++++++++++++++++++++++ @@ -2010,7 +2083,10 @@ % USE this BEFORE \istrootcntm % * [ line opt ] { LEFT AL } [ LEFT pos ] { RIGHT AL } [ RIGHT pos ] \NewDocumentCommand \cntmistb{ s O{} +G{} O{} +G{} O{} } -{ +{ + % to resolve the nullfont problem (ndh) + \tl_set_eq:NN \l_nullfont_tl \cntm@show@endpoint + \renewcommand*\cntmbranchopt { - , draw=none, #2 } \renewcommand*\cntmLeftAL {#3} \renewcommand*\cntmRightAL {#5} @@ -2062,8 +2138,8 @@ { % 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 + { % obey \xtShowEndPoints* and toss the value to \istrootcntm(A) via \cntmOUTERistb + \tl_set:NV \cntm@show@endpoint \l_nullfont_tl % (ndh) } } @@ -2076,6 +2152,9 @@ % * [ line opt ] { LEFT AL } [ LEFT pos ] { RIGHT AL } [ RIGHT pos ] \NewDocumentCommand \cntmAistb { s O{-} +G{} O{} +G{} O{} } { + % to resolve the nullfont problem (ndh) + \tl_set_eq:NN \l_nullfont_tl \cntm@show@endpoint + \renewcommand*\cntmAbranchdrawopt {#2} \renewcommand*\cntmALeftAL {#3} \renewcommand*\cntmARightAL {#5} @@ -2127,8 +2206,8 @@ { % 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 + { % obey \xtShowEndPoints* and toss the value to \istrootcntm(A) via \cntmOUTERistb + \tl_set:NV \cntm@show@endpoint \l_nullfont_tl % (ndh) } } @@ -2426,7 +2505,7 @@ % 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) + \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 @@ -2641,7 +2720,7 @@ % 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) + \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 @@ -3225,7 +3304,7 @@ % \setxtarrowtips -% to toss values to arrow tip styls +% to toss values to arrow tip styles \NewDocumentCommand \setxtarrowtips { D<>{ \xt@default@arrow@pos } @@ -3238,7 +3317,7 @@ \renewcommand*\xtarrowopt { - , thin , solid , shorten~> = 0 , #3} } % initial set for defaults -\setxtarrowtips +\AtBeginDocument{\setxtarrowtips} % variable style [->]: % accepts an option value changed by \xtarrowopt (this is better) |