summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/istgame/istgame-doc-v2.0.tex
blob: aa91c4d8076712068fdc635380feed3c323e7ed4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
%!TEX root = istgame-doc.tex

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

\section{Changes and remarks}

\subsection{Changes}

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

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

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

\paragraph{Changed and removed macros}

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


\paragraph{Redesigned macros and the environment}

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

\subsection{What's new}

\paragraph{Some new functions}

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

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

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

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

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

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

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

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

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

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


\paragraph{List of new arrow styles}

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

\subsection{How to read this document}

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

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

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

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

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

%\clearpage
\subsection{Remarks}

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

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

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

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

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

\paragraph{Optional versions of macros}

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

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


\paragraph{Global macros}

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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


%\clearpage

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

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

\xbigskip1

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

\xbigskip1

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

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


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

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

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

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

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

\subsection{Connecting simple tree structures}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\subsubsection{How to put information sets}

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

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


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

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

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

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

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


\subsubsection{How to put a continuum of branches}

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

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

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

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

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

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

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

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

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

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

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

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

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


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

\label{sec:xtdistance}

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

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

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

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

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

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


%\xbigskip1
\remark

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

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


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

\subsection{The \env{istgame} environment}

\label{ssec:envistgame}

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

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

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

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

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

%\tmpclearpage

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

\subsubsection{Basic node styles}

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

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


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

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


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

\xbigskip1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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


\subsubsection*{the root}

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

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

\xbigskip1

Here is a simple example of drawing a tree structure.

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


\subsubsection*{naming children: counterclockwise or clockwise}

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

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

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


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

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

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

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

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

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

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

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


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

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

\subsubsection*{local change of distances}

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

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

\label{ssec:istroot'}

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

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

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

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

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

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

\label{ssec:istrootstar}

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

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

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

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

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

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

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

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

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


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

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



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

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


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

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


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


%\xbigskip1

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

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


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

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

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

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

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

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

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


\subsubsection*{branches}

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

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

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

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

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

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

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

\subsubsection*{action labels}

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

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

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

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

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

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

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

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

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

%\xbigskip1
\subsubsection*{payoffs}

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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


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

\subsection{How to put players}

\subsubsection{Players: basics}

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

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

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

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

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

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

\label{sec:firstthing}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\subsection{How to put action labels}

\subsubsection{Action labels: basics}

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

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

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

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

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

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

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

\subsubsection{Decorating action labels}

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

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

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

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

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


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

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

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

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

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

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

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


%\clearpage
\subsubsection{Dual action labels}

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

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

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

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

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

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

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

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

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

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

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


%\clearpage
\subsection{How to put payoffs}

\subsubsection{Payoffs: basics}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\subsubsection{Decorating payoffs}

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

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

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

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


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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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


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


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


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

\subsection{Fine-tuning positions: owners}

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

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

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

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


\subsection{Fine-tuning positions: action labels}

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

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

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

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

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

\xbigskip1

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

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

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


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

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

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

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

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

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

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

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


\subsection{Fine-tuning positions: payoffs}

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

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


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

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

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

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

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

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


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

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

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

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

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

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

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

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

This macro allows you to to rotate a game tree.

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


\xbigskip1

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

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

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

\subsubsection{A tree growing east -- counterclockwise}

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

Numbers increase upward (or counterclockwise).

\subsubsection{A tree growing east -- clockwise}

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

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

\subsubsection{A tree growing north -- counterclockwise}

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

Numbers increase from right to left (or counterclockwise).

\subsubsection{A tree growing north -- clockwise}

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

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

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

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

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

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

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

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

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


\section{Information sets}

\label{sec:infoset}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\xbigskip1
\remark 

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


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

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

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

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

%\clearpage
\subsubsection{Sloped information sets}

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


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

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

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

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

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

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

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

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

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

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


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

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

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


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

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

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

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

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

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

Here is an example of drawing curved information sets.

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


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

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

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

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

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


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

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

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

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


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

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

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

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

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

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


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

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

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


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

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

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

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


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


\xbigskip1
\remark

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


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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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


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

\section{Continuum of branches}

\label{sec:cntm}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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


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

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

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

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

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


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


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


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

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

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

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

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


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


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

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

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

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

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


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


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

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


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

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

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

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

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


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

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


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

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

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

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

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

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

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

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

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


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

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

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


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

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

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

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

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


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

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


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

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

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

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

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

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

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


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

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


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

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


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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

\xbigskip1

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

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


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

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


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

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

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

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

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

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

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

\xbigskip1

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

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


\subsection{Information sets for continua of branches}

\subsubsection{Information sets for continuum triangles}

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

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


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

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

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

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

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

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

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

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

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

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

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


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

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


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

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

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


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

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

\subsubsection*{turing X circles}

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

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


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

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

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

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


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

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

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

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

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

%\xbigskip1

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

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

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

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

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


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

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

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

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

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

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

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


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

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


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

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

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

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

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


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

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

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

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


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

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

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

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

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

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

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


\subsubsection{Middle arrow tip styles}


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

\xbigskip1

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

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

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


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

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

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

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

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


\subsection{Middle arrow for simple tress}

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

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

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

\xbigskip1

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

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


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

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

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

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

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


\subsection{Arrows for simple trees}

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

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

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

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

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

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


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

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

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

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


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

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

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

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

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

\xbigskip1
Here is one more example.

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


\section{Supplementary macros}

\label{sec:suppmac}

\subsection{Supplementary macros to important labels}

\label{ssec:suppmac}

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

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

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

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

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

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

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

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


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

\subsection{More supplementary macros}

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

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

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

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

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

%\xbigskip1

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


\xbigskip1

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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


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

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

\section{Representing subgames}

Here is an example of a whole game tree.

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

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

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

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

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

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

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

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

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


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

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

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


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

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

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


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

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


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

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

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

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

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

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


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

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

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


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

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


\section{Miscellany}

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

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


\subsection{Code reuse}

\subsubsection{Drawing subgames}

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

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

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

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

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

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

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

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

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

\xbigskip1

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

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

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

\xbigskip1

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


\subsubsection{Backward induction}

It is also easy to illustrate the procedure of \isw{backward induction}, when you analyze an extensive game.

\xbigskip1

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
\begin{istgame}[>=stealth]
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb[dashed]{A}[a]{(2,2)}[l]
  \istb[very thick]{D}[r]
\endist 
\istroot(1)(0-2)<left>{1}
  \istb[very thick]{L}[al]
  \istb<dashed>{R}[ar]
\endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb[->,very thick,blue]{\ell}[al]{(4,2)}
  \istb[thick,dotted]{r}[ar]{(1,1)}
\endist 
\istroot(3)(1-2)<45>{2}
  \istb[thick,dotted]{\ell}[al]{(3,2)}
  \istb[very thick,blue]{r}[ar]{(0,3)}
\endist 
\end{istgame}
\end{tcblisting}
\xbigskip1

By using \cmd{\istb} with options for the middle arrow tips, you can effectively express the backward induction procedure.
The command \cmd{\setxtarrowtips} controls the style of arrow tips and just declaring \cmd{\setxtarrowtips} followed by nothing restores defaults for the middle arrow tips styles. See Section~\ref{sec:arrows}, for more details.
change the color and the style of a line representing a branch and an arrow tip to it.

\xbigskip1
\begin{tcblisting}{listing outside text, righthand width=.4\linewidth,breakable}
% Example: backward induction
\begin{istgame}
\setxtarrowtips[red,very thick,shorten >=-2pt,shorten <=-2pt]
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb[-x-,dashed,blue]{A}[a]{(2,2)}[l]
  \istb[-o-,very thick]{D}[r]
  \endist 
\istroot(1)(0-2)<left>{1}
  \istb[very thick]{L}[al]
  \istb[dashed,-x-]{R}[ar]
  \endist 
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)<135>{2}
  \istb[->>>-,very thick,draw=blue]{\ell}[al]{(4,2)}
  \istb[-x-,thick,dotted]{r}[ar]{(1,1)}
  \endist 
\setxtarrowtips % restore defaults
\istroot(3)(1-2)<45>{2}
  \istb[-x-,thick,dotted]{\ell}[al]{(3,2)}
  \istb[->-,draw=blue]{r}[ar]{(0,3)}
  \endist 
\end{istgame}
\end{tcblisting}


%\clearpage
\subsubsection{Code reusability}

Chen(2013)'s work is good to understand how drawing a game tree with \TikZ\ works.

\begin{tcblisting}{listing above text}
% Chen (2013)
\begin{tikzpicture}[scale=1,font=\footnotesize]
\tikzstyle{solid node}=[circle,draw,inner sep=1.5,fill=black]
\tikzstyle{hollow node}=[circle,draw,inner sep=1.5]
\tikzstyle{level 1}=[level distance=15mm,sibling distance=3.5cm]
\tikzstyle{level 2}=[level distance=15mm,sibling distance=1.5cm]
\tikzstyle{level 3}=[level distance=15mm,sibling distance=1cm]
\node(0)[solid node,label=above:{$P1$}]{}
child{node[solid node,label=above left:{$P2$}]{}
child{node[hollow node,label=below:{$(1,2)$}]{} edge from parent node[left]{$C$}}
child{node[hollow node,label=below:{$(1,-1)$}]{} edge from parent node[left]{$D$}}
child{node[hollow node,label=below:{$(0,2)$}]{} edge from parent node[right]{$E$}}
edge from parent node[left,xshift=-5]{$A$}
}
child{node[solid node,label=above right:{$P2$}]{}
child{node[hollow node,label=below:{$(2,2)$}]{} edge from parent node[left]{$F$}}
child{node[hollow node,label=below:{$(1,3)$}]{} edge from parent node[right]{$G$}}
edge from parent node[right,xshift=5]{$B$}
};
\end{tikzpicture}
\end{tcblisting}

%\xbigskip1

You can get a quite similar (actually the same) result by using the \pkg{istgame} package.

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% istgame
\begin{istgame}[scale=1,font=\footnotesize]
\setistDecisionNodeStyle{4pt}
\xtdistance{15mm}{3.5cm}
\istroot(0){$P1$}
  \istb{A}[al]
  \istb{B}[ar]
  \endist
\xtShowEndPoints[oval node]
\xtdistance{15mm}{1.5cm}
\istroot(1)(0-1)<135>{$P2$}
  \istb{C}[l]{(1,2)}
  \istb{D}[l]{(1,-1)}
  \istb{E}[r]{(0,2)}
  \endist
\istroot(2)(0-2)<45>{$P2$}
  \istb{F}[l]{(2,2)}
  \istb{G}[r]{(1,3)}
  \endist
\end{istgame}
\end{tcblisting}


The \pkg{istgame} package enhances simplicity and readability, and hence it is easy to reuse codes. You can easily read and modify game tree codes even if you go over them after a while.

%\clearpage
\section{Game tree examples}

This section provides some examples of extensive games.
Before we start, let us change the default font size of the \env{istgame} environment by stating
\cmd{\setistgamefontsize\{\cmd{\footnotesize\}}} outside of the environment. (Right here!)

\setistgamefontsize{\footnotesize}

\subsection{Simple examples}

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth,breakable}
\begin{istgame}[->,shorten >=1.3pt]
\setistmathTF*001
\xtdistance{15mm}{30mm}
\istroot(0)[initial node]{Child}
  \istb{Good}[above left]{(0,2)}
  \istb{Bad}[above right]
  \endist
\istroot(1)(0-2)<30>{Parent}
  \istb{Forgive}[above left]{(1,1)}
  \istb{Punish}[above right]{(-1,-1)}
  \endist 
\end{istgame}
\end{tcblisting}

\medskip 

%\begin{tcblisting}{listing outside text, righthand width=.35\linewidth,breakable}
%% sloped action labels
%\begin{istgame}[->]
%\setistmathTF*001 % action labels in italics
%\xtShowEndPoints
%\xtdistance{15mm}{30mm}
%\istroot(0)[initial node]{Child}
%  \istb{Good}[above,sloped]{(0,2)}
%  \istb{Bad}[above,sloped]
%  \endist
%\istroot(1)(0-2)<30>{Parent}
%  \istb{Forgive}[above,sloped]{(1,1)}
%  \istb{Punish}[above,sloped]{(-1,-1)}
%  \endist 
%\end{istgame}
%\end{tcblisting}
%
%\medskip 

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth,breakable}
% dual sloped action labels (\istB)
\begin{istgame}
\setistmathTF*001 % action labels in italics
\xtShowArrows
\xtdistance{15mm}{30mm}
\istroot(0)[initial node]{Child}
  \istB{Good}[above,sloped]
       {$p$}[below, sloped]{(0,2)}
  \istB{Bad}[above,sloped]
       {$1-p$}[below, sloped]
  \endist
\istroot(1)(0-2)<30>{Parent}
  \istB{Forgive}[above,sloped]
       {$q$}[below, sloped]{(1,1)}
  \istB{Punish}[above,sloped]
       {$1-q$}[below, sloped]{(-1,-1)}
  \endist 
\end{istgame}
\end{tcblisting}

\medskip 

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
% IGT 218.1 (Osborne, 2004b)
\begin{istgame}[font=\normalsize]
\xtdistance{10mm}{20mm}
  \istroot(0){Vote}
  \istb{a}[al]{x}
  \istb{b}[ar]
  \endist
\istroot(1)([yshift=-1.5em]0-2){Vote}
  \istb{c}[al]{y}
  \istb{d}[ar]{z}
  \endist
\end{istgame}
\end{tcblisting}

\medskip

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
% information set
\begin{istgame}
\xtdistance{10mm}{30mm}
\istroot(0){1}
  \istb{L}[al]   \istb{R}[ar] 
  \endist
\xtdistance{7mm}{15mm}
\istroot(1a)(0-1)
  \istb{a}[al]{1,0} 
  \istb{b}[ar]{2,3}  
  \endist
\istroot(1b)(0-2)
  \istb{c}[al]{0,1}   \istb{d}[ar]{-1,0} 
  \endist
\xtInfoset(1a)(1b){2}
\end{istgame}
\end{tcblisting}

\medskip

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
% information set
\begin{istgame}
\xtShowEndPoints[oval node]
\xtdistance{10mm}{30mm}
\istroot(0){1}
  \istb{L}[al]   \istb{R}[ar] 
  \endist
\xtdistance{7mm}{15mm}
\istroot(1a)(0-1)
  \istb{a}[al]{1,0}   \istb{b}[ar]{2,3}  
  \endist
\istroot(1b)(0-2)
  \istb{c}[al]{0,1}   \istb{d}[ar]{-1,0} 
  \endist
\xtInfoset[bend left=30](1a)(1b){2}
\end{istgame}
\end{tcblisting}

\medskip 

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth,breakable}
% (oval) information set
\begin{istgame}
\xtdistance{15mm}{30mm}
\istroot[-135](0)[initial node]<0>{1}
  \istb{A}[a]{(2,2)}[l]  \istb{D}[r]  
  \endist 
\istroot(1)(0-2)<left>{1}
  \istb{L}[al]    \istb{R}[ar]  
  \endist 
\xtInfosetO(1-1)(1-2){2}
\xtdistance{10mm}{20mm}
\istroot(2)(1-1)
  \istb{\ell}[al]{(4,2)}  \istb{r}[ar]{(1,1)}
  \endist 
\istroot(3)(1-2)
  \istb{\ell}[al]{(3,2)}  \istb{r}[ar]{(0,3)}
  \endist 
\end{istgame}
\end{tcblisting}


\clearpage
\subsection{A game tree with a strategic game}

\begin{tcblisting}{listing outside text, righthand width=.35\linewidth}
%\usepackage{tabu}
%\NewExpandableDocumentCommand\xcol{mO{c|}m}
%  {\multicolumn{#1}{#2}{\ensuremath{#3}}}
\def\strategicgame{
\begin{tabular}  {c|c|c|} % to 3cm
\xcol1[c]{~} & \xcol1[c]{$B$} & \xcol1[c]{$S$} \\\cline{2-3}
$B$   & $3,1$     & $0,0$    \\\cline{2-3}
$S$   & $0,0$     & $1,3$    \\\cline{2-3}
\end{tabular}
}
  \begin{istgame}
\setistmathTF*001
\xtdistance{10mm}{40mm}
\istroot(0)[initial node]{1}
  \istb{Book}[al]{2,2}
  \istb{Concert}[ar]
  \endist
\xtPayoff(0-2){\strategicgame}[below,xshift=-7pt]
\end{istgame}
\end{tcblisting}


%\clearpage
\subsection{Larger game trees with information sets}

\begin{tcblisting}{}
\begin{istgame}
\xtShowEndPoints
\xtdistance{10mm}{40mm}
\istroot(0)[initial node]{1}  \istb  \istb  \istb  \endist
\xtdistance{10mm}{10mm}
\istroot(1)(0-1)              \istb  \istb  \istb  \endist
\istroot(2)(0-2)              \istb  \istb  \istb  \endist
\xtdistance{10mm}{20mm}
\istroot(3)(0-3)              \istb  \istb  \endist
\xtdistance{10mm}{7mm}
\istroot(a)(1-3){3}           \istb  \istb  \istb  \endist
\xtdistance{10mm}{14mm}
\istroot(b)(2-3)              \istb  \istb  \endist
\istroot(c)(3-1){2}           \istb  \istb  \endist
\istroot(d)(3-2){2}           \istb  \istb  \endist
\xtInfosetO[fill=red!20](0)(0)
\xtInfoset(1)(2){2} 
\xtCInfosetO[fill=blue!20](a)(a)
\setxtinfosetstyle{blue,thick,dashed}
\xtInfosetO(b)(3){3}
\setxtinfosetstyle % restore defaults
\xtCInfosetO(d)(d)
\end{istgame}
\end{tcblisting}


\begin{tcblisting}{}
\begin{istgame}[scale=1]
\useasboundingbox (-7,-3) rectangle (7,.5);
\xtdistance{10mm}{40mm}
\istroot(0)[initial node]{1}  \istb  \istb  \istb  \istb \endist
\xtdistance{10mm}{10mm}
\istroot(1)(0-1)     \istb  \istb  \istb  \endist
\istroot(2)(0-2)  \istb  \istb  \istb  \endist
\xtdistance{10mm}{20mm}
\istroot(3)(0-3)  \istb  \istb  \endist
\istroot(4)(0-4)  \istb  \istb  \endist
\xtdistance{10mm}{7mm}
\istroot(a)(1-3)  \istb  \istb  \istb  \endist
\istroot(b)(2-3)  \istb  \istb  \endist
\istroot(c)(3-1)  \istb  \istb  \istb  \endist
\xtCInfosetO[fill=red!20](1)!.4!(3){2} 
\xtInfosetO(2)(2){1}[above]
\setxtinfosetlayer{behind}
\xtCInfoset[blue,thick,dashed](a)(c)<.85>{3}[below]
\setxtinfosetlayer % restore default layer (behnd)
\xtCInfosetO[fill=blue!20](b)(4)<.7>{2}
\end{istgame}
\end{tcblisting}


\subsection{A continuum of branches}

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\cntmdistance*{8mm}{16mm}
\cntmpreset*[dashed]{.7} % white triangle
\istrootcntm(0)(0,0){1}  \istb{x}[r]  \endist
\istroot(1)(0-1)<[label distance=-3pt]120>{2}
  \istb{Y}[al]{x,1-x}    \istb{N}[ar] \endist
\cntmpreset % restore defaults
\istrootcntm(2)(1-2){2}  \istb{y}[r]  \istbm  \endist
\istroot(3)(2-1)<[label distance=-3pt]120>{1}
  \istb[]{Y}[al]{1-y,y}  \istb{N}[ar] \endist
\end{istgame}
\end{tcblisting}

%\medskip

\begin{tcblisting}{listing outside text, righthand width=.25\linewidth}
\begin{istgame}[font=\scriptsize]
\cntmdistance*{8mm}{16mm}
\istrootcntmA(0)(0,0){1} \istbA{x}[r]  \endist
\cntmAInfoset(0)
\istroot(1)(0-1)<[label distance=-3pt]120>{2}
  \istb{Y}[al]{x,1-x}    \istb{N}[ar]  \endist
\istrootcntmA(2)(1-2){2} \istbA{y}[r]  \endist
\cntmAInfosetO[fill=blue!20](2)
\istroot(3)(2-1)<[label distance=-3pt]120>{1}
  \istb[]{Y}[al]{1-y,y}  \istb{N}[ar]  \endist
\end{istgame}
\end{tcblisting}


%\clearpage
\subsection{Tic-tac-toe (sketch)}

% tic-tac-toe
\begin{tcblisting}{}
% tic-tac-toe (sketch)
\begin{istgame}[scale=1.8,font=\tiny]
\xtdistance{20mm}{7mm}
\istroot(0) \istb \istb \istb \istb \istb \istb{\dots} \istb \istb \istb{9}[r] \endist
\foreach \x in {1,...,4}
{\xtActionLabel(0)(0-\x){\x}[l]}
\xtdistance{10mm}{3mm}
\istroot(a1)(0-1) \istb{2}[l] \istb \istb \istb \istb \istb \istb \istb{9}[r] \endist
\istroot(a7)(0-7) \istb{1}[l] \istb \istb \istb \istb \istb \istb \istb{9}[r] \endist
\xtdistance{10mm}{2mm}
\istroot(A)(a1-3) \istb{2}[l] \istb \istb \istb \istb \istb \istb{9}[r] \endist
\istroot(B)(a1-8) \istb{2}[l] \istb \istb \istb \istb \istb \istb{8}[r] \endist
\istroot(C)(a7-8) \istb{1}[l] \istb \istb \istb \istb \istb \istb{8}[r] \endist
\istroot(Bx)(B-7) \istb{2}[l] \istb \istb \istb \istb \istb{7}[r] \endist
\istroot(By)(Bx-1) \istb{3}[l] \istb \istb \istb \istb{7}[r]  \endist
\istroot(Bz)(By-1) \istb{4}[l] \istb \istb \istb{7}[r]  \endist
\xtPayoff(Bz-4){\vdots}    \xtPayoff(Bz-4){\cdots}[right,xshift=10pt]
\end{istgame}
\end{tcblisting}


%\clearpage
\subsection{Selten's horse}

\begin{tcblisting}{listing outside text, righthand width=.4\linewidth}
% Selten's horse: IGT 331.2 (Osborne, 2004b)
\begin{istgame}
\xtdistance{8mm}{16mm}
\istroot[-45](0)[initial node]{1}
  \istb{D}[r]
  \istb<grow=east,level distance=30mm>{C}[a]
  \endist
\istroot(1)(0-1)+10mm..20mm+
  \istb{L}[al]{3,3,2}
  \istb{R}[ar]{0,0,0}
  \endist
\istroot[-45](a)(0-2){2}
  \istb{d}[r]
  \istb<grow=0,level distance=20mm>{c}[a]{1,1,1}[r]
  \endist
\istroot(a1)(a-1)+10mm..20mm+
  \istb{L}[al]{4,4,0}
  \istb{R}[ar]{0,0,1}
  \endist
\xtInfoset(1)(a1){3}
\end{istgame}
\captionof{figure}{IGT 331.2}
\end{tcblisting}


\subsection{Centipede game}

\begin{tcblisting}{}
% centipede
\begin{istgame}[scale=1.5]
\setistmathTF*001
\setistgrowdirection{south east}
\xtdistance{10mm}{20mm}
\istroot(0)[initial node]{1}
  \istb{Take}[r]{(2,0)}[b]  \istb{Pass}[a]  \endist
\istroot(1)(0-2){2}
  \istb{Take}[r]{(1,3)}[b]  \istb{Pass}[a]  \endist
\istroot(2)(1-2){1}
  \istb{Take}[r]{(4,2)}[b]  \istb{Pass}[a]  \endist
\xtInfoset(2-2)([xshift=5mm]2-2)
%-------------
\istroot(3)([xshift=5mm]2-2){2}
  \istb{Take}[r]{(97,99)}[b]  \istb{Pass}[a]  \endist
\istroot(4)(3-2){1}
  \istb{Take}[r]{(100,98)}[b]  \istb{Pass}[a]  \endist
\istroot(5)(4-2){2}
  \istb{Take}[r]{(99,101)}[b]  \istb{Pass}[a]{(100,100)}[r]  \endist
\end{istgame}
\end{tcblisting}


%\clearpage
\subsection{Poker game}

% poker
\begin{tcblisting}{}
% poker: growing south
\begin{istgame}[scale=1.7]
\setistmathTF*001
\xtShowEndPoints
\xtdistance{15mm}{30mm}
\istroot(0)[chance node]{N}
  \istB{Black}[al]{$\frac12$}[br]
  \istB{Red}[ar]{$\frac12$}[bl]
  \endist
\xtdistance{15mm}{30mm}
\istroot(1-1)(0-1){1}
  \istbA(.5)<grow=-135>{Fold}[al]{1,-1}
  \istb{Raise}[ar]
  \endist
\xtdistance{10mm}{20mm}
\istroot(1)(1-1-2)
  \istb{Pass}[al]{1,-1}
  \istb{Meet}[ar]{2,-2}
  \endist
\xtdistance{15mm}{30mm}
\istroot(1-2)(0-2){1}
  \istbA(.5)<grow=-135>{Fold}[al]{-1,1}
  \istb{Raise}[ar]
  \endist
\xtdistance{10mm}{20mm}
\istroot(2)(1-2-2){}
  \istb{Pass}[al]{1,-1}
  \istb{Meet}[ar]{-2,2}
  \endist
\xtInfoset(1)(2){2}
\end{istgame}
\end{tcblisting}


\subsection{Poker game: growing to the right}
\label{p:poker-right}

\begin{tcblisting}{}
% poker: growing east -- counterclockwise
\begin{istgame}[scale=1.3]
\setistmathTF*001
\setistgrowdirection{0}   % default grow-direction is 'east' from now on
\xtdistance{15mm}{30mm}
\istroot(0)[chance node]<left>{N}
  \istB{Black}[bl]{$\frac12$}[ar]
  \istB{Red}[al]{$ \frac12$}[br]
  \endist
\xtdistance{15mm}{30mm}
\istroot(1-1)(0-1)<left>{1}
  \istb<grow=-45,level distance=10mm>{Fold}[bl]{1,-1}
  \istb{Raise}[al]
  \endist
\xtdistance{12mm}{24mm}
\istroot(1)(1-1-2)
  \istb{Pass}[bl]{1,-1}
  \istb{Meet}[al]{2,-2}
  \endist
\xtdistance{15mm}{30mm}
\istroot(1-2)(0-2)<left>{1}
  \istb<grow=-45,level distance=10mm>{Fold}[bl]{-1,1}[[xshift=5pt]below]
  \istb{Raise}[al]
  \endist
\xtdistance{12mm}{24mm}
\istroot(2)(1-2-2)
  \istb{Pass}[bl]{1,-1}
  \istb{Meet}[al]{-2,2}
  \endist
\xtCInfosetO[fill=blue!20](1-1-2)(1-2-2){2}
\end{istgame}
\end{tcblisting}

\begin{tcblisting}{}
% poker: growing east -- clockwise (swap version)
\begin{istgame}[scale=1.3]
\setistmathTF*001
\setistgrowdirection'{0}   % \setistgrowdirection'
\xtdistance{15mm}{30mm}
\istroot(0)[chance node]<left>{N}
  \istB{Black}[al]{$\frac12$}[br]
  \istB{Red}[bl]{$\frac12$}[ar]
  \endist
\xtdistance{15mm}{30mm}
\istroot(1-1)(0-1)<left>{1}
  \istb<grow=45,level distance=10mm>{Fold}[al]{1,-1}
  \istb{Raise}[bl]
  \endist
\xtdistance{12mm}{24mm}
\istroot(1)(1-1-2)
  \istb{Pass}[al]{1,-1}
  \istb{Meet}[bl]{2,-2}
  \endist
\xtdistance{15mm}{30mm}
\istroot(1-2)(0-2)<left>{1}
  \istb<grow=45,level distance=10mm>{Fold}[al]{-1,1}
  \istb{Raise}[bl]
  \endist
\xtdistance{12mm}{24mm}
\istroot(2)(1-2-2)
  \istb{Pass}[al]{1,-1}
  \istb{Meet}[bl]{-2,2}
  \endist
\xtInfosetO[fill=red!20](1-1-2)(1-2-2){2}
\end{istgame}
\end{tcblisting}

\subsection{Signaling games}

\begin{tcblisting}{listing above text,halign lower=center}
% signaling game: IGT 337.1 (Osborne, 2004b)
\begin{istgame}
\setistgrowdirection'{right}
% game start: choice of chance
\xtdistance{20mm}{20mm}
\istroot(0)[chance node]<180>{Chance}
  \istB<grow=north>{H}[l]{\pi}[r]  \istB<grow=south>{L}[l]{1-\pi}[r]  \endist
\istroot(H0)(0-1)<180>{F}
  \istb{(p_1,E)}[a]  \endist
\istroot(L0)(0-2)<180>{F}
  \istb{(p_1,E)}[a]  \endist
\setistmathTF*001
\cntmdistance*{10mm}{20mm}{8mm}
% subtree after H is chosen
\istroot(H)(H0-1)
  \istb{Buy}[br]  \istb{Refrain}[ar]{-E,0}  \endist
\istrootcntm(H1)(H-1)
  \istb{$p_2^H$}[b]  \istbm  \endist
\istroot(CH)(H1-1)<[label distance=-4pt]135>{C}
  \istb{Buy}[br]{p_1-E-c_H+p_2^H-c_H, 2H-p_1-p_2^H}
  \istb{Refrain}[ar]{p_1-E-c_H, H-p_1}
  \endist
% subtree after L is chosen
\istroot(L)(L0-1)
  \istb{Buy}[br]  \istb{Refrain}[ar]{-E,0}  \endist
\istrootcntm(L1)(L-1)
  \istbm  \istb{$p_2^L$}[a]  \endist
\istroot(CL)(L1-2)<[label distance=-4pt]-135>{C}
  \istb{Buy}[br]{p_1-E-c_L+p_2^L-c_L, 2L-p_1-p_2^L}
  \istb{Refrain}[ar]{p_1-E-c_L, L-p_1}
  \endist
\xtInfoset(H)(L){C}[left]
\end{istgame}
\end{tcblisting}

\xbigskip2

\begin{tcblisting}{listing outside text, righthand width=.5\linewidth}
% signaling game
\begin{istgame}[scale=1.3]
\xtdistance{20mm}{20mm}
\istroot(0)[chance node]{$c$}
  \istb<grow=left>{\frac12}[a]
  \istb<grow=right>{\frac12}[a]
  \endist
\xtdistance{10mm}{20mm}
\istroot(1)(0-1)<180>{1}
  \istb<grow=north>{a}[l]
  \istb<grow=south>{b}[l]
  \endist
\istroot(2)(0-2)<0>{1}
  \istb<grow=north>{a}[r]
  \istb<grow=south>{b}[r]
  \endist
\istroot'[north](a1)(1-1)
  \istb{L}[bl]{-1,0}
  \istb{R}[br]{0,-1}
  \endist
\istroot(b1)(1-2)
  \istb{L}[al]{2,0}
  \istb{R}[ar]{0,2}
  \endist
\istroot(a2)(2-2)
  \istb{L}[al]{3,0}
  \istb{R}[ar]{0,3}
  \endist
\istroot'[north](b2)(2-1)
  \istb{L}[bl]{1,0}
  \istb{R}[br]{0,1}
  \endist
\xtInfoset(a1)(b2){2}
\xtInfoset(b1)(a2){2}
\end{istgame}
\end{tcblisting}


%\clearpage
\setsecnumdepth{chapter}
\section{Version history}

\begin{itemize}
\item v\tmpversion (\tmpdate) to be upload to CTAN
  \begin{itemize}
  \item changed the title of the package to ``Draw Game Trees with \Tikz"
  \item package document done
  \end{itemize}
\item v2.0rc (2019/01/27)
  \begin{itemize}
  \item introduced \cmd{\setxtinfosetstyle}
    \begin{itemize}
    \item introduced \xw{infoset style}, a new style for information sets
    \item modified all definitions of information sets, accordingly
    \end{itemize}
  \item redefined macros related to layer, to easily restore default values
  \item modified the cross arrow tip options
  \item modified defaults of \cmd{\setxtarrowtips} not to depend on branch styles initially
  \item code refinement
  \end{itemize}
\item v2.0beta1 (2019/01/26)
  \begin{itemize}
%  \item beta test
  \item introduced \cmd{\xtshowXpoints} and \cmd{\xtshowXcircles} (for developer only, not documented)
  \end{itemize}
%\item v1.99x (2019/01/24)
%  \begin{itemize}
%  \item changed \xw{expl3} macros
%    \begin{itemize}
%    \item \verb+\str_case_x:nnTF+ to \verb+\str_case_e:nnTF+ and then to \verb+\str_case:nnTF+
%    \item \verb+\str_if_eq_x:nnTF+ to \verb+\str_if_eq:eeTF+ and then to \verb+\str_if_eq:nnTF+
%    \end{itemize}
%  \item modified macros on arrows and middle arrows
%  \item redefined \cmd{\xtTimeLineH} and \cmd{\xtTimeLineV} to deal with swap of branches
%  \item modified \cmd{\xtCommentTo} and \cmd{\xtCommentFrom} for the last option delimiters
%  \end{itemize}
%\item v1.99w (2019/01/21)
%  \begin{itemize}
%  \item fixed bug in \cmd{\xtInfosetO} regarding \cmd{\xtinfosetheihtvar} for \xw{rounded corner}
%  \item corrected \cmd{\cntmistb} and \cmd{\cntmAistb}
%    \begin{itemize}
%    \item separated options for \cmd{\cntmAistb} from those for \cmd{\cntmistb}
%    \item those two are independent to each other (except the way to deal with endpoints)
%    \end{itemize}
%  \item redefined \cmd{\endist} to restore initial values after each execution of the \verb+cntm(A)istb+ 
%    \begin{itemize}
%    \item but not for the effect of printing endpoints
%    \item (internally introduced) \cmd{\cntmistbVariablesRestore}
%    \item (internally introduced) \cmd{\cntmAistbVariablesRestore}
%    \end{itemize}
%  \item introduced \cmd{\xtHideEndPoints*} for extra work for continuum endpoints
%  \item introduced \cmd{\cntmAlayerpreset}, with \xw{behind} as default
%  \item redefined \cmd{\xtShowArrows} to add an option for a node style
%  \item changed the order of options for \cmd{\setxtshowarrows}
%  \item changed the order of options for \cmd{\setxtarrowtips}
%  \item renamed \cmd{\setxtmidarrows} to \cmd{\setxtarrowtips}
%  \end{itemize}
%\item v1.99v (2018/01/17)
%  \begin{itemize}
%  \item redefined the \env{istgame} environment and \cmd{\istgameScaleCallTestAndAdjust} 
%        to take care of simultaneous use of \xw{xscale} and \xw{yscale}.
%  \item modified macros to make singleton information sets scaled accordingly when needed
%    \begin{itemize}
%    \item \cmd{\xtInfosetO}, \cmd{\xtCInfosetO}, \cmd{\cntmAInfosetO}, \cmd{\istgameScaleCallTestAndAdjust}
%    \item (internally) added \cmd{\xtinfosetheightvar} and \cmd{\cntminfosetheightvar}
%    \end{itemize}
%  \end{itemize}
%\item v1.99u (2019/01/15)
%  \begin{itemize}
%  \item redefined macros to deal with local change of sibling distances
%    \begin{itemize}
%    \item redefined \cmd{\istrootcntm}, \cmd{\istrootcntmA}, \cmd{\istrootocntm}, \cmd{\istrootocntmA}, 
%    \item redefined \cmd{\istbA}, \cmd{\istbAt}
%    \item redefined \cmd{\cntmpreset}, \cmd{\cntmApreset}  -- NEED TO GO BACK (no need call test)
%    \end{itemize}
%  \item redefined \cmd{\xtCInfoset} to add abbreviations for the position of owners
%  \item redefined \cmd{\xtCInfoset} to print a singleton information set
%  \item modified \cmd{\xtCInfoset} to change the way of input for its position (\xw{add to \textbackslash cntmApos})
%  \end{itemize}\
%\item v1.99t (2019/01/13)
%  \begin{itemize}
%  \item redefined macros to deal with local change of level and sibling distances for \cmd{\istbA}
%    \begin{itemize}
%    \item code complication, inevitable to take care of too many cases
%    \item redefined \cmd{\istroot} and \cmd{\istrooto}
%    \item redefined \cmd{\istrootcntm} and its variants
%    \item redefined \cmd{\istbA} and \cmd{\istbAt}
%    \end{itemize}
%  \end{itemize}
%\item v1.99s (2019/01/10)
%  \begin{itemize}
%  \item modified \cmd{\xtCInfosetO} for better results when swapped with \xw{plotfactor} less than 1
%  \item modified \cmd{\istrootcntm} and its variants for better results of shrunken continua
%  \item redefined \cmd{\xtTimeLineH} (for a horizontal time-line)
%  \item introduced \cmd{\xtTimeLineH(')} for a vertical time-line
%  \item introduced \cmd{\xtCInfosetOTurnX} for turning X circles to use it just in case
%  \end{itemize}
%\item v1.99r (2019/01/07)
%  \begin{itemize}
%  \item redefined \cmd{\istrootcntm} and \cmd{\istrootocntm} for smaller triangle continua of branches 
%  \item introduced \cmd{\cntmpreset} and \cmd{\cntmpreset*}
%  \item put `call test' for cases of how to change level distance with \cmd{\istbA}
%  \item modified \cmd{\xtCInfosetO} and \cmd{\cntmAInfosetO} for coloring
%  \end{itemize}
%\item v1.99q (2019/01/05)
%  \begin{itemize}
%  \item modified \cmd{\xtInfosetO} to print a singleton information set by a circle.
%  \item finished fine-tuning \cmd{\cntmAInfosetO} (for tuning base circles)
%  \end{itemize}
%\item v1.99p (2019/01/02)
%  \begin{itemize}
%  \item redefined \cmd{\xtInfoset} and \cmd{\xtInfosetO} in accordance with new \cmd{\xtCInfosetO}
%  \item redefined completely \cmd{\cntmAInfoset} and \cmd{\cntmAInfsetO} in the way of \cmd{\xtCInfosetO}
%  \item redefined \cmd{\cntmAInfoset}, \cmd{\cntmAInfosetO}, \cmd{\istrootcntmA}, and \cmd{\istrootocntmA}
%    \begin{itemize}
%    \item to compensate the dependency of arcs on the ratio of \cmd{\cntmlevdist} to \cmd{\cntmsibdist}
%    \end{itemize}
%  \end{itemize}
%\item v1.99o (2018/12/31)
%  \begin{itemize}
%  \item redefined completely \cmd{\xtCInfosetO} and \cmd{\xtCInfoset} for enhancement
%    \begin{itemize}
%      \item (internally) added \cmd{\setxtCIAngleAccordingtoGrowswapCallForCI}
%      \item to make it possible for the control points to turn accordingly along the base circles 
%            for sides of curved information sets
%    \end{itemize}
%  \end{itemize}
%\item v1.99n (2018/12/27)
%  \begin{itemize}
%  \item redefined \cmd{\setistmathTF*} to make it work with basic text font styles
%    \begin{itemize}
%    \item \cmd{\istownertextfont}, \cmd{\istactionlabeltextfont}, \cmd{\istpayofftextfont}
%    \item all working only in text mode
%    \end{itemize}
%  \item introduced \cmd{\xtcureslopedlabelsNS} and \cmd{\xtcureslopedlabelsEW} to resolve a \Tikz\ conflict to sloped labels
%    \begin{itemize}
%    \item (internally) added \cmd{\xtlevdistadj} and \cmd{\xtsibdistadj}
%    \end{itemize}
%  \end{itemize}
%\item v1.99m (2018/12/21)
%  \begin{itemize}
%  \item added starred versions that work with \cmd{\setistmathTF}
%  \begin{itemize}
%  \item \cmd{\xtInfoset*}, \cmd{\xtInfosetO*}, \cmd{\xtCInfoset}, \cmd{\xtCInfosetO}
%  \item \cmd{\xtOwner*}, \cmd{\xtActionLabel*}, \cmd{\xtPayoff*}, \cmd{\xtInfosetOwner*}
%  \end{itemize}
%  \end{itemize}
%\item v1.99l (2018/12/18)
%  \begin{itemize}
%  \item changed the order and the type of argument delimiters for input consistency
%    \begin{itemize}
%    \item \cmd{\xtCInfosetO}, \cmd{\cmtmAinfosetO}, and their related macros
%    \item effective from \xw{v.1.99l}
%      \begin{itemize}
%      \item not consistent with the earlier versions of update
%      \item but intact with the \xw{version 1}
%      \end{itemize}
%    \end{itemize}
%  \end{itemize}
%\item v1.99k (2018/12/15)
%  \begin{itemize}
%  \item introduced \cmd{\xtCInfosetO} for bubble type curved information sets
%    \begin{itemize}
%    \item (internally) added \cmd{\xtPrototypeForCInfosetO} -- only for \cmd{\xtCInfosetO}
%    \end{itemize}
%  \end{itemize}
%\item v1.99j (2018/12/11)
%  \begin{itemize}
%  \item introduced \cmd{\xtCInfoset} for curved information sets
%    \begin{itemize}
%    \item (internally) added \cmd{\istgameScaleCallTestAndAdjust} (must be used in a group)
%    \item (internally) added \cmd{\setxtCIAngleAccordingtoGrowswapCall}
%    \end{itemize}
%  \end{itemize}
%\item v1.99i (2018/12/08)
%  \begin{itemize}
%  \item (macro name change,  effective from \xw{v1.99i}) all `\xw{cntmarc}' changed to `\xw{cntmA}'
%  \item introduced \cmd{\cntmAInfosetO}
%  \item introduced \cmd{\cntmAexpostShowEndPoints}
%  \item introduced \cmd{\istbA(*)} and \cmd{\istbAt(*)}
%  \end{itemize}
%\item v1.99h (2018/11/07)
%  \begin{itemize}
%  \item changed the default position of a continuum arc from \xw{.5} to \xw{1}
%  \item introduced \cmd{\cntmarcInfoset}
%  \end{itemize}
%\item v1.99g (2018/09/30)
%  \begin{itemize}
%  \item put \cmd{\xtShowArrows} and \cmd{\xtShowMidArrows} into \cmd{\istB}
%  \item found issues with \cmd{\xtShowArrows} and \cmd{\xtShowMidArrows} related to \xw{postaction}
%  \item added the arrow end shorten option to \cmd{\xtCommentTo} and \cmd{\xtCommentFrom}.
%  \item (internal) minor changes
%    \begin{itemize}
%    \item redefined \cmd{\setistSolidNodeStyle} to keep consistency with other node styles
%    \item redefined \cmd{\setistNullNodeStyle} to keep consistency with other node styles
%    \end{itemize}
%  \end{itemize}
%\item v1.99f (2018/09/19)
%  \begin{itemize}
%  \item (internally) redefined \cmd{\cntmistb} and \cmd{\cntmarcistb} to resolve endpoints problems
%  \begin{itemize}
%    \item (internally) added \cmd{\cntmOUTERistb} and \cmd{\cntmarcOUTERistb}
%    \item (internally) removed \cmd{\cntmendpointsShow} and \cmd{\cntmendpointsPrint}
%    \item (internally) redefined \cmd{\istrootcntm} and its variants accordingly
%  \end{itemize}
%  \end{itemize}
%\item v1.99e (2018/09/15)
%  \begin{itemize}
%  \item introduced \cmd{\xtShowArrows} and \cmd{\xtHideArrows(*)}
%  \item introduced \cmd{\setxtshowarrows}
%  \item introduced \cmd{\xtShowMidArrows} and \cmd{\xtHideMidArrows}
%  \end{itemize}
%\item v1.99d (2018/09/13)
%  \begin{itemize}
%  \item introduced \cmd{\setxtarrowtips} with a tikzstyle \xw{->-}
%  \item introduced new arrow styles: \xw{->>-}, \xw{->>>-}, \xw{-o-}, and \xw{-x-}
%  \end{itemize}
%\item v1.99c (2018/09/09)
%  \begin{itemize}
%  \item introduced \cmd{\cntmistb} and \cmd{\cntmarcistb}
%  \item redefined \cmd{\cntmdistance} to check if \cmd{\cntmactsibdist} is called or not
%  \item (internally) added \cmd{\cntmendpointsShow}
%    \begin{itemize}
%    \item redefined \cmd{\xtShowEndPoints} and \cmd{\xtHideEndPoints} accordingly
%    \item introduced \cmd{\xtShowEndPoints*} (for outermost branches of a continuum)
%    \end{itemize}
%  \item (internally) added \cmd{\cntmendpointsPrint}
%    \begin{itemize}
%    \item redefined \cmd{\istrootcntm} and its variants accordingly
%    \end{itemize}
%  \end{itemize}
%\item v1.99b (2018/09/07)
%  \begin{itemize}
%  \item redesigned \cmd{\istrootcntm} and its variants
%    \begin{itemize}
%    \item removed \cmd{\ISTCntm(')} and \cmd{\ISTCntmArc(')}
%    \end{itemize}
%  \item introduced \cmd{\cntmdraw}, \cmd{\cntmdrawset} and related macros
%  \item redfined \cmd{\cntmdistance} to check if \cmd{\cntmactsibdist} is called or not
%  \end{itemize}
%\item v1.99a (2018/09/05)
%  \begin{itemize}
%  \item introduced \cmd{\setistgameshorten} (for \env{istgame} environment option)
%  \end{itemize}
%\item v1.98 (2018/09/03)
%  \begin{itemize}
%  \item redefined \cmd{\istrootcntm(arc)} to make it work with \cmd{\setistmathTF(*)}
%  \item redefined \cmd{\istrootocntm(arc)} to make it work with \cmd{\setistmathTF(*)}
%  \end{itemize}
%\item v1.97 (2018/09/02)
%  \begin{itemize}
%  \item redefined \cmd{\istroot(o)} to resolve tex expansion problems
%  \item redefined \cmd{\istrootcntm(arc)} to resolve tex expansion problems
%  \item redefined \cmd{\istrootocntm(arc)} to resolve tex expansion problems
%  \item redefined the \env{istgame} environment to add \xw{[shorten >=0pt]} if \xw{[->]} exists
%  \end{itemize}
%\item 1.96 (2018/08/30)
%  \begin{itemize}
%  \item minor changes
%    \begin{itemize}
%    \item altered the default sibling distance of \cmd{\xtdistance} from \xw{15mm} to \xw{\levdist}
%    \item altered initial options for \xw{null}, \xw{solid}, and \xw{hollow} nodes (added \xw{thin}, \xw{solid})
%    \item added \xw{text depth=.25ex} for some definitions
%    \end{itemize}
%  \end{itemize}
%\item v1.95 (2018/08/27)
%  \begin{itemize}
%  \item resolved dimension issues for \cmd{\cntmdistance}
%  \item added \cmd{\xtOwner*}, \cmd{\xtActionLabel*}, \cmd{\xtPayoff*} (working with \cmd{\setistmathTF(*)})
%  \end{itemize}
%\item v1.94 (2018/08/22)
%  \begin{itemize}
%  \item resolved tex expansion issues in the macros for a continuum of branches
%  \end{itemize}
%\item v1.93 (2018/08/19)
%  \begin{itemize}
%  \item introduced \cmd{\setistmath} to set input mode for owners, action labels, and payoffs
%  \item introduced \cmd{\setistmath*} to print action labels in italics, in case of text mode
%  \item (internally) added \cmd{\istownerstyle}, \cmd{\istactionlabelstyle}, and \cmd{\istpayoffstyle}
%  \end{itemize}
%\item v1.92 (2018/08/17)
%  \begin{itemize}
%  \item redesigned the \env{istgame} environment
%    \begin{itemize}
%    \item to extract the number input from \xw{scale}, \xw{xscale}, or \xw{yscale}
%    \item added \cmd{\xtscale}, \cmd{\xtxscale}, and \cmd{\xtyscale} to save scale option values
%    \end{itemize}
%  \item tested to apply scale values to improve the result of \cmd{\xtInfosetO}
%  \end{itemize}
%\item v1.91 (2018/08/16)
%  \begin{itemize}
%  \item many changes to resolve expansion problems
%    \begin{itemize}
%    \item redefined \cmd{\cntmset}, \cmd{\cntmarcset}, and related macors
%    \item redifined \cmd{\cntmlevdist} and \cmd{\cntmsibdist} as lengths
%    \end{itemize}
%  \end{itemize}
%\item v1.9 (2018/08/11)
%  \begin{itemize}
%  \item introduced \cmd{\cntmarcplotfactorset}
%  \end{itemize}
%\item v1.8 (2018/08/09)
%  \begin{itemize}
%  \item made possible to use the directional abbreviations with \cmd{\xtInfoset}
%  \item introduced \cmd{\istrootocntm} and \cmd{\istrootocntmarc} (oval versions)
%  \end{itemize}
%\item v1.7 (2018/08/04)
%  \begin{itemize}
%  \item introduced \cmd{\istbm}
%  \item introduced \cmd{\setistNewNodeStyle}
%  \end{itemize}
%\item v1.6 (2018/08/01)
%  \begin{itemize}
%  \item resigned \cmd{\cntmdistance} (now ready for users)
%    \begin{itemize}
%    \item added \cmd{\cntmactsibdist} to distinguish it from \cmd{\cntmsibdist}
%    \end{itemize}
%  \item added \cmd{\cntmdistance*} to incorporate with \cmd{\xtdistance}
%  \item introduced \cmd{\istrootcntmA(')}
%    \begin{itemize}
%    \item added (internally) \cmd{\ISTCntmArc(')}
%    \item added \cmd{\cntmarcset}
%    \end{itemize}
%  \item introduced \cmd{\istrootcntm(')}
%    \begin{itemize}
%    \item added (internally) \cmd{\ISTCntm(')}
%    \end{itemize}
%  \item (internally) renamed \cmd{\istCntmRoot(Arc)} to \cmd{\obsoleteISTCntm(Arc)}
%  \end{itemize}  
%\item v1.5 (2018/07/26)
%  \begin{itemize}
%  \item introduced \cmd{\setxtinfosetlayer}
%  \item introduced \cmd{\setxtsubgamelayer}
%  \end{itemize}
%\item v1.4 (2018/07/12)
%  \begin{itemize}
%  \item completely rewrote \cmd{\xtInfosetO} to deal with sloped information sets
%    \begin{itemize}
%    \item removed \cmd{\xtInfosetO'} and \cmd{\xtInfoset'} (critical change for users!)
%    \end{itemize}
%  \end{itemize}
%\item v1.3 (2018/07/06)
%  \begin{itemize}
%  \item (internally) renamed some macros (such as \cmd{\xt@...})
%  \item (internally) renamed \cmd{\xtaction} to \cmd{\istaction}
%  \item (internally) renamed \cmd{\xtpayoff} to \cmd{\istpayoff}
%  \item (internally) renamed \cmd{\istRoot(O)} to \cmd{\ISTRoot(O)}
%  \end{itemize}
%\item v1.2 (2017/12/11)
%  \begin{itemize}
%  \item replaced \cmd{\istb.} by \cmd{\istbt} (critical change for users!)
%    \begin{itemize}
%    \item \cmd{\istb} redefined accordingly
%    \item this is the cost of introducing \cmd{\istB(*)}
%    \end{itemize}
%  \item introduced \cmd{\istB(*)} to deal with dual action labels
%  \item added \cmd{\istbt(*)} and \cmd{\istBt(*)}
%  \item added \xw{text depth=.25ex} as an option to \cmd{\istroot} and \cmd{\istrooto}
%  \end{itemize}
%\item v1.1 (2017/10/02)
%  \begin{itemize}
%  \item introduced \cmd{\xtCommentTo} and \cmd{\xtCommentFrom}
%  \item introduced \cmd{\xtTimeLineH(')}
%  \item redefined \cmd{\xtActionLabel} to deal with sloped labels
%  \item replaced \cmd{\tikzstyle} by \cmd{\tikzset}
%  \end{itemize}
\item v1.0 (2017/09/04)
  \begin{itemize}
  \item introduced \cmd{\cntmlevdist} and \cmd{\cntmsibdist}
  \item introduced \cmd{\cntmdistance}
  \item redefined related marcos
  \item package document done
  \end{itemize}
%%%\item v1.0 (2017/09/04) ready to submit to CTAN
%%%  \begin{itemize}
%%%  \item introduced \cmd{\cntmlevdist} and \cmd{\cntmsibdist}
%%%  \item introduced \cmd{\cntmdistance} (for internal use)
%%%  \item redefined related marcos.
%%%  \item package document done
%%%  \end{itemize}
%%%\item v0.99g (2017/08/21)
%%%  \begin{itemize}
%%%  \item redefined the \env{istgame} environment to add \xw{>=stealth} as default
%%%  \item added \xw{text depth=.25ex} as an option to \cmd{\istb} to get better alignment of action labels
%%%  \end{itemize}
%%%\item v0.99f (2017/08/02)
%%%  \begin{itemize}
%%%  \item redefined \cmd{\xtInfosetO(')}
%%%    \begin{itemize}
%%%    \item added \verb+\begin{scope}[on background layer]...\end{scope}+
%%%    \end{itemize}
%%%  \end{itemize}
%%%\item v0.99e (2017/08/01)
%%%  \begin{itemize}
%%%  \item introduced the prime(\xw{'}) versions to deal with \xw{grow'} (this is the swap version in \TikZ)
%%%  \item redefined \cmd{\istroot(')}
%%%  \item defined \cmd{\istrooto(')} to replace \cmd{\istroot*}
%%%    \begin{itemize}
%%%    \item \cmd{\istroot*} completely replaced by \cmd{\istrooto}
%%%    \end{itemize}
%%%  \item redefinde \cmd{\istcntm}
%%%  \item defined \cmd{\istcntmarc}
%%%    \begin{itemize}
%%%    \item \cmd{\istcntm*} completely replaced by \cmd{\istcntmarc}
%%%    \end{itemize}
%%%  \item redefined \cmd{\xtInfoset(')} and \cmd{\xtInfosetOwner(')}
%%%  \item introduced \cmd{\xtInfosetO(')}
%%%    \begin{itemize}
%%%    \item \cmd{\xtInfoset*} completely replaced by \cmd{\xtInfosetO}
%%%    \end{itemize}
%%%  \item introduced \cmd{\xt@growswap} introduced
%%%  \item redefined \cmd{\xtNode} accordingly
%%%  \end{itemize}
%%%\item v0.99d (2017/07/27)
%%%  \begin{itemize}
%%%  \item defined \cmd{\xtSubgameBox(*)} and \cmd{\xtSubgameOval(*)} to express a subgame
%%%  \end{itemize}
%%%\item v0.99c (2017/07/20)
%%%  \begin{itemize}
%%%  \item defined \cmd{\xtgrow} to deal with going `clockwise' of branch arrangement
%%%  \item defined \cmd{\setxtgrowkey} to change between \xw{grow} and \xw{grow'}
%%%  \item introduced \cmd{\setistgrowdirection'} by redefining \cmd{\setistgrowdirection}
%%%  \item updated `related macros' accordingly
%%%  \end{itemize}
%%%\item v0.99b (2017/07/16)
%%%  \begin{itemize}
%%%  \item renamed \xw{zero node} as \xw{plain node}
%%%  \item added \cmd{\setistPlainNodeStyle}
%%%  \item defined \cmd{\xtNode*} (for a terminal node text with a plain node)
%%%  \item redefined \cmd{\xt<...>NodeStyle} (now all arguments are optional)
%%%  \item renamed \cmd{\isthorizontallabelshift} as \cmd{\istactionlabelxshift}, with default \xw{1pt}
%%%  \item renamed \cmd{\istverticallabelshift} as \cmd{\istactionlabelyshift}, with default \xw{2pt}
%%%  \end{itemize}
%%%\item v0.99a (2017/03/10)
%%%  \begin{itemize}
%%%  \item started rewriting package manual
%%%  \item introduced \cmd{\istb.}\ (for terminal nodes)
%%%  \item redefined \cmd{\xtShowTerminalNodes}
%%%  \item introduced \cmd{\xtShowEndPoints} and \cmd{\xtHideEndPoints}
%%%  \item redefined \cmd{\xtInfoset*}, with \cmd{\xtdefaultinfosep} added
%%%  \end{itemize}
%%%\item v0.9 (2017/02/13)
%%%  \begin{itemize}
%%%  \item some internal macro names changed (\cmd{\xtnode}, \cmd{\xttnode},\cmd{\xtshowtnode})
%%%%  \item conflict with \pkg{tikz-qtree} resolved. (\env{istgame} differs from \env{tikzpicture} with \pkg{tikz-qtree})
%%%%  \item \cmd{\setistbranchanchors} added
%%%  \item added \xw{zero node}
%%%  \end{itemize}
%%%\item v0.8 (2017/01/17)
%%%  \begin{itemize}
%%%  \item macro names changed
%%%    \begin{itemize}
%%%      \item \cmd{\xtdistance}: prefix `\xw{x}' changed to `\xw{xt}' meaning `extensive tree'
%%%      \item \cmd{\xtInfoset(*)}, \cmd{\xtInfosetOwner}, \cmd{\xtActionLabel}, \cmd{xtOwner}, \cmd{\xtPayoff}, \cmd{\xtNode}
%%%      \item \cmd{\xtShowTerminalNodes}, \cmd{\xtHideTerminalNodes}
%%%      \item \cmd{\xtlevdist}, \cmd{\xtsibdist}
%%%    \end{itemize}
%%%  \item \cmd{\xtNode} redefined
%%%  \item some internal macro names changed (including \cmd{\xtpayff}, \cmd{\xtmove})
%%%  \item node styles redefined
%%%  \item \cmd{\setist<Solid>NodeStyle} added for <Various> node styles
%%%  \item \cmd{\setistdefaultnodecolor}, \cmd{setistdefaultnodebgcolor} added
%%%  \end{itemize}
\end{itemize}


\section{Acknowledgement}

The basic idea of the \pkg{istgame} package came from Osborne's \pkg{egameps} package and Chen (2013). 
The update of the package \pkg{istgame} to \xw{version 2.0} is partly motivated by the questions and discussions on the subject of \xw{game tree} at \url{https://tex.stackexchange.com/}, where Alan Munn is thanked for his kind interest in the \pkg{istgame} package.
Special thanks go to Kangsoo Kim of KTUG for his great help in using \pkg{expl3} to simplify the appearance and the usage of the macros, and to resolve the issues on \TeX's expansion.


\section{References}
\hpara{}Chen, H.~K.~(2013), ``Drawing Game Trees with \TikZ,'' \url{http://www.sfu.ca/~haiyunc/notes/Game_Trees_with_TikZ.pdf}.

\hpara{}Cho, I-S.~(2017), ``\pkg{istgame}: Drawing Game Trees with \TikZ,'' in Korean TeX Society, \emph{\TeX, Beyond the World of Typesetting}, Seoul: Kyungmoonsa, 203--237.

\hpara{}Osborne, M.~J.~(2004a), ``Manual for \pkg{egameps.sty},'' Version 1.1, \url{http://texdoc.net/texmf-dist/doc/latex/egameps/egameps.pdf}

\hpara{}\uline{\hphantom{Osborne, M.~J}}~(2004b), \emph{An Introduction to Game Theory}, New York: Oxford.

\hpara{}Tantau, T.~(2015), ``\TikZ\ and PGF: Manual for version 3.0.1a,'' \url{http://sourceforge.net/projects/pgf}.

%\section*{Discussions (in Korean) on KTUG board}
%
%\begin{itemize}
%\item Drawing Game Trees 1: \url{http://www.ktug.org/xe/index.php?document_srl=207287}
%
%\item Drawing Game Trees 1-1: \url{http://www.ktug.org/xe/index.php?document_srl=207513}
%
%\item Drawing Game Trees 1-2:
%\url{http://www.ktug.org/xe/index.php?document_srl=208286}
%
%\item Drawing Game Trees 2: \url{http://www.ktug.org/xe/index.php?document_srl=212043}
%
%\item Drawing Game Trees 2-1:
%\url{http://www.ktug.org/xe/index.php?document_srl=212225}
%
%\item Drawing Game Trees 2-2:
%\url{http://www.ktug.org/xe/index.php?document_srl=212319}
%\end{itemize}