summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/onedown/onedown.dtx
blob: 89f6d5034b88138d88d36aa6527002a104741041 (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
% \iffalse meta-comment
%
% Copyright (C) 2018 by Jacob Wiersma <jack46@online.de>
% ---------------------------------------------------------------------------
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Jacob Wiersma.
%
% This work consists of the files onedown.dtx and onedown.ins
% and the derived filebase onedown.sty.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{onedown.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[2014/05/01]
%<package>\def\ODwstyleversion{1.4}\def\ODwstyledate{2019/10/15}
%<package>\ProvidesPackage{onedown}
%<package> [\ODwstyledate\space v\ODwstyleversion\space 
%<package> Typeset Bridge Diagrams - Jacob Wiersma (C) 2016-2019]
%
%<*driver>
%\documentclass[a4paper,12pt,draft]{ltxdoc}% with draft no hyperrefs
\documentclass[a4paper,12pt]{ltxdoc}
% the package |shortvrb| is auto-loaded, providing |...| as shorthand 
\usepackage[utf8]{inputenc}
%
\usepackage[T1]{fontenc}
\usepackage[german,dutch,french,swedish,english,shorthands=]{babel}
\usepackage{onedown}[2019/10/15]
\usepackage[normalem]{ulem}%   for strikeout todos that are done
\usepackage{needspace}%        keep contiguous lines on one page
\usepackage[inline]{enumitem}% Control various parameters of lists
\usepackage{titlesec}
\usepackage{verbatimbox}%      For env. verbnobox (set font)
%\usepackage[hyphens]{url}%    for typesetting URLs
\setcounter{secnumdepth}{4}
\titleformat{\paragraph}{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\usepackage[numbered]{hypdoc}
%
% add '-' and '/' to the list of URL break characters
% '/' won't work!
%
\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks\do\-\do/\do\/}
%
% Set a nice color for \MacroDef and \EnvDef.
% But not if we want a printout on a monochrome printer
%

\newboolean{NoColor}% to suppress all colors

\AtBeginDocument{%
\ifNoColor
  \setdefaults{colors=b+w}
  \hypersetup{linkcolor=black,urlcolor=black}
  \def\ODwcolor{black}
  \definecolor{defbackgr}{rgb}{1,1,1}
  \definecolor{optbackgr}{named}{lightgray}
\else
  \def\ODwcolor{red}
  \definecolor{defbackgr}{rgb}{1,1,0.75}
  \definecolor{optbackgr}{named}{lime}
\fi
}%
%
\newlength\defwidth
%
% We need to typeset optional args without \meta too!
%\newcommand\Oarg[1]{{\ttfamily[}#1{\ttfamily]}}
\newcommand\Oarg[1]{\colorbox{optbackgr}{\textbf{#1}}}
%
\NewDocumentCommand\MacroDef{st+mO{}}{%
% \MacroDef* + {macroname}[args]
%          1 2      3       4
% #1 flags if macroname is multi-lingual
% #2 flags if macroname is put in the list of user commands
% #3 is the macroname that we describe
% #4 are the possible args of macroname
%
 \bgroup
  \IfBooleanTF#2{\usercom{#3}}{}%
  \setlength{\fboxsep}{4pt}\setlength{\fboxrule}{1.25pt}%
  \setlength\defwidth\linewidth%
  \addtolength\defwidth{-2\fboxrule}%
  \addtolength\defwidth{-2\fboxsep}%
  \fcolorbox{black}{defbackgr}{%
     \makebox[\defwidth][l]{%
       \IfBooleanTF#1{\ML}{}%
       \texttt{\footnotesize\bs#3#4}%
     }%
  }%
  \par\vspace{0.5\baselineskip}\noindent%
 \egroup
}% MacroDef
%
\NewDocumentCommand\EnvDef{st+mO{}}{%
% \EnvDef*  + {env-name}[args]
%       #1 #2     #3    #4
% #1 flags if env-name is multi-lingual
% #2 flags if env-name is put in the list of user commands
% #3 is the env-name that we describe
% #4 are the possible args of env-name
%
 \bgroup
  \IfBooleanTF#2{\usercom[]{#3 (env)}}{}%
  \setlength{\fboxsep}{4pt}\setlength{\fboxrule}{1.25pt}%
  \setlength\defwidth\linewidth%
  \addtolength\defwidth{-2\fboxrule}%
  \addtolength\defwidth{-2\fboxsep}%
  \fcolorbox{black}{defbackgr}{%
     \makebox[\defwidth][l]{%
       \IfBooleanTF#1{\ML}{}%
       \texttt{\footnotesize\bs begin\string{#3\string}#4\ldots\bs end\string{#3\string}}
     }%
  }%
  \par\vspace{0.5\baselineskip}\noindent%
 \egroup
}% EnvDEf
%
%
% Special processing of user commands
%
% We supply command NAMES, so we must add the \ afterwards, to make it look
% like a real command in the index
%
\newcommand\bs{%
  \texttt{%
    \upshape% the itshape of meta screws the backslash
    \textbackslash%
  }%
}% bs
%
% \usercom gets the NAME of a command (without \), labels the actual
% position and inserts the appropriate hyperref index entry in the UCFile,
% whilst adding the \ before the command name.
%
\newcommand\usercom[2][\noexpand\bs]{%
  \ifnumequal{\pdfshellescape}{1}{%
    % restricted shell enabled
    \label{#2}%
    \immediate\write\UCFile{%
      \noexpand\hyperref[#2]{%
        #1#2, \thepage\noexpand\newline%
      }%
    }%
  }{}%
}% usercom
%
% We write the user commands (on the fly sorted) in file onedown.odw.
% We must disable | first and enable it again afterwards
%
\ifnumequal{\pdfshellescape}{1}{%
  \newwrite\UCFile
  \DeleteShortVerb{\|}
  \immediate\openout\UCFile="| sort -d > \jobname.odw
  \MakeShortVerb{\|}
}{}
%
% Used to mark MultiLingual macros
%
\newcommand\ML{\textcolor{\ODwcolor}{\textsc{\tiny ML}}\xspace}
%
% Typeset package names 
%
\newcommand\packname[1]{\texttt{#1}\xspace}
%
% Write our own package name a bit special
%
\newcommand\OneDown{\textcolor{\ODwcolor}{\smaller\bfseries\textsc{OneDown}}\xspace}
%
% We translate our multilingual examples
%
\NewDocumentCommand\Translate{smO{german}}{%
  \let\xspaceODwold=\xspace%
  \def\xspace{}%
  \foreignlanguage{#3}{%
    \IfBooleanTF#1{\GetTranslation{#2-(ODw)}}{#2}%
  }%
  \let\xspace=\xspaceODwold%
}% Translate
%
% Put a frame surrounding examples
%
\newcommand\example[1]{\fbox{#1}}
%
% End of user-command 
%
\setdefaults*{game=\sffamily\bfseries\footnotesize,%
              other=\sffamily\bfseries\footnotesize}

\AtBeginDocument{\CodelineIndex
  \EnableCrossrefs}
\AtBeginDocument{\RecordChanges}
\extrafloats{100}
\begin{document}
  \DocInput{onedown.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{3771}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% ^^A Commands to be used for the documentations only
%
% \makeatletter
%   \def\CP{\ODw@Compass}
%   \def\Xfer#1{\ODw@Xfer{#1}}
% \makeatother

%
% ^^A We are onedown now with new versioning!
%
% \changes{v0.1}{2018/01/28}{\\
% - Reorganized the bzr versioning. bzr will contain only onedown, the
% former bidnplay stuff is archived. The ToDo and Known-Bugs lists are
% cleaned. \\
% - We are version 0.1 now, trying to keep the bzr version number equal to
% the changes minor number.}
%
% \changes{v0.2}{2018/02/12}{\\
% - We finally have a List of User Commands. \\
% - In the compass we can print vulner in red and mark the dealer. We have
% a hook \cmd{\CompassMid} to write something in the middle of the
% compass.\\
% - Added several macros to auto-translate common stuff like 'lead' etc.\\
% - Added the danish language. \\
% - Corrected a bug in \cmd{\dealer} and \cmd{\vulner}.\\
% - Removed pgf-key 'lang': we now load the needed languages on the fly.\\
% - Finally we revised the documentation.}
%
% \changes{v0.4}{2018/03/09}{\\
% - Major change in playtricks: the winner is now determined by the cards
% played, and code is added to check consistency.\\
% - Dirty coded macros like \cmd{\ODw@symbol} and \cmd{\ODw@(@)Card(s)} are
% replaced by neat expl3 code.\\
% - We load necesary dictionaries automatically on the fly and enhanced the
% colors options.\\
% - Corrected some minor bugs and reorganized the documentation. \\
% - One can now also generate the documentation without the list of user
% commands}
%
% \changes{v0.5}{2018/03/14}{\\
% - Associated the names and bidders in a fixed way.\\
% - Added checks to onesuitNS/EW.\\
% - Made ODw@OtherFont local where necessary.\\
% - Redefined columntypes.\\
% - Made 'T' a code for '10'.\\
% - Adapted the 'translate' macro to enable both 1H and 1\cmd{\He} etc. \\
% - Enhanced the documentation.}
%
% \changes{v0.6}{2018/03/14}{\\
% - Made all internal names hidden by adding 'ODw@' to it.\\
% - Changed \cmd{\ODw@AccTricksN} in \cmd{\ODw@AccTricks}.\\
% - Some minor adaptions of the documentation}
%
% \changes{v0.7}{2018/03/20}{\\
% - Final(?) edits of the documentation: Consequent use of 'card diagram',
% 'bidding' diagram and 'play diagram'. \\
% - Corrected some minor bugs. \\
% - Changed the name of the 'playtricks' environment into 'play'.\\
% - Can now disable all colors in the manual for monochrome printing.\\
% - Changed signature of \cmd{\expertquiz} and \cmd{\boardtext}.}
%
% \changes{v0.7a}{2018/03/24}{\\
% - Major change: Removed all \cmd{\bidXX} and \cmd{\bidXXpair} commands.\\
% - The biddings can now be shown with \cmd{\showXX+} (with token '\texttt{+}').\\
% - The macros \cmd{\hand-} and the bidding environments suppress their
% output with token '\texttt{-}'}
%
% \changes{v0.8}{2018/04/11}{\\
% - Added package \packname{verbatimbox} to adjust verbatim font easily.\\
% - Added \cmd{\setdefaults} with keys for fonts, compass and bidding
% diagrams.\\
% - Made \cmd{\FirstBidCol} internally hidden.\\
% - Removed \cmd{\longcalls}, \cmd{\CompassMid}, added \cmd{\compassfont}.\\
% - Changed the order of the hands in \cmd{\onesuitAll}.\\
% - Renewed the implementation of the compass and added extra features.}
%
% \changes{v0.9}{2018/04/15}{\\
% - Adapted \cmd{\ODwset} and \cmd{\setdefaults}.\\
% - Separated key \emph{messages} into keys \emph{warn} and \emph{err}.\\
% - Adapted \cmd{\ODw@Compass}. \\
% - Removed legends from \cmd{\showNS}.\\
% - Added \cmd{\sbox1} to all \cmd{\showXX} macros with a N-hand.\\
% - Changed ODw@[No]Warnings and ODw@[No]Errors.\\
% - Corrected some minor bugs and adapted the documentation accordingly.}
%
% \changes{v1.0}{2018/05/23}{\\
% - Adapted the urls, the directories and some filenames to conform to the
% CTAN-standard and made the bundle ready for upload. \\
% - Corrected a small bug in \cmd{\ODw@Compass} that was introduced in
% v0.9.\\
% - Made all relevant text-writing macros in 4 versions with/without tokens
% '*' and '^^21'.\\
% - Corrected a sizing/font bug.\\
% - Added 4 variants of many other text-writing macros, onesuit-NE/NW/.\\
% - Adapted \cmd{\handskip}. \\
% - Added code to work-around a \packname{babel}-\packname{translations}
% inconsistency w.r.t.  norsk/norwegian.}
%
% \changes{v1.1}{2018/09/22}{\\
% - Corrected onedown-ref.tex\\
%    . Added the missing rows in lines 419-422.\\
%    . and the explanational text on line 457.\\
% - Changed in all ODw*.trsl files: The translation of 'pass!' into 'p' and
% 'Pass!' into 'P'.\\
% - Corrected some typos in ShowAll.tex:\\
%    . \cmd{\contract*} into \cmd{\contract},\\
%    . \cmd{\declarer*} into \cmd{\declarer} and\\
%    . \cmd{\lead*} into \cmd{\lead}.\\
% - Removed some illegal chars from changes entries.}
% \changes{v1.2a}{2018/10/10}{\\
% - Enhanced the documention (both onedown.dtx and onedown-ref.tex: The
%   command tokens are no longer shown as '[*^^21]', but as '*^^21' with a
%   different background color.\\
% - Added a thinspace ('\cmd{\,}') before all points counts (HCP, LP, DP
% and TP)\\
% - Improved \cmd{\alert} by using \cmd{\textasteriskcentered} rather than
% just a '*'\\
% - The changes history has a better layout now \\
% - \cmd{\showNS} and \cmd{\showEW} now can selectively display only the N-
% or S-hand, resp the E- or W-hand.}
% \changes{v1.2b}{2018/10/31}{\\
% - Corrected a bug: Added \cmd{\ODw@monochromefalse} in all
% initializations of multi colors in \cmd{\ODw@set}\\
% - Made all relevant setdefaults settings (like bidfirst) non-global\\
% - Made all \cmd{\ODw@BidderX} and \cmd{\ODw@NameX} non-global\\
% - Removed '\cmd{\global}' from \cmd{\ODw@CompShow} (false and true),
% \cmd{\ODw@CompTurn}, \cmd{\ODw@Bidders}, \cmd{\ODw@BidLine} and
% \cmd{\ODw@LongCalls}\\
% - In command \cmd{\suit} changed 'JW   \cmd{\ODw@GameSize}' into
% '\cmd{\ODw@GameSize}'}
% \changes{v1.3a}{2019/02/21}{\\
% - Added \cmd{\HLP} \\
% - Changed/Added in all relevant ODw-lang.trsl: \\
%    - 'V0.4' into 'V0.4-2018/12/01' \\
%    - 'FP' into 'F' , 'fp' into 'f' (entry HCP/hcp) \\
%    - 'Figuren-Punkte' into 'Figurenpunkte' , 'figuren-punkte' into 'figurenpunkte' \\
%    - 'FL' into 'L' , 'f{}l' into 'l' \\
%    - \cmd{\NewDictTranslation\\ \{HLP-(ODw)\}\{FL\}} (german)
% }
% \changes{v1.3b}{2019/03/16}{\\
% - Added setdefaults to the list of User Commands \\
% - Corrected \cmd{\setdefaults} in onedown-examples: \\
%   - changed  [~] into \{\} \\
%   - Adapted/corrected onedown-ref and onedown-examples \\
% - Added color 'gray' for special effects
% }
% \changes{v1.4}{2019/10/12}{\\
% - Made \emph{onedown-ref} independent of \emph{onedown-examples} and \emph{subfiles} \\
% - Corrected some mistakes ODw-*.trsl files, all \texttt{V0.51-2019/10/15} \\
% - Added macro \cmd{\Ten} to get rid of the extra enlargment by 'scalefnt' in \cmd{\gamefont}
% - Added support for the spanish language \\
% - Made onedown-ref.tex and onedown-examples.tex multilangual. We can output the onedown
% commands in all supported languages. \\
% - \cmd{\DeclareSymbolFont \\ \{symbols\}\{OMS\} \{txsy\}\{m\}\{n\}} interferes with package \packname{newtxmath}.
% I renamed \emph{symbols} into \textbf{ODw@symbols} and \emph{symbolsC} into \textbf{ODw@symbolsC}
% to solve this. 
% }
% ^^A Note: ^^21 denotes the exclamation mark (!)
% ^^A Note: Char ' is not allowed within changes
%
% \DoNotIndex{\newcommand,\newenvironment,\BODY,\boolean,\IfEqCase,\IfInteger,
%              \DeclareFontSubstitution,\dimexpr,\ifcat,\ifmmode,\IfValueT,
%              \fontencoding,\fontfamily,\fontseries,\fontshape,\makebox,\StrChar,\StrLen,
%              \mathord,\mdseries,\NewEnviron,\newif,\mskip,\edef,\rotatebox,\width,
%              \newsavebox,\noexpand,\rmfamily,\rule,\sbox,\scshape,\put,\real,
%              \selectfont,\SetSymbolFont,\slshape,\tabcolsep,\color,\cs,\do,\docsvlist,
%              \thinspace,\usebox,\AtBeginDocument,\begingroup,\endgroup,\unitlength,
%              \bgroup,\egroup,\IfValueTF,\newcolumntype,\renewrobustcmd}
% \DoNotIndex{\@ifstar,\\,\,}
% \DoNotIndex{\addtolength,\advance,\alph,\baselineskip,\begin,\bfseries,\macro,
%             \group,\center,\centering,\clubsuit,\collectcell,\count,\def,\ ,\let,
%             \diamondsuit,\dimen,\divide,\dpts,\egroup,\else,\empty,\end,\expandafter,
%             \endcenter,\endcollectcell,\endinput,\ensuremath,\equal,\everypar,
%             \extracolsep,\fbox,\fboxrule,\fboxsep,\fi,\gdef,\global,\ExplSyntaxOff,
%             \hangafter,\hangindent,\hbadness,\hbox,\heartsuit,\hfill,\ExplSyntaxOn,
%             \hline,\hsize,\hskip,\hspace,\hss,\ht,\HUGE,\if,\IfBooleanTF,\moveto,
%             \ifthenelse,\ifx,\itemsep,\kern,\labelsep,\labelwidth,\large,
%             \leftmargin,\leftskip,\lengthtest,\LoadDictionaryFor,\lower,
%             \mathbf,\medskip,\multicolumn,\NeedsTeXFormat,\newboolean,\numexpr,
%             \newcounter,\newdimen,\NewDocumentCommand,\strokepath,\closepath,
%             \NewDocumentEnvironment,\newlength,\noindent,\p@,\par,\whiledo,
%             \parbox,\parfillskip,\parindent,\parsep,\parskip,\partopsep,\lineto,
%             \phantom,\ProvidesPackage,\quad,\raggedright,\raisebox,\linethickness,
%             \relax,\renewcommand,\RequirePackage,\rightmargin,\PackageWarning,
%             \rightskip,\rlap,\setboolean,\setbox,\setcounter,\setlength,
%             \settowidth,\sffamily,\smaller,\larger,\space,\spadesuit,\skip@,
%             \ssmall,\stackbox,\stepcounter,\styledate,\styleversion,\textbf,
%             \textrm,\textsc,\textsf,\textsl,\textwidth,\thefootnote,\ifnumequal,
%             \thinspace,\topsep,\typeout,\vspace,\vtop,\wd,\widthof,\IfFileExists,
%             \xspace,\xspaceaddexceptions,\z@,\PackageWarning,\ForEachTrackedLanguage,
%             \newtoks,\PackageInfo,\provideenvironment,\str,\textit,\Hoffset,\Voffset,
%             \the,\thinmuskip,\thislang,\tl,\tmp,\xdef,\PicSize,\MidSize,
% }
% \DoNotIndex{%
%   \\,\arrayrulewidth,\addtocounter,\cci,\DeclareMathSymbol,\skip@,
%   \DeclareSymbolFont,\footnotemark,\footnotesize,\footnotetext,\isodd,
%   \mathalpha,\pgfkeys,\pgfqkeys,\ProcessPgfOptions,\scriptsize,
%   \shortstack,\superscript,\textcolor,\thinspace,\tiny,\underline,\value}
% \DoNotIndex{\GetTranslation,\ifpdf,\iflanguage,\iffalse,\AfterPackage,
% \ifbool,\setbool,\newbool,\StrSubstitute,\StrCount,\StrDel,\ifcase,
% \ifboolexpr,\ifnumcomp,\or,\overline,\mbox,\@ODw}
% \setcounter{IndexColumns}{2}
% ^^A \providecommand*{\url}{\texttt}
% ^^A\newcommand{\tasc}{\textbf{\raisebox{-0.7ex}[1ex][0pt]{*}}}
% \newcommand{\tasc}{\textbf{\textasteriskcentered}}
% ^^A \newcommand{\plus}{\texttt{\larger{\raisebox{-0.25ex}[1ex][0pt]{+}}}}
% \newcommand{\plus}{\texttt{\larger{\raisebox{-0.25ex}[1ex][0pt]{+}}}}
%^^A set the font for the macros in the margin
% \renewcommand{\MacroFont}{\ttfamily\scriptsize}
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ^^A We must redefine \verb (from doc.sty),
% ^^A because there is no font-changing hook to add \footnotesize
% ^^A This is only for the document, not the style file
%
% \makeatletter
% \def\verb{\relax\ifmmode\hbox\else\leavevmode\null\fi
%   \bgroup \let\do\do@noligs \verbatim@nolig@list
%     \ttfamily\footnotesize \verb@eol@error \let\do\@makeother \dospecials
%     \@ifstar{\@sverb}{\@vobeyspaces \frenchspacing \@sverb}}
%
%  \newcommand\ODwBox{\ODw@Box\xspace}
%
% \makeatother
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \GetFileInfo{onedown.sty}
% \title{The \OneDown package\\[0.5em]
% \normalsize\url{www.ctan.org/pkg/onedown}
% ^^A The frustrating ltxdoc also obfuscates this simple thing!
% \thispagestyle{empty}
% }
% \author{Jacob Wiersma \\ \url{jack@schuli-wirsi.de}}
% \date{v\ODwstyleversion~from \ODwstyledate}
%
% \maketitle
% {
% \gamefont{\sffamily\bfseries\large}
% \otherfont{\rmfamily\bfseries\normalsize}
% \setdefaults{bidfirst=S,bidlong=on,err=on,warn=on}
% \hfill
% \frame{
%   \setdefaults{bidlong=off}
%   \parbox{22em}{
%     \northhand{A32}{QJT}{KQJT9}{QJ}
%     \southhand{KQJT}{9876}{A8}{AK2}
%     \westhand{8765}{AK}{732}{T987}
%     \easthand{94}{5432}{654}{6543}
%     \dealer[\South*!]\vulner[\NorthSouth*!]
%     \leftupper{\dealertext}{\vulnertext}{}
%     \showAll*
%
%     \begin{bidding}*(\explainit{15--17}\\\explainit{quantitative})
%       1N\markit & p & 4N\markit & p \\
%       6N        & X & {\Allpass*} \\
%     \end{bidding}
%
% \setdefaults{warn=off}
%
%     \begin{play}*{W}
%       HK & T & 2 & 6 \\
%       HA & J & 3 & 7 \\
%     \end{play}
%   }
% }
% \hfill
% }
% \setdefaults*{}
% \newpage
% \begin{abstract}\noindent
%  This package implements commands and environments to typeset various bridge
%  diagrams, with or without a |bidding| sequence. It offers following
%  features:
% \begin{itemize}
% \item It is possible to use an own font and/or a font-size with which the
% diagrams will be typeset independently from the main font used in the
% document. This also allows an easy production of overhead slides and for
% digital projection. Different fonts can be used for e.g.\ the bidding
% diagram, its header, the compass, the hands etc. Most diagrams can be
% centered both horizontally and vertically.
%
% \item A special feature is the automated check on consistency of suits
% and hands. If a hand holds more than 13 cards an error is printed, if there
% are less then 13 cards a warning. If a suit over the 4 hands has more
% than 13 cards or if a card appears more than once an error like
% \example{\textcolor{\ODwcolor}{Error: Card \Sp\,8 occurs 2 times}} is printed.
% These warnings and error messages are controlled by the |err| and |warn|
% options, e.g.\ when loading the package.
%  
%  \item The output of the implemented bridge terms like \example{\double}
%  (which you get by calling the command |\double|) are multilingual
%  and get translated automatically. When the language |german| is
%  active the command |\double| would produce
%  \example{\Translate{\double}}. Also the basic symbols like A(ce),
%  K(ing), Q(ueen) and J(ack) are multilingual. So
%  \example{\suit[\Di]{AKQJ}} would automatically become
%  \example{\Translate{\suit[\Di\,]{AKQJ}}} in a German text.
%  
%  \item It is possible to add annotations to a card diagram, like the
%  board number, the dealer or the vulnerability etc.\ on several positions
%  in the diagram (if a board number is given, the dealer and vulnerability
%  are computed automatically). One can also add explanations to the
%  |bidding| diagram, as well as the real world names of the bidders.
%
%  \item There are two specials: a command to typeset a quiz with answers,
%  and an environment to typeset the sequence of playing tricks, where also
%  the total number of tricks won by each side is calculated and displayed.
% \end{itemize}
% \end{abstract}
%
% \tableofcontents
%
% \section{Preface}
%
% I am neither a good bridge player nor a good package writer. But I like
% to read about bridge and when I write about bridge (sometimes a funny
% short story, sometimes some training exercises for beginners) I do feel
% the need for an appropriate tool to support that. Surprisingly enough,
% there exists no comprehensive package on |CTAN| for typesetting bridge
% diagrams. For all those people who feel more or less the same as I do,
% there is this package called \OneDown. As some say: \emph{one down is
% good bridge}\footnote{please, don't discuss the truth-value of this
% statement with me}, I hope that \OneDown is a good bridge package.
%
% You can generate this documentation by running
%
% \iffalse
%<*verb>
% \fi
\begin{verbnobox}[\small]
pdflatex --shell-escape onedown.dtx
makeindex -s gind.ist onedown.idx
makeindex -s gglo.ist -o onedown.gls onedown.glo
pdflatex --shell-escape onedown.dtx
pdflatex --shell-escape onedown.dtx
\end{verbnobox}
% \iffalse
%</verb>
% \fi
% Use:\\
% |pdflatex --shell-escape '\AtBeginDocument{\NoColortrue}\input{onedown.dtx}'|
% as last run to get a pdf for printing on a monochrome printer.
% The |--shell-escape| flag is necesary to generate the list of user
% commands. If you think this is too dangerous, then run pdflatex without
% this flag and you will get the docmentation without the list of user
% command (of about 1 page). In any case you'll find a multi-page reference
% overview of all commands in |onedown-ref.pdf|.
%
% \section{Introduction}
%
% There must be a lot of bridge players who also use \LaTeX{} to typeset
% their documents. And it is almost incredible that on |CTAN| there exist
% no modern package with a decent documentation that supports
% this.

% In 1990 Kees van der Laan \cite{Laan} published an article in
% TUGBoat\footnote{\url{http://tug.org/TUGboat/Articles/tb11-2/tb28laan.pdf}}
% in which he describes how well the \TeX-machinery is able to produce
% beautiful bridge diagrams. Based on this article and examples,
% Johannes
% Braams put these commands together in a style file\footnote{%
% \packname{bridge.sty}, last version v1.7c, 1994/12/20} and added more.
% Some time later René Steiner and Thomas Hof produced the
% \packname{bridge-i} and the \packname{kibitzer}\footnote{both v1.0,
% 1995/04/06} style files, in which they made a lot of 
% enhancements.
% Also others made some efforts in this direction.\footnote{Antony Lee
% released his package \packname{bridge} in 2012 and Gordon Bower his
% package \packname{grbbridge} in 2013. Both are very interesting but offer
% only limited features and are not on CTAN at the time of writing. See
% \url{http://www.bridgebase.com/forums/topic/51967-latex-package-for-typesetting-bridge-related-stuff/}}
 
% Around 2005 I used these style files for
% some tiny projects. The quality of the output was splendid. Putting the
% text and diagrams together was not always easy and the documentation was
% poor. In 2015, after a long pause, I had to produce bridge texts again. I
% enhanced some of the existing stuff and made ad hoc changes in the code,
% which led to smaller and greater catastrophes. Summer 2016 I decided to
% write a new package, based on the work of the previously mentioned
% persons. I called it \OneDown. The central goal was to offer a user
% friendly package with detailed documentation. For example you don't need
% to say |\setlength{\handskip}{5mm}| or |\def\handskip{5mm}| but rather
% call the command |\handskip{1em}|. Not only the call is somewhat
% friendlier, more important, setting the width in terms of the
% font used, it will automatically adapt its size accordingly to font and
% font-size changes. \OneDown features:
% \begin{itemize}
% \item Sizing of diagrams relative to font and font-size.
% \item The font-sizes of the diagrams and text are independent.
% \item Automated translation of all important bridge terms.
% \item Diagrams can optionally contain information about the dealer, who
%       is vulnerable etc.
% \end{itemize}
%
% The \OneDown package is designed to be used for typesetting texts that have to
% do with the game of bridge. It provides not only simple commands like
% |\Sp| which produces the spade symbol \example{\Sp}. Also complete
% card diagrams with the hands of the \north, \east, etc.\ player can
% be defined in several ways. One can select which hands are to be shown.
% Bidding diagrams can be shown stand-alone or in connection with one or
% more hands. In |bidding| diagrams annotations are possible.
%
% \section{Usage}
%
% \subsection{Initialization}
%
% \subsubsection{Requirements}
%
% The package \OneDown depends on several other packages, such as
% \packname{ifthen}, \packname{translations} or \packname{xspace}. All
% these packages get loaded automatically if not already used in your
% document. For a complete overview of all required packages, refer to page
% \pageref{RequirePackage}. All the packages are loaded without any option,
% so the risk of an option clash should be low: Just load your package with
% options \emph{before} \OneDown.
%
% Furthermore, for the several languages that \OneDown supports, there are
% the dictionary files with translations of the specific bridge terms.
% These dictionaries follow the naming convention:
% \texttt{ODw-\meta{language}.trsl} and are included in the bundle. The
% name of the \meta{language} is generally the same as the name that you
% use as option for \packname{babel}. There is one exception: the
% Norwegian language uses |norsk| for \packname{babel} and |norwegian| for
% \packname{translations}. But all the same, the |norwegian| dictionary is
% automatically loaded when |norsk| is used.
%
% Should you make a dictionary for a language that is not provided yet, or
% have corrections for an existing one, please send it to the maintainer,
% so it can be added to the bundle.
%
% \subsubsection{Loading the package}
%
% Simply say |\usepackage{onedown}| in the preamble of
% your document if you want to load \OneDown with its default settings.
%
% \textbf{Warning:} \OneDown loads all necessary |ODw|-dictionaries
% automatically at the begin of the document. In order to know which
% languages must be loaded, these must be specified \emph{before} package
% \packname{onedown} is loaded. In general this means that if you use
% \packname{babel} (or \packname{polyglossia}) you must
% load it before package \OneDown. If for some reason you cannot
% or do not want to do that, you can load any |ODw|-dictionary if you put
% the command: |\LoadDictionaryFor{|\marg{language}|}{ODw}| in your
% preamble, provided that the dictionary is in the \TeX-path. For a
% discussion about the caveats of using e.g.\ babel, refer to section%
% \ref{Languages}.
%
% \subsubsection{Options}\label{Options}
%
% To change the behaviour of \OneDown one can load the package with certain
% options: |\usepackage[|\meta{options}|]{onedown}|. Of course this 'option
% loading' takes place in the preamble. But it is also possible to set (or
% change) options within the document by calling the macro |\setdefaults|.
% This macro uses the same \meta{key}=\meta{val} syntax as is used for the
% options and offers some more keys that cannot be used when loading the
% package. Refer to page~\pageref{Defaults} for  details.
%
% As said before, the package loads its options using the
% \meta{key}=\meta{val} syntax. These options deal with:
% \begin{itemize}
% \item[colors] \verb:colors=0|1|2|3|4A|4B:\\
% The color in which the card symbols will
% be printed. The color options are \textbf{0} (black only), \textbf{1}
% (black and white) \textbf{2} (black and red), \textbf{3} (grey (for special effects)),
% \textbf{4A} (green, orange,
% red and blue), \textbf{4B} (black, orange, red and green). We also
% defined some synonyms, as shown in the table below.
% \par
% Thus loading the package with |\usepackage[colors=X]{onedown}| will print
% \begin{itemize}
%   \item[x=0:] {\setdefaults{colors=0} \Cl, \Di, \He and \Sp}
%               (synonyms:  |mono|, |black|) 
%   \item[x=1:] {\setdefaults{colors=1} \Cl, \Di, \He and \Sp}
%               (synonyms:  |b+w|)
%   \item[x=2:] {\setdefaults{colors=2} \Cl, \Di, \He and \Sp}
%               (synonyms:  |b+r|)
%   \item[x=3:] {\setdefaults{colors=3} \Cl, \Di, \He and \Sp}
%               (synonyms:  |gray|, |grey|)
%   \item[x=4A:] {\setdefaults{colors=4A} \Cl, \Di, \He and \Sp}
%               (synonyms:  |4a|, |fourA|)
%   \item[x=4B:] {\setdefaults{colors=4B} \Cl, \Di, \He and \Sp}
%               (synonyms:  |4b|, |fourB|)
% \end{itemize}
% The default is |colors=2| for printing in black and red. Please note, that |colors=3| is not
% meant to typeset the whole document. You can use it if you want e.g. to repeat something and want
% it to be less apparent. 
% \item[err, warn] \verb:err=on|off:\qquad\verb:warn=|on|off:\\
% These options regulate which messages are to be output. These
% messages have to do with the consistency of cards in
% a suit, in a hand or combined hands. It is an error when a hand has more
% that 13 cards, or when the same card occurs twice or more in a hand or a
% deal. With the option |err=on| (which is the default) these error
% messages appear as output. With |err=off| you can suppress that.
% On the other hand when a suit has less than 13 cards, this must not
% necessarily be wrong. Maybe only some cards are to be shown, e.g.\ in an
% example concerning a finesse. Or when only e.g.\ |E-W| hands are
% concerned, not all cards of the deck will be specified. These situations
% will be caught by setting |warn=on|. To suppress these spurious warnings
% use |warn=off|, which is the default.
% Synonyms for |on| are |1| and |true|. Synonyms for |off| are |0| and
% |false|. This also applies for other keys that do not control a package
% option.
% \end{itemize}
%
% \subsubsection{Active Characters: a Warning}\label{Languages}
%
% \OneDown uses the \packname{tranlation} package to automatically
% translate often appearing brigde terms like e.g.\ \emph{declarer}. It does
% so by looking up these terms in the special |ODw|-dictionary for the
% active language. The current \OneDown version supports English, German,
% Dutch, French, most Scadinavian languages and Turkish. Some dictionaries
% may not be complete or may contain errors, please send
% corrections/additions to the maintainer.
%
% \needspace{5\baselineskip}
%
% \paragraph*{\textcolor{red}{\centering Warning for people using active
% characters.}}
%
% Some language packages fiddle around making characters active.
% This can have unexpected influence on \OneDown.
% The |=|~sign is used when loading the package \packname{onedown} to
% specify options.
% It appears also in calls like |\setdefaults{warn=on}|. 
% We also use the following characters as tokens for optional arguments
% with the meaning as shown in this list:
% \begin{itemize}[itemsep=-1mm,topsep=-0em]
% \item[|*|] to center diagrams or print a long or capitalized text 
% \item[|!|] special action like short names of vertical layout
% \item[|-|] to hide what would normally been shown
% \item[|+|] to show what would normally be hidden
% \end{itemize}
% \par\noindent
% To give you an idea what e.g.\ babel can cause we cite from 
% \emph{The Turkish style for babel}:\par
% \begin{quote}
% Turkish typographic rules specify that a little 'white space' should be
% added before the characters ':', '!' and '='. In order to insert this
% white space automatically these characters are made |\active|, so they
% have to be treated in a special way.
% \end{quote}
% So babel-Turkish makes the equal sign and exlamation mark active. This
% leads to errors when you call e.g.\ |\setdefaults{warn=on}| or |\hand!|.
% If you do not need any character to be active, then load this language
% with |\usepackage[turkish,shorthands=]{babel}|. If you do need the
% shorthand then you must disable it every time you have to use e.g.\ the
% |=|~character as a normal character by:
%
% \iffalse
%<*verb>
% \fi
\begin{verbnobox}[\small]
\shorthandoff{=}% Make '=' not active any more
  \setdefaults{warn=on}
\shorthandon{=}% Restore '=' to active again
\end{verbnobox}
% \iffalse
%</verb>
% \fi
%
% \section{User Commands}
%
% \subsection{Overview}
%
% In the next sections we give a short description of all the user commands
% and environments that are defined in \OneDown. The commands marked with
% \ML are multilingual. I.e.\ the text they typeset gets
% translated automatically into the active language.
%
% In order to make sure that the example diagrams do not disturb the
% page layout of this document too much, we scaled them down to
% |footnotesize|.
% \gamefont{\bfseries\sffamily\footnotesize}
% Sometimes the output of a command is shown as an example. This output is
% framed in this document like \example{this}, just to recognize it easily
% as an output example. In an accompanying
% file\footnote{onedown-examples.pdf} with examples one can find in more
% detail how these commands are used and what they produce.
%
% We have loaded the package \OneDown with the default option for colors,
% giving us \textcolor{black}{black} and \textcolor{red}{red}. Furthermore,
% when we descibe macros, we use a colored frame that also shows the output
% of the commend. Some commands have optional tokens that produce an output
% that differs from the naked version. These optional tokens appear in a
% different background color like \Oarg{*!}. If an output of a macro is
% shown, then the output of tokenized calls is shown in parenthesis to
% demonstrate the difference.
%
% \subsubsection{The Compass}
%
% \boardnr{0}
% The compass \CP is not available as a user command itself, but it is used
% in all user commands that draw a card diagram. It has some special
% features. 
% \begin{itemize}[itemsep=0em]
% \item It can mark the dealer (\north) \boardnr{1} \CP 
% \item It can write the vulnerable side  (\northsouth) in red \boardnr{5} \CP
% \item it can put something (a board number) in the middle
% \boardnr{3} \setdefaults{compmid=3} \CP
% \end{itemize}
% The machinery is intelligent enough to calculate the dealer and
% vulnerability from the board number. When only |black| or
% |b+w| is selected as option for colors, then the
% vulnerable side is written in italics rather colorized. Because
% underlining the \South*-hand would interfere with the compass frame, we
% overline it. With the command  |\setdefaults| one can customize the look
% of the compass. In particular, if you want to print the actual board
% number, specified by calling |\boardnr{Nr}|, you can achieve that by
% calling |\setdefaults{compmid=\boardtext}|. In the accompanying file with
% examples you'll find more examples about |\setdefaults|.
% 
% \subsubsection{Hooks}
%
% We use kind of hooks to
% \begin{enumerate}
% \item change the font or the font-size. These are discussed in chapter
% \emph{Sizing and Fonts} on page \pageref{Fonts}.
% \item add commentary information to card diagrams. These are discussed in
% chapter \emph{Conditions in Diagrams} on page \pageref{Conditions}
% \item There is one other hook to enable the user to add something to the
% compass. This is done by calling |\setdefaults{compmid=<Text>}|.
% \end{enumerate}
%
% \subsection{Basic Symbols}\label{BasicSym}
%
% In this section we show the predefined commands that produce terms that
% occur often in bridge text. On page \pageref{ReDefine} an easy way is
% shown to redefine them as to use a different variant of the term in
% question. 
% \par\vspace{0.3\baselineskip}\noindent
% The next 5 macros are shorthands for the suit symbols and \NT:
% \par\vspace{0.5\baselineskip}\noindent
% \needspace{5\baselineskip}\noindent
% \DescribeMacro{\Cl}\MacroDef+{Cl}[\hfill \Cl]
% \par\noindent
% \DescribeMacro{\Di}\MacroDef+{Di}[\hfill \Di]
% \par\noindent
% \DescribeMacro{\He}\MacroDef+{He}[\hfill \He]
% \par\noindent
% \DescribeMacro{\Sp}\MacroDef+{Sp}[\hfill \Sp]
% \par\noindent
% \DescribeMacro{\NT}\MacroDef*+{NT}[\hfill \NT]
% \par\vspace{0.3\baselineskip}\noindent
% The next 4 macros typeset the non-bid calls
% \par\vspace{0.5\baselineskip}\noindent
% \needspace{4\baselineskip}\noindent
% \DescribeMacro{\pass}\MacroDef*+{pass}[\hfill \pass]
% \par\noindent
% \DescribeMacro{\allpass}\MacroDef*+{allpass}[\hfill \allpass]
% \par\noindent
% \DescribeMacro{\double}\MacroDef*+{double}[\hfill \double]
% \par\noindent
% \DescribeMacro{\redouble}\MacroDef*+{redouble}[\hfill \redouble]
% The next 6 macros typeset the directions that identify dealer (or player)
% and the axis that is vulnerable.
% \par\vspace{0.5\baselineskip}\noindent
% \needspace{4\baselineskip}\noindent
% \DescribeMacro{\north}\MacroDef*+{north}[\hfill \north]
% \par\noindent
% \DescribeMacro{\east}\MacroDef*+{east}[\hfill \east]
% \par\noindent
% \DescribeMacro{\south}\MacroDef*+{south}[\hfill \south]
% \par\noindent
% \DescribeMacro{\west}\MacroDef*+{west}[\hfill \west]
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\northsouth}\MacroDef*+{northsouth}[\hfill \northsouth]
% \par\noindent
% \DescribeMacro{\eastwest}\MacroDef*+{eastwest}[\hfill \eastwest]
% The next 4 macros typeset the \emph{unit} of the points when valuing a
% bridge hand. If one or more of these items do not appear in your bridge
% world, don't argue them, Just don't use them! They are meant to specify
% \emph{High Card Points}, \emph{High Card + Length Points}, \emph{Length Points},
% \emph{Distribution Points} and \emph{Total Points} respectively.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\HCP}\MacroDef*+{HCP}[\hfill \HCP]
% \par\noindent
% \DescribeMacro{\HLP}\MacroDef*+{HLP}[\hfill \HLP]
% \par\noindent
% \DescribeMacro{\LP}\MacroDef*+{LP}[\hfill \LP]
% \par\noindent
% \DescribeMacro{\DP}\MacroDef*+{DP}[\hfill \DP]
% \par\noindent
% \DescribeMacro{\TP}\MacroDef*+{TP}[\hfill \TP]
% \par\noindent
% The next 5 commands produce the abbreviations for several forcing
% expressions.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\GF}\MacroDef*+{GF}[\hfill \GF]
% \par\noindent
% \DescribeMacro{\SF}\MacroDef*+{SF}[\hfill \SF]
% \par\noindent
% \DescribeMacro{\NMF}\MacroDef*+{NMF}[\hfill \NMF]
% \par\noindent
% \DescribeMacro{\TSF}\MacroDef*+{TSF}[\hfill \TSF]
% \par\noindent
% \DescribeMacro{\FSF}\MacroDef*+{FSF}[\hfill \FSF]
%
% \subsubsection{Header of the Bidding Table}
%
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\namesNS}\MacroDef+{namesNS}[\marg{N-name}\marg{S-name}]
% Defines the real world names for the \north and the \south player. If
% they are defined, they appear in the \North*!- and the \South*!-column
% of the |bidding| diagram.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\namesEW}\MacroDef+{namesEW}[\marg{E-name}\marg{W-name}]
% Same as |\namesNS| but now for the \east and the \west player.
%
% \subsection{The Card Diagrams}
%
% \subsubsection{The hands of the players}
% Before a card diagram can be shown, one must specify the cards that
% each player holds. With the various \meta{player}|hand|-commands one can
% do this. The suits they define are only shown when a |show|-command is
% issued after they have been defined. The |show|-commands are discussed on
% page \pageref{ShowCommands}.
% \par\vspace{0.5\baselineskip}\noindent
% \needspace{4\baselineskip}\noindent
% \DescribeMacro{\northhand}\MacroDef+{northhand}[\oarg{v-offset}\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
% \par\noindent
% \DescribeMacro{\easthand}\MacroDef+{easthand}[\oarg{h-offset}\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
% \par\noindent
% \DescribeMacro{\southhand}\MacroDef+{southhand}[\oarg{v-offset}\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
% \par\noindent
% \DescribeMacro{\westhand}\MacroDef+{westhand}[\oarg{h-offset}\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
% The command |\northhand| defines the cards (all 4 suits) for the
% \North*!-player. |\easthand|, |\southhand| and |\westhand| do that for
% the \East*!-, \South*!- or \West*!-player. These commands have 4
% mandatory arguments in
% which the cards of the 4 suits are specified. In all suit commands where
% card ranks are issued, one must use \textbf{T} to denote the value
% \textbf{10}. On output, some kerning takes care that the output looks
% like \suit{T} and not like a \textbf{1} followed by a \textbf{0}. So
% |\suit{AKJT8}| produces \example{\suit{AKJT8}}.
% It is also possible to use a small 'x' as symbol for a spot card: |\suit{AKxxx}|
% produces \example{\suit{AKxxx}}.
%
% These commands also have an optional argument, an offset which by default
% is 0pt. This offset is meant to finetune the layout of the hands in the
% card diagrams. They change the distance between a hand and the compass.
% |\northhand| and |\southhand| have a \emph{vertical} offset, whereas 
% |\easthand| and |\westhand| have a \emph{horizontal} one. A positive
% value moves away from the compass.
%
% \subsubsection{The single hand}
%
% \noindent
% \DescribeMacro{\hand}\MacroDef+{hand}[\Oarg{*!-}\oarg{pos}\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
% This macro typesets the cards of one single hand, either vertically or
% horizontally. There are 4 mandatory arguments defining the 4 suits. With
% 2 optional tokens '|*|' resp.\ '|!|' one can typeset the hand with
% some special features:
% \begin{itemize}[itemsep=0em] 
% \item |\hand*| typesets a hand horizontally, centered
% \item |\hand!| typesets a hand vertically, left aligned
% \item |\hand*!| typesets a hand vertically, centered
%\end{itemize}
% For vertical hands the optional argument |pos| (default= \textbf{c})
% controls the horizontal alignment. Without a token, the hand is typeset
% horizontally, left aligned: The call |\hand{AK2}{T85}{AQT6}{A42}|
% typesets the hand horizontally like:
% \par\vspace{0.3\baselineskip}\noindent
% \example{\hand{AK2}{T85}{AQT6}{A42}},
% \par\vspace{0.3\baselineskip}\noindent
% whereas the |\hand!| version produces 
% \shorthandoff{!}
% \example{\hand!{AK2}{T85}{AQT6}{A42}}.
% \shorthandon{!}
% \par\vspace{0.3\baselineskip}\noindent
% The third optional token, a '|-|' suppresses all output and saves the
% stuff for later use. This is used e.g.\ in |\expertquiz|.
%
% \subsubsection{Only one suit}
%
% \noindent
% \DescribeMacro{\onesuitAll}\MacroDef+{onesuitAll}[\Oarg{*!}\marg{N}\marg{S}\marg{E}\marg{W}]
% Typesets the cards of 1 suit for all players. This command has 4
% mandatory arguments defining the cards of the 4 players. There are 2
% optional tokens. With |\onesuitAll*| the output is centered, with
% |onesuitAll!| the cards are placed around a |NESW| compass.
% Without the '|!|'-token a small box (\ODwBox) is used instead. Thus
% the macro call |\onesuitAll{AQ6}{J3}{T54}{K2}| produces
% \example{\onesuitAll{AQ6}{J3}{T54}{K2}}.
% \par\noindent
% Please note the order of the
% players in the arguments: the first 2 denote the \north and \south hand.
% The last 2 denote the \east and \west hand. We choose it this way so you
% can easily cut and paste one pair from the |\onesuitAll|, or extend
% |\onesuitNS| to showing all hands.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\onesuitNS}\MacroDef+{onesuitNS}[\Oarg{*!}\marg{N}\marg{S}]
% \par\noindent
% \DescribeMacro{\onesuitEW}\MacroDef+{onesuitEW}[\Oarg{*!}\marg{E}\marg{W}]
% \par\noindent
% \DescribeMacro{\onesuitNE}\MacroDef+{onesuitNE}[\Oarg{*!}\marg{N}\marg{E}]
% \par\noindent
% \DescribeMacro{\onesuitNW}\MacroDef+{onesuitNW}[\Oarg{*!}\marg{N}\marg{W}]
% These commands are similar to |\onesuitAll| but have only 2 mandatory
% arguments. The command |\onesuitNS{AQ3}{JT9}| typesets
% \example{\onesuitNS{AQ3}{JT9}} and |\onesuitEW{8764}{K2}| will
% produce \example{\onesuitEW{8764}{K2}}. Please note that at the latter the
% cards for the \east hand appear in the first argument. Finally 
% |\onesuitNE{AQ3}{8764}| produces \example{\onesuitNE{AQ3}{8764}} and
% |\onesuitNW{AQ3}{K2}| \example{\onesuitNW{AQ3}{K2}}. 
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\suit}\MacroDef+{suit}[\oarg{suit symbol}\marg{cards}]
% This command has 1 optional argument denoting a suit symbol and 1
% mandatory argument, defining the cards of the suit.
% |\suit{AQJ7}| by default produces \example{\suit{AQJ7}}. When the German
% language is active it would produce \example{\Translate{\suit{AQJ7}}}.
% Using the optional argument like in |\suit[\Di]{AQJ7}| will produce:
% \example{\suit[\Di]{AQJ7}}.
%
% \subsubsection{Showing Card Diagrams}\label{ShowCommands}
%
% \noindent
% \DescribeMacro{\showAll}\MacroDef+{showAll}[\Oarg{*+}\oarg{pos}]
% \par\noindent
% \DeleteShortVerb{\|}
% \DescribeMacro{\showNS}\MacroDef+{showNS}[\Oarg{*+}\oarg{pos}\parg{N|S}]
% \par\noindent
% \DescribeMacro{\showEW}\MacroDef+{showEW}[\Oarg{*+}\oarg{pos}\parg{E|W}]
% \MakeShortVerb{\|}
% \par\noindent
% \DescribeMacro{\showNE}\MacroDef+{showNE}[\Oarg{*+}\oarg{pos}]
% \par\noindent
% \DescribeMacro{\showNW}\MacroDef+{showNW}[\Oarg{*+}\oarg{pos}]
% All |show|-commands have two optional tokens, a '|*|' which centers the
% output and a '|+|' which also displays a |bidding| diagram next to the
% card diagram. This |bidding| diagram must have been defined before, see
% page~\pageref{Bidding}.
% They also have one optional argument that defines the aligning. Its
% default is~\textbf{c}.
% |\showAll| typesets a card diagram with the |NESW| compass with \North*! in
% top and the hands of the 4 players surrounding it. These hands must have
% been defined before by calling |\northhand| etc. Hands that are not
% defined are left empty. Optionally some conditions (like the dealer or
% who is vulnerable etc.) can be added to the diagram by using the commands
% described in section \emph{Diagram Conditions}. Please note that when the
% \north or \south hand contains a long suit that extends beyond the
% |NESW| compass, this might collide with these extra texts. You can
% correct that with the optional offset parameter of the condition commands
% (see page \pageref{Legend}).
%
% The other commands are similar to |\showAll| but typeset only the hands
% of the players that are represented in the name of the command:
% \NorthSouth*!, \EastWest*!,  \North*!--\East*! and \North*!--\West*!.
%
% The commands |\showNS| and |\showEW| have an extra optional argument with
% which selectively only one of the two hands can be displayed. E.g.\ 
% |\showNS(S)| will display only the \South*-hand.
% \needspace{6\baselineskip}\noindent
%
% \subsubsection{Showing Card Diagrams with Bidding}\label{PlayCommands}
%
% \subsubsection{Diagram Conditions}
%
% \noindent
% \DescribeMacro{\headlinetext}\MacroDef+{headlinetext}[\marg{text}]
% \par\noindent
% \DescribeMacro{\footlinetext}\MacroDef+{footlinetext}[\marg{text}]
% These commands have 1 mandatory argument: the text that defines the
% annotation that is to be added to a card diagram. The text can be on more
% than one line, just separate them with a |\par| or
% |\newline|\footnote{Using '\bs\bs' instead produces a misleading error:
% \textbf{! Missing \} inserted\ldots}}.
% |\headlinetext| places the annotation above the diagram, |\footlinetext|
% below it.
% \par\vspace{0.5\baselineskip}
% \needspace{4\baselineskip}\noindent
% \DescribeMacro{\leftupper}\MacroDef+{leftupper}[\oarg{h-offset}\marg{line1}\marg{line2}\marg{line3}]\label{Legend}
% \par\noindent
% \DescribeMacro{\leftlower}\MacroDef+{leftlower}[\oarg{h-offset}\marg{line1}\marg{line2}\marg{line3}]
% \par\noindent
% \DescribeMacro{\rightupper}\MacroDef+{rightupper}[\oarg{h-offset}\marg{line1}\marg{line2}\marg{line3}]
% \par\noindent
% \DescribeMacro{\rightlower}\MacroDef+{rightlower}[\oarg{h-offset}\marg{line1}\marg{line2}\marg{line3}]
% These commands have 1 optional argument (default 0pt) with which you can
% add some extra horizontal space if hand and legend collide, and 3
% mandatory arguments: the lines of text that are added as conditions
% to the card diagram. Both |\leftupper| (|\rightupper|) place their
% text in the left- (right-) upper corner of the diagram. The top line
% will be aligned with the (inner) top of the diagram. |\leftlower|
% (|\rightlower|) are similar, but place their text at the lower corner of
% the diagram. The last line is aligned with the (inner) bottom of the
% diagram. For an empty line you must issue an empty argument.
% With a positive offset, |\leftupper| and |\leftlower| shift to the left
% whereas |\rightupper| and |\rightlower| shift to the right. I.e.\ they
% shift away from their neighbouring hand.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\dealer}\MacroDef+{dealer}[\oarg{text}]\label{dealerX}
% \par\noindent
% \DescribeMacro{\vulner}\MacroDef+{vulner}[\oarg{text}]
% Both commands have 1 optional argument. If present it sets (and prints)
% the internal corresponding variable to this value, otherwise it only
% outputs the value of this internal variable.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\dealertext}\MacroDef+{dealertext}[\oarg{text}]
% \par\noindent
% \DescribeMacro{\vulnertext}\MacroDef+{vulnertext}[\oarg{text}]
% These commands have also 1 optional argument. If present e.g.\
% |\dealertext[\North*]| this text is output in the form
% \example{\dealertext[\North*]}. If the German language is active then the
% call |\dealertext[\South*]| produces the text
% \foreignlanguage{german}{\example{\dealertext[\South*]}}. Calling
% |\dealertext| without an argument outputs the predefined text, which can
% be set with |\dealer|.\\
% Example:
% |\dealer[Jacob]\dealertext| produces \example{\dealer[Jacob]\dealertext}.
%
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\boardnr}\MacroDef+{boardnr}[\marg{Nr}]
% The macro |\boardnr| has 1 mandatory argument. If it is a number, it is
% considered to be the board number. The dealer and which side is
% vulnerable is then calculated from it and stored in the appropriate
% variables. If it is not a positive integer, it is considered user-defined
% text and will be stored and used \emph{as is}.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\boardtext}\MacroDef*+{boardtext}[\Oarg{*}]
% The macro |\boardtext| has 1 token and no arguments. |\boardtext|
% retrieves only the board number (stored by calling |\boardnr|).
% |\boardtext*| outputs the board number with some additional (multilingual)
% text. |\boardnr{23}\boardtext| produces \example{\boardnr{23}\boardtext}
% whereas |\boardtext*| would produce \example{\boardtext*}.
% Note that |\boardnr| can have a non-integer argument.
% |\boardnr{Fun}\boardtext| produces \example{\boardnr{Fun}\boardtext} and
% with |\boardtext*| it would produce \example{\boardtext*}.
%
% \subsubsection{Sizing and Fonts}\label{Fonts}
%
% \noindent
% \DescribeMacro{\handskip}\MacroDef+{handskip}[\marg{length description}]
% This command has 1 mandatory argument: a \textbf{text} describing a
% length. |\handskip| enlarges the distance (default |1em|) between the
% rightmost hand and the |bidding| diagram. A negative value diminishes the
% distance.
% \par\vspace{0.5\baselineskip}
% \needspace{4\baselineskip}\noindent
% \DescribeMacro{\bidderfont}\MacroDef+{bidderfont}[\marg{font description}]
% \par\noindent
% \DescribeMacro{\compassfont}\MacroDef+{compassfont}[\marg{font description}]
% \par\noindent
% \DescribeMacro{\gamefont}\MacroDef+{gamefont}[\marg{font description}]
% \par\noindent
% \DescribeMacro{\legendfont}\MacroDef+{legendfont}[\marg{font description}]
% \par\noindent
% \DescribeMacro{\namefont}\MacroDef+{namefont}[\marg{font description}]
% \par\noindent
% \DescribeMacro{\otherfont}\MacroDef+{otherfont}[\marg{font description}]
% These commands all have 1 mandatory argument: a \textbf{description} of
% the font to be used. In the list below the command names are typeset in
% their default font.
% \begin{itemize}[itemsep=-2mm]
% \item {\mdseries\sffamily bidderfont}: Used for the player-names in the
% |bidding| diagram.\\ The default is |\mdseries\sffamily|.
% \item {\mdseries\sffamily compassfont}: Used for the directions and the
% ''midvalue'' in the compass. The default is |\mdseries\sffamily|.
% \item {\bfseries\sffamily gamefont}: Used for card diagrams, hands and
% suits.\\ The default is |\bfseries\sffamily|.
% \item {\mdseries\rmfamily legendfont}: Used for the conditions in
% card diagrams.\\ The default is |\mdseries\rmfamily|.
% \item {\mdseries\slshape namefont}: Used for the real world names in 
% |bidding| diagrams.\\ The default is |\mdseries\slshape|.
% \item {\bfseries\sffamily otherfont}: Used for the other bridge
% expressions, also outside diagrams. The default is |\bfseries\sffamily|.
% \end{itemize}
% If a new font is
% defined, all relevant dimensions of the card diagrams (including the
% |NESW| compass, the |bidding| diagram etc.) will be recalculated.
% Some examples for setting the gamefont to a new value are:
% \begin{itemize}[itemsep=-2mm]
% \item |\gamefont{\sffamily\bfseries\HUGE}| to get \emph{HUGE} diagrams.
% Refer to the documentation of package \packname{moresize} for details.
% \item |\legendfont{\smaller}| to diminish the text in the card diagram
% conditions a little. Refer to the
% documentation of package \packname{relsize} for details.
% \item |\gamefont{\sffamily\scalefont{3}}|\footnote{needs package
% scalefnt} to typeset real big diagrams for overhead sheets
% \end{itemize}
% \needspace{4\baselineskip}\noindent
%
% \subsection{Misc}
%
% Many of the text producing macros have in common that they can produce 4
% different versions of the text they represent. Normally, without any
% token, they produce the 
% lowercase text. With the token~|*| they produce the capitalised text.
% With the token |!| they produce some abbreviation of the text (if
% available). Finally with both tokens~|*!| the produce the capitalised
% abbreviation of the text. What exactly is produced, is shown in the
% macro descriptions. In some cases it seems rather strange to have the
% code for an abbreviated form, i.e.\ |\Lead[*!]|, because it produces only
% the variants \Lead and  \Lead*. But remember that we also support automatic
% translations into other languages and that in another language an
% abreviationt might be feasible: With the german language active |\Lead*|
% and |\Lead*!| produce \foreignlanguage{german}{\example{\Lead*}} and
% \foreignlanguage{german}{\example{\Lead*!}} respectively.

% At the other
% hand it seems peculiar to let |\Ace!| produce \example{\Ace!} for an
% Ace. But we do not foresee which modern novelist might want to produce
% this. That's why they are defined, but 'normal' writers probably will
% never used it.
%
% The short versions are primarily meant to be used within diagrams,
% allthough it is possible to get the long forms there too. Refer to page
% \pageref{Defaults} for details. We show the output of such a macro
% |\Macro| (note the capital~|M|!) in the form:
% \par\vspace{0.3\baselineskip}\noindent
% \MacroDef{Macro}[\Oarg{*!}\hfill \cmd{\Macro} (\cmd{\Macro*}, \cmd{\Macro!}, \cmd{\Macro*!})]
% In addition to each macro |\Macro| with its 4 variants, we also create a
% macro |\macro| which is defined to output the most used variant of
% |\Macro|:
% \par\vspace{0.3\baselineskip}\noindent
% \MacroDef{macro}[\hfill most used variant of \cmd{\Macro}]
% \par\vspace{0.3\baselineskip}\noindent
% It is very easy to redefine |\macro|.\label{ReDefine}
%  As an example we take the macro |\ace|. Its definition is:
% \par
% |\def\ace{\Ace*!}|\\
% so calling |\ace| will produce \example{\ace}. If somewhere in your
% document you redefine |\ace| to be 
% \par
% |\def\ace{\Ace*}|\\
% {\def\ace{\Ace*} then |\ace| will produce \example{\ace}} rather than \example{\ace}.
%
% \subsubsection{Honor Cards}
%
% \noindent
% \DescribeMacro{\Ace}\MacroDef*+{Ace}[\Oarg{*!}\hfill \Ace (\Ace*, \Ace!, \Ace*!)]
% \par\noindent
% \DescribeMacro{\ace}\MacroDef*+{ace}[\hfill \ace]
% \par\noindent
% \DescribeMacro{\King}\MacroDef*+{King}[\Oarg{*!}\hfill \King (\King*, \King!, \King*!)]
% \par\noindent
% \DescribeMacro{\king}\MacroDef*+{king}[\hfill \king]
% \par\noindent
% \DescribeMacro{\Queen}\MacroDef*+{Queen}[\Oarg{*!}\hfill \Queen (\Queen*, \Queen!, \Queen*!)]
% \par\noindent
% \DescribeMacro{\queen}\MacroDef*+{queen}[\hfill \queen]
% \par\noindent
% \DescribeMacro{\Jack}\MacroDef*+{Jack}[\Oarg{*!}\hfill \Jack (\Jack*, \Jack!, \Jack*!)]
% \par\noindent
% \DescribeMacro{\jack}\MacroDef*+{jack}[\hfill \jack]
% These commands produce the language dependent names for the honor
% cards. To be used primarily when adding a lead to a card diagram.
%
% \subsubsection{Variants of Basic Symbols}
%
% In section \ref{BasicSym} we already described the macros for the main
% variant. Here we introduce the macros that handle 4 variants with a
% combination of the tokens |*| and |!|.
% \par\noindent
% We start with the variants for |\NT| 
% \par\vspace{0.3\baselineskip}\noindent
% \DescribeMacro{\nt}\MacroDef*+{nt}[\Oarg{*!}\hfill \nt (\nt*, \nt!, \nt*!)]
% \par\noindent
% Next we show the 4 macros for the non-bid calls:
% \par\vspace{0.3\baselineskip}\noindent
% \DescribeMacro{\Pass}\MacroDef*+{Pass}[\Oarg{*!}\hfill \Pass (\Pass*, \Pass!, \Pass*!)]
% \par\noindent
% \DescribeMacro{\Allpass}\MacroDef*+{Allpass}[\Oarg{*!}\hfill \Allpass
% (\Allpass*, \Allpass!, \Allpass*!)]
% \par\noindent
% \DescribeMacro{\Double}\MacroDef*+{Double}[\Oarg{*!}\hfill \Double (\Double*,
% \Double!, \Double*!)]
% \par\noindent
% \DescribeMacro{\Redouble}\MacroDef*+{Redouble}[\Oarg{*!}\hfill \Redouble
% (\Redouble*, \Redouble!, \Redouble*!)]
% \par\noindent
% Next come the 6 macros for the symbolic names of players and axes.
% \par\vspace{0.5\baselineskip}\noindent
% \needspace{4\baselineskip}\noindent
% \DescribeMacro{\North}\MacroDef*+{North}[\Oarg{*!}\hfill \North (\North*, \North!, \North*!)]
% \par\noindent
% \DescribeMacro{\East}\MacroDef*+{East}[\Oarg{*!}\hfill \East (\East*, \East!, \East*!)]
% \par\noindent
% \DescribeMacro{\South}\MacroDef*+{South}[\Oarg{*!}\hfill \South (\South*, \South!, \South*!)]
% \par\noindent
% \DescribeMacro{\West}\MacroDef*+{West}[\Oarg{*!}\hfill \West (\West*, \West!, \West*!)]
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\NorthSouth}\MacroDef*+{NorthSouth}[\Oarg{*!}\hfill \NorthSouth (\NorthSouth*, \NorthSouth!, \NorthSouth*!)]
% \par\noindent
% \DescribeMacro{\EastWest}\MacroDef*+{EastWest}[\Oarg{*!}\hfill \EastWest (\EastWest*, \EastWest!, \EastWest*!)]
% \par\noindent
% The 4 commands that typeset the \emph{point-unit}
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\hpts}\MacroDef*+{hpts}[\Oarg{*!}\hfill \hpts (\hpts*, \hpts!, \hpts*!)]
% \par\noindent
% \DescribeMacro{\tpts}\MacroDef*+{tpts}[\Oarg{*!}\hfill \tpts (\tpts*, \tpts!, \tpts*!)]
% \par\noindent
% \DescribeMacro{\lpts}\MacroDef*+{lpts}[\Oarg{*!}\hfill \lpts (\lpts*, \lpts!, \lpts*!)]
% \par\noindent
% \DescribeMacro{\dpts}\MacroDef*+{dpts}[\Oarg{*!}\hfill \dpts (\dpts*, \dpts!, \dpts*!)]
% \par\noindent
% The forcing terms
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\gforce}\MacroDef*+{gforce}[\Oarg{*!}\hfill \gforce (\gforce*, \gforce!, \gforce*!)]
% \par\noindent
% \DescribeMacro{\sforce}\MacroDef*+{sforce}[\Oarg{*!}\hfill \sforce (\sforce*, \sforce!, \sforce*!)]
% \par\noindent
% \DescribeMacro{\nmforce}\MacroDef*+{nmforce}[\Oarg{*!}\hfill \nmforce (\nmforce*, \nmforce!, \nmforce*!)]
% \par\noindent
% \DescribeMacro{\tsforce}\MacroDef*+{tsforce}[\Oarg{*!}\hfill \tsforce (\tsforce*, \tsforce!, \tsforce*!)]
% \par\noindent
% \DescribeMacro{\fsforce}\MacroDef*+{fsforce}[\Oarg{*!}\hfill \fsforce (\fsforce*, \fsforce!, \fsforce*!)]
%
% \subsubsection{Conditions in Diagrams}\label{Conditions}
%
% These commands produce the langugage dependent expressions for
% \emph{\all, \none, \by, \board} etc. To be used primarily in card
% diagrams.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\All}\MacroDef*+{All}[\Oarg{*!}\hfill \All (\All*, \All!, \All*!)]
% \par\noindent
% \DescribeMacro{\all}\MacroDef*+{all}[\hfill \all]
% \par\noindent
% \DescribeMacro{\None}\MacroDef*+{None}[\Oarg{*!}\hfill \None (\None*, \None!, \None*!)]
% \par\noindent
% \DescribeMacro{\none}\MacroDef*+{none}[\hfill \none]
% \par\noindent
% \DescribeMacro{\by}\MacroDef*+{by}[\hfill \by]
% \par\noindent
% \DescribeMacro{\Board}\MacroDef*+{Board}[\Oarg{*!}\hfill \Board (\Board*, \Board!, \Board*!)]
% \par\noindent
% \DescribeMacro{\board}\MacroDef*+{board}[\hfill \board]
% \par\noindent
% \DescribeMacro{\Contract}\MacroDef*+{Contract}[\Oarg{*!}\hfill \Contract (\Contract*, \Contract!, \Contract*!)]
% \par\noindent
% \DescribeMacro{\contract}\MacroDef*+{contract}[\hfill \contract]
% \par\noindent
% \DescribeMacro{\Declarer}\MacroDef*+{Declarer}[\Oarg{*!}\hfill \Declarer (\Declarer*, \Declarer!, \Declarer*!)]
% \par\noindent
% \DescribeMacro{\declarer}\MacroDef*+{declarer}[\hfill \declarer]
% \par\noindent
% \DescribeMacro{\Deal}\MacroDef*+{Deal}[\Oarg{*!}\hfill \Deal (\Deal*, \Deal!, \Deal*!)]
% \par\noindent
% \DescribeMacro{\deal}\MacroDef*+{deal}[\hfill \deal]
% \par\noindent
% \DescribeMacro{\Lead}\MacroDef*+{Lead}[\Oarg{*!}\hfill \Lead (\Lead*, \Lead!, \Lead*!)]
% \par\noindent
% \DescribeMacro{\lead}\MacroDef*+{lead}[\hfill \lead]
%
% \subsubsection{Annotations in Bidding Diagrams}
%
% \noindent
% \DescribeMacro{\alert}\MacroDef+{alert}[\hfill \alert]
% \par\noindent
% \DescribeMacro{\announce}\MacroDef+{announce}[\hfill \announce]
% \par\noindent
% These macros have no argument. With |\alert| one can mark a call that
% must be alerted with an asterisk (\alert) e.g.\ a weak 2\NT{} opening
% with |2\NT\alert|. It produces \example{2\NT\alert}. With |\announce| one
% can mark a bid with an 'A' (\announce) where an announcement is
% obligatory, e.g |2\He\announce| produces \example{2\He\announce}.
% \par\vspace{0.5\baselineskip}
% \needspace{4\baselineskip}\noindent
% \DescribeMacro{\markit}\MacroDef+{markit}
% \par\noindent
% \DescribeMacro{\explainit}\MacroDef+{explainit}[\marg{explanation}]
% These commands are to be used to mark a call in the |bidding| diagram and
% explain it with a kind of footnote-like mechanism, directly below the
% |bidding| diagram. Both |\markit| and |\explainit| step a counter for
% associating the explanation with the mark. |\markit| has no arguments;
% |\explainit| has one mandatory argument: the text to be displayed as
% explanation. |\explainit| should be called in the description part of
% |bidding| diagrams (or expertquiz). The text of the explanation is then
% typeset under the |bidding| diagram and has the same width.
% You can use newline (|\\|, or |\newline|) in your text to force an new
% line in the explanation\footnote{Using \bs par produces the error:
% \textbf{Runaway argument?\ldots}}.
% \needspace{6\baselineskip}%

% \subsubsection{Specials}
%
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\expertquiz}\MacroDef+{expertquiz}[\Oarg{*!}\oarg{comment}\marg{award}]
% This command displays a hand, a |bidding| sequence and some additional
% stuff. It is designed after the \emph{Expert Quiz} column in the
% \emph{Bridge Magazin} of the  \textsf{DBV}\footnote{Deutsche Bridge
% Verband}, the German Bridge Union.
% \\
% It has 2 optional tokens: a '|*|' for centering and a
% '|!|' which 1) forces the |bidding| diagram to appear on a new line, and
% 2) shifts the hand a bit to the right.
% Next there is one optional argument with wich some commentary information
% can be added. And finally there is 1 mandatory argument that describes the
% awards for certain solutions. Both the hand and the bidding must be
% defined before calling |\expertquiz|. One can do that by calling e.g.
% |\hand-| which suppresses the output of the hand.
%
% \subsubsection{Re-Initialization}
%
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\newgame}\MacroDef+{newgame}
% This command resets most bridge diagram data and can be used to start a
% new series of bridge diagrams. It is however not necessary to use
% |\newgame| if one enters new cards for the \north etc.\ hands. The list
% below shows which items are reset by calling |\newgame|
% \begin{itemize}
% \item resets |\boardnr{0}|.
% \item resets |headlinetext| and |footlinetext|.
% \item resets |LeftUpperText|, |LeftLowerText|, |RightUpperText| and
% |RightLowerText|.
% \item resets |northhand|, |easthand|, |southhand| and |westhand|.
% \item resets |namesNS| and |namesEW|.
% \item resets the checks for Spades, Hearts, Diamonds and Clubs.
% \end{itemize}
% \needspace{15\baselineskip}
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\setdefaults}\MacroDef+{setdefaults}[\Oarg{*}\string{\meta{key1=val1},\meta{key2=val2},\ldots\string}]\label{Defaults}
% \par\noindent
% \DeleteShortVerb{\|}
% \begin{tabular}{>{\ttfamily}l>{\ttfamily}l}
% key      & font \\\hline
% bidder   & bidderfont \\
% compass  & compassfont \\
% game     & gamefont \\
% legend   & legendfont \\
% name     & namefont \\
% other    & otherfont \\\hline
% \\
% key      & value \\\hline
% colors   & 0|1|\underline{2}|3|4A|4B \\
% warn     & \underline{off}|on \\
% err      & off|\underline{on} \\
% \hline
% \end{tabular}
% \qquad
% \begin{tabular}{>{\ttfamily}l>{\ttfamily}l}
% key      & value \\\hline
% compline & \meta{factor} \\
% compshow & off|\underline{on} \\
% compsize & \meta{factor} \\
% compturn & \underline{off}|on \\\hline
% \\
% key      & value  \\\hline
% bidders  & off|\underline{on} \\
% bidfirst & N|E|S|\underline{W} \\
% bidline  & \underline{off}|on \\
% bidlong  & off|\underline{on} \\
% \hline
% \end{tabular}
% \MakeShortVerb{\|}
% \par\vspace{\baselineskip}
% The macro |\setdefaults| uses a \meta{key}=\meta{val} mechanism. The
% tables above show which keys are available. The underlined key values are
% defaults. The available keys with respect to fonts are: |bidder|,
% |compass|, |game|, |legend|, |name| and |other|. In upper the table to
% the left the association between key and font is shown. A call e.g.\ 
% |\setdefaults{name=\bfseries\scriptsize}| will set the default for the
% namefont to the value specified. The starred form |\setdefaults*| will
% also call |\resetfonts|, which effectuates any change in a new default
% font immediately.
%
% In the lower table to the left you'll find the three keys that are also
% possible as package options. They have been described already in section
% \ref{Options}.
%
% The keys with respect to the compass are: |compline|, |compshow|,
% |compsize| and |compturn|. They are shown in the upper table to the
% right. With the first key one can set the linethickness of the compass
% frame, the default is |0.1em|. The second key controls whether the
% compass is shown or not. The third key controls the size of the compass,
% which per default is |2.5em|. With the fourth key one can rotate the
% letters for the \EastWest*! direction over 90°. The
% multiplication-\meta{factor}, which defaults to the value |1|, can have
% any non-negative real value.
%
% The keys with respect to the |bidding| diagram are: |bidders|, |bidfirst|,
% |bidline| and |bidlong|. They are shown in the lower table to the right.
% With the first key one can suppress the bidders in the bidding header.
% With the second key one can set which bidder appears in the first column
% of the diagram. The default is |W|. The third key controls whether an
% |\hline| is printed below the header. The fourth key switches between
% the long or short form of the non-bid calls, like \example{\pass} or
% \example{\Pass!}.
%
% For the key-value |on| we have the synonyms |true| and |1|, for the
% key-value |off| we have the synonyms |false| and |0|.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\resetfonts}\MacroDef+{resetfonts}
% When calling this macro, all fonts are set back to their default value.
% This is the value that was explicitly set by a previous call of
% |\setdefaults|, or to the intrinsic default value if |\setdefaults| has
% not been called before.
%
% \subsection{Environments}
%
% In the first place we must warn the user for a peculiarity of the package
% \packname{collcell}, which is used to do some special processing in these
% 3 environments: \emph{The last row must either end with a newline} (|\\|)
% \emph{or with an \emph{empty} cell.}\par\noindent
% The advantage of the |collcell| processing is that within the |bidding|
% and |play| diagrams we can use shorthands for the suit symbols: rather
% than writing |3\Sp| in a |bidding| diagram we can also write |3S| to obtain
% 3\,\Sp. In the |play| diagram we could write |HA| instead of |\He\,\Ace|
% and get \He\,A as output. In |bidding| diagrams some non-bid calls may
% appear in short or in long form, controlled by calling
% |\setdfefaults{bidlong=on}|, which switches to the lang form, or
% |\setdfefaults{bidlong=off}| which switches to the short form.
% These non-bid calls are coded as follows: A small |p| yields short form
% \example{\Pass!} or long form \example{\pass}. A capital |P| yields short
% form \example{\Allpass*!} or long form \example{\allpass}. A capital |X|
% yields short form \example{\Double!} and long form \example{\double}. A
% capital |R| yields short form \example{\Redouble!} and long form
% \example{\redouble}.\footnote{due to the fact that |x| denotes a
% spotcard, we had to implement it this way}
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeEnv{bidding}\EnvDef*+{bidding}[\Oarg{*!-}\oarg{pos}\parg{description}]\label{Bidding}
% This environment has 3 tokens. The '|*|' centers the |bidding| diagram.
% The '|!|' outputs the short form: e.g.\ \North*! rather than the long form
% \North* in the table heading. The '|-|' completely suppresses the output.
% The data is stored in a savebox and can be used in other macros, e.g.\ in
% all |\showXX| macros. Next come 2 optional parameters. The first
% one controls the alignment (default \textbf{c}) and the second one adds
% the list of annotations below the |bidding| diagram. With |\setdefaults|
% one can fine tune the look of the |bidding| diagram. Refer to page
% \pageref{Defaults} for details. For example
% \iffalse
%<*verb>
% \fi
\begin{verbnobox}[\small]
 \begin{bidding}(\explainit{WeakTwo}\explainit{preemptive})
   2H\markit & p & 3H\markit & p \\
 \end{bidding}
\quad
 \setdefaults{bidlong=off}
 \begin{bidding}!
   2H & p & 3H & p\\
 \end{bidding}\\
\end{verbnobox}
% \iffalse
%</verb>
% \fi
% produces\\
% \example{
% \begin{bidding}(\explainit{WeakTwo}\\\explainit{preemptive})
%  2H\markit & p & 3H\markit & p \\
% \end{bidding}
% \quad
% \setdefaults{bidlong=off}
% ^^A avoid clash with babel languages
% \shorthandoff{!}
% \begin{bidding}!
%  2H & p & 3H & p \\
% \end{bidding} 
% }
%
% \shorthandon{!}\setdefaults{bidlong=on}
% 
% \par\vspace{0.3\baselineskip}\noindent
% In addition to the shorthands we mentioned before, one can also use macros
% in the bidding and play diagrams. As long as these macros appear as 1
% single token in the diagram, no special care has to be taken. But if a
% macro appears as multiple tokens, e.g.\ like the call |\Pass*!|, which
% consists of the 3 tokens |\Pass|, |*| and |!|, then it \textbf{must} be
% enclosed in braces |{...}| to make it act as 1 token. Without the
% braces |\Pass*!| will produce \example{\Xfer{\Pass*!}}, with them
% |{\Pass*!}| will produce \example{\Xfer{{\Pass*!}}}.
% Note that although |\pass| expands to |\Pass*|, it wil produce the correct
% \example{\Xfer{\pass}}.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeEnv{biddingpair}\EnvDef*+{biddingpair}[\Oarg{*!-}\oarg{pos}\parg{descr}]
% This environment is essentially the same as the |bidding| environment, but 
% here the |bidding| diagram has only two columns rather than four.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeEnv{play}\EnvDef*+{play}[\Oarg{*}\marg{Lead}\oarg{Trump}]
% This environment has 1 token, a '|*|', which controls the centering of
% the table; 1 mandatory argument, denoting the opening lead and 1
% optional argument which specifies the trump suit, with default: \NT. It
% typesets a diagram with the sequence of playing tricks, by producing a
% table with 8 columns: the running number; the player who had
% had the lead; the 4 cards played in this trick and finally
% the 2 columns that show how many tricks \NorthSouth*!{} and \EastWest*!{}
% have won so far. The user has to specify only the columns 3-6, i.e.\ the
% cards that were played. Columns 1--2 and 7--8 are constructed by
% \OneDown. Just as in |bidding| diagrams, also here
% one can denote the suit with |S|, |H|, |D|, or |C|. The winning card is
% automatically detected, taking into account if a suit contract or \NT
% is played. The winning tricks counters are then updated automatically.
% Concerning consistency it is just as with hands and deals: If a card
% occurs more than one time, an error is raised and for missing cards a
% warning is issued.
% \\[0.3\baselineskip]
% \needspace{4\baselineskip}\noindent
% \otherfont{\sffamily\bfseries\footnotesize}
% \begin{minipage}{\linewidth}
% \begin{minipage}[b]{0.36\linewidth}
% 
% \iffalse
%<*verb>
% \fi
\begin{verbnobox}[\small]
\begin{play}{W}  \\
  D3 & 2 & Q & K \\
  HA & 5 & 4 & J \\
  C3 & 5 & K & A \\
\end{play}
\end{verbnobox}
% \iffalse
%</verb>
% \fi
%
% \end{minipage}
% \quad
% \example{
% \begin{play}{W}
%    D3 & 2 & Q & K \\
%    HA & 5 & 4 & J  \\
%    C3 & 5 & K & A \\
% \end{play}
% }
% \end{minipage}
%
% \needspace{8\baselineskip}\noindent
%
% \iffalse
%<*verb>
% \fi
\begin{verbnobox}[\small]
\begin{play}*{W} \\
  D3 & 2 & Q & K \\
  HA & 5 & 4 & J \\
  C3 & 5 & K & A \\
\end{play}
\end{verbnobox}
% \iffalse
%</verb>
% \fi
%
% produces the same diagram, but this time horizontally
% centered.\\[0.5\baselineskip]
% \example{
% \begin{minipage}{0.95\linewidth}
% \begin{play}*{W}
%    D3 & 2  & Q  & K \\
%    HA & 5  & 4  & J  \\
%    C3 & 5  & K  & A \\
% \end{play}
% \end{minipage}
% }
% \otherfont{\sffamily\bfseries\footnotesize}
%
% \section{Final Remarks}
%
% \subsection{Known Bugs}
%
% \begin{itemize}
%   \item Some dictionaries have questionable translations.
%   \item The boxes in |\northhand| and |\southhand| lead to problems with
%   shifting the \west hand. See file Legends in the example bundle.
% \end{itemize}
% \newpage
%
% \subsection{ToDo}
%
% \begin{itemize}[itemsep=-2mm]
%  \item Add the High Points to card diagrams (like Turnier in KA)
%  \item Check if |\def\xspace{}| is also needed in bidding...?
%  \item Make a template for showing 16 hands on 1 DIN A4 (3x5+1 or 4x4
%   landscape) e.g as handout for the hands on slides.
%  \item Read source files in PBN format. Example:
% \url{http://new.bridgekosice.sk/bridzove-diagramy-vykrelene-pomocou-tex/}
% \end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \subsection{Acknowledgements}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% 
% This package is based on (ideas from) the style files:
% \begin{itemize}[itemsep=-2mm]
%  \item |bridge-i v1.0 (1995/04/16)| by René Steiner and Thomas Hof.
%  \item |kibitzer v1.0 (1995/04/16)| by René Steiner and Thomas Hof.
%  \item |bridge v0.1 (2012/03/18)| by Antony Lee.
%  \item |grbbridge v2.2 (2013/12/24)| by Gordon Bower.
% \end{itemize}
% 
% The style file |bridge-i| is based on the style file |bridge| v1.7c
% (1994/12/20) by J.L. Braams, which on itself was based on an article
% by Kees van der Laan in TUGboat (Vol 11 (1990), No 2: p265ff.
% \par
% Last but not least I want to thank all those wonderful people down
% there in the Internet who spent their time in answering silly questions
% and solving difficult problems. If I had imagined the difficulties I
% would encounter, then I would not have started this work. And without the
% help %of all these, to me unknown, people, this package would not exist.
%
% \StopEventually{}
%
% \section{Implementation}
%
% \iffalse
%<*package>
% \fi
%
% \subsection{Prelimaries}
%
% \subsubsection{Packages we depend upon}
%
% \label{RequirePackage}
%    \begin{macrocode}
\RequirePackage{%
  xcolor,%        colorizing symbols \Sp etc.
  textcomp,%      for the numbersign in environment play.
  moresize,%      add \HUGE and \ssmall to font-sizes
  relsize,%       relative font-sizes. (e.g. \smaller)
  makecmds,%      needed for provideenvironment
  expl3,%         needed for LaTeX3 packages (xparse)
  xparse,%        optional params and starred commands
  xspace,%        handling of spacing behind a command
  calc,%          makes calculations and lengths easier
  ifthen,%        easy booleans, tests and loops
  adjustbox,%     stacked boxes in L-/R-Lower captions
  translations,%  auto-translate terms (e.g. East->Ost)
  array,%         actions for tabular column cells 
  collcell,%      macro calls for tabular column cells
  pgfopts,%       for keyval opts, loads also pgfkeys
  environ,%       for handling bidding environments
  xstring,%       for easy string processing.
  tracklang,%     for iterating over loaded languages
  pict2e,%        for drawing the compass
}
%    \end{macrocode}
%\noindent
% Add exceptions for xspace
%    \begin{macrocode}
\xspaceaddexceptions{%
  = \markit \, \suit \GetTranslation
  2 3 4 5 6 7 8 9 T J Q K A
}
%    \end{macrocode}
% Load the fallback dictionary. This is the default one and equals the
% English dictionary. All other dictionaries are loaded on the fly, when
% needed, provided they are in the \TeX-path.
%
%    \begin{macrocode}
\LoadDictionaryFor{fallback}{ODw}
%    \end{macrocode}
%
% \subsubsection{Options}
%
% We use the \packname{pgf} \meta{key}=\meta{val} system for our 
% options: |colors|, |warn| and |err|.
%    \begin{macrocode}
\pgfkeys{/ODw/.is family}
\def\ODw@set#1{\pgfkeys{/ODw,#1}}
\ODw@set{colors/.is choice,}
\ODw@set{warn/.is choice,}
\ODw@set{err/.is choice,}
%    \end{macrocode}
% The details for option |colors| are on page \pageref{Colors}ff and those for
% option |warn| and |err| on page \pageref{Messages}.
%
% \subsubsection{Misc}
%
% \begin{macro}{\,}\MacroDef{,}
% \begin{macro}{\thinspace}\MacroDef{thinspace}
% We redefine |\thinspace| (originally $\frac{1}{6}$em) to a smaller amount.
% That makes denominations like |3\Sp| (3\Sp) look better. The code is
% from:\\
% \url{https://tex.stackexchange.com/questions/181003/multiply-fine-tuning-with-a-thinspace}\\
% This code however doesn't work when coded within an own package, unless we
% use |\AtBeginDocument|. 
%    \begin{macrocode}
\AtBeginDocument{%
  \renewcommand{\,}[1][1]{%
    \ifmmode\mskip#1\thinmuskip%
     \else\thinspace[#1]\fi%
  }%
  \renewcommand{\thinspace}[1][1]{%
   \kern#1\dimexpr0.16667em\relax%
  }% 
}% AtBeginDocument
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\ODw@gsetlength}\MacroDef{ODw@gsetlength}[\marg{\bs len-name}\marg{len-value}]
% \noindent
%
% We need to store the length of certain objects that are within a
% group (the group is needed to keep the font-size changes local).
% Therefore we define macro |\ODw@gsetlength|
% that works globally. The code is based upon a solution on LaTeX
% StackExchange:\\
% (\url{https://tex.stackexchange.com/questions/406015/defining-macro-gsetlength-as-global-setlength-reliable})
%    \begin{macrocode}
\gdef\ODw@gsetlength#1#2{%
  \begingroup
    \setlength\skip@{#2}% local assign to scratch reg.
    \global#1=\skip@%     global assignment to #1;
  \endgroup%              restore \skip@ by endgroup.
}% ODw@gsetlength
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@append}\MacroDef{ODw@append}[\marg{tokens}]
% In the environment |play| we need to calculate the winning tricks for
% \NorthSouth*! and \EastWest*!\footnote{For details see page \pageref{Play}}.
% We store this information as a string in |\ODw@Scratch| and use
%  |\ODw@append| to accumulate them.
%    \begin{macrocode}
\gdef\ODw@append#1{%
  \bgroup%
    \edef\tmp{\the\ODw@Scratch #1}%
    \global\ODw@Scratch=\expandafter{\tmp}%
  \egroup%
}% ODw@append
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Variables}
%
% In this package we do use font relative sizing. That means that widths
% and skips are defined in terms of |em|, |ex| and |baselineskip|. On the
% other hand there are e.g.\ the real world names of the bidders, that must
% be recorded. Some of these the user should be able to control. Rather
% than forcing the user to do that directly with |\def| or |\renewcommand|
% we store all this information in internal variables, by defining a
% constant command. These variables can be set by calling a user command,
% that is associated with the variable. E.g.\ the variable |\ODw@Skipwidth|
% gets set by the command |\handskip|. The variables we use are:
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\ODw@BidderFont}
% Controlled by |\bidderfont|: the font used for the players (|bidding|).
% \par\noindent
% \DescribeMacro{\ODw@CompassFont}
% Controlled by |\compassfont|: the font used for the compass.
% \par\noindent
% \DescribeMacro{\ODw@GameFont}
% Controlled by |\gamefont|: the font used for all card diagrams
% \par\noindent
% \DescribeMacro{\ODw@LegendFont}
% Controlled by |\legendfont|: the font used for the annotations.
% \par\noindent
% \DescribeMacro{\ODw@NameFont}
% Controlled by |\namefont|: the font used for the real world names.
% \par\noindent
% \DescribeMacro{\ODw@OtherFont}
% Controlled by |\otherfont|: the font used for other bridge
% expressions, also outside diagrams.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\ODw@BidderDefault}
% \DescribeMacro{\ODw@CompassDefault}
% \DescribeMacro{\ODw@GameDefault}
% \DescribeMacro{\ODw@LegendDefault}
% \DescribeMacro{\ODw@NameDefault}
% \DescribeMacro{\ODw@OtherDefault}
% These contain the default values for the fonts
% \par\vspace{5.5\baselineskip}\noindent
% \DescribeMacro{\ODw@North@Name}
% \DescribeMacro{\ODw@South@Name}
% Controlled by |\namesNS|: hold the real world names of the \north
% and the \south player.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{\ODw@East@Name}
% \DescribeMacro{\ODw@West@Name}
% Controlled by |\namesEW|: hold the real world names of the \east
% and the \west player. These names are typeset using the font specified with
% |\namefont|.
% \par\vspace{0.5\baselineskip}\noindent
% \DescribeMacro{ODw@BoardText}
% Controlled by |\boardtext|: holds the board number and extra text.\\
% \DescribeMacro{ODw@HeaderText}
% Controlled by |\headlinetext|: holds header information for card
% diagrams.\\
% \DescribeMacro{ODw@FooterText}
% Controlled by |\footlinetext|: holds footer information for card
% diagrams.\\
% \DescribeMacro{ODw@Last}
% Used in command |\ODw@Tricks|: to store the player that had the
% lead\footnote{see page \pageref{Last}}.\\
% \DescribeMacro{\ODw@Skipwidth}
% Controlled by |\handskip|: holds the distance between hand and bidding
% diagram. 
%    \begin{macrocode}
\def\ODw@CompSize{1}% factor to enlarge the compass
\def\ODw@CompLine{}%  thickness of compass frame
\def\ODw@Skipwidth{1em}%
%    \end{macrocode}
%
% \subsubsection{Booleans, Saveboxes, Lengths, Counters and Registers}
%
% \paragraph{Booleans}
%
% \DescribeMacro{\ifODw@description}
% |\ifODw@description| is used in the |bidding| environments and the
% command |\expertquiz| to test if there is an annotation that should
% be written.
% \par\noindent
% \DescribeMacro{\ifODw@short}
% |\ifODw@short| is used in the |bidding| environments and the command
% |\expertquiz| to denote if a short form of the diagram header is to be
% used.
% \par\noindent
% \DescribeMacro{\ifODw@monochrome}
% |\ifODw@monochrome| flags the case
% that the user specified |colors=0| or |colors=1|, i.e.\ just black and
% white. In this situation we will not print the vulnerable side in red,
% but use italics instead.
% \par\noindent
% \DescribeMacro{\ifOdW@CardSkip}
% |\ifOdW@CardSkip| determines whether we need some extra space between
% card ranks (i.e.\ in suit descriptions) or not (i.e.\ in |bidding| 
% or |play| diagrams).
% \par\noindent
% \DescribeMacro{\ifOdW@Bidders}
% |\ifODw@Bidders| suppresses the bidders in the bidding header.
% \par\noindent
% \DescribeMacro{\ifOdW@BidLine}
% |\ifODw@BidLine| draw a |\hline| below the bidding header.
% \par\noindent
% \DescribeMacro{\ifOdW@LongCalls}
% |\ifODw@LongCalls| determines whether to use the short (like \North*!) or
% the long form (like \North*) for calls in the |bidding| diagram.
% \par\noindent
% \DescribeMacro{\ifOdW@CompShow}
% With |\ifODw@CompShow| one can suppress drawing a compass within card
% diagramns completely.
% \par\noindent
% \DescribeMacro{\ifOdW@CompTurn}
% With |\ifODw@CompTurn| one rotates letters |E| and |W| in the
% compass 90°.
%    \begin{macrocode}
\newif\ifODw@description% must typeset an annotation
\newif\ifODw@short%       short form in bidding header
\newif\ifODw@monochrome%  no colors wanted
\newif\ifOdW@CardSkip%    skip between ranks needed
%    \end{macrocode}
% The next booleans are directly controlled by |\setdefaults|.
%    \begin{macrocode}
\newif\ifODw@Bidders%    suppress bidders in bidding header
\newif\ifODw@BidLine%    draw \hline below bidding header
\newif\ifODw@LongCalls%  switch between long/short calls
\newif\ifODw@CompShow%   show compass or not
\newif\ifODw@CompTurn%   turn E-W letters 90°
%    \end{macrocode}
% \begin{macro}{\ODw@EmptyHeader}
% \begin{macro}{\ODw@EmptyFooter}
% Since there seems to be a problem in using\label{Empty}
% |\ifthenelse|\footnote{\textbf{ifthenelse} bites \textbf{multicolumn}!}
% in particular places, these booleans are set by calling |ODw@TestIfEmpty|
% (which uses an ordinary |\ifthenelse|) \emph{outside} the dangerous
% places, and then use e.g.\ |\ifODw@EmptyHeader| as a test whether the
% header is empty or not.
%    \begin{macrocode}
\newboolean{ODw@EmptyHeader}% = 'header is empty'
\newboolean{ODw@EmptyFooter}% = 'footer is empty'
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \paragraph{Saveboxes}
% \DescribeMacro{\ODw@Diagram@Box}
% |\ODw@Diagram@Box| is to store the actual card diagram (the compass
% with the hands) in order to calculate its width.
% \par\noindent
% \DescribeMacro{\ODw@BidBox}
% |\ODw@BidBox| stores a |bidding| diagram. 
% \par\noindent
% \DescribeMacro{\ODw@Hand@Box}
% |\ODw@Hand@Box| stores a hand with the 4 suits. 
% \par\noindent
%    \begin{macrocode}
\newsavebox\ODw@Diagram@Box
\newsavebox\ODw@Hand@Box
\newsavebox\ODw@BidBox
%    \end{macrocode}
% \paragraph{Lengths}
% \DescribeMacro{\ODw@Bid@Width}
% Is used to store the actual width of the |bidding| diagram.
% \par\noindent
% \DescribeMacro{\ODw@Card@Skip} Defines space between
% adjacent cards in suits.
% \par\noindent
% \DescribeMacro{\ODw@Diagram@Width} Defines the width of compass plus
% (\EastWest*!) hands.
% \par\noindent
% \DescribeMacro{\ODw@Skip@Width} Defines the distance between the card
% diagram and the |bidding| diagram.
% \par\noindent
% \DescribeMacro{\ODw@Tmp@Len}
% \par\noindent
% \DescribeMacro{\ODw@Tmp@Width} Auxiliary lengths, used in several
% calculations.
% \par\noindent
%    \begin{macrocode}
\newlength\ODw@Compasssize% the size of the compass.
\newlength\ODw@Diagram@Width
\newlength\ODw@Card@Skip
\setlength\ODw@Card@Skip{.15em}% space between cards
\newlength\ODw@Bid@Width
\newlength\ODw@Skip@Width
  \setlength\ODw@Skip@Width{\ODw@Skipwidth}
\newlength\ODw@Tmp@Len%   temp var for computations
\newlength\ODw@Tmp@Width% temp var for computations
%    \end{macrocode}
% \paragraph{Counters}
% \DescribeMacro{ODw@Nr} Counts lines (in |play| diagrams) and explanations
% (in |bidding| diagrams).
%    \begin{macrocode}
\newcounter{ODw@Nr}
%    \end{macrocode}
% \par\noindent
% \DescribeMacro{ODw@Cnt} Auxiliary counter, used in several calculations.
%    \begin{macrocode}
\newcounter{ODw@Cnt}
%    \end{macrocode}
% \par\noindent
% \DescribeMacro{ODw@PlayerNr} Set to the player that won the trick in
% environment |play|.
%    \begin{macrocode}
\newcounter{ODw@PlayerNr}
%    \end{macrocode}
% \par\noindent
% \DescribeMacro{ODw@NSCnt} Holds the number of N-S tricks in environment
% |play|.
%    \begin{macrocode}
\newcounter{ODw@NSCnt}
%    \end{macrocode}
% \par\noindent
% \DescribeMacro{ODw@EWCnt} Holds the number of E-W tricks in environment
% |play|.
%    \begin{macrocode}
\newcounter{ODw@EWCnt}
%    \end{macrocode}
% \paragraph{Registers}
% \DescribeMacro{ODw@Scratch} Tempory store for winning tricks in
% environment |play|.
%    \begin{macrocode}
\newtoks{\ODw@Scratch}
%    \end{macrocode}
%
% \subsubsection{Fonts}
%
% \paragraph{Text Fonts}
%
% Here we merely define the commands to set the default fonts. At the end
% of this .sty file they are set to their value. Refer to
% section~\ref{Init} for details.
% \begin{macro}{\bidderfont}
% \begin{macro}{\ODw@BidderFont}
% The font used to indicate the symbolic player (N, E, S, W) in bidding
% diagrams. The default is |\mdseries\sffamily|.
%    \begin{macrocode}
\newcommand\bidderfont[1]{\gdef\ODw@BidderFont{#1}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\compassfont}
% \begin{macro}{\ODw@CompassFont}
% The font used to indicate the directions (N, E, S, W) in the compass. The
% default is |\mdseries\sffamily|.
%    \begin{macrocode}
\newcommand\compassfont[1]{\gdef\ODw@CompassFont{#1}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\namefont}
% \begin{macro}{\ODw@NameFont}
% The font used for the real world names of the players in bidding
% diagrams. The default id |\mdseries\slshape|.
%    \begin{macrocode}
\newcommand\namefont[1]{\gdef\ODw@NameFont{#1}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\legendfont}
% \begin{macro}{\ODw@LegendFont}
% The font used for the conditions in card diagrams. The default is
% |\mdseries\rmfamily|.
%    \begin{macrocode}
\newcommand\legendfont[1]{\gdef\ODw@LegendFont{#1}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\otherfont}
% \begin{macro}{\ODw@OtherFont}
% The font used for the other bridge expressions like |\north|, |\pass| or
% |\double|. The default is |\bfseries\sffamily|.
%    \begin{macrocode}
\newcommand\otherfont[1]{\gdef\ODw@OtherFont{#1}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\gamefont}
% The font for the hands and calls. It sets the general font-size/widths for
% the game. The default is |\bfseries\sffamily|.
% \par\noindent
% \begin{macro}{\ODw@GameFont}
% We use widths that are dynamically adjusted at font changes and store the
% 'value' as text in |\ODw@GameFont|.
% \par\noindent
% \begin{macro}{\ODw@GameSize}
% |\ODw@GameSize| recalculates these
% sizes and is called in all show- and bid-diagrams.
%    \begin{macrocode}
\newcommand\gamefont[1]{%
  \gdef\ODw@GameFont{#1}%
  \gdef\ODw@GameSize{% recalculate dimens for the new font
    \ODw@GameFont%
    \setlength\ODw@Skip@Width{\ODw@Skipwidth}%
  }%
}% gamefont
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \paragraph{Symbol Font}
% We need special symbols to get solid colored \He{} and \Di, rather than
% \textcolor{red}{\ensuremath{\heartsuit}}{} and 
% \textcolor{red}{\ensuremath{\diamondsuit}}. We use those from |stix|.
% As the shape of the 'normal' black suits differ from the red ones we also
% take the black suits from the font |stix|. First we define the symbols
% and font. As we do not want to load the complete package, we only use
% the relevant piece of code found in |txfont.sty|:
%    \begin{macrocode}
\fontencoding{T1}\fontfamily{stix}
\fontseries{m}\fontshape{n}\selectfont
%
% Code stolen from txfonts.sty.
% It works smoothly: thank you guys!
% Because of an interference with package newtxmath I had to rename
% symbols into ODw@symbols and symbolsC into ODw@symbolsC
%
\DeclareSymbolFont{ODw@symbols}{OMS}{txsy}{m}{n}
\SetSymbolFont{ODw@symbols}{bold}{OMS}{txsy}{bx}{n}
\DeclareFontSubstitution{OMS}{txsy}{m}{n}
\DeclareSymbolFont{ODw@symbolsC}{U}{txsyc}{m}{n}
\SetSymbolFont{ODw@symbolsC}{bold}{U}{txsyc}{bx}{n}
\DeclareFontSubstitution{U}{txsyc}{m}{n}
%    \end{macrocode}
% \begin{macro}{\ODw@spadesuit}
%    \begin{macrocode}
\DeclareMathSymbol{\ODw@spadesuit}{\mathord}{ODw@symbols}{127}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ODw@varheart}
%    \begin{macrocode}
\DeclareMathSymbol{\ODw@varheart}{\mathord}{ODw@symbolsC}{114}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ODw@vardiamond}
%    \begin{macrocode}
\DeclareMathSymbol{\ODw@vardiamond}{\mathord}{ODw@symbolsC}{113}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ODw@clubsuit}
%    \begin{macrocode}
\DeclareMathSymbol{\ODw@clubsuit}{\mathord}{ODw@symbols}{124}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Bridge Basic Terms}
%
% \subsubsection{Suit Symbols}
%
% First we supply shorthands for the `five' suits (\Cl, \Di, \He, \Sp and
% \NT) that are used in the game of bridge.
% We define the international version with the English shortcuts. We use
% the |xcolor| package to colorize the suit symbols. The color can be set
% as an \meta{key}=\meta{val} option when loading the package. The option
% |colors=0| means mono-color (black only), synonyms of key 0 are |mono|
% and |black|. |colors=1| means black and white, a synonym is |b+w|.
% |colors=2| means bi-color (black and red), with synonym |b+r|.
% |colors=3| means grey, with synonyms |gray| and |grey|. This 'color' is meant for special
% effects, e.g. for making unimportant parts less visible
% |colors=4A| gives qua-color (green, orange, red and blue); synonyms are
% |fourA| and |4a|. Finally |colors=4B| defines the second qua-color (black,
% orange, red and green) with synonyms |fourB| and |4b|. 
%
% We precede all the suit symbols with a `very-thin-space' (|\,[0.3]|)
% which is 0.3 the size of a normal |\thinspace|.\label{Colors}
%
% In order to test which suit (|\Cl|,\ldots) was encountered in
% |\ODw@translate|\footnote{see page \pageref{Translate}} we \emph{must}
% define the suits with a |renewrobustcommand|. So we must |\def| them
% first.
%
% \changes{v0.6a}{2018/03/15}{\\
% - In order to test which suit (\cmd{\Cl},\ldots) was encountered in \cmd{\ODw@translate} (see page \pageref{Translate}) we \emph{must} define the suits as a \emph{renewrobustcommand}. So we \cmd{\def}ine them first! The idea was given on LaTeX StackExchange by egreg, see \url{https://tex.stackexchange.com/questions/420257/test-which-macro-is-called-in-tabular/420258#420258}
% }
%
%    \begin{macrocode}
% \def them first and then use renewrobustcmd! 
\def\Cl{}\def\Di{}\def\He{}\def\Sp{}%
\ODw@set{%
 colors/0/.code={%
  \ODw@monochrometrue%
  \renewrobustcmd\Cl{\textcolor{black}%
   {\,[0.3]\ensuremath{\ODw@clubsuit}}\xspace}%
  \renewrobustcmd\Di{\textcolor{black}%
   {\,[0.3]\ensuremath{\ODw@vardiamond}}\xspace}%
  \renewrobustcmd\He{\textcolor{black}%
   {\,[0.3]\ensuremath{\ODw@varheart}}\xspace}%
  \renewrobustcmd\Sp{\textcolor{black}%
   {\,[0.3]\ensuremath{\ODw@spadesuit}}\xspace}%
 }%
}
\ODw@set{colors/mono/.code={\pgfkeys{/ODw/colors=0}}}
\ODw@set{colors/black/.code={\pgfkeys{/ODw/colors=0}}}
%
\ODw@set{%
 colors/1/.code={%
  \ODw@monochrometrue%
  \renewrobustcmd\Cl{\textcolor{black}%
   {\,[0.3]\ensuremath{\ODw@clubsuit}}\xspace}%
  \renewrobustcmd\Di{\,[0.3]\ensuremath{\diamondsuit}\xspace}%
  \renewrobustcmd\He{\,[0.3]\ensuremath{\heartsuit}\xspace}%
  \renewrobustcmd\Sp{\textcolor{black}%
   {\,[0.3]\ensuremath{\ODw@spadesuit}}\xspace}%
 }%
}
\ODw@set{colors/b+w/.code={\pgfkeys{/ODw/colors=1}}}
%
\ODw@set{%
 colors/2/.code={%
  \ODw@monochromefalse%
  \renewrobustcmd\Cl{\textcolor{black}%
   {\,[0.3]\ensuremath{\ODw@clubsuit}}\xspace}%
  \renewrobustcmd\Di{\textcolor{red}%
   {\,[0.3]\ensuremath{\ODw@vardiamond}}\xspace}%
  \renewrobustcmd\He{\textcolor{red}%
   {\,[0.3]\ensuremath{\ODw@varheart}}\xspace}%
  \renewrobustcmd\Sp{\textcolor{black}%
   {\,[0.3]\ensuremath{\ODw@spadesuit}}\xspace}%
 }%
}
\ODw@set{colors/b+r/.code={\pgfkeys{/ODw/colors=2}}}
%
\ODw@set{%
 colors/3/.code={%
  \ODw@monochromefalse%
  \renewrobustcmd\Cl{\textcolor{gray}%
   {\,[0.3]\ensuremath{\ODw@clubsuit}}\xspace}%
  \renewrobustcmd\Di{\textcolor{gray}%
   {\,[0.3]\ensuremath{\ODw@vardiamond}}\xspace}%
  \renewrobustcmd\He{\textcolor{gray}%
   {\,[0.3]\ensuremath{\ODw@varheart}}\xspace}%
  \renewrobustcmd\Sp{\textcolor{gray}%
   {\,[0.3]\ensuremath{\ODw@spadesuit}}\xspace}%
 }%
}
\ODw@set{colors/grey/.code={\pgfkeys{/ODw/colors=3}}}
\ODw@set{colors/gray/.code={\pgfkeys{/ODw/colors=3}}}
%
\ODw@set{%
 colors/4A/.code={%
  \ODw@monochromefalse%
  \renewrobustcmd\Cl{\textcolor{green}%
   {\,[0.3]\ensuremath{\ODw@clubsuit}}\xspace}%
  \renewrobustcmd\Di{\textcolor{orange}%
   {\,[0.3]\ensuremath{\ODw@vardiamond}}\xspace}%
  \renewrobustcmd\He{\textcolor{red}%
   {\,[0.3]\ensuremath{\ODw@varheart}}\xspace}%
  \renewrobustcmd\Sp{\textcolor{blue}%
   {\,[0.3]\ensuremath{\ODw@spadesuit}}\xspace}%
 }%
}
\ODw@set{colors/fourA/.code={\pgfkeys{/ODw/colors=4A}}}
\ODw@set{colors/4a/.code={\pgfkeys{/ODw/colors=4A}}}
%
\ODw@set{%
 colors/4B/.code={%
  \ODw@monochromefalse%
  \renewrobustcmd\Cl{\textcolor{black}%
   {\,[0.3]\ensuremath{\ODw@clubsuit}}\xspace}%
  \renewrobustcmd\Di{\textcolor{orange}%
   {\,[0.3]\ensuremath{\ODw@vardiamond}}\xspace}%
  \renewrobustcmd\He{\textcolor{red}%
   {\,[0.3]\ensuremath{\ODw@varheart}}\xspace}%
  \renewrobustcmd\Sp{\textcolor{green}%
   {\,[0.3]\ensuremath{\ODw@spadesuit}}\xspace}%
 }%
}
\ODw@set{colors/fourB/.code={\pgfkeys{/ODw/colors=4B}}}
\ODw@set{colors/4b/.code={\pgfkeys{/ODw/colors=4B}}}
%    \end{macrocode}
%
% \begin{macro}{\nt}
% \begin{macro}{\NT}
% Because some languages use a different symbol for \NT{} (\nt*) we must
% look it up in the dictionary to find e.g.\ \Translate{\NT}
% (\Translate{\nt*}) for German.
%    \begin{macrocode}
\NewDocumentCommand\nt{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF#1{%
      \IfBooleanTF#2
        {\,[0.3]\GetTranslation{NT-(ODw)}}%
        {\GetTranslation{No Trump-(ODw)}}%
      }{%
      \IfBooleanTF#2
        {\,[0.3]\GetTranslation{nt-(ODw)}}%
        {\GetTranslation{no trump-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% nt
%    \end{macrocode}
% Define a practical shorthand to produce \NT{} without the need to add a
% token.
%    \begin{macrocode}
\def\NT{\nt*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \par\vspace{0.3\baselineskip}\noindent
% \begin{macro}{\ODw@SetRank}\MacroDef{ODw@SetRank}[\marg{card rank}]
% |\ODw@SetRank| stores the rank of the card played in |\ODw@Rank|. This is
% essentially the intrinsic rank of the card (\emph{2} for a 2, \emph{14}
% for an Ace), but there are special cases:
% \begin{itemize}[itemsep=-2mm,topsep=-1em]
%  \item Spot cards (denoted with \emph{x}) always get rank 0
%  \item Discards always get rank 0
%  \item Trump cards get 15 (\emph{15} to ensure that a spot trump card
%  defeats an Ace) added to the intrinsic rank, to make sure
%   that:
%   \begin{itemize}[itemsep=-1mm,topsep=-0.3em]
%    \item A trump card will defeat all other cards
%    \item The highest trump card will win the trick
%   \end{itemize}
% \end{itemize}
% \par\vspace{0.5\baselineskip}
% We first define three variables, one to store the suit of the actual card,
% the second one to store which suit was led and the last variable
% to store which suit is the trump suit, all initialized with the '\NT-suit'.
%    \begin{macrocode}
\gdef\ODw@SuitPlayed{N}
\gdef\ODw@SuitLead{N}
\gdef\ODw@TrumpSuit{N}
\newcounter{ODw@Rank}
%    \end{macrocode}
%    \begin{macrocode}
\def\ODw@SetRank#1{%
  \ifthenelse{\equal{\ODw@SuitPlayed}{\ODw@SuitLead}}%
  % if a suit is followed, store the intrinsic rank
    {\setcounter{ODw@Rank}{#1}}%
    {% else, if a suit is not followed then ...
  % (at NoTrump, the trumpsuit is coded 'N' and will
  % never match a real suit (coded C, D, H and S))
  % thus avoiding that trump cards are detected
       \ifthenelse{\equal{\ODw@SuitPlayed}{\ODw@TrumpSuit}}%
  % if it is a trump card, increase the rank
         {\setcounter{ODw@Rank}{#1}%
          \addtocounter{ODw@Rank}{15}}%
  % if it is a discard, set the rank to 0 to make
  % sure it will never win
         {\setcounter{ODw@Rank}{0}}%
    }% ifthen
  % If the card was of another suit,
  %    then ODw@SuitPlayed was changed.
  % If we encounter 'unsuited' cards, 
  %    then we must reestablish the 
  %    original ODw@SuitPlayed. 
    \global\edef\ODw@SuitPlayed{\ODw@SuitLead}% org. suit
}% ODw@SetRank
%    \end{macrocode}
% \end{macro}
% \par\vspace{0.3\baselineskip}\noindent
% \begin{macro}{\ODw@Xfer}\MacroDef{ODw@Xfer}[\marg{tokens}]
% This macro gets called by |ODw@Tfer| which is automatically called in the
% environments |play|, |bidding| and |biddingpair| by means of
% |columntype P| and |columntype B| to convert at one hand the shorthand
% suit code in suit symbols and at the other hand to translate card honors
% into the active language. It also converts the card value |T| into
% \Xfer{T} and a hyphen into an en-dash. It calls |\ODw@translate| to do
% the work.
%
% The following code was contributed on StackExchange by egreg, see
% \url{https://tex.stackexchange.com/questions/417731/problem-with-xstring-ifeqcase-case-falls-thru/417788?noredirect=1#comment1045001_417788}
%    \begin{macrocode}
\ExplSyntaxOn
 % NB: now all spaces are ignored, use '~' if needed.
\NewDocumentCommand{\ODw@Xfer}{m}{
  \bgroup
  % we do not want spaces here
    \def\xspace{}
    \tl_map_function:nN {#1} \ODw@translate:n
  \egroup
}% ODw@Xfer
%    \end{macrocode}
% \end{macro}
% \par\vspace{0.3\baselineskip}\noindent
% \begin{macro}{\ODw@translate}\MacroDef{ODw@translate}[\marg{tokens}]
% |\ODw@translate| processes a (relatively short) string of tokens that
% determine an entry in |bidding| or |play| diagrams, and also
% in all situations where suits are defined. It gets called by |\ODw@Xfer|.
%
% It expects bridge stuff describing strings like |AKT54| to produce the
% suit \suit{AKT52}, |2H\alert| to produce the call
% \Xfer{2H\alert} in the |bidding| diagram, or |DA| to produce \Xfer{DA} as
% entry in the |play| diagram to show that the ace of diamonds was played.
% Please note that constructs like |\textit{DA}| or |\frame{2H}| are not
% allowed and will produce rather misleading errors like:\\
% \example{|! Argument of \bs ODw@translate:n has an extra \}.|} or \\
% \example{|! Missing number,treated as zero.|}\\[0.2\baselineskip]
% Even clever people who use |{\frame{2H}}| will get disoppointed, because
% they'll get \frame{2H} rather than the wanted \frame{2\He}. But the very
% clever people can reach their goal by using |{\frame{2\He}}| or
% |{\textit{\Di A}}|. 
% \par\vspace{0.5\baselineskip}
%    \begin{macrocode}
\cs_new_protected:Nn \ODw@translate:n
 {
  \setcounter{ODw@Rank}{0}
  \str_case:nnTF {#1}
   { % Store the suit of the card played
     % needed to determine the winner
     % and for checking for multiple cards
     {C}{\Cl\gdef\ODw@SuitPlayed{C}}
     {D}{\Di\gdef\ODw@SuitPlayed{D}}
     {H}{\He\gdef\ODw@SuitPlayed{H}}
     {S}{\Sp\gdef\ODw@SuitPlayed{S}}
     {N}{\NT\gdef\ODw@SuitPlayed{N}}
  % Translate a hyphen into an en-dash
     {-}{--}
  %
  % 1: translate the honour cards,
  % 2: store the played cards for checking
  % 3: and set their rank. This must be done last, because
  % \ODw@SetRank resets \ODw@SuitPlayed to \ODw@SuitLead
  % Honour Cards
  %        1                      2
     {A}{\Ace*!\ODw@AppendCard{\ODw@SuitPlayed}{A}
          \ODw@SetRank{14}}% 3
     {K}{\King*!\ODw@AppendCard{\ODw@SuitPlayed}{K}
          \ODw@SetRank{13}}
     {Q}{\Queen*!\ODw@AppendCard{\ODw@SuitPlayed}{Q}
          \ODw@SetRank{12}}
     {J}{\Jack*!\ODw@AppendCard{\ODw@SuitPlayed}{J}
          \ODw@SetRank{11}}
     {T}{\kern-0.1em1\kern-0.1em0% massage 1 and 0 a bit
         \ODw@AppendCard{\ODw@SuitPlayed}{T}\ODw@SetRank{10}}
  % Numeral Cards
     {9}{9\ODw@AppendCard{\ODw@SuitPlayed}{9}\ODw@SetRank{9}}
     {8}{8\ODw@AppendCard{\ODw@SuitPlayed}{8}\ODw@SetRank{8}}
     {7}{7\ODw@AppendCard{\ODw@SuitPlayed}{7}\ODw@SetRank{7}}
     {6}{6\ODw@AppendCard{\ODw@SuitPlayed}{6}\ODw@SetRank{6}}
     {5}{5\ODw@AppendCard{\ODw@SuitPlayed}{5}\ODw@SetRank{5}}
     {4}{4\ODw@AppendCard{\ODw@SuitPlayed}{4}\ODw@SetRank{4}}
     {3}{3\ODw@AppendCard{\ODw@SuitPlayed}{3}\ODw@SetRank{3}}
     {2}{2\ODw@AppendCard{\ODw@SuitPlayed}{2}\ODw@SetRank{2}}
  % A spot card has rank 0
     {x}{x\ODw@SetRank{0}}
  % 
  % Non cards (bidding only)
     {1}{1}% this enables e.g. 1\He in biddings
     {p}{\ifODw@LongCalls\Pass*\else\Pass!\fi}
     {P}{\ifODw@LongCalls\Allpass*\else\Allpass*!\fi}
     {X}{\ifODw@LongCalls\Double*\else\Double!\fi}
     {R}{\ifODw@LongCalls\Redouble*\else\Redouble!\fi}
   }% case
   {% if matched (case T(rue)) 
    \ifOdW@CardSkip\hspace{\ODw@Card@Skip}\fi
  % suit of 1st card (ODw@SuitLead) is ODw@SuitPlayed
   \if\theODw@PlayerNr1
     \global\edef\ODw@SuitLead{\ODw@SuitPlayed}
   \fi
   }
%    \end{macrocode}
% We offer the possibility that one can use also |\He| in |bidding| and
% |play| diagrams rather than just the abbreviation |H|. Therefore we must
% test which suit was given and set |\ODw@SuitPlayed| accordingly. To make
% this test work, we had to redefine the suit macros with an
% |\renewrobustcmd|.\label{Translate} Here we also issue |\expandafter{#1}|
% rather than just |#1|. Otherwise, among others, the coloring of the suit
% symbol would extend behind it. Curiously enough the phenomena does not
% occur anymore. I leave the expandafter in, until this is cleared.
%    \begin{macrocode}
   {% if not matched (case F(alse))
     \ifx#1\Cl\gdef\ODw@SuitPlayed{C}\fi
     \ifx#1\Di\gdef\ODw@SuitPlayed{D}\fi
     \ifx#1\He\gdef\ODw@SuitPlayed{H}\fi
     \ifx#1\Sp\gdef\ODw@SuitPlayed{S}\fi
     \expandafter{#1}% enables e.g. 1\He
   % suit of 1st card (ODw@SuitLead) is ODw@SuitPlayed
     \if\theODw@PlayerNr1
       \global\edef\ODw@SuitLead{\ODw@SuitPlayed}
     \fi
   }
}% ODw@translate
\ExplSyntaxOff
%    \end{macrocode}
% \end{macro}
% \par\vspace{0.3\baselineskip}\noindent
% \begin{macro}{\ODw@AppendCard}\MacroDef{ODw@AppendCard}[\marg{suit}\marg{card}]
% In order to do a simple consistency check in |play| diagrams, we
% need to store the cards that were played. We do that for each suit in the
% variable |\ODw@<suit>|. This macro is called in |\ODw@translate|, i.e.\ 
% for all situations where cards are to be manipulated. But the result of
% |\ODw@AppendCard| is used only within |play| diagrams. The macro
% |\ODw@appendcard| appends 1 character to a string.
% 
%    \begin{macrocode}
%
\newcommand{\ODw@appendcard}[2]{\xdef#1{#1#2}}

\newcommand\ODw@AppendCard[2]{%
  \IfEqCase{#1}{%
    {C}{\ODw@appendcard{\ODw@Clubs}{#2}}%
    {D}{\ODw@appendcard{\ODw@Diamonds}{#2}}%
    {H}{\ODw@appendcard{\ODw@Hearts}{#2}}%
    {S}{\ODw@appendcard{\ODw@Spades}{#2}}%
  }%
}% ODw@AppendCard
%    \end{macrocode}
% \end{macro}
% \par\vspace{0.3\baselineskip}\noindent
% \begin{macro}{\ODw@PTfer}\MacroDef{ODw@PTfer}[\marg{tokens}]
% This macro is called within |play| diagrams where we can write |HA| and
% get \Xfer{HA}. Also all relevant symbols get translated into the active
% language. We use the counter |ODw@PlayerNr| to determine the column in
% the |play| diagrams with the winning card, and from this we can compute
% which player won the trick. 
% |\ODw@PTfer| is essentially called for each entry in all columns of the 
% |play| diagram through the column definition:\\
% |\newcolumntype{P}{>{\collectcell\ODw@PTfer}c<{\endcollectcell}}|
%
% We first define two counters, both initially set to zero.
%    \begin{macrocode}
\newcounter{ODw@Highest}%    the highest rank until now
\setcounter{ODw@Highest}{0}
\newcounter{ODw@WinningNr}%  player with the highest rank
\setcounter{ODw@WinningNr}{0}

\def\ODw@PTfer#1{%
  \stepcounter{ODw@PlayerNr}%
  \ODw@Xfer{#1}% ODw@Rank = the rank for this card
  \ifthenelse{\value{ODw@Rank} > \value{ODw@Highest}}%
    {% This rank is higher than previous highest one
      \setcounter{ODw@WinningNr}{\theODw@PlayerNr}%
      \setcounter{ODw@Highest}{\theODw@Rank}% 
    }%
    {}%
  \ifthenelse{\value{ODw@PlayerNr} = 4}%
    {% last player: Process the winning trick:
      \stepcounter{ODw@Nr}% Start new row with new player
      \ODw@AccTricks%      Accumulate tricks for N-S/E-W
    }%
    {}%
}
%    \end{macrocode}
% \end{macro}
% \par\vspace{0.3\baselineskip}\noindent
% \begin{macro}{\ODw@FTfer}\MacroDef{ODw@FTfer}[\marg{tokens}]
% |\ODw@FTfer| is called for the first column of the |play| diagram
% TableII. In |\ODw@Tricks| it just resets |ODw@PlayerNr| and |\ODw@Last|
% and writes the player who leads. Finally it processes the entry of the
% first column by calling |\ODw@PTfer|.
% |\ODw@FTfer| is essentially called for the entries in the first column of
% TableII in the |play| diagram through the column definition:\\
% |\newcolumntype{F}{>{\collectcell\ODw@FTfer}c<{\endcollectcell}}|
%    \begin{macrocode}
\def\ODw@FTfer#1{%
  \ODw@Tricks%
  \ODw@PTfer{#1}%
}% ODw@FTfer
%    \end{macrocode}
% \end{macro}
% \par\vspace{0.3\baselineskip}\noindent
% \begin{macro}{\ODw@BTfer}\MacroDef{ODw@BTfer}[\marg{tokens}]
% This macro is called within |bidding| diagrams and enables us to type
% |1C\announce| and get \Xfer{1C\announce}. The symbols get translated into
% the active language. |\ODw@BTfer| is essentially called for each entry in
% the |bidding| diagrams through:\\
% |\newcolumntype{B}{>{\collectcell\ODw@BTfer}c<{\endcollectcell}}|
%
% As there is no special processing for the biding entries, we call |\ODw@Xfer|
% right away to do the job.
%
%    \begin{macrocode}
\def\ODw@BTfer#1{%
  \ODw@Xfer{#1}%
}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Names of Directions and Axes}
%
% \begin{macro}{\North}\MacroDef{North}[\Oarg{*!}]
% \begin{macro}{\north}\MacroDef{north}
%    \begin{macrocode}
\NewDocumentCommand\North{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF#1{%
      \IfBooleanTF{#2}{\ODw@N*}{\ODw@North*}%
    }{%
      \IfBooleanTF{#2}{\ODw@N}{\ODw@North}%
    }% TF#1
  \egroup%
  \xspace%
}% North
%
\def\north{\North*}
%    \end{macrocode}
% \end{macro}
% \end{macro}

% \begin{macro}{\East}\MacroDef{East}[\Oarg{*!}]
% \begin{macro}{\east}\MacroDef{east}
%    \begin{macrocode}
\NewDocumentCommand\East{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF#1{%
      \IfBooleanTF{#2}{\ODw@E*}{\ODw@East*}%
    }{%
      \IfBooleanTF{#2}{\ODw@E}{\ODw@East}%
    }% TF#1
  \egroup%
  \xspace%
}% East
%
\def\east{\East*}
%    \end{macrocode}
% \end{macro}
% \end{macro}

% \begin{macro}{\South}\MacroDef{South}[\Oarg{*!}]
% \begin{macro}{\south}\MacroDef{south}
%    \begin{macrocode}
\NewDocumentCommand\South{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF#1{%
      \IfBooleanTF{#2}{\ODw@S*}{\ODw@South*}%
    }{%
      \IfBooleanTF{#2}{\ODw@S}{\ODw@South}%
    }% TF#1
  \egroup%
  \xspace%
}% South
%
\def\south{\South*}
%    \end{macrocode}
% \end{macro}
% \end{macro}

% \begin{macro}{\West}\MacroDef{West}[\Oarg{*!}]
% \begin{macro}{\west}\MacroDef{west}
%    \begin{macrocode}
\NewDocumentCommand\West{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF#1{%
      \IfBooleanTF{#2}{\ODw@W*}{\ODw@West*}%
    }{%
      \IfBooleanTF{#2}{\ODw@W}{\ODw@West}%
    }% TF#1
  \egroup%
  \xspace%
}% West
%
\def\west{\West*}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\NorthSouth}\MacroDef{NorthSouth}[\Oarg{*!}]
% \begin{macro}{\northsouth}\MacroDef{northsouth}
%    \begin{macrocode}
\NewDocumentCommand\NorthSouth{s t!}{%
  \bgroup%
   \ODw@OtherFont%
   \IfBooleanTF#1{%
     \IfBooleanTF{#2}{\North*!--\South*!}{\North*--\South*}%
   }{%
     \IfBooleanTF{#2}{\North!--\South!}{\North--\South}%
   }%
  \egroup%
  \xspace%
}% NorthSouth
%
\def\northsouth{\NorthSouth*}
%    \end{macrocode}
% \end{macro}
% \end{macro}

% \begin{macro}{\EastWest}\MacroDef{EastWest}[\Oarg{*!}]
% \begin{macro}{\eastwest}\MacroDef{eastwest}
%    \begin{macrocode}
\NewDocumentCommand\EastWest{s t!}{%
  \bgroup%
    \ODw@OtherFont%
   \IfBooleanTF#1{%
     \IfBooleanTF{#2}{\East*!--\West*!}{\East*--\West*}%
   }{%
     \IfBooleanTF{#2}{\East!--\West!}{\East--\West}%
   }%
  \egroup%
  \xspace%
}% EastWest
%
\def\eastwest{\EastWest*}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% Next we define macros that translate the short form of the directions
% into the active language.
% \par\noindent
% \begin{macro}{\ODw@N}
% \begin{macro}{\ODw@E}
% \begin{macro}{\ODw@S}
% \begin{macro}{\ODw@W}
%    \begin{macrocode}
\def\ODw@N{%
  \@ifstar{\GetTranslation{N-(ODw)}}%
          {\GetTranslation{n-(ODw)}}%
}
\def\ODw@E{%
  \@ifstar{\GetTranslation{E-(ODw)}}%
          {\GetTranslation{e-(ODw)}}%
}
\def\ODw@S{%
  \@ifstar{\GetTranslation{S-(ODw)}}%
          {\GetTranslation{s-(ODw)}}%
}
\def\ODw@W{%
  \@ifstar{\GetTranslation{W-(ODw)}}%
          {\GetTranslation{w-(ODw)}}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\ODw@NS}
% \begin{macro}{\ODw@EW}
%    \begin{macrocode}
\def\ODw@NS{\ODw@N--\ODw@S}
\def\ODw@EW{\ODw@E--\ODw@W}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\ODw@North}
% \begin{macro}{\ODw@East}
% \begin{macro}{\ODw@South}
% \begin{macro}{\ODw@West}
%    \begin{macrocode}
\def\ODw@North{%
  \@ifstar{\GetTranslation{North-(ODw)}}%
          {\GetTranslation{north-(ODw)}}%
}
\def\ODw@East{%
  \@ifstar{\GetTranslation{East-(ODw)}}%
          {\GetTranslation{east-(ODw)}}%
}
\def\ODw@South{%
  \@ifstar{\GetTranslation{South-(ODw)}}%
          {\GetTranslation{south-(ODw)}}%
}
\def\ODw@West{%
  \@ifstar{\GetTranslation{West-(ODw)}}%
          {\GetTranslation{west-(ODw)}}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \subsubsection{Non-Bid Calls}
%
% \begin{macro}{\Pass}\MacroDef{Pass}[\Oarg{*!}]
% \begin{macro}{\pass}\MacroDef{pass}
%    \begin{macrocode}
\NewDocumentCommand\Pass{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{Pass!-(ODw)}}%
        {\GetTranslation{Pass-(ODw)}}%
    }{%
     \IfBooleanTF{#2}%
       {\GetTranslation{pass!-(ODw)}}%
       {\GetTranslation{pass-(ODw)}}%
    }% TF#1
  \egroup%
  \xspace%
}% Pass
%
\def\pass{\Pass*}
%    \end{macrocode}
% \end{macro}
% \end{macro}

% \begin{macro}{\Allpass}\MacroDef{Allpass}[\Oarg{*!}]
% \begin{macro}{\allpass}\MacroDef{allpass}
%    \begin{macrocode}
\NewDocumentCommand\Allpass{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF#1{%
      \IfBooleanTF{#2}%
        {\GetTranslation{AP-(ODw)}}%
        {\GetTranslation{All pass-(ODw)}}%
    }{%
     \IfBooleanTF{#2}%
       {\GetTranslation{ap-(ODw)}}%
       {\GetTranslation{all pass-(ODw)}}%
    }% TF#1
  \egroup%
  \xspace%
}% Allpass
%
\def\allpass{\Allpass*}
%    \end{macrocode}
% \end{macro}
% \end{macro}

% \begin{macro}{\Double}\MacroDef{Double}[\Oarg{*!}]
% \begin{macro}{\double}\MacroDef{double}
%    \begin{macrocode}
\NewDocumentCommand\Double{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF#1{%
      \IfBooleanTF{#2}%
       {\GetTranslation{Dbl-(ODw)}}%
       {\GetTranslation{Double-(ODw)}}%
    }{%
     \IfBooleanTF{#2}%
       {X}%
       {\GetTranslation{double-(ODw)}}%
    }% TF#1
  \egroup%
  \xspace%
}% Double
%
\def\double{\Double*}
%    \end{macrocode}
% \end{macro}
% \end{macro}

% \begin{macro}{\Redouble}\MacroDef{Redouble}[\Oarg{*!}]
% \begin{macro}{\redouble}\MacroDef{redouble}
%    \begin{macrocode}
\NewDocumentCommand\Redouble{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF#1{%
      \IfBooleanTF{#2}%
        {\GetTranslation{ReDbl-(ODw)}}%
        {\GetTranslation{ReDouble-(ODw)}}%
   }{%
     \IfBooleanTF{#2}%
       {\mbox{X\kern-0.1em X}}%
       {\GetTranslation{redouble-(ODw)}}%
    }% TF#1
  \egroup%
  \xspace%
}% Redouble
%
\def\redouble{\Redouble*}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
% \subsubsection{Bidding Diagrams}
%
% \DeleteShortVerb{\|}
% \begin{macro}{\ODw@FirstBidCol}\MacroDef{ODw@FirstBidCol}[\marg{{\upshape N|S|E|W}}]
% \MakeShortVerb{\|}
%
% |\ODw@FirstBidCol| determines which player starts in the first bidding column.
% We also take care that the real world name of the players are kept
% associated with the columns. For |\ODw@BidderX| (X=I,II,III,IV) we
% define two macros: |\ODw@BidderX| and |\ODw@BidderX*| in one. When these
% macros are called in the |bidding| diagram, the starred version writes the
% short notation whereas the unstarred one writes the long version.
%    \begin{macrocode}
\newcommand\ODw@FirstBidCol[1]{%
 \IfEqCase{#1}{%
  {N}{%
   \def\ODw@BidderI{\@ifstar{\ODw@North*}{\ODw@N*}}%
   \def\ODw@BidderII{\@ifstar{\ODw@East*}{\ODw@E*}}%
   \def\ODw@BidderIII{\@ifstar{\ODw@South*}{\ODw@S*}}%
   \def\ODw@BidderIV{\@ifstar{\ODw@West*}{\ODw@W*}}%
   \def\ODw@NameI{\ODw@North@Name}%
   \def\ODw@NameII{\ODw@East@Name}%
   \def\ODw@NameIII{\ODw@South@Name}%
   \def\ODw@NameIV{\ODw@West@Name}%
  }%
  {E}{%
   \def\ODw@BidderI{\@ifstar{\ODw@East*}{\ODw@E*}}%
   \def\ODw@BidderII{\@ifstar{\ODw@South*}{\ODw@S*}}%
   \def\ODw@BidderIII{\@ifstar{\ODw@West*}{\ODw@W*}}%
   \def\ODw@BidderIV{\@ifstar{\ODw@North*}{\ODw@N*}}%
   \def\ODw@NameI{\ODw@East@Name}%
   \def\ODw@NameII{\ODw@South@Name}%
   \def\ODw@NameIII{\ODw@West@Name}%
   \def\ODw@NameIV{\ODw@North@Name}%
  }%
  {S}{%
   \def\ODw@BidderI{\@ifstar{\ODw@South*}{\ODw@S*}}%
   \def\ODw@BidderII{\@ifstar{\ODw@West*}{\ODw@W*}}%
   \def\ODw@BidderIII{\@ifstar{\ODw@North*}{\ODw@N*}}%
   \def\ODw@BidderIV{\@ifstar{\ODw@East*}{\ODw@E*}}%
   \def\ODw@NameI{\ODw@South@Name}%
   \def\ODw@NameII{\ODw@West@Name}%
   \def\ODw@NameIII{\ODw@North@Name}%
   \def\ODw@NameIV{\ODw@East@Name}%
  }%
  {W}{%
   \def\ODw@BidderI{\@ifstar{\ODw@West*}{\ODw@W*}}%
   \def\ODw@BidderII{\@ifstar{\ODw@North*}{\ODw@N*}}%
   \def\ODw@BidderIII{\@ifstar{\ODw@East*}{\ODw@E*}}%
   \def\ODw@BidderIV{\@ifstar{\ODw@South*}{\ODw@S*}}%
   \def\ODw@NameI{\ODw@West@Name}%
   \def\ODw@NameII{\ODw@North@Name}%
   \def\ODw@NameIII{\ODw@East@Name}%
   \def\ODw@NameIV{\ODw@South@Name}%
  }%
 }% IfEqCase
}% ODw@FirstBidCol
%    \end{macrocode}
% \end{macro}
%
% Next we define the real world names for the \NorthSouth*! and the \EastWest*!
% bidders. We use |\ODw@All@Names| as variable to test if we have names for
% bidders at all: If it is empty, then no names were defined.
% \begin{macro}{\namesNS}\MacroDef{namesNS}[\marg{N-name}\marg{S-name}]
%    \begin{macrocode}
\newcommand\namesNS[2]{%
  \gdef\ODw@North@Name{#1}%
  \gdef\ODw@South@Name{#2}%
  \gdef\ODw@All@Names{#1#2\ODw@East@Name\ODw@West@Name}%
}% namesNS
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\namesEW}\MacroDef{namesEW}[\marg{E-name}\marg{W-name}]
%    \begin{macrocode}
\newcommand\namesEW[2]{%
  \gdef\ODw@East@Name{#1}%
  \gdef\ODw@West@Name{#2}%
  \gdef\ODw@All@Names{#1#2\ODw@North@Name\ODw@South@Name}%
}% namesEW
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Diagram Hands}
%
% Here we implement commands that store the cards that each player holds.
% E.g.\ |\northhand| defines the complete hand, i.e.\ all 4 suits for the
% \North*-player. They have an optional parameter (an offset, default |0pt|)
% to finetune the distance to the compass. In |\ODw@Nhand| and
% |\ODw@Shand| we use a makebox to prevent that its width goes beyond the
% |NESW| compass (but this can interfere with the Right-U/L-Legend). Within
% these macros, we check the consistency of the cards in the hand and also
% store card-information to check a complete deal later.
% \begin{macro}{\northhand}\MacroDef{northhand}[\oarg{v-offset}\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
% |\northhand[v-offset]{Sp}{He}{Di}{Cl}|\\
% |               1      2   3   4   5|
%    \begin{macrocode}
\newcommand\northhand[5][0pt]{%
% check that north has 13 cards
  \ODw@ChkNrOfCards{#2#3#4#5}{\north}%
  \gdef\ODw@NSpades{#2}%   Save norths cards
  \gdef\ODw@NHearts{#3}%   of all suits
  \gdef\ODw@NDiamonds{#4}% for later
  \gdef\ODw@NClubs{#5}%    checking
%    \end{macrocode}
% \begin{macro}{\ODw@Nhand}
% We fit the \north hand in a box to avoid that a 
% very long suit shifts the \east hand to the right
%    \begin{macrocode}
  \gdef\ODw@Nhand{%
    \makebox[\ODw@Compasssize + 2ex][l]{%
      \ODw@hand{t}{#2}{#3}{#4}{#5}%
    }%
    \vspace{#1}%
  }%
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
}% northhand
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\easthand}\MacroDef{easthand}[\oarg{h-offset}\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
% |\easthand[h-offset]{Sp}{He}{Di}{Cl}|\\
% |               1      2   3   4   5|
%    \begin{macrocode}
\newcommand\easthand[5][0pt]{%
% check that east has 13 cards
  \ODw@ChkNrOfCards{#2#3#4#5}{\east}%
  \gdef\ODw@ESpades{#2}%   Save easts cards
  \gdef\ODw@EHearts{#3}%   of all suits
  \gdef\ODw@EDiamonds{#4}% for later
  \gdef\ODw@EClubs{#5}%    checking
%    \end{macrocode}
% \begin{macro}{\ODw@Ehand}
%    \begin{macrocode}
  \gdef\ODw@Ehand{%
    \hspace{#1}%
    \ODw@hand{c}{#2}{#3}{#4}{#5}%
  }%
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
}% easthand
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\southhand}\MacroDef{southhand}[\oarg{v-offset}\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
% |\southhand[v-offset]{Sp}{He}{Di}{Cl}|\\
% |               1      2   3   4   5|
%    \begin{macrocode}
\newcommand\southhand[5][0pt]{%
% check that south has 13 cards
  \ODw@ChkNrOfCards{#2#3#4#5}{\south}%
  \gdef\ODw@SSpades{#2}%   Save souths cards
  \gdef\ODw@SHearts{#3}%   of all suits
  \gdef\ODw@SDiamonds{#4}% for later
  \gdef\ODw@SClubs{#5}%    checking
%    \end{macrocode}
% \begin{macro}{\ODw@Shand}
% We fit the \south hand in a box to avoid that a 
% very long suit shifts the \east hand to the right
%    \begin{macrocode}
  \gdef\ODw@Shand{%
    \parbox[b]{\ODw@Compasssize + 2ex}{%
      \vspace*{#1}\par%
      \makebox[0pt][l]{%
        \ODw@hand{b}{#2}{#3}{#4}{#5}%
      }%
    }%
  }%
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
}% southhand
%    \end{macrocode}
% \end{macro}

% \begin{macro}{\westhand}\MacroDef{westhand}[\oarg{h-offset}\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
% |\westhand[h-offset]{Sp}{He}{Di}{Cl}|\\
% |               1      2   3   4   5|
%    \begin{macrocode}
\newcommand\westhand[5][0pt]{%
% check that west has 13 cards
  \ODw@ChkNrOfCards{#2#3#4#5}{\west}%
  \gdef\ODw@WSpades{#2}%   Save wests cards
  \gdef\ODw@WHearts{#3}%   of all suits
  \gdef\ODw@WDiamonds{#4}% for later
  \gdef\ODw@WClubs{#5}%    checking
%    \end{macrocode}
% \begin{macro}{\ODw@Whand}
%    \begin{macrocode}
  \gdef\ODw@Whand{%
    \ODw@hand{c}{#2}{#3}{#4}{#5}%
    \hspace*{#1}%
  }%
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
}% westhand
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{A Single Hand}
%
% Sometimes we want to show only (the cards of) one single hand.
%
% \noindent
% \begin{macro}{\hand}\MacroDef{hand}[\Oarg{*!-}\oarg{pos}\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
%    \begin{macrocode}
\NewDocumentCommand\hand{s t! t- O{c}mmmm}{%
%    \end{macrocode}
% |\hand* ! -[pos]{Sp}{He}{Di}{Cl}|\\
% |     1 2 3  4   5   6   7   8|\\
% This macro has 3 optional tokens that act as follows:\\
% Naked mode: Displays the hand horizontally, left aligned.\\
% |*| mode: Displays the hand horizontally, centered.\\
% |!| mode: Displays the hand vertically, left aligned.\\
% |*!| mode: Displays the hand vertically, centered.\\
% |-| mode: Output is suppressed, it is stored in a savebox for later use.
% \par\vspace{0.3\baselineskip}\noindent
% The 4th argument is the aligning (used only in case of a vertical hand):
% default \textbf{c}. The rest of the arguments denote the cards of the
% suits. 
%
% We first check that this hand has 13 cards. Then we check for each
% suit that there are no multiples. Finally we store the hand in
% |\ODw@Hand@Box|. If output is not suppressed, we write the hand with
% |\usebox\ODw@Hand@Box|.
%    \begin{macrocode}
  \ODw@ChkNrOfCards{#5#6#7#8}{Hand}%
  \ODw@ChkSameCards{#5}{\Sp}% 
  \ODw@ChkSameCards{#6}{\He}%
  \ODw@ChkSameCards{#7}{\Di}%
  \ODw@ChkSameCards{#8}{\Cl}%
  \global\sbox{\ODw@Hand@Box}{%
    \bgroup%
      \ODw@GameSize% 
      \IfBooleanTF{#2}%
        {\ODw@vhand[#4]{#5}{#6}{#7}{#8}}%
        {\ODw@hhand{#5}{#6}{#7}{#8}}%
    \egroup%
  }% sbox
  \IfBooleanTF{#3}{}{%
   \IfBooleanTF{#1}%
      {{\centering \usebox{\ODw@Hand@Box}\par}}%
      {\usebox{\ODw@Hand@Box}}%
  }%
}% hand
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@hhand}\MacroDef{ODw@hhand}[\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
% Displays a hand horizontally (e.g.\ \hand{xxxx}{xxx}{xxx}{xxx}). We use a
% |tabular| with 4 columns in 1 row to print the 4 suits.
%    \begin{macrocode}
\newcommand\ODw@hhand[4]{%
  \bgroup%
  \def\xspace{}% undo xspace locally
               % it screws the distance between suit and cards
  \setlength\tabcolsep{1\ODw@Card@Skip}%
  \begin{tabular}{llll}
  % we can't use \suit here: it would cause double checks!
    \Sp\hspace{0.3em}\ODw@Cards{#1} &%
    \He\hspace{0.3em}\ODw@Cards{#2} &%
    \Di\hspace{0.3em}\ODw@Cards{#3} &%
    \Cl\hspace{0.3em}\ODw@Cards{#4} \\
  \end{tabular}%
  \egroup%
}% ODw@hhand
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\ODw@vhand}\MacroDef{ODw@vhand}[\oarg{pos}\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
% \shorthandoff{!}
% Display a hand vertically (e.g.\ \hand!{xxxx}{xxx}{xxx}{xxx}). We call
% \shorthandon{!}
% |\ODw@hand| to do the job.
%    \begin{macrocode}
\newcommand\ODw@vhand[5][c]{%
  \ODw@hand{#1}{#2}{#3}{#4}{#5}%
}% ODw@vhand
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@hand}\MacroDef{ODw@hand}[\oarg{pos}\marg{Sp}\marg{He}\marg{Di}\marg{Cl}]
% We put a hand and some spacing in a |tabular| by reading the cards for
% each suit, making the lines more tense with the |\\[-0.5ex]|.
% Empty hands are discarded completely.
%
%    \begin{macrocode}
\newcommand\ODw@hand[5]{%
%    \end{macrocode}
% |ODw@hand{pos}{spades}{hearts}{diamonds}{clubs}|\\
% |          1     2       3        4        5|
% \par\noindent 
% First we test if the hand is completely empty; only if not, we output
% something.
%    \begin{macrocode}
  \ifthenelse{\equal{#2#3#4#5}{}}{}{%
    \setlength\tabcolsep{\ODw@Card@Skip}%
%JW    \ODw@GameSize% XYX JW 30.04.2018
    \begin{tabular}[#1]{ll}%
  % we can't use \suit here: it would cause double checks!
      \Sp & \ODw@Cards{#2}\\[-0.5ex]
      \He & \ODw@Cards{#3}\\[-0.5ex]
      \Di & \ODw@Cards{#4}\\[-0.5ex]
      \Cl & \ODw@Cards{#5}\\
    \end{tabular}%
  }% ifthenelse
}% ODw@hand
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Suits}
%
% In some cases, we need only a collection of cards, without a suit symbol.
% \begin{macro}{\onesuitAll}\MacroDef{onesuitAll}[\Oarg{*!}\marg{N}\marg{S}\marg{E}\marg{W}]
% Display the cards of one suit in a \North*!{}\South*!--\East*!{}\West*! diagram, with
% the \North*!-, \East*!-, \South*!- and \West*!-hand.
%    \begin{macrocode}
\NewDocumentCommand\onesuitAll{s t! mmmm}{%
%    \end{macrocode}
% |onesuitAll* !{N-hand}{S-hand}{E-hand}{W-hand}|\\
% |          1 2   3       4       5       6|\\
% |Naked version:  Use a |\ODwBox\\
% |* version: Display the diagram centered|\\
% |! version: use the NESW compass|
% \par\noindent
% First we test that we have no multiple cards in the suit. Then we use a
% |tabular| to place the cards around a compass or around a box. 
%    \begin{macrocode}
  \ODw@ChkSameCards{#3#4#5#6}{}%
  \IfBooleanTF#1{\begin{center}}{}%
  \bgroup%
    \ODw@GameSize%
    \setlength\tabcolsep{0em}%
\begin{tabular}{@{}r@{ }c@{ }l@{}}%
%\begin{tabular}{@{}rcl@{}}%
       & \ODw@Cards{#3} \IfBooleanTF#2{\\[-0.2em]}{\\}%
 \ODw@Cards{#6} & \IfBooleanTF#2{\ODw@Compass}{\ODw@Box}%
         & \ODw@Cards{#5} \IfBooleanTF#2{\\[-0.2em]}{\\}%
                & \ODw@Cards{#4}\\
    \end{tabular}%
  \egroup%
  \IfBooleanTF#1{\end{center}}{}%
}% onesuitAll
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\onesuitNS}\MacroDef{onesuitNS}[\Oarg{*!}\marg{N}\marg{S}]
% Display a suit as |NS|-diagram. Similar to |\onesuitAll| but with only
% |N|- and |S|-hand.
%    \begin{macrocode}
\NewDocumentCommand\onesuitNS{s t! mm}{%
%    \end{macrocode}
% |onesuitNS* !{N-hand}{S-hand}|\\
% |         1 2   3       4|\\
% |Naked version:  Use a |\ODwBox\\
% |* version:  Display the diagram centered|\\
% |! version: use the NESW compass|
%
%    \begin{macrocode}
  \ODw@ChkSameCards{#3#4}{}%
  \IfBooleanTF#1{\begin{center}}{}%
  \bgroup%
    \ODw@GameSize%
    \begin{tabular}{@{}c@{}}%
      \ODw@Cards{#3}\IfBooleanTF#2{\\[-0.2em]}{\\}%
        \IfBooleanTF#2{\ODw@Compass\\[-0.2em]}{\ODw@Box\\}%
      \ODw@Cards{#4}%
    \end{tabular}%
  \egroup%
  \IfBooleanTF#1{\end{center}}{}%
}% onesuitNS
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\onesuitEW}\MacroDef{onesuitEW}[\Oarg{*!}\marg{E}\marg{W}]
% Display a suit as |EW| diagram. Similar to |\onesuitAll| but with only
% |E|- and |W|-hand.
%    \begin{macrocode}
\NewDocumentCommand\onesuitEW{s t! mm}{%
%    \end{macrocode}
% |onesuitEW* !{E-hand}{W-hand}|\\
% |         1 2   3       4|\\
% |Naked version:  Use a |\ODwBox\\
% |* version: Display the diagram centered|\\
% |! version: use the NESW compass|
%
%    \begin{macrocode}
  \ODw@ChkSameCards{#3#4}{}%
  \IfBooleanTF#1{\begin{center}}{}%
  \bgroup%
    \ODw@GameSize%
    \begin{tabular}{@{}r@{ }c@{ }l@{}}%
      \ODw@Cards{#4} &%
      \IfBooleanTF#2{\ODw@Compass}{\ODw@Box} &%
         \ODw@Cards{#3} \\%
    \end{tabular}%
  \egroup%
   \IfBooleanTF#1{\end{center}}{}%
}% onesuitEW
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\onesuitNE}\MacroDef{onesuitNE}[\Oarg{*!}\marg{N}\marg{E}]
% Display a suit as |NE| diagram. Similar to |\onesuitAll| but with only
% |N|- and |E|-hand.
%    \begin{macrocode}
\NewDocumentCommand\onesuitNE{s t! mm}{%
%    \end{macrocode}
% |onesuitNE* !{N-hand}{E-hand}|\\
% |         1 2   3       4|\\
% |Naked version:  Use a |\ODwBox\\
% |* version: Display the diagram centered|\\
% |! version: use the NESW compass|
%
%    \begin{macrocode}
  \ODw@ChkSameCards{#3#4}{}%
  \IfBooleanTF#1{\begin{center}}{}%
  \bgroup%
    \ODw@GameSize%
    \begin{tabular}[b]{c@{ }l@{}}%
      \ODw@Cards{#3} \\%
      \IfBooleanTF#2{\ODw@Compass}{\ODw@Box} &%
         \ODw@Cards{#4} \\%
    \end{tabular}%
  \egroup%
   \IfBooleanTF#1{\end{center}}{}%
}% onesuitEW
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\onesuitNW}\MacroDef{onesuitNW}[\Oarg{*!}\marg{N}\marg{W}]
% Display a suit as |NW| diagram. Similar to |\onesuitAll| but with only
% |N|- and |W|-hand.
%    \begin{macrocode}
\NewDocumentCommand\onesuitNW{s t! mm}{%
%    \end{macrocode}
% |onesuitNW* !{N-hand}{W-hand}|\\
% |         1 2   3       4|\\
% |Naked version:  Use a |\ODwBox\\
% |* version: Display the diagram centered|\\
% |! version: use the NESW compass|
%
%    \begin{macrocode}
  \ODw@ChkSameCards{#3#4}{}%
  \IfBooleanTF#1{\begin{center}}{}%
  \bgroup%
    \ODw@GameSize%
    \begin{tabular}[b]{r@{ }c}%
                     & \ODw@Cards{#3} \\%
      \ODw@Cards{#4} & \IfBooleanTF#2{\ODw@Compass}{\ODw@Box} \\%
    \end{tabular}%
  \egroup%
   \IfBooleanTF#1{\end{center}}{}%
}% onesuitEW
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\suit}\MacroDef{suit}[\oarg{suit symbol}\marg{cards}]
% Command for displaying the cards of a suit. With the optional argument
% one can add a suit symbol to the suit.
%
%    \begin{macrocode}
\newcommand\suit[2][]{%
%    \end{macrocode}
% |\suit[suit]{cards}|\\
% |       1      2   |
%    \begin{macrocode}
  \ODw@ChkNrOfCards{#2}{suit}%
  \ODw@ChkSameCards{#2}{#1}%
  \bgroup% keep font change local
%JW
    \ODw@GameSize%
    #1\ODw@Cards{#2}%
  \egroup%
  \xspace%
}% suit
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@Cards}\MacroDef{ODw@Cards}[\marg{cards}]
% This macro gets called by |\suit| and all commands that process hands. It
% processes the ranks of the cards. Between ranks some space is typeset.
% Care is taken that |T| becomes \suit{T} and honor cards are
% translated into the active language.
%    \begin{macrocode}
\newcommand{\ODw@Cards}[1]{%
%    \end{macrocode}
% \par\vspace{0.3\baselineskip}\noindent
% We enable the cardskip and call |\ODw@Xfer| to do the job
%    \begin{macrocode}
  \OdW@CardSkiptrue%
  \ODw@Xfer{#1}%
}% ODw@Cards
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Card Diagrams}
%
% Next we define several diagrams with hands around the compass.
% |\ODw@GameSize| sets the size of the compass, the directions and the
% hands, according to the actual font or font-size.
% |\ODw@LeftUpperText| etc.\ displays extra text, that appear in the left
% upper, etc.\ corner of the diagram. If |\headlinetext| (|\footlinetext|)
% is the empty string, we set boolean |ODw@EmptyHeader| (|ODw@EmptyFooter|)
% to true\footnote{see page \pageref{Empty}, last paragraph why this is
% necessary}. This value is used in
% |\ODw@ProcessHeader| to conditionally span the 3 columns with the
% headline- (footline)text. We first store the diagram in a box, so we can
% calculate its width and use that as a size to limit the header/footer
% texts.
%
% \begin{macro}{\showAll}\MacroDef{showAll}[\Oarg{*+}\oarg{pos}]
% Define the diagram, showing the cards for \textbf{All} hands.
%
%    \begin{macrocode}
\NewDocumentCommand\showAll{s t+ O{c}}{%
%    \end{macrocode}
% |showAll* + [pos]|\\
% |       1 2   3|\\
% |Display the NS--EW diagram, defined by \northhand, etc|\\
% |* Version: Display the diagram centered|\\
% |+ Version: Also display a bidding diagram|\\ 
% |pos: aligning, default= c|
% \par\noindent
% First, for all suits we store all cards of all sides together. Next we
% check the consistency of all complete suits. The individual suits of each
% player have already been checked as we defined the hands. Finally we
% print the hands around the compass using a |tabular|, taking care of the
% additions above, below and in the corners of the diagram. Before we write
% the diagram, we store it in an sbox to calulate its width, so we can use
% that in other places.
% 
%    \begin{macrocode}
  \gdef\ODw@Spades{% store all Spades together
    \ODw@NSpades\ODw@ESpades\ODw@SSpades\ODw@WSpades%
  }%
  \gdef\ODw@Hearts{% store all Hearts together
    \ODw@NHearts\ODw@EHearts\ODw@SHearts\ODw@WHearts%
  }%
  \gdef\ODw@Diamonds{% store all Diamonds together
    \ODw@NDiamonds\ODw@EDiamonds\ODw@SDiamonds\ODw@WDiamonds%
  }%
  \gdef\ODw@Clubs{% store all Clubs together
    \ODw@NClubs\ODw@EClubs\ODw@SClubs\ODw@WClubs%
  }%
  % check for multiple and nr. of cards
  \ODw@ChkNrOfCards{\ODw@Spades}{\Sp}%
  \ODw@ChkSameCards{\ODw@Spades}{\Sp}%
  \ODw@ChkNrOfCards{\ODw@Hearts}{\He}%
  \ODw@ChkSameCards{\ODw@Hearts}{\He}%
  \ODw@ChkNrOfCards{\ODw@Diamonds}{\Di}%
  \ODw@ChkSameCards{\ODw@Diamonds}{\Di}%
  \ODw@ChkNrOfCards{\ODw@Clubs}{\Cl}%
  \ODw@ChkSameCards{\ODw@Clubs}{\Cl}%
  \IfBooleanTF#1{\begin{center}}{}%
  \bgroup%
    \setlength\tabcolsep{0em}%
    \ODw@GameSize%
    \ODw@TestIfEmpty{\ODw@HeaderText}{ODw@EmptyHeader}%
    \ODw@TestIfEmpty{\ODw@FooterText}{ODw@EmptyFooter}%
  % sbox1 necessary to calc. |Compasssize| for |Nhand|
    \sbox1{\ODw@Compass}%
    \sbox0{%
\begin{tabular}[#3]{@{}r@{}c@{}l@{}}%
  \ODw@LeftUpperText & \ODw@Nhand & \ODw@RightUpperText\\
  \ODw@Whand         & \usebox{1} & \ODw@Ehand\\
  \ODw@LeftLowerText & \ODw@Shand & \ODw@RightLowerText\\
\end{tabular}%
    }% sbox
    \ODw@gsetlength{\ODw@Diagram@Width}{\wd0}%
    \begin{tabular}[#3]{@{}r@{}c@{}l@{}}%
      \ODw@ProcessHeader{3}% span 3 columns
      \ODw@LeftUpperText & \ODw@Nhand & \ODw@RightUpperText\\
      \ODw@Whand         & \usebox{1} & \ODw@Ehand\\
      \ODw@LeftLowerText & \ODw@Shand & \ODw@RightLowerText\\
      \ODw@ProcessFooter{3}% span 3 columns
    \end{tabular}%
    \IfBooleanTF#2{%
 %  needed for \ODw@CondNewLine
      \setlength{\ODw@Bid@Width}{\wd\ODw@BidBox}%
      \ODw@CondNewLine%
      \usebox{\ODw@BidBox}%
    }{}%
  \egroup%
  \IfBooleanTF#1{\end{center}}{}%
}% showAll
%    \end{macrocode}
% \end{macro}
%
% \DeleteShortVerb{\|}
% \begin{macro}{\showNS}\MacroDef{showNS}[\Oarg{*+}\oarg{pos}\parg{N|S}]
% \MakeShortVerb{\|}
% Define the diagram, showing the cards for the \NorthSouth*! hands.
%
%    \begin{macrocode}
\NewDocumentCommand\showNS{s t+ O{c} d()}{%
%    \end{macrocode}
% |showNS* +[pos] (N/S)|\\
% |      1 2  3     4|\\
% |Display the NS diagram, defined by \northhand, etc|\\
% |* Version: Display the diagram centered|\\
% |+ Version: Also display a bidding diagram|\\
% |pos: aligning, default c|\\
% |N/S: only N-hand (or S-hand) is to be displayed|\\
% \par\noindent
% Description: similar to |\showAll|
%    \begin{macrocode}
% For all suits store all cards of north and south together
  \gdef\ODw@Spades{\ODw@NSpades\ODw@SSpades}%
  \gdef\ODw@Hearts{\ODw@NHearts\ODw@SHearts}%
  \gdef\ODw@Diamonds{\ODw@NDiamonds\ODw@SDiamonds}%
  \gdef\ODw@Clubs{\ODw@NClubs\ODw@SClubs}%
  \ODw@ChkSameCards{\ODw@Spades}{\Sp}%
  \ODw@ChkSameCards{\ODw@Hearts}{\He}%
  \ODw@ChkSameCards{\ODw@Diamonds}{\Di}%
  \ODw@ChkSameCards{\ODw@Clubs}{\Cl}%
  \IfBooleanTF#1{\begin{center}}{}%
  \bgroup%
    \setlength\tabcolsep{0em}%
    \ODw@GameSize%
    \ODw@TestIfEmpty{\ODw@HeaderText}{ODw@EmptyHeader}%
    \ODw@TestIfEmpty{\ODw@FooterText}{ODw@EmptyFooter}%
%    \end{macrocode}
% Here we store the width of the diagram \textbf{without} the header and
% footer. So we can limit their width to the diagramwidth.
%    \begin{macrocode}
  % sbox1 necessary to calc. |Compasssize| for |Nhand|
    \sbox1{\ODw@Compass}%
    \sbox0{%
  \begin{tabular}[#3]{@{}r@{}c@{}l@{}}%
% Display the N-hand only with token 'N', or no token at all
     & \IfNoValueTF{#4}{\ODw@Nhand}{\ifthenelse{\equal{#4}{N}}{\ODw@Nhand}{}} & \\
     & \usebox{1} & \\
% Display the S-hand only with token 'S', or no token at all
     & \IfNoValueTF{#4}{\ODw@Shand}{\ifthenelse{\equal{#4}{S}}{\ODw@Shand}{}} & \\
  \end{tabular}%
    }% sbox0
  \ODw@gsetlength\ODw@Diagram@Width{\wd0}%
  \begin{tabular}[#3]{@{}r@{}c@{}l@{}}%
    \ODw@ProcessHeader{3}% span 3 columns
% Display the N-hand only with token 'N', or no token at all
     & \IfNoValueTF{#4}{\ODw@Nhand}{\ifthenelse{\equal{#4}{N}}{\ODw@Nhand}{}} & \\
     & \usebox{1} & \\
% Display the S-hand only with token 'S', or no token at all
     & \IfNoValueTF{#4}{\ODw@Shand}{\ifthenelse{\equal{#4}{S}}{\ODw@Shand}{}} & \\
    \ODw@ProcessFooter{3}% span 3 columns
  \end{tabular}%
   \IfBooleanTF#2{%
 % necessary for \ODw@CondNewLine
     \setlength{\ODw@Bid@Width}{\wd\ODw@BidBox}%
     \ODw@CondNewLine%
     \usebox{\ODw@BidBox}%
   }{}%
 \egroup%
 \IfBooleanTF#1{\end{center}}{}%
}% showNS
%    \end{macrocode}
% \end{macro}
%
% \DeleteShortVerb{\|}
% \begin{macro}{\showEW}\MacroDef{showEW}[\Oarg{*+}\oarg{pos}\parg{E|W}]
% \MakeShortVerb{\|}
% Define the diagram, showing the cards for the \EastWest*! hands.
%    \begin{macrocode}
\NewDocumentCommand\showEW{s t+ O{c} d()}{%
%    \end{macrocode}
% |showEW* + [pos] (E/W)|\\
% |      1 2   3     4|\\
% |Display the EW diagram, defined by \easthand, etc|\\
% |* Version: Display the diagram centered|\\
% |+ Version: Also display a bidding diagram|\\
% |pos: aligning, default c|\\
% |E/W: only E-hand (or W-hand) is to be displayed|\\
% \par\noindent
% Description: similar to |\showAll|
%    \begin{macrocode}
% For all suits put all cards of east and west together
  \gdef\ODw@Spades{\ODw@ESpades\ODw@WSpades}%
  \gdef\ODw@Hearts{\ODw@EHearts\ODw@WHearts}%
  \gdef\ODw@Diamonds{\ODw@EDiamonds\ODw@WDiamonds}%
  \gdef\ODw@Clubs{\ODw@EClubs\ODw@WClubs}%
  \ODw@ChkSameCards{\ODw@Spades}{\Sp}%
  \ODw@ChkSameCards{\ODw@Hearts}{\He}%
  \ODw@ChkSameCards{\ODw@Diamonds}{\Di}%
  \ODw@ChkSameCards{\ODw@Clubs}{\Cl}%
  \IfBooleanTF#1{\begin{center}}{}%
  \bgroup%
    \setlength\tabcolsep{0em}%
    \ODw@GameSize%
    \ODw@TestIfEmpty{\ODw@HeaderText}{ODw@EmptyHeader}%
    \ODw@TestIfEmpty{\ODw@FooterText}{ODw@EmptyFooter}%
    \sbox0{%
      \begin{tabular}[#3]{@{}r@{}c@{}l@{}}%
% Display the W-hand only with token 'W', or no token at all
        \IfNoValueTF{#4}{\ODw@Whand}{\ifthenelse{\equal{#4}{W}}{\ODw@Whand}{}} 
               & \ODw@Compass & 
% Display the E-hand only with token 'E', or no token at all
        \IfNoValueTF{#4}{\ODw@Ehand}{\ifthenelse{\equal{#4}{E}}{\ODw@Ehand}{}} \\
      \end{tabular}%
    }% sbox
    \ODw@gsetlength{\ODw@Diagram@Width}{\wd0}%
    \begin{tabular}[#3]{@{}r@{}c@{}l@{}}%
      \ODw@ProcessHeader{3}% span 3 columns
               &              & \\
% Display the W-hand only with token 'W', or no token at all
      \IfNoValueTF{#4}{\ODw@Whand}{\ifthenelse{\equal{#4}{W}}{\ODw@Whand}{}} 
               & \ODw@Compass & 
% Display the E-hand only with token 'E', or no token at all
      \IfNoValueTF{#4}{\ODw@Ehand}{\ifthenelse{\equal{#4}{E}}{\ODw@Ehand}{}} \\
      \ODw@ProcessFooter{3}% span 3 columns
    \end{tabular}%
   \IfBooleanTF#2{%
 % necessary for \ODw@CondNewLine
     \setlength{\ODw@Bid@Width}{\wd\ODw@BidBox}%
     \ODw@CondNewLine%
     \usebox{\ODw@BidBox}%
   }{}%
  \egroup%
  \IfBooleanTF#1{\end{center}}{}%
}% showEW
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\showNE}\MacroDef{showNE}[\Oarg{*+}\oarg{pos}]
% Define the diagram, showing the cards for the
% \North*!{}\textbf{--}\East*! hands.
%    \begin{macrocode}
\NewDocumentCommand\showNE{s t+ O{c}}{%
%    \end{macrocode}
% |showNE* +[pos]|\\
% |      1 2  3|\\
% |Display the NE diagram, defined by \northhand, etc|\\
% |* Version: Display the diagram centered|\\
% |+ Version: Also display a bidding diagram|\\
% |pos: aligning, default c|\\
% Description: similar to |\showAll|
%    \begin{macrocode}
% For all suits put all cards of north and east together
  \gdef\ODw@Spades{\ODw@NSpades\ODw@ESpades}%
  \gdef\ODw@Hearts{\ODw@NHearts\ODw@EHearts}%
  \gdef\ODw@Diamonds{\ODw@NDiamonds\ODw@EDiamonds}%
  \gdef\ODw@Clubs{\ODw@NClubs\ODw@EClubs}%
  \ODw@ChkSameCards{\ODw@Spades}{\Sp}%
  \ODw@ChkSameCards{\ODw@Hearts}{\He}%
  \ODw@ChkSameCards{\ODw@Diamonds}{\Di}%
  \ODw@ChkSameCards{\ODw@Clubs}{\Cl}%
  \IfBooleanTF#1{\begin{center}}{}%
  \bgroup%
    \setlength\tabcolsep{0em}%
    \ODw@GameSize%
    \ODw@TestIfEmpty{\ODw@HeaderText}{ODw@EmptyHeader}%
    \ODw@TestIfEmpty{\ODw@FooterText}{ODw@EmptyFooter}%
  % sbox1 necessary to calc. |Compasssize| for |Nhand|
    \sbox1{\ODw@Compass}%
    \sbox0{%
      \begin{tabular}[#3]{@{}c@{}l@{}}%
        \ODw@Nhand & \ODw@RightUpperText\\
        \usebox{1} & \ODw@Ehand\\
      \end{tabular}%
    }% sbox
    \ODw@gsetlength{\ODw@Diagram@Width}{\wd0}%
    \begin{tabular}[#3]{@{}c@{}l@{}}%
      \ODw@ProcessHeader{2}% span 2 columns
      \ODw@Nhand & \ODw@RightUpperText\\
      \usebox{1} & \ODw@Ehand\\
      \ODw@ProcessFooter{2}% span 2 columns
    \end{tabular}%
   \IfBooleanTF#2{%
 % necessary for \ODw@CondNewLine
     \setlength{\ODw@Bid@Width}{\wd\ODw@BidBox}%
     \ODw@CondNewLine%
     \usebox{\ODw@BidBox}%
   }{}%
  \egroup%
  \IfBooleanTF#1{\end{center}}{}%
}% showNE
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\showNW}\MacroDef{showNW}[\Oarg{*+}\oarg{pos}]
% Define the diagram, showing the cards for the
% \North*!{}\textbf{--}\West*! hands.
%    \begin{macrocode}
\NewDocumentCommand\showNW{s t+ O{c}}{%
%    \end{macrocode}
% |showNW* +[pos]|\\
% |      1 2  3|\\
% |Display the NW diagram, defined by \northhand, etc|\\
% |* Version: Display the diagram centered|\\
% |+ Version: Also display a bidding diagram|\\
% |pos: aligning, default c|\\
% Description: similar to |\showAll|
%    \begin{macrocode}
% For all suits put all cards of north and west together
  \gdef\ODw@Spades{\ODw@NSpades\ODw@WSpades}%
  \gdef\ODw@Hearts{\ODw@NHearts\ODw@WHearts}%
  \gdef\ODw@Diamonds{\ODw@NDiamonds\ODw@WDiamonds}%
  \gdef\ODw@Clubs{\ODw@NClubs\ODw@WClubs}%
  \ODw@ChkSameCards{\ODw@Spades}{\Sp}%
  \ODw@ChkSameCards{\ODw@Hearts}{\He}%
  \ODw@ChkSameCards{\ODw@Diamonds}{\Di}%
  \ODw@ChkSameCards{\ODw@Clubs}{\Cl}%
  \IfBooleanTF#1{\begin{center}}{}%
  \bgroup%
    \setlength\tabcolsep{0em}%
    \ODw@GameSize%
    \ODw@TestIfEmpty{\ODw@HeaderText}{ODw@EmptyHeader}%
    \ODw@TestIfEmpty{\ODw@FooterText}{ODw@EmptyFooter}%
  % sbox1 necessary to calc. |Compasssize| for |Nhand|  
    \sbox1{\ODw@Compass}%
    \sbox0{%
      \begin{tabular}[#3]{@{}c@{}l@{}}%
        \ODw@LeftUpperText & \ODw@Nhand\\
        \ODw@Whand         & \usebox{1}\\
      \end{tabular}%
    }% sbox
    \ODw@gsetlength{\ODw@Diagram@Width}{\wd0}%
    \begin{tabular}[#3]{@{}r@{}c@{}}%
      \ODw@ProcessHeader{2}% span 2 columns
      \ODw@LeftUpperText & \ODw@Nhand\\
      \ODw@Whand         & \usebox{1}\\
      \ODw@ProcessFooter{2}% span 2 columns
    \end{tabular}%
   \IfBooleanTF#2{%
 % necessary for \ODw@CondNewLine
     \setlength{\ODw@Bid@Width}{\wd\ODw@BidBox}%
     \ODw@CondNewLine%
     \usebox{\ODw@BidBox}%
   }{}%
  \egroup%
  \IfBooleanTF#1{\end{center}}{}%
}% showNW
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{The Compass}
%
% When displaying the compass, the square with |N-S| and |E-W| axes, we try
% to achieve several things:
% \begin{enumerate}[itemsep=0em]
% \item Making the size font-size dependent
% \item Put both |N| and |S| horizontally centered
% \item Put both |E| and |W| vertically centered
% \item Print the vulnerable side in red if in colored mode
% \item Underline the dealer (we \emph{over}line |S| for better clarity)
% \end{enumerate}
% We use the mapping as shown in the tables below. The |U| stands for
% undefined. This reflects the situation where neither |\vulner| nor
% |\dealer| have been called, and also there is no board number known.\\
%
% \hfill
% \begin{tabular}{|c|c|}\hline
% \multicolumn{2}{|c|}{Player} \\\hline
% N & 0 \\
% E & 1 \\
% S & 2 \\
% W & 3 \\\hline
% \end{tabular}
% \hfill\hfill
% \begin{tabular}{|c|c|}\hline
% \multicolumn{2}{|c|}{Vulner} \\\hline
% none & 0 \\
% all & 1 \\
% N-S & 2 \\
% E-W & 3 \\\hline
% U & -1 \\\hline
% \end{tabular}
% \hfill\hfill
% \begin{tabular}{|c|c|}\hline
% \multicolumn{2}{|c|}{Dealer} \\\hline
% N & 0 \\
% E & 1 \\
% S & 2 \\
% W & 3 \\\hline
% U & -1 \\\hline
% \end{tabular}
% \hfill\hfill
%
% \begin{macro}{\ODw@Compass}\MacroDef{ODw@Compass}
%    \begin{macrocode}
\newcommand{\ODw@Compass}{%
%    \end{macrocode}
% The codes for dealership (|\ODw@D|) and vulnerability (|\ODw@V|) are used
% in |\ODw@Print|. We initialize them with the value |-1| to denote the
% undefined state. |\@ODw| acts as a local temp variable in oder to make a
% smooth comparison.
%    \begin{macrocode}
 \begingroup
  \def\ODw@V{-1}\def\ODw@D{-1}%
%
% Set the code for vulnerability
%
  \def\@ODw{\none}\ifx\ODw@Vulner\@ODw\def\ODw@V{0}\fi%
  \def\@ODw{\none*}\ifx\ODw@Vulner\@ODw\def\ODw@V{0}\fi%
  \def\@ODw{\none!}\ifx\ODw@Vulner\@ODw\def\ODw@V{0}\fi%
  \def\@ODw{\none*!}\ifx\ODw@Vulner\@ODw\def\ODw@V{0}\fi%
  \def\@ODw{\all}\ifx\ODw@Vulner\@ODw\def\ODw@V{1}\fi%
  \def\@ODw{\all*}\ifx\ODw@Vulner\@ODw\def\ODw@V{1}\fi%
  \def\@ODw{\all!}\ifx\ODw@Vulner\@ODw\def\ODw@V{1}\fi%
  \def\@ODw{\all*!}\ifx\ODw@Vulner\@ODw\def\ODw@V{1}\fi%
  \def\@ODw{\NorthSouth}\ifx\ODw@Vulner\@ODw\def\ODw@V{2}\fi%
  \def\@ODw{\NorthSouth*}\ifx\ODw@Vulner\@ODw\def\ODw@V{2}\fi%
  \def\@ODw{\NorthSouth!}\ifx\ODw@Vulner\@ODw\def\ODw@V{2}\fi%
  \def\@ODw{\NorthSouth*!}\ifx\ODw@Vulner\@ODw\def\ODw@V{2}\fi%
  \def\@ODw{\EastWest}\ifx\ODw@Vulner\@ODw\def\ODw@V{3}\fi%
  \def\@ODw{\EastWest*}\ifx\ODw@Vulner\@ODw\def\ODw@V{3}\fi%
  \def\@ODw{\EastWest!}\ifx\ODw@Vulner\@ODw\def\ODw@V{3}\fi%
  \def\@ODw{\EastWest*!}\ifx\ODw@Vulner\@ODw\def\ODw@V{3}\fi%
%
% Set the code for dealership
%
  \def\@ODw{\North}\ifx\ODw@Dealer\@ODw\def\ODw@D{0}\fi%
  \def\@ODw{\North*}\ifx\ODw@Dealer\@ODw\def\ODw@D{0}\fi%
  \def\@ODw{\North!}\ifx\ODw@Dealer\@ODw\def\ODw@D{0}\fi%
  \def\@ODw{\North*!}\ifx\ODw@Dealer\@ODw\def\ODw@D{0}\fi%
  \def\@ODw{\East}\ifx\ODw@Dealer\@ODw\def\ODw@D{1}\fi%
  \def\@ODw{\East*}\ifx\ODw@Dealer\@ODw\def\ODw@D{1}\fi%
  \def\@ODw{\East!}\ifx\ODw@Dealer\@ODw\def\ODw@D{1}\fi%
  \def\@ODw{\East*!}\ifx\ODw@Dealer\@ODw\def\ODw@D{1}\fi%
  \def\@ODw{\South}\ifx\ODw@Dealer\@ODw\def\ODw@D{2}\fi%
  \def\@ODw{\South*}\ifx\ODw@Dealer\@ODw\def\ODw@D{2}\fi%
  \def\@ODw{\South!}\ifx\ODw@Dealer\@ODw\def\ODw@D{2}\fi%
  \def\@ODw{\South*!}\ifx\ODw@Dealer\@ODw\def\ODw@D{2}\fi%
  \def\@ODw{\West}\ifx\ODw@Dealer\@ODw\def\ODw@D{3}\fi%
  \def\@ODw{\West*}\ifx\ODw@Dealer\@ODw\def\ODw@D{3}\fi%
  \def\@ODw{\West!}\ifx\ODw@Dealer\@ODw\def\ODw@D{3}\fi%
  \def\@ODw{\West*!}\ifx\ODw@Dealer\@ODw\def\ODw@D{3}\fi%
%
%    \end{macrocode}
% We use a |picture| environment and set its size to 
% $\mbox{|2.5em|} \times \mbox{|2.5em|}$
% by setting the |\PicSize| to 500 and the unitlength to |0.005em|. Doing this
% enables us the avoid floating point arithmetic in the calculations of
% positions. Both |\PicSize| and |\MidSize| are local to |\ODw@Compass| and
% skipped from indexing. The same goes for |\Hoffset| and |\Voffset|.
%    \begin{macrocode}
  \ODw@CompassDefault% use the compass font
  \def\PicSize{500}%
  \def\MidSize{250}%
  % Multiply unitlength=0.005em with CompSize (default= 1)
  \setlength\unitlength{0.005em * \real{\ODw@CompSize}}%
  \ODw@gsetlength\ODw@Compasssize{\unitlength * \PicSize + 2ex}%
  \def\Hoffset{30}% distance between W (E) and frame
  \def\Voffset{30}% distance between N (S) and frame
  \setlength\ODw@Tmp@Width{0.1em * \real{\ODw@CompLine}}%
  \linethickness{\ODw@Tmp@Width}%
  % leave 1ex space on all sides
  \parbox[c][\ODw@Compasssize]{\ODw@Compasssize}{%
    \centering%
    \begin{picture}(\PicSize,\PicSize)%
      \ifODw@CompShow%
        % the frame
        \moveto(0,0)
       \if\ODw@CompLine0% must do it this way, because
       \else% linethickness zero does not suppress the line
         \lineto(0,\PicSize)\lineto(\PicSize,\PicSize)
         \lineto(\PicSize,0)\closepath\strokepath
       \fi%
        % the cardinal points
       \put(\MidSize,\the\numexpr \PicSize - \Voffset)%
         {\makebox[0pt]{\raisebox{-\height}{\ODw@Print{0}}}}% N
       \put(\MidSize,\Voffset){\makebox[0pt]{\ODw@Print{2}}}% S
       \put(\Hoffset,\MidSize){%
         \makebox[0pt][l]{%
          \ifODw@CompTurn%
            \raisebox{-0.5\height}{%
              \rotatebox[origin=t]{90}{\ODw@Print{3}}%
            }%
          \else%
             \raisebox{-0.5\height}{\ODw@Print{3}}%
          \fi%
         }% makebox
        }% W
        \put(\the\numexpr \PicSize - \Hoffset,\MidSize)%
         {\makebox[0pt][r]{%
            \raisebox{-0.5\height}{%
            \ifODw@CompTurn%
                \rotatebox[origin=c]{90}{\ODw@Print{1}}%
              \else%
                \ODw@Print{1}%
              \fi%
            }%
           }% makebox
         }% E
        % the center
          \put(\MidSize,\MidSize){\makebox(0,0){\ODw@mid}}
      \fi%
    \end{picture}%
   }% parbox
 \endgroup
}% ODw@Compass 
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@Print}\MacroDef{ODw@Print}[\marg{player-code}]
% |\ODw@Print| prints |N|, |E|, |S| and |W| in the compass. The side that
% is vulnerable is printed in red (or italics if we are monochrome),
% otherwise in black. The dealer is under- or overlined.
% \par\noindent
% The |\ifcase| distinguishes between the players. Then dealership and
% vulnerability are tested. |\ODw@PrintColor| is called to actually print
% the player.
%    \begin{macrocode}
\newcommand\ODw@Print[1]{%
%    \end{macrocode}
% |\ODw@Print{player-code}|\\
% |            1 (player-code=0-3)|
%    \begin{macrocode}
\bgroup
  \smaller\smaller%
  \ifcase#1% #1=0: print N
    \ifboolexpr{ test {\ifnumcomp{\ODw@D}{=}{0}}}%
    {% dealer = N
      \ifboolexpr{ test {\ifnumcomp{\ODw@V}{=}{1}} or%
                   test {\ifnumcomp{\ODw@V}{=}{2}} }%
        {\ODw@PrintColor{\underline{\ODw@N*}}}% Vul
        {\underline{\ODw@N*}}% not Vul
    }{% dealer <> N
      \ifboolexpr{ test {\ifnumcomp{\ODw@V}{=}{1}} or%
                   test {\ifnumcomp{\ODw@V}{=}{2}} }%
        {\ODw@PrintColor{\ODw@N*}}% Vul
        {\ODw@N*}% not Vul
    }% 
  \or% #1=1: print E
    \ifboolexpr{ test {\ifnumcomp{\ODw@D}{=}{1}}}%
    {% dealer E
      \ifboolexpr{ test {\ifnumcomp{\ODw@V}{=}{1}} or%
                   test {\ifnumcomp{\ODw@V}{=}{3}} }%
        {\ODw@PrintColor{\underline{\ODw@E*}}}% Vul
        {\underline{\ODw@E*}}% not Vul
    }{% dealer <> E
      \ifboolexpr{ test {\ifnumcomp{\ODw@V}{=}{1}} or%
                   test {\ifnumcomp{\ODw@V}{=}{3}} }%
        {\ODw@PrintColor{\ODw@E*}}% Vul
        {\ODw@E*}% not Vul
    }% 
  \or% #1=2: print S
    \ifboolexpr{ test {\ifnumcomp{\ODw@D}{=}{2}}}%
    {% dealer S
      \ifboolexpr{ test {\ifnumcomp{\ODw@V}{=}{1}} or%
                   test {\ifnumcomp{\ODw@V}{=}{2}} }%
        {\ODw@PrintColor{%
           \ensuremath{\overline{\mbox{\ODw@S*}}}}%
        }% Vul
        {\ensuremath{\overline{\mbox{\ODw@S*}}}}% not Vul
    }{% dealer <> S
      \ifboolexpr{ test {\ifnumcomp{\ODw@V}{=}{1}} or%
                   test {\ifnumcomp{\ODw@V}{=}{2}} }%
        {\ODw@PrintColor{\ODw@S*}}% Vul
        {\ODw@S*}% not Vul
    }% 
  \or% #1=3: print W
    \ifboolexpr{ test {\ifnumcomp{\ODw@D}{=}{3}}}%
    {% dealer W
      \ifboolexpr{ test {\ifnumcomp{\ODw@V}{=}{1}} or%
                   test {\ifnumcomp{\ODw@V}{=}{3}} }%
        {\ODw@PrintColor{\underline{\ODw@W*}}}% Vul
        {\underline{\ODw@W*}}% not Vul
    }{% dealer <> W
      \ifboolexpr{ test {\ifnumcomp{\ODw@V}{=}{1}} or%
                   test {\ifnumcomp{\ODw@V}{=}{3}} }%
        {\ODw@PrintColor{\ODw@W*}}% Vul
        {\ODw@W*}% not Vul
    }% 
  \fi% (ifcase#1)
\egroup%
}% ODw@Print
%    \end{macrocode}
% \end{macro}
%
% \DeleteShortVerb{\|}
% \begin{macro}{\ODw@PrintColor}\MacroDef{ODw@PrintColor}[\{|N|E|S|W\}]
% \MakeShortVerb{\|}
% |\ODw@PrintColor| checks if we are in monochrome mode. If that is the
% case we print |N|, |E|, |S| or |W| in italics, otherwise in color.
% 
%    \begin{macrocode}
\newcommand\ODw@PrintColor[1]{%
  \ifODw@monochrome\textit{#1}\else\textcolor{red}{#1}\fi%
}% ODw@PrintColor
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@mid}
% Hook to write something in the middle of the compass. We write what is
% stored in |\ODw@CompMid| a bit smaller than the |N-S| and |E-W| letters.
% |\ODw@mid| writes the contents of |\ODw@CompMid| in the middle of the
% compass. As there is only very limited room, this text should be very
% short. It is primarily meant to write just a board number in the
% compass.
% \begin{macro}{\ODw@CompMid}
%    \begin{macrocode}
\def\ODw@CompMid{}
\def\ODw@mid{{\smaller\smaller\smaller\ODw@CompMid}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ODw@Box}
% Displays a \ODwBox 
%    \begin{macrocode}
\newcommand{\ODw@Box}{%
  \bgroup
    \setlength{\fboxsep}{0pt}%
    \setlength{\fboxrule}{0.1em}%
    \fbox{\rule{0mm}{0.7em}\rule{0.7em}{0mm}}%
  \egroup
}% ODw@Box
%    \end{macrocode}
% \end{macro}
%
%
% \subsubsection{Diagram Conditions}
%
% Here we implement several macros that add some board information to the
% card diagram. |\ODw@BoardText| serves as a variable to store the
% user-defined or (by means of the board number) auto-generated text,
% concerning the board. The macro |\boardnr| has 1 mandatory argument. If
% it is a number, it is considered to be the board number.
% The dealer and which side is vulnerable is then
% calculated from it and stored by calling |\dealer| resp. |\vulner|.  If
% it is not a positive integer, it is considered user-defined text which is
% stored 'as is' in |\ODw@BoardText|. The contents can be retrieved by the
% user by calling |\boardtext| to actually print the board information.
% \begin{macro}{\ODw@BoardText}
%    \begin{macrocode}
\def\ODw@BoardText{}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\boardtext}\MacroDef{boardtext}[\Oarg{*}]
% \noindent
% |\boardtext| has only 1 token and no arguments. The unstarred form
% outputs only the text stored in |\ODw@BoardText|, this is normally a
% board number. |\boardtext*| outputs something like 'Board:~23'.
%    \begin{macrocode}
\NewDocumentCommand\boardtext{s}{%
  \IfBooleanTF#1{\GetTranslation{Board-(ODw)}:\,\ODw@BoardText}%
                {\ODw@BoardText}%
}% boardtext
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\boardnr}\MacroDef{boardnr}[\marg{Nr}]
% |\boardnr{Nr}| sets the dealership and vulnerability according to |Nr|.
% As the system repeats itself after the 16th board, we canonize |Nr| to
% the range of 1--16. We also set |\ODw@BoardText| accordingly. For the
% association between boardnumber and dealer/vulner, see file
% \emph{Compass} of the |onedown-example| collection.
%    \begin{macrocode}
\newcommand{\boardnr}[1]{%
  \IfInteger{#1}{%
    \gdef\ODw@BoardText{%
      \bgroup%
        \ODw@OtherFont%
%        \GetTranslation{Board-(ODw)} #1%
      #1%
      \egroup%
    }%
    \setcounter{ODw@Cnt}{#1}%
    \whiledo{\theODw@Cnt > 16}{%
      \addtocounter{ODw@Cnt}{-16}%
    }% whiledo, now 1 <= Cnt <= 16
    \IfEqCase{\theODw@Cnt}{% set dealer/vulner
% Board 0 = no board: mark dealer and vulner undefined
      {0}{\gdef\ODw@BoardText{}\vulner[-1]\dealer[-1]}
      {1}{\vulner[\none]\dealer[\North*!]}
      {2}{\vulner[\NorthSouth*!]\dealer[\East*!]}
      {3}{\vulner[\EastWest*!]\dealer[\South*!]}
      {4}{\vulner[\all]\dealer[\West*!]}
      {5}{\vulner[\NorthSouth*!]\dealer[\North*!]}
      {6}{\vulner[\EastWest*!]\dealer[\East*!]}
      {7}{\vulner[\all]\dealer[\South*!]}
      {8}{\vulner[\none]\dealer[\West*!]}
      {9}{\vulner[\EastWest*!]\dealer[\North*!]}
      {10}{\vulner[\all]\dealer[\East*!]}
      {11}{\vulner[\none]\dealer[\South*!]}
      {12}{\vulner[\NorthSouth*!]\dealer[\West*!]}
      {13}{\vulner[\all]\dealer[\North*!]}
      {14}{\vulner[\none]\dealer[\East*!]}
      {15}{\vulner[\NorthSouth*!]\dealer[\South*!]}
      {16}{\vulner[\EastWest*!]\dealer[\West*!]}
    }% IfEqCase
  }{\gdef\ODw@BoardText{#1}}% otherwise take #1
}% boardnr
%    \end{macrocode}
% \end{macro}
%
% The next macros are used to add some game information above resp. below
% the card diagram. |\ODw@HeaderText| and |\ODw@FooterText| are used as
% variables to store the user-defined text.
% \begin{macro}{\headlinetext}\MacroDef{headlinetext}[\marg{text}]
% \begin{macro}{\ODw@HeaderText}
%    \begin{macrocode}
\newcommand\headlinetext[1]{\gdef\ODw@HeaderText{#1}}
\headlinetext{}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\footlinetext}\MacroDef{footlinetext}[\marg{text}]
% \begin{macro}{\ODw@FooterText}
%    \begin{macrocode}
\newcommand\footlinetext[1]{\gdef\ODw@FooterText{#1}}
\footlinetext{}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% The next macros are used to add some game information in the corners of
% the card diagram. We use a |tabular| with 1 column and 3 lines to do so.
%
% We redefine the (originally empty) |Left[Upper/Lower]|- and\\
% |Right[Upper/Lower]Text|, and set it to the wanted value. The
% first (optional) parameter defines some horizontal extra space if the
% hand and a condition text collide. The commands have 3 mandatory
% arguments, each for 1 of the 3 condition lines, which may be empty.
% \begin{macro}{\leftupper}\MacroDef{leftupper}[\oarg{h-offset}\marg{line1}\marg{line2}\marg{line3}]
% \begin{macro}{\ODw@LeftUpperText}
%    \begin{macrocode}
\def\ODw@LeftUpperText{}
\newcommand\leftupper[4][0pt]{%
  \gdef\ODw@LeftUpperText{%
    \hspace{-#1}%
     \begin{tabular}[t]{l}#2\\#3\\#4\\\end{tabular}
  }%
}% leftupper
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\leftlower}\MacroDef{leftlower}[\oarg{h-offset}\marg{line1}\marg{line2}\marg{line3}]
% \begin{macro}{\ODw@LeftLowerText}
%    \begin{macrocode}
\def\ODw@LeftLowerText{}
\newcommand\leftlower[4][0pt]{%
  \gdef\ODw@LeftLowerText{%
    \hspace{-#1}%
     \begin{tabular}[b]{l}#2\\#3\\#4\\\end{tabular}
  }%
}% leftlower
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\rightupper}\MacroDef{rightupper}[\oarg{h-offset}\marg{line1}\marg{line2}\marg{line3}]
% \begin{macro}{\ODw@RightUpperText}
%    \begin{macrocode}
\def\ODw@RightUpperText{}
\newcommand\rightupper[4][0pt]{%
  \gdef\ODw@RightUpperText{%
    \hspace{#1}%
     \begin{tabular}[t]{l}#2\\#3\\#4\\\end{tabular}
  }%
}% rightupper
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\rightlower}\MacroDef{rightlower}[\oarg{h-offset}\marg{line1}\marg{line2}\marg{line3}]
% \begin{macro}{\ODw@RightLowerText}
%    \begin{macrocode}
\def\ODw@RightLowerText{}
\newcommand\rightlower[4][0pt]{%
  \gdef\ODw@RightLowerText{%
    \hspace{#1}%
     \begin{tabular}[b]{l}#2\\#3\\#4\\\end{tabular}
  }%
}% rightlower
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
% \begin{macro}{\ODw@ProcessHeader}\MacroDef{ODw@ProcessHeader}[\marg{N}]
% |\ODw@ProcessHeader[N]| puts |HeaderText| in a multicolumn which spans N
% columns.
%    \begin{macrocode}
\newcommand{\ODw@ProcessHeader}[1]{%
%    \end{macrocode}
% Programmers note:\\
% |\ODw@TestIfEmpty| cannot be called in here. The |\ifthenelse| called within
% the tabular environment leads to the error:\\
%   \example{|! Misplaced |\bs|omit. |\bs|multispan ->|\bs|omit |\bs|@multispan|}
% \par\vspace{0.5\baselineskip}\noindent
% So the test of the emptiness of |Header-| and |FooterText| is done out of
% the tabular. Why is (La)TeX always causing unexpected problems?:-(
% \par\noindent
% We set the headline/footline text to the width of the diagram with a
% solution found at:\\
% \url{https://tex.stackexchange.com/questions/125005/how-to-create-a-table-where-one-cell-spans-all-the-columns-and-the-text-wraps-pr}
%
%    \begin{macrocode}
  \ifODw@EmptyHeader% Must be this way (StackExchange)
   \else%             |\ifthenelse| bites |\multicolumn|!
    \multicolumn{#1}{%
      p{\dimexpr\ODw@Diagram@Width-%
          2\tabcolsep-2\arrayrulewidth}%
    }{{\ODw@LegendFont\ODw@HeaderText}}\\
  \fi%
}% ODw@ProcessHeader
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@TestIfEmpty}\MacroDef{ODw@TestIfEmpty}[\marg{Str}\marg{Bool}]
% Tests the emptiness of a string.
%    \begin{macrocode}
\newcommand{\ODw@TestIfEmpty}[2]{%
%    \end{macrocode}
% |\ODw@TestIfEmpty{Str}{Bool}|\\
% | sets boolean Bool to true if string Str is empty|
%    \begin{macrocode}
  \ifthenelse{\equal{#1}{}}{%
    \setboolean{#2}{true}}{%
    \setboolean{#2}{false}%
  }%
}% ODw@TestIfEmpty
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\ODw@ProcessFooter}\MacroDef{ODw@ProcessFooter}[\marg{N}]
% |\ODw@ProcessFooter[N]| puts |FooterText| in a multicolumn which spans
% |N| columns.
%    \begin{macrocode}
\newcommand{\ODw@ProcessFooter}[1]{%
  \ifODw@EmptyFooter% Must be this way (StackExchange)
   \else%             |\ifthenelse| bites |\multicolumn|!
    \multicolumn{#1}{% 
      p{\dimexpr\ODw@Diagram@Width%
        -2\tabcolsep-2\arrayrulewidth}%
    }{{\ODw@LegendFont\ODw@FooterText}}\\
  \fi%
}% ODw@ProcessFooter
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\handskip}\MacroDef{handskip}[\marg{length}]
% |\handskip| adds \meta{length} to |SkipWidth|, i.e.\ the distance between
% the card diagram (with or without the east hand) and the |bidding|
% diagram.
%    \begin{macrocode}
\newcommand\handskip[1]{%
  \def\ODw@Skipwidth{1em + #1}% recalculate the new Skipwidth
  \setlength\ODw@Skip@Width{\ODw@Skipwidth}%
}% handskip
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@DealerText}
% Typesets the string \emph{Dealer}.
%    \begin{macrocode}
\def\ODw@DealerText{%
  \bgroup%
     \ODw@OtherFont\GetTranslation{Dealer-(ODw)}%
  \egroup%
}% ODw@DealerText
%    \end{macrocode}
% \end{macro}
% \par\noindent\needspace{2\baselineskip}
% \begin{macro}{\ODw@VulnerText}
% \makeatletter
% \MacroDef{ODw@VulnerText}[\Oarg{*!}\hfill \ODw@VulnerText (\ODw@VulnerText*,
%                   \ODw@VulnerText!, \ODw@VulnerText*!)]
% \makeatother
% Typesets the string \emph{vulnerable} or \emph{Vul}.
%    \begin{macrocode}
\NewDocumentCommand\ODw@VulnerText{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF#1{%
      \IfBooleanTF#2{\GetTranslation{Vul-(ODw)}}%
        {\GetTranslation{Vulnerable-(ODw)}}%
    }{%
      \IfBooleanTF#2{\GetTranslation{vul-(ODw)}}%
        {\GetTranslation{vulnerable-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% ODw@VulnerText
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@AwardText} Typesets the text to be put as 'title' in
% the \emph{award} part of a expert quiz.
%    \begin{macrocode}
\def\ODw@AwardText{\textsf{\GetTranslation{Award-(ODw)}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dealer}\MacroDef{dealer}[\oarg{dealer}]
% If |#1 = empty| then set |\ODw@Dealer| to |#1| else output |\ODw@Dealer|
%    \begin{macrocode}
\newcommand\dealer[1][]{%
  \ifthenelse{\equal{#1}{}}%
    {\ODw@Dealer}%
    {\gdef\ODw@Dealer{#1}}%
}% dealer
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ODw@Dealer}
% set \north as default
%    \begin{macrocode}
\def\ODw@Dealer{\North*}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\vulner}\MacroDef{vulner}[\oarg{vulner}]
% If |#1 = empty| then set |\ODw@Vulner| to |#1| else output |\ODw@Vulner|
%    \begin{macrocode}
\newcommand\vulner[1][]{%
  \ifthenelse{\equal{#1}{}}%
    {\ODw@Vulner}%
    {\gdef\ODw@Vulner{#1}}%
}% vulner
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ODw@Vulner}
% set \NorthSouth as default
%    \begin{macrocode}
\def\ODw@Vulner{\NorthSouth}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\dealertext}
%    \begin{macrocode}
\newcommand\dealertext[1][\ODw@Dealer]{\ODw@DealerText:\,#1}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\vulnertext}
%    \begin{macrocode}
\newcommand\vulnertext[1][\ODw@Vulner]{%
  \ifODw@LongCalls%
    \ODw@VulnerText*%
  \else%
    \ODw@VulnerText*!%
  \fi%
  :\,#1%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\alert}
%    \begin{macrocode}
\newcommand{\alert}{{}\ensuremath{^\textbf{\textasteriskcentered}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\announce}
%    \begin{macrocode}
\newcommand{\announce}{{}\ensuremath{^\textbf{\smaller A}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\markit}\MacroDef{markit}
%    \begin{macrocode}
\newcommand\markit{%
%    \end{macrocode}
% Sets markers \emph{a, b} etc. To be used only in |bidding| diagrams.
%    \begin{macrocode}
  \stepcounter{ODw@Nr}%
  \footnotemark[\theODw@Nr]%
}% markit
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\explainit}\MacroDef{explainit}[\marg{text}]
%    \begin{macrocode}
\newcommand\explainit[1]{%
%    \end{macrocode}
% Explains the marked items.  To be used only in |bidding| diagrams. The
% counter |ODw@Nr| associates the marker with the explanation.
%    \begin{macrocode}
  \stepcounter{ODw@Nr}%
  \ensuremath{{}^\textrm{\smaller\alph{ODw@Nr}}}\,#1%
}% explainit
%    \end{macrocode}
% \end{macro}
%
% \subsection{The Bidding Environments}
%
% \subsubsection{Special Columntypes}
%
% \begin{macro}{\newcolumntype}
% In order to automatically apply a macro call on all cell contents of a
% column (translate/convert; step a counter) in |bidding| and |play| diagrams,
% we define newcolumntypes, made possible by loading package
% \packname{collectcell}. We define next columntypes:
% \begin{description}[topsep=2mm,itemsep=-2mm]
% \item{B:} Transfers suits and cards (|bidding| and |play|)
% \item{F:} sets First column in |play| diagrams
% \item{P:} Transfers suits and cards, accumulates won tricks (|play|)
% \end{description}
%
%    \begin{macrocode}
\newcolumntype{B}{% for Biddings
  >{\collectcell\ODw@BTfer}c<{\endcollectcell}}
\newcolumntype{F}{% for First column in |play| diagrams
  >{\collectcell\ODw@FTfer}c<{\endcollectcell}}
\newcolumntype{P}{% for |Play| diagrams (2nd--4th column)
  >{\collectcell\ODw@PTfer}c<{\endcollectcell}}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{The Hidden Implementation}
%
% As explained before, in the |bidding| diagrams we convert |S| to the spade
% symbol \Sp, etc. We do need packages \packname{array} and
% \packname{collectcell} for this and define the columntype |B|. In order
% to avoid these convertions in the top row, where names are displayed, we
% use the |\cci|-trick to suppress expansion of the cell macro. Curiously
% the command |\cci| (from \packname{collcell}, v0.5, 2011/02/27) sometimes
% produces unwanted characters. The reason is unknown to me.
% We use a space ("| |") as first character in |\cci| to avoid this.
% \par\noindent
% We store the |bidding| diagram without the explanations in a box, so we can
% calculate the width of the |bidding| diagram and make our explanation part
% exactly as wide. In the first row we write the bidders: |North| etc.\ (or
% |N|, if it has to be short). In the second row we write the real world
% names of the bidders, if given. If any description is given, we make a
% multicolumn over the 4 rows with the previously stored width to write the
% explanations. We also use this width to calculate whether the bidding
% diagram will fit on the actual line. If not, we put it on a new line.
% \begin{environment}{ODw@Bidding}\MacroDef{ODw@Bidding}[\oarg{pos}\parg{description}\ldots\bs endODw@Bidding]
%    \begin{macrocode}
\NewEnviron{ODw@Bidding}[2][t]{%
  \def\xspace{}%
  \setlength\tabcolsep{0.2em}%
  \sbox{0}{%
    \begin{tabular}[#1]{BBBB}% 1st column
     \ifODw@Bidders%
      \cci{ % there MUST be a ' ' (space)
        \ODw@BidderFont%
          \ifODw@short\ODw@BidderI%
            \else\ODw@BidderI*%
          \fi%
      } &%                     2nd column
      \cci{ % there MUST be a ' ' (space)
        \ODw@BidderFont%
          \ifODw@short\ODw@BidderII%
            \else\ODw@BidderII*%
          \fi%
      } &%                     3rd column
      \cci{ % there MUST be a ' ' (space)
        \ODw@BidderFont%
          \ifODw@short\ODw@BidderIII%
            \else\ODw@BidderIII*%
          \fi%
      } &%                     4th column
      \cci{ % there MUST be a ' ' (space)
        \ODw@BidderFont%
          \ifODw@short\ODw@BidderIV%
            \else\ODw@BidderIV*%
          \fi%
      } \\% end of 1st row
      \if\ODw@All@Names\empty%
      \else% 2nd row
        \cci{ \ODw@NameFont\ODw@NameI}   &%  please
        \cci{ \ODw@NameFont\ODw@NameII}  &%  mind
        \cci{ \ODw@NameFont\ODw@NameIII} &%  the
        \cci{ \ODw@NameFont\ODw@NameIV}  \\% spaces!
      \fi%
      \ifODw@BidLine\hline\fi%
     \fi%
     \BODY%
%%%%%%
    \end{tabular}%
  }% sbox0
  \setcounter{ODw@Nr}{0}%
  \setlength{\ODw@Bid@Width}{\wd0}%
  \global\sbox\ODw@BidBox{%
    \begin{tabular}[#1]{BBBB}%   1st column
     \ifODw@Bidders%
      \cci{ % there MUST be a ' ' (space)
        \ODw@BidderFont%
          \ifODw@short\ODw@BidderI%
            \else\ODw@BidderI*%
          \fi%
      } &%                       2nd column
      \cci{ % there MUST be a ' ' (space)
        \ODw@BidderFont%
          \ifODw@short\ODw@BidderII%
            \else\ODw@BidderII*%
          \fi%
      } &%                       3rd column
      \cci{ % there MUST be a ' ' (space)
        \ODw@BidderFont%
          \ifODw@short\ODw@BidderIII%
            \else\ODw@BidderIII*%
          \fi%
      } &%                       4th column
      \cci{ % there MUST be a ' ' (space)
        \ODw@BidderFont%
          \ifODw@short\ODw@BidderIV%
            \else\ODw@BidderIV*%
          \fi%
      } \\% end of 1st row
      \if\ODw@All@Names\empty%
      \else% 2nd row
        \cci{ \ODw@NameFont\ODw@NameI}   &%  please
        \cci{ \ODw@NameFont\ODw@NameII}  &%  mind
        \cci{ \ODw@NameFont\ODw@NameIII} &%  the
        \cci{ \ODw@NameFont\ODw@NameIV}  \\% spaces!
      \fi%
      \ifODw@BidLine\hline\fi%
     \fi
     \BODY%
%%%%%  Until here the same code as in the sbox!
      \ifODw@description%
      % Add the description, if not empty
        \hline%
        \multicolumn{4}{% span explanations over 4 cols...
          p{\dimexpr\ODw@Bid@Width-2\tabcolsep}%
        }{% ...with the right width
          \setcounter{ODw@Nr}{0}%
          \raggedright%
          \smaller\smaller#2%
        }\\%
      \fi%
    \end{tabular}%
  }% sbox ODw@BidBox
}% ODw@Bidding
%    \end{macrocode}
% \end{environment}
%
% \begin{environment}{ODw@Biddingpair}\MacroDef{ODw@Biddingpair}[\oarg{pos}\parg{description}\ldots\bs endODw@Biddingpair]
% Decription: Similar to |ODw@Bidding|
%    \begin{macrocode}
\NewEnviron{ODw@Biddingpair}[2][t]{%
  \def\xspace{}%
  \setlength\tabcolsep{0.2em}%
  \sbox{0}{%
   \begin{tabular}[#1]{BB}% 1st column
    \ifODw@Bidders%
     \cci{ % there MUST be a ' ' (space)
      \ODw@BidderFont%
       \ifODw@short\ODw@BidderI%
         \else\ODw@BidderI*%
       \fi%
     } &% 2nd column
     \cci{ % there MUST be a ' ' (space)
      \ODw@BidderFont%
       \ifODw@short\ODw@BidderIII%
        \else\ODw@BidderIII*%
       \fi%
      } \\% end of 1st row
      \if\ODw@All@Names\empty%
       \else% 2nd row
        \cci{ \ODw@NameFont\ODw@NameI} &%  please mind
        \cci{ \ODw@NameFont\ODw@NameIII} \\% the spaces!
      \fi%
      \ifODw@BidLine\hline\fi%
     \fi%
     \BODY%
%%%%%%%
    \end{tabular}%
  }% sbox0
  \setcounter{ODw@Nr}{0}%
  \setlength{\ODw@Bid@Width}{\wd0}%
  \global\sbox\ODw@BidBox{%
    \begin{tabular}[#1]{BB}% 1st column
     \ifODw@Bidders%
      \cci{ % there MUST be a ' ' (space)
       \ODw@BidderFont%
        \ifODw@short\ODw@BidderI%
         \else\ODw@BidderI*%
        \fi%
      } &% 2nd column
      \cci{ % there MUST be a ' ' (space)
        \ODw@BidderFont%
          \ifODw@short\ODw@BidderIII%
            \else\ODw@BidderIII*%
          \fi%
      } \\% end of 1st row
      \if\ODw@All@Names\empty%
      \else% 2nd row
       \cci{ \ODw@NameFont\ODw@NameI}   &%  please mind
       \cci{ \ODw@NameFont\ODw@NameIII} \\% the spaces!
      \fi%
      \ifODw@BidLine\hline\fi%
     \fi%
     \BODY%
  %%%%%% Until here the same code as in the sbox!
      \ifODw@description%
      % Add the description, if not empty
        \hline%
        \multicolumn{2}{%
          p{\dimexpr\ODw@Bid@Width-2\tabcolsep}%
        }{%
          \setcounter{ODw@Nr}{0}%
          \raggedright%
          \smaller\smaller#2%
        }\\%
      \fi%
    \end{tabular}%
  }% sbox ODw@BidBox
}% ODw@Biddingpair
%    \end{macrocode}
% \end{environment}
%
% \subsection{The User Environments}
%
% \subsubsection{Bidding}
%
% The |bidding| environments have 2 optional arguments: an alignment
% \oarg{pos} and an annotation \parg{description}. There are also 3 tokens:
% the |*| centers the |bidding| diagram, the |+| forces the short notation,
% i.e. \North*! rather than \North* and the |-| suppresses all output.
% \par\noindent
% |\ODw@GameSize| takes care of the font dependent sizing of the diagram.
% We locally redefine |\thefootnote| and reset the (general) counter
% |ODw@Nr|, which is stepped in |\markit| and |\explainit| to make the
% annotations correspond. In the end code we define a multicolumn over all
% 4 (2) columns and write the annotation given in argument |#2|. With
% |p{...\ODw@Bid@Width...}| care is taken to limit this text to the width
% of the diagram.
%
% \begin{environment}{bidding}\EnvDef{bidding}[\Oarg{*!-}\oarg{pos}\parg{description}]
%    \begin{macrocode}
\NewDocumentEnvironment{bidding}{s t! t- O{c}d()}{%
%    \end{macrocode}
% |\begin{bidding}* ! -[pos](description)|\\
% |               1 2 3  4        5|\\
% The 1st token (|*|) centers the environment; the 2nd token (|!|) switches to the short
% notation in the table header; the 3rd token (|-|) suppresses the output.
% Argument 4 regulates the alignment of the table (default is \textbf{c}
% and the 5th argument contains the annotations of the bidding.
%    \begin{macrocode}
  \ODw@GameSize%
  \renewcommand{\thefootnote}{\alph{footnote}}%
  \setcounter{ODw@Nr}{0}%
  \IfBooleanTF#1{\center}{}%           "*" detected
  \IfBooleanTF{#2}{\ODw@shorttrue}{}%  "!" detected
  \IfValueTF{#5}{\ODw@descriptiontrue}{\ODw@descriptionfalse}%
  \ODw@Bidding[#4]{#5}%
}{%
  \endODw@Bidding%
  \IfBooleanTF{#3}%
    {\rule{0pt}{0pt}}%
  %           +---without this, pdflatex aborts compilation!
    {\usebox{\ODw@BidBox}}%  "-" detected
  \IfBooleanTF#1{\endcenter}{}%
}% bidding
%    \end{macrocode}
% \end{environment}
%
% \begin{environment}{biddingpair}\EnvDef{biddingpair}[\Oarg{*!-}\oarg{pos}\parg{description}]
%    \begin{macrocode}
\NewDocumentEnvironment{biddingpair}{s t! t- O{c}d()}{%
%    \end{macrocode}
% |\begin{biddingpair}* ! -[pos](description)|\\
% |                   1 2 3  4        5|\\
% The same as with environment |bidding|, only with 2 columns instead of 4.
%    \begin{macrocode}
  \def\xspace{}%
  \ODw@GameSize%
  \renewcommand{\thefootnote}{\alph{footnote}}%
  \setcounter{ODw@Nr}{0}%
  \IfBooleanTF#1{\center}{}%           "*" detected
  \IfBooleanTF{#2}{\ODw@shorttrue}{}%  "+" detected
  \IfValueTF{#5}{\ODw@descriptiontrue}{\ODw@descriptionfalse}%
  \ODw@Biddingpair[#4]{#5}%
}{%
  \endODw@Biddingpair%
  \IfBooleanTF{#3}%
    {\rule{0pt}{0pt}}%
  %           +---without this, pdflatex aborts compilation!
    {\usebox{\ODw@BidBox}}%  "-" detected
  \IfBooleanTF#1{\endcenter}{}%
}% biddingpair
%    \end{macrocode}
% \end{environment}
%
%
% \subsubsection{Play}
%
% Environment |play| displays the sequence of playing tricks. It uses
% 2 |newcolumntype|s:
% \begin{itemize}[itemsep=0em]
% \item[|F|] to increment and display the current row.
% \item[|P|] to translate an convert suits/ranks.
% \end{itemize}
%
% \begin{macro}{\ODw@AccTricks}
% |\ODw@AccTricks| calculates and shows the accumulated tricks in
% |play| that |N-S| and |E-W| has won. The winning card is detected
% automatically and |\ODw@LastTrick| is called to process the winning trick
% for whichever side won it (|N-S| or |E-W|) by stepping the counter for the
% winning side. The counter |ODw@Player| denotes the player who won the
% trick. From the player who leads and the position that wins we calculate
% the winning player and step the counter for his side.
%    \begin{macrocode}
\def\ODw@AccTricks{%
    \ODw@LastTrick{\ODw@Last}{\theODw@WinningNr}%
    \ODw@append{\theODw@NSCnt,\theODw@EWCnt,}% store counters
    \setcounter{ODw@Highest}{0}% reset for next trick
}% ODw@AccTricks
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@Tricks}\MacroDef{ODw@Tricks}
% \begin{macro}{\ODw@Last}\label{Last}
% This macro is automatically called in TableII for column 1.
% This column displays the player who had the lead.
% It essentially 1) resets the |ODw@PlayerNr| which will be
% stepped for each next column in search for the winning card 2)
% remembers in |\ODw@Last| who had the lead. From these two values we can
% later calculate who won this trick. The stepping of |ODw@PlayerNr| occurs
% in |\ODw@Tfer|.
%    \begin{macrocode}
\def\ODw@Tricks{%
  \setcounter{ODw@PlayerNr}{0}%
  \gdef\ODw@Last{\ODw@NextLead}%
    \expandafter\GetTranslation%
    \expandafter{\ODw@NextLead-(ODw)}:\,%
% write a colon and a thin space in the table,
% as separator between lead player and lead card.
}% ODw@Tricks
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\ODw@LastTrick}\MacroDef{ODw@LastTrick}[\marg{Player}\marg{Pos}]
% This macro is called by |\ODw@AccTricks|.
% It computes who won the last trick and steps the corresponding counter.
%    \begin{macrocode}
\newcommand\ODw@LastTrick[2]{%
%    \end{macrocode}
% |\ODw@LastTrick{Player}{Pos}|\\
% |                 1      2--- Seat Nr that won the trick|\\
% |                 +---------- Player (N,E,S,W) who has led|
% \par\vspace{0.5\baselineskip}\noindent
% Consider the following table, where the seats are in horizontal
% direction, starting with the player who leads in seat 1. Vertically, in
% the first column, we have an initial value, stored in |ODw@Cnt| which is
% associated with the leading player.
%
% \begin{tabular}{c|cccc}
%      & 1     & 2 & 3 & 4 \\\hline
%    0 & W$^1$ & N$^2$ & E$^3$ & S$^4$ \\
%    1 & N$^2$ & E$^3$ & S$^4$ & W$^5$ \\
%    2 & E$^3$ & S$^4$ & W$^5$ & N$^6$ \\
%    3 & S$^4$ & W$^5$ & N$^6$ & E$^7$ \\
% \end{tabular}
% \par\noindent
% If we add this initial value to the
% \emph{seat} where the trick is won, then the result gives us the
% \emph{player} who won the trick. Suppose that e.g.\ |S| had the lead,
% so |ODw@Cnt| $=$ 3. Suppose also that seat number 3 wins the trick. The
% sum equals 6 and this is the seat of |N|. For clarity these sums are
% displayed in the table as superscripts to the players
% \par\vspace{0.5\baselineskip}\noindent
% First we set the counter |ODw@Cnt| to the player who has the lead and add
% the seat number (|#2|) to it. We then store who has the next lead in
% |\ODw@NextLead| and increment the counter of the winning side.
%
%    \begin{macrocode}
  \IfEqCase{#1}{%
    {W}{\setcounter{ODw@Cnt}{0}}%
    {N}{\setcounter{ODw@Cnt}{1}}%
    {E}{\setcounter{ODw@Cnt}{2}}%
    {S}{\setcounter{ODw@Cnt}{3}}%
  }% IfEqCase
  \addtocounter{ODw@Cnt}{#2}%
  \IfEqCase{\theODw@Cnt}{%
    {1}{\gdef\ODw@NextLead{W}\stepcounter{ODw@EWCnt}}
    {2}{\gdef\ODw@NextLead{N}\stepcounter{ODw@NSCnt}}
    {3}{\gdef\ODw@NextLead{E}\stepcounter{ODw@EWCnt}}
    {4}{\gdef\ODw@NextLead{S}\stepcounter{ODw@NSCnt}}
    {5}{\gdef\ODw@NextLead{W}\stepcounter{ODw@EWCnt}}
    {6}{\gdef\ODw@NextLead{N}\stepcounter{ODw@NSCnt}}
    {7}{\gdef\ODw@NextLead{E}\stepcounter{ODw@EWCnt}}
  }% IfEqCase
}% ODw@LastTrick
%    \end{macrocode}
% \end{macro}
%
% \begin{environment}{play}\EnvDef{play}[*\marg{Lead}\oarg{Trump}]
% \label{Play}
% \changes{v0.3}{2018/02/24}{\\
% - In order to avoid empty columns in environment \texttt{playtricks} we
% reorganized it. Rather than just 1 table we use 3 tables. The middle one
% typesets the relevant tricks, stored in an \texttt{lrbox}, while
% generating on the fly a string with the winning tricks. Finally we put
% the running trick-number in TableI, we 'use' TableII and contruct
% TableIII from the string with the winning tricks.}
%
% Finally we define environment |play|. It consists primarily of
% these 3 tables, the middle one  with the special newcolumntype
% \textbf{P}. We reset the
% counter for the running line (=trick) |ODw@Nr| and the winning trick
% counters for |N|--|S| and |E|--|W|: |ODw@NSCnt| and |ODw@EWCnt|. As usual
% |\ODw@GameSize| takes care for the correct sizing. The first row (the
% title row) is displayed using the |\cci| method. The 3th table gets a
% stacked |N/S| and |E/W| title.
%    \begin{macrocode}
\NewDocumentEnvironment{play}{s mO{N}}{%
% #1 --> s center
% #2 --> m lead
% #3 --> O trumpsuit (default NoTrump)
  \def\ODw@TrumpSuit{#3}
  \gdef\ODw@NextLead{#2}%
  \setcounter{ODw@Nr}{0}%
  \setcounter{ODw@NSCnt}{0}
  \setcounter{ODw@EWCnt}{0}%
  \ODw@GameSize%
  \ODw@Scratch{}% make empty 
  \let\ODw@Clubs\empty%
  \let\ODw@Diamonds\empty%
  \let\ODw@Hearts\empty%
  \let\ODw@Spades\empty%
%
% We need some data which is calculated in TableII
% to create TableI and TableIII. So we put TableII in a 
% box and display it later at due time
%
\def\ODw@EXtra{0.9em}% white space in title
%
\provideenvironment{TableII}{%
    \begin{tabular}[b]{FPPP}%
      \multicolumn{1}{c}{\GetTranslation{Lead!-(ODw)}} &%
      \cci{\GetTranslation{2nd-(ODw)}}                 &%
      \cci{\GetTranslation{3rd-(ODw)}}                 &%
      \cci{\GetTranslation{4th-(ODw)}}   \\[0.3em]\hline%
      \multicolumn{4}{c}{}\\[-\ODw@EXtra]%
}{%
  \end{tabular}%
}% TableII
%
  \begin{lrbox}{0}% save TableII for later
    \begin{TableII}
}{%
    \end{TableII}
  \end{lrbox}%
  % Check consistency of the played cards
  \ODw@ChkSameCards{\ODw@Spades}{\Sp}%
  \ODw@ChkSameCards{\ODw@Hearts}{\He}%
  \ODw@ChkSameCards{\ODw@Diamonds}{\Di}%
  \ODw@ChkSameCards{\ODw@Clubs}{\Cl}%
%
  \setcounter{ODw@Cnt}{0}%
  \IfBooleanTF#1{\begin{center}}{}%
%
%    \end{macrocode}
% We need TableI to show the running trick number. When constructing Table
% II, the total number of tricks that were actually displayed is available
% in counter |ODw@Nr|. So we just need to loop |\theODw@Nr| times and write
% the local counter value |\theODw@Cnt|. To avoid \emph{the extra line
% problem} we use the solution from:\\
% \url{https://tex.stackexchange.com/questions/50296/problem-with-using-loop-inside-the-tabular-environment/142562#142562}
%    \begin{macrocode}
%
  \begin{tabular}[b]{r}% TableI
    \cci{\GetTranslation{Nr-(ODw)}}\\[0.3em]
    \hline\\[-\ODw@EXtra]%
    \setcounter{ODw@Cnt}{1}%
    \whiledo{\theODw@Cnt<\theODw@Nr}{%
      \theODw@Cnt\\
      \stepcounter{ODw@Cnt}%
    }%
    \theODw@Cnt\\% MUST be outside the loop 
  %  (the extra line problem]!
  \end{tabular}%
%
% TableII showing the cards played in the tricks
%
  \usebox{0}%
%
%    \end{macrocode}
% We use TableIII to show the winning trick counts. These are already stored
% in a CSV-list |\ODw@Scratch|, implemented as a token register. To process
% this list we use |\docsvlist| and must only define our |\do|. As this
% table has 2 columns, we check with |ODw@Nr| that after an item is read,
% we put an \& and after the next item a |\\|.
%    \begin{macrocode}
%
  \setcounter{ODw@Nr}{0}%
  \renewcommand*{\do}[1]{%
    \ifnumequal{\value{ODw@Nr}}{2}{\\\setcounter{ODw@Nr}{0}}{}%
    \stepcounter{ODw@Nr}%
    ##1
    \ifnumequal{\value{ODw@Nr}}{2}{}{&}%
  }%
  \begin{tabular}[b]{|cc}% TableIII
    \multicolumn{1}{|c}{%
      \cci{\scriptsize\shortstack[c]{\North*!\\\South*!}}} &%
    \multicolumn{1}{c}{%
      \cci{\scriptsize\shortstack[c]{\East*!\\\West*!}}%
    }\\\hline\\[-\ODw@EXtra]%
    \expandafter\docsvlist\expandafter{\the\ODw@Scratch}%
  \end{tabular}%
  \IfBooleanTF#1{\end{center}}{}%
%
}% play
%    \end{macrocode}
%  \end{environment}
%
% \subsection{Card Diagrams with Bidding}
%
% \begin{macro}{\ODw@CondNewLine}\MacroDef{ODw@CondNewLine}[\oarg{offset}]
%    \begin{macrocode}
\NewDocumentCommand\ODw@CondNewLine{O{0em}}{% 
%    \end{macrocode}
% |\ODw@CondNewLine| forces a newline if the |bidding| diagram does not fit on
% the line, taking into account the width of the card diagram and the width
% of the |bidding| diagram.
% Otherwise the |bidding| diagram appears to the right of the card diagram at
% distance |\ODw@Skip@Width|. We call the global macro
% |\ODw@Diagram@Width| that contains the width of the card diagram. The
% optional parameter of |\ODw@CondNewLine|  is used to add some extra
% offset if needed.
%
%    \begin{macrocode}
 {\ODw@GameFont% needed to relate skips to the font-size
%  :\the\ODw@Skip@Width:% JW XXX
  \setlength{\ODw@Tmp@Len}{\ODw@Bid@Width}%
  \addtolength{\ODw@Tmp@Len}{\ODw@Diagram@Width}%
  \addtolength{\ODw@Tmp@Len}{#1}%
  \addtolength{\ODw@Tmp@Len}{\ODw@Skip@Width}%
  \ifthenelse{\lengthtest{\ODw@Tmp@Len > \textwidth}}{%
    \\[1em]}{%
      \hspace{\ODw@Skip@Width}%
    }%
 }%
}% ODw@CondNewLine
%    \end{macrocode}
% \end{macro}
%
% \subsection{The Expert Quiz}
%
% \begin{macro}{\expertquiz}\MacroDef{expertquiz}[\Oarg{*!}\oarg{comment}\marg{award}]
% The macro |\expertquiz| displays a hand, a |bidding| diagram and the award
% for the answers. Optionally a description can be added. The hand and the
% bidding have to be defined before. This is done to avoid having 4 more
% arguments, needed for specifying the hand. The token '|*|' centers the
% whole and the token '|!|' forces that the |bidding| diagram appears on a
% new line and that the hand shifts a bit to the right. The last parameter
% defines the award. In order to limit the width of the award we use the
% known widths of the |bidding| diagram and the hand and set the parbox
% accordingly to display the award.
%
%    \begin{macrocode}
\NewDocumentCommand\expertquiz{st! O{}m}{%
%                              12  3  4
%    \end{macrocode}
% |\expertquiz* ![comment]{award}|\\
% |           1 2    3       4   |\\

%    \begin{macrocode}
  \noindent%
  \IfBooleanTF#1{\begin{center}}%      "*" detected
    {\par\vspace{0.5\baselineskip}}%
  \bgroup% keep font changes local (e.g. "\smaller").
    \ODw@LegendFont%
    \ifx#3\empty\else#3\par\fi%
  \egroup%
  \IfBooleanTF{#2}{~\hspace*{2em}}{}% "!" detected
  \usebox{\ODw@Hand@Box}%   display the saved hand
  \IfBooleanTF{#2}{}{\quad}%       no "!" detected
  \setlength\ODw@Tmp@Width{\wd\ODw@BidBox + 1em}%
  \IfBooleanTF{#2}%
    {\\}%
    {\addtolength\ODw@Tmp@Width{\wd\ODw@Hand@Box}}%
  \usebox{\ODw@BidBox}%     display the saved bidding
  \par\vspace{0.3em}%\noindent%
   {% keep legendfont and "smaller" local
    \ODw@LegendFont%
    \smaller%
    \IfBooleanTF#1{\bgroup\centering}{}%
    \parbox[t]{\ODw@Tmp@Width}{%
      \textbf{\ODw@AwardText: }%
      \raggedright#4%
    }% parbox
    \IfBooleanTF#1{\egroup}{}%
   }%
%  \fi%
    \IfBooleanTF#1{\end{center}}{}%
}% expertquiz
%    \end{macrocode}
% \end{macro}
%
% \subsection{Resetting the Game}
%
% We use \packname{pgfkeys} with its \meta{key}=\meta{val} system to
%specify the fonts and other things that we want to have as defaults,
%rather than the intitial \OneDown values. Therefore we first define the
%keys and the store for it.
%
%    \begin{macrocode}
\pgfkeys{%
  /ODw/.is family, /ODw,
% fonts
  bidder/.store in = \ODw@BidderDefault,
  compass/.store in = \ODw@CompassDefault,
  game/.store in = \ODw@GameDefault,
  legend/.store in = \ODw@LegendDefault,
  name/.store in = \ODw@NameDefault,
  other/.store in = \ODw@OtherDefault,
% compass
  compline/.store in = \ODw@CompLine,
  compmid/.store in = \ODw@CompMid,
  compsize/.store in = \ODw@CompSize,
}
% compass
  \ODw@set{compshow/.is choice}
  \ODw@set{compshow/off/.code={\ODw@CompShowfalse}}
  \ODw@set{compshow/on/.code={\ODw@CompShowtrue}}
  \ODw@set{compturn/.is choice}
  \ODw@set{compturn/off/.code={\ODw@CompTurnfalse}}
  \ODw@set{compturn/on/.code={\ODw@CompTurntrue}}
% bídding
  \ODw@set{bidders/.is choice}
  \ODw@set{bidders/off/.code={\ODw@Biddersfalse}}
  \ODw@set{bidders/on/.code={\ODw@Bidderstrue}}
  \ODw@set{bidfirst/.is choice}
  \ODw@set{bidfirst/N/.code=\ODw@FirstBidCol{N}}
  \ODw@set{bidfirst/E/.code=\ODw@FirstBidCol{E}}
  \ODw@set{bidfirst/S/.code=\ODw@FirstBidCol{S}}
  \ODw@set{bidfirst/W/.code=\ODw@FirstBidCol{W}}
  \ODw@set{bidline/.is choice}
  \ODw@set{bidline/off/.code={\ODw@BidLinefalse}}
  \ODw@set{bidline/on/.code={\ODw@BidLinetrue}}
  \ODw@set{bidlong/.is choice}
  \ODw@set{bidlong/off/.code={\ODw@LongCallsfalse}}
  \ODw@set{bidlong/on/.code={\ODw@LongCallstrue}}
% synonyms
  \ODw@set{compshow/1/.code={\pgfkeys{/ODw/compshow=on}}}
  \ODw@set{compshow/true/.code={\pgfkeys{/ODw/compshow=on}}}
  \ODw@set{compturn/1/.code={\pgfkeys{/ODw/compturn=on}}}
  \ODw@set{compturn/true/.code={\pgfkeys{/ODw/compturn=on}}}
  \ODw@set{bidline/1/.code={\pgfkeys{/ODw/bidline=on}}}
  \ODw@set{bidders/true/.code={\pgfkeys{/ODw/bidders=on}}}
  \ODw@set{bidders/1/.code={\pgfkeys{/ODw/bidders=on}}}
  \ODw@set{bidline/true/.code={\pgfkeys{/ODw/bidline=on}}}
  \ODw@set{bidlong/1/.code={\pgfkeys{/ODw/bidlong=on}}}
  \ODw@set{bidlong/true/.code={\pgfkeys{/ODw/bidlong=on}}}
%
  \ODw@set{compshow/0/.code={\pgfkeys{/ODw/compshow=off}}}
  \ODw@set{compshow/false/.code={\pgfkeys{/ODw/compshow=off}}}
  \ODw@set{compturn/0/.code={\pgfkeys{/ODw/compturn=off}}}
  \ODw@set{compturn/false/.code={\pgfkeys{/ODw/compturn=off}}}
  \ODw@set{bidders/0/.code={\pgfkeys{/ODw/bidders=off}}}
  \ODw@set{bidders/false/.code={\pgfkeys{/ODw/bidders=off}}}
  \ODw@set{bidline/0/.code={\pgfkeys{/ODw/bidline=off}}}
  \ODw@set{bidline/false/.code={\pgfkeys{/ODw/bidline=off}}}
  \ODw@set{bidlong/0/.code={\pgfkeys{/ODw/bidlong=off}}}
  \ODw@set{bidlong/false/.code={\pgfkeys{/ODw/bidlong=off}}}
%    \end{macrocode}
%
% \begin{macro}{\resetfonts}\MacroDef{resetfonts}
%    \begin{macrocode}
\newcommand\resetfonts{%
  \bidderfont{\ODw@BidderDefault}%
  \compassfont{\ODw@CompassDefault}%
  \gamefont{\ODw@GameDefault}%
  \legendfont{\ODw@LegendDefault}%
  \namefont{\ODw@NameDefault}%
  \otherfont{\ODw@OtherDefault}%
}% resetfonts
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\setdefaults}\MacroDef{setdefaults}[\Oarg{*}\string{\meta{key1=val1},\meta{key2=val2},\ldots\string}]
% The available keys are those defined in |\pgfkeys| some lines up from
% here. For the fonts they are: |bidder|, |compass|, |game|, |legend|,
% |name| and |other|. They store the new default value in the corresponding
% variable. In order to make the new default active, we must use
% |\setdefaults*| which will also call |\resetfonts|.
%
% The keys for the compass are: |compline|, |compmid|, |compshow|,
% |compsize| and |compturn|. They control the thickness of the frame, the
% mid-text, the visibility of the compass, its size and the angle of the
% compass E--W letters.
%
% For the |bidding| diagram we have: |bidders|, |bidfirst|, |bidline| and
% |bidlong|. They control if bidders are to be displayed at all, which
% bidder appears in the first column, draw a |\hline| below the header and
% showing long calls.
%
% Furthermore defined elsewhere are the keys to control errors |err| and
% warnings |warn|, as well as the key to control the color e.g. of the
% symbols |colors|. Refer to section~\ref{Options}
%
%    \begin{macrocode}
\NewDocumentCommand\setdefaults{s m}{%
  \pgfkeys{/ODw,#2}%
  \IfBooleanTF{#1}{\resetfonts}{}%
}% setdefaults
%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\newgame}\MacroDef{newgame}
% |\newgame| resets and clears the stored game information to be ready for
% a new game. We do not reset the option for warn- and err-messages, nor
% any selected font. Setting |\boardnr{0}| executes also:\\
% |\ODw@BoardText{}\vulner[-1]\dealer[-1]}|.
%
%    \begin{macrocode}
\newcommand\newgame{%
  \boardnr{0}%
  \headlinetext{}%
  \footlinetext{}%
% clear the left/right upper/lower stuff
  \gdef\ODw@LeftUpperText{}%
  \gdef\ODw@LeftLowerText{}%
  \gdef\ODw@RightUpperText{}%
  \gdef\ODw@RightLowerText{}%
% clear the hands
  \gdef\ODw@Nhand{\ODw@hand{t}{}{}{}{}}%
  \gdef\ODw@Ehand{\ODw@hand{c}{}{}{}{}}%
  \gdef\ODw@Shand{\ODw@hand{b}{}{}{}{}}%
  \gdef\ODw@Whand{\ODw@hand{c}{}{}{}{}}%
%
% set default for real bidders names: no names
% we print only the symbolic names North, East, etc.
%
   \namesNS{}{}\namesEW{}{}%
%
% reset consistency check stuff
%
  \gdef\ODw@Spades{}%
  \gdef\ODw@Hearts{}%
  \gdef\ODw@Diamonds{}%
  \gdef\ODw@Clubs{}%
%
  \gdef\ODw@NSpades{}\gdef\ODw@ESpades{}%
  \gdef\ODw@SSpades{}\gdef\ODw@WSpades{}%
  \gdef\ODw@NHearts{}\gdef\ODw@EHearts{}%
  \gdef\ODw@SHearts{}\gdef\ODw@WHearts{}%
  \gdef\ODw@NDiamonds{}\gdef\ODw@EDiamonds{}%
  \gdef\ODw@SDiamonds{}\gdef\ODw@WDiamonds{}%
  \gdef\ODw@NClubs{}\gdef\ODw@EClubs{}%
  \gdef\ODw@SClubs{}\gdef\ODw@WClubs{}%
%
}% newgame
%    \end{macrocode}
% \end{macro}
%
% \subsection{Error Handling}
%
% \subsubsection{Consistency Checks}
%
% We perform different checks on consistency of the cards entered:
% \begin{enumerate}[itemsep=-2mm]
% \item Check that a hand not has more than 13 cards (E)
% \item Check that a hand doesn't contain multiple cards (E)
% \item Check that a deal doesn't contain multiple cards (E)
% \item Check that a hand has less than 13 cards (W)
% \item check that a suit of a deal has more than 13 cards (E)
% \item check that a suit of a deal has less than 13 cards (W)
% \item In |play| diagrams: check that a card is played only once (E)
% \end{enumerate}
% The checks marked with (E) raise an error, those marked with (W) raise
% a warning. They can be controlled with the package options |err| and
% |warn|.
%
% \begin{macro}{\ODw@ChkNrOfCards}\MacroDef{ODw@ChkNrOfCards}[\marg{cards}\marg{hand}]
%    \begin{macrocode}
\newcommand\ODw@ChkNrOfCards[2]{%
%    \end{macrocode}
% |\ODw@ChkNrOfCards{cards}{hand}|\\
% |                    1      2|\\
% |#1 = a string with all cards of all suits of the hand denoted by #2|\\
% |step 1: remove all "-" (that denotes an empty suit)|\\
% |step 2: warn if StrLen < 13 ; Err if StrLen > 13|
%
%    \begin{macrocode}
  \StrDel{#1}{-}[\ODw@CardStr]%     remove voids
  \StrLen{\ODw@CardStr}[\ODw@CardLen]%  
  \ifthenelse{\ODw@CardLen > 13}{%
    \ODw@Error{#2 has \ODw@CardLen{} cards}%
  }{%
    \ifthenelse{\ODw@CardLen < 13}{%
      \ODw@Warning{#2 has \ODw@CardLen{} cards}%
    }{}%
  }%
}% ODw@ChkNrOfCards
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@PrErr}\MacroDef{ODw@PrErr}[\marg{rank}\marg{count}\marg{suit}]
%    \begin{macrocode}
\newcommand\ODw@PrErr[3]{%
%    \end{macrocode}
% |\ODw@PrErr{rank}{count}{suit}|\\
% |            1      2     3|\\
% This macro only outputs the warning/error if the card specified by rank
% (\#1) and suit (\#3) does not occur (denoted by \#2) exactly $1 \times$.
% An exception for spotcards must not be made, because in
% |\ODw@ChkSameCards| they are not taken into account. (In fact they are
% already filtered out by |ODw@translate|).
%
%    \begin{macrocode}
  \bgroup%
    \if#1T\def\ODw@T{10}\else\def\ODw@T{#1}\fi%
    \ifthenelse{#2 > 1}{%
      \ODw@Error{Card #3\,\ODw@T{} occurs #2 times}%
    }{%
      \ifthenelse{#2 = 0}{%
        \ODw@Warning{Card #3\,\ODw@T{} fails}}{}%
    }%
  \egroup%
}% ODw@PrErr
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@ChkSameCards}\MacroDef{ODw@ChkSameCards}[\marg{cards}\marg{suit}]
%    \begin{macrocode}
\newcommand\ODw@ChkSameCards[2]{%
%    \end{macrocode}
% |#1 = a string with all cards of 1 suit (denoted by #2) of all hands|\\
% |step 1: remove all "-" |\\
% |step 2: we count the frequency of all ranks 2--9,T,J,Q,K,A| (|ODw@CCnt|)\\
% |step 3: Warn if Freq(card) = 0 ; Err if Freq(card) > 1| (|ODw@PrErr|)\\
%
%    \begin{macrocode}
  \StrDel{#1}{-}[\ODw@CardStr]%
  \StrCount{\ODw@CardStr}{2}[\ODw@CCnt]\ODw@PrErr{2}{\ODw@CCnt}{#2}%
  \StrCount{\ODw@CardStr}{3}[\ODw@CCnt]\ODw@PrErr{3}{\ODw@CCnt}{#2}%
  \StrCount{\ODw@CardStr}{4}[\ODw@CCnt]\ODw@PrErr{4}{\ODw@CCnt}{#2}%
  \StrCount{\ODw@CardStr}{5}[\ODw@CCnt]\ODw@PrErr{5}{\ODw@CCnt}{#2}%
  \StrCount{\ODw@CardStr}{6}[\ODw@CCnt]\ODw@PrErr{6}{\ODw@CCnt}{#2}%
  \StrCount{\ODw@CardStr}{7}[\ODw@CCnt]\ODw@PrErr{7}{\ODw@CCnt}{#2}%
  \StrCount{\ODw@CardStr}{8}[\ODw@CCnt]\ODw@PrErr{8}{\ODw@CCnt}{#2}%
  \StrCount{\ODw@CardStr}{9}[\ODw@CCnt]\ODw@PrErr{9}{\ODw@CCnt}{#2}%
  \StrCount{\ODw@CardStr}{T}[\ODw@CCnt]\ODw@PrErr{T}{\ODw@CCnt}{#2}%
  \StrCount{\ODw@CardStr}{J}[\ODw@CCnt]\ODw@PrErr{J}{\ODw@CCnt}{#2}%
  \StrCount{\ODw@CardStr}{Q}[\ODw@CCnt]\ODw@PrErr{Q}{\ODw@CCnt}{#2}%
  \StrCount{\ODw@CardStr}{K}[\ODw@CCnt]\ODw@PrErr{K}{\ODw@CCnt}{#2}%
  \StrCount{\ODw@CardStr}{A}[\ODw@CCnt]\ODw@PrErr{A}{\ODw@CCnt}{#2}%
}% ODw@ChkSameCards
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Controlling Messages}
%
% \label{Messages}
%    \begin{macrocode}
\newbool{ODw@Warnings}
\newbool{ODw@Errors}
%
\ODw@set{warn/off/.code={%
  \global\setbool{ODw@Warnings}{false}}}
\ODw@set{warn/on/.code={%
  \global\setbool{ODw@Warnings}{true}}}
\ODw@set{err/off/.code={%
  \global\setbool{ODw@Errors}{false}}}
\ODw@set{err/on/.code={%
  \global\setbool{ODw@Errors}{true}}}
\ODw@set{warn=off}
\ODw@set{err=on}

\ProcessPgfOptions{/ODw}
%    \end{macrocode}

% \begin{macro}{\ODw@Error}
%    \begin{macrocode}
\newcommand\ODw@Error[1]{%
  \ifbool{ODw@Errors}{%
    \par\textcolor{red}{Error: #1}\par}{}%
}% ODw@Error
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ODw@Warning}
%    \begin{macrocode}
\newcommand\ODw@Warning[1]{%
  \ifbool{ODw@Warnings}{%
    \par\textcolor{blue}{Warning: #1}\par}{}%
}% ODw@Warning
%    \end{macrocode}
% \end{macro}
%
% \subsection{Misc Bridge Terms}
%
% \subsubsection{Honour Cards}
%
% These macros retrieve the translations of the 4 alternative forms of the
% honour cards from the |ODw|-dictionary of the active language.
% \noindent
% \begin{macro}{\Ace}
% \begin{macro}{\ace}
%    \begin{macrocode}
\NewDocumentCommand{\Ace}{s t!}{%
  \bgroup%
%JW    \ODw@GameFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{A-(ODw)}}%
        {\GetTranslation{Ace-(ODw)}}%
   }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{a-(ODw)}}%
        {\GetTranslation{ace-(ODw)}}%
  }%
  \egroup%
  \xspace%
}% Ace
%
\def\ace{\Ace*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\King}
% \begin{macro}{\king}
%    \begin{macrocode}
\NewDocumentCommand{\King}{s t!}{%
  \bgroup%
%JW    \ODw@GameFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{K-(ODw)}}%
        {\GetTranslation{King-(ODw)}}%
   }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{k-(ODw)}}%
        {\GetTranslation{king-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% King
%
\def\king{\King*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\Queen}
% \begin{macro}{\queen}
%    \begin{macrocode}
\NewDocumentCommand{\Queen}{s t!}{%
  \bgroup%
%JW    \ODw@GameFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{Q-(ODw)}}%
        {\GetTranslation{Queen-(ODw)}}%
   }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{q-(ODw)}}%
        {\GetTranslation{queen-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Queen
%
\def\queen{\Queen*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\Jack}
% \begin{macro}{\jack}
%    \begin{macrocode}
\NewDocumentCommand{\Jack}{s t!}{%
  \bgroup%
%JW    \ODw@GameFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{J-(ODw)}}%
        {\GetTranslation{Jack-(ODw)}}%
   }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{j-(ODw)}}%
        {\GetTranslation{jack-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Jack
%
\def\jack{\Jack*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\Ten}
%    \begin{macrocode}
\newcommand{\Ten}{%
  \bgroup%
%JW    \ODw@GameFont%
    10%
  \egroup%
  \xspace%
}% Ten
%    \end{macrocode}
% \end{macro}

%
% \subsubsection{Vulnerability}
%
% These macros retrieve the translations of the 4 alternative forms of the
% commands |\All| and |\None| from the |ODw|-dictionary of the active
% language. As there is no short form for them in the English language, we
% just code these entries in the |ODw|-dictionaries with an exclamation
% mark~'|!|'.

% \begin{macro}{\All}
% \begin{macro}{\all}
%    \begin{macrocode}
\NewDocumentCommand{\All}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{All!-(ODw)}}%
        {\GetTranslation{All-(ODw)}}%
   }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{all!-(ODw)}}%
        {\GetTranslation{all-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% All
%
\def\all{\All*}
%    \end{macrocode}
% \end{macro}
% \end{macro}

% \begin{macro}{\None}
% \begin{macro}{\none}
%    \begin{macrocode}
\NewDocumentCommand{\None}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{None!-(ODw)}}%
        {\GetTranslation{None-(ODw)}}%
   }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{none!-(ODw)}}%
        {\GetTranslation{none-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% None
%
\def\none{\None*}
%%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsubsection{Diagram Annotations}
%
% These macros retrieve the translations of the 4 alternative forms of the
% commands |\Contract|, |\Lead|, |\Declarer|, |\Board| and |\Deal| from the
% |ODw|-dictionary of the active language.
%
% \begin{macro}{\Contract}
% \begin{macro}{\contract}
%    \begin{macrocode}
\NewDocumentCommand{\Contract}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{Contr-(ODw)}}%
        {\GetTranslation{Contract-(ODw)}}%
   }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{contr-(ODw)}}%
        {\GetTranslation{contract-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Contract
%
\def\contract{\Contract*}
%%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\Lead}
% \begin{macro}{\lead}
%    \begin{macrocode}
\NewDocumentCommand{\Lead}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{Lead!-(ODw)}}%
        {\GetTranslation{Lead-(ODw)}}%
    }{% else #1
      \IfBooleanTF{#2}%
        {\GetTranslation{lead!-(ODw)}}%
        {\GetTranslation{lead-(ODw)}}%
    }% #1
  \egroup%
  \xspace%
}% Lead
%
\def\lead{\Lead*}
%%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\Declarer}
% \begin{macro}{\declarer}
%    \begin{macrocode}
\NewDocumentCommand{\Declarer}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{Decl-(ODw)}}%
        {\GetTranslation{Declarer-(ODw)}}%
   }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{decl-(ODw)}}%
        {\GetTranslation{declarer-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Declarer
%
\def\declarer{\Declarer*}
%%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\by}
%    \begin{macrocode}
\newcommand\by{%
  \bgroup%
    \ODw@OtherFont%
    \GetTranslation{by-(ODw)}%
  \egroup%
  \xspace%
}% by
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\Board}
% \begin{macro}{\board}
%    \begin{macrocode}
\NewDocumentCommand{\Board}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{Brd-(ODw)}}%
        {\GetTranslation{Board-(ODw)}}%
   }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{brd-(ODw)}}%
        {\GetTranslation{board-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Board
%
\def\board{\Board*}
%%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\Deal}
% \begin{macro}{\deal}
%    \begin{macrocode}
\NewDocumentCommand{\Deal}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{Deal!-(ODw)}}%
        {\GetTranslation{Deal-(ODw)}}%
   }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{deal!-(ODw)}}%
        {\GetTranslation{deal-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Deal
%
\def\deal{\Deal*}
%%    \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\doubled}
% The commands |\doubled| and |\redoubled| do not have a short form.
%    \begin{macrocode}
\NewDocumentCommand{\doubled}{s}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \GetTranslation{Doubled-(ODw)}}{%
      \GetTranslation{doubled-(ODw)}%
    }%
  \egroup%
  \xspace%
}% doubled
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\redoubled}
%    \begin{macrocode}
\NewDocumentCommand{\redoubled}{s}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \GetTranslation{Redoubled-(ODw)}}{%
      \GetTranslation{redoubled-(ODw)}%
    }%
  \egroup%
  \xspace%
}% redoubled
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Point Units}
%
% These macros retrieve the translations of the commands |\hpts|, |\lpts|,
% |\dpts| and |\tpts| from the |ODw|-dictionary of the active language.
% \begin{macro}{\hpts}
% \begin{macro}{\HCP}
%    \begin{macrocode}
\NewDocumentCommand{\hpts}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{HCP-(ODw)}}%
        {\GetTranslation{High Card Points-(ODw)}}%
    }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{hcp-(ODw)}}%
        {\GetTranslation{high card points-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% High Card Points
%
\def\HCP{\,\hpts*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\lpts}
% \begin{macro}{\LP}
% \begin{macro}{\HLP}
%    \begin{macrocode}
\NewDocumentCommand{\lpts}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{LP-(ODw)}}%
        {\GetTranslation{Length Points-(ODw)}}%
    }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{lp-(ODw)}}%
        {\GetTranslation{length points-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Length Points
%
\def\LP{\,\lpts*!}
\def\HLP{\,\bgroup\ODw@OtherFont\GetTranslation{HLP-(ODw)}\egroup\xspace}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\dpts}
% \begin{macro}{\DP}
%    \begin{macrocode}
\NewDocumentCommand{\dpts}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{DP-(ODw)}}%
        {\GetTranslation{Distribution Points-(ODw)}}%
    }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{dp-(ODw)}}%
        {\GetTranslation{distribution points-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Distribution Points
%
\def\DP{\,\dpts*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\tpts}
% \begin{macro}{\TP}
%    \begin{macrocode}
\NewDocumentCommand{\tpts}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{TP-(ODw)}}%
        {\GetTranslation{Total Points-(ODw)}}%
    }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{tp-(ODw)}}%
        {\GetTranslation{total points-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Total Points
%
\def\TP{\,\tpts*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsubsection{Forcings}
%
% These macros retrieve the translations of the commands |\gforce|,
% |\sforce|, |\nmforce|, |\tsforce|  and |\fsforce| from the
% |ODw|-dictionary of the active language.
% \begin{macro}{\gforce}
% \begin{macro}{\GF}
%    \begin{macrocode}
\NewDocumentCommand{\gforce}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{GF-(ODw)}}%
        {\GetTranslation{Game Forcing-(ODw)}}%
    }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{gf-(ODw)}}%
        {\GetTranslation{game forcing-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Game Forcing
%
\def\GF{\gforce*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\sforce}
% \begin{macro}{\SF}
%    \begin{macrocode}
\NewDocumentCommand{\sforce}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{SF-(ODw)}}%
        {\GetTranslation{Semi Forcing-(ODw)}}%
    }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{sf-(ODw)}}%
        {\GetTranslation{semi forcing-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Semi Forcing
%
\def\SF{\sforce*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\nmforce}
% \begin{macro}{\NMF}
%    \begin{macrocode}
\NewDocumentCommand{\nmforce}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{NMF-(ODw)}}%
        {\GetTranslation{New Minor Forcing-(ODw)}}%
    }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{nmf-(ODw)}}%
        {\GetTranslation{new minor forcing-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% New Minor Forcing
%
\def\NMF{\nmforce*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\tsforce}
% \begin{macro}{\TSF}
%    \begin{macrocode}
\NewDocumentCommand{\tsforce}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{TSF-(ODw)}}%
        {\GetTranslation{Third Suit Forcing-(ODw)}}%
    }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{tsf-(ODw)}}%
        {\GetTranslation{third suit forcing-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Third Suit Forcing
%
\def\TSF{\tsforce*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\fsforce}
% \begin{macro}{\FSF}
%    \begin{macrocode}
\NewDocumentCommand{\fsforce}{s t!}{%
  \bgroup%
    \ODw@OtherFont%
    \IfBooleanTF{#1}{%
      \IfBooleanTF{#2}%
        {\GetTranslation{FSF-(ODw)}}%
        {\GetTranslation{Fourth Suit Forcing-(ODw)}}%
    }{%
      \IfBooleanTF{#2}%
        {\GetTranslation{fsf-(ODw)}}%
        {\GetTranslation{fourth suit forcing-(ODw)}}%
    }%
  \egroup%
  \xspace%
}% Fourth Suit Forcing
%
\def\FSF{\fsforce*!}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Initialization}\label{Init}
%
% It's time to prepare everything. We clear the game and set the defaults.
%    \begin{macrocode}
\newgame
%    \end{macrocode}
% Set the default fonts
%    \begin{macrocode}
\setdefaults{bidder=\mdseries\sffamily}
\setdefaults{compass=\mdseries\sffamily}
\setdefaults{game=\bfseries\sffamily}
\setdefaults{legend=\mdseries\rmfamily}
\setdefaults{name=\mdseries\slshape}
\setdefaults*{other=\bfseries\sffamily}
%    \end{macrocode}
%
% Set default coloring to black and red
%    \begin{macrocode}
\setdefaults{colors=b+r}
%    \end{macrocode}
%
% Set the compass
%    \begin{macrocode}
\setdefaults{compshow=on,compturn=off}
%    \end{macrocode}
% set the start column for bidding (West is recommended) and the long form.
%    \begin{macrocode}
\setdefaults{bidfirst=W,bidders=on,bidlong=on}
%    \end{macrocode}
% Now we load the dictionaries for the languages that are to be used in
% the document. We use \packname{tracklang} to iterate over all the
% document languages and load the corresponding |ODw|-dictionaries. Due to
% an inconsistency between \packname{babel} and \packname{translations}
% with respect to the Norwegian language (\packname{babel} calls this
% language \emph{norsk} whereas \packname{translations} insist on using
% \emph{norwegian}, we redefine |\thislang| to the latter if it happens to
% be \emph{norsk}.
%    \begin{macrocode}
\AtBeginDocument{%
\ForEachTrackedLanguage{\thislang}{%
  \ifthenelse{\equal{\thislang}{norsk}}%
    {\def\thislang{norwegian}}{}%
  \IfFileExists{ODw-\thislang.trsl}%
  {%
    \LoadDictionaryFor{\thislang}{ODw}%
    \PackageInfo{ODw}{%
      Translation dictionary ODw-\thislang.trsl loaded%
    }%
  }{%
    \PackageWarning{ODw}{%
      Translation dictionary ODw-\thislang.trsl not found%
    }%
  }%
}% ForEach
}% AtBeginDocument
%    \end{macrocode}
% That's it folks, happy \TeX ing!
%    \begin{macrocode}
\endinput% onedown.sty
%    \end{macrocode}

%
% \iffalse
%</package>
% \fi
%
% \Finale
% \begin{thebibliography}{Laan}
% \bibitem{Laan} Kees van der Laan:
%   \emph{Typsetting Bridge via \TeX},
%   TUGboat Vol.~11, No.~2 (1990), p265ff
%
% \bibitem{Pav} Richard Pavlicek:
%   \emph{Bridge Writing Style Guide},
%   \url{http://www.rpbridge.net/7z69.htm}
% \end{thebibliography}
%
% \PrintChanges
% \newpage
% \PrintIndex
% \ifnumequal{\pdfshellescape}{1}{%
%   \newpage
%   \enlargethispage{1\baselineskip}
%   \immediate\closeout\UCFile
%   \begin{multicols}{3}[\section{List of User Commands}]
%
%     \IfFileExists{\jobname.odw}
%        {\noindent\input{\jobname.odw}}
%        {\PackageWarning{ODw}{File \jobname.odw not found}}
%   \end{multicols}
% }{}
\endinput