1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
|
% \iffalse
%% Style file `arydshln'
%% Copyright (C) 1993,1998-2004
%% Hiroshi Nakashima <nakasima'AT'tutics'DOT'tut'DOT'ac'DOT'jp>
%% (Kyoto Univ. / Toyohashi Univ. of Tech.)
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
% \fi
%
% \CheckSum{3605}
%% \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 \~}
%%
% \iffalse
%%
%<*dtx>
\ProvidesFile{arydshln.dtx}
%</dtx>
%<package>\def\next{LaTeX2e}
%<package>\ifx\fmtname\next\def\next{
%<package>\NeedsTeXFormat{LaTeX2e}[1994/12/01]
%<package>\ProvidesPackage{arydshln}}
%<package>\else\def\next[#1]{}\fi\next
%<driver>\ProvidesFile{arydshln-man.tex}
% \fi
% \ProvidesFile{arydshln.dtx}
[2004/08/31 v1.71 ]
%
% \iffalse
%<*driver>
\documentclass{ltxdoc}
\usepackage{arydshln}
\DisableCrossrefs
\PageIndex
\CodelineNumbered
\RecordChanges
%</driver>
%<driver>\OnlyDescription
%<driver>\def\ONLYDESCRIPTION{}
%<*driver>
\advance\textwidth4em
\begin{document}
\DocInput{arydshln.dtx}
\end{document}
%</driver>
% \fi
% \MakeShortVerb{\|}
% \GetFileInfo{arydshln.dtx}
% \IndexPrologue{\section*{Index}}
% \setcounter{IndexColumns}{2}
% \def\th{^{\it th}}
% \def\LOR{{\ {\lor}\ }}
% \def\LAND{{\ {\land}\ }}
% \let\togets\leftrightarrow
% \let\epsilon\varepsilon
% \def\cs#1{\hbox{\tt\char\escapechar#1}}
%
% \makeatletter
% \def\Meta#1{\penalty\@highpenalty \hbox{{\tt\char`\{}\meta{#1}{\tt\char`\}}}}
%
% \def\eqnarray{\stepcounter{equation}\let\@currentlabel=\theequation
% \global\@eqnswtrue
% \global\@eqcnt\z@\tabskip\@centering\let\\=\@eqncr
% $$\halign to \displaywidth\bgroup\hskip\@centering
% $\displaystyle\tabskip\z@{##}$\@eqnsel&\global\@eqcnt\@ne
% \hfil$\;{##}\;$\hfil
% &\global\@eqcnt\tw@ $\displaystyle\tabskip\z@{##}$\hfil
% \tabskip\@centering&\llap{##}\tabskip\z@\cr}
%
% \let\latex@addmarginpar\@addmarginpar
% \let\latex@latex@warning@no@line\@latex@warning@no@line
% \def\@addmarginpar{\let\@latex@warning@no@line\@gobble
% \latex@addmarginpar
% \let\@latex@warning@no@line\latex@latex@warning@no@line}
% \let\@font@warning\@gobble
%
% \long\def\m@cro@#1#2{\endgroup \topsep\MacroTopsep \trivlist
% \edef\saved@macroname{\string#2}
% \def\makelabel##1{\llap{##1\hskip\@totalleftmargin}}
% \if@inlabel
% \let\@tempa\@empty \count@\macro@cnt
% \loop \ifnum\count@>\z@
% \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m@ne \repeat
% \edef\makelabel##1{\llap{\vtop to\baselineskip
% {\@tempa\hbox{##1}\vss}
% \hskip\@totalleftmargin}}
% \advance \macro@cnt \@ne
% \else \macro@cnt\@ne \fi
% \edef\@tempa{\noexpand\item[
% #1
% \noexpand\PrintMacroName
% \else
% \noexpand\PrintEnvName
% \fi
% {\string#2}]}
% \@tempa
% \global\advance\c@CodelineNo\@ne
% #1
% \SpecialMainIndex{#2}\nobreak
% \DoNotIndex{#2}
% \else
% \SpecialMainEnvIndex{#2}\nobreak
% \fi
% \global\advance\c@CodelineNo\m@ne
% \ignorespaces}
%
% \def\DescribeOpt{\leavevmode\@bsphack\begingroup\MakePrivateLetters
% \Describe@Opt}
% \def\Describe@Opt#1{\endgroup \Describe@pt{#1}}
% \def\Describe@pt#1#2{
% \marginpar{\raggedleft\PrintDescribeMacro{#1}}
% \SpecialOptUsageIndex{#1}{#2}}
% \def\SpecialOptUsageIndex#1#2{
% \index{#1\actualchar{\protect\ttfamily#1} (#2)\encapchar usage}
% \index{#2s:\levelchar{\protect\ttfamily#1}\encapchar usage}
% \@esphack\ignorespaces}
% \def\SpecialOptMainIndex#1#2{
% \index{#1\actualchar{\protect\ttfamily#1} (#2)\encapchar main}
% \index{#2s:\levelchar{\protect\ttfamily#1}\encapchar main}
% \@esphack\ignorespaces}
% \def\SpecialOptIndex#1#2{
% \index{#1\actualchar{\protect\ttfamily#1} (#2)}
% \index{#2s:\levelchar{\protect\ttfamily#1}}
% \@esphack\ignorespaces}
% \def\SpecialOptIndexS#1#2{
% \index{#1\actualchar{\protect\ttfamily#1} (#2)}
% \index{#2es:\levelchar{\protect\ttfamily#1}}
% \@esphack\ignorespaces}
%
% \def\SpecialMainIndex#1{\@bsphack
% \RemoveAtFromCS{#1}
% \protected@edef\@tempa{\noexpand\special@index{\RAFCtempa
% \actualchar \string\verb
% \quotechar*\verbatimchar\string#1\verbatimchar
% \encapchar main}}\@tempa
% \@esphack}
%
% \def\SpecialIndex#1{\@bsphack
% \RemoveAtFromCS{#1}
% \protected@edef\@tempa{\noexpand\special@index{\RAFCtempa
% \actualchar \string\verb
% \quotechar*\verbatimchar\string#1\verbatimchar}}\@tempa
% \@esphack}
%
% \def\Macro{\begingroup \@sanitize \iMacro}
% \def\iMacro#1{\endgroup
% \def\SpecialMainIndex##1{\SWiIndex{##1}{\encapchar main}}
% \macro{#1}}
% \let\endMacro\endmacro
%
% \def\SpecialWeirdIndex{\@bsphack \begingroup \@sanitize \SWIndex{}}
% \def\SWIndex#1#2{\endgroup \SWiIndex{#2}{#1}}
% \def\SWiIndex#1#2{%
% \protected@edef\@tempa{\noexpand\special@index{
% #1\actualchar \string\verb
% \quotechar*\verbatimchar#1\verbatimchar#2}}\@tempa
% \@esphack}
%
% \let\RAFCempty\@empty
% \let\RAFCgobble\@gobble
% \makeatother
% \def\RemoveAtFromCS#1{\edef\RAFCtempa{\expandafter\RAFCgobble\string#1}
% \edef\RAFCtempa{\expandafter\string\csname\RAFCtempa\endcsname}
% \expandafter\iRemoveAtFromCS\RAFCtempa@\NIL}
% \def\iRemoveAtFromCS#1#2@#3\NIL{\def\RAFCtempb{#3}
% \ifx\RAFCtempb\RAFCempty \def\RAFCtempa{#2}\let\next\relax
% \else \def\RAFCtempa{#2@}\def\next{\iiRemoveAtFromCS#3\NIL}
% \def\RAFCtempb{#2}
% \ifx\RAFCtempb\RAFCempty
% \else\ifx\RAFCtempb\CommonCSPrefix
% \else\ifx\RAFCtempb\CommonIfPrefix
% \else \def\RAFCtempa{}\def\next{\xRemoveAtFromCS#2@#3\NIL}\fi\fi\fi\fi
% \next}
% \def\iiRemoveAtFromCS#1{\ifx#1@\edef\RAFCtempa{\RAFCtempa@}
% \let\next\iiRemoveAtFromCS
% \else \def\next{\xRemoveAtFromCS#1}\fi
% \next}
% \def\xRemoveAtFromCS#1@\NIL{\edef\RAFCtempa{#1\RAFCtempa}}
% \makeatletter
%
% \begingroup
% \gdef\@sverbcat{\catcode`\@\active\catcode`\#\active}
% \catcode`\@\active \gdef@{\char`\@\penalty\exhyphenpenalty}
% \catcode`\#\active \gdef#{\penalty\exhyphenpenalty}
% \endgroup
% \let\latex@sverb\@sverb
% \def\@sverb{\@sverbcat\latex@sverb}
%
% \newcount\ChangesCounter \ChangesCounter10000
% \def\changes@#1#2#3{\global\advance\ChangesCounter\@ne
% \protected@edef\@tempa{\noexpand\glossary{#1\levelchar
% x\number\ChangesCounter
% \ifx\saved@macroname\@empty
% \actualchar\generalname
% \else
% \expandafter\@gobble\saved@macroname
% \actualchar \string\verb
% \quotechar*\verbatimchar \saved@macroname
% \verbatimchar
% \fi
% :\levelchar #3}}\@tempa\endgroup\@esphack}
% \def\theglossary{\onecolumn \glossary@prologue
% \GlossaryParms \let\item\@idxitem \ignorespaces}
% \def\endtheglossary{\relax}
%
% \makeatother
% \errorcontextlines1000
%
%
%
% \changes{v1.0}{1993/04/01}
% {The style was born on a good day \ldots}
% \changes{v1.05}{1993/06/18}
% {Cope with \texttt{\char`\\\char`\\} with negative optional
% vertical space.}
% \changes{v1.1}{1993/06/24}
% {Save and restore the \texttt{\char`\\catcode} for
% `\texttt{@}'.}
% \changes{v1.2-1}{1998/07/16}
% {Add this document.}
% \changes{v1.2-2}{1998/07/16}
% {Cope with \protect\LaTeXe.}
% \changes{v1.2-3}{1998/07/16}
% {Allow mixture of vertical solid- and dash-lines.}
% \changes{v1.2-4}{1998/07/16}
% {Add the feature of explicit dash/gap specification.}
% \changes{v1.2-5}{1998/07/16}
% {Fix some bugs and change codes.}
% \changes{v1.4-1}{1999/06/25}
% {Make compatible with array package and add new features.}
%
% \changes{v1.4-2}{1999/06/25}
% {The following are changes of this document.}
%
% \changes{v1.4-3-1}{1999/06/25}
% {The following are for the general compatibility with \textsf{array}.}
% \changes{v1.4-3-2}{1999/06/25}
% {The following are to control the effective width of vertical lines.}
% \changes{v1.4-3-3}{1999/06/25}
% {The following are for inactivation of dash-line functions.}
% \changes{v1.4-3-4}{1999/06/25}
% {The following are for drawing mode to cope with the bug of
% \cs{xlearders}.}
% \changes{v1.4-3-5}{1999/06/25}
% {The following are to implement dashed version of \cs{firsthline}
% and \cs{lasthline} of \textsf{array}.}
% \changes{v1.4-3-6}{1999/06/25}
% {The following are to fix the bug by which the depth of
% \texttt{array}\slash\texttt{tabular} was always zero.}
% \changes{v1.4-3-7}{1999/06/25}
% {The following are to rename macros for \cs{cdashline}.}
% \changes{v1.4-3-8}{1999/06/25}
% {The following are to cope with very narrow or negative wide columns.}
% \changes{v1.4-4}{2000/07/04}
% {Released to CTAN.}
%
% \changes{v1.5-1}{2000/07/12}
% {The following are for the compatibility with \textsf{colortab}.}
% \changes{v1.5-2}{2002/06/26}
% {The following are for bug fix of \cs{adl@putlrc}.}
% \changes{v1.5-3}{2003/07/11}
% {The following are for bug fix of \cs{adl@inactivate}.}
% \changes{v1.54-1}{2003/08/25}
% {The following are for bug fix of \cs{adl@@vl}.}
% \changes{v1.54-2}{2003/08/25}
% {The following are for bug fix of activation.}
% \changes{v1.54-3}{2003/08/25}
% {The following are miscellaneous modifications.}
%
% \changes{v1.6-1}{2003/08/25}
% {The following are for the compatibility with \textsf{longtable}.}
%
% \changes{v1.7}{2003/05/21}
% {The following are for the compatibility with \textsf{colortbl}.}
% \changes{v1.7-1}{2004/5/21}
% {The following are for null-wide horizontal lines.}
% \changes{v1.7-2}{2004/5/21}
% {The following are to fix the bug of \cs{arrayrulecolor} etc. in
% \textsf{colortbl}.}
% \changes{v1.7-3}{2004/5/21}
% {The following are for vertical line coloring.}
%
% \changes{v1.71-1}{2004/7/31}
% {The following are for bug fix for \textsf{array}'s
% \texttt{m}-columns.}
%
%
% \def\EXCLAMATION{\texttt{!}}
% \def\VERTBAR{\texttt{\char`\|}}
% \edef\CommonCSPrefix{\expandafter\RAFCgobble\string\adl}
% \edef\CommonIfPrefix{\expandafter\RAFCgobble\string\ifadl}
%
% \title{The \textsf{arydshln} package\thanks{
% This file has version number \fileversion, last revised \filedate.}}
% \author{Hiroshi Nakashima\\(Toyohashi Univ. of Tech.)}
% \date{\filedate}
% \maketitle
%
% \begin{abstract}
% This file gives \LaTeX's |array| and |tabular| environments the capability
% to draw horizontal\slash vertical dash-lines.
% \end{abstract}
%
% \tableofcontents
% \newpage
%
%
%
% \section{Introduction}
% \label{sec:intro}
%
% In January 1993, Weimin Zhang kindly posted a style \textsf{hvdashln}
% written by the author, which draws horizontal\slash vertical dash-lines in
% \LaTeX's |array| and |tabular| environments, to the news group
% \textsf{comp.text.tex}. The style, unfortunately, has a known problem
% that vertical lines are broken when an array contains tall rows.
%
% In March of the year, Monty Hayes complained of this problem encouraging
% the author to make a new version \textsf{arydshln} to solve the problem.
% The new style also has new features, such as allowing `|:|' to specify
% vertical dash-line in preamble, and |\cdashline| being a counterpart of
% |\cline|.
%
% \changes{v1.4-2}{1999/06/25}
% {The history on the compatibility with \textsf{array} package.}
% In March 1999, Sebastian Rahtz kindly invited the style, which had been
% improved following the bug report from Takahiro Kubota, to be included in
% \TeX{} CTAN and also in the online catalogue compiled by Graham Williams.
% This invitation gave the style new users including Peter Ehrbar who wished
% to use it with \textsf{array} style in Standard \LaTeX{} Tools Bundle and
% had trouble because these styles were incompatible with each other.
% Therefore, the style became compatible with \textsf{array} and got
% additional new features.
%
% \changes{v1.5-1}{2000/7/12}
% {The history on the compatibility with \textsf{colortab} package.}
% In February 2000, Zsuzsanna Nagy reported that \textsf{arydshln} is not
% compatible with \textsf{colortab} style to let the author work on the
% compatibility issue again.
%
% \changes{v1.6-1}{2003/8/25}
% {The history on the compatibility with \textsf{longtable} package.}
% In Feburary 2001, Craig Leech reported another compatibility problem with
% \textsf{longtable}. Although the author promised that the problem would
% be attacked some day, the issue had left long time\footnote{
%
% Two years and a half! Sorry Craig.}
%
% until three other complaints. Then the author attacked the problem hoping
% it is the last compatibility issue\footnote{
%
% But his hope was dashed as described below.}.
%
% \changes{v1.7}{2004/5/21}
% {The history on the compatibility with \textsf{colortbl} package.}
% In May 2004, Klaus Dalinghaus found another incompatibility with
% \textsf{colortbl}. Although he was satisfied by a quick hack for cell
% painting, the author attacked a harder problem for line
% coloring to solve the problem\footnote{
%
% Without dreaming it is the last compatibility issue.}.
%
%
%
% \section{Usage}
% \label{sec:usage}
% \subsection{Loading Package}
% \label{sec:usage-load}
%
% \changes{v1.4-2}{1999/06/25}
% {Explanation of package loading is added.}
%
% The package is usable to both \LaTeXe{} and \LaTeX-2.09 users with their
% standard package loading declaration. If you use \LaTeXe, simply do the
% following.
% \begin{quote}
% \SpecialUsageIndex{\usepackage}
% |\usepackage{arydshln}|
% \end{quote}
% If you still love \LaTeX-2.09, the following is what you have to do.
% \begin{quote}
% \SpecialUsageIndex{\documentstyle}
% |\documentstyle[..,arydshln,...]|\Meta{style}
% \end{quote}
%
% \changes{v1.5-1}{2000/7/12}
% {Caution about loading order of \textsf{colortab} is added.}
% \changes{v1.6-1}{2003/8/25}
% {Caution about loading order of \textsf{longtable} is added.}
% \changes{v1.7}{2004/5/21}
% {Caution about loading order of \textsf{colortbl} is added.}
% \SpecialOptIndex{array}{package}
% \SpecialOptIndex{colortab}{package}
% \SpecialOptIndex{longtable}{package}
% \SpecialOptIndex{colortbl}{package}
%
% Only one caution given to users of \textsf{array} (v2.3m or later) and
% \textsf{longtable} (v4.10 or later) packages, included in Standard \LaTeX{}
% Tools Bundle, and \textsf{colortab} and \textsf{colortbl} package is that
% \textsf{arydshln} has to be loaded {\em after} \textsf{array},
% \textsf{longtable}, \textsf{colortab} and/or \textsf{colortbl} done. That
% is, the following is correct but reversing the order of |\usepackage| will
% cause some mysterious error.
%
% \begin{quote}
% |\usepackage{array} % and/or|\\
% |\usepackage{longtable} % and/or|\\
% |\usepackage{colortab} % or|\\
% |\usepackage{colortbl}|\\
% |\usepackage{arydshln}|
% \end{quote}
%
%
%
% \subsection{Basic Usage}
% \label{sec:usage-basic}
%
% \DescribeEnv{array}\DescribeEnv{tabular}
% \SpecialIndex{\hline}
% \SpecialIndex{\cline}
% \SpecialIndex{\multicolumn}
% You can simply use |array| or |tabular(*)| environments with standard
% preamble, such as \verb!{r|c|ll}!, and standard commands |\\|, |\hline|,
% |\cline| and |\multicolumn|.
%
% \leavevmode\marginpar{\raggedleft\PrintDescribeMacro{:}}
% \index{:={\protect\ttfamily:}|usage}
% Drawing a vertical dash-line is quite simple. Use `|:|' in the preamble
% as the separator of columns separated by the dash-line, just like using
% `\verb!|!' to draw a vertical solid-line. The {\em preamble} means not
% only that of the environment, but also the first argument of
% |\multicolumn|.
%
% \DescribeMacro{\hdashline}\DescribeMacro{\cdashline}
% \changes{v1.4-2}{1999/06/25}
% {Description of \cs{first}\slash\texttt{lasthdashline} is added.}
% It is also simple to draw a horizontal dash-line. Use |\hdashline| and
% |\cdashline| as the counterparts of |\hline| and |\cline|.
%
% For example;
%
%\begin{quote}
%\begin{verbatim}
%\begin{tabular}{|l::c:r|}\hline
%A&B&C\\\hdashline
%AAA&BBB&CCC\\\cdashline{1-2}
%\multicolumn{2}{|l:}{AB}&C\\\hdashline\hdashline
%\end{tabular}
%\end{verbatim}
%\end{quote}
%
% will produce the following result.
%
%\begin{quote}
%\catcode`\|12
%\begin{tabular}{|l::c:r|}\hline
%A&B&C\\\hdashline
%AAA&BBB&CCC\\\cdashline{1-2}
%\multicolumn{2}{|l:}{AB}&C\\\hdashline\hdashline
%\end{tabular}
%\end{quote}
%
% \DescribeMacro{\firsthdashline}\DescribeMacro{\lasthdashline}
% If you use \textsf{array}, the dashed version of |\firsthline| and
% |\lasthline| named |\first#hdash#line| and |\lasthdashline| are available.
%
%
%
% \subsection{Style Parameters}
% \label{sec:usage-par}
%
% \DescribeMacro{\dashlinedash}\DescribeMacro{\dashlinegap}
% You have two style parameters to control the shape of dash-lines:
% |\dashlinedash| is for the length of each dash segment in a dash line;
% |\dashlinegap| controls the amount of each gap between dash segments.
% Both parameters have a common default value, 4\,pt.
%
%
%
% \subsection{Fine Tuning}
% \label{sec:usage-fine}
%
% \leavevmode\marginpar{\raggedleft\PrintDescribeMacro{;}}
% \index{;={\protect\ttfamily;}|usage}
% Although you can control the shape of dash-lines in an
% |array|\slash|tabular| environment as described in \S\ref{sec:usage-par},
% you might want to draw a dash-line of a shape different from others. To
% specify the shape of a vertical dash-line explicitly, you may use;
%
% \begin{quote}
% |;{|\meta{dash}|/|\meta{gap}|}|
% \end{quote}
%
% instead of ordinary `|:|' and will have a dash-line with dash segments of
% \meta{dash} long separated by spaces of \meta{gap}.
%
% \DescribeMacro{\hdashline}\DescribeMacro{\cdashline}
% As for horizontal dash-lines, explicit shape specifications may be given
% through optional arguments of |\hdashline| and |\cdashline| as follows.
%
% \begin{quote}
% |\hdashline[|\meta{dash}|/|\meta{gap}|]|\\
% |\cdashline{|\meta{col1}|-|\meta{col2}|}[|\meta{dash}|/|\meta{gap}|]|
% \end{quote}
%
%
% For example;
%
%\begin{quote}
%\begin{verbatim}
%\begin{tabular}{|l::c;{2pt/2pt}r|}\hline
%A&B&C\\\hdashline[1pt/1pt]
%AAA&BBB&CCC\\\cdashline{1-2}[.4pt/1pt]
%\multicolumn{2}{|l;{2pt/2pt}}{AB}&C\\\hdashline\hdashline
%\end{tabular}
%\end{verbatim}
%\end{quote}
%
% will produce the following result.
%
%\begin{quote}
%\catcode`\|12
%\begin{tabular}{|l::c;{2pt/2pt}r|}\hline
%A&B&C\\\hdashline[1pt/1pt]
%AAA&BBB&CCC\\\cdashline{1-2}[.4pt/1pt]
%\multicolumn{2}{|l;{2pt/2pt}}{AB}&C\\\hdashline\hdashline
%\end{tabular}
%\end{quote}
%
% \changes{v1.4-2}{1999/06/25}
% {Description of the real width of vertical lines is added.}
%
% \DescribeMacro{\ADLnullwide}
% \DescribeMacro{\ADLsomewide}
% \SpecialIndex{\arrayrulewidth}
%
% The vertical solid and dashed lines are drawn as if their width is zero, as
% standard \LaTeX's |array| and |tabular| do, if you don't use
% \textsf{array} package. Otherwise, they have {\em real} width of
% |\arrayrulewidth| as the authors of \textsf{array} prefers. However, you
% may explicitly tell \textsf{arydshln} to follow your own preference by
% |\ADLnullwide| if you love \LaTeX{} standard, or |\ADLsomewide| if
% you second the preference of \textsf{array} authors.
%
%
%
% \subsection{Finer Tuning}
% \label{sec:usage-finer}
%
% \changes{v1.4-2}{1999/06/25}
% {Description of drawing mode is added.}
% To draw dash-lines, we use a powerful primitive of \TeX{} called |\xleaders|.
% It replicates a segment that consist of a dash and gap so that a dash-line
% has as many segments as possible and distributes {\it remainder} space to
% make the spaces between adjacent dash segments (almost) equal to each
% other. Therefore, you will have dash-lines with consistent steps of gaps
% and spaces as the left and upper lines in Figure~\ref{fig:mode}(1) are.
%
% \begin{figure}[b]
% \catcode`\|12
% \tabcolsep0pt \setbox\strutbox\hbox{\vrule height14pt depth6pt width0pt}
% \def\mb{\makebox[20pt]}
% \dashlinedash3.01pt \dashlinegap3.01pt
% \def\example#1{\begin{tabular}[b]{|c:c;{2pt/2pt}c|}
% \hline\noalign{\vskip-\arrayrulewidth}
% \mb{A}&\mb{A}&\mb{A}\\[-\arrayrulewidth]\hdashline
% \mb{B}&\mb{B}&\mb{B}\\[-\arrayrulewidth]\hdashline[2pt/2pt]
% \mb{C}&\mb{C}&\mb{C}\\[-\arrayrulewidth]\hline
% \multicolumn3c{(#1)}
% \end{tabular}}
%
% \centerline{\example1\qquad
% \ADLdrawingmode{2}\example2\qquad
% \ADLdrawingmode{3}\example3}
% \caption{Drawing mode controlled by \cs{ADLdrawingmode}}
% \label{fig:mode}
% \end{figure}
%
% However, because of a bug (or buggy feature) of |\xleaders|, there is a
% small possibility that a dash segment near the right\slash bottom end
% drops as right and lower lines in (1) of the figure shows. To cope with this
% problem, you may change the {\it drawing mode} by
% |\ADLdrawingmode|\Meta{$m$} as follows.
%
% \begin{itemize}
% \item $m=1$
% \DescribeMacro{\ADLdrawingmode}\\
% As shown in Figure~\ref{fig:mode}(1), most beautiful in almost all cases
% as the left/upper lines, but has a small possibility to produce an ugly
% result as right/lower lines. This is default.
%
% \item $m=2$\\
% As shown in (2) of the figure, beautiful if dash-lines are not so sparse
% as right/lower lines, but dash segments near the both ends may be a little
% bit too long as left/upper lines.
%
% \item $m=3$\\
% As shown in (3) of the figure, beautiful if dash-lines are not so sparse
% as right/lower lines, but gaps near the both ends may be considerably too
% large as left/upper lines.
% \end{itemize}
%
% It is recommended to use default mode 1 unless you have an ugly result
% in the final version of your manuscript, because the correctness of mode 1
% is very sensitive to the length of dash-lines.
%
%
%
% \subsection{Performance Tuning}
% \label{sec:usage-performance}
%
% \changes{v1.4-2}{1999/06/25}
% {Description of (in)activation is added.}
%
% Since drawing dash-lines is a hard job, you have to be patient with the
% fact that the performance of typesetting |array|\slash|tabular| with
% dash-lines is poorer than that of ordinary ones. In fact, according to
% author's small performance evaluation with a |tabular| having nine
% vertical and ten horizontal dash-lines, typesetting the |tabular| is
% approximately ten times as slow as its ordinary counterpart with solid
% lines.
%
% However, this is not a really bad news, unfortunately. The real one is
% that loading \textsf{arydshln} makes typesetting |array|\slash|tabular|
% slower even if they only have solid lines which the package treats as
% special ones of dash-lines. The evaluation result shows the degradation
% factor is about nine. Therefore, if your document has many
% |array|\slash|tabular| with solid lines, \LaTeX{} will run slowly even
% with quite few (or no) |array|\slash|tabular| with dash-lines,
%
% \DescribeMacro{\ADLinactivate}
% To cope with this problem, you may inactivate dash-line functions by the
% command |\ADLinactivate| that replaces dash-lines with solid
% lines drawn by a faster (i.e. ordinary) mechanism. Although the
% inactivation does not completely solve the performance problem, the
% degradation factor will become much smaller and acceptable, approximately
% 1.5 in the author's evaluation. For example, the draft version of your
% document will have the command in its preamble, which you will remove from
% your final version.
%
% \DescribeMacro{\ADLactivate}
% Alternatively, you may do |\ADLinactivate| in the preamble, switch on by
% |\ADLactivate| before you really need dash-lines, and switch off again
% afterword. A wiser way could be surrounding |array|\slash|tabular| by
% |\begin{ADLactivate}| and |\end{ADLactivate}|.
%
% \DescribeEnv{Array}
% \DescribeEnv{Tabular}
% If you feel it tiresome to type the long command\slash environment name for
% the activation, you may use |Array| and |Tabular(*)| environment in which
% dash-line functions are always active. Note that, however, since these
% environment names are too natural to keep them from being used by authors
% of other packages or yourself, name conflict could occur. If |Array|
% and/or |Tabular| have already been defined when \textsf{arydshln} is
% loaded, you will get a warning to show you have to define new
% environments, say |dlarray| and |dltabular|, as follows.
%
% \begin{itemize}\item[]
% |\newenvironment{dlarray}{\ADLactivate\begin{array}}%|\\
% | {\end{array}}|\\
% |\newenvironment{dltabular}{\ADLactivate\begin{tabular}}%|\\
% | {\end{tabular}}|\\
% |\newenvironment{dltabular*}{\ADLactivate\begin{tabular*}}%|\\
% | {\end{tabular*}}|
% \end{itemize}
%
% \begingroup
% \let\PDM\PrintDescribeMacro
% \def\PrintDescribeMacro#1{\leavevmode\llap{\PDM{#1}}}
% \DescribeMacro{\ADLnoshorthanded}
% On the other hand, if they are defined after \textsf{arydshln} is loaded,
% their definitions are silently replaced or \LaTeX{} complains of multiple
% definitions. The error in the latter case will be avoided by putting
% |\ADLnoshorthanded| just after |\usepackage{arydshln}|.
% \par
% \endgroup
%
%
%
% \subsection{Compatibility with Other Packages}
% \label{sec:usage-compat}
%
% \changes{v1.5-1}{2000/07/12}
% {Section 2.7 is added.}
% \changes{v1.4-2}{1999/06/25}
% {Description of characters and commands of \textsf{array} package is
% added.}
% \SpecialOptIndex{array}{package}
% \SpecialIndex{\extrarowheight}
% \SpecialIndex{\firsthline}
% \SpecialIndex{\lasthline}
% \SpecialIndex{\newcolumntype}
%
% Users of \textsf{array} package may use all of newly introduced
% preamble characters, such as `|>|', `|<|', `|m|', `|b|', and all the
% commands such as |\extrarowheight|, |\firsthilne| and |\lasthline|. The
% preamble characters given by \textsf{arydshln} may be included in the
% second argument of |\newcolumntype|.
%
% \changes{v1.5-1}{2000/07/12}
% {Description of \textsf{colortab} commands is added.}
% \SpecialOptIndex{colortab}{package}
% \SpecialIndex{\LCC}
% \SpecialIndex{\NAC}
% \SpecialIndex{\ENAC}
% \SpecialIndex{\AC}
% \SpecialIndex{\EAC}
%
% Also users of \textsf{colortab} package may use |\LCC|\slash |\ECC|
% construct to color columns. A horizontal solid\slash dash line may be
% colored by, e.g.\ |\NAC\hdashline\ENAC|\@. The pair of |\AC| and |\EAC| may
% be used to color everything between them {\em but}, unfortunately,
% vertical lines are not. There are no ways to color vertical lines in a
% table having dash lines. You may color vertical lines of a ordinary table
% inactivating dash line functions by |\ADLinactivate|.
%
% \changes{v1.7}{2004/5/21}
% {Description of \textsf{colortbl} and related commands is added.}
% \SpecialOptIndex{colortbl}{package}
% \SpecialIndex{\rowcolor}
% \SpecialIndex{\columncolor}
% \SpecialIndex{\cellcolor}
% \SpecialIndex{\arrayrulecolor}
% \SpecialIndex{\doublerulesepcolor}
%
% Another (and more convenient) table coloring tool \textsf{colortbl} may be
% also used simply by loading it before \textsf{arydshln}. Not only the
% painting commands |\rowcolor|, |\columncolor| and |\cellcolor| work well,
% but both solid and dash lines are also colored by the command
% |\arrayrulecolor| of \textsf{colortbl}\footnote{
%
% The \textsf{colortbl} manual says \cs{arrayrulecolor} and
% \cs{doublerulesepcolor} may be in \texttt{>\char`\{\ldots\char`\}}
% in a preamble but they cause an error with the original implementation.
% This bug is fixed in \textsf{arydshln} and they are now usable to specify
% the color of the vertical (dash) lines whose specifications occur after
% the commands.}.
%
% One caution is that |\arrayrulecolor| defines the color of the dash-part
% of dash lines and thus gap-part has no color (i.e. color of the paper on
% which the line drawn). Therefore, if you have a \textsf{tabular} like;
%
%\begin{quote}
%\begin{verbatim}
%\begin{tabular}{|>{\columncolor{red}}l:>{\colomncolor{green}}r|}
%...
%\end{tabular}
%\end{verbatim}
%\end{quote}
%
% you will find the vertical dash line is a sequence of black (or the color of
% |\arrayrulecolor|) and white segments. This problem is partly solved by
% declaring |\ADLnullwide|\footnote{
%
% Since \textsf{colortbl} automatically loads \textsf{array}, the default is
% \cs{ADLsomewide}}
%
% to conjunct the red and blue columns and to draw the dash line on their
% border.
%
% \DescribeMacro{\ADLnullwidehline}
% \DescribeMacro{\ADLsomewidehline}
% Unfortunately, however, |\ADLnullwide| does not affect the real
% width of horizontal (dash) lines and thus you will still see white gaps
% in |\hdashline| and |\cdashline|. A solution is to put
% |\ADLnullwidehline| before you start a
% \texttt{array}\slash\texttt{tabular}\footnote{
%
% This command also makes \cs{cline} and \cs{cdashline} visisble even if the
% row below is painted.}.
%
% With this command, a horizontal (dash) line is drawn adjusting its bottom
% edge to that of the row above. The command |\ADLsomewidehline| turns the
% switch to default and the top edge of a horizontal (dash) line will be
% adjusted to the bottom edge of the row above.
%
% \DescribeMacro{\dashgapcolor}
% \DescribeMacro{\nodashgapcolor}
% \SpecialIndex{\color}
% Another method to avoid white gaps is to give a color to gaps by
% |\dashgapcolor| with arguments same as |\color|. For example;
%
% \begin{quote}
% |\arrayrulecolor{green}\dashgapcolor[rgb]{1,1,0}|
% \end{quote}
%
% makes colorful dash lines with green dashes and yellow gaps. The command
% can be placed outside of \texttt{array}\slash\texttt{tabular} for dash
% lines in the environment, in the argument of preamble character |>|
% for vertical dash lines following them, or at the beginning of a row for
% horizontal dash lines following the command. The commmand
% |\nodashgapcolor| (no arguments) nullifies the effect of |\dashgapcolor|.
% Note that |\nodashgapcolor| is different from |\dashgapcolor{white}|
% because the former makes gaps {\it transparent} while the later whiten them.
%
% \DescribeEnv{longtable}
% \DescribeEnv{Longtable}
% \changes{v1.6-1}{2003/8/25}
% {Description of \textsf{longtable} is added.}
% \SpecialOptIndex{longtable}{package}
% Usage of \textsf{longtable} with \textsf{arydshln} is quite simple. Just
% loading \textsf{arydshln} after \textsf{longtable} is enough to make the
% |longtable| environment able to draw dash-lines. A shorthand activation
% of dash-line functions is also available by |Longtable| environment. One
% caution to \textsf{longtable} users is that the temporary results before
% the {\em convergence} of the column widths may be different from those
% without \textsf{arydshln}. For example, the following is the first pass
% result of the example shown in Table~3 of the \textsf{longtable} manual.
%
% \begin{quote}
% \catcode`\|12
% \leavevmode\vtop{\offinterlineskip
% \hbox{\begin{tabular}{|c|c|c|}\hline 1&2&3\end{tabular}}
% \hbox{\begin{tabular}{|c|}wide multicolumn spanning 1--3\end{tabular}}
% \hbox{\begin{tabular}{|c|c|}\omit&
% \omit\vrule height0pt width116.66695pt\cr
% multicolumn 1--2&3\end{tabular}}
% \hbox{\begin{tabular}{|c|c|c|}\omit&
% \omit\vrule height0pt width68.05573pt&
% \omit\vrule height0pt width116.66695pt\cr
% wide 1&2&3\\\hline\end{tabular}}}
% \end{quote}
%
% \SpecialOptIndex{LTchunksize}{counter}
% Since |LTchunksize| is one in the example, columns of each row has their own
% widths and thus has vertical lines drawn at the edges of the columns. On
% the other hand, you will have the following as the first pass result with
% \textsf{arydshln}.
%
% \begin{quote}
% \catcode`\|12
% \settowidth\unitlength{\begin{tabular}{|c|c|c|}\hline 1&2&3\end{tabular}}
% \begin{tabular}[t]{|l|c|c|}
% \multispan3\relax
% \leaders\hrule height\arrayrulewidth\hskip\unitlength\cr
% \hbox to0pt{1\hskip2\tabcolsep 2\hskip2\tabcolsep 3\hss}&&\\
% \multicolumn3{|l|}{wide multicolumn spanning 1--3}\\
% \multicolumn2{|l|}{\hbox to0pt{multicolumn 1--2\hskip\tabcolsep
% \hbox to116.66695pt{\hss3\hss}\hss}}&\\
% wide 1&2&3\\\hline
% \omit&
% \omit\vrule height0pt width68.05573pt&
% \omit\vrule height0pt width116.66695pt\cr
% \end{tabular}
% \end{quote}
%
% As you see, the vertical lines are drawn at the column edges of the last
% row\footnote{
%
% More precisely, drawn according to the column widths established by all
% the chunks preceding page output.}
%
% because \textsf{arydshln} draws them when it see the last row. Anyway,
% you may ignore temporary results and will have a compatible result when
% the column widths are converged like the following.
%
% \begin{quote}
% \catcode`\|12
% \begin{tabular}[t]{|c|c|c|}\hline
% 1&2&3\\
% \multicolumn{3}{|c|}{wide multicolumn spanning 1--3}\\
% \multicolumn{2}{|c|}{multicolumn 1--2}&3\\
% wide 1&2&3\\\hline
% \end{tabular}
% \end{quote}
%
%
%
% \section{Known Problems}
% \label{sec:prob}
%
% There are following known problems.
%
% \begin{enumerate}
% \item
% The new preamble specifiers `|:|' and `|;{|\meta{dash}|/|\meta{gap}|}|'
% cannot be followed or preceded by `|@{|\meta{text}|}|', or you will have
% an ugly result. More specifically, a specifier to draw a dash-line at the
% left edge of a column cannot be preceded by `|@{|\meta{text}|}|', while
% that to draw at the right edge cannot be followed by `|@{|\meta{text}|}|'.
%
% \item\leavevmode
% \changes{v1.4-2}{1999/06/25}
% {Description about `\protect\EXCLAMATION' of array package is added.}
%
% If you use \textsf{array} package, the restriction of `|@|' shown above is
% also applied to `|!|'.
%
% \item
% In order to make it sure that a dash-line always {\em touches} its both
% end, i.e. a dash-line always begins and ends with a dash segment, the
% amount of a gap will slightly vary depending on the dash-line length.
%
% \item
% \changes{v1.4-2}{1999/06/25}
% {Reference to the section for drawing mode is added.}
%
% As described in \S\ref{sec:usage-finer}, dash-lines drawn in the default
% mode 1 may lack a dash segment near its right\slash bottom end.
%
% \item
% \changes{v1.4-2}{1999/06/25}
% {Description on minimum length is added.}
%
% If a dash-line is too short, you will have an ugly result without overfull
% message. More specifically, in mode 1 or 3, a line will look to protrude
% beyond its column\slash row borders if it is shorter than a half of
% |\dashlinedash|. In mode 2, the minimum length to avoid the protrusion is
% $1.5\times|\dashlinedash|+ |\dashlinegap|$.
%
% \item
% \changes{v1.4-2}{1999/06/25}
% {Reference to the performance tuning section is added.}
%
% As described in \S\ref{sec:usage-performance},
% the processing speed for |array| and |tabular| environment will become
% slower even if dash-lines are not included.
%
% \item
% \changes{v1.5-1}{2000/07/12}
% {Caution about \cs{AC}/\cs{EAC} pair for vertical line coloring is
% added.}
% \changes{v1.7}{2004/5/21}
% {Comment on vertical line coloring with \textsf{colortbl} is added.}
%
%
% As described in \S\ref{sec:usage-compat}, |\AC| and |\EAC| pair of
% \textsf{colortab} such as |\AC&\EAC| cannot color the vertical line at
% |&|. Use |\ADLinactivate| if you want to have a ordinary table with
% colored vertical lines. Note that you may color vertical lines with
% \textsf{colortbl} package.
% \end{enumerate}
%
%
%
% \IndexPrologue{\newpage\section*{Index}
% Italicized number refers to the page where the specification of
% corresponding entry is described.}
% \StopEventually{
% \section*{Acknowledgments}
%
% \changes{v1.4-2}{1999/06/25}
% {Thank to more people.}
% \changes{v1.5-3}{2003/07/11}
% {Thank to Yaxin Liu.}
% \changes{v1.6-1}{2003/08/25}
% {Thank to people for \textsf{longtable}.}
% \changes{v1.7}{2004/5/21}
% {Thank to Klaus Dalinghaus and refer orignal \textsf{colortbl}.}
% \changes{v1.71-1}{2004/8/31}
% {Thank to Morten H\o gholm.}
%
% The author thanks to Monty Hayes who gave the author the opportunity to
% make this style, and Weimin Zhang and Takahiro Kubota who pointed out bugs
% in early versions. He also thanks to the following people; Sebastian
% Rahtz and Graham Williams who kindly invited the style to \TeX{} CTAN and
% online catalogue compiled by Graham; Peter Ehrbar who showed the style was
% incompatible with \textsf{array} and kindly accepted the offer to be an
% alpha-user of v1.4 alone; Zsuzsanna Nagy who reported another
% incompatibility problem with \textsf{colortab}; Ralf Heydenreich who
% reported the bug causing that glues in a column have no effect; Yaxin
% Liu who reported the incompatibility bug of \textsf{array} and
% \cs{ADLinactivate}; Craig Leech who reported the incompatibility
% problem with \textsf{longtable}, which was also reported by Uwe Jehmlich,
% Torge Thielemann and
% Florian Weig, and have waited for two years and a half (!) for the
% solution; and Klaus Dalinghaus who reported yet another incompatibility
% with \textsf{colortbl}; Morten H\o gholm who reported the bug of |m|-type
% columns of \textsf{array} which had not manifested in five (!!) years
% since the author realesed the first \textsf{array}-compatible version.
%
% The base implementation of \texttt{array} and \texttt{tabular}
% environments, part of which the author gives new definitions referring
% original ones, are written by Leslie Lamport as a part of \LaTeX-2.09 and
% \LaTeXe{} (1997/12/01) to which Johannes Braams and other authors also
% contributed. The author also refers \textsf{array} package (v2.3m)
% written by Frank Mittelbach and David Carlisle; \textsf{colortab} package
% (v0.9) written by Timothy van Zandt; and \textsf{longtable} (v4.10) and
% \textsf{colortbl} (v0.1j) packages
% written by David Carlisle; to make the style compatible with those
% packages.
%
% \PrintIndex}
%
%
%
% \newpage
% \section{Implementation}
% \label{sec:imp}
% \subsection{Problems and Solutions}
% \label{sec:imp-ps1}
%
% \changes{v1.4-2}{1999/06/25}
% {The title of section 4.1 is changed.}
% \changes{v1.4-2}{1999/06/25}
% {\cs{hfil} is replaced with \cs{hss} taking the possibility of
% negative wide columns into account.}
% \changes{v1.7}{2004/5/21}
% {Add notes for dash line coloring.}
%
% We have two different problems to solve; how to draw horizontal dash-lines
% and how to draw vertical dash-lines. The former problem is relatively
% easy because the technique for drawing |\cline|-s can be used. That is, if
% we know the number of columns, we can draw a dash-line across the
% |\multispan|-ed columns by |\xleaders| of dash. Modifying a preamble of
% |array|\slash|tabular| to count the number of columns is not hard. Since
% |\cdashline| is given beginning and ending columns, its implementation is
% also easy.
%
% \SpecialIndex{\@arstrutbox}
%
% The latter problem, however, is much harder. Remember that
% |array|\slash|tabular| draws vertical solid lines by |\vrule|-s in each row
% without height\slash depth specification exploiting \TeX's sophisticated
% mechanism of the rule extension in the surrounding box. Since \TeX{} does
% not have such a mechanism for |\xleaders| unfortunately, we at least have
% to know the height and depth of a row which includes vertical dash-lines.
% Although the height and depth are often same as those of |\@arstrutbox|, we
% will have an exceptionally tall and/or deep row that makes dash-lines {\em
% broken} if we assume every row has the standard height and depth.
%
% Moreover, even if we can measure the height\slash depth of each row (in
% fact we will do as describe later), drawing dash-lines in each row will
% not produce a good result. Look at the following two examples closely.
%
%\begin{quote}
%\makeatletter
%\begin{tabular}{c:c}\hline
%A&B\\\hline
%\noalign{\xdef\adl@rowsL{\adl@rowsL(\relax/0);}
% \xdef\adl@rowsR{\adl@rowsR(\relax/0);}}
%{\vrule height2\ht\strutbox depth2\dp\strutbox width\z@\LARGE A}&B\\\hline
%\end{tabular}\qquad
%\begin{tabular}{c:c}\hline
%A&B\\\hline
%{\vrule height2\ht\strutbox depth2\dp\strutbox width\z@\LARGE A}&B\\\hline
%\end{tabular}
%\end{quote}
%
% In the left example, two dash-lines are individually drawn in two rows.
% Since the first row is not so tall and deep (8.4\,pt\slash
% 3.6\,pt) as to contain enough number of default dash segments (4\,pt dash and
% 4\,pt gap) to keep |\xleaders| from inserting a large space, the dash-line
% in the first row is {\em sparse}. On the other hand, the second row is
% enough tall and deep (16.8\,pt\slash 7.2\,pt) and thus the dash-line in the
% row looks better. Thus the resulting dash-line is awful because it does
% not have a continuous dash/gap sequence.
%
% The right example, which we wish to produce, is much better than the left.
% In this example, the dash line is draw across two rows keeping continuous
% steps of dashes and gaps. In order to have this result, we have to draw
% the dash-line {\em after} two rows are built because it is necessary to
% know the total hight and depth of two rows. In general, if we know the
% total hight and depth of rows and whether a column has a dash-line, we can
% draw dash-lines by adding an extra row containing dash-lines. For
% example, the result shown above is obtained by the following row.
%
% \begin{quote}
% |\omit\hss|\meta{dash-line of 36\,pt high}|&\omit\cr|
% \end{quote}
%
% Note that \meta{dash-line of 36\,pt high} have to be |\smash|-ed.
%
% In addition to this basic scheme, we have to take the following points
% into account.
%
% \begin{itemize}
% \item
% A dash-line drawn by the preamble character `|;|' will have non-default
% dash\slash gap specification.
%
% \item
% A column may have two or more dash-lines separated by spaces of
% |\doublerulesep|. Mixed sequence of solid- and dash-lines also have to be
% allowed.
%
% \item
% The first column may have dash-lines at both ends, while those of others
% will appear at right ends only. An exception of this rule is brought by
% |\multicolumn| that may have leading sequence of solid- and/or dash-line
% specifiers in its preamble.
%
% \item
% A |\multicolumn| may break or add a dash-line, or may change the
% dash\slash gap specification of a dash-line. A sequence of
% |\h(dash)line|-s also break dash-lines.
%
% \item
% If \textsf{colortbl} is in use, coloring dash\slash gap by
% |\arrayrulecolor| and |\dashgapcolor| gives another possibility of the
% variation of dash\slash gap specification.
% \end{itemize}
%
% In order to cope with them, the following data structure is constructed
% during rows are built.
%
% \begin{enumerate}
% \item
% The list of row information $R=\langle r_1,r_2,\ldots,r_N\rangle$.
%
% \item
% The $i\th$ element of $R$, $r_i$, is one of the following\footnote{
%
% In the real implementation, the structure of $r_i$ is slightly different.}.
%
% \begin{enumerate}
% \item
% A triple $\langle C^L_i,C^R_i,h_i\rangle$, where $C^L_i$ and $C^R_i$ are
% the lists of solid- or dash-line segments drawn at the left and right edge
% of columns respectively, and $h_i$ is the height plus depth of the $i\th$
% row.
%
% \item
% ${\it connect}(h_i)$ for a |\h(dash)line| of $h_i$ wide meaning that $r_i$
% is an empty pseudo row of $h_i$ high and dash-lines are not broken at the
% row.
%
% \item
% \changes{v1.6-1}{2003/8/25}
% {Description of \textit{discard} is added.}
% In |longtable| environment, ${\it discard}(h_i)$ for a negative vertical
% space inserted by |\\[|\meta{$h_i$}|]| or |\h(dash)line| meaning $r_i$
% is an empty pseudo row of $h_i$ high and dash-lines are not broken but may
% be discarded by the page break at the row.
%
% \item
% ${\it disconnect}(h_i)$ for a vertical gap generated by a sequence of
% |\h(dash)line| meaning that $r_i$ is an empty pseudo row of $h_i$ high and
% dash-lines are broken at the row.
% \end{enumerate}
%
% \item
% $C^L_i=\langle e^i_1,e^i_2,\ldots,e^i_m\rangle$ where $e^i_j$ corresponds
% to the $j\th$ (leftmost is first) solid- or dash-line segment. $C^R_i$ is
% similar but its elements are ordered in reverse, i.e. the rightmost segment
% is the first element.
%
% \item
% \changes{v1.7}{2004/5/21}
% {A dash/gap specification $d^i_j/g^i_j$ now has color.}
% The $j\th$ element of $C^L_i$ or $C^R_i$, $e^i_j$, is a triple $\langle
% c^i_j,d^i_j,g^i_j\rangle$ where $c^i_j$ is the column number in which the
% segment appears, and $d^i_j$ and $g^i_j$ are dash\slash gap specification,
% length and color, of the segment. For a solid line segment, the length
% attributes of both $d^i_j$ and $g^i_j$ are 0.
% \end{enumerate}
%
% Then this data structure is processed to draw solid- and dash-lines at the
% end of the |array|\slash|tabular| as follows. Let $e^i_j=\langle c^i_j,
% d^i_j, g^i_j\rangle$ be the $j\th$ element of $C^L_i$ of $r_i$. The {\em
% position} $p^i_j$ of $e^i_j$ in the column $c^i_j$ is defined as follows.
%$$
% p^i_j = \cases{1& if $j=1 \LOR c^i_j\neq c^i_{j-1}$\cr
% p^i_{j-1}+1& otherwise}.
%$$
% The following defines whether two elements $e^i_j$ and $e^{i'}_{j'}$ are
% {\em connected}, or $e^i_j\sim e^{i'}_{j'}$.
%
% \begin{eqnarray*}
% e^i_j\sim e^{i'}_{j'}&
% \togets&i<i'\LAND\\
% && c^i_j=c^{i'}_{j'}\LAND d^i_j=d^{i'}_{j'}\LAND g^i_j=g^{i'}_{j'}\LAND
% p^i_j=p^{i'}_{j'}\LAND\\
% && ^\forall k(i<k<i'\to r_k=connect(h_k)).
% \end{eqnarray*}
%
% With these definitions, we can classify all $e^i_j$ into ordered sets
% $S_1,S_2,\ldots S_n$ as follows.
%
% \def\PH{\phantom{^\forall e^i_j\in S_k,\forall e^{i'}_{j'}\in S_{k'}(}}
% \begin{eqnarray*}
% k\neq k'&\togets&
% S_k\cap S_{k'}=\emptyset\\
% e^i_j\sim e^{i'}_{j'}&\togets&
% ^\exists k(e^i_j,e^{i'}_{j'}\in S_k\LAND
% S_k=\{\ldots,e^i_j,e^{i'}_{j'},\ldots\}\\
% k<k'&\togets&
% ^\forall e^i_j\in S_k,\forall e^{i'}_{j'}\in S_{k'}(
% (c^i_j<c^{i'}_{j'})\LOR\\
% && \PH (c^i_j=c^{i'}_{j'}\LAND p^i_j<p^{i'}_{j'})\LOR\\
% && \PH (c^i_j=c^{i'}_{j'}\LAND p^i_j=p^{i'}_{j'}\LAND i<i')).
% \end{eqnarray*}
%
% Now we can draw a dash-line $L_k=\langle\gamma_k, \pi_k, \delta_k, \xi_k,
% \tau_k, \beta_k\rangle$ corresponding to $S_k=\{e^i_j,\ldots,e^{i'}_{j'}\}$
% as follows.
%
% \begin{itemize}
% \item
% $L_k$ is $\pi_k\th$ line in the $\gamma_k\th$ column where $\gamma_k=
% c^i_j=\ldots=c^{i'}_{j'}$ and $\pi_k=p^i_j=\ldots=p^{i'}_{j'}$.
%
% \item
% $L_k$ has the dash specification (size and color)
% $\delta_k=d^i_j=\ldots=d^{i'}_{j'}$ and gap specification
% $\xi_k=g^i_j=\ldots=g^{i'}_{j'}$.
%
% \item
% The top and bottom ends of $L_k$ are at $\tau_k$ and $\beta_k$ above the
% bottom of the |array|\slash|tabular|, where;
%$$
% \tau_k=\sum_{l=i}^N h_l,\quad\beta_k=\sum_{l=i'+1}^N h_l.
%$$
% \end{itemize}
%
% The row to draw $L_1,\ldots,L_n$ is;
%$$
% \sigma_1 L_1 \sigma_2 L_2 \ldots L_{n-1}\sigma_n L_n\sigma_{n+1}|\cr|
%$$
% where;
%
% \def\amp{\hbox{\tt\&}}
% \begin{eqnarray*}
% \sigma_1&=&
% \cs{omit}[\cs{hss}\amp\cs{omit}]^{\gamma_1-1}\\[1ex]
% \sigma_{1<k\leq n}&=&
% \cases{ \cs{null}&
% if $\gamma_{k-1}=\gamma_k\LAND \pi_{k-1}=\pi_k$\cr
% \cs{hskip}\cs{doublerulesep}&
% if $\gamma_{k-1}=\gamma_k\LAND \pi_{k-1}\neq\pi_k$\cr
% [\cs{hss}\amp\cs{omit}]^{\gamma_k-\gamma_{k-1}}&
% if $\gamma_{k-1}\neq\gamma_k$\cr}\\[1ex]
% \sigma_{n+1}&=&
% [\cs{hss}\amp\cs{omit}]^{{\mit\Gamma}-\gamma_n-1}\cs{hss}.
% \end{eqnarray*}
%
% Note that $[x]^m$ means $m$-times iteration of $x$, and $\mit\Gamma$ is
% the number of columns specified in the preamble.
%
% Dash-lines at the right edges of columns are similarly drawn by processing
% $C^R_i$ with the following modifications.
%
% \begin{eqnarray*}
% k<k'&\togets&
% ^\forall e^i_j\in S_k,\forall e^{i'}_{j'}\in S_{k'}(
% (c^i_j<c^{i'}_{j'})\LOR\\
% && \PH (c^i_j=c^{i'}_{j'}\LAND p^i_j>p^{i'}_{j'})\LOR\\
% && \PH (c^i_j=c^{i'}_{j'}\LAND p^i_j=p^{i'}_{j'}\LAND i<i'))\\
% \sigma_1&=&
% \cs{omit}\cs{hss}[\amp\cs{omit}\cs{hss}]^{\gamma_1-1}\\[1ex]
% \sigma_{k>1}&=&
% \cases{ \cs{null}&
% if $\gamma_{k-1}=\gamma_k\LAND \pi_{k-1}=\pi_k$\cr
% \cs{hskip}\cs{doublerulesep}&
% if $\gamma_{k-1}=\gamma_k\LAND \pi_{k-1}\neq\pi_k$\cr
% [\amp\cs{omit}\cs{hss}]^{\gamma_k-\gamma_{k-1}}&
% if $\gamma_{k-1}\neq\gamma_k$\cr}\\[1ex]
% \sigma_{n+1}&=&
% [\amp\cs{omit}\cs{hss}]^{{\mit\Gamma}-\gamma_n-1}
% \end{eqnarray*}
%
%
%
% \subsection{Another Problem and Imperfect Solutions}
% \label{sec:imp-ps2}
%
% In the default mode 1, we draw a dash line of dash size $d$ and gap size
% $g$ as follows. Let $W$ be the length of the line plus 10\,|sp|\footnote{
%
% This small amount is added by \cs{xleaders} in order to, according to the
% comment in \texttt{tex.web}, compensate floating point rounding error.},
%
% which is unknown for us if horizontal but known for \TeX, and assume
% $W\geq d/2$ (or the line protrude to the column\slash row boarder.) At
% the both ends of the columns, dashes of $d/2$ long are drawn to make the
% dash-line {\em touched} to the ends. Then $n=\lfloor(W-d-g)/(d+g)\rfloor$
% dashes are equally distributed in the remaining space. Thus we will have;
% $$
% D_0(d/2)G_0(g+\epsilon')D_1(d)G_1(g+\epsilon)\ldots
% G_{n-1}(g+\epsilon)D_n(d)G_n(g+\epsilon')D_{n+1}(d/2)
% $$
% where $D_i(l)$ and $G_i(l)$ are dash and gap of $l$ long,
% $\epsilon=(W-(n+1)(d+g))/(n+1)$ (rounded), and
% $\epsilon'=(W-(n+1)(d+g)-(n-1)\epsilon)/2$ to compensate the rounding
% error on the calculation of $\epsilon$. For a horizontal line, this
% result will be obtained by |\xleaders| as follows where $G^m_i(\epsilon)$
% and $G^m_i(\epsilon')$ are the spaces inserted by |\xleaders|.
%
% \begin{eqnarray*}
% \rlap{$\displaystyle D_0(d/2)G^l_0(g/2)
% \hbox{\cs{xleaders}\cs{hbox}{\tt\char`\{}}
% G^r(g/2)D(d)G^l(g/2)\hbox{\tt\char`\}\cs{hss}\ }
% G^r_n(g)D_{n+1}(d/2)$}\qquad\\
% &=&D_0(d/2)G^l_0(g/2)G^m_0(\epsilon')
% \left(G^r_0(g/2)D_1(d)G^l_1(g/2)\right)G^m_1(\epsilon)\\
% && \phantom{D_0(d/2)G^l_0(g/2)G^m_0(\epsilon)}
% \left(G^r_1(g/2)D_2(d)G^l_2(g/2)\right)G^m_2(\epsilon)\\
% && \phantom{D_0(d/2)G^l_0(g/2)G^m_0(\epsilon)}\ldots\\
% && \phantom{D_0(d/2)G^l_0(g/2)G^m_0(\epsilon)}
% \llap{$\displaystyle G^m_{n-1}(\epsilon)$}
% \left(G^r_{n-1}(g/2)D_n(d)G^l_n(g/2)\right)
% G^m_n(\epsilon')G^r_n(g/2)D_{n+1}(d/2)\\
% &=&D_0(d/2)G_0(g+\epsilon')D_1(d)G_1(g+\epsilon)\ldots
% G_{n-1}(g+\epsilon)D_n(d)G_n(g+\epsilon')D_{n+1}(d/2)
% \end{eqnarray*}
%
% The problem is that $\epsilon'$ could be negative and \TeX{} mistakingly
% ignores this possibility. That is, since \TeX{} does not put |\hbox|
% beyond the right edge of |\xleaders|, the rightmost |\hbox| is omitted if
% $\epsilon'$ is negative as described in \S\ref{sec:usage-finer}.
%
% Since it is (almost) impossible to know the length of a horizontal line,
% we cannot cope with this problem by adding or subtracting its length.
% Thus we introduced {\em drawing mode} to have imperfect solutions. In the
% mode 2, we draw a line by the following sequence.
%
% \begin{eqnarray*}
% \rlap{$\displaystyle D_0(d/2)G^l_0(g/2)G^r_{0'}(g/2)D_{1'}(d)G^l_{1'}(g/2)
% G(-d-g)$}\qquad\\
% && \hbox{\cs{xleaders}\cs{hbox}{\tt\char`\{}}
% G^r(g/2)D(d)G^l(g/2)\hbox{\tt\char`\}\cs{hss}\ }\\
% && G(-d-g)G^r_{n'}(g/2)D_{n'}(d)G^l_{n'}(g/2)G^r_n(g)D_{n+1}(d/2)
% \end{eqnarray*}
%
% That is, $n\th$ |\hbox| that could be disappeared is put twice and the
% first one is also overlaid for symmetrization. Therefore the length of the
% first and $n\th$ dashes is $d+\vert\epsilon'\vert$ and thus could be a
% little bit longer than others.
%
% On the other hand, we replace |\xleaders| of mode 1 with |\cleaders| for
% the drawing in mode 3. The result will be;
% $$
% D_0(d/2)G_0(g+R)D_1(d)G_1(g)\ldots
% G_{n-1}(g)D_n(d)G_n(g+R)D_{n+1}(d/2)
% $$
% where $R=(W-(n+1)(d+g))/2$ to make the first and last gaps considerably wider
% than others.
%
%
%
% \iffalse
%<*package>
% \fi
%
% \subsection{Register Declaration}
% \label{sec:imp-decl}
%
% Here registers and switches are declared.
%
% \begin{macro}{\dashlinedash}
% \begin{macro}{\dashlinegap}
% \begin{macro}{\hdashlinewidth}
% \begin{macro}{\hdashlinegap}
% First of all, two |\dimen| registers |\dashlinedash| and |\dashlinegap|
% to control the shape of dash-lines are declared, and their default values,
% 4\,pt for both, are assigned to them. They have aliases,
% |\hdashlinewidth| and |\hdashlinegap| respectively, for the backward
% compatibility.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
%% Register Declaration
\newdimen\dashlinedash \dashlinedash4pt %
\newdimen\dashlinegap \dashlinegap4pt %
\let\hdashlinewidth\dashlinedash
\let\hdashlinegap\dashlinegap
% \end{macrocode}
%
% Next, the following six switches are declared.
% \begin{itemize}
% \item
% \begin{macro}{\ifadl@leftrule}
% |\ifadl@leftrule| is used in the preamble analysis macro |\@mkpream| and
% is true during it processes leading characters for solid- and dash-lines,
% i.e.\ `\verb!|!', `|:|', and `|;|'.
% \end{macro}
%
% \item
% \begin{macro}{\ifadl@connected}
% |\ifadl@connected| is used to indicate the {\em connection} $e^i_j\sim
% e^{i'}_{j'}$. When we process $e^{i'}_{j'}$, the switch is true iff
% $^\exists e^i_j(e^i_j\sim e^{i'}_{j'})$.
% \end{macro}
%
% \item
% \begin{macro}{\ifadl@doublerule}
% |\ifadl@doublerule| is used to make $\sigma_k$. When we are to make
% $\sigma_k L_k$, it is true iff $\gamma_{k-1}=\gamma_k\LAND\pi_{k-1}\neq
% \pi_k$.
% \end{macro}
%
% \item
% \begin{macro}{\ifadl@zwvrule}
% \changes{v1.4-3-2}{1999/06/25}
% {Introduced to indicate vertical lines have null width.}
% |\ifadl@zwvrule| controls the {\em real} width of vertical lines. If it
% is true, lines are drawn as if their width is zero following \LaTeX's
% standard. Otherwise, their width |\arrayrulewidth| contribute to the
% width of columns as \textsf{array} does.
% \end{macro}
%
% \item
% \begin{macro}{\ifadl@zwhrule}
% \changes{v1.7-1}{2004/5/21}
% {Introduced to indicate horizontal lines have null width.}
% |\ifadl@zwhrule| controls the {\em real} width of horizontal lines. If it
% is true, a line is drawn as if its width is zero and its bottom edge is
% adjusted to that of the row above by inserting |\vskip-\arrayulewidth|
% before the drawing. Thus a horizontal dash line is included in the row
% above and its gaps look colored properly if the row is painted. If it is
% false, the width |\arrayrulewidth| contribute to the height of
% \texttt{array}\slash\texttt{tabular} as usual.
% \end{macro}
%
% \item
% \begin{macro}{\ifadl@usingarypkg}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced to know if \textsf{array} is loaded.}
% |\ifadl@usingarypkg| is true iff \textsf{array} has been loaded prior to
% \textsf{arydshln}. This switch shows us which definitions, by \LaTeX{} or
% \textsf{array}, we have to modify. Its value is set by examining if
% |\extrarowheight|, which is introduced by \textsf{array}, is defined.
% \end{macro}
%
% \item
% \begin{macro}{\ifadl@inactive}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to indicate dash-line functions are inactive.}
% |\ifadl@inactive| inactivates dash-line functions if it is true. Its
% default value is false.
% \end{macro}
% \end{itemize}
%
% \SpecialIndex{\@tempswa}
% We also use a working switch |\@tempswa|.
%
% \begin{macrocode}
\newif\ifadl@leftrule
\newif\ifadl@connected
\newif\ifadl@doublerule
\newif\ifadl@zwvrule
\newif\ifadl@zwhrule
\newif\ifadl@usingarypkg
\ifx\extrarowheight\undefined \adl@usingarypkgfalse
\else \adl@usingarypkgtrue \fi
\newif\ifadl@inactive \adl@inactivefalse
% \end{macrocode}
%
% \begin{macro}{\ADLnullwide}
% \changes{v1.7-1}{2004/5/21}
% {Introduced to make horizontal lines null wide.}
% \begin{macro}{\ADLsomewide}
% \changes{v1.7-1}{2004/5/21}
% {Introduced to make horizontal lines \cs{arraydashline} wide.}
% The switch |\ifadl@hwvrule| is turned on/off by user interface macros
% |\ADLnullwide| and |\ADLsomewide|. Its initial value is the complement of
% |\adl@usingarypkg|.
% \end{macro}\end{macro}
%
% \begin{macro}{\ADLnullwidehline}
% \changes{v1.4-3-2}{1999/06/25}
% {Introduced to make vertical lines null wide.}
% \begin{macro}{\ADLsomewidehline}
% \changes{v1.4-3-2}{1999/06/25}
% {Introduced to make vertical lines \cs{arraydashline} wide.}
% The switch |\ifadl@zwvrule| is turned on/off by user interface macros
% |\ADLnullwidehline| and |\ADLsomewidehline|. Its initial value is false.
% \end{macro}\end{macro}
%
% \begin{macro}{\ADLactivate}
% \begin{macro}{\ADLinactivate}
% The switch |\ifadl@inactive| is also turned on/off by user interface macros
% |\ADL#inactivate| and |\ADLactivate|.
% \end{macro}\end{macro}
%
% \begin{macrocode}
\def\ADLnullwide{\adl@zwvruletrue}
\def\ADLsomewide{\adl@zwvrulefalse}
\ifadl@usingarypkg \ADLsomewide \else \ADLnullwide \fi
\def\ADLnullwidehline{\adl@zwhruletrue}
\def\ADLsomewidehline{\adl@zwhrulefalse}
\ADLsomewidehline
\def\ADLactivate{\adl@inactivefalse}
\def\ADLinactivate{\adl@inactivetrue}
% \end{macrocode}
%
% The following |\box| register and three |\dimen| registers are used to
% measure the height and depth of a row.
%
% \begin{itemize}
% \item
% \begin{macro}{\adl@box}
% The contents of a column is packed into the |\box| register |\adl@box| to
% measure its height and depth.
% \end{macro}
%
% \item
% \begin{macro}{\adl@height}
% \begin{macro}{\adl@depth}
% The |\dimen| registers |\adl@height| and |\adl@depth| contain the
% height\slash depth of the tallest\slash deepest column in a row. When a
% column is processed, they are compared to the height and depth of
% |\adl@box| and are updated if they are less.
% \end{macro}\end{macro}
%
% \begin{macro}{\adl@heightsave}
% \begin{macro}{\adl@depthsave}
% Since we have to update these register |\global|-ly to pass their value
% across |&| and we may have a column containing |array|\slash|tabular|,
% they are saved into |\adl@heightsave|\slash|\adl@depthsave| at the
% beginning of the environment and are restored at its end.
% \end{macro}\end{macro}
%
% \begin{macro}{\adl@finaldepth}
% \changes{v1.4-3-6}{1999/06/25}
% {Introduced to measure the depth of the last row.}
% The other |\dimen| register |\adl@finaldepth| is set to the depth of the
% last row, or zero if the last vertical item is a horizontal line. This
% value is used to shift |array|\slash|tabular| down because we add extra
% two |\smash|-ed rows which make the depth of |array|\slash|tabular| zero.
% \end{macro}
% \end{itemize}
%
% \SpecialIndex{\@tempdima}
% \SpecialIndex{\@tempdimb}
% We also use working |\dimen| registers |\@tempdima| and |\@tempdimb|.
%
% \begin{macrocode}
\newbox\adl@box
\newdimen\adl@height \newdimen\adl@heightsave
\newdimen\adl@depth \newdimen\adl@depthsave
\newdimen\adl@finaldepth
% \end{macrocode}
%
% Then the following |\count| registers are declared. Note that some of
% them contain dimensions measured by the unit |sp|.
%
% \begin{itemize}
% \item
% \begin{macro}{\adl@columns}
% \begin{macro}{\adl@ncol}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced for new column counting in preamble construction.}
% |\adl@columns| has the number of columns specified in the preamble of the
% environment. Because of a complicated reason related to the compatibility
% with \textsf{array}, we cannot count up |\adl@columns| directly but
% increment |\adl@ncol| when each column of preamble is built and move its
% value to |\adl@columns| after the preamble is constructed.
% \end{macro}\end{macro}
%
% \item
% \begin{macro}{\adl@currentcolumn}
% \begin{macro}{\adl@currentcolumnsave}
% To process |\multicolumn|, we have to know the column number where it
% appears. Thus we have a column counter |\adl@currentcolumn| which is
% |\global|-ly incremented when each column is built. Because of the
% |\global| assignment, the counter has to be saved\slash restored
% into\slash from |\adl@currentcolumnsave|.
% \end{macro}\end{macro}
%
% \item
% \begin{macro}{\adl@totalheight}
% In the real implementation, $\tau_k$ and $\beta_k$ are calculated by the
% following equations rather than those shown in \S\ref{sec:imp-ps1}.
%$$
% H=\sum_{l=1}^N h_l,\quad
% \tau_k=H-\sum_{l=1}^{i-1} h_l,\quad
% \beta_k=\tau_k-\sum_{l=i'}^i h_l.
%$$
% |\adl@totalheight| contains $\sum_{l=1}^i h_l$ when the $i\th$ row is
% built and thus its final value is $H$. Since the data structure $R$ are
% represented by a text, we have to pay attention to the precision of its
% dimensional elements, such as $h_i$. That is, if we append $h_i$ to $R$
% by expanding |\the\dimen|$n$ which has the height plus depth of $i\th$
% row, $h_i$ will be an approximation of |\dimen|$n$ represented by a
% decimal fraction with |pt|. Although the error of the approximation is
% quite small and may be negligible, the error must be avoided because it is
% avoidable by simply using |\number\dimen|$n$. Therefore, $h_i$ is an
% integer and thus |\adl@totalheight| is too.
% \end{macro}
%
% \begin{macro}{\adl@totalheightsave}
% Because of the |\global| assignment to |\adl@totalheight| to pass its value
% across rows, it has to be saved\slash restored into\slash from
% |\adl@totalheightsave|.
% \end{macro}
%
% \item
% \begin{macro}{\adl@dash}
% \begin{macro}{\adl@gap}
% In order to check $e^i_j\sim e^{i'}_{j'}$, the size attributes of $d^i_j$
% and $g^i_j$ are kept in
% the registers |\adl@dash| and |\adl@gap| when we process $e^{i'}_{j'}$.
% As explained above, $d^i_j$ and $g^i_j$ are integers and thus |\adl@dash|
% and |\adl@gap| are |\count| registers.
% \end{macro}\end{macro}
%
% \item
% \begin{macro}{\adl@cla}
% \begin{macro}{\adl@clb}
% \SpecialIndex{\@cla}
% \SpecialIndex{\@clb}
% The coding of |\cdashline| is similar to that of |\cline| in \LaTeX-2.09
% which uses two global |\count| registers |\@cla| and |\@clb|. These
% registers are omitted from \LaTeXe{} because its |\cline| is completely
% recoded. We could adopt new coding but it requires some other macro
% definitions that \LaTeX-2.09 does not have. Thus we simply introduce new
% global counters |\adl@cla| and |\adl@clb| for |\cdashline| in order to
% make |\cdashline| work in both \LaTeX-2.09 and \LaTeXe.
% \end{macro}\end{macro}
% \end{itemize}
%
% \SpecialIndex{\@tempcnta}
% \SpecialIndex{\@tempcnta}
% We also use working |\count| registers |\@tempcnta| and |\@tempcntb|.
%
% \begin{macrocode}
\newcount\adl@columns \newcount\adl@ncol
\newcount\adl@currentcolumn \newcount\adl@currentcolumnsave
\newcount\adl@totalheight \newcount\adl@totalheightsave
\newcount\adl@dash \newcount\adl@gap
\newcount\adl@cla \newcount\adl@clb
% \end{macrocode}
%
% \begin{macro}{\adl@everyvbox}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced for a tricky modification of \cs{@array}.}
% The last register declaration is for a |\toks| register named
% |\adl@everyvbox|. In order to minimize the copy-and-modify of the codes
% in \LaTeX{} and \textsf{array}, we need to use |\everyvbox| in our own
% definition of |\@array|. The register is used to save the contents of
% |\everyvbox|.
% \end{macro}
%
% \begin{macrocode}
\newtoks\adl@everyvbox
% \end{macrocode}
%
% \begin{macro}{\adl@org@arrayclassz}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to restore \cs{@arrayclassz}.}
% \begin{macro}{\adl@org@tabclassz}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to restore \cs{@tabclassz}.}
% \begin{macro}{\adl@org@classz}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to restore \cs{@classz}.}
% \begin{macro}{\adl@org@@startpbox}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to restore \cs{@@startpbox}.}
% \begin{macro}{\adl@org@@endpbox}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to restore \cs{@@endpbox}.}
% \begin{macro}{\adl@org@endpbox}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to restore \cs{@endpbox}.}
% \begin{macro}{\adl@org@cline}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to restore \cs{cline}.}
% \changes{v1.4-3-6}{1999/06/25}
% {Introduced to refer original version in modified \cs{cline}.}
% The other declarative stuffs are the sequence of |\let| to capture the
% original definitions of macros that we will modify afterword. The main
% purpose of them is to nullify the modification when dash-line functions
% are inactive, while |\adl@org@cline| is also referred in its modified
% version.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\let\adl@org@arrayclassz\@arrayclassz
\let\adl@org@tabclassz\@tabclassz
\let\adl@org@classz\@classz
\let\adl@org@@startpbox\@@startpbox
\let\adl@org@@endpbox\@@endpbox
\let\adl@org@endpbox\@endpbox
\let\adl@org@cline\cline
%%^L
% \end{macrocode}
%
%
%
% \subsection{Initialization}
% \label{sec:imp-init}
%
% \begin{macro}{\adl@array}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced to save original definition of \cs{@array}.}
% \begin{macro}{\@array}
% \changes{v1.4-3-1}{1999/06/25}
% {Drastically modified to avoid copy-and-modify.}
% \begin{macro}{\adl@noalign}
% \changes{v1.7-2}{2004/5/21}
% {Introduced to fix a bug of \textsf{colortbl}.}
%
% \LaTeX's macro |\@array| is modified to save and initialize registers and
% data structures which are |\global|-ly updated in order to allow nested
% |array|\slash|tabular|. This saving and initializing are performed by
% |\adl@arrayinit| as explained below. The problem in the modification is
% that the code of |\@array| in \textsf{array} is completely different from
% that of \LaTeX{} original.
%
% The main difference is that \LaTeX{} builds |\@preamble| locally, while
% \textsf{array} does globally exploiting the fact that the lifetime of
% |\@preamble| ends before another |array|\slash|tabular| appears in a
% column. The latter implementation will work well unless the building
% process in |\@mkpream| produces something referred after |\@preamble| is
% thrown into \TeX's {\em stomach}. In our implementation, unfortunately,
% the number of columns has to be counted in \break|\@mkpream| and will be
% referred by |\hdashline| and the vertical line drawing procedure.
%
% Thus we have to change the column counting mechanism depending on whether
% or not \textsf{array} is in use. The simplest way could be to copy the codes
% of \LaTeX{} and \textsf{array} and modify them appropriately examining the
% value of |\ifadl@usingarypkg|. However this solution is vulnerable to the
% modification of the original version and thus we wish to refuse it as far
% as possible.
%
% \SpecialIndex{\everyvbox}
% \SpecialIndex{\adl@everyvbox}
% Therefore, we use a trick with |\everyvbox| in which |\adl@arrayinit| is
% temporarily included to initialize registers and locally set
% |\adl@columns| to the number of columns |\global|-ly counted by
% |\adl@ncol|. This trick work well so far because;
%
% \begin{itemize}
% \item
% the first |\vbox|, |\vtop| or |\vcenter| made by |\@array| is the vertical
% box surrounding |\halign|, and;
%
% \item
% in |\@array| of \textsf{array} the box is opened {\em after} the preamble
% is constructed;
% \end{itemize}
%
% and will hopefully work in future.
%
% \changes{v1.5-3}{2003/07/11}
% {Move \cs{adl@inactivate} to \cs{@array} from \cs{adl@arrayinit}.}
% \changes{v1.54-2}{2003/08/25}
% {Invoke \cs{adl@activate} if not \cs{ifadl@inactive}.}
% \changes{v1.7-2}{2004/5/21}
% {Make \cs{adl@noalign} \cs{let}-equal to \cs{noalign}.}
% \SpecialIndex{\arrayrulecolor}
% \SpecialIndex{\doublerulesepcolor}
% \SpecialIndex{\dashgapcolor}
% Next, if |\ifadl@inactive| is true, |\adl@inactivate| is invoked to
% inactivate dash-line functions. Otherwise, |\adl@activate| is invoked to
% activate them because an inactivated |array|\slash|tabular|
% may have active children in it. Finally, |\adl@noalign| is made
% |\let|-equal to |\noalign| so that |\arrayrulecolor|,
% |\doublerulesepcolor| and |\dashgapcolor| are expanded with |\noalign| in
% the environment.
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\@@array}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced because \textsf{array} uses it.}
%
% \SpecialIndex{\@tabarray}
% Another stuff for the compatibility with \textsf{array} is to |\let| a
% control sequence |\@@array| be equal to |\@array| because it is referred
% in |\@tabarray| in \textsf{array}.
% \end{macro}
%
% \begin{macrocode}
%% Initialization
\let\adl@array\@array
\def\@array{\adl@everyvbox\everyvbox
\everyvbox{\adl@arrayinit \the\adl@everyvbox \everyvbox\adl@everyvbox}%
\ifadl@inactive \adl@inactivate \else \adl@activate \fi
\let\adl@noalign\noalign
\adl@array}
\let\@@array\@array
% \end{macrocode}
%
% \begin{macro}{\adl@arrayinit}
% \changes{v1.4-3-9}{1999/06/25}
% {The bug of saving \cs{adl@colsR} is fixed.}
% \changes{v1.5-1}{2000/07/12}
% {Use new macro \cs{adl@arraysave} to save registers/structures.}
% \begin{macro}{\adl@arraysave}
% \changes{v1.5-1}{2000/07/12}
% {Introduced to use in modified \cs{CC@} of \textsf{colortab}.}
% \SpecialIndex{\adl@height}
% \SpecialIndex{\adl@depth}
% \SpecialIndex{\adl@currentcolumn}
% \SpecialIndex{\adl@totalheight}
%
% As described in \S\ref{sec:imp-decl}, registers updated |\global|-ly,
% which are |\adl@height|, |\adl@depth|, |\adl@currentcolumn| and
% |\adl@totalheight|, are saved in |\adl@arrayinit| by calling
% |\adl@arraysave|, and also given initial values. The macro also saves the
% following data structures and initializes them to empty lists.
% \end{macro}
%
% \begin{macro}{\adl@rowsL}
% \begin{macro}{\adl@rowsR}
% \begin{macro}{\adl@rowsLsave}
% \begin{macro}{\adl@rowsRsave}
% \begin{macro}{\adl@colsL}
% \begin{macro}{\adl@colsR}
% \begin{macro}{\adl@colsLsave}
% \begin{macro}{\adl@colsRsave}
% \begin{itemize}
% \item
% In the real implementation, the data structure $R$ is split into two
% lists;
%
% \begin{eqnarray*}
% \cs{adl@rowsL}&=&R^L=\langle\langle C^L_1,h_1\rangle,\ldots\rangle\\
% \cs{adl@rowsR}&=&R^R=\langle\langle C^R_1,h_1\rangle,\ldots\rangle
% \end{eqnarray*}
%
% and they are saved into |\adl@rowsLsave| and |\adl@rowsRsave|.
%
% \item
% When the $i\th$ row is building, $C^L_i$ and $C^R_i$ are constructed in
% the macros |\adl@colsL| and |\adl@colsR|. They are saved
% into |\adl@colsLsave| and |\adl@colsRsave|.
% \end{itemize}
% \end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\adl@connect}
% \begin{macro}{\adl@discard}
% \changes{v1.6-1}{2003/8/25}
% {Add initializetion of \cs{adl@discard}.}
% \SpecialIndex{\@elt}
% \SpecialOptIndex{longtable}{environment}
%
% In the real implementation, $e^i_j$ is represented by a control sequence
% |\@elt|, and ${\it connect}(i)$ by |\adl@connect|. They are made
% |\let|-equal to |\relax| to keep them from expansion during $R$ is
% constructed. In |longtable| environment, ${\it connect}(i)$ for negative
% vertical space inserted by |\\[|\meta{h}|]| or a horizontal line has
% another representation |\adl@discard| to indicate it corresponds to a
% discardable item of page breaking. Since this representation, however, is
% nonsense in usural |array|\slash|tabular| even if they are included in
% |\longtable|, we define |\adl@discard| as |\adl@connect| so that it
% transforms itself into |\adl@connect| when it is added to
% |\adl@rowsL|\slash|R| by |\xdef|. Note that |\adl@discard| is made
% |\let|-equal to |\relax| to inhibit the transformation at the beginning of
% |longtable| environment.
% \end{macro}\end{macro}
%
% \changes{v1.4-3-1}{1999/06/25}
% {Modified for new column counting in preamble construction.}
%
% Then, we set to |\adl@columns| to the value of |\adl@ncol| {\em locally}.
% As explained above, this has an effect with \textsf{array} because
% |\adl@arrayinit| is called {\em after} the preamble is generated. Without
% \textsf{array}, on the other hand, this assignment has no effect but safe
% because it is included in a group of |\vbox| etc.
%
% \changes{v1.4-3-3}{1999/06/25}
% {Modified to call \cs{adl@inactivate}.}
% \changes{v1.5-3}{2003/07/11}
% {Move \cs{adl@inactivate} from \cs{adl@arrayinit} to \cs{@array}.}
%
% \end{macro}
% \SpecialIndex{\adl@height}
% \SpecialIndex{\adl@depth}
% \SpecialIndex{\adl@currentcolumn}
% \SpecialIndex{\adl@totalheight}
% \SpecialIndex{\adl@heightsave}
% \SpecialIndex{\adl@depthsave}
% \SpecialIndex{\adl@currentcolumnsave}
% \SpecialIndex{\adl@totalheightsave}
%
% \begin{macrocode}
\def\adl@arrayinit{%
\adl@arraysave
\global\adl@height\z@ \global\adl@depth\z@
\global\adl@currentcolumn\@ne \global\adl@totalheight\z@
\gdef\adl@rowsL{}\gdef\adl@rowsR{}\gdef\adl@colsL{}\gdef\adl@colsR{}%
\let\@elt\relax \let\adl@connect\relax \def\adl@discard{\adl@connect}%
\adl@columns\adl@ncol}
\def\adl@arraysave{%
\adl@heightsave\adl@height
\adl@depthsave\adl@depth
\adl@currentcolumnsave\adl@currentcolumn
\adl@totalheightsave\adl@totalheight
\let\adl@rowsLsave\adl@rowsL
\let\adl@rowsRsave\adl@rowsR
\let\adl@colsLsave\adl@colsL
\let\adl@colsRsave\adl@colsR}
% \end{macrocode}
%
% \begin{macro}{\adl@inactivate}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to inactivate \cs{@arrayclassz} etc.}
% \changes{v1.5-3}{2003/07/11}
% {Change \cs{adl@inactivate} caller to \cs{@array}.}
% \changes{v1.7-1}{2004/5/21}
% {Remove \cs{cline} because our own version is needed for null-wide.}
% If |\ADLinactivate| has effect and thus |\ifadl@inactive| is true, the
% macro |\adl@inactivate| is called from |\@array|\footnote{
%
% Before v1.53, \cs{adl@inactivate} was called from \cs{adl@arrayinit} and
% thus invokded {\em after} the preamble of \textsf{array} is built. This
% was incorrect of course and made inactive version of \texttt{p},
% \texttt{m} and \texttt{b} produce nothing.}.
%
% This |\let|-s the following control sequences be equal to their
% counterparts in \LaTeX{} and/or \textsf{array} package.
%
% \changes{v1.54-2}{2003/08/25}
% {Add \cs{adl@argcr} to inactivation.}
%
% \begin{itemize}\item[]
% \SpecialIndex{\@arrayclassz}
% \SpecialIndex{\@tabclassz}
% \SpecialIndex{\@classz}
% \SpecialIndex{\@@startpbox}
% \SpecialIndex{\@@endpbox}
% \SpecialIndex{\@endpbox}
% \SpecialIndex{\adl@cr}
% \SpecialIndex{\adl@argcr}
% \SpecialIndex{\adl@endarray}
% |\@arrayclassz|\quad
% |\@tabclassz|\quad
% |\@classz|\quad
% |\@@startpbox|\quad
% |\@@endpbox|\\
% |\@endpbox|\quad
% |\adl@cr|\quad
% |\adl@argcr|\quad
% |\adl@endarray|
% \end{itemize}
%
% Note that we have to inactivate both |\@@endpbox| for \LaTeX{} and
% |\@endpbox| for \textsf{array}, while |\@startpbox| for \textsf{array} is
% not necessary because it is unmodified. Also note that \break|\@classz|
% has to
% be |\let|-equal to |\adl@org@classz| only if \textsf{array} is in use,
% because \LaTeX{} does not define |\@classz| but refers it which is either
% |\@arrayclassz| or |\@tabclassz|. Yet another remark is that we have to
% conceal |\cr| for |\adl@cr|\slash|\adl@argcr| and |\crcr| for
% |\adl@endarray| by bracing them from \TeX's |\halign| mechanism that
% searches them when an |array|\slash|tabular| has an nested
% |array|\slash|tabular|. This could be done by a tricky |\let|-assignment
% such as;
%
% \begin{quote}
% |\iffalse{\let\adl@cr\cr \iffalse}\fi|
% \end{quote}
%
% but we simply use |\def| instead of |\let| because of clarity.
%
% We also |\let| the following be {\it no-operation} or their inactive
% versions.
%
% \begin{itemize}\item[]
% \SpecialIndex{\adl@hline}
% \SpecialIndex{\adl@ihdashline}
% \SpecialIndex{\adl@cdline}
% \SpecialIndex{\adl@@vlineL}
% \SpecialIndex{\adl@@vlineR}
% \SpecialIndex{\adl@vlineL}
% \SpecialIndex{\adl@vlineR}
% |\adl@hline|\quad
% |\adl@ihdashline|\quad
% |\adl@cdline|\quad
% |\adl@@vlineL|\quad
% |\adl@@vlineR|\\
% |\adl@vlineL|\quad
% |\adl@vlineR|
% \end{itemize}
% Note that we have to inactivate both |\adl@@vlineL| and |\adl@vlineL|,
% because the latter is referred when \textsf{array} is in use while the
% former is referred otherwise. Their |R| relatives are also inactivated by
% the same reason.
% \end{macro}
%
% \SpecialIndex{\@arrayclassz}
% \SpecialIndex{\@tabclassz}
% \SpecialIndex{\@classz}
% \SpecialIndex{\@@startpbox}
% \SpecialIndex{\@@endpbox}
% \SpecialIndex{\@endpbox}
% \SpecialIndex{\adl@cr}
% \SpecialIndex{\adl@argcr}
% \SpecialIndex{\adl@endarray}
% \SpecialIndex{\adl@hline}
% \SpecialIndex{\adl@ihdashline}
% \SpecialIndex{\adl@cdline}
% \SpecialIndex{\adl@@vlineL}
% \SpecialIndex{\adl@@vlineR}
% \SpecialIndex{\adl@vlineL}
% \SpecialIndex{\adl@vlineR}
% \SpecialIndex{\adl@org@arrayclassz}
% \SpecialIndex{\adl@org@tabclassz}
% \SpecialIndex{\adl@org@classz}
% \SpecialIndex{\adl@org@@startpbox}
% \SpecialIndex{\adl@org@@endpbox}
% \SpecialIndex{\adl@org@endpbox}
% \SpecialIndex{\adl@cr}
% \SpecialIndex{\adl@argcr}
% \SpecialIndex{\adl@org@cline}
% \SpecialIndex{\adl@inactivehdl}
% \SpecialIndex{\adl@inactivecdl}
% \SpecialIndex{\adl@inactivevl}
% \begin{macrocode}
\def\adl@inactivate{%
\let\@arrayclassz\adl@org@arrayclassz
\let\@tabclassz\adl@org@tabclassz
\ifadl@usingarypkg \let\@classz\adl@org@classz \fi
\let\@@startpbox\adl@org@@startpbox
\let\@@endpbox\adl@org@@endpbox
\let\@endpbox\adl@org@endpbox
\def\adl@cr{\cr}%
\def\adl@argcr##1{\cr}%
\def\adl@endarray{\crcr}%
\let\adl@hline\@gobbletwo
\let\adl@ihdashline\adl@inactivehdl
\let\adl@cdline\adl@inactivecdl
\let\adl@@vlineL\adl@inactivevl
\let\adl@@vlineR\adl@inactivevl
\let\adl@vlineL\adl@inactivevl
\let\adl@vlineR\adl@inactivevl}
% \end{macrocode}
%
% \begin{macro}{\adl@activate}
% \changes{v1.54-2}{2003/08/25}
% {Introduced to activate \cs{@arrayclassz} etc.\ again.}
%
% On the other hand, if |\ifadl@inactive| is false, the macro |\adl@activate|
% is called from |\@array| to make inactivated macros active again in order
% to cope with the case in which an inactive \textsf{array}\slash
% \textsf{tabular} has active children in it\footnote{
%
% Before v1.54, an active \textsf{array}\slash\textsf{tabular} in an
% inactive parent was not activated.}.
%
% To do that, |\adl@activate| makes |\@arrayclassz| etc.\ |\let|-equal to
% their active version |\adl@act@arrayclassz| etc.\ which will be defined
% (|\let|-equal to) as our own |\@arrayclassz| etc.\ in \S\ref{sec:imp-sh}.
% \end{macro}
%
% \SpecialIndex{\@arrayclassz}
% \SpecialIndex{\@tabclassz}
% \SpecialIndex{\@classz}
% \SpecialIndex{\@@startpbox}
% \SpecialIndex{\@@endpbox}
% \SpecialIndex{\@endpbox}
% \SpecialIndex{\adl@cr}
% \SpecialIndex{\adl@argcr}
% \SpecialIndex{\adl@endarray}
% \SpecialIndex{\adl@hline}
% \SpecialIndex{\adl@ihdashline}
% \SpecialIndex{\adl@cdline}
% \SpecialIndex{\adl@@vlineL}
% \SpecialIndex{\adl@@vlineR}
% \SpecialIndex{\adl@vlineL}
% \SpecialIndex{\adl@vlineR}
% \SpecialIndex{\adl@act@arrayclassz}
% \SpecialIndex{\adl@act@tabclassz}
% \SpecialIndex{\adl@act@classz}
% \SpecialIndex{\adl@act@@startpbox}
% \SpecialIndex{\adl@act@@endpbox}
% \SpecialIndex{\adl@act@endpbox}
% \SpecialIndex{\adl@act@cr}
% \SpecialIndex{\adl@act@argcr}
% \SpecialIndex{\adl@act@cline}
% \SpecialIndex{\adl@act@endarray}
% \SpecialIndex{\adl@act@hline}
% \SpecialIndex{\adl@act@ihdashline}
% \SpecialIndex{\adl@act@cdline}
% \SpecialIndex{\adl@act@@vlineL}
% \SpecialIndex{\adl@act@@vlineR}
% \begin{macrocode}
\def\adl@activate{%
\let\@arrayclassz\adl@act@arrayclassz
\let\@tabclassz\adl@act@tabclassz
\ifadl@usingarypkg \let\@classz\adl@act@classz \fi
\let\@@startpbox\adl@act@@startpbox
\let\@@endpbox\adl@act@@endpbox
\let\@endpbox\adl@act@endpbox
\let\adl@cr\adl@act@cr
\let\adl@argcr\adl@act@argcr
\let\adl@endarray\adl@act@endarray
\let\adl@hline\adl@act@hline
\let\adl@ihdashline\adl@act@ihdashline
\let\adl@cdline\adl@act@cdline
\let\adl@@vlineL\adl@act@@vlineL
\let\adl@@vlineR\adl@act@@vlineR
\let\adl@vlineL\adl@act@@vlineL
\let\adl@vlineR\adl@act@@vlineR}
%%^L
% \end{macrocode}
%
% \changes{v1.6-1}{2003/8/25}
% {Add a summary of activation/inactivation.}
% The summary of the activation and inactivation is shown in
% Table~\ref{tab:act}.
%
%
%
% \begin{table}
% \catcode`\|12
% \caption{Active and Inactive Operations}\label{tab:act}
% \def\!{\texttt{\char`\\\char`\\}}
% \centerline{\begin{tabular}[t]{|l||l|l|}\hline
% command&active&inactive\\\hline\hline
% \tt l c r&&\\
% \qquad with \textsf{array}& \cs{adl@act@classz}&
% \cs{adl@org@classz}\\
% \qquad without \textsf{array}&\cs{adl@act@tabclassz}&
% \cs{adl@org@tabclassz}\\
% & \cs{adl@act@arrayclassz}&
% \cs{adl@org@arrayclassz}\\\hline
% {\tt p m b} (open)&&\\
% \qquad with \textsf{array}& \cs{adl@act@classz}&
% \cs{adl@org@classz}\\
% \qquad without \textsf{array}&\cs{adl@act@@startpbox}&
% \cs{adl@org@@startpbox}\\\hline
% {\tt p m b} (close)& \cs{adl@act@@endpbox}&
% \cs{adl@org@@endpbox}\\\hline
% \tt \char`\|/:/;& \cs{adl@act@@vlineL/R}&
% \cs{adl@inactivevl}\\\hline
% \!& $\to$\cs{adl@act@(arg)cr}&
% $\to$\cs{cr}\\\hline
% \cs{hline}& $\to$\cs{adl@act@hline}&
% $\to$\cs{@gobbletwo}\\\hline
% \cs{hdashline}& $\to$\cs{adl@act@ihdashline}&
% $\to$\cs{adl@inactivehdl}\\\hline
% \cs{cdashline}& $\to$\cs{adl@act@cdline}&
% $\to$\cs{adl@inactivecdl}\\\hline
% \end{tabular}}
% \end{table}
%
%
%
% \subsection{Making Preamble}
% \label{sec:imp-pream}
%
% Each preamble character is converted to a part of |\halign|'s preamble as
% follows.
%
% \begin{itemize}
% \item
% \begin{macro}{\adl@colhtdp}
% \changes{v1.5-2}{2002/06/26}
% {The pseudo-formal description of $\langle\hbox{\it put-lrc}\rangle$
% is modified.}
% \SpecialIndex{\adl@box}
% \SpecialIndex{\adl@height}
% \SpecialIndex{\adl@depth}
% `|l|', `|r|' and `|c|' are converted to the following \meta{lrc}.
%
% \begingroup \catcode`\|12
% \begin{eqnarray*}
% \meta{lrc}&::=&
% [\cs{hfil}]\meta{put-lrc}[\cs{hfil}]\\
% \meta{put-lrc}&::=&
% \cs{setbox}\cs{adl@box}\cs{hbox}\Meta{lrc-contents}\\
% && \cs{adl@colhtdp }\cs{unhbox}\cs{adl@box}\\
% \meta{lrc-contents}&::=&
% \hbox{\texttt{\$\cs{relax}\#\$}}\ |\\
% && \hbox{\texttt{\#\cs{unskip}}}\\
% \end{eqnarray*}
% \endgroup
%
% That is, the content of a column is at first packed into the |\box|
% register |\adl@box|, then its height and depth are compared to
% |\adl@height| and |\adl@depth| by the macro |\adl@colhtdp|, and finally
% the box is put with leading and/or trailing |\hfil|.
% \end{macro}
%
% \item
% \begin{macro}{\adl@vlineL}
% \begin{macro}{\adl@vlineR}
% \def\G{{\mit\Gamma}}
% `\verb!|!', `|:|' and |;{|\meta{dash}|/|\meta{gap}|}| are converted to the
% following \meta{vline}.
%
% \begingroup \catcode`\|12
% \begin{eqnarray*}
% \meta{vline}&::=&
% [\cs{hskip}\cs{doublerulesep}]\meta{vline-LR}\\
% \meta{vline-LR}&::=&
% \cs{adl@vlineL}\Meta{$\G_d$}\Meta{$\G_g$}Meta{c}
% \hbox{{\tt\char`\{}\meta{d}/\meta{g}{\tt\char`\}}}\ |\\
% && \cs{adl@vlineR}\Meta{$\G_d$}\Meta{$\G_g$}Meta{c}
% \hbox{{\tt\char`\{}\meta{d}/\meta{g}{\tt\char`\}}}\\
% \meta{d}&::=&
% 0\ |&\hbox to.3\textwidth{\ldots\ for `\texttt{|}'\hfil}\cr
% && \cs{dashlinedash}\ |&
% \hbox to.3\textwidth{\ldots\ for `\texttt{:}'\hfil}\cr
% && \meta{dash}&
% \hbox to.3\textwidth{\ldots\ for `\texttt{;}'\hfil}\cr
% \meta{g}&::=&
% 0\ |&\hbox to.3\textwidth{\ldots\ for `\texttt{|}'\hfil}\cr
% && \cs{dashlinegap}\ |&
% \hbox to.3\textwidth{\ldots\ for `\texttt{:}'\hfil}\cr
% && \meta{gap}&
% \hbox to.3\textwidth{\ldots\ for `\texttt{;}'\hfil}\cr
% \end{eqnarray*}
% \endgroup
%
% \SpecialIndex{\CT@arc@}
% \SpecialIndex{\adl@dashgapcolor}
% Note that \meta{c} is the column number (leftmost is 1) where the
% character appears, and \meta{$\G_d$} and \meta{$\G_g$} is the
% color of dashs and gaps specified in |\CT@arc@| and |\adl@dashgapcolor|.
% \end{macro}\end{macro}
% \end{itemize}
%
% \SpecialIndex{\adl@currentcolumn}
% Additionally, each column except for the last one has;
%
% \begin{quote}
% |\global\advance\adl@currentcolumn\@ne|
% \end{quote}
%
% just before |&| to increment |\adl@currentcolumn|. Other features, such
% as inserting spaces of |\arraycolsep|\slash|\tabcolsep|, are as same as
% original scheme. This means that |@|\Meta{text} and |!|\Meta{text} of
% \textsf{array} are {\em not} handled specially although it could interfere
% with drawing vertical lines. Therefore, we have the problem 1 shown in
% \S\ref{sec:prob}, which is very hard to solve. Note that the measurement
% of the column of `|p|' of \LaTeX{} original is done by (modified)
% |\@@startpbox| and |\@@endpbox| and thus the preamble for `|p|' is not
% modified. In case with \textsf{array}, however, the preambles for `|p|'
% and its relatives `|m|' and `|b|' are modified to set |\adl@box| to the
% box for them.
%
% \begin{macro}{\adl@mkpream}
% \begin{macro}{\@mkpream}
% \changes{v1.4-3-1}{1999/06/25}
% {Modified for new column counting and control sequence redefinition.}
% \changes{v1.71-1}{2004/08/31}
% {Modified to nullify \cs{adl@startmbox} and \cs{adl@endmbox} for
% \textsf{array's} \texttt{m}-columns.}
% \SpecialIndex{\adl@colhtdp}
% \SpecialIndex{\adl@vlineL}
% \SpecialIndex{\adl@vlineR}
% \SpecialIndex{\adl@startmbox}
% \SpecialIndex{\adl@endmbox}
% \SpecialIndex{\adl@preaminit}
% \SpecialIndex{\afterassignment}
%
% To make the preamble shown above, |\@mkpream| is modified to |\let|
% control sequences |\adl@colhtpd|, |\adl@vlineL| and |\adl@vlineR| be
% |\relax| in order to keep them from being expanded by |\edef|\slash
% |\xdef| for the preamble construction. The control sequences
% |\adl@startmbox| and |\adl@endmbox| for \texttt{m}-columns of
% \textsf{array} are also made |\let|-equal to |\relax|.
%
% Giving them their own definition is done by |\adl@preaminit| that is
% called using |\afterassignment| after |\@preamble| is made by
% |\adl@mkpream|, the original version of |\@mkpream|. If \textsf{array} is
% not in use, |\@mkpream| is followed by an |\edef| of |\@preamble| to add
% |\ialign| etc.\ and thus |\adl@preaminit| is properly called {\em after}
% this final {\em assignment} to make |\@preamble|.
%
% With \textsf{array}, on the other hand, calling |\adl@preaminit| is safe
% because |\@mkpream| is followed by |\xdef| for |\@preamble| too, but has
% no effect because it is in the group for |\@mkpream|. This grouping,
% however, gives us an easier way to give those control sequences their own
% definition. That is, we simply initiate them with the definitions that
% will be regained when the group is closed.
%
% \SpecialIndex{\adl@ncol}
% \SpecialIndex{\adl@columns}
% \SpecialIndex{\ifadl@leftrule}
% The modified |\@mkpream| also initializes |\adl@ncol| and
% |\ifadl@leftrule|, and set |\adl@columns| to the value of |\adl@ncol|
% locally after the preamble is made. This has an effect in case without
% \textsf{array} because the body of |array|\slash|tabular| is in the same
% grouping context of |\@mkpream|. With \textsf{array}, on the other hand,
% this assignment has no effect but safe because it is included in a group
% of |\@mkpream|'s own.
% \end{macro}\end{macro}
%
% \begin{macrocode}
%% Making Preamble
\let\adl@mkpream\@mkpream
\def\@mkpream#1{\let\adl@colhtdp\relax
\let\adl@vlineL\relax \let\adl@vlineR\relax
\let\adl@startmbox\relax \let\adl@endmbox\relax
\global\adl@ncol\@ne \adl@leftruletrue
\adl@mkpream{#1}\adl@columns\adl@ncol \afterassignment\adl@preaminit}
% \end{macrocode}
%
% \begin{macro}{\@addamp}
% \changes{v1.4-3-1}{1999/06/25}
% {Modified for new column counting in preamble construction.}
% \SpecialIndex{\adl@currentcolumn}
% \SpecialIndex{\adl@ncol}
%
% The macro |\@addamp| is also modified to add the code for incrementing the
% counter |\adl@currentcolumn| to |\@preamble| with |&|. The counter
% |\adl@ncol| is also incremented by |\@addamp| so that we can refer its
% value as \meta{c} of |\adl@vlineL|\slash|R|\@. This increment is done
% |\global|-ly in order that we locally set |\adl@columns| to the counting
% result outside of the group for |\@mkpream| of \textsf{array}. Therefore,
% whether or not \textsf{array} is in use, |\adl@columns| will have a
% correct value and will be correctly referred by |\hdashline| to know how
% many columns are specified in the preamble. Note that this |\global|
% assignment is safe because the life time of |\adl@ncol| is same as that of
% |\@preamble|.
% \end{macro}
%
% \begin{macrocode}
\def\@addamp{\if@firstamp\@firstampfalse \else
\@addtopreamble{\global\advance\adl@currentcolumn\@ne &}%
\global\advance\adl@ncol\@ne \fi}
% \end{macrocode}
%
% \SpecialIndex{\ifadl@usingarypkg}
% Since the implementation of |\@testpach| and macros for class-0 characters
% (i.e. |l|, |r| and |c|) is completely different between \LaTeX{} and
% \textsf{array}, we have to have two versions switched by
% |\adl@usingarypkg|.
%
% \subsubsection*{With \textsf{array}}
%
% \begin{macro}{\@testpach}
% \changes{v1.4-3-1}{1999/06/25}
% {The version for \textsf{array} is introduced.}
% \SpecialIndex{\@arrayrule}
% \SpecialIndex{\adl@arrayrule}
% \SpecialIndex{\adl@arraydashrule}
% \SpecialIndex{\adl@argarraydashrule}
%
% Although we introduced two preamble characters `|:|' and `|;|', we did not
% introduce new character {\em class} because we want to minimize the
% modification of original codes. Therefore, `|:|' and `|;|' is classified
% into class-1 together with `\verb!|!'\@. Since these characters obviously
% have their own appropriate operations, |\@testpach| is modified so that
% |\@arrayrule|, which is invoked from |\@mkpream| in the case of class-1
% character, is |\let|-equal to the macro corresponding to each character.
% \end{macro}
%
% \begin{macrocode}
\ifadl@usingarypkg
\def\@testpach{\@chclass
\ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
\ifnum \@lastchclass=7 5 \else
\ifnum \@lastchclass=8 \tw@ \else
\ifnum \@lastchclass=9 \thr@@
\else \z@
\ifnum \@lastchclass = 10 \else
\edef\@nextchar{\expandafter\string\@nextchar}%
\@chnum
\if \@nextchar c\z@ \else
\if \@nextchar l\@ne \else
\if \@nextchar r\tw@ \else
\z@ \@chclass
\if\@nextchar |\@ne \let\@arrayrule\adl@arrayrule \else
\if\@nextchar :\@ne \let\@arrayrule\adl@arraydashrule \else
\if\@nextchar ;\@ne \let\@arrayrule\adl@argarraydashrule \else
\if \@nextchar !6 \else
\if \@nextchar @7 \else
\if \@nextchar <8 \else
\if \@nextchar >9 \else
10
\@chnum
\if \@nextchar m\thr@@\else
\if \@nextchar p4 \else
\if \@nextchar b5 \else
\z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi \fi \fi
\fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi}
% \end{macrocode}
%
% \begin{macro}{\@classz}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced because \textsf{array} uses it.}
% \changes{v1.71-1}{2004/08/31}
% {Modified to call \cs{adl@startmbox} and \cs{adl@endmbox} for
% \textsf{array}'s \texttt{m}-columns.}
% \SpecialIndex{\adl@putlrc}
% \SpecialIndex{\adl@box}
% \SpecialIndex{\adl@startmbox}
% \SpecialIndex{\adl@endmbox}
%
% In \textsf{array}, |array| and |tabular| share common macro for class-0
% named |\@classz|, which also generates the preamble for `|p|', `|m|' and
% `|b|'. Thus we modify it to measure the height and depth of the
% class-0 column by the macro |\adl@putlrc|, and to set |\adl@box| to the
% box for `|p|' and its relatives. Note that |m|-type preambles
% (|@chnum|${}=3$) have to be generated by |\adl@startmbox| and
% |\adl@endmbox| because a |\vcenter| construct cannot be assigned by
% to |\adl@box| by |\setbox| directly.
% \end{macro}
%
% \begin{macrocode}
\def\@classz{\@classx
\@tempcnta \count@
\prepnext@tok
\@addtopreamble{\ifcase \@chnum
\hfil
\adl@putlrc{\d@llarbegin \insert@column \d@llarend}\hfil \or
\hskip1sp\adl@putlrc{\d@llarbegin \insert@column \d@llarend}\hfil \or
\hfil\hskip1sp\adl@putlrc{\d@llarbegin \insert@column \d@llarend}\or
\setbox\adl@box\hbox \adl@startmbox{\@nextchar}\insert@column
\adl@endmbox\or
\setbox\adl@box\vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or
\setbox\adl@box\vbox \@startpbox{\@nextchar}\insert@column \@endpbox
\fi}\prepnext@tok}
% \end{macrocode}
%
% \begin{macro}{\adl@class@start}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced for class number identification.}
% \begin{macro}{\adl@class@iiiorvii}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced for class number identification.}
%
% Another stuffs for compatibility are to refer the class number of the
% beginning of preamble which is different between \LaTeX{} and
% \textsf{array}, and that of `|p|' or `|@|' to get the argument of `|;|' as
% explained later. In case with \textsf{array}, the former is class-4
% and we use `|@|' (class-7) for the latter.
% \end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@class@start{4}
\def\adl@class@iiiorvii{7}
% \end{macrocode}
%
% \subsubsection*{Without \textsf{array}}
%
% \begin{macro}{\@testpach}
% \SpecialIndex{\@arrayrule}
% \SpecialIndex{\adl@arrayrule}
% \SpecialIndex{\adl@arraydashrule}
% \SpecialIndex{\adl@argarraydashrule}
%
% The reason why and how we modify |\@testpach| of \LaTeX{} is same as those
% of \textsf{array}.
% \end{macro}
%
% \begin{macrocode}
\else
\def\@testpach#1{\@chclass \ifnum \@lastchclass=\tw@ 4\relax \else
\ifnum \@lastchclass=\thr@@ 5\relax \else
\z@ \if #1c\@chnum \z@ \else
\if #1l\@chnum \@ne \else
\if #1r\@chnum \tw@ \else
\@chclass
\if #1|\@ne \let\@arrayrule\adl@arrayrule \else
\if #1:\@ne \let\@arrayrule\adl@arraydashrule \else
\if #1;\@ne \let\@arrayrule\adl@argarraydashrule \else
\if #1@\tw@ \else
\if #1p\thr@@ \else \z@ \@preamerr 0\fi
\fi \fi \fi \fi \fi \fi \fi \fi \fi}
% \end{macrocode}
%
% \begin{macro}{\@arrayclassz}
% \begin{macro}{\@tabclassz}
% \SpecialIndex{\adl@putlrc}
%
% Since \LaTeX{} has two macros for class-0, one for |array| and the other
% for |tabular|, we have to modify both. Since the box for `|p|' is opened
% by |\@@startpbox|, however, we may not worry about it.
% \end{macro}\end{macro}
%
% \begin{macrocode}
\def\@arrayclassz{\ifcase \@lastchclass \@acolampacol \or \@ampacol \or
\or \or \@addamp \or
\@acolampacol \or \@firstampfalse \@acol \fi
\edef\@preamble{\@preamble
\ifcase \@chnum
\hfil\adl@putlrc{$\relax\@sharp$}\hfil
\or \adl@putlrc{$\relax\@sharp$}\hfil
\or \hfil\adl@putlrc{$\relax\@sharp$}\fi}}
\def\@tabclassz{\ifcase \@lastchclass \@acolampacol \or \@ampacol \or
\or \or \@addamp \or
\@acolampacol \or \@firstampfalse \@acol \fi
\edef\@preamble{\@preamble
\ifcase \@chnum
\hfil\adl@putlrc{\@sharp\unskip}\hfil
\or \adl@putlrc{\@sharp\unskip}\hfil
\or \hfil\hskip\z@ \adl@putlrc{\@sharp\unskip}\fi}}
% \end{macrocode}
%
% \begin{macro}{\adl@class@start}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced for class number identification.}
% \begin{macro}{\adl@class@iiiorvii}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced for class number identification.}
% In \LaTeX{}, the beginning of preamble is class-6 and we use `|p|'
% (class-3) to get the argument of `|;|'.
% \end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@class@start{6}
\def\adl@class@iiiorvii{3}
\fi
% \end{macrocode}
%
% Hereafter, codes for \LaTeX{} and \textsf{array} are common again.
%
% \begin{macro}{\adl@putlrc}
% \changes{v1.5-2}{2002/06/26}
% {\cs{adl@putlrc} must do \cs{unhbox}\cs{adl@box} to make glues
% effective.}
% \SpecialIndex{\adl@box}
% \SpecialIndex{\adl@colhtdp}
%
% The macro |\adl@putlrc| is for class-0 preamble characters to set
% |\adl@box| to the contents of a column, measure its height\slash depth by
% |\adl@colhtdp| and put the box by |\unhbox| (not by |\box|) in order to
% make the glues in the contents effective.
% \end{macro}
%
% \begin{macrocode}
\def\adl@putlrc#1{\setbox\adl@box\hbox{#1}\adl@colhtdp \unhbox\adl@box}
% \end{macrocode}
%
% \begin{macro}{\adl@arrayrule}
% \changes{v1.4-3-1}{1999/06/25}
% {Modified to replace \cs{adl@columns} with \cs{adl@ncol}.}
% \begin{macro}{\adl@arraydashrule}
% \changes{v1.4-3-1}{1999/06/25}
% {Modified to replace \cs{adl@columns} with \cs{adl@ncol}.}
% \begin{macro}{\adl@argarraydashrule}
% \changes{v1.4-3-1}{1999/06/25}
% {Modified to replace \cs{adl@columns} with \cs{adl@ncol}.}
% \changes{v1.4-3-1}{1999/06/25}
% {Modified to pretend \texttt{p} or \texttt{@} depending on if
% \textsf{array} is in use.}
% \begin{macro}{\adl@xarraydashrule}
% \changes{v1.4-3-1}{1999/06/25}
% {Modified to refer \cs{adl@class@start} rather than \LaTeX's 6.}
% \changes{v1.4-3-2}{1999/06/25}
% {Modified to add invisible rule of \cs{arrayrulewidth} wide if
% \cs{ADLsome}\penalty\exhyphenpenalty\texttt{wide}.}
% \changes{v1.7-3}{2004/5/21}
% {Modified to add color arguments to \cs{adl@vline}\texttt{L}\slash
% \texttt{R}}
% \SpecialIndex{\@lastchclass}
% \SpecialIndex{\adl@class@start}
% \SpecialIndex{\ifadl@leftrule}
% \SpecialIndex{\adl@vlineL}
% \SpecialIndex{\adl@vlineR}
% \SpecialIndex{\adl@ncol}
% \SpecialIndex{\CT@arc@}
% \SpecialIndex{\adl@dashgapcolor}
% \SpecialIndex{\color}
% \def\G{{\mit\Gamma}}
%
% The preamble parts for vertical solid- and dash-lines are constructed by
% the macros |\adl@arrayrule| for `\verb!|!', |\adl@arraydashrule| for
% `|:|', and |\adl@argarraydashrule| for `|;|'.\@ The macro;
%
% \begin{quote}
% |\adl@xarraydashrule|\Meta{$c^L$}\Meta{$c^R$}|{|\meta{d}|/|\meta{g}|}|
% \end{quote}
%
% is invoked by them to perform common operations. It at first checks the
% preamble character is the first element of the preamble
% (|\@lastchclass|${}=|\adl@class@start|$) or it follows another character
% for vertical line (|\@lastchclass|${}=1$). If this is not satisfied, the
% vertical line is put at the right edge of a column and thus
% |\ifadl@leftrule| is set to false. Then it adds
% |\adl@vlineL|\Meta{$\G_d$}\Meta{$\G_g$}
% \Meta{$c^L$}|{|\meta{d}|/|\meta{g}|}| if |\ifadl@leftrule| is
% true indicating the vertical line will appear at the left edge of the
% column \meta{$c^L$}, or |\adl@vlineR|\Meta{$\G_d$}\Meta{$\G_g$}
% \Meta{$c^R$}|{|\meta{d}|/|\meta{g}|}| otherwise. Note that \meta{$c^L$}
% is always 1 for {\em main} preamble while \meta{$c^R$} is the column
% number given by |\adl@ncol|, but \meta{$c^L$} may not be 1 for the
% preamble of |\multicolumn| as described in \S\ref{sec:imp-mc}. Also note
% that $\G_d$ and $\G_g$ are |\CT@arc@| and |\adl@dashgapcolor|
% respectively whose bodies are |\color| for dashes and gaps specified by
% |\arrayrulecolor| and |\dashgapcolor|, or |\relax| if they are not colored.
%
% In addition, an invisible |\vrule| of |\arrayrulewidth| wide is added if
% both |\ADL#some#wide| and |\ADLactivate| are in effect, i.e.\ both
% |\ifadl@zwrule| and |\ifadl@inactive| are false, to keep a space for
% the vertical line having {\em real} width.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\adl@classv}
% \begin{macro}{\adl@classvfordash}
% \SpecialIndex{\@nextchar}
% \SpecialIndex{\@chclass}
% \SpecialIndex{\@classv}
% \SpecialIndex{\adl@class@iiiorvii}
%
% The argument of `|;|' is not provided by |\adl@argarraydashrule| but is
% directly passed from the preamble text through |\@nextchar|. This direct
% passing is implemented by the following trick. The macro
% |\adl@argarraydashrule| set |\@chclass| to |\adl@class@iiiorvii| to
% pretend it is for `|p|' if \textsf{array} is not in use, or `|@|'
% otherwise. Then it temporally changes the definition of |\@classv|, which
% is incidentally for the argument of `|p|' and `|@|' in case without/with
% \textsf{array} respectively, to |\adl@classvfordash| to process the
% argument of `|;|' rather than that of `|p|' or `|@|'\@. Then
% |\adl@classvfordash| is invoked by |\@mkpream| and it adds the argument to
% |\@preamble|. Finally, it restores the definition of |\@classv| and set
% |\@chclass| to 1 to indicate that the last item is a vertical line
% specification.
% \end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@arrayrule{%
\adl@xarraydashrule
{\@ne}{\adl@ncol}{{\z@/\z@}}}
\def\adl@arraydashrule{%
\adl@xarraydashrule
{\@ne}{\adl@ncol}%
{{\dashlinedash/\dashlinegap}}}
\def\adl@argarraydashrule{%
\adl@xarraydashrule
{\@ne}{\adl@ncol}{}%
\@chclass\adl@class@iiiorvii \let\@classv\adl@classvfordash}
\def\adl@xarraydashrule#1#2#3{%
\ifnum\@lastchclass=\adl@class@start\else
\ifnum\@lastchclass=\@ne\else
\adl@leftrulefalse \fi\fi
\ifadl@zwvrule\else \ifadl@inactive\else
\@addtopreamble{\vrule\@width\arrayrulewidth
\@height\z@ \@depth\z@}\fi \fi
\ifadl@leftrule
\@addtopreamble{\adl@vlineL{\CT@arc@}{\adl@dashgapcolor}%
{\number#1}#3}%
\else \@addtopreamble{\adl@vlineR{\CT@arc@}{\adl@dashgapcolor}%
{\number#2}#3}\fi}
\let\adl@classv\@classv
\def\adl@classvfordash{\@addtopreamble{{\@nextchar}}\let\@classv\adl@classv
\@chclass\@ne}
%%^L
% \end{macrocode}
%
%
% \subsection{Building Columns}
% \label{sec:imp-col}
%
% \begin{macro}{\adl@preaminit}
% \begin{macro}{\adl@colhtdp}
% \begin{macro}{\adl@vlineL}
% \begin{macro}{\adl@vlineR}
%
% If \textsf{array} is not in use, after the |\@preamble| is completed, the
% control sequences for macros in it should regain their own definition.
% The macro |\adl@preaminit| performs this operation for macros we
% introduced, |\adl@colhtdp|, |\adl@vlineL| and |\adl@vlineR|. For the case
% with \textsf{array}, we will call |\adl@preaminit| in \textsf{arydshln} to
% initiate them with the definitions as described later.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
%% Building Columns
\def\adl@preaminit{\let\adl@colhtdp\adl@@colhtdp
\let\adl@vlineL\adl@@vlineL \let\adl@vlineR\adl@@vlineR}
% \end{macrocode}
%
% \begin{macro}{\adl@@colhtdp}
% For the measurement of the height and depth of a row, |\adl@@colhtdp|
% compares |\adl@height| and |\adl@depth| to the height and depth of
% |\adl@box| which contains the main part of the column to be built, and
% |\global|-ly updates the registers if they are less.
% \end{macro}
%
% \begin{macrocode}
\def\adl@@colhtdp{%
\ifdim\adl@height<\ht\adl@box \global\adl@height\ht\adl@box \fi
\ifdim\adl@depth<\dp\adl@box \global\adl@depth\dp\adl@box\fi}
% \end{macrocode}
%
% \begin{macro}{\adl@@vlineL}
% \changes{v1.7-3}{2004/5/21}
% {Color arguments are added.}
% \begin{macro}{\adl@@vlineR}
% \changes{v1.7-3}{2004/5/21}
% {Color arguments are added.}
% \begin{macro}{\adl@@ivline}
% \changes{v1.7-3}{2004/5/21}
% {Invocations of \cs{adl@setcolor} are added.}
% \begin{macro}{\adl@setcolor}
% \changes{v1.7-3}{2004/5/21}
% {Introduced to color vertical lines.}
% \begin{macro}{\adl@nocolor}
% \changes{v1.7-3}{2004/5/21}
% {Introduced to examine if coloring is specified.}
% \begin{macro}{\adl@dashcolor}
% \changes{v1.7-3}{2004/5/21}
% {Introduced as the temporary variable of color specification of
% dashes.}
% \begin{macro}{\adl@gapcolor}
% \changes{v1.7-3}{2004/5/21}
% {Introduced as the temporary variable of color specification of
% gaps.}
% \SpecialIndex{\color}
% \SpecialIndex{\current@color}
% \def\G{{\mit\Gamma}} \let\g\gamma
% The macro
% |\adl@@vlineL|\meta{$\G_d$}\meta{$\G_g$}\meta{c}|{|\meta{d}|/|\meta{g}|}|
% adds the element
% $e=\langle c,d,g\rangle={}$
% |\@elt|\Meta{c}\Meta{d}\Meta{g}\Meta{$\g_d$}\Meta{$\g_g$} to the tail of
% the list |\adl@colsL| to construct $C^L_i$, where $\g_d$ and $\g_g$ are
% the color specifications given by |\color| macros in $\G_d$ and $\G_g$.
% The macro |\add@@vlineR| performs similar operation but the element is
% added to the head of |\adl@colsR| for $C^R_i$ because it is processed
% right-to-left manner. The argument \meta{d} and \meta{g} are extracted by
% the macro |\adl@ivline| which converts given dimensional values of them to
% integers. It also set \meta{d} and \meta{g} to 0 (i.e. solid-line) if one
% of given values are not positive, in order to make it sure that one dash
% segment has positive length. Then it invokes |\adl@setcolor| to define
% |\adl@dashcolor| and |\adl@gapcolor| with the color specification of
% $\G_d$ and $\G_g$. Since |\adl@setcolor| locally expands |\color| macro
% in $\G_d$ and $\G_g$ to define |\currnet@color| that becomes the body of
% |\adl@dashcolor| ($\g_d$) and |\adl@gapcolor| ($\g_g$) with expansion,
% different |\color| specifications of a color, such as |\color{red}|
% and |\color[rgb]{1,0,0}|, will produce a unified result such as
% |{rgb 1 0 0}|. If $\G_d$ or $\G_g$ is |\relax| which is the body of
% |\adl@nocolor|, $\g_d$ or $\g_g$ is also |\relax| to indicate dashes are
% colored (or not colored) as done in outer world and gaps are transparent.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@@vlineL#1#2#3#4{\adl@ivline#4\@nil{#1}{#2}%
\xdef\adl@colsL{\adl@colsL
\@elt{#3}{\number\@tempcnta}{\number\@tempcntb}%
{\adl@dashcolor}{\adl@gapcolor}}}
\def\adl@@vlineR#1#2#3#4{\adl@ivline#4\@nil{#1}{#2}%
\xdef\adl@colsR{%
\@elt{#3}{\number\@tempcnta}{\number\@tempcntb}%
{\adl@dashcolor}{\adl@gapcolor}%
\adl@colsR}}
\def\adl@ivline#1/#2\@nil#3#4{%
\@tempdima#1\relax \@tempcnta\@tempdima
\@tempdima#2\relax \@tempcntb\@tempdima
\ifnum\@tempcnta>\z@ \else \@tempcnta\z@ \@tempcntb\z@ \fi
\ifnum\@tempcntb>\z@ \else \@tempcnta\z@ \@tempcntb\z@ \fi
\adl@setcolor\adl@dashcolor{#3}\adl@setcolor\adl@gapcolor{#4}}
\def\adl@setcolor#1#2{\def\@tempa{#2}\ifx\@tempa\adl@nocolor \def#1{\relax}%
\else{#2\xdef#1{\current@color}}\fi}
\def\adl@nocolor{\relax}
% \end{macrocode}
%
% \begin{macro}{\adl@colhtdp}
% \changes{v1.4-3-1}{1999/06/25}
% {Initialized by calling \cs{adl@preaminit}.}
% \begin{macro}{\adl@vlineL}
% \changes{v1.4-3-1}{1999/06/25}
% {Initialized by calling \cs{adl@preaminit}.}
% \begin{macro}{\adl@vlineR}
% \changes{v1.4-3-1}{1999/06/25}
% {Initialized by calling \cs{adl@preaminit}.}
% \SpecialIndex{\adl@preaminit}
%
% After |\adl@@colhtdp|, |\adl@@vlineL| and |\adl@@vlineR| are defined,
% we call |\adl@preaminit| to |\let| their single |@| counterparts be equal
% to them. Therefore, in case with \textsf{array}, |\adl@colhtdp| etc.\ are
% temporarily |\relax| when |\@preamble| is being generated in the group of
% |\@mkpream|, and regain their own definition outside the group where
% the completed |\@preamble| is referred.
% \end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\adl@preaminit
% \end{macrocode}
%
% \begin{macro}{\adl@inactivevl}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to emulate `\texttt{:}' and \texttt{;} by
% \protect\VERTBAR.}
% \changes{v1.7-3}{2004/5/21}
% {Modified to color the \cs{vline} by the first argument.}
% \SpecialIndex{\ifadl@zwvrule}
%
% If |\ADLinactivate| is in effect, |\adl@vlineL|\slash|R| and
% |\adl@@vlineL|\slash|R| are |\let|-equal
% to |\adl@inactivevl|. This macro simply put a |\vrule| by |\vline| with
% |\color| (or |\relax|) in its first argument and
% with\slash without negative |\hskip| of a half of |\arrayrulewidth| wide
% depending on |\ifadl@zwvrule|, discarding other arguments.
% \end{macro}
%
% \begin{macrocode}
\def\adl@inactivevl#1#2#3#4{\ifadl@zwvrule \hskip-.5\arrayrulewidth \fi
{#1\vline}\ifadl@zwvrule \hskip-.5\arrayrulewidth \fi}
% \end{macrocode}
%
%
% \begin{macro}{\@@startpbox}
% \begin{macro}{\@@endpbox}
% \begin{macro}{\@endpbox}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced because \textsf{array} uses it.}
% \begin{macro}{\adl@startmbox}
% \changes{v1.71-1}{2004/08/31}
% {Introduced to the bug fix of \textsf{array}'s \texttt{m}-columns.}
% \begin{macro}{\adl@endmbox}
% \changes{v1.71-1}{2004/08/31}
% {Introduced to the bug fix of \textsf{array}'s \texttt{m}-columns.}
% \SpecialIndex{\@finalstrut}
% \SpecialIndex{\@startpbox}
% \SpecialIndex{\adl@box}
% \SpecialIndex{\adl@colhtdp}
%
% The macros to make |\parbox| for `|p|' (and `|b|' of
% \textsf{array}), |\@@startpbox| and \hbox{|\@@endpbox|}, are modified for
% height\slash depth measurement. The code for |\@@endpbox| is based on
% that of \LaTeXe{} to fix the bug of |\strut|-ing in \LaTeX-2.09, but
% |\@finalstrut| is manually expanded because it is not available in
% \LaTeX-2.09.
%
% In \textsf{array}, |\@@endpbox| is not used but |\@endpbox| is.
% Therefore, we |\let| them be equal. As for |\@startpbox|, however, we may
% not worry about it because we have modified \hbox{|\@classz|} in
% \S\ref{sec:imp-pream} for the measurement. However, we have to take care
% of |m|-type columns specially because its body |\vcenter| cannot be
% assigned directly to |\adl@box| by |\setbox|\footnote{
%
% The author had forgotten this fact until Morten H\o gholm pointed out it.
% Thanks Morten.}.
%
% Thus we enclose a |$\vcenter{|\ldots|}$| construct in a |\hbox| and assign
% it to |\adl@box|. The macro |\adl@startmbox| opens the construct with
% \textsf{array}'s |\@startpbox|, while |\adl@endmbox| closes it calling
% |\adl@org@endpbox| which is the unmodified |\@endpbox| of \textsf{array}
% and measures the height and depth of the |\hbox| by |\adl@colhtdp|.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\@@startpbox#1{\setbox\adl@box\vtop\bgroup \hsize#1\@arrayparboxrestore}
\def\@@endpbox{\unskip \ifhmode \nobreak
\vrule\@width\z@\@height\z@\@depth\dp\@arstrutbox \fi
\par \egroup \adl@colhtdp \box\adl@box \hfil}
\let\@endpbox\@@endpbox
\def\adl@startmbox{\bgroup $\vcenter\@startpbox}
\def\adl@endmbox{\adl@org@endpbox $\egroup \adl@colhtdp \box\adl@box \hfil}
%%^L
% \end{macrocode}
%
%
%
% \subsection{Multi-columns}
% \label{sec:imp-mc}
%
% \begin{macro}{\multicolumn}
% \changes{v1.4-3-1}{1999/06/25}
% {Modified for several reason.}
% \begin{macro}{\adl@preamble}
% \begin{macro}{\adl@mcaddamp}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced for the complaint on multiple columns if with
% \textsf{array}.}
% \begin{macro}{\adl@activatepbox}
% \changes{v1.4-3-1}{1999/06/25}
% {Introduced to do nothing if with \textsf{array}.}
%
% The macro |\multicolumn| is modified for the followings.
%
% \begin{itemize}
% \item
% The macros to construct the parts of |\@preamble| for vertical lines,
% |\adl@arrayrule|, |\adl@arraydashrule| and |\adl@argarraydashrule|, have
% to perform operations slightly different from those for main preamble.
% Thus they are |\def|-ined to multi-column version |\adl@mcarrayrule|, etc.
% \changes{v1.3}{1998/10/08}
% {\cs{def}-s for \cs{adl@mcarrayrule} etc. are enclosed in a group.}
% These |\def|-initions are enclosed in a group so that they are not
% affected to |array| or |tabular| which may occur in the third argument of
% |\multicolumn|. In order to make |\@preamble| work well outside of the
% group containing |\@makepream|, |\adl@preamble| is |\global|-ly |\let|-equal
% to |\@preamble| just after |\@makepream| in the group and then
% reverse |\let|-assignment is performed just after the group is closed.
% These global assignment is unnecessary with \textsf{array} because
% |\@preamlbe| is constructed |\global|-ly, but safe.
%
% Since this grouping nullifies the effect of |\adl@preaminit| called in
% |\@mkpream|, we call |\adl@preaminit| again after the group closing.
%
% \item
% In \textsf{array}, |\@addamp| to make |\@preamble| for |\multicolumn| has
% a different definition from that for main one. Thus it is |\let|-equal
% to |\adl@mcaddamp| whose definition is switched by |\ifadl@usingarypkg|.
%
% \item
% If \textsf{array} is in use, |\@preamble| has to be |\xdef|-ed once again
% by |\@addpreamble| with an |\@empty| argument after |\@mkpreamble| to
% expand the contents of |\toks| registers. This is performed whether or
% not with \textsf{array} because it is safe.
%
% \item
% As done in |\@array|, |\set@typeset@protect| is replaced with direct
% |\let|.
%
% \item
% If without \textsf{array}, |\@startpbox| and |\@endpbox| should be
% |\let|-equal to their |@@| counterparts, while should not with
% \textsf{array}. Thus we define |\adl@activatepbox| to do or not to do so
% depending on |\ifadl@usingarypkg|.
%
% \item
% The counter |\adl@currentcolumn| is |\global|-ly incremented by the first
% argument of |\multicolumn| (number of columns to be |\span|-ned).
% \end{itemize}
%
% Note that |\adl@columns| is modified by |\@mkpream|, but it is not
% referred |\adl@mcarrayrule| etc., and its value is restored before
% referred by |\hdashline|, etc.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \SpecialIndex{\adl@arrayrule}
% \SpecialIndex{\adl@arraydashrule}
% \SpecialIndex{\adl@argarraydashrule}
% \SpecialIndex{\adl@mcarrayrule}
% \SpecialIndex{\adl@mcarraydashrule}
% \SpecialIndex{\adl@mcargarraydashrule}
% \SpecialIndex{\ifadl@usingarypkg}
% \SpecialIndex{\adl@currentcolumn}
%
% \begin{macrocode}
%% Multi-Columns
\def\multicolumn#1#2#3{\multispan{#1}\begingroup \begingroup
\def\adl@arrayrule{\adl@mcarrayrule{#1}}%
\def\adl@arraydashrule{\adl@mcarraydashrule{#1}}%
\def\adl@argarraydashrule{\adl@mcargarraydashrule{#1}}%
\let\@addamp\adl@mcaddamp
\@mkpream{#2}\@addtopreamble\@empty
\global\let\adl@preamble\@preamble \endgroup
\let\@preamble\adl@preamble
\def\@sharp{#3}\let\protect\relax
\adl@activatepbox
\adl@preaminit
\@arstrut \@preamble\hbox{}\endgroup
\global\advance\adl@currentcolumn#1\ignorespaces}
\ifadl@usingarypkg
\def\adl@mcaddamp{\if@firstamp\@firstampfalse \else\@preamerror5\fi}
\let\adl@activatepbox\relax
\else
\let\adl@mcaddamp\@addamp
\def\adl@activatepbox{\let\@startpbox\@@startpbox
\let\@endpbox\@@endpbox}
\fi
% \end{macrocode}
%
% \begin{macro}{\adl@mcarrayrule}
% \begin{macro}{\adl@mcarraydashrule}
% \begin{macro}{\adl@mcargarraydashrule}
% \changes{v1.4-3-1}{1999/06/25}
% {Modified to pretend \texttt{p} or \texttt{@} depending on if
% \textsf{array} is in use.}
% \SpecialIndex{\adl@arrayrule}
% \SpecialIndex{\adl@arraydashrule}
% \SpecialIndex{\adl@argarraydashrule}
% \SpecialIndex{\adl@currentcolumn}
%
% The preamble parts for vertical lines are constructed by the macros
% |\adl@mcarrayrule|, |\adl@mcarraydashrule| and |\adl@mcargarraydashrule|
% which are passed the first argument \meta{$n$} of |\multicolumn| to know
% the number of columns to be |\span|-ned. They are similar to their
% relatives for main preamble, |\adl@arrayrule|, etc., but the arguments
% \meta{$c^L$} and \meta{$c^R$} passed to |\adl@xarraydashrule| are;
% $$
% c^L=c,\qquad c^R=c+n-1
% $$
% where $c={}$|\adl@currentcolumn|. This makes leading vertical lines drawn
% at the left edge of the leftmost |\span|-ned column and trailing ones at
% the right edge of the rightmost column.
% \end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@mcarrayrule#1{\@tempcnta#1\advance\@tempcnta\adl@currentcolumn
\advance\@tempcnta\m@ne
\adl@xarraydashrule
{\adl@currentcolumn}{\@tempcnta}{{\z@/\z@}}}
\def\adl@mcarraydashrule#1{\@tempcnta#1\advance\@tempcnta\adl@currentcolumn
\advance\@tempcnta\m@ne
\adl@xarraydashrule
{\adl@currentcolumn}{\@tempcnta}%
{{\dashlinedash/\dashlinegap}}}
\def\adl@mcargarraydashrule#1{\@tempcnta#1\advance\@tempcnta\adl@currentcolumn
\advance\@tempcnta\m@ne
\adl@xarraydashrule
{\adl@currentcolumn}{\@tempcnta}{}%
\@chclass\adl@class@iiiorvii \let\@classv\adl@classvfordash}
%%^L
% \end{macrocode}
%
%
%
% \subsection{End of Rows}
% \label{sec:imp-eor}
%
% \begin{macro}{\@xarraycr}
% \changes{v1.4-3-1}{1999/06/25}
% {The version for \textsf{array} is introduced.}
% \begin{macro}{\@xtabularcr}
% \begin{macro}{\@xargarraycr}
% \begin{macro}{\@yargarraycr}
% \SpecialIndex{\ifadl@usingarypkg}
%
% At the end of the $i\th$ row, we have to calculate $h_i$ which is the height
% plus depth of the row, and add elements \meta{$C^L_i,h_i$} and
% \meta{$C^R_i,h_i$} to $R^L$ and $R^R$. To do this, |\cr|-s in the macros
% \hbox{|\@xarraycr|}, |\@xtabularcr|, |\@xargarraycr| are replaced with our
% own |\adl@cr|. The macro |\@yargarraycr|\meta{dimen} is also modified but
% its |\cr| is replaced with |\adl@argcr|\meta{dimen} to add (negative)
% |\dimen| to $h_i$. Note that |\@xargarraycr|\meta{dimen} uses ordinary
% |\adl@cr| because the extra vertical space of \meta{dimen} is inserted to
% the last column.
%
% Note that the implementation of |\@xarraycr| is slightly different between
% \LaTeX{} and \textsf{array}, we have to have two versions and choose one.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
%% End of row
\ifadl@usingarypkg
\def\@xarraycr{\@ifnextchar[{\@argarraycr}{\ifnum0=`{}\fi\adl@cr}}
\else
\def\@xarraycr{\@ifnextchar[{\@argarraycr}{\ifnum0=`{\fi}${}\adl@cr}}
\fi
\def\@xtabularcr{\@ifnextchar[{\@argtabularcr}{\ifnum0=`{\fi}\adl@cr}}
\def\@xargarraycr#1{\@tempdima#1\advance\@tempdima\dp\@arstrutbox
\vrule\@height\z@\@depth\@tempdima\@width\z@
\adl@cr}
\def\@yargarraycr#1{\adl@argcr{#1}\noalign{\vskip #1}}
% \end{macrocode}
%
% \begin{macro}{\adl@cr}
% \begin{macro}{\adl@argcr}
% The macro |\adl@cr| and |\adl@argcr| perform |\cr| and then invoke the
% common macro |\adl@@cr|\meta{x}. The argument \meta{x} is the extra
% (negative) vertical space for |\adl@argcr|, while it is 0 for |\adl@cr|.
% \end{macro}\end{macro}
%
% \begin{macro}{\adl@@cr}
% \changes{v1.4-3-6}{1999/06/25}
% {Modified to set \cs{adl@finaldepth}.}
% \changes{v1.6-1}{2003/8/25}
% {Modified to insert \cs{adl@discard}.}
% \SpecialIndex{\@arstrutbox}
% \SpecialIndex{\adl@totalheight}
% \SpecialIndex{\adl@colsL}
% \SpecialIndex{\adl@colsR}
% \SpecialIndex{\adl@rowsL}
% \SpecialIndex{\adl@rowsR}
% \SpecialIndex{\adl@connect}
% \SpecialIndex{\adl@discard}
% \SpecialIndex{\adl@finaldepth}
% \SpecialIndex{\adl@height}
% \SpecialIndex{\adl@depth}
% \SpecialIndex{\adl@currentcolumn}
%
% The macro |\adl@@cr|\meta{x} at first calculate $h_i$ as follows. The
% registers |\adl@height|${}=\eta$ and |\adl@depth|${}=\delta$ have the
% maximum height and depth of the columns in the row. However, they could
% be smaller than the height and/or depth of |\@arstrutbox|, $\eta_s$ and
% $\delta_s$. If so, the height and/or depth of the row are $\eta_s$ and
% $\delta_s$. Therefore, $h_i$ is caluclated by;
% $$
% h_i = \max(\eta,\eta_s) + \max(\delta,\delta_s).
% $$
% Additionally, if the extra space \meta{x} is negative, a vertical space of
% $x$ is inserted below the row\footnote{
%
% Before v1.54, negative \meta{x} shrinks the hight of the row by $\vert
% x\vert$. Although the former result may be more appropriate if the row
% has vertical lines than the current because lines extrude to the next row
% now, new feature is considered compatible with original
% \texttt{array}\slash \texttt{tabular}.}.
%
% Thus the integer value of $h_i+x$ is
% |\global|-ly added to |\adl@totalheight|, and the elements
% \meta{$C^L_i{=}\cs{adl@colsL},h_i$} and
% \meta{$C^R_i{=}\cs{adl@colsR},h_i$} are added to the tail of
% $R^L={}$|\adl@rowsL| and $R^C={}$|\adl@rowsR|\@. If $x$ is not 0
% (negative), {\it discard}$(x)$ or {\it connect}$(x)$ is also added after
% \meta{$C^{L/R}_i,h_i$} according to the current environment (|longtable|
% or not). In the real implementation, $R^L$ and $R^C$ has the following
% format of \meta{rows}.
%
%
% \begin{eqnarray*}
% \meta{rows}&::=&
% [\meta{row}\hbox{\tt;}]^*\\
% \meta{row}&::=&
% \hbox{{\tt(}\meta{cols}{\tt/}\meta{$h_i$}{\tt)}}\\
% \meta{cols}&::=&
% [\hbox{\cs{elt}\Meta{c}\Meta{d}\Meta{g}}]^*\ \vert\qquad\qquad&
% \hbox to.3\textwidth{\ldots\ $C^L$ or $C^R$\hss}\cr
% && \cs{adl@connect}\ \vert&
% \hbox to.3\textwidth{\ldots\ for {\it connect}$(h_i)$\hss}\cr
% && \cs{adl@discard}\ \vert&
% \hbox to.3\textwidth{\ldots\ for {\it discard}$(h_i)$\hss}\cr
% && \cs{relax}&
% \hbox to.3\textwidth{\ldots\ for {\it disconnect}$(h_i)$\hss}\cr
% \noalign{\vskip-\baselineskip}
% \end{eqnarray*}
%
% Since |\adl@discard| is |\def|-ined as |\adl@connect| by |\adl@arrayinit|,
% added |\adl@discard| transforms itself into |\adl@connect| if current
% envrionment is not |longtable|. Otherwise, as we make |\adl@discard|
% |\let|-equal to |\relax| when a |longtable| environment starts, it keeps
% its own form.
%
% Then, |\adl@finaldepth| is set to |\adl@depth| if $x$ is zero, or to zero
% otherwise (negative), in order to make the depth |array|\slash|tabular|
% equal to that of the last row. Finally, |\adl@colsL|, |\adl@colsR|,
% |\adl@currentcolumn|, |\adl@height| and |\adl@depth| are reinitialized to
% process the next row.
% \end{macro}
%
% \begin{macrocode}
\def\adl@cr{\cr\noalign{\adl@@cr\z@}}
\def\adl@argcr#1{\cr\noalign{\adl@@cr{#1}}}
\def\adl@@cr#1{
\ifdim\adl@height<\ht\@arstrutbox \adl@height\ht\@arstrutbox\fi
\ifdim\adl@depth<\dp\@arstrutbox \adl@depth\dp\@arstrutbox\fi
\advance\adl@height\adl@depth
\global\advance\adl@totalheight\adl@height
\@tempdima#1\relax \global\advance\adl@totalheight\@tempdima
\xdef\adl@rowsL{\adl@rowsL
(\adl@colsL/\number\adl@height);%
\ifdim#1=\z@\else (\adl@discard/\number\@tempdima);\fi}%
\xdef\adl@rowsR{\adl@rowsR
(\adl@colsR/\number\adl@height);%
\ifdim#1=\z@\else (\adl@discard/\number\@tempdima);\fi}%
\gdef\adl@colsL{}\gdef\adl@colsR{}
\global\adl@currentcolumn\@ne
\ifdim#1=\z@ \global\adl@finaldepth\adl@depth
\else \global\adl@finaldepth\z@\fi
\global\adl@height\z@ \global\adl@depth\z@}
%%^L
% \end{macrocode}
%
%
%
% \subsection{Horizontal Lines}
% \label{sec:imp-hline}
%
% \begin{macro}{\hline}
% \changes{v1.4-3-6}{1999/06/25}
% {Modified to set \cs{adl@finaldepth} to zero.}
% \changes{v1.7-1}{2004/5/21}
% {Modified to shift up if null-wide.}
% \begin{macro}{\cline}
% \changes{v1.4-3-6}{1999/06/25}
% {Modified to set \cs{adl@finaldepth} to zero.}
% \changes{v1.7-1}{2004/5/21}
% {Modified to shift up if null-wide.}
% \SpecialIndex{\adl@hline}
% \SpecialIndex{\adl@xhline}
% \SpecialIndex{\adl@connect}
% \SpecialIndex{\adl@finaldepth}
% \SpecialIndex{\adl@org@cline}
%
% The macro |\hline| is modified to insert |\vskip-\arrayrulewidth| before
% drawing if |\ADLnullwidehline| is in effect, or to add the element ${\it
% connect}(w)={}$|(\adl@connect/|\allowbreak|\number\arrayrulewidth)| to the
% end of $R^L$ and $R^R$ by |\adl@hline| otherwise. The other modifications
% are to set |\adl@finaldepth| to zero for the case that the last vertical
% item is |\hline|, and to check if it is followed by not only |\hline| but
% also |\hdashline| by |\adl@xhline|.
%
% The macro |\cline| is also modified to set |\adl@finaldepth| to zero. As
% for the feature of |\ADLnullwidehline|, it inserts |\vskip-\arrayrulewidth|
% to shift the line up befor drawing, and |\vskip\arrayrulewidth| after
% drawing to cancel the negative skip inserted by |\adl@org@cline|.
% \end{macro}\end{macro}
%
% \begin{macrocode}
%% Horizontal Lines
\def\hline{\noalign{\ifnum0=`}\fi
\ifadl@zwhrule \vskip-\arrayrulewidth
\else \adl@hline\adl@connect\arrayrulewidth \fi
\hrule\@height\arrayrulewidth
\global\adl@finaldepth\z@
\futurelet\@tempa\adl@xhline}
\def\cline#1{\noalign{\global\adl@finaldepth\z@
\ifadl@zwhrule \vskip-\arrayrulewidth\fi}
\adl@org@cline{#1}%
\noalign{\ifadl@zwhrule \vskip\arrayrulewidth\fi}}
% \end{macrocode}
%
% \begin{macro}{\hdashline}
% \changes{v1.4-3-5}{1999/06/25}
% {Modified to make \cs{adl@hdashline} usable for
% \cs{first}\slash\texttt{lasthdashline}.}
% \begin{macro}{\adl@hdashline}
% \changes{v1.4-3-5}{1999/06/25}
% {Modified to be usable for
% \cs{first}\slash\texttt{lasthdashline}.}
% \changes{v1.7-1}{2004/5/21}
% {Modified for null-wide horizontal lines.}
% \begin{macro}{\adl@ihdashline}
% \changes{v1.4-3-5}{1999/06/25}
% {Introduced as the substitute of old \cs{adl@hdashline}.}
% \changes{v1.7-1}{2004/5/21}
% {\cs{adl@hline} is moved to \cs{adl@hdashline} for null-wide lines.}
% \SpecialIndex{\adl@hcline}
% \SpecialIndex{\dashlinedash}
% \SpecialIndex{\dashlinegap}
%
% The macro |\hdashline| calls |\adl@hdashline| to open the |\noalign|
% construct by the well-known trick |{\ifnum0=`}\fi| and then to invoke
% |\adl@ihdashline| checking the existence of its optional argument
% |[|\meta{dash}|/|\meta{gap}|]|. Before the invocation, it inserts
% |\vskip-\arrayrulewidth| if |\ADLnullwidehline| is in effect, or adds
% ${\it connect}(w)$ to the end of $R^L$ and $R^R$. Then |\adl@ihdashline|
% closes the |\noalign| by |\ifnum0=`{\fi}| to start the pseudo row for the
% horizontal dash-line. Before the dash-line is drawn by |\adl@hcline|
% which is also used for |\cdashline|, all the columns are |\span|-ned by
% giving |\adl@columns| to |\multispan|. Finally, the |\noalign| is opened
% again and |\adl@xhline| is invoked to check whether |\h(dash)line| is
% followed.
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\adl@inactivehdl}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to emulate \cs{hdashline} by \cs{hline}.}
% \changes{v1.7-1}{2004/5/21}
% {Modified to shift up if null-wide.}
%
% If |\ADLinactivate| is in effect, |\adl@ihdashline| is |\let|-equal
% to |\adl@inactivehdl|. This macro simply puts a |\hrule| discarding its
% arguments after inserting |\vskip|\allowbreak|-\arrayrulewidth| if
% |\ADLnullwidehline| is in effect.
% \end{macro}
%
% \begin{macrocode}
\def\hdashline{\adl@hdashline\adl@ihdashline}
\def\adl@hdashline#1{\noalign{\ifnum0=`}\fi
\ifadl@zwhrule \vskip-\arrayrulewidth
\else \adl@hline\adl@connect\arrayrulewidth \fi
\@ifnextchar[%]
{#1}%
{#1[\dashlinedash/\dashlinegap]}}
\def\adl@ihdashline[#1/#2]{\ifnum0=`{\fi}%
\multispan{\adl@columns}\unskip \adl@hcline\z@[#1/#2]%
\noalign{\ifnum0=`}\fi
\futurelet\@tempa\adl@xhline}
\def\adl@inactivehdl[#1/#2]{\ifadl@zwhrule \vskip-\arrayrulewidth \fi
\hrule\@height\arrayrulewidth
\futurelet\@tempa\adl@xhline}
% \end{macrocode}
%
% \begin{macro}{\adl@xhline}
% \SpecialIndex{\@xhline}
%
% The macro |\adl@xhline| is the counterpart of the original |\@xhline|.
% This is introduced to check the mixed sequence of |\hline| and
% |\hdashline|, and to add the element ${\it
% disconnect}(s)={}$|(\relax/\doublerulesep)| to the end of $R^L$ and $R^R$
% by |\adl@hline| if a pair of |\h(dash)line| is found.
% \end{macro}
%
% \begin{macrocode}
\def\adl@xhline{\ifx\@tempa\hline \adl@ixhline\fi
\ifx\@tempa\hdashline \adl@ixhline\fi
\ifnum0=`{\fi}}
\def\adl@ixhline{\vskip\doublerulesep \adl@hline\relax\doublerulesep}
% \end{macrocode}
%
% \begin{macro}{\adl@hline}
% \SpecialIndex{\adl@totalheight}
% \SpecialIndex{\adl@rowsL}
% \SpecialIndex{\adl@rowsR}
%
% The macro |\adl@hline|\meta{cs}\meta{dimen} |\global|-ly adds the integer
% value of \meta{dimen} to |\adl@totalheight| and adds the element
% |(|\meta{cs}|/\number|\meta{dimen}|)| to the tail of $R^L$ and $R^R$. The
% arguments \meta{cs}\meta{dimen} are |\adl@connect\arrayrulewidth| for
% ${\it connect}(w)$ or |\relax\doublerulesep| for ${\it disconnect}(s)$.
% \end{macro}
%
% \begin{macrocode}
\def\adl@hline#1#2{\@tempcnta#2
\global\advance\adl@totalheight\@tempcnta
\xdef\adl@rowsL{\adl@rowsL
(#1/\number\@tempcnta);}%
\xdef\adl@rowsR{\adl@rowsR
(#1/\number\@tempcnta);}}
% \end{macrocode}
%
% \begin{macro}{\cdashline}
% \changes{v1.4-3-7}{1999/06/25}
% {Modified to call renamed \cs{adl@cdline}.}
% \begin{macro}{\adl@cdline}
% \changes{v1.4-3-7}{1999/06/25}
% {Renamed and modified to call renamed \cs{adl@cdlinea}\slash
% \texttt{b}.}
% \changes{v1.7-1}{2004/5/21}
% {Modified to shift up if null-wide.}
% \begin{macro}{\adl@cdlinea}
% \changes{v1.4-3-7}{1999/06/25}
% {Renamed.}
% \begin{macro}{\adl@cdlineb}
% \changes{v1.4-3-7}{1999/06/25}
% {Renamed.}
% \SpecialIndex{\@cline}
% \SpecialIndex{\adl@cla}
% \SpecialIndex{\adl@clb}
% \SpecialIndex{\adl@org@cline}
% \SpecialIndex{\adl@hcline}
%
% The macro |\cdashline| at first opens |\noalign| and then invokes
% |\adl@cdline| checking the existence of its optional argument
% |[|\meta{dash}|/|\meta{gap}|]|. The macro |\adl@cdline| first inserts
% |\vskip-\arrayrulewidth| if |\ADLnullwidehline| is in effect. Then it
% performs column |\span|-ing by the code based on that of |\@cline| in
% \LaTeX-2.09 because \LaTeXe's version will not work with \LaTeX-2.09. The
% main job is done by |\adl@hcline| after the target columns are |\span|-ned
% by |\adl@cdlinea| or |\adl@cdlineb|.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\adl@inactivecdl}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to emulate \cs{cdashline} by \cs{cline}.}
% \changes{v1.7-1}{2004/5/21}
% {Modified to invoke \cs{cline} rather than \cs{adl@orgcline} for
% null-wide.}
%
% If |\ADLinactivate| is in effect, |\adl@cdline| is |\let|-equal
% to |\adl@inactivecdl|. This macro simply calls our own |\cline|, after
% closing the |\noalign| opened by |\cdashline|.
% \end{macro}
%
% \begin{macrocode}
\def\cdashline#1{\noalign{\ifnum0=`}\fi
\@ifnextchar[%]
{\adl@cdline[#1]}%
{\adl@cdline[#1][\dashlinedash/\dashlinegap]}}
\def\adl@cdline[#1-#2]{\ifadl@zwhrule \vskip-\arrayrulewidth \fi
\global\adl@cla#1\relax
\global\advance\adl@cla\m@ne
\ifnum\adl@cla>\z@ \global\let\@gtempa\adl@cdlinea
\else \global\let\@gtempa\adl@cdlineb\fi
\global\adl@clb#2\relax
\global\advance\adl@clb-\adl@cla \ifnum0=`{\fi}
\@gtempa{-\arrayrulewidth}}
\def\adl@cdlinea{\multispan\adl@cla &\multispan\adl@clb \unskip \adl@hcline}
\def\adl@cdlineb{\multispan\adl@clb \unskip \adl@hcline}
\def\adl@inactivecdl[#1-#2][#3]{\ifnum0=`{\fi}\cline{#1-#2}}
% \end{macrocode}
%
% \begin{macro}{\adl@hcline}
% \changes{v1.4-3-4}{1999/06/25}
% {Modified to use \cs{adl@draw}.}
% \changes{v1.54-3}{2003/08/25}
% {Omit \cs{vskip} if the space is 0.}
% \changes{v1.7-1}{2004/5/21}
% {Modified not to shift null-wide \cs{cdashline} down.}
% \SpecialIndex{\adl@draw}
% \SpecialIndex{\adl@vrule}
% \SpecialIndex{\adl@finaldepth}
%
% The macro |\adl@hcline|\meta{w}|[|\meta{d}|/|\meta{g}|]| draws a
% horizontal dash-line of dash size $d$ and gap size $g$ for |\hdashline|
% and |\cdashline| in the |\span|-ned columns by |\adl@draw|. As we will
% discussed in \S\ref{sec:imp-draw}, the macro requires $d$ and $g$ are
% passed through |\@tempdima| and \hbox{|\@tempdimb|}, and control sequences
% \meta{rule}, \meta{skip} and \meta{box} are passed through its arguments
% to make it usable for both horizontal and vertical lines. Then the
% vertical space of $w$, $-$|\arrayrulewidth| for |\cdashline|, is
% inserted if it is not 0 (for |\hdashline|) and |\ADLnullwidehline| is not
% in effect.
% \end{macro}
%
% \begin{macrocode}
\def\adl@hcline#1[#2/#3]{\@tempdima#2\relax \@tempdimb#3\relax
\adl@draw\adl@vrule\hskip\hbox \cr
\noalign{\global\adl@finaldepth\z@ \ifdim#1=\z@\else
\ifadl@zwhrule\else \vskip#1\fi\fi}}
% \end{macrocode}
%
% \begin{macro}{\firsthdashline}
% \changes{v1.4-3-5}{1999/06/25}
% {Introduced as the dashed version of \cs{firsthline}.}
% \begin{macro}{\lasthdashline}
% \changes{v1.4-3-5}{1999/06/25}
% {Introduced as the dashed version of \cs{lasthline}.}
% \SpecialIndex{\firsthline}
% \SpecialIndex{\lasthline}
% \SpecialIndex{\adl@hdashline}
% \SpecialIndex{\adl@ihdashline}
%
% If \textsf{array} is in use, we wish to have dashed counterparts of
% |\first|\slash|lasthline| named |\first|\slash|lasthdashline|, which
% simply call |\adl@hdashline| with an argument to call
% |\adl@first|\slash|lasthdashline| after closing |\noalign| opened by
% |\adl@hdashline|.
% \end{macro}\end{macro}
%
% \begin{macro}{\adl@defflhdl}
% \changes{v1.4-3-5}{1999/06/25}
% {Introduced for the tricky definition of \cs{adl@first}\slash
% \texttt{lasthdashline}.}
% \begin{macro}{\adl@idefflhdl}
% \changes{v1.4-3-5}{1999/06/25}
% {Introduced for the tricky definition of \cs{adl@first}\slash
% \texttt{lasthdashline}.}
% \begin{macro}{\adl@firsthdashline}
% \changes{v1.4-3-5}{1999/06/25}
% {Introduced as the body of \cs{firsthdashline}.}
% \begin{macro}{\adl@lasthdashline}
% \changes{v1.4-3-5}{1999/06/25}
% {Introduced as the body of \cs{lasthdashline}.}
% The macros |\adl@first|\slash|lasthdashline|, however, are defined in a
% tricky manner to replace |\hline| in |\first|\slash|lasthline| with;
%
% \begin{quote}
% |\adl@hdashline\adl@ihdashline[|\meta{dash}|/|\meta{gap}|]|
% \end{quote}
%
% in order to avoid copy-and-replace. To do that, we define |\adl@defflhdl|
% and |\adl@idefflhdl| in which the body of |\first|\slash|lasthline| is
% expanded by |\exapndafter| and the parts preceding and following |\hline|
% are extracted. Then the preceding part \meta{p}, the calling sequence of
% |\adl@hdashline|, and the following part \meta{f} are connected to be the
% body of |\adl@first|\slash|lasthdashline|. Thus we define
% |\adl@firsthdashline| as follows.
%
% \begin{quote}
% |\def\adl@firsthdashline|\texttt{[\#1/\#2]}|{%|\\
% \mbox{\qquad}\meta{p}\\
% \mbox{\qquad}|\adl@hdashline\adl@ihdashline|\texttt{[\#1/\#2]}\\
% \mbox{\qquad}\meta{f}|}|
% \end{quote}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\ifadl@usingarypkg
\def\firsthdashline{\adl@hdashline{\ifnum0=`{\fi}\adl@firsthdashline}}
\def\lasthdashline{\adl@hdashline{\ifnum0=`{\fi}\adl@lasthdashline}}
\def\adl@defflhdl#1{\def\@tempa{#1}
\expandafter\adl@idefflhdl}
\def\adl@idefflhdl#1\hline#2\@nil{%
\@namedef\@tempa[##1/##2]{#1\adl@hdashline\adl@ihdashline[##1/##2]#2}}
\adl@defflhdl{adl@firsthdashline}\firsthline\@nil
\adl@defflhdl{adl@lasthdashline}\lasthline\@nil
\fi
%%^L
% \end{macrocode}
%
%
% \subsection{End of Environment}
% \label{sec:imp-eoe}
%
% \begin{macro}{\endarray}
% \begin{macro}{\endtabular}
% \changes{v1.7}{2004/5/21}
% {Modified to refer proper \cs{endarray} depending on the
% exsistance of \textsf{colortbl}.}
% \begin{macro}{\endtabular*}
% \SpecialIndex{\adl@arrayrestore}
%
% The macros to close the |array|/|tabular| environment, |\endarray| and
% |\endtabular(*)|, are modified so that they invoke |\adl@endarray| to draw
% vertical lines just before closing |\halign|, and |\adl@arrayrestore| to
% restore registers and data structures |\global|-ly modified in the
% environment.
% \end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
%% End of Environment
\def\endarray{\adl@endarray \egroup \adl@arrayrestore \egroup}
\def\endtabular{\endarray $\egroup}
\expandafter\let\csname endtabular*\endcsname\endtabular
% \end{macrocode}
%
% \begin{macro}{\adl@endarray}
% \changes{v1.4-3-6}{1999/06/25}
% {Modified to set the depth of \texttt{array}\slash\texttt{tabular}
% to \cs{adl@finaldepth}.}
% \begin{macro}{\adl@rows}
% \begin{macro}{\adl@addvl}
% \begin{macro}{\adl@vlrowL}
% \begin{macro}{\adl@vlrowR}
% \begin{macro}{\adl@vlrow}
% \SpecialIndex{\adl@height}
% \SpecialIndex{\adl@depth}
% \SpecialIndex{\adl@@cr}
% \SpecialIndex{\adl@currentcolumn}
% \SpecialIndex{\adl@rowsL}
% \SpecialIndex{\adl@rowsR}
% \SpecialIndex{\adl@makevlrL}
% \SpecialIndex{\adl@makevlrR}
% \SpecialIndex{\adl@drawvl}
% \SpecialIndex{\adl@finaldepth}
%
% The macro |\adl@endarray| at first closes the last row by |\crcr|. If this
% |\crcr| has real effect, we have to invoke |\adl@@cr| to perfrom our own
% end-of-row operations. We assume that the |\crcr| is effective if either
% |\adl@height| or |\adl@depth| has a non-zero value\footnote{
%
% The author confesses that this rule is not strict and the introduction of a
% switch could improve the strictness.}.
%
% Then the rows to draw vertical lines $L_1$, \ldots, $L_n$;
% $$
% \sigma_1 L_1 \sigma_2 L_2 \ldots L_{n-1}\sigma_n L_n\sigma_{n+1}
% $$
% are created in |\adl@vlrowL| and |\adl@vlrowR| by |\adl@makevlrL| and
% |\adl@makevlrR|. In the real implementation,
% $L_k=\meta{$\gamma_k,\pi_k,\delta_k,\xi_k,\tau_k,\beta_k$}$ is represented
% as;
%
% \begin{quote}
% |\adl@vl{|$\beta_k$|}{|$\tau_k-\beta_k$|}{|$\delta_k$|}{|$\xi_k$|}|.
% \end{quote}
%
% Thus |\adl@vl| is made |\let|-equal to |\relax| when the rows are
% constructed and to \hbox{|\adl@@vl|} when the rows are put.
%
% Since |\adl@makevlrL| and |\adl@makevlrR| shares common macros, they
% conceptually have the following interface.
%
% \begin{quote}
% \begin{tabbing}
% \cs{adl@vlrow}${}={}$\cs{adl@makevlrL/R}(\=
% \cs{adl@rows}\,:\,\meta{$R^L$ or $R^R$},\\
% \> \cs{adl@currentcolumn}\,:\,\meta{start column},\\
% \> \cs{adl@addvl}\,:\,\meta{macro to add an element})
% \end{tabbing}
% \end{quote}
%
% Thus they are invoked as;
%
% \begin{quote}\leavevmode
% \cs{adl@vlrowL}${}={}$\cs{adl@makevrL}(
% \cs{adl@rowsL},
% 1,
% \cs{adl@addvlL})\\
% \cs{adl@vlrowR}${}={}$\cs{adl@makevrR}(
% \cs{adl@rowsR},
% \cs{adl@columns},
% \cs{adl@addvlR})
% \end{quote}
%
% \changes{v1.54-1}{2003/08/25}
% {Rows for vertical lines are replaced by \cs{adl@drawvl}.}
%
% Finally, after constructed rows for vertical lines are put by
% |\adl@drawvl|, a vertical skip of $-{}$|\adl@finaldepth| is inserted to
% move back to the last baseline, and then an invisible |\vrule| of
% |\adl@finaldepth| deep is put to make |array|\slash|tabular| has the depth
% of the last real row or zero if it ends with a horizontal line.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@endarray{\crcr \noalign{
\ifdim\adl@height=\z@
\ifdim\adl@depth=\z@ \else \adl@@cr\z@ \fi
\else \adl@@cr\z@ \fi
\let\adl@vl\relax
\def\adl@vlrow{}\adl@currentcolumn\@ne
\let\adl@rows\adl@rowsL
\let\adl@addvl\adl@addvlL
\adl@makevlrL \global\let\adl@vlrowL\adl@vlrow
\def\adl@vlrow{}\adl@currentcolumn\adl@columns
\let\adl@rows\adl@rowsR
\let\adl@addvl\adl@addvlR
\adl@makevlrR \global\let\adl@vlrowR\adl@vlrow
\global\let\adl@vl\adl@@vl}%
\adl@drawvl
\noalign{\vskip-\adl@finaldepth}%
\omit\vrule\@width\z@\@height\z@\@depth\adl@finaldepth\cr}
% \end{macrocode}
%
% \begin{macro}{\adl@arrayrestore}
% \SpecialIndex{\adl@height}
% \SpecialIndex{\adl@depth}
% \SpecialIndex{\adl@currentcolumn}
% \SpecialIndex{\adl@totalheight}
% \SpecialIndex{\adl@heightsave}
% \SpecialIndex{\adl@depthsave}
% \SpecialIndex{\adl@currentcolumnsave}
% \SpecialIndex{\adl@totalheightsave}
% \SpecialIndex{\adl@rowsL}
% \SpecialIndex{\adl@rowsR}
% \SpecialIndex{\adl@rowsLsave}
% \SpecialIndex{\adl@rowsRsave}
% \SpecialIndex{\adl@colsL}
% \SpecialIndex{\adl@colsR}
% \SpecialIndex{\adl@colsLsave}
% \SpecialIndex{\adl@colsRsave}
%
% The macro |\adl@arrayrestore| restores the values of registers and data
% structures, |\adl@height|, |\adl@depth|, |\adl@currentcolumn|,
% |\adl@totalheight|, |\adl@rowsL|, |\adl@rowsR|, |\adl@colsL| and
% |\adl@colsR|, saved by |\adl@arrayinit|.
% \end{macro}
%
% \begin{macrocode}
\def\adl@arrayrestore{%
\global\adl@height\adl@heightsave
\global\adl@depth\adl@depthsave
\global\adl@currentcolumn\adl@currentcolumnsave
\global\adl@totalheight\adl@totalheightsave
\global\let\adl@rowsL\adl@rowsLsave
\global\let\adl@rowsR\adl@rowsRsave
\global\let\adl@colsL\adl@colsLsave
\global\let\adl@colsR\adl@colsRsave}
%%^L
% \end{macrocode}
%
%
%
% \def\defprog{
% \def\WHILE{\hbox{\bf while}}
% \def\DO{\hbox{\bf do}}
% \def\BEGIN{\hbox{\bf begin}}
% \def\END{\hbox{\bf end}}
% \def\IF{\hbox{\bf if}}
% \def\THEN{\hbox{\bf then}}
% \def\ELSE{\hbox{\bf else}}
% \def\TRUE{\hbox{\bf true}}
% \def\FALSE{\hbox{\bf false}}
% \let\_\gets
% \def\GAMMA{{\mit\Gamma}}
% \def\LAMBDA{{\mit\Lambda}}
% \def\!{\stepcounter{enumi}\llap{\footnotesize(\arabic{enumi})\quad}}
% }
% \begin{figure}[p]\defprog
% \begin{itemize}\item[]
% \let\B\bot
% \setcounter{enumi}{0}
% \begin{tabbing}
%\!$\LAMBDA\_\meta{}$; $R\_R^L$; $\gamma\_1$;\\
%\!\WHILE\ $\gamma\leq\GAMMA$ \DO\ \BEGIN\\
%\!\qquad\=
% $\tau\_H$; $\beta\_H$; $\delta\_ \meta{$-1,\B$}$;
% $\xi\_ \meta{$-1,\B$}$;\\
%\!\> ${\it conn}\_\FALSE$; ${\it double}\_\FALSE;$; $R'\_\meta{}$\\
%\!\> \WHILE\ $R\neq\meta{}$ \DO\ \BEGIN\\
%\!\>\qquad\= $\meta{$r,R$}\_R$;\\
%\!\> \> $\meta{$C,h$}\_r$;\\
%\!\> \> \IF\ $C=\meta{}$ \THEN\\
%\!\> \>\qquad\= ${\it add}(\tau,\beta,\delta,\xi)$;\\
%\!\> \> \ELSE\IF\ $C\neq\meta{connect}$ \BEGIN\\
%\!\> \> \> $\meta{$e,C'$}=C$; $\meta{$c,d,g$}=e$;\\
%\!\> \> \> \IF\ $c=\gamma$ \THEN\ \BEGIN\\
%\!\> \> \>\qquad\= \IF\ $d=\delta\LAND g=\xi$ \THEN\ \BEGIN\\
%\!\> \> \> \>\qquad\= \IF\ $\lnot{\it conn}$ \THEN\ \BEGIN\\
%\!\> \> \> \> \>\qquad\= $\tau\_\beta$;
% ${\it conn}\_\TRUE$;\\
%\!\> \> \> \> \> \END;\\
%\!\> \> \> \> \END;\\
%\!\> \> \> \> \ELSE\ \BEGIN\\
%\!\> \> \> \> \> ${\it add}(\tau,\beta,\delta,\xi)$;\\
%\!\> \> \> \> \> $\delta\_d$; $\xi\_g$; $\tau\_\beta$;
% ${\it conn}\_\TRUE$;\\
%\!\> \> \> \> \END;\\
%\!\> \> \> \> \IF\ $C'=\meta{\meta{$\gamma,?,?$},$?$}$ \THEN
% \quad ${\it double}\_\TRUE$;\\
%\!\> \> \> \> $C\_C'$;\\
%\!\> \> \> \END;\\
%\!\> \> \> \ELSE\quad ${\it add}(\tau,\beta,\delta,\xi)$;\\
%\!\> \> \END;\\
%\!\> \> $\beta\_\beta-h$; $R'\_\meta{$R',\meta{$C,h$}$}$\\
%\!\> \END;\\
%\!\> ${\it add}(\tau,\beta,\delta,\xi)$; $R\_R'$;\\
%\!\> \IF\ {\it double} \THEN\quad
% $\LAMBDA\_\meta{$\LAMBDA,\cs{hskip}\cs{doublerulesep}$}$;\\
%\!\> \ELSE\ \BEGIN\\
%\!\> \> $\gamma\_\gamma+1$;\\
%\!\> \> \IF\ $\gamma>\GAMMA$ \THEN\quad\=
% $\LAMBDA\_\meta{$\LAMBDA,\cs{hfil}$}$;\\
%\!\> \> \ELSE\>
% $\LAMBDA\_
% \meta{$\LAMBDA,\cs{hfil}\hbox{\tt\&}\cs{omit}$}$;\\
%\!\> \END;\\
%\!\END;\\
%\!\\
%\!{\bf procedure} ${\it add}(\tau,\beta,\delta,\xi)$ \BEGIN\\
%\!\> \IF\ {\it conn} \THEN\ \BEGIN\\
%\!\> \> $\LAMBDA\_
% \meta{$\LAMBDA,\meta{$\beta,\tau-\beta,\delta,\xi$}$}$;
% ${\it conn}\_\FALSE$;\\
%\!\> \END;\\
%\!\END;
% \end{tabbing}
% \end{itemize}
% \caption{Conceptual Code of \cs{adl@makevlrL}}
% \label{fig-makevlr}
% \end{figure}
%
%
%
% \subsection{Drawing Vertical Lines}
% \label{sec:imp-vl}
%
% \SpecialIndex{\adl@rowsL}
% \SpecialIndex{\adl@rowsR}
% \SpecialIndex{\adl@rows}
% \SpecialIndex{\adl@vlrowL}
% \SpecialIndex{\adl@vlrowR}
% \SpecialIndex{\adl@vlrow}
% \SpecialIndex{\adl@columns}
% \SpecialIndex{\adl@currentcolumn}
% \SpecialIndex{\adl@dash}
% \SpecialIndex{\adl@gap}
% \SpecialIndex{\adl@vlrow}
% \SpecialIndex{\ifadl@connected}
% \SpecialIndex{\ifadl@doublerule}
% \SpecialIndex{\adl@totalheight}
%
% Figure~\ref{fig-makevlr} shows the conceptual code of |\adl@makevlrL|.
% The correspondance of variables in the code and control sequences in the
% real implementation is as follows.
% \begin{itemize}\item[]
% $\begin{array}[t]{*4{r@{\;{:}\;}l}}
% R^L& \cs{adl@rowsL}&
% R& \cs{adl@rows}&
% R'& \cs{@tempb}&
% \mit\Lambda& \cs{adl@vlrowL}\\
% \mit\Gamma& \cs{adl@columns}&
% \gamma& \rlap{\cs{adl@currentcolumn}}\\
% \tau& \cs{@tempcnta}&
% \beta& \cs{@tempcntb}&
% \delta& \rlap{\cs{adl@dash}/\cs{adl@dashcolor}}\\
% \xi& \rlap{\cs{adl@gap}/\cs{adl@gapcolor}}&\multicolumn2c{}&
% H& \rlap{\cs{adl@totalheight}}\\
% {\it conn}& \rlap{\cs{ifadl@connected}}&\multicolumn2c{}&
% {\it double}& \rlap{\cs{ifadl@doublerule}}\\
% \end{array}$
% \end{itemize}
%
% \begin{macro}{\adl@makevlrL}
% \changes{v1.4-3-8}{1999/06/25}
% {Modified to replace \cs{hfil} with \cs{hss} to prevent drawing
% vertical lines widen columns.}
% \begin{macro}{\adl@makevlrR}
% \changes{v1.4-3-8}{1999/06/25}
% {Modified to replace \cs{hfil} with \cs{hss} to prevent drawing
% vertical lines widen columns.}
% The macro |\adl@makevlrL| corresponds to the line (2) and (30)--(36). Its
% right-edge counterpart |\adl@makevlrR| has the same correspondance but the
% lines (1)--(2) are;
%
% \begin{quote}\defprog\setcounter{enumi}{0}
% \begin{tabbing}
%\!$\LAMBDA\_\meta{}$; $R\_R^R$; $\gamma\_\GAMMA$;\\
%\!\WHILE\ $\gamma>0$ \DO\ \BEGIN
% \end{tabbing}
% \end{quote}
%
% and (30)--(35) are;
%
% \begin{quote}\defprog\setcounter{enumi}{29}
% \begin{tabbing}
%\!\qquad\=
% \IF\ {\it double} \THEN\quad
% $\LAMBDA\_\meta{$\cs{hskip}\cs{doublerulesep},\LAMBDA$}$;\\
%\!\> \ELSE\ \BEGIN\\
%\!\>\qquad\= $\gamma\_\gamma-1$;\\
%\!\> \> \IF\ $\gamma=0$ \THEN\quad\=
% $\LAMBDA\_\meta{$\cs{hss},\LAMBDA$}$;\\
%\!\> \> \ELSE\>
% $\LAMBDA\_
% \meta{$\hbox{\tt\&}\cs{omit}\cs{hss},\LAMBDA$}$;\\
%\!\> \END;\\
% \end{tabbing}
% \end{quote}
% \end{macro}\end{macro}
% \begin{macrocode}
%% Drawing Vertical Lines
\def\adl@makevlrL{\adl@makevlr
\ifadl@doublerule
\edef\adl@vlrow{\adl@vlrow \hskip\doublerulesep}%
\let\next\adl@makevlrL
\else
\advance\adl@currentcolumn\@ne
\ifnum\adl@currentcolumn>\adl@columns \let\next\relax
\edef\adl@vlrow{\adl@vlrow \hss}%
\else \let\next\adl@makevlrL
\edef\adl@vlrow{\adl@vlrow \hss &\omit}%
\fi\fi\next}
\def\adl@makevlrR{\adl@makevlr
\ifadl@doublerule
\edef\adl@vlrow{\hskip\doublerulesep \adl@vlrow}%
\let\next\adl@makevlrR
\else
\advance\adl@currentcolumn\m@ne
\ifnum\adl@currentcolumn=\z@ \let\next\relax
\edef\adl@vlrow{\hss \adl@vlrow}%
\else \let\next\adl@makevlrR
\edef\adl@vlrow{&\omit \hss \adl@vlrow}%
\fi\fi\next}
% \end{macrocode}
%
% \begin{macro}{\adl@makevlr}
% \changes{v1.7-3}{2004/5/21}
% {Modified to initialize \cs{adl@dashcolor} and \cs{adl@gapcolor}.}
% \SpecialIndex{\adl@addvl}
% The macro |\adl@makevlr| corresponds to the lines (3)--(4) and (29).
% \end{macro}
%
% \begin{macrocode}
\def\adl@makevlr{\@tempcnta\adl@totalheight \@tempcntb\adl@totalheight
\adl@dash\m@ne \adl@gap\m@ne
\let\adl@dashcolor\relax \let\adl@gapcolor\relax
\adl@connectedfalse \adl@doublerulefalse \def\@tempb{}%
\expandafter\adl@imakevlr\adl@rows\@nil;%
\adl@addvl
\edef\adl@rows{\@tempb}}
% \end{macrocode}
%
% \begin{macro}{\adl@imakevlr}
% \begin{macro}{\adl@iimakevlr}
% \begin{macro}{\adl@endmakevlr}
% \SpecialIndex{\@elt}
% \SpecialIndex{\adl@connect}
%
% The macro |\adl@imakevlr|\meta{$r$}|;| corresponds to the lines (5)--(6),
% and the macro |\adl@iimakevlr(|\meta{$C$}|/|\meta{$h$}|)| to (7) and (27).
% \end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@imakevlr#1;{\def\@tempa{#1}\ifx\@tempa\@nnil \let\next\relax
\else \adl@iimakevlr#1\let\next\adl@imakevlr \fi \next}
\def\adl@iimakevlr(#1/#2){\let\@elt\adl@iiimakevlr
\let\adl@connect\adl@@connect
\let\adl@endmakevlr\adl@endmakevlrcut
#1\adl@endmakevlr
\let\@elt\relax \let\adl@connect\relax
\advance\@tempcntb-#2\edef\@tempb{\@tempb(\@tempc/#2);}}
% \end{macrocode}
%
% \begin{macro}{\adl@iiimakevlr}
% \changes{v1.7-3}{2004/5/21}
% {Modified to check color indentity.}
% \begin{macro}{\adl@ivmakevlr}
% \changes{v1.7-3}{2004/5/21}
% {Modified not to see $d$ and $g$ which now have colors.}
% \begin{macro}{\adl@vmakevlr}
% \begin{macro}{\adl@endmakevlrcut}
% \begin{macro}{\adl@endmakevlrconn}
% \begin{macro}{\adl@@connect}
% The correspondance of the lines (8)--(29) is a little bit complicated. As
% shown above, |\adl@iimakevlr| expands $C$ attaching the sentinel
% |\adl@endmakevlr|.
%
% \begin{enumerate}
% \item
% If $C\neq\meta{}$ and $C\neq\meta{connect}$, $C$ has at least one
% |\@elt|\meta{$c$}\meta{$d$}\meta{$g$} which is made |\let|-equal to
% |\adl@iiimakevlr| by |\adl@iimakevlr|. Thus the lines (10)--(21) and (25)
% are performed by |\adl@iiimakevlr|.
%
% Then;
% \begin{enumerate}
% \item
% if $c=\gamma$, |\@elt| becomes |\let|-equal to |\adl@ivmakevlr| which
% corresponds to (22) in the case of $C'\neq\meta{}$. Then |\adl@vmakevlr|
% is invoked for (23) and to eat the sentinel |\adl@endmakevlr|. If
% $C'=\meta{}$, |\adl@endmakevlrconn| is invoked, because the sentinel
% |\adl@endmakevlr| is made |\let|-equal to it by |\adl@iiimakevlr|, for
% (23) (i.e.\ $C\gets\meta{}$).
%
% \item
% if $c\neq\gamma$, |\adl@vmakevlr| is invoked to perform implicit $C\gets
% C$ operation and to eat the sentinel.
% \end{enumerate}
%
% \item
% If $C=\meta{connect}$, i.e.\ it has only one element |\adl@connect|, the
% macro |\adl@@connect| is invoked because it is |\let|-equal to
% |\adl@connect|. The macro do nothing but implict $C\gets C\ {}
% (=\meta{connect})$ and eating the sentinel.
%
% \item
% If $C=\meta{}$, |\adl@endmakevlrcut| that is |\let|-equal to the sentinel
% |\adl@endmakevlr| is invoked to perform (8)--(9) and implicit $C\gets C
% \ (=\meta{})$.
% \end{enumerate}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \SpecialIndex{\adl@addvl}
%
% \begin{macrocode}
\def\adl@iiimakevlr#1#2#3#4#5{\let\@elt\adl@ivmakevlr \let\next\relax
\ifnum#1=\adl@currentcolumn\relax
\let\adl@endmakevlr\adl@endmakevlrconn
\@tempswafalse
\ifnum#2=\adl@dash\relax
\ifnum#3=\adl@gap\relax
\def\@tempa{#4}\ifx\@tempa\adl@dashcolor
\def\@tempa{#5}\ifx\@tempa\adl@gapcolor
\@tempswatrue
\fi\fi\fi\fi
\if@tempswa
\ifadl@connected\else
\@tempcnta\@tempcntb \adl@connectedtrue \fi
\else
\adl@addvl
\adl@dash#2\relax \adl@gap#3\relax
\def\adl@dashcolor{#4}\def\adl@gapcolor{#5}%
\@tempcnta\@tempcntb \adl@connectedtrue
\fi
\else
\adl@addvl
\def\next{\adl@vmakevlr\@elt{#1}{#2}{#3}{#4}{#5}}%
\fi\next}
\def\adl@ivmakevlr#1{%
\ifnum#1=\adl@currentcolumn \adl@doubleruletrue \fi
\adl@vmakevlr\@elt{#1}}
\def\adl@vmakevlr#1\adl@endmakevlr{\def\@tempc{#1}}
\def\adl@endmakevlrcut{\adl@addvl \def\@tempc{}}
\def\adl@endmakevlrconn{\def\@tempc{}}
\def\adl@@connect\adl@endmakevlr{\def\@tempc{\adl@connect}}
% \end{macrocode}
%
% \begin{macro}{\adl@addvlL}
% \changes{v1.7-3}{2004/5/21}
% {Modified to add colors to $\delta$ and $\xi$.}
% \begin{macro}{\adl@addvlR}
% \changes{v1.7-3}{2004/5/21}
% {Modified to add colors to $\delta$ and $\xi$.}
% The macro |\adl@addvlL| corresonds to the lines (38)--(42), i.e.\ the
% procedure {\it add}. The macro |\adl@addvlR| performs simlar operations,
% but its conceptual code is the following.
%
% \begin{quote}\defprog\setcounter{enumi}{37}
% \begin{tabbing}
%\!{\bf procedure} ${\it add}(\tau,\beta,\delta,\xi)$ \BEGIN\\
%\!\qquad\=
% \IF\ {\it conn} \THEN\ \BEGIN\\
%\!\>\qquad\= $\LAMBDA\_
% \meta{$\meta{$\beta,\tau-\beta,\delta,\xi$},\LAMBDA$}$;
% ${\it conn}\_\FALSE$;\\
%\!\> \END;\\
%\!\END;
% \end{tabbing}
% \end{quote}
% \end{macro}\end{macro}
% \SpecialIndex{\ifadl@connected}
% \SpecialIndex{\adl@vlrow}
% \SpecialIndex{\adl@vl}
% \SpecialIndex{\adl@dash}
% \SpecialIndex{\adl@gap}
%
% \begin{macrocode}
\def\adl@addvlL{\ifadl@connected
\advance\@tempcnta-\@tempcntb
\edef\adl@vlrow{\adl@vlrow
\adl@vl{\number\@tempcntb}{\number\@tempcnta}%
{\number\adl@dash}{\number\adl@gap}%
{\adl@dashcolor}{\adl@gapcolor}}%
\adl@connectedfalse \fi}
\def\adl@addvlR{\ifadl@connected
\advance\@tempcnta-\@tempcntb
\edef\adl@vlrow{\adl@vl{\number\@tempcntb}{\number\@tempcnta}%
{\number\adl@dash}{\number\adl@gap}%
{\adl@dashcolor}{\adl@gapcolor}\adl@vlrow}%
\adl@connectedfalse \fi}
% \end{macrocode}
%
% \begin{macro}{\adl@drawvl}
% \changes{v1.54-1}{2003/08/25}
% {Introduced to draw vertical lines correctly if \cs{ADLsomewide}.}
% \begin{macro}{\adl@@vl}
% \changes{v1.4-3-2}{1999/06/25}
% {Modified to make vertical line null wide only if \cs{ADLnullwide}.}
% \changes{v1.4-3-4}{1999/06/25}
% {Modified to use \cs{adl@draw}.}
% \changes{v1.54-1}{2003/08/25}
% {Insert a negative skip to left/right of the line if \cs{ADLsomewide}.}
% \changes{v1.7-3}{2004/5/21}
% {Modified to color dashs and gaps.}
% \begin{macro}{\adl@vl@leftskip}
% \begin{macro}{\adl@vl@rightskip}
% \SpecialIndex{\adl@vlrowL}
% \SpecialIndex{\adl@vlrowL}
% \SpecialIndex{\adl@vl}
% \SpecialIndex{\adl@draw}
% \SpecialIndex{\set@color}
%
% After the the macros |\adl@vlrowL| and |\adl@vlrowR| are constructed, they
% are expanded to draw vertical lines by |\adl@drawvl|. Prior to the
% expansion, the macro |\adl@drawvl| globally defines |\adl@vl@leftskip| and
% |\adl@vl@rightskip|, which are the amount of negative spaces inserted to the
% left\slash right of a vertical line, as follows.
%
% \begin{eqnarray*}
% \cs{adl@vl@leftskip}&=&\cases{
% \cs{arrayrulewidth}/2& if \cs{ifadl@zwrule}\cr
% 0& else if leftside\cr
% \cs{arrayrulewidth}& otherwise}\\
% \cs{adl@vl@rightskip}&=&\cases{
% \cs{arrayrulewidth}/2& if \cs{ifadl@zwrule}\cr
% 0& else if rightside\cr
% \cs{arrayrulewidth}& otherwise}
% \end{eqnarray*}
%
% That is, if |\ADLnulwide| is in effect, a vertical line is surrounded by
% horizontal spaces of $-|\arrayrulewidth|/2$ to adjust the center of the
% line to the left or right edge of its column. Otherwise, a horizontal
% space $-|\arrayrulewidth|$ is inserted after (before) the line is drawn to
% adjust its left (right) edge to the left (right) edge of the column
% \footnote{
% Before v1.54, the horizontal spaces was not inserted if \cs{ADLsomewide}
% and thus disconnected lines were not aligned vertically.}.
%
% Then the macros |\adl@vlrowL| and |\adl@vlrowR| are expanded. These
% macros will have |\adl@vl|, which is made |\let|-equal to
% \hbox{|\adl@@vl|} prior to the expansion, to draw a vertical line. The
% macro
% |\adl@@vl|\meta{$\beta$}\meta{$\lambda$}\meta{$\delta_l$}\meta{$\gamma_l$}
% \meta{$\delta_c$}\meta{$\gamma_c$} ($x_l$ and $x_c$ are length and color)
% draws a sloid line if $\gamma_l=0$ or a dash-line otherwise in a |\vbox| of
% $\lambda=\tau-\beta$ high and |\raise|-s it by $\beta$. The method to
% draw a dash line in the |\vbox| is analogous to that for holizontal line
% shown in \S\ref{sec:imp-hline}, except that a line is surrounded by
% horizontal spaces of |\adl@vl@leftskip| and |\adl@vl@rightskip|. Coloring
% gaps is done by draw a vertical rule setting $\gamma_c$ by |\set@color|
% prior to dash line drawing if $\gamma_c$ is not |\relax|. To color
% dashes or solid line, |\set@color| with $\delta_c$ is done if it is not
% |\relax| before line drawing.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@drawvl{%
\omit \relax \ifadl@zwvrule
\gdef\adl@vl@leftskip{.5\arrayrulewidth}%
\global\let\adl@vl@rightskip\adl@vl@leftskip
\else \global\let\adl@vl@leftskip\z@
\global\let\adl@vl@rightskip\arrayrulewidth
\fi \adl@vlrowL \cr
\omit \relax \ifadl@zwvrule
\gdef\adl@vl@leftskip{.5\arrayrulewidth}%
\global\let\adl@vl@rightskip\adl@vl@leftskip
\else \global\let\adl@vl@leftskip\arrayrulewidth
\global\let\adl@vl@rightskip\z@
\fi \adl@vlrowR \cr}
\def\adl@@vl#1#2#3#4#5#6{\vbox to\z@{\vss\hbox{%
\hskip-\adl@vl@leftskip
\ifnum#3=\z@\else \def\@tempa{#6}\ifx\@tempa\adl@nocolor\else
\raise#1sp\hbox{\let\current@color\@tempa \set@color
\vrule height#2sp width\arrayrulewidth}%
\hskip-\arrayrulewidth \fi \fi
\raise#1sp\vbox to#2sp{
\def\@tempa{#5}\ifx\@tempa\adl@nocolor\else
\let\current@color\@tempa \set@color \fi
\ifnum#3=\z@
\hrule height#2sp depth\z@ width\arrayrulewidth
\else \@tempdima#3sp \@tempdimb#4sp
\adl@draw\adl@hrule\vskip\vbox
\fi}%
\hskip-\adl@vl@rightskip}}}
%%^L
% \end{macrocode}
%
%
%
% \subsection{Drawing Dash-lines}
% \label{sec:imp-draw}
% \changes{v1.4-2}{1999/06/25}
% {Section 4.12 is added.}
%
% \begin{macro}{\adl@vrule}
% \changes{v1.4-3-4}{1999/06/25}
% {Introduced to draw a dash for horizontal lines in \cs{adl@draw}.}
% \begin{macro}{\adl@hrule}
% \changes{v1.4-3-4}{1999/06/25}
% {Introduced to draw a dash for vertical lines in \cs{adl@draw}.}
% As explained later, horizontal and vertical lines are drawn by a common
% macro |\adl@draw| to which the length of a dash segment, $d$, is passed
% through |\@tempdima|. The macro also has an argument that is either
% |\adl@vrule| to draw a dash for {\em horizontal} lines or |\adl@hrule| for
% {\em vertical}. These two macros commonly have one argument \meta{f} to
% draw a dash of $f\times d$ long and of |\arrayrulewidth| wide.
% \end{macro}\end{macro}
%
% \begin{macrocode}
%% Draw Dash Lines (\adl@vrule/\adl@hrule, \hskip/\vskip, \hbox/\vbox)
\def\adl@vrule#1{\vrule\@width#1\@tempdima\@height\arrayrulewidth\relax}
\def\adl@hrule#1{\hrule\@height#1\@tempdima\@width\arrayrulewidth\relax}
% \end{macrocode}
%
% \begin{macro}{\adl@drawi}
% \changes{v1.4-3-4}{1999/06/25}
% {Introduced as \cs{adl@draw} in mode 1.}
% \begin{macro}{\adl@drawii}
% \changes{v1.4-3-4}{1999/06/25}
% {Introduced as \cs{adl@draw} in mode 2.}
% \begin{macro}{\adl@drawiii}
% \changes{v1.4-3-4}{1999/06/25}
% {Introduced as \cs{adl@draw} in mode 3.}
% \begin{macro}{\adl@draw}
% \changes{v1.4-3-4}{1999/06/25}
% {Introduced as the mode and axis independent line drawing macro.}
% \SpecialIndex{\xleaders}
% \SpecialIndex{\cleaders}
%
% The macro |\adl@draw| is to draw a horizontal or vertical line. It is
% |\let|-equal to one of |\adl@drawi|, |\adl@drawii| and |\adl@drawiii|
% according to the drawing mode specified by |\ADLdrawingmode|. These three
% macros have common interface, |\@tempdima| and \hbox{|\@tempdimb|} for the
% length of dash and gap, $d$ and $g$, and three arguments \meta{rule},
% \meta{skip} and \meta{box} with which |\adl@draw| is called in the
% following manner.
%
% \begin{eqnarray*}
% \hbox{|\adl@draw\adl@vrule\hskip\hbox|}&\ldots&\hbox{horizontal}\\
% \hbox{|\adl@draw\adl@hrule\vskip\vbox|}&\ldots&\hbox{vertical}
% \end{eqnarray*}
%
% The drawing methods in three modes have been explained in
% \S\ref{sec:imp-ps2}. More specifically, |\adl@drawi| for mode 1, to which
% |\adl@draw| is |\let|-equal by default, conceptually performs the
% following operations.
%
% \begin{quote}
% \def\arg#1{\hbox{{\tt\char`\{}#1{\tt\char`\}}}}
% \meta{rule}\arg{1/2}\quad\meta{skip}$(g/2)$\\
% |\xlearders|\meta{box}
% \arg{\meta{skip}$(g/2)$ \meta{rule}\arg{1} \meta{skip}$(g/2)$}\\
% \phantom{\texttt{.xleaders}}\meta{skip}(0 |plus| 1|fil minus| 1|fil|)\\
% \meta{skip}$(g/2)$\quad\meta{rule}\arg{1/2}
% \end{quote}
%
% The conceptual operations of |\adl@drawii| for mode 2 are as follows.
%
% \begin{quote}
% \def\arg#1{\hbox{{\tt\char`\{}#1{\tt\char`\}}}}
% \meta{rule}\arg{1/2}\quad\meta{skip}$(g/2)$\\
% \meta{box}\arg{\meta{skip}$(g/2)$ \meta{rule}\arg{1} \meta{skip}$(g/2)$}\quad
% \meta{skip}$(-d-g)$\\
% |\xlearders|\meta{box}
% \arg{\meta{skip}$(g/2)$ \meta{rule}\arg{1} \meta{skip}$(g/2)$}\\
% \phantom{\texttt{.xleaders}}\meta{skip}(0 |plus| 1|fil minus| 1|fil|)\\
% \meta{skip}$(-d-g)$\quad
% \meta{box}\arg{\meta{skip}$(g/2)$ \meta{rule}\arg{1} \meta{skip}$(g/2)$}\\
% \meta{skip}$(g/2)$\quad\meta{rule}\arg{1/2}
% \end{quote}
%
% The macro |\adl@drawiii| for mode 3 is quite similar to |\adl@drawi|
% except that |\xleaders| is replaced by |\cleaders|. This replacement is
% done by temporarily |\let|-ing |\xleaders| be equal to |\cleaders|.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \SpecialIndex{\adl@box}
%
% \begin{macrocode}
\def\adl@drawi#1#2#3{%
#1{.5}#2.5\@tempdimb
\xleaders#3{#2.5\@tempdimb #1{1}#2.5\@tempdimb}%
#2\z@ plus1fil minus1fil\relax
#2.5\@tempdimb #1{.5}}
\def\adl@drawii#1#2#3{%
\setbox\adl@box#3{#2.5\@tempdimb #1{1}#2.5\@tempdimb}%
#1{.5}#2.5\@tempdimb
\copy\adl@box #2-\@tempdima #2-\@tempdimb
\xleaders\copy\adl@box#2\z@ plus1fil minus1fil\relax
#2-\@tempdima #2-\@tempdimb \copy\adl@box
#2.5\@tempdimb #1{.5}}
\def\adl@drawiii#1#2#3{{\let\xleaders\cleaders \adl@drawi#1#2#3}}
\let\adl@draw\adl@drawi
% \end{macrocode}
%
% \begin{macro}{\ADLdrawingmode}
% \changes{v1.4-3-4}{1999/06/25}
% {Introduced to specify drawing mode.}
% The macro |\ADLdrawingmode|\Meta{m} defines the drawing mode by |\let|-ing
% |\adl@draw| be equal to |\adl@drawi| if $m=1$, and so on. If \meta{m} is
% neither 1, 2 nor 3, it is assumed as 1.
% \end{macro}
%
% \begin{macrocode}
\def\ADLdrawingmode#1{\ifcase #1%
\let\adl@draw\adl@drawi \or
\let\adl@draw\adl@drawi \or
\let\adl@draw\adl@drawii \or
\let\adl@draw\adl@drawiii \else
\let\adl@draw\adl@drawi \fi}
%%^L
% \end{macrocode}
%
%
%
% \subsection{Shorthand Activation}
% \label{sec:imp-sh}
% \changes{v1.4-2}{1999/06/25}
% {Section 4.13 is added.}
%
% \begin{macro}{\adl@Array}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced as the body of \cs{Array}.}
% \begin{macro}{\adl@Tabular}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced as the body of \cs{Tabular}.}
% \begin{macro}{\adl@Tabularstar}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced as the body of \cs{Tabular*}.}
% \begin{macro}{\adl@Longtable}
% \changes{v1.6-1}{2003/8/25}
% {Introduced as the body of \cs{Longtable}.}
% \SpecialIndex{\array}
% \SpecialIndex{\tabular}
% \SpecialIndex{\tabular*}
% \SpecialIndex{\longtable}
%
% The macros|\adl@Array|, |\adl@Tabular|, |\adl@Tabular*| and
% |\adl@Longtable| start environments |array|, |tabular|, |tabular*| and
% |longtable| respectively, turning |\ifadl@inactive| false to activate
% dash-line functions. We will |\let| macros |\Array| etc.\ be equal to
% them for shorthand activation.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
%% Shorthand Activation
\def\adl@Array{\adl@inactivefalse \array}
\def\adl@Tabular{\adl@inactivefalse \tabular}
\def\adl@Tabularstar{\adl@inactivefalse \@nameuse{tabular*}}
\def\adl@Longtable{\adl@inactivefalse \longtable}
% \end{macrocode}
%
% \begin{macro}{\@notdefinable}
% \begin{macro}{\adl@notdefinable}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to check if \cs{Array} etc. are definable.}
% \SpecialIndex{\@ifdefinable}
%
% Before making |\Array| etc.\ |\let|-equal to |\adl@Array| etc., we have to
% check if these macros having too natural names have already used. This
% check is done by |\@ifdefinable| that will call |\@notdefinable| for the
% complaint if undefinable. Since we want to complain with our own
% warning message, |\@notdefinable| is temporarily |\def|-ined so that it
% simply |\def|-ines a macro |\adl@notdefinable| as empty. Therefore,
% |\adl@notdefinebale| will have some definition if one of |\Array|,
% |\Tabular|, |\Tabular*| and |\Longtable| (if \textsf{longtable} is loaded)
% cannot be defined, while it will stay undefined otherwise.
% \end{macro}\end{macro}
%
% \begin{macrocode}
\begingroup
\def\@notdefinable{\gdef\adl@notdefinable{}}
\@ifdefinable\Array\relax
\@ifdefinable\Tabular\relax
\expandafter\@ifdefinable\csname Tabular*\endcsname\relax
\ifx\longtable\undefined\else \@ifdefinable\Longtable\relax \fi
\endgroup
% \end{macrocode}
%
% \begin{macro}{\Array}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced as the always-active \cs{array}.}
% \begin{macro}{\Tabular}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced as the always-active \cs{tabular}.}
% \begin{macro}{\Tabular*}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced as the always-active \cs{tabular*}.}
% \begin{macro}{\Longtable}
% \changes{v1.6-1}{2003/8/25}
% {Introduced as the always-active \cs{longtable}.}
% \begin{macro}{\endArray}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to \cs{end} the environment \texttt{Array}.}
% \begin{macro}{\endTabular}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to \cs{end} the environment \texttt{Tabular}.}
% \begin{macro}{\endTabular*}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to \cs{end} the environment \texttt{Tabular*}.}
% \begin{macro}{\endLongtable}
% \changes{v1.6-1}{2003/8/25}
% {Introduced to \cs{end} the environment \texttt{Longtable}.}
% \SpecialIndex{\PackageWarning}
% \SpecialIndex{\@warning}
% \SpecialIndex{\MessageBreak}%
%
% If |\adl@notdefinable| is |\undefined| indicating that all |\Array| etc.\
% are definable, we |\let| them be equal to |\adl@Array| etc. We also
% |\let| ending macros |\endArray| etc.\ be equal to |\endarray| etc.
% Note that |\Longtable| and |\endLongtable| are defined only when
% \textsf{longtable} is loaded, and |\endLongtable| is |\def|-ined as (not
% being |\let|-equal to) |\endlongtable| because its definition of our own
% is not given yet.
%
% Otherwise, we complain with a warning message put by |\PackageWarning| if
% it is defined (i.e.\ \LaTeXe) or |\@warning| otherwise (i.e.\ \LaTeX-2.09).
% \end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\ifx\adl@notdefinable\undefined
\let\Array\adl@Array
\let\Tabular\adl@Tabular
\expandafter\let\csname Tabular*\endcsname\adl@Tabularstar
\let\endArray\endarray
\let\endTabular\endtabular
\expandafter\let\csname endTabular*\endcsname\endtabular
\ifx\longtable\undefined\else
\let\Longtable\adl@Longtable
\def\endLongtable{\endlongtable}
\fi
\else
\begingroup
\ifx\longtable\undefined
\def\@tempa{Array and Tabular are not defined because one of them\MessageBreak
has been defined}
\else
\def\@tempa{Array/Tabular/Longtable are not defined because \MessageBreak
one of them has been defined}
\fi
\ifx\PackageWarning\undefined
\def\MessageBreak{^^J}
\@warning\@tempa
\else
\let\on@line\empty
\PackageWarning{arydshln}\@tempa
\fi
\endgroup
\fi
% \end{macrocode}
%
% \begin{macro}{\ADLnoshorthanded}
% \changes{v1.4-3-3}{1999/06/25}
% {Introduced to nullify macros for shorthand activation.}
% \changes{v1.6-1}{2003/8/25}
% {\cs{Longtable} and \cs{endLongtable} are added.}
% If a user wishes to define an environment named |Array| or |Tabular(*)|
% (or |Longtable| if \textsf{longtable} is in use) by him/herself or by
% loading other packages {\em after} \textsf{arydshln} is loaded,
% |\newenvironment| for |Array| etc.\ will fail because they have already
% been undefinable. The macro |\ADLnoshorthanded| makes them definable
% again by |\let|-ing them and their ending counterparts be equal to
% |\relax|.
% \end{macro}
%
% \begin{macrocode}
\def\ADLnoshorthanded{%
\let\Array\relax
\let\Tabular\relax
\expandafter\let\csname Tabular*\endcsname\relax
\let\endArray\relax
\let\endTabular\relax
\expandafter\let\csname endTabular*\endcsname\relax
\ifx\longtable\undefined\else
\let\Longtable\relax
\let\endLongtable\relax \fi}
% \end{macrocode}
%
% \vskip15\baselineskip\endgraf\vskip-15\baselineskip\vskip0pt
% \begin{macro}{\adl@act@arrayclassz}
% \changes{v1.54-2}{2003/08/25}
% {Introduced to activate \cs{@arrayclassz} etc. again.}
% \begin{macro}{\adl@act@tabclassz}
% \begin{macro}{\adl@act@classz}
% \begin{macro}{\adl@act@@startpbox}
% \begin{macro}{\adl@act@@endpbox}
% \begin{macro}{\adl@act@endpbox}
% \begin{macro}{\adl@act@cr}
% \begin{macro}{\adl@act@argcr}
% \begin{macro}{\adl@act@cline}
% \begin{macro}{\adl@act@endarray}
% \begin{macro}{\adl@act@hline}
% \begin{macro}{\adl@act@ihdashline}
% \begin{macro}{\adl@act@cdline}
% \begin{macro}{\adl@act@@vlineL}
% \begin{macro}{\adl@act@@vlineR}
% \SpecialIndex{\@arrayclassz}
% \SpecialIndex{\@tabclassz}
% \SpecialIndex{\@classz}
% \SpecialIndex{\@@startpbox}
% \SpecialIndex{\@@endpbox}
% \SpecialIndex{\@endpbox}
% \SpecialIndex{\adl@cr}
% \SpecialIndex{\adl@argcr}
% \SpecialIndex{\cline}
% \SpecialIndex{\adl@endarray}
% \SpecialIndex{\adl@hline}
% \SpecialIndex{\adl@ihdashline}
% \SpecialIndex{\adl@cdline}
% \SpecialIndex{\adl@@vlineL}
% \SpecialIndex{\adl@@vlineR}
%
% Finally here we define {\em active} version of |\@arrayclassz| named
% |\adl@act@arrayclassz| etc. for |\adl@activate| (see \S\ref{sec:imp-init}).
% The definitions are simply done by |\let|-ing |\adl@act@arrayclassz| equal
% to |\@arrayclassz| etc\footnote{%
%
% Alternatively, we may define \cs{adl@act@arrayclassz} in place of
% \cs{@arrayclassz} but the author chose this way to minimize the possiblity
% of {\em enbug}.}.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\let\adl@act@arrayclassz\@arrayclassz
\let\adl@act@tabclassz\@tabclassz
\ifadl@usingarypkg \let\adl@act@classz\@classz \fi
\let\adl@act@@startpbox\@@startpbox
\let\adl@act@@endpbox\@@endpbox
\let\adl@act@endpbox\@endpbox
\let\adl@act@cr\adl@cr
\let\adl@act@argcr\adl@argcr
\let\adl@act@endarray\adl@endarray
\let\adl@act@hline\adl@hline
\let\adl@act@ihdashline\adl@ihdashline
\let\adl@act@cdline\adl@cdline
\let\adl@act@@vlineL\adl@@vlineL
\let\adl@act@@vlineR\adl@@vlineR
%%^L
% \end{macrocode}
%
%
%
% \subsection{Compatibility with \textsf{colortab}}
% \label{sec:imp-colortab}
%
% \begin{macro}{\adl@CC@}
% \begin{macro}{\CC@}
% \changes{v1.5-1}{2000/07/12}
% {Modified to save/restore globals before/after height measurement.}
% \SpecialIndex{\LCC}
% \SpecialIndex{\adl@arraysave}
% \SpecialIndex{\adl@arrayrestore}
%
% The package \textsf{colortab} has a macro;
%
% \begin{quote}
% |\LCC|\meta{colorspec}|\\|\meta{rows}|\ECC|
% \end{quote}
%
% to color \meta{rows} referring \meta{colorspec}. The macro |\CC@|, the
% heart of the coloring function, first makes a box with \meta{rows} using
% |\@preamble| to measure the height of \meta{rows}, then makes a row putting
% a heavy rule of the height in each column with a color command for the
% column specified by \meta{colorspec}, and finally puts \meta{rows}
% overlaying them on the colored rule. Therefore \meta{rows} is processed
% twice by |\CC@| to update |\global| registers/structures incorrectly.
%
% Thus we modify |\CC@|, if the package \textsf{colortab} is provided, to
% save |\global| stuffs by |\adl@arraysave| before the height measurement and
% restore them by |\adl@arrayrestore| after that.
% \end{macro}\end{macro}
%
% \begin{macrocode}
%% Compatibility with colortab
\def\adl@CC@#1#2#3{%
\ifcolortab
\noalign{%
\adl@arraysave
\setbox\CT@box=\vbox{#1#3\crcr\egroup}%
\adl@arrayrestore
\CT@dim=\ht\CT@box
\global\advance\CT@dim by \dp\CT@box
\def\CT@next{}%
\futurelet\next\CT@columncolor#2&\@nil}%
\CT@next\cr
\noalign{\vskip-\CT@dim}%
\fi
#3}
\ifx\ColortabLoaded\undefined\else
\let\CC@\adl@CC@
\fi
%%^L
% \end{macrocode}
%
%
%
% \subsection{Compatibility with \textsf{longtable}}
% \label{sec:imp-longtable}
%
% \changes{v1.6-1}{2003/8/25}
% {\S\ref{sec:imp-longtable} is added.}
%
% \SpecialOptIndex{longtable}{package}
% \SpecialOptIndex{longtable}{environment}
% \SpecialIndex{\output}
% \SpecialIndex{\adl@rowsL}
% \SpecialIndex{\adl@rowsR}
%
% Making \textsf{arydshln} compatible with \textsf{longtable} is a hard job
% because a |longtable| consists of multiple {\em chunks} and each chunk is
% a distinct |\halign|. We could draw vertical lines in each chunks as we
% do with ordinary |array|\slash |table|. However this straightforward
% solution should {\em break} dash-lines at invisible borders of chunks and
% produce awful results.
%
% Therefore, this implementation draws dash-lines in |\output| routine in
% which we have all the rows to be put in a page. The hard part is to know
% which rows are being put in |\output|. This problem is solved by
% extracting the leading part of $R^L$ (|\adl@rowsL|) and $R^R$
% (|\adl@rowsR|) by the height\slash depth of the table fraction to be put
% and removing the part from $R^{L/R}$.
%
%
%
% \subsubsection{Initialization}
% \label{sec:imp-lt-init}
% \changes{v1.7}{2003/05/21}
% {Codes for \textsf{longtable} is surrounded by \cs{ifx}/\cs{fi}}
%
% First of all, the following switch and |\dimen| register are declared.
% \begin{itemize}
% \item
% \begin{macro}{\ifadl@LTfirstpage}
% |\ifadl@LTfirstpage| is tested in |\output| routine to examine if the page
% being put has the first fraction of a |longtable|.
% \end{macro}
%
% \item
% \begin{macro}{\adl@LTpagetotal}
% |\adl@LTpagetotal| is set to |\pagetotal| just before the first portion of a
% |longtable| is added to the main vertical list. Since the |\box255| has
% items preceding the |\longtable| and its first fraction, we can obtain the
% height of the first fraction by subtracting |\adl@LTpagetotal| from the
% height plus depth of |\box255|.
% \end{macro}
% \end{itemize}
%
%
% \begin{macrocode}
%% Compatibility with longtable: initialization
\newif\ifadl@LTfirstpage
\newdimen\adl@LTpagetotal
% \end{macrocode}
%
% Next, we skip everything if \textsf{longtable} is not in use, or
% we have undefined-error when we refer the definitions in it. Note that
% since |\newif| cannot be in the |\ifx|\slash|\fi| construct, the
% declarations above are excluded.
%
% \begin{macrocode}
\ifx\longtable\undefined\else
% \end{macrocode}
%
%
% \begin{macro}{\adl@LT@array}
% \begin{macro}{\LT@array}
% \begin{macro}{\adl@discard}
% \SpecialIndex{\adl@arrayinit}
% \SpecialIndex{\adl@ihdashline}
% \SpecialIndex{\adl@LTihdashline}
% \SpecialIndex{\ifadl@inactive}
%
% Then we redefine the macro |\LT@array|, which is the heart of |\longtable|,
% saving its original definition in |\adl@LT@array|. The modified
% |\LT@array| first calls |\adl@arrayinit| to initialize the global data
% structures, and sets |\ifadl@LTfirstpage| to true. Then |\adl@idashline|
% and |\adl@discard| are made |\let|-equal to its \textsf{longtable} version
% |\adl@LTidashline| and |\relax| (to inhibit expansion) respectively.
% Then the macro calls |\adl@LTinactivate| if |\adl@inactive| is true, and
% finally calls its original version |\adl@LT@array|. Note that since
% |longtable| cannot be nested;
%
% \begin{itemize}
% \item
% |\adl@arraysave| in |\adl@arrayinit| is unnecessary but safe, and thus
% its invocation timing is not so sensitive; and
%
% \item
% activator is not required.
% \end{itemize}
%
% Also note that the assignment |\adl@ncol| to |\adl@columns| in
% |\adl@arrayinit| is void and thus we will do it afterward.
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\adl@LTinactivate}
% \SpecialIndex{\adl@inactivate}
% \SpecialIndex{\adl@ihdashline}
% \SpecialIndex{\adl@LTinactivehdl}
% \SpecialIndex{\endlongtable}
% \SpecialIndex{\LT@make@row}
% \SpecialIndex{\LT@echunk}
% \SpecialIndex{\LT@end@hd@ft}
% \SpecialIndex{\LT@kill}
% \SpecialIndex{\LT@output}
% \SpecialIndex{\adl@org@endlongtable}
% \SpecialIndex{\adl@org@LT@make@row}
% \SpecialIndex{\adl@org@LT@echunk}
% \SpecialIndex{\adl@org@LT@end@hd@ft}
% \SpecialIndex{\adl@org@LT@kill}
% \SpecialIndex{\adl@org@LT@output}
%
% The macro |\adl@LTinactivate| first calls |\adl@inactivate| to do basic
% inactivation and then |\let|-s the following control sequences be equal to
% their counterparts in \textsf{longtable}.
% \begin{itemize}\item[]
% |\endlongtable|\quad
% |\LT@make@row|\quad
% |\LT@echunk|\quad
% |\LT@end@hd@ft|\quad
% |\LT@kill|\\
% |\LT@output|
% \end{itemize}
% It also make |\adl@idashline| |\let|-equal to its inactive version because
% we need the macro to find mixed |\hline| and |\hdasnline| sequence.
% \end{macro}
%
% \begin{macrocode}
\let\adl@LT@array\LT@array
\def\LT@array{\adl@arrayinit \adl@LTfirstpagetrue
\let\adl@discard\relax \let\adl@ihdashline\adl@LTihdashline
\ifadl@inactive \adl@LTinactivate \fi
\adl@LT@array}
\def\adl@LTinactivate{\adl@inactivate
\let\endlongtable\adl@org@endlongtable
\let\LT@make@row\adl@org@LT@make@row
\let\LT@echunk\adl@org@LT@echunk
\let\LT@end@hd@ft\adl@org@LT@end@hd@ft
\let\LT@kill\adl@org@LT@kill
\let\LT@output\adl@org@LT@output
\let\adl@ihdashline\adl@LTinactivehdl}
% \end{macrocode}
%
% \begin{macro}{\adl@org@LT@make@row}
% \begin{macro}{\LT@make@row}
% \SpecialIndex{\adl@ncol}
% \SpecialIndex{\adl@columns}
% \SpecialIndex{\adl@LTstartpbox}
% \SpecialIndex{\@startpbox}
% \SpecialIndex{\@@startpbox}
% \SpecialIndex{\adl@LTendpbox}
% \SpecialIndex{\@endpbox}
% \SpecialIndex{\@@endpbox}
% \SpecialIndex{\LT@startpbox}
%
% The macro |\LT@make@row| is redefined for additional initialization which
% must be done after the original |\LT@array| performs its own
% initialization. First, |\LT@make@row| itself is reset to its original
% version |\adl@org@LT@make@row| to initialize stuffs only once, since
% |\LT@make@row| is called repeatedly at each chunk. Next |\adl@ncol| is
% assigned to |\adl@columns| to give its value calculated in |\@mkpream|.
% Then macros to begin\slash end |p|-boxes are made |\let|-equal to our own
% version because the original |\LT@array| has done it with its own version.
% Note that |\@@startpbox| and |\@statpbox| are |\let|-equal to our own
% |\adl@LTstartpbox| if \textsf{array} is not in use because with
% \textsf{array} opening a |p|-box is not done by |\@startpbox| but is
% embedded in |\@preamble|. Finally, the original version
% |\adl@org@LT@make@row| is called.
% \end{macro}\end{macro}
%
% \begin{macrocode}
\let\adl@org@LT@make@row\LT@make@row
\def\LT@make@row{\let\LT@make@row\adl@org@LT@make@row
\adl@columns\adl@ncol
\ifadl@usingarypkg\else
\let\@@startpbox\adl@LTstartpbox
\let\@startpbox\adl@LTstartpbox \fi
\let\@@endpbox\adl@LTendpbox
\let\@endpbox\adl@LTendpbox
\adl@org@LT@make@row}
%%^L
% \end{macrocode}
%
% The summary of the activation and inactivation specific to
% \textsf{longtable} is shown in Table~\ref{tab:lt-act}.
%
%
%
% \begin{table}
% \catcode`\|12
% \caption{Active and Inactive \textsf{longtable} Operations}\label{tab:lt-act}
% \def\!{\texttt{\char`\\\char`\\}}
% \centerline{\begin{tabular}[t]{|l||l|l|}\hline
% command&active&inactive\\\hline\hline
% {\tt p m b} (open)&&\\
% \qquad with \textsf{array}& \cs{adl@act@classz}&
% \cs{adl@org@classz}\\
% & \quad$\to$\cs{LT@startpbox}&
% \quad$\to$\cs{LT@startpbox}\\
% \qquad without \textsf{array}&\cs{adl@LTstartpbox}&
% \cs{LT@startpbox}\\\hline
% {\tt p m b} (close)& \cs{adl@LTendpbox}&
% \cs{LT@endpbox}\\\hline
% \cs{hline}& $\to$\cs{adl@act@hline}&
% $\to$\cs{@gobbletwo}\\\hline
% \cs{hdashline}& $\to$\cs{adl@LTihdashline}&
% $\to$\cs{adl@LTinactivehdl}\\
% & $\to$\cs{adl@act@hline}&
% $\to$\cs{@gobbletwo}\\\hline
% \cs{endlongtable}& modified version&
% \cs{adl@org@endlongtable}\\
% \cs{LT@make@row}&& \cs{adl@org@LT@make@row}\\
% \cs{LT@echunk}&& \cs{adl@org@LT@echunk}\\
% \cs{LT@end@hd@ft}&& \cs{adl@org@LT@end@hd@ft}\\
% \cs{LT@kill}&& \cs{adl@org@LT@kill}\\
% \cs{LT@output}&& \cs{adl@org@LT@output}\\\hline
% \end{tabular}}
% \end{table}
%
%
%
% \subsubsection{Ending Chunks}
% \label{sec:imp-lt-echunk}
%
% \begin{macro}{\adl@org@endlongtable}
% \begin{macro}{\endlongtable}
% \begin{macro}{\adl@org@LT@echunk}
% \begin{macro}{\LT@echunk}
% \begin{macro}{\adl@LTlastrow}
% \SpecialIndex{\adl@height}
% \SpecialIndex{\adl@depth}
% \SpecialIndex{\adl@@cr}
%
% When a chunk is closed with |\crcr|, we have to add the information of the
% last row to $R^{L/R}=|\adl@rowsL|/|R|$ if the row is not finished by an
% explicit |\\|. This is done by |\adl@LTlastrow| as we did at the first
% job of |\adl@endarray|. Two chunk closing macros, |\endlongtable| and
% |\LT@echunk|, are modified to call |\adl@LTlastrow| before its original
% job done by |\adl@org@endlongtable| and |\adl@org@LT@echunk| respectively.
% Note that |\adl@LTlastrow| only has |\crcr| and |\noalign| and thus
% another |\crcr| in original |\endlongtable| and |\LT@echunk| is
% no-operation as desired. Also note that |\adl@LTlastrow| is called twice
% from |\endlongtable|, once from |\LT@echunk| in the original version, but
% it is safe because the first call makes |\adl@height| and |\adl@depth|
% zero and thus the second become no-operation.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
%
% \begin{macrocode}
%% Compatibility with longtable: end chunk
\let\adl@org@endlongtable\endlongtable
\def\endlongtable{\adl@LTlastrow \adl@org@endlongtable}
\let\adl@org@LT@echunk\LT@echunk
\def\LT@echunk{\adl@LTlastrow \adl@org@LT@echunk}
\def\adl@LTlastrow{\crcr \noalign{
\ifdim\adl@height=\z@
\ifdim\adl@depth=\z@ \else \adl@@cr\z@ \fi
\else \adl@@cr\z@ \fi}}
% \end{macrocode}
%
% \begin{macro}{\adl@org@LT@end@hd@ft}
% \begin{macro}{\LT@end@hd@ft}
% \begin{macro}{\adl@LThfsave}
% \begin{macro}{\adl@LTth}
% \begin{Macro}{\\adl@LTth\LT@firsthead}
% \begin{Macro}{\\adl@LTth\LT@head}
% \begin{Macro}{\\adl@LTth\LT@lastfoot}
% \begin{Macro}{\\adl@LTth\LT@foot}
% \begin{Macro}{\\adl@rowsL\LT@firsthead}
% \begin{Macro}{\\adl@rowsL\LT@head}
% \begin{Macro}{\\adl@rowsL\LT@lastfoot}
% \begin{Macro}{\\adl@rowsL\LT@foot}
% \begin{Macro}{\\adl@rowsR\LT@firsthead}
% \begin{Macro}{\\adl@rowsR\LT@head}
% \begin{Macro}{\\adl@rowsR\LT@lastfoot}
% \begin{Macro}{\\adl@rowsR\LT@foot}
% \SpecialIndex{\endfirsthead}
% \SpecialIndex{\endhead}
% \SpecialIndex{\endlastfoot}
% \SpecialIndex{\endfoot}
% \SpecialIndex{\LT@firsthead}
% \SpecialIndex{\LT@head}
% \SpecialIndex{\LT@lastfoot}
% \SpecialIndex{\LT@foot}
% \SpecialIndex{\adl@rowsL}
% \SpecialIndex{\adl@rowsR}
% \SpecialIndex{\adl@totalheight}
%
% Another chunk ending macro is |\LT@end@hd@ft|\meta{box} to close a
% header\slash footer called by |\endfirsthead|, |\endhead|, |\endlastfoot|
% and |\endfoot| with an argument \meta{box} being |\LT@firsthead|,
% |\LT@head|, |\LT@lastfoot| and |\LT@foot| respectively.
% In order to maintain the information of rows
% $R^{L/R}=|\adl@rowsL|/|R|$ of headers/footers separately from the main one,
% the modified |\LT@end@hd@ft| saves them together with
% |\adl@totalheight| to weirdly named macros;
%
% \begin{quote}
% |\\adl@LTth|\meta{box}\\
% |\\adl@rowsL|\meta{box}\\
% |\\adl@rowsR|\meta{box}
% \end{quote}
%
% after closing the last row by |\adl@LTlastrow|. The |\string|
% representation of the macros looks like;
%
% \begin{quote}
% |\\adl@LTth\LT@firsthead|
% \end{quote}
% and so on. The saving operation is done by
% the macro |\adl@LThfsave|\meta{box}\meta{info} and is equivalent to;
%
% \begin{quote}
% |\global\let\|\meta{info}\meta{box}=\meta{info}
% \end{quote}
%
% After the saving, three global variables are reinitialized. Calling
% |\adl@LTlastrow| twice, once from the original version through
% |\LT@echunk| is safe as described above.
% \end{Macro}\end{Macro}\end{Macro}\end{Macro}
% \end{Macro}\end{Macro}\end{Macro}\end{Macro}
% \end{Macro}\end{Macro}\end{Macro}\end{Macro}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\let\adl@org@LT@end@hd@ft\LT@end@hd@ft
\def\LT@end@hd@ft#1{\adl@LTlastrow
\noalign{\edef\adl@LTth{\number\adl@totalheight}%
\adl@LThfsave#1\adl@LTth \global\adl@totalheight\z@
\adl@LThfsave#1\adl@rowsL\gdef\adl@rowsL{}%
\adl@LThfsave#1\adl@rowsR\gdef\adl@rowsR{}}
\adl@org@LT@end@hd@ft#1}
\def\adl@LThfsave#1#2{\expandafter\global\expandafter\let
\csname\string#2\string#1\endcsname#2}
% \end{macrocode}
%
% \begin{macro}{\adl@org@LT@kill}
% \begin{macro}{\LT@kill}
% \begin{macro}{\adl@LTkill}
% \begin{macro}{\adl@LTkillend}
% The additional job for yet another chunk closer |\LT@kill| to kill a
% template row is a little bit harder. Since the row information might have
% been added by an explicit |\\| preceding |\kill|, we have to remove it
% from the tail of |\adl@rowsL|\slash|R|, and subtract its $h_i$ from
% |\adl@totalheight| because |\kill|-ed row may be in header\slash footer
% definition. To do that, modified |\LT@kill| first ensures the information
% addition by |\adl@LTlastrow|, then traverses |\adl@rowsL|\slash|R| adding
% its non-last elements to |\@tempb| by the loop of |\adl@LTkill|, and
% assigns |\@tempb| to |\adl@rowsL|\slash|R| globally by
% |\adl@LTkillend| when |\adl@LTkill| find the tail. The macro
% |\adl@LTkillend| also sets the $h_i$ of the last element to |\@tempcnta|,
% which is subtracted from |\adl@totalheight| globally. Finally, the
% original version |\adl@org@LT@kill| is called.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\let\adl@org@LT@kill\LT@kill
\def\LT@kill{\adl@LTlastrow \noalign{
\def\@tempb{}\expandafter\adl@LTkill\adl@rowsL\@nil\adl@rowsL
\def\@tempb{}\expandafter\adl@LTkill\adl@rowsR\@nil\adl@rowsR
\global\advance\adl@totalheight-\@tempcnta}%
\adl@org@LT@kill}
\def\adl@LTkill#1;#2{\def\@tempa{#2}%
\ifx\@tempa\@nnil\def\next{\adl@LTkillend#1}%
\else\edef\@tempb{\@tempb#1;}\def\next{\adl@LTkill#2}\fi
\next}
\def\adl@LTkillend(#1/#2)#3{\global\let#3\@tempb \@tempcnta#2\relax}
%%^L
% \end{macrocode}
%
%
%
% \subsubsection{Horizontal Lines and \texttt{p}-Boxes}
% \label{sec:imp-lt-hlpbox}
%
% \begin{macro}{\LT@hline}
% \begin{macro}{\adl@hdashline}
% \changes{v1.7-1}{2004/5/21}
% {Keep original without shift up because it is done by
% \cs{adl@LThdline}.}
% \begin{macro}{\adl@LTihdashline}
% \begin{macro}{\adl@LTinactivehdl}
% \begin{macro}{\adl@LThdlrow}
% \SpecialIndex{\hline}
% \SpecialIndex{\adl@ihdashline}
% \SpecialIndex{\adl@inactivehdl}
% \SpecialIndex{\adl@hcline}
%
% The macro |\LT@hline|, \textsf{longtable} version of |\hline|, is
% redefined to add pseudo row information to $R^{L/R}$ and to check mixed
% sequence of |\hline| and |\hdashline|\footnote{
%
% In the original \textsf{longtable}, a sequence of three \cs{hline}-s are not
% recognized. This buggy feature is fixed in this implementation.}.
%
% We also define the macro |\adl@LTihdashline[|\meta{dash}|/|\meta{gap}|]|
% and its inactive counterpart |\adl@LTinactivehdl| as the
% \textsf{longtable} version of |\adl@ihdashline| and |\adl@inactivehdl|.
% These two macros, the main part of |\hdashline|, are redefined to make it
% possible that |\hdashline| can be broken into two part by \TeX's page
% breaker.
%
% These three macros call a common routine |\adl@LThdline| after defining
% |\adl@LThdlrow| which makes a row of horizontal (dash) line drawn by
% |\multispan| and |\leaders\hrule| or
% |\adl@hcline[|\meta{dash}|/|\meta{gap}|]|.
%
% Note that |\adl@hdashline| is redefined here because its version without
% \textsf{longtable} performs a part of the job done by |\adl@LThdline| as
% shown soon.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
%% Compatibility with longtable: horizontal lines and p-boxes
\def\LT@hline{\noalign{\ifnum0=`}\fi
\gdef\adl@LThdlrow{\multispan{\LT@cols}\unskip
\leaders\hrule\@height\arrayrulewidth\hfill\cr}%
\adl@LThdline}
\def\adl@hdashline#1{\noalign{\ifnum0=`}\fi
\@ifnextchar[%]
{#1}%
{#1[\dashlinedash/\dashlinegap]}}
\def\adl@LTihdashline[#1/#2]{%
\gdef\adl@LThdlrow{\multispan{\LT@cols}\unskip
\adl@hcline\z@[#1/#2]}%
\adl@LThdline}
\def\adl@LTinactivehdl[#1/#2]{%
\gdef\adl@LThdlrow{\multispan{\LT@cols}\unskip
\leaders\hrule\@height\arrayrulewidth\hfill\cr}%
\adl@LThdline}
% \end{macrocode}
%
%
% \begin{macro}{\adl@LThdline}
% \changes{v1.7-1}{2004/5/21}
% {Modified to shift up if null-wide.}
% \begin{macro}{\adl@LTxhline}
% \begin{macro}{\adl@LTixhline}
% \SpecialIndex{\@medpenalty}
% \SpecialIndex{\@lowpenalty}
% \SpecialIndex{\adl@hline}
% \SpecialIndex{\adl@connect}
% \SpecialIndex{\adl@discard}
%
% The macro |\adl@LThdline| called by above three macros first
% inserts a vertical penalty 10000 to inhibit page break between the
% horizontal line and preceding row. Then it inserts
% |\vskip-\arrayrulewidth| with another break inhibitor if
% |\ADLnullwidehline| is in effect, or adds the
% pseudo row information {\it connect}(|\arrayrulewidth|) to $R^{L/R}$ by
% |\adl@hline|\footnote{
%
% Or do noting if inactive and thus it is \cs{let}-equal to \cs{@gobbletwo}.}.
%
% Next, it draw a horizontal (dash) line by
% |\adl@LThdlrow| and checks if the following control sequence is |\hline|
% or |\hdashline| by |\futurelet| and |\adl@LTxhline|. If |\hline| or
% |\hdashline| is the next token, |\adl@LTixhline| is called to insert a
% vertical penalty of $-$|\@medpenalty| and a vertical space of
% |\doublerulesep|. The macro |\adl@LTixhline| also adds {\it
% disconnect}(|\doublerulesep|) to $R^{L/R}$ and makes |\adl@LThdlrow| void.
% Otherwise, |\adl@LThdline| inserts a vertical penalty of $-$|\@lowpanalty|
% and a vertical space of $-$|\arrayrulewidth| and draws the horizontal
% (dash) line again by |\adl@LThdlrow|. Thus a page can be broken between
% two overlaid horizontal (dash) lines\footnote{
%
% If the page is broken, the horizontal line at the beginning of the
% succeeding page has a width even if \cs{ADLnullwidehline} is in effect.}.
%
% Two pseudo row information, {\it
% discard}($-$|\arrayrulewidth|) for the negative vertical space which may
% be discarded and {\it connect}(|\arrayrulewidth|) for the second
% horizontal line, are also added to $R^{L/R}$.
% \end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@LThdline{\penalty\@M
\ifadl@zwhrule \vskip-\arrayrulewidth \penalty\@M
\else \adl@hline\adl@connect\arrayrulewidth \fi
\ifnum0=`{\fi}%
\adl@LThdlrow
\noalign{\ifnum0=`}\fi
\futurelet\@tempa\adl@LTxhline}
\def\adl@LTxhline{\ifx\@tempa\hline \adl@LTixhline
\else\ifx\@tempa\hdashline \adl@LTixhline
\else \penalty-\@lowpenalty \vskip-\arrayrulewidth
\adl@hline\adl@discard{-\arrayrulewidth}%
\adl@hline\adl@connect\arrayrulewidth
\fi\fi \ifnum0=`{\fi}%
\adl@LThdlrow \noalign{\penalty\@M}}
\def\adl@LTixhline{\penalty-\@medpenalty \vskip\doublerulesep
\adl@hline\relax\doublerulesep \global\let\adl@LThdlrow\@empty}
% \end{macrocode}
%
% \begin{macro}{\adl@LTstartpbox}
% \begin{macro}{\adl@LTendpbox}
% \SpecialIndex{\@startpbox}
% \SpecialIndex{\@@startpbox}
% \SpecialIndex{\@@endpbox}
% \SpecialIndex{\LT@startpbox}
% \SpecialIndex{\adl@act@@startpbox}
% \SpecialIndex{\adl@act@@endpbox}
%
% Macros for opening/closing |p|-boxes are fairly simple. The macros
% |\adl@LTstartpbox{|\meta{w}|}| and |\adl@LTendpbox| are |\let|-assigned
% to |\@@startpbox| and |\@@endpbox| by |\LT@make@row|. The former
% opens a |p|-box of $w$ wide by our own
% |\adl@act@@startpbox| and performs a footnote related operation introduced
% by \textsf{longtable}. The latter closes the |p|-box by our own
% |\adl@act@@endpbox| and also performs the footnote stuffs. Note that if
% \textsf{array} is in use, a |p|-box is opened by codes embedded in
% |\@preamble| and its initialization is done by
% |\@startpbox|${}={}$|\LT@startpbox|.
% \end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@LTstartpbox#1{%
\adl@act@@startpbox{#1}\let\@footnotetext\LT@p@ftntext}
\def\adl@LTendpbox{\adl@act@@endpbox \the\LT@p@ftn \global\LT@p@ftn{}}
%%^L
% \end{macrocode}
%
%
%
% \subsubsection{First Chunk}
% \label{sec:imp-lt-start}
%
% \begin{macro}{\LT@start}
% \SpecialIndex{\LT@firsthead}
% \SpecialIndex{\adl@LTpagetotal}
%
% The macro |\LT@start| which puts (first) head and controls the page break
% of the first page is modified for the followings.
%
% \begin{itemize}
% \item
% After it inserts a vertical skip |\LTpre|, |\endgraf| is performed so that
% the skip contributes to |\pagetotal|\footnote{
%
% This modification is necessary for the original \textsf{longtable}, or it
% underestimates the room of the first page and leaves head and foot only.}.
%
% \item
% When the |\box2| is |\vsplit| to get first item of the first chunk,
% |\vbadness| is saved into |\@tempcnta|, set to 10000 to avoid unnecessary
% |underfull| message\footnote{
%
% This is also necessary for the original version.},
%
% and restored from |\@tempcnta|.
%
% \item
% The |\dimen| register |\adl@LTpagetotal| is set to |\pagetotal| to know
% the total height of the items preceding |longtable|. Since the assignment
% is performed after the inserted |\endgraf| and the intentional page break,
% it should have real total height.
%
% \item
% The box |\LT@firsthead| is put by |\copy| rather than |\box| because it is
% referred in the |\output| routine.
% \end{itemize}
%
% This macro does not have inactive counterpart because the modification
% shown above is desirable (first two) or not-harmful\footnote{
%
% Logically, at least.}
%
% (last two) to the original version.
% \end{macro}
%
% \begin{macrocode}
%% Compatibility with longtable: first chunk
\def\LT@start{%
\let\LT@start\endgraf
\endgraf \penalty\z@ \vskip\LTpre \endgraf
\dimen@\pagetotal
\advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
\advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
\advance\dimen@ \ht\LT@foot
\dimen@ii\vfuzz \@tempcnta\vbadness
\vfuzz\maxdimen \vbadness\@M
\setbox\tw@\copy\z@
\setbox\tw@\vsplit\tw@ to \ht\@arstrutbox
\setbox\tw@\vbox{\unvbox\tw@}%
\vfuzz\dimen@ii \vbadness\@tempcnta
\advance\dimen@\ht
\ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi
\advance\dimen@\dp
\ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi
\advance\dimen@ -\pagegoal
\ifdim \dimen@>\z@\vfil\break \fi
\global\adl@LTpagetotal\pagetotal
\global\@colroom\@colht
\ifvoid\LT@foot\else
\advance\vsize-\ht\LT@foot
\global\advance\@colroom-\ht\LT@foot
\dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@
\maxdepth\z@
\fi
\copy\ifvoid\LT@firsthead \LT@head \else \LT@firsthead \fi
\output{\LT@output}}
%%^L
% \end{macrocode}
%
%
%
% \subsubsection{Output Routine}
% \label{sec:imp-lt-output}
%
% \begin{macro}{\adl@org@LT@output}
% \begin{macro}{\LT@output}
% \SpecialIndex{\LT@firsthead}
% \SpecialIndex{\LT@head}
% \SpecialIndex{\LT@lastfoot}
% \SpecialIndex{\LT@foot}
%
% The output routine is the heart of the \textsf{longtable} compatible
% implementation. The macro |\LT@output| which is set to |\output| by
% |\LT@start| is modified from its original (and thus inactive) version
% |\adl@org@LT@output| as follows.
%
% \begin{itemize}
% \item
% Three fractions of the original version to compile the final output image
% of the table portion into |\box255| or the main vertical list are modified
% to set the image into |\box255| unconditionally and to call
% |\adl@LTdraw|\meta{foot}\meta{tail} which is the real heart of the
% compatible implementation. The argument \meta{foot} is |\LT@foot| or
% |\LT@lastfoot| according to the portion of the |longtable| to be output.
% The argument \meta{tail} is |\vss| if the last item is it which is not
% included in |\box255| yet, or |\@empty| otherwise. Since |\adl@LTdraw|
% builds final output image drawing vertical (dash) lines in |\box255|, it is
% put to the main vertical list if the |longtable| portion is the last one.
%
% \item
% Since the boxes |\LT@head|, |\LT@foot| and |\LT@lastfoot| are referred in
% |\adl@LTdraw|, they are put by |\copy| rather than |\box|.
% \end{itemize}
% \end{macro}\end{macro}
%
% \begin{macrocode}
%% Compatibility with longtable: output routine
\let\adl@org@LT@output\LT@output
\def\LT@output{%
\ifnum\outputpenalty <-\@Mi
\ifnum\outputpenalty > -\LT@end@pen
\LT@err{floats and marginpars not allowed in a longtable}\@ehc
\else
\setbox\z@\vbox{\unvbox\@cclv}%
\ifdim \ht\LT@lastfoot>\ht\LT@foot
\dimen@\pagegoal
\advance\dimen@-\ht\LT@lastfoot
\ifdim\dimen@<\ht\z@
\setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot}%
\adl@LTdraw\LT@foot\vss
\@makecol
\@outputpage
\setbox\z@\vbox{\copy\LT@head}%
\fi
\fi
\global\@colroom\@colht
\global\vsize\@colht
\setbox\@cclv\vbox{\unvbox\z@
\copy\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}%
\adl@LTdraw\LT@lastfoot\@empty \box\@cclv
\fi
\else
\setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot}%
\adl@LTdraw\LT@foot\vss
\@makecol
\@outputpage
\global\vsize\@colroom
\copy\LT@head
\fi}
% \end{macrocode}
%
%
% \begin{macro}{\adl@LTdraw}
% \begin{macro}{\adl@LTinit}
% \begin{macro}{\adl@LTheadL}
% \begin{macro}{\adl@LTheadR}
% \begin{macro}{\adl@LTfootL}
% \begin{macro}{\adl@LTfootR}
% \SpecialIndex{\adl@LTpagetotal}
% \SpecialIndex{\ifadl@LTfirstpage}
%
% The macro |\adl@LTdraw|\meta{foot}\meta{tail} draws vertical
% (dash) lines onto the image in |\box255|. First it measures the total
% height $H$ (|\adl@totalheight|) of |longtable| rows in |\box255| and the
% total height $H_b$ (|\@tempdima|) of its {\em body} which consists of the
% rows without the header and footer, as follows where $H_{255}$, $H_h$ and
% $H_t$ are the height plus depth of |\box255| and the effective header and
% footer of the page respectively.
%
% \begin{eqnarray*}
% T&=&\cases{\hbox{\cs{adl@LTpagetotal}}&if \cs{ifadl@LTfirstpage}\cr
% 0&otherwise}\\
% t&=&\cases{
% \hbox{\cs{topskip} glue}&
% if \texttt{longtable} is the first item of the page\cr
% & ($\lnot(\hbox{\cs{ifadl@firstpage}}\land T{>}0)$)\cr
% 0& otherwise}\\
% H&=&H_{255}-t-T\\
% H_b&=&H-H_h-H_t
% \end{eqnarray*}
%
% The hard part is to measure $t$ because it is not |\topskip| but that
% minus the first box of |\box255|. Thus we do not measure $t$ but remove
% it from the box by the following tricky way. First we copy |\box255|
% items into |\box0| adding a |\hrule| of 1\,sp high as its first item.
% Then |\box0| is |\vsplit| to 1\,sp setting |\splittopskip| to 0.
% Since the |\topskip| glue is the first item of |\box255| and the |\vsplit|
% discards it at the breakpoint, |\box0| must have all the items in
% |\box255| lead by 0 (|\splittopskip|) glue rather than |\topskip| glue.
% Thus the height of |\box0| is $H_{255}-t$.
%
% \SpecialIndex{\LT@firsthead}
% \SpecialIndex{\LT@head}
% \SpecialIndex{\LT@lastfoot}
% \SpecialIndex{\LT@foot}
% \SpecialWeirdIndex{\\adl@LTth\LT@firsthead}
% \SpecialWeirdIndex{\\adl@LTth\LT@head}
% \SpecialWeirdIndex{\\adl@LTth\LT@lastfoot}
% \SpecialWeirdIndex{\\adl@LTth\LT@foot}
% \SpecialWeirdIndex{\\adl@rowsL\LT@firsthead}
% \SpecialWeirdIndex{\\adl@rowsL\LT@head}
% \SpecialWeirdIndex{\\adl@rowsL\LT@lastfoot}
% \SpecialWeirdIndex{\\adl@rowsL\LT@foot}
% \SpecialWeirdIndex{\\adl@rowsR\LT@firsthead}
% \SpecialWeirdIndex{\\adl@rowsR\LT@head}
% \SpecialWeirdIndex{\\adl@rowsR\LT@lastfoot}
% \SpecialWeirdIndex{\\adl@rowsR\LT@foot}
%
% Subtraction of $H_h$ and $H_t$ is done by the macro
% |\adl@LTinit{|\meta{hf}|}|\meta{box}, where \meta{hf} is |head| or |foot|
% and \meta{box} is one of |\LT@firsthead|, |\LT@head| and \meta{foot}
% (|\LT@lastfoot| or |\LT@foot|). This macro also copies the contents of
% weirdly named structure such as |\\adl@rowsL\LT@head| into |\adl@LTheadL|
% and so on\footnote{
%
% Copying by \cs{edef} can be replaced by \cs{let} with many
% \cs{expandafter} but it is not comprehensible.}
%
% if \meta{box} is not void. Otherwise, |\adl@LTheadL| etc. is kept to
% their initial value, |\@empty|.
%
% \SpecialIndex{\adl@makevlrL}
% \SpecialIndex{\adl@makevlrL}
% \SpecialIndex{\adl@rows}
% \SpecialIndex{\adl@rowsL}
% \SpecialIndex{\adl@rowsR}
% \SpecialIndex{\adl@vlrow}
% \SpecialIndex{\adl@vlrowL}
% \SpecialIndex{\adl@vlrowR}
% \SpecialIndex{\adl@addvl}
% \SpecialIndex{\adl@addvlL}
% \SpecialIndex{\adl@addvlR}
% \SpecialIndex{\adl@currentcolumn}
%
% Next, we make rows for vertical lines by |\adl@makevlrL|\slash|R| after
% extracting the leading part of $R^{L/R}$ corresponding to the {\em body}
% by the macro
% |\adl@LTsplit|\meta{$R^{L/R}$}\meta{$R^{L/R}_h$}\meta{$R^{L/R}_f$}, where
% $R^{L/R}_h$ and $R^{L/R}_f$ are |\adl@LTheadL| and so on. Since the macro
% defines |\adl@rows| given to |\adl@makevlL|\slash|R| to the sequence of
% $R^{L/R}_h$, the extracted part of $R^{L/R}$ and $R^{L/R}_f$, the rows for
% vertical lines for all the rows including header and footer are build in
% |\adl@vlrowL| and |\adl@vlrowR| as in the ordinary case without
% |longtable|.
%
% \SpecialIndex{\LT@bchunk}
% \SpecialIndex{\LT@save@row}
% \SpecialIndex{\c@LT@chunks}
% \SpecialIndex{\LT@rows}
% \SpecialIndex{\adl@vl}
% \SpecialIndex{\adl@@vl}
% \SpecialIndex{\adl@drawvl}
%
% Then the rows are put into |\box0| by calling |\LT@bchunk| with
% |\adl@drawvl| (line drawing) and |\LT@save@row| (column widths
% adjustment), saving\slash restoring counters |\LT@rows| and |\c@LT@chunks|
% which |\LT@bchunk| globally updates. Since we refer potentially
% immature |\LT@save@row| here, some weird looking vertical lines could be
% drawn but the result after convergence should be correct. Finally, the
% contents of |\box255| followed by the vertical lines in |\box0| are put
% back into |\box255| keeping its original depth and adding \meta{tail}
% (|\vss| or nothing) to its end.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@LTdraw#1#2{%
\@tempswatrue
\ifadl@LTfirstpage\ifdim\adl@LTpagetotal>\z@\@tempswafalse \fi\fi
\if@tempswa
\setbox\z@\vbox{\hrule height1sp\unvcopy\@cclv}
\splittopskip\z@
\setbox\@ne\vsplit\z@ to1sp\relax
\@tempdima\ht\z@
\else \@tempdima\ht\@cclv \fi
\advance\@tempdima\dp\@cclv
\adl@totalheight\@tempdima
\let\adl@LTheadL\@empty \let\adl@LTheadR\@empty
\let\adl@LTfootL\@empty \let\adl@LTfootR\@empty
\ifadl@LTfirstpage
\global\adl@LTfirstpagefalse
\advance\@tempdima-\adl@LTpagetotal
\adl@totalheight\@tempdima
\ifvoid\LT@firsthead
\adl@LTinit{head}\LT@head
\else \adl@LTinit{head}\LT@firsthead
\fi
\else \adl@LTinit{head}\LT@head \fi
\ifvoid#1%
\adl@LTinit{foot}\LT@foot
\else \adl@LTinit{foot}#1\fi
\let\adl@vl\relax \def\adl@discard{\adl@connect}%
\def\adl@vlrow{}\adl@currentcolumn\@ne
\adl@LTsplit\adl@rowsL\adl@LTheadL\adl@LTfootL
\let\adl@addvl\adl@addvlL
\adl@makevlrL \let\adl@vlrowL\adl@vlrow
\def\adl@vlrow{}\adl@currentcolumn\adl@columns
\adl@LTsplit\adl@rowsR\adl@LTheadR\adl@LTfootR
\let\adl@addvl\adl@addvlR
\adl@makevlrR \let\adl@vlrowR\adl@vlrow
\let\adl@vl\adl@@vl
\@tempcnta\LT@rows
\LT@bchunk \adl@drawvl
\LT@save@row\cr \egroup \setbox\@ne\lastbox \unskip \egroup
\global\advance\c@LT@chunks\m@ne
\global\LT@rows\@tempcnta
\@tempdima\dp\@cclv
\setbox\@cclv\vbox{\unvbox\@cclv \box\z@ \vskip-\@tempdima
\hrule\@width\z@\@height\z@\@depth\@tempdima#2}}
\def\adl@LTinit#1#2{\ifvoid#2\else
\advance\@tempdima-\csname\string\adl@LTth\string#2\endcsname sp%
\expandafter\edef\csname adl@LT#1L\endcsname{%
\csname\string\adl@rowsL\string#2\endcsname}%
\expandafter\edef\csname adl@LT#1R\endcsname{%
\csname\string\adl@rowsR\string#2\endcsname}\fi}
% \end{macrocode}
%
% \begin{macro}{\adl@LTsplit}
% \begin{macro}{\adl@LTxsplit}
% \begin{macro}{\adl@LTrowrelax}
% \begin{macro}{\adl@LTrowdiscard}
% \begin{macro}{\adl@LTysplit}
% \begin{macro}{\adl@LTisplit}
% \begin{macro}{\adl@LTiisplit}
% \begin{macro}{\adl@LTsplitend}
% \SpecialIndex{\adl@rows}
% \SpecialIndex{\adl@discard}
%
% The macro
% |\adl@LTsplit|\meta{$R^{L/R}$}\meta{$R^{L/R}_h$}\meta{$R^{L/R}_f$} moves
% leading elements in $R^{L/R}$ into $R'$ (|\adl@rows|) until total heights
% of the elements summed in $h$ (|\@tempdimb|) reaches to $H_b$
% (|\@tempdima|)\footnote{
%
% Although $h$ must become $H_b$ exactly in usual case, we stop the loop
% when $h\geq H_b$ to avoid accidental overrun in unusual cases.}
%
% by a straightforward loop with the macros |\adl@LTisplit| to fetch the
% $i$-th element and |\adl@LTiisplit| to get $h_i$. Before moving, however,
% we have to remove discardable item(s)\footnote{
%
% Must be only one but the implementation allows two or more.}
%
% from the top of $R^{L/R}$. Since an element for a discardable item is
% {\it disconnect} (|\relax|) or {\it discard} (|\adl@discard|), we check
% the first part of the element by |\ifx|-comparison with |\adl@LTrowrelax|
% and |\adl@LTrowdiscard| whose bodies are |\relax| and |\adl@discard| if the
% |longtable| portion does not have a header ($R^{L/R}_h$ is |\@empty|).
% Otherwise, the discardable item was not discarded because the first
% item of the page is not it but the header.
%
% Note that since moving from $R^{L/R}$ to $R'$ is done by |\edef| and
% |\adl@discard| is |\def|-ined as |\adl@connect| in |\adl@LTdraw|,
% non-discarded {\it discard} transforms into {\it connect} in $R'$. Also
% note that since the remaining part of $R^{L/R}$ is |\def|-ined as the body
% of |\@tempb| which is globally |\let|-assigned to $R^{L/R}$ again,
% |\adl@discard| survives in the new $R^{L/R}$.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@LTsplit#1#2#3{\def\adl@rows{}\@tempdimb\z@
\expandafter\adl@LTxsplit#1\@nil;%
\edef\adl@rows{#2\adl@rows#3}%
\global\let#1\@tempb}
\def\adl@LTxsplit#1;{\def\@tempa{#1}%
\ifx\@tempa\@nnil \def\@tempb{}\let\next\relax
\else\ifx\adl@LTheadL\@empty \def\next{\adl@LTysplit#1}%
\else \def\next{\adl@LTisplit#1;}\fi \fi
\next}
\def\adl@LTrowrelax{\relax}
\def\adl@LTrowdiscard{\adl@discard}
\def\adl@LTysplit(#1/#2){\def\@tempa{#1}%
\ifx\@tempa\adl@LTrowrelax \let\next\adl@LTxsplit
\else\ifx\@tempa\adl@LTrowdiscard \let\next\adl@LTxsplit
\else \def\next{\adl@LTisplit(#1/#2);}\fi \fi
\next}
\def\adl@LTisplit#1;{\def\@tempa{#1}%
\ifx\@tempa\@nnil \def\@tempb{}\let\next\relax
\else\ifdim\@tempdimb<\@tempdima
\adl@LTiisplit#1\let\next\adl@LTisplit
\else \def\next{\adl@LTsplitend#1;}\fi \fi
\next}
\def\adl@LTiisplit(#1/#2){\edef\adl@rows{\adl@rows(#1/#2);}%
\advance\@tempdimb#2sp}
\def\adl@LTsplitend#1;\@nil;{\def\@tempb{#1;}}
\fi
%%^L
% \end{macrocode}
%
%
%
% \subsection{Compatibility with \textsf{colortbl}}
% \label{sec:imp-colortbl}
% \changes{v1.7}{2003/05/21}
% {\S\ref{sec:imp-colortbl} is added.}
%
% The implementation to make \textsf{arydshln} compatible with
% \textsf{colortbl} consists of the following three (almost
% independent) issues.
%
% \begin{description}
% \item[Cell coloring]
% is the easiest part because it does not affect dash line drawing. Another
% reason of the easiness is that \textsf{colortbl} packs each cell in a box
% to measure its height for painting in the modified version of |\@classz|.
% Thus we do not need to code |\@classz| for both of \textsf{colortbl} and
% \textsf{arydshln}, but may sneak our own height\slash depth measurement
% into |\@classz| of \textsf{colortbl}. Almost everything we have to pay
% attention to is the compatibility of the initialization and finalization
% of \textsf{colortbl} and \textsf{arydshln}.
%
% \item[Horizontal line coloring]
% is relatively easy because it is almost enough to insert coloring macro
% |\CT@arc@| before the line drawing. A little bit complicated part is the
% gap coloring which is done by drawing a solid line of gap color before
% dash line is drawn.
%
% \item[Vertical line coloring]
% is the hardest part but almost everything is done in previous sections to
% attach dash\slash gap color to each vertical line segment $e^i_j$ in the
% list $C_i^L$ and $C_i^R$ of the $i$-th row information $r_i$. What we do
% here is to fix the bugs of |\arrayrulecolor| and |\doublerulesepcolor| in
% \textsf{colortbl} implementation and to add |\dashgapcolor|. If you put
% |\arrayrulecolor| in |>{...}| construct to specify the color
% of the vertical lines following the construct as the manual of
% \textsf{colortbl} says, you will have an error message ``Misplaced
% |\noalign|'' because the macro is expanded with |\noalign| in a column
% body. Even if you somehow remove |\noalign| to avoid the error, you will
% have a mysterious line coloring as follows:
%
% \begin{itemize}
% \item
% If you have |\arrayrulecolor| before the |\array|\slash|\tabular| starts,
% |\arrayrule#color| in the preamble has no effect to vertical lines but
% decides the color of horizontal lines except for those at the top of the
% environment. Additional |\arrayrulecolor| at the beginning of a row has
% no effect to vertical lines (as expected) but decides horizontal lines
% following it (also as expected). The effect of |\doublerulesepcolor| is
% same as |\arrayrulecolor|.
%
% \item
% Otherwise, i.e. without |\arrayrulecolor| outside the environment,
% |\arrayrule#color| in the preamble decides the color of vertical and
% horizontal lines except for verticals preceding columns in the first row
% and horizontals at the top of the environment. Additional
% |\arrayrulecolor| at the beginning of a row decides all the vertical and
% horizontal lines following it. On the other hand, |\doublerulesepcolor|
% acts as if |\doublerulesepcolor{white}| is done outside the environment.
% \end{itemize}
%
% The reason of the mysterious behavior is as follows. An
% |\arrayrulecolor|, which globally |\def|-ines a macro |\CT@arc@| with a
% body containing |\color|, in the preamble is not expanded nor evaluated in
% the preamble construction phase but done when the first (and succeeding)
% row is build. On the other hand, |\CT@arc@| attached to vertical line
% drawing is expanded in the preamble construction phase. Thus if
% |\CT@arc@| has been defined before the environment starts, vertical lines
% are colored following the outside definition. Otherwise, since |\CT@arc@|
% is |\let|-equal to |\relax|, it remains unchanged in the preamble
% construction phase and expanded when each row is build referring its
% definition that |\arrayrulecolor| modifies in the row building phase.
% Since the macro |\CT@drsc@| defined by |\doublerulesepcolor| is examined
% if it is |\relax| or not in the preamble construction phase,
% |\doublerulesepcolor| in the preamble has no effect regardless the
% existence of the outside definition.
%
% Thus we have to expand and evaluate |\arrayrulecolor| and
% |\doublerulecolor| in the preamble construction phase to define |\CT@arc@|
% and |\CT@drsc@|. We also have to initialize |\CT@arc@| as an expandable
% but non-operative token (e.g. a macro with a body of |\relax| as we do) to
% make it is expanded in the preamble construction phase rather than the row
% building.
% \end{description}
%
%
%
% \subsubsection{Initialization, Cell Coloring and Finalization}
% \label{sec:impl-colortbl-init}
%
% \begin{macro}{\CT@arc@}
% \begin{macro}{\adl@dashgapcolor}
% First of all, we initialize the macro |\CT@arc@|, which will be
% |\def|-ined as |\color| to specify the color of solid lines and dash
% segments by |\arrayrulecolor|, with a body of |\relax| because it will be
% referred by the vertical line drawing process even if \textsf{colortbl} is
% not in use. We also initialize the macro |\adl@dashgapcolor| for the
% color of gaps of dash lines similarly. Note that these macros are not
% |\let|-equal to |\relax| but have bodies of |\relax| so that they are
% replaced with |\relax| in the preamble construction phase rather than
% surviving with their own name.
% \end{macro}\end{macro}
%
% \begin{macrocode}
%% Compatibility with colortbl
\def\CT@arc@{\relax}
\def\adl@dashgapcolor{\relax}
% \end{macrocode}
%
% \SpecialIndex{\@ifpackageloaded}
% Next we examine if \textsf{colortbl} is in use by |\@ifpackageloaded|, and
% skip everything if not, or we have some errors especially when
% \textsf{array} is not in use.
%
% \begin{macrocode}
\@ifpackageloaded{colortbl}\@tempswatrue\@tempswafalse
\if@tempswa
% \end{macrocode}
%
% \begin{macro}{\adl@org@inactivate}
% \begin{macro}{\adl@org@activate}
% \begin{macro}{\adl@inactivate}
% \begin{macro}{\adl@activate}
% \begin{macro}{\CT@setup}
% \begin{macro}{\@endpbox}
% Then we redefine |\adl@inactivate| and |\adl@activate| referring their
% original version |\adl@org@inactivate| and |\adl@org@activate| so that
% they make |\CT@setup| |\let|-equal to its original version |\adl@CT@setup|
% if |\ADLinactivate| is in effect, or to our own version
% |\adl@act@CT@setup| which will be defined soon. New |\adl@activate| also
% {\em inactivates} \hbox{|\@endpbox|} because our own one for column
% height\slash
% depth measuremnt is inappropriate with \textsf{colortbl} as explained soon.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\let\adl@org@inactivate\adl@inactivate
\let\adl@org@activate\adl@activate
\def\adl@inactivate{\adl@org@inactivate \let\CT@setup\adl@CT@setup}
\def\adl@activate{\adl@org@activate \let\CT@setup\adl@act@CT@setup
\let\@endpbox\adl@org@endpbox}
% \end{macrocode}
%
% \begin{macro}{\adl@CT@setup}
% \begin{macro}{\CT@setup}
% \begin{macro}{\adl@act@CT@setup}
% \SpecialIndex{\adl@@colhtdp}
% Cell coloring is done by |\@classz| preamble of \textsf{colortbl} in which
% a column is packed in |\box0|. On the other hand, our own |\@classz| one
% with \textsf{array} packs the column in |\adl@box| so that we measure its
% height
% and depth. Thus we have choices; to insert height\slash depth measurement
% into \textsf{colrotbl}'s version; or to insert coloring into our own version.
% Since the code of height\slash depth measurement is much simpler than the
% coloring, we choose the first way. Thus the macro |\adl@act@CT@setup|,
% which is |\let|-equal to |\CT@setup| and is invoked from |\@classz|
% preamble after the column is packed into |\box0|, measures the height and
% depth of |\box0| and sets |\adl@height| and/or |\adl@depth| to them if
% they break the records as |\adl@@colhtdp| does with |\adl@box|, after it
% invokes its original version |\adl@CT@setup|. Note that we compare
% |\adl@height| with the height of |\box0| plus |\minrowclearance| because
% it is the real height. Also note that we could insert the measurement
% code into the modified version of \textsf{colortbls}'s |\@classz| placing
% it just before the |\box0| is put where |\ht0| plus |\minrowclearance| is
% caluculated, but did not because the author wished to make it clear that
% |\@classz| is modified only for the bug fix of |\arrayrulecolor| and
% |\doublerulesepcolor| (and to introduce |\dashgapcolor|).
% \end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\let\adl@CT@setup\CT@setup
\def\CT@setup{\adl@CT@setup
\@tempdima\ht\z@ \advance\@tempdima\minrowclearance
\ifdim\adl@height<\@tempdima \global\adl@height\@tempdima \fi
\ifdim\adl@depth<\dp\z@ \global\adl@depth\dp\z@\fi}
\let\adl@act@CT@setup\CT@setup
% \end{macrocode}
%
% \begin{macro}{\adl@activatepbox}
% \SpecialIndex{\CT@cell@color}
% \SpecialIndex{\CT@row@color}
% \SpecialIndex{\CT@column@color}
% \SpecialIndex{\CT@do@color}
% \SpecialIndex{\multicolumn}
% Another job for cell coloring is to make |\CT@|$x$|@color|
% ($x\in\{\texttt{cell},\texttt{column},\texttt{do}\}$)
% |\let|-equal to |\relax| before the body of |\multicolumn| is put so that
% the |\columncolor| in the environment preamble does not affect the
% |\span|-ned column. Note that resetting |\CT@cell@color| will be
% unnecessary (but safe) because it is always reset after its invocation.
% Also note that resetting |\CT@row@color| in \textsf{colortbl}'s
% |\multicolumn| is a buggy feature because it should be effective, and thus
% we remove it. Although we have our own |\multicolumn| for dash lines, we
% keep it unchanged. Instead we redefine |\adl@activatepbox|, which is
% usually |\relax| with \textsf{array}, to do the color resetting to
% minimize recoding.
% \end{macro}
%
% \begin{macrocode}
\def\adl@activatepbox{\let\CT@cell@color\relax
\let\CT@column@color\relax
\let\CT@do@color\relax}
% \end{macrocode}
%
% \begin{macro}{\adl@CT@start}
% \begin{macro}{\CT@start}
% \begin{macro}{\adl@dashgapcolor@save}
% \begin{macro}{\adl@CT@end}
% \begin{macro}{\CT@end}
% \begin{macro}{\endarray}
% \begin{macro}{\endArray}
% Yet another job is the save\slash restore of color information at the
% beginning and end of the environment. Since this is done by |\CT@start| and
% |\CT@end|, we modify them to save\slash restore |\adl@dashgapcolor|
% to/from |\adl@dashgapcolor@save| referring their original version
% |\adl@CT@start| and |\adl@CT@end|. We also modify our own |\endarray| and
% its shorthand active version |\endArray| so that |\CT@end| is invoked at
% the end of environment. Note that we may not modify |\endtabular| because
% it refers |\endarray|. Also note that |\CT@start| is invoked from
% |\@tabarray| which we keep unchanged.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\let\adl@CT@start\CT@start
\def\CT@start{\adl@CT@start \let\adl@dashgapcolor@save\adl@dashgapcolor}
\let\adl@CT@end\CT@end
\def\CT@end{\adl@CT@end \global\let\adl@dashgapcolor\adl@dashgapcolor@save}
\def\endarray{\adl@endarray \egroup \adl@arrayrestore \CT@end \egroup}
\ifx\adl@notdefinable\undefined \let\endArray\endarray \fi
% \end{macrocode}
%
% \subsubsection{Horizontal Line Coloring}
% \label{sec:impl-colortbl-hline}
%
% \begin{macro}{\hline}
% \begin{macro}{\adl@inactivehdl}
% \begin{macro}{\adl@ixhline}
% \SpecialIndex{\CT@arc@}
% \SpecialIndex{\CT@drsc@}
% \SpecialIndex{\cline}
% To color |\hline| and inactivated |\hdashline|, we modify our own |\hline|
% and |\adl@inactivehdl| inserting the line coloring macro |\CT@arc@| before
% drawing by |\hrule| and pushing the coloring\slash drawing into a group.
% We also modify |\adl@ixhline| to draw a colored horizontal rule of
% |\doublerulesep| wide with the color defined in |\CT@drsc@| if it is not
% |\relax|, rather than to insert a vertical skip. Note that the |\cline|
% coloring is done by \textsf{colortbl}'s |\cline| renamed as
% |\adl@org@cline| and invoked from our own one.
% \end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\hline{\noalign{\ifnum0=`}\fi
\ifadl@zwhrule \vskip-\arrayrulewidth
\else \adl@hline\adl@connect\arrayrulewidth \fi
{\CT@arc@ \hrule\@height\arrayrulewidth}%
\global\adl@finaldepth\z@
\futurelet\@tempa\adl@xhline}
\def\adl@inactivehdl[#1/#2]{\ifadl@zwhrule \vskip-\arrayrulewidth \fi
{\CT@arc@ \hrule\@height\arrayrulewidth}%
\futurelet\@tempa\adl@xhline}
\def\adl@ixhline{{\ifx\CT@drsc@\relax \vskip \else
\CT@drsc@\hrule\@height \fi \doublerulesep}%
\adl@hline\relax\doublerulesep}
% \end{macrocode}
%
% \begin{macro}{\adl@ihdashline}
% \begin{macro}{\adl@act@ihdashline}
% \begin{macro}{\adl@cdline}
% \begin{macro}{\adl@act@cdline}
% To draw a horizontal dash line with colored dashes and also colored gaps,
% we drastically modified |\adl@ihdashline| for |\hdashline| and
% |\adl@cdline| for |\cdashline|. First, they invoke |\adl@hclinesetup|
% that makes the prefix of a |\multispan|-ned row from the first to last
% columns for |\hdashline| or given columns for |\cdashline|. Then the line
% is drawn by the modified version of |\adl@hcline|. We have to declare
% these macros are active ones again.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@ihdashline[#1/#2]{\adl@hclinesetup\@ne\adl@columns
\adl@hcline\z@[#1/#2]%
\noalign{\ifnum0=`}\fi
\futurelet\@tempa\adl@xhline}
\let\adl@act@ihdashline\adl@ihdashline
\def\adl@cdline[#1-#2]{\ifadl@zwhrule \vskip-\arrayrulewidth \fi
\adl@hclinesetup{#1}{#2}%
\adl@hcline{-\arrayrulewidth}}
\let\adl@act@cdline\adl@cdline
% \end{macrocode}
%
% \begin{macro}{\adl@hclinesetup}
% \begin{macro}{\adl@cdlinea}
% \begin{macro}{\adl@cdlineb}
% The macro |\adl@hclinesetup|\meta{f}\meta{t} makes the prefix of a
% |\multispan|-ned row from the column $f$ to $t$ and |\global|-ly defines
% it as |\@gtempa|. This is done by a code very similar to original
% |\adl@cdline| (and thus \LaTeX-2.09's |\cline|) but the invocation of
% |\adl@hcline| is removed form |\adl@cdliena| and |\adl@cdlineb|, one of
% which is |\@gtempa|.
% \end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@hclinesetup#1#2{\global\adl@cla#1\relax
\global\advance\adl@cla\m@ne
\ifnum\adl@cla>\z@ \global\let\@gtempa\adl@cdlinea
\else \global\let\@gtempa\adl@cdlineb\fi
\global\adl@clb#2\relax
\global\advance\adl@clb-\adl@cla \ifnum0=`{\fi}}
\def\adl@cdlinea{\multispan\adl@cla &\multispan\adl@clb \unskip}
\def\adl@cdlineb{\multispan\adl@clb \unskip}
% \end{macrocode}
%
% \begin{macro}{\adl@hcline}
% \begin{macro}{\adl@paintdashgap}
% \SpecialIndex{\adl@draw}
% The modified version of |\adl@hcline|\meta{w}|[|\meta{d}|/|\meta{g}|]|
% draws a colored horizontal dash line of dash size $d$ and gap size $g$ and
% insert vertical skip of $w$. First it |\span|-s columns by |\@gtempa| and
% checks if the body of |\adl@dashgapcolor| is something other than
% |\relax|. If so, i.e.\ it has |\color|,
% |\adl@paintdashgap| is invoked to
% draw a horizontal rule of |\color| by |\leaders| as the background
% of the dash line, to insert |\nobreak| (for \textsf{longtable}) a negative
% space for canceling the width of the
% rule, and to |\span| the columns again. Then |\adl@hcline| draws the
% colored dash line, over the background if the gaps are colored, by
% inserting |\CT@arc@| before the invocation of |\adl@draw|.
% \end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@hcline#1[#2/#3]{\@gtempa
\ifx\adl@dashgapcolor\adl@nocolor \else \adl@paintdashgap \fi
{\@tempdima#2\relax \@tempdimb#3\relax
\CT@arc@ \adl@draw\adl@vrule\hskip\hbox}\cr
\noalign{\global\adl@finaldepth\z@ \ifdim#1=\z@\else
\ifadl@zwhrule\else \vskip#1\fi\fi}}
\def\adl@paintdashgap{{\adl@dashgapcolor
\leaders\hrule\@height\arrayrulewidth\hfill}\cr
\noalign{\penalty\@M \vskip-\arrayrulewidth}\@gtempa}
% \end{macrocode}
%
% \subsubsection{Vertical Line Coloring}
% \label{sec:impl-colortbl-vline}
%
% \begin{macro}{\arrayrulecolor}
% \begin{macro}{\CT@arc@}
% \begin{macro}{\doublerulesepcolor}
% \begin{macro}{\CT@drsc@}
% \begin{macro}{\dashgapcolor}
% \begin{macro}{\adl@dashgapcolor}
% \begin{macro}{\adl@defcolor}
% \begin{macro}{\adl@idefcolor}
% \begin{macro}{\adl@noalign}
% \begin{macro}{\nodashgapcolor}
% \SpecialIndex{\@array}
% A bug of \textsf{colortbl}'s |\arrayrulecolor| and |\doublerulesepcolor|
% is that they are defined like;
%
% \begin{quote}
% |\ifdim\baselineskip=\z@ \noalign \fi{\gdef\CT@arc@{\color...}}|
% \end{quote}
%
% This aims to do |\noalign{\gdef...}| in \textsf{array}\slash
% \textsf{tabular} and do |{\gdef...}| outside but has two problems: First,
% if they are in |>{...}| construct, they are expanded with |\noalign|
% inappropriately when the argument of |>| is expanded. Second, they may
% appear at a place where |\baselineskip| is 0 but is outside of
% \textsf{array}\slash\textsf{tabular} and will cause the misplaced
% |\noalign| error. To solve the second problem, we introduced
% |\adl@noalign| which is set to |\noalign| in the environment by our own
% |\@array|, and |\relax| outside. We also introduced
% |\adl@defcolor|\meta{cs}\meta{opt} for the common job to define \meta{cs}
% as |\color| with \meta{opt}, in |\noalign| if necessary, by
% |\adl@idefcolor|. Thus |\arrayrulecolor| and |\doublerulesepcolor| are
% modified to define |\CT@arc@| and |\CT@drsc@| using |\adl@defcolor|, and
% our own |\dashgapcolor| is defined
% similarly to define |\adl@dashgapcolor|. Another macro |\nodashgapcolor|
% to nullify |\dashgapcolor| is also defined with |\adl@noalign| to reset
% |\adl@dashgapcolor| to |\relax|.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\arrayrulecolor{\adl@defcolor\CT@arc@}
\def\doublerulesepcolor{\adl@defcolor\CT@drsc@}
\def\dashgapcolor{\adl@defcolor\adl@dashgapcolor}
\def\adl@defcolor#1#2#{\adl@idefcolor{#1}{#2}}
\def\adl@idefcolor#1#2#3{\adl@noalign{\gdef#1{\color#2{#3}}}}
\let\adl@noalign\relax
\def\nodashgapcolor{\adl@noalign{\gdef\adl@dashgapcolor{\relax}}}
% \end{macrocode}
%
% \begin{macro}{\@classz}
% \begin{macro}{\adl@act@classz}
% \begin{macro}{\adl@org@classz}
% The tougher bug of \textsf{colortbl} is the expansion timing of
% |\arrayrulecolor| and |\dobule#rule#sep#color| in a |>|-argument. We
% have to modify |\@classz| to extract them from
% |\toks|\break|\@tempcnta| as its
% original version does for |\columncolor|. Thus we inserted the invocation
% of |\adl@extract@arc| for |\arrayrulecolor|, |\adl@extract@drsc| for
% |\doublerulesep#color|, and |\adl@extract@dgc| for |\dashgapcolor| just
% after the invocation of |\CT@extract|. Note that the other part of
% |\@classz| is not modified logically, but done for author's preference of
% indentation. Also note that both |\adl@act@classz| and |\adl@org@classz|
% are |\let|-equal to the modified |\@classz| because we have to be bug free
% even if |\ADLinactive| is in effect.
% \end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\@classz{\@classx
\@tempcnta\count@ \prepnext@tok
\expandafter\CT@extract\the\toks\@tempcnta\columncolor!\@nil
\expandafter\adl@extract@arc\the\toks\@tempcnta\arrayrulecolor!\@nil
\expandafter\adl@extract@drsc
\the\toks\@tempcnta\doublerulesepcolor!\@nil
\expandafter\adl@extract@dgc\the\toks\@tempcnta\dashgapcolor!\@nil
\@addtopreamble{%
\setbox\z@\hbox\bgroup\bgroup
\ifcase \@chnum
\hskip\stretch{.5}\kern\z@
\d@llarbegin
\insert@column
\d@llarend\hskip\stretch{.5}%
\or \d@llarbegin \insert@column \d@llarend \hfill
\or \hfill \kern\z@ \d@llarbegin \insert@column \d@llarend
\or $\vcenter
\@startpbox{\@nextchar}\insert@column \@endpbox $%
\or \vtop \@startpbox{\@nextchar}\insert@column \@endpbox
\or \vbox \@startpbox{\@nextchar}\insert@column \@endpbox
\fi
\egroup\egroup
\begingroup
\CT@setup
\CT@column@color
\CT@row@color
\CT@cell@color
\CT@do@color
\endgroup
\@tempdima\ht\z@
\advance\@tempdima\minrowclearance
\vrule\@height\@tempdima\@width\z@
\unhbox\z@}%
\prepnext@tok}
\let\adl@act@classz\@classz
\let\adl@org@classz\@classz
% \end{macrocode}
%
% \begin{macro}{\adl@def@extract}
% \begin{macro}{\adl@extract@arc}
% \begin{macro}{\adl@extract@arc@b}
% \begin{macro}{\CT@arc@}
% \begin{macro}{\adl@extract@drsc}
% \begin{macro}{\adl@extract@drsc@b}
% \begin{macro}{\CT@drsc@}
% \begin{macro}{\adl@extract@dgc}
% \begin{macro}{\adl@extract@dgc@b}
% \begin{macro}{\adl@dashgapcolor}
% The definitions of |\adl@extract@|$x$ ($x\in\{\texttt{arc}, \texttt{drsc},
% \texttt{dgc}\}$) are quite similar to each other. For example
% |\adl@extract@arc| is defined as follows.
%
%\begin{verbatim}
%\def\adl@extract@arc#1\arrayrulecolor#2#3\@nil{%
% \if!#2\toks\@tempcnta{#1}\let\@tempa\relax%
% \else\if[#2%]
% \def\@tempa{\adl@extract@arc@b{#1}#3\@nil}%
% \else \def\CT@arc@{\color{#2}}%
% \def\@tempa{\adl@extract@arc#1#3\@nil}%
% \fi\fi \@tempa}
%\def\adl@extract@arc@b#1#2]#3{%
% \def\CT@arc@{\color[#2]{#3}}%
% \adl@extract@arc#1}
%\end{verbatim}
%
% This code extracts {\em all the} occurrences of
% |\arrayrulecolor[|\meta{m}|]|\Meta{c} from the token register and
% |\def|-ines |\CT@arc@| as |\color[|\meta{m}|]|\Meta{c}. Note that
% |\CT@extract| does a similar job for |\columncolor| but it mistakingly
% ignores the possibility that the token register has two or more
% |\columncolor|\footnote{
%
% Fixing this bug is not our business.}.
%
% Anyway, if we copy the code above and replace
% `|@arc|' with `|@drsc|', |\arrayrulecolor| with |\doublerulesepcolor|, and
% |\CT@arc@| with \hbox{|\CT@drsc@|}, we will have |\adl@extract@drsc|(|@b|)
% for
% |\doublerulesepcolor|. The code for |\adl@extract@dgc|(|@b|) will be also
% obtained similarly. However, having three relatives for a almost common
% job is too awful. Thus we introduce;
%
% \begin{quote}
% |\adl@def@extract|\meta{key}\meta{umac}\meta{cmac}
% \end{quote}
%
% to define the macros |\adl@extract@|\textit{key} and
% |\adl@extract@|\textit{key}|@b| for the user interface macro \meta{umac}
% in which a color macro \meta{cmac} is defined with |\color|. For example,
% we will obtain |\adl@extract@arc|(|@b|) shown above by;
%
% \begin{quote}
% |\adl@def@extract{arc}\arrayrulecolor\CT@arc@|
% \end{quote}
%
% Note that |\color| is made |\relax| in the preamble construction phase
% by \textsf{colortbl}'s \break |\@mkpream| and regain its proper meaning
% after the phase.
% \end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\def\adl@def@extract#1#2#3{%
\expandafter\def\csname adl@extract@#1\endcsname##1#2##2##3\@nil{%
\if!##2\toks\@tempcnta{##1}\let\@tempa\relax
\else\if[##2%]
\def\@tempa{\@nameuse{adl@extract@#1@b}{##1}##3\@nil}%
\else \def#3{\color{##2}}%
\def\@tempa{\@nameuse{adl@extract@#1}##1##3\@nil}%
\fi\fi \@tempa}
\expandafter\def\csname adl@extract@#1@b\endcsname##1##2]##3{%
\def#3{\color[##2]{##3}}%
\@nameuse{adl@extract@#1}##1}}
\adl@def@extract{arc}\arrayrulecolor\CT@arc@
\adl@def@extract{drsc}\doublerulesepcolor\CT@drsc@
\adl@def@extract{dgc}\dashgapcolor\adl@dashgapcolor
% \end{macrocode}
%
%
%
% \subsubsection{Compatibility with \textsf{longtable}}
% \label{sec:impl-colortbl-longtable}
%
% \begin{macro}{\LT@hline}
% \begin{macro}{\adl@LTihdashline}
% \begin{macro}{\adl@LTinactivehdl}
% \begin{macro}{\adl@LTixhline}
% Yet another compatiblity issue is to cope with both \textsf{longtable} and
% \textsf{colortbl}. We redefine |\LT@hline| and |\LT@inactivehdl| in order
% to put |\CT@arc@| before line drawing and to push them in a group.
% Modified |\adl@LTidashline| first
% invokes |\adl@hclinesetup| and open |\noalign| because it is closed by
% |\adl@hclinesetup|. The contents of |\adl@LThdlrow| for
% |\adl@LTidashline| is simply |\adl@hcline| because it does |\multispan|
% now. The macro |\adl@LTixhline| is modified to paint the |\doublerulesep|
% gap by |\leaders\hrule| with color of |\CT@drsc@| if it is not |\relax|.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
%
% \begin{macrocode}
\ifx\longtable\undefined\else
\def\LT@hline{\noalign{\ifnum0=`}\fi
\gdef\adl@LThdlrow{\multispan{\LT@cols}\unskip{\CT@arc@
\leaders\hrule\@height\arrayrulewidth\hfill}\cr}%
\adl@LThdline}
\def\adl@LTihdashline[#1/#2]{\adl@hclinesetup\@ne\adl@columns
\noalign{\ifnum0=`}\fi
\gdef\adl@LThdlrow{\adl@hcline\z@[#1/#2]}%
\adl@LThdline}
\def\adl@LTinactivehdl[#1/#2]{%
\gdef\adl@LThdlrow{\multispan{\LT@cols}\unskip{\CT@arc@
\leaders\hrule\@height\arrayrulewidth\hfill}\cr}%
\adl@LThdline}
\def\adl@LTixhline{%
\ifx\CT@drsc@\relax \gdef\adl@LThdlrow{\noalign{
\penalty-\@medpenalty \vskip\doublerulesep}}
\else \gdef\adl@LThdlrow{\noalign{\penalty\@M}%
\multispan{\LT@cols}\unskip{\CT@drsc@
\leaders\hrule\@height\doublerulesep\hfill}\cr}\fi
\ifnum0=`{\fi}\adl@LThdlrow \noalign{\ifnum0=`}\fi
\adl@hline\relax\doublerulesep \global\let\adl@LThdlrow\@empty}
\fi
\fi
% \end{macrocode}
%
% \iffalse
%</package>
% \fi
%
%
%
% \IndexPrologue{\newpage\section*{Index}
% Italicized number refers to the page where the specification and usage of
% corresponding entry is described, while underlined is for the
% implementation of the entry.
%
% To find a control sequence, remove prefixes \cs{@}, \cs{adl@} and
% \cs{ifadl@} from its name if it has one of them.}
% \Finale
% \newpage
% \PrintChanges
\endinput
|