Debian Codegraph @

texmf-dist/doc/latex/istgame/istgame-doc-v2.1.1.tex

raw
1 %!TEX root = istgame-doc.tex
2 %\begin{document}
3
4 \setcounter{section}{-1}
5
6 \section{Changes and remarks}
7
8 \subsection{Changes in version 2.1}
9 \label{ssec:changes2.1}
10
11 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.
12
13 \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.
14 \begin{itemize}
15 \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.)
16 \item |\begin{istgame}*| may be slightly faster than |\begin{istgame}| as it does not collect this information.
17 \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|).
18 \item With |\begin{istgame}*|:
19 \begin{itemize}
20 \item |\xtxscale|, |\xtyscale|, and |\xtscale| have no effect.
21 \item |\xtcureslopedlabelsNS| and |\xtcureslopedlabelsEW| do nothing.
22 \item The oval type information sets |\xtInfosetO|, |\xtCIfnosetO|, and |\cntmAInfosetO| may be distorted.
23 \item |\setistgamefontsize| and |\setistgameshorten| have no effect.
24 \item The initial \Tikz\ arrow style (but not |>=stealth|) is used.
25 \end{itemize}
26 %\end{istgame}
27 %\end{tikzpicture}
28 %\end{istgame}
29 %\end{istgame}
30 %\end{istgame}
31 \end{itemize}
32
33 It is recommended to use the standard \env{istgame} environment,
34 when you use the oval type information sets and sloped labels with \Tikz\ scaling.
35 \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).
36
37 \xbigskip1
38 Here are some examples to show that the \env{istgame} environment can automatically achieve the best results.
39
40 \begin{doccode}{.3}
41 % asymmetric scaling: distorted oval information sets
42 \begin{istgame}*[xscale=1.5,yscale=.9] % starred
43 \setistgrowdirection'{south east}
44 \istroot(0) \istb \istb* \endist
45 \istroot(1)(0-1){2} \istb* \istb* \endist
46 \xtInfosetO[fill=red!20,ellipse](0)(0-2){1}
47 \xtInfosetO(1)(1)
48 \xtInfosetO[fill=blue!40,opacity=.5]
49 (1-1)(1-2){3}(1.5em)
50 \end{istgame}
51 \end{doccode}
52
53 \begin{doccode}{.3}
54 % Oval information sets do not depend on scaling
55 \begin{istgame}[xscale=1.5,yscale=.9]
56 \setistgrowdirection'{south east}
57 \istroot(0) \istb \istb* \endist
58 \istroot(1)(0-1){2} \istb* \istb* \endist
59 \xtInfosetO[fill=red!20,ellipse](0)(0-2){1}
60 \xtInfosetO(1)(1)
61 \xtInfosetO[fill=blue!40,opacity=.5]
62 (1-1)(1-2){3}(1.5em)
63 \end{istgame}
64 \end{doccode}
65
66
67 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.)
68
69 \begin{doccode}{.3}
70 % tikz tree's sloped labels problem:
71 \begin{istgame}*[xscale=2,font=\footnotesize] % starred
72 \xtcureslopedlabelsNS % does nothing
73 \istroot(0)
74 \istb[dashed,thick]{Left}[above,sloped]
75 \istb[->]{Center}[above,sloped]
76 \istb[draw=blue,thick]{Right}[above,sloped]
77 \endist
78 \end{istgame}
79 \end{doccode}
80
81 The macro |\xtcureslopedlabelsNS| solves this problem only when you use the standard version of \env{istgame}.
82
83 \begin{doccode}{.3}
84 % tikz tree's sloped labels problem: solved
85 \begin{istgame}[xscale=2,font=\footnotesize]
86 \xtcureslopedlabelsNS
87 \istroot(0)
88 \istb[dashed,thick]{Left}[above,sloped]
89 \istb[->]{Center}[above,sloped]
90 \istb[draw=blue,thick]{Right}[above,sloped]
91 \endist
92 \end{istgame}
93 \end{doccode}
94
95 \paragraph{New macros to set the default node sizes:}
96 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.
97
98 In the following example you can see the effect of |\setistsolidnodesize{.5\pgflinewidth}|. The default size of a |solid| node is |2.4pt|.
99
100 \begin{doccode}[text above listing]
101 % \setistsolidnodesize
102 \begin{istgame}
103 \istroot(0)(0,0) \istb* \istb* \istb* \endist
104 \istroot(c)(0-3) \istb* \istb* \endist
105 \setistsolidnodesize{.5\pgflinewidth} % solid node size changed
106 \istroot(0)(6,0) \istb* \istb* \istb* \endist
107 \istroot(c)(0-3) \istb* \istb* \endist
108 \end{istgame}
109 \end{doccode}
110
111
112 \paragraph{Some more:}
113 The update to version 2.1 includes a few bug fixes and minor changes.
114 (See the version history on page~\pageref{version-history}.)
115
116 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}.
117
118 \subsection{Changes in version 2.0}
119
120 Some macros have been \textsc{changed} and \textsc{removed} in version 2.0.
121 Those who have used these changed and removed macros may want to \textsc{find} and \textsc{replace} the followings:
122
123 %\begin{center}
124 %\begin{tabu} {X[l1.5]X[l1.5]} \toprule %to .5\linewidth
125 %\makecell[l]{\textbf{ver. 1.0}} & \makecell[l]{\textbf{ver. 2.0 or later}} \\\midrule
126 %|\istb.| & |\istbt| \\\tabucline-
127 %|\xtInfoset'| & |\xtInfoset| \\\tabucline-
128 %|\xtInfosetO'| & |\xtInfosetO| \\\tabucline-
129 %|\setistgrowkey| & |\setxtgrowkey| \\\tabucline-
130 %\end{tabu}
131 %\end{center}
132
133 \begin{center}
134 \begin{tabular} {lll} \toprule
135 \makecell[l]{\textbf{ver. 1.0}} & \makecell[l]{\textbf{ver. 2.0 or later}} \\\midrule
136 |\istb.| & |\istbt| \\\cline{1-2}
137 |\xtInfoset'| & |\xtInfoset| \\\cline{1-2}
138 |\xtInfosetO'| & |\xtInfosetO| \\\cline{1-2}
139 |\setistgrowkey| & |\setxtgrowkey| \\\cline{1-2}
140 \end{tabular}
141 \end{center}
142
143 \paragraph{Changed and removed macros}
144
145 \begin{itemize}\tightlist
146 \item The macro name |\istb.|(terminal version) has been changed
147 to |\istbt| (terminal version).
148 \begin{itemize}
149 \item This is the opportunity cost of having a new macro |\istB| (dual action label version).
150 \end{itemize}
151 \item The two (unsatisfactory) macros |\xtInfoset'| and |\xtInfosetO'| have been removed.
152 \begin{itemize}
153 \item The macro |\xtInfosetO| is completely redesigned,
154 so that we do not need the macro |\xtInfosetO'| any more.
155 \item No reasons could be found to keep (even for the backward compatibility)
156 the swap versions |\xtInfoset'| and |\xtInfosetO'|,
157 except for the inconvenience to do `find and replace.'
158 \end{itemize}
159 \item|\setistgrowkey| is renamed to |\setxtgrowkey| for consistency in macro naming.
160 \end{itemize}
161
162
163 \paragraph{Redesigned macros and the environment}
164
165 \begin{itemize}\firmlist
166 \item |\xtInfosetO| is completely redefined to improve its function:
167 \begin{itemize}
168 \item Now a \emph{sloped} information set is possible.
169 \item It connects two nodes like |\xtInfosetO(coor1)(coor2)|,
170 but if the two coordinates are identical it represents a \emph{singleton information set}
171 by a \emph{circle} by default.
172 \item This change does not seem to cause much harm, but be aware that
173 the swap version |\xtInfosetO'| has been removed and replaced by |\xtInfosetO|.
174 \item Be aware also that the way to change the \emph{height} (|1em| by new default)
175 of an information set has been \emph{changed},
176 though you might not see much difference if you have only used the default information sets.
177 \item With \emph{new macros} |\xtCInfoset| and |\xtCInfosetO|, a curved (even skewed curved) information set is now possible.
178 \end{itemize}
179 \item \env{istgame} environment: (internal change)
180 \begin{itemize}
181 \item Now the each value of the option of |xscale| and |yscale|, if exists,
182 is extracted and saved at |\xtxscale| and |\xtyscale|, respectively.
183 The value of |scale| is also saved at |\xtscale|
184 only when it is used without |xscale| nor |yscale|.
185 These values are internally used to get the best outputs of trees in many ways.
186 \item If the \Tikz\ arrow option |->| exists in the option list of an \env{istgame} environment,
187 you can globally control the arrow-end-shorten value (by default, |shorten >=0pt|)
188 by using a new macro |\setistgameshorten|.
189 This is to get a better result of branches with arrows.
190 \end{itemize}
191 \item Some changes that you might not notice have been made, including:
192 \begin{itemize}
193 \item The core macros |\istroot|, |\istb|, and |\endist| have literally been redefined
194 for some purposes, but this makes no difference to users.
195 \item The options |thin| and |solid| have been added to the definitions of basic node styles.
196 \item Some default values have been slightly changed.
197 \end{itemize}
198 \end{itemize}
199
200
201 \subsection{What's new in version 2.0}
202
203 \paragraph{Some new functions}
204
205 \begin{itemize}\tightlist
206 \item \emph{input mode changer} (math or text) for important labels: owners, action labels, and payoffs
207 \begin{itemize}\tightlist
208 \item |\setistmathTF| as an input mode changer for the important labels
209 \item |\setistmathTF*| having additional functions as a \emph{text font style changer}
210 \end{itemize}
211 \item \emph{curved} (even \emph{skewed}) \emph{information sets}
212 \begin{itemize}\tightlist
213 \item |\xtCInfoset| for curved information sets
214 \item |\xtCInfosetO| for curved bubble type information sets
215 \end{itemize}
216 \item enhanced \emph{continuum of branches} (making |\istcntm| and |\istcntmarc| obsolete)
217 \begin{itemize}\tightlist
218 \item |\istrootcntm| for a continuum triangle
219 \item |\istrootcntmA| for a continuum arc (with |\istbA|)
220 \item |\cntmAInfoset| and |\cntmAInfosetO| for information sets for a continuum of branches
221 \end{itemize}
222 \item \emph{arrows} and \emph{middle arrows} on branches
223 \begin{itemize}\tightlist
224 \item controllable arrow option |->-| with |\setxtarrowtips| and middle arrow tip styles
225 \item |\xtShowMidArrows| and |\xtShowArrows|
226 \end{itemize}
227 \item and some more
228 \begin{itemize}
229 \item |\istB| for dual action labels
230 \item |\xtTimeLineH|, |\xtTimeLineV|, |\xtCommentTo|, |\xtCommentFrom|, etc.
231 \end{itemize}
232 \end{itemize}
233
234 \paragraph{List of new macros}
235 \begin{itemize}\tightlist
236 \item |\istbt(*)|: terminal version of |\istb(*)|
237 (replacement of the removed macro |\istb.(*)|)
238 \item |\istB(*)|: dual action label version of |\istb(*)|
239 \item |\istBt(*)|: terminal version of |\istB(*)|
240 \item |\istbA(*)|: alternative version of |\istb(*)| (intended to work with a continuum arc)
241 \item |\istbAt(*)|: terminal version of |\istbA(*)|
242 %
243 \listdivider
244
245 \item |\setistmathTF|: input mode changer (math or text) for owners, action labels, and payoffs
246 % \begin{itemize}\tightlist
247 % \item |\istownermathtrue|, |\istactionlabelmathtrue|, |\istpayoffmathtrue|: math mode
248 % \item |\istownermathfalse|, |\istactionlabelmathfalse|, |\istpayoffmathfalse|: text mode
249 % \end{itemize}
250 \item |\setistmathTF*|: input mode and font style changer for owners, action labels, and payoffs
251 % \begin{itemize}\tightlist
252 % \item |\istownertextfont|, |\istactionlabeltextfont|, |\istpayofftextfont|
253 % \end{itemize}
254 %
255 \listdivider
256
257 \item |\xtCInfoset|: (curved version) curved information set
258 \item |\xtCInfosetO|: (curved oval version) curved oval type information set
259 \item |\xtCInfosetOTurnX|: turns |X| circles of |\xtCInfosetO| (to use it just in case)
260 %
261 \listdivider
262
263 \item |\xtInfoset*|: prints owners according to the input mode as set by |\setistmathTF(*)|
264 \item |\xtInfosetO*|: prints owners according to the input mode as set by |\setistmathTF(*)|
265 \item |\xtCInfoset*|: prints owners according to the input mode as set by |\setistmathTF(*)|
266 \item |\xtCInfosetO*|: prints owners according to the input mode as set by |\setistmathTF(*)|
267 \item |\xtOwner*|: prints owners according to the input mode as set by |\setistmathTF(*)|
268 \item |\xtActionLabel*|: prints action labels according to the input mode set by |\setistmathTF(*)|
269 \item |\xtPayoff*|: prints payoffs according to the input mode as set by |\setistmathTF(*)|
270 \item |\xtInfosetOwner*|: prints owners according to the input mode set by |\setistmathTF(*)|
271 %
272 \listdivider
273
274 \item |\setxtinfosetstyle|: changes line the style (line style, fill, etc.) for all information sets
275 \item |\setxtinfosetlayer|: changes the layer of information sets
276 \item |\setxtsubgamelayer|: changes the layer of |\xtSubgameBox| and |\xtSubgameOval|
277 \item |\setistgameshorten|: value of the key |shorten >| in \env{istgame} environment option list
278 %
279 \listdivider
280
281 \item |\cntmdistance|: analogous to |\xtdistance|, for a continuum of branches
282 \item |\cntmdistance*|: incorporates |\cntmdistance| with |\xtdistance|
283 %\item |\cntmactsibdist|: sibling distance for action branches from |\istrootcntm| and its variants
284 \item |\istrootcntm|: |\istroot| |+| |cntm|, printing a continuum of branches
285 \item |\istrootcntm'|: swap version of |\istrootcntm|
286 \item |\istrootocntm|: (oval version) |\istrooto| |+| |cntm|, printing a continuum triangle
287 \item |\istrootocntm'|: swap version of |\istrootocntm|
288 \item |\cntmpreset|: controls a continuum of branches (line style, color, size, fill color)
289 \item |\cntmpreset*|: controls a simple triangle continuum of branches with no background color
290 \item |\cntmistb|: similar to |\istb| for the outermost branches of a continuum triangle
291 \item |\cntmistb*|: draws |solid node|s at the ends of the continuum outermost branches
292 \item |\istrootcntmA|: |\istroot| |+| |cntmA|, printing a continuum arc
293 \item |\istrootcntmA'|: swap version of |\istrootcntmA|
294 \item |\istrootocntmA|: (oval version) |\istrooto| |+| |cntmA|, printing a continuum arc
295 \item |\istrootocntmA'|: swap version of |\istrootocntmA|
296 \item |\cntmApreset|: controls the features of a continuum arc
297 \item |\cntmAlayerpreset|: sets the layer of a continuum wedge (with fill color)
298 \item |\cntmAistb|: similar to |\istb| for the outermost branches of a continuum arc
299 \item |\cntmAistb*|: draws |solid node|s at the ends of the continuum arc outermost branches
300 \item |\cntmAInfoset|: prints an information set for a continuum arc
301 \item |\cntmAInfosetO|: oval version of |\cntmAInfoset|
302 \item |\xtShowEndPoints*|: shows additionally the outermost endpoints of a continuum of branches
303 \item |\xtHideEndPoints*|: turns off only the endpoints of a continuum of branches
304 \item |\cntmAexpostShowEndPoints|: shows the two endpoints of a continuum arc
305 %
306 \listdivider
307
308 \item |\setxtarrowtips|: works through |->-| to control the features of middle arrow tips
309 \item |\xtShowMidArrows|: shows arrows in the middle of branches
310 \item |\xtHideMidArrows|: hides middle arrows drawn by |\xtShowMidArrows|
311 \item |\setxtshowmidarrows|: controls the middle arrows on branches in a simple tree
312 \item |\xtShowArrows|: shows arrows at the ends of branches with endpoints
313 \item |\xtHideArrows|: hides arrows drawn by |\xtShowArrows|
314 \item |\xtHideArrows*|: hides arrows but with endpoints remained
315 \item |\setxtshowarrows|: controls the features of the arrows shown by |\xtShowArrows|
316 %
317 \listdivider
318
319 \item |\xtTimeLineH|: a horizontal time-line
320 \item |\xtTimeLineH'|: a horizontal time-line with a label at the other end
321 \item |\xtTimeLineV|: a vertical time-line
322 \item |\xtTimeLineV'|: a vertical time-line with a label at the other end
323 \item |\xtCommentTo|: to leave a comment |to| a node |from| a \emph{relative} coordinate
324 \item |\xtCommentFrom|: to leave a comment |from| an \emph{absolute} coordinate |to| a node
325 %
326 \listdivider
327
328 \item |\xtcureslopedlabelsNS|: cures the \TikZ\ issue of sloped labels with asymmetric scales
329 \item |\xtcureslopedlabelsEW|: same, for a tree growing eastwards or westwards\par
330 The last two macros are for only temporary use and could be removed at any time.
331 \end{itemize}
332
333
334 \paragraph{List of new arrow styles}
335
336 \begin{itemize}\tightlist
337 \item |->-|: (controllable) middle arrow tip, taking one optional argument
338 \item |->>-|: double middle arrow tip
339 \item |->>>-|: triple middle arrow tip
340 \item |-o-|: circle middle arrow tip
341 \item |-x-|: cross middle arrow tip
342 \end{itemize}
343
344 \subsection{How to read this document}
345
346 %First of all, since this package is just an application of \Tikz\ to draw game trees, not for learning \Tikz, you should have basic knowledge of using \Tikz\ to take a full advantage of this package.
347
348 As a \Tikz\ user, if this is your first read of this manual, \emph{all you need to read} is Section~\ref{sec:gettingstarted} entitled ``\emph{Getting started}."
349 That's only \emph{four} pages long. (You can find a little secret at the first part of Section~\ref{sec:desperateusers} entitled ``\emph{Complete examples for desperate users}.")
350 Every example in this document is provided with its complete codes you can copy to use.
351 Now you can go to Section~\ref{sec:gettingstarted} to get started!
352
353 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}").
354 That's about \emph{thirty} pages all total.
355
356 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.
357
358 If you you are an experienced user of the \pkg{istgame} package, enjoy every detail of the package.
359
360 %\clearpage
361 \subsection{Remarks}
362
363 \paragraph{Rules of thumb for the usage of delimiters}
364
365 Though the rules are not strictly observed, it might be useful to go over the rules of thumb for the usage of delimiters.
366
367 \begin{itemize}\tightlist
368 \item |{ }|: contents, texts, important dimensions (mandatory or optional)
369 \item |[ ]|: usual options, positions or directions, node types, fill color
370 \item |( )|: coordinate related arguments, dimension as the last optional argument, special purposes
371 \item |< >|: angles (or directions), special purposes (mostly used right before |{ }|)
372 \item |+ .. +|: only for the local change of level and sibling distances with |\istroot| and its friends
373 \item |! !|: |midpoint factor| only for curved information sets
374 \end{itemize}
375
376 As for the order of delimiters, the (somewhat loose) rules are as follows:
377
378 \begin{itemize}\tightlist
379 \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!)
380 \item |< >| is used just before |{ }|, except for |\istb| and its friends.
381 \item |( )| as the last optional argument is for dimensions, like |(1em)| or |(3pt)|.
382 \item The order mostly looks like |<>{}[]| or |<>{}[]()|, especially after a mandatory argument.
383 \end{itemize}
384
385 \paragraph{Optional versions of macros}
386
387 Some macros have a starred(|*|) version or a swap(|'|) version, for example, |\istb*| or \cmd{\istroot'}.
388
389 \begin{itemize}\tightlist
390 \item |* version|: just another version with different functions (in some cases, it's quite different)
391 \item |' version|: clockwise arrangement of branches or its related version
392 \end{itemize}
393
394
395 \paragraph{Global macros}
396
397 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}.
398
399 The following macros, all prefixed by |\setist...|, can be used outside of the \env{istgame} environment, to change the default values of the options:
400
401 \begin{itemize}\tightlist
402 \item \icmd{\setistgamefontsize}|{<text size>}| \hfill (default: |\normalsize|)
403 \item \icmd{\setistgameshorten}|{<arrow end shorten dim>}| \hfill (default: |0pt|)
404 \begin{itemize}
405 \item This works only when |->| exists in the option list of the \env{istgame} environment.
406 \end{itemize}
407 \end{itemize}
408
409 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.
410
411 \begin{itemize}\tightlist
412 \item \icmd{\setistmathTF}, \icmd{\setistmathTF*} \hfill (initially: |011|)
413 \item \icmd{\setistdefaultnodeinnersep} \hfill (default: |1pt|)
414 \item \icmd{\setistdefaultnodeoutersep} \hfill (default: |0pt|)
415 \item \icmd{\setistdefaultnodedrawcolor} \hfill (default: |black|)
416 \item \icmd{\setistdefaultnodefillcolor} \hfill (default: |white|)
417 \item \icmd{\setist<...>NodeStyle}
418 \item \icmd{\setistgrowdirection}, \icmd{\setistgrowdirection'} \hfill (default: |south|):
419 \begin{itemize}
420 \item You may not want to use (but still can use) this outside of an \env{istgame} environment.
421 \end{itemize}
422 \end{itemize}
423
424 %You can also use (from the version 2.1):
425 %
426 %\begin{itemize}\tightlist
427 %\item \icmd{\setistsolidnodesize} \hfill (default: |2.4pt|)
428 %\item \icmd{\setisthollownodesize} \hfill (default: |2.8pt|)
429 %\item \icmd{\setistellipsenodesize} \hfill (default: |4.8pt|)
430 %\item \icmd{\setistrectanglenodesize} \hfill (default: |4pt|)
431 %\end{itemize}
432
433 So, for example, you can do, in the preamble of your document, like:
434
435 \begin{verbatim}
436 \usepackage{istgame}
437 \setistgamefontsize{\normalsize}
438 \setistdefaultnodedrawcolor{black}
439 \setistsolidnodesize{2.4pt} % (new in version 2.1)
440 \setistellipsenodesize{2.8pt} % (new in version 2.1)
441 \setistgameshorten{.3pt}
442 \setistmathTF011
443 \end{verbatim}
444
445 The node styles such as |ellipse node| and |rectangle node| has |white| as the default background color.
446 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.
447 In this case you can resolve the conflict by adding the following two lines at the very first of your document:
448 \begin{verbatim}
449 \papercolor{blue!16}
450 \setistdefaultnodefillcolor{blue!16}
451 \end{verbatim}
452
453 %The background color of the TeXShop preview in the dark mode of |macOS| |Mojave| is very similar to |black!16|.
454
455
456 \paragraph{Known problem with the \pkg{tikz-qtree} package}
457
458 It seems that
459 \pkg{tikz-qtree} changes node anchors.
460 So, with the \pkg{tikz-qtree} package uploaded, you will get unexpected results
461 when you draw a game tree by using the native |tree| library in \TikZ.
462 Since the \pkg{istgame} package is based on the |tree| library, it is also affected by \pkg{tikz-qtree}, resulting in unexpected outputs.
463
464 The best way to resolve this problem is that you DO NOT LOAD \pkg{tikz-qtree} when you draw game trees with \TikZ.
465 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:
466
467 \xbigskip1
468 \begin{docplain}
469 % tikz-qtree conflict resolution (only with \usepackage{tikz-qtree})
470 [
471 edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}
472 ]
473 \end{docplain}
474 %\begin{docsty}
475 %\begin{istgame}%
476 % [ % tikz-qtree conflict resolution (only with \usepackage{tikz-qtree})
477 % edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}
478 % ]
479 % < istgame codes >
480 %\end{istgame}
481 %\end{docsty}
482
483
484 %\tmpclearpage
485 \subsection{Previous changes (up to version 1.0)}
486
487 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.}
488 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.
489
490 Also, |\istroot*|, |\istcntm*|, and |\xtInfoset*| must be replaced by |\istrooto|, |\istcntmarc|, and |\xtInfosetO|, respectively, in the version 1.0 or later.
491
492 %\begin{center}
493 %\begin{tabu} {X[l4]X[l3]X[l2]} \toprule % to\linewidth
494 %\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
495 %|\xdistance| & |\xtdistance| & \\\tabucline-
496 %|\xDot| &|\xtNode| & \\\tabucline-
497 %|\xInfoset| &|\xtInfoset| & \\\tabucline-
498 %|\xInfoset*| &|\xtInfoset*| & |\xtInfosetO| \\\tabucline-
499 %|\xInfosetOwner| &|\xtInfosetOwner| & \\\tabucline-
500 %|\xActionLabel| &|\xtActionLabel| & \\\tabucline-
501 %|\xPayoff| &|\xtPayoff| & \\\tabucline-
502 %|\ShowTerminalNodes| &|\xtShowTerminalNodes| & \\\tabucline-
503 %|\HideTerminalNodes| &|\xtHideTerminalNodes| & \\\tabucline-
504 %|\levdist| &|\xtlevdist| & \\\tabucline-
505 %|\sibdist| &|\xtsibdist| & \\\tabucline-
506 %|\setistactionlabelshift| & ~ & |\xtALPush| \\\tabucline-
507 %|\setistactionlabelposition| & ~ & |\xtALShift| \\\tabucline-
508 %|\istroot*| & & |\istrooto| \\\tabucline-
509 %|\istcntm*| & & |\istcntmarc| \\\tabucline-
510 %\end{tabu}
511 %\end{center}
512
513 \begin{center}
514 \begin{tabular} {lll} \toprule % to\linewidth
515 \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
516 |\xdistance| & |\xtdistance| & \\\cline{1-3}
517 |\xDot| &|\xtNode| & \\\cline{1-3}
518 |\xInfoset| &|\xtInfoset| & \\\cline{1-3}
519 |\xInfoset*| &|\xtInfoset*| & |\xtInfosetO| \\\cline{1-3}
520 |\xInfosetOwner| &|\xtInfosetOwner| & \\\cline{1-3}
521 |\xActionLabel| &|\xtActionLabel| & \\\cline{1-3}
522 |\xPayoff| &|\xtPayoff| & \\\cline{1-3}
523 |\ShowTerminalNodes| &|\xtShowTerminalNodes| & \\\cline{1-3}
524 |\HideTerminalNodes| &|\xtHideTerminalNodes| & \\\cline{1-3}
525 |\levdist| &|\xtlevdist| & \\\cline{1-3}
526 |\sibdist| &|\xtsibdist| & \\\cline{1-3}
527 |\setistactionlabelshift| & ~ & |\xtALPush| \\\cline{1-3}
528 |\setistactionlabelposition| & ~ & |\xtALShift| \\\cline{1-3}
529 |\istroot*| & & |\istrooto| \\\cline{1-3}
530 |\istcntm*| & & |\istcntmarc| \\\cline{1-3}
531 \end{tabular}
532 \end{center}
533
534
535 \clearpage
536
537 \section{Getting started}
538 \label{sec:gettingstarted}
539
540 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}.
541 |\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.
542 A tree drawn by the sequence of |\istroot-||\istb-||\endist| is a \ixsw{simple tree}.
543 You can draw a whole game tree by repeatedly connecting these \emph{simple tree structures}.
544
545 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.
546
547 The package \pkg{istgame} depends on the packages \ipkg{tikz}, \ipkg{xparse}, and \ipkg{expl3}.
548
549 To use the \pkg{istgame} package you must load the package in the preamble of your document:
550 \begin{verbatim}
551 \usepackage{istgame}
552 \end{verbatim}
553 The package preloads the following \TikZ\ libraries:
554 \begin{verbatim}
555 trees,calc,arrows,shapes,positioning,backgrounds,fit,decorations.markings,
556 arrows.meta,bending,
557 \end{verbatim}
558 and also preloads |patterns| and |intersections| for additional use.
559
560
561 \subsection{Getting-started example: a simple tree}
562
563 Let us get started with a simple self-explanatory example:
564
565 \begin{doccode}{.3}
566 %% \usepackage{istgame}
567 % Example: a simple tree
568 \begin{istgame}
569 \istroot(0)(0,0) % names the root (0) at (0,0)
570 \istb % endpoint will be (0-1), automatically
571 \istb % endpoint will be (0-2), automatically
572 \istb % endpoint will be (0-3), automatically
573 \endist % end of simple (parent-child) structure
574 \end{istgame}
575 \end{doccode}
576
577 The resulting tree has the \emph{height} of |15mm| and
578 the \emph{distance between two neighbor endpoints} (not shown) is also |15mm| by default.
579 In \TikZ, the height is called the \ixw{level distance} and
580 the distance between two neighbor endpoints is called the \ixw{sibling distance}.
581
582 If the second parenthesis argument of |\istroot| is omitted, it is regarded as |(0,0)| by default,
583 otherwise it is necessary to specify the coordinate from which a simple tree starts.
584
585 \subsection{Connecting simple tree structures}
586
587 Basically, in order to draw a whole game tree, we just repeat the simple |\istroot-\istb-\endist| structure.
588
589 \begin{doccode}{.3}
590 % Example: connecting simple trees
591 \begin{istgame}
592 \istroot(0) % names the root (0) at (0,0)
593 \istb % endpoint will be (0-1), automatically
594 \istb % endpoint will be (0-2)
595 \istb % endpoint will be (0-3)
596 \endist % end of simple (parent-child) structure
597 \istroot(c)(0-3) % names the subroot (c) at (0-3)
598 \istb % endpoint will be (c-1)
599 \istb % endpoint will be (c-2)
600 \endist
601 \end{istgame}
602 \end{doccode}
603
604 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.
605
606 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.
607
608 \subsection{Complete examples for desperate users}
609 \label{sec:desperateusers}
610
611 Basically, |\istroot| designates a \emph{decision node} and its \emph{owner} (or a \emph{player}),
612 |\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.)
613
614 \subsubsection{How to put a decision node and its owner}
615
616 \begin{docstx}
617 \istroot(<decision node name>)(<root location>)<owner position>{<owner>}
618 \end{docstx}
619
620 The only \emph{mandatory} argument of \icmd{\istroot} is |(<decision node name>)| and all others are \emph{optional}.
621 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.
622 The position of an \isw{owner} (or a \isw{player}) is |<above>| (or equivalently, |<90>| degree) by default.
623 The \emph{owner} of a node is printed in \emph{text mode} by default.
624
625 \begin{doccode}{.3}
626 % Example: first try
627 \begin{istgame}
628 \xtdistance{15mm}{30mm}
629 \istroot(0)(0,0){Child}
630 \istb \istb \endist
631 \istroot(1)(0-2)<30>{Parent}
632 \istb \istb \endist
633 \end{istgame}
634 \end{doccode}
635
636 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.
637
638 \subsubsection{How to print branches with action labels and payoffs}
639
640 \begin{docstx}
641 \istb{<action label>}[<action label pos>]{<payoffs>}[<payoff pos>]
642 \end{docstx}
643
644 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.
645
646 \begin{doccode}{.3}
647 % Example: first try
648 \begin{istgame}
649 \xtdistance{15mm}{30mm}
650 \istroot(0){Child}
651 \istb{Good}[above left]{(0,2)}
652 \istb{Bad}[above right]
653 \endist
654 \istroot(1)(0-2)<30>{Parent}
655 \istb{Forgive}[al]{(1,1)}
656 \istb{Punish}[ar]{(-1,-1)}
657 \endist
658 \end{istgame}
659 \end{doccode}
660
661 The positions of an action label and payoffs are specified as options right after each of the two.
662 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]|.
663 The abbreviations |[a]|, |[b]|, |[l]|, and |[r]| are also available.
664
665 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}.)
666
667 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.
668
669 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.
670 Just connect simple trees to complete a whole tree.
671
672 \subsubsection{How to put information sets}
673
674 The macro \icmd{\xtInfoset} connects two nodes with a densely dotted line, by default, representing an information set.
675
676 \begin{docstx}
677 \xtInfoset(<from coor>)(<end coor>){<owner>}[<owner pos>]
678 \end{docstx}
679
680
681 The two node coordinates are \emph{mandatory}.
682 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.
683 For more details about |\xtInfoset|, see Section~\ref{sec:infoset} on page~\pageref{sec:infoset}.
684
685 In the example below, the macro |\xtInfoset| is used to show an \isw{information set}.
686
687 \begin{doccode}{.35}
688 % Example: information set
689 \begin{istgame}
690 %\setistgrowdirection'{east}
691 \xtdistance{15mm}{30mm}
692 \istroot(0){Alice}
693 \istb{A}[al]{(2,2)}
694 \istb{D}[ar]
695 \endist
696 \istroot(1)(0-2)<above right>{Alice}
697 \istb{L}[al]
698 \istb{R}[ar]
699 \endist
700 \xtdistance{10mm}{20mm}
701 \istroot(2)(1-1)
702 \istb{\ell}[al]{(4,2)}
703 \istb{r}[ar]{(1,1)}
704 \endist
705 \istroot(3)(1-2)
706 \istb{\ell}[al]{(3,2)}
707 \istb{r}[ar]{(0,3)}
708 \endist
709 \xtInfoset(2)(3){Elaine}
710 \end{istgame}
711 \end{doccode}
712
713 The package also provides the macro |\xtInfosetO| to draw a bubble type information set.
714 Just replace |\xtInfoset| with |\xtInfosetO| (see Section~\ref{ssec:xtInfosetO} on page~\pageref{ssec:xtInfosetO}).
715
716 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.
717
718
719 \subsubsection{How to put a continuum of branches}
720
721 Just use |\istrootcntm| (|\istroot + cntm|), instead of |\istroot|, to draw a \isw{continuum} of branches.
722
723 \begin{docstx}
724 \istrootcntm(<decision node name>)(<root location>)<owner position>{<owner>}
725 \end{docstx}
726
727 The macro \icmd{\istrootcntm} works just like |\istroot|, but it prints a background triangle in |black!25|, by default, representing a continuum of branches.
728
729 \begin{doccode}{.35}
730 % Example: continuum of branches
731 \begin{istgame}[font=\scriptsize]
732 \istrootcntm(0){1}
733 \istb{x}[r] \istbm \endist
734 \xtdistance{10mm}{20mm}
735 \istroot(1)(0-1)<120>{2}
736 \istb{Y}[al]{x,1-x} \istb{N}[ar]{0,0} \endist
737 \end{istgame}
738 \end{doccode}
739
740 Here, |\istbm| represents a missing (or an invisible) branch (see page~\pageref{page:istbm}).
741
742 You can also change the color and size of the triangle representing a continuum of branches.
743 For more details on |\istrootcntm| see Section~\ref{ssec:istrootcntm}, on page~\pageref{ssec:istrootcntm}.
744
745 The package also provides the macro |\istrootcntmA| to draw an arc to represent a continuum of branches.
746 You can just replace |\istrootcntm| by |\istrootcntmA| to do that, but let us not try this now.
747 (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.)
748 For more details on |\istrootcntmA| see Section~\ref{ssec:istrootcntmA}, on page~\pageref{ssec:istrootcntmA}.
749
750 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.
751
752 \subsubsection{How to change the growing direction of a tree}
753
754 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.
755
756 \begin{doccode}{.35}
757 % Example: \setistgrowdirection(')
758 \begin{istgame}[scale=1.2]
759 \setistgrowdirection'{east}
760 \istroot(0)<180>{1}
761 \istb{a}[al]
762 \istb{b}[a]
763 \istb{c}[bl]
764 \endist
765 \xtdistance{10mm}{20mm}
766 \istroot(1)(0-2)<135>{2}
767 \istb{Y}[al]{x,1-x}
768 \istb{N}[bl]{0,0}
769 % \endist
770 \end{istgame}
771 \end{doccode}
772
773 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}.
774 When changing the direction of a tree, you may want to relocate the owner and action labels.
775 For more details, see Sections~\ref{sec:growing} (on page~\pageref{sec:growing}) and~\ref{sec:payoffdirection} (on page~\pageref{sec:payoffdirection}).
776
777 Now you are ready to draw any standard game trees such as all game trees in Osborne's book.
778
779
780 \section{Important distances: \protect\CMD{\xtdistance}}
781
782 \label{sec:xtdistance}
783
784 The length and direction of branches in a simple tree can be controlled by the macro \icmd{\xtdistance}.
785 Here, the prefix `|xt|' stands for \ixsw{extensive tree}.
786
787 \begin{docstx}
788 % syntax: \xtdistance
789 \xtdistance[<level depth>]{<level dist>}{<sibling dist>}
790 % defaults:
791 [1]{15mm}{15mm}
792 \end{docstx}
793
794 The macro |\xtdistance| sets or resets the \xw{level distance} and the \xw{sibling distance}, respectively.
795 Note also that internally, for example, |\xtdistance{20mm}{30mm}| assigns |20mm| to \icmd{\xtlevdist} and |30mm| to \icmd{\xtsibdist}, which renew the default distances.
796 It is effective until you change the distances by using another |\xtdistance|.
797
798 \begin{center}
799 \begin{istgame}[scale=2]
800 \istroot(0)
801 \istb* \istb* \istb* \endist
802 \coordinate (A) at ([xshift=-10pt]0-|0-1) ;
803 \coordinate (B) at ([xshift=-10pt]0-1) ;
804 \coordinate (C) at ([yshift=-10pt]0-1) ;
805 \coordinate (D) at ([yshift=-10pt]0-2) ;
806 \begin{scope}[blue]
807 \draw [|<->|] (A) -- (B) ;
808 \draw [|<->|] (C) -- (D) ;
809 \node at ($(A)!.5!(B)$) [left] {\makecell[c]{level distance\\\xw{\xtlevdist}}} ;
810 \node at ($(C)!.5!(D)$) [below] {\makecell[c]{sibling distance\\\xw{\xtsibdist}}} ;
811 \end{scope}
812 \end{istgame}
813 \end{center}
814
815 You can use |\xtdistance| at any time you want to change the length and the directions of branches.
816 Since we are dealing with simple \emph{parent-child} tree structures, |<level depth>| is |1| by default.
817 (The level depth number other than |1| is not expected to be used.)
818
819 \begin{doccode}{.3}
820 % \xtdistance
821 \begin{istgame}
822 \xtdistance{15mm} % default
823 \istroot(0)
824 \istb \istb \istb \endist
825 \xtdistance{15mm}{30mm} % changes sibling dist
826 \istroot(a)(0-1)
827 \istb \istb \endist
828 \endist
829 \end{istgame}
830 \end{doccode}
831
832
833 \remark
834 \begin{itemize}
835 \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|.
836 \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.
837 See Section~\ref{sec:xtdistance*}, on page~\pageref{sec:xtdistance*},
838 for more details about |\cntmdistance*|.
839 \end{itemize}
840
841 In fact, the core macros are much more powerful. |\istroot| controls the direction to which a simple parent-child tree grows,
842 node styles, the node owner and its position, the height and sibling distance of a current simple tree, etc.
843 |\istb| specifies the growing direction of an individual branch, branch line styles, branch color, action labels, and payoffs and their position.
844 Below we will see in more details on how the core macros and others work.
845
846
847 \section{The \env{istgame} environment and node styles}
848
849 \subsection{The \env{istgame} environment}
850
851 \label{ssec:envistgame}
852
853 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.
854 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.)
855
856 \begin{docsty}
857 % istgame environment
858 % \def\istgame@default@fontsize{\normalsize}
859 \begin{istgame}[ <Tikz options> ]
860 < istgame contents >
861 < tikzpicture contents >
862 \end{istgame}
863 % default options:
864 [ font=\normalsize , >=stealth ]
865 \end{docsty}
866
867 The default font size is set as |font=\normalsize|.
868 You can globally change the default font size by using \icmd{\setistgamefontsize}, like
869 |\setistgamefontsize{\scriptsize}|.
870 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
871 |\begin{istgame}[font=\scriptsize]...\end{istgame}|.
872
873 \remark \textbf{(Not for most users)} What the \env{istgame} environment \emph{internally} does includes:
874 \begin{itemize}
875 \item
876 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.
877 And if the optional value of |scale| exists, it is saved at \icmd{\xtscale} only when neither |xscale| nor |yscale| exists.
878 You can use these values to calculate something you want, like |5*1/\xtscale|.
879 The extracted values are internally used to get the best results of the shapes of bubble type information sets.
880 \item
881 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 |[->]|.
882 You can change the arrow shortening default value,
883 like |\setistgameshorten{1.3pt}|. (Though this is \emph{not for most users}, you can see some more details, in Section~\ref{sec:setistgamearrowendshorten}.)
884 \end{itemize}
885
886 \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.
887 (See the discussion on page~\pageref{ssec:changes2.1} for more details on what happens in this case.)
888
889
890 \subsection{Node styles}
891 \label{sec:nodestyles}
892
893 \subsubsection{Basic node styles}
894
895 The |tikzstyle|'s of the six basic node styles are predefined.
896
897 \begin{itemize}\tightlist
898 \item \ixw{plain node}: draws nothing
899 \hfill (default: |inner sep=1pt|)
900 \item \ixw{null node}: \begin{istgame}\istroot(0)[null node]\endist\end{istgame} (very small node)
901 \hfill (default: |minimum size=0.2pt|)
902 \item \ixw{solid node}: \begin{istgame}\istroot(0)[solid node]\endist\end{istgame} (default node style)
903 \hfill (default: |minimum size=2.4pt|)
904 \item \ixw{hollow node}: \begin{istgame}\istroot(0)[hollow node]\endist\end{istgame}
905 \hfill (default: |minimum size=2.8pt|)
906 \item \ixw{rectangle node}: \begin{istgame}\istroot(0)[rectangle node]\endist\end{istgame}
907 \hfill (defaults: |inner sep=2pt|, |minimum size=4pt|)
908 \item \ixw{ellipse node}: \begin{istgame}\istroot(0)[ellipse node]\endist\end{istgame}
909 \hfill (defaults: |inner sep=1.5pt|, |minimum size=4.8pt|)
910 \end{itemize}
911
912
913 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.
914
915 \begin{verbatim}
916 syntax:
917 \setistPlainNodeStyle{<inner sep dim>}{<outer sep dim>}
918 \setistNullNodeStyle[<draw color>]{<min-size dim>}[<bg color>][<opacity>]
919 \setistSolidNodeStyle[<draw color>]{<min-size dim>}[<bg color>][<opacity>]
920 \setistHollowNodeStyle[<draw color>]{<min-size dim>}[<bg color>][<opacity>]
921 \setistRectangleNodeStyle[<draw color>]{<min-size dim>}[<bg color>][<opacity>]
922 \setistEllipseNodeStyle[<draw color>]{<min-size dim>}[<bg color>][<opacity>]
923 \end{verbatim}
924
925
926 \begin{doccode}{.1}
927 % Examples:
928 \begin{istgame}\setistSolidNodeStyle[blue]{10pt}
929 \istroot(0)[solid node]\endist\end{istgame}\\[1ex]
930 \begin{istgame}\setistHollowNodeStyle[blue]{10pt}[yellow]
931 \istroot(0)[hollow node]\endist\end{istgame}\\[1ex]
932 \begin{istgame}\setistRectangleNodeStyle{10pt}[red][.5]
933 \istroot(0)[rectangle node]\endist\end{istgame}\\[1ex]
934 \begin{istgame}\setistEllipseNodeStyle[blue]{10pt}[green]
935 \istroot(0)[ellipse node]\endist\end{istgame}\\[1ex]
936 \begin{istgame}\setistNullNodeStyle[blue!20]{10pt}
937 \istroot(0)[null node]\endist\end{istgame}
938 \end{doccode}
939
940
941 These basic node styles have their aliases, for convenience, for those who are familiar with game theoretic terminology.
942
943 \begin{docsty}
944 % aliases for game theorists
945 \tikzset{decision node/.style=solid node} % decision nodes
946 \tikzset{terminal node/.style=solid node} % terminal nodes
947 \tikzset{initial node/.style=hollow node}
948 \tikzset{chance node/.style=hollow node}
949 \end{docsty}
950
951 The set of all nodes of a game tree can be partitioned into
952 the set of \ixw{decision nodes} and that of \ixw{terminal nodes}.
953 You can use \ixw{initial node}
954 to distinguish the \ixsw{root} (or the |initial node|) of a game tree from decision nodes.
955 You can also use \ixw{chance node} to represent a chance node of a game tree.
956
957 %You can also change the node styles, like |\setistDecisionNodeStyle[blue]{3pt}|.
958
959 Additional convenient node aliases are also provided: \ixw{box node}, \ixw{square node}, and \ixw{oval node}.
960
961 \begin{docsty}
962 % some more aliases
963 \tikzset{box node/.style=rectangle node}
964 \tikzset{square node/.style=rectangle node}
965 \tikzset{oval node/.style=ellipse node}
966 \end{docsty}
967
968 For aliases, you can also change the node styles, like |\setistDecisionNodeStyle[blue]{3pt}| or |\setistBoxNodeStyle{3pt}[green][.5]|.
969
970 \subsubsection{Your own node styles: \protect\CMD{\setistNewNodeStyle}}
971
972 You can create your own node style by \icmd{\setistNewNodeStyle}.
973
974 \begin{docstx}
975 % \setistNewNodeStyle
976 % syntax:
977 \setistNewNodeStyle{<style name>}[<opt>]{<minimum size>}
978 % defaults:
979 {<m>}[-,circle,draw=black,fill=white,inner sep=1pt]{6mm}
980 \end{docstx}
981
982 The first, mandatory denoted by |{<m>}|, argument is |{style name}| to be used.
983 The second, optional, argument is |[<options>]| to determine the style of a new node, with defaults.
984 The third, optional, argument should be |{<minimum size>}| only in dimension, which may be frequently used.
985
986 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:
987 \begin{docplain}
988 \tikzset{new node/.style={
989 circle , draw=black , fill=red , inner sep=1pt , minimum size=3mm } }
990 \end{docplain}
991
992 Here is an example of using |\setistNewNodeStyle|.
993
994 % Example: \setistNewNodeStyle
995 \begin{doccode}{.4}
996 \begin{istgame}[scale=1.5]
997 \setistNewNodeStyle{new 1}
998 [regular polygon,regular polygon sides=3,
999 shape border rotate=180]
1000 \setistNewNodeStyle{new 2}
1001 [regular polygon,regular polygon sides=3]
1002 \setistNewNodeStyle{new 3}[star]
1003 \xtdistance{15mm}{30mm}
1004 \istroot(0)[new 1]<center>{I}
1005 \istb \istb \endist
1006 \xtdistance{15mm}{15mm}
1007 \istrooto(1)(0-1)[new 2]{II} % \istrooto
1008 \istb \istb \endist
1009 \istroot(2)(0-2)[new 3]<center>{III}
1010 \istb \istb \endist
1011 \end{istgame}
1012 \end{doccode}
1013
1014 \remark
1015 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.
1016 However, if you use the oval version |\istrooto|, you don't need that.
1017 (See Section~\ref{sec:istroot} on page~\pageref{sec:istroot} for more details on |\istroot| and |\istrooto|.)
1018
1019 \remark
1020 In \TikZ, the shape of a node is independent of the |scale| option in \env{tikzpicture}.
1021 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|.)
1022
1023 % Example: \setistrNewNodeStyle (scaled)
1024 \begin{doccode}{.4}
1025 \begin{istgame}[scale=1.5]
1026 \setistNewNodeStyle{new 1}
1027 [regular polygon,regular polygon sides=3,
1028 shape border rotate=180]
1029 \setistNewNodeStyle{new 2}
1030 [regular polygon,regular polygon sides=3]
1031 \setistNewNodeStyle{new 3}[star]
1032 \xtdistance{15mm}{30mm}
1033 \istroot(0)
1034 [new 1,transform shape]<center>{I}
1035 \istb \istb \endist
1036 \xtdistance{15mm}{15mm}
1037 \istrooto(1)(0-1)[new 2]{II} % \istrooto
1038 \istb \istb \endist
1039 \istroot(2)(0-2)
1040 [new 3,transform shape]<center>{III}
1041 \istb \istb \endist
1042 \end{istgame}
1043 \end{doccode}
1044
1045
1046 \section{Core macro: \protect\CMD{\istroot}}
1047 \label{sec:istroot}
1048
1049 \subsection{\protect\CMD{\istroot}: basics}
1050
1051 \subsubsection{\protect\CMD{\istroot} -- counterclockwise: standard version}
1052 \label{ssec:istroot}
1053
1054 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.
1055 In game theoretic terminology, |\istroot| designates a decision node and its \isw{owner} (or a \isw{player}).
1056
1057 \begin{docstx}
1058 % \istroot
1059 % syntax:
1060 \istroot[<grow keyval>,<tree opt>](<coor1>)(<coor2>)
1061 [<node style>,<node opt>]<[owner opt]owner label angle>{<owner>}
1062 +<lev-distance>..<sib-distance>+
1063 % defaults:
1064 [south](<m>)(0,0)[decision node]<above>{}+15mm..15mm+
1065 % arguments: (coor1) is mandatory, all others are optional arguments
1066 [grow] % the direction of growing <default: south>
1067 (coor1) % name of the (sub)root: mandatory
1068 (coor2) % the (sub)root is at (coor2) <default: (0,0)>
1069 [node style] % node style <default: decision node>
1070 <angle> % position of owner name <default: above>
1071 {owner} % name of the owner of the (sub)root
1072 +level dist..sibling dist+ % <defaults: 15mm,15mm>
1073 \end{docstx}
1074
1075
1076 \subsubsection*{the root}
1077
1078 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.
1079 |(coor2)| specifies the location where the (sub)root is placed.
1080 If |(coor2)| is omitted, it is regarded as |(0,0)| by default.
1081
1082 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.
1083
1084 Here is a simple example of drawing a tree structure.
1085
1086 \begin{doccode}{.3}
1087 % \istroot
1088 \begin{istgame}
1089 \istroot(0)
1090 \istb
1091 \istb
1092 \istb
1093 \endist
1094 \istroot(a)(0-1)[chance node]
1095 \istb
1096 \istb
1097 \endist
1098 \end{istgame}
1099 \end{doccode}
1100
1101
1102 \subsubsection*{naming children: counterclockwise or clockwise}
1103
1104 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).
1105 Since \TikZ\ arranges branches of a tree \xw{counterclockwise}, by default,
1106 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).
1107
1108 The root of the subtree is named |(a)|, located at |(0-1)|, and has two children.
1109 Its children are automatically named |(a-1)| and |(a-2)| \ixsw{counterclockwise} (or from left to right if the tree grows down).
1110 See the following code example with explanatory labels to see what is going on.
1111
1112 \begin{doccode}{.3}
1113 % \istroot (explained with labels)
1114 \begin{istgame}[font=\scriptsize]
1115 \istroot(0)
1116 \istb \istb \istb \endist
1117 \istroot(a)(0-1)
1118 \istb \istb \endist
1119 %% labels: (ignore the following lines at the moment)
1120 \setistmathTF000
1121 \xtOwner(0){(0)}
1122 \xtOwner(a){(a)}[l]
1123 \xtPayoff*(0-1){(0-1)}[r]
1124 \xtPayoff*(0-2){(0-2)}[b]
1125 \xtPayoff*(0-3){(0-3)}[b]
1126 \xtPayoff*(a-1){(a-1)}[b]
1127 \xtPayoff*(a-2){(a-2)}[b]
1128 \draw [->,ultra thick,blue!20](-260:1.5)
1129 arc (-260:80:1.5cm)
1130 node [above,blue!30] {counterclockwise};
1131 \end{istgame}
1132 \end{doccode}
1133 \label{page:clockwise}
1134
1135
1136 \subsubsection*{owner (or player)}
1137
1138 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(*)|
1139 (see Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}, for more details).
1140
1141 The position of the owner of a decision node is specified in angle brackets, like |<90>|, |<above>|, or |<north>|.
1142 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.
1143 You can also use the positional words such as |<above>|, |<below>|, |<left>|, |<rigth>|, and their valid combinations.
1144
1145
1146 \subsubsection*{growing direction of a simple tree}
1147
1148 The first bracket option is mainly for the direction of a simple tree (|[south]| by default).
1149 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|.
1150
1151 \begin{adjustwidth}{\parindent}{\parindent}
1152 \remark
1153 \begin{itemize}
1154 \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.
1155 \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).
1156 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]|.
1157 (For examples in more detail, see Section~\ref{sec:firstthing} on page~\pageref{sec:firstthing}.)
1158 \item Be aware that the first entry in the option list \emph{must} be a \emph{directional word} for a simple tree.
1159 \end{itemize}
1160 \end{adjustwidth}
1161
1162 The tree growing direction can be specified by |[<degrees>]| or by using the compass directions such as
1163 |[north]|, |[south]|, |[east]|, |[west]|, |[north east]|, |[north west]|, |[south east]|, |[south west]|.
1164 You can also use positional words like |[left]|, |[rigth]|, |[down]|, and |[up]|, but you cannot use |[above]| nor |[below]|.
1165
1166 \label{page:onesimpletree}
1167 \begin{doccode}{.3}
1168 % Example 1: \istroot (one simple tree)
1169 \begin{istgame}[font=\itshape]
1170 \istroot[right](0)<left>{player 1}
1171 \istb \istb \endist
1172 \end{istgame}
1173 \end{doccode}
1174
1175
1176 \remark One thing you should remember about this is that |\istgrowdirection| is internally used
1177 in the definition of |\istb| to control the label position for payoffs.
1178 However, for the label position in \TikZ, |[below]| and |[above]| are good,
1179 but not |[down]| nor |[up]|.
1180 So DO NOT USE |[down]| nor |[up]| to specify the tree growing direction.
1181
1182 \begin{doccode}{.3}
1183 % Example 2: \istroot (three simple trees connected)
1184 \begin{istgame}
1185 \xtdistance{20mm}{20mm}
1186 \istroot[right](0)[oval node]<left>{player 1}
1187 \istb \istb \endist
1188 \istroot(a)(0-1)<right>{player 2}+15mm..10mm+
1189 \istb \istb \endist
1190 \istroot[right](b)(0-2)[box node]<135>{player 3}
1191 \istb \istb \endist
1192 \end{istgame}
1193 \end{doccode}
1194 \label{page:threesimpletrees}
1195
1196
1197 \subsubsection*{local change of distances}
1198
1199 The last two options of |\istroot| specify the \xw{level distance} and the \xw{sibling distance}.
1200 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|.
1201 Do not forget, when you use decimal distances, to delimit the decimal dimensions with curly braces, like
1202 |+{15.5mm}..{10.5mm}+|.
1203
1204 \subsubsection{\protect\CMD{\istroot'} -- clockwise: swap version}
1205
1206 \label{ssec:istroot'}
1207
1208 The macro \icmd{\istroot'} is the \emph{swap version} of |\istroot|.
1209 \cmd{\istroot'} works just like |\istroot| but with one exception: going \emph{clockwise}, not \emph{counterclockwise}.
1210 \cmd{\istroot'} arranges its branches \ixsw{clockwise} (or from right to left if the tree grows down).
1211
1212 Compare the following example with that of |\istroot| above on page~\pageref{page:clockwise}.
1213 The two examples have exactly the same codes as each other except for one thing: either |\istroot| or \cmd{\istroot'}.
1214
1215 \begin{doccode}{.3}
1216 % \istroot' (explained with labels)
1217 \begin{istgame}[font=\scriptsize]
1218 \istroot'(0) \istb \istb \istb \endist
1219 \istroot'(a)(0-1) \istb \istb \endist
1220 %% labels: (ignore the following lines at the moment)
1221 \setistmathTF000
1222 \xtOwner(0){(0)}
1223 \xtOwner(a){(a)}[l]
1224 \xtPayoff*(0-1){(0-1)}[r]
1225 \xtPayoff*(0-2){(0-2)}[b]
1226 \xtPayoff*(0-3){(0-3)}[b]
1227 \xtPayoff*(a-1){(a-1)}[b]
1228 \xtPayoff*(a-2){(a-2)}[b]
1229 \draw [<-,ultra thick,blue!20](-260:1.5)
1230 arc (-260:80:1.5cm) node [above,blue!30] {clockwise};
1231 \end{istgame}
1232 \end{doccode}
1233
1234 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.
1235
1236 If you draw a game tree growing south, you don't need to worry about the swap version \cmd{\istroot'}. Just use |\istroot|.
1237
1238 \subsection{\protect\CMD{\istrooto}: oval version}
1239
1240 \label{ssec:istrootstar}
1241
1242 \subsubsection{\protect\CMD{\istrooto} -- counterclockwise}
1243
1244 The macro \icmd{\istrooto} is the oval version of |\istroot|.
1245 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.
1246
1247 \begin{docstx}
1248 % \istrooto
1249 % syntax:
1250 \istrooto[<grow keyval,tree opt>](<coor1>)(<coor2>)
1251 [<node style>,<node opt>]{<owner>}+<lev-distance>..<sib-distance>+
1252 % default: only (coor1) is mandatory, <m>, all others optional
1253 [south](<m>)(0,0)[oval node]{}+15mm..15mm+
1254 \end{docstx}
1255
1256
1257 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|.
1258
1259 \begin{doccode}{.3}
1260 % Example 1: \istrooto (one simple tree)
1261 \begin{istgame}[font=\itshape]
1262 \istrooto[right](0)<180>{player 1}
1263 \istb \istb \endist
1264 \end{istgame}
1265 \end{doccode}
1266
1267 %The following example is also the same as above with |\istroot| on page~\pageref{page:threesimpletrees} but now with the oval version |\istrooto|.
1268
1269 \begin{doccode}{.3}
1270 % Example 2: \istrooto (three simple trees connected)
1271 \begin{istgame}
1272 \xtdistance{20mm}{20mm}
1273 \istrooto[right](0)[oval node]<left>{player 1}
1274 \istb \istb \endist
1275 \istroot(a)(0-1)<right>{player 2}+15mm..10mm+
1276 \istb \istb \endist
1277 \istrooto[right](b)(0-2)[box node]<135>{player 3}
1278 \istb \istb \endist
1279 \end{istgame}
1280 \end{doccode}
1281
1282 Observe that the angle |<180>|, |<left>|, |<right>|, or |<135>| specifying the position of an owner's name is redundant to |\istrooto|.
1283
1284 \begin{doccode}{.3}
1285 % Example 3: \istroot (counterclockwise)
1286 \begin{istgame}
1287 \xtdistance{15mm}{30mm}
1288 \istrooto(0){player 1}
1289 \istb \istb \endist
1290 \xtdistance{15mm}{15mm}
1291 \istroot(a)(0-1)<right>{player 2}
1292 \istb \istb \endist
1293 \istrooto(b)(0-2)[box node]{player 3}
1294 \istb \istb \endist
1295 \end{istgame}
1296 \end{doccode}
1297
1298 \begin{doccode}{.3}
1299 % Example 4: \istrooto (counterclockwise)
1300 \begin{istgame}
1301 \setistOvalNodeStyle{.6cm}
1302 \istrooto(0){0}+{12.5mm}..{3.45cm}+
1303 \istb \istb \endist
1304 \xtShowEndPoints[oval node]
1305 \xtdistance{12.5mm}{11.5mm}
1306 \istrooto(1)(0-1){1}
1307 \istb{}{3}[center] \istb{}{4}[center]
1308 \istb{}{5}[center] \endist
1309 \istrooto(2)(0-2){2}
1310 \istb{}{6}[center] \istb{}{7}[center]
1311 \istb{}{8}[center] \endist
1312 \istrooto(6)(2-1){6}
1313 \istb{}{9}[center] \istb{}{10}[center]
1314 \endist
1315 \draw [->,ultra thick,blue!20](-260:1.5)
1316 arc (-260:80:1.5cm)
1317 node [above,blue!30] {counterclockwise};
1318 \end{istgame}
1319 \end{doccode}
1320
1321
1322 %\remark Note that, in \TikZ, a tree branch comes from the center of the parent node
1323 %and goes to the center of the child node.
1324 %Now what if you want to have branches coming from some point of the circumference of, say,
1325 %an oval parent node to that of a child node.
1326 %|\setistbranchanchors| specifies the anchors of parent node and child node. (experimental!)
1327 %
1328 %\begin{docstx}
1329 %% \setistbranchanchors (experimental!)
1330 %% syntax: \setistbranchanchors
1331 % \setistbranchanchors{<parent anchor>}{<child anchor>}
1332 %% defaults: <parent anchor> is mandatory
1333 % {}{center}
1334 %\end{docstx}
1335
1336 The previous example shows how |\istrooto| arranges its branches: \ixsw{counterclockwise}, by default.
1337
1338
1339 \subsubsection{\protect\CMD{\istrooto'} -- clockwise: swap version}
1340
1341 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.
1342
1343
1344
1345 \begin{doccode}{.3}
1346 % Example 2: \istrooto' (clockwise)
1347 \begin{istgame}
1348 \xtdistance{20mm}{20mm}
1349 \istrooto'[right](0)[oval node]<left>{player 1}
1350 \istb \istb \endist
1351 \istrooto'[right](b)(0-1)[box node]<135>{player 2}
1352 \istb \istb \endist
1353 \istroot(a)(0-2)<right>{player 3}+15mm..10mm+
1354 \istb \istb \endist
1355 \end{istgame}
1356 \end{doccode}
1357
1358 \begin{doccode}{.3}
1359 % Example 3: \istrooto' (clockwise)
1360 \begin{istgame}
1361 \xtdistance{15mm}{30mm}
1362 \istrooto'(0){player 1}
1363 \istb \istb \endist
1364 \xtdistance{15mm}{15mm}
1365 \istroot(a)(0-1)<right>{player 2}
1366 \istb \istb \endist
1367 \istrooto(b)(0-2)[box node]{player 3}
1368 \istb \istb \endist
1369 \end{istgame}
1370 \end{doccode}
1371
1372 The swap version is useful when a tree grows northwards or eastwards.
1373 The example below shows a tree rotated to the east by \icmd{\setistgrowdirection}.
1374 Note that \cmd{\istrooto'} arranges its branches \ixsw{clockwise}.
1375
1376
1377 %\begin{doccode}{.4}
1378 %% Example 3: \istrooto' (clockwise)
1379 %\begin{istgame}
1380 %\setistgrowdirection{north}
1381 %\setistOvalNodeStyle{.6cm}
1382 %\istrooto'(0){0}+{12.5mm}..{3.45cm}+
1383 % \istb \istb \endist
1384 %\xtShowEndPoints[oval node]
1385 %\xtdistance{12.5mm}{11.5mm}
1386 %\istrooto'(1)(0-1){1}
1387 % \istb{}{3}[center] \istb{}{4}[center]
1388 % \istb{}{5}[center] \endist
1389 %\istrooto'(2)(0-2){2}
1390 % \istb{}{6}[center] \istb{}{7}[center]
1391 % \istb{}{8}[center] \endist
1392 %\istrooto'(6)(2-1){6}
1393 % \istb{}{9}[center] \istb{}{10}[center]
1394 % \endist
1395 %\draw [->,ultra thick,blue!20](260:1.5)
1396 % arc (260:-80:1.5cm)
1397 % node [below,blue!30] {clockwise};
1398 %\end{istgame}
1399 %\end{doccode}
1400
1401
1402
1403 \begin{doccode}{.4}
1404 % Example 4: \istrooto' (clockwise)
1405 \begin{istgame}
1406 \setistgrowdirection'{east}
1407 \setistOvalNodeStyle{.6cm}
1408 \istrooto'(0){0}+{12.5mm}..{3.45cm}+
1409 \istb \istb \endist
1410 \xtShowEndPoints[oval node]
1411 \xtdistance{12.5mm}{11.5mm}
1412 \istrooto(1)(0-1){1}
1413 \istb{}{3}[center] \istb{}{4}[center]
1414 \istb{}{5}[center] \endist
1415 \istrooto(2)(0-2){2}
1416 \istb{}{6}[center] \istb{}{7}[center]
1417 \istb{}{8}[center] \endist
1418 \istrooto(6)(2-1){6}
1419 \istb{}{9}[center] \istb{}{10}[center]
1420 \endist
1421 \draw [->,ultra thick,blue!20](260:1.5)
1422 arc (260:-80:1.5cm)
1423 node [below,blue!30] {clockwise};
1424 \end{istgame}
1425 \end{doccode}
1426
1427 \remark
1428 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}.)
1429
1430
1431 \section{Core macro: \protect\CMD{\istb}}
1432 \label{sec:istb}
1433
1434 \subsection{\protect\CMD{\istb}: basics}
1435 \label{ssec:istb}
1436
1437 \subsubsection{Basics: branches, action labels, and payoffs}
1438
1439 The macro \icmd{\istb}, basically, prints a \emph{\isw{branch}}.
1440 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|).
1441 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.
1442
1443 The macro |\istb| also puts an \emph{\isw{action}} label and \emph{\isw{payoff}\,}s along with a branch, and does other functions.
1444 Note that the \emph{action labels} and \emph{payoffs} are to be typeset in \emph{math mode}.
1445 If you want to change the input mode to text mode, you can use the macro |\setistmathTF(*)|.
1446 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).
1447
1448 \begin{docstx}
1449 % \istb
1450 % syntax:
1451 \istb<grow, distance, missing>[<line style>]{<action>}[<pos>]{<payoff>}[<pos>]
1452 % defaults:
1453 <grow=south>{-}{}[center]{}[\istgrowdirection]
1454 % arguments: all arguments are optional
1455 <grow=keyval> % the direction of a branch <default: south>
1456 [line style] % branch line style <default: solid>
1457 {action} % action label (in math mode)
1458 [action pos] % position of action label <default: center>
1459 {payoff} % payoffs (in math mode)
1460 [payoff pos] % position of payoffs <default: \istgrwodirection: south>
1461 \end{docstx}
1462
1463 \remark The macro |\istb| has many variants including
1464 |\istb*| (starred version), |\istbt| (terminal version), and |\istbm| (missing version).
1465 It also has other very close friends: |\istB| (dual action label version) and |\istbA| (alternative or arc version).
1466 Each friend of |\istb| has its starred version and terminal version, of course, except |\istbm|.
1467 |\cntmistb(*)| and |\cntmAistb(*)| are also friends only when a continuum of branches is in play.
1468
1469
1470 \subsubsection*{branches}
1471
1472 In the example below, each |\istb| draws a branch.
1473 With the option \ixw{missing}, |\istb| prints an \emph{invisible} branch.
1474 Since the third child is \emph{missing}, the last child is named |(0-4)|.
1475
1476 \begin{doccode}{.3}
1477 % \istb<missing> (simply, \istbm)
1478 \begin{istgame}
1479 \istroot(0)
1480 \istb \istb \istb<missing> \istb \endist
1481 \istroot(D)(0-4)
1482 \istb \istb \endist
1483 \end{istgame}
1484 \end{doccode}
1485
1486 To make it simple, you can use the \emph{missing version} \icmd{\istbm} instead of |\istb<missing>|.
1487 \label{page:istbm}
1488
1489 \begin{docsty}
1490 % \istbm
1491 \newcommand\istbm{\istb<missing>}
1492 \end{docsty}
1493
1494 The macro |\istb| also has various options to control the line style of a branch, and the direction and length of a branch.
1495 |\istb| can also place payoffs to the direction of tree growth by default.
1496
1497 For various line styles of each branch, you can use any \TikZ\ options of arrows, line style, color, and so on.
1498
1499 \begin{doccode}{.3}
1500 % Example: \istb (branch line styles)
1501 \begin{istgame}
1502 \istroot(0)
1503 \istb[dashed,thick]
1504 \istb[->]
1505 \istb[draw=blue,thick] \endist
1506 \end{istgame}
1507 \end{doccode}
1508
1509 \subsubsection*{action labels}
1510
1511 By default, an action label is put on the midpoint of the corresponding branch, in \emph{math} mode.
1512
1513 \begin{doccode}{.3}
1514 % Example: action labels
1515 \begin{istgame}
1516 \istroot(0)
1517 \istb[dashed,thick]{A}
1518 \istb[->]{\beta}[right]
1519 \istb[draw=blue,thick]{Right}[ar] \endist
1520 \end{istgame}
1521 \end{doccode}
1522
1523 To specify the position of action labels,
1524 you can use the positional words or the \emph{\isw{abbreviations}}:\par
1525 |[a]| for |[above]|, |[b]| for |[below]|, |[l]| for |[left]|, |[r]| for |[right]|,\par
1526 |[al]| for |[above left]|, |[ar]| for |[above right]|, \par
1527 |[bl]| for |[below left]|, and |[br]| for |[below right]|.
1528
1529 \remark
1530 Note that these abbreviations \emph{must be used with no other options}, otherwise you will get a compile \emph{error}.
1531 For example, when you want to print \isw{sloped labels} for actions, you should do like |[above,sloped]| but not like |[a,sloped]|.
1532
1533 \begin{doccode}{.3}
1534 % Example: sloped labels
1535 \begin{istgame}[font=\footnotesize]
1536 \istroot(0)
1537 \istb[dashed,thick]{Left}[above,sloped]
1538 \istb[->]{Center}[above,sloped]
1539 \istb[draw=blue,thick]{Right}[above,sloped]
1540 \endist
1541 \end{istgame}
1542 \end{doccode}
1543
1544 \warning \label{page:slopedlabels-warning}
1545 Issues in \emph{sloped labels} in \TikZ\ with \emph{asymmetric scales}:
1546 \begin{itemize}
1547 \item The |tree| library in \TikZ\ does not seem to treat sloped labels properly, when |xscale| or |yscale| is used asymmetrically.
1548
1549 \begin{doccode}{.319}
1550 % Example: sloped labels problem
1551 \begin{istgame}[xscale=2,font=\footnotesize]
1552 %\xtcureslopedlabelsNS
1553 \istroot(0)
1554 \istb[dashed,thick]{Left}[above,sloped]
1555 \istb[->]{Center}[above,sloped]
1556 \istb[draw=blue,thick]{Right}[above,sloped]
1557 \endist
1558 \end{istgame}
1559 \end{doccode}
1560
1561 \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}.
1562 These must be used in a TeX group with caution.
1563 \emph{These are only temporary solutions that have not been tested for every occasion}.
1564
1565 \begin{doccode}{.319}
1566 % Example: sloped labels problem cured
1567 \begin{istgame}[xscale=2,font=\footnotesize]
1568 \xtcureslopedlabelsNS
1569 \istroot(0)
1570 \istb[dashed,thick]{Left}[above,sloped]
1571 \istb[->]{Center}[above,sloped]
1572 \istb[draw=blue,thick]{Right}[above,sloped]
1573 \endist
1574 \end{istgame}
1575 \end{doccode}
1576 \end{itemize}
1577
1578
1579 \subsubsection*{payoffs}
1580
1581 The second curly braces option of the macro |\istb| is for \emph{payoffs} and the last bracket option for the position of payoffs.
1582
1583 By default, |\istb| prints payoffs in \emph{math mode}, which can be changed by |\setistmathTF(*)|.
1584 By default, payoffs are put in the direction of |\istgrowdirection| (|[south]| by default).
1585
1586 \begin{doccode}{.3}
1587 % Example: payoffs
1588 \begin{istgame}
1589 \istroot(0)
1590 \istb[dashed,thick]{A}{(0,1)}
1591 \istb[->]{}{(1,-1)}
1592 \istb[draw=blue,thick]{\beta}[a]{u_1,u_2}
1593 \endist
1594 \end{istgame}
1595 \end{doccode}
1596
1597 \remark What is \icmd{\istgrowdirection} and what is it used for?
1598 \begin{itemize}
1599 \item |\istgrowdirection| has the value of |[<grow keyval>]| typed in |\istroot| (default: |south|).
1600 \item The value of |\istgrowdirection| is (internally) used to determine the direction of putting \emph{payoffs} (|south| by default).
1601 \end{itemize}
1602
1603
1604 In the following example, notice that the tree grows south-eastwards, so the payoffs are placed to the south-east of the endpoints.
1605
1606 \begin{doccode}{.3}
1607 % Example: tree toward south east (or -45 degree)
1608 \begin{istgame}
1609 \istroot[-45](0)
1610 \istb[dashed,thick]{A}{(0,1)}
1611 \istb[->]{}{(1,-1)}
1612 \istb[draw=blue,thick]{\beta}[a]{u_1,u_2}
1613 \endist
1614 \end{istgame}
1615 \end{doccode}
1616
1617 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.
1618 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]|.
1619
1620 \begin{doccode}{.3}
1621 % Example: tree toward south west (or 225 degree)
1622 \begin{istgame}
1623 \istroot[south west](0)
1624 \istb[dashed,thick]{A}{(0,1)}
1625 \istb[->]{}{(1,-1)}
1626 \istb[draw=blue,thick]{\beta}[r]{u_1,u_2}[below]
1627 \endist
1628 \end{istgame}
1629 \end{doccode}
1630
1631 \remark
1632 \begin{itemize}
1633 \item |\istb| expects a \emph{directional word} to be input as the last optional argument (by default,
1634 |\istgrowdirection|).
1635 \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]|.
1636 Otherwise, a compile \emph{error} will be produced.
1637 \item Note also that you can do like |[[xshift=5mm]below]|, instead (see also page~\pageref{page:finetuningpayoffs}).
1638 \end{itemize}
1639
1640 \subsubsection{Printing action labels in italics in text mode: \protect\CMD{\setistmathTF*}}
1641 \label{ssec:setistmathTF}
1642
1643 By default, an owner is printed in \emph{text mode}, action labels and payoffs in \emph{math mode}.
1644 With the macro |\setistmathTF(*)|, you can change the input mode for those labels.
1645 These are discussed in Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}.
1646
1647 Here, it is briefly discussed how to change the input mode of action labels to \emph{text mode}.
1648 To do that, just declare |\setistmathTF001|.
1649 The second zero means that the input mode for action labels is in text mode.
1650 (The first number is for owners and the third one for payoffs.)
1651
1652 \begin{doccode}{.3}
1653 % \setistmathTF011 (default modes)
1654 \begin{istgame}[font=\footnotesize]
1655 \setistmathTF001
1656 \istroot(0)
1657 \istb[dashed,thick]{Left}[above,sloped]{(0,1)}
1658 \istb[->]{Center}[above,sloped]{(1,-1)}
1659 \istb[draw=blue,thick]{Right}[above,sloped]{u_1,u_2}
1660 \endist
1661 \end{istgame}
1662 \end{doccode}
1663
1664 If you use the starred version, like |\setistmathTF*001|, action labels are printed in \emph{italics}, by default.
1665
1666 \begin{doccode}{.3}
1667 \begin{istgame}[font=\footnotesize]
1668 \setistmathTF*001
1669 \istroot(0)
1670 \istb[dashed,thick]{Left}[above,sloped]{(0,1)}
1671 \istb[->]{Center}[above,sloped]{(1,-1)}
1672 \istb[draw=blue,thick]{Right}[above,sloped]{u_1,u_2}
1673 \endist
1674 \end{istgame}
1675 \end{doccode}
1676
1677 You can, of course, do the same thing in the default math mode.
1678
1679 \begin{doccode}{.3}
1680 \begin{istgame}[font=\footnotesize]
1681 \istroot(0)
1682 \istb[dashed,thick]
1683 {\textit{Left}}[above,sloped]{(0,1)}
1684 \istb[->]{\textit{Center}}[above,sloped]{(1,-1)}
1685 \istb[draw=blue,thick]
1686 {\textit{Right}}[above,sloped]{u_1,u_2}
1687 \endist
1688 \end{istgame}
1689 \end{doccode}
1690
1691
1692 \subsection{\protect\CMD{\istb*}: starred version}
1693 \label{ssec:istbstar}
1694
1695 \subsubsection{\protect\CMD{\istb*}: basics}
1696
1697 The starred version \icmd{\istb*} prints a |solid node| at the end of the corresponding branch.
1698 This is the only difference between |\istb| and |\istb*|.
1699
1700 \begin{doccode}{.3}
1701 % \istb* (starred version)
1702 \begin{istgame}
1703 \istroot[east](0)
1704 \istb[dashed,thick]{A}
1705 \istb*[->]{}{(1,-1)}
1706 \istb*[draw=blue,thick]{\beta}[a]
1707 \endist
1708 \end{istgame}
1709 \end{doccode}
1710
1711 \subsubsection{\protect\CMD{\xtShowEndPoints} and \protect\CMD{\xtHideEndPoints}}
1712 \label{page:endpoint}
1713
1714 Each endpoint is printed by each execution of |\istb*|.
1715 You can print solid nodes (by default) at \emph{all} the endpoints of \emph{simple trees} by the macro \icmd{\xtShowEndPoints}.
1716 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]|.
1717
1718 \begin{docstx}
1719 % \xtShowEndPoints
1720 % syntax:
1721 \xtShowEndPoints[<node style>]
1722 % default:
1723 [solid node]
1724 \end{docstx}
1725
1726 The macro \icmd{\xtHideEndPoints} turns off the effects of |\xtShowEndPoints|.
1727
1728 It is too early to say that the starred version \icmd{\xtShowEndPoints*} additionally prints the two outermost endpoints of a continuum.
1729 |\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.)
1730
1731 Here is an example of using |\xtShowEndPoints| and |\xtHideEndPoints|.
1732
1733 \begin{doccode}{.3}
1734 % \xtShowEndPoints and \xtHideEndPoints
1735 \begin{istgame}
1736 \xtShowEndPoints[oval node,minimum size=6pt]
1737 \istroot(0)[solid node]
1738 \istb[dashed,thick]{A}
1739 \istb
1740 \istb[very thick]{\beta}[ar]
1741 \endist
1742 \xtShowEndPoints % default: solid nodes
1743 \xtdistance{15mm}{10mm}
1744 \istroot(b)(0-2)
1745 \istb
1746 \istb
1747 \endist
1748 \xtHideEndPoints % \istb* overrides
1749 \istroot(b)(0-3)
1750 \istb
1751 \istb*
1752 \endist
1753 \end{istgame}
1754 \end{doccode}
1755
1756 Note that |\xtShowEndPoints| and |\xtHideEndPoints| should be in an \env{istgame} environment to avoid unexpected results.
1757 Note also that |\istb*| overrides all the effects of these two macros by forcing to print a \pkg{solid node}.
1758
1759
1760 \subsection{\protect\CMD{\istbt}: terminal version}
1761 \label{ssec:istbperiod}
1762
1763 \subsubsection{\protect\CMD{\istbt}: basics}
1764
1765 The terminal version \icmd{\istbt}\ is designed to represent a \emph{terminal move} in a game tree.
1766 Basically, |\istbt|\ works exactly the same way as |\istb| does.
1767 However, using |\istbt|\ together with the macro |\xtShowTerminalNodes| you can control the shape of the terminal nodes, \emph{all at once}.
1768
1769 \subsubsection{\protect\CMD{\xtShowTerminalNodes} and \protect\CMD{\xtHideTerminalNodes}}
1770 \label{page:terminalnode}
1771
1772 The terminal version |\istbt|\ used with \icmd{\xtShowTerminalNodes} prints a |solid node| (by default).
1773 You can change the style of the terminal nodes, like |\xtShowTerminalNodes[oval node]|.
1774 This effect can be turned off by \icmd{\xtHideTerminalNodes}.
1775
1776
1777 \begin{docstx}
1778 % \xtShowTerminalNodes (works only with \istbt and other terminal versions)
1779 % syntax:
1780 \xtShowTerminalNodes[<node style>]
1781 % default:
1782 [solid node]
1783 \end{docstx}
1784
1785 \begin{doccode}{.3}
1786 % \xtShowTerminalNodes and \xtHideTerminalNodes
1787 \begin{istgame}
1788 \xtShowTerminalNodes[box node,fill=green]
1789 \istroot(0)[solid node]
1790 \istbt[dashed,thick]{A} \istb
1791 \istb[very thick]{\beta}[ar] \endist
1792 \xtdistance{15mm}{10mm}
1793 \istroot(b)(0-2) \istbt* \istbt \endist
1794 \xtHideTerminalNodes
1795 \istroot(b)(0-3) \istbt \istbt \endist
1796 \end{istgame}
1797 \end{doccode}
1798
1799 \remark
1800 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.
1801 Note also that \icmd{\istbt*} overrides the effects of |\xtShowTerminalNodes| and |\xtHideTerminalNodes|.
1802
1803 \subsection{\protect\CMD{\istB}: dual action label version}
1804 \label{sec:istB}
1805
1806 \subsubsection{\protect\CMD{\istB}: basics}
1807
1808 The macro \icmd{\istB}\ works just like |\istb|, except one thing: |\istB| prints \emph{dual action labels}\index{dual action labels} for a branch.
1809
1810 The starred version \icmd{\istB*} prints a solid node at the end of the corresponding branch, just like |\istb*|.
1811 And the terminal versions |\istBt| and \icmd{\istBt*} work just like |\istbt| and |\istbt*|, respectively, except for dual action labels.
1812
1813
1814 \begin{docstx}
1815 % \istB
1816 % syntax:
1817 \istB<grow>[<opt>]{<action1>}[<pos1>]{<action2>}[<pos2>]{<payoff>}[<pos>]
1818 % defaults:
1819 <grow=south>{-}{}[center]{}[center]{}[\istgrowdirection]
1820 % arguments: all arguments are optional
1821 <grow=keyval> % the direction of a branch <default: south>
1822 [line style] % branch line style <default: solid>
1823 {action label 1} % action label 1 (in math mode)
1824 [action pos 1] % position of action label 1 <default: center>
1825 {action 2} % action label 2 (in math mode)
1826 [action label pos 2] % position of action label 2 <default: center>
1827 {payoff} % payoffs (in math mode)
1828 [payoff pos] % position of payoffs <default: \istgrwodirection: south>
1829 \end{docstx}
1830
1831 With |\istB|, do not forget to put \emph{two labels}. Otherwise, you might get an unexpected result.
1832
1833 \begin{doccode}{.3}
1834 % \istB (dual action label version)
1835 \begin{istgame}[font=\footnotesize]
1836 \xtdistance{15mm}{30mm}
1837 \istroot(0)[chance node]
1838 \istB{Black}[al]{x}[br]
1839 \istB{Red}[ar]{1-x}[bl]
1840 \endist
1841 \istroot(1)(0-1)[initial node]
1842 \istBt{Head}[al]{y}[br]
1843 \istBt[draw=blue,thick]{Tail}[ar]{1-y}[bl]
1844 \endist
1845 \end{istgame}
1846 \end{doccode}
1847
1848 \subsubsection{\protect\CMD{\xtActionLabel} and \protect\CMD{\xtActionLabel*}}
1849 \label{ssec:istbandxtActionLabel}
1850
1851 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}).
1852 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.
1853
1854 \begin{docstx}
1855 % \xtActionLabel
1856 % syntax:
1857 \xtActionLabel*[<line opt>](<from>)(<to>){<action>}[<pos>,<node opt>]
1858 % default:
1859 [-,draw=none](<m>)(<m>){}[black,text depth=.25]
1860 \end{docstx}
1861
1862
1863 \remark
1864 In some cases, it is not a good idea to use |\istB| to print dual action labels.
1865 \begin{itemize}\tightlist
1866 \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}).
1867 \label{page:noistB}
1868
1869 \item With respect to a \emph{continuum} of branches, |\istB| has little role to play.
1870 \end{itemize}
1871
1872 You can do the same thing as |\istB| does using |\istb| together with |\xtActionLabel|.
1873
1874 \begin{doccode}{.3}
1875 % \istb and \xtActionLabel
1876 \begin{istgame}[font=\footnotesize]
1877 \xtdistance{15mm}{30mm}
1878 \istroot(0)[chance node]
1879 \istb{Left}[al]
1880 \istb{Right}[ar]
1881 \endist
1882 \istroot(1)(0-1)[initial node]
1883 \istbt{Head}[al]
1884 \istbt{Tail}[ar]
1885 \endist
1886 \xtActionLabel(0)(0-1){x}[br]
1887 \xtActionLabel(0)(0-2){1-x}[bl]
1888 \xtActionLabel(1)(1-1){y}[br]
1889 \xtActionLabel[draw,blue,thick](1)(1-2){1-y}[bl]
1890 \end{istgame}
1891 \end{doccode}
1892
1893 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|).
1894
1895 \begin{doccode}{.3}
1896 % \istb and \xtActionLabel*
1897 \begin{istgame}[font=\footnotesize]
1898 \xtdistance{15mm}{30mm}
1899 \istroot(0)[chance node]
1900 \istb{Left}[al]
1901 \istb{Right}[ar]
1902 \endist
1903 \istroot(1)(0-1)[initial node]
1904 \istbt{Head}[al]
1905 \istbt{Tail}[ar]
1906 \endist
1907 \xtActionLabel(0)(0-1){x}[br]
1908 \xtActionLabel(0)(0-2){1-x}[bl]
1909 \setistmathTF*001{texttt}
1910 \xtActionLabel*(1)(1-1){y}[br]
1911 \xtActionLabel*[draw,blue,thick](1)(1-2){1-y}[bl]
1912 \end{istgame}
1913 \end{doccode}
1914
1915
1916 \subsection{\protect\CMD{\istbA}: alternative (or arc) version}
1917 \label{sec:istbA}
1918
1919 \subsubsection{\protect\CMD{\istbA}: basics}
1920
1921 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|.
1922 For example, |\istbA(.5)| is an abbreviation of |\istb<level distance=.5*\xtlevdist>|,
1923 as you can see in the example below:
1924
1925 \begin{doccode}{.3}
1926 % \istbA (alternative or arc version)
1927 \begin{istgame}
1928 \istroot(0) \istb \istbA \endist
1929 \istroot(1)(0-1) \istb \istbA(.5){b} \endist
1930 \istroot(2)(0-2) \istb
1931 \istbA<level distance=.5*\xtlevdist>{b} \endist
1932 \end{istgame}
1933 \end{doccode}
1934
1935 You can interchangeably use \icmd{\istbA} and |\istb|, except for one case, in which you are working with a continuum of branches.
1936
1937 \remark (too early to comment)
1938 \begin{itemize}\tightlist
1939 \item The macro |\istbA| is originally created to work with |\istrootcntmA| as an arc version.
1940 \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}.)
1941 \item Except for the case of using a continuum of branches, |\istbA| is equivalent to |\istb| for users.
1942 \end{itemize}
1943
1944 Its terminal version \icmd{\istbAt} is also available, but the dual action label version of |\istbA| is not provided.
1945 The starred versions \icmd{\istbA*} and \icmd{\istbAt*} print a solid node (by default) at the end of the corresponding branch.
1946
1947 \subsubsection{\protect\CMD{\istbA}: applications}
1948 By specifying the |grow| key of |\istb| you can draw a branch with the exact length you want.
1949
1950 \begin{doccode}{.3}
1951 % Example: \istbA
1952 \begin{istgame}
1953 \xtdistance{10mm}{15mm}
1954 \istroot(0) \istb \istb \istb \endist
1955 \istroot(1)(0-1)
1956 \istbA(.7)<grow=-120> \istb
1957 \istbA(1)<grow=-30>{b} \endist
1958 \istroot(2)(0-3) \istb \istbA{b} \endist
1959 \draw [dashed] (1) circle (10mm);
1960 \draw [dotted] (1) circle (7mm);
1961 \end{istgame}
1962 \end{doccode}
1963
1964 You can also apply |\istbA| to easily ruin your regular balanced trees.
1965
1966 \begin{doccode}{.3}
1967 % Example: \istbA
1968 \begin{istgame}
1969 \xtdistance{10mm}{15mm}
1970 \istroot(0) \istbA(.2) \istbA(1.5) \istbA(1.2) \endist
1971 \istroot(1)(0-1)
1972 \istbA(.7) \istb \istbA(2)<grow=-60>{b} \endist
1973 \istroot(2)(0-3) \istbA(.2) \istbA(-1){b} \endist
1974 \end{istgame}
1975 \end{doccode}
1976
1977
1978 \section{Important labels: players, action labels, and payoffs}
1979 \label{sec:corelabels}
1980
1981 \subsection{How to put players}
1982
1983 \subsubsection{Players: basics}
1984
1985 The macro \icmd{\istroot} specifies the (sub)root of a simple tree and puts its \isw{owner} (or a \isw{player}).
1986 The direction to which a player label is put is set by the angle |< >| option of |\istroot|, like |<above>| (by default), |<east>|, or |<45>|.
1987 To specify the direction you can use degrees, the compass directions, or positional words.
1988
1989 \begin{doccode}{.3}
1990 % Example: node owner
1991 \begin{istgame}
1992 \istroot(0)<above>{Child} % default: <above>
1993 \istb \istb \endist
1994 \istroot(1)(0-2)<45>{Parent}
1995 \istb \istb \endist
1996 \end{istgame}
1997 \end{doccode}
1998
1999 \remark
2000 \begin{itemize}
2001 \item
2002 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}).
2003 \item
2004 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}).
2005 \end{itemize}
2006
2007 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}).
2008
2009 \begin{doccode}{.3}
2010 % Example: node owner (with \istrooto)
2011 \begin{istgame}
2012 \istrooto(0){Child}
2013 \istb \istb \endist
2014 \istrooto(1)(0-2)<45>{\textbf{Parent}}
2015 \istb \istb \endist
2016 \end{istgame}
2017 \end{doccode}
2018
2019 \subsubsection{Coloring players or a whole simple tree using \protect\CMD{\istroot}}
2020
2021 \label{sec:firstthing}
2022
2023 You can change the color of a player's name by giving |color| in the angle option of |\istroot|, like |<[red]>| or |<[blue]45>|.
2024 (This is the \TikZ\ way of giving options for the |label| nodes.)
2025
2026 \begin{doccode}{.3}
2027 % Example: coloring players
2028 \begin{istgame}
2029 \istroot(0)<[red]>{Child}
2030 \istb
2031 \istb
2032 \endist
2033 \istroot(1)(0-2)<[blue]45>{\textsf{Parent}}
2034 \istb
2035 \istb
2036 \endist
2037 \end{istgame}
2038 \end{doccode}
2039
2040 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.
2041
2042 \begin{doccode}{.3}
2043 % Example: coloring a simple tree
2044 \begin{istgame}
2045 \istroot[south,red](0) % whole simple tree, but node
2046 [draw=red,fill=red] % for node only
2047 <[red]45>{Child} % for owner only
2048 \istb{l}[al]{0,2}[south]
2049 \istb{r}[ar]
2050 \endist
2051 \istroot[south,draw=blue](1)(0-2)<45>{\texttt{Parent}}
2052 \istb{l}[al]{1,-1}[south]
2053 \istb{r}[ar]{1,1}[-90]
2054 \endist
2055 \end{istgame}
2056 \end{doccode}
2057
2058 \remark
2059 \begin{itemize}
2060 \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.
2061 \begin{itemize}
2062 \item If you want to have all the branches, action labels, and payoffs in red,
2063 just use the color name like |[south,red]|.
2064 If you want to have just the branches in blue, use the |draw| option key like |[south,draw=blue]|.
2065 (This is what \TikZ\ does.)
2066 \end{itemize}
2067 \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]|.
2068 (This is what |\istroot| requires.) Otherwise, you will get a compile \emph{error}.
2069 \end{itemize}
2070
2071 \subsubsection{Decorating players or a whole simple tree using \protect\CMD{\istrooto}}
2072
2073 The oval version \icmd{\istrooto} puts an owner within a bubble type node.
2074 With |\istrooto|, the color of a player can be changed by the second bracket |[option]|, such as |[red]| or |[blue]|.
2075 (This is the \TikZ\ way for giving options for the main |node|s.)
2076
2077 \begin{doccode}{.3}
2078 % Example: decorating players (with \istrooto)
2079 \begin{istgame}
2080 \istrooto(0)[text=red]{Child}
2081 \istb{a}{B}[below] \istb{c} \endist
2082 \istrooto(1)(0-2)[fill=white,text=blue,dashed]{Parent}
2083 \istb \istb \endist
2084 \end{istgame}
2085 \end{doccode}
2086
2087 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.
2088
2089 \begin{doccode}{.3}
2090 % Example: decorating players (with \istrooto)
2091 \begin{istgame}
2092 \istrooto[south,red](0)[draw=green,text=blue]{Child}
2093 \istb*{a}{B}[below] \istb{c} \endist
2094 \istrooto[-90,blue](1)(0-2)[draw=blue,text=blue]{Parent}
2095 \istb* \istb \endist
2096 \end{istgame}
2097 \end{doccode}
2098
2099 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.
2100
2101 \begin{doccode}{.3}
2102 % Example: decorating oval/box nodes
2103 \begin{istgame}
2104 \istrooto(0)[top color=white,
2105 bottom color=blue!80!black,text=yellow]{Child}
2106 \istb \istb \endist
2107 \istrooto(1)(0-2)
2108 [box node,fill=red!20,text=blue]{Parent}
2109 \istb \istb \endist
2110 \end{istgame}
2111 \end{doccode}
2112
2113 \subsubsection{Changing the input mode and text font style: \protect\CMD{\setistmathTF(*)}}
2114 \label{ssec:setistmathTF-owners}
2115
2116 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.
2117 The first number |1| means that an owner is printed in \emph{math mode}.
2118 (The second number |1| and third number |1| mean that action labels and payoffs are in math mode, respectively.)
2119 |\setistmathTF011| means that an owner is printed in text mode (this is default).
2120
2121 \begin{doccode}{.3}
2122 % Example: \setistmathTF
2123 \begin{istgame}
2124 \setistmathTF111 % owner: math mode
2125 \istroot(0){\Omega_{\alpha}}+10mm..20mm+
2126 \istb \istb \endist
2127 \istroot(1)(0-1)<180>{Alpha 2} \istb \istb \endist
2128 \setistmathTF011 % owner: text mode
2129 \istroot(2)(0-2)<0>{Omega 2} \istb \istb \endist
2130 \end{istgame}
2131 \end{doccode}
2132
2133 The starred version, for example, |\setistmathTF*011|, enables you to change the font style of an owner.
2134 Moreover, by specifying a text font style, like |\setistmathTF*011<texttt>|, in angle brackets, you can print an owner in typewriter font.
2135 (See Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}, for more details on |\setistmathTF*|.)
2136
2137 \begin{doccode}{.3}
2138 % Example: \setistmathTF(*)
2139 \begin{istgame}
2140 \setistmathTF111 % owner: math mode
2141 \istroot(0){\Omega_{\alpha}}+10mm..20mm+
2142 \istb \istb \endist
2143 \setistmathTF011 % owner: text mode
2144 \istroot(1)(0-1)<180>{Alpha 2}
2145 \istb \istb \endist
2146 \setistmathTF*011<texttt> % owner: in texttt
2147 \istroot(2)(0-2)<0>{Omega 2}
2148 \istb \istb \endist
2149 \end{istgame}
2150 \end{doccode}
2151
2152 The supplementary macro |\xtOwner| gives an alternative way of putting, outside of a simple tree, an owner in \emph{text mode} at a node.
2153 The starred version |\xtOwner*| prints an owner as in the input mode set by |\setistmathTF*|.
2154 (See Section~\ref{ssec:suppmac} on page~\pageref{ssec:suppmac}, for more details on |\xtOwner|.)
2155
2156 \begin{doccode}{.3}
2157 % Example: \setistmathTF(*)
2158 \begin{istgame}
2159 \setistmathTF111 % owner: math mode
2160 \istroot(0){\Omega_{\alpha}}+10mm..20mm+
2161 \istb \istb \endist
2162 \setistmathTF*011<textbf> % owner: text mode
2163 \istroot(1)(0-1)
2164 \istb \istb \endist
2165 \istroot(2)(0-2)
2166 \istb \istb \endist
2167 \xtOwner*(1){Alpha 2}[left] % owner: textbf
2168 \xtOwner(2){Omega 2}[r] % owner: normal font
2169 \end{istgame}
2170 \end{doccode}
2171
2172
2173 \subsection{How to put action labels}
2174
2175 \subsubsection{Action labels: basics}
2176
2177 The macro \icmd{\istb} prints a \isw{branch} and its \isw{action} label.
2178 Note that action labels should be input in \emph{math mode}, by default.
2179
2180 \begin{doccode}{.3}
2181 % Example: action labels
2182 \begin{istgame}
2183 \istroot(0)
2184 \istb{Good}[above left] \istb{Bad} \endist
2185 \istroot(1)(0-2)
2186 \istb{\text{\fbox{$\alpha$}}}[above left]
2187 \istb{\text{\fbox{$\beta$}}}[above right]
2188 \endist
2189 \end{istgame}
2190 \end{doccode}
2191
2192 By default, |\istb| prints its action label on the midpoint of the corresponding branch.
2193 You can specify the position of an action label with the positional words and abbreviations but not by the compass directions or degrees.
2194
2195 In the following example, the abbreviations are used to place action labels.
2196
2197 \begin{doccode}{.3}
2198 % Example: action labels with abbreviations
2199 \begin{istgame}
2200 \istroot(0)
2201 \istb{Good}[al] \istb{Bad} \endist
2202 \istroot(1)(0-2)
2203 \istb{\text{\fbox{$\alpha$}}}[al]
2204 \istb{\text{\fbox{$\beta$}}}[ar]
2205 \endist
2206 \end{istgame}
2207 \end{doccode}
2208
2209 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}).
2210
2211 \remark
2212 \begin{itemize}\tightlist
2213 \item
2214 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).
2215 \item
2216 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}).
2217 \end{itemize}
2218
2219
2220 \subsubsection{Decorating action labels}
2221
2222 You can change the color of action labels with \TikZ\ options.
2223 In the example below, the bracket options before an action label are for branches and those after are only for the action labels.
2224
2225 \begin{doccode}{.3}
2226 % Example: color and line style
2227 \begin{istgame}
2228 \istroot(0)
2229 \istb[dashed,thick]{A}[al]
2230 \istb[blue,very thick]{B}[r]
2231 \istb[blue,very thick]{C}[above right,red]
2232 \endist
2233 \end{istgame}
2234 \end{doccode}
2235
2236 \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]|.
2237
2238 You can also express action labels in a box or a circle, or other shapes with colors.
2239
2240 \begin{doccode}{.3}
2241 % Example: decorating action labels
2242 \begin{istgame}
2243 \istroot(0)
2244 \istb{A}[above left,draw=black,circle,fill=red!20]
2245 \istb{B}[right,draw=black,fill=green,inner sep=0pt]
2246 \istb{\textbf{C}}[above right,fill=blue,text=yellow]
2247 \endist
2248 \istroot(1)(0-2)
2249 \istb{D}[above left,xshift=-3pt,draw=blue,double]
2250 \istb{E}[above right,xshift=5pt,draw,star]
2251 \endist
2252 \end{istgame}
2253 \end{doccode}
2254
2255
2256 \subsubsection{Sloped action labels}
2257 \label{ssec:slopedlabels}
2258
2259 You can print \isw{sloped labels} for actions by using the \TikZ\ option |sloped|.
2260 Still you should remember that you cannot use the abbreviations to place action labels with other options like |sloped|.
2261
2262 \begin{doccode}{.3}
2263 % Example: sloped action labels
2264 \begin{istgame}
2265 \istroot(0)
2266 \istb{Good}[above,sloped]
2267 \istb{Bad}[above,sloped]
2268 \endist
2269 \istroot(1)(0-2)
2270 \istb{\text{\fbox{$\alpha$}}}[above,sloped]
2271 \istb{\text{\fbox{$\beta$}}}
2272 \endist
2273 \end{istgame}
2274 \end{doccode}
2275
2276 \warning
2277 Issues in \emph{sloped labels} in \TikZ\ with \emph{asymmetric scales}:
2278 \begin{itemize}\tightlist
2279 \item The |tree| library in \TikZ\ does not seem to treat sloped labels properly, when |xscale| or |yscale| is used asymmetrically.
2280
2281 % Example: actions labels with abbreviations
2282 \begin{doccode}{.31}
2283 \begin{istgame}[xscale=2.5]
2284 \istroot(0)
2285 \istb{Good}[above,sloped]
2286 \istb{Bad}[above,sloped]
2287 \endist
2288 \istroot(1)(0-2)
2289 \istb{\text{\fbox{$\alpha$}}}[above,sloped]
2290 \istb{\text{\fbox{$\beta$}}}
2291 \endist
2292 \end{istgame}
2293 \end{doccode}
2294
2295 \item A temporary solution to cure this issue is to declare the macro |\xtcureslopedlabelsNS|, provided with this package, in a TeX group with caution.
2296 For a tree growing eastwards or westwards, use |\xtcureslopedlabelsEW|, instead.
2297 (\emph{These solutions are only temporary. They have not been tested for every occasion.})
2298
2299 % Example: actions labels with abbreviations
2300 \begin{doccode}{.31}
2301 \begin{istgame}[xscale=2.5]
2302 \xtcureslopedlabelsNS
2303 \istroot(0)
2304 \istb{Good}[above,sloped]
2305 \istb{Bad}[above,sloped]
2306 \endist
2307 \istroot(1)(0-2)
2308 \istb{\text{\fbox{$\alpha$}}}[above,sloped]
2309 \istb{\text{\fbox{$\beta$}}}
2310 \endist
2311 \end{istgame}
2312 \end{doccode}
2313 \end{itemize}
2314
2315
2316 %\clearpage
2317 \subsubsection{Dual action labels}
2318
2319 You can also express \isw{dual action labels} for actions by using \icmd{\istB} or \icmd{\istBt}.
2320
2321 \begin{doccode}{.25}
2322 % dual action labels: \istB and \istBt
2323 \begin{istgame}[sloped,font=\footnotesize]
2324 \xtdistance{15mm}{25mm}
2325 \istroot(0)[chance node]
2326 \istB{Black}[a]{x}[b]
2327 \istB{Red}[a]{1-x}[b] \endist
2328 \istroot(1)(0-1)[chance node]
2329 \istBt{Head}[a]{y}[b]
2330 \istBt{Tail}[a]{1-y}[b] \endist
2331 \end{istgame}
2332 \end{doccode}
2333
2334 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).
2335
2336 \subsubsection{Changing the input mode and text font style: \protect\CMD{\setistmathTF(*)}}
2337 \label{ssec:setistmathTF-actionlabels}
2338
2339 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|).
2340
2341 So if you do like |\setistmathTF001| (with the second number |0|), action labels are in \emph{text mode}.
2342
2343 \begin{doccode}{.25}
2344 % Example: \setistmathTF001
2345 \begin{istgame}[sloped,font=\footnotesize]
2346 \istroot(0)[chance node]+15mm..25mm+
2347 \istB{Left}[a]{x}[b] \istB{Right}[a]{1-x}[b] \endist
2348 \setistmathTF001 % action labels: in text mode
2349 \istroot(1)(0-1)[chance node]
2350 \istBt{Left}[a]{y}[b] \istBt{Right}[a]{1-y}[b] \endist
2351 \istroot(2)(0-2)[chance node]
2352 \istBt{Head}[a]{z}[b] \istBt{Tail}[a]{1-z}[b] \endist
2353 \end{istgame}
2354 \end{doccode}
2355
2356 Moreover, if you use the \emph{starred version}, like \icmd{\setistmathTF*}|001|, action labels automatically are printed in \emph{italics}.
2357 If you specify a font style in \emph{curly braces}, like |\setistmathTF*001{texttt}|, you can even print action labels in typewriter font.
2358 For more details, see Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}.
2359
2360 \begin{doccode}{.25}
2361 % Example: \setistmathTF*001 (in italics)
2362 \begin{istgame}[sloped,font=\footnotesize]
2363 \istroot(0)[chance node]+15mm..25mm+
2364 \istB{Left}[a]{x}[b] \istB{Right}[a]{1-x}[b] \endist
2365 \setistmathTF*001 % action labels: in italics
2366 \istroot(1)(0-1)[chance node]
2367 \istB{Left}[a]{y}[b] \istB{Right}[a]{1-y}[b] \endist
2368 \setistmathTF*001{texttt} % action labels: in texttt
2369 \istroot(2)(0-2)[chance node]
2370 \istB{Head}[a]{z}[b] \istB{Tail}[a]{1-z}[b] \endist
2371 \end{istgame}
2372 \end{doccode}
2373
2374 The supplementary macro |\xtActionLabel| prints, from outside of a simple tree, an action label in \emph{math mode}.
2375 The starred version |\xtActionLabel*| prints an action label in the input mode as set by |\setistmathTF*|.
2376 For more details, see Section~\ref{ssec:istbandxtActionLabel} (on page~\pageref{ssec:istbandxtActionLabel}) and Section~\ref{sec:setistmathTF} (on page~\pageref{sec:setistmathTF}).
2377
2378 %\begin{doccode}{.25}
2379 %% Example: \xtActionLabel* (with \setistmathTF*)
2380 %\begin{istgame}[sloped,font=\footnotesize]
2381 %\istroot(0)[chance node]+15mm..25mm+
2382 % \istb{Left}[a] \istb{Right}[a] \endist
2383 %\setistmathTF*001 % action labels: in italics
2384 %\istroot(1)(0-1)[chance node]
2385 % \istb{Left}[a] \istb{Right}[a] \endist
2386 %\setistmathTF*001{texttt} % action labels: in texttt
2387 %\istroot(2)(0-2)[chance node]
2388 % \istb{Head}[a] \istb{Tail}[a] \endist
2389 %\xtActionLabel*(0)(0-2){1-x}[b] % in texttt
2390 %\xtActionLabel(1)(1-2){1-y}[b] % in math mode (default)
2391 %\xtActionLabel*(2)(2-2){1-z}[b] % in texttt
2392 %\end{istgame}
2393 %\end{doccode}
2394
2395
2396 \subsection{How to put payoffs}
2397
2398 \subsubsection{Payoffs: basics}
2399
2400 The macro \icmd{\istb} can print a branch and also the corresponding payoffs, in \emph{math mode} by default, near at its endpoint.
2401 The payoffs are put in the direction set by \icmd{\setistgrowdirection} (|south|, by default), unless it is changed by |<grow keyval>| of |\istroot|.
2402
2403 \begin{doccode}{.3}
2404 % Example: payoffs
2405 \begin{istgame}
2406 \istroot(0)
2407 \istb{Good}[l]{0,2}
2408 \istb{Bad} \endist
2409 \istroot(1)(0-2)
2410 \istb{\alpha}[al]{(1,1)}
2411 \istb{\beta}[ar]{-1,-1} \endist
2412 \end{istgame}
2413 \end{doccode}
2414
2415 \remark
2416 \begin{itemize}
2417 \item
2418 The supplementary macro |\xtPayoff| is provided for an extra way of putting payoffs (see Section~\ref{ssec:suppmac} on page~\pageref{ssec:suppmac}).
2419 \item
2420 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}).
2421 \end{itemize}
2422
2423 \subsubsection{Payoffs and \protect\cmd{\istgrowdirection}}
2424 \label{sec:payoffdirection}
2425
2426 The \isw{direction} of where payoffs are put from a terminal node follows \icmd{\istgrowdirection} typed in as the first optional argument of |\istroot|.
2427 The default direction is |south| and can be changed by |\setistgrowdirection|.
2428 For example, |\setistgrowdirection{north}| changes the default direction to |north|.
2429
2430 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}.
2431
2432 \begin{doccode}{.3}
2433 % grow=south (default)
2434 \begin{istgame}
2435 \istroot(0)
2436 \istb[dashed,thick]{A}{\binom23}
2437 \istb*{}{(-2,3)}
2438 \istbt[blue,very thick]{B}[ar]{2,3}
2439 \endist
2440 \end{istgame}
2441 \end{doccode}
2442
2443 By default, |grow=south|, so |\istgrowdirection| is |south| (or |below| or |-90|).
2444 The above example shows payoffs at the south (by default) of terminal nodes.
2445
2446 \remark
2447 \begin{itemize}
2448 \item
2449 You can simply omit the position of payoffs. Then they are printed, by default, in the direction as set by |\istgrowdirection|.
2450 \item
2451 However, if you use options other than the direction of payoffs, you must specify the direction with others.
2452 \item
2453 Moreover, the direction \emph{must} be the \emph{first} entry of the option list for payoffs and the abbreviations cannot be used.
2454 For example, |[b,yshift=-3mm]| and |[yshift=-3mm,below]| are not acceptable.
2455 It must be that |[below,yshift=-3mm]|.
2456 \item Note also that you can do like |[[yshift=-3mm]below]|, instead (see also page~\pageref{page:finetuningpayoffs}).
2457 \end{itemize}
2458
2459 \begin{doccode}{.3}
2460 % Example: grow=south (default)
2461 \begin{istgame}
2462 \istroot(0)
2463 \istb[dashed,thick]{A}{\binom23}
2464 \istb*{}{(-2,3)}
2465 \istbt[blue,very thick]{B}[ar]{2,3}
2466 [below,yshift=-3mm,draw]
2467 \endist
2468 \end{istgame}
2469 \end{doccode}
2470
2471 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.
2472
2473 \begin{doccode}{.3}
2474 % Example: grow=right (or east or 0 degree)
2475 \begin{istgame}
2476 \istroot[right](0)
2477 \istb[dashed,thick]{A}{\binom23}
2478 \istb*{}{(-2,3)}
2479 \istbt[blue,very thick]{B}[al]{2,3}
2480 \endist
2481 \xtHideTerminalNodes
2482 \end{istgame}
2483 \end{doccode}
2484
2485 |grow=right=\istgrowdirection|, so payoffs are put on the right.
2486
2487 \begin{doccode}{.3}
2488 % Example: grow=north
2489 \begin{istgame}
2490 \setistgrowdirection{north}
2491 \istroot(0)
2492 \istb[dashed,thick]{A}{\binom23}
2493 \istb*{}{(-2,3)}
2494 \istbt[blue,very thick]{B}[bl]{2,3}
2495 \endist
2496 \end{istgame}
2497 \end{doccode}
2498
2499 |grow=north=\istgrowdirection|, so payoffs are put above the terminal nodes.
2500
2501 \begin{doccode}{.3}
2502 % Example: grow=south west
2503 \begin{istgame}
2504 \istroot[south west](0)
2505 \istb[dashed,thick]{A}{\binom23}
2506 \istb{}{(-2,3)}
2507 \istb[blue,very thick]{B}[right]{2,3}
2508 \endist
2509 \end{istgame}
2510 \end{doccode}
2511
2512 |grow=south west=\istgrowdirection|, so payoffs are put below left of the terminal node.
2513
2514 \remark
2515 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]|.
2516
2517 \remark
2518 You can use the \isw{abbreviations} |[l]|, |[r]|, |[a]|, and |[b]| for |[left]|, |[right]|, |[above]|, and |[below]|, respectively.
2519 The abbreviations |[al]|, |[ar]|, |[bl]|, and |[br]| can also be used
2520 for |[above left]|, |[above right]|, |[below left]|, and |[below right]|, respectively,
2521 to put payoffs (for more details about abbreviations, see Section~\ref{sec:abb} on page~\pageref{sec:abb}).
2522
2523 \remark
2524 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]|.
2525
2526
2527 \subsubsection{Decorating payoffs}
2528
2529 You can change the color of payoffs by giving \TikZ\ options right before the positional words for payoffs.
2530 For example you can do like |\istb...{(1,1)}[[blue]below]|.
2531 %This is the \TikZ\ way of giving options for |label|.
2532 Note that, in this case, you cannot use the abbreviation of the positional words.
2533
2534 \begin{doccode}{.2}
2535 % Example: coloring payoffs
2536 \begin{istgame}
2537 \istroot(0)
2538 \istb{Good}[l]{0,2}
2539 \istb{Bad}
2540 \endist
2541 \istroot(1)(0-2)
2542 \istb{\alpha}[al]{(1,1)}[[red]below]
2543 \istb{\beta}[ar]{-1,-1}[[blue]below]
2544 \endist
2545 \end{istgame}
2546 \end{doccode}
2547
2548 You can also put payoffs in a box, a circle, or other shapes, even with color in the background.
2549
2550 \begin{doccode}{.2}
2551 % Example: decorating payoffs
2552 \begin{istgame}
2553 \istroot(0)
2554 \istb{Good}[l]{0,2}[[draw,circle,double,fill=green]below]
2555 \istb{Bad} \endist
2556 \istroot(1)(0-2)
2557 \istb{\alpha}[al]{(1,1)}[[red,draw=black]below]
2558 \istb{\beta}[ar]{\textbf{-1,-1}}
2559 [[draw,ellipse,fill=blue,text=yellow,inner sep=2pt]below]
2560 \endist
2561 \end{istgame}
2562 \end{doccode}
2563
2564
2565 \subsubsection{Changing the input mode and text font style: \protect\CMD{\setistmathTF(*)}}
2566 \label{ssec:setistmathTF-payoffs}
2567
2568 You can change the input mode for payoffs from math mode (by default) to text mode,
2569 by using |\setistmathTF010|. The last |0| means that payoffs are in text mode.
2570
2571 \begin{doccode}{.2}
2572 % Example: \setistmathTF
2573 \begin{istgame}
2574 \istroot(0)
2575 \istb{Good}[l]{pizza 1}
2576 \istb{Bad}
2577 \endist
2578 \setistmathTF010 % payoffs: in text mode
2579 \istroot(1)(0-2)
2580 \istb{\alpha}[al]{out 1}
2581 \istb{\beta}[ar]{in 1}
2582 \endist
2583 \end{istgame}
2584 \end{doccode}
2585
2586 The starred version, for example, |\setistmathTF*010[texttt]|, with a font style specified in brackets, prints payoffs in typewriter font.
2587
2588 \begin{doccode}{.2}
2589 % Example: \setistmathTF*
2590 \begin{istgame}
2591 \setistmathTF010 % payoffs: in text mode
2592 \istroot(0)
2593 \istb{Good}[l]{pizza 1}
2594 \istb{Bad}
2595 \endist
2596 \setistmathTF*010[texttt] % payoffs: in texttt
2597 \istroot(1)(0-2)
2598 \istb{\alpha}[al]{out 1}
2599 \istb{\beta}[ar]{in 1}
2600 \endist
2601 \end{istgame}
2602 \end{doccode}
2603
2604 The supplementary macro |\xtPayoff| prints, outside of a simple tree, payoffs in \emph{math mode}.
2605 The starred version |\xtPayoff*| prints payoffs in the input mode as set by |\setistmathTF*|.
2606 See Section~\ref{sec:setistmathTF} on page~\pageref{sec:setistmathTF}.
2607
2608
2609 \section{Input mode and text font style changer: \protect\CMD{\setistmathTF(*)}}
2610 \label{sec:setistmathTF}
2611
2612 The macro \icmd{\setistmathTF} enables you to change the input mode for important labels: owners, action labels, and payoff.
2613 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}.
2614 The three numbers represents the input mode for owners, action labels, and payoffs, respectively.
2615 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.
2616
2617 \begin{docstx}
2618 % \setistmathTF
2619 % syntax:
2620 \setistmathTF{<owner input mode>}{<action input mode>}{<payoff input mode>}
2621 % initial values:
2622 {0}{1}{1}
2623 \end{docstx}
2624
2625 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}.
2626 The arguments must be one of text font styles \emph{without a backslash} such as |textrm|, |textit|, |itshape|, |textbf|, |scriptsize|, |tiny|, and so on.
2627 Each of the three optional arguments is ignored when used with |\setistmathTF| and when the corresponding input mode is in math mode.
2628
2629 \begin{docstx}
2630 % \setistmathTF
2631 % syntax:
2632 \setistmathTF{}{}{}<owner font>{<action label font>}[<payoff font>]
2633 % defaults
2634 {0}{1}{1}<>{textit}[]
2635 \end{docstx}
2636
2637 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}.
2638
2639 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).
2640 With |\setistmathTF000<texttt>{textit}[tiny]|, all the optional arguments are ignored and all the labels are printed in normal text font.
2641 Note also that with |\setistmathTF*001|, you can print action labels in \emph{italics} (by default).
2642
2643 \subsection{\protect\CMD{\setistmathTF}: input mode changer}
2644
2645 The macro |\setistmathTF| is an \emph{input mode changer}, taking three numbers as mandatory arguments.
2646 The default input modes for important labels are set as |\setistmathTF011|.
2647
2648 \begin{doccode}{.4}
2649 % \setistmathTF
2650 \begin{istgame}
2651 %\setistmathTF011 % (default mode)
2652 \xtdistance{20mm}{20mm}
2653 \istroot(0){Alan 1}+20mm..40mm+
2654 \istb{left 1}[al]
2655 \istb{right 1}[ar] \endist
2656 \setistmathTF001 % mode: text,text,math
2657 \istroot(1)(0-1)<180>{Bob 2}
2658 \istb{left 2}[al]{pie 1}
2659 \istb{right 2}[ar]{pie 2} \endist
2660 \setistmathTF100 % mode: math,text,text
2661 \istroot(2)(0-2)<0>{Kim 3}
2662 \istb{left 3}[al]{pie 3}
2663 \istb{right 3}[ar]{pie 4} \endist
2664 \end{istgame}
2665 \end{doccode}
2666
2667
2668 \subsection{\protect\CMD{\setistmathTF*}: input mode and text font style changer}
2669
2670 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.
2671
2672 Each optional argument should be one of valid font shapes and sizes, but without a textbackslash (not as a command),
2673 such as |textbf|, |textsc|, |textit|, |large|, |tiny|, and so on.
2674 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.
2675
2676 \remark
2677 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.
2678
2679 \begin{doccode}{.4}
2680 % \setistmathTF*
2681 \begin{istgame}
2682 \xtdistance{20mm}{20mm}
2683 \setistmathTF*011<textsc>{tiny}[textbf]
2684 \istroot(0){Alan 1}+20mm..40mm+
2685 \istb{left 1}[al]
2686 \istb{right 1}[ar] \endist
2687 \setistmathTF*001<textsc>{tiny}[textbf]
2688 \istroot(1)(0-1)<180>{Bob 2}
2689 \istb{left 2}[al]{pie 1}
2690 \istb{right 2}[ar]{pie 2} \endist
2691 \setistmathTF*100[textbf] % actions labels in italics (by default)
2692 \istroot(2)(0-2)<0>{Kim 3}
2693 \istb{left 3}[al]{pie 3}
2694 \istb{right 3}[ar]{pie 4} \endist
2695 \end{istgame}
2696 \end{doccode}
2697
2698 \subsection{\protect\CMD{\setistmathTF*} and supplementary macros \texttt{\bs xtFoo*} printing labels}
2699
2700 Many supplementary macros, working outside of a simple tree, optionally print important labels: owners, action labels, and payoffs.
2701 These include \icmd{\xtOwner}, \icmd{\xtActionLabel}, \icmd{\xtPayoff}, \icmd{\xtInfosetOwner} and many more.
2702 All of the macros for information sets (except |\cntmAInfoset| and |\cntmAInfosetO|) such as |\xtInfoset| or |\xtCInfosetO| also print the owners of information sets.
2703 With any supplementary macros, by default, an owner is printed in text mode and action labels and payoffs are printed in math mode.
2704
2705 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}.
2706
2707 \begin{doccode}{.4}
2708 % Example: \setistmathTF* and \xtActionLabel*
2709 \begin{istgame}
2710 \xtdistance{20mm}{20mm}
2711 \setistmathTF*000<textsc>{tiny}[textbf]
2712 \istroot(0)+20mm..40mm+ \istb \istb \endist
2713 \istroot(1)(0-1) \istb \istb \endist
2714 \xtOwner*(0){Alan 1} \xtOwner(1){Bob 2}[l]
2715 \xtActionLabel(0)(0-1){left 1}[al]
2716 \xtActionLabel*(1)(1-1){left 2}[al]
2717 \xtPayoff*(1-1){pie 1}
2718 \end{istgame}
2719 \end{doccode}
2720
2721 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}.
2722
2723 Here are some more examples on owners of information sets (see Section~\ref{sec:infoset} for more details on information sets).
2724
2725 \label{page:xtInfoset*}
2726 \begin{doccode}{.25}
2727 % Example: owners of information sets
2728 \begin{istgame}
2729 \setistmathTF*011<textsf>
2730 \istroot(0){Alice}+15mm..30mm+ \istb{A} \istb{B} \endist
2731 \istroot(1)(0-1)<135>{Ben} \istb{C} \istb{D} \endist
2732 \istroot(2)(0-2) \istb{a} \istb{b} \endist
2733 \istroot(3)(1-2) \istb{a} \istb{b} \endist
2734 \setistmathTF*011<textbf>
2735 \xtInfosetO(0)(0)
2736 \xtInfosetO[rectangle,rounded corners=.2em](1)(1)
2737 \xtInfosetO*[ellipse,fill=blue!60]
2738 (3)(2){Cate}[sloped,white](1.5em)
2739 \end{istgame}
2740 \end{doccode}
2741
2742
2743 \begin{doccode}{.4}
2744 \begin{istgame}
2745 \setistmathTF*100{textsc}[texttt]
2746 \istroot(0){\alpha}+15mm..30mm+
2747 \istb{Left}[al] \istb{Right}[ar] \endist
2748 \istroot(1)(0-1) \istb \istb \endist
2749 \istroot(2)(0-2) \istb \istb \endist
2750 \xtdistance{10mm}{10mm}
2751 \istroot(3)(1-1) \istb \istb \endist
2752 \istroot(4)(1-2) \istb \istb \endist
2753 \istroot(5)(2-1) \istb \istb \endist
2754 \istroot(6)(2-2)
2755 \istb \istb{Go}[r]{omega} \endist
2756 \xtInfoset*(1)(2)
2757 \xtInfosetOwner*(1)(2){beta}[a]
2758 \setistmathTF*011<textbf>
2759 \xtCInfoset*(1-1)(2-1){Ben}
2760 \xtCInfoset*(1-2)(2-2){Cate}
2761 \end{istgame}
2762 \end{doccode}
2763
2764
2765 \label{page:xtCInfoset*}
2766 \begin{doccode}{.4}
2767 \begin{istgame}
2768 \setistmathTF*011<texttt>
2769 \istroot(0){Alice}+15mm..30mm+
2770 \istb \istb \endist
2771 \istroot(1)(0-1) \istb \istb \endist
2772 \istroot(2)(0-2) \istb \istb \endist
2773 \xtdistance{10mm}{10mm}
2774 \istroot(3)(1-1) \istb \istb \endist
2775 \istroot(4)(1-2) \istb \istb \endist
2776 \istroot(5)(2-1) \istb \istb \endist
2777 \istroot(6)(2-2) \istb \istb \endist
2778 \xtCInfosetO*(1)(0){imperfect recall}[left]
2779 \xtCInfosetO*[dashed,blue,thick]
2780 (1)(2)<.7>{Blue}
2781 \xtCInfosetO(1-1)(2-1){Ben}
2782 \xtCInfosetO(1-2)(2-2){Cate}
2783 \end{istgame}
2784 \end{doccode}
2785
2786
2787 \section{Fine-tuning positions of players, action labels, and payoffs (experimental)}
2788
2789 \subsection{Fine-tuning positions: owners}
2790
2791 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|.
2792
2793 Examples are |<[xshift=10pt]above>{Child}| and |<[label distance=-5pt]45>{Parent}|, as shown in the following:
2794
2795 \begin{doccode}{.2}
2796 % Example: node owner
2797 \begin{istgame}
2798 \istroot(0)<[xshift=10pt]above>{Child}
2799 \istb
2800 \istb
2801 \endist
2802 \istroot(1)(0-2)<[label distance=-5pt]45>{Parent}
2803 \istb
2804 \istb
2805 \endist
2806 \end{istgame}
2807 \end{doccode}
2808
2809 %\begin{doccode}{.3}
2810 %\begin{istgame}[scale=1.2]
2811 %\istcntm(cntm)[green]+8mm..24mm+
2812 %\istroot(0)(cntm){I}+8mm..8mm+
2813 % \istb{x}[r]
2814 % \istbm
2815 % \endist
2816 %\xtdistance{10mm}{18mm}
2817 %\istroot(1)(0-1)<[label distance=-3pt]120>{II}
2818 % \istb{Y}[l]{x,1-x}
2819 % \istb{N}[r]{0,0}
2820 % \endist
2821 %\end{istgame}
2822 %\end{doccode}
2823
2824
2825 \subsection{Fine-tuning positions: action labels}
2826
2827 \subsubsection{Abbreviations: \xw{[l]}, \xw{[r]}, \xw{[a]}, and \xw{[b]}}
2828
2829 As discussed in~\ref{ssec:istb} on page~\pageref{ssec:istb}, the macro |\istb| deals with the action labels.
2830
2831 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.
2832 (Internally, the \isw{abbreviations} for payoffs and those for action labels work slightly differently in terms of |xshift| and |yshift|.)
2833
2834 \begin{doccode}{.2}
2835 % Example: action labels (default position)
2836 \begin{istgame}[scale=1.2]
2837 \xtShowEndPoints
2838 \xtdistance{12mm}{16mm}
2839 \istroot(0)[initial node]
2840 \istb<grow=0>{\fbox{$a$}}[a] \istb<grow=90>{\fbox{$l$}}[l]
2841 \istb<grow=180>{\fbox{$b$}}[b] \istb<grow=-90>{\fbox{$r$}}[r]
2842 \endist
2843 \end{istgame}
2844 \end{doccode}
2845 %\captionof{figure}{action labels by defaults with \xw{l}, \xw{r}, \xw{a}, and \xw{b}}
2846
2847 When you use these abbreviations you can manipulate the horizontal and/or the vertical shifts toward branches by using \icmd{\xtALPush}. (This is experimental!)
2848
2849
2850 \begin{docstx}
2851 % syntax:
2852 \xtALPush{<xshift dim> for l and r}{<yshift dim> for a and b}
2853 % default:
2854 {0pt}{0pt}
2855 \end{docstx}
2856
2857 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:
2858
2859 \begin{doccode}{.2}
2860 % \xtALPush
2861 \begin{istgame}[scale=1.2]
2862 \xtShowEndPoints
2863 \xtALPush{-3pt}{5pt} % look here
2864 \xtdistance{12mm}{16mm}
2865 \istroot(0)[initial node]
2866 \istb<grow=0>{\fbox{$a$}}[a] \istb<grow=90>{\fbox{$l$}}[l]
2867 \istb<grow=180>{\fbox{$b$}}[b] \istb<grow=-90>{\fbox{$r$}}[r]
2868 \endist
2869 \end{istgame}
2870 \end{doccode}
2871 %\captionof{figure}{action labels shifted: comparison}
2872
2873
2874 \subsubsection{Abbreviations: \xw{[al]}, \xw{[ar]}, \xw{[bl]}, and \xw{[br]}}
2875 \label{sec:abb}
2876
2877 You can also use the \isw{abbreviations} |al|, |ar|, |bl|, and |br| to represent
2878 |above left|, |above right|, |below left|, and |below right|, respectively,
2879 to position action labels. Precise representation of abbreviations is as follows:
2880 \begin{itemize}\tightlist
2881 \item |[al]| represents |[above left,xshift=1pt,yshift=-2pt,black]|
2882 \item |[ar]| represents |[above right,xshift=-1pt,yshift=-2pt,black]|
2883 \item |[bl]| represents |[below left,xshift=1pt,yshift=2pt,black]|
2884 \item |[br]| represents |[below right,xshift=-1pt,yshift=2pt,black]|
2885 \end{itemize}
2886
2887 \begin{doccode}{.35}
2888 % Example: action labels with abbreviations
2889 \begin{istgame}[scale=1.1]
2890 \xtShowTerminalNodes[oval node,line width=.3pt]
2891 \def\xbox#1{\fbox{$#1$}} \def\ybox#1{#1}
2892 \xtdistance{12mm}{16mm}
2893 \istroot(0)[initial node]
2894 \istb<grow=0>{\ybox{a}}[a]
2895 \istb<grow=90>{\ybox{l}}[l]
2896 \istb<grow=180>{\ybox{b}}[b]
2897 \istb<grow=-90>{\ybox{r}}[r]
2898 \endist
2899 \begin{scope}[line width=1.2]
2900 \xtdistance{10mm}{20mm}
2901 \istroot[90](N)(0-2)
2902 \istbt[red]{\xbox{br}}[br]{1,1}
2903 \istbt[blue,dashed]{\xbox{bl}}[bl]{2,2}
2904 \endist
2905 \istroot[180](W)(0-3)
2906 \istbt[green]{\xbox{ar}}[ar]{0,3}
2907 \istbt[red]{\xbox{br}}[br]{2,1}
2908 \endist
2909 \istroot[-90](S)(0-4)
2910 \istbt[dotted]{\xbox{al}}[al]{1,-1}
2911 \istbt[green]{\xbox{ar}}[ar]{-1,1}
2912 \endist
2913 \istroot[0](E)(0-1)
2914 \istbt[blue,dashed]{\xbox{bl}}[bl]{1,3}
2915 \istbt[dotted]{\xbox{al}}[al]{2,0}
2916 \endist
2917 \foreach \x in {1,...,4} {\xtNode(0-\x)}
2918 \end{scope}
2919 \end{istgame}
2920 \end{doccode}
2921 \captionof{figure}{positioning action labels with the abbreviations}\label{fig:actlabel3}
2922
2923 \pagebreak[2]
2924
2925 In Figure~\ref{fig:actlabel3}, \fbox{$al$}'s are put in the same position from dotted branches,
2926 and so are the other labels from their corresponding branches, like \fbox{$bl$}'s from the blue dashed branches.
2927
2928 You can also use \icmd{\xtALShift} to put and push labels horizontally and vertically. (This is experimental!)
2929
2930 \begin{docstx}
2931 % syntax:
2932 \xtALShift{<horizontal shift dim>}{<vertical shift dim>}
2933 % defaults:
2934 {1pt}{2pt}
2935 \end{docstx}
2936
2937 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.
2938
2939 \begin{doccode}{.3}
2940 % Example: node owner
2941 \begin{istgame}
2942 \xtALShift{4pt}{3pt}
2943 \istroot(0)<above>{Child} % default: <above>
2944 \istb{A}[al] \istb{B}[ar] \endist
2945 \istroot(1)(0-2)<45>{Parent}
2946 \istb{L}[al] \istb{R}[ar] \endist
2947 \end{istgame}
2948 \end{doccode}
2949
2950
2951 \subsection{Fine-tuning positions: payoffs}
2952
2953 You can change the position of payoffs with \TikZ\ options: |xshift| and |yshift|.
2954 For example, you can do as shown in the following:
2955 \label{page:finetuningpayoffs}
2956
2957 \begin{doccode}{.3}
2958 % Example: payoffs
2959 \begin{istgame}
2960 \istroot(0)
2961 \istb{Good}[l]{0,2} \istb{Bad} \endist
2962 \istroot(1)(0-2)
2963 \istb{\alpha}[al]{(1,1)}[[xshift=-10pt]below]
2964 \istb{\beta}[ar]{-1,-1}[[yshift=-10pt]below]
2965 \endist
2966 \end{istgame}
2967 \end{doccode}
2968
2969
2970 \section{Growing direction of trees}
2971 \label{sec:growing}
2972
2973 You can draw a game tree that grows in any \isw{direction}.
2974 By default, a game tree grows down and the |child| branches are arranged and named counterclockwise with respect to their parent node.
2975 When a tree grows down, the branches are arranged from left to right.
2976 When a tree grows to the right, the branches are arranged and named from bottom to top.
2977
2978 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.
2979 In \TikZ, |grow'=<direction>| enables you to draw a tree developed clockwise.
2980
2981 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}.
2982
2983 \begin{docsty}
2984 % default: growing south counterclockwise
2985 \def\xtgrow{grow}
2986 \def\istdefault@grow{south} % tree growing direction
2987
2988 % \setistgrowdirection(')
2989 \NewDocumentCommand\setistgrowdirection{t'm}
2990 {\IfBooleanTF {#1}
2991 { \renewcommand\xtgrow{grow'}
2992 \renewcommand\istdefault@grow{#2}
2993 }
2994 { \renewcommand\xtgrow{grow}
2995 \renewcommand\istdefault@grow{#2}
2996 }
2997 }
2998 \end{docsty}
2999
3000
3001 \subsection{\protect\CMD{\setistgrowdirection} -- counterclockwise}
3002
3003 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).
3004
3005 \begin{doccode}{.3}
3006 % Example 1: \setistgrowdirection{south}
3007 \begin{istgame}
3008 \setistOvalNodeStyle{.6cm}
3009 \xtShowEndPoints[oval node]
3010 \istrooto(0){0}+{12.5mm}..{3.45cm}+
3011 \istb \istb \endist
3012 \xtdistance{12.5mm}{11.5mm}
3013 \istrooto(1)(0-1){1}
3014 \istb{}{3}[center] \istb{}{4}[center]
3015 \istb{}{5}[center] \endist
3016 \istrooto(2)(0-2){2}
3017 \istb{}{6}[center] \istb{}{7}[center] \endist
3018 \end{istgame}
3019 \end{doccode}
3020
3021 By default or with |\setistgrowdirection{south}|, the numbers written in the child nodes increase counterclockwise with respect to their parent nodes.
3022
3023 \subsection{\protect\CMD{\setistgrowdirection'} -- clockwise}
3024
3025 \begin{doccode}{.3}
3026 % Example 2: \setistgrowdirection'{south}
3027 \begin{istgame}
3028 \setistgrowdirection'{south}
3029 % same codes as in Example 1
3030 \setistOvalNodeStyle{.6cm}
3031 \xtShowEndPoints[oval node]
3032 \istrooto(0){0}+{12.5mm}..{3.45cm}+
3033 \istb \istb \endist
3034 \xtdistance{12.5mm}{11.5mm}
3035 \istrooto(1)(0-1){1}
3036 \istb{}{3}[center] \istb{}{4}[center]
3037 \istb{}{5}[center] \endist
3038 \istrooto(2)(0-2){2}
3039 \istb{}{6}[center] \istb{}{7}[center] \endist
3040 \end{istgame}
3041 \end{doccode}
3042
3043 With |\setistgrowdirection'{south}|, the numbers written in the child nodes increase \ixsw{clockwise} with respect to their parent nodes, which does not look natural.
3044
3045 \subsection{Examples of rotating trees with \protect\CMD{\setistgrowdirection}}
3046
3047 This macro allows you to to rotate a game tree.
3048
3049 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'}.
3050
3051
3052
3053 \xmedskip1\noindent\textbf{Tips:} \label{page:growtips}
3054 Though it is not necessary, it is suggested to use the following combinations of the macros and the directions.
3055
3056 |\setistgrowdirection{south}|: branches going counterclockwise (from left to right)\par
3057 |\setistgrowdirection{west}|: branches going counterclockwise (downward)\par
3058 \cmd{\setistgrowdirection'}|{north}|: branches going clockwise (from left to right)\par
3059 \cmd{\setistgrowdirection'}|{east}|: branches going clockwise (downward)
3060
3061 \remark When you use the swap version \cmd{\setistgrowdirection'}, using either |\istroot| or \cmd{\istroot'} gives you the same result.
3062
3063 \subsubsection{A tree growing east -- counterclockwise}
3064
3065 \begin{doccode}{.3}
3066 % Example 3: \setistgrowdirection{east}
3067 \begin{istgame}
3068 \setistgrowdirection{east}
3069 % same codes as in Example 1
3070 \setistOvalNodeStyle{.6cm}
3071 \xtShowEndPoints[oval node]
3072 \istrooto(0){0}+{12.5mm}..{3.45cm}+
3073 \istb \istb \endist
3074 \xtdistance{12.5mm}{11.5mm}
3075 \istrooto(1)(0-1){1}
3076 \istb{}{3}[center] \istb{}{4}[center]
3077 \istb{}{5}[center] \endist
3078 \istrooto(2)(0-2){2}
3079 \istb{}{6}[center] \istb{}{7}[center]
3080 \endist
3081 \end{istgame}
3082 \end{doccode}
3083
3084 Numbers increase upward (or counterclockwise).
3085
3086 \subsubsection{A tree growing east -- clockwise}
3087
3088 \begin{doccode}{.3}
3089 % Example 4: \setistgrowdirection'{east}
3090 \begin{istgame}
3091 \setistgrowdirection'{east}
3092 % same codes as in Example 1
3093 \setistOvalNodeStyle{.6cm}
3094 \xtShowEndPoints[oval node]
3095 \istrooto(0){0}+{12.5mm}..{3.45cm}+
3096 \istb \istb \endist
3097 \xtdistance{12.5mm}{11.5mm}
3098 \istrooto(1)(0-1){1}
3099 \istb{}{3}[center] \istb{}{4}[center]
3100 \istb{}{5}[center] \endist
3101 \istrooto(2)(0-2){2}
3102 \istb{}{6}[center] \istb{}{7}[center]
3103 \endist
3104 \end{istgame}
3105 \end{doccode}
3106
3107 Here, numbers increase downward (or clockwise).
3108 This looks more natural.
3109
3110 \subsubsection{A tree growing north -- counterclockwise}
3111
3112 \begin{doccode}{.3}
3113 % Example 5: \setistgrowdirection{north}
3114 \begin{istgame}
3115 \setistgrowdirection{north}
3116 % same codes as in Example 1
3117 \setistOvalNodeStyle{.6cm}
3118 \xtShowEndPoints[oval node]
3119 \istrooto(0){0}+{12.5mm}..{3.45cm}+
3120 \istb \istb \endist
3121 \xtdistance{12.5mm}{11.5mm}
3122 \istrooto(1)(0-1){1}
3123 \istb{}{3}[center] \istb{}{4}[center]
3124 \istb{}{5}[center] \endist
3125 \istrooto(2)(0-2){2}
3126 \istb{}{6}[center] \istb{}{7}[center]
3127 \endist
3128 \end{istgame}
3129 \end{doccode}
3130
3131 Numbers increase from right to left (or counterclockwise).
3132
3133 \subsubsection{A tree growing north -- clockwise}
3134
3135 \begin{doccode}{.3}
3136 % Example 6: \setistgrowdirection'{north}
3137 \begin{istgame}
3138 \setistgrowdirection'{north}
3139 \setistOvalNodeStyle{.6cm}
3140 \xtShowEndPoints[oval node]
3141 \xtdistance{12.5mm}{11.5mm}
3142 \istrooto(0){0}+{12.5mm}..{3.45cm}+
3143 \istb \istb \endist
3144 \xtdistance{12.5mm}{11.5mm}
3145 \istrooto(1)(0-1){1}
3146 \istb{}{3}[center] \istb{}{4}[center]
3147 \istb{}{5}[center] \endist
3148 \istrooto(2)(0-2){2}
3149 \istb{}{6}[center] \istb{}{7}[center]
3150 \endist
3151 \end{istgame}
3152 \end{doccode}
3153
3154 Numbers increase from left to right (or clockwise).
3155 This looks more natural.
3156
3157 \subsubsection{\protect\CMD{\setxtgrowkey} for one simple tree}
3158
3159 \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.
3160
3161 \begin{docsty}
3162 % \setxtgrowkey: definition
3163 \NewDocumentCommand\setxtgrowkey{m}
3164 {
3165 \renewcommand\xtgrow{#1}
3166 }
3167 % #1 is either grow or grow'
3168 \end{docsty}
3169
3170 The example below shows that the branches are arranged clockwise by \cmd{\setistgrowdirection'}.
3171 So you will need to use |\setistgrow{grow}| to locally get back to \emph{counterclockwise}.
3172
3173 \begin{doccode}{.25}
3174 % Example: using \setistgrowdirection' (swap version)
3175 \begin{istgame}[scale=.7,font=\scriptsize]
3176 \setistgrowdirection'{east}
3177 \istroot(0) \istb{a}[al] \istb{b}[bl] \endist
3178 \istroot[north](1)(0-1) \istb{c}[bl] \istb{d}[br] \endist
3179 {\setxtgrowkey{grow}
3180 \istroot[south](2)(0-2) \istb{e}[al] \istb{f}[ar] \endist
3181 }
3182 \istroot'(3)(2-2) \istb{g}[al] \istb{h}[bl] \endist
3183 \end{istgame}
3184 \end{doccode}
3185
3186 You can do the same thing by using |\setistgrowdirection| and \cmd{\istroot'}. See the following example, in which
3187 you do not need to use |\setxtgrowkey|.
3188
3189 \begin{doccode}{.25}
3190 % Example: using \istroot' (swap version)
3191 \begin{istgame}[scale=.7,font=\scriptsize]
3192 \setistgrowdirection{east}
3193 \istroot'(0) \istb{a}[al] \istb{b}[bl] \endist
3194 \istroot'[north](1)(0-1) \istb{c}[bl] \istb{d}[br] \endist
3195 \istroot[south](2)(0-2) \istb{e}[al] \istb{f}[ar] \endist
3196 \istroot'(3)(2-2) \istb{g}[al] \istb{h}[bl] \endist
3197 \end{istgame}
3198 \end{doccode}
3199
3200
3201 \section{Information sets}
3202
3203 \label{sec:infoset}
3204
3205 \subsection{\protect\CMD{\xtInfoset}: standard version}
3206 \label{ssec:xtInfoset}
3207
3208 The macro \icmd{\xtInfoset} draws an \isw{information set}, connecting two decision nodes.
3209
3210 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).
3211
3212 \begin{docstx}
3213 % \xtInfoset
3214 % syntax: from left to right
3215 \xtInfoset[<info line type>](<from>)(<to>){<owner>}[<pos>,<node opt>]
3216 % defaults:
3217 [-,infoset style](<m>)(<m>){}[above]
3218 % option style for (all) information sets
3219 infoset style={semithick,densely dotted}
3220 \end{docstx}
3221
3222 The two coordinates |(<from>)| and |(<to>)| are mandatory and all other arguments are optional.
3223
3224 \remark
3225 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}.
3226
3227 \begin{doccode}{.25}
3228 % \xtInfoset
3229 \begin{istgame}
3230 \istroot(0){1}+15mm..30mm+ \istb{a} \istb{b} \endist
3231 \istroot(1)(0-1) \istb{c} \istb{d} \endist
3232 \istroot(2)(0-2) \istb{c'} \istb{d'} \endist
3233 \xtInfoset(1)(2){2}
3234 \end{istgame}
3235 \end{doccode}
3236
3237 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.
3238
3239 \begin{doccode}{.25}
3240 \begin{istgame}
3241 \setistgrowdirection'{east}
3242 \setxtinfosetstyle{dashed} % changes line style
3243 \istroot(0){1}+15mm..30mm+ \istb{a} \istb{b} \endist
3244 \istroot(1)(0-1) \istb{c} \istb{d} \endist
3245 \istroot(2)(0-2) \istb{c'} \istb{d'} \endist
3246 \xtInfoset(1)(2){2}[left,red]
3247 \end{istgame}
3248 \end{doccode}
3249
3250 For a curved information set, you can do like, for example, |\xtInfoset[bend left](1)(2)|.
3251 However this depends on the direction of tree growing or swapping the arrangement of branches.
3252 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}.
3253
3254 \subsection{\protect\CMD{\xtInfosetO}: oval version}
3255
3256 \subsubsection{\protect\CMD{\xtInfosetO}: basics}
3257 \label{ssec:xtInfosetO}
3258
3259 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.
3260 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}}.
3261
3262 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).
3263
3264 \begin{docstx}
3265 % \xtInfosetO (from left to right)
3266 % syntax:
3267 \xtInfosetO[<bubble opt>](<from>)(<to>){<owner>}[<pos>,<owner opt>](min. height)
3268 % defaults: connecting two nodes: \xtInfoset(coor1)(coor2)
3269 [ -,draw,rectangle,samples,inner sep=0pt,transform shape,sloped,midway,
3270 rounded corners=.5*<minimum height>*<\xtscale>,
3271 minimum width=\n1+<minimum height>,
3272 minimum height=1em,inner sep=0pt,infoset style ]
3273 (<m>)(<m>){}[](1em)
3274 % option style for (all) information sets
3275 infoset style={semithick,densely dotted}
3276 \end{docstx}
3277
3278 Here is an example that shows a bubble type information set as a rounded rectangle and a singleton information set as a circle.
3279
3280 \begin{doccode}{.25}
3281 % \xtInfosetO
3282 \begin{istgame}
3283 \istroot(0){1}+15mm..30mm+
3284 \istb{a} \istb{b} \endist
3285 \istroot(1)(0-1) \istb{c} \istb{d} \endist
3286 \istroot(2)(0-2) \istb{c'} \istb{d'} \endist
3287 \xtInfosetO(0)(0)
3288 \xtInfosetO(1)(2){2}
3289 \end{istgame}
3290 \end{doccode}
3291
3292 The the height (or thickness) of an information set does not depend on |scale|, |xscale|, nor |yscale|.
3293
3294 \begin{doccode}{.25}
3295 % Example: \xtInfosetO with x-y-scale
3296 \begin{istgame}[xscale=1.2,yscale=.7]
3297 \istroot(0){1}+15mm..30mm+
3298 \istb{a} \istb{b} \endist
3299 \istroot(1)(0-1) \istb{c} \istb{d} \endist
3300 \istroot(2)(0-2) \istb{c'} \istb{d'} \endist
3301 \xtInfosetO(0)(0)
3302 \xtInfosetO(1)(2){2}
3303 \end{istgame}
3304 \end{doccode}
3305
3306 The size of an information set adjusts accordingly to the scale values.
3307
3308 \remark
3309 \begin{itemize}\firmlist
3310 \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)|.
3311 \item The width of a bubble information set is |\n1+<minimum height>| by default,
3312 where |\n1| is the Euclidean distance (measured by \TikZ) between two nodes in an information set.
3313 \end{itemize}
3314
3315
3316 \begin{doccode}{.25}
3317 % Example: \xtInfosetO: changing shape or color
3318 \begin{istgame}
3319 \setistgrowdirection'{east}
3320 \istroot(0){1}+15mm..30mm+
3321 \istb{a} \istb{b} \endist
3322 \istroot(1)(0-1) \istb{c} \istb{d} \endist
3323 \istroot(2)(0-2) \istb{c'} \istb{d'} \endist
3324 \xtInfosetO[fill=blue!20,minimum width=\n1+3em]
3325 (1)(2){2}(2em)
3326 \xtInfosetO(0)(0)(3em)
3327 \end{istgame}
3328 \end{doccode}
3329
3330 The shape of an information set does not depend on the direction of tree growing, either.
3331 You can change the shape to, for example, an ellipse by specifying it in the first bracket option list.
3332 You can also change the color of the bubble representing an information set by specifying it in the option list.
3333
3334 \begin{doccode}{.25}
3335 % Example: south east and yscale
3336 \begin{istgame}[yscale=1.5]
3337 \setistgrowdirection'{south east}
3338 \istroot(0) \istb \istb* \endist
3339 \istroot(1)(0-1){2} \istb* \istb* \endist
3340 \setxtinfosetstyle{fill=red!20,ellipse}
3341 \xtInfosetO(0)(0-2){1}
3342 \setxtinfosetstyle{solid,fill=blue!40,opacity=.5}
3343 \xtInfosetO(1-1)(1-2){3}
3344 \setxtinfosetstyle % restore defaults
3345 \xtInfosetO(1)(1)
3346 \end{istgame}
3347 \end{doccode}
3348
3349 Note that, in the above example, |\setxtinfosetstyle| is used to change the style of information sets.
3350 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}.)
3351
3352
3353 \subsubsection{Sloped information sets}
3354
3355 With the \pkg{istgame} package, a \isw{sloped information set} is not special. Just connect any two nodes using |\xtInfoset| or |\xtInfosetO|.
3356
3357 \begin{doccode}{.25}
3358 % Example: sloped infoset
3359 \begin{istgame}
3360 \istroot(0){Alice}+15mm..30mm+
3361 \istb{A} \istb{B} \endist
3362 \istroot(1)(0-1)<135>{Ben} \istb{C} \istb{D} \endist
3363 \istroot(2)(0-2) \istb{a} \istb{b} \endist
3364 \istroot(3)(1-2) \istb{a} \istb{b} \endist
3365 \xtInfosetO(0)(0)(2em)
3366 \xtInfosetO[rectangle](1)(1)
3367 \xtInfosetO(3)(2){Cate}
3368 \end{istgame}
3369 \end{doccode}
3370
3371 If you want to have an owner sloped too, you need the option |[sloped]|, as shown below.
3372
3373 \begin{doccode}{.25}
3374 % Example: sloped infoset with sloped text
3375 \begin{istgame}
3376 \setistgrowdirection'{east}
3377 \istroot(0){Alice}+15mm..30mm+ \istb{A} \istb{B} \endist
3378 \istroot(1)(0-1)<135>{Ben} \istb{C} \istb{D} \endist
3379 \istroot(2)(0-2) \istb{a} \istb{b} \endist
3380 \istroot(3)(1-2) \istb{a} \istb{b} \endist
3381 \setistmathTF*011<textbf>
3382 \xtInfosetO(0)(0)
3383 \xtInfosetO[rectangle,rounded corners=.2em](1)(1)
3384 \xtInfosetO*[ellipse,fill=blue!60]
3385 (3)(2){Cate}[sloped,white](1.5em)
3386 \end{istgame}
3387 \end{doccode}
3388
3389 \warning
3390 Issues in \emph{sloped labels} in \TikZ\ with \emph{asymmetric scales}:
3391 \begin{itemize}\tightlist
3392 \item The |tree| library in \TikZ\ does not seem to treat sloped labels properly, when |xscale| or |yscale| is used asymmetrically.
3393 \item To cure this problem you can use |\xtcureslopedlabelsNS| for trees growing northwards and southwards and |\xtcureslopedlabelsWS| for trees growing eastwards and westwards.
3394 (See Section~\ref{ssec:slopedlabels} and page~\pageref{page:slopedlabels-warning}, for more details with examples.)
3395 \item Note, however, that sloped labels for information owners printed by |\xtInfosetO| do not depend on scaling.
3396 \end{itemize}
3397
3398 \subsubsection{\protect\CMD{\setxtinfosetstyle}}
3399 \label{ssec:setxtinfosetstyle}
3400
3401 With the macro \icmd{\setxtinfosetstyle} you can change the style of all information sets, at once.
3402 For this end, a simple new style |infoset style| is defined as follows:
3403
3404 \begin{docsty}
3405 % \setxtinfosetstyle
3406 \NewDocumentCommand \setxtinfosetstyle { m }
3407 { \tikzset { infoset style/.style = { semithick , densely dotted , #1 } } }
3408 \end{docsty}
3409
3410 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}|.
3411
3412 If you want get the option values back to the default, then just declare |\setxtinfosetstyle|.
3413
3414 \begin{doccode}{.35}
3415 % \setxtinfosetstyle
3416 \begin{istgame}
3417 \istroot(0){Alice}+15mm..30mm+
3418 \istb \istb \endist
3419 \istroot(1)(0-1) \istbA(1.3) \istb \endist
3420 \istroot(2)(0-2) \istbA(1.3) \istb \endist
3421 \xtdistance{10mm}{8mm}
3422 \istroot(3)(1-1) \istb \istb \endist
3423 \istroot(4)(1-2) \istb \istb \endist
3424 \istroot(5)(2-1) \istb \istb \endist
3425 \istroot(6)(2-2) \istb \istb \endist
3426 \setxtinfosetstyle{dashed,blue,thick}
3427 \xtInfoset(1)(2){Blue}
3428 \xtInfoset(1-1)(2-1)
3429 \xtInfosetO(1-2)(2-2)
3430 \setxtinfosetstyle % restore defaults
3431 \xtInfosetO(0)(0)
3432 \end{istgame}
3433 \end{doccode}
3434
3435 With |\setxtinfosetstyle|, you can also change the background color of information sets.
3436 \begin{doccode}{.35}
3437 % Example: \setxtinfosetstyle
3438 \begin{istgame}
3439 \istroot(0){Alice}+15mm..30mm+
3440 \istb \istb \endist
3441 \istroot(1)(0-1) \istbA(1.3) \istb \endist
3442 \istroot(2)(0-2) \istbA(1.3) \istb \endist
3443 \xtdistance{10mm}{8mm}
3444 \istroot(3)(1-1) \istb \istb \endist
3445 \istroot(4)(1-2) \istb \istb \endist
3446 \istroot(5)(2-1) \istb \istb \endist
3447 \istroot(6)(2-2) \istb \istb \endist
3448 \setxtinfosetstyle{dashed,blue,thick,fill=blue!20}
3449 \xtInfosetO(1)(2){Blue}
3450 \xtInfosetO(1-1)(2-1)
3451 \xtInfoset(1-2)(2-2)
3452 \setxtinfosetstyle % restore defaults
3453 \xtInfosetO(0)(0)
3454 \end{istgame}
3455 \end{doccode}
3456
3457
3458 \subsubsection{\protect\CMD{\setxtinfosetlayer}}
3459 \label{sec:setxtinfosetlayer}
3460
3461 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.
3462 To go back to the default layer, just declare |\setxtinfosetlayer| or |\setxtinfosetlayer{}|.
3463
3464 \begin{doccode}{.25}
3465 % \setxtinfosetlayer
3466 \begin{istgame}
3467 \setistgrowdirection'{east}
3468 \istroot(0){1}+15mm..30mm+ \istb{a} \istb{b} \endist
3469 \istroot(1)(0-1) \istb{c} \istb{d} \endist
3470 \istroot(2)(0-2) \istb{c'} \istb{d'} \endist
3471 \setxtinfosetlayer{behind}
3472 \xtInfosetO[fill=red,ellipse,opacity=.2](0)(1)(1.5em)
3473 \setxtinfosetlayer
3474 \xtInfosetO[fill=blue!20](0-1)(0-2){2}(2em)
3475 \end{istgame}
3476 \end{doccode}
3477
3478
3479
3480 \subsection{\protect\CMD{\xtCInfoset}: curved version}
3481 \label{ssec:xtCInfoset}
3482
3483 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}
3484
3485 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).
3486
3487 \subsubsection{Curved information sets with \protect\CMD{\xtCInfoset}: basics}
3488
3489 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.
3490 The basic usage of |\xtCInfoset| is the same as of |\xtInfoset|.
3491
3492 \begin{docstx}
3493 % \xtCInfoset : basics
3494 % syntax:
3495 \xtCInfoset[<bubble opt>](<from>)(<to>){<owner>}[<pos>,<owner opt>]
3496 % defaults: connecting two nodes: \xtInfoset(coor1)(coor2)
3497 [ -,samples=500,tension=1,infoset style](<m>)(<m>){}[]
3498 % infoset style = { semithick , densely dotted }
3499 \end{docstx}
3500
3501 Here is an example of drawing curved information sets.
3502
3503 \begin{doccode}{.4}
3504 % \xtCInfoset
3505 \begin{istgame}
3506 \istroot(0){Ace}+15mm..30mm+
3507 \istb\istb\endist
3508 \istroot(1)(0-1) \istb \istb \endist
3509 \istroot(2)(0-2) \istb \istb \endist
3510 \xtdistance{10mm}{10mm}
3511 \istroot(3)(1-1) \istb \istb \endist
3512 \istroot(4)(1-2) \istb \istb \endist
3513 \istroot(5)(2-1) \istb \istb \endist
3514 \istroot(6)(2-2) \istb \istb \endist
3515 % curved information sets
3516 \xtCInfoset(1)(0){imperfect recall}[left]
3517 \xtCInfoset[dashed,blue,thick](1)(2){Blue}
3518 \xtCInfoset(1-1)(2-1){Ben}
3519 \xtCInfoset(1-2)(2-2){Cate}
3520 \end{istgame}
3521 \end{doccode}
3522
3523
3524
3525 \subsubsection{Skewed \protect\CMD{\xtCInfoset}: full functions}
3526
3527 Besides the basic functions, |\xtCInfoset| has two additional optional arguments to control the shape of a curved information set.
3528 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!|).
3529
3530 \begin{docstx}
3531 % \xtCInfoset : full definition
3532 % syntax:
3533 \xtCInfoset[<opt>](<from>)!midpoint factor!(<to>)
3534 <plot factor>
3535 {<owner>}[<pos>,<owner opt>]
3536 % defaults: connecting two nodes: \xtInfoset(coor1)(coor2)
3537 [ -,samples=500,tension=1,infoset style](<m>)!.5!(<m>)<1.3>{}[]
3538 % infoset style = { semithick , densely dotted }
3539 \end{docstx}
3540
3541 \label{page:plotfactor}
3542 By \ixw{plot factor}, we mean that it determines the maximum or minimum value of a curve.
3543 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.
3544 For example, |\xtCInfoset(1)(2)<.7>| (left to right) and |\xtCInfoset(2)(1)<1.3>| (right to left) will give the same result.
3545
3546 \begin{doccode}{.4}
3547 % \xtCIfoset: plot factor
3548 \begin{istgame}[scale=1.5,font=\scriptsize]
3549 \istroot(0){Ace}+15mm..30mm+\istb\istb\endist
3550 \istroot(1)(0-1) \istb \istb \endist
3551 \istroot(2)(0-2) \istb \istb \endist
3552 \setistmathTF*011<texttt>
3553 \xtCInfoset*[dashed,blue](1)(2)<1.5>{1.5}
3554 \xtCInfoset*[dashed,blue](1)(2)<1.3>{1.3}
3555 \xtCInfoset*[dashed,blue](1)(2)<1>{1}
3556 \setxtinfosetlayer{above}
3557 \xtCInfoset*[dashed,blue](1)(2)<.7>{.7}
3558 \setxtinfosetlayer{background}
3559 \xtCInfoset*[solid,green,thick](2)(1)<1.3>
3560 \xtCInfoset*[dashed,blue](1)(2)<.5>{.5}
3561 \end{istgame}
3562 \end{doccode}
3563
3564
3565 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.
3566
3567 \begin{doccode}{.4}
3568 % \xtCInfoset: midpoint factor (skewed)
3569 \begin{istgame}[font=\scriptsize]
3570 \istroot(0){Ace}+15mm..30mm+\istb\istb\endist
3571 \istroot(1)(0-1) \istb \istb \endist
3572 \istroot(2)(0-2) \istb \istb \endist
3573 \xtdistance{10mm}{10mm}
3574 \istroot(3)(1-1) \istb \istb \endist
3575 \istroot(4)(1-2) \istb \istb \endist
3576 \istroot(5)(2-1) \istb \istb \endist
3577 \istroot(6)(2-2) \istb \istb \endist
3578 \xtCInfoset(0)(1)<.7>{imperfect recall}[left]
3579 \xtCInfoset(1-1)!-.05!(2-1)<1.6>{Ben}
3580 \xtCInfoset(1-2)!.9!(2-2)<1.4>{Cate}
3581 \end{istgame}
3582 \end{doccode}
3583
3584 A curved information set drawn by |\xtCInfoset| does not depend on the tree growing direction.
3585 It does not depend on scaling nor swapping branches, either.
3586
3587 \begin{doccode}{.4}
3588 \begin{istgame}[scale=.85,font=\scriptsize]
3589 \setistgrowdirection'{east}
3590 \istroot(0){Ace}+15mm..30mm+\istb\istb\endist
3591 \istroot(1)(0-1) \istb \istb \endist
3592 \istroot(2)(0-2) \istb \istb \endist
3593 \xtdistance{10mm}{10mm}
3594 \istroot(3)(1-1) \istb \istb \endist
3595 \istroot(4)(1-2) \istb \istb \endist
3596 \istroot(5)(2-1) \istb \istb \endist
3597 \istroot(6)(2-2) \istb \istb \endist
3598 \xtCInfoset(0)(1)<.7>{imperfect recall}[left]
3599 \xtCInfoset(1-1)!-.05!(2-1)<1.6>{Ben}
3600 \xtCInfoset(1-2)!.9!(2-2)<1.4>{Cate}
3601 \end{istgame}
3602 \end{doccode}
3603
3604
3605 \subsection{\protect\CMD{\xtCInfosetO}: curved oval version}
3606 \label{ssec:xtCInfosetO}
3607
3608 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.
3609
3610 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).
3611
3612 \subsubsection{Curved bubble type information sets with \protect\CMD{\xtCInfosetO}: basics}
3613
3614 The basic usage of |\xtCInfosetO| is the same as of |\xtInfosetO|.
3615 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|.
3616
3617 \begin{docstx}
3618 % \xtCInfosetO : basics
3619 % syntax:
3620 \xtCInfosetO[<bubble opt>](<from>)(<to>){<owner>}[<pos>,<owner opt>](min. height)
3621 % defaults: connecting two nodes: \xtInfoset(coor1)(coor2)
3622 [ -,draw,samples=500,inner sep=0pt,minimum height=1em,infoset style ]
3623 (<m>)(<m>){}[](1em)
3624 % infoset style = { semithick , densely dotted }
3625 \end{docstx}
3626
3627
3628 \begin{doccode}{.4}
3629 % \xtCInfosetO: curved
3630 \begin{istgame}
3631 \setistmathTF*011<texttt>
3632 \istroot(0){Ace}+15mm..30mm+\istb\istb\endist
3633 \istroot(1)(0-1) \istb \istb \endist
3634 \istroot(2)(0-2) \istb \istb \endist
3635 \xtdistance{10mm}{10mm}
3636 \istroot(3)(1-1) \istb \istb \endist
3637 \istroot(4)(1-2) \istb \istb \endist
3638 \istroot(5)(2-1) \istb \istb \endist
3639 \istroot(6)(2-2) \istb \istb \endist
3640 \xtCInfosetO*(1)(0){imperfect recall}[left]
3641 \xtCInfosetO(1-1)(2-1){Ben}
3642 \xtCInfosetO(1-2)(2-2){Cate}
3643 \end{istgame}
3644 \end{doccode}
3645
3646 The shape of information sets does not depend on the direction of tree growing.
3647 You also can change the background color and the height, like |(1.5em)| as the last option.
3648
3649 \begin{doccode}{.4}
3650 \begin{istgame}[font=\scriptsize]
3651 \setistgrowdirection'{east}
3652 \istroot(0){Ace}+15mm..30mm+\istb\istb\endist
3653 \istroot(1)(0-1) \istb \istb \endist
3654 \istroot(2)(0-2) \istb \istb \endist
3655 \xtdistance{10mm}{10mm}
3656 \istroot(3)(1-1) \istb \istb \endist
3657 \istroot(4)(1-2) \istb \istb \endist
3658 \istroot(5)(2-1) \istb \istb \endist
3659 \istroot(6)(2-2) \istb \istb \endist
3660 \xtCInfosetO[fill=blue!20]
3661 (1)(0){imperfect recall}[left](.7em)
3662 \xtCInfosetO[fill=blue!20]
3663 (1-1)(2-1){Ben}
3664 \xtCInfosetO[fill=red!40,opacity=.5]
3665 (1-2)(2-2)<1.3>{Cate}(1.5em)
3666 \end{istgame}
3667 \end{doccode}
3668
3669
3670 \subsubsection{Skewed \protect\CMD{\xtCInfosetO}: full function}
3671
3672 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.
3673 The two optional arguments are \ixw{plot factor} and \ixw{midpoint factor}. (The meanings are documented on page~\pageref{page:plotfactor}.)
3674
3675 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!|).
3676
3677 \begin{docstx}
3678 % \xtCInfosetO : full definition
3679 % syntax:
3680 \xtCInfosetO[<bubble opt>](<from>)!<midpoint factor>!(<to>)
3681 <plot factor>
3682 {<owner>}[<pos>,<owner opt>](min. height)
3683 % defaults: connecting two nodes: \xtInfoset(coor1)(coor2)
3684 [ -,draw,samples,inner sep=0pt, minimum size=1em, infoset style]
3685 (<m>)!.5!(<m>)<1.3>{}[](1em)
3686 % infoset style = { semithick , densely dotted }
3687 \end{docstx}
3688
3689
3690 \begin{doccode}{.4}
3691 % \xtCInfosetO: skewed
3692 \begin{istgame}[font=\scriptsize]
3693 \istroot(0){Ace}+15mm..30mm+\istb\istb\endist
3694 \istroot(1)(0-1) \istb \istb \endist
3695 \istroot(2)(0-2) \istb \istb \endist
3696 \xtdistance{10mm}{10mm}
3697 \istroot(3)(1-1) \istb \istb \endist
3698 \istroot(4)(1-2) \istb \istb \endist
3699 \istroot(5)(2-1) \istb \istb \endist
3700 \istroot(6)(2-2) \istb \istb \endist
3701 \xtCInfosetO[fill=blue!20]
3702 (1)(0){imperfect recall}[left]
3703 \xtCInfosetO[dashed,blue](1)(2)<.7>{Blue}
3704 \xtCInfosetO(1-1)!.35!(2-1){Ben}
3705 \xtCInfosetO[fill=red!40,opacity=.5]
3706 (1-2)!.65!(2-2)<1.5>{Cate}
3707 \end{istgame}
3708 \end{doccode}
3709
3710
3711 \remark
3712 \begin{itemize}
3713 \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.)
3714 \item You do not need to bother if the tree is swapped, because the package internally takes care of that instead.
3715 \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.)
3716 \end{itemize}
3717
3718
3719 \subsection{Fine-tuning \protect\CMD{\xtCInfosetO}: Not for most users}
3720
3721 \subsubsection{\protect\CMD{\xtCInfosetOTurnX}: too high or too low \xw{midpoint factor}}
3722 \label{ssec:extrememidpointfactor}
3723
3724 What if you really want to use the |midpoint factor| close to |0| or |1|?
3725 In this case, you will possibly get some unsatisfactory result as shown in the example below.
3726 (Note that this being unsatisfied might not happen if you use the |midpoint factor| within the recommended range.)
3727
3728 \begin{doccode}{.4}
3729 % Example: \xtCInfoset (to be cured)
3730 \begin{istgame}[yscale=1.5,font=\scriptsize]
3731 \xtdistance{10mm}{10mm}
3732 \istroot(0){Ace}+15mm..15mm+
3733 \istb \istb \istb \istb \endist
3734 \istroot(1)(0-1) \istb \istb \endist
3735 \istroot(2)(0-2) \istb \istb \endist
3736 \istroot(3)(0-3) \istb \istb \endist
3737 \istroot(4)(0-4) \istb \istb \endist
3738 \xtCInfosetO[fill=blue!20]
3739 (1)!.2!(3)<1.4>{Ben}
3740 \xtCInfosetO[fill=red!40,opacity=.5]
3741 (2)!.8!(4)<1.5>{Cate}
3742 \tikzset{tmp/.style={draw,circle,opacity=.5,
3743 minimum size=1em}}
3744 \node at (1) [tmp,blue] {};
3745 \node at (4) [tmp,red] {};
3746 \end{istgame}
3747 \end{doccode}
3748
3749 The package provides the macro \icmd{\xtCInfosetOTurnX} to make it straight.
3750
3751 \begin{docstx}
3752 % \xtCInfosetOTurnX
3753 % syntax: X angle is mandatory
3754 \xtCInfosetOTurnX {turn X angle}{turn Y angle}
3755 \end{docstx}
3756
3757 First, find the blue circle and the red circle in the above example.
3758 Let us call by \xw{X} the (blue) circle at the beginning of an information set and by \xw{Y} at the end.
3759 With |\xtCInfosetOTurnX| you can turn these circles to get a better result.
3760
3761 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.
3762
3763 \begin{doccode}{.4}
3764 \begin{istgame}[yscale=1.5,font=\scriptsize]
3765 \xtdistance{10mm}{10mm}
3766 \istroot(0){Ace}+15mm..15mm+
3767 \istb \istb \istb \istb \endist
3768 \istroot(1)(0-1) \istb \istb \endist
3769 \istroot(2)(0-2) \istb \istb \endist
3770 \istroot(3)(0-3) \istb \istb \endist
3771 \istroot(4)(0-4) \istb \istb \endist
3772 \setxtinfosetlayer{behind}
3773 \xtCInfosetOTurnX{40}{0}
3774 \xtCInfosetO[fill=blue!20]
3775 (1)!.3!(3)<1.4>{Ben}[left]
3776 \setxtinfosetlayer{background}
3777 \xtCInfosetOTurnX{0}{-45}
3778 \xtCInfosetO[fill=red!40]
3779 (2)!.7!(4)<1.5>{Cate}
3780 \end{istgame}
3781 \end{doccode}
3782
3783 \remark
3784 \begin{itemize}\tightlist
3785 \item
3786 |\xtCInfosetOTurnX| works just once only for the following |\xtCInfosetO|, without affecting any other.
3787 \item
3788 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}).
3789 \end{itemize}
3790
3791
3792 \subsubsection{Scaling information sets according to the value of \TikZ\ \xw{scale}}
3793 \label{ssec:scaleissue}
3794
3795 The height (or thickness) of bubble type information sets drawn by |\xtInfosetO| and |\xtCInfosetO|,
3796 does not depend on the values of \TikZ\ scales.
3797 What if you want to make them scaled according the value of \TikZ\ symmetric scale, for example, |[scale=.5]|?
3798 Then use, instead, |[scale=.5,xscale=1]| or equivalently |[yscale=1,scale=.5]| in any order of the options.
3799
3800 Here is an ordinary example of using \xw{[scale=.5]}.
3801 %, where the heights (or thickness) of bubble type information sets are not affected by the value of \TikZ\ scale.
3802
3803 \begin{doccode}{.4}
3804 \begin{istgame}[scale=.5]
3805 \xtdistance{40mm}{30mm}
3806 \istroot(0)+40mm..40mm+
3807 \istb \istb \istb \endist
3808 \istroot(1)(0-1) \istb \istb \endist
3809 \istroot(2)(0-2) \istb \istb \endist
3810 \istroot(3)(0-3) \istb \istb \endist
3811 \xtCInfosetO(0)(0)(2em)
3812 \xtInfosetO[fill=green](1)(2)[green]
3813 \xtCInfosetO(1)(3){player}(1.5em)
3814 \end{istgame}
3815 \end{doccode}
3816
3817 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.
3818
3819 \begin{doccode}{.4}
3820 \begin{istgame}[scale=.5,xscale=1]
3821 \xtdistance{40mm}{30mm}
3822 \istroot(0)+40mm..40mm+
3823 \istb \istb \istb \endist
3824 \istroot(1)(0-1) \istb \istb \endist
3825 \istroot(2)(0-2) \istb \istb \endist
3826 \istroot(3)(0-3) \istb \istb \endist
3827 \xtInfosetO(0)(0)(2em)
3828 \xtInfosetO[fill=green](1)(2)
3829 \xtCInfosetO(1)(3){player}(1.5em)
3830 \end{istgame}
3831 \end{doccode}
3832
3833
3834 \remark (\textbf{Not for most users})
3835 How the \env{istgame} environment works with the \Tikz\ scales, regarding oval type information sets.
3836 \begin{itemize}\tightlist
3837 \item
3838 In the \ipkg{istgame} package, it is intended that the height (or thickness) of any bubble type information set
3839 is not affected by the values of \TikZ\ scale, unless users change it. (This is a desirable feature.)
3840 \item
3841 The shapes of bubble type information sets work perfectly fine, as intended, when:
3842 \begin{itemize}
3843 \item \ixw{scale} only (not with \ixw{xscale} nor \ixw{yscale}) is used in the environment option list
3844 \item and either |xscale| or |yscale| or both (not with |scale|) are used in the option list.
3845 \end{itemize}
3846 \item
3847 Now, this is how the \env{istgame} environment works when |scale| is used with |xscale| or |yscale|.
3848 \begin{itemize}
3849 \item When this is the case, the value of |scale| is not taken care of by the package.
3850 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}}.
3851 \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.
3852 \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.)
3853 \end{itemize}
3854 %\item
3855 %You can also try using \icmd{\pgftransformscale} like |\pgftransfromscale{1/\xtscale}|.
3856 \end{itemize}
3857
3858 \section{Continuum of branches}
3859
3860 \label{sec:cntm}
3861
3862 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.
3863 As you will see, all the supplemental macros to a continuum of branches are prefixed by |\cntm|.
3864
3865 Two types of graphic objects, a triangle type and an arc type, are provided in the package to represent a continuum of branches.
3866 So you can start by choosing one type of a continuum of branches.
3867
3868 \subsection{\protect\CMD{\istrootcntm}: standard continuum version}
3869 \label{ssec:istrootcntm}
3870
3871 \subsubsection{\protect\CMD{\istrootcntm}: basics}
3872
3873 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.
3874 You can regard |\istrootcntm| as the sum |\istroot| |+| |cntm|.
3875
3876 \begin{docstx}
3877 % \istrootcntm
3878 % syntax:
3879 \istrootcntm[<grow keyval>,<opt>](<coor1>)(<coor2>)[<node style>,<opt>]%
3880 <owner label angle>{<owner>}+<cntm-levdist>..<cntm-sibdist>+
3881 % defaults:
3882 [south](<m>)(0,0)[decision node]<above>{}+8mm..24mm+
3883 % arguments: (coor1) is mandatory, all others are optional arguments
3884 [grow] % the direction of growing <default: south>
3885 (coor1) % name of the (sub)root: mandatory
3886 (coor2) % the (sub)root is at (coor2) <default: (0,0)>
3887 [node style] % node style <default: decision node>
3888 <angle> % position of owner name <default: above>
3889 {owner} % name of the owner of the (sub)root
3890 +cntmlevdist..cntmsibdist+ % <defaults: 8mm,24mm>
3891 \end{docstx}
3892
3893 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).
3894
3895 \begin{doccode}{.25}
3896 % \istrootcntm (\istroot + cntm)
3897 \begin{istgame}[scale=1.2]
3898 \cntmdistance{8mm}
3899 \istrootcntm(0){I}
3900 \istb{x}[r] \istbm \endist
3901 \xtdistance{10mm}{20mm}
3902 \istroot(1)(0-1)<[label distance=-3pt]120>{II}
3903 \istb{Y}[al]{x,1-x}
3904 \istb{N}[ar]{0,0}
3905 \endist
3906 \end{istgame}
3907 \end{doccode}
3908
3909 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.
3910
3911 \begin{doccode}{.25}
3912 % Example: action sibling distance
3913 \begin{istgame}[scale=1.2]
3914 \xtdistance{10mm}{20mm}
3915 \istrootcntm(0){I}+10mm..20mm+
3916 \istb{x}[r]
3917 \istb*[dashed,white]
3918 \endist
3919 \istroot(1)(0-1)<[label distance=-3pt]120>{II}
3920 \istb{Y}[al]{x,1-x}
3921 \istb{N}[ar]{0,0}
3922 \endist
3923 \end{istgame}
3924 \end{doccode}
3925
3926 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+|.
3927 Note that these options do not affect the action sibling distance.
3928
3929 \remark
3930 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}.}
3931
3932 %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}|.
3933
3934 \begin{doccode}{.25}
3935 \begin{istgame}[font=\scriptsize]
3936 \xtdistance{10mm}{20mm}
3937 \istrootcntm(1){1} % period 1
3938 \istb{x}[r] \istbm \endist
3939 \istroot(A1)(1-1)<[label distance=-3pt]135>{2}
3940 \istb{A}[al]{x,1-x} \istb{R}[ar] \endist
3941 \istrootcntm(2)(A1-2){2}+10mm..15mm+ % period 2
3942 \istb{y}[r] \istbm \endist
3943 \istroot(A2)(2-1)<[label distance=-3pt]135>{1}
3944 \istb{A}[al]{1-y,y} \istb{R}[ar] \endist
3945 \istrootcntm(3)(A2-2){1} % period 3
3946 \istb{x}[r] \istbm \endist
3947 \istroot(A1)(3-1)<[label distance=-3pt]135>{2}
3948 \istb{A}[al]{x,1-x} \istb{R}[ar]{0,0} \endist
3949 \end{istgame}
3950 \end{doccode}
3951
3952 \remark
3953 \begin{itemize}
3954 \item
3955 Once the work of |\istrootcntm| is completed by |\endist|, |\istrootcntm| internally produces three node coordinates: |(cntm)|, |(cntm-1)|, and |(cntm-2)|.
3956 \item You can use these coordinates after |\istrootcntm| and before another |\istrootcntm| or one of its variant, like |\istrootcntmA|, is used.
3957 \end{itemize}
3958
3959
3960 \begin{doccode}{.25}
3961 % Example: using coordinates: (cntm),(cntm-1),(cntm-2)
3962 \begin{istgame}[scale=1.2]
3963 \istrootcntm(0){I}
3964 \istb{x}[r] \istbm \endist
3965 \xtdistance{10mm}{20mm}
3966 \istroot(1)(0-1)<[label distance=-3pt]120>{II}
3967 \istb{Y}[al]{x,1-x} \istb{N}[bl]{0,0} \endist
3968 \xtInfosetO(cntm)(cntm)
3969 \xtInfosetO[draw=none,fill=red,opacity=.3](cntm-1)(cntm-2)
3970 \end{istgame}
3971 \end{doccode}
3972
3973 \subsubsection*{\protect\CMD{\istrootcntm'}: swap version}
3974
3975 The swap version \icmd{\istrootcntm'} arranges branches clockwise just like \cmd{\istroot'} does.
3976 With \cmd{\setistgrowdirection'}, both |\istrootcntm| and its swap version \cmd{\istrootcntm'} end up with the same result.
3977
3978 \begin{doccode}{.25}
3979 % \istrootcntm' (swap version)
3980 \begin{istgame}[scale=1.2]
3981 \setistgrowdirection'{east}
3982 \istrootcntm'(0){I}
3983 \istb{x}[b] \istbm \endist
3984 \xtdistance{10mm}{20mm}
3985 \istroot(1)(0-1)<[label distance=-3pt]120>{II}
3986 \istb{Y}[al]{x,1-x} \istb{N}[bl]{0,0} \endist
3987 \end{istgame}
3988 \end{doccode}
3989
3990 %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}.
3991
3992
3993 \subsubsection{\protect\CMD{\cntmdistance}}
3994 \label{page:cntmdistance}
3995
3996 \icmd{\cntmdistance} working for |\istrootcntm| (and |\istrootcntmA|) is analogous to |\xtdistance| working for |\istroot|.
3997 %As |\xtdistance| controls the height and width of a simple tree,
3998 |\cntmdistance| controls the height and width of a background triangle representing a continuum, but it has one more function than |\xtdistance|.
3999 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.
4000
4001 \begin{docstx}
4002 % \cntmdistance
4003 % syntax:
4004 \cntmdistance{<cntm levdist>}{<cntm sibdist>}{<action sibdist>}
4005 % defaults: <cntm levdist> is mandatory, and all others are optional
4006 {8mm}{3*<cntm lev dist>}{(1/3)*<cntm sib dist>}
4007 \end{docstx}
4008
4009 Note that the first argument of |\cntmdistance| is \emph{mandatory}, and all the others are optional.
4010 For example, |\cntmdistance{10mm}{20mm}| means the followings:
4011 \begin{verbatim}
4012 \cntmlevdist = 10mm, \cntmsibdist = 20mm, and
4013 \cntmactsibdist = (1/3)*\cntmsibdist, from now on.
4014 \end{verbatim}
4015
4016 And |\cntmdistance{10mm}{20mm}{3mm}| means now |\cntmactsibdist = 3mm|.
4017
4018
4019
4020 \begin{doccode}{.25}
4021 % \cntmdistance
4022 \begin{istgame}[font=\scriptsize]
4023 \xtdistance{10mm}{20mm}
4024 \cntmdistance{10mm}{20mm}{3mm}
4025 \istrootcntm(1){1} % period 1
4026 \istb{x}[r] \istbm \endist
4027 \istroot(A1)(1-1)<[label distance=-3pt]135>{2}
4028 \istb{A}[al]{x,1-x} \istb{R}[ar] \endist
4029 \istrootcntm(2)(A1-2){2} % period 2
4030 \istb{y}[r] \istbm \endist
4031 \istroot(A2)(2-1)<[label distance=-3pt]135>{1}
4032 \istb{A}[al]{1-y,y} \istb{R}[ar] \endist
4033 \istrootcntm(3)(A2-2){1} % period 3
4034 \istb{x}[r] \istbm \endist
4035 \istroot(A1)(3-1)<[label distance=-3pt]135>{2}
4036 \istb{A}[al]{x,1-x} \istb{R}[ar]{0,0} \endist
4037 \end{istgame}
4038 \end{doccode}
4039
4040
4041
4042 %\begin{doccode}{.25}
4043 %% Example:
4044 %\begin{istgame}[scale=1.2]
4045 %\cntmdistance{10mm}{3*\cntmlevdist}{1.5*10mm}
4046 %\istrootcntm(0){I}
4047 % \istb*{x}[r] \istbm \endist
4048 %\end{istgame}
4049 %\end{doccode}
4050
4051
4052 \subsubsection{\protect\CMD{\cntmdistance*}: combined with \protect\CMD{\xtdistance}}
4053 \label{sec:xtdistance*}
4054
4055 The macro \icmd{\cntmdistance*} incorporates |\cntmdistance| with |\xtdistance|.
4056
4057
4058 \begin{docstx}
4059 % \cntmdistance*
4060 % syntax:
4061 \cntmdistance*{<lev dist>}{<sib dist>}{<action sib dist>}
4062 % defaults:
4063 {15mm}{15mm}{(1/3)*<sib dist>}
4064 \end{docstx}
4065
4066
4067 The macro |\cntmdistance| does not have anything to do with |\xtdistance|, but the starred version |\cntmdistance*| does.
4068 For example, |\cntmdistance*{10mm}{20mm}| means the followings:
4069 \begin{verbatim}
4070 \cntmlevdist = \xtlevdist = 10mm, \cntmsibdist = \xtsibdist = 20mm, and
4071 \cntmactsibdist = (1/3)*\cntmsibdist, from now on.
4072 \end{verbatim}
4073 And |\cntmdistance*{10mm}{20mm}{3mm}| means now |\cntmactsibdist = 3mm|.
4074
4075
4076 \begin{doccode}{.25}
4077 % \cntmdistance* and \xtdistance
4078 \begin{istgame}[scale=1.2]
4079 \cntmdistance*{10mm}{20mm}{3mm}
4080 \istrootcntm(0){I}
4081 \istb{x}[r] \istbm \endist
4082 %\xtdistance{10mm}{20mm}
4083 \istroot(1)(0-1)<[label distance=-3pt]120>{II}
4084 \istb{Y}[al]{x,1-x} \istb{N}[ar]{0,0} \endist
4085 \end{istgame}
4086 \end{doccode}
4087
4088
4089 %%%You can use |\cntmpreset|, |\cntmactsibdist|, and |\cntmdistance| in any order, but whichever comes later overrides the previous effects.
4090
4091
4092 \subsubsection{\protect\CMD{\cntmpreset}: controlling continuum triangles}
4093 \label{ssec:cntmpreset}
4094
4095 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|.
4096
4097 \begin{docstx}
4098 % \cntmpreset
4099 % syntax:
4100 \cntmpreset[<line style>,<opts>]{<shrink factor>}[<fill color>]
4101 % defaults
4102 [-,solid,draw=black!25,fill=<draw color>]{1}[]
4103 \end{docstx}
4104
4105 To change the background color you can do like, for example, either |\cntmpreset[blue!20]| or |\cntmpreset{1}[blue!20]|.
4106 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.
4107
4108
4109 \begin{doccode}{.25}
4110 \begin{istgame}[scale=.8,font=\scriptsize]
4111 \cntmdistance*{10mm}{20mm}{3mm}
4112 \istrootcntm(1) \istb \istbm \endist
4113 \istroot(A1)(1-1) \istb \istb \endist
4114 \cntmpreset[draw=blue,dashed][red!20]
4115 \istrootcntm(2)(A1-2) \istb \istbm \endist
4116 \istroot(A2)(2-1) \istb \istb \endist
4117 \cntmpreset[blue!20][red!20]
4118 \istrootcntm(3)(A2-2) \istb \istbm \endist
4119 \istroot(A1)(3-1) \istb \istb \endist
4120 \end{istgame}
4121 \end{doccode}
4122
4123
4124
4125 %% example with labels
4126
4127 %\begin{doccode}{.25}
4128 %\begin{istgame}[font=\scriptsize]
4129 %\xtdistance{10mm}{20mm}
4130 %\cntmdistance{10mm}{20mm}{3mm}
4131 %\istrootcntm(1){1} % period 1
4132 % \istb{x}[r] \istbm \endist
4133 %\istroot(A1)(1-1)<[label distance=-3pt]135>{2}
4134 % \istb{A}[al]{x,1-x} \istb{R}[ar] \endist
4135 %\cntmpreset[draw=blue,dashed][red!20]
4136 %\istrootcntm(2)(A1-2){2} % period 2
4137 % \istb{y}[r] \istbm \endist
4138 %\istroot(A2)(2-1)<[label distance=-3pt]135>{1}
4139 % \istb{A}[al]{1-y,y} \istb{R}[ar] \endist
4140 %\cntmpreset[blue!20][red!20]
4141 %\istrootcntm(3)(A2-2){1} % period 3
4142 % \istb{x}[r] \istbm \endist
4143 %\istroot(A1)(3-1)<[label distance=-3pt]135>{2}
4144 % \istb{A}[al]{x,1-x} \istb{R}[ar]{0,0} \endist
4145 %\end{istgame}
4146 %\end{doccode}
4147
4148
4149
4150 You can also draw a \emph{smaller} triangle, by specifying \ixw{shrink factor} as a decimal number in the curly braces.
4151
4152
4153 \begin{doccode}{.25}
4154 % \cntmpreset{<shrink factor>}
4155 \begin{istgame}[font=\scriptsize]
4156 \cntmdistance*{10mm}{20mm}
4157 \cntmpreset{.7}
4158 \istrootcntm(1)
4159 \istb \endist
4160 \istroot(A1)(1-1)
4161 \istb \istb \endist
4162 \cntmpreset[draw=blue,dashed]{.8}[red!20]
4163 \istrootcntm(2)(A1-2)
4164 \istb \istbm \endist
4165 \istroot(A2)(2-1)
4166 \istb \istb \endist
4167 \end{istgame}
4168 \end{doccode}
4169
4170
4171
4172 \subsubsection{\protect\CMD{\cntmpreset*}: simple triangles with no background color}
4173 \label{ssec:cntmpreset*}
4174
4175 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}.
4176
4177
4178 \begin{docstx}
4179 % \cntmpreset
4180 % syntax:
4181 \cntmpreset*[<line style>,<opts>]{<shrink factor>}[<fill color>]
4182 % defaults
4183 [-,solid,draw=black,fill=none]{1}[]
4184 \end{doccode}
4185 \end{docstx}
4186
4187 \remark
4188 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.
4189
4190
4191 \begin{doccode}{.25}
4192 % \cntmpreset*
4193 \begin{istgame}[font=\scriptsize]
4194 \cntmdistance*{10mm}{20mm}
4195 \cntmpreset*
4196 \istrootcntm(1)
4197 \istb \endist
4198 \istroot(A1)(1-1)
4199 \istb \istb \endist
4200 \cntmpreset*[fill=blue!20]
4201 \istrootcntm(2)(A1-2)
4202 \istb \endist
4203 \istroot(A2)(2-1)
4204 \istb \istb \endist
4205 \cntmpreset % restore default triangle options
4206 \istrootcntm(3)(A2-2)
4207 \istb \istbm \endist
4208 \istroot(A1)(3-1)
4209 \istb \istb \endist
4210 \end{istgame}
4211 \end{doccode}
4212
4213
4214
4215 You can also draw a \emph{smaller} triangle, by specifying \ixw{shrink factor} as a decimal number in the curly braces.
4216
4217
4218 \begin{doccode}{.25}
4219 % Example: \cntmpreset(*)
4220 \begin{istgame}[font=\scriptsize]
4221 \cntmdistance*{10mm}{20mm}
4222 \cntmpreset*{.5}
4223 \istrootcntm(1)
4224 \istb \endist
4225 \istroot(A1)(1-1)
4226 \istb \istb \endist
4227 \istrootcntm(2)(A1-2)
4228 \istb \endist
4229 \istroot(A2)(2-1)
4230 \istb \istb \endist
4231 \cntmpreset{.7} % restore default triangle options
4232 \istrootcntm(3)(A2-2)
4233 \istb \istbm \endist
4234 \istroot(A1)(3-1)
4235 \istb \istb \endist
4236 \end{istgame}
4237 \end{doccode}
4238
4239
4240 \subsection{\protect\CMD{\istrootcntmA}: continuum arc version}
4241 \label{ssec:istrootcntmA}
4242
4243 \subsubsection{\protect\CMD{\istrootcntmA}: basics}
4244 \label{ssec:cntmA}
4245
4246 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|.
4247 You can regard |\istrootcntmA| as the sum |\istroot| |+| |cntmA|.
4248
4249
4250 \remark
4251 \begin{itemize}
4252 \item
4253 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.
4254 \item
4255 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}}.)
4256 \end{itemize}
4257
4258
4259 \begin{docstx}
4260 % \istrootcntmA
4261 % syntax:
4262 \istrootcntmA[<grow keyval>,<opt>](<coor1>)(<coor2>)[<node style>,<opt>]
4263 <arc pos>{<owner>}+<cntm levdist>..<cntm sibdist>+
4264 % defaults:
4265 [south](<m>)(0,0)[decision node]<above>{}+8mm..24mm+
4266 % arguments: (coor1) is mandatory, all others are optional arguments
4267 [grow] % the direction of growing <default: south>
4268 (coor1) % name of the (sub)root: mandatory
4269 (coor2) % the (sub)root is at (coor2) <default: (0,0)>
4270 [node style] % node style <default: decision node>
4271 <owner pos> % position of the owner's name
4272 {owner} % name of the owner of the (sub)root
4273 +level dist..sibling dist+ % <defaults: 8mm,24mm>
4274 \end{docstx}
4275
4276 The default level and sibling distance of a continuum of branches are |8mm| and |3*8mm|.
4277 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.
4278
4279 \begin{doccode}{.25}
4280 % \istrootcntmA (\istroot + cntmA)
4281 \begin{istgame}[scale=1.2]
4282 \istrootcntmA(0){I}
4283 \istb{x}[r] \endist
4284 \xtdistance{10mm}{20mm}
4285 \istroot(1)(0-1)<120>{II}
4286 \istb{Y}[al]{x,1-x}
4287 \istb{N}[ar]{0,0}
4288 \endist
4289 \draw [dashed,red]
4290 ([xshift=-3mm]cntm-1) -- ([xshift=3mm]cntm-2);
4291 \coordinate (C) at ($(cntm)!1.333!(0-1)$);
4292 \draw [dashed,blue] (C-|{-1.5,0}) -- (C-|{1.5,0});
4293 \end{istgame}
4294 \end{doccode}
4295
4296
4297 With the macro \icmd{\istbA} you can draw a single branch ending up with an endpoint on the continuum arc.
4298 Just remember |\istb| always reaches the \emph{red dashed line} and |\istbA| the \emph{blue dashed line}.
4299 For more details, see below Section~\ref{ssec:istbAfigure} (though it is not for first readers).
4300
4301 \begin{doccode}{.25}
4302 % \istrootcntmA and \istbA
4303 \begin{istgame}[scale=1.2]
4304 \istrootcntmA(0){I}
4305 \istbA{x}[r] \endist
4306 \xtdistance{10mm}{20mm}
4307 \istroot(1)(0-1)<120>{II}
4308 \istb{Y}[al]{x,1-x}
4309 \istb{N}[ar]{0,0}
4310 \endist
4311 \xtTimeLineH[dashed,blue](0-1){-1.5}{1.5}
4312 \end{istgame}
4313 \end{doccode}
4314
4315
4316 \subsubsection*{\protect\CMD{\istrootcntmA'}}
4317
4318 The swap version \icmd{\istrootcntmA'} arranges branches clockwise, like \cmd{\istroot'} does.
4319 Note also that if you use \cmd{\setistgrowdirection'}, then
4320 using the swap version makes no difference in results.
4321
4322 \begin{doccode}{.25}
4323 % \istrootcntmA' (swap version: growing east)
4324 \begin{istgame}[scale=1.2]
4325 \setistgrowdirection'{east}
4326 \istrootcntmA'(0){I}
4327 \istb<level distance=1.3*\cntmlevdist>{x}[b]
4328 \istbm
4329 \endist
4330 \xtdistance{10mm}{20mm}
4331 \istroot(1)(0-1)<120>{II}
4332 \istb{Y}[al]{x,1-x}
4333 \istb{N}[bl]{0,0}
4334 \endist
4335 \end{istgame}
4336 \end{doccode}
4337
4338
4339 \subsubsection{\protect\CMD{\istrootcntmA} and \protect\CMD{\istbA}}
4340 \label{ssec:istbAfigure}
4341
4342 As discussed in Section~\ref{sec:istbA} on page~\pageref{sec:istbA} |\istb| and |\istbA| can be used interchangeably (but with one exception).
4343 However, when it comes to \icmd{\istrootcntmA}, \icmd{\istbA} has a unique function: it reaches a continuum arc.
4344
4345 \begin{center}
4346 %\begin{doccode}{.25}
4347 % Example: \istrootcntmA
4348 \begin{istgame}[scale=2.2,font=\scriptsize]
4349 %\cntmApreset<1.7>
4350 \setistmathTF*000{texttt}
4351 \istrootcntmA(0)
4352 \istb*{\bs istb}[left,yshift=-1mm]
4353 \istbm
4354 \endist
4355 \istrootcntmA(0)
4356 \istbm
4357 \istbA{\bs istbA}[right,xshift=-1mm,yshift=-1mm]
4358 \istbA*{\bs istbA}[right,yshift=-1mm]
4359 \endist
4360 \xtdistance{6mm}{12mm}
4361 \istroot(1)(0-2)
4362 \istb \istb \endist
4363 \draw [dashed,red]
4364 ([xshift=-3mm]cntm-1) -- ([xshift=3mm]cntm-2);
4365 \coordinate (C) at ($(cntm)!1.333!(0-1)$);
4366 \draw [dashed,blue]
4367 (C-|{-1.5,0}) -- (C-|{1.5,0});
4368 \draw [|<->|,red] (0,0-|-1.5,0) -- ({0-1}-|-1.5,0);
4369 \draw [|<->|,blue] (0,0-|1.5,0) -- (C-|1.5,0);
4370 \node at (-1.5,-.2) [left] {|level distance of \istb|};
4371 \node at (1.5,-.2) [right] {|\istbA's level distance|};
4372 \node at (-1.5,-.4) [left] {|= \cntmlevdist|};
4373 \node at (1.5,-.4) [right] {|= k*\cntmlevdist|};
4374 \node at (1.5,-.6) [right] {| (k=1.333 with default values)|};
4375 \end{istgame}
4376 %\end{doccode}
4377 \end{center}
4378
4379 To be precise, |\istbA| reaches the \emph{blue dashed line}, as shown in the above picture, while |\istb| reaches the \emph{red dashed line}.
4380 So when |\istbA| is the only child of the root, it arrives exactly at the continuum arc.
4381
4382 \begin{doccode}{.25}
4383 % Example: \istrootcntmA and \istbA
4384 \begin{istgame}[scale=1.2]
4385 \istrootcntmA(0)
4386 \istbA*
4387 \istbA*
4388 \istbA*
4389 \endist
4390 \xtTimeLineH[dashed,blue](0-2){-1.5}{1.5}
4391 \end{istgame}
4392 \end{doccode}
4393
4394
4395 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.
4396 This allows you to make any |\istbA| reach the continuum arc, but after some trial and errors.
4397
4398 \begin{doccode}{.25}
4399 % Example: \istrootcntmA and \istbA
4400 \begin{istgame}[scale=1.2]
4401 \istrootcntmA(0)
4402 \istbA*(.89)
4403 \istbA*
4404 \istbA*(.89)
4405 \endist
4406 \istrootcntmA(1)(0-1)
4407 \istbA*(.97)
4408 \istbA*(.97)
4409 \endist
4410 \end{istgame}
4411 \end{doccode}
4412
4413
4414 \subsubsection{\protect\CMD{\cntmApreset}: controlling continuum arcs and wedges}
4415
4416 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.
4417 You can also change the background color (by default |transparent|) of the \emph{wedge} formed by a continuum arc.
4418
4419
4420 \begin{docstx}
4421 % syntax: \cntmApreset
4422 \cntmApreset*[<arc line opt>]<arc plot factor>{<arc pos factor>}[<fill color>]
4423 % defaults: all arguments are optional
4424 [-,tension=1]<1.333>{1}[transparent]
4425 \end{docstx}
4426
4427
4428 You can change the line style or the color of a continuum arc, in the usual \TikZ\ way, like |[dashed,thick,blue]|.
4429 If you do not specify any optional argument, the corresponding argument will have the default values.
4430 So, by declaring |\cntmApreset| followed by nothing, you can restore all the default values.
4431
4432 \remark
4433 \begin{itemize}
4434 \item
4435 A continuum arc connects the two endpoints, by default, of the two outermost branches.
4436 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.
4437 \item
4438 What if the factor is greater than |1|? You try!
4439 \end{itemize}
4440
4441
4442 \begin{doccode}{.25}
4443 % \cntmApreset (with \istrootcntmA and \istbA)
4444 \begin{istgame}
4445 \cntmdistance*{10mm}{20mm}
4446 \cntmApreset[dashed,blue,thick]
4447 \istrootcntmA(1)
4448 \istbA \endist
4449 \istroot(A1)(1-1)
4450 \istb \istb \endist
4451 \cntmApreset[dashed]{.6}
4452 \istrootcntmA(2)(A1-2)
4453 \istb \endist
4454 \istroot(A2)(2-1)
4455 \istb \istb \endist
4456 \cntmApreset % restore defaults
4457 \istrootcntmA(3)(A2-2)
4458 \istbA \endist
4459 \istroot(A1)(3-1)
4460 \istb \istb \endist
4461 \end{istgame}
4462 \end{doccode}
4463
4464
4465 Note that |\istbA| (if it is the only child) always prints a branch with its endpoint exactly on the arc.
4466 Note also that the effect of \icmd{\cntmApreset} goes on until another |\cntmApreset|, which restores the values to defaults, is used.
4467
4468
4469 \remark
4470 \begin{itemize}
4471 \item
4472 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.
4473 \item
4474 If the factor is |1|, it becomes a straight line. What if the factor is less than |1|? You guess!
4475 \end{itemize}
4476
4477
4478 \begin{doccode}{.25}
4479 % \cntmApreset<plot factor>
4480 \begin{istgame}
4481 \cntmdistance*{10mm}{20mm}
4482 \cntmApreset<1.2>
4483 \istrootcntmA(1)
4484 \istbA
4485 \endist
4486 \cntmApreset[tension=1.12]<1.508>
4487 \istrootcntmA(2)(1-1)
4488 \istbA
4489 \endist
4490 \cntmApreset<1.7>[green]
4491 \istrootcntmA(3)(2-1)
4492 \istbA*
4493 \endist
4494 \end{istgame}
4495 \end{doccode}
4496
4497
4498
4499 In order to change the background color of the wedge formed by an arc, you should use the \emph{second bracket option}.
4500 The first one is for a continuum arc line.
4501
4502
4503 \subsubsection*{\protect\CMD{\cntmAlayerpreset}: continuum arc layers}
4504
4505 The color filled wedge lies on the |behind| layer, by default.
4506 You can change the \emph{\isw{layer}} by using \icmd{\cntmAlayerpreset}.
4507 Available layers are: |background|, |behind|, |main|, |above|, and |foreground|, in that order.
4508 To restore the default layer (i.e., |behind|), just declare |\cntmAlayerpreset|.
4509
4510
4511 \begin{doccode}{.25}
4512 % \cntmAlayerpreset
4513 \begin{istgame}
4514 \cntmdistance*{10mm}{20mm}
4515 \cntmApreset{.5}[blue!20]
4516 \cntmAlayerpreset{background}
4517 \istrootcntmA(1) \istbA \endist
4518 \istroot(A1)(1-1) \istb \istb \endist
4519 \istrootcntmA(2)(A1-2) \istbA \endist
4520 \istroot(A2)(2-1) \istb \istb \endist
4521 \cntmApreset[dashed,blue,thick][red!20]
4522 \cntmAlayerpreset % restore default (behind)
4523 \istrootcntmA(3)(A2-2) \istbA \endist
4524 \istroot(A3)(3-1) \istb \istb \endist
4525 \xtInfosetO[fill=green](A1)(A3)
4526 \end{istgame}
4527 \end{doccode}
4528
4529
4530 \subsection{\protect\CMD{\istrootocntm} and \protect\CMD{\istrootocntmA}: oval continuum versions}
4531
4532 In some cases, you may want to use \icmd{\istrootocntmA}, the oval version of |\istrootcntmA|.
4533 It can be regarded as the sum |\istrooto| |+| |cntmA|. The swap version \icmd{\istrootocntmA'} is also provided.
4534
4535
4536 \begin{doccode}{.25}
4537 % \istrootocntmA (oval version: \istrooto + cntmA)
4538 \begin{istgame}
4539 \setistEllipseNodeStyle[white]
4540 \cntmdistance*{10mm}{20mm}
4541 \cntmApreset[dashed]
4542 \istrootocntmA(1){A} \istbA{x}[r] \istbm \endist
4543 \istrooto(1a)(1-1){B}
4544 \istb{Y}[al] \istb{N}[ar] \endist
4545 \istrootocntmA(2)(1a-2){B} \istbA{y}[r] \istbm \endist
4546 \istrooto(2a)(2-1){A}
4547 \istb{Y}[al] \istb{N}[ar] \endist
4548 \end{istgame}
4549 \end{doccode}
4550
4551
4552 It is anyway possible to use \icmd{\istrootocntm}, which is the oval version of |\istrootcntm|.
4553 It can be regarded as the sum |\istrooto| |+| |cntm|.
4554 You can also use its swap version \icmd{\istrootocntm'}.
4555
4556
4557 \begin{doccode}{.25}
4558 % Example: \istrootocntm
4559 \begin{istgame}
4560 \cntmdistance*{10mm}{20mm}
4561 \cntmApreset[dashed]
4562 \istrootocntm(1){A} \istbA{x}[r] \istbm \endist
4563 \istrooto(1a)(1-1){B}
4564 \istb{Y}[al] \istb{N}[ar] \endist
4565 \istrootocntm(2)(1a-2){B} \istbA{y}[r] \istbm \endist
4566 \istrooto(2a)(2-1){A}
4567 \istb{Y}[al] \istb{N}[ar] \endist
4568 \end{istgame}
4569 \end{doccode}
4570
4571
4572 \subsection{Doing some chores: not for most users}
4573
4574 \subsubsection{\protect\CMD{\cntmistb}: controlling outermost branches}
4575
4576 The macro \icmd{\cntmistb} controls the outermost branches of a continuum triangle.
4577 This works similar to |\istb|, but you need to use this macro \emph{right before} the |\istrootcntm|.
4578 And it works just \emph{once} only for the immediately following |\istrootcntm| and its close variants, but not for the continuum arc versions.
4579
4580
4581 \remark
4582 The macro \icmd{\cntmistb*} prints \xw{solid nodes} at the endpoints of the outermost branches.
4583 \begin{itemize}\tightlist
4584 \item The effect of printing \xw{solid nodes} affects \emph{all the following continua}.
4585 It can be \emph{turned off} by the starred version \icmd{\xtHideEndPoints*} (see Section~\ref{ssec:xtShowEndPoints*}, for more details).
4586 \end{itemize}
4587
4588
4589 \begin{docstx}
4590 % syntax: \cntmistb
4591 \cntmistb[<branch opt>]{<left action label>}[<pos>]{<right action label>}[<pos>]
4592 % defaults: all arguments are optional
4593 [-,draw=none]{}[]{}[]
4594 \end{docstx}
4595
4596 \begin{doccode}{.25}
4597 % \cntmistb (cntm outermost branches)
4598 \begin{istgame}[font=\scriptsize]
4599 \cntmdistance*{10mm}{20mm}{3mm}
4600 \cntmistb[draw=blue,dashed]{x=0}[l]{x=1}[above,sloped]
4601 \istrootcntm(1)
4602 \istb \istbm \endist
4603 \istroot(A1)(1-1)
4604 \istb \istb \endist
4605 \cntmistb*[blue]{x=0}[l]{x=1}[above,sloped]
4606 \istrootcntm(2)(A1-2)
4607 \istb \istbm \endist
4608 \istroot(A2)(2-1)
4609 \istb \istb \endist
4610 \setistmathTF*000{texttt}
4611 \cntmistb[red,draw=blue,thick]{x=0}[l]{x=1}[above,sloped]
4612 \istrootcntm(3)(A2-2)
4613 \istb \istbm \endist
4614 \istroot(A1)(3-1) \istb \istb \endist
4615 \end{istgame}
4616 \end{doccode}
4617
4618 |\cntmistb(*)| prints action labels in math mode by default, and the input mode can be changed by |\setistmathTF(*)|.
4619
4620
4621 \begin{doccode}{.25}
4622 \begin{istgame}[font=\scriptsize]
4623 \cntmpreset*[dashed]{.7}
4624 \cntmdistance*{10mm}{20mm}{3mm}
4625 \cntmistb{x=0}[l]{x=1}[above,sloped]
4626 \istrootcntm(1) \istb \endist
4627 \istroot(A1)(1-1) \istb \istb \endist
4628 \cntmistb*[blue]{x=0}[l]{x=1}[above,sloped]
4629 \istrootcntm(2)(A1-2) \istb \endist
4630 \istroot(A2)(2-1) \istb \istb \endist
4631 \setistmathTF*000{texttt}
4632 \cntmpreset*{.9}[blue!20]
4633 \cntmistb{x=0}[l]{x=1}[above,sloped]
4634 \istrootcntm(3)(A2-2) \istb \endist
4635 \istroot(A1)(3-1) \istb \istb \endist
4636 \end{istgame}
4637 \end{doccode}
4638
4639 \subsubsection{\protect\CMD{\cntmAistb}: controlling outermost branches}
4640
4641 The macro \icmd{\cntmAistb} controls the outermost branches of a continuum arc.
4642 This works similar to |\istb|, but you need to use this macro \emph{right before} the |\istrootcntmA|.
4643 And it works just \emph{once} only for the immediately following |\istrootcntmA| and its close variants, but not for the continuum triangle versions.
4644
4645 The macro \icmd{\cntmAistb*} prints |solid nodes| at the endpoints of the outermost branches.
4646 The effect of printing |solid node|s affects \emph{all the following continua}.
4647 It can be \emph{turned off} by the starred version \icmd{\xtHideEndPoints*} (see Section~\ref{ssec:xtShowEndPoints*}, for more details).
4648
4649
4650 \begin{docstx}
4651 % syntax: \cntmAistb
4652 \cntmistb[<branch opt>]{<left action label>}[<pos>]{<right action label>}[<pos>]
4653 % defaults: all arguments are optional
4654 [-]{}[]{}[]
4655 \end{docstx}
4656
4657
4658 Note that |\cntmAistb| controls outermost branches of a continuum, while |\cntmApreset| controls the arc line.
4659
4660
4661 \begin{doccode}{.25}
4662 \begin{istgame}[font=\scriptsize]
4663 \cntmdistance*{10mm}{20mm}
4664 \cntmAistb[dotted]{x=0}[above,sloped]{x=1}[above,sloped]
4665 \cntmApreset[dashed,blue,thick]{.7}
4666 \istrootcntmA(1) \istbA \endist
4667 \istroot(A1)(1-1) \istbA \istbA \endist
4668 \end{istgame}
4669 \end{doccode}
4670
4671
4672
4673 |\cntmAistb(*)| prints action labels in math mode by default, and the input mode can be changed by |\setistmathTF(*)|.
4674
4675
4676 \begin{doccode}{.25}
4677 \begin{istgame}[font=\scriptsize]
4678 \cntmdistance*{10mm}{20mm}
4679 \cntmAistb[dashed]{x=0}[l]{x=1}[above,sloped]
4680 \cntmApreset[dashed]{.7}
4681 \istrootcntmA(1) \istbA \endist
4682 \istroot(A1)(1-1) \istbA \istbA \endist
4683 \cntmAistb*[red,draw=black]{x=0}[l]{x=1}[above,sloped]
4684 \istrootcntmA(2)(A1-2) \istb \endist
4685 \istroot(A2)(2-1) \istbA \istbA \endist
4686 \setistmathTF*000{texttt}
4687 \cntmAistb[draw=blue,thick]{x=0}[l]{x=1}[above,sloped]
4688 \cntmApreset{.9}[blue!20]
4689 \istrootcntmA(3)(A2-2) \istbA \endist
4690 \istroot(A1)(3-1) \istbA \istbA \endist
4691 \end{istgame}
4692 \end{doccode}
4693
4694
4695
4696 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|.
4697
4698 \begin{doccode}{.25}
4699 \begin{istgame}[font=\scriptsize]
4700 \cntmAistb*
4701 \cntmApreset{.7}
4702 \istrootcntmA(1) \istbA \endist
4703 \cntmAexpostShowEndPoints
4704 \istrootcntmA(A1)(1-1) \istbA* \endist
4705 \cntmAexpostShowEndPoints[oval node][box node]
4706 \end{istgame}
4707 \end{doccode}
4708
4709
4710 \subsubsection{\protect\CMD{\xtShowEndPoints*}}
4711 \label{ssec:xtShowEndPoints*}
4712
4713 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|.
4714 However, the starred versions |\cntmistb*| and |\cntmAistb*| do not obey |\xtShowEndPoints*|.
4715 They anyway print solid nodes at the endpoints of outermost branches and the effect goes on until it is blocked by |\xtShowEndPoints*| or |\xtHidePoints*|.
4716
4717 |\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.
4718 Whichever comes later wins.
4719
4720 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.
4721
4722 \remark
4723 Note that the non-starred versions |\xtShowEndPoints| and |\xtHideEndPoints| have nothing to do with the outermost endpoints of a continuum.
4724
4725
4726 In the example below, |\cntmistb*| overrides the effect of |\xtShowEndPoint*[oval node]|, with respect to the outermost endpoints of continua.
4727
4728 \begin{doccode}{.25}
4729 \begin{istgame}
4730 \cntmdistance*{8mm}{16mm}
4731 \cntmpreset*
4732 \xtShowEndPoints*[oval node]
4733 \cntmistb
4734 \istrootcntm(1) \istb \endist
4735 \istroot(A1)(1-1) \istb \istb \endist
4736 \cntmistb
4737 \istrootcntm(2)(A1-2) \istb \endist
4738 \istroot(A2)(2-1) \istb \istb \endist
4739 \cntmistb*
4740 \istrootcntm(3)(A2-2) \istb \endist
4741 \istroot(A3)(3-1) \istb \istb \endist
4742 \cntmistb
4743 \istrootcntm(4)(A3-2) \istb \endist
4744 \istroot(A4)(4-1) \istb \istb \endist
4745 \end{istgame}
4746 \end{doccode}
4747
4748
4749
4750 In the example below, |\xtHideEndPoints| and |\xtHidePoints*| cooperatively turn off the effects of |\xtShowEndPoints*| and |\cntmAistb|*.
4751
4752 \begin{doccode}{.25}
4753 \begin{istgame}
4754 \cntmdistance*{8mm}{16mm}
4755 \xtShowEndPoints*[oval node]
4756 \cntmAistb*
4757 \istrootcntmA(1) \istbA \endist
4758 \istroot(A1)(1-1) \istb \istb \endist
4759 \xtShowEndPoints*[box node]
4760 \cntmAistb
4761 \istrootcntmA(2)(A1-2) \istbA \endist
4762 \istroot(A2)(2-1) \istb \istb \endist
4763 \cntmAistb
4764 \istrootcntmA(3)(A2-2) \istbA \endist
4765 \istroot(A3)(3-1) \istb \istb \endist
4766 \cntmAistb*
4767 \xtHideEndPoints* % turns off only cntm endpoints
4768 \xtHideEndPoints
4769 \istrootcntmA(4)(A3-2) \istbA \endist
4770 \istroot(A4)(4-1) \istb \istb \endist
4771 \end{istgame}
4772 \end{doccode}
4773
4774
4775 \subsection{Information sets for continua of branches}
4776
4777 \subsubsection{Information sets for continuum triangles}
4778
4779 It is not an issue to draw information sets for continuum triangles. You can just apply |\xtInfoset| or |\xtInfosetO|.
4780 %This section is for drawing information sets for continuum arcs.
4781
4782 \begin{doccode}{.25}
4783 \begin{istgame}
4784 \cntmdistance*{8mm}
4785 \cntmpreset{1}[green]
4786 \istrootcntm(1) \istb \endist
4787 \xtInfoset([yshift=-1mm]cntm-1)([yshift=-1mm]cntm-2)
4788 \istroot(A1)(1-1) \istb \istb \endist
4789 \istrootcntm(2)(A1-2) \istb \endist
4790 \xtInfosetO[fill=red,opacity=.4](cntm-1)(cntm-2)
4791 \istroot(A2)(2-1) \istb \istb \endist
4792 \end{istgame}
4793 \end{doccode}
4794
4795
4796 \subsubsection{\protect\CMD{\cntmAInfoset} for continuum arcs}
4797
4798 The macro \icmd{\cntmAInfoset} draws an arc to represent an \isw{information set} for an arc type continuum of branches,
4799 on the background layer.
4800 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.
4801 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|.)
4802
4803
4804 \begin{docstx}
4805 % syntax: \cntmAInfoset
4806 \cntmAInfoset*[<line opt>](<cntm root>)<plot factor>{<add-to cntmApos>}
4807 % defaults: (<cntm root>) is mandatory
4808 [-,samples=500,tension=1,infoset style](<m>)<1.333>{.1}
4809 \end{docstx}
4810
4811
4812 You can change, if necessary, the curvature of an information set arc by using \ixw{plot factor} (|<1.333>| by default).
4813
4814 \begin{doccode}{.25}
4815 % \cntmAInfoset
4816 \begin{istgame}[scale=1.5]
4817 \istrootcntmA(0) \istbA \endist
4818 \cntmAInfoset(0)<1.34>
4819 \xtdistance{10mm}{20mm}
4820 \istroot(1)(0-1) \istb \istb \endist
4821 \end{istgame}
4822 \end{doccode}
4823
4824 %\begin{doccode}{.25}
4825 %% Example: \istrootcntmA
4826 %\begin{istgame}[scale=1.2]
4827 %\istrootcntmA(0){I}
4828 % \istbA{x}[r] \endist
4829 %\cntmAInfoset(0)
4830 %\xtdistance{10mm}{20mm}
4831 %\istroot(1)(0-1)<120>{II}
4832 % \istb{Y}[al]{x,1-x} \istb{N}[ar]{0,0} \endist
4833 %\end{istgame}
4834 %\end{doccode}
4835
4836 You can also change the position and the line style of an information set arc, as shown in the following example:
4837
4838 \begin{doccode}{.25}
4839 % Example: \cntmAInfoset
4840 \begin{istgame}[scale=1.5]
4841 \istrootcntmA(0) \istbA \endist
4842 \cntmAInfoset[red,dashed,thick](0){-.1}
4843 \cntmAInfoset(0)
4844 \cntmAInfoset[blue,dashed,thick](0){.2}
4845 \xtdistance{10mm}{20mm}
4846 \istroot(1)(0-1) \istb \istb \endist
4847 \end{istgame}
4848 \end{doccode}
4849
4850 \subsubsection{\protect\CMD{\cntmAInfosetO}: oval version}
4851 \label{sec:cntmAInfosetO}
4852
4853 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.
4854
4855
4856 \begin{docstx}
4857 % syntax: \cntmAInfosetO
4858 \cntmAInfosetO[<line opt>](<cntm root>)
4859 <plot factor>{<add-to cntmApos>}[<turn X-ang>](<infoset height>)
4860 % defaults: (<cntm root>) is mandatory
4861 [-,samples=500,tension=1,infoset style](<m>)<1.333>{.1}[0](1em)
4862 \end{docstx}
4863
4864
4865
4866 \begin{doccode}{.25}
4867 % \cntmAinfosetO
4868 \begin{istgame}[scale=1.2]
4869 \istrootcntmA(0) \istbA \endist
4870 \cntmAInfosetO(0)
4871 \xtdistance{10mm}{20mm}
4872 \istroot(1)(0-1) \istb \istb \endist
4873 \end{istgame}
4874 \end{doccode}
4875
4876
4877 You can change the style of an information set by using usual \TikZ\ options.
4878 You can also change its position and curvature via |\cntmApreset|.
4879
4880
4881 \begin{doccode}{.25}
4882 % \cntmAInfosetO and \cntmApreset<plot factor>
4883 \begin{istgame}[scale=1.2]
4884 \cntmdistance*{10mm}{20mm}
4885 \istrootcntmA(0) \istbA \endist
4886 \cntmAInfosetO[blue,dashed,thick](0)
4887 \cntmApreset{.6}
4888 \istrootcntmA(1)(0-1) \istbA \endist
4889 \cntmAInfosetO[solid,fill=green](1)(.5em)
4890 \cntmApreset<1.8>{.6}
4891 \istrootcntmA(2)(1-1) \istbA \endist
4892 \cntmAInfosetO[fill=blue!20](2)
4893 \end{istgame}
4894 \end{doccode}
4895
4896
4897 You do not need to bother if a tree is swapped or rotated.
4898 Note also that the height (or thickness) of information set are not affected by \TikZ\ scaling.
4899
4900 \begin{doccode}{.25}
4901 \begin{istgame}[scale=.8]
4902 \setistgrowdirection'{east}
4903 \cntmdistance*{10mm}{20mm}
4904 \istrootcntmA(0) \istbA \endist
4905 \cntmAInfosetO[blue,dashed,thick](0)
4906 \cntmApreset{.6}
4907 \istrootcntmA(1)(0-1) \istbA \endist
4908 \cntmAInfosetO[solid,fill=green](1)(.5em)
4909 \cntmApreset<1.8>{.6}
4910 \istrootcntmA(2)(1-1) \istbA \endist
4911 \cntmAInfosetO[fill=blue!20](2)
4912 \end{istgame}
4913 \end{doccode}
4914
4915
4916
4917 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).
4918
4919 \subsubsection{Fine-tuning \protect\CMD{\cntmAInfosetO}: Not for most users}
4920 \label{ssec:turnxangles}
4921
4922 \subsubsection*{turing X circles}
4923
4924 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.
4925 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.
4926 To do that, specify an appropriate degree of rotation in brackets, like |\cntmAInfosetO(2)[60]|, as shown below.
4927 (See Section~\ref{ssec:extrememidpointfactor} for a related topic.)
4928
4929
4930 \begin{doccode}{.25}
4931 % \cntmAInfosetO: fine-tuning
4932 \begin{istgame}[xscale=4]
4933 \cntmdistance*{15mm}{10mm}
4934 \cntmApreset<1.8>
4935 \istrootcntmA(1) \istbA \endist
4936 \node at (cntm-1)
4937 [draw,circle,blue,opacity=.4,minimum size=1em]{};
4938 \cntmAInfosetO(1)
4939 \istrootcntmA(2)(1-1) \istbA \endist
4940 \cntmAInfosetO(2)[60]
4941 \end{istgame}
4942 \end{doccode}
4943
4944
4945 \subsubsection*{scaling \protect\CMD{\cntmAInfosetO} according to \TikZ\ scales}
4946 \label{page:scaleissue-cntm}
4947
4948 The height (or thickness) of an information set drawn by |\cntmAInfosetO| is not affected by \TikZ\ scales.
4949 In some cases, you may want to change the height according to the values of \TikZ\ scales.
4950
4951 \remark
4952 \begin{itemize}
4953 \item
4954 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.
4955 \item
4956 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.
4957 \end{itemize}
4958
4959 \begin{doccode}{.25}
4960 % \cntmAInfosetO: scaling
4961 \begin{istgame}[scale=.7,xscale=1]
4962 \istrootcntmA(0)
4963 \istbA
4964 \endist
4965 \cntmAInfosetO[fill=blue!20](0)
4966 \xtdistance{10mm}{20mm}
4967 \istroot(1)(0-1)
4968 \istb
4969 \istb
4970 \endist
4971 \end{istgame}
4972 \end{doccode}
4973
4974
4975 \subsection{Transition from obsolete macros \protect\CMD{\istcntm} and \protect\CMD{\istcntmarc}}
4976
4977 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.
4978
4979 \paragraph{\protect\CMD{\istcntm}}
4980
4981 The macro |\istcntm| draws only a background triangle for a continuum of branches.
4982 And then you can draw an action taken using |\istroot|.
4983
4984 \begin{docstx}
4985 % \istcntm
4986 % syntax:
4987 \istcntm[<grow keyval>](<coor1>)(<coor2>)[<fill color>]+<levdist>..<sibdist>+
4988 % defaults: [south]()(0,0)[black!25]+8mm..24mm+
4989 \end{docstx}
4990
4991
4992
4993 %Using |\istroot| with |\istcntm| draws a representative branch of a continuum of branches.
4994 %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.
4995
4996 \begin{doccode}{.25}
4997 % \istcntm (obsolete)
4998 \begin{istgame}[scale=1.2]
4999 \istcntm(cntm)
5000 \istroot(0)(cntm){I}+8mm..8mm+
5001 \istb{x}[r] \istbm \endist
5002 \xtdistance{10mm}{20mm}
5003 \istroot(1)(0-1)<[label distance=-3pt]120>{II}
5004 \istb{Y}[al]{x,1-x} \istb{N}[ar]{0,0} \endist
5005 \end{istgame}
5006 \end{doccode}
5007
5008
5009 The above old way can be switched to the following new way:
5010
5011 \begin{doccode}{.25}
5012 % \istrootcntm (new way)
5013 \begin{istgame}[scale=1.2]
5014 \istrootcntm(0){I}
5015 \istb{x}[r] \istbm \endist
5016 \xtdistance{10mm}{20mm}
5017 \istroot(1)(0-1)<[label distance=-3pt]120>{II}
5018 \istb{Y}[al]{x,1-x} \istb{N}[ar]{0,0} \endist
5019 \end{istgame}
5020 \end{doccode}
5021
5022 %%%\subsubsection*{Changing the size and the color of a continuum of branches}
5023 %%%
5024 %%%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+}.
5025 %%%
5026 %%%\begin{doccode}{.25}
5027 %%%% Example: \istcntm (changing the size)
5028 %%%\begin{istgame}
5029 %%%\istcntm(cntm)+10mm..20mm+
5030 %%%\istroot(0)(cntm){1}+10mm..10mm+
5031 %%% \istbm \istb{x}[l] \endist
5032 %%%\end{istgame}
5033 %%%\end{doccode}
5034 %%%
5035 %%%Once the distances are type in as options of |\istcntm|, they internally change the default values, which apply only to the corresponding triangle.
5036 %%%For example, |+10mm..20mm+| will result in |\cntmlevdist=10mm| and |\cntmsibdist=20mm|.
5037 %%%So you can get exactly the same result as previous one by doing the following:
5038 %%%
5039 %%%\begin{doccode}{.25}
5040 %%%% Example: \istcntm (changing the size)
5041 %%%\begin{istgame}
5042 %%%\istcntm(cntm)+10mm..20mm+
5043 %%%\istroot(0)(cntm){1}+\cntmlevdist..\cntmlevdist+
5044 %%% \istbm \istb{x}[l] \endist
5045 %%%\end{istgame}
5046 %%%\end{doccode}
5047 %%%
5048 %%%You can change the color of the background triangle by using an option as you can see in the following example:
5049 %%%
5050 %%%\begin{doccode}{.25}
5051 %%%\begin{istgame}
5052 %%%\xtdistance{10mm}{20mm}
5053 %%%\istroot(0){1}
5054 %%% \istb{A}[al] \istb{B}[ar]{1,1} \endist
5055 %%%\istcntm(cntm)(0-1)[green]+10mm..20mm+
5056 %%%\istroot(1)(cntm)<135>{2}+\cntmlevdist..\cntmlevdist+
5057 %%% \istbm \istb{x}[l] \endist
5058 %%%\istroot(2)(1-2)<[label distance=-4pt]45>{1}
5059 %%% \istb{Y}[l]{3-x,x} \istb{N}[r]{0,0} \endist
5060 %%%\end{istgame}
5061 %%%\end{doccode}
5062
5063
5064 \paragraph{\protect\CMD{\istcntmarc} (arc version)}
5065
5066 The macro |\istcntmarc| is the arc version, which draws a background arc to represent a continuum of branches.
5067
5068 \begin{docstx}
5069 % \istcntmarc
5070 % syntax:
5071 \istcntmarc[<grow keyval>](<coor1>)(<coor2>)[<color,opt>]{<num>}+levd..sibd+
5072 % defaults: [south](<m>)(0,0)[bend right]{.5}+8mm..24mm+
5073 \end{docstx}
5074
5075 %The option \xw{<num>} (\xw{0.5} by default) specifies
5076 %the convex combination of the root and each of the background child nodes.
5077 %The smaller \xw{<num>} is, the closer is the connecting arc to the root.
5078
5079 \begin{doccode}{.25}
5080 % \istcntmarc (obsolete)
5081 \begin{istgame}[scale=1.2]
5082 \istcntmarc(cntm)[green]
5083 \istroot(0)(cntm){I}+8mm..8mm+
5084 \istb{x}[r] \istbm \endist
5085 \xtdistance{10mm}{18mm}
5086 \istroot(1)(0-1)<[label distance=-3pt]120>{II}
5087 \istb{Y}[al]{x,1-x} \istb{N}[ar]{0,0} \endist
5088 \end{istgame}
5089 \end{doccode}
5090
5091
5092 The above old way can be switched to the following new way.
5093 One difference is that the position of a continuum arc is now |1| by default, while it was |.5|.
5094
5095 \begin{doccode}{.25}
5096 % \istrootcntmA (new way)
5097 \begin{istgame}[scale=1.2]
5098 \cntmApreset<1.44>{.5}[green]
5099 \istrootcntmA(0){I}
5100 \istb{x}[r] \istbm \endist
5101 \xtdistance{10mm}{18mm}
5102 \istroot(1)(0-1)<[label distance=-3pt]120>{II}
5103 \istb{Y}[al]{x,1-x} \istb{N}[ar]{0,0} \endist
5104 \end{istgame}
5105 \end{doccode}
5106
5107
5108 \section{Arrows}
5109 \label{sec:arrows}
5110
5111 \subsection{Using \TikZ\ arrow options with \env{istgame}}
5112
5113
5114 \subsubsection{\TikZ\ arrow option \xw{->}}
5115
5116 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 |->|.
5117
5118
5119 \begin{doccode}{.25}
5120 % Example: arrows
5121 \begin{istgame}[->,scale=.8]
5122 \istroot(0)+15mm..30mm+ \istb \istb \endist
5123 \xtShowEndPoints
5124 \istroot(1)(0-1) \istb \istb \endist
5125 \istroot(2)(0-2) \istb \istb \endist
5126 \istroot(3)(1-2) \istb \istb \endist
5127 \end{istgame}
5128 \end{doccode}
5129
5130 For an arrow on an individual branch, you can use arrow options with each |\istb|.
5131
5132 \begin{doccode}{.25}
5133 % Example: arrows
5134 \begin{istgame}[scale=.8]
5135 \istroot(0)+15mm..30mm+ \istb[->] \istb \endist
5136 \xtShowEndPoints
5137 \istroot(1)(0-1) \istb[->] \istb \endist
5138 \xtHideEndPoints
5139 \istroot(2)(0-2) \istb[-|<>|] \istb[->o>>>o>] \endist
5140 \end{istgame}
5141 \end{doccode}
5142
5143
5144 \subsubsection{Fine-tuning with \protect\CMD{\setistgameshorten}: Not for most users}
5145 \label{sec:setistgamearrowendshorten}
5146 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},
5147 like |\setistgameshorten{1.3pt}|, right \emph{before} the \env{istgame} environment.
5148 Note that |\setistgameshorten| has a global effect. So, when necessary, you should use the macro within a TeX group.
5149
5150
5151 \remark (not for most users)
5152 \begin{itemize}\tightlist
5153 \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 |->|.
5154 \item You can do the same thing, without using this macro, by manually adding, for example, |[->,shorten >=1.3pt]| to the list of options.
5155 \end{itemize}
5156
5157 \begin{doccode}{.25}
5158 % \setistgameshorten
5159 \setistgameshorten{1.3pt} % use in a TeX group
5160 \begin{istgame}[->,scale=.8]
5161 %\xtShowEndPoints
5162 \istroot(0)+15mm..30mm+ \istb \istb \endist
5163 \istroot(1)(0-1) \istb \istb \endist
5164 \istroot(2)(0-2) \istb \istb \endist
5165 \istroot(3)(1-2) \istb \istb \endist
5166 \end{istgame}
5167 \end{doccode}
5168
5169 You should also be aware that, in \Tikz, the options \xw{shorten} and \xw{->} affect any lines or curves in the current environment.
5170
5171
5172 \subsection{Middle arrows for a branch}
5173 \label{sec:showmidarrows}
5174
5175 \index{middle arrow}
5176 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{->-},
5177 like |\istb[->-]|.
5178
5179 \subsubsection{A middle arrow for each \protect\CMD{\istb}}
5180
5181 To print an arrow tip in the middle of a branch, you can use |->-| as an option for |\istb|.
5182 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.
5183 For example, |\istb[->-=0.1]| prints an arrow tip near the parent node, and |\istb[->-=0.9]| near the child node.
5184
5185
5186 \begin{doccode}{.25}
5187 % middle arrow tip styles
5188 \begin{istgame}[scale=.8]
5189 \istroot(0)+15mm..30mm+
5190 \istb[->-] \istb[->-] \endist
5191 \istroot(1)(0-1)
5192 \istb[->-=.3] \istb[->-=.9] \endist
5193 \istroot(2)(0-2)
5194 \istb[->-=.7,draw=blue] \istb[->-=.2,draw=red] \endist
5195 \istroot(3)(1-2)
5196 \istb \istb[->-=1] \endist
5197 \end{istgame}
5198 \end{doccode}
5199
5200
5201 \remark issues on middle arrows with |\istB|:
5202 \begin{itemize}\tightlist
5203 \item Middle arrows work well with |\istb|, but the exact position of a middle arrow tip does NOT work very well with |\istB|.
5204 \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}).
5205 \end{itemize}
5206
5207 Except for |\istB|, all the other variants of |\istb| including |\istbA|, |\cntmistb|, and |\cntmAistb| work well with the middle arrow option |->-|.
5208
5209
5210 \subsubsection{Middle arrow tip styles}
5211
5212
5213 The package also provides additional styles for middle arrow tips, which have a \emph{fixed} position and shape.
5214 (Note that the \ixw{single arrow tip} \xw{->-} is \emph{controllable}.)
5215
5216
5217
5218 Additional \ixw{middle arrow tip style}|s|:
5219 \begin{itemize}\tightlist
5220 \item \ixttw{->>-} : \ixw{double arrow tip} in the middle of a branch at the position of |.6|
5221 \item \ixttw{->>>-} : \ixw{triple arrow tip} in the middle of a branch at the position of |.65|
5222 \item \ixttw{-o-} : \ixw{circle arrow tip} in the middle of a branch at the position of |.55|
5223 \item \ixttw{-x-} : \ixw{cross arrow tip} in the middle of a branch at the position of |.5|
5224 \end{itemize}
5225
5226 \remark
5227 All the middle arrow tips are printed in black, by default.
5228 Their color can be changed by |\setxtarrowtips| (see the following Section~\ref{ssec:setxtarrowtips}).
5229
5230
5231 \begin{doccode}{.25}
5232 % Example: middle arrow tips
5233 \begin{istgame}[xscale=.8]
5234 \istroot(0)+15mm..30mm+
5235 \istb[->>-] \istb[->>>-,red] \endist
5236 \istroot(1)(0-1)
5237 \istb[-o-,red] \istb[-x-,blue] \endist
5238 \setxtarrowtips[blue,thick]
5239 \istroot(2)(0-2)
5240 \istb[-o-] \istb[-x-] \endist
5241 \end{istgame}
5242 \end{doccode}
5243
5244
5245 \subsubsection{\protect\CMD{\setxtarrowtips}: controlling middle arrow tips via \xw{->-}}
5246 \label{ssec:setxtarrowtips}
5247
5248 The macro \icmd{\setxtarrowtips} controls the position and shape of a middle arrow tip,
5249 but only works through the \emph{controllable} middle arrow style |->-|, not the other \emph{fixed} arrow styles.
5250 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.
5251
5252
5253 \begin{docstx}
5254 % \setxtarrowtips
5255 % syntax: all arguments are optional
5256 \setxtarrowtips<midarrow tip pos>{<arrow tip shape>}[<arrow opt>]
5257 % defaults: <.55>{>}[black,-,thin,solid,shorten >=0pt]
5258 \end{docstx}
5259
5260
5261 \begin{doccode}{.25}
5262 % \setxtarrowtips
5263 \begin{istgame}[scale=1]
5264 \setxtarrowtips<.7>{Bar}[blue,thick]
5265 \istroot(0)+15mm..25mm+
5266 \istb[->-] \istb[->-] \endist
5267 \istroot(1)(0-1)
5268 \istb[->-=.5] \istb[->-=.3] \endist
5269 \setxtarrowtips<.8>{Rays}[red,thick]
5270 \istroot(2)(0-2)
5271 \istb[->-,green] \istb[->-,red] \endist
5272 \setxtarrowtips<.7>
5273 \istroot(3)(1-2)
5274 \istb \istb[->>-] \endist
5275 \istroot(4)(2-2)
5276 \istb[-o-] \istb[-x-] \endist
5277 \end{istgame}
5278 \end{doccode}
5279
5280 Note that, as seen in the example above, the position set individually by an option value of |\istb|, like |\istb[->-=.3]|,
5281 wins the position set by |\setxtarrowtips<.9>|.
5282
5283
5284 \subsection{Middle arrows for simple trees}
5285
5286 \subsubsection{\protect\CMD{\xtShowMidArrows} and \protect\CMD{\xtHideMidArrows}}
5287
5288 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).
5289 The effect of |\xtShowMidArrows| continues until it is changed by another |\xtShowMidArrows| or blocked by \icmd{\xtHideMidArrows}.
5290
5291
5292 \begin{doccode}{.25}
5293 % Example: \xtShowMidArrows, \xtHideMidArrows
5294 \begin{istgame}
5295 \xtShowMidArrows
5296 \istroot(0)+15mm..30mm+
5297 \istb[blue] \istb[red] \endist
5298 \xtHideMidArrows
5299 \istroot(1)(0-1)
5300 \istb \istb \endist
5301 \istroot(2)(0-2)
5302 \istb \istb \endist
5303 \xtShowMidArrows
5304 \istroot(3)(1-2)
5305 \istb \istb \endist
5306 \end{istgame}
5307 \end{doccode}
5308
5309
5310
5311 \remark
5312 \begin{itemize}
5313 \item |\xtShowMidArrows| works for all branches of simple trees.
5314 \item The middle arrow option styles work separately only for |\istb|'s having them and |\setxtarrowtips| works only for |\istb|'s having the option |->-|.
5315 \item Since the middle arrow tip styles and |\xtShowMidArrows| work completely independently, if you use both of them, they are all printed.
5316 \item Note also that |\xtHideMidArrows| removes only the effect of |\xtShowMidArrows|.
5317 \end{itemize}
5318
5319 \begin{doccode}{.25}
5320 % Example: \xtShowMidArrows, \xtHideMidArrows
5321 \begin{istgame}
5322 \setxtarrowtips<.3>{Rays[n=2,sep]Rays[n=2]}[red,thick]
5323 \xtShowMidArrows
5324 \istroot(0)+15mm..30mm+
5325 \istb[blue] \istb[red] \endist
5326 \xtHideMidArrows
5327 \istroot(1)(0-1)
5328 \istb[->-] \istb[-o-] \endist
5329 \istroot(2)(0-2)
5330 \istb \istb \endist
5331 \xtShowMidArrows
5332 \istroot(3)(1-2)
5333 \istb[->-] \istb[-o-] \endist
5334 \end{istgame}
5335 \end{doccode}
5336
5337
5338 \subsubsection{\protect\CMD{\setxtshowmidarrows}: controlling \protect\CMD{\xtShowMidArrows}}
5339
5340 The macro \icmd{\setxtshowmidarrows},
5341 you can control the position, color, style, and shape of middle arrow tips, to be drawn by |\xtShowMidArrows|.
5342
5343
5344 \begin{docstx}
5345 % \setxtshowmidarrows
5346 % syntax:
5347 \setxtshowmidarrows<midarrow tip relative pos>{<arrow shape>}[<arrow opt>]
5348 % defaults: <.55>{>}[black]
5349 \end{docstx}
5350
5351 \begin{doccode}{.25}
5352 % \setxtshowmidarrows
5353 \begin{istgame}
5354 \xtShowMidArrows
5355 \istroot(0)+15mm..30mm+
5356 \istb \istb \endist
5357 \xtHideMidArrows
5358 \istroot(1)(0-1) \istb \istb \endist
5359 \xtShowMidArrows
5360 \setxtshowmidarrows<.8>{>>>}[red,thick]
5361 \istroot(2)(0-2) \istb \istb \endist
5362 \setxtshowmidarrows<1>
5363 \istroot(3)(1-2) \istb \istb \endist
5364 %----- Remark ---------------------------------------
5365 %\draw ([yshift=-5pt]2-1) -- ([yshift=-5pt]2-2); % NO!
5366 \coordinate (A) at ([yshift=-5pt]2-1);
5367 \coordinate (B) at ([yshift=-5pt]2-2);
5368 \draw [|-|] (A) -- (B);
5369 \end{istgame}
5370 \end{doccode}
5371
5372
5373 \remark issues in adding other graphic objects (not for most users)
5374 \label{page:showarrows}
5375 \begin{itemize}%\tightlist
5376 \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.
5377 \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}).
5378 \item |\xtShowArrows| does not affect the \Tikz\ absolute coordinates.
5379 \end{itemize}
5380
5381
5382 \subsection{Arrows for simple trees}
5383
5384 \subsubsection{\protect\CMD{\xtShowArrows} and \protect\CMD{\xtHideArrows}}
5385
5386 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.
5387
5388 \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.
5389 Therefore, for example, |\xtShowArrows[oval node]| is equivalent to |\xtShowEndPoints[oval node]| followed by printing arrows (in black by default).
5390
5391 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.)
5392
5393
5394 \begin{doccode}{.25}
5395 % \xtShowArrows and \xtHideArrows
5396 \begin{istgame}
5397 \xtShowArrows
5398 \istroot(0)+15mm..30mm+
5399 \istb[blue] \istb[red] \endist
5400 \xtHideArrows
5401 \istroot(1)(0-1)
5402 \istb{a} \istb \endist
5403 \xtHideArrows* % endpoints remain
5404 \istroot(2)(0-2)
5405 \istb{b} \istb \endist
5406 \xtShowArrows[oval node]
5407 \istroot(3)(1-2)
5408 \istb{c} \istb \endist
5409 \end{istgame}
5410 \end{doccode}
5411
5412
5413 \remark issues in adding other graphic objects (not for most users)
5414 \begin{itemize}\tightlist
5415 \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}.
5416 \end{itemize}
5417
5418
5419 \subsubsection{\protect\CMD{\setxtshowarrows}: controlling \protect\CMD{\xtShowArrows}}
5420
5421 The macro \icmd{\setxtshowarrows} controls the color and shape of arrow tips.
5422 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)}.
5423
5424
5425 \begin{docstx}
5426 % \setxtshowarrows
5427 % syntax:
5428 \setxtshowarrows{<arrow shape>}[<arrow opt>](<arrow end shorten dim>)
5429 % defaults: {>}[](1.2pt)
5430 \end{docstx}
5431
5432
5433 \begin{doccode}{.25}
5434 % \setxtshowarrows (with \xtShowArrows and \xtHideArrows)
5435 \begin{istgame}
5436 \setxtshowarrows{Stealth[open]}[blue](5pt)
5437 \xtShowArrows
5438 \istroot(0)+15mm..30mm+
5439 \istb[blue] \istb[red] \endist
5440 \xtHideArrows
5441 \istroot(1)(0-1)
5442 \istb{a} \istb \endist
5443 \xtHideArrows* % endpoints remain
5444 \istroot(2)(0-2)
5445 \istb{b} \istb \endist
5446 \xtShowArrows[oval node]
5447 \istroot(3)(1-2)
5448 \istb{c} \istb \endist
5449 \end{istgame}
5450 \end{doccode}
5451
5452
5453 \subsubsection{Arrows and continua of branches: examples (Not for most users)}
5454
5455 There is nothing special in using arrow tips in game trees having continua of branches.
5456
5457
5458 \begin{doccode}{.25}
5459 % Example: cntm and arrows
5460 \begin{istgame}[font=\scriptsize]
5461 \xtdistance{10mm}{20mm}
5462 \xtShowArrows
5463 \istrootcntm(0)(0,0){1}
5464 \istb{x}[r] \istbm \endist
5465 \istroot(1)(0-1)<[label distance=-3pt]120>{2}
5466 \istb{Y}[al]{x,1-x} \istb{N}[ar] \endist
5467 \istrootcntm(2)(1-2){2}
5468 \istb{y}[r] \istbm \endist
5469 \istroot(3)(2-1)<[label distance=-3pt]120>{1}
5470 \istb[]{Y}[al]{1-y,y} \istb{N}[ar] \endist
5471 \end{istgame}
5472 \end{doccode}
5473
5474
5475 It is not impossible to put arrow tips on the outermost branches of a continuum.
5476 To do that, you can use |\cntmistb(*)| and |\cntmAistb(*)| together with the middle arrow tip styles and |\setxtarrowtips|.
5477
5478
5479 \begin{doccode}{.25}
5480 % Example: cntm, \setxtarrowtips
5481 \begin{istgame}[font=\scriptsize]
5482 \xtdistance{10mm}{20mm}
5483 \xtShowArrows
5484 \setxtarrowtips<.97>
5485 \cntmistb*[->-,draw]
5486 \istrootcntm(0)(0,0){1}
5487 \istb{x}[r] \istbm \endist
5488 \istroot(1)(0-1)<[label distance=-3pt]120>{2}
5489 \istb{Y}[al]{x,1-x} \istb{N}[ar] \endist
5490 \cntmistb*[->-,draw]
5491 \istrootcntm(2)(1-2){2}
5492 \istb{y}[r] \istbm \endist
5493 \istroot(3)(2-1)<120>{1}
5494 \istb[]{Y}[al]{1-y,y} \istb{N}[ar] \endist
5495 \end{istgame}
5496 \end{doccode}
5497
5498
5499 Here is one more example.
5500
5501
5502 \begin{doccode}{.25}
5503 % Example: cntmA, \setxtarrowtips
5504 \begin{istgame}
5505 \cntmdistance*{8mm}{16mm}
5506 \xtShowArrows
5507 \xtShowEndPoints*[oval node]
5508 \setxtarrowtips<.93>{>>}[red,thick]
5509 \cntmAistb[->-]
5510 \istrootcntmA(1) \istbA[-x-] \endist
5511 \istroot(A1)(1-1) \istb \istb \endist
5512 \cntmAistb[->-]
5513 \istrootcntmA(2)(A1-2) \istbA[-o-] \endist
5514 \istroot(A2)(2-1) \istb \istb \endist
5515 \setxtarrowtips<.93>
5516 \cntmAistb[->-]
5517 \istrootcntmA(3)(A2-2) \istbA[-x-] \endist
5518 \istroot(A3)(3-1) \istb \istb \endist
5519 \cntmAistb[->-]
5520 \istrootcntmA(4)(A3-2) \istbA[-o-] \endist
5521 \istroot(A4)(4-1) \istb \istb \endist
5522 \end{istgame}
5523 \end{doccode}
5524
5525
5526 \section{Supplementary macros}
5527 \label{sec:suppmac}
5528
5529 \subsection{Supplementary macros to important labels}
5530 \label{ssec:suppmac}
5531
5532 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.
5533 %And the abbreviations of the position of labels are available for these supplemental macros.
5534
5535 \begin{description}\tightlist
5536 \item \icmd{\xtOwner} puts the owner of a node (or a player), in text mode
5537 \item \icmd{\xtOwner}* puts an owner in the input mode as set by |\setistmathTF(*)|\par
5538 syntax: |\xtOwner(<coor>){<owner>}[<pos>,<node opt>]|\par
5539 defaults: |(<m>){}[above]|\par
5540 (abbreviations for |<pos>| available)
5541
5542 \item \icmd{\xtActionLabel} puts an action label to a branch, in math mode
5543 \item \icmd{\xtActionLabel*} puts an owner in the input mode as set by |\setistmathTF(*)|\par
5544 syntax: |\xtActionLabel[<opt>](<from>)(<to>){<action>}[<pos>,<node opt>]|\par
5545 defaults: |[-,draw=none](<m>)(<m>){}[black,text depth=.25ex]|\par
5546 (abbreviations for |<pos>| available)
5547
5548 \item \icmd{\xtPayoff} puts payoffs, in math mode
5549 \item \icmd{\xtPayoff*} puts payoffs in the input mode as set by |\setistmathTF(*)|\par
5550 syntax: |\xtPayoff(<coor>){<payoff>}[<pos>,<node opt>]|\par
5551 defaults: |(<m>){}[below,inner sep=0pt,outer sep=4pt,text depth=.25ex]|\par
5552 (abbreviations for |<pos>| available)
5553 % (corrected) below added (2019/11/19)
5554 % remark: position of xtPayoff is not automatized, because "south" cannot be used for node position.
5555
5556
5557 \item \icmd{\xtInfosetOwner} puts the owner of an information set, in text mode
5558 \item \icmd{\xtInfosetOwner*} puts an information set owner in the input mode as set by |\setistmathTF(*)|\par
5559 syntax: |\xtInfosetOwner(<from>)(<to>){<owner>}[<pos>,<node opt>]|\par
5560 defaults: |(<m>)(<m>){}[]|\par
5561 (abbreviations for |<pos>| available)
5562
5563 \item \icmd{\xtNode} puts `something,' say, an owner into a node\par
5564 syntax: |\xtNode[<opt>](<coor>)[<node style>,<node opt>]{<node text>}|\par
5565 defaults: |[-](<m>)[solid node]{}|
5566
5567 \item \icmd{\xtNode*} puts `something' into a \ixw{plain node}\par
5568 syntax: |\xtNode*(<coor>)[<node style>,<node opt>]{<node text>}|\par
5569 defaults: |(<m>)[plain node]{}|
5570 \end{description}
5571
5572
5573 The supplementary macros depend on the coordinates defined
5574 in the sequence of |\istroot|--|\istb|--|\endist|
5575 and print their corresponding objects on or around the specified coordinates.
5576 So, in the above supplementary macros, all the coordinates such as |(<from>)|, |(<to>)|,
5577 and |(<coor>)| are mandatory arguments, denoted by |<m>|.
5578
5579
5580 \begin{doccode}[listing above text]
5581 % Example: various supplement macros
5582 \begin{istgame}[scale=3]
5583 \istroot(0)[chance node]
5584 \istb[dashed]{A} \istb*
5585 \istb*[blue,very thick]{B}[right,xshift=2pt,yshift=2pt,red] \endist
5586 \xtInfosetO(0)(0)
5587 \xtInfoset[thick](0-1)(0-2){1}
5588 \xtInfosetO[thick,red,rounded corners=1em](0-2)(0-3){2}(2em)
5589 \xtInfoset[dashed,bend right=25](0-1)(0-3)
5590 %-----------------
5591 \xtActionLabel(0)(0-3){1-\epsilon}[below,sloped] % action label in math mode
5592 \xtInfosetOwner(0-1)(0-3){3}[xshift=-25pt,yshift=-25pt]
5593 \xtOwner(0){Nash}[xshift=-5pt,left]
5594 \xtPayoff(0-3){(u_1,u_2)}[right,xshift=5pt] % payoffs in math mode
5595 \xtNode[dotted](0-1)[box node,fill=blue!20]{Smith}
5596 %-----------------
5597 \istroot[east](a)(0)[chance node] \istb \endist
5598 \xtNode*(a-1){text}
5599 \end{istgame}
5600 \end{doccode}
5601
5602
5603 To specify the |[<pos>]| option for the above supplementary macros (other than |\xtNode|),
5604 you can use the \isw{abbreviations}
5605 |[l]|, |[r]|, |[a]|, |[b]|, |[al]|, |[ar]|, |[bl]|, and |[br]|.
5606 Each of these abbreviations works only when used alone without any other option keys in the option list.
5607 For example, the option |[b]| or |[below]| or |[below,xshift=5pt]| works, but |[b,xshift=5pt]| does not, producing a compile error.
5608
5609 \subsection{More supplementary macros}
5610
5611 \subsubsection{\protect\CMD{\xtTimeLineH} and \protect\CMD{\xtTimeLineV}}
5612
5613 With the macro \icmd{\xtTimeLineH}, you can draw a horizontal time-line.
5614
5615
5616 \begin{docstx}
5617 % \xtTimeLineH (same logic for \xtTimeLineV)
5618 % syntax: %% if tree swapped, the following means -<from> -<to>
5619 \xtTimeLineH[<opt>](<coor>){<from>}{<to>}{<label>}[<pos>,<opt>]
5620 % defaults:
5621 [-,dotted,shorten <=0pt,shorten >=0pt](<m>){}{}[right]
5622 \end{docstx}
5623
5624 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).
5625 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.
5626 To change the position of the label, you can use the abbreviations, like |[a]| or |[ar]|.
5627
5628 The swap version \icmd{\xtTimeLineH'} simply puts the label on the other end of a time-line, |left| by default.
5629 That's the only difference from the normal version, |\xtTimeLineH|.
5630
5631
5632
5633 \begin{doccode}{.4}
5634 % \xtTimeLineH('): tree not swapped
5635 \begin{istgame}[font=\scriptsize]
5636 \setistgrowdirection{south} % default
5637 \xtdistance{10mm}{20mm}
5638 \istrootcntm(1) \istb \istbm \endist
5639 \istroot(A1)(1-1) \istb \istb \endist
5640 \istrootcntm(2)(A1-2) \istb \istbm \endist
5641 \istroot(A2)(2-1) \istb \istb \endist
5642 \istrootcntm(3)(A2-2) \istb \istbm \endist
5643 \istroot(A3)(3-1) \istb \istb \endist
5644 \xtTimeLineH[->](1){-1.5}{3}{period 1}
5645 \xtTimeLineH(2){-1.5}{3}{period 2}
5646 \xtTimeLineH'(3){-1.5}{3}{period 3}
5647 \end{istgame}
5648 \end{doccode}
5649
5650
5651
5652
5653 \remark
5654 The direction to which a time-line goes depends on whether a tree is swapped or not.
5655 \index{clockwise} \index{counterclockwise}
5656 \begin{itemize}\tightlist
5657 \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}.
5658 \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|.
5659 \end{itemize}
5660
5661 The following codes are the same as the above, except that the tree is swapped.
5662
5663 \begin{doccode}{.4}
5664 % \xtTimeLineH('): tree swapped
5665 \begin{istgame}[font=\scriptsize]
5666 \setistgrowdirection'{south} % clockwise
5667 \xtdistance{10mm}{20mm}
5668 \istrootcntm(1) \istb \istbm \endist
5669 \istroot(A1)(1-1) \istb \istb \endist
5670 \istrootcntm(2)(A1-2) \istb \istbm \endist
5671 \istroot(A2)(2-1) \istb \istb \endist
5672 \istrootcntm(3)(A2-2) \istb \istbm \endist
5673 \istroot(A3)(3-1) \istb \istb \endist
5674 \xtTimeLineH[->](1){-1.5}{3}{period 1}
5675 \xtTimeLineH(2){-1.5}{3}{period 2}
5676 \xtTimeLineH'(3){-1.5}{3}{period 3}
5677 \end{istgame}
5678 \end{doccode}
5679
5680
5681 With the macro \icmd{\xtTimeLineV}, you can draw a vertical time-line with a label on the top right, by default.
5682 As to |\xtTimeLineV|, we take a time-line going \emph{from above to below} as a standard case, because it is natural.
5683 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|.
5684
5685 The swap version \icmd{\xtTimeLineV'} simply puts the label on the other side of a time-line.
5686 That's the only difference to the normal version, |\xtTimeLineV|.
5687
5688
5689 \begin{doccode}{.4}
5690 % \xtTimeLineV('): tree swapped
5691 \begin{istgame}[font=\scriptsize]
5692 \setistgrowdirection'{east} % clockwise
5693 \xtdistance{10mm}{20mm}
5694 \istrootcntm(1) \istb \istbm \endist
5695 \istroot(A1)(1-1) \istb \istb \endist
5696 \istrootcntm(2)(A1-2) \istb \istbm \endist
5697 \istroot(A2)(2-1) \istb \istb \endist
5698 \istrootcntm(3)(A2-2) \istb \istbm \endist
5699 \istroot(A3)(3-1) \istb \istb \endist
5700 \xtTimeLineV[->](1){1.5}{-3}{period 1}
5701 \xtTimeLineV(2){1.5}{-3}{period 2}
5702 \xtTimeLineV'(3){1.5}{-3}{period 3}
5703 \end{istgame}
5704 \end{doccode}
5705
5706
5707 The following codes are the same as the above, except that the tree is \emph{not} swapped.
5708 \begin{doccode}{.4}
5709 % \xtTimeLineV('): tree not swapped
5710 \begin{istgame}[font=\scriptsize]
5711 \setistgrowdirection{east} % counterclockwise
5712 \xtdistance{10mm}{20mm}
5713 \istrootcntm(1) \istb \istbm \endist
5714 \istroot(A1)(1-1) \istb \istb \endist
5715 \istrootcntm(2)(A1-2) \istb \istbm \endist
5716 \istroot(A2)(2-1) \istb \istb \endist
5717 \istrootcntm(3)(A2-2) \istb \istbm \endist
5718 \istroot(A3)(3-1) \istb \istb \endist
5719 \xtTimeLineV[->](1){1.5}{-3}{period 1}
5720 \xtTimeLineV(2){1.5}{-3}{period 2}
5721 \xtTimeLineV'(3){1.5}{-3}{period 3}
5722 \end{istgame}
5723 \end{doccode}
5724
5725
5726 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|.
5727
5728 %Here is one more example of using |\xtTimeLineH|.
5729 %
5730 %\begin{doccode}{.4}
5731 %% Example: \xtTimeLineH
5732 %\begin{istgame}[font=\scriptsize]
5733 %\xtShowMidArrows
5734 %\xtdistance{10mm}{20mm}
5735 %\istrootcntm(1){1} % period 1
5736 % \istb{x}[r] \istbm \endist
5737 %\istroot(A1)(1-1)
5738 % <[label distance=-3pt]135>{2}
5739 % \istb{A}[al]{x,1-x} \istb{R}[ar] \endist
5740 %\istrootcntm(2)(A1-2){2} % period 2
5741 % \istb{y}[r] \istbm \endist
5742 %\istroot(A2)(2-1)
5743 % <[label distance=-3pt]135>{1}
5744 % \istb{A}[al]{1-y,y} \istb{R}[ar] \endist
5745 %\istrootcntm(3)(A2-2){1} % period 3
5746 % \istb{x}[r] \istbm \endist
5747 %\istroot(A3)(3-1)
5748 % <[label distance=-3pt]135>{2}
5749 % \istb{A}[al]{x,1-x}\istb{R}[ar]{0,0}\endist
5750 %\xtTimeLineH[draw=none](1){-2}{3}{period 1}[l]
5751 %\xtTimeLineH[draw=none](2){-2}{3}{period 2}
5752 %\xtTimeLineH[draw=none](3){-2}{3}{period 3}
5753 %\xtTimeLineH[draw=none](A2-1){2.5}{-2.5}
5754 % {$\left(\makecell{\delta\\\delta}
5755 % \right)\cdots$}[yshift=-.8em]
5756 %\xtTimeLineH[draw=none](A3-1){2.5}{-2.5}
5757 % {$\left(\makecell{\delta^2\\\delta^2}
5758 % \right)\cdots$}[yshift=-.8em]
5759 %\end{istgame}
5760 %\end{doccode}
5761
5762
5763
5764 \subsubsection{\protect\CMD{\xtCommentTo} and \protect\CMD{\xtCommentFrom}}
5765
5766 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).
5767 Note that with |\xtCommentTo| you need to specify a \emph{target absolute} coordinate followed by a \emph{start \textbf{relative}} coordinate.
5768
5769
5770 \begin{docstx}
5771 % \xtCommentTo
5772 % syntax:
5773 \xtCommentTo[<line opt>](<absolute to-coor>)(<relative from-coor>){<comment>}
5774 [<pos>,<node opt>](<end-shorten dim>)
5775 % defaults:
5776 [densely dotted,->,>=stealth,shorten >=1pt](<m>)(<m>){}[above](1pt)
5777 \end{docstx}
5778
5779
5780 The last parenthesis option if for shortening arrow end.
5781 You can use the abbreviations of the directional words, but not with other options in the option list.
5782
5783 \begin{doccode}{.3}
5784 % \xtCommentTo
5785 \begin{istgame}[->,scale=.7]
5786 \xtShowEndPoints
5787 \istroot(0)+15mm..30mm+ \istb \istb \endist
5788 \istroot(1)(0-1) \istb \istb \endist
5789 \istroot(2)(0-2)[chance node] \istb \istb \endist
5790 \xtCommentTo[bend right](0)(150:2){Alice moves}[l]
5791 \xtCommentTo[bend right](1)(150:2){Ben moves}
5792 \xtCommentTo[bend left](2)(0,2){Nature moves}[a](5pt)
5793 \end{istgame}
5794 \end{doccode}
5795
5796
5797 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.
5798 Note that with |\xtCommentFrom| you need to specify a \emph{start absolute} coordinate followed by a \emph{target absolute} coordinate.
5799 The last parenthesis option if for shortening arrow end.
5800 You can use the abbreviations of the directional words.
5801
5802
5803 \begin{docstx}
5804 % \xtCommentFrom
5805 % syntax:
5806 \xtCommentFrom[<line opt>](<from>)(<to>){<comment>}[<pos>,<node opt>]<arrow end shorten>
5807 % defaults:
5808 [densely dotted,->,>=stealth,shorten >=1pt](<m>)(<m>){}[above](1pt)
5809 \end{docstx}
5810
5811
5812 \begin{doccode}{.3}
5813 % \xtCommentFrom
5814 \begin{istgame}[scale=.6]
5815 \xtShowEndPoints
5816 \istroot(0)+15mm..30mm+ \istb \istb \endist
5817 \istroot(1)(0-1) \istb \istb \endist
5818 \istroot(2)(0-2)[chance node] \istb \istb \endist
5819 \xtCommentFrom[bend right](-3,2)(0){decision nodes}
5820 \xtCommentFrom[bend right](-3,2)(1)
5821 \xtCommentFrom[bend right,solid,blue](-3,2)(2)
5822 \xtCommentFrom[bend right](-3,-5)(1-1)
5823 {terminal nodes}[b]
5824 \xtCommentFrom[bend right](-3,-5)(1-2)
5825 \xtCommentFrom[bend right](-3,-5)(2-1)
5826 \xtCommentFrom[bend right](-3,-5)(2-2)(5pt)
5827 \end{istgame}
5828 \end{doccode}
5829
5830 %\subsubsection{To show and hide end-points and terminal nodes}
5831 %
5832 %With the macro \icmd{\xtShowEndPoints}, you can control the node shape of every endpoint of every simple tree, all at once.
5833 %(For more details, see page~\pageref{page:endpoint}.)
5834 %
5835 %\icmd{\xtHideEndPoints} turns off the effect of |\xtShowEndPoints|.
5836 %
5837 %\begin{docstx}
5838 %syntax: \xtShowEndPoints[<node style>]
5839 %syntax: \xtHideEndPoints
5840 %\end{docstx}
5841 %
5842 %
5843 %The macro \icmd{\xtShowTerminalNodes} works only with |\istbt|\@ and |\istBt| to control the node shape of terminal nodes, all at once.
5844 %(For more details, see page~\pageref{page:terminalnode}.)
5845 %
5846 %\icmd{\xtHideTerminalNodes} turns off the effect of |\xtShowTerminalNodes|.
5847 %
5848 %\begin{docstx}
5849 %syntax: \xtShowTerminalNodes[<node style>] % work only with \istbt and \istBt
5850 %syntax: \xtHideTerminalNodes
5851 %\end{docstx}
5852
5853 \section{Representing subgames}
5854
5855 Here is an example of a whole game tree.
5856
5857 \begin{doccode}{.3}
5858 \begin{istgame}
5859 \xtdistance{15mm}{30mm}
5860 \istroot[-135](0)[initial node]<0>{1}
5861 \istb{A}[a]{(2,2)}[l] \istb{D}[r] \endist
5862 \istroot(1)(0-2)<135>{1}
5863 \istb{L}[al] \istb{R}[ar] \endist
5864 \xtdistance{10mm}{20mm}
5865 \istroot(2)(1-1)<135>{2}
5866 \istb{\ell}[al]{(4,2)} \istb{r}[ar]{(1,1)} \endist
5867 \istroot(3)(1-2)<45>{2}
5868 \istb{\ell}[al]{(3,2)} \istb{r}[ar]{(0,3)} \endist
5869 \end{istgame}
5870 \end{doccode}
5871
5872 \subsection{\protect\CMD{\xtSubgameBox} (experimental)}
5873
5874 \subsubsection{\protect\CMD{\xtSubgameBox}}
5875
5876 \icmd{\xtSubgameBox} is for indicating a \ixsw{subgame} by a box (or a rectangle) with rounded corners.
5877
5878 \begin{docstx}
5879 % \xtSubgameBox(*)
5880 % syntax:
5881 \xtSubgame(*)(<subroot coor>){(<coor1>) (<coor2>) ... }[<opt>]
5882 % options:
5883 *: filled box
5884 (<subroot coor>): the subroot of a subgame (mandatory)
5885 {(coor1) (coor2) ...}: coordinates of terminal nodes (mandatory)
5886 [<opt>]: color, line style
5887 % defaults:
5888 (<m>){}[rectangle,dashed,inner sep=20pt,rounded corners=15pt,black!50]
5889 *(<m>){}[rectangle,inner sep=20pt,rounded corners=15pt,red!20]
5890 \end{docstx}
5891
5892
5893 The subgame box embraces the subroot indicated in parentheses and terminal nodes specified within curly braces.
5894 The coordinates of terminal nodes are listed in curly braces without delimiters (spaces are allowed).
5895 The default options for the subgame box are |dashed|, |inner sep=20pt|, |rounded corners=15pt|, and |black!50|.
5896
5897
5898 \begin{doccode}{.3}
5899 % \xtSubgameBox
5900 \begin{istgame}
5901 \xtdistance{15mm}{30mm}
5902 \istroot[-135](0)[initial node]<center>{1}
5903 \istb{A}[a]{(2,2)}[l] \istb{D}[r] \endist
5904 \istroot(1)(0-2)<135>{1}
5905 \istb{L}[al] \istb{R}[ar] \endist
5906 \xtdistance{10mm}{20mm}
5907 \istroot(2)(1-1)<135>{2}
5908 \istb{\ell}[al]{(4,2)} \istb{r}[ar]{(1,1)} \endist
5909 \istroot(3)(1-2)<45>{2}
5910 \istb{\ell}[al]{(3,2)} \istb{r}[ar]{(0,3)} \endist
5911 \xtSubgameBox(1){(2-1)(3-2)}
5912 \xtSubgameBox(2){(2-1)(2-2)}[solid,blue]
5913 \end{istgame}
5914 \end{doccode}
5915
5916 You can change the size of the box in two ways.
5917 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)|.
5918 Of course, you can do the both at the same time.
5919
5920 % subgame: rectangle (inner sep,yshift)
5921 \begin{doccode}{.3}
5922 \begin{istgame}
5923 \xtdistance{15mm}{30mm}
5924 \istroot[-135](0)[initial node]<0>{1}
5925 \istb{A}[a]{(2,2)}[l] \istb{D}[r] \endist
5926 \istroot(1)(0-2)<135>{1}\istb{L}[al]\istb{R}[ar]\endist
5927 \xtdistance{10mm}{20mm}
5928 \istroot(2)(1-1)<135>{2}
5929 \istb{\ell}[al]{(4,2)} \istb{r}[ar]{(1,1)} \endist
5930 \istroot(3)(1-2)<45>{2}
5931 \istb{\ell}[al]{(3,2)} \istb{r}[ar]{(0,3)} \endist
5932 \xtSubgameBox(1){(2-1)(3-2)}
5933 \xtSubgameBox([yshift=5pt]2){(2-1)(2-2)}%
5934 [solid,blue,inner sep=10pt]
5935 \end{istgame}
5936 \end{doccode}
5937
5938
5939 \subsubsection{\protect\CMD{\xtSubgameBox*}}
5940
5941 The starred version \icmd{\xtSubgameBox*} produces a subgame box with background color (by default |red!20|).
5942 In the following example, where the tree grows east, the size of the filled subgame box is adjusted by manipulating |inner sep| and |xshift|.
5943
5944 \begin{doccode}{.3}
5945 % \xtSubgameBox*
5946 \begin{istgame}
5947 \setistgrowdirection'{east}
5948 \xtdistance{15mm}{30mm}
5949 \istroot[45](0)[initial node]<180>{1}
5950 \istb{A}[l]{(2,2)}[a] \istb{D}[b] \endist
5951 \istroot(1)(0-2)<135>{1}\istb{L}[al]\istb{R}[bl]\endist
5952 \xtdistance{10mm}{20mm}
5953 \istroot(2)(1-1)<135>{2}
5954 \istb{\ell}[al]{(4,2)} \istb{r}[bl]{(1,1)} \endist
5955 \istroot(3)(1-2)<-135>{2}
5956 \istb{\ell}[al]{(3,2)} \istb{r}[bl]{(0,3)} \endist
5957 \xtSubgameBox*([xshift=20pt]1){(2-1)(3-2)}%
5958 [inner xsep=30pt]
5959 \end{istgame}
5960 \end{doccode}
5961
5962
5963 \subsection{\protect\CMD{\xtSubgameOval} and \protect\CMD{\xtSubgameOval*} (experimental)}
5964
5965 \icmd{\xtSubgameOval} and \icmd{\xtSubgameOval*} are also provided.
5966
5967 \begin{docstx}
5968 % \xtSubgameOval(*)
5969 % syntax:
5970 \xtSubgameOval(*)(<subroot coor>){(<coor1>) (<coor2>) ... }[<opt>]
5971 % options:
5972 *: filled box
5973 (<subroot coor>): the subroot of a subgame (mandatory)
5974 {(coor1) (coor2) ...}: coordinates of terminal nodes (mandatory)
5975 [<opt>]: color, line style
5976 % defaults:
5977 (<m>){}[ellipse,dashed,inner sep=20pt,rounded corners=15pt,black!50]
5978 *(<m>){}[ellipse,inner sep=20pt,rounded corners=15pt,red!20]
5979 \end{docstx}
5980
5981
5982 %\begin{docstx}
5983 %% \xtSubgameOval(*)
5984 %% syntax:
5985 % \xtSubgame(*)(<subroot coor>){(<coor1>) (<coor2>) ... }[<opt>]
5986 %%% \xtSubgameOval: definition
5987 %\def\xtdefaultsubrootshiftoval{0,-.7}
5988 %\DeclareDocumentCommand\xtSubgameOval{ s r() m O{}}
5989 %{ \IfBooleanTF #1
5990 % {
5991 % \coordinate (xtsubroot) at ($(#2)+(\xtdefaultsubrootshiftoval)$);
5992 % \begin{scope}[on background layer]
5993 % \node [ellipse,fill=red!20,inner sep=15pt,#4]
5994 % [fit=(xtsubroot) #3] {};
5995 % \end{scope}
5996 % }
5997 % {
5998 % \coordinate (xtsubroot) at ($(#2)+(0,-.7)$);
5999 % \begin{scope}[on background layer]
6000 % \node [ellipse,draw,dashed,inner sep=15pt,black!50,#4]
6001 % [fit=(xtsubroot) #3] {};
6002 % \end{scope}
6003 % }
6004 %}
6005 %\end{docstx}
6006
6007 |\xtSubgameOval(*)| works just like |\xtSubgameBox(*)|, except for one thing: an oval instead of a rectangle.
6008 |\xtSubgameOval| draws an oval (or an ellipse) to represent a subgame, and |\xtSubgameOval*| draws a filled oval with |red!20| by default.
6009
6010
6011 \begin{doccode}{.4}
6012 % \xtSubgameOval
6013 \begin{istgame}
6014 \xtdistance{15mm}{30mm}
6015 \istroot[-135](0)[initial node]<0>{1}
6016 \istb{A}[a]{(2,2)}[l]
6017 \istb{D}[r]
6018 \endist
6019 \istroot(1)(0-2)<135>{1}
6020 \istb{L}[al]
6021 \istb{R}[ar]
6022 \endist
6023 \xtdistance{10mm}{20mm}
6024 \istroot(2)(1-1)<135>{2}
6025 \istb{\ell}[al]{(4,2)}
6026 \istb{r}[ar]{(1,1)}
6027 \endist
6028 \istroot(3)(1-2)<45>{2}
6029 \istb{\ell}[al]{(3,2)}
6030 \istb{r}[ar]{(0,3)}
6031 \endist
6032 \xtSubgameOval(1){(2-1)(3-2)}
6033 \xtSubgameOval(2){(2-1)(2-2)}
6034 \end{istgame}
6035 \end{doccode}
6036
6037
6038 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.
6039 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|.
6040
6041 \begin{doccode}{.4}
6042 % \xtSubgameOval*
6043 \begin{istgame}
6044 \setistgrowdirection'{east}
6045 \xtdistance{15mm}{30mm}
6046 \istroot[45](0)[initial node]<180>{1}
6047 \istb{A}[l]{(2,2)}[a]
6048 \istb{D}[b]
6049 \endist
6050 \istroot(1)(0-2)<135>{1}
6051 \istb{L}[al]
6052 \istb{R}[bl]
6053 \endist
6054 \xtdistance{10mm}{20mm}
6055 \istroot(2)(1-1)<135>{2}
6056 \istb{\ell}[al]{(4,2)}
6057 \istb{r}[bl]{(1,1)}
6058 \endist
6059 \istroot(3)(1-2)<-135>{2}
6060 \istb{\ell}[al]{(3,2)}
6061 \istb{r}[bl]{(0,3)}
6062 \endist
6063 \xtSubgameOval*([xshift=30pt]1){(2-1)(3-2)}%
6064 [inner xsep=25pt,blue!20]
6065 \end{istgame}
6066 \end{doccode}
6067
6068 \subsection{\protect\CMD{\setxtsubgamelayer}}
6069
6070 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.
6071
6072 \begin{doccode}{.4}
6073 % subgame: half circle
6074 \begin{istgame}
6075 \xtdistance{15mm}{30mm}
6076 \istroot[-135](0)[initial node]<0>{1}
6077 \istb{A}[a]{(2,2)}[l]
6078 \istb{D}[r] \endist
6079 \istroot(1)(0-2)<135>{1}
6080 \istb{L}[al]
6081 \istb{R}[ar] \endist
6082 \xtdistance{10mm}{20mm}
6083 \istroot(2)(1-1)<135>{2}
6084 \istb{\ell}[al]{(4,2)}
6085 \istb{r}[ar]{(1,1)}
6086 \endist
6087 \istroot(3)(1-2)<45>{2}
6088 \istb{\ell}[al]{(3,2)}
6089 \istb{r}[ar]{(0,3)}
6090 \endist
6091 \xtSubgameBox([yshift=-2cm]1){(2-1)(3-2)}%
6092 [semicircle,inner sep=15pt]
6093 \end{istgame}
6094 \end{doccode}
6095
6096
6097 %\begin{doccode}{.4}
6098 %% subgame: half circle*
6099 %\begin{istgame}
6100 %\setistgrowdirection'{east}
6101 %\xtdistance{15mm}{30mm}
6102 %\istroot[45](0)[initial node]<180>{1}
6103 % \istb{A}[l]{(2,2)}[a]
6104 % \istb{D}[b]
6105 % \endist
6106 %\istroot(1)(0-2)<135>{1}
6107 % \istb{L}[al]
6108 % \istb{R}[bl]
6109 % \endist
6110 %\xtdistance{10mm}{20mm}
6111 %\istroot(2)(1-1)<135>{2}
6112 % \istb{\ell}[al]{(4,2)}
6113 % \istb{r}[bl]{(1,1)}
6114 % \endist
6115 %\istroot(3)(1-2)<-135>{2}
6116 % \istb{\ell}[al]{(3,2)}
6117 % \istb{r}[bl]{(0,3)}
6118 % \endist
6119 %\xtSubgameBox*([xshift=2cm]1){(2-1)(3-2)}%
6120 % [semicircle,rotate=90,inner sep=0pt]
6121 %\end{istgame}
6122 %\end{doccode}
6123
6124 Here are more examples showing how to draw a rectangle and circles to represent subgames.
6125
6126 \begin{doccode}{.4}
6127 % subgame: circle
6128 \begin{istgame}
6129 \xtdistance{15mm}{30mm}
6130 \istroot[-135](0)[initial node]<0>{1}
6131 \istb{A}[a]{(2,2)}[l]
6132 \istb{D}[r] \endist
6133 \istroot(1)(0-2)<135>{1}
6134 \istb{L}[al]
6135 \istb{R}[ar] \endist
6136 \xtdistance{10mm}{20mm}
6137 \istroot(2)(1-1)<135>{2}
6138 \istb{\ell}[al]{(4,2)}
6139 \istb{r}[ar]{(1,1)}
6140 \endist
6141 \istroot(3)(1-2)<45>{2}
6142 \istb{\ell}[al]{(3,2)}
6143 \istb{r}[ar]{(0,3)}
6144 \endist
6145 \xtSubgameBox*(1){(2-1)(3-2)}
6146 \xtSubgameOval*(2){(2-1)(2-2)}%
6147 [circle,blue!20,inner xsep=9pt]
6148 \xtSubgameOval(3){(3-1)(3-2)}%
6149 [circle,inner xsep=9pt]
6150 \end{istgame}
6151 \end{doccode}
6152
6153
6154 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{}|.
6155
6156 \begin{doccode}{.4}
6157 % \setxtsubgamelayer
6158 \begin{istgame}
6159 \xtdistance{15mm}{30mm}
6160 \istroot[-135](0)[initial node]<0>{1}
6161 \istb{A}[a]{(2,2)}[l]
6162 \istb{D}[r] \endist
6163 \istroot(1)(0-2)<135>{1}
6164 \istb{L}[al]
6165 \istb{R}[ar] \endist
6166 \xtdistance{10mm}{20mm}
6167 \istroot(2)(1-1)<135>{2}
6168 \istb{\ell}[al]{(4,2)}
6169 \istb{r}[ar]{(1,1)}
6170 \endist
6171 \istroot(3)(1-2)<45>{2}
6172 \istb{\ell}[al]{(3,2)}
6173 \istb{r}[ar]{(0,3)}
6174 \endist
6175 \setxtsubgamelayer{behind}
6176 \xtSubgameOval*(2){(2-1)(2-2)}%
6177 [circle,blue!80,inner xsep=9pt,opacity=.25]
6178 \setxtsubgamelayer % restore defaults
6179 \xtSubgameBox*(1){(2-1)(3-2)}
6180 \xtSubgameOval(3){(3-1)(3-2)}%
6181 [circle,inner xsep=9pt]
6182 \end{istgame}
6183 \end{doccode}
6184
6185
6186 \section{Miscellany}
6187
6188 \subsection{Various branch types, directions, and lengths}
6189
6190 Here is an example of how to deal with various line types, directions, and lengths of branches.
6191 You can do this using |\istbA| (see Section~\ref{sec:istbA}, for more details).
6192
6193 \begin{doccode}[listing above text]
6194 % various branches
6195 \begin{istgame}[scale=1.3]
6196 \istroot(0)[chance node]<[blue]>{N}+10mm..30mm+
6197 \istb[->,shorten >=.8pt]{p}[above left,red]
6198 \istb[->,shorten >=.8pt]{1-p}[ar] \endist
6199 \istroot(1)(0-1)+15mm..30mm+
6200 \istb<level distance=7mm,sibling distance=14mm>{L}[al]
6201 \istb*[->>>]{R}[ar] \endist
6202 \istroot(2)(0-2)+10mm..15mm+
6203 \istb[->,dashed]{A}
6204 \istbA(2.5)<grow=30>[red]{a}[al]{(1,-1)}[[blue]right]
6205 \istb*<grow=-45>[blue,text=red,thick]{b}[ar]{(u_1,u_2)}[[green]-90] \endist
6206 \end{istgame}
6207 \end{doccode}
6208
6209
6210 \subsection{Code reuse}
6211
6212 \subsubsection{Drawing subgames}
6213
6214 Suppose that you have the following tree as a whole game.
6215
6216 \begin{doccode}{.4}
6217 % Example: a whole game
6218 \begin{istgame}
6219 \xtdistance{15mm}{30mm}
6220 \istroot[-135](0)[initial node]<0>{1}
6221 \istb{A}[a]{(2,2)}[l]
6222 \istb{D}[r]
6223 \endist
6224 \istroot(1)(0-2)<left>{1}
6225 \istb{L}[al]
6226 \istb{R}[ar]
6227 \endist
6228 \xtdistance{10mm}{20mm}
6229 \istroot(2)(1-1)<135>{2}
6230 \istb{\ell}[al]{(4,2)}
6231 \istb{r}[ar]{(1,1)}
6232 \endist
6233 \istroot(3)(1-2)<45>{2}
6234 \istb{\ell}[al]{(3,2)}
6235 \istb{r}[ar]{(0,3)}
6236 \endist
6237 \end{istgame}
6238 \end{doccode}
6239
6240 It is easy to draw a subgame if you use the existing codes for a whole game.
6241 To get a subgame, just comment out the codes for the rest of the subgame.
6242
6243 \begin{doccode}{.4}
6244 % Example: a subgame
6245 \begin{istgame}
6246 \xtdistance{15mm}{30mm}
6247 %\istroot[-135](0)[initial node]<0>{1}
6248 % \istb{A}[a]{(2,2)}[l]
6249 % \istb{D}[r]
6250 %\endist
6251 \istroot(1)(0-2)<left>{1}
6252 \istb{L}[al]
6253 \istb{R}[ar]
6254 \endist
6255 \xtdistance{10mm}{20mm}
6256 \istroot(2)(1-1)<135>{2}
6257 \istb{\ell}[al]{(4,2)}
6258 \istb{r}[ar]{(1,1)}
6259 \endist
6260 \istroot(3)(1-2)<45>{2}
6261 \istb{\ell}[al]{(3,2)}
6262 \istb{r}[ar]{(0,3)}
6263 \endist
6264 \end{istgame}
6265 \end{doccode}
6266
6267
6268 \remark If you copy and paste the previous codes alone and try to compile to get a subgame, you will get an error message:
6269
6270 |! Package pgf Error: No shape named 0-2 is known.|
6271
6272 \noindent
6273 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:
6274
6275 |\istroot(1)(0,0)<left>{1}|
6276
6277 \noindent
6278 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).
6279 Therefore, most of the time you will not get the error message by commenting out some lines to get a subgame.
6280
6281
6282
6283 A smaller subgame is also easy to get by commenting out the rest of the subgame you want.
6284
6285 \begin{doccode}{.4}
6286 % Example: a smaller subgame
6287 \begin{istgame}
6288 %\xtdistance{15mm}{30mm}
6289 %\istroot[-135](0)[initial node]<0>{1}
6290 % \istb{A}[a]{(2,2)}[l]
6291 % \istb{D}[r]
6292 %\endist
6293 %\istroot(1)(0-2)<left>{1}
6294 % \istb{L}[al]
6295 % \istb{R}[ar]
6296 %\endist
6297 \xtdistance{10mm}{20mm}
6298 \istroot(2)(1-1)<135>{2}
6299 \istb{\ell}[al]{(4,2)}
6300 \istb{r}[ar]{(1,1)}
6301 \endist
6302 %\istroot(3)(1-2)<45>{2}
6303 % \istb{\ell}[al]{(3,2)}
6304 % \istb{r}[ar]{(0,3)}
6305 %\endist
6306 \end{istgame}
6307 \end{doccode}
6308
6309
6310 It is not possible to make a subgame stay put where it appears in a whole game.
6311 (Replace |[black!5]| by |[white]| to make the rest of the game disappear in the example below.)
6312
6313
6314
6315 \begin{doccode}{.4}
6316 % Example: a subgame stays put
6317 \begin{istgame}
6318 \setistDecisionNodeStyle[black!5]
6319 \xtdistance{15mm}{30mm}
6320 \istroot[-135](0)%[initial node]<0>{1}
6321 \istb[black!5]%{A}[a]{(2,2)}[l]
6322 \istb[black!5]%{D}[r]
6323 \endist
6324 \istroot(1)(0-2)%<left>{1}
6325 \istb[black!5]%{L}[al]
6326 \istb[black!5]%{R}[ar]
6327 \endist
6328 \setistDecisionNodeStyle
6329 \xtdistance{10mm}{20mm}
6330 \istroot(2)(1-1)<135>{2}
6331 \istb{\ell}[al]{(4,2)}
6332 \istb{r}[ar]{(1,1)}
6333 \endist
6334 \setistDecisionNodeStyle[black!5]
6335 \istroot(3)(1-2)%<45>{2}
6336 \istb[black!5]%{\ell}[al]{(3,2)}
6337 \istb[black!5]%{r}[ar]{(0,3)}
6338 \endist
6339 \end{istgame}
6340 \end{doccode}
6341
6342
6343 \subsubsection{Backward induction}
6344
6345 It is also easy to illustrate the procedure of \isw{backward induction}, when you analyze an extensive game.
6346
6347
6348
6349 \begin{doccode}{.4}
6350 \begin{istgame}[>=stealth]
6351 \xtdistance{15mm}{30mm}
6352 \istroot[-135](0)[initial node]<0>{1}
6353 \istb[dashed]{A}[a]{(2,2)}[l]
6354 \istb[very thick]{D}[r]
6355 \endist
6356 \istroot(1)(0-2)<left>{1}
6357 \istb[very thick]{L}[al]
6358 \istb<dashed>{R}[ar]
6359 \endist
6360 \xtdistance{10mm}{20mm}
6361 \istroot(2)(1-1)<135>{2}
6362 \istb[->,very thick,blue]{\ell}[al]{(4,2)}
6363 \istb[thick,dotted]{r}[ar]{(1,1)}
6364 \endist
6365 \istroot(3)(1-2)<45>{2}
6366 \istb[thick,dotted]{\ell}[al]{(3,2)}
6367 \istb[very thick,blue]{r}[ar]{(0,3)}
6368 \endist
6369 \end{istgame}
6370 \end{doccode}
6371
6372
6373 By using |\istb| with options for the middle arrow tips, you can effectively express the backward induction procedure.
6374 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.
6375 change the color and the style of a line representing a branch and an arrow tip to it.
6376
6377
6378 \begin{doccode}{.4}
6379 % Example: backward induction
6380 \begin{istgame}
6381 \setxtarrowtips[red,very thick,shorten >=-2pt,shorten <=-2pt]
6382 \xtdistance{15mm}{30mm}
6383 \istroot[-135](0)[initial node]<0>{1}
6384 \istb[-x-,dashed,blue]{A}[a]{(2,2)}[l]
6385 \istb[-o-,very thick]{D}[r]
6386 \endist
6387 \istroot(1)(0-2)<left>{1}
6388 \istb[very thick]{L}[al]
6389 \istb[dashed,-x-]{R}[ar]
6390 \endist
6391 \xtdistance{10mm}{20mm}
6392 \istroot(2)(1-1)<135>{2}
6393 \istb[->>>-,very thick,draw=blue]{\ell}[al]{(4,2)}
6394 \istb[-x-,thick,dotted]{r}[ar]{(1,1)}
6395 \endist
6396 \setxtarrowtips % restore defaults
6397 \istroot(3)(1-2)<45>{2}
6398 \istb[-x-,thick,dotted]{\ell}[al]{(3,2)}
6399 \istb[->-,draw=blue]{r}[ar]{(0,3)}
6400 \endist
6401 \end{istgame}
6402 \end{doccode}
6403
6404
6405 %\clearpage
6406 \subsubsection{Code reusability}
6407
6408 Chen(2013)'s work is good to understand how drawing a game tree with \TikZ\ works.
6409
6410 \begin{doccode}[listing above text]
6411 % Chen (2013)
6412 \begin{tikzpicture}[scale=1,font=\footnotesize]
6413 \tikzstyle{solid node}=[circle,draw,inner sep=1.5,fill=black]
6414 \tikzstyle{hollow node}=[circle,draw,inner sep=1.5]
6415 \tikzstyle{level 1}=[level distance=15mm,sibling distance=3.5cm]
6416 \tikzstyle{level 2}=[level distance=15mm,sibling distance=1.5cm]
6417 \tikzstyle{level 3}=[level distance=15mm,sibling distance=1cm]
6418 \node(0)[solid node,label=above:{$P1$}]{}
6419 child{node[solid node,label=above left:{$P2$}]{}
6420 child{node[hollow node,label=below:{$(1,2)$}]{} edge from parent node[left]{$C$}}
6421 child{node[hollow node,label=below:{$(1,-1)$}]{} edge from parent node[left]{$D$}}
6422 child{node[hollow node,label=below:{$(0,2)$}]{} edge from parent node[right]{$E$}}
6423 edge from parent node[left,xshift=-5]{$A$}
6424 }
6425 child{node[solid node,label=above right:{$P2$}]{}
6426 child{node[hollow node,label=below:{$(2,2)$}]{} edge from parent node[left]{$F$}}
6427 child{node[hollow node,label=below:{$(1,3)$}]{} edge from parent node[right]{$G$}}
6428 edge from parent node[right,xshift=5]{$B$}
6429 };
6430 \end{tikzpicture}
6431 \end{doccode}
6432
6433
6434
6435 You can get a quite similar (actually the same) result by using the \pkg{istgame} package.
6436
6437 \begin{doccode}{.4}
6438 % istgame
6439 \begin{istgame}[scale=1,font=\footnotesize]
6440 \setistDecisionNodeStyle{4pt}
6441 \xtdistance{15mm}{3.5cm}
6442 \istroot(0){$P1$}
6443 \istb{A}[al]
6444 \istb{B}[ar] \endist
6445 \xtShowEndPoints[oval node]
6446 \xtdistance{15mm}{1.5cm}
6447 \istroot(1)(0-1)<135>{$P2$}
6448 \istb{C}[l]{(1,2)}
6449 \istb{D}[l]{(1,-1)}
6450 \istb{E}[r]{(0,2)} \endist
6451 \istroot(2)(0-2)<45>{$P2$}
6452 \istb{F}[l]{(2,2)}
6453 \istb{G}[r]{(1,3)} \endist
6454 \end{istgame}
6455 \end{doccode}
6456
6457
6458 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.
6459
6460
6461 \section{Game tree examples}
6462
6463 This section provides some examples of extensive games.
6464 Before we start, let us change the default font size of the \env{istgame} environment by stating
6465 |\setistgamefontsize{|\cmd{\footnotesize}|}| outside of the environment. (Right here!)
6466
6467 \setistgamefontsize{\footnotesize}
6468
6469 \subsection{Simple examples}
6470
6471 \begin{doccode}{.35}
6472 \begin{istgame}[->,shorten >=1.3pt]
6473 \setistmathTF*001
6474 \xtdistance{15mm}{30mm}
6475 \istroot(0)[initial node]{Child}
6476 \istb{Good}[above left]{(0,2)}
6477 \istb{Bad}[above right]
6478 \endist
6479 \istroot(1)(0-2)<30>{Parent}
6480 \istb{Forgive}[above left]{(1,1)}
6481 \istb{Punish}[above right]{(-1,-1)}
6482 \endist
6483 \end{istgame}
6484 \end{doccode}
6485
6486 \medskip
6487
6488 %\begin{doccode}{.35}
6489 %% sloped action labels
6490 %\begin{istgame}[->]
6491 %\setistmathTF*001 % action labels in italics
6492 %\xtShowEndPoints
6493 %\xtdistance{15mm}{30mm}
6494 %\istroot(0)[initial node]{Child}
6495 % \istb{Good}[above,sloped]{(0,2)}
6496 % \istb{Bad}[above,sloped]
6497 % \endist
6498 %\istroot(1)(0-2)<30>{Parent}
6499 % \istb{Forgive}[above,sloped]{(1,1)}
6500 % \istb{Punish}[above,sloped]{(-1,-1)}
6501 % \endist
6502 %\end{istgame}
6503 %\end{doccode}
6504 %
6505 %\medskip
6506
6507 \begin{doccode}{.35}
6508 % dual sloped action labels (\istB)
6509 \begin{istgame}
6510 \setistmathTF*001 % action labels in italics
6511 \xtShowArrows
6512 \xtdistance{15mm}{30mm}
6513 \istroot(0)[initial node]{Child}
6514 \istB{Good}[above,sloped]
6515 {$p$}[below, sloped]{(0,2)}
6516 \istB{Bad}[above,sloped]
6517 {$1-p$}[below, sloped]
6518 \endist
6519 \istroot(1)(0-2)<30>{Parent}
6520 \istB{Forgive}[above,sloped]
6521 {$q$}[below, sloped]{(1,1)}
6522 \istB{Punish}[above,sloped]
6523 {$1-q$}[below, sloped]{(-1,-1)}
6524 \endist
6525 \end{istgame}
6526 \end{doccode}
6527
6528 \medskip
6529
6530 \begin{doccode}{.35}
6531 % IGT 218.1 (Osborne, 2004b)
6532 \begin{istgame}[font=\normalsize]
6533 \xtdistance{10mm}{20mm}
6534 \istroot(0){Vote}
6535 \istb{a}[al]{x}
6536 \istb{b}[ar]
6537 \endist
6538 \istroot(1)([yshift=-1.5em]0-2){Vote}
6539 \istb{c}[al]{y}
6540 \istb{d}[ar]{z}
6541 \endist
6542 \end{istgame}
6543 \end{doccode}
6544
6545 \medskip
6546
6547 \begin{doccode}{.35}
6548 % information set
6549 \begin{istgame}
6550 \xtdistance{10mm}{30mm}
6551 \istroot(0){1}
6552 \istb{L}[al] \istb{R}[ar]
6553 \endist
6554 \xtdistance{7mm}{15mm}
6555 \istroot(1a)(0-1)
6556 \istb{a}[al]{1,0}
6557 \istb{b}[ar]{2,3}
6558 \endist
6559 \istroot(1b)(0-2)
6560 \istb{c}[al]{0,1} \istb{d}[ar]{-1,0}
6561 \endist
6562 \xtInfoset(1a)(1b){2}
6563 \end{istgame}
6564 \end{doccode}
6565
6566 \medskip
6567
6568 \begin{doccode}{.35}
6569 % information set
6570 \begin{istgame}
6571 \xtShowEndPoints[oval node]
6572 \xtdistance{10mm}{30mm}
6573 \istroot(0){1}
6574 \istb{L}[al] \istb{R}[ar]
6575 \endist
6576 \xtdistance{7mm}{15mm}
6577 \istroot(1a)(0-1)
6578 \istb{a}[al]{1,0} \istb{b}[ar]{2,3}
6579 \endist
6580 \istroot(1b)(0-2)
6581 \istb{c}[al]{0,1} \istb{d}[ar]{-1,0}
6582 \endist
6583 \xtInfoset[bend left=30](1a)(1b){2}
6584 \end{istgame}
6585 \end{doccode}
6586
6587 \medskip
6588
6589 \begin{doccode}{.35}
6590 % (oval) information set
6591 \begin{istgame}
6592 \xtdistance{15mm}{30mm}
6593 \istroot[-135](0)[initial node]<0>{1}
6594 \istb{A}[a]{(2,2)}[l] \istb{D}[r]
6595 \endist
6596 \istroot(1)(0-2)<left>{1}
6597 \istb{L}[al] \istb{R}[ar]
6598 \endist
6599 \xtInfosetO(1-1)(1-2){2}
6600 \xtdistance{10mm}{20mm}
6601 \istroot(2)(1-1)
6602 \istb{\ell}[al]{(4,2)} \istb{r}[ar]{(1,1)}
6603 \endist
6604 \istroot(3)(1-2)
6605 \istb{\ell}[al]{(3,2)} \istb{r}[ar]{(0,3)}
6606 \endist
6607 \end{istgame}
6608 \end{doccode}
6609
6610
6611 \subsection{A game tree with a strategic game}
6612
6613 \begin{doccode}{.35}
6614 \DeclareExpandableDocumentCommand\xcol{O{c|}m}
6615 {\multicolumn{1}{#1}{\ensuremath{#2}}}
6616 \def\strategicgame{%
6617 \begin{tabular} {c|c|c|}
6618 \xcol[c]{~} & \xcol[c]{B} & \xcol[c]{S}
6619 \\\cline{2-3}
6620 $B$ & $3,1$ & $0,0$ \\\cline{2-3}
6621 $S$ & $0,0$ & $1,3$ \\\cline{2-3}
6622 \end{tabular}
6623 }
6624
6625 \begin{istgame}
6626 \setistmathTF*001
6627 \xtdistance{10mm}{40mm}
6628 \istroot(0)[initial node]{1}
6629 \istb{Book}[al]{2,2} \istb{Concert}[ar] \endist
6630 \xtPayoff(0-2){\strategicgame}[below,xshift=-7pt]
6631 \end{istgame}
6632 \end{doccode}
6633
6634
6635 %\clearpage
6636 \subsection{Larger game trees with information sets}
6637
6638 \begin{doccode}[text above listing]
6639 \begin{istgame}
6640 \xtShowEndPoints
6641 \xtdistance{10mm}{40mm}
6642 \istroot(0)[initial node]{1} \istb \istb \istb \endist
6643 \xtdistance{10mm}{10mm}
6644 \istroot(1)(0-1) \istb \istb \istb \endist
6645 \istroot(2)(0-2) \istb \istb \istb \endist
6646 \xtdistance{10mm}{20mm}
6647 \istroot(3)(0-3) \istb \istb \endist
6648 \xtdistance{10mm}{7mm}
6649 \istroot(a)(1-3){3} \istb \istb \istb \endist
6650 \xtdistance{10mm}{14mm}
6651 \istroot(b)(2-3) \istb \istb \endist
6652 \istroot(c)(3-1){2} \istb \istb \endist
6653 \istroot(d)(3-2){2} \istb \istb \endist
6654 \xtInfosetO[fill=red!20](0)(0)
6655 \xtInfoset(1)(2){2}
6656 \xtCInfosetO[fill=blue!20](a)(a)
6657 \setxtinfosetstyle{blue,thick,dashed}
6658 \xtInfosetO(b)(3){3}
6659 \setxtinfosetstyle % restore defaults
6660 \xtCInfosetO(d)(d)
6661 \end{istgame}
6662 \end{doccode}
6663
6664
6665 \begin{doccode}[text above listing]
6666 \begin{istgame}[scale=.8]
6667 \useasboundingbox (-7,-3) rectangle (7,.5);
6668 \xtdistance{10mm}{40mm}
6669 \istroot(0)[initial node]{1} \istb \istb \istb \istb \endist
6670 \xtdistance{10mm}{10mm}
6671 \istroot(1)(0-1) \istb \istb \istb \endist
6672 \istroot(2)(0-2) \istb \istb \istb \endist
6673 \xtdistance{10mm}{20mm}
6674 \istroot(3)(0-3) \istb \istb \endist
6675 \istroot(4)(0-4) \istb \istb \endist
6676 \xtdistance{10mm}{7mm}
6677 \istroot(a)(1-3) \istb \istb \istb \endist
6678 \istroot(b)(2-3) \istb \istb \endist
6679 \istroot(c)(3-1) \istb \istb \istb \endist
6680 \xtCInfosetO[fill=red!20](1)!.4!(3){2}
6681 \xtInfosetO(2)(2){1}[above]
6682 \setxtinfosetlayer{behind}
6683 \xtCInfoset[blue,thick,dashed](a)(c)<.85>{3}[below]
6684 \setxtinfosetlayer % restore default layer (behind)
6685 \xtCInfosetO[fill=blue!20](b)(4)<.7>{2}
6686 \end{istgame}
6687 \end{doccode}
6688
6689
6690 \subsection{A continuum of branches}
6691
6692 \begin{doccode}{.25}
6693 \begin{istgame}[font=\scriptsize]
6694 \cntmdistance*{8mm}{16mm}
6695 \cntmpreset*[dashed]{.7} % white triangle
6696 \istrootcntm(0)(0,0){1} \istb{x}[r] \endist
6697 \istroot(1)(0-1)<[label distance=-3pt]120>{2}
6698 \istb{Y}[al]{x,1-x} \istb{N}[ar] \endist
6699 \cntmpreset % restore defaults
6700 \istrootcntm(2)(1-2){2} \istb{y}[r] \istbm \endist
6701 \istroot(3)(2-1)<[label distance=-3pt]120>{1}
6702 \istb[]{Y}[al]{1-y,y} \istb{N}[ar] \endist
6703 \end{istgame}
6704 \end{doccode}
6705
6706 %\medskip
6707
6708 \begin{doccode}{.25}
6709 \begin{istgame}[font=\scriptsize]
6710 \cntmdistance*{8mm}{16mm}
6711 \istrootcntmA(0)(0,0){1} \istbA{x}[r] \endist
6712 \cntmAInfoset(0)
6713 \istroot(1)(0-1)<[label distance=-3pt]120>{2}
6714 \istb{Y}[al]{x,1-x} \istb{N}[ar] \endist
6715 \istrootcntmA(2)(1-2){2} \istbA{y}[r] \endist
6716 \cntmAInfosetO[fill=blue!20](2)
6717 \istroot(3)(2-1)<[label distance=-3pt]120>{1}
6718 \istb[]{Y}[al]{1-y,y} \istb{N}[ar] \endist
6719 \end{istgame}
6720 \end{doccode}
6721
6722
6723 \leavevmode
6724 \vfill
6725
6726 \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}}
6727
6728 \xbigskip1
6729
6730 \begin{doccode}{.4}
6731 \DeclareDocumentCommand\vpay{ m }
6732 {\begin{matrix} #1 \end{matrix}}
6733
6734 \begin{istgame}[scale=1.5,font=\scriptsize]
6735 \cntmApreset{.9}
6736 \cntmdistance{15mm}{20mm}
6737 \istrootcntmA(0)[null node]{1}
6738 \istbA(.977)[->,thick]{q_1}[r]
6739 \istbm
6740 \endist
6741 \cntmAInfosetO[thick,dashed](0)[-11](2em)
6742 \istrootcntmA(1)(0-1)[null node]<180>{2}
6743 \istbm
6744 \istbA(.977)[->,thick]{q_2}[r]
6745 {\vpay{\pi_1(q_1,q_2)\\\pi_2(q_1,q_2)}}
6746 \endist
6747 \end{istgame}
6748 \end{doccode}
6749
6750 \vfill
6751
6752 \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}}
6753
6754 \xbigskip1
6755
6756 \begin{doccode}{.4}
6757 \DeclareDocumentCommand\vpay{ m }
6758 {\begin{matrix} #1 \end{matrix}}
6759
6760 \begin{istgame}
6761 \xtdistance{15mm}{40mm}
6762 \cntmdistance{15mm}{30mm}
6763 \cntmApreset[draw=none]{1}[red!50,opacity=.2]
6764 \istroot(0){Challenger}
6765 \istb{In}[al] \istb{Out}[ar] \endist
6766 \cntmAistb[draw=none]
6767 \istrootcntmA(1)(0-1)<135>{Incumbent}
6768 \istbA{q_I}[left] \endist
6769 \cntmAInfosetO(1)
6770 \cntmAistb[draw=none]
6771 \istrootcntmA(2)(0-2)<45>{Incumbent}
6772 \istbA*{q_I}[left]
6773 {\vpay{\pi_C(0,q_I)\\\pi_I(0,q_I)}}
6774 \endist
6775 \cntmApreset[draw=none]{1}[blue!50,opacity=.2]
6776 \cntmAistb[draw=none]
6777 \istrootcntmA(3)(1-1)<180>{Challenger}
6778 \istbA*{q_C}[midway,left]
6779 {\vpay{\pi_C(q_C,q_I)\\ \pi_I(q_C,q_I)}}
6780 \endist
6781 \end{istgame}
6782 \end{doccode}
6783
6784 \vfill
6785
6786 \clearpage
6787 \subsection{Tic-tac-toe (sketch)}
6788
6789 % tic-tac-toe
6790 \begin{doccode}[text above listing]
6791 % tic-tac-toe (sketch)
6792 \begin{istgame}[scale=1.8,font=\tiny]
6793 \xtdistance{20mm}{7mm}
6794 \istroot(0) \istb \istb \istb \istb \istb \istb{\dots} \istb \istb \istb{9}[r] \endist
6795 \foreach \x in {1,...,4}
6796 {\xtActionLabel(0)(0-\x){\x}[l]}
6797 \xtdistance{10mm}{3mm}
6798 \istroot(a1)(0-1) \istb{2}[l] \istb \istb \istb \istb \istb \istb \istb{9}[r] \endist
6799 \istroot(a7)(0-7) \istb{1}[l] \istb \istb \istb \istb \istb \istb \istb{9}[r] \endist
6800 \xtdistance{10mm}{2mm}
6801 \istroot(A)(a1-3) \istb{2}[l] \istb \istb \istb \istb \istb \istb{9}[r] \endist
6802 \istroot(B)(a1-8) \istb{2}[l] \istb \istb \istb \istb \istb \istb{8}[r] \endist
6803 \istroot(C)(a7-8) \istb{1}[l] \istb \istb \istb \istb \istb \istb{8}[r] \endist
6804 \istroot(Bx)(B-7) \istb{2}[l] \istb \istb \istb \istb \istb{7}[r] \endist
6805 \istroot(By)(Bx-1) \istb{3}[l] \istb \istb \istb \istb{7}[r] \endist
6806 \istroot(Bz)(By-1) \istb{4}[l] \istb \istb \istb{7}[r] \endist
6807 \xtPayoff(Bz-4){\vdots} \xtPayoff(Bz-4){\cdots}[right,xshift=10pt]
6808 \end{istgame}
6809 \end{doccode}
6810
6811
6812 %\clearpage
6813 \subsection{Selten's horse}
6814
6815 \begin{doccode}{.4}
6816 % Selten's horse: IGT 331.2 (Osborne, 2004b)
6817 \begin{istgame}
6818 \xtdistance{8mm}{16mm}
6819 \istroot[-45](0)[initial node]{1}
6820 \istb{D}[r]
6821 \istb<grow=east,level distance=30mm>{C}[a]
6822 \endist
6823 \istroot(1)(0-1)+10mm..20mm+
6824 \istb{L}[al]{3,3,2}
6825 \istb{R}[ar]{0,0,0}
6826 \endist
6827 \istroot[-45](a)(0-2){2}
6828 \istb{d}[r]
6829 \istb<grow=0,level distance=20mm>{c}[a]{1,1,1}[r]
6830 \endist
6831 \istroot(a1)(a-1)+10mm..20mm+
6832 \istb{L}[al]{4,4,0}
6833 \istb{R}[ar]{0,0,1}
6834 \endist
6835 \xtInfoset(1)(a1){3}
6836 \end{istgame}
6837 \captionof{figure}{IGT 331.2}
6838 \end{doccode}
6839
6840
6841 \subsection{Centipede game}
6842
6843 \begin{doccode}[text above listing]
6844 % centipede
6845 \begin{istgame}[scale=1.5]
6846 \setistmathTF*001
6847 \setistgrowdirection{south east}
6848 \xtdistance{10mm}{20mm}
6849 \istroot(0)[initial node]{1}
6850 \istb{Take}[r]{(2,0)}[b] \istb{Pass}[a] \endist
6851 \istroot(1)(0-2){2}
6852 \istb{Take}[r]{(1,3)}[b] \istb{Pass}[a] \endist
6853 \istroot(2)(1-2){1}
6854 \istb{Take}[r]{(4,2)}[b] \istb{Pass}[a] \endist
6855 \xtInfoset(2-2)([xshift=5mm]2-2)
6856 %-------------
6857 \istroot(3)([xshift=5mm]2-2){2}
6858 \istb{Take}[r]{(97,99)}[b] \istb{Pass}[a] \endist
6859 \istroot(4)(3-2){1}
6860 \istb{Take}[r]{(100,98)}[b] \istb{Pass}[a] \endist
6861 \istroot(5)(4-2){2}
6862 \istb{Take}[r]{(99,101)}[b] \istb{Pass}[a]{(100,100)}[r] \endist
6863 \end{istgame}
6864 \end{doccode}
6865
6866
6867 %\clearpage
6868 \subsection{Poker game}
6869
6870 % poker
6871 \begin{doccode}[text above listing]
6872 % poker: growing south
6873 \begin{istgame}[scale=1.7]
6874 \setistmathTF*001
6875 \xtShowEndPoints
6876 \xtdistance{15mm}{30mm}
6877 \istroot(0)[chance node]{N}
6878 \istB{Black}[al]{$\frac12$}[br]
6879 \istB{Red}[ar]{$\frac12$}[bl]
6880 \endist
6881 \xtdistance{15mm}{30mm}
6882 \istroot(1-1)(0-1){1}
6883 \istbA(.5)<grow=-135>{Fold}[al]{1,-1}
6884 \istb{Raise}[ar]
6885 \endist
6886 \xtdistance{10mm}{20mm}
6887 \istroot(1)(1-1-2)
6888 \istb{Pass}[al]{1,-1}
6889 \istb{Meet}[ar]{2,-2}
6890 \endist
6891 \xtdistance{15mm}{30mm}
6892 \istroot(1-2)(0-2){1}
6893 \istbA(.5)<grow=-135>{Fold}[al]{-1,1}
6894 \istb{Raise}[ar]
6895 \endist
6896 \xtdistance{10mm}{20mm}
6897 \istroot(2)(1-2-2){}
6898 \istb{Pass}[al]{1,-1}
6899 \istb{Meet}[ar]{-2,2}
6900 \endist
6901 \xtInfoset(1)(2){2}
6902 \end{istgame}
6903 \end{doccode}
6904
6905
6906 \subsection{Poker game: growing to the right}
6907 \label{p:poker-right}
6908
6909 \begin{doccode}[text above listing]
6910 % poker: growing east -- counterclockwise
6911 \begin{istgame}[scale=1.3]
6912 \setistmathTF*001
6913 \setistgrowdirection{0} % default grow-direction is 'east' from now on
6914 \xtdistance{15mm}{30mm}
6915 \istroot(0)[chance node]<left>{N}
6916 \istB{Black}[bl]{$\frac12$}[ar]
6917 \istB{Red}[al]{$ \frac12$}[br]
6918 \endist
6919 \xtdistance{15mm}{30mm}
6920 \istroot(1-1)(0-1)<left>{1}
6921 \istb<grow=-45,level distance=10mm>{Fold}[bl]{1,-1}
6922 \istb{Raise}[al]
6923 \endist
6924 \xtdistance{12mm}{24mm}
6925 \istroot(1)(1-1-2)
6926 \istb{Pass}[bl]{1,-1}
6927 \istb{Meet}[al]{2,-2}
6928 \endist
6929 \xtdistance{15mm}{30mm}
6930 \istroot(1-2)(0-2)<left>{1}
6931 \istb<grow=-45,level distance=10mm>{Fold}[bl]{-1,1}[[xshift=5pt]below]
6932 \istb{Raise}[al]
6933 \endist
6934 \xtdistance{12mm}{24mm}
6935 \istroot(2)(1-2-2)
6936 \istb{Pass}[bl]{1,-1}
6937 \istb{Meet}[al]{-2,2}
6938 \endist
6939 \xtCInfosetO[fill=blue!20](1-1-2)(1-2-2){2}
6940 \end{istgame}
6941 \end{doccode}
6942
6943 \begin{doccode}[text above listing]
6944 % poker: growing east -- clockwise (swap version)
6945 \begin{istgame}[scale=1.3]
6946 \setistmathTF*001
6947 \setistgrowdirection'{0} % \setistgrowdirection'
6948 \xtdistance{15mm}{30mm}
6949 \istroot(0)[chance node]<left>{N}
6950 \istB{Black}[al]{$\frac12$}[br]
6951 \istB{Red}[bl]{$\frac12$}[ar]
6952 \endist
6953 \xtdistance{15mm}{30mm}
6954 \istroot(1-1)(0-1)<left>{1}
6955 \istb<grow=45,level distance=10mm>{Fold}[al]{1,-1}
6956 \istb{Raise}[bl]
6957 \endist
6958 \xtdistance{12mm}{24mm}
6959 \istroot(1)(1-1-2)
6960 \istb{Pass}[al]{1,-1}
6961 \istb{Meet}[bl]{2,-2}
6962 \endist
6963 \xtdistance{15mm}{30mm}
6964 \istroot(1-2)(0-2)<left>{1}
6965 \istb<grow=45,level distance=10mm>{Fold}[al]{-1,1}
6966 \istb{Raise}[bl]
6967 \endist
6968 \xtdistance{12mm}{24mm}
6969 \istroot(2)(1-2-2)
6970 \istb{Pass}[al]{1,-1}
6971 \istb{Meet}[bl]{-2,2}
6972 \endist
6973 \xtInfosetO[fill=red!20](1-1-2)(1-2-2){2}
6974 \end{istgame}
6975 \end{doccode}
6976
6977 \subsection{Signaling games}
6978
6979 \begin{doccode}[text above listing,halign lower=center]
6980 % signaling game: IGT 337.1 (Osborne, 2004b)
6981 \begin{istgame}
6982 \setistgrowdirection'{right}
6983 % game start: choice of chance
6984 \xtdistance{20mm}{20mm}
6985 \istroot(0)[chance node]<180>{Chance}
6986 \istB<grow=north>{H}[l]{\pi}[r] \istB<grow=south>{L}[l]{1-\pi}[r] \endist
6987 \istroot(H0)(0-1)<180>{F}
6988 \istb{(p_1,E)}[a] \endist
6989 \istroot(L0)(0-2)<180>{F}
6990 \istb{(p_1,E)}[a] \endist
6991 \setistmathTF*001
6992 \cntmdistance*{10mm}{20mm}{8mm}
6993 % subtree after H is chosen
6994 \istroot(H)(H0-1)
6995 \istb{Buy}[br] \istb{Refrain}[ar]{-E,0} \endist
6996 \istrootcntm(H1)(H-1)<[label distance=-3pt]135>{F}
6997 \istb{$p_2^H$}[b] \istbm \endist
6998 \istroot(CH)(H1-1)<[label distance=-4pt]135>{C}
6999 \istb{Buy}[br]{p_1-E-c_H+p_2^H-c_H, 2H-p_1-p_2^H}
7000 \istb{Refrain}[ar]{p_1-E-c_H, H-p_1}
7001 \endist
7002 % subtree after L is chosen
7003 \istroot(L)(L0-1)
7004 \istb{Buy}[br] \istb{Refrain}[ar]{-E,0} \endist
7005 \istrootcntm(L1)(L-1)<[label distance=-3pt]135>{F}
7006 \istbm \istb{$p_2^L$}[a] \endist
7007 \istroot(CL)(L1-2)<[label distance=-4pt]-135>{C}
7008 \istb{Buy}[br]{p_1-E-c_L+p_2^L-c_L, 2L-p_1-p_2^L}
7009 \istb{Refrain}[ar]{p_1-E-c_L, L-p_1}
7010 \endist
7011 \xtInfoset(H)(L){C}[left]
7012 \end{istgame}
7013 \end{doccode}
7014
7015 \xbigskip2
7016
7017 \begin{doccode}{.5}
7018 % signaling game
7019 \begin{istgame}[scale=1.3]
7020 \xtdistance{20mm}{20mm}
7021 \istroot(0)[chance node]{$c$}
7022 \istb<grow=left>{\frac12}[a]
7023 \istb<grow=right>{\frac12}[a]
7024 \endist
7025 \xtdistance{10mm}{20mm}
7026 \istroot(1)(0-1)<180>{1}
7027 \istb<grow=north>{a}[l]
7028 \istb<grow=south>{b}[l]
7029 \endist
7030 \istroot(2)(0-2)<0>{1}
7031 \istb<grow=north>{a}[r]
7032 \istb<grow=south>{b}[r]
7033 \endist
7034 \istroot'[north](a1)(1-1)
7035 \istb{L}[bl]{-1,0}
7036 \istb{R}[br]{0,-1}
7037 \endist
7038 \istroot(b1)(1-2)
7039 \istb{L}[al]{2,0}
7040 \istb{R}[ar]{0,2}
7041 \endist
7042 \istroot(a2)(2-2)
7043 \istb{L}[al]{3,0}
7044 \istb{R}[ar]{0,3}
7045 \endist
7046 \istroot'[north](b2)(2-1)
7047 \istb{L}[bl]{1,0}
7048 \istb{R}[br]{0,1}
7049 \endist
7050 \xtInfoset(a1)(b2){2}
7051 \xtInfoset(b1)(a2){2}
7052 \end{istgame}
7053 \end{doccode}
7054
7055
7056
7057 \clearpage
7058 \section{Selected examples from \texttt{tex.stackexchange.com}}
7059
7060 In this section |\setistgamefontsize{|\cmd{\normalsize}|}|.
7061 \setistgamefontsize{\normalsize}
7062
7063 \subsection{Subgames: \protect\CMD{\xtSubgameBox}}
7064
7065 \vfill
7066
7067 \href{https://tex.stackexchange.com/questions/482883/game-theory-subgame-box/488559#488559}{\sourcelink{game-theory-subgame-box}}
7068
7069 \vfill
7070
7071 \begin{doccode}[text above listing]
7072 \begin{istgame}
7073 \xtShowEndPoints
7074 \xtdistance{25mm}{70mm}
7075 \istrooto(0){Firm 1}
7076 \istb{BIG}[al] \istb{small}[ar] \endist
7077 \xtdistance{25mm}{35mm}
7078 \istrooto(1)(0-1){Firm 2}
7079 \istb{Low}[al] \istb{High}[ar] \endist
7080 \istrooto(2)(0-2){Firm 2} \istb{low}[al] \istb{high}[ar] \endist
7081 \xtdistance{20mm}{10mm}
7082 \istrooto(a)(1-1){Firm 1}
7083 \istb{L}[l]{\parbox{1em}{$u_1$\\$u_2$}} \istb{H}[r] \endist
7084 \istrooto(b)(1-2){Firm 1}
7085 \istb{L}[l] \istb{H}[r] \endist
7086 \istrooto(c)(2-1){Firm 1}
7087 \istb{l}[l] \istb{h}[r] \endist
7088 \istrooto(d)(2-2){Firm 1}
7089 \istb{l}[l] \istb{h}[r] \endist
7090 \setxtinfosetstyle{dashed}
7091 \xtInfoset(a)(b)
7092 \xtInfoset(c)(d)
7093 \xtSubgameBox([yshift=-2ex]1){(a-1)(b-2)}[inner ysep=7ex]
7094 \xtSubgameBox([yshift=-2ex]2){(c-1)(d-2)}[inner ysep=7ex]
7095 \end{istgame}
7096 \end{doccode}
7097
7098 \vfill
7099
7100 \clearpage
7101 \subsection{Information sets: \protect\CMD{\xtInfosetO}, \protect\CMD{\xtCInfosetO}, and \protect\CMD{\cntmAInfosetO}}
7102
7103 \vfill
7104
7105 \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}}
7106
7107 \vfill
7108
7109 \begin{doccode}[text above listing]
7110 \begin{istgame}[scale=1.2]
7111 \setistgrowdirection'{east}
7112 \tikzset{oval node/.style={ellipse node,draw=none}}
7113 \tikzset{move/.style={red,fill=white}}
7114 \xtdistance{25mm}{25mm}
7115 \istroot(0)[null node]<180>{1}+25mm..40mm+
7116 \istb{1}[move] \istb{2}[move] \endist
7117 \istrooto(1)(0-1){2}
7118 \istb{1}[move] \istb{2}[move] \endist
7119 \istrooto(2)(0-2){2}
7120 \istb{1}[move] \istb{2}[move]{(-1,1)} \endist
7121 \istrooto(3)(1-1){1}
7122 \istb{1}[move] \istb{2}[move]{(-1,1)} \endist
7123 \istrooto(4)(1-2){1}
7124 \istb{1}[move]{(-1,1)} \endist
7125 \istrooto(5)(2-1){1}
7126 \istb{1}[move]{(-1,1)} \endist
7127 \istrooto(6)(3-1){2}
7128 \istb{1}[move]{(-1,1)} \endist
7129 \setxtinfosetlayer{main}
7130 \xtInfosetO[dashed,thick](3)(4)(1.5em)
7131 \xtInfosetO[ellipse,dashed,thick](2)(5)(2em)
7132 \end{istgame}
7133 \end{doccode}
7134
7135 \vfill
7136
7137 \clearpage
7138 \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}}
7139
7140 \begin{doccode}[text above listing]
7141 \begin{istgame}[scale=.55,font=\footnotesize]
7142 \setistmathTF*001
7143 % top part
7144 \xtdistance{25mm}{120mm}
7145 \istroot(0)[chance node]{Nature} \istb \istb \endist
7146 \xtdistance{25mm}{50mm}
7147 \istroot(A)(0-1) \istb \endist
7148 \istroot(B)(0-2) \istb \endist
7149 % left part
7150 \xtdistance{25mm}{60mm}
7151 \istroot(A0)(A-1)<180>{2} \istb \istb \endist
7152 \xtdistance{25mm}{30mm}
7153 \istroot(A1)(A0-1) \istb \istb \endist
7154 \istroot(A2)(A0-2) \istb \istb \endist
7155 \xtdistance{25mm}{15mm}
7156 \istroot(A3)(A1-1)<180>{2} \istb{G}[l] \istb{S}[r] \endist
7157 \istroot(A4)(A1-2)<180>{2} \istb{G}[l] \istb{S}[r] \endist
7158 \istroot(A5)(A2-1)<180>{2} \istb{G}[l] \istb{S}[r] \endist
7159 \istroot(A6)(A2-2)<180>{2} \istb{G}[l] \istb{S}[r] \endist
7160 % right part
7161 \xtdistance{25mm}{60mm}
7162 \istroot(B0)(B-1)<180>{2} \istb \istb \endist
7163 \xtdistance{25mm}{30mm}
7164 \istroot(B1)(B0-1) \istb \istb \endist
7165 \istroot(B2)(B0-2) \istb \istb \endist
7166 \xtdistance{25mm}{15mm}
7167 \istroot(B3)(B1-1)<180>{2} \istb{G}[l] \istb{S}[r] \endist
7168 \istroot(B4)(B1-2)<180>{2} \istb{G}[l] \istb{S}[r] \endist
7169 \istroot(B5)(B2-1)<180>{2} \istb{G}[l] \istb{S}[r] \endist
7170 \istroot(B6)(B2-2)<180>{2} \istb{G}[l] \istb{S}[r] \endist
7171 % information sets
7172 \setxtinfosetstyle{dashed}
7173 \xtInfosetO[fill=black!15](A)(B){1}
7174 \xtCInfosetO[blue,fill=blue!15](A1)!.35!(B1)<1.15>{1}
7175 \xtCInfosetO[red,fill=red!15](A2)!.5!(B2)<.75>{1}
7176 \end{istgame}
7177 \end{doccode}
7178
7179
7180 \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}}
7181
7182 \vfill
7183
7184 %\begin{doccode}[text only]
7185 \begin{istgame}[scale=1.5]
7186 \setistgrowdirection'{east}
7187 %% root
7188 \xtdistance{20mm}{32mm}
7189 \istroot(0)[chance node]{0}
7190 \istb \istb \istb \istb \endist
7191 %% extending branches
7192 \istroot(0a)(0-1)[null node]
7193 \istb{\frac13(TL)}[above,near start] \endist
7194 \istroot(0b)(0-2)[null node]
7195 \istb{\frac13(BL)}[above,near start] \endist
7196 \istroot(0c)(0-3)[null node]
7197 \istb{\frac13(TR)}[below,near start] \endist
7198 \istroot(0d)(0-4)[null node]
7199 \istb{0(BR)}[below,near start] \endist
7200 %\xtShowEndPoints
7201 %% player I
7202 \xtdistance{15mm}{16mm}
7203 \istroot(1a)(0a-1)
7204 \istb{T_1}[a] \istb{B_1}[b] \endist
7205 \istroot(1b)(0b-1)
7206 \istb{T_2}[a] \istb{B_2}[b] \endist
7207 \istroot(1c)(0c-1)
7208 \istb{T_1}[a] \istb{B_1}[b] \endist
7209 \istroot(1d)(0d-1)
7210 \istb{T_2}[a] \istb{B_2}[b] \endist
7211 \xtdistance{15mm}{8mm}
7212 %% player II
7213 \istroot(2Aa)(1a-1)
7214 \istb{L_1}[a]{6,6} \istb{R_1}[b]{2,7} \endist
7215 \istroot(2Ab)(1a-2)
7216 \istb{L_1}[a]{7,2} \istb{R_1}[b]{0,0} \endist
7217 \istroot(2Ac)(1b-1)
7218 \istb{L_1}[a]{6,6} \istb{R_1}[b]{2,7} \endist
7219 \istroot(2Ad)(1b-2)
7220 \istb{L_1}[a]{7,2} \istb{R_1}[b]{0,0} \endist
7221 \istroot(2Ba)(1c-1)
7222 \istb{L_2}[a]{6,6} \istb{R_2}[b]{2,7} \endist
7223 \istroot(2Bb)(1c-2)
7224 \istb{L_2}[a]{7,2} \istb{R_2}[b]{0,0} \endist
7225 \istroot(2Bc)(1d-1)
7226 \istb{L_2}[a]{6,6} \istb{R_2}[b]{2,7} \endist
7227 \istroot(2Bd)(1d-2)
7228 \istb{L_2}[a]{7,2} \istb{R_2}[b]{0,0} \endist
7229 % information sets
7230 \xtInfosetO(0)(0)
7231 \xtCInfosetO[fill=red!20,fill opacity=.3](1a)!.4!(1c)<1.2>{I}
7232 \xtCInfosetO[fill=blue!20,fill opacity=.3](1b)!.6!(1d)<1.15>{I}
7233 \xtInfosetO(2Aa)(2Ad){II}
7234 \xtInfosetO(2Ba)(2Bd){II}
7235
7236 \end{istgame}
7237 %\end{doccode}
7238
7239 \vfill
7240
7241 \clearpage
7242
7243 \leavevmode
7244 \vfill
7245
7246 \begin{doccode}[listing only]
7247 \begin{istgame}[scale=1.5]
7248 \setistgrowdirection'{east}
7249 %% root
7250 \xtdistance{20mm}{32mm}
7251 \istroot(0)[chance node]{0}
7252 \istb \istb \istb \istb \endist
7253 %% extending branches
7254 \istroot(0a)(0-1)[null node]
7255 \istb{\frac13(TL)}[above,near start] \endist
7256 \istroot(0b)(0-2)[null node]
7257 \istb{\frac13(BL)}[above,near start] \endist
7258 \istroot(0c)(0-3)[null node]
7259 \istb{\frac13(TR)}[below,near start] \endist
7260 \istroot(0d)(0-4)[null node]
7261 \istb{0(BR)}[below,near start] \endist
7262 %\xtShowEndPoints
7263 %% player I
7264 \xtdistance{15mm}{16mm}
7265 \istroot(1a)(0a-1)
7266 \istb{T_1}[a] \istb{B_1}[b] \endist
7267 \istroot(1b)(0b-1)
7268 \istb{T_2}[a] \istb{B_2}[b] \endist
7269 \istroot(1c)(0c-1)
7270 \istb{T_1}[a] \istb{B_1}[b] \endist
7271 \istroot(1d)(0d-1)
7272 \istb{T_2}[a] \istb{B_2}[b] \endist
7273 \xtdistance{15mm}{8mm}
7274 %% player II
7275 \istroot(2Aa)(1a-1)
7276 \istb{L_1}[a]{6,6} \istb{R_1}[b]{2,7} \endist
7277 \istroot(2Ab)(1a-2)
7278 \istb{L_1}[a]{7,2} \istb{R_1}[b]{0,0} \endist
7279 \istroot(2Ac)(1b-1)
7280 \istb{L_1}[a]{6,6} \istb{R_1}[b]{2,7} \endist
7281 \istroot(2Ad)(1b-2)
7282 \istb{L_1}[a]{7,2} \istb{R_1}[b]{0,0} \endist
7283 \istroot(2Ba)(1c-1)
7284 \istb{L_2}[a]{6,6} \istb{R_2}[b]{2,7} \endist
7285 \istroot(2Bb)(1c-2)
7286 \istb{L_2}[a]{7,2} \istb{R_2}[b]{0,0} \endist
7287 \istroot(2Bc)(1d-1)
7288 \istb{L_2}[a]{6,6} \istb{R_2}[b]{2,7} \endist
7289 \istroot(2Bd)(1d-2)
7290 \istb{L_2}[a]{7,2} \istb{R_2}[b]{0,0} \endist
7291 % information sets
7292 \xtInfosetO(0)(0)
7293 \xtCInfosetO[fill=red!20,fill opacity=.3](1a)!.4!(1c)<1.2>{I}
7294 \xtCInfosetO[fill=blue!20,fill opacity=.3](1b)!.6!(1d)<1.15>{I}
7295 \xtInfosetO(2Aa)(2Ad){II}
7296 \xtInfosetO(2Ba)(2Bd){II}
7297
7298 \end{istgame}
7299 \end{doccode}
7300
7301 \vfill
7302 \vfill
7303 \vfill
7304
7305 \clearpage
7306
7307 \subsection{Continuum of moves: \protect\CMD{\istrootcntm} and \protect\CMD{\istrootcntmA}}
7308
7309 \leavevmode
7310 \vfill
7311
7312 \href{https://tex.stackexchange.com/questions/468397/draw-tree-in-tikz/468703#468703}{\sourcelink{draw-tree-in-tikz}}
7313
7314 \vfill
7315
7316 \begin{doccode}[text above listing]
7317 \begin{istgame}[scale=.8,font=\scriptsize]
7318 % presets
7319 \tikzset{odd node/.style={decision node,minimum size=6pt}}
7320 \tikzset{even node/.style={oval node,fill=cyan!50,minimum size=6pt}}
7321 % game tree
7322 \cntmdistance*{20mm}{35mm}
7323 \cntmpreset*[densely dashed]{.6}
7324 \istrootcntm(1a)[odd node]<15>{$x_1$}
7325 \istb{(a^0,1-a^0)}[right,near end] \endist
7326 \istroot(2)(1a-1)[even node]<-90>{$x_2$}
7327 \istb{acc}[al]{\left(a^0,1-a^0\right)}
7328 \istb{not}[ar]
7329 \endist
7330 \istrootcntm(2a)(2-2)[even node]<0>{$x_3$}
7331 \istb{(a^1,1-a^1)}[right,near end] \endist
7332 \istroot(3)(2a-1)[odd node]<-90>{$x_4$}
7333 \istb{acc}[al]{\left(\delta_1 a^1,\delta_2(1-a^1)\right)}
7334 \istb{not}[ar]
7335 \endist
7336 \istrootcntm(3a)(3-2)[odd node]<0>{$x_5$}
7337 \istb{(a^2,1-a^2)}[right,near end] \endist
7338 \istroot(4)(3a-1)[even node]<-90>{$x_6$}
7339 \istb{acc}[al]{\left((\delta_1)^2a^2,(\delta_2)^2(1-a^2)\right)}
7340 \istb{not}[ar]{(0,0)}
7341 \endist
7342 \end{istgame}
7343 \end{doccode}
7344
7345 \vfill
7346
7347 \clearpage
7348
7349 \vfill
7350
7351 \href{https://tex.stackexchange.com/questions/594222/tikz-game-tree-help-drawing/594552#594552}{\sourcelink{tikz-game-tree-help-drawing}}
7352
7353 \vfill
7354
7355 \begin{doccode}[text above listing]
7356 \begin{istgame}[scale=1.3]
7357 % nodes
7358 \tikzset{p1/.style={oval node,minimum size=3pt}}
7359 \tikzset{p2/.style={oval node,fill=black,minimum size=3pt}}
7360 % tree
7361 \xtdistance{20mm}{45mm}
7362 \cntmdistance{10mm}{20mm}
7363 \istroot(1)[p1] \istb \istb \endist
7364 \istrootcntmA(2a)(1-1)[p2] \istbA[draw=none] \endist
7365 \istrootcntmA(2b)(1-2)[p2] \istbA[draw=none] \endist
7366 \xtdistance{15mm}{30mm}
7367 \istroot(1a)(2a-1)[p1] \istb \istb \endist
7368 \istroot(1b)(2b-1)[p1] \istb \endist
7369 \istrootcntmA(2c)(1a-1)[p2] \istbA[draw=none] \endist
7370 \istrootcntmA(2d)(1a-2)[p2] \istbA[draw=none] \endist
7371 \istrootcntmA(2e)(1b-1)[p2] \istbA[draw=none] \endist
7372 \istroot(1c)(2c-1)[p1] \istb \endist
7373 \istroot(1d)(2d-1)[p1] \istb \endist
7374 \istroot(1e)(2e-1)[p1] \istb \endist
7375 % information sets
7376 \xtInfosetO[solid,thin,fill=blue!10](2a)(2b)
7377 \xtInfosetO[solid,thin,fill=blue!10](2d)(2e)
7378 \end{istgame}
7379 \end{doccode}
7380
7381 \vfill
7382
7383 \clearpage
7384
7385 \vfill
7386
7387 \href{https://tex.stackexchange.com/questions/203052/a-gametree-with-variable-choices/472415#472415}{\sourcelink{a-gametree-with-variable-choices}}
7388
7389 \vfill
7390
7391 \begin{doccode}[text above listing]
7392 \begin{istgame}[scale=1.3,semithick]
7393 \tikzset{oval node/.style={box node,draw=none,minimum size=5mm}}
7394 \cntmdistance*{20mm}{25mm}
7395 \istrooto(0)[plain node]{Firm 1}+15mm..50mm+
7396 \istb \istb \endist
7397 \setistmathTF111
7398 \cntmApreset[dashed,thick]{.6}
7399 \istrootocntmA(E2)(0-1){E_2} \istb[thin] \endist
7400 \xtNode*(cntm-1){0} \xtNode*(cntm-2){\infty}
7401 \istrootocntmA(E3)(0-2){E_3} \istb[thin] \endist
7402 \xtNode*(cntm-1){0} \xtNode*(cntm-2){\infty}
7403 \istrootocntmA(11)(E2-1){q_1} \istb[thin] \endist
7404 \xtNode*(cntm-1){0} \xtNode*(cntm-2){\infty}
7405 \istrootocntmA(21)(E3-1){q_1} \istb[thin] \endist
7406 \xtNode*(cntm-1){0} \xtNode*(cntm-2){\infty}
7407 \istrooto(3a)(11-1){q_2} \istb[thin] \endist
7408 \xtNode*(3a-1){\big(\prod\big)_1^{c_2}\prod_2^c\prod_3^m}
7409 \istrooto(3b)(21-1){q_3} \istb[thin] \endist
7410 \xtNode*(3b-1){\big(\prod\big)_1^{c_3}\prod_2^m\prod_3^c}
7411 \end{istgame}
7412 \end{doccode}
7413
7414
7415 \vfill
7416
7417 \clearpage
7418
7419
7420
7421 \subsection{Signaling games}
7422
7423 \leavevmode
7424 \vfill
7425
7426 \href{https://tex.stackexchange.com/questions/594771/how-draw-this-game-in-tikz/610845#610845}{\sourcelink{how-draw-this-game-in-tikz}}
7427
7428 \vfill
7429
7430 \begin{doccode}[text above listing]
7431 \begin{istgame}
7432 \setistNewNodeStyle{solid node}[null node]
7433 \setistmathTF001
7434 \setxtshowarrows[thick]
7435 \xtShowArrows
7436 \xtHideEndPoints
7437 % game start
7438 \setistgrowdirection'{east}
7439 \xtdistance{10mm}{40mm}
7440 \istroot(0)[chance node]<[xshift=2mm]200>{Nature}
7441 \istb{[.5]1}[l] \istb{[.5]2}[l] \endist
7442 % right part
7443 \xtdistance{30mm}{20mm}
7444 \istroot(Ra)(0-1)<-45>{$x_1$} \istb{Average}[a] \endist
7445 \istroot(Rb)(0-2)<45>{$x_2$} \istb{Average}[b] \endist
7446 \xtdistance{20mm}{20mm}
7447 \istroot(T1a)(Ra-1)<-135>{$x_3$}
7448 \istb{Hunk}[above,sloped]{2,3} \istb{Average}[below,sloped]{2,2} \endist
7449 \istroot(T1b)(Rb-1)<135>{$x_4$}
7450 \istb{Hunk}[above,sloped]{2,3} \istb{Average}[below,sloped]{2,2} \endist
7451 \xtInfoset[dashed](0-1)(0-2){$h_G$}[l]
7452 \xtInfosetOwner(0-1)(0-2){Gina}[r]
7453 \xtInfoset[dashed](T1a)(T1b){$h_{T1}$}[l]
7454 \xtInfosetOwner(T1a)(T1b){Tina}[r]
7455 % left part
7456 \setistgrowdirection{west}
7457 \xtdistance{30mm}{20mm}
7458 \istroot(La)(0-1) \istb{Hunk}[a] \endist
7459 \istroot(Lb)(0-2) \istb{Hunk}[b] \endist
7460 \xtdistance{20mm}{20mm}
7461 \istroot(T2a)(La-1)<-45>{$x_5$}
7462 \istb{Hunk}[above,sloped]{3,0} \istb{Average}[below,sloped]{3,2} \endist
7463 \istroot(T2b)(Lb-1)<45>{$x_6$}
7464 \istb{Hunk}[above,sloped]{0,3} \istb{Average}[below,sloped]{3,2} \endist
7465 % information set
7466 \xtInfoset[dashed](T2a)(T2b){$h_{T2}$}[r]
7467 \xtInfosetOwner(T2a)(T2b){Tina}[l]
7468 \end{istgame}
7469 \end{doccode}
7470
7471 \vfill
7472
7473 \clearpage
7474
7475 \subsection{Cross out nodes}
7476
7477 \leavevmode
7478 \vfill
7479
7480 \href{https://tex.stackexchange.com/questions/374600/problem-with-dashed-edges-and-cross-nodes/402407#402407}{\sourcelink{problem-with-dashed-edges-and-cross-nodes}}
7481
7482 \vfill
7483
7484 \begin{doccode}[text above listing]
7485 \begin{istgame}
7486 \setistNewNodeStyle{cross node}[cross out,ultra thick]{4pt}
7487 \xtdistance{15mm}{55mm}
7488 \istroot(1a){1.1}
7489 \istb{L_1}[al] \istb{R_1}[ar] \endist
7490 \xtdistance{15mm}{27mm}
7491 \istroot(2a)(1a-1)<135>{2.1}
7492 \istb[dashdotted]{l_1}[l] \istb{r_1}[r] \endist
7493 \istroot(2b)(1a-2)<45>{2.2}
7494 \istb{l_2}[l] \istb*{r_1}[r] \endist
7495 \xtdistance{15mm}{17mm}
7496 \istroot(1b)(2a-1)[cross node]<135>{1.2}
7497 \istb[dashdotted]{L_2}[l] \istb*[dashdotted]{R_2}[r] \endist
7498 \istroot(1c)(2a-2)<45>{1.3}
7499 \istb{L_3}[l] \istb{R_3}[r] \endist
7500 \istroot(1d)(2b-1)<135>{1.4}
7501 \istb*{L_4}[l] \istb{R_4}[r] \endist
7502 \xtShowEndPoints
7503 \xtdistance{18mm}{10mm}
7504 \istroot(2c)(1b-1)[cross node]<135>{2.3}
7505 \istb[dashdotted]{l_3}[l] \istb[dashdotted]{r_3}[r] \endist
7506 \istroot(2d)(1c-1)<135>{2.4}
7507 \istb{l_4}[l] \istb{r_4}[r] \endist
7508 \istroot(2e)(1c-2)<45>{2.5}
7509 \istb{l_5}[l] \istb{r_5}[r] \endist
7510 \istroot(2f)(1d-2)<45>{2.6}
7511 \istb{l_6}[l] \istb{r_6}[r] \endist
7512 \end{istgame}
7513 \end{doccode}
7514
7515 \vfill
7516
7517 \clearpage
7518
7519 \subsection{Large game trees}
7520
7521 %\leavevmode
7522 \vfill
7523
7524 \href{https://tex.stackexchange.com/questions/482040/game-theory-trees-solid-node-size/482610#482610}{\sourcelink{game-theory-trees-solid-node-siz}}
7525
7526 \vfill
7527 \vfill
7528 \vfill
7529
7530 %\begin{doccode}[text above listing]
7531 \def\vpay#1#2{\begin{matrix}#1\\#2\end{matrix}}
7532
7533 \begin{istgame}[scale=.8,font=\footnotesize]
7534 \xtShowEndPoints % solid nodes
7535 \setistEllipseNodeStyle{6mm} % minimum circle size for players
7536 \xtdistance{30mm}{30mm}
7537 \istrooto(0){Nature}
7538 \istB{JQK}[l]{p_1}[left,near start,xshift=-5pt]
7539 \istB{JKQ}[l]{p}[left,near start]
7540 \istB{QJK}[l]{p}[left,near start]
7541 \istB{QJK}[r]{p}[right,near start]
7542 \istB{KJQ}[r]{p}[right,near start,xshift=5pt]
7543 \istB{KQJ}[r]{p}[right,near start,xshift=5pt]
7544 \endist
7545 \xtdistance{25mm}{10mm}
7546 \istrooto(1)(0-1){$P_1$}
7547 \istb{c}[l]{\vpay{-1}{1}} \istb<grow=-70,level distance=90mm>{r}[r] \endist
7548 \istrooto(2)(0-2){$P_1$}
7549 \istb{c}[l]{\vpay{-1}{1}} \istb{r}[r] \endist
7550 \istrooto(3)(0-3){$P_1$}
7551 \istb{r}[l] \istb{c}[r]{\vpay{-1}{1}} \endist
7552 \istrooto(4)(0-4){$P_1$}
7553 \istb{c}[l]{\vpay{1}{-1}} \istb{r}[r] \endist
7554 \istrooto(5)(0-5){$P_1$}
7555 \istb{r}[l] \istb{c}[r]{\vpay{1}{-1}} \endist
7556 \istrooto(6)(0-6){$P_1$}
7557 \istb<grow=-110,level distance=90mm>{r}[l] \istb{c}[r]{\vpay{1}{-1}} \endist
7558 \xtdistance{20mm}{10mm}
7559 \istrooto(a)(2-2){$P_2$}
7560 \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{-2}{2}} \endist
7561 \istrooto(b)(3-1){$P_2$}
7562 \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{-2}{2}} \endist
7563 \istrooto(c)(4-2){$P_2$}
7564 \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{2}{-2}} \endist
7565 \istrooto(d)(5-1){$P_2$}
7566 \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{2}{-2}} \endist
7567 \xtdistance{28mm}{25mm}
7568 \istrooto(A)(1-2){$P_2$}
7569 \istb[draw=red]{f}[l]{\vpay{1}{-1}} \istb[draw=blue]{c}[r]{\vpay{-2}{2}} \endist
7570 \istrooto(B)(6-1){$P_2$}
7571 \istb[double]{r}[l]{\vpay{1}{-1}} \istb[ultra thick]{c}[r]{\vpay{2}{-2}} \endist
7572 % information sets
7573 \setxtinfosetstyle{dashed}
7574 \xtInfoset(1)(2)
7575 \xtInfoset(3)(4)
7576 \xtInfoset(5)(6)
7577 \xtInfoset(a)(b)
7578 \xtInfoset(c)(d)
7579 \xtInfoset(A)(B)
7580 \end{istgame}
7581 %\end{doccode}
7582
7583 \vfill
7584 \vfill
7585 \vfill
7586
7587 \clearpage
7588
7589 \leavevmode
7590 \vfill
7591
7592 \begin{doccode}[listing only]
7593 \def\vpay#1#2{\begin{matrix}#1\\#2\end{matrix}}
7594
7595 \begin{istgame}[scale=.8,font=\footnotesize]
7596 \xtShowEndPoints % solid nodes
7597 \setistEllipseNodeStyle{6mm} % minimum circle size for players
7598 \xtdistance{30mm}{30mm}
7599 \istrooto(0){Nature}
7600 \istB{JQK}[l]{p_1}[left,near start,xshift=-5pt]
7601 \istB{JKQ}[l]{p}[left,near start]
7602 \istB{QJK}[l]{p}[left,near start]
7603 \istB{QJK}[r]{p}[right,near start]
7604 \istB{KJQ}[r]{p}[right,near start,xshift=5pt]
7605 \istB{KQJ}[r]{p}[right,near start,xshift=5pt]
7606 \endist
7607 \xtdistance{25mm}{10mm}
7608 \istrooto(1)(0-1){$P_1$}
7609 \istb{c}[l]{\vpay{-1}{1}} \istb<grow=-70,level distance=90mm>{r}[r] \endist
7610 \istrooto(2)(0-2){$P_1$}
7611 \istb{c}[l]{\vpay{-1}{1}} \istb{r}[r] \endist
7612 \istrooto(3)(0-3){$P_1$}
7613 \istb{r}[l] \istb{c}[r]{\vpay{-1}{1}} \endist
7614 \istrooto(4)(0-4){$P_1$}
7615 \istb{c}[l]{\vpay{1}{-1}} \istb{r}[r] \endist
7616 \istrooto(5)(0-5){$P_1$}
7617 \istb{r}[l] \istb{c}[r]{\vpay{1}{-1}} \endist
7618 \istrooto(6)(0-6){$P_1$}
7619 \istb<grow=-110,level distance=90mm>{r}[l] \istb{c}[r]{\vpay{1}{-1}} \endist
7620 \xtdistance{20mm}{10mm}
7621 \istrooto(a)(2-2){$P_2$}
7622 \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{-2}{2}} \endist
7623 \istrooto(b)(3-1){$P_2$}
7624 \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{-2}{2}} \endist
7625 \istrooto(c)(4-2){$P_2$}
7626 \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{2}{-2}} \endist
7627 \istrooto(d)(5-1){$P_2$}
7628 \istb{f}[l]{\vpay{1}{-1}} \istb{c}[r]{\vpay{2}{-2}} \endist
7629 \xtdistance{28mm}{25mm}
7630 \istrooto(A)(1-2){$P_2$}
7631 \istb[draw=red]{f}[l]{\vpay{1}{-1}} \istb[draw=blue]{c}[r]{\vpay{-2}{2}} \endist
7632 \istrooto(B)(6-1){$P_2$}
7633 \istb[double]{r}[l]{\vpay{1}{-1}} \istb[ultra thick]{c}[r]{\vpay{2}{-2}} \endist
7634 % information sets
7635 \setxtinfosetstyle{dashed}
7636 \xtInfoset(1)(2)
7637 \xtInfoset(3)(4)
7638 \xtInfoset(5)(6)
7639 \xtInfoset(a)(b)
7640 \xtInfoset(c)(d)
7641 \xtInfoset(A)(B)
7642 \end{istgame}
7643 \end{doccode}
7644
7645 \vfill
7646 \vfill
7647 \vfill
7648
7649 \clearpage
7650
7651
7652 \subsection{Probability trees}
7653
7654 \vfill
7655
7656 \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}}
7657
7658 \vfill
7659
7660 \begin{doccode}{.25}
7661 \begin{istgame}[scale=.7]
7662 \tikzset{oval node/.style={ellipse node,draw=none}}
7663 \setistgrowdirection'{east}
7664 \xtdistance{14mm}{60mm}
7665 \istrooto(A){start}
7666 \istb \istb \istb \endist
7667 \xtdistance{12mm}{20mm}
7668 \istrooto(0)(A-1){0} \istb \istb \istb \endist
7669 \istrooto(1)(A-2){1} \istb \istb \istb \endist
7670 \istrooto(2)(A-3){2} \istb \istb \istb \endist
7671 \xtdistance{10mm}{10mm}
7672 \istrooto(00)(0-1){0}
7673 \istb{}{0 \quad 2^03^07^0=1}
7674 \istb{}{1 \quad 2^03^07^1=7}
7675 \endist
7676 \istrooto(01)(0-2){1}
7677 \istb{}{0}
7678 \istb{}{1}
7679 \endist
7680 \istrooto(02)(0-3){2}
7681 \istb{}{0}
7682 \istb{}{1}
7683 \endist
7684 \istrooto(10)(1-1){0}
7685 \istb{}{0}
7686 \istb{}{1}
7687 \endist
7688 \istrooto(11)(1-2){1}
7689 \istb{}{0}
7690 \istb{}{1}
7691 \endist
7692 \istrooto(12)(1-3){2}
7693 \istb{}{0}
7694 \istb{}{1}
7695 \endist
7696 \istrooto(20)(2-1){0}
7697 \istb{}{0}
7698 \istb{}{1}
7699 \endist
7700 \istrooto(21)(2-2){1}
7701 \istb{}{0}
7702 \istb{}{1}
7703 \endist
7704 \istrooto(22)(2-3){2}
7705 \istb{}{0 \quad 2^23^27^0=36}
7706 \istb{}{1 \quad 2^23^27^1=252}
7707 \endist
7708 \xtNode*([yshift=-1.3cm,xshift=-1.2cm]22)[anchor=mid]{$a$}
7709 \xtNode*([yshift=-1.3cm]22) [anchor=mid]{$b$}
7710 \xtNode*([yshift=-1.3cm,xshift=1.3cm]22) [anchor=mid]{$c$}
7711 \end{istgame}
7712 \end{doccode}
7713
7714
7715 \vfill
7716
7717 \clearpage
7718
7719 \subsection{More tree examples}
7720
7721 \vfill
7722
7723 \href{https://tex.stackexchange.com/questions/544753/game-tree-in-microeconomics/546141#546141}{\sourcelink{game-tree-in-microeconomics}}
7724
7725 \xbigskip1
7726
7727 \begin{doccode}{.4}
7728 % This is a game tree
7729 % imbalanced branch: \istbA
7730 \begin{istgame}[->]
7731 \tikzset{oval node/.style=
7732 {ellipse node,draw=none}}
7733 \xtdistance{20mm}{40mm}
7734 \istrooto'[90](0){\{a,b\}}
7735 \istb{(U,L)}[bl]{(5,5,2)}
7736 \istb{(U,R)}[br]{(4,4,1)}
7737 \endist
7738 \istrooto(0){\{a,b\}}
7739 \istb[->-=.92]{(D,L)}[al]
7740 \istb{(D,R)}[ar]{(5,5,2)}
7741 \endist
7742 \istrooto(1)(0-1){P}
7743 \istb{N}[al]{(4,4,1)}
7744 \istb{P}[ar]{(6,0,0)}
7745 \endist
7746 \end{istgame}
7747 \end{doccode}
7748
7749 \vfill
7750 \vfill
7751
7752
7753 \href{https://tex.stackexchange.com/questions/619273/constructing-a-tree-in-latex-using-tikz/619681#619681}{\sourcelink{constructing-a-tree-in-latex-using-tikz}}
7754
7755 \xbigskip1
7756
7757
7758 \begin{doccode}{.4}
7759 % This is not a game tree.
7760 \begin{istgame}[scale=1.2]
7761 \setistNewNodeStyle{ellipse node}{2em}
7762 \setxtinfosetstyle{thin,solid}
7763 \setistmathTF*011<sffamily>
7764 \istrooto(0){A}
7765 \istb
7766 \istbA(1.3)
7767 \istbA(1.6)
7768 \istb
7769 \endist
7770 \istrooto(1)(0-1){B} \endist
7771 \istrooto(2)(0-2){C} \endist
7772 \istrooto(3)(0-3){D} \endist
7773 \istrooto(4)(0-4){E} \endist
7774 \xtInfoset(1)(2)
7775 \xtInfoset(2)(4)
7776 \xtCInfoset(3)(1)<1.5>
7777 \end{istgame}
7778 \end{doccode}
7779
7780 \vfill
7781 \vfill
7782
7783 \clearpage
7784
7785 \vfill
7786
7787 \href{https://tex.stackexchange.com/questions/530161/how-to-rearrange-forest-tree/557463#557463}{\sourcelink{how-to-rearrange-forest-tree}}
7788
7789 \vfill
7790 \vfill
7791
7792 %\begin{doccode}[text above listing]
7793 \begin{istgame}[scale=1.5,draw=blue,text=blue,font=\sffamily]
7794 \tikzset{every node/.style={fill=white}} % action labels with white background
7795 \tikzset{every ellipse node/.style={circle,draw=blue,minimum size=2.5em}}
7796 \tikzset{xx/.style={circle,draw,fill,minimum size=2.5em,text=black}} % color node
7797 \tikzset{lev/.style={level distance=#1}}
7798 \setistmathTF*000{sffamily}
7799 \setistgrowdirection'{east}
7800 \xtShowEndPoints[oval node]
7801 \def\xdist{50mm}
7802 %% root
7803 \istrooto(A){Root}
7804 \istb<grow=0,lev=.4*\xdist>{1} \istb<grow=-90,lev=.7*\xdist>{0}[pos=.7] \endist
7805 \xtdistance{.4*\xdist}{.4*\xdist}
7806 \istrooto(Aa)(A-1) \istb{1} \istb{0} \endist
7807 \xtdistance{.4*\xdist}{.2*\xdist}
7808 \istrooto(Ab)(Aa-1) \istb{1} \istb{0} \endist
7809 \istrooto(Ac)(Aa-2) \istb{1} \istb{0} \endist
7810 %% level 1
7811 \istrooto(0)(A-2)
7812 \istb<grow=0,lev=.4*\xdist>{1} \istb<grow=-90,lev=.4*\xdist>{0}[pos=.6] \endist
7813 \xtdistance{.4*\xdist}{.2*\xdist}
7814 \istrooto(0a)(0-1)
7815 \istb{1}{c4}[[yellow,xx]center] % c4
7816 \istb{0}{c3}[[teal!50!white,xx]center] % c3
7817 \endist
7818 %% level 2 & level 3
7819 %\xtdistance{.4*\xdist}{.4*\xdist}
7820 \istrooto(00)(0-2)
7821 \istb<grow=0,lev=.4*\xdist>{1}{c2}[[teal!70!white,xx]center] % c2
7822 \istb<grow=-90,lev=.35*\xdist>{0}{c1}[[orange,xx]center] % c1
7823 \endist
7824 %% level lines
7825 \coordinate(X0)at($(A)!.66!(0)$);
7826 \coordinate(X1)at($(0)!.57!(00)$);
7827 \coordinate(X2)at($(00)!.5!(00-2)$);
7828 \xtTimeLineH'[solid](X0){1}{-8}
7829 \xtTimeLineH'[solid](X1){1}{-8}
7830 \xtTimeLineH'[solid,->](X2){1}{-8}
7831 %% level texts
7832 \xtTimeLineH'[draw=none](A){1}{-8}{root}[r]
7833 \xtTimeLineH'[draw=none](0){1}{-8}{level 1}[r]
7834 \xtTimeLineH'[draw=none](00){1}{-8}{level 2}[r]
7835 \xtTimeLineH'[draw=none](00-2){1}{-8}{level 3}[r]
7836 \end{istgame}
7837 %\end{doccode}
7838
7839 \vfill
7840 \vfill
7841
7842 \clearpage
7843
7844 \leavevmode
7845 \vfill
7846
7847 \begin{doccode}[listing only]
7848 \begin{istgame}[scale=1.5,draw=blue,text=blue,font=\sffamily]
7849 \tikzset{every node/.style={fill=white}} % action labels with white background
7850 \tikzset{every ellipse node/.style={circle,draw=blue,minimum size=2.5em}}
7851 \tikzset{xx/.style={circle,draw,fill,minimum size=2.5em,text=black}} % color node
7852 \tikzset{lev/.style={level distance=#1}}
7853 \setistmathTF*000{sffamily}
7854 \setistgrowdirection'{east}
7855 \xtShowEndPoints[oval node]
7856 \def\xdist{50mm}
7857 %% root
7858 \istrooto(A){Root}
7859 \istb<grow=0,lev=.4*\xdist>{1} \istb<grow=-90,lev=.7*\xdist>{0}[pos=.7] \endist
7860 \xtdistance{.4*\xdist}{.4*\xdist}
7861 \istrooto(Aa)(A-1) \istb{1} \istb{0} \endist
7862 \xtdistance{.4*\xdist}{.2*\xdist}
7863 \istrooto(Ab)(Aa-1) \istb{1} \istb{0} \endist
7864 \istrooto(Ac)(Aa-2) \istb{1} \istb{0} \endist
7865 %% level 1
7866 \istrooto(0)(A-2)
7867 \istb<grow=0,lev=.4*\xdist>{1} \istb<grow=-90,lev=.4*\xdist>{0}[pos=.6] \endist
7868 \xtdistance{.4*\xdist}{.2*\xdist}
7869 \istrooto(0a)(0-1)
7870 \istb{1}{c4}[[yellow,xx]center] % c4
7871 \istb{0}{c3}[[teal!50!white,xx]center] % c3
7872 \endist
7873 %% level 2 & level 3
7874 %\xtdistance{.4*\xdist}{.4*\xdist}
7875 \istrooto(00)(0-2)
7876 \istb<grow=0,lev=.4*\xdist>{1}{c2}[[teal!70!white,xx]center] % c2
7877 \istb<grow=-90,lev=.35*\xdist>{0}{c1}[[orange,xx]center] % c1
7878 \endist
7879 %% level lines
7880 \coordinate(X0)at($(A)!.66!(0)$);
7881 \coordinate(X1)at($(0)!.57!(00)$);
7882 \coordinate(X2)at($(00)!.5!(00-2)$);
7883 \xtTimeLineH'[solid](X0){1}{-8}
7884 \xtTimeLineH'[solid](X1){1}{-8}
7885 \xtTimeLineH'[solid,->](X2){1}{-8}
7886 %% level texts
7887 \xtTimeLineH'[draw=none](A){1}{-8}{root}[r]
7888 \xtTimeLineH'[draw=none](0){1}{-8}{level 1}[r]
7889 \xtTimeLineH'[draw=none](00){1}{-8}{level 2}[r]
7890 \xtTimeLineH'[draw=none](00-2){1}{-8}{level 3}[r]
7891 \end{istgame}
7892 \end{doccode}
7893
7894 \vfill
7895 \vfill
7896 \vfill
7897
7898 \clearpage
7899
7900 \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}}
7901
7902 \vfill
7903
7904 \begin{doccode}[text above listing]
7905 \begin{istgame}[edge from parent path={(\tikzparentnode) |- (\tikzchildnode.west)}]
7906 \setistgrowdirection'{east}
7907 \setistmathTF001
7908 \setxtarrowtips{latex}[very thick]
7909 \setistNewNodeStyle{init}[rectangle,fill=gray]{1cm}
7910 \setistNewNodeStyle{rect}[rectangle]{1cm}
7911 \setistNewNodeStyle{circ}{1cm}
7912 \tikzset{RR/.style={%
7913 edge from parent path={(\tikzparentnode.east)--(\tikzchildnode.west)}}}
7914 % tree
7915 \xtdistance{25mm}{30mm}
7916 \istroot(0)[init]<[xshift=3mm]-90>{\makecell[l]{Retailer\\announces\\$P$ and $T$}}
7917 \istb<RR>[->-=.75] \endist % \usepackage{makecell}
7918 \istrooto(1)(0-1)[rect]
7919 \istb<grow=0,RR>[->-=.75]{Buy}[above,pos=.3]
7920 \istb<sibling distance=60mm,level distance=65mm>{Don't buy}[above,pos=.57]{0}
7921 \endist
7922 \xtdistance{25mm}{30mm}
7923 \istrooto(2)(1-1)[circ]
7924 \istB[->-=.93]{Match}[above,pos=.72]{$m$}[below,pos=.72]
7925 \istB[->-=.93]{Mismatch}[below,pos=.72]{$1-m$}[above,pos=.72] \endist
7926 \xtdistance{15mm}{15mm}
7927 \istrooto(3a)(2-1)[rect]
7928 \istb{Keep}[above,pos=.75]{v-P} \istb{Return}[below,pos=.75]{vc-h} \endist
7929 \istrooto(3b)(2-2)[rect]
7930 \istb{Keep}[above,pos=.75]{s-P} \istb{Return}[below,pos=.75]{-h} \endist
7931 % time-lines
7932 \xtTimeLineV[dashed]([xshift=-7mm]1){3.5}{-4}{Stage I}[left=5mm]
7933 \xtTimeLineV[dashed]([xshift=-7mm]2){3.5}{-4}{Stage II}[left=5mm]
7934 \xtTimeLineV[dashed]([xshift=-1.5mm]3a-1){3.5}{-4}{Stage III}[left=15mm]
7935 \xtTimeLineV[draw=none]([xshift=-1.5mm]3a-1){3.5}{-4}{\underline{Utility}}[right=2mm]
7936 \xtTimeLineV'[draw=none]([xshift=-7mm]1){3.5}{-4}{Retailer}[left=5mm]
7937 \xtTimeLineV'[draw=none]([xshift=-7mm]2){3.5}{-4}{Consumer}[left=5mm]
7938 \xtTimeLineV'[draw=none]([xshift=-1.5mm]3a-1){3.5}{-4}{Consumer}[left=15mm]
7939 \end{istgame}
7940 \end{doccode}
7941
7942 \vfill
7943 \vfill
7944
7945 \clearpage
7946
7947 \vfill
7948 \href{https://tex.stackexchange.com/questions/540711/terminal-leaf-node-circle/557469#557469}{\sourcelink{terminal-leaf-node-circle}}
7949
7950 \vfill
7951 \vfill
7952
7953 \begin{doccode}[text above listing]
7954 \begin{istgame}
7955 \setistNewNodeStyle{max}
7956 [regular polygon, regular polygon sides = 3]{1.5cm}
7957 \setistNewNodeStyle{min}
7958 [regular polygon, regular polygon sides = 3, shape border rotate = 180]{1.5cm}
7959 \setistNewNodeStyle{chance}
7960 [circle]{1.2cm}
7961 \def\distFactor{20};
7962 \xtdistance{\distFactor mm}{4*\distFactor mm}
7963 \setxtarrowtips[blue, thick]
7964 \istroot(0)[max]<center, blue>{1.5}
7965 \istb[blue, ->-] \istb \endist
7966 \xtdistance{\distFactor mm}{2*\distFactor mm}
7967 \istroot(1)(0-1)[chance]<center, purple>{1.5}
7968 \istb{0.5}[al] \istb{0.5}[ar] \endist
7969 \istroot(2)(0-2)[chance]<center, purple>{$\leq 1$}
7970 \istb{0.5}[al] \istb{0.5}[ar] \endist
7971 %% terminal nodes with or without circles (TRICK!!)
7972 \xtShowEndPoints[circle,draw,minimum size=1.1cm] % before \xtShowTerminalNodes
7973 \xtShowTerminalNodes[circle,draw=none,minimum size=1.1cm]
7974 \xtdistance{\distFactor mm}{\distFactor mm}
7975 \istroot(3)(1-1)[min]<center, red>{2}
7976 \istbt{}{2}[center] \istb{}{5000}[center] \endist
7977 \istroot(4)(1-2)[min]<center, red>{1}
7978 \istbt{}{1}[center] \istb{}{100}[center] \endist
7979 \istroot(5)(2-1)[min]<center, red>{0}
7980 \istbt{}{0}[center] \istb{}{2}[center] \endist
7981 \istroot(6)(2-2)[min]
7982 \istb{}{-1}[center] \istb{}{0}[center] \endist
7983 \end{istgame}
7984 \end{doccode}
7985
7986 \vfill
7987 \vfill
7988
7989 \clearpage
7990
7991 \vfill
7992
7993 \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}}
7994
7995 \vfill
7996
7997 %\begin{doccode}[text above listing]
7998 \begin{istgame}[font=\footnotesize]
7999 \def\Rcar{{R_{cartel}}}
8000 \def\Rcom{{R_{comp}}}
8001 % tree
8002 \tikzset{oval node/.style={box node,draw=none,outer sep=1pt}}
8003 \xtdistance{15mm}{50mm}
8004 \istrooto(0){Deviate or Collude} \istb \istb \endist
8005 \istrooto(D)(0-1){Deviate} \istb \endist
8006 \istrooto(Da)(D-1){$R_{dev}-\mbox{EDC}$} \istb \endist
8007 \istrooto(Db)(Da-1){$\Rcom*\delta$} \istb \endist
8008 \istrooto(Dc)(Db-1){$\Rcom*\delta^2$} \istb \endist
8009 \istrooto(Dd)(Dc-1){$\Rcom*\delta^3$} \istb{}{\cdots} \endist
8010
8011 \xtdistance{15mm}{50mm}
8012 \istrooto(C)(0-2){Collude} \istb{\alpha}[al] \istb{1-\alpha}[ar] \endist
8013 \istrooto(Ca)(C-1){$\Rcar-\mbox{EDC}-\mbox{F}$} \istb \endist
8014 \istrooto(Cb)(Ca-1){$\Rcom*\delta$} \istb \endist
8015 \istrooto(Cc)(Cb-1){$\Rcom*\delta^2$} \istb \endist
8016 \istrooto(Cd)(Cc-1){$\Rcom*\delta^3$} \istb{}{\cdots} \endist
8017
8018 \xtdistance{15mm}{50mm}
8019 \istrooto(RC0)(C-2){$R_{cartel}$} \istb{\alpha}[al]
8020 \istb{1-\alpha}[ar] \endist
8021 \istrooto(RC0a)(RC0-1){$(\Rcar-\mbox{EDC}-\mbox{F})*\delta$}
8022 \istb{}{\cdots} \endist
8023 \istrooto(RC0b)(RC0a-1){$\Rcom*\delta^2$}
8024 \istb \endist
8025 \istrooto(RC0c)(RC0b-1){$\Rcom*\delta^3$}
8026 \istb{}{\cdots} \endist
8027
8028 \xtdistance{15mm}{40mm}
8029 \istrooto(RC1)(RC0-2){$\Rcar*\delta$}
8030 \istb{\alpha}[al] \istb{1-\alpha}[ar] \endist
8031 \istrooto(RC1a)(RC1-1){$(\Rcar-\mbox{EDC}-\mbox{F})*\delta^2$}
8032 \istb{}{\cdots} \endist
8033 \istrooto(RC1b)(RC1a-1){$\Rcom*\delta^3$}
8034 \istb{}{\cdots} \endist
8035
8036 \xtdistance{15mm}{30mm}
8037 \istrooto(RC2)(RC1-2){$\Rcar*\delta^2$} \istb{\alpha}[al]
8038 \istb{1-\alpha}[ar] \endist
8039 \istrooto(RC2a)(RC2-1){$(\Rcar-\mbox{EDC}-\mbox{F})*\delta^3$}
8040 \istb{}{\cdots} \endist
8041
8042 \xtdistance{15mm}{20mm}
8043 \istrooto(RC3)(RC2-2){$\Rcar*\delta^3$}
8044 \istb{\alpha}[al]{\cdots} \istb{1-\alpha}[ar]{\cdots} \endist
8045 \end{istgame}
8046 %\end{doccode}
8047
8048 \vfill
8049
8050 \clearpage
8051
8052 \leavevmode
8053 \vfill
8054
8055 \begin{doccode}[listing only]
8056 \begin{istgame}[font=\footnotesize]
8057 \def\Rcar{{R_{cartel}}}
8058 \def\Rcom{{R_{comp}}}
8059 % tree
8060 \tikzset{oval node/.style={box node,draw=none,outer sep=1pt}}
8061 \xtdistance{15mm}{50mm}
8062 \istrooto(0){Deviate or Collude} \istb \istb \endist
8063 \istrooto(D)(0-1){Deviate} \istb \endist
8064 \istrooto(Da)(D-1){$R_{dev}-\mbox{EDC}$} \istb \endist
8065 \istrooto(Db)(Da-1){$\Rcom*\delta$} \istb \endist
8066 \istrooto(Dc)(Db-1){$\Rcom*\delta^2$} \istb \endist
8067 \istrooto(Dd)(Dc-1){$\Rcom*\delta^3$} \istb{}{\cdots} \endist
8068
8069 \xtdistance{15mm}{50mm}
8070 \istrooto(C)(0-2){Collude} \istb{\alpha}[al] \istb{1-\alpha}[ar] \endist
8071 \istrooto(Ca)(C-1){$\Rcar-\mbox{EDC}-\mbox{F}$} \istb \endist
8072 \istrooto(Cb)(Ca-1){$\Rcom*\delta$} \istb \endist
8073 \istrooto(Cc)(Cb-1){$\Rcom*\delta^2$} \istb \endist
8074 \istrooto(Cd)(Cc-1){$\Rcom*\delta^3$} \istb{}{\cdots} \endist
8075
8076 \xtdistance{15mm}{50mm}
8077 \istrooto(RC0)(C-2){$R_{cartel}$} \istb{\alpha}[al]
8078 \istb{1-\alpha}[ar] \endist
8079 \istrooto(RC0a)(RC0-1){$(\Rcar-\mbox{EDC}-\mbox{F})*\delta$}
8080 \istb{}{\cdots} \endist
8081 \istrooto(RC0b)(RC0a-1){$\Rcom*\delta^2$}
8082 \istb \endist
8083 \istrooto(RC0c)(RC0b-1){$\Rcom*\delta^3$}
8084 \istb{}{\cdots} \endist
8085
8086 \xtdistance{15mm}{40mm}
8087 \istrooto(RC1)(RC0-2){$\Rcar*\delta$}
8088 \istb{\alpha}[al] \istb{1-\alpha}[ar] \endist
8089 \istrooto(RC1a)(RC1-1){$(\Rcar-\mbox{EDC}-\mbox{F})*\delta^2$}
8090 \istb{}{\cdots} \endist
8091 \istrooto(RC1b)(RC1a-1){$\Rcom*\delta^3$}
8092 \istb{}{\cdots} \endist
8093
8094 \xtdistance{15mm}{30mm}
8095 \istrooto(RC2)(RC1-2){$\Rcar*\delta^2$} \istb{\alpha}[al]
8096 \istb{1-\alpha}[ar] \endist
8097 \istrooto(RC2a)(RC2-1){$(\Rcar-\mbox{EDC}-\mbox{F})*\delta^3$}
8098 \istb{}{\cdots} \endist
8099
8100 \xtdistance{15mm}{20mm}
8101 \istrooto(RC3)(RC2-2){$\Rcar*\delta^3$}
8102 \istb{\alpha}[al]{\cdots} \istb{1-\alpha}[ar]{\cdots} \endist
8103 \end{istgame}
8104 \end{doccode}
8105
8106 \vfill
8107 \vfill
8108 \vfill
8109
8110
8111