1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
|
% \section{Overview}
% \label{sec:imp-ovv}
%
% \subsection{Column-Pages}
% \label{sec:imp-ovv-colpage}
%
% In our parallel multi-column typesetting, a column may grow independently
% of other columns and may cross its page boundary asynchronously with
% others. Therefore, we cannot throw away the contents of a column in a
% page, or a {\em\Uidx\colpage} in short, when a page break occurs in the
% column. Instead, we have to keep \colpage{}s until all columns are
% {\em\Uidx\sync{}ed} implicitly or explicitly.
%
% An {\em\Uidx\imsync} takes place when all columns in a page see
% page-breaks to let the page is shipped out. In general, all columns but
% the last one which arrives the page-break have completed \colpage{}s in the
% page in question and some of them may have succeeding \colpage{}s.
% Therefore, we maintain the list of completed \colpage{}s
% $\Uidx\S_c=|\pcol@shipped|{\cdot}c$
%
% \SpecialArrayMainIndex{c}{\pcol@shipped}
%
% for each column $c\In0\C$, where $\Uidx\C=\!\pcol@ncol!$ is the number of
% columns given through the argument of \env{paracol} environment, and the
% set of them $\Uidx\SS=\Set{\S_c}{c\In0\C}$.
%
% Each element $\Uidx\s_c(p)$ of a list $\S_c$ is an \!\insert! whose
% \!\vbox! contains the
% $p$-th completed \colpage\footnote{
%
% Other registers such as \cs{count} are not used.},
%
% where $p=0$ for the first \colpage{} produced in \env{paracol}
% environment or that following a page flushing macro \!\flushpage!,
% \!\clearpage! or \!\cleardoublepage!. That is, $\S_c$ is defined as
% follows, where $\Uidx\pbase=\!\pcol@basepage!$ is the zero-origin ordinal
% of the {\em\Uidx\bpage} being the oldest page not shipped out yet.
%
% \begin{eqnarray*}
% \S_c&=&(\s_c(\pbase),\s_c(\pbase{+}1),\ldots,\s_c(\pbase{+}k{-}1))\\
% &=&\!\@elt!\,\s_c(\pbase)\;\!\@elt!\,\s_c(\pbase{+}1)\;\cdots\;
% \!\@elt!\,\s_c(\pbase{+}k{-}1)
% \end{eqnarray*}
%
% Note that a list $\S_c$ can be empty and all members in $\SS$ may be empty.
%
% The other type of \sync{}ation, {\em\Uidx\exsync}, takes place by
% \!\switchcolumn!|*| or the beginning of starred \csenv{}s, by
% \Endparacol, or by one of page flushing macros \!\flushpage!,
% \!\clearpage! and \!\cleardoublepage!. A flushing \exsync{} ships out the
% pages from $\pbase$ to $\Uidx\ptop=\!\pcol@toppage!$ being the ordinal of
% the {\em\Uidx\tpage} to which the most advanced {\em\Uidx\lcolumn} has
% reached. On the other hand, other non-flushing \exsync{} keeps the page
% $\ptop$ from being shipped out because the \colpage{}s in it or the page
% itself will grow further.
%
%
%
% \subsection{Current Column-Pages and Their Contexts}
% \label{sec:imp-ovv-ccol}
% \changes{v1.3-4}{2013/09/17}
% {Remove $\mu$ for \cs{@mparbottom} from column-context because it is
% now in page context.}
%
% We also have to maintain another type of \colpage{}s which are currently
% built, or {\em\Uidx\ccolpage{}s} in short, to switch from a column to
% another. Since each column may have its own {\em context} for the
% typsetting of it, or {\em\Uidx\cctext} in short, it were perfect to save
% the context when we leave from a
% column and to restore that when we revisit the column if we could.
% However, \TeX{} and \LaTeX{} has a tremendously large number of context
% variables and the number becomes virtualy boundless when we take variables
% defined in various styles and by users themselves into account.
% Therefore, we had to abandon to keep the whole context of the column but
% carefully chose a small subset comprising variables automatically modified
% outside of users' control. That is, the \cctext{}
% $\Uidx\cc_c=|\pcol@col|{\cdot}c$
%
% \SpecialArrayMainIndex{c}{\pcol@col}
%
% of a column $c$ consists of the following elements, each of which named
% $e$ is referred to as $\cc_c(e)$ hereafter.
%
% \begin{itemize}
% \item $\Uidx\vb$
% represents $\!\insert!{\cdot}\vb$ containing the followings.
%
% \begin{itemize}
% \item
% $\vb^b=\!\box!{\cdot}\vb=\!\@holdpg!$ is the \!\vbox! containing the main
% vertical list which has already contributed to the \ccolpage{}.
%
% \item
% $\vb^p=\!\count!{\cdot}\vb=\!\pcol@page!$ means the \ccolpage{} belongs to
% the page $\vb^p$.
%
% \item
% $\vb^r=\!\dimen!{\cdot}\vb=\!\@colroom!$ is the room of the column.
% \end{itemize}
%
% \item $\Uidx\ft=\Midx{\!\pcol@currfoot!}$
% is the \!\insert! containing the footnotes added in the \ccolpage, if
% \Mcfnote{} typesetting is in effect. Its constituent \!\box!, \!\count!,
% \!\dimen! and \!\skip! are denoted as $\ft^b$, $\ft^c$, $\ft^d$ and
% $\ft^s$ respectively. On the other hand, if \Scfnote{} typesetting is in
% effect, $\ft$ is always empty\footnote{
%
% But the macro \cs{pcol@currfoot} is used to keep \Scfnote{}s temporarily.}.
%
% \item $\Uidx\pd=\!\pcol@prevdepth!$
% is the depth of the last vertical item in $\vb^b$ obtained by
% \!\prevdepth!.
%
% \item $\Uidx\tl=\!\@toplist!$
% is the list of top floats inserted in the \ccolpage.
%
% \item $\Uidx\ml=\!\@midlist!$
% is the list of mid floats inserted in the \ccolpage.
%
% \item $\Uidx\bl=\!\@botlist!$
% is the list of bottom floats inserted in the \ccolpage.
%
% \item $\Uidx\dl=\!\@deferlist!$
% is the list of \cwise{} floats deferred to the next \colpage.
%
% \item $\Uidx\tf=\!\pcol@textfloatsep!$
% is the vertical skip used instead of \!\textfloatsep! for top floats in the
% \ccolpage{} if it has \sync{}ation points, or $\infty$ otherwise.
%
% \item $\Uidx\fh=\!\@textfloatsheight!$
% is the total height of mid floats and their separators in the \ccolpage.
%
% \item $\Uidx\tn=\!\@topnum!$
% is the maximum number of top floats which the \ccolpage{} can accommodate
% further.
%
% \item $\Uidx\tr=\!\@toproom!$
% is the room for top floats in the \ccolpage.
%
% \item $\Uidx\bn=\!\@botnum!$
% is the maximum number of bottom floats which the \ccolpage{} can accommodate
% further.
%
% \item $\Uidx\br=\!\@botroom!$
% is the room for bottom floats in the \ccolpage.
%
% \item $\Uidx\cn=\!\@colnum!$
% is the maximum total number of floats which the \ccolpage{} can accommodate
% further.
%
% \item $\Uidx\sw$
% is the following encoding of \CSIndex{if@nobreak} and
% \CSIndex{if@afterindent} at the time we left from the column $c$.
% $$
% \sw=\cases{0&$\CSIndex{if@nobreak}=\false$\cr
% 1&$\CSIndex{if@nobreak}=\true\;\land\;
% \CSIndex{if@afterindent}=\true$\cr
% 2&$\CSIndex{if@nobreak}=\true\;\land\;
% \CSIndex{if@afterindent}=\false$}
% $$
% Note that we have only three states because \CSIndex{if@afterindent} is
% meaningful only when $\CSIndex{if@nobreak}=\true$\footnote{
%
% If only with the standard \LaTeX{} and so far.}.
%
% \item $\Uidx\ep=\!\everypar!$
% is the tokens stored in \!\everypar! at the time we left from the column
% $c$.
% \end{itemize}
%
% \changes{v1.1}{2012/05/11}
% {Add description of $w_c\EQ\cs{pcol@columnwidth}{\cdot}c$.}
%
% In addition, we have special context variables
% $\Uidx\w_c=|\pcol@columnwidth|{\cdot}c$
%
% \SpecialArrayMainIndex{c}{\pcol@columnwidth}
%
% in which we keep \!\columnwidth! for the column $c$.
%
% Note that we could add other variables to the saved context and/or provide
% some API macro to define them by users, but abandon them because it should
% be too complicated for users\footnote{
%
% And for the author if we include save/restore of macros, though it could
% be done with a \cs{toks} containing the \cs{def}initions of macros.}.
%
% Also note that we provide a save/restore mechanism for \lcounter{}s as
% discussed in \secref{sec:imp-ovv-counter}.
%
%
%
% \subsection{Pages and Their Contexts}
% \label{sec:imp-ovv-page}
% \changes{v1.2-2}{2013/05/11}
% {Redesign page context and its implementation.}
% \changes{v1.3-3}{2013/09/17}
% {Add $\pi^s(p)$ to the page context of $p$ for column-separating
% rule drawing and background painting.}
% \changes{v1.3-4}{2013/09/17}
% {Add $\pi^m(p)$ to the page context of $p$ for marginal note
% placement.}
%
% Besides the \colpage{}s, we have to keep track each whole page not yet
% shipped out but has some complete or incomplete (i.e., current) \colpage{}s.
% We maintain the list;
%
% \SpecialMainIndex{\pcol@pages}
%
% \begin{eqnarray*}
% \Uidx\PP
% &=&\!\pcol@pages!=(\Uidx\pp(\pbase),\pp(\pbase{+}1),\ldots\pp(\ptop{-}1))\\
% &=&\!\@elt!\,\pp(\pbase)\;\!\@elt!\,\pp(\pbase{+}1)\;\cdots\;
% \!\@elt!\,\pp(\ptop{-}1)\\
% \pp(p)&=&|{|\pp^p(p)|}|\pp^i(p)\pp^f(p)|{|\pp^s(p)|}||{|\pp^m(p)|}|
% \end{eqnarray*}
%
% where $\pp(p)$ is the {\em\Uidx\pctext} of $p$ and its elements $\pp^p(p)$,
% $\pp^i(p)$, $\pp^f(p)$, $\pp^s(p)$ and $\pp^m(p)$ have the followings.
%
% \begin{itemize}
% \item
% $\pp^p(p)=\Uidx\page(p)$ is the value of the counter \counter{page}
% (i.e. \!\c@page!) for the page $p$.
%
% \item
% Iff $\pp^i(p)\neq\bot$, the page $p$ has \pwise{} floats or the
% single-column {\em\Uidx\preenv} preceeding \beginparacol{} in the
% {\em\Uidx\spage} where it resides and spannig all columns. In this case
% $\pp^i(p)=i$ represents $\!\insert!{\cdot}i$, often {\em cached}
% in the macro \!\pcol@spanning!, for such {\em\Uidx\spanning}
% whose registers have the followings.
%
% \begin{itemize}
% \item
% $\pp^b(p)=\!\box!{\cdot}i$ contains the \spanning.
%
% \item
% $\pp^h(p)=\!\dimen!{\cdot}i=\!\@colht!$ if positive for the height of
% columns shrunk by the \spanning. If negative, the page is only for
% the \spanning, i.e. a {\em\Uidx\fpage}. We use the notation $\pp^h(p)$
% for the pages $\pp^i(p)=\bot$ to mean \!\textheight!.
%
% \item
% $\pp^t(p)=\!\skip!{\cdot}i=\!\pcol@topskip!$ being the value of
% \!\topskip! at \beginparacol{} to be inserted at the top of each column in
% each non-first page. Otherwise, i.e., for the columns in the \spage{}
% following the \preenv{}, it has 0 to prevent the \!\topskip! insertion.
% We use the notation $\pp^t(p)$ for the pages $\pp^i(p)=\bot$ to
% mean \!\pcol@topskip!.
% \end{itemize}
%
% \item
% Iff $\pp^f(p)\neq\bot$, \Scfnote{} typesetting, discussed in
% \secref{sec:imp-ovv-scfnote}, is in effect and the page $p$ has some
% footnotes in $\!\box!\cdot\pp^f(p)$. This element is often {\em cached}
% in the macro \Midx{\!\pcol@footins!}.
%
% \SpecialMainIndex{\pcol@pages}
%
% \item
% $\pp^s(p)=(\Uidx\spt(H_1,h_1),\ldots,\spt(H_n,h_n))=
% \!\@elt!\Arg{H_1,h_1}\ldots\!\@elt!\Arg{H_n,h_n}$ is the list of \mctext{}s
% in the page $p$, where $i$-th one's top edge is at $H_i$ from the top of
% the page (excluding \spanning) and its height-plus-depth is $h_i$, where
% $H_i$ and $h_i$ are represented in the form of integers. Therefore, it is
% emptied by \!\pcol@startpage!, and then the elements are added by
% \!\pcol@makecol! (only for the last one) and \!\pcol@output@switch!
% whenever they find a \mctext{} completes. The element is often {\em
% cached} in the macro \!\pcol@sptextlist! and is referred to by
% \!\pcol@buildcolseprule! to draw \cseprule{} and to paint columns and
% \csepgap{} leaving spaces for \mctext{}s. The usage of this element is
% discussed in \secref{sec:imp-ovv-cswap} a little bit more detailedly.
%
% \item
% $\pp^m(p)=\Arg{\Uidx\mpb_L^l}\Arg{\mpb_L^r}\Arg{\mpb_R^l}\Arg{\mpb_R^r}$
% is the set of lists of marginal notes in the left ($l$) and right
% ($r$) margins and in the left ($L$) and right ($R$) \parapag{}es. The
% words left and right of margins mean physical left and right, while left
% and right of \parapag{}es mean the logical ones, i.e., the page where the
% column-0 resides is left. Each element $\mpb_{\{L,R\}}^{\{l,r\}}$ has a
% list $(\Uidx\mpar(t_1,b_1),\ldots,\mpar(t_n,b_n))=
% \!\@elt!\Arg{t_1}\Arg{b_1}\ldots\!\@elt!\Arg{t_n}\Arg{b_n}$ of marginal
% notes whose top and bottom are at $t_i$ and $b_i$ from the top of the
% column area, where $t_i$ and $b_i$ are represented in the form of
% integers. Each element can be empty of course, and $\pp^m(p)$ itself can
% be so as well to mean all elements are empty\footnote{
%
% To minimize the possibility of miscoding for emptying and save a small
% amount of memory for pages having no marginal notes.}.
%
% Therefore, $\pp^m(p)$ is emptied by
% \!\pcol@startpage!, and then examined and modified by
% \!\pcol@addmarginpar! when it adds a marginal note through macros
% \!\pcol@getmparbottom! and \!\pcol@setmpbelt!. Another modifier
% \!\pcol@output@start! initializes one of the element $\mpb_L^{\{l,r\}}$
% with the value representing the last marginal note in \preenv{}, while
% another examiner \!\pcol@output@end! lets the outside \!\@mparbottom! have
% a value based on $b_n$ of one of the element, according to \LaTeX's
% setting of marginal note placement. The whole elemnt $\pp^m(p)$ is often
% {\em cached} in the macro \!\pcol@mparbottom!. The usage of this
% element is discussed in \secref{sec:imp-ovv-cswap} a little bit more
% detailedly.
% \end{itemize}
%
% Note that even in \parapag{}ing and in \npaired{} one in particular,
% a page $p$ consists of all columns $c\In0\C$. Therefore, the term {\em
% left\slash right \parapag{}e} $p$ always mean the left and right component
% of a \parapag{}e (pair) $p$.
%
% The reason why we keep track of $\page(p)$ is that page numbering is not
% necessrary to be consecutive. If such a {\em jump} occurs randomly in any
% columns explicitly updating \counter{page}, it is very tough to give a
% consistent view of the page number of a specific page to all columns.
% Therefore we suppose jumps occur only in the leftmost column 0\footnote{
%
% But we neither inhibit nor nullify a jump in non-leftmost column and thus
% the update can be seen referring to \texttt{page} counter explicitly.}
%
% which controls the page numbering, while non-leftmost columns are expected
% to refer the \counter{page} passively.
%
% This page numbering is implemented as follows. Each time a \colpage{} at
% $p$ of the leftmost column is completed to start a new \colpage{},
% $\page(p)$ is fixed to be the value of \counter{page} and
% $\page(q)=\pp^p(q)$ for all $q\in[p,\ptop]$ are let be $\page(p)+(q-p)$ in
% usual cases but $\page(p)+2(q-p)$ in \npaired{} \parapag{}ing.
% This update also takes place on \cswitch{} from the leftmost \colpage{} at
% $p$ to another column so that a jump happning before the switching is
% notified to other columns. On the other hand, starting or \cswitch{} to a
% non-leftmost \colpage{} at $p$ lets \counter{page} have $\page(p)$
% referring to $\pp(p)$, unless the column starts the most advanced \tpage.
% In this new \tpage{} case, $\pp(\ptop{+}1)$ is added to $\PP$ with the
% temporary setting $\pp^p(\ptop+1)=\page(\ptop+1)=\page(\ptop)+1$ usually but
% $\pp^p(\ptop+1)=\page(\ptop+1)=\page(\ptop)+2$ in \npaired{}
% \parapag{}ing, and $\ptop$ is incremented.
%
% Note that this management is imperfect because direct references of
% \counter{page} in non-leftmost columns can give inconsistent results if
% \counter{page} is modified in a non-leftmost column or the reference occurs
% in a page $p$ after that the leftmost column modifies \counter{page} in a
% page $q$ such that $q\leq p$. In addition to them, this mechanism in
% \npaired{} \parapag{}ing always gives incorrect page number to the
% columns in a right \parapag{}e because $\pp^p(p)$ always has $\page(p)$
% for the left \parapag{}e. However, it is expected that the progress of
% the leftmost column usually preceeds other columns to give consistent
% \counter{page} reference even with jumps, unless the reference is made by
% a column in a right \npaired{} \parapag{}e. More importantly, it is
% assured that indirect refereces through |.aux| records and page numbers
% recorded in |.toc|, |.idx|, and so on are always consistent because of the
% lazy evaluation of $\counter{page}=\page(p)$ at ship-out of an ordinary
% page $p$ or a left \parapag{}e $p$, while the counter is let have
% $\page(p)+1$ when a right \npaired{} \parapag{}e $p$ is shipped out.
%
% Also note that we also keep $\pp(\ptop)$ in \Midx{\!\pcol@currpage!}
% which is initialized by \!\pcol@output@start! to let $\pp^i(\ptop)$ have
% the \preenv. Then the macro is redefined to have the value representing
% the new page possibly with $\pp^i(\ptop)$ for \pwise{} floats in
% \!\pcol@startpage! by the macro \!\pcol@defcurrpage!. Another
% \!\def!inition is done in \!\pcol@output@switch! also with
% \!\pcol@defcurrpage! to let $\pp^f(\ptop)$ have \Scfnote{}s built in
% \!\footins! if \scfnote{} typsetting is in effect and the \cswitch{}
% leaves the column in $\ptop$\footnote{
%
% The \!\def!inition of \!\pcol@currpage! in \!\pcol@setpnoelt!, and
% emptying it in \!\pcol@output@start! and \!\pcol@freshpage! are for coding
% trick and thus not for giving a really new \!\def!initions.}.
%
% We denote the concatenation of $\PP$ and $\pp(\ptop)$ as $\Uidx\PPP$ to
% represent all pages {\em on-the-fly}.
%
%
%
% \subsection{Counters}
% \label{sec:imp-ovv-counter}
%
% Besides the context variables discussed in \secref{sec:imp-ovv-ccol}, we
% need to make counters local to each column except for those declared to be
% global by \!\globalcounter!. Let $\Uidx\CC$ be the set (list) of all
% counters declared before \beginparacol, i.e., $\CC=\!\cl@@ckpt!$, and
% $$
% \Uidx\CG=\!\pcol@gcounters!=\{\Uidx\cg_1,\ldots\}=\!\@elt!|{|\cg_1|}|\cdots
% $$
% be the set of {\em\Uidx\gcounter{}s} which have declared so by
% \!\globalcounter!|{|$\cg_i$|}|. Then the set of {\em\Uidx\lcounter{}s}
% $\Uidx\CTL$ is defined as follows.
%
% \SpecialMainIndex{\pcol@counters}
% $$
% \CTL=\CC-\CG=\!\pcol@counters!=\{\Uidx\cl_1,\ldots\}=\!\@elt!|{|\cl_1|}|\cdots
% $$
%
% Since each column has its own values in \lcounter{}s, we have to keep the
% set of counter\slash value pairs
%
% \SpecialArrayMainIndex{c}{\pcol@counters}
% $$
% \Uidx\Cc_c=\!\pcol@counters!{\cdot}c=\{\<\cl_1,\val_c(\cl_1)\>,\ldots\}
% =\!\@elt!|{|\cl_1|}||{|\val_c(\cl_1)|}|\cdots
% $$
% for each column $c$, where $\Uidx\val_c(\cl_i)$ is the value of a counter
% $\cl_i$ local to $c$. That is, whenever we switch from a column $c$ to
% $d$, we save $\<\cl_i,\val_c(\cl_i)\>$ in $\Cc_c$ and restore $\cl_i$ for
% $d$ by letting it have $\val_d(\cl_i)$ in $\Cc_d$, for all $\cl_i\in\CTL$.
%
% A \gcounter{} is free from these save\slash restore operations but needs
% another special operation when it is incremented by \!\stepcounter!. That
% is, the invocation of \!\stepcounter! for a \gcounter{} $\cg_i$ may clear
% \lcounter{}s in its set of descendant counters
% $\Uidx\clist(\cg_i)=|\pcol@cl@|{\cdot}\cg_i$
%
% \SpecialArrayMainIndex{\theta}{\pcol@cl@}
%
% and this clearing must be performed on the all instances of
% $\cl_j\in\clist(\cg_i)$ saved in $\Cc_c$ for all $c\In0\C$. Therefore, on
% the \!\stepcounter!, we do the followings for all $c\In0\C$; temporarily
% restore all $\cl_k\in\CTL$ from $\Cc_c$; clear all $\cl_j\in\clist(\cg_i)$;
% and then save $\<\cl_k,\val_c(\cl_k)\>$ back to $\Cc_c$.
%
% The other item we maintain for a \lcounter{} $\cl$ is its {\em\Uidx\lrep}
% $\arg{rep}$ in a column $c$ defined by
% $\!\definethecounter!\<\cl\>\<c\>\arg{rep}$. The \lrep{} $\arg{rep}$ is
% kept in $|\pcol@thectr@|{\cdot}\cl{\cdot}c$ and is made \!\let!-equal to
% $|\the|{\cdot}\cl$ when the column $c$ is visted.
%
% \SpecialArrayMainIndex{\theta{\cdot}c}{\pcol@thectr@}
% \SpecialArrayIndex{\theta}{\the}
%
%
%
% \subsection{Page-Wise and Merged Footnotes}
% \label{sec:imp-ovv-scfnote}
% \changes{v1.2-2}{2013/05/11}
% {Add the subsection ``Single-Columned and Merged Footnotes''.}
% \changes{v1.3-6}{2013/09/17}
% {Change the title from ``Single-Columned and Merged Footnotes'' to
% ``Page-Wise and Merged Footnotes'' according to the new naming.}
%
% \Uidx{\Index{page-wise footnote}}{\em Page-wise footnote}
% typesetting is completely different from ordinary {\em\Mcfnote}
% typesetting.
%
% When a \colpage{} in the \tpage{} is built, \!\footins! keeps all footnotes
% \!\insert!ed by \!\footnote! or \!\footnotetext! in {\em any} columns in
% the page. Therefore, \!\footnote! and \!\footnotetext! in the \tpage{}
% act as usual to add the footnote to \!\footins!. Then if a \cswitch{}
% takes place to leave the column, \!\footins! is saved into $\pp^f(\ptop)$
% by \!\pcol@output@switch!, so that $\pp^f(\ptop)$ is \!\insert!ed to
% \!\footins! again by \!\pcol@restartcolumn! when it visits a column in
% $\ptop$, or by \!\pcol@startcolumn! when it finds a column proceeds to
% $\ptop$.
%
% Then, when a \colpage{} in the \tpage{} completes advancing $\ptop$,
% \!\footins! is kept in $\pp^f(\ptop{-}1)$ by \!\pcol@startpage!, rather
% than being combined with the \colpage{}. This saving into
% $\pp^f(\ptop{-}1)$ {\em fixes} the footnotes in $\ptop{-}1$ so that
% $\pp^f(\ptop{-}1)$ is combined with other materials in the page by
% \!\pcol@outputelt! or \!\pcol@makeflushedpage! through \!\pcol@putfootins!
% when the page is shipped out.
%
% Fixing $\pp^f(p)$ for $p<\ptop$ makes it impossible to add footnotes in a
% column in the page $p$ not only to $\pp^f(p)$ but also to \!\footins!
% for the page $p$ becaues we have at least one fixed \colpage{} $\s_c(p)$
% unable to shrink to have such additional footnotes in $p$\footnote{
%
% The \colpage{} $\s_c(p)$ could have some space at its bottom produced by,
% for example, \cs{newpage}, but exploitation of such space is extremely
% hard.}.
%
% Therefore, such a footnote addition is {\em deferred} and is thrown into
% $\pp^f(\ptop)$ through a list;
% $$
% \Uidx\df=\!\pcol@topfnotes!=
% (f_1,f_2,\ldots,f_n)=\!\vbox!|{|f_1\;f_2\;\cdots\;f_n|}|
% $$
% where $f_i$ is a \!\vbox! containing the deferred footnote preceded by
% \!\penalty!\!\interlinepenalty! to allow \TeX{} to break footnotes to place
% them in two (or more) pages. That is, \!\footnote! or \!\footnotetext! in
% $p<\ptop$ adds an element for the footnote to $\df$, then all the elements
%
% \footnote{More accurately, some trailing elements may be left in $\df$ if
% its total height is too large, as discussed in
% \secref{sec:imp-sout-scfnote}.}
%
% are \!\insert!ed to \!\footins! by \!\pcol@deferredfootins! invoked in
% \!\pcol@restartcolumn! when it visits a column in $\ptop$, or in
% \!\pcol@startcolumn! when it starts a \colpage{} in $\ptop$. The macro
% \!\pcol@output@end! also do the \!\insert!ion by itself with \Mgfnote{}
% typesetting to let deferred footnotes be a part of \postenv.
%
% The reference to $\pp^f(p)$ for $p<\ptop$ is also made in
% \!\pcol@restartcolumn! and \!\pcol@flushcolumn!. The former \!\insert!s
% $\pp^f(p)$ to \!\footins! so that the \colpage{} which the macro restarts
% is built as if it has the footnotes in $\pp^f(p)$ to make the \colpage{}
% broken leaving the space for the footnotes. However, \!\footins! is never
% grown because it has been fixed and thus additional footnotes will go
% to $\df$ as discussed above. Then \!\footins! is discarded by
% \!\pcol@makecol! when the \colpage{} completes, or by
% \!\pcol@output@switch! when it leaves the column.
%
% The reference to $\pp^f(p)$ by the latter macro \!\pcol@flushcolumn! is to
% build the ship-out image of the \colpage{} to be flushed. When this macro
% and other macros, namely \!\pcol@makecol! and \!\pcol@makeflushedpage!,
% build the ship-out image in a page $p$ having $\pp^f(p)$ using
% \!\@makecol!, we have to be careful of the fact that the \colpage{} has
% been build as if it has footnotes in $\pp^f(p)$ but the footnotes are not
% included in its ship-out image but that of the page. Therefore,
% \!\@colht! referred in \!\@makecol! should be shrunk by the sum of
% height and depth of $\pp^f(p)$ and $\!\skip!\cdot\pp^f(p)$ by
% \!\pcol@shrinkcolbyfn!. Other and more subtle adjustment is to add the
% stretch and shrink factors of $\!\skip!\cdot\pp^f(p)$ at the tail of the
% \colpage{} by \!\pcol@unvbox@cclv!. This is necessary because \TeX{} has
% broken the \colpage{} taking account of the stretch and, more essentially,
% shrink factors, and thus without the factors the main vertical list in the
% \colpage{} could be a little bit taller than \!\@colht! causing overfull.
%
% The feature gathering footnotes in all columns in a page brings a problem
% to \exsync{}, because a column whose contents fit the \tpage{} at the
% last visit may be too tall on the \sync{}ation because other columns have
% put some footnotes after the last visit. That is, we cannot simply build
% the \tpage{} combining $\s_c(\ptop)$ for all $c\In0\C$ and $\pp^f(\ptop)$
% because there could be $\s_c(\ptop)$ too tall to reside in $\ptop$ with
% $\pp^f(\ptop)$.
%
% To solve this problem, we perform the following operations prior to fix
% the contents of $\ptop$ having an \exsync{} point in it. First one is
% {\em\Uidx\cscan} to visit all columns by \cswitch{} prior to the
% \sync{}ation so that \TeX's page builder has opportunities to break too
% tall \colpage{}s. Since this scan could merely break footnotes rather
% than the main vertical lists in the \colpage{}s and the broken footnotes
% will be reconnected when the \!\output!-routine is invoked for the
% \sync{}ation, we then examine if all $\s_c(\ptop)$ are accommodated in
% $\ptop$ with $\pp^f(p)$.
%
% This examination for a \sync{}ation by \!\switchcolumn!|*| or its
% relatives is done as a part of the inherent \sync{}ing procedure to see if
% the combination of the tallest {\em top} items, i.e., top floats and the
% main vertical list, and the tallest {\em bottom} items, i.e., bottom
% floats and \Mcfnote{}s, is too large causing page flushing. As for page
% flushing and environment closing, this {\em\Uidx\pfcheck} requires a
% special kind of \sync{}ed \cswitch{} by which we flush pages up to
% $\ptop-1$ and examine if there is a too tall column.
%
% Then if too tall columns are found, in either cases, we move to the {\em
% tallest} column to force a page break in the column so that we have a new
% page with shorter columns and shorter \Scfnote{}s as well. In the
% \sync{}ation by \!\switchcolumn!|*| or its relatives, this forced page
% break is then applied to all other columns so that new \colpage{}s have
% top floats, if any, below which we should place the \sync{}ation point.
% This examination and forced page break is repeated until we have a page
% without any too tall columns, because a page break may bring deferred
% floats and footnotes which may result in a too tall column.
%
%
%
% \subsection{Text Coloring}
% \label{sec:imp-ovv-color}
% \changes{v1.2-1}{2013/05/11}
% {Add the subsection ``Coloring''.}
% \changes{v1.3-5}{2013/09/17}
% {Change the subsection title from ``Coloring'' to ``Text Coloring''
% to distinguish it from background painting clearly.}
%
% \subsubsection{Fundamental Mechanism}
% \label{sec:imp-ovv-color-fundamental}
% \changes{v1.34}{2018/05/07}
% {Revise the description of \Sec1.6.1 according to the new
% implementation with \cs{insert}.}
%
% Text coloring done by \textsf{color} package and its relatives using
% \!\special! stands on the fact that the main vertical list is {\em
% printed} in the order of occurrence in the source |.tex|. That is, a
% command such as \!\color!|{red}| puts
% \!\special!|{color push [1 0 0]}|\footnote{
%
% If \texttt{.dvi} is processed by \texttt{dvips}, or other
% printer-dependent command corresponding to it.}
%
% into |.dvi| to make all stuff in the main vertical list colored red until
% other coloring \!\special! inserted by other coloring macro appears in
% |.dvi|. This simple mechanism works well even when the pair of coloring
% \!\special!s are in different pages and/or columns because, with respect
% to the main vertical list, everything between them in |.tex| is also
% surrounded by the \!\special! pair in |.dvi|. As for other stuff such as
% header, footer, floats and footnotes, \LaTeX{} surrounds them by
% \!\color@begingroup! and \!\color@endgroup! or other similar constructs so
% that they are colored without interference with the coloring of the main
% vertical list.
%
% In \env{paracol} environment, however, the orders of the main vertical list
% in |.tex| and |.dvi| are not always same. When a column encounters a page
% break, in |.dvi| the other column should intervene between the stuff in
% the broken pair of \colpage{}s possibly changing the color of the second
% \colpage. A \cswitch{} from $c_1$ to $c_2$ also makes the main vertical
% list out-of-order to cause another unexpected coloring because a coloring
% command in $c_2$ will have no effect when $c_1$ is revisited after that
% following its pre-switching stuff in |.dvi| which was put before the
% coloring. Therefore, we have to make {\em\Uidx\colorctext{}s} in both
% |.tex| and |.dvi| coherent inserting appropriate \!\special!s into |.dvi|
% whenever an out-of-order {\em jump} occurs in |.dvi| by a page break or in
% |.tex| by a \cswitch{}.
%
% The \textsf{color} package and its relatives\footnote{
%
% And all other coloring mechanism compliant with \LaTeXe{}, hopefully and
% believingly.}
%
% assume that {\em printers} have a stack for coloring and thus a coloring
% \!\special! pushes the new color into the stack while it is popped by
% another \!\special! which will be inserted by \!\aftergroup! mechanism
% when a group surrounding the coloring \!\special! is closed. Therefore we
% have to keep track of the \colorctext{} with {\em\Uidx\colorstack}
% $$
% \Uidx\cst=
% (\Uidx\celt_1,\celt_1,\ldots,\celt_n)=
% \!\vbox!|{|\celt_1\;\celt_2\;\ldots\;\celt_n|}|
% $$
% where $\celt_i$ is a \!\vbox! of 1\,|sp| tall, 0 deep and 0 wide containing
% a coloring \!\special! which \!\set@color! puts into the main vertical
% list. That is, when \!\set@color! is invoked we push $\celt$ to the tail
% of $\cst$, while when the corresponding \!\reset@color! appears we pop it
% from $\cst$\@. Then when we encounter an out-of-order jump, at first we
% rewind the \colorstack{} in |.dvi| by putting \!\special!s which
% \!\reset@color! would put, and then reestablish the \colorstack{} by
% putting \!\special!s in $\celt_i$ as if \!\set@color! for it is invoked
% for all $\celt_i\in\cst$. Therefore from the viewpoint of a {\em
% printer}, it will see stack-rewinding at the end of each \colpage{} and
% the leaving points of \cswitch{}, while the beginning of each \colpage{}
% and the entry points of \cswitch{} should have the sequence of coloring
% \!\special!s to regain the \colorstack{} which the {\em printer} must have
% at each of the points.
%
% \SpecialArrayMainIndex{c}{\pcol@columncolor@box}
%
% In addition, for each column $c$ we keep
% $\Uidx\Celt^c=|\pcol@columncolor@box|\cdot c$ as the {\em default} color
% of the column $c$, optionally given by the API macro \!\columncolor! or
% \!\normalcolumncolor!. If given for $c$, it is assumed to be at the bottom
% of the \colorstack{} denoted by
% $\Uidx\CST^c=(\Celt^c,\celt_1,\ldots,\celt_n)$ which we rewind\slash
% reestablish at each out-of-order jump in the column $c$.
%
%
%
% \subsubsection{Coloring in Horizontal Mode}
% \label{sec:imp-ovv-color-hmode}
% \changes{v1.22}{2013/06/30}
% {Add the subsection ``Coloring in Horizontal Mode''.}
% \changes{v1.34}{2018/05/07}
% {Revise the description of \Sec1.6.2 according to the new
% implementation with \cs{insert}.}
%
% We have to pay attention to the fact a coloring command can appear in
% horizontal mode of course, and thus push/pop operations in a \colpage{}
% would be done {\em before} the \colpage{} starts when \!\set@color! or
% \!\reset@color! is in the second half of a page-crossing paragraph and if
% we immediately performed push\slash pop of the \colorstack{} in these
% macros. In addition, even in vertical mode these macros can appear before
% \TeX{} finds a page break after which they must be in effect, if they are
% preceded by a sequece of non-breakable vertical items by which \TeX{}'s
% examination of the page break is {\em delayed} as well as the invocation
% of \!\output! at the break.
%
% In order to solve the problem of push/pop timing, we perform push\slash
% pop operations through \!\insert! to our own register set
% \!\pcol@colorins!. That is, we \!\insert! $\celt$ to \!\pcol@colorins!
% when we encounter a \!\set@color! for $\celt$, while its corresponding
% \!\reset@color! also \!\insert!s another \!\vbox! $\Uidx\celtpop$ of
% null-height\slash depth\slash width having a \!\special! which the
% \!\reset@color! puts into the main vertical list. Since we let
% $\!\count!\!\pcol@colorins!=0$ and $\!\skip!\!\pcol@colorins!=0$ to keep
% the \!\insert!iion from affecting the growth of \!\pagetotal!, it is
% guaranteed that an inserted $\celt$ or $\celtpop$ is given to \!\output!
% through \!\pcol@colorins! together with |\box255| containing the
% corresponding \!\special!.
%
% When \!\output! is invoked, \!\pcol@colorins! has $\Uidx\cstraw$
% containing $\celt_i$ and possibly its corresponding $\celtpop_i$.
% Therefore, if \!\output! is for a page break or a \cswitch, we remove all
% pairs of $\celt_i$ and $\celtpop_i$ from \!\pcol@colorins! to let it have
% $\cst$ only with $\celt_j$ whose corresponding $\celt_j^-$ is not in
% $\cstraw$. For this removal, we scan $\cstraw$ from its tail
% incrementing\slash decrementing a counter $\Uidx\npop$ which we initialize
% to 0 before scanning. In the scan, we remove all $\celtpop$
% unconditionally incrementing $\npop$, and $\celt$ such that $\npop>0$ on
% the encounter with it decrementing $\npop$. This scan is done by
% \!\pcol@clearcolorstack!, invoked from \!\pcol@opcol! for a page break and
% \!\pcol@output@switch! for a \cswitch{} through \!\pcol@clearcst@unvbox!,
% and is for rewinding the \colorstack{}
% $(\Celt^c,\cstraw)=\Uidx\CSTraw^c$. Therefore, for each $\celt$ to be kept
% because of $\npop=0$ on the encoutner with it we put \!\special! for
% \!\reset@color!. Note that on another scan for stack reestablishment,
% \!\pcol@colorins! has $\cst$ and is kept unchanged. Also note that other
% \!\output! invocations such as that for floats do not touch $\cstraw$ to
% allow it grows with $\celt$ and $\celtpop$ corresponding to \!\set@color!
% and \!\reset@color! in the \colpage{} in which the invocation
% happens\footnote{
%
% Unlike \cs{footins} which becomes void by putting its contents back to the
% main vertical list to reexamine the footnote placement possibly with
% splitting.}.
%
% The mechanism above especially for horizontal mode has subtle issues as
% follows.
%
% \begin{itemize}
% \item
% If \!\set@color! appears in a \!\vbox!, the \!\insert!ion for pushing
% is not effective but corresponding \!\reset@color! can be outside of the
% \!\vbox! to make pushes and pops unbalanced because \!\aftergroup! for it
% inserts it just after the closing of the \!\vbox! if \!\set@color! is not
% surrounded by an inner group.
%
% \item
% If we are in vertical mode, we can know if we are in a \!\vbox! by
% \CSIndex{ifinner}. However, in horizontal or math mode, \CSIndex{ifinner}
% cannot help us because it is true iff we are in a \!\hbox! or in an
% in-text math. In short, \TeX{} does not provide us with any convenient
% means to know if we are in a \!\vbox!.
% \end{itemize}
%
% To solve the problem above, we introduced a trick with \!\everyvbox! to
% turn a switch $\CSIndex{ifpcol@inner}=\true$ at the beginning of every
% \!\vbox! in a \env{paracol} environment, by which we supress the
% \!\insert!ion for \!\set@color! because a \!\vbox! cannot cross a
% page boundary. As for that of \!\reset@color!, we suppress it by not
% reserving our own macro \!\pcol@reset@color@pop! for the \!\insert!ion by
% \!\aftergroup!. That is, we reserve both \!\reset@color! and
% \!\pcol@reset@color@pop! with \!\aftergroup! if we are outside of any
% \!\vbox!es, while does the former only otherwise. By the same reason, we
% supress the \!\insert!ion if we are in restricted horizontal mode, i.e.,
% if both \CSIndex{ifhmode} and \CSIndex{ifinner} are true. On the other
% hand, we cannot supress the \!\insert!ion when we are in an in-text math
% because it can cross a page boundary\footnote{
%
% If an in-text math is in a \cs{hbox}, \cs{insert}ion is not
% necessary because the math cannot cross a page boundary. Though we can
% detect it by a trick with \!\everyhbox!, we abandon this idea because the
% request is not harmful. Another and more serious issue of coloring in
% math mode will be discussed shortly.}.
%
% Note that the detailed implementation shown in \secref{sec:imp-startenv}
% does not interfere the use of \!\everyvbox! inside/outside of
% \env{paracol} environments or is not affected by the use.
%
% Another attention we should pay is that \!\color! will leave \!\aftergroup!
% tokens of \!\reset@color! and thus they are invoked just after
% \Endparacol. However, since we have completed all \colpage{}s in the
% \lpage, the \colorstack{} in |.dvi| should be empty. Therefore to avoid
% stack underflow, we should reestablish $\cst$ (not $\CST^c$) so that
% elements in the stack are popped by \!\reset@color! invoked with the
% \!\aftergroup! mechanism. We also take care of our own \colorstack{}
% popper \!\pcol@reset@color@pop! which must do nothing, i.e., must not make
% an \!\insert!ion, after we completed the \lpage, i.e., if
% \CSIndex{ifpcol@output} is $\false$.
%
%
%
% \subsubsection{Changing Default Column Color}
% \label{sec:imp-ovv-color-colcolor}
% \changes{v1.34}{2018/05/07}
% {Split the description of \cs{columncolor} from \Sec1.6.2 to have
% new \Sec1.6.3 ``Changing Default Column Color'' because we have
% serveral new issues in the new implementation with \cs{insert}.}
%
% The implemntation of \!\columncolor! and \!\normalcolumncolor! is
% relatively easy for the cases that they appear outside
% \env{paracol} environment or they define the default color of a
% column different from the current column. That is, for the default color
% of a column $c$ we simply \!\def!ine
% ${\Uidx\Celtshadow}^c=|pcol@columncolor|\cdot c$ to let it have what
% \!\current@color! has for the color. Then, in \beginparacol{} in the
% former case or immediately in the latter, we let
% $\Celt^c=|pcol@coloumncolor@box|\cdot c$ have the coloring \!\special! for
% the color acquiring an \!\insert! from \!\@freelist! if the box is
% $\bot$.
%
% \SpecialArrayMainIndex{c}{\pcol@columncolor}
% \SpecialArrayIndex{c}{\pcol@columncolor@box}
%
% On the other hand, when the API commands are to define the default color
% of the current column $c$, we need to place the coloring at the bottom of
% \colorstack{}s in terms of |.tex| and |.dvi|. That is, for the former we
% have to rewind and reestablish the stack which can be different from
% $\CST^c$ because the API command can follow a page break which \TeX{} does
% not yet find. Therefore, we maintain a {\em shadow} of $\cst$ namely;
% $$
% {\Uidx\cstshadow}={\Midx{\!\pcol@colorstack@shadow!}}
% =({\Uidx\celtshadow}_1,\celtshadow_2,\ldots,\celtshadow_n)
% =\!\@elt!\Arg{\celtshadow_1}\;\!\@elt!\Arg{\celtshadow_2}\;\cdots\;
% \!\@elt!\Arg{\celtshadow_n}
% $$
% to which our version of \!\set@color! pushes $\celtshadow_i$ being
% \!\current@color! which the original one defines, while popping is done
% automatically by \TeX's grouping mechanism because pushes are done by
% \!\edef! rather than \!\xdef!. Then before we \!\def!ine $\Celtshadow^c$
% we rewind
% ${\Uidx\CSTshadow}^c=(\Celtshadow^c,\celtshadow_1,\ldots,\celtshadow_n)$
% putting \!\special! for pop to the main vertical list for each elements,
% and then after the \!\def!initon of $\Celtshadow^c$ we reestablish
% $\CSTshadow^c$ putting coloring \!\special! for each element.
%
% As for placing $\Celt^c$ at the bottom of $\CST^c$, we must ensure that
% the placement is done for the \colpage{} in which the API command
% belongs to, as we did in ordinary push\slash pop of the \colorstack.
% Therefore the API command \!\insert!s $\Celt^c$ to $\cstraw$ in the form
% of a \!\vbox!, whose height and depth are 1\,|sp| and width is 0,
% containing the coloring \!\special! for $\Celt^c$. Then when $\cstraw$ is
% scanned for rewinding in \!\output!, this \!\vbox! is found to let
% $\Celt^c$ have the \!\special! acquiring an \!\insert! from \!\@freelist!
% it was $\bot$. Note that $\cstraw$ may have multiple \!\vbox!es to update
% $\Celt^c$ and if so the last one is effective.
%
%
%
% \subsubsection{Coloring in Math Mode}
% \label{sec:imp-ovv-color-mmode}
% \changes{v1.24}{2013/07/27}
% {Add the subsection ``Coloring in Math Mode''.}
% \changes{v1.34}{2018/05/07}
% {Revise the description of \Sec1.6.4 according to the new
% implementation with \cs{insert}.}
%
% Unfortunately the solution above is imperfect because \TeX{} builds an
% implicit \!\hbox! for a |{|\textit{math stuff}|}| construct in math mode
% and an \!\insert! in the construct does not contribute to
% the main vertical list at all\footnote{
%
% The contents is not thrown away but \cs{insert}ion itself is added
% to the list rather than given to \cs{output}.}.
%
% Since the implicit \!\hbox! does not care about \!\everyhbox!, we cannot
% use the trick similar to that with \!\everyvbox!. Another bad news is
% that built-in \cs{if}s for mode checking cannot help us because we always
% have $\CSIndex{ifvmode}=\CSIndex{ifhmode}=\false$ and
% $\CSIndex{ifmmode}=\true$ while $\CSIndex{ifinner}$ is $\true$ or $\false$
% when we are in in-text or displayed math mode respectively. Therefore, we
% have to take care of the potential loss of \!\insert!ion for pushes and
% thus unmatched pops in $\cstraw$.
%
% For example, we have to remember that, in the cases like
% |${|\!\color!$\Arg{c}\textit{text}$|}$| or
% |$|\!\textcolor!$\~\Arg{c}\ARg{text}$|$| expanded to the former, the
% \!\insert!ion for push is lost while its counterpart for pop survives
% making it necessary to check the existance of pushing counterpart for each
% pop in $\cstraw$\footnote{
%
% Since a pop is always in a group one level outer from its push
% counterpart, the pop request should be presented if the push does.}.
%
% Note that the fact that the pop in the examples is in the in-text math
% does not help us, because the pop in
% |$|\!\begingroup!\!\color!\Arg{c}\textit{text}\!\endgroup!|$| is also in
% the in-text math while its pushing counterpart performs an effective
% \!\insert!ion, and two \!\insert!ions must be presented in $\cstraw$
% because we can have a page-break in \textit{text}. Therefore, we have to
% find a means to examine whether a pop $\celtpop_i$ has its counterpart
% $\celt_i$ in $\cstraw$ to remove $\celt_i$ from $\cstraw$ if exists or to
% igonore $\celtpop_i$ otherwise. That is, we have to attach an identifier
% $m$ to $\celt_i$ and $\celtpop_i$, i.e., to make them $\Uidx\mcelt_{i,m}$
% and $\Uidx\mceltpop_{i,m}$.
%
% Since the only means we have for the communication with \!\output! routine
% is what we \!\insert! to $\cstraw$, the \!\insert!ed \!\vbox! must carry an
% identifier $m$ for a push\slash pop in math mode. To do that, we make
% \!\vbox! $m$\,|sp| wide ($m>0$) if our version of \!\set@color! is in math
% mode to represent $\mcelt_{i,m}$ and $\mceltpop_{i,m}$, while the width is
% 0 otherwise as described in \secref{sec:imp-ovv-color-hmode}. Then in the
% scan of $\cstraw$ for rewinding in \!\output!, we supress
% incrementing\slash decrementing $\npop$ for $\mcelt_{i,m}$ and
% $\mceltpop_{i,m}$, but remove $\mcelt_{i,m}$ if $\mceltpop_{i,m}$ is in
% $\cstraw$ as a successor while we keep it in $\cstraw$ otherwise putting a
% \!\special! of pop for it to the main vertical list.
%
% To ensure that $\mcelt_{i,m}$ has its counterpart $\mceltpop_{i,m}$ in
% $\cstraw$ iff the push and pop are in a \colpage, we maintain the counter
% \!\pcol@mcid! incremented before (the attempt of) the \!\insert!ion of
% $\mcelt_{i,m}$ with $m=\!\pcol@mcid!$ and the \!\aftergroup! reservaion
% for that of $\mceltpop_{i,m}$. Then the counter is zero-cleared by
% \!\output! routine in order to keep it less than
% $\!\pcol@mcpushlimit!=1000$ unless, roughly speaking, a \colpage{} has a
% unexpectedly large number of math constructs having coloring commands in
% them. Note that this zero-clearing does not ensure that an identifier $m$
% is unique in $\cstraw$. That is, it can happen that $\cstraw$ has
% $\mcelt_{i,m}$, $\mceltpop_{i,m}$, $\mcelt_{j,m}$ and/or $\mceltpop_{j,m}$
% in this order for $i<j$, when two math constructs with coloring for $i$
% and $j$ are in different paragraphs and \!\output! is invoked at or after
% the end of the paragraph with the math for $i$. This potential
% duplication is, however, unharmful because of the following.
%
% \begin{itemize}
% \item
% Since a math construct cannot have immediate \!\output! invocations in it,
% the order of the elements in $\cstraw$ must be $\mcelt_{i,m}$,
% $\mceltpop_{i,m}$, $\mcelt_{j,m}$ and $\mceltpop_{j,m}$ from its bottom to
% top, though some of them could be missing. Therefore, if
% $\mceltpop_{i,m}$ is in $\cstraw$, $\mcelt_{j,m}$ must follow it if
% exsits not causing accidental matching with $\mceltpop_{i,m}$.
%
% \item
% If $\mcelt_{i,m}$ is in $\cstraw$ but $\mceltpop_{i,m}$ is not, it means
% we have a page break between vertical items corresponding to
% $\mcelt_{i,m}$ and $\mceltpop_{i,m}$ to keep the \!\insert!ion of
% $\mceltpop_{i,m}$ and anything following it from appended into $\cstraw$.
% Therefore, $\cstraw$ cannot have $\mceltpop_{j,m}$ not causing accidental
% matching with $\mcelt_{i,m}$.
% \end{itemize}
%
%
%
% \subsubsection{Emptiness of a Column-Page}
% \label{sec:imp-ovv-color-emptycol}
%
% The mechanism above works well with respect to coloring, but it has a
% problem that a \colpage{} created by, for example, a forced page break may
% not be perfectly empty but can have some coloring \!\special!s for
% \colorstack{} reestablishing and rewinding. They are of course invisible
% but affect the examination of \colpage{} emptiness for \exsync. That is,
% we examine if a \colpage{} does not have anything by a tricky way by
% \!\pcol@ifempty! but the existence of coloring \!\special!s makes the
% examination failed even if no other ordinary stuff such as boxes and skips
% are in the \colpage.
%
% Therefore we need to put coloring \!\special!s for \colorstack{}
% establishing and rewinding a little bit more carefully to avoid empty
% \colpage{}s just having such \!\special!s as follows. When we start a new
% \colpage{}, we don't put \!\special!s for establishing immediately but
% save the \colorstack{} $\CST^c$ into
% $\Uidx\csts=\!\pcol@colorstack@saved!$. Then when we leave the
% \colpage{} by switching or page breaking, we examine the emptiness of the
% \colpage{} and if so we do nothing, while otherwise we put the
% \!\special!s for reestablishing $\csts$ at the top of the \colpage{} and
% those for rewinding $\cstraw$ at the bottom. Similary, when we revisit a
% \colpage, we examine its emptiness and if so we save $\CST^c$ into
% $\csts$, while otherwise we put \!\special!s for reestablishing $\CST^c$
% and nullify $\csts$ so that nothing will be put at the top of the
% \colpage{} when we leave it. By these mechanisms, an empty \colpage{}
% should not have coloring \!\special!s, while non-empty ones should have a
% sequence of triples; reestablishing \!\special!s; ordinary main vertical
% list items including coloring \!\special!s inserted by \!\color! etc.; and
% then rewinding \!\special!s.
%
%
%
% \subsection
% [Parallel-Paging, Column-Swapping, Column-Separating Rule
% Drawing and Background Painting]
% {Parallel-Paging, Column-Swapping, Column-Separating\\Rule
% Drawing and Background Painting}
% \label{sec:imp-ovv-cswap}
% \changes{v1.2-4}{2013/05/11}
% {Add the subsection ``Column-Swapping''}
% \changes{v1.3-1}{2013/09/17}
% {Change the section title from ``Column-Swapping'' to
% ``Parallel-Paging, Column-Swapping, Column-Separating Rule Drawing
% and Background Painting'' to discuss related issues together''.}
% \changes{v1.3-2}{2013/09/17}
% {Add overview description of parallel-paging.}
% \changes{v1.3-3}{2013/09/17}
% {Add overview description of column-separating rule drawing and
% background painting.}
%
% We have the following four extensions, which are correlated to each other,
% from the basic parallel-columning.
%
% \paragraph{\em Parallel-paging}\UsageIndex{parallel-paging}\hskip-.5em
% to extend the concept of parallel-columning in a page to a pair of
% adjacent pages. A {\em left} \parapag{}e starts from column-0, has
% $\Uidx\CL$ columns where $\CL$ is given by the first optional argument of
% \beginparacol, while a {\em right} \parapag{}e starts from column-$\CL$
% and has $\C-\CL$ columns. Since we let $\CL=\C$ when \parapag{}ing is not
% in effect, we may ship out columns $c\In0\CL$ always and then, if
% $\CL<\C$, ship out columns $c\In\CL\C$ as a right \parapag{}e.
%
% The pair of \parapag{}es can be {\em\Uidx\paired} to comprise a virtual
% page $p$ and thus has common page number $\page(p)$, while
% {\em\Uidx\npaired} \parapag{}ing produces two individual pages from a
% internal page $p$ (i.e., set of all columns $\Set{c}{c\In0\C}$) whose
% left and right components have page numbers $\page(p)$ and $\page(p)+1$
% respectively. Since a page $p$ is internally considered as the set of all
% columns $c\In0\C$ always, regardless of \paired{} or \npaired{}
% \parapag{}ing, the difference between them arises only in two-sided
% ship-out process in which the header, footer and left-margin are common
% for left\slash right \paired{} \parapag{}s while they have to depend on
% the parity of the number of each \npaired{} \parapag{}e. Note that
% \textsf{paracol} does not specify the parity of a left \npaired{}
% \parapag{}e number, but the number is decided by the page from which a
% \parapag{}ed \env{paracol} environment starts.
%
% In ship-out process, we build the ship-out image of a right \parapag{}e in
% our own \!\box! register \!\pcol@rightpage! instead of the usual
% \!\@outputbox!. The register, however, must {\em survive} after
% \Endparacol{} to keep the columns in the last right \parapag{}e,
%
% \Index{last page}
%
% so that it is shipped out when the whole of last page including \postenv{}
% is shipped out, or, more complicatedly, to be passed to the next
% \env{paracol} environment as a part of its \preenv.
%
% {\em Page-wise stuff}
% \UsageIndex{page-wise stuff}
% spanning all columns, i.e., \spanning{} being \preenv{} or \pwise{}
% floats, \mctext{}s, \scfnote{} footnotes and \postenv{} are always placed
% in a left \parapag{}e, while the corresponding regions for them in a right
% \parapag{}e are always blank\footnote{
%
% So far. In some future, we could implement a special setting to let
% \preenv{}, \postenv{} and \scfnote{} footnotes are split into both
% \parapag{}es, and to make it possible that a \pwise{} float or a
% \mctext{} has its counterpart placed in the corresponding right
% \parapag{}e.}
%
% unless \preenv{} has the \lpage{} of the previous \env{paracol}
% environment.
%
% \paragraph{\em Column-swapping}\UsageIndex{column-swapping}\hskip-.5em
% to reverse the order of columns in even numbered pages from left-to-right
% to right-to-left. It is enabled by the specifier `|c|' of
% \!\twosided!\footnote{
%
% Or the backward compatible macro \!\swapcolumninevenpages!.}.
%
% Though it is fundamentally simple because we just need to reverse the
% scanning order of columns from left-to-right (i.e., 0 to $\C-1$) to
% right-to-left (i.e., $\C-1$ to 0) in the ship-out process of an even
% numbered page, there are a few complications in the implementation of
% related functionalities.
%
% First, a \paired{} \parapag{}e should also be swapped so that a
% \emph{physical} left (resp.\ right) \parapag{}e has columns $\C-1$ to
% $\CL$ (resp.\ $\CL-1$ to 0) in this order. Note that this \parapag{}e
% swapping also swaps the page in which \pwstuff{} are placed. That is, if
% both \paired{} \parapag{}ing and \cswap{} are in effect, \pwstuff{} are
% placed in the physical right \parapag{}e, or in other words they always
% placed in the page in which column-0 resides. Note that since \cswap{}
% with \npaired{} \parapag{}ing is meaningless and thus \cswap{} is
% disabled.
%
% Second, the side margin to which a marginal note goes can be swapped but
% enabling this swap is independent of \cswap{} and done by the specifier
% `|m|' of \!\twosided!, though almost all users will specify both swapping
% consistently. Since the side margin for a marginal note is decided in
% \!\output! routine by \!\pcol@addmarginpar! being our own version of
% \LaTeX's macro for maginal notes \!\@addmarginpar!, the page in which the
% margial note resides has been fixed. However, the number of the page and
% thus its parity may not have been fixed yet due to the possible jump in
% column-0 taking place afterward, unlike \cswap{} for which the page number
% has been fixed because it is performed in ship-out process. Since it is
% too costly to avoid this possibly wrong placement, we have to accept the
% possibility as \LaTeX{} itself does. Also unlike \cswap, the swapping of
% marginal notes is not disabled in \npaired{} \parapag{}ing because it is
% meaningful.
%
% Another remark for marginal notes is that two ore more columns may {\em
% share} a margin, inevitably if a (parallel) page has three or more columns
% or intentionally with a setting of \!\marginparthreshold!. Therefore, the
% context of marginal notes cannot be in \cctext{} but should be in \pctext,
% or cannot simply give the bottom of the last marginal note (i.e., \LaTeX's
% \!\@mparbottom!) but should show all marginal notes in margins in a
% page\footnote{
%
% Before version 1.3, we have \!\@mparbottom! in \cctext{} because a column
% has its own area for marginal notes, which can be the gap between columns
% rather than a margin of a page.}.
%
% Therefore, each \pctext{} has all marginal notes in the form of lists of
% their top and bottom positions in all margins as $\pp^m(p)$, so that we
% find a space for a marginal note in a column to add it to not only to the
% bottom but also into a space between two marginal notes having already
% been put by other columns.
%
% Third and finally, we have to take care the placement of \mctext{}s. In
% version 1.2 to which \cswap{} is introduced, we let a \mctext{} belong to
% column-$(\C-1)$ instead usual column-0 so that its left edge is aligned to
% the left edge of the leftmost column, i.e., that of the text area.
% However this simple solution has a severe problem that, if a \mctext{} is
% broken into two pages, its second half should be put in the rightmost
% column. In addition, even when a \mctext{} does not have page break in
% it, such wrong placement may happen if the text is followed by \!\nobreak!
% and thus a page break is made above the text but {\em after} the text is
% processed.
%
% In version 1.3, this problem is solved by capturing the first half of a
% \mctext{} in \!\output! routine for the page break in the text, and the
% second half or the whole of it in that for \sync{}ed \cswitch{} to close
% the text. Since an invocation of \!\output! routine means that it has been
% fixed which page the \mctext{} or its part resides in, we can place the
% text much more reliably expecting the parity of the page number has also
% been fixed. In addition, this decision making in \!\output! routine allows
% (or forces) us to let \mctext{}s always belong to column-0 preserving the
% consistency of, for example, local counter values referred to in them,
% while we need to shift a text to the left edge of the text area if it
% resides in an even numbered page. Furhtermore, this \mctext{} capturing
% enables to measure the vertical size of the captured text together with the
% vertical position of its top edge to record them in the list $\pp^s(p)$,
% so that we draw \cseprule{}s skipping the text and painting its \bground{}
% with a specific color different from colors of columns and \csepgap{}s, as
% discussed shortly.
%
% \paragraph{\em Column-separating rule drawing}
% \UsageIndex{column-separating rule}\hskip-.5em
% to draw a vertical rule in {\em\Uidx\csepgap} is correlated with a part of
% {\em\bgpaint} to paint each region in a page with a color specific to the
% region. Thanks to the list of \mctext{}s $\pp^s(p)=(\spt(H_i,h_i))_i^n$, we
% can draw \cseprule{}s skipping \mctext{}s in the page $p$ as the sequence
% of;
%
% \begingroup
% \def\RULE{\mathit{rule}}\def\GAP{\mathit{gap}}
% \begin{eqnarray*}
% &&\RULE(H'_1),\GAP(h_1),\ldots,\RULE(H'_n),\GAP(H'_n),\RULE(H'_{n+1})\\
% &&H'_i=H_i-(H_{i-1}+h_{i-1})
% \qquad H_0=h_0=0
% \qquad H_{n+1}=\pp^h(p)
% \end{eqnarray*}
% \endgroup
%
% where $\mathit{rule}(H')$ is a vertical rule of $H'$ high and
% $\mathit{gap}(h)$ is a vertical space of $h$. A rule may be colored with
% the color specified by \!\colseprulecolor! for each \csepgap{} or all
% of them. Note that if \cswap{} is in effect, a column $c$ is {\em
% preceded} by $c$-th \csepgap{} which may have its own width and color for
% its rule, rather than being followed by it.
%
% \paragraph{\em Background painting}\UsageIndex{background painting}\hskip-.5em
% also uses the list $\pp^s(p)$ to paint the \bground{} of each column-$c$
% with the color $\Uidx\bgc_c^c$, each \csepgap{} following the column-$c$
% with $\bgc_g^c$, and \mctext{}s with $\bgc_s$ and $\bgc_S$, where
% $\bgc_a^{[c]}$ is specified by the second argument of
% $\!\backgroundcolor!\Arg{\hbox{\ttfamily\itshape a}|[|c|]|}\~\Arg{color}$
% ($\hbox{\ttfamily\itshape a}\in\{|c|,|g|,|s|,|S|\}$) and kept in the macro
% $|\pcol@bg@color@|{\cdot}a[|@|{\cdot}c]$.
%
% \SpecialArrayMainIndex{a}{\pcol@bg@color@}
% \SpecialArrayMainIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
%
% The region to be painted for each item is as follows where
% $[(x_0,y_0)(x_1,y_1)]$ means the region
% $\Set{(x,y)}{x\In{x_0}{x_1},\;y\In{y_0}{y_1}}$ of the top-down
% $xy$-coordinate whose origin is at the left-top corner of the leftmost
% column.
%
% \begingroup\def\sS{{\{s,S\}}}
% \begin{eqnarray*}
% \Uidx\bgr_c^c(i)&=&[(\Uidx\W_c,\;H_{i-1}+h_{i-1})\;
% (\W_c+w_c,\;H_i+d_{c/g})]\\
% \bgr_g^c(i)&=&[(\W_c+w_c,\;H_{i-1}+h_{i-1})\;(\W_{c+1},\;H_i+d_{c/g})]\\
% \bgr_\sS(i)&=&[(0,\;H_i)\;(\Uidx\WT,\;H_i+h_i+d_s)]\\
% \W_{c}&=&\sum_{d=c_0}^{c-1}(w_c+g_c)\qquad
% c_0=\cases{0&$c<\CL$\cr
% \CL&$c\geq\CL$}\qquad
% \WT=\!\textwidth!\\
% d_{c/g}&=&\cases{\!\maxdepth!&$i=n+1\;\land\;H'_{n+1}>0\;\land\;$non-\lpage\cr
% 0&otherwise}\\[1ex]
% d_s&=&\cases{H_{n+1}-(H_n+h_n)+\!\maxdepth!&
% $i=n\;\land\;H'_{n+1}=0\;\land\;$non-\lpage\cr
% 0&otherwise}
% \end{eqnarray*}
% \endgroup
%
% In the specifications above, $\w_c$ and $\Uidx\gap_c$ is the width of the
% column $c$ and that of the \csepgap{} following it, defined by
% \!\columnratio! or \!\setcolumnwidth! and stored in
% $|\pcol@columnwidth|{\cdot}c$ and $|\pcol@columnsep|{\cdot}c$
% respectively.
%
% \SpecialArrayIndex{c}{\pcol@columnwidth}
% \SpecialArrayMainIndex{c}{\pcol@columnsep}
%
% The additions of $d_{c/g}$ and $d_s$ are to extend the bottom edge of each
% region down to the bottom of text area. In addition, for each
% $\bgr_a^{[c]}=[(x_0,y_0)(x_1,y_1)]$, {\em\Uidx\bgext}s
% $\Uidx{\bge}_a^{[c]}(\{x,y\}^\pm)$ can be specified to shift the base
% points $x_0$, $y_0$, $x_1$ and $y_1$ left ($x^-$), right ($x^+$), upward
% ($y^-$) and downward ($y^+$) respectively. That is, a region is defined
% as;
% $$
% \bgr_a^{[c]}=[(x_0-\bge_a^{[c]}(x^-),\;y_0-\bge_a^{[c]}(y^-))\;
% (x_1+\bge_a^{[c]}(x^+),\;y_1+\bge_a^{[c]}(y^+))]
% $$
% \begingroup\par\hfuzz0.9pt\noindent
% with the optional shifts specified by the first argument of
% \!\backgroundcolor! as
% \Arg{\hbox{\ttfamily\itshape{a}}\oarg{c}$|(|x^\pm|,|y^\pm|)|$} (for both
% $x^-$/$y^-$ and $x^+$/$y^+$) or \Arg{\hbox{\ttfamily\itshape
% a}\oarg{c}$|(|x^-|,|y^-|)||(|x^+|,|y^+|)|$} and kept in macros
% $|\pcol@bg@ext@|{\cdot}\~d{\cdot}|@|{\cdot}a[{\cdot}|@|{\cdot}c]$
%
% \SpecialArrayIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
% \SpecialArrayIndex
% {d{\cdot}\string\texttt{@}{\cdot}a{\cdot}\string\texttt{@}{\cdot}c}
% {\pcol@bg@ext@}
%
% where $d\in\{|l|,|r|,|t|,|b|\}$ for $x^-$ (|l|), $x^+$ (|r|), $y^-$ (|t|)
% and $y^+$ (|b|). Note that $\bge_a^{[c]}(\{x,y\}^\pm)$ can be extremely
% large, namely greater than or equal to 9000pt, to mean the region is
% extended to a border near by the corresponding paper edge. More
% specifically, by this {\em\Uidx\bginfext}, each $xy$ coordinate in
% $[(x_0,y_0)(x_1,y_1)]$ is defined as follows to represent a coordinate
% being $10000\PT-\bge_a^{[c]}(\{x,y\}^\pm)+\!\pagerim!$ inside from the page
% edge;
% \par\endgroup
%
% \begingroup \def\feven{f_{\mathit{even}}}
% \begin{eqnarray*}
% x_0&=&-\WM+(10000\PT-\bge_a^{[c]}(x^-)+\WR)\\
% y_0&=&-(\HS+\HM)+(10000\PT-\bge_a^{[c]}(y^-)+\HR)\\
% x_1&=&(\WP-\WM)-(10000\PT-\bge_a^{[c]}(x^+)+\WR)\\
% y_1&=&(\HP-\HS-\HM)-(10000\PT-\bge_a^{[c]}(y^+)+\HR)\\
% \Uidx\WP&=&\!\paperwidth!\\
% \Uidx\WM&=&1|in|+\cases{\!\oddsidemargin!&$\lnot\feven$\cr
% \!\evensidemargin!&$\feven$}\\
% \Uidx\WR&=&\Uidx\HR=\!\pagerim!\\
% \Uidx\HP&=&\!\paperheight!\\
% \Uidx\HM&=&\!\headsep!+\!\headheight!+\!\topmargin!+1|in|\\
% \Uidx\HS&=&\mathit{height}(\pp^b(p))+\mathit{depth}(\pp^b(p))
% \end{eqnarray*}
% \endgroup
%
% where $f_{\mathit{even}}$ is $\true$ iff we are in an even numbered page
% and two-sided typesetting is specified by the optional argument of
% \!\documentclass! or by the specifier `|p|' of \!\twosided! explicitly or
% implicitly.
%
% Another remark is that \cswap{} affects $\bgr_c^c(i)$ and $\bgr_s^c(i)$ to
% {\em\Uidx\mirror} the region making a reflection-symmetric transformation
% on it using a vertical edge of a page as the axis. That is,
% $[(x_0,y_0)(x_1,y_1)]$ for a region is transformed to
% $[(\WT-x_1,y_0)(\WT-x_0,y_1)]$ if $x_{\{0,1\}}$ is not extended infinitely.
% With \bginfext{} on the other hand, before this transformation $x_0$ and/or
% $x_1$ are calculated by the rule above replacing $\WM$ with
% $\WP-(\WM+\WT)$ to represent the width of the right margin rather than the
% left.
%
% On the other hand, the \mirror{}ing of $\bgr_{\{s,S\}}$ is enabled by the
% specifier `|b|' of \!\twosided!, together with other regions being top
% margin ($t,T$), bottom margin ($b,B$), left margin ($l,L$), right margin
% ($r,R$), \pwise{} floats ($f,F$) and \scfnote{} footnotes ($n,N$). The
% geometical specifications $\bgr_a$ for those regions are given as follows,
% but the coordinate origin is at the top-left corner of text area (rather
% than the leftmost column).
%
% \begin{eqnarray*}
% \bgr_{\{t,T\}}&=&[(-\WM+\WR,\;-\HM+\HR),\;(\WP-\WM-\WR,\;0)]\\
% \bgr_{\{b,B\}}&=&[(-\WM+\WR,\;\HT-\HM),\;(\WP-\WM-\WR,\;\HP-\HM-\HR)]\\
% \bgr_{\{l,L\}}&=&[(-\WM+\WR,\;0),\;(0,\HT)]\\
% \bgr_{\{r,R\}}&=&[(\WT,\;0),\;(\WP-\WM-\WR,\;\HT)]\\
% \bgr_{\{f,F\}}&=&[(0.\;0),\;(\WT,\;\HS)]\\
% \bgr_{\{n,N\}}&=&[(0,\;\HT-\HN)\;(\WT,\;\HT)]\\
% \Uidx\HT&=&\!\textheight!+\!\maxdepth!\\
% \Uidx\HN&=&\!\skip!\!\footins!+\!\ht!\!\footins!+\!\dp!\!\footins!
% \end{eqnarray*}
%
% Note that, since we use text area coordinates, in the calculation of
% \bginfext{} $\HS$ is let be 0.
%
% We have other regions for columns and \csepgap{}s, namely $\bgr_C^c$ and
% $\bgr_G^c$, which vertically span all over text area regardless exsistance
% of any \pwstuff. Therefore, their geometical specifications are as
% follows with text area coordinates.
%
% \begin{eqnarray*}
% \bgr_C^c&=&[(\W_{c-1},\;0),\:(\W_{c-1}+w_c,\;\HT)]\\
% \bgr_G^c&=&[(\W_{c-1}+w_c,\:0),\;(\W_c,\;\HT)]
% \end{eqnarray*}
%
% In addition, we have to paint \preenv{} and \postenv{} with color
% $\bgc_{\{p,P\}}$. The region $\bgr_{\{p,P\}}$ for them is defined as
% follows with text area coordinates where $\Uidx\HB$ is the $y$-coordinate
% of the bottom of previous \env{paracol} environment if any, or 0
% otherwise.
% $$
% \bgr_{\{p,P\}}=\cases{
% [(0,\;\HB)\;(\WT,\;\HS)]& \preenv\cr
% [(0,\;\HB)\;(\WT,\;\HT)]& \postenv}
% $$
% Note that paiting of \postenv{} is done {\em outside} \env{paracol}
% environment when the \postenv{} encounters a page break, unless another
% \env{paracol} environment starts in the page and thus the \postenv{}
% becomes \preenv{} of the second (or subsequent) environment.
%
% Finally, we define the order of \bgpaint{} as follows, where $a$, $a(i)$,
% $a^c$ and $a^c(i)$ mean $\bgr_a$, $\bgr_a(i)$, $\bgr_a^c$ and
% $\bgr_a^c(i)$ respectively, so that a succeding region is {\em overlaid}
% on preceding regions.
%
% \begin{eqnarray*}
% T&\to&B\to L\to R\\
% &\to&G^0\to\cdots\to G^{\C-2}\to C^0\to\cdots\to C^{\C-1}\\
% &\to&t\to b\to l\to r\to N\to n\to\{F,P\}\to\{f,p\}\footnotemark\\
% &\to&S(1)\to\cdots\to\S(n)\\
% &\to&g^0(1)\to\cdots\to g^{\C-2}(1)\to c^0(1)\to\cdots\to c^{\C-1}(1)\to
% s(1)\\
% &\to&\cdots\\
% &\to&g^0(n)\to\cdots\to g^{\C-2}(n)\to c^0(n)\to\cdots\to c^{\C-1}(n)\to
% s(n)\\
% &\to&g^0(n{+}1)\to\cdots\to g^{\C-2}(n{+}1)
% \to c^0(n{+}1)\to\cdots\to c^{\C-1}(n{+}1)
% \end{eqnarray*}
%
% \footnotetext{In column flushing, the order is $\{F,P\}\to\{f,p\}\to N\to
% n$ but this reversion should have no effect (almost always).}
%
%
%
% \subsection{Page-wise Float Placement}
% \label{sec:imp-ovv-float}
% \changes{v1.32-3}{2015/10/10}
% {Add the section ``Page-wise Float Placement'' to discuss the
% page-wise float problem.}
%
% In the release on 2015/01/10, \LaTeX{}'s float placement mechanism was
% drastically changed to avoid {\em out-of-order\/} appearance of \pwise{}
% floats as follows. Since the cause of overtaking of a \pwise{} float by a
% \cwise{} float is that they are in two separated lists \!\@dbldeferlist!
% for the former and \!\@deferlist! for the latter, in the new implemenation
% the two lists are merged to let all floats go to \!\@deferlist!. To
% distinguish \pwise{} and \cwise{} floats in the list, \!\end@dblfloat!
% lets the \pwise{} float processed by the macro have a special depth of
% |1sp|, while depth of \cwise{} floats are 0 since \!\@endfloatbox! add a
% \!\vskip! of 0 at the end of the box of floats.
%
% Then all float placement macros invoked in \!\output!-routine examine the
% depth of floats in the list they are working on against a newly introduced
% macro \!\f@depth! by also newly introduced \!\@testwrongwidth!, so that
% they process only floats of a page/column category specified by
% \!\f@depth!, while those not matching to \!\f@depth! are let go to
% \!\@deferlist! to inhibit succeeding floats of the same type from
% overtaking them. The \!\def!inition of \!\f@depth! is done only by
% modified \!\@dblfloatplacement!, always invoked in a group, to let it have
% |1sp| so that float placement macros usually work on \cwise{} ones with
% the default setting of $\!\f@depth!=\!\z@!$ except for special occasions
% in which the placement of \pwise{} floats is tried.
%
% Though the mechanism should work well with {\em ordinary\/} multi-columned
% documents, it is incompatible with \Paracol{} almost inherently. That is,
% in the first place we have to separate float-related lists into the sets
% of them corresponding to columns as we do\footnote{
%
% If counters \counter{figure} and \counter{table} are global and we have to
% avoid inter-column overtaking with respect to, for example, the partial
% ordering rooted by the top-left corner, merging \cwise{} lists together
% with the merge of \cs{@deferlist} and \cs{@dbldeferlist} might be a
% solution to let the depth of a \cwise{} float be $c\,\texttt{sp}$ while
% that of \pwise{} is $\C$\,\texttt{sp}. However such implementation is not
% only tough but also doubtful to be worthwhile.}.
%
% Therefore, it is obviously nonsense to merge the list for \pwise{} floats,
% i.e., \!\@dbldeferlist!, to \!\@deferlist! of a particular column, and
% thus we have to stick with the conventional implementation to process
% \pwise{} and \cwise{} floats separately as follows.
%
% \begin{enumerate}\def\labelenumi{(\arabic{enumi})}
% \item
% \label{item:ovv-float-end@dblfloat}
% We \!\def!ine our own \!\end@dblfloat! namely \!\pcol@end@dblfloat!
% whose definition is exactly same as the old version of \!\end@dblfloat!,
% and replace the new version with it by \!\let!ting them equivalent in
% \!\pcol@zparacol! by which start \env{paracol} environments. Therefore,
% \pwise{} floats composed in a \env{paracol} environment is processed in
% the traditional way, i.e., being inclueded in \!\@dbldeferlist! rather than
% \!\@deferlist! and having ordinary depth 0.
%
% \item
% \label{item:ovv-float-@dblfloatplacement}
% Each invocation of \!\@dblfloatplacement! in our own \!\output!-routine is
% followed by a \!\let! to nullify the setting of $\!\f@depth!=|1sp|$ done
% by \!\@dblfloatplacement! by doing \!\f@depth!=\!\z@!. By this setting,
% \!\@tryfcolumn! in \!\pcol@startpage! and \!\@makefcolumn! in
% \!\pcol@output@clear! work on their argument \!\@dbldeferlist! in the way
% exactly same as in 2014 or before.
%
% \item
% \label{item:ovv-float-@addtodblcol}
% Among \LaTeX's macros in its \!\output!-routine which we use in our own
% one as well, only \!\@addtodblcol! changed its target from
% \!\@dbldeferlist! to \!\@deferlist!. That is, if the macro fails to put a
% \pwise{} float to the page we just have started by \!\pcol@startpage!,
% the float is added to \!\@deferlist! rather than \!\@dbldeferlist!.
% Therefore, when we apply \!\@sdblcolelt! to the copy of \!\@dbldeferlist!
% to invoke \!\@addtodblcol! for each of its element float, we have to save
% \!\@deferlist! somewhere, to \!\reserved@c! in reality, and clear it prior
% to the application. Then after all elements are processed, we have to let
% \!\@dbldeferlist! have what \!\@deferlist! have, while \!\@deferlist!
% should regain its origial contents from the saved place. A subtle issue
% is that we might work with \LaTeX{} of 2014 or older in which the floats
% are returned to \!\@dbldeferlist!. Therefore to make \Paracol{}
% compatible with both of new and old versions, we have to {\em add}
% \!\@deferlist! to \!\@dbldeferlist! rather than replacing
% \!\@dbldeferlist! with \!\@deferlist!. This addition should work well,
% because we clear both lists before the application of \!\@sdblcolelt! and
% then one of them will have the still-deferred floats after the application
% while the other remains empty.
%
% \item
% \label{item:ovv-float-@output@start}
% We convert \!\@deferlist! to \!\@dbldeferlist! in \!\pcol@output@start! to
% start a \env{paracol} environment, and perform the reverse operation in
% \!\pcol@output@end! to close the environment. Though it is very unlikely
% (or maybe impossible) that the \!\@deferlist! {\em imported\/} in the
% former operation has \LaTeX's (i.e., not \Paracol's) double-column floats
% of |1sp| deep, we make such floats old-fashioned making their depth 0 so
% that they can be put in a page built in the \env{paracol} environment. On
% the other hand, the latter cannot {\em export\/} a list having floats of
% |1sp| deep because they have been produced in the closing \env{paracol}
% environment or have passed our {\em custom\/} \!\pcol@output@start! when
% they were imported\footnote{
%
% Therefore, if one try to {\em smuggle\/} a double-column float of the new
% scheme into a \env{paracol} and to pass it through the environment to
% another double-column world, the float will become a single-column one.
% Even if such guy a really exists and complains abount this transformation,
% however, we have good right to say ``don't do that''.}.
% \end{enumerate}
%
% Note that the operations (1), (2) and (4) are fully compatible with 2014
% or older version of \LaTeX{}, because with the old version; (1)
% \!\pcol@end@dblfloat! is equivalent to \!\end@dblfloat!; (2) modification
% of \!\f@depth! cannot be seen because it does not exist; and (4) we
% virtually do nothing in the importation. As for (3), we explicitly take
% care of the compatibility as shown above.
%
%
%
% \section{Interaction with \TeX{} and \LaTeX{}}
% \label{sec:imp-tex}
%
% The macros of \Paracol{} interacts with \TeX{} and \LaTeX{} through
% various registers and macros as discussed in this section.
%
% \subsection{Registers}
% \label{sec:imp-tex-reg}
%
% \subsubsection{Insertion Registers}
%
% \begin{description}
% \item[\Uidx{\!\footins!}]
% is used to \!\insert! footnotes through it by \!\footnote! and
% \!\footnotetext!, and then in \!\output! routine the footnotes
% \!\insert!ed in a page is presented in the register. The register is
% referred to by the following macros.
%
% \begin{itemize}
% \item
% \!\pcol@makecol! examines if the register has \Scfnote{}s and, if so,
% saves it into $\pp^f(p)$ if $p=\ptop$ or discards it otherwise.
%
% \item
% \!\pcol@startcolumn! \!\insert!s $\pp^f(p)$ into the \colpage{} to be
% created through the register.
%
% \item
% \!\pcol@specialoutput! logs the contents of the register for debugging.
%
% \item
% \!\pcol@output@start! examines if the register has footnotes to be merged
% with those in \env{paracol} environment, refers to its height plus depth to
% calculate effective \!\@colht!, and/or \!\insert!s its contents through
% itself to the main vertical list as the first part of \Mgfnote{}s.
%
% \item
% \!\pcol@makenormalcol! combines footnotes in the register to other
% \preenv{} to make a \spanning, or makes save\slash restore of the register
% to/from \!\@tempboxa! to exclude footnotes from \spanning{} when
% \mgfnote{}-footnote typesetting is specified.
%
% \item
% \!\pcol@output@switch! saves the register into $\pp^f(p)$ or $\cc_c(\ft)$,
% or discards its contents, when we leave from the column $c$ with footnotes.
%
% \item
% \!\pcol@restartcolumn! restores $\cc_d(\ft)$ or $\pp^f(p)$ to the register
% and then \!\insert!s the contents of \!\box!\!\footins! into itself so
% that it contributes to the main vertical list to be rebuilt for the column
% $d$.
%
% \item
% \!\pcol@getcurrfoot! for column $d$ lets the register have $\cc_d(\ft)$.
%
% \item
% \!\pcol@savefootins! saves the register into an \!\insert! for $\pp^f(p)$
% or $\cc_c(\ft)$.
%
% \item
% \!\pcol@deferredfootins! refers the \!\skip! component of the register to
% have the vertical skip above \Scfnote{}s and \!\insert!s deferred
% footnotes through the register.
%
% \item
% \!\pcol@output@end! \!\insert!s $\pp^f(p)$ into the \lpage{} through the
% register.
%
% \item
% \!\pcol@fntexttop!\marg{text} \!\insert!s the footnote $\arg{text}$ and a
% penalty through the register.
%
% \item
% \!\pcol@fntextbody!\marg{text} refers to the \!\skip! component of the
% register to cap the height of the footnote $\arg{text}$.
% \end{itemize}
%
% \item[\rm\Uidx{\!\bx@A!}, \ldots, \Uidx{\!\bx@R!}]
% have floats created by \!\@xfloat! in the ordinary usage of {\em
% fundamental\/} \LaTeX{} of 2014 or earlier or that without the extension
% of e-\TeX{} or its relatives. On the other hand, in \LaTeX{} of 2015 or
% later and with e-\TeX{} or its relatives, the set is \!\bx@A!, \ldots,
% \Uidx{\!\bx@Z!}, \Uidx{\!\bx@AA!}, \ldots, \Uidx{\!\bx@ZZ!}\@. In addtion
% to the use in \LaTeX, we use these registers for completed \colpage{}s
% $s_c(p)$ (\!\pcol@opcol!, \!\pcol@flushcolumn!), main vertical list
% $\cc_c(\vb)$ (\!\pcol@output@start!, \!\pcol@output@switch!,
% \!\pcol@flushcolumn!) and \Mcfnote{}s $\cc_c(\ft)$
% (\!\pcol@output@switch!) in \ccolpage{}s, \spanning{} including \preenv{}
% $\pp^i(p)$ (\!\pcol@startpage!, \!\pcol@output@start!) and \Scfnote{}s
% $\pp^f(p)$ (\!\pcol@makecol!, \!\pcol@output@switch!) in pages,
% \mvlfloat{}s for main vertical lists in \sync{}ed pages
% (\!\pcol@synccolumn!), and \pwise{} floats deferred from \env{paracol} to
% \postenv{} (\!\pcol@output@end!).
% \end{description}
%
%
%
% \subsubsection{Integer Registers}
%
% \begin{description}
% \item[\Uidx{\!\deadcycles!}]
% is \TeX's primitive register to count the number of \!\output! requests
% made between two \!\shipout! operatios. It is zero-cleared by
% \!\pcol@invokeoutput! because it can have a large number in a
% \env{paracol} environment.
%
% \item[\Uidx{\!\outputpenalty!}]
% is \TeX's primitive register to have the page-break penalty with which
% \!\output! routine is invoked. It is referred to by \!\pcol@output! to
% know whether it has special code less than $-10000$, and by
% \!\pcol@specialoutput! in detail for the dispatch according to the code.
% The register is also used for the communication from the latter, which lets
% it be $-10000$ for our own special \!\output! routines, to the former to
% determine \!\vsize! according to if the register has a value greater than
% $-10004$ or not.
%
% \item[\Uidx{\!\interlinepenalty!}]
% is \TeX's primitive register to have the page-break penalty inserted
% between two lines. The register is referred to in the following macros.
%
% \begin{itemize}
% \item
% \!\pcol@output@start! to make \Preenv{} \Mgfnote{}s followed by this
% \!\penalty! on the \!\insert!ion, and to insert it to start the first
% \colpage{} allowing page-break before the start unless it is inhibited
% by $\CSIndex{if@nobreak}=\true$.
%
% \item
% \!\pcol@restartcolumn! to insert this \!\penalty! to resume a \colpage{}
% allowing page-break if $\CSIndex{if@nobreak}=\false$.
%
% \item
% \!\pcol@deferredfootins! to let the secnod half of split $\df$ have this
% \!\penalty! as the very first element.
%
% \item
% \!\pcol@fntexttop!\marg{text} to make the footnote $\arg{text}$ followed
% by this \!\penalty! on the \!\insert!ion.
%
% \item
% \!\pcol@fntextother!\marg{text} to make the footnote $\arg{text}$ preceded
% by this \!\penalty! in $\df$.
%
% \item
% \!\pcol@fntextbody! to let the register have \!\interfootnotelinepenalty!.
% \end{itemize}
%
% \item[\Uidx{\!\floatingpenalty!}]
% is \TeX's primitive register to have the page-break penalty added to
% \!\insertpenalties! if an \!\insert! is moved to the page next to the page
% in which the line having the \!\insert! resides. It is let have 20000 in
% \!\pcol@fntextbody! for footnote typesetting.
%
% \item[\Uidx{\!\vbadness!}]
% is \TeX's primitive register to have the threshold of the badness of
% \!\vbox! construction with underfull messages. That is, if the badness
% exceeds the threshold on a \!\vbox! construction, \TeX{} will complain
% showing an underfull message. In \!\pcol@makenormalcol! and
% \!\pcol@deferredfootins!, the register is temporarily let have 10000 to
% avoid that \!\@makecol! invoked in the former and \!\vsplit! done in the
% latter causes the message with inevitable underfull.
%
% \item[\Uidx{\!\showboxdepth!}]
% is \TeX's primitive register to determine the maximum depth of box
% structure to be shown in logging etc. The register is let have 10000 in
% \!\pcol@ShowBox! for full logging.
%
% \item[\Uidx{\!\showboxbreadth!}]
% is \TeX's primitive register to determine the maximum breadth of box
% structure to be shown in logging etc. The register is let have 10000 in
% \!\pcol@ShowBox! for full logging.
%
% \item[\Uidx{\!\interfootnotelinepenalty!}]
% is an API \!\count! register to have \!\interlinepenalty! for footnotes.
% It is used in \!\pcol@fntextbody! to let \!\interlinepenalty! have it.
%
% \item[\Uidx{\!\@ne!}]
% is a \!\chardef! register to have 1. The register is referred to by the
% following macros mainly for incrementing another register.
%
% \begin{quote}\raggedright
% \!\pcol@F@count!,
% \!\pcol@output!,
% \!\pcol@opcol!,
% \!\pcol@setpnoelt!,
% \!\pcol@nextpage!,
% \!\pcol@nextpelt!,
% \!\pcol@startpage!,
% \!\pcol@checkshipped!,
% \!\pcol@outputelt!,
% \!\pcol@ioutputelt!,
% \!\@outputpage!,
% \!\pcol@bg@paint@ii!,
% \!\pcol@output@start!,
% \!\pcol@makenormalcol!,
% \!\pcol@output@switch!,
% \!\pcol@setcurrcol!,
% \!\pcol@iscancst!,
% \!\pcol@addmarginpar!,
% \!\pcol@do@mpbout@i!,
% \!\pcol@sync!,
% \!\pcol@flushcolumn!,
% \!\pcol@measurecolumn!,
% \!\pcol@synccolumn!,
% \!\pcol@makeflushedpage!,
% \!\pcol@imakeflushedpage!,
% \!\pcol@iflushfloats!,
% \!\pcol@freshpage!,
% \!\pcol@output@end!,
% \!\pcol@invokeoutput!,
% \!\pcol@zparacol!,
% \!\pcol@setcolwidth@r!,
% \!\pcol@setcolwidth@s!,
% \!\pcol@setcw@scan!,
% \!\pcol@setcw@calcf!,
% \!\pcol@synccounter!,
% \!\pcol@com@syncallcounters!,
% \!\pcol@stepcounter!,
% \!\pcol@com@switchcolumn!,
% \!\pcol@sptext!,
% \!\pcol@visitallcols!,
% \!\pcol@ifootnote!,
% \!\pcol@ifootnotemark!.
% \!\pcol@swapcolumn!,
% \!\pcol@set@color@push!,
% \end{quote}
%
% \item[\Uidx{\!\tw@!}]
% is a \!\chardef! register to have 2. It is used in \!\pcol@setcurrcol! to
% let $\cc_c(\sw)=2$ when $\CSIndex{if@nobreak}=\true$ but
% $\CSIndex{if@afterindent}=\false$, in
% $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ to calculate $x\cdot2^k$, $y/2^k$
% and $(x/y)\cdot2^k$ with various $k$, and in \!\pcol@swapcolumn! to
% calculate $\Cto-(c'-\Cfrom)-2=c-1=c^g$ for the \csepgap{} ordinal $c^g$
% physically following the column $c$ at the position $c'$.
%
% \item[\Uidx{\!\m@ne!}]
% is a \!\count! register to have $-1$. It is used in the following macros.
%
% \begin{itemize}
% \item
% \!\pcol@setpnoelt!, \!\pcol@nextpelt!, \!\pcol@getpelt! and
% \!\pcol@setmpbelt! to decrement
% \!\@tempcnta! which initially has $p-\pbase$ for a page $p$.
%
% \item
% \!\pcol@bg@paint@i! to decrement $\CBto$ by one locally to have the column
% scanning range $\LBRP\CBfrom{\CBto{-}1}$.
%
% \item
% \!\pcol@iscancst! to decrement $\npop$ by one.
%
% \item
% \!\pcol@do@mpbout@i! to let \!\@tempcnta! have it to indicate left margin.
%
% \item
% \!\pcol@setcolwidth@r! to calculate $\Cto-\Cfrom-1$.
%
% \item
% $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ in \!\@whilenum! loops to
% calculate $z'/2^k$ and $z'/2{k-16}$ where $z'/2^k\approx x/y$.
%
% \item
% \!\pcol@iadjustfnctr! to decrement \!\c@footnote!.
% \end{itemize}
%
% \item[\Uidx{\!\sixt@@n!}]
% is a \!\chardef! register to have 16. It is used in
% $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ to calculate
% $Z=z\times1\,|pt|=z'\cdot2^{16-k}$ where $z'/2^k\approx x/y$.
%
% \item[\Uidx{\!\@m!}]
% is a \!\mathchardef! register to have 1000. It is used in
% \!\pcol@synccolumn! and \!\pcol@output@end! to let
% $\!\prevdepth!=1000\,|pt|$ on a \sync{}ation or the closing \env{paracol}
% environment with an empty main vertical list, and in
% \!\pcol@setcw@getspec@i! to add 1000\,|pt| to strech and shrink
% compontents of \!\@tempskipa! having a column\slash gap sepcification to
% make it sure the skip register has those components.
%
% \item[\Uidx{\!\@M!}]
% is a \!\mathchardef! register to have 10000. It is used in the following
% macros
%
% \begin{itemize}
% \item
% \!\pcol@ShowBox! to let \!\showboxdepth! and \!\showboxbreadth! have
% 10000 for full logging of a box.
%
% \item
% \!\pcol@output! to examine if $\!\outputpenalty!<-10000$ to mean a special
% \!\output! request.
%
% \item
% \!\pcol@specialoutput! to let $\!\outputpenalty!=-10000$ to tell
% \!\pcol@output! that the special \!\output! request is our own.
%
% \item
% \!\pcol@makenormalcol! and \!\pcol@deferredfootins! to let \!\vbadness!
% have 10000 temporarily to avoid underfull messages.
%
% \item
% \!\pcol@synccolumn! to bias \!\pcol@textfloatsep! by 10000\,|pt| to
% indicate a \colpage{} has an \mvlfloat{} and in \!\pcol@cflt! and
% \!\pcol@addflhd! to remove the bias.
%
% \item
% \!\pcol@switchcol! and \!\pcol@flushclear! to put \!\penalty!|-10000| for
% forced page break.
%
% \item
% $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ to let $Z=z\times1\,|pt|=10000\,|pt|$
% if $x/y$ is too large.
% \end{itemize}
%
% \item[\Uidx{\!\@Mii!}]
% is a \!\mathchardef! register to have 10002. It is used in
% \!\pcol@end@dblfloat! to examine if $\!\@floatpenalty!=-10002$ to mean the
% float environment to be closed is given in horizontal mode.
%
% \item[\Uidx{\!\@Miv!}]
% is a \!\mathchardef! register to have 10004. It is used in \!\pcol@output!
% to examine if $\!\outputpenalty!=-10004$ for a dummy \!\output! request
% made by \LaTeX's float-related macros and our \!\pcol@invokeoutput! to
% ensure the real request is not eliminated when it is made at the very
% beginning of a page or a \colpage. It is also used in
% \!\pcol@specialoutput! for footnote logging when
% $\!\outputpenalty!=-10004$.
%
% \item[\Uidx{\!\@MM!}]
% is a \!\mathchardef! register to have 20000. It is used in
% \!\pcol@fntextbody! to let \!\floatingpenalty! have it for footnote
% typesetting.
%
% \item[\Uidx{\!\@beginparpenalty!}]
% is a \!\count! register to have the page-break penalty inserted before the
% first \!\item! of each \env{list}-like environment. The penalty is
% determined in class files and is, for example, $-\!\@lowpenalty!=-51$ with
% \textsf{article.cls}. It is referred to and inserted by \!\pcol@zparacol!
% when it finds the \env{paracol} environment to start is at the very
% beginning of a \env{list}-like environment.
%
% \item[\Uidx{\!\@floatpenalty!}]
% is a \!\count! register to have the penalty code -10002 or -10003 given by
% \!\@xfloat! at the beginning of a float environment according to the
% environment is in horizontal or vertical mode respectively, or by
% \!\marginpar! for a marginal note in the same meaning. It is
% referred to by \!\pcol@end@dblfloat! to insert the penalty, and by
% \!\pcol@xympar! to confirm \!\marginpar! is error free.
%
% \item[\Uidx{\!\@topnum!}]
% is a \!\count! register to have the maximum number of top floats which the
% \ccolpage{} can accept further. It is used in \!\pcol@setcurrcol!
% and \!\pcol@iigetcurrcol! to save\slash restore it into\slash from
% $\cc_c(\tn)$. The macro \!\pcol@synccolumn! also lets $\!\@topnum!=0$ to
% inhibit top-float insertions in the \ccolpage{} any more after a
% \sync{}ation.
%
% \item[\Uidx{\!\@botnum!}]
% is a \!\count! register to have the maximum number of bottom floats which
% the \ccolpage{} can accept further. It is used in \!\pcol@setcurrcol!
% and \!\pcol@iigetcurrcol! to save\slash restore it into\slash from
% $\cc_c(\bn)$.
%
% \item[\Uidx{\!\@colnum!}]
% is a \!\count! register to have the maximum total number of floats which
% the \ccolpage{} can accept further. It is used in \!\pcol@setcurrcol!
% and \!\pcol@iigetcurrcol! to save\slash restore it into\slash from
% $\cc_c(\cn)$.
%
% \item[\Uidx{\!\col@number!}]
% is a \!\count! register to have the number of columns. It is let have 1
% by \!\pcol@zparacol! and \!\pcol@sptext! regardless the real number of
% columns $\C$ in order to keep \!\maketitle! from putting the title by
% \!\twocolumn!.
%
% \item[\Uidx{\!\c@page!}]
% is \LaTeX's counter \Uidx{\counter{page}} being a \!\count! register to
% have the page number. It is referred to by \!\pcol@setpnoelt!, and
% \!\pcol@output@start! to let $\pp^p(p)=\page(p)$. The macro
% \!\pcol@startpage! reload the register from $\pp^p(\ptop{-}1)$ and then
% increment it by one usually but two in \npaired{} \parapag{}ing, and
% repeat $\pp^p(\ptop)=\page(\ptop)$ and incrementing $\page(p)$ for each
% \fpage{}s of \pwise{} floats. Reloading $\page(p)$ to the register from
% $\pp^p(p)$ is also done by \!\pcol@getpelt! for macros using
% \!\pcol@getcurrpage!, and by \!\pcol@outputelt!, \!\pcol@sync! and
% \!\pcol@makeflushedpage! by \!\pcol@getcurrpinfo!. Then the register is
% referred to by the following macros to exmine its parity.
%
% \begin{itemize}
% \item
% Our own \!\@outputpage! to give $\page(p)$ or $\page(p)+1$ to
% \!\pcol@outputpage@l! and \!\pcol@outputpage@r! which finally let the
% register have the value to be referred to by \!\pcol@@outputpage! being
% \LaTeX's \!\@outputpage!.
%
% \item
% \begin{Sloppy}{2800}%
% \!\pcol@bg@swappage! to determine the values of \!\pcol@bg@leftmargin!
% and \CSIndex{ifpcol@bg@@swap} with other factors.
% \end{Sloppy}
%
% \item
% \!\pcol@shiftspanning! to decide the necessity of shifting \mctext{} left
% with \cswap{}, examining {\em raw} \!\c@page! at the \!\output! request to
% close the \mctext{} rather than $\pp^p(\ptop)$ which will have the correct
% value with respect to possible jump {\em after} the macro completes its
% work.
%
% \item
% \!\pcol@addmarginpar! to determine the margin to which a marginal note
% goes.
%
% \item
% \!\pcol@do@mpbout@i! to determine which of $\mpb_L^l$ or $\mpb_L^r$ is the
% target of the operation specified by \!\pcol@do@mpbout@elem!.
%
% \item
% $\!\pcol@swapcolumn!\<c_1\>\<c_2\>\<\Cfrom\>\<\Cto\>$ to determine $c_2$
% for $c_1$ if \cswap{} is in effect.
% \end{itemize}
%
% In addition, to do the parity examination in \!\pcol@bg@swappage! above
% correctly, the macros \!\pcol@ioutputelt!, \!\pcol@makeflushedpage!,
% \!\pcol@imakeflushedpage!, \!\pcol@iflushfloats! and \!\pcol@output@end!
% temporarily increment the register by one when they are working on a right
% \npaired{} \parapag{}e.
%
% The other users are \!\localcounter!\marg{ctr} to check
% $\arg{ctr}\neq\counter{page}$, \!\pcol@remctrelt! to let
% $|\cl@|{\cdot}\theta=\!\pcol@stepcounter!\Arg{\theta}$
%
% \SpecialArrayIndex{\theta}{\cl@}
%
% unless $\theta=\counter{page}$, and \!\pcol@FF! to write it to a log file
% as a part the logging information of memory leak debugging.
%
% \item[\Uidx{\!\c@footnote!}]
% is \LaTeX's counter \Uidx{\counter{footnote}} being a \!\count! register
% to have the footnote number. It is referred to by \!\pcol@zparacol! to
% let $\bf=\!\pcol@footnotebase!$ have its value, by \!\pcol@calcfnctr! to
% calculate the footnote ordinal which the one of its invoker
% \!\pcol@iadjustfnctr! sets into the register, and by \!\endparacol! to let
% the register have $\bf+\nf=\!\pcol@footnotebase!+\!\pcol@nfootnotes!$.
%
% \item[$\cs{c@}{\cdot}\theta$]
% \SpecialArrayUsageIndex{\theta}{\c@}
%
% is a \!\count! register being \LaTeX's counter $\theta$. It is referred
% to by \!\pcol@savectrelt! to let $\val_c(\theta)=\Val(\theta)$ for saving
% it in $\Cc_c$, by \!\pcol@cmpctrelt! to examine if
% $\val_0(\theta)=\Val(\theta)$ to detect a modification outside
% \env{paracol} environment, and by \!\pcol@syncctrelt! to let
% $\val_c(\theta)=\Val(\theta)$ for all $c$ for \csync{}. It is also
% referred to by \!\pcol@remctrelt! and \!\localcounter! to examine if
% $\theta=\counter{page}$. The macros \!\pcol@setctrelt! and
% \!\pcol@stpldelt! restore the value of the counter from $\val_c(\theta)$,
% while \!\pcol@stpclelt! lets $\Val(\theta)=0$ for zero-clearing of
% descendent counters.
%
% \item[\Uidx{\!\count@!}]
% is a \!\count! register for temporary use. It is used in
% \!\pcol@iscancst! to have $m$ of $\mcelt_{i,m}$,
% \!\pcol@addmarginpar! to have the physical column position of the current
% column $c$ in which \!\marginpar! is given, and in
% $\!\pcol@extract@fil@i!\<s\>\!\@nil!$ to exract the unit of the stretch
% component $s$ of a glue.
%
% \item[\Uidx{\!\@tempcnta!}]
% is a \!\count! register for temporary use. The usages of this register
% are as follows.
%
% \begin{itemize}
% \item
% In \!\pcol@F@count!, it is used to measure the cardinality of
% \!\@freelist!.
%
% \item
% In \!\pcol@makecol!, it is used to keep $\page(\ptop)$ gotten by
% \!\pcol@getcurrpinfo! until we store it back by \!\pcol@defcurrpage!.
%
% \item\begin{Sloppy}{3700}
% In \!\pcol@setpageno!, \!\pcol@setpnoelt!, \!\pcol@nextpage!,
% \!\pcol@nextpelt!, \!\pcol@getcurrpage!, \!\pcol@getpelt!,
% \!\pcol@addmarginpar! and \!\pcol@setmpbelt!, it has $p-q$ when we scan
% $\pp(q)$ for all $q\in[\pbase,\ptop]$ and the \ccolpage{} is at $p$.
% \end{Sloppy}
%
% \item
% In \!\pcol@checkshipped!, it has $c$ when we scan $\S_c$ for all
% $c\In0\C$ to examine if all of them are not empty and thus we have pages
% to be shipped out.
%
% \item
% In \!\pcol@ioutputelt!, it has $c'$ when we scan $\s_c(q)$ for all
% $c\In0\CL$ or $c\In\CL\C$ to build the shipping out image of a page $q$,
% where $c=c'$ or $c=\Cto-1-(c'-\Cfrom)$ where
% $(\Cfrom,\Cto)\in\{(0,\CL),(\CL,\C)\}$.
%
% \item
% In \!\@outputpage!, it has $\page(p)$ or $\page(p)+1$ to be given to
% \!\pcol@outputpage@l! or \!\pcol@outputpage@r! as their argument when they
% are used to ship out the second (not always right) component of a
% \parapag{}e pair.
%
% \item
% In \!\pcol@bg@columnleft!, it has a value in $\LBRP\CBfrom{c}$ to sum up
% the width of columns and \csepgap{}s in the range.
%
% \item
% In \!\pcol@output@switch!, it is used to have $\page(p)$ obtained by
% \!\pcol@getcurrp~info! and simply to store the value in $\pp^p(p)$ by
% \!\pcol@defcurrpage! when we use these macros to add an element to
% $\pp^s(p)$ and/or let $\pp^f(p)=\!\footins!$.
%
% \item
% In \!\pcol@setcurrcol!, it has the code calculated from
% \CSIndex{if@nobreak} and |\if@after|\~|indent| to be saved in
% $\cc_c(\sw)$.
%
% \SpecialIndex{\if@afterindent}
%
% \item
% In $\!\pcol@scancst!\arg{box}$, it is let have
% $\arg{box}\in\{\!\pcol@colorins!,|\pcol@color|\~|stack@saved|\}$ and then is
% referred to in \!\pcol@iscancst!.
% \SpecialIndex{\pcol@colorstack@saved}
%
% \item
% In \!\pcol@addmarginpar! besides the page scan shown above, it is used to
% scan all columns whose physical position is left from the current
% colum $c$ to measure the distance between the left edges of the leftmost
% column and $c$.
%
% \item
% In \!\pcol@do@mpbout@i!, it has $\pm1$ according to the margin ($\rm
% left=-1$) which marginal notes outside \env{paracol} environments goes
% to.
%
% \item
% In \!\pcol@flushcolumn!, it is used to throw $\page(\ptop)$ away when we
% get it by \!\pcol@getcurrpinfo! because we don't need it.
%
% \item
% In \!\pcol@setcolwidth@r!, it has $c$ to scan fractions $r_d$ where
% $d=c-\Cfrom$ in its argument $\arg{ratio}$ specified by \!\columnratio!,
% and then to distribute the unspecifed portion of \!\textwidth! evenly to
% $\w_c$ for all $c\In{\Cfrom{+}k{+}1}\Cto$, where $k$ is the number of
% fractions and $(\Cfrom,\Cto)\in\{(0,\CL),(\CL,\C)\}$.
%
% \item
% In $\!\pcol@setcw@scan!\<\Cfrom\>\<\Cto\>\Arg{spec}$, it has $c$ for two
% loops for $c\In\Cfrom\Cto$ to add `|,|' to the tail of $\arg{spec}$ as
% many as $k=\Cto-\Cfrom$ and then to process first $k$ elements in
% $\arg{spec}$, and is referred to by \!\pcol@setcw@set! invoked in the
% second loop.
%
% \item
% In $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$, it used to calculate and to have
% $k$ such that $z'/2^k\approx x/y$.
%
% \item
% In \!\pcol@cmpctrelt!, it has $\Val(\theta)$ of a counter $\theta$ to be
% compared with $\val_0(\theta)$.
%
% \item
% In \!\pcol@com@switchcolumn!, it has $(c+1)\bmod\C$ being the target of
% \cswitch{}.
%
% \item
% In \!\pcol@sptext!, it temporarily has $d$ being the target of \cswitch{}
% during we let \!\pcol@nextcol! have 0 to visit the leftmost column
% to put a \mctext{}.
%
% \item
% In \!\pcol@visitallcols!, it has $d\In0\C-\{c\}$ being the columns to be
% visited for \cscan{}ning.
%
% \item
% In \!\definecolumnpreamble!\marg{c}\marg{pream}, $c$ is assigned to the
% register to ensure $c$ is a number.
%
% \item
% In \!\pcol@calcfnctr!, it has the footnote ordinal calculated by the
% macro to be referred to by the invokers \!\pcol@iadjustfnctr! and
% \!\pcol@iifootnotetext!.
%
% \item
% In $\!\marginparthreshold!\Arg{t_l}|[|t_r|]|$ it is let have $t_l$, while
% in the related macro $\!\pcol@marginparthreshold!|[|t_r|]|$ it is let have
% $t_r$.
% \end{itemize}
%
% \item[\Uidx{\!\@tempcntb!}]
% is a \!\count! register for temporary use. It is used in the following
% macros.
%
% \begin{itemize}
% \item
% In \!\pcol@ioutputelt! it has $c$, while in \!\pcol@imakeflushedpage! and
% \!\pcol@iflushfloats! it has $c'$, to have $c=c'$ or $c=\Cto-1-(c'-\Cfrom)$
% according to \cswap{} for $c'$-th iteration of column scanning loop for
% $c'\In\Cfrom\Cto$, where $(\Cfrom,\Cto)\in\{(0,\CL),(\CL,\C)\}$.
%
% \item
% In \!\pcol@scancst! and \!\pcol@iscancst!, it has $\npop$.
%
% \item
% In \!\pcol@addmarginpar!, it is let have the column number $d$ whose
% phisical position is left from the current colum $c$ to measure the
% distance between the left edges of the leftmost column and $c$.
%
% \item
% In \!\pcol@sync! and \!\pcol@measurecolumn!, it has the (so-far) tallest
% column which gives $\VP$.
%
% \item
% In \!\pcol@setcolwidth@r!, it has $\Cto-\Cfrom-1$ then $\Cto-1$ and
% finally $\Cto-\min(\Cfrom{+}k,\,\Cto{-}1)$, where $k$ is the number of
% fractions given in the argument of \!\columnratio! and
% $(\Cfrom,\Cto)\in\{(0,\CL),(\CL,\C)\}$.
%
% \item
% In $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$, at first it is used to calculate
% $z'/2^k\approx x/y$ and then to calculate
% $Z=z\times1\,|pt|=z'\cdot2^{16-k}$.
%
% \item
% In \!\pcol@visitallcols!, it has $c=\!\pcol@currcol!$ to exclude it from
% the \cscan{} targets.
% \end{itemize}
% \end{description}
%
%
%
% \subsubsection{Dimension Registers}
%
% \begin{description}
% \item[\Uidx{\!\vsize!}]
% is \TeX's primitive register to have the height of a page or a \colpage{}
% being built. It is let be \!\@colroom! or \!\maxdimen! by
% \!\pcol@output!.
%
% \item[\Uidx{\!\hsize!}]
% is \TeX's primitive register to have the width of a page or a \colpage{}
% being built. It is let be $\w_c$ by \!\pcol@invokeoutput! to restart (or
% stay in) the column $c$, be \!\textwidth! by \!\pcol@sptext! for \mctext,
% and be either of \!\textwidth! or $\w_c$ by \!\pcol@fntextbody! according
% to the footnote typesetting being \scfnote{} or \mcfnote{} resepectively.
%
% \item[\Uidx{\!\maxdepth!}]
% is \TeX's primitive register to have the maximum depth of the page being
% built. In \LaTeX, it is assumed that its value is fixed at
% \beginenv{document}, in which the value is saved into \!\@maxdepth!, for
% the typesetting throughout the document, unless a bottom float is added to
% a page in which the register is let have 0 until it is shipped out. This
% temporary setting for a page with bottom floats has some reasonability but
% its implementation for \env{paracol} environments having \cswitch{}
% from/to a \colpage{} with bottom floats to/from another one without
% them is too costly\footnote{
%
% That is, we would need to incorporate \cs{maxdepth} as a member of
% \cctext, but we don't because the idea of temporary setting itself is too
% vague to pay the effort and a precious membership in \cctext.}.
%
% Therefore, we let the register have \!\@maxdepth! in \!\pcol@output! and
% \!\pcol@combinefloats! to cancel the temporary setting done in
% \!\@addtobot! for the references by \TeX's page builder and \!\@cflt!
% respectively.
%
% \item[\Uidx{\!\boxmaxdepth!}]
% is \TeX's primitive register to have the maximum depth of \!\vbox!es.
% The macros \!\pcol@cflt!, \!\pcol@opcol!,
% \!\pcol@ioutputelt!, \!\pcol@combine~floats!, \!\pcol@output@flush! and
% \!\pcol@output@clear! let it be \!\@maxdepth! for the boxes having a
% completed \colpage{} or page to cap the depth of the box. The macro
% $\!\pcol@@makecol!\<d\>$ also do that when $d=\!\@maxdepth!$ but it can be
% $d=0$ when it is invoked to build \lpage{}.
%
% \item[\Uidx{\!\splitmaxdepth!}]
% is \TeX's primitive register to have the maximum depth of the \!\vbox!
% being the first half of a box being split. It is used in
% \!\pcol@deferredfootins! to cap the depth of the first half of deferred
% footnotes split from $\df$, and in \!\pcol@fntextbody! to let it have the
% depth of \!\strutbox!.
%
% \item[\Uidx{\!\prevdepth!}]
% is \TeX's primitive register to have the depth of the box which just has
% been added to a vertical list, or to be given to \TeX's vertical list
% builder for the calculation of the vertical skip inserted below the last
% box. The macro \!\pcol@invokeoutput! refers to it to save its value in
% \!\pcol@prevdepth! before putting a dummy \!\vbox! and making a \!\output!
% request, and then let it have \!\pcol@prevdepth! which is given by
% \!\output! routine for the column that we resume. The macro
% \!\pcol@zparacol! also refers to it to save it in \!\pcol@firstprevdepth!
% for the \preenv.
%
% \item[\Uidx{\!\vfuzz!}]
% is \TeX's primitive register to have the threshold height of overfull
% messaging. It is set to 0 in $\!\pcol@ShowBox!\arg{b}$ to ensure overfull
% for any \!\box! $b$ of non-null height.
%
% \item[\Uidx{\!\maxdimen!}]
% is a \!\dimen! register to have $16383.99999\,|pt|$ being the largest
% legal dimensional value. The usages of this register are as follows.
%
% \begin{itemize}
% \item
% For the \!\insert! register set $\!\pcol@colorins!=\cstraw$,
% \!\dimen!\!\pcol@colorins! is let be \!\maxdimen! for the consistency with
% our intention that a \colpage{} can have virtually infinite number of
% \!\insert!ions for text coloring.
%
% \item
% In \!\pcol@output!, it is set into \!\vsize! when $\!\outputpenalty!=-10004$
% for the dummy \!\output! request so that no page break should occur
% between the dummy and real requests.
%
% \item
% Our own \!\dimen! register \!\pcol@textfloatsep! has \!\maxdimen! if a
% \colpage{} does not have \sync{}ation points to let top floats are
% inserted in usual way. Therefore, \!\pcol@floatplacement! and
% \!\pcol@zparacol! let the register have \!\maxdimen! as the initial
% value. Then the macros \!\pcol@makecol! and \!\pcol@combinefloats!
% examine if $\!\pcol@textfloatsep!=\!\maxdimen!$ to determine the operation
% type of top float insertion, while \!\pcol@synccolumn! does that to know
% if it is flushing a \colpage{} with a \sync{}ation point or is setting the
% first \sync{}ation point in the \colpage{}. The macro \!\pcol@addflhd!
% also examines it for the measurement of the combined height of top and
% bottom floats, while \!\pcol@measurecolumn! gives it \!\maxdimen! as its
% third argument for bottom floats.
%
% \item
% The \pctext{} $\pp^h(p)$ has $-\!\maxdimen!$ if the page is a \fpage{}.
% The macro \!\pcol@startpage! makes that when it creates such a page.
%
% \item
% Our own \!\pcol@prevdepth! and that saved in $\cc_c(\pd)$ have
% \!\maxdimen! if the main vertical list is empty at a \sync{}ation. The
% macro \!\pcol@measurecolumn! makes that when it finds an empty list.
%
% \item
% The \cctext{} $\cc_c(\tr)$ may have \!\maxdimen! if the column $c$ has a
% \fcolumn{} in the \lpage{} of a \env{paracol} environment and the floats in
% it can be put as top floats. The macro \!\pcol@makefcolumn! makes this
% special assignment, and \!\pcol@flushcolumn! and \!\pcol@imakeflushedpage!
% examine it.
%
% \item
% The macro \!\pcol@makefcolelt! let the room for floats in a \fpage{} be
% $-\!\maxdimen!$ if it finds no futher floats can be added to the page.
%
% \item
% At a \sync{}ation, we measure the maximum combined size of top floats and
% the main vertical list $\VT$, that of footnotes and bottom floats $\VB$,
% that of four items $\VP$, and $\VPP$ being $\VP$ or $\VP+\!\textfloatsep!$
% according to the existence of bottom floats. We also let $\DT$ and $\DP$
% be the minimum depth of the \colpage{}s which gives $\VT$ and $\VPP$
% respectively. For the measurement, the macro \!\pcol@sync! lets
% $\VT=\VB=\VP=\VPP=-\!\maxdimen!$ and $\DT=\DP=\!\maxdimen!$ as their
% initial values. Then the macro \!\pcol@synccolumn! examines if
% $\DT=\!\maxdimen!$ to mean the \sync{}ation point is set just below the
% top floats of a column whose main vertical list is empty. On the other
% hand, \!\pcol@makeflushedpage! and \!\pcol@output@end! examine if
% $\VPP=-\!\maxdimen!$ to mean the last \colpage{}s are empty.
% \end{itemize}
%
% \item[\Uidx{\!\linewidth!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
% of a line possibly shorter than \!\columnwidth! in \env{list}-like
% environments. It is let have $\w_c-\lrm$ by
% \!\pcol@invokeoutput! for the outermost paragraphs in \env{paracol}
% environment, where $\lrm=\!\pcol@lrmargin!=\!\textwidth!-l$ which
% \!\pcol@zparacol! lets have to represent the left-plus-right margin of the
% \env{list}-like environment, whose \!\linewidth! is $l$, enclosing
% \env{paracol} if any. The macro \!\pcol@sptext! also sets the register
% temporarily for \mctext{}s but letting it have $\!\textwidth!-\lrm$.
%
% \item[\Uidx{\!\footnotesep!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the
% vertical space inserted in a footnote when it is split into two or more
% pages. It is uesed in \!\pcol@fntextbody! to \!\splittopskip! have it,
% and to make the first line of the footnote is at least as tall as the
% amount in the register.
%
% \item[\Uidx{\!\topmargin!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
% (height) of the top margin minus 1\,inch. The register is used as an
% element of \!\pcol@bg@pagetop! to calculate the distance from the origin
% at the left-top corner of text area to the top edge of a page. The
% other users are \!\pcol@ioutputelt! and \!\pcol@makeflushedpage!
% temporarily add the height-plus-depth of $\pp^b(p)$ to the register to
% make the calculation biased shifting the origin to the left-top corner of
% column area, i.e., below $\pp^b(p)$. The macro \!\@outputpage! also
% refers to the register together with \!\headheight! and \!\headsep! to
% calculate the distance from the page top (ingoring 1\,inch shift) to the
% text area top.
%
% \item[\Uidx{\!\oddsidemargin!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
% of the left margin minus 1\,inch for two-sided odd-numbered pages and
% all single-sided pages. The register is used together with
% \!\evensidemargin! in \!\pcol@outputpage@l!, \!\pcol@outputpage@r! and
% \!\pcol@bg@swappage! to decide the left margin of the page they are
% working on.
%
% \item[\Uidx{\!\evensidemargin!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
% of the left margin minus 1\,inch for two-sided even-numbered pages. The
% register is used together with \!\oddsidemargin! in \!\pcol@outputpage@l!,
% \!\pcol@outputpage@r! and \!\pcol@bg@swappage! to decide the left margin
% of the page they are working on.
%
% \item[\Uidx{\!\headheight!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the
% height of page headers. The register is used together with \!\topmargin!
% and \!\headsep! as an element of \!\pcol@bg@pagetop! and in \!\@outputpage!
% to calculate the distance from the real and imaginary page top to the text
% area top respectively.
%
% \item[\Uidx{\!\headsep!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the
% vertical distance from the bottom of a page header to the text area top.
% The register is used together with \!\topmargin! and \!\headheight! as an
% element of \!\pcol@bg@pagetop! and in \!\@outputpage! to calculate the
% distance from the real and imaginary page top to the text area top
% respectively.
%
% \item[\Uidx{\!\textheight!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the
% height of text area in a page. The register is referred to by
% \!\pcol@output! to examine if a page is very short, by \!\pcol@getpinfo!,
% \!\pcol@startpage!, \!\pcol@flushfloats! and \!\pcol@output@end! to let
% \!\@colht! be it for a page without \spanning{} (so far), by
% \!\pcol@outputelt!, \!\@outputpage!, \!\pcol@output@flush! and
% \!\pcol@output@clear! to build a page to be shipped out, by
% \!\pcol@bg@textheight! to calculate $\HT$, and by \!\pcol@fntextbody! to
% cap the height of a footnote.
%
% \item[\Uidx{\!\textwidth!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
% of a page, which we occasionally refer to as $\WT$. The register is
% referred to by \!\pcol@ioutputelt!, \!\pcol@imakeflushedpage! and
% \!\pcol@iflushfloats! to build a \!\hbox! of \!\textwidth! wide to have
% all columns (in a left or right \parapag{}e). It also referred to by
% following macros; \!\pcol@bg@swappage! to calculate the right margin for
% \mirror{}ed \bgpaint; \!\pcol@bg@@r!, \!\pcol@bg@@f!, \!\pcol@bg@@n!,
% \!\pcol@bg@@p! and \!\pcol@bg@@s! to specify the width of \bground{} of
% \pwstuff{} to be painted; \!\pcol@shiftspanning! to calculate the
% left-shift amount of a \mctext{} in \cswap; \!\pcol@addmarginpar! to
% measure the distance between the right edges of the rightmost and current
% columns; \!\pcol@zparacol! for the calculation of
% $\lrm=\!\pcol@lrmargin!$; \!\pcol@setcolwidth@r! for the calculation of
% $\w_c$ for all $c\In0\CL$ or $c\In\CL\C$; \!\pcol@setcw@calcfactors! for
% the calculation of $\WT/W$ and $(\WT-W)/F$; \!\pcol@sptext!,
% \!\footnoterule! of \env{paracol}'s local and \!\endparacol! to set it
% in \!\columnwidth!; and \!\pcol@fntextbody! to set it in \!\hsize! if
% \Scfnote{} typesetting is in effect.
%
% \item[\Uidx{\!\columnwidth!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
% of a column. The register is let have $\w_c$ by \!\pcol@getcurrcol! for
% the column $c$, then is referred to by the following macros;
% \!\pcol@shiftspanning! to calculate the left-shift amount of a \mctext{} in
% \cswap; \!\pcol@addmarginpar! to measure the distance between the right
% edges of the rightmost and current columns; \!\pcol@imakeflushedpage! and
% \!\pcol@iflushfloats! to put each \colpage{} into a \!\hbox! of $\w_c$ wide
% for shipping a page out; \!\pcol@invokeoutput! to let \!\linewidth! and
% \!\hsize! have the value of or based on it; and \!\pcol@fntextbody! to
% let \!\hsize! have it for \Mcfnote{} typesetting. The register is also
% let have \!\textwidth! by \!\footnoterule! of \env{paracol}'s local
% defined in \!\pcol@zparacol! if \Scfnote{} typesetting is in effect, by
% \!\pcol@sptext! for \mctext{}s, and by \!\endparacol! for \postenv.
%
% \item[\Uidx{\!\columnsep!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
% of \csepgap{}s. It is referred to by \!\pcol@setcolwidth@r! to
% calculate $\w_c$ for all $c\In0\CL$ or $c\In\CL\C$, and by
% \!\pcol@setcw@getspec! as the default width of \csepgap{}s.
%
% \item[\Uidx{\!\columnseprule!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
% of the rules to be drawn in \csepgap{}s. It is referred to by
% \!\pcol@buildcolseprule! and \!\pcol@buildcselt! to draw the rule, and by
% \!\pcol@hfil! to examine if it is positive to mean the rule is really
% drawn and if so to add skips of $-\!\columnseprule!/2$ to surround the
% rule to nullify the width of the rule.
%
% \item[\Uidx{\!\marginparwidth!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
% of a marginal note. It is temporarily modified by \!\pcol@addmarginpar!
% so that a left marginal note is placed appropriately.
%
% \item[\Uidx{\!\marginparsep!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the
% distance between a marginal note and text area. It is temporarily
% modified by \!\pcol@addmarginpar! so that a right marginal note is placed
% appropriately.
%
% \item[\Uidx{\!\marginparpush!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the
% minimum vertical distance between two marginal notes. It is referred to
% by \!\pcol@addmarginpar! to find a place for a marginal note and remember
% the place in $\pp^m(p)$.
%
% \item[\Uidx{\!\paperheight!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the height
% of physical pages $\HP$. It is referred to by \!\pcol@bg@paperheight!
% to calculate $\HP-2\WR$.
%
% \item[\Uidx{\!\paperwidth!}]
% is a \!\dimen! register for an API parameter of \LaTeX{} to have the width
% of physical pages $\WP$. It is referred to by \!\pcol@bg@swappage! to
% calculate the right margin for \mirror{}ed \bgpaint, and by
% \!\pcol@bg@paperwidth! to calculate $\WP-2\WR$.
%
% \item[\Uidx{\!\z@!}]
% is a \!\dimen! register to have 0\,|pt| to initialize \!\pagerim!,
% \!\belowfootnoteskip! and \!\skip!\!\pcol@colorins! at their declarations,
% and is used in the following macros.
%
% \begin{quote}\raggedright
% \!\pcol@ShowBox!,
% \!\pcol@makecol!,
% \!\pcol@combinefloats!,
% \!\pcol@nextpelt!,
% \!\pcol@floatplacement!,
% \!\pcol@startpage!,
% \!\pcol@restartcolumn!,
% \!\pcol@outputelt!,
% \!\pcol@ioutputelt!,
% \!\pcol@buildcolseprule!,
% \!\pcol@buildcselt@S!,
% \!\pcol@buildcselt!,
% \!\@outputpage!,
% \!\pcol@startcolumn!,
% \!\pcol@bg@paint@i!,
% \!\pcol@bg@paintregion!,
% \!\pcol@output@start!,
% \!\pcol@putbackmvl!,
% \!\pcol@iscancst!,
% \!\pcol@deferredfootins!,
% \!\pcol@combinefootins!,
% \!\pcol@addmarginpar!,
% \!\pcol@getmparbottom!,
% \!\pcol@sync!,
% \!\pcol@measurecolumn!,
% \!\pcol@synccolumn!,
% \!\pcol@makeflushedpage!,
% \!\pcol@imakeflushedpage!,
% \!\pcol@output@end!,
% \!\pcol@invokeoutput!,
% \!\pcol@setcolwidth@s!,
% \!\pcol@setcw@calcfactors!,
% \!\pcol@setcw@calcf!,
% \!\pcol@extract@fil@ii!,
% \!\pcol@sptext!,
% \!\pcol@fntextbody!.
% \!\pcol@marginpar!,
% \!\pcol@icolumncolor!,
% \!\pcol@set@color@push!,
% \!\pcol@reset@color@pop!,
% \!\pcol@reset@color@mpop!,
% \!\pcol@backgroundcolor@iii!.
% \end{quote}
%
% It is also used to give the number 0 for the initializations of
% \!\pcol@currcol!, \!\pcol@ncol!, \!\pcol@ncolleft! and
% \!\count!\!\pcol@colorins! at their declarations, and in the following
% macros.
%
% \begin{quote}\raggedright
% \!\pcol@ShowBox!,
% \!\pcol@F@count!,
% \!\pcol@makecol!,
% \!\pcol@opcol!,
% \!\pcol@setpnoelt!,
% \!\pcol@nextpelt!,
% \!\pcol@checkshipped!,
% \!\pcol@getpelt!,
% \!\pcol@outputelt!,
% \!\pcol@ioutputelt!,
% \!\@outputpage!,
% \!\pcol@startcolumn!,
% \!\pcol@output@start!,
% \!\pcol@output@switch!,
% \!\pcol@setcurrcol!,
% \!\pcol@iscancst!,
% \!\pcol@addmarginpar!,
% \!\pcol@setmpbelt!,
% \!\pcol@do@mpbout@i!,
% \!\pcol@sync!,
% \!\pcol@synccolumn!,
% \!\pcol@makeflushedpage!,
% \!\pcol@imakeflushedpage!,
% \!\pcol@flushfloats!,
% \!\pcol@iflushfloats!,
% \!\pcol@freshpage!,
% \!\pcol@output@end!,
% \!\pcol@zparacol!,
% \!\pcol@setcolwidth@r!,
% \!\pcol@setcw@calcf!,
% \!\pcol@synccounter!,
% \!\pcol@com@syncallcounters!,
% \!\pcol@stepcounter!,
% \!\pcol@stpclelt!,
% \!\pcol@com@switchcolumn!,
% \!\pcol@switchcolumn!,
% \!\pcol@sptext!,
% \!\pcol@switchcol!,
% \!\pcol@visitallcols!,
% \!\pcol@xympar!,
% \!\endparacol!.
% \end{quote}
%
% \item[\Uidx{\!\p@!}]
% \begin{Sloppy}{3950}%
% is a \!\dimen! register to have 1\,|pt|. It is used in \!\pcol@ShowBox!,
% \!\pcol@cflt!, \!\pcol@addflhd!, \!\pcol@synccolumn!, \!\pcol@output@end!,
% \!\pcol@setcolwidth@s!, \!\pcol@setcw@getspec@i!, \!\pcol@setcw@fill! and
% \!\pcol@setcw@calcf!, and the top level assignment to \!\@tempskipa! for
% the invocation of \!\pcol@defkw!, as the shorthand of |pt|.
% \end{Sloppy}
%
% \item[\Uidx{\!\@totalleftmargin!}]
% is a \!\dimen! register to have the total size of the left margins of a
% \env{list}-like environment and those surrounding it. It is given to
% \!\parshape! by \!\pcol@invokeoutput! and \!\pcol@sptext! if \env{paracol}
% is enclosed in a \env{list}-like environment.
%
% \item[\Uidx{\!\@themargin!}]
% is a control sequence \!\let!-equal to \!\evensidemargin! for two-sided
% even numbered pages or \!\oddsidemargin! for others. In
% \!\pcol@outputpage@l! and \!\pcol@outputpage@r! it is bound to one of
% \!\dimen! registers for the references in \!\pcol@outputpage@ev!\footnote{
%
% The reference in \CSIndex{pcol@@outputpage} being \LaTeX's
% \CSIndex{@outputpage} is done after the macro itself makes the assignment,
% which is of course consistent with those in our macros.}.
%
% \item[\Uidx{\!\@maxdepth!}]
% is a \!\dimen! register to have \!\maxdepth! at \beginenv{document} to
% recover the temporary update of \!\maxdepth! with 0 by \!\@addtobot! for
% bottom float incorporation in a page. As discussed in the explanation of
% \!\maxdepth!, in \env{paracol} environments \!\maxdepth! is let have
% \!\@maxdepth! always by the assignments in \!\pcol@output! and
% \!\pcol@combinefloats!. Other users, \!\pcol@cflt!, \!\pcol@opcol!,
% \!\pcol@ioutputelt!, \!\pcol@combinefootins!, \!\pcol@output@flush! and
% \!\pcol@output@clear!, let \!\boxmaxdepth! have \!\@maxdepth! so as to
% limit the depth of boxes for a completed \colpage{} or page to the value
% for page typesetting, while \!\pcol@flushcolumn! and
% \!\pcol@imakeflushedpage! do that by \!\pcol@@makecol! giving the register
% to it. The other usage of the register is to calculate \bgpaint{}
% parameter $\HT$ by \!\pcol@bg@textheight!, and to determine the bottom
% edge of the \bground{}s of columns and \csepgap{}s through the argument of
% \!\pcol@buildcolseprule! given by \!\pcol@ioutputelt!,
% \!\pcol@imakeflushedpage! and \!\pcol@iflushfloats!. The register is also
% referred to by \!\pcol@unvbox@cclv! to go back the last baseline of the
% main vertical list in \!\box!|255|, and by \!\pcol@deferredfootins! to let
% \!\splitmaxdepth! have its value to cap the depth of the first half of
% footnotes split from $\df$.
%
% \item[\Uidx{\!\@colht!}]
% is a \!\dimen! register to have the height of columns in a page possibly
% shrunk from \!\textheight! by \spanning. The usages of the register
% are as folllows.
%
% \begin{itemize}
% \item\begin{Sloppy}{1600}
% In \!\pcol@startpage!, \!\pcol@output@start!, \!\pcol@flushfloats! and
% \!\pcol@output@end!, it is initialized to \!\textheight!. In first two,
% the value of the register is reduced to reflect \spanning{} if exists and
% then set into $\pp^h(p)$, while the setting by the third is referred to by
% its callee \!\pcol@iflushfloats!.
% \end{Sloppy}
%
% \item
% In \!\pcol@getpelt!, \!\pcol@sync!, \!\pcol@flushcolumn!,
% \!\pcol@makeflushedpage! and \!\pcol@imakeflushedpage!, it is let have
% $\pp^h(p)$. In addition \!\pcol@sync! examines if
% $\!\@colht!<\VT+\VB+v(f)$, and \!\pcol@makefcolumn! uses it to initialize
% the room of a \fcolumn{} as well as the height of $\cc_c(\vb)$ for it.
%
% \item
% In \!\pcol@opcol!, it is used to add \!\pcol@clearcolorstack! to the
% bottom of $\cc_c(\vb)$ whose height is \!\@colht!.
%
% \item
% In \!\pcol@startcolumn!(*), \!\pcol@flushcolumn!(*) and
% \!\pcol@freshpage!, it is used to let \!\@colroom! have it.
%
% \item
% In \!\pcol@restartcolumn!(*), it is saved and restored for the use as the
% height cap of deferred footnote \!\insert!ion in \!\pcol@deferredfootins!
% because it can be shrunk by the non-deferred \Scfnote{}s.
%
% \item
% In \!\pcol@output@flush! and \!\pcol@output@clear!, it is given to
% \!\pcol@make~flushedpage! as its argument. The macro
% \!\pcol@makeflushedpage!(*) lets \!\@colht! be the argument if it is less
% than \!\@colht! and thus is given by \!\pcol@output@end!.
% \end{itemize}
%
% In addition, in the macros with `(*)' above and \!\pcol@makecol!, the
% register is passed to \!\pcol@shrinkcolbyfn! to shrink the height in it
% temporarily to keep the space required to put \Scfnote{}s in the page they
% are working on, for the reference by starred macros themselves or
% \!\@makecol! invoked in \!\pcol@makecol!.
%
% \item[\Uidx{\!\@colroom!}]
% is a \!\dimen! register to have the height of a column possibly shrunk
% from \!\@colht! by top and bottom floats. The register is initialized to
% have \!\@colht! by \!\pcol@startcolumn!, \!\pcol@output@start!,
% \!\pcol@flushcolumn! and \!\pcol@freshpage!, the last three of which also
% save it into $\cc_c(\vb^r)$. This save operation is also done by
% \!\pcol@output@switch! while restoring from it done by
% \!\pcol@restartcolumn!, but the latter macro may shrink the amount in its
% callee \!\pcol@putbackmvl! to capture a \mctext{} while the former cancel
% this shrinkage. The macros \!\pcol@output! and \!\pcol@output@start! also
% refer to this register to let \!\vsize! have it in the former and to
% calculate the room for each \colpage{} in the \spage{} in the latter. The
% macro \!\pcol@output@end! lets the register have \!\textheight! for the
% \postenv{} because the \colpage{}s above it simply precedes the stuff in
% the main vertical list. The other users \!\pcol@makefcolumn! and
% \!\pcol@makefcolelt! use this register to accumulate the total size of
% floats to be put in a \fcolumn{} temporarily.
%
% \item[\Uidx{\!\@pageht!}]
% is a \!\dimen! register to be used in \LaTeX's \!\@specialoutput! to have
% the height of \!\@holdpg!. It is referred to by \!\pcol@addmarginpar! to
% deteremine the position at which a marginal note is placed.
% We also use it as a scratchpad to have $\VP$ in \!\pcol@sync! and
% \!\pcol@measurecolumn!, and to save $\pp^h(\ptop)$ in \!\pcol@flushcolumn!
% for the reference in itself, and to do so in \!\pcol@makeflushedpage! for
% \!\pcol@imakeflushedpage!.
%
% \item[\Uidx{\!\@pagedp!}]
% is a \!\dimen! register to be used in \LaTeX's \!\@specialoutput! to have
% the depth of \!\@holdpg!. However, we use it as a scratchpad in
% \!\pcol@sync! and \!\pcol@measurecolumn! to have $\DP$, and in
% \!\pcol@output@end! to have the value to be set in \!\pcol@prevdepth!.
%
% \item[\Uidx{\!\@toproom!}]
% is a \!\dimen! register to have the room for top floats. The register is
% saved in $\cc_c(\tr)$ by \!\pcol@setcurrcol! and restored from it by
% \!\pcol@iigetcurrcol!. The macro \!\pcol@makefcolumn! uses this register
% as a flag to indicate that $\cc_c(\tl)$ of the column $c$ having
% $\cc_c(\tr)=\infty$ contains floats to be put in its last \fcolumn{}
% possibly as top floats so that it is examined by \!\pcol@flushcolumn! and
% \!\pcol@imakeflushedpage!, the former of which then lets $\cc_c(\tr)=0$ to
% mean the floats are put in a \fcolumn{} in a non-\lpage{} by the macro.
%
% \item[\Uidx{\!\@botroom!}]
% is a \!\dimen! register to have the room for bottom floats. The register
% is saved in $\cc_c(\br)$ by \!\pcol@setcurrcol! and restored from it by
% \!\pcol@iigetcurrcol!.
%
% \item[\Uidx{\!\@fpmin!}]
% is a \!\dimen! register to have $\!\floatpagefraction!\times\!\@colht!$
% being the minimum total size of floats for which an ordinary (not flushed)
% \fcolumn{} can be build. It is referred to by \!\pcol@makefcolumn! as the
% threshhold below which floats in the last \fcolumn{} can be put as top
% floats.
%
% \item[\Uidx{\!\@mparbottom!}]
% is a \!\dimen! register to have the bottom position of the last
% \!\marginpar! stuff. Its value at \beginparacol{} is referred to by
% \!\pcol@output@start! to let $\mpb_L^l$ or $\mpb_L^r$ of $\pp^m(0)$ has an
% element based on it, while the tail of one of the lists in $\pp^m(\ptop)$
% defines the value at \Endparacol{} which \!\pcol@output@end! lets the
% register have. The register is also updated by \!\pcol@getmparbottom! and
% \!\pcol@getmpbelt! to let \!\pcol@@addmarginpar! being \LaTeX's original
% \!\@addmarginpar! know the uppermost available position for the marginal
% note to be added. This update is, however, just for communicatoin betwee
% these macros and thus is ineffective for typesetting posterior to that, as
% well as the update in \!\pcol@@addmarginpar!, because whole information
% for marginal note placement is kept in $\pp^m(p)$ in $\PPP$.
%
% \item[\Uidx{\!\@textfloatsheight!}]
% is a \!\dimen! register to have the combined height of mid floats and
% their separators. It is initialize to be 0 by \!\pcol@floatplacement!,
% saved in $\cc_c(\fh)$ by \!\pcol@setcurrcol!, and restored from it by
% \!\pcol@iigetcurrcol!.
%
% \item[\Uidx{\!\dimen@!}]
% is a \!\dimen! register for temporary use. It is used in the following
% macros.
%
% \begin{itemize}
% \item
% \!\pcol@buildcolseprule!, \!\pcol@buildcselt@S! and \!\pcol@buildcselt! to
% have the argument $d\in\{\!\@maxdepth!,0\}$ of the first macro.
%
% \item
% \!\pcol@bg@paintregion@i! to have $y_1$ of $\bgr_a^{[c]}$.
%
% \item
% $\!\pcol@bias@mpbout@i!\Arg{y}\Arg{t}\Arg{b}$ to have $t$ and then $t+y$.
%
% \item
% \!\pcol@output@switch! to have the height of \prespan{} in
% \!\pcol@prespan!, or 0 if it is $\bot$.
%
% \item
% \!\pcol@sync! to have $V$ or $V-\DT+\VE$.
%
% \item
% \!\pcol@addflhd! and \!\pcol@hdflelt! to measure the height of top and
% bottom floats, \!\pcol@makecol! and \!\pcol@output@switch! to measure
% the height of \prespan{} including the top floats, and
% \!\pcol@measurecolumn! for top and bottom floats and $\VT$, $\VB$ and
% $\VP$.
%
% \item
% \!\pcol@setcolwidth@s! and \!\pcol@setcw@accumwd! to accumulate $W$ being
% the sum of natural widths of column\slash gap specifications, and then
% used by \!\pcol@setcw@calcfactors! to calculate $W/\WT$ and $W-\WT$.
% \end{itemize}
%
% \item[\Uidx{\!\dimen@ii!}]
% is a \!\dimen! register for temporary use. It is used in the following
% macros.
%
% \begin{itemize}
% \item
% \!\pcol@makecol! to measure the total height of top floats by
% \!\pcol@addflhd!.
%
% \item
% \!\pcol@bg@addext! to have
% $e=|pcol@bg@ext@|{\cdot}d{\cdot}|@|{\cdot}\{a{\cdot}|@|{\cdot}c,a\}$
%
% \SpecialArrayIndex{d{\cdot}\string\texttt{@}
% {\cdot}a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@ext@}
% \SpecialArrayIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
%
% and then $10000\PT-e$ to calculate an \bgext{} of \bgpaint.
%
% \item
% $\!\pcol@bias@mpbout@i!\Arg{y}\Arg{t}\Arg{b}$ to have $b$ and then $b+y$.
%
% \item
% \!\pcol@measurecolumn! to measure $\VT$, $\VP$ and $\DP$.
%
% \item
% \!\pcol@setcolwidth@s! and \!\pcol@setcw@accumwd! to accumulate $F$ being
% the sum of infinite stretch factors in column\slash gap specifications with
% the unit of pt, and then used by \!\pcol@setcw@calcfactors! to calculate
% $(W-\WT)/F$, where $W$ is the sum of natural widths.
%
% \item
% \!\pcol@setcw@calcfactors! to have $(W-\WT)/F$ above or 0 to be used in
% \!\pcol@def@extract@fil@iii! through \!\pcol@setcw@filunit! made
% \!\let!-equal to the register by \!\pcol@setcolwidth@s!.
% \end{itemize}
%
% \item[\Uidx{\!\@tempdima!}]
% is a \!\dimen! register for temporary use. The usages of this register
% are as follows.
%
% \begin{itemize}
% \item
% In \!\pcol@makecol! and \!\pcol@startpage!, it is used to throw
% $\pp^h(\ptop)$ away when we get it by \!\pcol@getcurrpinfo! because we
% don't need it.
%
% \item
% In \!\pcol@outputelt!, it has $\pp^h(p)$ to examine if $p$ is a \fpage.
%
% \item
% In \!\pcol@ioutputelt!, it has $\pp^h(p)$ possibly shrunk by \Scfnote{}s
% to know the \bground{}s to be painted for columns etc. After that it has
% $\w_c$ being the width of each \!\hbox! into which the \colpage{} of each
% column $c$ is put.
%
% \item
% In \!\pcol@buildcolseprule! and its callees \!\pcol@buildcselt@S! and
% \!\pcol@buildcselt!, the register has the first argment $H=\pp^h(p)$ of
% the caller macro.
%
% \item
% In \!\pcol@hfil!$\<c\>$, it has $\gap_c=|\pcol@columnsep|{\cdot}c$.
%
% \SpecialArrayIndex{c}{\pcol@columnsep}
%
% \item
% In \!\@outputpage!, it has the sum of \!\topmargin!, \!\headheight! and
% \!\headsep! being the distance between tops of imaginary page and its text
% area.
%
% \item
% In \!\pcol@startcolumn!, it is used to save \!\@colht! which can be shrunk
% temporarily by \Scfnote{}s.
%
% \item
% In \!\pcol@bg@paintregion@i!, it is let have $x_0$ of $\bgr_a^{[c]}$.
%
% \item
% In \!\pcol@output@start!, it is used to have the room for each \colpage{}
% in the \spage, and then the height-plus-depth of the \preenv.
%
% \item
% In \!\pcol@output@switch!, it is used to throw $\pp^h(p)$ away when
% we get it by \!\pcol@getcurrpinfo! because we don't need it.
%
% \item
% In \!\pcol@shiftspanning!, it is let have the left-shift amount of a
% \mctext{} in \cswap.
%
% \item
% In \!\pcol@restartcolumn!, it is used to save \!\@colht! which can be
% shrunk temporarily by \Scfnote{}s.
%
% \item
% In \!\pcol@unvbox@cclv!$\arg{ins}$, it has the depth of \!\box!|255| for
% going back to the baseline of the box, and then has the natural component
% of $\!\skip!\arg{ins}$ to add its stretch and shrink components only.
%
% \item
% In \!\pcol@addmarginpar!, at first it has the distance between left edges
% of the leftmost and current columns. Then it is let have the distance
% between top edges of the column and the marginal text to be put.
%
% \item
% In $\!\pcol@getmparbottom!\<t\>\<h\>$ and
% $\!\pcol@getmpbelt!\<t_i\>\<b_i\>$, it at first has $t$ and then is
% let have $b_i$ when the marginal note cannot be put at $t$.
%
% \item
% In \!\pcol@sync!, \!\pcol@measurecolumn! and \!\pcol@synccolumn!, it has
% $\VT$ being the maximum combined height of top floats and the main
% vertical list.
%
% \item
% In \!\pcol@makefcolumn! and \!\pcol@makefcolelt!, it has the room for
% floats to be put in a \fcolumn{}.
%
% \item
% In \!\pcol@makeflushedpage!, it has the height-plus-depth of \spanning in
% $\pp^i(\ptop)$.
%
% \item
% In \!\pcol@output@end!, at first it is let have $\VPP-H$, where $H$ is the
% height(-plus-depth) of \!\@outputbox! having the ship-out image of the
% \lpage, being the negative counterpart of the height-plus-depth of
% \spanning{} in the \lpage{} for setting $\mpbout$, and then have $H$ to be
% set in \!\pcol@bg@preposttop! for the \bgpaint{} of \postenv.
%
% \item
% In \!\pcol@setcolwidth@r!, it has
% $\!\textwidth!-(\Cto-\Cfrom-1)\!\columnsep!$ being the base of $\w_c$.
%
% \item
% In \!\pcol@setcw@getspec@i!, it is let have the natural width of a
% column\slash gap specification, to be used in \!\pcol@setcolwidth@s!,
% \!\pcol@setcw@accumwd! and \!\pcol@setcw@set!, while in the last of them
% it finally has $\w_c$ or $\gap_c$.
%
% \item
% In $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$, at first it has $y$, then
% $y/2^{k_2}$, and then $\lceil y/2^{k_2+k_3}\rceil$, where $k_2$ and $k_3$
% are scaling parameters for good approximation.
%
% \item
% In \!\pcol@switchcol!, it is let have what \!\pcol@ensurevspace! has so
% that the dimensional expression in it is evaluated in the macro and the
% evaluateion result is assigned to $\VE=\!\pcol@@ensurevspace!$.
%
% \item
% In $\!\ensurevspace!\ARg{space}$, it is let have $\arg{space}$ to ensure
% the argument is a dimension including forced one.
%
% \item
% In \!\pcol@fntextbody!, it has the height-plus-depth of the \!\vbox! in
% which the footnote is encapsulated.
%
% \item
% In \!\pcol@set@color@push!, it has the width of the \!\vbox! to be
% \!\insert!ed, which is $m$\,|sp| for a math-mode push of $\mcelt_{i,m}$ or
% 0 for a non-math one $\celt_i$.
%
% \item
% In $\!\pcol@bg@defext!\Arg{d}\Arg{e}$, it is let have $e$ to confirm $e$
% is a proper dimension.
% \end{itemize}
%
% \item[\Uidx{\!\@tempdimb!}]
% is a \!\dimen! register for temporary use. The usages of this register
% are as follows.
%
% \begin{itemize}
% \item
% In \!\pcol@makecol!, it is used to measure the height-plus-depth $h_i$ of
% decapsulated \!\box!|255| and its original form to add an element
% $\spt(H_i,h_i)$ to $\pp^s(\ptop)$ for a \mctext{} captured in the box.
%
% \item
% In \!\pcol@ioutputelt!, if has the height-plus-depth of \spanning{}
% $\pp^b(q)$ to be temporarily added to \!\topmargin!.
%
% \item
% In \!\pcol@buildcolseprule! it has $H_0+h_0$, while in its callee
% $\!\pcol@buildcselt!\<H_i\>\~\<h_i\>$ it has $H_{i-1}+h_{i-1}$ and then
% $H_i+h_i$ where $\spt(H_i,h_i)\in\pp^s(p)$.
%
% \item
% In \!\pcol@bg@paintregion@i!, it is let have $y_0$ of $\bgr_a^{[c]}$.
%
% \item
% In \!\pcol@output@switch!, it is let have the height-plus-depth $h_i$ of
% \!\@holdpg! having a \mctext{} to add an element $\spt(H_i,h_i)$ to
% $\pp^s(\ptop)$.
%
% \item
% In \!\pcol@shrinkcolbyfn!, it is let have the inverse of the \!\skip!
% component of the argument \!\insert! register of the macro, so that in
% \!\pcol@startcolumn! and \!\pcol@restartcolumn! it has that of $\pp^f(p)$
% if $p$ has \Scfnote{}s, or 0 otherwise, and then is referred to by
% \!\pcol@deferredfootins! which then lets the register have the height cap
% of $\df$ splitting.
%
% \item
% In \!\pcol@addmarginpar!, \!\pcol@getmparbottom! and \!\pcol@getmpbelt!,
% it is let have the vertical space to be occupied
% by the marginal text to be put, being the second argument of
% \!\pcol@getmparbottom!.
%
% \item
% In \!\pcol@sync! and \!\pcol@measurecolumn!, it has $\VB$ and then, in the
% former, it has $\VP+v(f)$, $\VT$ or $\VT+\VB+v(f)$ according to the
% contents of the page to be \sync{}ed.
%
% \item
% In \!\pcol@makefcolelt!, it has the size of vertical space consumed by a
% float.
%
% \item
% In \!\pcol@synccolumn!, it has $\VT-\vc(t)$ being the vertical space from
% the bottom of $\cc_c(\vb^b)$ to the \sync{}ation point. If the
% \sync{}ation point is defined by a column without main vertical list but
% with top floats, then the register is let have
% $\VT-\vc(t)+\!\textfloatsep!-\!\floatsep!+10000\,|pt|$ to be set in
% $\cc_c(\tf)=\!\pcol@textfloatsep!$ as the space below the \mvlfloat{}
% biased by 10000\,|pt| to indicate the last float is the \mvlfloat{}.
%
% \item
% In \!\pcol@setcolwidth@r!, it has
% $\!\textwidth!-(\Cto-\Cfrom-1)\!\columnsep!-\sum_{d=0}^{k-1}w_d$ being the
% base of $\w_c$ for $c\In{\Cfrom{+}k}{\,\Cto}$ where $k$ is the number of
% fractions given in the argument of \!\columnratio!.
%
% \item
% In $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$, at first it is let have $x$,
% then $x\cdot2^{k_1}$, then
% $z'=\break\lfloor(x\cdot2^{k_1})/\lceil{}y/2^{k_2+k_3}\rceil\rfloor$, and
% finally
% $Z=z\times1\,|pt|=z'\cdot2^{16-k}$ referred to by
% \!\pcol@setcw@calcfactors! as $\phi_f=(\WT-W)/F$, where $k_1$, $k_2$ and
% $k_3$ are scaling parameters for good approximation and $k=k_1+k_2+k_3$.
%
% \item
% In \!\pcol@extract@fil@ii! and \!\pcol@extract@fil@iii!, it is let have
% the infinite stretch factor of a column\slash gap specification
% represented with the unit \!\pcol@setcw@filunit!, to be used in
% \!\pcol@setcolwidth@s!, \!\pcol@setcw@accumwd!, and \!\pcol@setcw@set!.
%
% \item
% In \!\pcol@fntextbody!, it has $\!\textheight!-\!\skip!\!\footins!$ as the
% cap of the footnote.
% \end{itemize}
%
%
% \item[\Uidx{\!\@tempdimc!}]
% is a \!\dimen! register for temporary use. It is let have values as
% follows.
%
% \begin{itemize}
% \item
% $H_i-(H_{i-1}+h_{i-1})$ in $\!\pcol@buildcselt!\<H_i\>\<h_i\>$.
%
% \item
% $x_1$ of $\bgr_a^{[c]}$ in \!\pcol@bg@paintregion@i!.
%
% \item
% $t+h$ in $\!\pcol@getmparbottom!\<t\>\<h\>$.
%
% \item
% $\max(t,b_{i-1})+h$ in $\!\pcol@getmpbelt!\<t_i\>\<b_i\>$ invoked from
% $\!\pcol@getmparbottom!\<t\>\~\<h\>$.
%
% \item
% $\DT$ in \!\pcol@sync!, \!\pcol@measurecolumn! and \!\pcol@synccolumn!.
%
% \item
% \!\floatsep! or \!\@fpsep! in \!\pcol@makefcolumn! and
% \!\pcol@makefcolelt!.
%
% \item
% $\w_c$ being the width of column $c$ in \!\pcol@setcolwidth@r!.
%
% \item
% $\WT-W$ in \!\pcol@setcw@calcfactors!.
%
% \item
% At first for calculation of $y/2^{k_2}$ and then $z'/2^k\approx x/y$
% in $\!\pcol@setcw@calcf!\<x\>\<y\>\~\<z\>$ where $k_2$ and $k$ are scaling
% parameters for good approximation.
% \end{itemize}
% \end{description}
%
%
%
% \subsubsection{Skip Registers}
%
% \begin{description}
% \item[\Uidx{\!\baselineskip!}]
% is \TeX's primitive register to have the vertical skip to separate
% adjacent baselines. It is referred to by \!\pcol@output! and
% \!\pcol@output@start! to examine if \!\@colroom! is unexpectedly small,
% and by \!\pcol@switchcol! to give it to \!\ensurevspace! to let
% \!\pcol@ensurevspace! have the default value.
%
% \item[\Uidx{\!\topskip!}]
% is \TeX's primitive register to have the vertical skip from the top edge
% of a page to the baseline of its first vertical item. It is let be 0 by
% \!\pcol@output@start! if we have \preenv{} and is saved in $\pp^t(0)$,
% while \!\pcol@startpage! lets it be \!\pcol@topskip!, into which
% \!\pcol@zparacol! saves the value outside \env{paracol} environment,
% saving the value in $\pp^t(p)$. Then the register is restored from
% $\pp^t(p)$ by \!\pcol@getpelt! and \!\pcol@sync!, while
% \!\pcol@synccolumn! refers to the value restored by the latter to adjust a
% \sync{}ation point. The macro \!\pcol@putbackmvl! lets the register have
% 0 when it starts a \mctext{} because it originally follows \prespan{} in
% the \colpage{} to be restarted rather than at the page top. The macro
% \!\pcol@output@end! temporarily lets the register have 0 if we have
% non-empty columns in the last page, while \!\endparacol! restores it from
% \!\pcol@topskip! for the pages outside \env{paracol} environmnet.
%
% \item[\Uidx{\!\splittopskip!}]
% is \TeX's primitive register to have the vertical skip inserted at the
% beginning of the second half of the box split by \!\vsplit! or \TeX's
% internal operation for splitting an \!\insert! at a page break. The
% register is temporarily let have 0 by \!\pcol@deferredfootins! when it
% splits $\df$ so that the second half does not have any skip at the top.
% The register is also let have \!\footnotesep! in \!\pcol@fntextbody! for
% footnote typesetting.
%
% \item[\Uidx{\!\parskip!}]
% is \TeX's primitive register to have the vertical skip inserted above each
% paragraph. It is referred to by \!\pcol@zparacol! to nullify the
% insertion going to be made by the first \!\item! of a \env{list}-like
% environment, when the macro finds the \env{paracol} environment to start
% is at the very beginning of a \env{list}-like environment.
%
% \item[\Uidx{\!\fill!}]
% is an API \!\skip! register to have a skip 0\,|pt| |plus| 1\,|fill|. In
% our macros, however, it is used as a keyword in \!\pcol@setcw@getspec!,
% \!\pcol@setcw@getspec@i! and \!\pcol@setcw@fill! to extract the infinite
% stretch factor $f$ given as $f\!\fill!$ in the specification.
%
% \item[\Uidx{\!\itemsep!}]
% is an API \!\skip! register to have the vertical skip inserted above each
% non-first \!\item! in \env{list}-like environments. It is referred to by
% \!\pcol@zparacol! to nullify the insertion going to be made by the first
% \!\item! of a \env{list}-like environment, when the macro finds the
% \env{paracol} environment to start is at the very beginning of a
% \env{list}-like environment.
%
% \item[\Uidx{\!\floatsep!}]
% is an API \!\skip! register to have the vertical skip between adjacent floats.
% It is referred to by \!\pcol@cflt! to cancel the skip following the last
% float, by \!\pcol@makefcolumn! to let \!\pcol@makefcolelt! examine the
% capacity of a \fcolumn{} in the \lpage, by \!\pcol@addflhd! and
% \!\pcol@hdflelt! to measure the total height of top and bottom floats,
% and by \!\pcol@sync! to calculate the space below the \mvlfloat.
%
% \item[\Uidx{\!\textfloatsep!}]
% is an API \!\skip! register to have the vertical skip between the main
% vertical list and top\slash bottom floats. It is referred to by
% \!\pcol@output@start! to calculate the room for each \colpage{} in the
% \spage{} with bottom floats in the \preenv{}, by \!\pcol@combinefloats! to
% insert a skip below the bottom floats in the \preenv{} and \lpage{},
% by \!\pcol@measurecolumn! to take this skip into account in the
% calculation of $\VPP$, by \!\pcol@addflhd! to measure the vertical space
% for top and bottom floats, and by \!\pcol@synccolumn! to calculate the
% \sync{}ation point for columns with top floats.
%
% \item[\Uidx{\!\dblfloatsep!}]
% is an API \!\skip! register to have the vertical skip between adjacent
% \pwise{} floats, and is used in \!\pcol@startpage! to cancel the skip
% below the last float.
%
% \item[\Uidx{\!\dbltextfloatsep!}]
% is an API \!\skip! register to have the vertical skip between the last
% \pwise{} float and the top of columns, and is used in
% \!\pcol@startpage! to put the skip.
%
% \item[\Uidx{\!\@topsep!}]
% is a \!\skip! register to have the vertical skip inserted above the first
% \!\item! of a \env{list}-like environment. The actual value is determined
% by \!\@trivlist! from API parameters \!\topsep!, \!\partopsep! and
% \!\parskip! depending on how the environment appears. The skip in the
% register is inserted by \!\pcol@zparacol! when it finds the \env{paracol}
% environment to start is at the very beginning of a \env{list}-like
% environment.
%
% \item[\Uidx{\!\@fptop!}]
% is a \!\skip! register to have the vertical skip inserted at the top of
% a \fcolumn, and is used in \!\pcol@makefcolpage!.
%
% \item[\Uidx{\!\@fpsep!}]
% is a \!\skip! register to have the vertical skip between adjacent floats
% in a \fcolumn, and is used in \!\pcol@makefcolpage!.
%
% \item[\Uidx{\!\@fpbot!}]
% is a \!\skip! register to have the vertical skip inserted at the bottom of
% a \fcolumn, and is used in \!\pcol@makefcolpage!.
%
% \item[\Uidx{\!\@tempskipa!}]
% is a \!\skip! register for temporary use. It is used in the following
% macros.
%
% \begin{itemize}
% \item
% \begin{Sloppy}{2400}%
% \!\pcol@makecol!, \!\pcol@startpage!, \!\pcol@outputelt!,
% \!\pcol@output@switch!, \!\pcol@flushcolumn! and \!\pcol@makeflushedpage!
% to throw $\pp^t(p)$ away because we don't need it.
% \end{Sloppy}
%
% \item
% \!\pcol@output@start! to determine \!\topskip! for the \spage.
%
% \item
% \!\pcol@setcw@getspec@i! and \!\pcol@setcw@fill! to have the width
% specification of a column or gap.
% \end{itemize}
% It is also used in the top level invocation of \!\pcol@defkw! with a glue
% of $0\,|pt|\ |plus|\ 1\,|fil|\~\ |minus|\ 1\,|fil|$.
% \end{description}
%
%
%
% \subsubsection{Box Registers}
%
% \begin{description}
% \item[\Uidx{\!\strutbox!}]
% is an API \!\box! register to have the strut for the current font size.
% It is used in \!\pcol@fntextbody!\marg{text} to let \!\splitmaxdepth! have
% its depth, and to let the last line of the footnote $\arg{text}$ have its
% depth at shallowest.
%
% \item[\Uidx{\!\@cclv!}]
% is a \!\box! register but \TeX{} defines that it has the main vertical
% list when \!\output! routine is invoked. It is referred to by
% \!\pcol@makecol! when it has a broken \mctext{} to measure its
% height-plus-depth for the element to be added to $\pp^s(\ptop)$ and to
% update it combining its contents with \prespan{} optionally shifting it
% left by passing the register to \!\pcol@shiftspanning!. The macro also
% uses the register together with its callee \!\pcol@unvbox@cclv! to add
% stretch\slash shrink factor of \!\skip!\!\footins! at its bottom for a
% \colpage{} in a page having \Scfnote{}s. The macro \!\pcol@specialoutput!
% examines the register to discard the dummy \!\vbox! inserted in it by
% \!\pcol@invokeoutput!. The other users \!\pcol@output@start!,
% \!\pcol@makenormalcol!, \!\pcol@flushcolumn! and \!\pcol@imakeflushedpage!
% let the register have the main vertical list of \preenv{} or a column to
% be passed to \!\@makecol!, and \!\pcol@flushcolumn! also takes care the
% skip above \Scfnote{}s.
%
% \item[\Uidx{\!\voidb@x!}]
% is a \!\box! register to be void ($\bot$) always. It is used to
% initialize \!\pcol@prespan! and \!\pcol@rightpage! at their declaration,
% and is referred to by the following macros.
%
% \begin{itemize}
% \item
% \!\pcol@makecol! to make \!\pcol@currfoot! void unless \Scfnote{}s in
% \!\foot~ins! is saved into $\pp^f(p)$.
%
% \item
% \!\pcol@startpage! to let
% $\pp^i(\ptop)=\bot$ if the new \tpage{} does not have \spanning{} and
% $\pp^f(\ptop)=\bot$ for all \fpage{}s and the new \tpage.
%
% \item
% \!\pcol@outputelt! to initialize \!\@outputbox!.
%
% \item
% \!\pcol@ioutputelt! to examine if $\S_c$ is empty.
%
% \item
% \!\pcol@output@start! to let $\pp^f(0)=\bot$, and $\Celt^c=\bot$ if
% $\Celtshadow^c$ is undefined.
%
% \item
% \!\pcol@output@switch! to let $\cc_c(\ft^b)=\bot$ if the column does
% not have \Mcfnote{}s.
%
% \item
% \!\pcol@getcurrfoot! to let \!\footins! be void if so.
%
% \item
% \!\pcol@setcurrcolnf! to let $\cc_c(\ft^b)=\bot$ because the column $c$
% does not have \Mcfnote{}s.
%
% \item
% \!\pcol@putbackmvl! to let $\!\pcol@prespan!=\bot$ if a \mctext{} really
% starts from the top of a \colpage, and $\csts=\bot$ if the \colpage{}
% $\cc_c(\vb)$ to be restarted is non-empty.
%
% \item
% \!\pcol@savecolorstack! to let $\csts=\bot$ or its first item be $\bot$ if
% $\CST^c$ or $\Celt^c$ is $\bot$, resepectively.
%
% \item
% \!\pcol@savefootins! to let its argument macro have a void box if
% \!\@freelist! is exhausted.
%
% \item
% \!\pcol@makeflushedpage! to initialize \!\@outputbox! and
% \!\pcol@rightpage! to be $\bot$ if the flushed page does not have
% \spanning{}, and to let $\pp^f(\ptop)=\bot$ after putting it in the
% \lpage{} so that \!\pcol@output@end! will be unaware of the \scfnote{} and
% non-\Mgfnote{}s.
%
% \item
% \!\pcol@flushfloats! to let $\!\pcol@rightpage!=\bot$ if \parapag{}ing is
% not in effect.
%
% \item
% \!\pcol@output@end! to let $\!\pcol@rightpage!=\bot$ if
% the last page has nothing other than \spanning{} being \pwise{} floats
% and thus we don't have the right \parapag{}e. The macro also lets
% $\Celt^c=\bot$ for all $c$ and $\cst=\bot$.
%
% \item
% \!\pcol@com@flushpage! and \!\pcol@com@clearpage! gives the void box to
% \!\pcol@flushclear! as its argument to mean these macros are only aware
% of \CSIndex{ifpcol@flush} as the result of \pfcheck. The macro
% \!\endparacol! also does that if the footnote typesetting is \mgfnote.
% \end{itemize}
%
% \item[\Uidx{\!\@holdpg!}]
% is a \!\box! register to have the main vertical list when \!\output! is
% invoked with a special \!\penalty! code. It is let have that by
% \!\pcol@specialoutput!, and is referred to by \!\pcol@output@start! and
% \!\pcol@makenormalcol! for \preenv{}, and by \!\pcol@output@switch! for the
% column from which we are leaving.
%
% \item[\Uidx{\!\@outputbox!}]
% is a \!\box! register to have a partial or the complete ship-out image
% of a column or a page. The usages of the register are as follows.
%
% \begin{itemize}
% \item
% In \!\pcol@@makecol!, it has a \colpage{} made by \!\@makecol! for
% \!\pcol@flush~column! and \!\pcol@imakeflushedpage!.
%
% \item
% In \!\pcol@combinefloats!, it has a \colpage{} to which top and bottom
% floats are combined.
%
% \item
% In \!\pcol@cflt!, it has a \colpage{} to which top floats are combined.
%
% \item
% In \!\pcol@opcol!, it has the complete \colpage{} built by \!\@makecol!.
%
% \item
% In \!\pcol@startpage!, it has the complete \fpage{} built by \!\@tryfcolumn!.
%
% \item
% In \!\pcol@outputelt!, it has the complete (left parallel-) page to be
% shipped out by \!\@outputpage!.
% \Index{parallel-paging}
%
% \item
% In \!\pcol@outputpage@r!, it is temporarily made \!\let!-equal to
% \!\pcol@rightpage! so that the box is shipped out by \!\pcol@@outputpage!
% being \LaTeX's \!\@outputpage! instead of the real \!\@outputbox!.
%
% \item\begin{Sloppy}{1700}
% In \!\pcol@output@start!, it has the \preenv{} built by
% \!\pcol@makenormalcol!.
% \end{Sloppy}
%
% \item
% In \!\pcol@combinefootins!, it is let have the \preenv{} with footnotes.
%
% \item
% In \!\pcol@flushcolumn!, it has a flushed \colpage{} built by \!\@makecol!
% or a \fcolumn{} built by \!\@makefcolumn!.
%
% \item
% In \!\pcol@output@flush! and \!\pcol@output@clear!, it has a flushed page
% built by \!\pcol@makeflushedpage! and \!\pcol@imakeflushedpage! in which
% it has each of flushed \colpage{} built by \!\@makecol!.
%
% \item
% In \!\pcol@flushfloats!, it has the complete (left parallel) page for
% flushed \fcolumn{}s.
%
% \Index{parallel-paging}
%
% \item
% In \!\pcol@iflushfloats!, it has a \fcolumn{} built by
% \!\pcol@makefcolumn!.
%
% \item
% In \!\pcol@output@end!, it has the ship-out image of the \lpage{} of a
% \env{paracol} environment built by \!\pcol@makeflushedpage! and
% \!\pcol@imakeflushedpage!.
% \end{itemize}
%
% \item[\Uidx{\!\@tempboxa!}]
% is a \!\box! register for temporary use. The usages of the register are
% as follows.
%
% \begin{itemize}
% \item
% In \!\pcol@makecol!, it is used to decapsulate \!\box!|255| containing a
% broken \mctext{}. In the macro and \!\pcol@output@switch!, it is also
% used as a waste bascket to make \!\footins! void when it contains
% \Scfnote{}s in a non-\tpage.
%
% \item\begin{Sloppy}{2100}
% In \!\pcol@cflt! and \!\pcol@startpage!, it has top column-\slash
% \pwise{} floats combined by the application of
% \!\@comflelt!\slash\!\@comdblflelt! to \!\@toplist!\slash\!\@dbltoplist!
% respectively.
% \end{Sloppy}
%
% \item
% In \!\pcol@phantom!$\<b\>$, it has an empty box whose height and depth are
% equal to those of the argument box $b$.
%
% \item
% By \!\pcol@buildcolseprule! and its callees \!\pcol@buildcselt@S! and
% \!\pcol@buildcselt!, it is let have the painted \bground{}s for columns,
% \csepgap{}s and \mctext{}s in a page, and then is put into the ship-out
% image of the page by \!\pcol@ioutputelt!, \!\pcol@imakeflushedpage! or
% \!\pcol@iflushfloats!.
%
% \item
% In \!\@outputpage!, it is let have the painted \bground{} of the right
% page referred to by its callee \!\pcol@outputpage@r!.
%
% \item
% In $\!\pcol@bg@paint@i!\Arg{body}$, it is let have painted \bground{}s
% built by $\arg{body}$.
%
% \item
% In $\!\pcol@bg@paintregion!\arg{a}\arg{c}$, it is let have painted
% \bground{} of the region $\bgr_a^{[c]}$.
%
% \item
% In \!\pcol@specialoutput!, it is used to discard the dummy \!\vbox! put by
% \!\pcol@invokeoutput!.
%
% \item
% In \!\pcol@makenormalcol!, it is used to save \!\footins! into it and make
% it $\bot$ temporarily to exclude \mgfnote{} footnotes from \spanning{} for
% \preenv.
%
% \item
% In \!\pcol@ifempty!$\arg{box}\arg{then}\arg{else}$, it is used to examine
% if $\arg{box}$ is empty.
%
% \item
% In $\!\pcol@scancst!\arg{box}$ and \!\pcol@iscancst!, it is used to have
% what $\cst$ or $\csts$ has after the scan of $\arg{box}\in\{\cst,\csts\}$.
%
% \item
% In \!\pcol@savecolorstack!, it is used to have the \!\vbox! for $\Celt^c$
% to be placed at the top of $\csts$.
%
% \item
% In \!\pcol@deferredfootins!, it is used to have the first half split from
% $\df$ being the deferred footnotes to be \!\insert!ed.
%
% \item
% In \!\pcol@fntextbody!\marg{text}, it is used to encapsulate $\arg{text}$
% in it.
%
% \item
% In \!\pcol@icolumncolor!, it is used to have a \!\vbox! to be \!\insert!ed
% for the update of $\Celt^c$.
%
% \item
% In \!\pcol@set@color@push!, it is used to have a \!\vbox! to be \!\insert!ed
% to push $\celt_i$ or $\mcelt_{i,m}$ to $\cstraw$.
%
% \item
% In \!\pcol@reset@color@pop! and \!\pcol@reset@color@mpop!, it is used to
% have a \!\vbox! to be \!\insert!ed to add $\celtpop_i$ or
% $\mceltpop_{i,m}$ to $\cstraw$.
% \end{itemize}
% \end{description}
%
%
%
% \subsubsection{Token Registers}
%
% \begin{description}
% \item[\Uidx{\!\output!}]
% is \TeX's primitive to have \!\output! routine. It is let have
% \!\pcol@output! as its sole token by \!\pcol@zparacol!.
%
% \item[\Uidx{\!\everypar!}]
% is \TeX's primitive to have tokens inserted at the beginning of each
% paragarph. In \!\pcol@sptext! and \!\pcol@com@endcolumn!, it is
% \!\global!ized to keep its contents after the end of a group. In
% \!\pcol@output@switch!, its contents are broadcasted to $\cc_c(\ep)$ for
% all $c\In0\C$ if columns are \sync{}ed with a \mctext. Then these values
% or that simply given in a column are saved into $\cc_c(\ep)$ by
% \!\pcol@setcurrcol!, and then restored from it by \!\pcol@iigetcurrcol!.
%
% \item[\Uidx{\!\everyvbox!}]
% is \TeX's primitive to have tokens inserted at the beginning of each
% \!\vbox!. In \!\pcol@zparacol!, after tokens in it are saved into
% \!\pcol@everyvbox!, it is let have a \!\the!-reference to
% \!\pcol@everyvbox! and |\pcol@innertrue| to turn
% $\CSIndex{ifpcol@inner}=\true$, and then the register itself is made
% \!\let!-equal to \!\pcol@everyvbox!. In addition, it is let have tokens
% in \!\pcol@everyvbox! if a \!\global! assignment to the register is made
% in the \env{paracol} just having been closed. Another usage of this
% register is to insert a painted page \bground{} to the \!\vbox! to be
% \!\shipout! by \!\pcol@@outputpage! being \LaTeX's \!\@outputpage!, and is
% used for this purpose by \!\pcol@outputpage@l! and \!\pcol@outputpage@r!,
% and by \!\pcol@outputpage@ev! to nullify this special function for other
% inside \!\vbox!es.
%
% \item[\Uidx{\!\@temptokena!}]
% is a \!\toks! register for temporary use. It is used in
% \!\pcol@output@switch! to broadcast \!\everypar! to $\cc_c(\ep)$ for all
% $c\In0\C$.
%
% \end{description}
%
%
%
% \subsubsection{Switches}
%
% \begin{description}
% \item[\Uidx{\CSIndex{if@twocolumn}}]
% is a switch to be $\true$ iff multi-column pages are being typeset. It is
% turned $\true$ by \!\pcol@zparacol!, and then turned $\false$ by
% \!\endparacol!. In addition, it is turned $\false$ when \!\pcol@output!
% finds that the \!\output! request for a page break outside \env{paracol}
% is sneaked into our own \!\output! routine, in order to avoid that
% \LaTeX's original \!\output! routine misunderstands it is working on a
% two-columned document. The switch is examined by \LaTeX's own macros
% including old \!\end@dblfloat! kept in our own \!\pcol@end@dblfloat!. It
% is also examined by \!\pcol@zparacol! before being turned $\true$ to
% ensure it is $\false$ or to complain about the inappropriateness otherwise.
%
% \item[\Uidx{\CSIndex{if@firstcolumn}}]
% is a switch to be $\true$ iff the first column is being typeset. Its
% truth value is determined by \!\pcol@addmarginpar! to tell
% \!\pcol@@addmarginpar!, \!\pcol@getmparbottom@i! and \!\pcol@setmpbelt@i!
% the margin which a marginal note goes to.
%
% \item[\Uidx{\CSIndex{if@twoside}}]
% is a switch to be $\true$ iff two-sided page typesetting is in effect and
% thus even numbered page may have their own left margins, headers and
% footers different from those for odd numbered pages. Besides the
% initialization by the main class file such as \textsf{article.cls}
% according to the class option |twoside|, the switch is \!\global!ly turned
% $\false$ by \!\pcol@twosided! for the case in which API macro \!\twosided!
% does not have `|p|' in its optional argument, and then \!\global!ly turned
% $\true$ by \!\pcol@twosided@p! which is invoked when the argument contains
% `|p|', or the API macro does not have the argument at all. Then the
% switch is referred to by \!\pcol@outputpage@l!, \!\pcol@outputpage@r! and
% \!\pcol@bg@swappage! to decide the left margin of even numbered pages,
% i.e., \!\evensidemargin! if the switch is $\true$ or \!\oddsidemargin!
% otherwise. The switch is also referred to by \!\pcol@com@cleardoublepage!
% to have a blank page if the switch is $\true$ and the command
% \!\cleardoublepage! is used in an odd-numbered page.
%
% \item[\Uidx{\CSIndex{if@reversemargin}}]
% is a switch to be $\true$ iff \!\reversemarginpar! is specified to reverse
% the side which marginal notes go to. It is examined by
% \!\pcol@addmarginpar! as a factor to decide the margin which a marginal
% note goes to, and by \!\pcol@do@mpbout@i! for the same purpose but for
% marginal notes in pre-environment or \postenv.
%
% \Index{pre-environment stuff}
%
% \item[\Uidx{\CSIndex{if@mparswitch}}]
% is a switch to be $\true$ iff it is specified by, for example,
% \texttt{twoside} option of a class such as \textsf{article}, that marginal
% notes in even numbered pages go to thier left margin. It is examined by
% \!\pcol@do@mpbout@i! as a factor to decide the margin which a maginal note
% goes to in pre-environment or \postenv{}.
%
% \Index{pre-environment stuff}
%
% \item[\Uidx{\CSIndex{if@nobreak}}]
% is a switch to be $\true$ iff the last paragraph is for a sectioning
% command. The switch is saved into $\cc_c(\sw)$ together with
% \CSIndex{if@afterindent} by \!\pcol@setcurrcol!, and then restored from
% it by \!\pcol@iigetcurrcol!. The macro \!\pcol@output@switch! refers to
% it to broadcast its value set by a \mctext{} to $\cc_c(\sw)$ for all
% $c\In0\C$, while \!\pcol@output@start! and \!\pcol@restartcolumn! insert
% $\!\penalty!=10000$ by \!\nobreak! if the switch is $\true$. This
% conditional \!\nobreak! is also done by \!\pcol@icolumncolor!,
% \!\pcol@set@color@push!, \!\pcol@reset@color@pop! and
% \!\pcol@reset@color@mpop! to avoid a break after an \!\insert!. The macro
% \!\pcol@zparacol! also exmaines the switch, but with the truth value in it
% given outside \env{paracol} environment, to invoke \!\@nbitem! if $\true$
% when the macro finds the \env{paracol} environment to start is at the very
% beginning of a \env{list}-like environment.
%
% \item[\Uidx{\CSIndex{if@newlist}}]
% is a switch to be $\true$ in the duration after a \env{list}-like
% environment starts and until its first \!\item! appears. The switch is
% examined by \!\pcol@zparacol! to know if the \env{paracol} environment to
% start is at the very beginning of a \env{list}-like environment and, if
% so, is turned $\false$ by the macro after it inserts vertical skips
% pretending the first \!\item! is given.
%
% \item[\Uidx{\CSIndex{if@inlabel}}]
% is a switch to be $\true$ in the duration after an \!\item! appears and
% until its first paragraph is given. The switch is examined by
% \!\pcol@zparacol! together with \CSIndex{if@newlist} to know if the
% \env{paracol} environment to start is at the very beginning of a
% \env{list}-like environment ($\false$) and not \env{trivlist}-like one
% ($\true$).
%
% \item[\Uidx{\CSIndex{if@afterindent}}]
% is a switch to be $\true$ iff a sectioning commmand tells that the fisrt
% paragraph following it is to be indented. The switch is saved into
% $\cc_c(\sw)$ together with \CSIndex{if@nobreak} by \!\pcol@setcurrcol!,
% and then restored from it by \!\pcol@iigetcurrcol!. The macro
% \!\pcol@output@switch! refers to it to broadcast its value set by a
% \mctext{} to $\cc_c(\sw)$ for all $c\In0\C$.
%
% \item[\Uidx{\CSIndex{if@fcolmade}}]
% is a switch to be $\true$ iff a \fcolumn{} or \fpage{} is built by
% \!\@tryfcolumn! or \!\@makefcolumn!. The value is set by \!\@tryfcolumn!
% for $\cc_c(\dl)$ is referred to by \!\pcol@output!, \!\pcol@startcolumn!
% and \!\pcol@freshpage!, while that for \!\@dbldeferlist! is referred to by
% \!\pcol@startpage!. The value set by \!\@makefcolumn! for $\cc_c(\dl)$ is
% referred to by \!\pcol@flushcolumn!, while that for \!\@dbldeferlist! is
% referred to by \!\pcol@output@clear!. The macros \!\pcol@flushfloats! and
% \!\pcol@iflushfloats! also refer to the switch to build pages having only
% \fcolumn{}s and turn the switch $\true$ or $\false$ by themselves to know
% such paegs are still to be built or not. The macro \!\pcol@output@end!
% also turns the switch $\true$ if a \lpage{} will be followed by page(s)
% having \fcolumn{}s to tell that to \!\pcol@flushfloats!.
%
% \item[\Uidx{\CSIndex{if@tempswa}}]
% is a switch for temporary use. The usages of the switch are as follows.
%
% \begin{itemize}
% \item
% In \!\pcol@checkshipped!, it is turned $\true$ iff $\S_c$ for all
% $c\In0\C$ have \colpage{}s to be shipped out, and then it is examined by
% \!\pcol@opcol!.
%
% \item
% In \!\pcol@nextpage! and \!\pcol@nextpelt!, it is $\true$ until
% \!\pcol@nextpelt! finds the first $q$ such that $q>p$ and
% $\pp^h(q)\geq0$ to mean $q$ is not for a \fpage{}, so that we let $p=q$
% to skip \fpage{}s following to the old $p$ if any.
%
% \item
% In \!\pcol@outputcolumns! and \!\pcol@outputelt!, it is $\true$ until
% \!\pcol@outputelt! finds the first $q$ such that $q\geq\pbase$ and
% $\pp^h(q)\geq0$ to mean $q$ is not for a \fpage{}, and the arguemnt of
% \!\pcol@outputcolumns! is 0 to mean that it is not for page flushing, so that
% we ship out $q$ and all \fpage{}s following it if any.
%
% \item
% In \!\@outputpage! it is let have the value of \CSIndex{ifpcol@bg@painted}
% indicating if \bgpaint{} for the left page is done, and then it is
% examined by \!\pcol@outputpage@l! to determine whether the \bground{} is
% put into the final ship-out image.
%
% \item
% In \!\pcol@makenormalcol!, it is $\true$ iff the footnotes in \preenv{} is
% included in \!\@outputbox! which the macro builds.
%
% \item
% In \!\pcol@output@switch!, at first it holds \CSIndex{if@nobreak} of the
% \mctext{} if columns are \sync{}ed with it to broadcast
% \CSIndex{if@nobreak} to all $\cc_c(\sw)$. Then it is turned $\true$ iff
% $\CSIndex{ifpcol@sync}=\true$ for \sync{}ation or
% $\CSIndex{ifpcol@clear}={\true}$ for flushing, so as to invoke
% \!\pcol@sync!. And finally, it is turned $\true$ iff
% $\CSIndex{ifpcol@clear}={\false}$ or $\CSIndex{ifpcol@sync}=\true$, so as
% to invoke \!\pcol@restartcolumn!.
%
% \item
% In \!\pcol@restartcolumn!, it is turned $\true$ iff footnote typesetting
% is \scfnote{} and $p<\ptop$.
%
% \item
% In \!\pcol@scancst!, it is initialized to be $\true$. Then it is referred
% to by \!\pcol@iscancst! for each $\celt\in\cstraw$ to update $\Celt^c$ and
% then turned $\false$ when the first one is found.
%
% \item
% In \!\pcol@savecolorstack!, it is $\true$ iff either $\cst\neq\bot$ or
% $\Celt^c\neq\bot$, i.e., $\CST^c$ to be saved is not $\bot$.
%
% \item
% In \!\pcol@getmparbottom!, it is intialized to be $\false$ and then may be
% turned $\true$ by \!\pcol@getmpbelt! if it finds a gap between two marginal
% notes to accommodate that to be added, and then examined by
% \!\pcol@getmparbottom! to know the fact.
%
% \item
% In \!\pcol@sync!, it is turned $\true$ iff the \sync{}ed or flushed page
% can be built by \!\pcol@synccolumn!.
%
% \item
% In \!\pcol@makefcolumn! having non-empty $\cc_c(\tl)$, it is turned
% $\false$ iff the macro is acting on a column in the \lpage{}, $\cc_c(\dl)$
% is emptied by the macro itself, and the total size of the floats to be put
% in the \fcolumn{} being built by the macro is less than \!\@fpmin!, to
% mean it is possible that the floats in $\cc_c(\tl)$ is put in the
% \fcolumn{} as top floats.
%
% \item
% In \!\pcol@measurecolumn! and \!\pcol@addflhd!, it is set to be $\false$
% iff both top floats and the main vertical list are empty, so that
% \!\pcol@measureupdate! examines it for the update of $\VT$ and $\DT$.
% Then it is kept $\false$ iff both of footnotes and bottom floats are
% empty, so that \!\pcol@measurecolumn! examines it for the update of $\VP$
% and \!\pcol@measureupdate! does for $\VPP$ and $\DP$.
%
% \item
% In \!\pcol@makeflushedpage!, it is made $\false$ iff $\ptop$ is the
% \lpage{}, $\VPP=-\infty$ to mean all columns are empty and
% $\pp^f(\ptop)=\bot$, so as to make the \spanning{} in $\pp^i(\ptop)$ a
% float in \postenv{} if \CSIndex{ifpcol@dfloats} also $\false$. Then it is
% kept $\false$ if $\CSIndex{ifpcol@dfloats}=\false$ or $\pp^i(\ptop)=\bot$
% to mean nothing is shipped out for \lpage{}. Then it is made $\false$ iff
% $\ptop$ is the \lpage{} without deferred floats and \Mgfnote{}
% typesetting is in effect, i.e., the switch is $\true$ iff \Scfnote{}s are
% put in the page to be flushed.
%
% \item
% In \!\pcol@imakeflushedpage!, it is turned $\true$ iff $\cc_c(\tr)=\infty$
% and $\VPP=\pp^h(\ptop)$ to mean the floats in $\cc_c(\tl)$ should be put in
% a \fcolumn{} in the \lpage{} as usual.
%
% \item
% In \!\pcol@iflushfloats!, it is turned $\true$ iff one or more columns have
% non-empty $\cc_c(\dl)$ after shipping a page for \fcolumn{}s out, so that
% \CSIndex{if@fcolmade} is let have its value after scanning all columns.
%
% \item
% In \!\pcol@output@end!, it is turned $\true$ iff we built \fcolumn{}s, or
% the main vertical list in the \lpage{} is empty and the page is not the
% \spage, so that we create a new page for the \postenv.
%
% \item
% In \!\globalcounter!\marg{ctr}, it is turned $\true$ iff $\arg{ctr}\in\CG$
% already.
%
% \item
% In $\!\pcol@cmpctrelt!\arg{\theta}$, it is turned $\true$ iff $\theta$ is
% not in $\Cc_0$ or $\Val(\theta)\neq\val_0(\theta)$, so that $\theta$ is
% added to \!\@gtempa! being the list of \lcounter{}s to be synchronized.
%
% \item
% In \!\pcol@switchcolumn!$|[|d|]|$, it is turned $\false$ iff $0\leq d<\C$
% so that we complain $c$ is invalid if the switch is $\true$.
%
% \item
% In $\!\pcol@ac@caption@def!\arg{s}\arg{t}$, \CSIndex{@tempswatrue} or
% \CSIndex{@tempswafalse} is given as its first argument $s$ by
% $\!\pcol@ac@caption@enable!$ or $\!\pcol@ac@caption@disable!$ respectively,
% so that $|\if@ac@caption@if@|{\cdot}t$ is made \!\let!-equal to $s$ and
% \!\pcol@ac@caption! examines it for enabling\slash disabling
% \!\addcontentsline! respectively. The macros \!\pcol@ac@caption@if@lof!
% and \!\pcol@ac@caption@if@lot! are initialized to be \!\let!-equal to
% \!\@tempswatrue! as the default.
%
% \item
% In \!\pcol@icolumncolor!, it is turned $\true$ iff we are in a \!\vbox! or
% in restricted horizontal or math mode.
%
% \item
% In \!\pcol@backgroundcolor@i!, it is exmained if the root of the
% invocation chain is \!\backgroundcolor! which turns the switch $\true$, or
% \!\nobackgroundcolor! which turns it $\false$, to determine whether the
% \bground{} of a region is painted or not.
% \end{itemize}
% \end{description}
%
%
%
% \subsection{Macros}
% \label{sec:imp-tex-macro}
%
% \subsubsection{Procedural Macros}
%
% \begin{description}
% \item[\Uidx{\CSIndex{par}}]
% is \TeX's primitive to end\slash start paragraphs, but may be modified by
% \LaTeX{} to have some special functionality occasionally. The macro
% \!\pcol@output! makes it \!\let!-equal to \hbox{\!\@@par!} in which the
% \TeX's orinigal definition is kept, while \!\pcol@zparacol! and
% \!\pcol@par! use it as is.
%
% \item[\Uidx{\!\space!}]
% is an API macro to have a space token. It is used in \!\pcol@output!,
% \!\pcol@icolumncolor!, \!\pcol@defcseprulecolor@i! and
% \!\pcol@backgroundcolor@ii! for warning messages, and in
% \!\pcol@def@extract@fil! to \!\def!ine the macro \!\pcol@extract@fil!
% having spaces in its argument specification.
%
% \item[\Uidx{\!\nointerlineskip!}]
% is an API macro to let $\!\prevdepth!=-1000$\,pt to inhibit \TeX's
% baseline progress mechanism. It is used in \!\pcol@ioutputelt!,
% \!\pcol@makeflushedpage! and \!\pcol@imakeflushedpage! to joint boxes
% without \!\baselineskip! between them, in \!\pcol@outputpage@ev! to
% suppress the \!\baselineskip! insertion after the first box of painted
% \bground{} in the final ship-out image, and in \!\pcol@bg@paint@i!
% for the same purpose for the box having painted \bground{}s.
%
% \item[\Uidx{\!\offinterlineskip!}]
% is an API macro to let $\!\baselineskip!=-1000$\,pt, $\!\lineskip!=0$ and
% $\!\lineskiplimit!=\!\maxdimen!$ to supress \!\baselineskip! insertion for
% all boxes following this macro. It is used in \!\pcol@bg@paint@i! to do
% that in the box in which painted \bground{}s are built.
%
% \item[\Uidx{\!\thepage!}]
% is an API macro to have the representation of the counter \counter{page}.
% It is used in \!\pcol@output! for a warning message.
%
% \item[\Uidx{$\cs{the}{\cdot}\theta$}]
% \SpecialArrayIndex{\theta}{\the}
%
% is an API macro to have the representation of the counter $\theta$. The
% macro is kept in $|\pcol@thectr@|{\cdot}\theta$
%
% \SpecialArrayIndex{\theta}{\pcol@thectr@}
%
% by \!\pcol@thectrelt! which also makes the macro \!\let!-equal to
% $|\pcol@thectr@|{\cdot}\theta{\cdot}0$
%
% \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
%
% if the \lrep{} of $\theta$ in the column 0 is defined by
% \!\definethecounter!. The macro \!\pcol@setctrelt! also makes this
% overriding for the column $c$ to which the macro belongs if
% $|\pcol@thectr@|{\cdot}\theta{\cdot}c$
%
% \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
%
% being the \lrep{} for $c$ is defined, while it makes $|\the|{\cdot}\theta$
%
% \SpecialArrayIndex{\theta}{\the}
%
% \!\let!-equal to $|\pcol@thectr@|{\cdot}\theta$
%
% \SpecialArrayIndex{\theta}{\pcol@thectr@}
%
% otherwise to give it its original definition.
%
% \item[\Uidx{$\!\stepcounter!\<\theta\>$}]
% is an API macro to increment the counter $\theta$ and zero-clear its
% descendant counters. It is used in \!\pcol@startpage! for the counter
% \counter{page}, and in \!\pcol@iifootnotetext! for \counter{footnote}.
%
% \item[\Uidx{\!\nobreak!}]
% is an API macro to insert $\!\penalty!=10000$ to inhibit line or page
% breaks. It is used in \!\pcol@output@start!, \!\pcol@restartcolumn!,
% \!\pcol@icolumncolor!, \!\pcol@set@color@push!, \!\pcol@reset@color@pop!
% and \!\pcol@reset@color@mpop! to meet the page-break inhibition request
% made by $\CSIndex{if@nobreak}=\true$.
%
% \item[\Uidx{$\!\addvspace!$\marg{skip}}]
% is an API macro to insert a vertical $\arg{skip}$ if
% $\!\lastskip!<\arg{skip}$, or a skip of $\arg{skip}+\!\lastskip!$
% otherwise. The macro is used in \!\pcol@zparacol! when it finds the
% \env{paracol} environment to start is at the very beginning of a
% \env{list}-like environment, to insert \!\@topsep! instead of
% $\!\parskip!+\!\itemsep!$ going to be inserted by the first \!\item!.
%
% \item[\Uidx{$\!\addpenalty!\arg{pen}$}]
% is an API macro to insert a page break $\!\penalty!=\arg{pen}$ if
% $\CSIndex{if@nobreak}={\false}$. The \!\penalty! is inserted removing the
% last vertical skip which is reinserted after the \!\penalty!. The macro
% is used in \!\pcol@output@start! and \!\pcol@restartcolumn! to insert
% \!\interlinepenalty! if $\CSIndex{if@nobreak}=\false$, while
% \!\pcol@zparacol! uses it to insert \!\@beginparpenalty! when it finds the
% \env{paracol} environment to start is at the very beginning of a
% \env{list}-like environment.
%
% \item[\Uidx{\!\footnotesize!}]
% is an API macro to set the font size for footnotes. It is used in
% \!\pcol@fntextbody! for footnote typesetting.
%
% \item[\Uidx{\!\rule!\oarg{\mbox{$r$}}$\Arg{w}\Arg{h}$}]
% is an API macro to draw a vertical rule of $w$ width and $h$ tall,
% optionally raised by $r$. It is used in \!\pcol@fntextbody! to have the
% rule of $w=r=0$ and $h=\!\footnotesep!$ to make the first line of the
% footnote is at least as tall as \!\footnotesep!.
%
% \item[\Uidx{$\!\addcontentsline!\arg{file}\arg{sec}\arg{entry}$}]
% is an API macro to put \!\addtocontents! for the arguments to |.aux| file.
% The orignial definition of the macro is kept in
% \!\pcol@addcontentsline! so that \!\pcol@ac@disable@toc! and
% \!\pcol@ac@caption! make the macro regain its original definition after
% temporarily disabling its function by making it \!\let!-equal to
% \!\pcol@gobblethree!.
%
% \item[\Uidx{\!\marginpar!}\oarg{left}\marg{right}]
% is an API macro to put merginal note $\arg{left}$ or $\arg{right}$ to the
% left or right margin. In \!\pcol@zparacol! it is made \!\let!-equal to
% \!\pcol@marginpar! for the emulation of \!\marginnote!, while its original
% version is kept in \!\pcol@@marginpar!.
%
% \item[\Uidx{\!\footnote!}\oarg{num}\marg{text}]
% is an API macro to give a footnote $\arg{text}$ optionally with its number
% $\arg{num}$. In \!\pcol@zparacol! it is made \!\let!-equal to
% \!\pcol@footnote! to implement its starred version and the adjustment of
% \counter{footnote} at \Endparacol, while its original version is kept in
% \!\pcol@@footnote!.
%
% \item[\Uidx{\!\footnotemark!}\oarg{num}]
% is an API macro to give a footnote mark optionally with the number
% $\arg{num}$ which the mark represents. In \!\pcol@zparacol! it is made
% \!\let!-equal to \!\pcol@footnotemark! to implement its starred version
% and the adjustment of \counter{footnote} at \Endparacol, while its
% original version is kept in \!\pcol@@footnotemark!.
%
% \item[\Uidx{\!\footnotetext!}\oarg{num}\marg{text}]
% is an API macro to give a footnote $\arg{text}$ optionally with its number
% $\arg{num}$ but without putting the mark in the footnoted text. In
% \!\pcol@zparacol! it is made \!\let!-equal to \!\pcol@footnotetext! to
% implement its starred version, while its original version is kept in
% \!\pcol@@footnotetext!.
%
% \item[\Uidx{\!\footnoterule!}]
% is an API macro to draw a horizontal line above footnotes, or to insert
% whatever it has above them. With \Scfnote{} typesetting, it is redefined
% in \!\pcol@zparacol! so that it refers to \!\textwidth! instead of
% \!\columnwidth! for drawing the horizontal line or whatever defined, while
% the original version is kept in \!\pcol@footnoterule!. Then it is used in
% \!\pcol@putfootins! to separate footnotes from the stuff above them, with
% the original or modified definition.
%
% \item[\Uidx{\!\newpage!}]
% is an API macro to break a page. It is used in \!\pcol@switchcol! as the
% argument of \!\pcol@visitallcols! to break the \colpage{}s visited in the
% \cscan{} when the \sync{}ed \cswitch{} requires explicit page breaks.
%
% \item[\Uidx{\!\dblfigrule!}]
% is an API macro to draw a horizontal line between the last \pwise{}
% floats and the main vertical list, or to insert whatever it has between
% them. The macro is used in \!\pcol@startpage! to build \spanning{} in
% the page $p$ in $\pp^b(p)$.
%
% \item[\Uidx{\!\topfigrule!}]
% is an API macro to draw a horizontal line between the last \cwise{}
% top float and the main vertical list, or to insert whatever it has between
% them. The macro is used in \!\pcol@cflt! and \!\pcol@synccolumn! to
% insert it below the last (real) top float. It is also made \!\let!-equal
% to \!\relax! temporarily by \!\pcol@imakeflushedpage! when it put floats in
% a \fcolumn{} as top floats. Note that the macro and its bottom
% counterpart \!\botfigrule! should produce a vertical list whose total
% height and depth is 0, because \LaTeX's float mechanism and thus our
% macros believe so.
%
% \item[\Uidx{\!\normalcolor!}]
% is an API macro to have color specification stuff for normal coloring.
% The macro is used in \!\pcol@putfootins! to specify the color of footnotes
% to be put in \!\@outputbox!, in \!\normalcolumncolor!\oarg{c} to
% define that the default color of the column $c$ is the normal color,
% in \!\normalcolseprulecolor! to specify that the color for \cseprule{}s is
% \!\normalcolor!, and in the initial definition of \!\pcol@colseprulecolor!
% to give the default color for \cseprule{}s.
%
% \item[\Uidx{\!\color!}\oarg{mode}\marg{color}]
% is an API macro defined in coloring pacakges to start text coloring with
% $\arg{color}$ optionally with $\arg{mode}$. The macro is used in
% \!\pcol@xcolumncolor!\oarg{mode}\~\marg{color}\oarg{c} and
% \!\pcol@ycolumncolor!\marg{color}\oarg{c} to define the default color of
% the column $c$ is $\arg{color}$ optionally with $\arg{mode}$, in
% \!\pcol@defcseprulecolor@x! and \!\pcol@defcseprulecolor@y! to define the
% color of \cseprule{}s, and in \!\pcol@backgroundcolor@x! to define the
% color for \bgpaint{} of a region.
%
% \item[\Uidx{\!\pfmtname!}]
% is an API macro defined in p\LaTeX{} to have its format name |pLaTeX2e|
% (so far). It is used in the top level assignment of the constant switch
% \CSIndex{ifpcol@bfbottom}.
%
% \item[\Uidx{$\!\PackageError!\arg{pkg}\arg{msg}\arg{hlp}$}]
% is a developer's API macro to stop the exectution showing the error
% message $\arg{msg}$ with the package identification $\arg{pkg}$ and the
% help mssage $\arg{hlp}$. The macro is used in the following macros;
% \!\pcol@ovf! on \!\@freelist! shortage; \!\pcol@set@color@push! on too
% many math-mode colorings; in \!\pcol@zparacol! on two-column
% typesetting outside \env{paracol} and illegal nesting of \env{paracol};
% $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ on too large $x/y$;
% \!\pcol@switchcolumn! on invalid target column; \!\pcol@switchenv! on
% illegal \cswitch{} commands\slash environments in a \csenv;
% \!\addcontentsonly! on unknown contents type; \!\footnotelayout! on
% unknown layout; \!\pcol@twosided! on unknown two-sided typesetting
% feature; \!\pcol@backgroundcolor! on unknown region of \bgpaint; and in
% \!\pcol@backgroundcolor@i! on a region not being a column or \csepgap{}
% but its ordinal being specified.
%
% \item[\Uidx{$\!\PackageWarning!\arg{pkg}\arg{msg}$}]
% is a developer's API macro to report a warning message $\arg{msg}$ with
% the package identification $\arg{pkg}$. The macro is used in
% \!\pcol@ignore! to complain an API macro appears in \env{paracol}
% inappropriately, in \!\pcol@fntextbody! if the footnote is taller than
% $\!\textheight!-\!\skip!\!\footins!$, in \!\pcol@mn@warning! to show
% \!\marginnote! is emulated, and in \!\pcol@icolumncolor!,
% \!\pcol@defcseprulecolor@i! and \!\pcol@backgroundcolor@ii! to complain
% \!\columncolor!\slash\!\normalcolumncolor!,
% \!\colseprulecolor!\slash\!\normalcolseprulecolor! or \!\background~color!
% is used without coloring packages respectively.
%
% \item[\Uidx{\!\@@par!}]
% is an internal macro to keep \TeX's original primitive \CSIndex{par} in it.
% The macro is used in \!\pcol@output! to let \CSIndex{par} act with its
% original definition, and in \!\pcol@switchcol! and \!\pcol@flushclear! as
% the argument given to \!\pcol@visitallcols! to give \TeX's page builder
% the chance of page break in \cscan{}ning.
%
% \item[\Uidx{\!\@height!}]
% is an internal macro having the keyword |height|. It is used in
% \!\pcol@buildcolsep~rule!, \!\pcol@buildcselt!, \!\pcol@bg@paintregion@i!,
% \!\pcol@output@start!, and \!\pcol@putbackmvl! to draw a \!\hrule! for
% \cseprule{} in the first two, a \!\vrule! to be painted in the third, and
% an invisible \!\hrule! in the fourth and last.
%
% \item[\Uidx{\!\@width!}]
% is an internal macro having the keyword |width|. It is used in
% \!\pcol@buildcolsep~rule!, \!\pcol@buildcselt!, \!\pcol@bg@paintregion@i!,
% \!\pcol@output@start!, and \!\pcol@putbackmvl! to draw a \!\hrule! for
% \cseprule{} in the first two, a \!\vrule! to be painted in the third, and
% an invisible \!\hrule! in the fourth and last.
%
% \item[\Uidx{\!\@plus!}]
% is an internal macro having the keyword |plus|. It is used in the
% following macros.
%
% \begin{itemize}
% \item
% \!\pcol@makecol! to \!\def!ine \!\@textbottom! with the body of a vertical
% skip with small infinite stretch and shrink.
%
% \item
% \!\pcol@combinefloats! for a skip of the same amount in \!\@textbottom!
% above and that of negative amount to {\em move} the effect.
%
% \item
% \!\pcol@hfil! for skips having 1\,|fil| infinite stretch with $\gap_c$ or
% $\gap_c/2$ to make it sure the series of columns and \csepgap{}s does not
% cause underfull.
%
% \item
% \!\pcol@synccolumn! to put a $1\,|fil|$ infinte stretch below the
% main vertical list together with a small infinte shrink in the \colpage{}
% being flushed and having a \sync{}ation point, and a vertical skip with a
% small infinite stretch to push up the main vertical list above a
% \sync{}ation point.
%
% \item
% \!\pcol@setcw@getspec@i! to add $0\,|pt|\ |plus|\ 1000\,|pt|\ |minus|\
% 1000\,|pt|$ to \!\@tempskipa! to ensure the register have stretch and
% shrink components.
%
% \item
% \!\pcol@setcw@fill! to let $\!\@tempskipa!=0\,|pt|\ |plus|\ f\,|fil|$ as
% the infinite stretch factor of $f$.
% \end{itemize}
%
% It is also used in the top level assignment of $0\,|pt|\ |plus|\ 1\,|fil|\
% |minus|\ 1\,|fil|$ to \!\@tempskipa! for the invocatoin of \!\pcol@defkw!.
%
% \item[\Uidx{\!\@minus!}]
% is an internal macro having the keyword |minus|. It is used in the
% following macros.
%
% \begin{itemize}
% \item
% \!\pcol@makecol! to \!\def!ine \!\@textbottom! with the body of a vertical
% skip with small infinite stretch and shrink.
%
% \item
% \!\pcol@combinefloats! for a skip of the same amount and that of negative
% amount.
%
% \item
% \!\pcol@synccolumn! to put a small infinite shrink together with a
% stretch of $1\,|fil|$ at the bottom of the main vertical list in a
% \colpage{} being flused and having a \sync{}ation point.
%
% \item
% \!\pcol@setcw@getspec@i! to add $0\,|pt|\ |plus|\ 1000\,|pt|\ |minus|\
% 1000\,|pt|$ to \!\@tempskipa! to ensure the register have stretch and
% shrink components.
% \end{itemize}
%
% It is also used in the top level assignment of $0\,|pt|\ |plus|\ 1\,|fil|\
% |minus|\ 1\,|fil|$ to \!\@tempskipa! for the invocatoin of \!\pcol@defkw!.
%
% \item[\Uidx{\!\hb@xt@!}]
% is an internal macro having the sequence ``\!\hbox!| to|''. It is used in
% \!\pcol@ioutputelt!, \!\pcol@imakeflushedpage! and \!\pcol@iflushfloats! to
% put each \colpage{} in a \!\hbox! of \!\columnwidth! wide and to enclose
% all of them in a \!\hbox! of \!\textwidth! wide.
%
% \item[\Uidx{$\!\@namedef!\arg{cs}\arg{body}$}]
% is an internal macro to do $\!\def!|\|\arg{cs}\Arg{body}$. It is used in
% the following macros.
%
% \begin{itemize}
% \item
% \!\pcol@zparacol! for \!\column*! and \!\pcol@com@column*!.
%
% \item
% $\!\pcol@remctrelt!\<\theta\>$ for $|\cl@|{\cdot}\theta$.
%
% \SpecialArrayIndex{\theta}{\cl@}
%
% \item
% $\!\definethecounter!\<\theta\>\<c\>\arg{rep}$ for
% $|\pcol@thectr@|{\cdot}\theta{\cdot}c$,
%
% \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
%
% \item
% $\!\pcol@loadctrelt!\<\theta\>\<\val_c(\theta)\>$ for
% $|\pcol@ctr@|{\cdot}\theta$.
%
% \SpecialArrayIndex{\theta}{\pcol@ctr@}
%
% \item
% \!\pcol@defcolumn! for \!\pcol@com@column*!.
%
% \item
% \!\pcol@defcseprulecolor@i! for $\!\pcol@colseprulecolor![{\cdot}c]$.
%
% \SpecialArrayIndex{c}{\pcol@colseprulecolor}
%
% \end{itemize}
%
% We also use this macro in top level \!\def!initions of
% \!\pcol@com@nthcolumn*!, \!\pcol@com@leftcolumn*! and
% \!\pcol@com@rightcolumn*! for the starter of the environments
% \env{nthcolumn*}, \env{leftcolumn*} and \env{rightcolumn*}.
%
% \item[\Uidx{$\!\@nameuse!\arg{cs}$}]
% is an internal macro to do $|\|\arg{cs}$. It is used in the following
% macros.
%
% \begin{itemize}
% \item
% $\!\pcol@bg@addext!\arg{z}\Arg{s}\Arg{d}$ for
% $|\pcol@bg@ext@|{\cdot}d{\cdot}|@|{\cdot}\{a{\cdot}|@|{\cdot}c,a\}$.
%
% \SpecialArrayIndex{d{\cdot}\string\texttt{@}
% {\cdot}a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@ext@}
% \SpecialArrayIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
%
% \item
% \!\pcol@bg@columnleft! for $|\pcol@columnwidth|{\cdot}c$ and
% $|\pcol@columnsep|{\cdot}c$.
%
% \SpecialArrayIndex{c}{\pcol@columnwidth}
% \SpecialArrayIndex{c}{\pcol@columnsep}
%
% \item
% \!\pcol@bg@columnwidth! for $|\pcol@columnwidth|{\cdot}c$.
%
% \SpecialArrayIndex{c}{\pcol@columnwidth}
%
% \item
% \!\pcol@bg@columnsep! for $|\pcol@columnsep|{\cdot}c$.
%
% \SpecialArrayIndex{c}{\pcol@columnsep}
%
% \item
% \!\pcol@ccuse! for
% $\Celt^c=|\pcol@columncolor@box|{\cdot}c$ or
% $\Celtshadow^c=|\pcol@columncolor|{\cdot}c$.
%
% \SpecialArrayIndex{c}{\pcol@columncolor}
% \SpecialArrayIndex{c}{\pcol@columncolor@box}
%
% \item
% \!\column*! for \!\pcol@com@column*!.
%
% \item
% \!\pcol@zparacol! for $|\pcol@colpream|{\cdot}0$.
%
% \SpecialArrayIndex{c}{\pcol@colpream}
%
% \item
% $\!\pcol@storectrelt!\<\theta\>$ for $|\pcol@ctr@|{\cdot}\theta$.
%
% \SpecialArrayIndex{\theta}{\pcol@ctr@}
%
% \item
% $\!\pcol@cmpctrelt!\<\theta\>$ for $|\c@|{\cdot}\theta$
%
% \SpecialArrayIndex{\theta}{\c@}
%
% and $|\pcol@ctr@|{\cdot}\theta$.
%
% \SpecialArrayIndex{\theta}{\pcol@ctr@}
%
% \item
% \!\pcol@synccounter! for $|\pcol@counters|{\cdot}c$ for the column $c$.
%
% \SpecialArrayIndex{c}{\pcol@counters}
%
% \item
% $\!\pcol@syncctrelt!\<\theta\>$ for $|\c@|{\cdot}\theta$.
%
% \SpecialArrayIndex{\theta}{\c@}
%
% \item
% $\!\pcol@stepcounter!\<\theta\>$ for $|\pcol@counters|{\cdot}c$ for the
% column $c$,
%
% \SpecialArrayIndex{c}{\pcol@counters}
%
% and for $|\cl@|{\cdot}\theta$.
%
% \SpecialArrayIndex{\theta}{\cl@}
%
% \item
% \!\pcol@switchcol! to the column $c$ for $|\pcol@colpream|{\cdot}c$.
%
% \SpecialArrayIndex{c}{\pcol@colpream}
%
% \item
% $\!\pcol@aconlyelt!\<t\>\<c\>$ for $|\pcol@ac@def@|{\cdot}t$.
%
% \SpecialIndex{\pcol@ac@def@lof}\SpecialIndex{\pcol@ac@def@lot}
%
% \item
% $\!\pcol@ac@def@lof!\arg{eord}$ and $\!\pcol@ac@def@lot!\arg{eord}$
% for $|\pcol@ac@caption@|{\cdot}\~\arg{eord}$.
%
% \SpecialIndex{\pcol@ac@caption@enable}
% \SpecialIndex{\pcol@ac@caption@disable}
%
% \item
% $\!\pcol@ac@caption!\arg{type}|[|\arg{lcap}|]|\arg{cap}$ for
% $|\pcol@ac@caption@if@|{\cdot}t$
%
% \SpecialIndex{\pcol@ac@caption@if@lof}
% \SpecialIndex{\pcol@ac@caption@if@lot}
%
% and for $|\ext@|{\cdot}\~\arg{type}$.
%
% \SpecialIndex{\ext@figure}\SpecialIndex{\ext@table}
%
% \item
% $\!\footnotelayout!\Arg{l}$ for $|pcol@fnlayout@|{\cdot}l$.
%
% \SpecialArrayIndex{l}{\pcol@fnlayout@}
% \SpecialIndex{\pcol@fnlayout@c}
% \SpecialIndex{\pcol@fnlayout@p}
% \SpecialIndex{\pcol@fnlayout@m}
%
% \item
% $\!\pcol@twosided!|[|T|]|$ for $|pcol@twosided@|{\cdot}t$ where $t\in T$.
%
% \SpecialArrayIndex{t}{\pcol@twosided@}
% \SpecialIndex{\pcol@twosided@p}
% \SpecialIndex{\pcol@twosided@c}
% \SpecialIndex{\pcol@twosided@m}
% \SpecialIndex{\pcol@twosided@b}
% \end{itemize}
%
% \item[\Uidx{$\!\@gobble!\arg{arg}$}]
% discards its argument $\arg{arg}$. It is used in \!\pcol@output@start!,
% \!\pcol@icolumncolor! and \!\pcol@set@color@push! for temporarily letting
% \!\aftergroup! be \!\@gobble! to nullify \!\aftergroup! with
% \!\reset@color! invoked in \!\pcol@set@color!, being the original version
% of \!\set@color!, and in \!\pcol@zparacol! to make \!\pcol@bg@paintbox!
% \!\let!-equal to \!\@gobble! to nullify it if any coloring packages have
% not been loaded. In addition, the macros \!\pcol@F! and \!\pcol@Fe! for
% logging are made \!\let!-equial to \!\@gobble! at the top level to nullify
% them.
%
% \item[\Uidx{$\!\@ifundefined!\arg{cs}\arg{then}\arg{else}$}]
% \begin{Hfuzz}{0.8pt}%
% is an internal macro to do $\arg{then}$ or $\arg{else}$ if $\arg{cs}$ is
% undefined or defined respectively.
% It is used in the following macros;
% $\!\pcol@bg@paintregion!\arg{a}\arg{c}$ to examine if either
% $|\pcol@bg@color@|{\cdot}a{\cdot}|@|{\cdot}c$ or
% $|\pcol@bg@color@|{\cdot}a$ is defined;
%
% \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
% \SpecialArrayIndex{a}{\pcol@bg@color@}
%
% \!\add~contentsonly!$\<t\>\<c\>$ to stop the execution if
% $|\pcol@ac@def@|{\cdot}t$ is not defined;
%
% \SpecialArrayIndex{t}{\pcol@ac@def@}
%
% \!\footnote~layout!$\Arg{l}$ to stop the execution if
% $|\pcol@fnlayout@|{\cdot}l$ is not defined;
%
% \SpecialArrayIndex{l}{\pcol@fnlayout@}
%
% $\!\pcol@twosided!|[|T|]|$ to stop the execution if $T$ has $t$
% such that $|\pcol@twosided@|{\cdot}t$ is not defined;
%
% \SpecialArrayIndex{t}{\pcol@twosided@}
%
% \!\pcol@backgroundcolor! to stop the execution if $|\pcol@bg@@|{\cdot}a$
% is not defined for a region $a$;
%
% \SpecialArrayIndex{a}{\pcol@bg@@}
%
% and \!\pcol@backgroundcolor@i! to stop the execution if
% $|\pcol@bg@mayhavecol|{\cdot}a$ is not defined for a region $a$.
% \end{Hfuzz}
%
% \item[\Uidx{$\!\@ifnextchar!\arg{char}\arg{then}\arg{else}$}]
% is an internal macro to do $\arg{then}$ or $\arg{else}$ if the character
% following to the macro is $\arg{char}$ or not respectively. It is used in
% the following macros to examine if they are followed by a `\texttt{\LB}'.
%
% \begin{quote}\raggedright
% \!\paracol!,
% \!\pcol@zparacol!,
% \!\columnratio!,
% \!\pcol@com@column*!\hbox{ (initial definition)},
% \!\pcol@com@switchcolumn!,
% \!\pcol@iswitchcolumn!,
% \!\pcol@adjustfnctr!,
% \!\pcol@ifootnotetext!,
% \!\twosided!,
% \!\marginparthreshold!,
% \!\columncolor!,
% \!\pcol@columncolor!,
% \!\normalcolumncolor!.
% \!\colseprulecolor!,
% \!\pcol@defcseprulecolor!,
% \!\normalcolseprulecolor!,
% \!\pcol@backgroundcolor!,
% \!\pcol@backgroundcolor@w!.
% \end{quote}
% It is also used in \!\pcol@backgroundcolor@iii! and
% \!\pcol@backgroundcolor@iv! if they are followed by a `\texttt{\LP}'.
%
% \item[\Uidx{$\!\@ifstar!\arg{then}\arg{else}$}]
% is an internal macro to do $\arg{then}$ or $\arg{else}$ if the character
% following to the macro is `|*|'. It is used in \!\pcol@yparacol!,
% \!\globalcounter!, \!\pcol@switchcolumn!, \!\pcol@footnote!,
% \!\pcol@footnotemark! and \!\pcol@footnotetext! to examine if the optional
% `|*|' is specified.
%
% \item[\Uidx{$\!\@whilesw!\arg{sw}\cs{fi}\arg{body}$}]
% is an internal macro to iterate $\arg{body}$ while the switch $\arg{sw}$
% is $\true$. It is used in \!\pcol@output!, \!\pcol@startpage!,
% \!\pcol@output@clear!, \!\pcol@flushfloats!, \!\pcol@freshpage! and
% \!\pcol@output@end! to iterate building process of \fcolumn{}s or
% \fpage{}s while $\CSIndex{if@fcolmade}=\true$, and in \!\pcol@switchcol!
% and \!\pcol@flushclear! to iterate the height check of \sync{}ed or
% flushed pages while $\CSIndex{ifpcol@flush}=\true$.
%
% \item[\Uidx{$\!\@whilenum!\arg{ifnum}\cs{do}\arg{body}$}]
% is an internal macro to interate $\arg{body}$ while the integer comparison
% expression $\arg{ifnum}$ is $\true$. The macro is used in the following
% macros to iterate their own procedures for all columns $c\In0\C$.
%
% \begin{quote}\raggedright
% \!\pcol@checkshipped!,
% \!\pcol@output@start!,
% \!\pcol@output@switch!,
% \!\pcol@sync!,
% \!\pcol@makeflushedpage!,
% \!\pcol@freshpage!,
% \!\pcol@output@end!,
% \!\pcol@synccounter!,
% \!\pcol@com@syncallcounters!,
% \!\pcol@stepcounter!,
% \!\pcol@visitallcols!.
% \end{quote}
%
% The macro is also used in the following macros for the ranges following
% macro name, where $(\Cfrom,\Cto)\in\{(0,\CL),(\CL,\C)\}$ and $c$ is the
% column they are working on.
%
% \begin{quote}
% \!\pcol@ioutputelt! $\LBRP\Cfrom\Cto$\\
% \!\pcol@bg@paint@ii! $\LBRP\CBfrom{\Cto{-}1}$\\
% \!\pcol@bg@columnleft! $\LBRP\CBfrom{c}$\\
% \!\pcol@addmarginpar! $\LBRP\Cfrom{c'}$ ($c'\in\{c,\;\Cto-(c-\Cfrom)-1\}$)\\
% \!\pcol@imakeflushedpage! $\LBRP\Cfrom\Cto$\\
% \!\pcol@iflushfloats! $\LBRP\Cfrom\Cto$\\
% \!\pcol@setcw@scan! $\LBRP\Cfrom\Cto$
% \end{quote}
%
% The other users have a little bit more complicated range as follows.
% \begin{itemize}
% \item
% \!\pcol@flushcolumn! to iterate \fcolumn{} building for a column $c$ in
% pages $q$ such that $q\in(\cc_c(\vb^p),\ptop)$.
%
% \item
% \!\pcol@setcolwidth@r! to make assignment of $\w_c$ for
% $c\In{\min(\Cfrom{+}k,\Cto{-}1)}{\,\Cto}$ where $k$ is the number of
% fractions given as the first or second argument of
% \!\columnratio! and kept in \!\pcol@columnratioleft! or
% \!\pcol@columnratioright!, respectively.
%
% \item
% $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ to calculate
% $\lceil{y/2^{k_2+k_3}}\rceil$ finding $k_3$ by iterating $y/2$ until the
% result becomes less than $2^{15}$, to calculate $z'/2^k$ with the range
% $\LBRP0k$, to calculate $z'/2^{k-16}$ with the range $\LBRP0{\,k{-}16}$,
% and to calculate $z'\cdot2^{16-k}$ with the range $\LBRP0{\,16{-}k}$,
% where $z'\cdot2^{16-k}=Z=z\times1\,|pt|$ and $k_2$, $k_3$ and $k$ are
% scaling parameters for good approximation.
% \end{itemize}
%
% \item[\Uidx{$\!\@whiledim!\arg{ifdim}\cs{do}\arg{body}$}]
% is an internal macro to interate $\arg{body}$ while the dimensional
% comparison expression $\arg{ifdim}$ is $\true$. The macro is used in
% $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ twice, at first to find
% $k_1=\min\Set{k}{x\cdot2^k\geq2^{13}\,|pt|}$ and to have $x\cdot2^{k_1}$,
% and then to find $k_2=\max\Set{k}{y\bmod2^k=0}$ and to have $y/2^{k_2}$.
%
% \item[$\Uidx{\!\@for!}\arg{cs}\texttt{:=}\arg{list}\cs{do}\arg{body}$]
% is an internal macro to iterate $\arg{body}$ for each element of the
% comma-separated $\arg{list}$ letting $\arg{cs}$ have the element. The
% macro is used in \!\pcol@setcolwidth@r! to scan its argument
% $\arg{ratio}$ defined by \!\columnratio!, and in \!\pcol@setcw@scan! to
% scan its argment $\arg{spec}$ defined by \!\setcolumnwidth!.
%
% \item[$\Uidx{\!\@tfor!}\arg{cs}|:=|\arg{list}\cs{do}\arg{body}$]
% is an internal macro to iterate $\arg{body}$ for each non-space token in
% $\arg{list}$ letting $\arg{cs}$ have the token. The macro is used in
% \!\pcol@bg@paint@ii!, \!\pcol@setcw@getspec! and \!\pcol@twosided! to scan
% their arguments, in \!\pcol@setcw@getspec@i! to scan a column\slash
% gap specification to remove spaces from it, and in
% $\!\pcol@twosided!|[|T|]|$ to scan all tokens being two-sided typesetting
% features in $T$.
%
% \item[\Uidx{$\!\@next!\arg{elm}\arg{lst}\arg{suc}\arg{fail}$}]
% is an internal macro to remove the first element from $\arg{lst}$,
% \!\def!ine $\arg{elm}$ to have the first element, and then do $\arg{suc}$,
% if $\arg{lst}$ is not empty. Otherwise, it performs $\arg{fail}$. The
% macro is used in the following macros to obtain an \!\insert! from
% \!\@freelist!.
%
% \begin{itemize}
% \item
% \!\pcol@opcol! for the completed \colpage{}.
%
% \item
% \!\pcol@startpage! for \fpage{}s and \spanning{} for \pwise{} top
% floats.
%
% \item
% \!\pcol@output@start! for the \preenv{}, and \colpage{}s and $\Celt^c$ of
% all columns.
%
% \item
% \!\pcol@output@switch! for the \colpage{} from which we are leaving.
%
% \item
% \!\pcol@iscancst! for $\Celt^c$.
%
% \item
% \!\pcol@savefootins! for footnotes.
%
% \item
% \!\pcol@flushcolumn! for \fcolumn{}s and the empty \colpage{} in $\ptop$.
%
% \item
% \!\pcol@synccolumn! for an \mvlfloat{} on a \sync{}ation if its point
% defined by a column whose main vertical list is empty.
%
% \item
% \!\pcol@output@end! for the \pwise{} floats in the \lpage{} if the
% main vertical list of the page is empty.
%
% \item
% \!\pcol@icolumncolor! for $\Celt^c$.
% \end{itemize}
%
% The macro is also used in \!\pcol@ioutputelt! to obtain completed
% \colpage{}s from $\S_c$.
%
% \item[\Uidx{%
% $\!\@xnext!\cs{@elt}\arg{car}\arg{cdr}\cs{@@}\arg{first}\arg{rest}$}]
% is an internal macro to remove the first element $|\@elt|\arg{car}$ from a
% list in the form of $|\@elt|\,e_1\,\cdots\,|\@elt|\,e_n$ where
% $\arg{cdr}=|\@elt|\,e_2\,\cdots\~\,|\@elt|\,e_n$ and |\def|ine
% $\arg{first}$ as $\arg{car}$ and globally |\def|ine $\arg{rest}$ as
% $\arg{cdr}$. It is used in \!\pcol@addmarginpar! to get the first element
% of \!\@currlist! being a \!\insert! for a right marginal note without
% modifying \!\@currlist!.
%
% \item[\Uidx{$\!\@cons!\arg{lst}\arg{elm}$}]
% is an internal macro to add $\!\@elt!\arg{elm}$ to the tail of $\arg{lst}$.
%
% \begin{itemize}
% \item
% \!\pcol@makecol! to add $\spt(H,h)$ to the tail of $\pp^s(\ptop)$.
%
% \item
% \!\pcol@opcol! to add the completed \ccolpage{} $\cc_c(\vb)$ to $\S_c$.
%
% \item
% \!\pcol@startpage! to add $\pp(\ptop-1)$ and \fpage{}s to $\PP$.
%
% \item
% \!\pcol@outputelt! to return \spanning{} $\pp^i(q)$ in a shipped-out \fpage{}
% $q$ to \!\@freelist!, or to add $\pp(q)$ to $\PP$ if the page $q$ is kept.
%
% \item
% \!\pcol@ioutputelt! to return \spanning{} $\pp^i(q)$, \Scfnote{}s
% $\pp^f(q)$ and/or \colpage{}s $\s_c(q)$ for all $c\In0C$ in a shipped-out
% page $q$ to \!\@freelist!.
%
% \item
% \!\pcol@output@start! to return the \ccolpage{} $\cc_0(\vb)$ to
% \!\@freelist!.
%
% \item
% \!\pcol@output@switch! to add $\spt(H,h)$ to the tail of $\pp^s(\ptop)$.
%
% \item
% \!\pcol@restartcolumn! to return the \ccolpage{} $\cc_c(\vb)$ to be resumed,
% and its footnotes $\cc_c(\ft)$ if any, to \!\@freelist!.
%
% \item
% $\!\pcol@getmparbottom!\<t\>\<h\>$ to add
% $\mpar(\max(t,b_n),\max(t,b_n){+}h)$ to the tail of the list
% $\mpb_{\{L,R\}}^{\{l,r\}}$, and its callee
% $\!\pcol@getmpbelt!\<t_i\>\<b_i\>$ to add $\mpar(t_i,b_i)$ or
% $\mpar(\max(t,b_{i-1}),\max(t,b_{i-1}){+}h)$ to the so-far tail of the
% list in rebuilding.
%
% \item
% \!\pcol@flushcolumn! to return footnotes $\cc_c(\ft)$ in the \ccolpage{}
% of $c$ to be flushed to \!\@freelist! if any, and to add the flushed
% \colpage{} and \fcolumn{}s to $\S_c$.
%
% \item
% \!\pcol@makefcolelt! to add a float to \!\@toplist! or $\cc_c(\dl)$.
%
% \item
% \!\pcol@synccolumn! to add an \mvlfloat{} for \sync{}ation to
% $\cc_c(\tl)$.
%
% \item
% \!\pcol@makeflushedpage! to return \spanning{} $\pp^i(\ptop)$ and/or
% \Scfnote{}s $\pp^f(\ptop)$ in the top page to be flushed to \!\@freelist!
% if any.
%
% \item
% \!\pcol@imakeflushedpage! to return \Mcfnote{}s in $\cc_c(\ft)$ s.t.\
% $\cc_c(\vb^p)=\ptop$ to \!\@freelist! if any.
%
% \item
% \!\pcol@output@end! to return $\pp^f(\ptop)$, all \ccolpage{}s
% $\cc_c(\vb)$, and all $\Celt^c\neq\bot$ to \!\@freelist!.
%
% \item
% \!\pcol@end@dblfloat! to add a \pwise{} float in \!\@currbox! to
% \!\@dbldeferlist!.
%
% \item
% $\!\globalcounter!\<\theta\>$ to add a \gcounter{} $\theta$ to $\CG$.
%
% \item
% $\!\pcol@iremctrelt!\<\theta\>$ to add a \lcounter{} $\theta$ to $\CTL$.
%
% \item
% $\!\pcol@storectrelt!\<\theta\>$ to add a pair $\<\theta,\val_c(\theta)\>$
% to $\Cc_c$ for a column $c$.
%
% \item
% $\!\pcol@savectrelt!\<\theta\>$ to add a pair $\<\theta,\val(\theta)\>$ to
% $\Cc_c$ for a column $c$.
%
% \item
% $\!\pcol@cmpctrelt!\<\theta\>$ to add a counter $\theta$ to the list of
% \lcounter{}s to be synchronized.
%
% \item
% $\!\addcontentsonly!\<t\>\<c\>$ to add a pair $\<t,c\>$ to $\T$.
%
% \item
% \!\pcol@backgroundcolor@ii! to add a region whose \bground{} is painted to
% \!\pcol@bg@defined!.
% \end{itemize}
%
% \item[\Uidx{$\!\@cdr!\<a_1\>\<a_2\>\cdots\<a_n\>\cs{@nil}$}]
% is an internal macro to be expanded to $\<a_2\>\cdots\<a_n\>$. It is used
% in $\!\pcol@getcurrpinfo!\arg{cs}$ to extract $\pp(\ptop)$ from
% $\!\pcol@currpage!=\!\@elt!\arg{\pp(\ptop)}$ and to \!\def!ine $\arg{cs}$
% letting it have $\pp(\ptop)$.
%
% \item[\Uidx{$\!\protected@edef!\arg{macro}$\marg{body}}]
% is an internal macro to do \!\edef!$\arg{macro}$\marg{body} with the
% \!\protect!ion so that \!\protect!$\arg{cs}$ is kept in the expansion. It
% is used in \!\pcol@fntextbody! to \!\edef!ine \!\@currentlabel!.
%
% \item[\Uidx{$\!\@latex@warning@no@line!\arg{msg}$}]
% is an internal macro to report a warning message $\arg{msg}$ without the
% line number in which the cause lies. It is used in \!\pcol@output! if
% a page with floats and very short main vertical list is built.
%
% \item[\Uidx{\!\@eha!}]
% is an internal macro having a help message saying the command causing an
% error is ignored. It is used in \!\pcol@zparacol!, \!\pcol@setcw@calcf!,
% \!\pcol@switchcolumn!, \!\pcol@switchenv!, and \!\addcontentsonly! as the
% argument of \!\PackageError!.
%
% \item[\Uidx{\!\@ehb!}]
% is an internal macro having a help message saying the error causes a
% serious problem. It is used in \!\pcol@ovf!, \!\pcol@zparacol! and
% \!\pcol@set@color@push! as the argument of \!\PackageError!.
%
% \item[\Uidx{\!\@parmoderr!}]
% is an internal macro to complain about misplacement of a macro or
% environment which is expected to appear in ``outer par mode''.
% It is used in \!\pcol@zparacol! if it finds $\CSIndex{ifinner}=\true$.
%
% \item[\Uidx{\!\@Esphack!}]
% is an internal macro to put back the horizontal skip and space factor
% saved by \!\@bsphack! at the end of an environment. It is used in
% \!\pcol@end@dblfloat!.
%
% \item[\Uidx{\!\reset@font!}]
% is an internal macro \!\let!-equal to \!\normalfont! to use a starndard
% font. It is used in \!\pcol@fntextbody! for footnote typesetting.
%
% \item[\Uidx{\!\set@color!}]
% is an internal macro to start coloring of texts following it. By default
% it is \!\relax! but may have a definition to put a \!\special! for
% coloring with the color in \!\current@color!. In the following macros, it
% is examined if $\!\set@color!=\!\relax!$ and/or some local definition is
% given to \!\set@color!.
%
% \begin{itemize}
% \item
% \!\pcol@output! lets $\!\set@color!=\!\pcol@set@color!$ i.e., lets it
% regain its original definition because we don't need any special
% operations in \!\output! routine.
%
% \item
% \!\@outputpage! performs \bgpaint{} if $\!\set@color!\neq\!\relax!$.
%
% \item
% \!\pcol@zparacol! performs set-up operations for text coloring, including
% making \!\set@color! \!\let!-equal to \!\pcol@set@color@push! saving
% its original definition into \!\pcol@set@color!, and enabling \bgpaint{}
% macros if $\!\set@color!\neq\!\relax!$, while these \bgpaint{} macros are
% nullified otherwise.
%
% \item
% \!\pcol@icolumncolor! complains that no color packages have been loaded if
% \!\set@color!${}={}$\!\relax!, and then otherwise temporarily lets it be
% the original saved in \!\pcol@set@color! to \!\insert! a \!\vbox! to
% update $\Celt^c$ or to do the update immediately.
%
% \item
% \!\pcol@iicolumncolor! temporarily lets $\!\set@color!=\!\relax!$ so that
% \!\color! or \!\normalcolor! invoked in the macro just defines
% \!\current@color! to be set into $\Celtshadow^c$ without doing any other
% coloring operations.
%
% \item
% \!\pcol@defcseprulecolor@i! complains that no color packages have been
% loaded if $\!\set@color!=\!\relax!$, while otherwise the macro temporarily
% lets $\!\set@color!=\!\relax!$ to invoke \!\color! (or \!\normalcolor!) to
% check if its arguments are properly given.
%
% \item
% \!\pcol@backgroundcolor@ii! complains that no color packages have been
% loaded if $\!\set@color!=\!\relax!$, while otherwise its descendent
% \!\pcol@backgroundcolor@x! temporarily lets
% $\!\set@color!=\!\pcol@backgroundcolor@y!$ to \!\def!ine
% $|\pcol@bg@|\~|color@|a[|@|{\cdot}c]$ to be \!\current@color!.
%
% \SpecialArrayIndex{a}{\pcol@bg@color@}
% \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
% \end{itemize}
%
% \item[\Uidx{\!\reset@color!}]
% is an internal macro to finish text coloring started by \!\set@color!. By
% default it is undefined but may have some definition to put a \!\special!
% to finish coloring. It is used in \!\pcol@clearcolorstack! so as to apply
% it to all elements in $\CST^c$, in \!\pcol@iscancst! to put it to the
% main vertical list in the case that $\Celt^c$ was $\bot$ and then updated,
% in \!\pcol@icolumncolor! to apply it to all elements in $\CSTshadow^c$,
% and in \!\pcol@reset@color@pop! and \!\pcol@reset@color@mpop! to have an
% uncoloring \!\special! in the \!\vbox! for $\celt_i$ and $\mcelt_{i,m}$.
%
% \item[\Uidx{\!\color@begingroup!}]
% is an internal macro to open a group in which a color is specified. It is
% used in \!\pcol@putfootins! to enclose footnotes with \!\normalcolor!, and
% in \!\pcol@fntextbody!\marg{text} to enclose the coloring in the footnote
% $\arg{text}$.
%
% \item[\Uidx{\!\color@endgroup!}]
% is an internal macro to close a group in which a color is specified. It is
% used in \!\pcol@putfootins! to enclose footnotes with \!\normalcolor!, and
% in \!\pcol@fntextbody!\marg{text} to enclose the coloring in the footnote
% $\arg{text}$.
%
% \item[\Uidx{$\!\@stpelt!\<\theta\>$}]
% is an internal macro to zero-clear the counter $\theta$ for the
% implementation of \!\stepcounter!. It is used in \!\pcol@stepcounter! to
% clear the descendent counters of a \gcounter{} $\cg$ listed in
% $|\pcol@cl@|{\cdot}\cg$.
%
% \SpecialArrayIndex{\theta}{\pcol@cl@}
%
% \item[\Uidx{\!\@nbitem!}]
% is an internal macro to insert a vertical skip of
% $\!\@outerparskip!-\!\parskip!$ above the first \!\item! of a
% \env{list}-like environment when $\CSIndex{if@nobreak}=\true$. It is used
% by \!\pcol@zparacol! when it finds the \env{paracol} environment to start
% is at the very beginning of a \env{list}-like environment and
% $\CSIndex{if@nobreak}=\true$.
%
% \item[\Uidx{\!\@parboxrestore!}]
% is an internal macro to set up typesetting paramenters for paragraphs
% encapsulated in a box. It is used in \!\pcol@fntextbody! for paragraphs
% in a footnonte.
%
% \item[\Uidx{\!\@finalstrut!}$\arg{box}$]
% is an internal macro to add an invisible vertical rule whose depth is that
% of a $\arg{box}$. It is used in \!\pcol@fntextbody! to make the last line
% of the footnotes is as deep as \!\strutbox! at shallowest.
%
% \item[\Uidx{\!\@sect!}]
% is an internal macro to implement sectioning commands. The original
% definition of the macro is kept in \!\pcol@ac@enable@toc!, while
% \!\pcol@ac@def@toc! makes it \!\let!-equal to \!\pcol@ac@enable@toc! or
% \!\pcol@ac@disable@toc!, the latter of which uses the original version
% temporarily disabling \!\addcontentsline!.
%
% \item[\Uidx{\!\@svsechd!}]
% is an internal macro (locally) \!\def!ined in \!\@sect! and \!\@ssect! to
% keep the section header of a sectioning command such as \!\paragraph!
% which puts the header as the leading text of the paragraph following the
% command rather than putting it as an individual paragraph. The macro is
% \!\global!ized in \!\pcol@sptext! so that it is properly referred to in
% \!\everypar! for the paragraph led by the text in case that a \mctext{}
% has the sectioning command only and thus the \!\def!inition of the macro
% must survive after we close the group in which the \mctext{} is put.
%
% \item[\Uidx{\!\@svsec!}]
% is an internal macro (locally) \!\def!ined in \!\@sect! to keep
% \!\thesection! etc.\ to be displayed as the leading part of the section
% header. The macro is \!\global!ized in \!\pcol@sptext! together with
% \!\@svsechd! because it is in the body of \!\@svsechd!.
%
% \item[\Uidx{\!\@caption!}]
% is an internal macro to implement \!\caption!. The original definition of
% the macro is kept in \!\pcol@ac@caption@latex!, while
% \!\pcol@ac@caption@def! makes it \!\let!-equal to \!\pcol@ac@caption!
% which uses the original version temporarily disabling \!\addcontentsline!
% if necessary.
%
% \item[\Uidx{\!\end@float!}]
% is an internal macro to close a \cwise{} float environment. It is used in
% \!\pcol@end@dblfloat! (but never invoked because we havd \cs{if@twocolumn}
% true always).
%
% \item[\Uidx{\!\end@dblfloat!}]
% is an internal macro to close a \pwise{} float environment. It is replaced
% with our own \!\pcol@end@dblfloat!.
%
% \item[\Uidx{\!\@endfloatbox!}]
% is an internal macro to close a \!\vbox! for a float. It is used in
% \!\pcol@end@dblfloat!.
%
% \item[\Uidx{\!\@largefloatcheck!}]
% is an internal macro to examine if a float is too large. It is used in
% \!\pcol@end@dblfloat!.
%
% \item[\Uidx{\!\@floatplacement!}]
% is an internal macro for \!\output! routine to reinitialize \cwise{}
% float placement parameters. It is used in our own version of it,
% \!\pcol@floatplacement!.
%
% \item[\Uidx{\!\@dblfloatplacement!}]
% is an internal macro for \!\output! routine to reinitialize \pwise{}
% float placement paramenters. It is used in \!\pcol@startpage! and
% \!\pcol@output@clear! prior to processing \pwise{} floats in
% \!\@dbldeferlist!. As discussed in
% item-(\ref{item:ovv-float-@dblfloatplacement}) of
% \secref{sec:imp-ovv-float}, this macro in 2015 or later version of
% \LaTeX{} lets $\!\f@depth!=|1sp|$.
%
% \item[\Uidx{\!\@xympar!}]
% is an interal macro to perform the last operations for \!\marginpar!. In
% \!\pcol@zparacol! it is made \!\let!-equal to \!\pcol@xympar! for the
% emulation of \!\marginnote!, while its original version is kept in
% \!\pcol@@xympar!.
%
% \item[\Uidx{\!\p@footnote!}]
% is an internal macro to have the prefix to \!\thefootnote! in the printed
% reference of the counter \counter{footnote}. It is used in
% \!\pcol@fntextbody! to produce \!\@currentlabel!.
%
% \item[\Uidx{\!\@thefnmark!}]
% is an internal macro to have \!\thefootnote!\footnote{
%
% Or \cs{thempfootnote} in \env{minipage} environment.}.
%
% It is used in \!\pcol@fntextbody! to produce \!\@currentlabel!.
%
% \item[\Uidx{\!\@footnotetext!}\marg{text}]
% is an internal macro to implement \!\footnote! and \!\footnotetext! for
% $\arg{text}$. In \!\pcol@zparacol!, it is made \!\let!-equal to
% \!\pcol@fntext!.
%
% \item[\Uidx{\!\@makefntext!}\marg{fn}]
% is an internal macro to typeset the footnote $\arg{fn}$. It is used in
% \!\pcol@fntextbody!\marg{text} to typeset the footnote $\arg{text}$ with
% some other stuff.
%
% \item[\Uidx{\!\@emptycol!}]
% is an internal macro for \!\output! routine to put back an empty page to
% the main vertical list. It is used \!\pcol@output! if a page with floats
% and very short main vertical list is built.
%
% \item[\Uidx{\!\@specialoutput!}]
% is an internal macro for \!\output! routine to process an \!\output!
% request made by \LaTeX's original \!\clearpage!, $\!\end!\Arg{float}$ and
% \!\marginpar!. It is used in \!\pcol@specialoutput! to process the
% request for floats or marginal notes.
%
% \item[\Uidx{\!\@opcol!}]
% is an internal macro for \!\output! routine to output a page or to keep
% the first column until the second one is completed. This macro is used in
% \!\pcol@output! to process a sneaked \!\output! request from outside of
% \env{paracol}, and in \!\pcol@output@end! for the case \pwise{} floats
% are left at \Endparacol{} and they are put in \fpage{}s.
%
% \item[\Uidx{\!\@makecol!}]
% is an internal macro for \!\output! routine to build the ship-out
% image of a column in \!\@outputbox! consisting of top floats, main
% vertical list in \!\box!|255|, footnotes in \!\footins!, and bottom
% floats\footnote{
%
% In p\LaTeX, the order of footnotes and bottom floats are reversed.}.
%
% It is used in \!\pcol@output! to process a sneaked \!\output! request
% from outside of \env{paracol}, in \!\pcol@@makecol! for a \colpage{} to be
% flushed by \!\pcol@flushcolumn! and \!\pcol@makeflushedpage!, in
% \!\pcol@makecol! for an ordinary \colpage{}, and in \!\pcol@output@start!
% and \!\pcol@makenormalcol! for \preenv{}.
%
% \item[\Uidx{\!\@textbottom!}]
% is an internal macro for \!\output! routine to be put at the bottom of
% \!\@outputbox! in which a \colpage{} is stored, by \!\@makecol!. This
% macro is temporarily re\!\def!ined by \!\pcol@makecol! for a \colpage{}
% having \sync{}ation points so that it has a vertical skip of inifinite
% stretch and shrink to push up/down the stuff below the last \sync{}ation
% point in order to adjust its top to the point. After that, its original
% definition kept in \!\pcol@textbottom! is restored. Another modifiers of
% the macro are as follows; \!\pcol@makenormalcol! to make the macro
% \!\let!-equal to \!\relax! temporarily to avoid the insertion of whatever
% the macro has in \!\@makecol!; and \!\pcol@makeflushedpage! to let the
% macro have \!\vfil! temporarily so that empty columns in a \lpage{} are
% made {\em full size} without underfull.
%
% \item[\Uidx{\!\@outputpage!}]
% is an internal macro for \!\output! routine to output a page kept in
% \!\@outputbox! together with the header and footer. The original
% definition of this macro is saved in \!\pcol@@outputpage! to be used in
% \!\pcol@outputpage@l! and \!\pcol@outputpage@r! being callees of our own
% revised version of \!\@outputpage!. Therefore, any \!\output! request to
% result in page ship-out reaches our own \!\@outputpage! and then \LaTeX's
% one after we perform operations for \parapag{}ing and \bgpaint{} onto the
% ship-out image.
%
% \item[\Uidx{\!\@combinefloats!}]
% is an internal macro for \!\output! routine to combine top and bottom
% floats in \!\@toplist! and \!\@botlist! respectively with \!\@outputbox!
% in which the main vertical list and footnotes\footnote{
%
% In p\LaTeX, footnotes are not in \cs{@outputbox} because of the reversal of
% footnotes and bottom floats.}
%
% have been put by \!\@makecol!, and to have the result in \!\@outputbox!
% again. In \!\pcol@zparacol!, it is made \!\let!-equal to our own
% \!\pcol@combinefloats! so that \!\@makecol! and \!\pcol@makenormalcol!
% uses it instead of the original one. However, if \!\pcol@output! finds
% that the \!\output! request for a page break outside \env{paracol} is
% sneaked into our own \!\output! routine, it makes this macro \!\let!-equal
% to \!\pcol@@combinefloats! in which \LaTeX's version is kept so that
% \LaTeX's original \!\output! routine works perfectly as original.
%
% \item[\Uidx{\!\@cflt!}]
% is an internal macro for \!\output! routine to put all top floats in
% \!\@toplist! and related stuff such as the vertical skip of
% \!\textfloatsep! into \!\@outputbox! together with its old contents being
% the main vertical list and footnotes
%
% \addtocounter{footnote}{-1}\footnotemark.
%
% It is used in \!\pcol@combinefloats! if the \colpage{} being processed
% does not have \sync{}ation points.
%
% \item[\Uidx{\!\@cflb!}]
% is an internal macro for \!\output! routine to put all bottom floats in
% \!\@botlist! and related stuff such as the vertical skip of
% \!\textfloatsep! into \!\@outputbox! together with its old contents being
% top floats, the main vertical list and footnotes
%
% \addtocounter{footnote}{-1}\footnotemark.
%
% It is used in \!\pcol@combinefloats!.
%
% \item[\Uidx{$\!\@comflelt!\arg{flt}$}]
% is an internal macro for \!\output! routine to put $\arg{flt}$ being a
% \cwise{} top or bottom float to the tail of \!\@tempboxa! which
% finally has all top\slash bottom floats in a column. It is used in
% \!\pcol@cflt! to apply it to each element of \!\@toplist!.
%
% \item[\Uidx{$\!\@comdblflelt!\arg{flt}$}]
% is an internal macro for \!\output! routine to put $\arg{flt}$ being a
% \pwise{} float to the tail of \!\@tempboxa! which finally has the
% \spanning{} for \pwise{} floats. It is used in \!\pcol@startpage! to
% apply to each element of \!\@dbltoplist! to have the \spanning.
%
% \item[\Uidx{\!\@startcolumn!}]
% is an internal macro for \!\output! routine which tries to build a
% \fcolumn{} for the floats in \!\@deferlist! and, if the column
% is not built, tries to move floats to \!\@toplist! and \!\@botlist!. This
% macro is used in \!\pcol@output! to process a sneaked \!\output! request
% from outside of \env{paracol}, and in \!\pcol@output@end! for the case
% \pwise{} floats are left at \Endparacol{} after which they become
% \cwise{} ones.
%
% \item[\Uidx{$\!\@tryfcolumn!\arg{lst}$}]
% is an internal macro for \!\output! routine which examines if a \fcolumn{}
% or a \fpage{} can be built with some floats in $\arg{lst}$ and, if so,
% builds the page in \!\@outputbox! removing floats put in the page from
% $\arg{lst}$. It is used in \!\pcol@startpage! for \pwise{} floats in
% \!\@dbldeferlist!, and in \!\pcol@startcolumn! for \cwise{} floats in
% $\cc_c(\dl)$.
%
% \item[\Uidx{$\!\@scolelt!\arg{flt}$}]
% is an internal macro for \!\output! routine which examines if a
% \cwise{} float $\arg{flt}$ can be added to \!\@toplist! or
% \!\@botlist! being the list of the floats to be put at the top or bottom
% of a page respectively. Then, if the examination succeeds, $\arg{flt}$ is
% added to \!\@toplist! or \!\@botlist!, while it is added to
% \!\@deferlist! otherwise. It is used in \!\pcol@trynextcolumn! to
% apply to each element of (the copy of) $\cc_c(\dl)$.
%
% \item[\Uidx{$\!\@sdblcolelt!\arg{flt}$}]
% is an internal macro for \!\output! routine which examines if a
% \pwise{} float $\arg{flt}$ can be added to \!\@dbltoplist! being the
% list of the floats to be put at the top of a page, and if so, adds
% $\arg{flt}$ to \!\@dbltoplist!, while it is added to \!\@dbldeferlist! or
% \!\@deferlist! depending on \LaTeX's version otherwise as discussed in
% item-(\ref{item:ovv-float-@addtodblcol}) of \secref{sec:imp-ovv-float}.
% It is used in \!\pcol@startpage! to apply to each element of (the copy of)
% \!\@dbldeferlist!.
%
% \item[\Uidx{\!\@addmarginpar!}]
% is an internal macro for \!\output! routine to add a marginal note. Its
% original definition is kept in \!\pcol@@addmarginpar! and used in
% \!\pcol@addmarginpar! being our own \!\@addmarginpar!.
%
% \item[\Uidx{$\!\@makefcolumn!\arg{lst}$}]
% is an internal macro for \!\output! routine to build a \fcolumn{} with
% some floats at the head of a float list $\arg{lst}$ and to remove the
% floats from the list. It is used in \!\pcol@flushcolumn! and
% \!\pcol@iflushfloats! for $\cc_c(\dl)$ of \cwise{} floats, and in
% \!\pcol@output@clear! for \!\@dbldeferlist! of \pwise{} floats.
% \end{description}
%
%
%
% \subsubsection{Structural Macros}
%
% \begin{description}
% \item[\Uidx{$\!\@elt!\<a_1\>\cdots\<a_n\>$}]
% is an internal control sequence to represent a list element having $n$
% subelements. The sequence is often made \!\let!-equal to a macro which
% processes $\<a_1\>\cdots\<a_n\>$ and is applied to all members in a list.
% It is also made \!\let!-equal to \!\relax! on a manipulation of a list,
% such as element addition and concatenation, by \!\edef! or \!\xdef!. The
% usages of the sequence are as follows.
%
% \begin{itemize}
% \item
% \!\pcol@F@count! \!\def!ines \!\@elt! as a macro to increment
% \!\@tempcnta! by one to measure the cardinality of \!\@freelist!.
%
% \item
% \!\pcol@cflt! lets $\!\@elt!=\!\@comflelt!$ for $\cc_c(\tl)$, and then
% $\!\@elt!=\!\relax!$ to concatenate \!\@freelist! and $\cc_c(\tl)$.
%
% \item
% \!\pcol@setpageno! lets $\!\@elt!=\!\pcol@setpnoelt!$ for $\PP$.
%
% \item
% \!\pcol@setpnoelt! and \!\pcol@setmpbelt! let $\!\@elt!=\!\relax!$ to add
% $\pp(q)$ to $\PP$. It also uses \!\@elt! to \!\def!ine \!\pcol@currpage!
% with $\!\@elt!
% \Arg{\pp^p(q)}\<\pp^i(q)\>\<\pp^f(q)\>\~\Arg{\pp^s(p)}\Arg{\pp^m(p)}$.
%
% \item
% \!\pcol@defcurrpage! lets $\!\@elt!=\!\relax!$ to \!\xdef!ine
% \!\pcol@currpage! with
% $\!\@elt!\Arg{\pp^p(q)}\<\pp^i(q)\>\<\pp^f(q)\>\Arg{\pp^s(p)}\Arg{\pp^m(p)}$.
%
% \item
% \!\pcol@nextpage! lets $\!\@elt!=\!\pcol@nextpelt!$ for $\PP$.
%
% \item
% \!\pcol@getcurrpage! lets $\!\@elt!=\!\pcol@getpelt!$ for $\PPP$.
%
% \item
% \!\pcol@startpage! lets $\!\@elt!=\!\@sdblcolelt!$ for (the copy of)
% \!\@dbldeferlist!, and $\!\@elt!=\!\@comdblflelt!$ for \!\@dbltoplist!. It
% also lets $\!\@elt!=\!\relax!$ for the concatenation of \!\@dbldeferlist!
% and \!\@deferlist!, and that of \!\@freelist! and \!\@dbltoplist!.
%
% \item
% \!\pcol@outputcolumns! lets $\!\@elt!=\!\pcol@outputelt!$ with two arguments
% for (the copy of) $\PP$.
%
% \item
% \begin{Sloppy}{2400}%
% \!\pcol@ioutputelt! \!\def!ines \!\pcol@bg@footnoteheight! and
% \!\pcol@bg@float~height! with \!\@elt! to let painting macros add elements
% in them to have the height of the \bground{} regions $\bgr_{\{n,N\}}$ and
% $\bgr_{\{f,F\}}$ to be painted.
% \end{Sloppy}
%
% \item
% \!\pcol@buildcolseprule! lets $\!\@elt!=\!\pcol@buildcselt@S!$ and then
% $\!\@elt!=\!\pcol@buildcselt!$ for $\pp^s(p)$, and then \!\def!ines
% \!\pcol@bg@columnheight! with \!\@elt! to add $H'_n$ and $\!\@maxdepth!$
% or 0 for the \bground{} region $\bgr_{\{c,g\}}^c(n+1)$ where
% $n=\Abs{\pp^s(p)}$.
%
% \item
% \!\pcol@buildcselt@S! \!\def!ines \!\pcol@bg@spanningtop! and
% \!\pcol@bg@spanning~height! with \!\@elt! to define the region
% $\bgr_S(i)$.
%
% \item
% \begin{Hfuzz}{0.55pt}
% \!\pcol@buildcselt! \!\def!ines \!\pcol@bg@columnheight!,
% \!\pcol@bg@spanningtop! and \!\pcol@bg@spanningheight! with \!\@elt! to
% define regions $\bgr_{\{c,g\}}^c(i)$ and $\bgr_s(i)$.
% \end{Hfuzz}
%
% \item
% $\!\pcol@bg@calculate!\arg{z}\arg{z_0}\Arg{F}$ lets
% $\!\@elt!=\!\pcol@bg@advance!$ to let $\!\@elt!\arg{f}$ in $F$ do
% $z\gets z+f$.
%
% \item
% $\!\pcol@bg@negative!\Arg{F^-}$ lets $\!\@elt!=\!\pcol@bg@nadvance!$ to
% let $\!\@elt!\arg{f}$ in $F^-$ do $z\gets z-f$, and then lets
% $\!\@elt!=\!\pcol@bg@advance!$ to go back to addition.
%
% \item
% \!\pcol@output@start! lets all floats $f$ imported in \!\@dbldeferlist!
% have depth 0 by \!\def!ining $\!\@elt!\arg{f}$ to do it, \!\edef!ines
% \!\pcol@bg@textheight! with \!\@elt! having height-plus-depth of
% \preenv{} for \bgpaint{} of it, and \!\def!ines $\pp^m(0)$ having one
% element in $\mpb_L^l$ or $\mpb_L^r$ for \!\@mparbottom! in \preenv{}.
%
% \item
% \!\pcol@makenormalcol! lets $\!\@elt!=\!\relax!$ to concatenate
% \!\@freelist! and \!\@midlist!.
%
% \item
% \!\pcol@trynextcolumn! lets $\!\@elt!=\!\@scolelt!$ for (the copy of)
% $\cc_c(\dl)$.
%
% \item
% \!\pcol@setcurrcol! lets $\!\@elt!=\!\relax!$ to \!\xdef!ine $\cc_c$ with
% $\cc_c(\tl)=\!\@toplist!$, $\cc_c(\ml)=\!\@midlist!$,
% $\cc_c(\bl)=\!\@botlist!$ and $\cc_c(\dl)=\!\@deferlist!$.
%
% \item
% \!\pcol@scancst! and \!\pcol@iscancst! let $\!\@elt!=\!\relax!$ to
% \!\edef!ine the list $M=(m\,\Bar\,\mceltpop_{j,m}\in\cstraw,\;j\geq i)$ for
% $\mceltpop_{i,*}$, and then the latter \!\def!ines \!\@elt! as a macro with
% an argument $m$ to examine $m\in M$ for $\mcelt_{i,m}$.
%
% \item
% \!\pcol@addmarginpar! lets $\!\@elt!=\!\pcol@setmpbelt!$ for $\PPP$.
%
% \item
% \!\pcol@getmparbottom! lets $\!\@elt!=\!\pcol@getmpbelt!$ for the list
% $\mpb_{\{L,R\}}^{\{l,r\}}$. It also lets $\!\@elt!=\!\relax!$ for the
% addition of $\mpar(h_i,t_i)$ to the list by itself and
% \!\pcol@getmpbelt!.
%
% \item
% \!\pcol@mparbottom@zero! has \!\@elt! in its body to have $\mpar(0,0)$ for
% each $M\in\Set{\mpb_X^x}{X\in\{L,R\},x\in\{l,r\}}$ the macro has.
%
% \item
% $\!\pcol@bias@mpbout@i!\Arg{y}\!\@elt!\Arg{t}\Arg{b}\!\@nil!$ has \!\@elt!
% in its argument specification, and \!\def!ines \!\reserved@b! with
% \!\@elt! for $\mpar(t+y,b+y)$.
%
% \item
% \begingroup\def\,{\mskip0mu plus2mu\relax}
% $\!\pcol@getmparbottom@last@i!\,
% \Arg{y}\,\mpar(t_1,b_1)\,\cdots\,\mpar(t_n,b_n)\,\!\@nil!$ at first
% \!\def!\-ines \!\reserved@b! with \!\@elt! for $\mpar(y,y)$ and then
% \!\def!ines \!\@elt! to do it for $\mpar(t_i,b_i)$ for all $i\in[1,n]$.
% \endgroup
%
% \item
% \!\pcol@makefcolumn! lets $\!\@elt!=\!\pcol@makefcolelt!$ for (the copy
% of) $\cc_c(\dl)$ to examine if each float in it can be put in a \fcolumn{}
% to be built, and then \!\def!ine it to put floats in $\cc_c(\tl)$ into
% $\cc_c(\vb^b)$.
%
% \item
% \!\pcol@addflhd! lets $\!\@elt!=\!\pcol@hdflelt!$ for its argument
% $\cc_c(\tl)$ or $\cc_c(\bl)$, and then $\!\@elt!=\!\relax!$ to give the
% default.
%
% \item
% \!\pcol@makeflushedpage! \!\edef!ines \!\pcol@bg@floatheight! with
% \!\@elt! letting it be \!\relax!.
%
% \item
% \!\pcol@imakeflushedpage! \!\def!ines \!\pcol@bg@footnoteheight! with
% \!\@elt!.
%
% \item
% \!\pcol@output@end! uses \!\@elt! in the argument specification of the
% \!\def!inition of \!\pcol@do@mpbout@elem!, lets $\!\@elt!=\!\relax!$ to
% add the \spanning{} of the last page to the head of \!\@dbldeferlist!, and
% uses it in the body of \!\pcol@bg@textheight! and
% \!\pcol@bg@footnoteheight! to be \!\def!ined for \bgpaint{} of
% \Scfnote{}s.
%
% \item
% \begin{Hfuzz}{0.14pt}%
% \!\pcol@zparacol! lets $\!\@elt!=\!\pcol@remctrelt!$ for $\CG$,
% $\!\@elt!=\!\pcol@thectrelt!$ for $\CTL$, $\!\@elt!=\!\pcol@loadctrelt!$
% for $\Cc_0$, $\!\@elt!=\!\pcol@cmpctrelt!$ for $\CTL$,
% $\!\@elt!=\!\pcol@defcomelt!$ for \!\pcol@localcommands!, and then
% $\!\@elt!=\!\relax!$ to give the default.
% \end{Hfuzz}
%
% \item
% \!\globalcounter!\marg{ctr} defeines \!\@elt!\marg{\theta} for $\CG$ to
% check if there is $\theta\in\CG$ such that $\theta=\arg{ctr}$.
%
% \item
% \!\pcol@localcommands! has the sequence of $\!\@elt!\ARg{com}$ for all
% \lcommand{}s $|\|\arg{com}$.
%
% \item
% \!\pcol@gcounters! has \!\@elt!|{page}| as its initial definition.
%
% \item
% $\!\pcol@removecounter!\arg{\Theta'}\arg{\theta}$ lets
% $\!\@elt!=\!\pcol@iremctrelt!$ for (the copy of) its argument
% $\mathit{\Theta}'$ to remove $\theta$ from it.
%
% \item
% $\!\pcol@sscounters!\arg{elt}$ lets $\!\@elt!=\arg{elt}$, where
% $\arg{elt}=\!\pcol@storectrelt!$ or $\arg{elt}=\!\pcol@savectrelt!$, for
% $\CTL$, and then $\!\@elt!=\!\relax!$ to \!\xdef!ine $\Cc_c$.
%
% \item \begingroup\hfuzz1.4pt
% $\!\pcol@com@synccounter!\<\theta\>$ gives $\!\@elt!\Arg{\theta}$ as the
% argument of |\pcol@synccounter|.
%
% \SpecialIndex{\pcol@synccounter}
% \par\endgroup
%
% \item \begingroup\hfuzz0.51pt
% $\!\pcol@synccounter!\arg{lst}$ lets $\!\@elt!=\!\relax!$ to have the list
% $\arg{lst}$ in \!\reserved@a! by \!\edef!, $\!\@elt!=\!\pcol@loadctrelt!$
% for $\CC_c$, and then $\!\@elt!=\!\pcol@syncctrelt!$ for $\arg{lst}$.
% \par\endgroup
%
% \item
% $\!\pcol@stepcounter!\<\theta\>$ lets $\!\@elt!=\!\pcol@stpldelt!$ for
% $\CTL$, $\!\@elt!=|\pcol@|\~|stpclelt|$
%
% \SpecialIndex{\pcol@stpclelt}
%
% for $\clist(\theta)$, and then $\!\@elt!=\!\@stpelt!$ for
% $\clist(\theta)$.
%
% \item
% \!\pcol@switchcol! lets $\!\@elt!=\!\pcol@setctrelt!$ for $\CC_c$,
% $\!\@elt!=|\pcol@|\~|aconlyelt|$
%
% \SpecialIndex{\pcol@aconlyelt}
%
% for $\T$, and then $\!\@elt!=\!\relax!$ to give the default.
%
% \item
% \!\pcol@icolumncolor! \!\def!ines $\!\@elt!\arg{\celtshadow_i}$ to apply
% \!\reset@color! for rewinding and \!\pcol@set@color! for reestablishing
% to each $\celtshadow_i\in\CSTshadow^c=(\Celtshadow^c,\cstshadow)$
% by \!\pcol@scancst@shadow!, in which \!\@elt! is explicitly applied to
% $\Celtshadow^c$ if it is defined and then implicitly done to
% $\cstshadow=\!\pcol@colorstack@shadow!$.
%
% \item
% \!\pcol@set@color@push! lets $\!\@elt!=\!\relax!$ to push a color
% information into $\cstshadow$, with save\slash restore of its original
% value.
%
% \item
% \!\resetbackgroundcolor! lets $\!\@elt!=\!\pcol@resetbackgroundcolor!$ to
% scan \!\pcol@bg@defined! containing $\!\@elt!\Arg{a'_i}$ to let
% $|\pcol@bg@color|{\cdot}a'_i$ for each of $i$.
%
% \SpecialArrayIndex{a}{\pcol@bg@color@}
% \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
% \end{itemize}
%
% \item[\Uidx{\!\@empty!}]
% is a macro always having nothing. Its major usages are to examine if a
% macro often having a list is empty, and to make such a macro empty. The
% following macros use \!\@empty! to examine the emptiness of the objects in
% parentheses.
%
% \begin{quote}
% \!\pcol@combinefloats! ($\cc_c(\tl)$, $\cc_c(\bl)$)\\
% \!\pcol@checkshipped! ($S_c$)\\
% \!\pcol@startpage! ($\pp(\ptop)$, \!\@dbltoplist!)\\
% \!\pcol@makenormalcol! (\!\@botlist! in \preenv)\\
% \!\pcol@getmparbottom! ($\pp^m(p)$)\\
% \!\pcol@getmparbottom@last! ($\pp^m(\ptop)$)\\
% \!\pcol@setmpbelt! ($\pp^m(p)$)\\
% \!\pcol@flushcolumn! ($\cc_c(\dl)$)\\
% \!\pcol@makefcolumn! ($\cc_c(\tl)$, $\cc_c(\dl)$)\\
% \!\pcol@measurecolumn! ($\cc_c(\bl),\cc_c(\dl)$)\\
% \!\pcol@addflhd! ($\cc_c(\tl)$, $\cc_c(\bl)$)\\
% \!\pcol@synccolumn! ($\cc_c(\tl)$)\\
% \!\pcol@makeflushedpage! ($\cc_c(\dl)$)\\
% \!\pcol@imakeflushedpage! ($\cc_c(\dl)$)\\
% \!\pcol@iflushfloats! ($\cc_c(\dl)$)\\
% $\!\pcol@setcw@getspec@i!\arg{default}\<x'_d\>$ ($x'_d$)\\
% $\!\pcol@setcw@fill!\<f\>\!\fill!$ ($f$)
% \end{quote}
%
% The following macros use \!\@empty! to empty the objects in parentheses.
%
% \begin{quote}
% \!\pcol@cflt! ($\cc_c(\tl)$)\\
% \!\pcol@setpageno! ($\PP$, $\pp(\ptop)$)\\
% \!\pcol@startpage! ($\cc_c(\dl)$, \!\@dbldeferlist!, \!\@deferlist!,
% \!\@dbltoplist!)\\
% \!\pcol@trynextcolumn! ($\cc_c(\dl)$)\\
% \!\pcol@output@start! ($\PP$, $\pp(\ptop)$, $\cc_c(\dl)$)\\
% \!\pcol@makenormalcol! (\!\@midlist! in \preenv)\\
% \!\pcol@addmarginpar! ($\PP$, $\pp(\ptop)$)\\
% \!\pcol@getmparbottom! ($\mpb_{\{L,R\}}^{\{l,r\}}$)\\
% \!\pcol@makefcolumn! ($\cc_c(\dl)$, $\cc_c(\tl)$)\\
% \!\pcol@makeflushedpage! ($\cc_c(\tl)$)\\
% \!\pcol@freshpage! ($\PP$, $\pp(\ptop)$)\\
% \!\pcol@zparacol! (\!\@gtempa!)\\
% \!\pcol@removecounter!$\<\mathit{\Theta}'\>\Arg{\theta}$
% ($\mathit{\Theta}'\in\{\CG,\CL\}$)\\
% \!\pcol@sscounters! ($\Cc_c$)
% \end{quote}
%
% \item[\Uidx{\!\@currentlabel!}]
% is an internal macro to have the reference to be associated with the
% \!\label! following it. It is defined in \!\pcol@fntextbody! to have the
% reference to the footnote with \!\@thefnmark!.
%
% \item[\Uidx{\!\ext@figure!}]
% is an internal macro having ``|lof|'' being the extention of the file for
% list of figures. It is used in
% $\!\pcol@ac@caption!\arg{type}|[|\arg{lcap}|]|\<cap\>$ to have ``|lof|''
% when $\arg{type}=|figure|$.
%
% \item[\Uidx{\!\ext@table!}]
% is an internal macro having ``|lot|'' being the extention of the file for
% list of tables. It is used in
% $\!\pcol@ac@caption!\arg{type}|[|\arg{lcap}|]|\<cap\>$ to have ``|lot|''
% when $\arg{type}=|table|$.
%
% \item[\Uidx{\!\@currbox!}]
% is an internal macro which conventionally has an \!\insert! for floats,
% etc. The follwing macros use \!\@currbox! having the objects in
% parentheses.
%
% \begin{quote}
% \!\pcol@opcol! ($\cc_c(\vb)$)\\
% \!\pcol@startpage! ($\pp^i(\ptop)$)\\
% \!\pcol@ioutputelt! ($\s_c(q)$)\\
% \!\pcol@output@start! ($\pp^i(0)$, $\cc_c(\vb)$, $\Celt^c$)\\
% \!\pcol@output@switch! ($\cc_c(\vb)$)\\
% \!\pcol@restartcolumn! ($\cc_c(\vb)$)\\
% \!\pcol@igetcurrcol! ($\cc_c(\vb)$)\\
% \!\pcol@setcurrcol! ($\cc_c(\vb)$)\\
% \!\pcol@putbackmvl! ($\cc_c(\vb)$)\\
% \!\pcol@iscancst! ($\Celt^c$)\\
% \!\pcol@addmarginpar! (left marginal note)\\
% \!\pcol@flushcolumn! ($\cc_c(\vb), \s_c(q)$)\\
% \!\pcol@makefcolumn! ($\cc_c(\vb)$)\\
% \!\pcol@measurecolumn! ($\cc_c(\vb)$)\\
% \!\pcol@synccolumn! ($\cc_c(\vb)$)\\
% \!\pcol@imakeflushedpage! ($\cc_c(\vb)$)\\
% \!\pcol@freshpage! ($\cc_c(\vb)$)\\
% \!\pcol@output@end! (top float, $\cc_c(\vb)$)\\
% \!\pcol@end@dblfloat! (\pwise{} float)\\
% \!\pcol@icolumncolor! ($\Celt^c$)
% \end{quote}
%
% \item[\Uidx{\!\@marbox!}]
% is an internal macro which has an \!\insert! for left marginal notes. It
% is used in \!\pcol@xympar!.
%
% \item[\Uidx{\!\@currlist!}]
% is an internal macro which has an list of \!\insert!s for floats and
% marginal notes given to \!output!. It is used in \!\pcol@addmarginpar! to
% get the right marginal note from its head.
%
% \item[\Uidx{\!\@freelist!}]
% is an internal macro having available \!\insert!s for floats originially,
% but also \colpage{}s, \spanning{}, footnotes and default column-color in
% our usage. Besides the acquisition of an \!\insert! from it shown in the
% description of \!\@next!, it is used by the following macros to return the
% the objects in parentheses to \!\@freelist!.
%
% \begin{quote}
% \!\pcol@cflt! ($\cc_c(\tl)$)\\
% \!\pcol@startpage! (\!\@dbltoplist!)\\
% \!\pcol@outputelt! ($\pp^i(q)$)\\
% \!\pcol@ioutputelt! ($\pp^i(q)$, $\pp^f(q)$, $\s_c(q)$)\\
% \!\pcol@startcolumn! ($\pp^f(\ptop)$)\\
% \!\pcol@output@start! ($\cc_0(\vb)$)\\
% \!\pcol@makenormalcol! (\!\@midlist! in \preenv)\\
% \!\pcol@restartcolumn! ($\cc_c(\vb)$, $\pp^f(p)$ or $\cc_c(\ft)$)\\
% \!\pcol@savefootins! ($\pp^f(p)$ or $\cc_c(\ft)$)\\
% \!\pcol@flushcolumn! ($\cc_c(\ft)$)\\
% \!\pcol@makefcolpage! ($\cc_c(\tl)$)\\
% \!\pcol@makeflushedpage! ($\pp^i(\ptop)$, $\pp^f(\ptop)$)\\
% \!\pcol@imakeflushedpage! ($\cc_c(\ft)$)\\
% \!\pcol@output@end! ($\pp^f(\ptop)$, $\cc_c(\vb)$, $\Celt^c$)
% \end{quote}
%
% In addition \!\pcol@F@count! scans its element to have its cardinality.
%
% \item[\Uidx{\!\@nil!}]
% is an internal control sequence which is conventionally used to terminate
% a variable length argument. It is used in the following macros.
%
% \begin{itemize}
% \item
% \!\pcol@getcurrpinfo! for the invocation of \!\@cdr!.
%
% \item
% $\!\pcol@bias@mpbout@i!\Arg{y}\!\@elt!\Arg{t}\Arg{b}\!\@nil!$ to capture
% $t$ and $b$ following the convention in \!\pcol@do@mpb@all@ii!.
%
% \item
% \begingroup\def\,{\mskip0mu plus2mu\relax}
% $\!\pcol@getmparbottom@last@i!\,
% \Arg{y}\,\mpar(t_1,b_1)\,\cdots\,\mpar(t_n,b_n)\,\!\@nil!$ to capture
% $\mpar(t_i,b_i)$ for all $i\in[1,n]$.
% \endgroup
%
% \item
% $\!\pcol@do@mpb@all@i!
% \Arg{\mpb_L^l}\Arg{\mpb_L^r}\Arg{\mpb_R^l}\Arg{\mpb_R^r}$ to terminate the
% list $M\in\Set{\mpb_X^x}{X\in\{L,R\},x\in\{l,r\}}$ in the invocation of
% \!\pcol@do@mpb@all@ii!.
%
% \item
% $\!\pcol@do@mpb@all@ii!
% \Arg{y}\mpar(t_1,b_1)\cdots\mpar(t_n,b_n)\!\@nil!$ to capture
% $\mpar(t_i,b_i)$ for all $i\in[1,n]$, and then to terminate them
% passed to \!\pcol@bias@mpbout@i! or \!\pcol@getmparbottom@last!.
%
% \item
% \!\pcol@setcw@scan! for the invocation of\\\mbox{}\qquad
% $\!\pcol@setcw@getspec!\<w'_d\>|/|\<g'_d\>|/|\arg{garbage}\~\!\@nil!$.
%
% \item
% \!\pcol@setcw@getspec@i! for the invocation of\\\mbox{}\qquad
% $\!\pcol@extract@fil!\<n\>| plus |\<f\>| minus|\arg{garbage}\!\@nil!$\\
% and thus in the \!\def!inition of it in \!\pcol@def@extract@fil!.
%
% \item
% \!\pcol@defkw! has \!\@nil! in its argument specification to terminate the
% argument $0\,|pt|\ |plus|\ 1\,|fil|\ |minus|\ 1\,|fil|$.
%
% \item
% \!\pcol@extract@fil@i!, \!\pcol@extract@fil@ii! and
% \!\pcol@extract@fil@iii! have \!\@nil! in their argument specifications as
% the terminator, and thus \!\@nil! appears in their invocations in
% \!\pcol@extract@fil!, \!\pcol@extract@fil@i! and \!\pcol@extract@fil@ii!
% respectively, and in the \!\def!inition of \!\pcol@extract@fil@iii! in
% \!\pcol@def@extract@fil@iii!.
%
% \item
% \!\pcol@iadjustfnctr! and \!\pcol@iifootnotetext! to terminate their
% argument |[|$[|+-|]\meta{disp}$|]| passed to \!\pcol@calcfnctr!.
%
% \item
% \!\backgroundcolor! and \!\nobackgroundcolor! to terminate their first
% argument given to \!\pcol@backgroundcolor! so that its descendants
% \!\pcol@backgroundcolor@x! and \!\pcol@backgroundcolor@z! finally capture
% everything not processed by their ancestors.
% \end{itemize}
%
% \item[\Uidx{\!\current@color!}]
% is an internal macro having color information to be put into |.dvi| as a
% part of the argument of coloring \!\special!. It is referred to by
% \!\pcol@bg@paintregion@i!,
% \!\pcol@output@start!,
% \!\pcol@icolumncolor!,
% \!\pcol@iicolumncolor!, and
% \!\pcol@set@color@push!,
% \!\pcol@backgroundcolor@y!.
%
% \item[\Uidx{\!\@dbldeferlist!}]
% is an internal macro having the list of \pwise{} floats whose page
% appearance are not yet fixed. It is scanned and then updated in
% \!\pcol@startpage! and \!\pcol@output@clear!, while \!\pcol@output@start!
% lets it have \!\@deferlist! made before \beginparacol, and
% \!\pcol@output@end! adds \pwise{} floats to be put in the empty
% \lpage{} to it and then move the whole of the list to \!\@deferlist!.
% As discussed in \secref{sec:imp-ovv-float}, 2015 or later version of
% \LaTeX{} no longer uses this list, but we stick with it for \pwise{}
% floats produced in \env{paracol} environments and thus have its top level
% definition with empty body in \Paracol.
%
% \item[\Uidx{\!\@dbltoplist!}]
% is an internal macro having the list of \pwise{} floats which
% \!\@sdblcolelt! decided to be put in the new page. The macro
% \!\pcol@startpage! scans it to put all floats into the page $\ptop$ as its
% \spanning{} $\pp^i(\ptop)$, and then empties it after returning all floats
% to \!\@freelist!.
%
% \item[\Uidx{\!\@deferlist!}]
% is an internal macro having the list of \cwise{} floats whose page
% appearance are not yet fixed. It is scanned and then updated in
% \!\pcol@startcolumn!, \!\pcol@trynextcolumn!, \!\pcol@flushcolumn!,
% \!\pcol@makefcolumn! and \!\pcol@iflushfloats!, while the following macros
% also act on it.
%
% \begin{itemize}
% \item
% \!\pcol@output@start! moves it to \!\@dbldeferlist! because it is created
% before \beginparacol.
%
% \item
% \!\pcol@startpage! uses it as the interface with \!\@addtodblcol! of 2015
% or later version of \LaTeX{} as discussed in
% item-(\ref{item:ovv-float-@addtodblcol}) of
% \secref{sec:imp-ovv-float}.
%
% \item
% \!\pcol@setcurrcol! and \!\pcol@igetcurrcol! saves\slash restores it
% into/from $\cc_c(\dl)$, respectively.
%
% \item
% \!\pcol@makefcolelt!$\arg{flt}$ returns $\arg{flt}$ to the list if
% $\arg{flt}$ cannot be put in the \fcolumn{} which the macro is working on.
%
% \item
% \!\pcol@measurecolumn! examines its emptiness to let
% $\CSIndex{ifpcol@dfloats}=\true$ iff not empty.
%
% \item
% \!\pcol@output@end! lets it have \!\@dbldeferlist! so that it processed as
% \cwise{} floats after \Endparacol.
% \end{itemize}
%
% \item[\Uidx{\!\@toplist!}]
% is an internal macro having the list of \cwise{} floats which is
% decided to be put at the top of the \ccolpage{} by float environments or by
% \!\pcol@trynextcolumn!. This list is scanned by \!\pcol@cflt! if its
% invoker \!\pcol@combinefloats! finds the macro is not empty. The list is
% also scanned by \!\pcol@makecol!, \!\pcol@output@switch! and
% \!\pcol@measurecolumn! using \!\pcol@addflhd! for the measurement of the
% combined size of top floats, while \!\pcol@setcurrcol! and
% \!\pcol@igetcurrcol! saves\slash restores the list into/from $\cc_c(\tl)$
% respectively. In addition our macros may add an element or build the
% entire list in the following two cases. One case is for a \sync{}ation
% for which \!\pcol@synccolumn! lets the main vertical list in
% $\cc_c(\vb^b)$ be a float, namely {\em\mvlfloat} to be added to this list.
% Another case is for a \fcolumn{} in the \lpage{} for which
% \!\pcol@makefcolumn! and \!\pcol@makefcolelt! build this list for deferred
% floats. In the latter case, the list is scanned by \!\pcol@makefcolpage!
% invoked from \!\pcol@makefcolumn! itself, \!\pcol@flushcolumn! and
% \!\pcol@makeflushedpage!.
%
% \item[\Uidx{\!\@botlist!}]
% is an internal macro having the list of \cwise{} floats which is
% decided to be put at the bottom of the \ccolpage{} by float environments or
% by \!\pcol@trynextcolumn!. The emptiness of this list examined by
% \!\pcol@combinefloats! to invoke the scanner \!\@cflb! unless empty,
% by \!\pcol@output@start! to calculate the room for each \colpage{} in the
% \spage, and by \!\pcol@makenormalcol! to decide whether \!\@makecol! is
% used or not for building \preenv. The list is also scanned by
% \!\pcol@measurecolumn! for the measurement of the combined size of bottom
% floats, while \!\pcol@setcurrcol! and \!\pcol@igetcurrcol! saves\slash
% restores the list into/from $\cc_c(\bl)$ respectively.
%
% \item[\Uidx{\!\@midlist!}]
% is an internal macro having the list of in-text floats which has already
% been put in the \ccolpage{} but is kept to check the ordering of the
% succeeding floats. The list is emptied by \!\pcol@makenormalcol! after
% returning all elements in it to \!\@freelist!, while \!\pcol@setcurrcol!
% and \!\pcol@igetcurrcol! saves\slash restores the list into/from
% $\cc_c(\ml)$ respectively.
%
% \item[\Uidx{\!\f@depth!}]
% is an internal macro having |1sp| or being \!\let!-equal to \!\z@! to
% specify the float category, \pwise{} or \cwise{} respectively, which
% float-related macros work on. As discussed in
% item-(\ref{item:ovv-float-@dblfloatplacement}) of
% \secref{sec:imp-ovv-float}, this feature introduced in 2015 version
% of \LaTeX{} is nullified in \env{paracol} environments and thus the
% setting with |1sp| done by \!\@dblfloatplacement! is overriden by
% \!\pcol@startpage! and \!\pcol@output@clear! when they invoke the macro.
%
% \item[\Uidx{\!\cl@@ckpt!}]
% is an internal macro having the list of all counters defined by
% \!\newcounter! and the counter \counter{page}. The original usage of this
% macro is to log the values of all counters into |.aux| by \!\include!, but
% we use it to obatin all counters in \!\pcol@zparacol! and
% \!\pcol@globalcounter@s!.
%
% \item[$\cs{cl@}{\cdot}\theta$]
% is an internal macro having the list $\clist(\theta)$ of descendant
% counters of the counter $\theta$ whose increment by \!\stepcounter! lets
% them 0. The macro \!\pcol@remctrelt! moves it to
% $|\pcol@cl@|{\cdot}\theta$
%
% \Uidx{\SpecialArrayIndex{\theta}{\cl@}}
%
% and re\!\def!ines it to have $\!\pcol@stepcounter!\Arg{\theta}$.
%
% \item[\Uidx{\!\reserved@a!}]
% is an internal macro for temporary use. Its usages are as follows.
%
% \begin{itemize}
% \item
% In \!\pcol@Fe!, it is used to keep the cardinality of \!\@freelist! in
% \!\pcol@F@n! to log it by \!\pcol@FF! after \!\pcol@F@n! is let have
% another measurement result.
%
% \item
% In $\!\pcol@iLogLevel!\<l\>\arg{name}$, it is used to implement
% $\!\let!|\|\arg{name}=|\|\arg{name}{\cdot}l'$ where $l'$ is the roman
% representation of the level $l$.
%
% \item
% In \!\pcol@setpageno!, it has $\PPP$ so that we update $\PP$ and
% $\pp(\ptop)$ scanning their original contents.
%
% \item
% In \!\pcol@getcurrpinfo!, it has $\pp(\ptop)$ so that we give its five
% components to \!\pcol@getpinfo! as its first five arguments.
%
% \item
% In \!\@outputpage!, it has a sequence of \bgpaint{} for both left and
% right \parapag{}es to be shipped out outside \env{paracol} environment.
%
% \item
% In \!\pcol@outputpage@ev!, it has the expansion result of
% \!\meaning!\!\yoko! to be compared with \!\reserved@b! having
% \!\string!\!\yoko! for examining if \!\yoko! is a primitive of underlying
% \TeX{}.
%
% \item
% In $\!\pcol@bg@paintregion!\arg{a}\arg{c}$, it is let have
% $a'=a{\cdot}|@|{\cdot}c$ or $a'=a$, and then referred to by
% \!\pcol@bg@paintregion@i! to use $|\pcol@bg@color|{\cdot}a'$, and by
% $\!\pcol@bg@addext!\arg{z}\Arg{s}\Arg{d}$ to use
% $|\pcol@bg@ext@|{\cdot}d{\cdot}|@|{\cdot}a'$.
%
% \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
% \SpecialArrayIndex{a}{\pcol@bg@color@}
% \SpecialArrayIndex{d{\cdot}\string\texttt{@}
% {\cdot}a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@ext@}
% \SpecialArrayIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
%
% \item
% In \!\pcol@specialoutput!, it is \!\let!-equal to $|\pcol@output@|{\cdot}f$
% corresponding to $\!\outputpenalty!=|\pcol@op@|{\cdot}f$, or
% \!\@specialoutput!.
%
% \item
% In \!\pcol@output@start!, it is let have a \bgpaint{} macro
% \!\pcol@bg@paintbox! and the definition of a parameter
% \!\pcol@bg@textheight! for it.
%
% \item
% In \!\pcol@output@switch!, it is \!\let!-equal to \!\@nobreaktrue! or
% \!\@nobreakfalse! according to \CSIndex{if@nobreak} in the leaving column
% to broadcast it to other columns.
%
% \item
% In \!\pcol@ifempty!$\arg{box}\arg{then}\arg{else}$, it has $\arg{then}$ or
% $\arg{else}$ according to the emptiness of $\arg{box}$.
%
% \item
% In \!\pcol@clearcolorstack!, it is \!\def!ined to put an uncoloring
% \!\special! by \!\reset@color! for its argument $\celt_i$ in
% \!\pcol@iscancst!.
%
% \item
% In \!\pcol@restorecst!, it is \!\def!ined to put a coloring \!\special! in
% its argument $\celt_i$ by \!\unvbox! done in \!\pcol@iscancst!.
%
% \item
% In \!\pcol@addmarginpar!, at first it is made let equal to 0 or $\CL$
% according to $c<\CL$ or not. Then it is let have $\PPP$ to be scanned to
% find $\pp^m(p)$.
%
% \item
% In \!\pcol@getmparbottom@i!, it is let have one of
% $\mpb_{\{L,R\}}^{\{l,r\}}$ according to the side margin which the marginal
% note to be added goes to, and then it is referred to by
% \!\pcol@getmparbottom!.
%
% \item
% In \!\pcol@setmpbelt@i!, it is let have what $\pp^m(p)$ should have after
% the update of a list of marginal notes in it, and then \!\pcol@setmpbelt!
% updates $\pp(p)$ with the new $\pp^m(p)$ in the macro.
%
% \item
% In $\!\pcol@bias@mpbout!\Arg{y}$ and $\!\pcol@getmparbottom@last!\Arg{y}$,
% it is let have $\!\pcol@bias@mpbout@i!\Arg{y}$ and
% $\!\pcol@getmparbottom@last@i!\Arg{y}$ respectively, so that they are
% invoked in \!\pcol@do@mpb@all@ii!.
%
% \item
% In \!\pcol@makeflushedpage!, it is let have an invocation of
% \!\pcol@bg@paintbox! for \pwise{} floats in $\pp^i(\ptop)$ together with
% the condition of the \bgpaint.
%
% \item
% In \!\pcol@output@end!, it is let have the invocation of
% \!\pcol@bg@paintbox! for \bgpaint{} of \Scfnote{}s with the condition to
% do it and a \!\def!inition of \!\pcol@bg@footnoteheight!.
%
% \item
% In $\!\pcol@defcomelt!\arg{com}$, it is used to implement
% $\!\let!|\|\arg{com}=|\pcol@com@|{\cdot}\~\arg{com}$.
%
% \item
% In \!\pcol@setcolumnwidth!, it is made \!\let!-equal to
% \!\pcol@setcolwidth@s! or \!\pcol@setcolwidth@r! according to
% $\!\pcol@columnratioleft!=\!\relax!$ or not.
%
% \item
% In \!\pcol@setcolwidth@r!, it is used to have the fraction $r_d$ being a
% comma-seperated list element in its argument $\arg{ratio}$ defined by
% \!\columnratio! and scanned by a \!\@for! loop.
%
% \item
% In $\!\pcol@setcw@scan!\<\Cfrom\>\<\Cto\>\Arg{spec}$, at first it is let
% have $\arg{spec}$, then the result of adding `|,|' as many as
% $\Cto-\Cfrom$ to the tail, and finally each element in the extended
% $\arg{spec}$ in a \!\@for! loop.
%
% \item
% In $\!\pcol@setcw@getspec@i!\arg{default}\<x'_d\>$, it is let have
% $\<x'_d\>$ from which all space tokens are removed.
%
% \item
% In \!\pcol@setcw@calcfactors!, it is used as a waste bascket to throw away
% $(\WT-W)/(F\times1\,|pt|)$ calculated by \!\pcol@setcw@calcf!.
%
% \item
% In $\!\pcol@extract@fil@i!\<n\>|.|\<m{\cdot}\mathit{unit}\>\!\@nil!$, it has
% $\<n\>|.|\<m{\cdot}\mathit{unit}\>$, and is referred to by
% \!\pcol@extract@fil@ii!.
%
% \item
% In \!\globalcounter!\marg{ctr}, it is used to have $\arg{ctr}$ for the
% \CSIndex{ifx}-comparison with each $\theta\in\CG$.
%
% \item
% In $\!\pcol@remctrelt!\<\theta\>$, it is used to implement
% $\!\let!|\pcol@cl@|{\cdot}\theta=|\cl@|{\cdot}\theta$,
%
% \SpecialArrayIndex{\theta}{\pcol@cl@}\SpecialArrayIndex{\theta}{\cl@}
%
% \item
% In $\!\pcol@removecounter!\<\mathit{\Theta}'\>\Arg{\theta}$, it is used to
% have $\theta$ for the \CSIndex{ifx}-comparison in \!\pcol@iremctrelt!.
%
% \item
% In $\!\pcol@thectrelt!\<\theta\>$, it is used to implement
% $\!\let!|\pcol@thectr@|{\cdot}\theta=|\the|{\cdot}\theta$,
%
% \SpecialArrayIndex{\theta}{\pcol@thectr@}\SpecialArrayIndex{\theta}{\the}
%
% and then is made \!\let!-equal to $|\pcol@thectr@|{\cdot}\theta{\cdot}0$.
%
% \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
%
% \item
% In $\!\pcol@synccounter!\arg{lst}$, it has $\arg{lst}$.
%
% \item
% In $\!\pcol@setctrelt!\<\theta\>\<\val_c(\theta)\>$, it is made
% \!\let!-equal to $|\pcol@thectr@|{\cdot}\theta$
%
% \SpecialArrayIndex{\theta}{\pcol@thectr@}
%
% or
% $|\pcol@thectr@|{\cdot}\theta{\cdot}c$.
%
% \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
%
% \item
% In \!\pcol@switchenv!, it is used to save \!\switchcolumn! which is
% redefined in the macro, and then to invoke \!\switchcolumn! with the
% original definition.
%
% \item
% In \!\pcol@fntext!\marg{text}, it is \!\let!-equal to \!\pcol@fntextother!
% or \!\pcol@fntext~top! according to the footnote $\arg{text}$ is deferred
% or not.
%
% \item
% \begin{Hfuzz}{0.6pt}%
% In \!\pcol@calcfnctr!$\arg{num}$\!\@nil!, it has the first token of
% $\arg{num}$ for \CSIndex{ifx}-comparison with `|+|' and `|-|'.
% \end{Hfuzz}
%
% \item
% In $\!\pcol@twosided!|[|T|]|$, it is let have each non-space token in $T$
% given by a \!\@tfor! loop.
% \end{itemize}
%
% \item[\Uidx{\!\reserved@b!}]
% is an internal macro for temporary use. It is used in the following
% macros to keep a list shown in paraentheses so that we update the list in
% the scan of list elements.
%
% \begin{quote}
% \!\pcol@startpage! (\!\@dbldeferlist!)\\
% \!\pcol@outputcolumns! ($\PP$)\\
% \!\pcol@trynextcolumn! ($\cc_c(\dl)$)\\
% \!\pcol@makefcolumn! ($\cc_c(\dl)$)\\
% \!\pcol@removecounter!$\<\mathit{\Theta}'\>\Arg{\theta}$
% ($\mathit{\Theta}'\in\{\CG,\CC\}$)
% \end{quote}
%
% In addition, it is used in the following macros.
%
% \begin{itemize}
% \item
% In \!\pcol@outputpage@ev!, it has the expansion result of
% \!\string!\!\yoko! to be compared with \!\reserved@a! having
% \!\meaning!\!\yoko! for examining if \!\yoko! is a primitive of underlying
% \TeX{}.
%
% \item
% In \!\pcol@bg@paint@ii!, it has a token in the arguments $K_b$, $K_g$ and
% $K_c$ of the macro scanned by \!\@tfor!.
%
% \item
% In \!\pcol@output@switch!, it is \!\let!-equal to |\@afterindenttrue| or
% |\@after|\~|indentfalse| according to \CSIndex{if@afterindent} in the
% leaving column to broadcast it to other columns.
%
% \item
% In \!\pcol@clearcolorstack!, it is \!\def!ined to put an uncoloring
% \!\special! by \!\reset@color! for its argument $\Celt^c$ in
% \!\pcol@scancst!.
%
% \item
% In \!\pcol@restorecst!, it is \!\def!ined to put a coloring \!\special! in
% its argument $\Celt^c$ by \!\unvcopy! done in \!\pcol@scancst!.
%
% \item
% In \!\pcol@scancst! and \!\pcol@iscancst!, after the reference for the
% purposes shown in the two items above, it has
% $M=(m\,\Bar\,\mceltpop_{j,m}\in\cstraw,\;j\geq i)$ for $\mceltpop_{i,*}$
% and in the latter is scanned to find $m$ for $\mcelt_{i,m}$ in $M$.
%
% \item
% In \!\pcol@addmarginpar!, it is made let equal to $\CL$ or $\C$
% according to $c<\CL$ or not.
%
% \item
% In $\!\pcol@bias@mpbout@i!\Arg{y}\!\@elt!\Arg{t}\Arg{b}\!\@nil!$, it is
% let have $\mpar(t+y,b+y)$, and in $\!\pcol@getmparbottom@last@i!
% \Arg{y}\mpar(t_1,b_1)\cdots\mpar(t_n,b_n)\!\@nil!$ it is let have
% $\mpar(y,y)$ or $\mpar(t_n,b_n)$, so that they are let be a
% $\mpb_{\{L,R\}}^{\{l,r\}}$ by \!\pcol@do@mpb@all@ii!.
%
% \item
% In $\!\pcol@setcw@getspec@i!\arg{default}\<x'_d\>$, it is let have each
% non-space token in $\<x'_d\>$ to remove space tokens from it.
%
% \item
% In $\!\pcol@setcw@fill!\<f\>\!\fill!$, it is let have $f$.
%
% \item
% In $\!\pcol@extract@fil@ii!\arg{unit}\!\@nil!$, it is let have
% $\arg{unit}$.
%
% \item
% In \!\globalcounter!$\Arg{\theta}$, it has $\cg_i\in\CG$ for
% \CSIndex{ifx}-comparison with $\theta$.
%
% \item
% In $\!\pcol@iremctrelt!\<\mathit{\Theta}'\>\Arg\theta$, it has $\theta$ for
% \CSIndex{ifx}-comparison with $\theta'$ to be removed from $\CG$ or $\CC$.
%
% \item
% In \!\pcol@calcfnctr!$\arg{num}$\!\@nil!, it has `|+|' and then `|-|' for
% \CSIndex{ifx}-comparison with the first token of $\arg{num}$.
%
% \item
% In \!\pcol@backgroundcolor@ii!, it has \!\pcol@backgroundcolor@x! or
% \!\pcol@back~groundcolor@z! according that the region of \bgpaint{} and its
% color is defined or undefined.
% \end{itemize}
%
% \item[\Uidx{\!\reserved@c!}]
% is an internal macro for temporary use. It is used in \!\pcol@startpage!
% to save \!\@deferlist! in it and then to restore the list from it, and in
% \!\pcol@iscancst! to have \!\relax! or the macro itself to iterate the
% macro recursively.
%
% \item[\Uidx{\!\reserved@d!}]
% is an internal macro for temporary use. It is used in
% \!\pcol@iscancst! as a \!\chardef! register to have 0 if $m$ for
% $\mcelt_{i,m}$ is not in the list
% $M=(n\,\Bar\,\mceltpop_{j,n}\in\cstraw,\;j\geq i)$, or 1 if found.
%
% \item[\Uidx{\!\@gtempa!}]
% is an internal macro used as a \!\global!ly modifiable scratchpad. Its
% usages are as follows.
%
% \begin{itemize}
% \item
% In \!\pcol@ifempty!$\arg{box}\arg{then}\arg{else}$, it has \!\lastpenalty!
% in a \!\vbox! whose value is examined outside the \!\vbox! for the
% emptiness check of $\arg{box}$.
%
% \item
% In \!\pcol@addmarginpar!, it is given to \!\@xnext! as the target to have
% the second and successive elements of \!\@currlist! which we cannot modify.
%
% \item
% In \!\pcol@zparacol! and \!\pcol@cmpctrelt!, it has the list of counters
% to be synchronized.
%
% \item
% In $\!\pcol@setcw@getspec@i!\arg{default}\<x'_d\>$, it is made
% \!\@empty! or \!\relax! according to $x'_d$ has \!\fill! or not.
%
% \item
% In \!\pcol@storectrelt!, \!\pcol@savectrelt! and \!\pcol@sscounters!, it
% has the new version of $\CC_c$.
% \end{itemize}
% \end{description}
%
%
%
%\iffalse
%<*paracol>
%\fi
%
% \section{Register Declaration}
% \label{sec:imp-decl}
%
% \subsection{\cs{count} Registers}
%
% Here we declare registers and switches. The first group is for \!\count!
% registers.
%
% \begin{macro}{\pcol@currcol}
% \changes{v1.2-1}{2013/05/11}
% {Add initialization to 0 after the declaration.}
%
% The register \!\pcol@currcol! has the zero-origin ordinal $c$ of the
% column which we were in when \!\output! is invoked. Therefore, for
% example, in the process of \!\switchcolumn!, the register has $c$ from
% which we are switching to another column. The register is initialized to
% be 0 by \!\pcol@output@start!, and then set to $\!\pcol@nextcol!=d$ by
% \!\pcol@restartcolumn! to switch to (or stay in) $d$. Note that these two
% assignments are \!\global! while other macros may {\em locally} use the
% register to, for example, scan all columns $c\In0\C$. Besides two macros
% above, the following macros refer to the register to know which column we
% are in (or which column is processed by their invokers).
%
% \begin{quote}\raggedright
% \!\pcol@Log@iii!,
% \!\pcol@Log@ii!,
% \!\pcol@FF!,
% \!\pcol@makecol!,
% \!\pcol@opcol!,
% \!\pcol@bg@columnleft!,
% \!\pcol@bg@columnwidth!,
% \!\pcol@bg@columnsep!,
% \!\pcol@output@switch!,
% \!\pcol@getcurrcol!,
% \!\pcol@setcurrcol!,
% \!\pcol@clearcolorstack!,
% \!\pcol@restorecolorstack!,
% \!\pcol@addmarginpar!,
% \!\pcol@getmparbottom@i!,
% \!\pcol@setmpbelt@i!,
% \!\pcol@invokeoutput!\footnote{
%
% Only for logging.},
%
% \!\thecolumn!,
% \!\pcol@sscounters!,
% \!\pcol@setctrelt!,
% \!\pcol@com@switchcolumn!,
% \!\pcol@switchcol!,
% \!\pcol@visitallcols!,
% \!\pcol@aconlyelt!,
% \!\pcol@flushclear!.
% \!\pcol@columncolor!,
% \!\normalcolumncolor!,
% \!\pcol@icolumncolor!,
% \end{quote}
%
% Among the macros above, \!\columncolor! and \!\normalcolumncolor! could
% refer to the register outside \env{paracol} environment and thus before
% the initialization by \!\pcol@output@start!. Therefore, the register is
% also initialized to be 0 after its declaration to assure safe reference.
%
% The following macros use the register for the scan of all $c\In0\C$ by
% themselves or their invokers.
%
% \begin{quote}\raggedright
% \!\pcol@output@start!,
% \!\pcol@output@switch!,
% \!\pcol@sync!,
% \!\pcol@flushcolumn!,
% \!\pcol@measurecolumn!,
% \!\pcol@synccolumn!,
% \!\pcol@makeflushedpage!,
% \!\pcol@flushfloats!,
% \!\pcol@freshpage!,
% \!\pcol@output@end!,
% \!\pcol@synccounter!,
% \!\pcol@com@syncallcounters!,
% \!\pcol@stepcounter!.
% \end{quote}
%
% The macros \!\pcol@imakeflushedpage! and \!\pcol@iflushfloats! also use
% the register for scanning but for $\LBRP\Cfrom\Cto$ given by their
% arguments.
%
% In addition \!\pcol@ccuse!, \!\pcol@ifccdefined! and \!\pcol@ccxdef!
% refer to the register to have the control sequence
% $|\pcol@columncolor|\cdot c=\Celtshadow^c$ or
% $|\pcol@columncolor@box|\cdot c=\Celt^c$ where $c$ is for the current
% column or for all columns depending on their invokers.
%
% \SpecialArrayIndex{c}{\pcol@columncolor}
% \SpecialArrayIndex{c}{\pcol@columncolor@box}
% \end{macro}
%
% \begin{macro}{\pcol@nextcol}
% The register \!\pcol@nextcol! has the zero-origin ordinal $d$ of the
% column to which we are switching, or in which we are staying, to be set
% into \!\pcol@currcol! by \!\pcol@restartcolumn!. The main usage of the
% register is to set the switching target in \!\pcol@switchcolumn!, but
% other macros use it to specify the (temporary) target of
% \!\pcol@switchcol!; the tallest column in \!\pcol@sync!; 0 in
% \!\pcol@zparacol!, \!\pcol@sptext! and \!\endparacol!; all in $\LBRP0\C$
% but $c=\!\pcol@currcol!$ in \!\pcol@visitallcols!; and $c$ in
% \!\pcol@flushclear! to stay in the current column $c$. The other user of
% this register is \!\pcol@invokeoutput! but only for logging.
% \end{macro}
%
% \begin{macro}{\pcol@ncol}
% \changes{v1.3-3}{2013/09/17}
% {Add initial zero-clearing for safe reference in \cs{@outputpage}
% invokded prior to the first \string\texttt{paracol}.}
% \begin{macro}{\pcol@ncolleft}
% \changes{v1.3-2}{2013/09/17}
% {Introduced to specify the number of columns in left
% parallel-pages.}
%
% The register \!\pcol@ncol! has the number of columns $\C$ given as the
% argument of \!\paracol!, whose callee \!\pcol@zparacol! being the sole
% modifier of the register \!\global!ly assigns $C$ to the register to give
% safe reference to \!\@outputbox! invoked after a \env{paracol} is closed.
% In addition for the reference in \!\@outputbox! before the first
% \env{paracol}, the register is initialized with zero after the declaration.
%
% The following macros refer to the register to scan all columns $c\In0\C$.
%
% \begin{quote}\raggedright
% \!\pcol@checkshipped!,
% \!\pcol@output@start!,
% \!\pcol@output@switch!,
% \!\pcol@sync!,
% \!\pcol@makeflushedpage!,
% \!\pcol@freshpage!,
% \!\pcol@output@end!,
% \!\pcol@synccounter!,
% \!\pcol@com@syncallcounters!,
% \!\pcol@stepcounter!,
% \!\pcol@visitallcols!.
% \end{quote}
%
% The register \!\pcol@ncolleft! has $\Uidx\CL$ being the number of columns
% in the left {\em\Uidx\parapag{}e} if \parapag{}ing is in effect, or have
% $\C$ otherwise. Similar to $\C$, the number $\CL$ is given as the
% optional argument of \!\pcol@zparacol! and is \!\global!ly assigned to the
% register by the sole modifier \!\pcol@zparacol!, unless the optional
% arugment is not less than $\C$ which is assigned to $\CL$ if this
% exception is found. The reason of the \!\global! assignment and the
% initial zero-clearing after the declaration is same as that for $C$, i.e.,
% for the reference in \!\@outputpage! outside \env{paracol}.
%
% The following macros examines if $\Uidx\CL<\C$, i.e., if \parapag{}ing is
% in effect.
%
% \begin{quote}\raggedright
% \!\pcol@outputelt!,
% \!\@outputpage!,
% \!\pcol@output@start!,
% \!\pcol@output@flush!,
% \!\pcol@output@clear!,
% \!\pcol@makeflushedpage!,
% \!\pcol@flushfloats!,
% \!\pcol@output@end!,
% \!\pcol@zparacol!,
% \end{quote}
%
% \begin{Sloppy}{2350}
% In the macros listed above, \!\pcol@outputelt!, \!\pcol@makeflushedpage!
% and \!\pcol@flushfloats! passes $\LBRP0\CL$ and $\LBRP\CL\C$ to their
% respective callees \!\pcol@ioutputelt!, \!\pcol@imakeflushedpage! and
% \!\pcol@iflushfloats! as their argument pair
% $\LBRP{\Uidx\Cfrom}{\Uidx\Cto}$ to let them work on the left and right
% \parapag{}es repsectively. The callees above also pass the pair to
% \!\pcol@swapcolumn! to swap the scanning order of columns if \cswap{} is
% in efect.
%
% They also pass the pair to \!\pcol@buildcolseprule! which then passes it
% to \!\pcol@bg@paintcolumns! and \!\pcol@bg@paintbox! by binding it to
% $\LBRP\CBfrom\CBto=\LBRP{\!\pcol@bg@from!}{\~\!\pcol@bg@to!}$ referred to
% by \!\pcol@bg@paint@i! and its callee \!\pcol@bg@paint@ii! to define the
% range of columns to be painted is $\LBRP\CBfrom\CBto$. Similar passing is
% done by (our own version of) \!\@outputpage!, but it directly uses
% $\LBRP0\CL$ and $\LBRP\CL\C$ as the sources and the target painting macros
% are \!\pcol@bg@paintpage!, \!\pcol@bg@@paintpage! and
% \!\pcol@bg@paintbox!. Note that $\CBto$ is initialized to be
% \!\let!-equal to $\C$ because it may be referred to without
% binding\footnote{
%
% This meaningless reference has no harmful side effects.}.
% \end{Sloppy}
%
% The macro \!\pcol@addmarginpar! also referes to $\CL$ to know if the
% column $c$ on which it is working on is in the left or right \parapag{}e,
% i.e., $c<\CL$ or not, to decide the margin to which a marginal note is put,
% and to pass $\LBRP0\CL$ or $\LBRP\CL\C$ to \!\pcol@swapcolumn! to
% calculate the distance to the left or right margin from the column. The
% examination of $c<\CL$ is also done in related macros
% \!\pcol@getmparbottom@i! and \!\pcol@setmpbelt@i!.
%
% Similar column-range specification is done for the argument pair
% $\LBRP\Cfrom\Cto$ of \!\pcol@setcolumnwidth! invoked from
% \!\pcol@zparacol!. Then the arguments are passed to the callees
% \!\pcol@setcolwidth@r! or \!\pcol@setcolwidth@s!, the latter of
% which also passes them to its callee \!\pcol@setcw@scan!, to define the
% width of columns in $\LBRP\Cfrom\Cto$ and thier separators.
%
% The other references to $\C$ are made by \!\pcol@com@switchcolumn! and
% \!\pcol@switchcolumn! to examine $c<\C$, to wraparound $\C-1$ to 0 for the
% former and to complain if $c\geq\C$ for the latter.
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@page}
% The register \!\pcol@page! has the zero-orgin ordinal $p$ of the page
% which we are in. The register is initialized to be 0 not only by
% \!\pcol@output@start! to give the obvious starting point, but also by
% \!\pcol@freshpage! for page flushing which clears $\PP=\!\pcol@pages!$ to
% give us another type of starting point. Then the register is incremented
% by \!\pcol@nextpage! to advance one page, by \!\pcol@nextpelt! to skip a
% \fpage, and by \!\pcol@startpage! for a \fpage{} to be created. The other
% type of updates of the register is done by \!\pcol@restartcolumn! which
% lets $p$ be $\cc_c(\vb^p)$ when we revisit the column $c$ belonging to the
% page $p$. Note that, besides these \!\global! updates,
% \!\pcol@flushcolumn! locally updates the register to scan
% $\PP=\!\pcol@pages!$, and \!\pcol@freshpage! also performs local updates
% but in more weird manner. Besides the updates discussed above, the
% macros \!\pcol@Log@iii!, \!\pcol@Log@ii!, \!\pcol@FF!, \!\pcol@makecol!,
% \!\pcol@opcol!, \!\pcol@setpageno!, \!\pcol@getcurrpage!,
% \!\pcol@startcolumn!, \!\pcol@output@switch!, \!\pcol@addmarginpar! and
% \!\pcol@fntext! refer to the register to know which page they are
% operating on.
% \end{macro}
%
% \begin{macro}{\pcol@basepage}
% The register \!\pcol@basepage! has the ordinal $\pbase$ of the \bpage{}
% being the oldest page not shipped out yet. The register is initialized to
% be 0 by \!\pcol@output@start! and \!\pcol@freshpage! together with
% \!\pcol@page!, and then incremented by \!\pcol@outputelt! when it ships
% the page $\pbase$ out. The macros \!\pcol@setpageno!, \!\pcol@nextpage!,
% \!\pcol@getcurrpage! and \!\pcol@addmarginpar! refer to the register in
% their scans of $\PP$ or $\PPP$ to know the zero-origin ordinal of the
% element for the current page $p$ is $p-\pbase$.
% \end{macro}
%
% \begin{macro}{\pcol@toppage}
% \changes{v1.0}{2011/10/10}
% {Renamed from \cs{pcol@maxpage}.}
%
% The register \!\pcol@toppage! has the ordinal $\ptop$ of the \tpage{}
% having the most advanced \colpage{}s, or {\em\Uidx\lcolpage{}s} in short.
% The register is initialized to be 0 by \!\pcol@output@start! and
% \!\pcol@freshpage! together with \!\pcol@page!, and then let be
% $p=\!\pcol@page!$ by \!\pcol@startpage! to start a new page $p$. The
% macros \!\pcol@makecol!, \!\pcol@opcol!, \!\pcol@startcolumn!,
% \!\pcol@output@switch! and \!\pcol@restartcolumn! refer to the register
% to examine if they are working on a \colpage{} in the \tpage, while
% \!\pcol@flushcolumn! and \!\pcol@fntext! examines if the \ccolpage{} is
% behind the \tpage. The register is also referred to by \!\pcol@Log@iii!,
% \!\pcol@Log@ii! and \!\pcol@FF! for logging.
% \end{macro}
%
% \begin{macro}{\pcol@footnotebase}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for page-wise footnotes.}
%
% The register \!\pcol@footnotebase! is let have the value of \!\c@footnote!
% at the start of a \env{paracol} environment by \!\pcol@zparacol! to give
% the base value $\Uidx\bf$ for relative numbering of \counter{footnote}
% done in \!\pcol@calcfnctr! for the starred versions of \!\footnote!,
% \!\footnotemark! and \!\footnotetext!. The register is also referred to
% by \!\endparacol! to let \!\c@footnote! have $\bf+\nf$ where
% $\nf=\!\pcol@nfootnotes!$ shown below is the number of footnotes in the
% \env{paracol} environment to be closed.
% \end{macro}
%
% \begin{macro}{\pcol@nfootnotes}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for page-wise footnotes.}
%
% The register \!\pcol@nfootnotes! is to accumulate the number of footnotes
% $\Uidx\nf$ in a \env{paracol} environment. Therefore, it is zero-cleared
% by \!\pcol@zparacol!, then incremented by \!\pcol@ifootnote! and
% \!\pcol@ifootnotemark! for \!\footnote! and \!\footnotemark!, and finally
% referred to by \!\endparacol! to let $\!\c@footnote!=\bf+\nf$.
% \end{macro}
%
% \begin{macro}{\pcol@mcid}
% \changes{v1.24}{2013/07/27}
% {Introduced for coloring specified in math mode.}
% \changes{v1.34}{2018/05/07}
% {Change its meaning and operations with it a little bit according to
% the new text coloring with \cs{insert}.}
%
% The register \!\pcol@mcid! has the number of pushes of
% \colorstack{} by coloring commands in math mode between two consecutive
% invocations of \!\output!. The register is
% zero-cleared by \!\pcol@output! because we are definitely in the main
% vertical mode and thus all pops corresponding to pushes in math mode must
% have been applied to |.tex|'s \colorstack. Then the register
% is referred to by \!\pcol@set@color@push! when it is invoked in math mode,
% to increment it and then examine if it does not exceed the limit
% \!\pcol@mcpushlimit! to mean the math-mode coloring still can be made. The
% macro then uses the value of the register as the identifier of the push
% operation given to \!\output! through an \!\insert!ion.
% \end{macro}
% \begin{macrocode}
%% Register Declaration
\newcount\pcol@currcol \global\pcol@currcol\z@
\newcount\pcol@nextcol
\newcount\pcol@ncol \global\pcol@ncol\z@
\newcount\pcol@ncolleft \global\pcol@ncolleft\z@
\newcount\pcol@page
\newcount\pcol@basepage
\newcount\pcol@toppage
\newcount\pcol@footnotebase
\newcount\pcol@nfootnotes
\newcount\pcol@mcid
% \end{macrocode}
%
%
%
% \subsection{Switches}
%
% The second declaration group is for switches.
%
% \begin{macro}{\ifpcol@output}
% \changes{v1.2-7}{2013/05/11}
% {Introduced to solve the \cs{output} request sneaking.}
% \changes{v1.22}{2013/06/30}
% {Add a user \cs{pcol@reset@color@pop} to inhibit uncoloring if
% $\mathit{false}$.}
% \changes{v1.3-2}{2013/09/17}
% {Add a user \cs{@outputpage} for parallel-paging.}
% \changes{v1.3-3}{2013/09/17}
% {Add a user \cs{@outputpage} for background-painting.}
%
% The switch \CSIndex{ifpcol@output} is $\true$ iff \!\pcol@output@start!
% which turns the switch $\true$ has been invoked but \!\pcol@output@end!
% which does $\false$ has not yet. Then the switch is examined by
% \!\pcol@output! to detect an \!\output! request sneaked from outside of
% the \env{paracol} environment. The other users \!\@outputpage! and
% \!\pcol@reset@color@pop! examine this switch to know if the macro is
% invoked inside or outside of \env{paracol} environment, while the macro
% \!\pcol@output@start! temporarily turns the switch $\false$ when it ships
% out a page having \preenv{} only.
% \end{macro}
%
% \begin{macro}{\ifpcol@nospan}
% \changes{v1.0}{2011/10/10}
% {Renamed from \cs{pcol@textonly}.}
%
% The switch |\ifpcol@nospan| is $\true$ iff a page $p$ does not have
% \spanning, i.e., $\pp^i(p)=\bot$. It is set by by
% \!\pcol@getpinfo! for the examination in \!\pcol@ioutputelt!,
% \!\pcol@makeflushedpage! and \!\pcol@output@end!.
% \end{macro}
%
% \begin{macro}{\ifpcol@sync}
% \changes{v1.0}{2011/10/10}
% {Add initialization to be $\string\mathit{false}$.}
% \changes{v1.2-2}{2013/05/11}
% {Add \cs{pcol@switchcol} and \cs{pcol@flushclear} to the macros
% turning the switch $\string\mathit{true}$ due to column scanning
% and pre-flushing column height check.}
%
% The switch |\ifpcol@sync| is $\true$ iff \!\pcol@output@switch! is invoked
% for \sync{}ed \cswitch{} by \!\switchcolumn!|*| or its relative
% enviroment openers, or \pfcheck{} prior to page flushing or environment
% closing. Therefore, the switch is \!\global!ly turned $\true$ by
% \!\pcol@iswitchcolumn! and \!\pcol@sptext! for the \sync{}ing
% \cswitch{}ing but then temporarily turned $\false$ by \!\pcol@switchcol!
% invoked by them for \cscan{}ning and then turned $\true$ again by the
% macro. For \pfcheck{}, the macro \!\pcol@flushclear! turns the switch
% $\true$. The other macro turns this switch is \!\pcol@output@switch! at
% the end of which the switch is turned $\false$ to go back to the default
% state. The macros examining this switch are \!\pcol@output@switch!,
% \!\pcol@putbackmvl!, \!\pcol@sync!, \!\pcol@invokeoutput! (for logging) and
% \!\pcol@switchcol!.
% \end{macro}
%
% \begin{macro}{\ifpcol@sptextstart}
% \changes{v1.3-1}{2013/09/17}
% {Introduced to capture the starting point of a spanning text so that
% the text is split from other main vertical list stuff.}
% \begin{macro}{\ifpcol@sptext}
% \changes{v1.0}{2011/10/10}
% {Introduced to restrict the broadcast of \cs{if@nobreak} and
% \cs{everypar} only when a column-switching is accompanied with
% spanning text.}
% \changes{v1.3-1}{2013/09/17}
% {Renamed from \cs{ifpcol@mctext} following the naming convention, and
% move the timing of turning $\string\mathit{true}$ from the end
% of a spanning text to its beginning.}
%
% The switch |\ifpcol@sptextstart| is $\true$ iff \!\pcol@output@switch! is
% invoked from \!\pcol@sptext! prior to a \mctext. That is, the switch is
% \!\global!ly\footnote{
%
% Not necessary to be \cs{global}ly turned but we dare to do that to clearly
% distinguish that from the local turning in \cs{pcol@putbackmvl}.}
%
% let $\true$ and then $\false$ by \!\pcol@sptext! before and
% after the invocation of \sync{}ed \!\pcol@switchcol! prior to the
% \mctext. Then the switch is examined by \!\pcol@putbackmvl! after
% the \sync{}ation to save the {\em\Uidx\prespan}, being all stuff in main
% vertical list prior to the \sync{}ation, so that the \mctext{} is split
% from the stuff and is captured afterward by \!\pcol@makecol! and/or
% \!\pcol@output@switch!. The macro also locally turns the switch
% $\false$ if it does not follow the \sync{}ation, i.e., its invocation is
% for \cscan{}ning or is caused by pre-\sync{}ation page break, to do the
% saving only when it follows the \sync{}ation. The switch is also examined
% in \!\pcol@output! to inhibit the warning and forced page break even when
% $\cc_0(\vb^r)=\!\@colroom!<1.5\!\baselineskip!$, because we may let it have
% a small value when the \mctext{} starts near the page bottom to capture
% the text portion in the page by \!\pcol@makecol!. In addition, it is
% examined by \!\pcol@switchcol! to invoke $|\pcol@colpream|{\cdot}c$,
% where $c=-1$ if $\true$ or $c=\!\pcol@currcol!$ otherwise.
%
% \SpecialArrayIndex{c}{\pcol@colpream}
%
% The macro \!\pcol@sptext! then \!\global!ly turns another switch
% \CSIndex{ifpcol@sptext} $\true$ before putting the \mctext{} into the main
% vertical list so that \!\pcol@makecol! for the page break in the text and
% \!\pcol@output@switch! for closing capture the text to place it
% appropriately especially when \cswap{} is in effect. Then the switch
% is \!\global!ly turned $\false$ by \!\pcol@output@switch! to give the
% default state after it {\em broadcasts} \CSIndex{if@nobreak},
% \CSIndex{if@afterindent} and \!\everypar! to all columns.
% \end{macro}\end{macro}
%
% \begin{macro}{\ifpcol@clear}
% \changes{v1.0}{2011/10/10}
% {Add initialization to be $\string\mathit{false}$.}
% \changes{v1.2-2}{2013/05/11}
% {Add \cs{pcol@flushclear} to the macros turning the switch
% $\string\mathit{true}$ due to the pre-flushing column height
% check.}
%
% The switch |\ifpcol@clear| is $\true$ iff \!\pcol@output@switch! is
% invoked for \pfcheck{}, page flushing or environment closing. Therefore,
% the switch is turned $\true$ by \!\pcol@flushclear! in the first case, and
% by \!\pcol@makeflushedpage! in the latter two. These two macros also
% turned the switch $\false$ after the direct\slash indirect invocation of
% \!\pcol@output@switch! to give the default state. The switch is examined
% by \!\pcol@output@switch! and its descendants \!\pcol@sync!,
% \!\pcol@flushcolumn! and \!\pcol@synccolumn! for \sync{}ation, and by
% \!\pcol@invokeoutput! for logging.
% \end{macro}
%
% \begin{macro}{\ifpcol@flush}
% \changes{v1.2-3}{2013/05/11}
% {Introduced to fix the problem with a too-tall page at
% synchronization.}
% \changes{v1.2-2}{2013/05/11}
% {Add uses for page-wise footnote functions.}
%
% The switch |\ifpcol@flush| is turned $\true$ by \!\pcol@sync! iff it finds
% that the page to be \sync{}ed or to be flushed is too tall because the
% sum of the total height of top floats and main text in a column and that
% of bottom floats and footnotes in another column is larger than
% $\pp^h(\ptop)-v^f-\VE$, where $v^f$ is the total heigth-plus-depth of the
% \Scfnote{}s if $\ptop$ has them or 0 otherwise, and $\VE$ is the amount
% given by \!\ensurevspace! in \sync{}ation or 0 in flushing. Then the
% switch is examined in \!\pcol@sync! itself to restart the tallest column
% if $\true$, in \!\pcol@putbackmvl! to check if a \mctext{} is really to
% start, in \!\pcol@switchcol! to have a explicit page break in each column
% if $\true$, and in \!\pcol@flushclear! also to have a page break if
% $\true$. The last examiner \!\pcol@flushclear! may turn the switch
% $\true$ when it is invoked from \!\endparacol! if the last page leaves
% deferred and non-merged \Scfnote{}s for which an explicit page break is
% also required.
% \end{macro}
%
% \begin{macro}{\ifpcol@outputflt}
% \changes{v1.0}{2011/10/10}
% {Renamed from \cs{ifpcol@stopoutput} with the reversal.}
%
% The switch |\ifpcol@outputflt| is used in \!\pcol@outputelt! to know
% whether a \fpage{} is to be shipped out ($\true$) or not. The switch is
% initialized to be $\true$ by \!\pcol@outputcolumns! which invokes
% \!\pcol@outputelt! for all $\pp(p)\in\PP$. Then if \!\pcol@outputcolumns! is
% invoked from \!\pcol@opcol! to ship the oldest page $\pbase$ out, the
% switch is turned $\false$ when we visit the second non-\fpage. That is,
% all \fpage{}s following the first (oldest) page are shipped out but others
% are not. On the other hand, if \!\pcol@outputcolumns! is invoked from
% \!\pcol@sync! to ship out all pages including \fpage{}s in $\PP$, the
% switch is kept $\true$ throughout all invocations of \!\pcol@outputelt!.
% \end{macro}
%
% \begin{macro}{\ifpcol@lastpage}
% \changes{v1.0}{2011/10/10}
% {Introduced for special operations in the last page.}
% \begin{macro}{\ifpcol@lastpagesave}
% \changes{v1.2-7}{2013/05/11}
% {Introduced to fix the bug that \cs{@makecol} and
% \cs{pcol@makefcolumn} in \cs{pcol@flushcolumn} misunderstand that
% non-last pages are last.}
%
% The switch |\ifpcol@lastpage| is used to know whether the following macros
% work on the {\em\Uidx\lpage} of a \env{paracol} environment to do special
% operations if so.
%
% \begin{itemize}
% \item
% \!\pcol@combinefloats! adds \!\textfloatsep! below bottom floats of each
% column if any so that the floats are well sepearated from the \postenv.
%
% \item
% \!\pcol@sync! examines $\VPP$ instead of $\VP$ for the \pfcheck.
%
% \item
% \!\pcol@makefcolumn! trys to make deferred floats as top floats.
%
% \item
% \!\pcol@makeflushedpage! builds a short page of $\VPP$ tall, leaves
% \spanning{} from ship-out if $\VPP=\!\pcol@colht!=-\infty$ so that it
% becomes a float in \postenv, and leaves \Scfnote{}s untouched if
% \Mgfnote{} typesetting is in effect. This macro itself turns this switch
% $\false$ if $\CSIndex{ifpcol@dfloats}=\true$ to mean one or more columns
% in the \lpage{} have deferred \cwise{} floats and thus the \lpage{}
% must be {\em full size}.
%
% \item
% \!\pcol@imakeflushedpage! leaves the \bground{} of \Scfnote{}s unpainted,
% and lets the depth of the \lpage{} be 0 in \bgpaint{} and packing of
% \colpage{}s.
% \end{itemize}
%
% The switch is initialized to be $\false$ by \!\pcol@zparacol!, then turned
% $\true$ by \!\endparacol!, and then finally turned $\false$ by
% \!\pcol@output@end! again for
% \fpage{}s following the \lpage{} if any. The macro \!\pcol@flushcolumn!
% saves the switch into \CSIndex{ifpcol@lastpagesave} then turning it
% $\false$ during it works on \colpage{}s in non-top and thus non-\lpage{}s
% to keep \!\@makecol! and \!\pcol@makefcolumn! from misunderstanding the
% pages are last, and then restore the switch when the macro reaches to the
% \tpage. This saving and temporary turning $\false$ is also done in
% \!\pcol@flushclear! when it forces a page break so that the \!\output!
% routine working on the broken non-\lpage{} correctly recognizes that.
% Another temporary turning is made by \!\pcol@makenormalcol! but in reverse
% to let the switch be $\true$ so that its indirect callee
% \!\pcol@combinefloats! puts a vertical skip of \!\textfloatsep! below the
% bottom floats in \preenv.
% \end{macro}\end{macro}
%
% \begin{macro}{\ifpcol@scfnote}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for page-wise footnote functions.}
%
% The switch \!\ifpcol@scfnote! is turned $\true$ by \!\pcol@fnlayout@p!
% and \!\pcol@fnlayout@m! (through \!\pcol@fnlayout@p!) to indicate
% footnotes in all columns are merged and \scfnote, while
% \!\pcol@fnlayout@c! turns it $\false$ to make footnote typesetting
% \mcfnote{}, being default as well. The switch is examined by the
% following macros to do special operations for \Scfnote{}s if
% it is $\true$.
%
% \begin{itemize}
% \item
% \!\pcol@makecol! shrinks \!\@colht! and put the stretch\slash shrink
% factor of \!\skip!\!\footins! at the bottom of the \colpage{} to be built
% by the macro if the page has footnotes. If the \colpage{} is in the
% \tpage{} $\ptop$, the macro also saves \!\footins! into \!\pcol@currfoot!
% which then will be saved into $\pp^f(\ptop)$ by \!\pcol@startpage!, or
% \!\footins! is discarded otherwise.
%
% \item
% \!\pcol@startcolumn!, if it is invoked from \!\pcol@output! to start a
% \colpage{} in a page $p$, \!\insert!s $\pp^f(p)$ through \!\footins!, and
% also the deferred footnotes in $\df$ by \!\pcol@deferredfootins!, if
% $p=\ptop$.
%
% \item
% \!\pcol@output@switch! saves \!\footins! into $\pp^f(\ptop)$ if the macro
% is to leave a \colpage{} in the \tpage, or discards it otherwise.
%
% \item
% \!\pcol@restartcolumn! to restart a \colpage{} in a page $p$ \!\insert!s
% $\pp^f(p)$ through \!\footins!, and also the deferred footnotes in $\df$
% by \!\pcol@deferredfootins!, if $p=\ptop$.
%
% \item
% \!\pcol@sync! examines whether the total height of \Scfnote{}s is too
% large to let them reside in the page to be synchronized or flushed as a
% whole.
%
% \item
% \!\pcol@zparacol! redefines \!\footnoterule! so that it refers to
% \!\textwidth! rather than \!\column~width! to determine the width of the
% rule above footnotes.
%
% \item
% \!\pcol@fntext! invokes \!\pcol@fntextother! to add the footnote given to
% it to $\df$ as a deferred footnote if $p<\ptop$.
%
% \item
% \!\pcol@fntextbody! lets \!\hsize! be \!\textwidth! rather than
% \!\columnwidth! to typeset the footnote given to it.
% \end{itemize}
% \end{macro}
%
% \begin{macro}{\ifpcol@mgfnote}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for page-wise footnote functions.}
%
% The switch \!\ifpcol@mgfnote! is turned $\true$ by \!\pcol@fnlayout@m!
% to indicate footnotes in the \spage{} and \lpage{} of a \env{paracol}
% environment are merged with those in pre- and \postenv{}, while
% \!\pcol@fnlayout@p! and \!\pcol@fnlayout@c! turn it $\false$ to
% put them above\slash below the columns in the starting\slash\lpage{}
% respectively, being default as well. The switch is examined by the
% following macros to do special operations for \mgfnote{} \Scfnote{}s
% if it is $\true$.
%
% \Index{pre-environment stuff}
% \Index{starting page}
%
% \begin{itemize}
% \item
% \!\pcol@makenormalcol! leaves \!\footins! untouched rather than putting it
% as a part of \preenv.
%
% \item
% \!\pcol@makeflushedpage! leaves \!\footins! untouched rather than putting it
% as a part of the \lpage{} of \env{paracol} if it works on the page.
%
% \item
% \!\endparacol! does not let \!\pcol@flushclear! examine the existence of
% deferred footnotes in \pfcheck{} for the \lpage.
% \end{itemize}
% \end{macro}
%
% \begingroup\let\small\footnotesize
% \begin{macro}{\ifpcol@fncounteradjustment}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for page-wise footnote functions.}
%
% The switch \!\ifpcol@fncounteradjustment! is turned $\true$ by the API
% macro \!\fncounter~adjustment!, which is also invoked from
% \!\pcol@fnlayout@p! and \!\pcol@fnlayout@m! (through \!\pcol@fnlayout@p!),
% to let $\!\c@footnote!=\bf+\nf$ by \!\endparacol!. The macro
% \!\nofncounter~adjustment! turns the switch $\false$ to give the default
% state.
% \end{macro}
% \endgroup
%
% \begin{macro}{\ifpcol@inner}
% \changes{v1.22}{2013/06/30}
% {Introduced to know if we are in a \cs{vbox}.}
%
% The switch \cs{ifpcol@inner} is turned $\false$ by \!\pcol@zparacol! to
% mean we are outside any \!\vbox!es, while the macro also lets
% \!\everyvbox! in the \env{paracol} environment has the operation to turn
% the switch $\true$ so that it is true whenever we are in a \!\vbox!. The
% switch is examined by \!\pcol@set@color@push! and \!\pcol@icolumncolor!,
% the former of which also turns it $\true$ if we are in restricted
% horizontal mode, to make an \!\output! request for \colorstack{}
% manipuratoin and, in the former, to reserve the stack popper by
% \!\aftergroup!, iff the switch is $\false$.
% \end{macro}
%
% \begin{macro}{\ifpcol@firstpage}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to know if a spanning stuff is pre-environment one.}
%
% The switch \cs{ifpcol@firstpage} is \!\global!ly turned $\true$ or
% $\false$ by \!\pcol@output@start! if it captures \preenv{} as a
% \spanning{} or not because it is too large, respectively. Then the switch
% is examined by \!\pcol@ioutputelt! or \!\pcol@makeflushedpage! when they
% finds a \spanning{} to be combined to the page to be printed so as to
% paint the \bground{} for the color of \pwise{} floats unless the switch is
% $\true$ to mean the stuff is pre-environment one rather than floats. Then
% \!\pcol@outputelt! or \!\pcol@makeflushedpage! itself \!\global!ly turns
% the switch $\false$ after printing a page because we no longer have
% \preenv{} in the \env{paracol} environment we are in.
% \end{macro}
%
% \begin{macro}{\ifpcol@havelastpage}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to know if a page to be put has the last page of a
% \string\texttt{paracol} environment.}
%
% The switch \cs{ifpcol@havelastpage} is, after intiailized $\false$,
% \!\global!ly turned $\true$ by \!\pcol@output@end! if it finds the
% \lpage{} of the \env{paracol} environment is connected to the \postenv, or
% $\false$ otherwise. Then the switch is examined by (our own version of)
% \!\@outputpage! which paints the \bground{} of the page to be printed iff
% the switch is $\true$ because a part of the page was prodcued by a
% \env{paracol} environment. Then the macro \!\global!ly turns the switch
% $\false$ because so far \bgpaint{} should be disabled.
% \end{macro}
%
% \begin{macro}{\ifpcol@paired}
% \changes{v1.3-2}{2013/09/17}
% {Introduced for parallel-paging which has paired and non-paired mode.}
%
% The switch \cs{ifpcol@paired} is $\true$ if the \parapag{}ed typesetting
% should be done in {\em\paired} mode in which the pair of left and right
% \parapag{}es comprises a virtual page, while it is $false$ if
% \npaired{} to treat the left and right pages as individual ones.
% Therefore, the switch is \!\global!ly turned $\false$ by \!\pcol@yparacol!
% when \beginparacol{} has the optional argument for the number of columns
% in the left \parapag{}e followed by |*|, or turned $\true$
% otherwise by \!\paracol! for giving default or by \!\pcol@zparacol! if it
% finds $\CL\geq\C$ to mean \parapag{}ing is not in effect
% in reality\footnote{
%
% The initialization to let the switch $\false$ is not necessary because it
% is examined only after the first \cs{paracol} even in the
% \cs{@outputpage} outside \texttt{paracol} environment, but we dare to do
% this for the sake of clearity.}.
%
% Then the switch is examined by \!\pcol@setpnoelt! and \!\pcol@startpage!
% so that, if the switch is $\false$, they let $\page(q)=\page(q-1)+2$ where
% $\cc_0(\vb^p)<q\leq\ptop$ in the former and $q=\ptop$ in the latter,
% instead of $\page(q)=\page(q-1)+1$ in the usual $\true$ case, because the
% left\slash right pair of \parapag{}es is treated as two pages rather than
% one.
%
% The other macros \!\pcol@ioutputelt!, (our own version of) \!\@outputpage!,
% \!\pcol@output@start!, \!\pcol@imakeflushedpage!, \!\pcol@iflushfloats! and
% \!\pcol@output@end! also refer to the switch so that, if $\false$, they
% temporarily let $\!\c@page!=\page(p)+1$ in building the shipout image of
% the right component of the \parapag{}e pair of the page $p$ in order to
% have the appropriate page number parity for the right component. Among
% them, \!\@outputpage! has another mode dependant operation, if the switch
% is $\true$, to decrement \!\c@page! by one before shipping out the right
% component to cancel the increment in the ship-out process of the left
% component. The macro \!\pcol@addmarginpar! also examines the switch to
% decide the margin for marginal notes in \npaired{} \parapag{}es. Another
% examiner \!\pcol@zparacol! lets $\CSIndex{ifpcol@swapcolumn}=\false$
% only in the \env{paracol} environment to start if the switch is $\true$
% because \cswap{} is meaningless in \npaired{} \parapag{}ing.
% \end{macro}
%
% \begin{macro}{\ifpcol@swapcolumn}
% \changes{v1.2-4}{2013/05/11}
% {Introduced for column-swapping in even pages.}
% \begin{macro}{\ifpcol@swapmarginpar}
% \changes{v1.3-4}{2013/09/17}
% {Introduced for marginal-note-swapping in even pages.}
% \begin{macro}{\ifpcol@bg@swap}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for mirrored backgournd painting for even numbered
% pages.}
% \begin{macro}{\ifpcol@bg@@swap}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for mirrored backgournd painting for even numbered
% pages.}
%
% The switch \cs{ifpcol@swapcolumn}, \cs{ifpcol@swapmarginpar} and
% \cs{ifpcol@bg@swap} specify that, if $\true$, columns, marginal notes,
% and \bgpaint{} in even numbered pages are swapped, respectively.
% That is, \cs{ifpcol@swapcolumn} lets columns be put from right to left,
% \cs{ifpcol@swapmarginpar} lets marginal notes go to the opposite side from
% that in odd numbered pages, and \cs{ifpcol@bg@swap} makes \bgpaint{}
% \mirror{}ed.
%
% Besides the initial setting to let them $\false$ \!\global!ly after the
% declaration, the switches are \!\global!ly turned $\false$ by
% \!\pcol@twosided! for the cases in which API macro \!\twosided! does not
% have `|c|', `|m|' or `|b|' in its optional argument respectively, and then
% \!\global!ly turned $\true$ by $|\pcol@twosided@|{\cdot}k$
% ($k\in\{|c|,|m|,|b|\}$ )
%
% \SpecialIndex{\pcol@twosided@c}
% \SpecialIndex{\pcol@twosided@m}
% \SpecialIndex{\pcol@twosided@b}
%
% which is invoked when the argument contains `|c|', `|m|' or `|b|'
% respectively, or the API macro does not have the argument at
% all\footnote{
%
% \cs{ifpcol@swapcolumn} is also turned $\true$ and $\false$ by backward
% compatible API macros \cs{swapcolumn}\~\texttt{inevenpages} and
% \cs{noswapcolumninevenpages} respectively.}.
%
% \SpecialIndex{\swapcolumninevenpages}
% \SpecialIndex{\noswapcolumninevenpages}
%
% The switch \CSIndex{ifpcol@swapcolumn} is also turned $\false$ by
% \!\pcol@zparacol! but locally if \npaired{} \parapag{}ing is specified
% because \cswap{} is meaningless in the environment. Another modifier is (our
% own version of) \!\@outputpage!, but setting and examining the switch in
% this macro is also local and is to decide the ship-out order of left and
% right \parapag{}es.
%
% Besides the local use by \!\@outputpage!, \CSIndex{ifpcol@swapcolumn} is
% then examined by the following macros to do special operations if it is
% $\true$ and we are in an even numbered page.
%
% \begin{itemize}
% \item
% \!\pcol@swapcolumn! to reverse the order of column visiting in
% \!\pcol@ioutputelt!, \!\pcol@imakeflushedpage! and \!\pcol@iflushfloats!.
%
% \item
% \!\pcol@shiftspanning! to shift a \mctext{} to the left edge of text area.
%
% \item
% \!\pcol@bg@paint@ii! to \mirror{} the \bgpaint{} of columns and \csepgap{}s.
% \end{itemize}
%
% On the other hand, examiners of \CSIndex{ifpcol@swapmarginpar} and
% \CSIndex{ifpcol@bg@swap} are sole for each, namely \!\pcol@addmarginpar!
% and \!\pcol@bg@paint@i! respectively. If each switch is $\true$ and we
% are in an even numbered page, the former reverses \CSIndex{if@firstcolumn}
% from the value having been set for non-swapping case, while the latter
% \mirror{}s the \bgpaint{} of the regions excepting columns and
% \csepgap{}s.
%
% A related switch \CSIndex{ifpcol@bg@@swap} is let be $\true$ if
% \CSIndex{ifpcol@swapcolumn} or \cs{ifpcol@bg@}\~\texttt{swap}
%
% \CSINDEX{ifpcol@bg@swap}
%
% is $\true$ and we are working on a even numbered page by
% \!\pcol@bg@swappage! for \mirror{}ed \bgpaint{} of columns and
% \csepgap{}s, or other regions respectively, and then examined by
% \!\pcol@bg@paintregion@i! for \mirror{}ing.
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\ifpcol@bg@painted}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to examine if a set of regions are painted.}
%
% The switch \cs{ifpcol@bg@painted} is \!\global!ly turned $\false$ at the
% beginning of \!\pcol@bg@paint@i!, and then \!\global!ly turned $\true$ by
% \!\pcol@bg@paintregion! if it paint the region specified by its argument,
% i.e., \!\backgroundcolor! for the region is declared. Then the switch is
% examined by \!\pcol@bg@paint@i! to combine the painted region with others,
% by (our own version of) \!\@outputpage! and \!\pcol@outputpage@r! to
% incorporate painted regions into ship-out image.
% \end{macro}
%
% \begin{macro}{\ifpcol@bfbottom}
% \changes{v1.3-6}{2013/09/17}
% {Introduced to know which column-wise footnotes or bottom floats
% are put at the bottom of a column.}
%
% The switch \cs{ifpcol@bfbottom} is $\true$ if \!\@makecol! puts bottom
% floats at the bottom of a column as done by the macro in \LaTeX's standard
% implementation, or $\false$ otherwise and thus bottom floats can be
% followed by footnotes as done in p\LaTeX. Since we know only p\LaTeX{} is
% exceptional, we let the switch $\false$ iff \!\pfmtname! is defined and
% has |pLaTeX2e| in its body. The switch is examined by
% \!\pcol@measurecolumn! to determine which footnotes or bottom floats
% determine $\DP$ if both of them exist.
% \end{macro}
%
% \begin{macro}{\ifpcol@dfloats}
% \changes{v1.3-6}{2013/09/17}
% {Introduced to know if the last page has deferred column-wise floats.}
%
% The switch \cs{ifpcol@dfloats} is $\true$ iff one or more columns (in a
% \lpage) have deferred \cwise{} floats. Therefore, it is turned
% $\false$ by \!\pcol@sync! before it invokes \!\pcol@measurecolumn! which
% turns it $\true$ when it finds a column $c$ such that
% $\cc_c(\dl)\neq\emptyset$. Then the switch is examined by
% \!\pcol@makeflushedpage! to make a \lpage{} {\em full size}, and by
% \!\pcol@output@end! to flush these floats.
% \end{macro}
% \begin{macrocode}
\newif\ifpcol@output \global\pcol@outputfalse
\newif\ifpcol@nospan
\newif\ifpcol@sync \pcol@syncfalse
\newif\ifpcol@sptextstart \pcol@sptextstartfalse
\newif\ifpcol@sptext \pcol@sptextfalse
\newif\ifpcol@clear \pcol@clearfalse
\newif\ifpcol@flush
\newif\ifpcol@outputflt
\newif\ifpcol@lastpage
\newif\ifpcol@lastpagesave
\newif\ifpcol@scfnote \pcol@scfnotefalse
\newif\ifpcol@mgfnote \pcol@mgfnotefalse
\newif\ifpcol@fncounteradjustment \pcol@fncounteradjustmentfalse
\newif\ifpcol@inner
\newif\ifpcol@firstpage
\newif\ifpcol@havelastpage \global\pcol@havelastpagefalse
\newif\ifpcol@paired \global\pcol@pairedtrue
\newif\ifpcol@swapcolumn \global\pcol@swapcolumnfalse
\newif\ifpcol@swapmarginpar \global\pcol@swapmarginparfalse
\newif\ifpcol@bg@swap \global\pcol@bg@swapfalse
\newif\ifpcol@bg@@swap
\newif\ifpcol@bg@painted
\newif\ifpcol@bfbottom
\def\reserved@a{pLaTeX2e}
\ifx\reserved@a\pfmtname \pcol@bfbottomfalse \else \pcol@bfbottomtrue \fi
\newif\ifpcol@dfloats
% \end{macrocode}
%
%
%
% \subsection{\cs{dimen} and \cs{skip} Registers}
%
% The next declaration group is for six \!\dimen! and one \!\skip!
% registers.
%
% \begin{macro}{\pcol@prevdepth}
% The \!\dimen! register \!\pcol@prevdepth! is set to the depth of the last
% item added to the main vertical list of column $c$ from which we switch to
% another column $d$, i.e., \!\prevdepth! seen in \!\pcol@invokeoutput!
% before \!\output! request. The value of the register is then set into
% \!\prevdepth! also by \!\pcol@invokeoutput! after \!\output! for the
% column $d$. The value of the register is stored in $\cc_c(\pd)$ by
% \!\pcol@setcurrcol! and then restored into the register by
% \!\pcol@igetcurrcol! for the use in \!\pcol@invokeoutput! above and in
% \!\pcol@measurecolumn!, which may let the register and $\cc_c(\pd)$ have
% $\infty$ if the \colpage{} $c$ is empty. The register is also updated by
% \!\pcol@synccolumn! for empty main vertical list case, and by
% \!\pcol@output@end! to be set into \!\prevdepth! for the first vertical
% item of \postenv.
% \end{macro}
%
% \begin{macro}{\pcol@colht}
% The \!\dimen! register \!\pcol@colht! has $\VPP$ being the height of the
% tallest column in the \lpage{} taking \!\textfloatsep! below bottom floats
% into account if any. The register is initialized to be $-\!\maxdimen!$ by
% \!\pcol@sync! and then is examined and updated in \!\pcol@measurecolumn!
% to find the tallest column. Besides the internal use of this exploration,
% its result is referred to by \!\pcol@sync! as the threshold of \pfcheck,
% and by \!\pcol@makeflushedpage! through its argument given by
% \!\pcol@output@end! to know the height of multi-column stuff in the
% \lpage{}. The macro \!\pcol@makeflushedpage! also lets the register have
% 0 if the \lpage{} has nothing but non-\mgfnote{} \Scfnote{}. The other
% usage of this register is in \!\pcol@freshpage! to keep the value of
% \!\@colht! of the page made by \!\flushpage! or \!\clearpage! so that it
% is given to $\!\@colroom!=\cc_c(\vb^r)$ of each column $c$ in case a
% column $c'$ s.t.\ $c'<c$ made another page for \fcolumn{}s updating
% \!\@colht!.
% \end{macro}
%
% \begin{macro}{\pcol@textfloatsep}
% \changes{v1.0}{2011/10/10}
% {Introduced for the bug fix of float space enlargement.}
%
% The \!\dimen! (not \!\skip!) register \!\pcol@textfloatsep! has
% \!\maxdimen! if a \colpage{} does not have \sync{}ation points, to let top
% floats are inserted in usual way. If it has, the register may hold the
% vertical space amount inserted after top floats in a \colpage{} instead of
% \!\textfloatsep! so that, if a column only with top floats defines the
% first \sync{}ation point, the space for floats are extended to the
% \sync{}ation point. In this extension case, the register has the amount
% above biased by 10000\,|pt| to distinguish the case from another case with
% ordinary top floats in which the register has non-biased \!\textfloatsep!.
% In addition, if the register is less than \!\maxdimen! including a value
% equal to \!\textfloatsep!, top floats are packed in a \!\vbox! so that
% stretch\slash shrink factor of \!\floatsep! cannot move \sync{}ation
% points. After the default setting to be \!\maxdimen! by \!\pcol@zparacol!
% and \!\pcol@floatplacement!, the value of the register is stored in
% $\cc_c(\tf)$ by \!\pcol@setcurrcol! and then restored into the register by
% \!\pcol@igetcurrcol! for the use in \!\pcol@makecol!,
% \!\pcol@combinefloats!, \!\pcol@cflt!, \!\pcol@output@switch!,
% \!\pcol@measurecolumn!, \!\pcol@addflhd! and \!\pcol@synccolumn!.
% \end{macro}
%
% \begin{macro}{\pcol@lrmargin}
% \changes{v1.2-5}{2013/05/11}
% {Introduced to let \cs{linewidth} for each column has the value
% according to $w_c$ and the list-like environment surrounding
% \string\texttt{paracol} envrionment.}
% \begin{macro}{\pcol@bg@leftmargin}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
%
% The \!\dimen! register \!\pcol@lrmargin! is let have
% $\Uidx\lrm=\!\textwidth!-\!\linewidth!$ by \!\pcol@zparacol!, so that
% \!\linewidth! for column $c$ is let have $\w_c-\lrm$ by
% \!\pcol@invokeoutput!, which also sets \!\parshape! if $\lrm>0$.
%
% The other usage of this register is to have the left or right margin for
% \bgpaint{} in the alias \!\pcol@bg@leftmargin! for strict local use in
% \!\pcol@bg@paint@i! and its descendent macros for \bgpaint. That is, the
% register is aliased as \!\pcol@bg@leftmargin! by \!\pcol@bg@paint@i!, let
% have left or right margin by \!\pcol@bg@swappage!, and then referred to by
% \!\pcol@bg@pageleft!.
% \end{macro}\end{macro}
%
% \begin{macro}{\pagerim}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to specify the page rim size for backgournd coloring.}
%
% The API \!\dimen! register \!\pagerim! has the size of {\em\Uidx\prim{}s}
% specified by users. Since the rims are the area for which \bgpaint{}
% is inhibited, the register is used in area specification macros
% \!\pcol@bg@paperwidth!, \!\pcol@bg@paperheight!, \!\pcol@bg@pageleft! and
% \!\pcol@bg@pagetop!, in which the register has the negative counterpart of
% the specified value set by \!\pcol@bg@paint@i!.
% \end{macro}
%
% \begin{macro}{\pcol@topskip}
% The \!\skip! register \!\pcol@topskip! keeps the value of \!\topskip! at
% \beginparacol{} for the ordinary usage of \!\topskip! which may have 0 in
% the starting and \lpage{} temporarily. After the initialization by
% \!\pcol@zparacol!, it is referred to by \!\pcol@getpinfo! for pages without
% \spanning{} and thus \preenv, by \!\pcol@startpage! to let \!\topskip! and
% $\pp^t(p)$ has it for non-\spage{} $p$, by \!\pcol@output@start! for the
% second page if it finds \preenv{} is too large to combine with the
% multi-column stuff, and by \!\endparacol! to recover \!\topskip! for the
% pages following the \lpage.
% \end{macro}
%
% \begin{macro}{\belowfootnoteskip}
% \changes{v1.35-4}{2018/12/31}
% {Introduced to specify the additional space below the non-merged
% pre-environment footnotes.}
%
% The API \!\skip! register \!\belowfootnoteskip! has the amount of the space
% added below non-merged \Preenv{} footnotes. The register is initialized
% with the default 0\,pt, and then used in \!\pcol@output@start! to measure
% the room in the first page, and in \!\pcol@combinefootins! to add the
% space.
% \end{macro}
%
% \begin{macrocode}
\newdimen\pcol@prevdepth
\newdimen\pcol@colht
\newdimen\pcol@textfloatsep
\newdimen\pcol@lrmargin
\newdimen\pagerim \pagerim\z@
\newskip\pcol@topskip
\newskip\belowfootnoteskip \belowfootnoteskip\z@
% \end{macrocode}
%
%
%
% \subsection{\cs{box} Registers}
%
% The next declaration group is for the following \!\box! registers.
%
% \begin{macro}{\pcol@topfnotes}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for page-wise footnote functions.}
%
% The \!\box! register \!\pcol@topfnotes! is the implementation of $\df$ to
% have the list of deferred footnotes. The register is made void by
% \!\pcol@output@start! and then is made grown by \!\pcol@fntextother! with
% a deferred footnote added by the macro. The macro
% \!\pcol@deferredfootins! invoked from \!\pcol@startcolumn! and
% \!\pcol@restartcolumn! tries to \!\insert! the contents of the register
% through \!\footins! but may keep some of trailing ones in it if the total
% height of the footnotes is too large, while \!\pcol@output@end! does the
% \!\insert!ion without height capping. The macro \!\endparacol! with
% non-\mgfnote{} \Scfnote{} typesetting also refers to the register to pass
% it to \!\pcol@flushclear! as its argument so as to make an explicit page
% break if the register has some deferred footnotes.
% \end{macro}
%
% \begin{macro}{\pcol@prespan}
% \changes{v1.3-1}{2013/09/17}
% {Introduced to save pre-spanning-text stuff.}
%
% The \!\box! register \!\pcol@prespan! keeps the \prespan{} during a
% \mctext{} is processed by \TeX{} and our own \!\output! routine. That is,
% the macro \!\pcol@putbackmvl! saves the contents $\cc_0(\vb^b)$ of
% the column 0 to be restarted into the register instead of putting it back
% to the main vertical list, or makes the register $\bot$ if the column has
% nothing, when the restart follows the \sync{}ation with
% $\CSIndex{ifpcol@sptextstart}=\true$. Then the contents of the register
% is put back to the main vertical list together with the box having
% \mctext{} after its vertical size is registered in the list $\pp^s(p)$ of
% \mctext{} postions and heights, by \!\pcol@makecol! when the text sees a
% page break, or by \!\pcol@output@switch! when the text is completed.
% \end{macro}
%
% \begin{macro}{\pcol@rightpage}
% \changes{v1.3-2}{2013/09/17}
% {Introduced to have the ship-out image of a right parallel-page.}
%
% The \!\box! register \!\pcol@rightpage! is used to build (a part of) the
% ship-out image of a right \parapag{}e in it. The macros;
%
% \begin{quote}\raggedright
% \!\pcol@outputelt!,
% \!\pcol@ioutputelt!,
% \!\pcol@makeflushedpage!,
% \!\pcol@flushfloats!,
% \!\pcol@output@flush!, and
% \!\pcol@output@clear!
% \end{quote}
%
% work on the register together with \!\@outputbox! for
% the left \parapag{}e to pass both of them to (our of version of)
% \!\@outputpage!. The macro \!\pcol@output@end! also uses the register to
% paint the \bground{} of the empty counterpart of non-merged \Scfnote{}s in
% it, or to make the register $\bot$ when it have an empty \lpage{} but with
% \spanning{} of \pwise{} floats. After closing a \env{paracol}
% environment, the contents of the register
% will be shiped out by
% \!\@outputpage! invoked outside \env{paracol} environment when the
% \postenv{} sees a page break, or referred to by \!\pcol@output@start! as
% the \preenv{} in the right \parapag{}e. This right \preenv{} then will be
% combined with \colpage{}s in the right \parapag{}e by \!\pcol@ioutputelt!
% or \!\pcol@imakeflushedpage! for shipping-out, or by
% the latter indirectly invoked from \!\pcol@output@end! as the
% last\Index{last page}{} right \parapag{}e again. Therefore the \!\setbox!
% of the register in \!\pcol@output@start!, \!\pcol@makeflushedpage!,
% \!\pcol@imakeflushedpage! and \!\pcol@output@end! must be done
% \!\global!ly\footnote{
%
% The \!\global! setting in \!\pcol@makeflushedpage! and
% \!\pcol@imakeflushedpage!, together with \!\@outputbox! which does not
% need \!\global! assignment, is also required by the sake of simplicity in
% its implementation, incidentally.}.
% \end{macro}
%
% \begin{macro}{\pcol@colorstack@saved}
% \changes{v1.34}{2018/05/07}
% {Introduced as $\mathit{\Gamma}_s$ to keep the color stack
% $\mathit{\Gamma}^c$ until a column-page of $c$ becomes non-empty.}
%
% The \!\box! register \!\pcol@colorstack@saved! is $\csts$ to keep the
% \colorctext{} $\CST^c$ of column $c$ until its \ccolpage{} becomes non-empty
% to avoid that the \colpage{} only has coloring \!\special!s for
% \colorstack{} establishing and rewinding to let \!\pcol@ifempty! misjudge
% the \colpage{} is non-empty. It is let have $\Celt^c$, if defined,
% and $\cst$ by \!\pcol@savecolorstack! invoked from \!\pcol@startcolumn!
% and \!\pcol@output@start!, and from \!\pcol@restartcolumn! through
% \!\pcol@putbackmvl! when we know or find the (re)starting \colpage{} is
% empty. The macro \!\pcol@putbackmvl! also makes the \!\box! register
% $\bot$ when the restarting \colpage{} is not empty and thus the \colpage{}
% has had coloring \!\special!s for establishing \colorctext{} at its
% beginning. Then the register is given to \!\pcol@restorecst! by
% \!\pcol@clearcst@unvbox! to put leading coloring \!\special!s for
% establishing of the \colpage{} when we complete it by \!\pcol@opcol! or
% leave from it by \!\pcol@output@switch!.
% \end{macro}
%
% \begin{macro}{\pcol@tempboxa}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to have materials temporarily for column-separatig rule
% drawing or background painting.}
% \changes{v1.34}{2018/05/07}
% {Renamed from \cs{pcol@tempbox} because its relative
% \cs{pcol@tempboxb} is introduced.}
% \changes{v1.34}{2018/05/07}
% {Add ussage in \cs{pcol@scancst} and \cs{pcol@iscancst}.}
%
% The \!\box! register \!\pcol@tempboxa! is used to have stuff temporarily as
% follows.
%
% \begin{itemize}
% \item
% The macro \!\pcol@buildcolseprule! and its callee \!\pcol@buildcselt!
% builds the \cseprule{} in the register for a page to be shipped out, while
% its contents is put into each \csepgap{} by \!\pcol@hfil!.
%
% \item
% In (our own version of) \!\@outputpage!, the register has the \bgpaint{}
% of the (left parallel-) page,
%
% \Index{parallel-paging}
%
% which is inserted into the ship-out image by its callee
% \!\pcol@outputpage@l! through \!\everyvbox! and its contents
% \!\pcol@outputpage@ev!.
%
% \item
% In \!\pcol@scancst! and its callee \!\pcol@iscancst! to scan $\CSTraw^c$,
% $\CST^c$ or $\csts$, the sequence of (un)coloring \!\special!s to be put
% into the main vertical list is build in it.
% \end{itemize}
% \end{macro}
%
% \begin{macro}{\pcol@tempboxb}
% \changes{v1.34}{2018/05/07}
% {Introduced to extract the top of color stack $\mathit{\Gamma}$,
% $\mathit{\Gamma}_r$ or $\mathit{\Gamma}_s$.}
%
% The \!\box! register \!\pcol@tempboxb! is used in \!\pcol@iscancst!
% to extract the top (last) element of $\cst$, $\cstraw$ or $\csts$.
% \end{macro}
%
% \begin{macrocode}
\newbox\pcol@topfnotes
\newbox\pcol@prespan \setbox\pcol@prespan\box\voidb@x
\newbox\pcol@rightpage \global\setbox\pcol@rightpage\box\voidb@x
\newbox\pcol@colorstack@saved
\newbox\pcol@tempboxa
\newbox\pcol@tempboxb
% \end{macrocode}
%
%
%
% \subsection{\cs{insert} Register Set}
% \changes{v1.34}{2018/05/07}
% {Add \Sec3.6 ``\cs{insert} Register Set'' for \cs{pcol@colorins}.}
%
% The next declaration is for the following \!\insert! register set.
%
% \begin{macro}{\pcol@colorins}
% \changes{v1.34}{2018/05/07}
% {Introduced to present text-coloring operations to \cs{output}
% synchronously with column-pages.}
%
% The register set \!\pcol@colorins! is to \!\insert! a \!\vbox! containing a
% (un)coloring \!\special! for color pushing or popping, or the definition
% of a new default color of the current column. In order to make it sure
% that an \!\insert!ion does not affect \!\pagetotal! and is given to
% \!\output! with |\box255| containing the corresponding coloring
% \!\special! put in the main vertical list, \!\count!\!\pcol@colorins! and
% \!\skip!\!\pcol@colorins! are let be 0, while \!\dimen!\!\pcol@colorins! is
% let be \!\maxdimen! to allow a \colpage{} to have vitually infinite number
% of \!\insert!ions.
%
% The \!\insert!ion is done by \!\pcol@icolumncolor! for a default color
% definition, \!\pcol@set@color@push! for color pushing, and
% \!\pcol@reset@color@pop! and \!\pcol@reset@color@mpop! for color popping
% in non-math and math mode respectrively. Then \!\insert!ed \!\vbox!es are
% packed into \!\box!\!\pcol@colorins! and is given to \!\output! as
% $\cstraw$ to be scanned by \!\pcol@clearcolorstack! to reform it as
% $\cst$, and then scanned by \!\pcol@restorecolorstack! or saved into
% $\csts=\!\pcol@colorstack@saved!$ by \!\pcol@savecolorstack!. The
% register is also referred to by $\!\pcol@scancst!\arg{box}$ to examine if
% $\arg{box}$ is this register or \!\pcol@colorstack@saved!, and is made
% $\bot$ by \!\pcol@output@end! after the final reestablishment of the
% \colorstack.
%
% \begin{macrocode}
\newinsert\pcol@colorins
\count\pcol@colorins\z@ \skip\pcol@colorins\z@ \dimen\pcol@colorins\maxdimen
% \end{macrocode}
% \end{macro}
%
%
%
% \subsection{\cs{toks} Register}
%
% The last declaration is for the following \!\toks! register.
%
% \begin{macro}{\pcol@everyvbox}
% \changes{v1.22}{2013/06/30}
% {Introduced to keep \cs{everyvbox} work as usual while having
% \cs{pcol@innertrue} in it always.}
%
% The register \!\pcol@everyvbox! acts as \!\everyvbox! in \env{paracol}
% environments. That is, by \!\pcol@zparacol!, \!\everyvbox! is made
% \!\let!-equal to this register so that updates and references of
% \!\everyvbox! is made to this register, while the real \!\everyvbox! is
% let have the reference to the register and |\pcol@innertrue| to make
% $\CSIndex{ifpcol@inner}=\true$ in every \!\vbox!. Besides
% \!\pcol@zparacol!, the register is reffered to by
% \!\pcol@restoreeveryvbox! to examine if it has been \!\global!ly updated,
% i.e., its contents is not \!\pcol@dummytoken!.
% \end{macro}
%
% \begin{macrocode}
\newtoks\pcol@everyvbox
% \end{macrocode}
%
%
%
% \section{Logging Tools}
% \label{sec:imp-logging}
%
% Prior to the \!\def!initions of macros to implement \textsf{paracol}'s
% functions, we define a few macros for debug logging.
%
% \begin{macro}{\pcol@ShowBox}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \changes{v1.3-6}{2013/09/17}
% {Change \cs{unvcopy} to \cs{copy} to make sure the argument box
% causes overfull if its height is positive and even if it has
% nothing.}
% \changes{v1.34}{2018/05/07}
% {Add messaging {\tt (VOID)} if $\langle b\rangle\EQ\bot$,
% $\cs{vfuzz}\gets0$ to ensure overfull, and \cs{vskip} of 1\,{\tt
% pt} if $\langle b\rangle$'s height is 0 to ensure overfull too.}
%
% The macro $\!\pcol@ShowBox!\arg{b}$ puts a logging \!\message! showing the
% height, depth and width of the \!\box! (or \!\insert!) register $b$, or
% ``|(VOID)|'' if $b=\bot$. Then, if $b\neq\bot$, $b$'s contents is dumped
% into |.log| file making overfull intentionally by putting $b$ into
% \!\box!|0| of null height, together with \!\vskip! of 1\,|pt| if $b$'s
% height is 0, with setting $\!\vfuzz!=0$.
% \end{macro}
%
% \KeepSpace{13}
% \begin{macro}{\pcol@LogLevel}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@iLogLevel}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Log}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Log@iii}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Log@ii}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Log@i}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Logstart}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Logstart@ii}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Logstart@i}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Logend}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Logend@ii}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Logend@i}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Logfn}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Logfn@ii}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
% \begin{macro}{\pcol@Logfn@i}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for debugging page-wise footnote functions.}
%
% The macro $\!\pcol@LogLevel!\arg{l_1}\arg{l_2}\arg{l_3}$ defines the
% detailedness of logging done by logging macros. It invokes
% $\!\pcol@iLogLevel!\Arg{l_i}\Arg{cs}$ to let the following $|\|\arg{cs}$
% be $|\|\arg{cs}|@|\arg{l'_i}$ where $l'_i$ is the \!\romannumeral!
% representation of $l_i$.
%
% \begin{itemize}
% \item
% $\!\pcol@Log!\arg{cs}\Arg{m}\arg{f}$ is to log the contents of the \!\insert!
% register $f$ containing footnotes which is referred to by the macro
% $\arg{cs}$ in a context shown by $m$. The macro \!\pcol@Log@iii!
% ($l_1=3$) logs the detailed contents of $f$ by \!\pcol@ShowBox!, while
% \!\pcol@Log@ii! ($l_1=2$) just shows the height of $f$ and \!\pcol@Log@i!
% ($l_1=1$) does nothing.
%
% \item
% $\!\pcol@Logstart!\Arg{m}$ and $\!\pcol@Logend!\Arg{m}$ put logging
% \!\message!s `$|S:|m$' and `$|E:|m$' respectively to show the beginning
% and end of a procedure in the macro whose name is at the head of $m$, if
% $l_2=2$ and thus they are \!\let!-equal to \!\pcol@Logstart@ii! and
% \!\pcol@Logend@ii!. If $l_2=1$, \!\pcol@Logstart@i! and \!\pcol@Logend@i!
% do nothing.
%
% \item
% $\!\pcol@Logfn!\Arg{m}$ puts a logging \!\message! $m$ whose head is the
% macro name for footnotes whose information such as the ordinal number of
% the footnote processed by the macro may be shown in $m$ as well, if
% $l_3=2$ and thus it is \!\let!-equal to \!\pcol@Logfn@ii!. If $l_3=1$,
% \!\pcol@Logfn@i! does nothing.
% \end{itemize}
% \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}
%% Logging Tools
\def\pcol@ShowBox#1{%
\ifvoid#1\message{(VOID)}%
\else
\message{(\the\ht#1+\the\dp#1)x(\the\wd#1)}%
{\vfuzz\z@ \showboxdepth\@M \showboxbreadth\@M
\setbox\z@\vbox to\z@{\ifdim\ht#1=\z@ \vskip1\p@\fi \copy#1}}%
\fi}
\def\pcol@LogLevel#1#2#3{%
\pcol@iLogLevel{#1}{pcol@Log}%
\pcol@iLogLevel{#2}{pcol@Logstart}%
\pcol@iLogLevel{#2}{pcol@Logend}%
\pcol@iLogLevel{#3}{pcol@Logfn}}
\def\pcol@iLogLevel#1#2{%
\expandafter\let\expandafter\reserved@a
\csname #2@\romannumeral#1\endcsname
\expandafter\let\csname #2\endcsname\reserved@a}
\def\pcol@Log@iii#1#2#3{\message{\string#1{#2%
(\number\pcol@page:\number\pcol@currcol/\number\pcol@toppage)}}%
\pcol@ShowBox#3\message{end\string#1}}
\def\pcol@Log@ii#1#2#3{\message{\string#1{#2%
(\number\pcol@page:\number\pcol@currcol/\number\pcol@toppage)}=\the\ht#3}}
\def\pcol@Log@i#1#2#3{}
\def\pcol@Logstart@ii#1{\message{S\string#1}}
\def\pcol@Logend@ii#1{\message{E\string#1}}
\def\pcol@Logstart@i#1{}
\def\pcol@Logend@i#1{}
\def\pcol@Logfn@ii#1{\message{\string#1}}
\def\pcol@Logfn@i#1{}
\pcol@LogLevel111
% \end{macrocode}
%
% \begin{macro}{\pcol@F@write}
% \changes{v1.32-2}{2015/10/10}
% {Introduced for debugging memory leak problems.}
% \begin{macro}{\pcol@F}
% \changes{v1.32-2}{2015/10/10}
% {Introduced for debugging memory leak problems.}
% \begin{macro}{\pcol@FF}
% \changes{v1.32-2}{2015/10/10}
% {Introduced for debugging memory leak problems.}
% \begin{macro}{\pcol@F@count}
% \changes{v1.32-2}{2015/10/10}
% {Introduced for debugging memory leak problems.}
% \begin{macro}{\pcol@F@n}
% \changes{v1.32-2}{2015/10/10}
% {Introduced for debugging memory leak problems.}
% \begin{macro}{\pcol@Fb}
% \changes{v1.32-2}{2015/10/10}
% {Introduced for debugging memory leak problems.}
% \begin{macro}{\pcol@Fe}
% \changes{v1.32-2}{2015/10/10}
% {Introduced for debugging memory leak problems.}
% Another debugging tool is for investigating memory leak problems. Since
% \Paracol{} uses \!\insert! registers for various purposes, management
% operations of them especially that for proper release of them are crusial
% for the correctness of the implmentation. A source of toughness in
% debugging {\em memory leak} caused by missing a release of a register back
% to \!\@freelist! is that the resulting shortage is revealed long after the
% leakage to make it hard to find the point of the leakage.
%
% The set of macros is to help such debugging by logging the aquire and
% release of \!\insert! registers into a file named $\arg{job}|.fls|$
% associated with \!\pcol@F@write! where $\arg{job}$ is given by
% \!\jobname!. After opened when \Paracol{} is loaded, the file is written by
% $\!\pcol@FF!\Arg{m_a}\Arg{m_b}$ with a line of the following form with
% text messages $m_a$ and $m_b$, where $p=\!\pcol@page!$,
% $c=\!\pcol@currcol!$, $\ptop=\!\pcol@toppage!$, $\pi=\page(p)=\!\c@page!$,
% and $n_b=\!\pcol@F@n!$ is the cardinality of \!\@deferlist! counted by
% \!\pcol@F@count!.
%
% \begin{itemize}\item[]
% $\arg{m_a}|(|\arg{p}|:|\arg{c}|/|\arg{\ptop}|:|\arg{\pi}|)=|
% \arg{n_b}\arg{m_b}$
% \end{itemize}
%
% The argument $\arg{m_b}$ is empty when $\!\pcol@FF!$ is invoked from
% $\!\pcol@F!\arg{m_a}$ for snapshot, while
% $\arg{m_b}=\hbox{`|<=|$\arg{n_b}$'}$ when invoked from
% $\!\pcol@Fe!\arg{m_a}$ paired by $\!\pcol@Fb!=\!\pcol@F@count!$ by which
% the cardinality of \!\@freelist! is given to $\arg{n_b}$ through
% \!\pcol@F@n! and then \!\reserved@a!. Therefore, by the pair of
% \!\pcol@Fb! and \!\pcol@Fe!, the consumption or restitution in a series of
% operations surrounded by the pair is logged in the file.
%
% In the production version, the logging is disabled of course by \!\let!ting
% \!\pcol@F! and \!\pcol@Fe! be \!\@gobble! and \!\pcol@F! be \!\relax!,
% while the open of \!\pcol@F@write! is disabled as well by a pair of
% \cs{iffalse} and \cs{fi}.
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macrocode}
\iffalse
\newwrite\pcol@F@write
\immediate\openout\pcol@F@write\jobname.fls
\fi
\def\pcol@F#1{\pcol@FF{#1}{}}
\def\pcol@FF#1#2{\pcol@F@count
\immediate\write\pcol@F@write{#1(\number\pcol@page:\number\pcol@currcol/%
\number\pcol@toppage:\number\c@page)=\pcol@F@n #2}}
\def\pcol@F@count{{\@tempcnta\z@
\def\@elt##1{\advance\@tempcnta\@ne}\@freelist
\xdef\pcol@F@n{\number\@tempcnta}}}
\let\pcol@Fb\pcol@F@count
\def\pcol@Fe#1{{\let\reserved@a\pcol@F@n \pcol@FF{#1}{<=\reserved@a}}}
\let\pcol@F\@gobble
\let\pcol@Fb\relax
\let\pcol@Fe\@gobble
% \end{macrocode}
%
%
%
% \section{\cs{output} Routine}
% \label{sec:imp-output}
%
% \begin{macro}{\pcol@ovf}
% Before giving the definitions of macros in \!\output! routine, we define
% the macro \!\pcol@ovf! invoked if \!\@freelist! is empty on an acquision
% of an \!\insert! by \!\@next! and thus we have to abort the execution by
% \!\PackageError! with a message notifying the shortage. The additional
% help message is \!\@ehb! as in \!\@fltovf!. This macro is used in
% \!\pcol@opcol!, \!\pcol@startpage!, \!\pcol@output@start!,
% \!\pcol@output@switch!, \!\pcol@iscancst!, \!\pcol@savefootins!,
% \!\pcol@flushcolumn!, \!\pcol@synccolumn!, \!\pcol@output@end! and
% \!\pcol@icolumncolor!.
% \end{macro}
%
% \begin{macrocode}
%% \output Routine
\def\pcol@ovf{%
\PackageError{paracol}{Too many unprocessed columns/floats}\@ehb}
% \end{macrocode}
%
% \begin{macro}{\pcol@output}
% \changes{v1.2-2}{2013/05/11}
% {Add \cs{pcol@Logstart} and \cs{pcol@Logend}.}
% \changes{v1.2-7}{2013/05/11}
% {Add the examination of \cs{ifpcol@output} and \protect\LaTeX's
% original sequence for \cs{output} request sneaked from outside of
% \texttt{paracol} environment.}
% \changes{v1.2-7}{2013/05/11}
% {Add the assignment of \cs{@maxdepth} to \cs{maxdepth} to nullify
% the temproary setting done by \cs{@addtobot}.}
% \changes{v1.33-2}{2016/11/19}
% {Add a space after \cs{@opcol} to obey the coding convention.}
%
% The macro \!\pcol@output! is the \Paracol's version of \!\output! which
% is let have this macro as its sole token by \!\pcol@zparacol!. The
% structure of this macro is same as that of \LaTeX's \!\output! but the
% following replacements are made\footnote{.
%
% Besides the logging with \cs{pcol@Logstart} and \cs{pcol@Logend}.}.
%
% \begin{itemize}
% \item
% $\!\@specialoutput!\to\!\pcol@specialoutput!$ to process \LaTeX's genuine
% functions including the customized marginal note placement, and \Paracol's
% own special output functions; starting first page, \colorctext{} management,
% \cswitch, page flushing with\slash without float flusing, and building the
% multi-column part of the \lpage.
%
% \item
% \changes{v1.0}{2011/10/10}
% {Replace \cs{@makecol} with \cs{pcol@makecol} for a special care for
% column-pages with synchronization points.}
%
% $\!\@makecol!\to\!\pcol@makecol!$ for a special care for \ccolpage{} having
% \sync{}ation point and/or \Scfnote{}s.
%
% \item
% $\!\@opcol!\to\!\pcol@opcol!$ to hold the \ccolpage{} which just has
% completed.
%
% \item
% \changes{v1.2-2}{2013/05/11}
% {Add an argument \cs{@ne} to \cs{pcol@startcolumn} to distinguish it
% from the invocation in \cs{pcol@freshpage}.}
%
% $\!\@startcolumn!\to\!\pcol@startcolumn!$ to creat a new \colpage{}. The
% argument \!\@ne! is to distinguish the invocation in this macro from
% that in \!\pcol@freshpage! so that the \!\insert!ions of $\pp^f(p)$ and
% $\df$ are done only when a new \colpage{} is created with ordinary page
% break.
% \end{itemize}
%
% \changes{v1.22}{2013/06/30}
% {Add reset of \cs{set@color}.}
% \changes{v1.24}{2013/07/27}
% {Add zero-clear of \cs{pcol@mcid}.}
% \changes{v1.3-1}{2013/09/17}
% {Add $\cs{ifpcol@sptextstart}\EQ\string\mathit{false}$ to the
% condition for the warning of too small \cs{vsize}.}
%
% In addition, before we start the main body of \!\output! routine, we add
% two operations for coloring. One is to make
% \!\set@color! \!\let!-equal to \!\pcol@set@color!, i.e, to let it regain
% its original definition throughout \!\output! routine, because
% no manipulation of \colorstack{} is necessary\footnote{
%
% Though this operation is not necessary because \cs{everyvbox} should work
% for any \cs{set@color} because they should be in a \cs{vbox}, we dare to
% do it for clearity.}.
%
% The other is to zero-clear the counter \!\pcol@mcid! because we are
% definitely in the main (non-internal) vertical mode and thus all push/pop
% pairs of the coloring in math mode have been processed.
%
% Further, before we start the sequence for non-special \!\output! request
% on page breaks, we examine if $\CSIndex{ifpcol@output}=\true$ to mean
% \!\pcol@output@start! has already been invoked in order to cope with
% \!\output! request {\em sneaking}. This sneaking happens when
% \beginparacol{} is at a crtical position of page breaking at which the
% \preenv{} has already exceeds \!\vsize! but \TeX{} cannot make the
% \!\output! request for the page break at \CSIndex{par} at the beginning of
% \!\pcol@zparacol! because it sees $\!\penalty!=10000$ due to, e.g., a
% sectioning command just preceding \beginparacol. In this case, the
% request is postponed until \TeX{} see a \!\penalty! less than 10000 and
% thus it is made with some non-special \!\outputpenalty! greather than
% $-10000$ when \TeX{} sees the dummy request of $\!\penalty!=-10004$ in
% \!\pcol@invokeoutput! for \!\pcol@output@start!. At this timing,
% \!\pcol@zparacol! has already let \!\output! have \!\pcol@output! of
% course but the request must be processed by original \!\output! because it
% is made {\em outside} of the \env{paracol} environment which has just
% started. Therefore, if $\CSIndex{ifpcol@output}=\false$, we have to
% perform the operation sequence as the original \!\output! does.
% Furthermore, we have to take care of the fact that a few our own settings
% related to \!\output! routine has already been made in \!\pcol@zparacol!,
% namely $\CSIndex{if@twocolumn}=\true$ and
% $\!\@combinefloats!=\!\pcol@combinefloats!$, which should make the macros
% in the original sequnce confused especially by the former. Therefore, we
% turns $\CSIndex{if@twocolumn}=\false$ and let \!\@combinefloats! have the
% original definition kept in \!\pcol@@combinefloats!\footnote{
%
% Though we know \cs{pcol@combinefloats} acts exactly as \cs{@combinefloats}
% because \cs{pcol@zparacol} initializes $\cs{pcol@textfloatsep}=\infty$ and
% $\cs{ifpcol@lastpage}=\false$. On the other hand, we don't cancel the
% re\cs{def}itnition of \cs{footnoterule} because it should be
% $\cs{textwidth}=\cs{columnwidth}$ outside of \env{paracol} environments.}
%
% temporarily, i.e., only in the group automatically surrounding the
% invocation of \!\output!.
%
% Another addition is to assign \!\@maxdepth! to \!\maxdepth! in order to
% nullify the temporary setting to 0 done in \!\@addtobot!. By this
% assignment, in \env{paracol} environments \TeX's page builder always
% refers to the value in \!\@maxdepth!. Yet another addition is to add
% $\CSIndex{ifpcol@sptextstart}=\false$ to the condition for the warning of
% too short \!\vsize!, because a \mctext{} can start near the bottom of a
% page with a small \!\@colroom! less than $1.5\times\!\baselineskip!$ and
% thus the warning is unnecessary and inappropriate when
% $\CSIndex{ifpcol@sptextstart}=\true$.
%
% \begin{macrocode}
\def\pcol@output{\let\par\@@par \let\set@color\pcol@set@color
\global\pcol@mcid\z@
\pcol@Logstart{\pcol@output\number\outputpenalty
(\number\c@page:\number\pcol@currcol)}%
\ifnum\outputpenalty<-\@M
\pcol@specialoutput
\else\ifpcol@output
\pcol@makecol
\pcol@opcol
\pcol@startcolumn\@ne
\@whilesw\if@fcolmade\fi{\pcol@opcol \pcol@startcolumn\@ne}%
\else
\@twocolumnfalse \let\@combinefloats\pcol@@combinefloats
\@makecol
\@opcol
\@startcolumn
\@whilesw\if@fcolmade\fi{\@opcol \@startcolumn}%
\fi\fi
\global\maxdepth\@maxdepth
\ifnum\outputpenalty>-\@Miv
\ifdim\@colroom<1.5\baselineskip
\ifdim\@colroom<\textheight
\ifpcol@sptextstart
\global\vsize\@colroom
\else
\@latex@warning@no@line{Text page \thepage\space
contains only floats}%
\@emptycol
\fi
\else
\global\vsize\@colroom
\fi
\else
\global\vsize\@colroom
\fi
\else
\global\vsize\maxdimen
\fi
\pcol@Logend\pcol@output}
% \end{macrocode}
% \end{macro}
%
%
%
% \section{Completing Column-Page}
% \label{sec:imp-opcol}
%
% \begin{macro}{\pcol@@makecol}
% \changes{v1.2-7}{2013/05/11}
% {Introduced to cope with the careless implementaion of \cs{@makecol}
% in p\string\LaTeX.}
% \changes{v1.3-6}{2013/09/17}
% {Add an argument $d$ to be assigned to \cs{boxmaxdepth} to let it
% have 0 rather than \cs{@maxdepth} for last page.}
%
% The macro $\!\pcol@@makecol!\<d\>$ is used in \!\pcol@flushcolumn! and
% \!\pcol@imakeflushedpage! which simply require \LaTeX's original
% \!\@makecol! to build the ship-out image of a \colpage. The reason why we
% need our own version is that a variation of \LaTeX, namely p\LaTeX{} for
% Japanese, carelessly implements its own \!\@makecol! to make the resulting
% \!\@outputbox! has a depth larger than \!\@maxdepth! if the \colpage{} has
% \Mcfnote{}s whose last line is unusually deep. To cope with the problem,
% this macro at first invokes \!\@makecol!, and then reshape \!\@outputbox!
% assigning $d=\!\@maxdepth!$ to \!\boxmaxdepth! to cap its depth, unless
% this macro is used for the \lpage{} with $d=0$ because depth of the last
% component of the \!\@outputbox! is incorporated in \!\@colht!.
%
% \begin{macrocode}
%% Completing Column-Page
\def\pcol@@makecol#1{\@makecol
\setbox\@outputbox\vbox to\@colht{\boxmaxdepth#1\unvbox\@outputbox}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@makecol}
% \changes{v1.0}{2011/10/10}
% {Introduced for special float handling in a column-page with
% synchronization points.}
% \changes{v1.2-2}{2013/05/11}
% {Add save/discard of page-wise footnotes.}
% \changes{v1.2-7}{2013/05/11}
% {Remove unnecessary check of \cs{ifpcol@lastpage} on the
% redefinition of \cs{@textbottom}.}
% \changes{v1.3-1}{2013/09/17}
% {Add a function to capture a broken spanning text, to combine it
% with pre-spanning-text stuff, and to shift it left on
% column-swapping.}
% \changes{v1.3-3}{2013/09/17}
% {Add the addition of the element to $\pi^s(p)$ for a broken
% spanning text.}
% \changes{v1.3-4}{2013/09/17}
% {Add $\pi^m(p)\EQ\cs{pcol@mparbottom}$ to the argument of
% \cs{pcol@defcurrpage}.}
% \changes{v1.3-3}{2013/09/17}
% {Add \cs{@colht} and \cs{relax} as the first and third argument of
% \cs{pcol@shrinkcolbyfn}.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
% \changes{v1.33-2}{2016/11/19}
% {Move down the \cs{def}inition of \cs{pcol@currfoot} with $\bot$ to
% place it just before the \cs{ifpcol@scfnote}/\cs{fi} construct to
% make it clear how \cs{pcol@currfoot} is \cs{def}ined.}
%
% The macro \!\pcol@makecol! is invoked solely from \!\pcol@output! to build
% the shipping image of the \ccolpage{} which just has completed in
% \!\@outputbox!. This macro has two additional functions to its original
% version \!\@makecol!\footnote{
%
% Not \cs{pcol@@makecol} because the depth capping of \cs{@outputbox} is
% done by \cs{pcol@opcol} when it saves the box into $\cc_c(\vb^b)$.}
%
% invoked in this macro.
%
% First, if $\cc_c(\tf)\neq\infty$ to mean the \colpage{} has \sync{}ation
% points, \!\@makecol! is invoked with a special \!\def!inition of
% \!\@textbottom! to put a vertical skip having $1/10000\,|fil|$ as its
% stretch and shrink. This modification is to nullify not only finite
% stretches (as \!\raggedbottom! does) but also finite shrinks possibly
% inserted just below the last \sync{}ation point to move up the first
% visible item upward a little bit if active. Therefore, \!\flushbottom!
% setting is nullified for \colpage{}s having \sync{}ation points and a
% small exceess from the bottom of a \colpage{} cannot be absorbed by
% shrinks but visible at the bottom\footnote{
%
% That is, the author gives higher priority to the perfect alignment of the
% items following a \sync{}ation point.}.
%
% Note that the original definition of \!\@textbottom! is saved in
% \Midx{\!\pcol@textbottom!} before the invocation of \!\@makecol! and is
% restored after that\footnote{
%
% This save/restore cannot be done by a grouping because \!\@makecol! builds
% \!\@outputbox! by local assignments.}.
%
% Second, if $\CSIndex{pcol@sptext}=\true$ and $c=0$ to mean a \mctext{}
% encounters a page break, we have the first half (or second or succeeding
% part if the text lays across three or more pages) of the text in
% \!\box!|255|. Therefore, we add an element $\spt(H_n,h_n)$ to the tail of
% the list of \mctext{}s $\pp^s(\ptop)=\!\pcol@sptextlist!$, where $H_n$ is
% the height of \prespan{} in \!\pcol@prespan!\footnote{
%
% Since we have a \sync{}ation point before a \mctext{} always, \prespan{}
% or its sole contents \cs{vbox} has a vertical skip at its tail to make the
% its depth 0 as discussed in \secref{sec:imp-sout-sync}.}
%
% plus the total height of top floats calculated by \!\pcol@addflhd! with
% $\cc_c(\tl)=\!\@toplist!$, and $h_n$ is the height-plus-depth of
% \!\box!|255|. Note that $H_n$ and $h_n$ are represented in the form of
% integer and thus we produce them by expansions with \!\number!.
%
% The addition, however, is not made if $h_n=0$ because painting its
% \bground{} is harmful if an extension is specified to make the region
% visible, while not painting or drawing a segment of \cseprule{} is very
% natural. Note that this $h_n=0$ case includes that in which \!\box!|255|
% has nothing but its height-plus-depth is non-zero because of discarding
% leading skips of the \mctext{} as pre-break skips. This special case is
% detected by decapsulating \!\box!|255| by \!\unvcopy! and examining the
% height-plus-depth of the result\footnote{
%
% We cannot do
% \cs{setbox}\cs{@cclv}\cs{vbox}\texttt{\Arg{\cs{unvbox}\cs{@cclv}}}
% because it erases the effect of pre-break skip following some visible
% material.}.
%
% Also note that the list to be added is always for the \tpage{}, i.e.,
% $\pp^s(\ptop)$ and thus we get and update it by \!\pcol@getcurrpinfo! and
% \!\pcol@defcurrpage!, because the \mctext{} immediately follows a
% \sync{}ation point in $\ptop$. Then we let \!\box!|255| have the
% \prespan{} followed by the \mctext{} being the original contents of
% \!\box!|255|, which may be shifted left by
% $\WT-w_c=\!\textwidth!-\!\columnwidth!$ by the macro
% \!\pcol@shiftspanning! if \cswap{} is in effect so that its left edge is
% aligned to that of the leftmost column, i.e., of the text area.
%
% The third addition is for \Scfnote{}s. If they are presented in
% \!\footins!, we shrink \!\@colht! by its height plus depth
% by \!\pcol@shrinkcolbyfn! and put the stretch and shrink factor of
% \!\skip!\!\footins! at the bottom of \!\box!|255| by \!\pcol@unvbox@cclv!
% to {\em remove} footnotes from the \colpage{} but keeping the
% stretch\slash shrink contribution to the page breaking by their existence.
% Then we save \!\footins! into a new \!\insert! to be referred to as
% \!\pcol@currfoot!\footnote{
%
% Not in \cs{pcol@footins} because it is destroyed in \cs{pcol@startpage}
% just before saving operation into $\pp^f(p)$.}
%
% by \!\pcol@savefootins! if $p=\ptop$ so that it is saved in $\pp^f(p)$ by
% \!\pcol@startpage! afterward, or simply discard the contents of
% \!\footins! otherwise because $\pp^f(p)$ has already been fixed. Note
% that these saving\slash discarding make \!\footins! void and thus
% \!\@makecol! will not put footnotes.
%
% On the other hand, if footnote typesetting is \mcfnote{}, \!\footins! is
% kept unchanged so that its contents will be put by \!\@makecol! if it has
% something. As for \!\pcol@currfoot!, it should have its default value
% $\!\voidb@x!=\bot$ assigned to it beforehand, so that, if $p=\ptop$,
% \!\pcol@startpage! will make $\pp^f(p)=\bot$ unless \Scfnote{s} are given
% in \!\footins!.
%
% \begin{macrocode}
\def\pcol@makecol{\let\pcol@textbottom\@textbottom
\ifdim\pcol@textfloatsep=\maxdimen\else
\def\@textbottom{\vskip\z@\@plus.0001fil\@minus.0001fil}\fi
\ifpcol@sptext \ifnum\pcol@currcol=\z@
\pcol@getcurrpinfo\@tempcnta\@tempdima\@tempskipa
\setbox\@tempboxa\vbox{\unvcopy\@cclv}%
\@tempdimb\ht\@tempboxa \advance\@tempdimb\dp\@tempboxa
\ifdim\@tempdimb>\z@
\@tempdimb\ht\@cclv \advance\@tempdimb\dp\@cclv
\dimen@\ht\pcol@prespan \pcol@addflhd\@toplist\pcol@textfloatsep
\@cons\pcol@sptextlist{{\number\dimen@}{\number\@tempdimb}}%
\fi
\pcol@defcurrpage{\number\@tempcnta}\pcol@spanning\pcol@footins
{\pcol@sptextlist}{\pcol@mparbottom}%
\setbox\@cclv\vbox{\unvbox\pcol@prespan \pcol@shiftspanning\@cclv
\unvbox\@cclv}%
\fi\fi
\def\pcol@currfoot{\voidb@x}%
\ifpcol@scfnote \ifvoid\footins\else
\pcol@shrinkcolbyfn\@colht\footins\relax
\setbox\@cclv\vbox{\pcol@unvbox@cclv\footins}%
\ifnum\pcol@page=\pcol@toppage
\pcol@Log\pcol@makecol{save}\footins
\pcol@Fb
\pcol@savefootins\pcol@currfoot
\pcol@Fe{makecol(pagefn)}%
\else
\pcol@Log\pcol@makecol{discard}\footins
\setbox\@tempboxa\box\footins
\fi
\fi\fi
\pcol@Logstart\pcol@makecol
\ifvoid\footins\else \pcol@Log\@makecol{put}\footins \fi
\@makecol
\pcol@Logend\pcol@makecol
\let\@textbottom\pcol@textbottom}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{1}
% \begin{macro}{\@combinefloats}
% \begin{macro}{\pcol@combinefloats}
% \changes{v1.0}{2011/10/10}
% {Introduced for special float handling in a column-page with
% synchronization points.}
% \changes{v1.2-2}{2013/05/11}
% {Remove the shrink of \cs{textfloatsep} because each column in the last
% page is now made not taller than \cs{@colht} definitely by the
% introduction of the pre-flushing column height check.}
% \changes{v1.2-7}{2013/05/11}
% {Add the assignment of \cs{@maxdepth} to \cs{maxdepth} to nullify
% the temproary setting done by \cs{@addtobot}.}
% \changes{v1.3-6}{2013/09/17}
% {Add special operations for columns having synchronization point to
% move the infinite stretch and shrink to let it follow bottom floats
% ratehr than preceding them.}
% \begin{macro}{\pcol@@combinefloats}
% \changes{v1.2-7}{2013/05/11}
% {Introduced to solve the \cs{output} request sneaking.}
%
% The macro \!\pcol@combinefloats! being our own version of \!\@combinefloats!
% is used in \LaTeX's \!\@makecol! because the original and our
% own are made \!\let!-equal by \!\pcol@zparacol!, and also used in
% \!\pcol@makenormalcol! explicitly. The customization is twofold for both
% of top and bottom floats.
%
% For the top floats, we invoke the original \!\@cflt! if
% $\cc_c(\tf)=\infty$ to mean the \colpage{} to be shipped out does not have
% \sync{}ation points, or otherwise our own \!\pcol@cflt! which we will
% discuss shortly. Prior to the invocation of \!\@cflt!, in addition, we
% let $\!\maxdepth!=\!\@maxdepth!$ so that the macro refers to the value used
% throughout a \env{paracol} environment instead of that modified by
% \!\@addtobot! possibly affect the work in \!\@cflt! by the following
% sequence.
%
% \begin{eqnarray*}
% \!\pcol@flushcolumn!(c)&\to&\!\pcol@trynextcolumn!\to\cdots\to\!\@addtobot!\\
% &\to&\!\pcol@flushcolumn!(c{+}k)\to\!\pcol@@makecol!\to\!\@makecol!\\
% &\to&\!\pcol@combinefloats!\to\!\@cflt!
% \end{eqnarray*}
%
% For the bottom floats, we invoke the original \!\@cflb! always but, if
% the \colpage{} has \sync{}ation points, we insert vertical skips of
% $s=0\,|pt|\ |plus|\ 0.0001\,|fil|\ |minus|\ 0.0001\,|fil|$ and $-s$ before
% and after the invocation respectively. Since \!\@textbottom! is let have
% the skip of $s$ by \!\pcol@makecol! for a \colpage{} having \sync{}ation
% points and is inserted below bottom floats by \!\@makecol!\footnote{
%
% The insertion point is common to \LaTeX{} and p\LaTeX{}.},
%
% the effect of \!\@textbottom! is canceled by the skip of $-s$ but looks
% moved above bottom floats. Therefore, if the natural height of the
% \colpage{} is smaller than \!\@colht!, bottom floats are flushed to the
% page bottom as if \colpage{} itself is flushed by \!\newpage! etc. On the
% other hand, if the natural height is larger, more importantly, all shrinks
% below the last \sync{}ation point is canceled by the infinite shrink in
% $s$ above the bottom float but we should have sufficient space for shrinks
% there thanks to \!\textfloatsep! to avoid the interference between the
% bottom text and bottom floats.
%
% In addition, if $\CSIndex{ifpcol@lastpage}=\true$ to mean the \colpage{} is
% in the \lpage{}, we insert \!\textfloatsep! in \!\@outputbox! below the
% bottom floats so that they are well separated from \postenv. The switch
% is also $\true$ in the invocation from \!\pcol@makenormalcol! for
% \preenv{}, so that the bottom floats in it are well separated from the top
% of multi-column stuff in the \spage.
%
% On the other hand, the original \!\@combinefloats! saved in
% \!\pcol@@combinefloats! by \!\pcol@zparacol! is used in \!\pcol@output! to
% restore the original when it finds \!\output! request sneaking.
%
% \begin{macrocode}
\def\pcol@combinefloats{%
\global\maxdepth\@maxdepth
\ifx\@toplist\@empty\else
\ifdim\pcol@textfloatsep=\maxdimen \@cflt \else \pcol@cflt \fi
\fi
\ifx\@botlist\@empty\else
\ifdim\pcol@textfloatsep=\maxdimen \@cflb
\else
\setbox\@outputbox\vbox{\unvbox\@outputbox
\vskip\z@\@plus.0001fil\@minus.0001fil}%
\@cflb
\setbox\@outputbox\vbox{\unvbox\@outputbox
\vskip\z@\@plus-.0001fil\@minus-.0001fil}%
\fi
\ifpcol@lastpage
\setbox\@outputbox\vbox{\box\@outputbox \vskip\textfloatsep}%
\fi
\fi}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@cflt}
% \changes{v1.0}{2011/10/10}
% {Introduced for special float handling in a column-page with
% synchronization points.}
% \changes{v1.2-7}{2013/05/11}
% {Replace \cs{maxdepth} with \cs{@maxdepth}.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
% \changes{v1.33-2}{2016/11/19}
% {Add {\tt\%} to the end of the line to open \cs{vbox} for
% \cs{@outputbox} to obey the coding convention.}
%
% The macro \!\pcol@cflt! is invoked solely from \!\pcol@combinefloats! if
% the \colpage{} for which the macro combines the top floats has
% \sync{}ation points. The macro has the same structure as \LaTeX's version
% \!\@cflt! but has three modifications. The first one is that the floats
% are packed in a \!\vbox! rather than listed in \!\@outputbox! to nullify
% the stretch and shrink of \!\floatsep! to keep the \sync{}ation point from
% moving by them\footnote{
%
% Maybe unnecessary because of \!\@textbottom! inserted by \!\pcol@makecol!
% but \ldots}.
%
% The second is that we use \!\@maxdepth! instead of \!\maxdepth! to make it
% clear we always use the value common throughout a \env{paracol}
% environment. The third is that the \!\textfloatsep! is replaced with
% $\!\pcol@textfloatsep!=\cc_c(\tf)$ (definitely finite) which can have a
% value different from \!\textfloatsep! when the float space is enlarged for
% \sync{}ation. If this enlargement is required, $\cc_c(\tf)$ is biased by
% 10000\,|pt| and thus is assuredly\footnote{
%
% Though not definitely in theoretical sense.}
%
% larger than 5000\,|pt|. If so, the insertion of \!\topfigrule! should be
% inhibited because it has already been inserted by \!\pcol@synccolumn! or
% there are no real floats but we only have the float for main vertical list
% prior to the \sync{}ation point, or {\em\Uidx\mvlfloat} in short.
%
% \begin{macrocode}
\def\pcol@cflt{%
\let\@elt\@comflelt
\setbox\@tempboxa\vbox{}%
\@toplist
\setbox\@outputbox\vbox{%
\boxmaxdepth\@maxdepth
\box\@tempboxa
\vskip-\floatsep
\ifdim\pcol@textfloatsep>5000\p@
\advance\pcol@textfloatsep-\@M\p@
\else
\topfigrule
\fi
\vskip\pcol@textfloatsep
\unvbox\@outputbox}%
\let\@elt\relax
\pcol@Fb
\xdef\@freelist{\@freelist\@toplist}%
\pcol@Fe{cflt}%
\global\let\@toplist\@empty}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@opcol}
% \changes{v1.0}{2011/10/10}
% {Remove unnecessary assignment of \cs{@colht}.}
% \changes{v1.0}{2011/10/10}
% {Rename \cs{pcol@maxpage} as \cs{pcol@toppage}.}
% \changes{v1.2-1}{2013/05/11}
% {Add \cs{pcol@clearcst@unvbox} to add coloring \cs{special}s at the
% top and bottom of the column-page to be shipped out, together with
% the setting $\cs{boxmaxdepth}\EQ\cs{@maxdepth}$ for depth capping.}
% \changes{v1.3-2}{2013/09/17}
% {Rename \cs{pcol@outputpage} as \cs{pcol@outputcolumns}.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
% \changes{v1.33-2}{2016/11/19}
% {Add {\tt\%} to the end of the line to open \cs{vbox} for
% \cs{@currbox} to obey the coding convention.}
%
% The macro \!\pcol@opcol! is invoked from \!\pcol@output! for the ordinary
% completed \colpage{} built by \!\pcol@makecol!, or from the loop creating
% \fcolumn{}s in \!\pcol@output! or \!\pcol@freshpage!. At first it
% saves the \colpage{} of column $c$ in \!\@outputbox!, which
% \!\pcol@makecol! or \!\@tryfcolumn! just has built for an ordinary or
% \fcolumn{} respectively, in an \!\insert! acquired from \!\@freelist! by
% \!\@next!, and then adds it to the tail of $\S_c=|\pcol@shipped|{\cdot}c$
%
% \SpecialArrayIndex{c}{\pcol@shipped}
%
% by \!\@cons!. In this saving operation, we add the sequence of uncoloring
% \!\special!s at the bottom to clear \colorstack{} by
% \!\pcol@clearcst@unvbox! giving it \!\@outputbox! to be \!\unvbox!ed and
% possibly coloring \!\special!s for the \colpage{}'s \colorctext{} saved in
% $\csts$ at the top, so that the succeeding \colpage{} in printing order
% starts with its own \colorctext. For this addition, furthermore, we let
% $\!\boxmaxdepth!=\!\@maxdepth!$ to keep the depth capping made in the box
% builder from nullified\footnote{
%
% Or to apply the capping dropped from p\LaTeX's \cs{@makecol}, or to do
% nothing for the box made by \cs{@tryfcolumn} and thus being 0 deep.}.
%
% Then if $c=0$, we fix the page number of the page $p$ having the
% \colpage{} and let $\pp^p(q)$ have $\page(p)+(q-p)$ usually but possibly
% $\page(p)+2(q-p)$ with \npaired{} \parapag{}ing, for all
% $q\in[p{+1},\ptop]$ by \!\pcol@setpageno!. After that, we invoke
% \!\pcol@nextpage! to let $p=p'$ for the next \colpage{} of $c$, where
% $p'=p+1$ usually but can be $p+k+1$ if we have consecutive $k$ \fpage{}s
% from $p+1$.
%
% Next, we check if the oldest page $\pbase$ is made ready to be shipped out
% by the participation of the completed \colpage{} by \!\pcol@checkshipped!.
% If so, we invoke \!\pcol@outputcolumns! giving argument 0 to ship out
% $\pbase$ and its successor \fpage{}s.
%
% Finally we set up the next page $p$ by \!\pcol@startpage! if $p>\ptop$
% meaning it is new one, or by \!\pcol@getcurrpage! otherwise, and
% reinitialize parameters for floats by \!\pcol@floatplacement! before
% returning to the invoker.
%
% \begin{macrocode}
\def\pcol@opcol{%
\pcol@Fb
\@next\@currbox\@freelist{\global\setbox\@currbox\vbox to\@colht{%
\boxmaxdepth\@maxdepth
\pcol@clearcst@unvbox\@outputbox}}\pcol@ovf
\pcol@Fe{opcol}%
\expandafter\@cons\csname pcol@shipped\number\pcol@currcol\endcsname\@currbox
\ifnum\pcol@currcol=\z@ \pcol@setpageno \fi
\pcol@nextpage
\pcol@checkshipped
\if@tempswa \pcol@outputcolumns\z@ \fi
\ifnum\pcol@page>\pcol@toppage \pcol@startpage
\else \pcol@getcurrpage
\fi
\pcol@floatplacement}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@setpageno}
% \changes{v1.33-2}{2016/11/19}
% {Add \cs{let}\cs{@elt}\cs{relax} before \cs{edef} of \cs{reserved@a}
% for the sake of clarity.}
% \begin{macro}{\pcol@setpnoelt}
% \changes{v1.0}{2011/10/10}
% {Rename \cs{ifpcol@textonly} as \cs{ifpcol@nospan}.}
% \changes{v1.2-2}{2013/05/11}
% {Completely recode reflecting the redesign of page context.}
% \changes{v1.3-2}{2013/09/17}
% {Add an operation to increment $\string\mathit{page}(p)$ by two for
% non-paired parallel-paging.}
% \changes{v1.3-3}{2013/09/17}
% {Revise reflecting the new page context element $\pi^s(p)$, and add a
% invoker \cs{pcol@makecol}.}
% \changes{v1.3-4}{2013/09/17}
% {Revise reflecting the new page context element $\pi^m(p)$.}
%
% The macro \!\pcol@setpageno! is invoked from \!\pcol@opcol! when it
% proceeses the \colpage{} of the first column $c=0$ to fix the page number
% $\page(p)\gets\counter{page}=\!\c@page!$ of the page $p=\!\pcol@page!$
% having the \colpage{}. It is also invoked from \!\pcol@output@switch!
% when it leaves from the first column to reflect a jump of \counter{page}
% made in the column building. In both cases, the macro lets $\pp^p(q)$
% have $\page'(q)=\page(p)+(q-p)$, except for the case of \npaired{}
% \parapag{}ing in which $\page'(q)=\page(p)+2(q-p)$ instead, for all
% $q\in[p,\ptop]$.
%
% Since we possibly have to update $\pp(q)$ such that $q\geq p$, at first we
% temporarily let
% $\Uidx\PPP=(\PP,\pp(\ptop))=\!\pcol@pages!\!\pcol@currpage!$ empty
% after copying its original value into $\mathit{\Pi}'=\!\reserved@a!$.
% Then we scan $\pi'(q)\in\mathit{\Pi}'$ for all $q\in[\pbase,\ptop]$ by
% applying \!\pcol@setpnoelt! to each $\pi'(q)$ giving its five components
% to the macro, so that the macro updates $\pp(q)$ by \!\pcol@defcurrpage!
% letting $\pp^p(q)=\page'(q)$ if $q\geq p$, or equivalently $p-q\leq0$.
% Note that we let \!\c@page! have $\page'(q)$, but this assignment is
% temporary and \!\c@page! will regain the value $\page(p)$ after
% \!\pcol@setpageno! finishes.
%
% \begin{macrocode}
\def\pcol@setpageno{\begingroup
\@tempcnta\pcol@page \advance\@tempcnta-\pcol@basepage
\let\@elt\relax \edef\reserved@a{\pcol@pages\pcol@currpage}%
\global\let\pcol@pages\@empty \global\let\pcol@currpage\@empty
\let\@elt\pcol@setpnoelt \reserved@a
\endgroup}
\def\pcol@setpnoelt#1#2#3#4#5{%
{\let\@elt\relax \xdef\pcol@pages{\pcol@pages\pcol@currpage}}%
\ifnum\@tempcnta>\z@ \gdef\pcol@currpage{\@elt{#1}#2#3{#4}{#5}}%
\else \pcol@defcurrpage{\number\c@page}{#2}{#3}{#4}{#5}%
\advance\c@page\@ne
\ifpcol@paired\else \advance\c@page\@ne \fi
\fi
\advance\@tempcnta\m@ne}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@defcurrpage}
% \changes{v1.2-2}{2013/05/11}
% {Introduced by the redesign of page context, partly replacing
% \cs{pcol@setordpage} which once we call \cs{pcol@settextpage}.}
% \changes{v1.3-3}{2013/09/17}
% {Revise reflecting the new page context element $\pi^s(p)$, and add a
% invoker \cs{pcol@makecol}.}
% \changes{v1.3-4}{2013/09/17}
% {Revise reflecting the new page context element $\pi^m(p)$.}
%
% The macro
% $\!\pcol@defcurrpage!
% \Arg{\pp^p(p)}\arg{\pp^i(p)}\arg{\pp^f(p)}\Arg{\pp^s(p)}\Arg{\pp^m(p)}$
% is invoked from \!\pcol@makecol! to update $\pp^s(\ptop)$,
% \!\pcol@setpnoelt! to update $\pp^p(p)$, \!\pcol@startpage! to initialize
% a newly created page, \!\pcol@output@start! to initialize a \spage{},
% \!\pcol@output@switch! to update $\pp^s(\ptop)$ and/or $\pp^f(\ptop)$, and
% \!\pcol@setmpbelt! to update $\pp^m(p)$. The macro \!\xdef!ines
% \!\pcol@currpage! letting it have the \pctext{} $\pp(p)$ given by the
% arguments.
%
% \begin{macrocode}
\def\pcol@defcurrpage#1#2#3#4#5{{%
\let\@elt\relax \xdef\pcol@currpage{\@elt{#1}#2#3{#4}{#5}}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@nextpage}
% \changes{v1.2-7}{2013/05/11}
% {Remove unnecessary scan of $\pi(p_t)$.}
% \begin{macro}{\pcol@nextpelt}
% \changes{v1.2-2}{2013/05/11}
% {Revise reflecting the redesign of page context.}
% \changes{v1.3-3}{2013/09/17}
% {Revise reflecting the new page context element $\pi^s(p)$, and add a
% invoker \cs{pcol@makecol}.}
% \changes{v1.3-4}{2013/09/17}
% {Revise reflecting the new page context element $\pi^m(p)$.}
% \changes{v1.3-6}{2013/09/17}
% {Fix the bug that $\pi^h(q)$ is not referred correctly.}
%
% The macro \!\pcol@nextpage! is invoked solely in \!\pcol@opcol! to let
% $p$ be $p+k+1$ where $k$ is the number of \fpage{}s directly following
% $p$, i.e., $k=\Abs{\Set{q>p}{p<\forall q'\leq q:\pp(q')^h<0}}$. For
% this update, the macro scans $\pp(q)\in\PP$ for all $q\In\pbase\ptop$
% applying \!\pcol@nextpelt! to $\pp(q)$, to perform the following where
% $p_0$ is $p$ before update and $f=\CSIndex{if@tempswa}$ being $\true$ at
% initial, to let $p\gets p+k$, and then increments $p$ to have $p+k+1$.
% $$
% \<p,f\>\gets\cases{
% \<p,f\>& $q\leq p_0$\cr
% \<p{+}1,f\>& $q>p_0\;\land\;f\;\land\;\pp^i(q)\neq\bot\;\land\;
% \pp^h(q)<0$\cr
% \<p,\false\>& otherwise}
% $$
%
% \begin{macrocode}
\def\pcol@nextpage{\begingroup
\@tempcnta\pcol@page \advance\@tempcnta-\pcol@basepage
\@tempswatrue
\let\@elt\pcol@nextpelt \pcol@pages
\global\advance\pcol@page\@ne
\endgroup}
\def\pcol@nextpelt#1#2#3#4#5{%
\ifnum\@tempcnta<\z@
\ifvoid#2\@tempswafalse
\else\ifdim\dimen#2<\z@
\if@tempswa \global\advance\pcol@page\@ne \fi
\else \@tempswafalse
\fi\fi
\fi
\advance\@tempcnta\m@ne}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@checkshipped}
% The macro \!\pcol@checkshipped! is invoked solely in \!\pcol@opcol! to let
% \CSIndex{if@tempswa} be $\true$ iff
% $S_c=|\pcol@shipped|{\cdot}c\neq\emptyset$
%
% \SpecialArrayIndex{c}{\pcol@shipped}
%
% for all $c\In0\C$ to mean the oldest page $\pbase$ is ready to be shipped
% out.
%
% \begin{macrocode}
\def\pcol@checkshipped{\@tempswatrue
\@tempcnta\z@ \@whilenum\@tempcnta<\pcol@ncol\do{%
\expandafter\ifx\csname pcol@shipped\number\@tempcnta\endcsname\@empty
\@tempswafalse \fi
\advance\@tempcnta\@ne}}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{2}
% \begin{macro}{\pcol@getcurrpage}
% \changes{v1.3-4}{2013/09/17}
% {Add a user \cs{pcol@addmarginpar}.}
% \begin{macro}{\pcol@getpelt}
% \changes{v1.2-2}{2013/05/11}
% {Revise reflecting the redesign of page context.}
% \begin{macro}{\pcol@getpinfo}
% \changes{v1.0}{2011/10/10}
% {Rename \cs{ifpcol@textonly} as \cs{ifpcol@nospan}.}
% \changes{v1.2-2}{2013/05/11}
% {Revise reflecting the redesign of page context.}
% \begin{macro}{\pcol@getcurrpinfo}
% \changes{v1.2-2}{2013/05/11}
% {Revise reflecting the redesign of page context.}
% \changes{v1.3-3}{2013/09/17}
% {Revise reflecting the new page context element $\pi^s(p)$, and add a
% invoker \cs{pcol@makecol}.}
% \changes{v1.3-4}{2013/09/17}
% {Revise reflecting the new page context element $\pi^m(p)$.}
%
% The macro \!\pcol@getcurrpage! is invoked in \!\pcol@opcol!,
% \!\pcol@restartcolumn!, \!\pcol@addmarginpar!, \!\pcol@flushcolumn! and
% \!\pcol@freshpage! to let;
%
% \begin{eqnarray*}
% &&\!\c@page!=\pp^p(p)\quad
% \!\@colht!=\pp^h(p)\quad
% \!\topskip!=\pp^t(p)\quad
% \CSIndex{ifpcol@nospan}=(\pp^i(p)=\bot)\\
% &&\Midx{\!\pcol@spanning!}=\pp^i(p)\quad
% \Midx{\!\pcol@footins!}=\pp^f(p)\quad
% \Midx{\!\pcol@sptextlist!}=\pp^s(p)\\
% &&\Midx{\!\pcol@mparbottom!}=\pp^m(p)
% \end{eqnarray*}
%
% for $p=\!\pcol@page!\in[p_b,p_t]$. To do that, the macro scans all
% $\pp(q)\in\PPP=(\PP,\pp(\ptop))$ applying \!\pcol@getpelt! to
% $\pp(q)=
% \Arg{\pp^p(q)}\arg{\pp^i(q)}\arg{\pp^f(q)}\Arg{\pp^s(q)}\Arg{\pp^m(q)}$
% to invoke
% $$
% \!\pcol@getpinfo!
% \Arg{\pp^p(q)}\arg{\pp^i(q)}\arg{\pp^f(q)}\Arg{\pp^s(q)}\Arg{\pp^m(q)}
% \arg{pg}\arg{ch}\arg{ts}
% $$
% with the following arguments for \!\global! assignments, if $q=p$.
% $$
% \arg{pg}=\!\global!\!\c@page!\quad
% \arg{ch}=\!\global!\!\@colht!\quad\arg{ts}=\!\global!\!\topskip!
% $$
% Then the macro \!\pcol@getpinfo! do the obvious assighments to
% \!\pcol@spanning!, \!\pcol@footins!, \!\pcol@sptextlist!,
% \!\pcol@mparbottom! and $\arg{pg}$, and the following
% condintional assignments.
%
% \begin{eqnarray*}
% &&\<\arg{ch},\arg{ts},\CSIndex{ifpcol@nospan}\>=
% \left\{\begin{array}{llll}
% \<\!\textheight!,&\!\pcol@topskip!,&\true\>&\quad\pp^i(q)=\bot\\
% \<\pp^h(q),&\pp^t(q),&\false\>&\quad\pp^i(q)\neq\bot\end{array}\right.
% \end{eqnarray*}
%
% \begin{Sloppy}{2800}\noindent
% The other macro $\!\pcol@getcurrpinfo!\arg{pg}\arg{ch}\arg{ts}$ is invoked
% in \!\pcol@makecol!, \!\pcol@startpage!, \!\pcol@output@switch!,
% \!\pcol@sync!, \!\pcol@flushcolumn! and \!\pcol@make~flushedpage! do the
% similar assignments using \!\pcol@getpinfo!, but it is not for $\pp(p)$
% but for $\pp(\ptop)={}$\!\pcol@currpage!. The macro \!\pcol@getpinfo!
% also has a direct invoker \!\pcol@outputelt!.
% \end{Sloppy}
%
% \begin{macrocode}
\def\pcol@getcurrpage{\begingroup
\@tempcnta\pcol@page \advance\@tempcnta-\pcol@basepage
\let\@elt\pcol@getpelt \pcol@pages\pcol@currpage
\endgroup}
\def\pcol@getpelt#1#2#3#4#5{%
\ifnum\@tempcnta=\z@
\pcol@getpinfo{#1}#2#3{#4}{#5}%
{\global\c@page}{\global\@colht}{\global\topskip}%
\fi
\advance\@tempcnta\m@ne}
\def\pcol@getpinfo#1#2#3#4#5#6#7#8{\pcol@nospantrue
\gdef\pcol@spanning{#2}\gdef\pcol@footins{#3}\gdef\pcol@sptextlist{#4}%
\gdef\pcol@mparbottom{#5}%
#6#1\relax
\ifvoid#2\relax #7\textheight #8\pcol@topskip
\else #7\dimen#2\relax #8\skip#2\relax \pcol@nospanfalse
\fi}
\def\pcol@getcurrpinfo{%
\edef\reserved@a{\expandafter\@cdr\pcol@currpage\@nil}%
\expandafter\pcol@getpinfo\reserved@a}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@floatplacement}
% \changes{v1.0}{2011/10/10}
% {Add initialization of \cs{pcol@textfloatsep}.}
% \changes{v1.3-4}{2013/09/17}
% {Remove clearing operation on \cs{@mparbottom} because it is no
% longer in column-context.}
%
% The macro \!\pcol@floatplacement! is invoked from \!\pcol@opcol!,
% \!\pcol@output@start!, \!\pcol@flushcolumn!, \!\pcol@freshpage! and
% \!\pcol@output@end! to reinitialize the parameters of \cwise{} float
% placement at the beginning of a \colpage{} or that of \postenv. The macro
% lets \!\@textfloatsheight! be 0 and then invokes \!\@floatplacement!, as
% \!\@opcol! does its tail\footnote{
%
% But $\!\@mparbottom!=0$ is not done because it is meaningless now.}.
%
% In addition, the macro lets \!\pcol@textfloatsep! be \!\maxdimen! to mean
% the new \colpage{} does not have \sync{}ation point at initial.
%
% \begin{macrocode}
\def\pcol@floatplacement{%
\global\@textfloatsheight\z@ \global\pcol@textfloatsep\maxdimen
\@floatplacement}
% \end{macrocode}
% \end{macro}
%
%
%
% \section{Starting New Page}
% \label{sec:imp-startpage}
%
% \begin{macro}{\pcol@startpage}
% \changes{v1.0}{2011/10/10}
% {Add assignment of \cs{pcol@firstprevdepth} to be \cs{relax}.}
% \changes{v1.0}{2011/10/10}
% {Rename \cs{pcol@maxpage} as \cs{pcol@toppage}.}
% \changes{v1.0}{2011/10/10}
% {Rename \cs{pcol@settextpage} as \cs{pcol@setordpage}.}
% \changes{v1.2-2}{2013/05/11}
% {Revise reflecting the redesign of page context.}
% \changes{v1.3-2}{2013/09/17}
% {Duplicate \cs{stepcounter} of \cs{c@page} if non-paired
% parallel-paging is in effect.}
% \changes{v1.3-3}{2013/09/17}
% {Revise reflecting the new page context element $\pi^s(p)$.}
% \changes{v1.3-4}{2013/09/17}
% {Revise reflecting the new page context element $\pi^m(p)$.}
% \changes{v1.32-3}{2015/10/10}
% {Add $\hbox{\cs{f@depth}}\EQ0$ to override
% $\hbox{\cs{f@depth}}\EQ\hbox{\texttt{1sp}}$ done by
% \cs{@dblfloatplacement}.}
% \changes{v1.32-3}{2015/10/10}
% {Modify the code to apply \cs{@sdblcolelt} to \cs{@dbldeferlist} so
% as to work with both 2015 (or newer) and 2014 (or older) versions
% of \LaTeX.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% The macro \!\pcol@startpage! is invoked from \!\pcol@opcol! with
% $\!\pcol@currpage!=\pp(p{-}1)$ to start a new page $p=\!\pcol@page!$, or
% from \!\pcol@output@start! with a too large \preenv{} or
% \!\pcol@freshpage! with $\!\pcol@currpage!=|{}|$ and $\!\c@page!=\page(p)$
% to start a new page $p=0$.
%
% First, we let $\!\pcol@firstprevdepth!=\!\relax!$ to mean we have (had)
% left from the \spage{} so that \!\pcol@output@end! will be informed of
% that. Next we let $\ptop=p$ and then, if invoked from \!\pcol@opcol!,
% obtain $\pp^p(p{-}1)$ by \!\pcol@getcurrpinfo! to have $\page(p{-}1)$ in
% \!\c@page!, and let $\PP\gets\PPP=(\PP,\pp(p{-}1))$ with
% $\pp^f(p{-}1)=\!\pcol@currfoot!$ into which \!\pcol@makecol! saved
% \Scfnote{}s if any. Next we lets $\!\c@page!=\page(p{-}1)+1$ unless
% \npaired{} \parapag{}ing is in effect or in other words if
% $\CSIndex{ifpcol@paired}=\true$, or $\!\c@page!=\page(p{-}1)+2$ otherwise,
% by \!\stepcounter!. Then we let $\!\@colht!=\!\textheight!$ as the base
% value without \spanning, and $\!\topskip!=\!\pcol@topskip!$ because the
% new page is the second or succeeding one built in \env{paracol}
% environment.
%
% \begin{macrocode}
%% Starting New Page
\def\pcol@startpage{%
\global\let\pcol@firstprevdepth\relax
\global\pcol@toppage\pcol@page
\ifx\pcol@currpage\@empty\else
\pcol@getcurrpinfo{\global\c@page}\@tempdima\@tempskipa
\@cons\pcol@pages
{{\number\c@page}\pcol@spanning\pcol@currfoot
{\pcol@sptextlist}{\pcol@mparbottom}}%
\stepcounter{page}\ifpcol@paired\else \stepcounter{page}\fi
\fi
\global\@colht\textheight
\global\topskip\pcol@topskip
% \end{macrocode}
%
% Then, we build \fpage{}s if any as follows. First we invoke
% \!\@dblfloatplacement! to reinitialize the parameters for \pwise{} float
% placement. In addition, we let $\!\f@depth!=0$ to nullify the
% setting $\!\f@depth!=|1sp|$ possiblly done by \!\@dblfloatplacement! as
% discussed in the item-(\ref{item:ovv-float-@dblfloatplacement}) of
% \secref{sec:imp-ovv-float}. Then we repeat \!\@tryfcolumn! giving it
% \!\@dbldeferlist! having \pwise{} floats not contributed to previous
% pages yet, while $\CSIndex{if@fcolmade}=\true$ meaning it builds \fpage{}s
% in \!\@outputbox!. For each \fpage{}, we acquire an \!\insert! from
% \!\@freelist! by \!\@next! for $\pp^i(\ptop)$ to let it have the
% followings to represent the \fpage{}.
%
% \begin{eqnarray*}
% \pp^p(\ptop)&=&\!\c@page!\quad
% \pp^b(\ptop)=\!\@outputbox!\quad
% \pp^h(\ptop)=-\!\maxdimen!\quad
% \pp^t(\ptop)=\!\pcol@topskip!\\
% \pp^f(\ptop)&=&\bot\quad
% \pp^s(\ptop)=\emptyset\quad
% \pp^m(\ptop)=\emptyset
% \end{eqnarray*}
%
% We also increment $p$ and $\ptop$, and also \!\c@page! by one or two
% according to \CSIndex{ifpcol@paired} by \!\stepcounter!, to let them have
% the values for the page following the \fpage{}s.
%
% \begin{macrocode}
\@dblfloatplacement \let\f@depth\z@
\@tryfcolumn\@dbldeferlist
\@whilesw\if@fcolmade\fi{%
\pcol@Fb
\@next\@currbox\@freelist{%
\global\setbox\@currbox\box\@outputbox}\pcol@ovf
\pcol@Fe{startpage(fcol)}%
\global\dimen\@currbox-\maxdimen
\global\skip\@currbox\pcol@topskip
\@cons\pcol@pages{{\number\c@page}\@currbox\voidb@x{}{}}%
\stepcounter{page}\ifpcol@paired\else \stepcounter{page}\fi
\global\advance\pcol@page\@ne \global\pcol@toppage\pcol@page
\@tryfcolumn\@dbldeferlist}%
% \end{macrocode}
%
% Next, we copy \!\@dbldeferlist! containing \pwise{} floats which
% could not be included in \fpage{}s to \!\reserved@b!, clear the list, and
% then scan the copied list by applying \!\@sdblcolelt! to each list
% element to invoke \!\@addtodblcol! for adding the element to \!\@dbltoplist!
% or keeping it in \!\@dbldeferlist! or \!\@deferlist! depending on \LaTeX's
% version, as \LaTeX's \!\@startdblcolumn! does. In addition, as discussed
% in item-(\ref{item:ovv-float-@addtodblcol}) of
% \secref{sec:imp-ovv-float}, we also clear \!\@deferlist! after saving it in
% \!\reserved@c! prior to the scan, and then after the scan we concatenate
% \!\@dbldeferlist! and \!\@deferlist! to let the former have the result and
% restore \!\@deferlist! from \!\reserved@c!.
%
% Then If this scan results in empty \!\@dbltoplist! to mean the new page
% does not have any \spanning, we invoke \!\pcol@defcurrpage! with
% $\pp^i(\ptop)=\pp^f(\ptop)=\bot$ and $\pp^s(\ptop)=\pp^m(\ptop)=\emptyset$
% so that $\pp(\ptop)$ reprsents a page perfectly empty.
%
% \begin{macrocode}
\begingroup
\let\reserved@b\@dbldeferlist \let\reserved@c\@deferlist
\global\let\@dbldeferlist\@empty \global\let\@deferlist\@empty
\let\@elt\@sdblcolelt
\reserved@b
\let\@elt\relax \xdef\@dbldeferlist{\@dbldeferlist\@deferlist}%
\global\let\@deferlist\reserved@c
\endgroup
\ifx\@dbltoplist\@empty
\pcol@defcurrpage{\number\c@page}\voidb@x\voidb@x{}{}%
% \end{macrocode}
%
% Otherwise, i.e., \!\@dbltoplist! is not empty, we scan all elements in it
% by letting $\!\@elt!=\!\@comdblflelt!$ to have all \pwise{} floats in
% \!\@tempboxa!. Then, after returning all elements to \!\@freelist!, we
% acquire an \!\insert! from \!\@freelist! to be $\pp^i(\ptop)$ by \!\@next!
% and store the contents of \!\@tempboxa! in $\pp^b(\ptop)$ after removing
% the last vertical skip \!\dblfloatsep! and then adding \!\dblfigrule! and
% the vertical skip \!\dbltextfloatsep!. The other elements of $\pp(\ptop)$
% are set as follows to represent the page with \spanning{} which makes the
% height of each column \!\@colht! shrunk from its initial value
% \!\textheight! by the series of \!\@addtodblcol!.
%
% \begin{eqnarray*}
% \pp^p(\ptop)&=&\!\c@page!=\page(\ptop)\quad
% \pp^h(\ptop)=\!\@colht!\quad
% \pp^t(\ptop)=\!\pcol@topskip!\quad
% \pp^f(\ptop)=\bot\\
% \pp^s(\ptop)&=&\emptyset\quad
% \pp^m(\ptop)=\emptyset\quad
% \end{eqnarray*}
%
% Finally, regardless of the existence of the \pwise{} floats, we let
% $\!\pcol@footins!=\bot$ to mean the \tpage{} does not have any \Scfnote{}s,
% so far if footnote typesetting is \scfnote, or never otherwise.
%
% \begin{macrocode}
\else
\setbox\@tempboxa\vbox{}%
\begingroup
\let\@elt\@comdblflelt
\@dbltoplist
\let\@elt\relax
\pcol@Fb
\xdef\@freelist{\@freelist\@dbltoplist}%
\pcol@Fe{startpage(dbltop)}%
\global\let\@dbltoplist\@empty
\pcol@Fb
\@next\@currbox\@freelist{\global\setbox\@currbox\vbox{%
\unvbox\@tempboxa \vskip-\dblfloatsep \dblfigrule
\vskip\dbltextfloatsep}}\pcol@ovf
\pcol@Fe{startpage(spanning)}%
\global\dimen\@currbox\@colht
\global\skip\@currbox\pcol@topskip
\pcol@defcurrpage{\number\c@page}\@currbox\voidb@x{}{}%
\endgroup
\fi
\gdef\pcol@footins{\voidb@x}}
% \end{macrocode}
% \end{macro}
%
%
%
% \section{Shipping Page Out}
% \label{sec:imp-outputpage}
%
% \begin{macro}{\pcol@outputcolumns}
% \changes{v1.0}{2011/10/10}
% {Rename \cs{ifpcol@stopoutput} as \cs{ifpcol@outputflt}.}
% \changes{v1.3-2}{2013/09/17}
% {Rename \cs{pcol@outputpage} as \cs{pcol@outputcolumns}.}
%
% The macro \!\pcol@outputcolumns!$\arg{all}$ is invoked from \!\pcol@opcol!
% with $\arg{all}=0$ to ship out the page $\pbase$ and \fpage{}s following
% it if any, or \!\pcol@sync! with $\arg{all}=1$ to ship out all pages in
% $\PP$. It copies $\PP=\!\pcol@pages!$ into $\mathit{\Pi}'=\!\reserved@b!$
% and clear $\PP$ once to remove pages shipped out from it. Then, after
% initializing $f_o=\CSIndex{if@tempswa}=\true$ to ship out (the first)
% ordinary page and $f_f=\CSIndex{ifpcol@outputflt}=\true$ to ship out
% \fpage{}s (following the first page), it scans all
% $\pp(q)\in\mathit{\Pi}'$ applying $\!\pcol@outputelt!\arg{all}$ to
% $\pp(q)$ to ship it out or keep it in $\PP$.
%
% \begin{macrocode}
%% Shipping Page Out
\def\pcol@outputcolumns#1{\begingroup
\def\@elt{\pcol@outputelt#1}\@tempswatrue \pcol@outputflttrue
\let\reserved@b\pcol@pages \gdef\pcol@pages{}%
\reserved@b
\endgroup}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@outputelt}
% \changes{v1.2-2}{2013/05/11}
% {Revise reflecting the redesign of page context.}
% \changes{v1.3-3}{2013/09/17}
% {Revise reflecting the new page context element $\pi^s(p)$.}
% \changes{v1.3-4}{2013/09/17}
% {Revise reflecting the new page context element $\pi^m(p)$.}
%
% The macro $\!\pcol@outputelt!
% \arg{all}\Arg{\pp^p(q)}\arg{\pp^i(q)}\arg{\pp^f(q)}
% \Arg{\pp^s(q)}\Arg{\pp^m(q)}$ ships out the ordinary or \fpage{} $q$ if
% $f_o=\true$ or $f_f=\true$ respectively. After initializing
% \!\@outputbox! to be $\bot$, we retrive the page $q$'s information by
% \!\pcol@getpinfo! to have $\page(q)$ in \!\c@page! locally, \!\textheight!
% or $\pp^h(q)$ in $h=\!\@tempdima!$,
% $f_{\it{}ns}=\CSIndex{ifpcol@nospan}=(\pp^i(q)=\bot)$, and
% $\!\pcol@footins!={\pp^f(q)}$.
%
% \begin{macrocode}
\def\pcol@outputelt#1#2#3#4#5#6{%
\setbox\@outputbox\box\voidb@x
\pcol@getpinfo{#2}#3#4{#5}{#6}\c@page\@tempdima\@tempskipa
% \end{macrocode}
%
% Then, we do one of the followings according to $h$ and $f_o$.
%
% \begin{itemize}
% \item $h<0$\\
% It means $q$ is a \fpage{}. If $f_f=\true$, we let \!\@outputbox! have
% $\pp^b(q)$ to be shipped out, paint its \bground{} with $\bgc_{\{F,f\}}$
% by \!\pcol@bg@paintbox! letting the basic height \!\pcol@bg@floatheight!
% of the paining region
% $\bgr_{\{F,f\}}$ be
% $\HT=\!\pcol@bg@textheight!=\!\textheight!+\!\maxdepth!$, and return
% $\!\insert!{\cdot}\pp^i(q)$ to \!\@freelist! by \!\@cons! because it is no
% longer necessary. Then if $\CL<\C$ to mean \parapag{}ing is in effect, we
% let \!\pcol@rightpage! be an empty box but paint its \bground{} too, because
% the right counterpart of left parallel float page should be always blank.
% Note that we temporarily increment $\page(q)$ by one for \npaired{} right
% \parapag{}ee so that the paiting macro performs page-parity dependent
% operations correctly.
%
% \Index{parallel-paging}
% \Index{float page}
%
% On the other hand if $f_f=\false$, we simply return $\pp(q)$ back to $\PP$.
% \end{itemize}
%
% \changes{v1.0}{2011/10/10}
% {Rename \cs{ifpcol@stopoutput} as \cs{ifpcol@outputflt}.}
% \changes{v1.3-3}{2013/09/17}
% {Add painting of page-wise float page.}
% \changes{v1.3-2}{2013/09/17}
% {Add building a empty right parallel float page.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\ifdim\@tempdima<\z@
\ifpcol@outputflt
\def\pcol@bg@floatheight{\pcol@bg@textheight}%
\setbox\@outputbox\vbox to\textheight{%
\pcol@bg@paintbox{Ff}\unvbox\pcol@spanning}%
\pcol@Fb
\@cons\@freelist\pcol@spanning
\pcol@Fe{outputelt(spanning)}%
\ifnum\pcol@ncolleft<\pcol@ncol
\setbox\pcol@rightpage\vbox to\textheight{%
\ifpcol@paired\else \advance\c@page\@ne \fi
\pcol@bg@paintbox{Ff}\vfil}%
\fi
\else
\@cons\pcol@pages{{#2}#3#4{#5}{#6}}%
\fi
% \end{macrocode}
%
% \begin{itemize}
% \item $h\geq0\;\land\;f_o=\true$\\
% It means $q$ is a non-\fpage{} to be shipped out. If $\arg{all}=0$, we
% let $f_o=\false$ to keep succeeding non-\fpage{}s from being shipped out.
% Then we build the ship-out image of the right \parapag{}e $q$ in
% \!\pcol@rightpage! by \!\pcol@ioutputelt! giving it the box and the column
% range $\LBRP\CL\C$ if $\CL<\C$ to mean \parapag{}ing, and then that of the
% left \parapag{}e in \!\@outputbox! by \!\pcol@ioutputelt! again but giving
% it $\LBRP0\CL$ and \!\@outputbox!. Note that the right-first left-second
% order is essential, because in the process to build right \parapag{}e we
% have to examine the existence of $\pp^i(q)$ and $\pp^f(q)$ and then refer
% to their height and depth to make the region corresponding to them blank,
% while the boxes of these \!\insert!s are made void in the building process
% of the left \parapag{}e obviously.
%
% Then after the ship-out image building, we \!\global!ly let
% $\CSIndex{ifpcol@firstpage}=\false$ to tell \!\pcol@ioutputelt! and
% \!\pcol@makeflushedpage! that the pages they build are no longer first of
% a \env{paracol} environment and thus $\pp^i(q)$ should have \pwise{}
% floats rather than \preenv{} hereafter.
% \end{itemize}
%
% \changes{v1.0}{2011/10/10}
% {Rename \cs{ifpcol@textonly} as \cs{ifpcol@nospan}.}
% \changes{v1.1}{2012/05/11}
% {Use $\cs{pcol@columnwidth}{\cdot}c$ instead of \cs{columnwidth} as
% the width of $c$'s \cs{hbox}.}
% \changes{v1.2-4}{2013/05/11}
% {Add column-swapping for even pages if specified.}
% \changes{v1.2-2}{2013/05/11}
% {Add ship-out of page-wise footnote.}
% \changes{v1.2-7}{2013/05/11}
% {Add $\cs{boxmaxdepth}\EQ\cs{@maxdepth}$ for depth capping.}
% \changes{v1.3-2}{2013/09/17}
% {Move the core of ship-out image building to \cs{pcol@ioutputelt} for
% parallel pageing.}
%
% \begin{macrocode}
\else\if@tempswa
\ifnum#1=\z@ \@tempswafalse \fi
\ifnum\pcol@ncolleft<\pcol@ncol
\pcol@Logstart{\pcol@outputelt{right}}%
\pcol@ioutputelt\pcol@ncolleft\pcol@ncol\pcol@rightpage
\pcol@Logend{\pcol@outputelt{right}}%
\fi
\pcol@Logstart{\pcol@outputelt{left}}%
\pcol@ioutputelt\z@\pcol@ncolleft\@outputbox
\pcol@Logend{\pcol@outputelt{left}}%
\global\pcol@firstpagefalse
% \end{macrocode}
%
% \begin{itemize}
% \item $h\geq0\;\land\;f_o=\false$\\
% It means $q$ is a non-\fpage{} to be kept. Therefore, we let
% $f_f=\false$ to keep \fpage{}s following it from being shipped out. Then
% we return $\pp(q)$ to $\PP$ by \!\@cons!.
% \end{itemize}
%
% \begin{macrocode}
\else
\pcol@outputfltfalse
\@cons\pcol@pages{{#2}#3#4{#5}{#6}}%
\fi\fi
% \end{macrocode}
%
% Finally, if $\!\@outputbox!\neq\bot$ to mean $\pp(q)$ is to be
% shipped out, we invoke \!\@outputpage! to do it and increment $\pbase$ to
% let it has $q+1$. Note that since we have let $\!\c@page!=\page(q)$, the
% direct and indirect references to it in \!\@outputpage! are correctly done.
% Also note that the \!\global! increment of it by \!\stepcounter! in
% \!\@outputpage! will be overriden by the \!\global! assignment to it done
% by \!\pcol@startpage! or \!\pcol@getcurrpage! invoked from \!\pcol@opcol!
% if $\arg{all}=0$, or by \!\pcol@getcurrpinfo! invoked from \!\pcol@sync!
% otherwise.
%
% \begin{macrocode}
\ifvoid\@outputbox\else
\global\advance\pcol@basepage\@ne \@outputpage
\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@ioutputelt}
% \changes{v1.3-2}{2013/09/17}
% {Introduced for parallel-paging.}
% \changes{v1.3-3}{2013/09/17}
% {Add column-separating rule drawing and background painting.}
% \changes{v1.3-4}{2013/09/17}
% {Add a logic to cope with non-uniform column-separating gaps.}
%
% The macro $\!\pcol@ioutputelt!\<\Cfrom\>\<\Cto\>\arg{b}$ is invoked solely
% in \!\pcol@outputelt! but can be done twice with
% $(\Cfrom,\Cto,b)=(\CL,\C,\!\pcol@rightpage!)$ if \parapag{}ing is in
% effect and with $(\Cfrom,\Cto,b)=(0,\CL,\!\@outputbox!)$ always, to build
% the ship-out image of the right or left \parapag{}e $q$ in the box $b$
% respectively.
%
% After opening a \!\vbox! of \!\textheight! tall for $b$, at first we
% increment $\page(q)$ by one for right \parapag{}e if it is \npaired, so
% that painting macros perform page-parity dependent operations correctly.
%
% Next, we put materials to be shipped out in the box $b$ as follows.
% First, if $\pp^f(q)\neq\bot$ to mean the page $q$ has \Scfnote{}, we paint
% their \bground{} with $\bgc_{\{N,n\}}$ by \!\pcol@bg@paintbox! letting the
% basic height \!\pcol@bg@footnoteheight! of the paining region
% $\bgr_{\{N,n\}}$ be the height-plus-depth of $\pp^f(q)$.
% We do the painting at this earliest stage of the image building in order
% to use the left-top corner of the text area where we are now at as the
% origin for painting, and to let the region may be overlaid by those of
% columns and \csepgap{}s. We also let $h=\pp^h(q)=\!\@tempdima!$ shrunk by
% the height-plus-depth by \!\pcol@shrinkcolbyfn!.
%
% \begin{macrocode}
\def\pcol@ioutputelt#1#2#3{\setbox#3\vbox to\textheight{%
\ifpcol@paired\else\ifnum#1=\z@\else \advance\c@page\@ne \fi\fi
\ifvoid\pcol@footins\else
\def\pcol@bg@footnoteheight{\@elt{\ht\pcol@footins}\@elt{\dp\pcol@footins}}%
\pcol@bg@paintbox{Nn}%
\pcol@shrinkcolbyfn\@tempdima\pcol@footins\relax
\fi
% \end{macrocode}
%
% Second, if $f_{\it ns}=\false$ to mean $\pp(q)$ has \spanning{} in
% $\pp^b(q)$, we do one of the followings.
%
% \begin{itemize}
% \item
% If $\Cfrom=0$ to mean the target is the left \parapag{}e, $\pp^b(q)$ is
% put by \!\unvbox!, painting its \bground{} with $\bgc_{\{F,f\}}$ by
% \!\pcol@bg@paintbox! letting the basic height \!\pcol@bg@floatheight! of
% the paining region $\bgr_{\{F,f\}}$ be the height-plus-depth of $\pp^b(q)$
% if $q$ is not the first page and thus $\pp^b(q)$ has \pwise{} floats. We
% also return the \!\insert! $\pp^i(q)$ to \!\@freelist! by \!\@cons!.
%
% \item
% If $\Cfrom\neq0$ to mean right \parapag{}e and $q$ is the first page,
% \!\pcol@rightpage! has \preenv{} in the right \parapag{}e. Therefore, we
% simply put the box but making its height and depth equal to those of
% $\pp^b(q)$, without painting because the box has already been painted, and
% with \!\nointerlineskip! to prevent baseline-skip insertion below the box.
%
% \item
% Otherwise, i.e., $\Cfrom\neq0$ and $q$ is not the first page, we put an
% empty box whose height and depth equal to those of $\pp^b(q)$ by
% \!\pcol@phantom!, with painting as done for floats in the left \parapag{}e
% and with \!\nointerlineskip!.
% \end{itemize}
%
% Note that after putting \spanning{} and/or painting the \bground{}, we
% temporarily increment \!\topmargin! by the height-plus-depth of
% $\pp^b(q)$, so that painting macros for columns, \csepgap{}s and
% \mctext{}s assume the top edge of column area as that of text area when
% they extend the top edges of their regions upward to the page top.
%
% \Index{extension of background painting region}
%
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\ifpcol@nospan\else
\def\pcol@bg@floatheight{%
\@elt{\ht\pcol@spanning}\@elt{\dp\pcol@spanning}}%
\@tempdimb\ht\pcol@spanning \advance\@tempdimb\dp\pcol@spanning
\ifnum#1=\z@
\ifpcol@firstpage\else \pcol@bg@paintbox{Ff}\fi
\pcol@Fb
\@cons\@freelist\pcol@spanning \unvbox\pcol@spanning
\pcol@Fe{ioutputelt(spanning)}%
\else\ifpcol@firstpage
\ht\pcol@rightpage\ht\pcol@spanning
\dp\pcol@rightpage\dp\pcol@spanning
\box\pcol@rightpage \nointerlineskip
\else
\pcol@bg@paintbox{Ff}\pcol@phantom\pcol@spanning \nointerlineskip
\fi\fi
\advance\topmargin\@tempdimb
\fi
% \end{macrocode}
%
% Third, we invoke \!\pcol@buildcolseprule! giving it $h$ being $\pp^h(q)$
% but possibly shrunk by \Scfnote{}s, the column range $\LBRP\Cfrom\Cto$,
% and \!\@maxdepth! to mean $q$ is non-\lpage, to draw a \cseprule{}
% possibly broken by the speces for \mctext{}s in the box \!\pcol@tempboxa!
% and to paint the \bground{}s of columns, \csepgap{}s and \mctext{} in the
% box \!\@tempboxa! which we put into $b$ immediately.
%
% Fourth, we put a \!\hbox! of \!\textwidth! wide having \!\hbox!es
% of $\w_c=|\pcol@columnwidth|{\cdot}c$
%
% \SpecialArrayIndex{c}{\pcol@columnwidth}
%
% wide containing $\sigma_c$ followed by \!\hss! for all $c\In\Cfrom\Cto$,
% where $\sigma_c=\!\box!{\cdot}s_c(q)$ being the first element removed from
% $\S_c$ by \!\@next! and then returned to \!\@freelist! by \!\@cons! if it
% is not $\bot$, or \!\voidb@x! otherwise. We sepearate \!\hbox!es of
% $\sigma_c$ by making each \!\hbox! preceded by \Midx{\!\pcol@@hfil!} being
% \!\relax! for the first one and the macro \!\pcol@hfil! for others giving
% it an argument $c^g=\!\pcol@colsepid!\in\{c,c{-}1\}$ which we discuss
% shortly to put a gap of $\gap_{c^g}=|\pcol@columnsep|{\cdot}c^g$
%
% \SpecialArrayIndex{c}{\pcol@columnsep}
%
% wide optionally having a \cseprule{} and being painted.
%
% Note that the scanning order of $c\In\Cfrom\Cto$ is usually ascending of
% course, but is descending if \cswap{} is specified and $\page(q)\bmod2=0$.
% For this ordering, we invoke
% $\!\pcol@swapcolumn!\arg{c'}\arg{c}\<\Cfrom\>\<\Cto\>$ to have $c$ for
% the $(c'-\Cfrom)$-th iteration of the scanning where $c'=\!\@tempcnta!$
% and $c=\!\@tempcntb!$. Another operation done by the macro is to let
% $c^g=c-1$ if swapped or $c^g=c$ otherwise, because if swapped the
% column-$c$ is followed by the gap which follows $c-1$ if not swapped.
%
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\pcol@buildcolseprule\@tempdima#1#2\@maxdepth \unvbox\@tempboxa
\hb@xt@\textwidth{%
\let\pcol@@hfil\relax
\@tempcnta#1\relax \@whilenum\@tempcnta<#2\do{%
\pcol@swapcolumn\@tempcnta\@tempcntb#1#2\relax
\expandafter\@next\expandafter\@currbox
\csname pcol@shipped\number\@tempcntb\endcsname
\relax{\let\@currbox\voidb@x}%
\ifvoid\@currbox\else
\pcol@Fb
\@cons\@freelist\@currbox
\pcol@Fe{ioutputelt(page)}%
\fi
\expandafter\@tempdima
\csname pcol@columnwidth\number\@tempcntb \endcsname
\pcol@@hfil \hb@xt@\@tempdima{\box\@currbox\hss}%
\edef\pcol@@hfil{\noexpand\pcol@hfil{\pcol@colsepid}}%
\advance\@tempcnta\@ne}}%
% \end{macrocode}
%
% Fifth, if $\pp^f(q)\neq\bot$ to mean the page $q$ has \Scfnote{}s, we put
% them at the bottom of \!\@outputbox! by \!\pcol@putfootins!, and return
% $\pp^f(q)$ to \!\@freelist!, if $\Cfrom=0$ meaning left \parapag{}e.
% Otherwise for the right \parapag{}e, we simply put an empty box whose
% height and depth equal to those of $\pp^f(q)$ by \!\pcol@phantom!,
% preceded by a vertical skip of $\!\skip!{\cdot}\pp^f(q)$ and then
% \!\nointerlineskip! to inhibit baseline skip insertion above the box, and
% followed by null \!\vskip! as done in \!\pcol@putfootins!.
%
% Sixth and finally\footnote{
%
% Not necessary to be finally, but we placed this assignment at the end of
% the box to make it clear the depth capping is only for the box.},
%
% we let $\!\boxmaxdepth!=\!\@maxdepth!$ to cap the depth of $b$ which we
% are now closing, as done for each \colpage{} and as expected to be applied
% to \Scfnote{}s.
%
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\ifvoid\pcol@footins\else
\ifnum#1=\z@
\pcol@Log\pcol@outputelt{output}\pcol@footins
\pcol@putfootins\pcol@footins
\pcol@Fb
\@cons\@freelist\pcol@footins
\pcol@Fe{ioutputelt(footins)}%
\else
\vskip\skip\pcol@footins \nointerlineskip
\pcol@phantom\pcol@footins \vskip\z@
\fi
\fi
\boxmaxdepth\@maxdepth}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@phantom}
% \changes{v1.3-2}{2013/09/17}
% {Introduced for parallel-paging.}
%
% The macro \!\pcol@phantom!$\<b\>$ is used in \!\pcol@ioutputelt!,
% \!\pcol@makeflushedpage! and \!\pcol@output@end! to put an empty box, whose
% height and depth are equal to that of the argument box $b$ being a kind of
% \pwstuff, into \!\pcol@rightpage! for the right \parapag{}e whose left
% counterpart has $b$ in it. That is, the macro is used to make a region
% corresponding to $b$ blank. To put the empty box, we locally let
% \!\@tempboxa! have it setting its height and depth to those of $b$ and
% then put it.
%
% \begin{macrocode}
\def\pcol@phantom#1{{%
\setbox\@tempboxa\vbox{}\ht\@tempboxa\ht#1\dp\@tempboxa\dp#1\box\@tempboxa}}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{1}
% \begin{macro}{\pcol@buildcolseprule}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for column-separating rule drawing and background
% painting for columns, column-separating gaps and spanning texts.}
% \changes{v1.3-4}{2013/09/17}
% {Introduced for non-uniform column-separating gaps.}
% \changes{v1.34}{2018/05/07}
% {Rename \cs{pcol@tempbox} as \cs{pcol@tempboxa}.}
% \begin{macro}{\pcol@buildcselt@S}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background under-painting for spanning texts.}
% \begin{macro}{\pcol@buildcselt}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for column-separating rule drawing and background
% painting for columns, column-separating gaps and spanning texts.}
% \changes{v1.3-4}{2013/09/17}
% {Introduced for non-uniform column-separating gaps.}
% \changes{v1.34}{2018/05/07}
% {Rename \cs{pcol@tempbox} as \cs{pcol@tempboxa}.}
%
% The macro $\!\pcol@buildcolseprule!\<H_{n+1}\>\<\Cfrom\>\<\Cto\>\<d\>$ is
% used in \!\pcol@ioutputelt!, \!\pcol@imakeflushedpage! and
% \!\pcol@iflushfloats! to build a box containing \cseprule{} possibly
% broken by \mctext{}s and to paint \bground{}s of columns and \csepgap{}s
% for $c\In\Cfrom\Cto$ and \mctext{}s in the \lpage{} ($d=0$) or non-last
% page ($d=\!\@maxdepth!$) $p$ having \colpage{}s of $H_{n+1}$ tall where
% $n=\Abs{\pp^s(p)}$.
%
% For initializing the drawing and painting process, we let
% $\!\@tempdimb!=H_0+h_0=0$,
% $(\!\pcol@bg@from!,\!\pcol@bg@to!)=(\CBfrom,\CBto)=(\Cfrom,\Cto)$, and
% make boxes $b_r=\!\pcol@tempboxa!$ for the rule and $b_b=\!\@tempboxa!$ for
% the \bground{} empty. Then we apply
% \!\pcol@buildcselt@S!$\<H_i\>\<h_i\>$ to each element $\spt(H_i,h_i)$ of
% $\pp^s(p)$ to under-paint the \bground{} of each \mctext{} by
% \!\pcol@bg@paintbox! defining its region $\bgr_S(i)$ by letting their top
% edge positions $y_0=\!\pcol@bg@spanningtop!=H_i$, and height
% $y_1-y_0=\!\pcol@bg@spanningheight!=h_i$ if $H_i+h_i<H_{n+1}$ to mean the
% \mctext{} is non-last, or $(H_{n+1}-H_i)+d$ if last to fill the narrow
% strip of $d=\!\@maxdepth!$ tall below the text for non-\lpage{}s.
%
% Then we scan $\pp^s(p)$ again but applying
% $\!\pcol@buildcselt!\~\<H_i\>\<h_i\>$ to each element $\spt(H_i,h_i)$ to
% do the followings.
%
% \begin{enumerate}
% \item
% To $b_r$, add a vertical rule whose height is $H'_i=H_i-(H_{i-1}+h_{i-1})$
% and width is \!\columnseprule! if $H'_i>0$, and then a vertical skip of
% $h_i$, as the rule segment between $(i{-}1)$-th and $i$-th \mctext{}s.
% Note that $H_i$ and $h_i$ are represented in the form of integers and thus
% we need |sp| to use them as dimensions.
%
% \item
% To $b_b$, add painted \bground{}s for all columns $c\In\Cfrom\Cto$ and
% \csepgap{}s $c\In\Cfrom{\Cto{-}1}$ by \!\pcol@bg@paintcolumns! defining
% their regions $\bgr_{\{c,g\}}^c(i)$ by letting common top edge position
% $y_0=\!\pcol@bg@columntop!=H_{i-1}+h_{i-1}$ and common height
% $y_1-y_0=\!\pcol@bg@columnheight!=H'_i$, if $H'_i>0$. Also add painted
% \bground{} for the $i$-th \mctext{} by \!\pcol@bg@paintbox! as we did for
% under-painting but this time the region is $\bgr_s(i)$.
%
% \item
% Let $\!\@tempdimb!=H_i+h_i$ for the next element $\spt(H_{i+1},h_{i+1})$.
% \end{enumerate}
%
% Then if $H'_{n+1}>0$, we add the last rule segment of $H'_{n+1}$ tall to
% $b_r$, and add painted \bground{}s for columns and \csepgap{}s as done in
% the step\Tie2 above but letting $y_1-y_0=H'_{n+1}+d$ to let the common
% bottom edge of the their regions reach the bottom of text area for
% non-\lpage{}s.
%
% \begin{macrocode}
\def\pcol@buildcolseprule#1#2#3#4{%
\@tempdima#1\relax \dimen@#4\relax
\let\pcol@bg@from#2\relax \let\pcol@bg@to#3\relax
\setbox\pcol@tempboxa\vbox{}\setbox\@tempboxa\vbox{}%
\let\@elt\pcol@buildcselt@S \pcol@sptextlist
\@tempdimb\z@ \let\@elt\pcol@buildcselt \pcol@sptextlist
\let\@elt\relax \advance\@tempdima-\@tempdimb
\ifdim\@tempdima>\z@
\setbox\pcol@tempboxa\vbox{\unvbox\pcol@tempboxa
\hrule\@height\@tempdima\@width\columnseprule}%
\setbox\@tempboxa\vbox{\unvbox\@tempboxa
\let\@elt\relax
\edef\pcol@bg@columntop{\number\@tempdimb sp}%
\edef\pcol@bg@columnheight{%
\@elt{\number\@tempdima sp}\@elt{\number\dimen@ sp}}%
\pcol@bg@paintcolumns}%
\fi}
\def\pcol@buildcselt@S#1#2{%
\setbox\@tempboxa\vbox{\unvbox\@tempboxa
\let\@elt\relax
\def\pcol@bg@spanningtop{\@elt{#1sp}}%
\advance\@tempdima-#1sp\relax \advance\@tempdima-#2sp\relax
\advance\dimen@\@tempdima
\edef\pcol@bg@spanningheight{\@elt{#2sp}%
\ifdim\@tempdima>\z@\else \@elt{\number\dimen@ sp}\fi}%
\pcol@bg@paintbox{S}}}
\def\pcol@buildcselt#1#2{%
\@tempdimc#1sp \advance\@tempdimc-\@tempdimb
\setbox\pcol@tempboxa\vbox{\unvbox\pcol@tempboxa
\ifdim\@tempdimc>\z@ \hrule\@height\@tempdimc\@width\columnseprule \fi
\vskip#2sp}%
\setbox\@tempboxa\vbox{\unvbox\@tempboxa
\let\@elt\relax
\edef\pcol@bg@columntop{\number\@tempdimb sp}%
\edef\pcol@bg@columnheight{\@elt{\number\@tempdimc sp}}%
\ifdim\@tempdimc>\z@ \pcol@bg@paintcolumns \fi
\def\pcol@bg@spanningtop{\@elt{#1sp}}%
\advance\@tempdima-#1sp\relax \advance\@tempdima-#2sp\relax
\advance\dimen@\@tempdima
\edef\pcol@bg@spanningheight{\@elt{#2sp}%
\ifdim\@tempdima>\z@\else \@elt{\number\dimen@ sp}\fi}%
\pcol@bg@paintbox{s}}%
\@tempdimb#1sp \advance\@tempdimb#2sp\relax}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@hfil}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for column-separating rule drawing.}
% \changes{v1.3-4}{2013/09/17}
% {Introduced for non-uniform column-separating gaps.}
% \changes{v1.34}{2018/05/07}
% {Rename \cs{pcol@tempbox} as \cs{pcol@tempboxa}.}
%
% The macro $\!\pcol@hfil!\<c\>$ is used in \!\pcol@ioutputelt!,
% \!\pcol@imakeflushedpage! and \!\pcol@iflushfloats! to separate column
% $c{+}1$ and $c$ or $c$ and $c{+}1$ according as the columns are
% swapped or not in the page the caller macros are building.
%
% \Index{column-swapping}
%
% If $\!\columnseprule!=r>0$, the macro puts the followings; a horizontal
% space of $\gap_{c}/2=|\pcol@columnsep|{\cdot}c/2$
%
% \SpecialArrayIndex{c}{\pcol@columnsep}
%
% followed by a skip $-r/2$ to nullify the width of the rule; the rule in
% \!\pcol@tempboxa! which \!\pcol@buildcolseprule! built, with color
% $|\pcol@colseprulecolor|{\cdot}c$
%
% \SpecialArrayIndex{c}{\pcol@columnsep}
%
% or \!\pcol@colseprulecolor! according as the former is defined or not,
% i.e., \!\colseprulecolor!\oarg{mode}\ARg{color}$|[|c|]|$ is declared or
% not; and $\gap_c/2$ again but preceded by $-r/2$. On the other hand if
% $r=0$, we simply put a space of $\gap_c$. Note that the skips of
% $\gap_c/2$ and $\gap_c$ are accompanied by 1\,|fil| inifinit stretch to
% avoid underfull when $\sum_{c=\Cfrom}^{\Cto-2}(\w_c+\gap_c)+\w_{\Cto-1}<\WT$
% where $(\Cfrom,\Cto)=\{(0,\CL),(\CL,C)\}$, due to arithmetic errors in
% calculations of $\w_c$ and $\gap_c$\footnote{
%
% It is assured the sum of $w_c$ and $\gap_c$ cannot exceed $\WT$ even with
% arithmetic errors and thus overfull never occurs.}.
%
% \begin{macrocode}
\def\pcol@hfil#1{{%
\@tempdima\csname pcol@columnsep#1\endcsname\relax
\ifdim\columnseprule>\z@
\hskip.5\@tempdima\@plus1fil\relax
\hskip-.5\columnseprule
\@ifundefined{pcol@colseprulecolor#1}%
{\pcol@colseprulecolor}{\@nameuse{pcol@colseprulecolor#1}}%
\copy\pcol@tempboxa \hskip-.5\columnseprule
\hskip.5\@tempdima\@plus1fil\relax
\else \hskip\@tempdima\@plus1fil\relax
\fi}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@@outputpage}
% \changes{v1.3-2}{2013/09/17}
% {Introduced keep the original definition of \cs{@outputpage}.}
% \changes{v1.3-3}{2013/09/17}
% {Introduced keep the original definition of \cs{@outputpage}.}
% \changes{v1.3-4}{2013/09/17}
% {Introduced keep the original definition of \cs{@outputpage}.}
% \begin{macro}{\@outputpage}
% \changes{v1.3-2}{2013/09/17}
% {Redefined for parallel-paging.}
% \changes{v1.3-3}{2013/09/17}
% {Redefined for background painting.}
% \changes{v1.3-4}{2013/09/17}
% {Redefined for marginal note placement.}
% \changes{v1.34}{2018/05/07}
% {Rename \cs{pcol@tempbox} as \cs{pcol@tempboxa}.}
%
% The macro \!\@outputpage!, being our own version of \LaTeX's one kept in
% \!\pcol@@outputpage!, ships out a page $p$ or \parapag{}e pair in $p$.
% The reason why we redefine this macro is that we need a few special
% operations for \parapag{}ing and \bgpaint{} {\em outside} of \env{paracol}
% environments. Therefore, the macro is not only used in our own macros
% \!\pcol@outputelt!, \!\pcol@output@start!, \!\pcol@output@flush!,
% \!\pcol@output@clear!, \!\pcol@flushfloats! and \!\pcol@output@end!, but
% also in \LaTeX's \!\@opcol! and \!\@doclearpage!\footnote{
%
% And possibly in \CSIndex{@outputdblcol} if double-column typesetting is
% done outside \env{paracol}.}
%
% invoked from our own or \LaTeX's \!\output! routine.
%
% First we calculate $H'_M=\!\topmargin!+\!\headheight!+\!\headsep!$ to place
% the origin of \bgpaint{} at the top edge of text area in what \LaTeX{}
% assumes as a page, i.e., shifted 1\,inch down from the real page. Then if
% $\CSIndex{ifpcol@output}=\true$ to mean this macro is used in a
% \env{paracol} environment, we build the painted \bground{}s of left and
% right \parapag{}es in $\!\pcol@tempboxa!=b_l$ and $\!\@tempboxa!=b_r$ by
% putting a vertical skip of $H'_M$, and invoking \!\pcol@bg@paintpage!
% with the setting $(\!\pcol@bg@from!,\!\pcol@bg@to!)=(\CBfrom,\CBto)$ be
% $(0,\CL)$ and $(\CL,\C)$ respectively. Note that \!\pcol@bg@paintpage!
% paints \bground{}s of regions $\bgr_a^{[c]}$ for all
% $a\in\{T,B,L,R,C,S,t,b,l,r\}$ and $c\In\CBfrom\CBto$, and for $b_r$ we
% temporarily increment $\page(p)$ by one if \npaired{} \parapag{}ing is in
% effect.
%
% Otherwise, i.e., if $\CSIndex{ifpcol@output}=\false$ indicating outside
% use, we build the painted \bground{}s in $b_l$ and $b_r$ similarly but
% with the following differences; \bgpaint{} is done if
% $\CSIndex{ifpcol@havelastpage}=\true$ to mean the page to be shipped has
% the \lpage{} of closed \env{paracol} as its part and
% $\!\set@color!\neq\!\relax!$ to mean some coloring package is loaded;
% page \bground{} painting is done by \!\pcol@bg@@paintpage! because
% \!\pcol@bg@paintpage! is not available outside \env{paracol} environments;
% the \bground{} of \postenv{} is painted by \!\pcol@bg@@paintbox! for the
% region $\bgr_{\{P,p\}}=[(0,\WT)(\HB,\HT)]$ where
% $\HB=\!\pcol@bg@preposttop!
% \in\{\!\pcol@bg@preposttop@left!,\!\pcol@bg@preposttop@right!\}$
% having the bottom edge of the last
% \env{paracol} environment (having right \parapag{}e for $b_r$). In
% addition, we examine if $\!\pcol@rightpage!\neq\bot$ to mean the right
% \parapag{}e was built by \!\pcol@output@end! when the last \env{paracol}
% environment was closed and, if so, make the box \!\textheight! tall adding
% \!\vfil! to its bottom.
%
% Then regardless of \CSIndex{ifpcol@output}, we do the followings; let the
% height and depth of $b_l$ and $b_r$ be 0 because they cannot occupy any
% real spaces in the ship-out image; temporarily let
% $\CSIndex{ifpcol@swapcolumn}=\false$ if $\page(p)$ is odd, $\CL=\C$ to
% mean \parapag{}ing is not in effect\footnote{
%
% Since the assignments of $\CL$ and $\C$ in \CSIndex{pcol@zparacol} are
% \CSIndex{global} and they are not nodified anywhere else, examining their
% equality outside \env{paracol} environments is safe and meaningful.},
%
% \parapag{}ing is done in \npaired{} mode\footnote{
%
% We need this examination because $\CSIndex{ifpcol@swapcolumn}=\false$ for
% \npaired{} \parapag{}ing is made locally by \!\pcol@zparacol!.},
%
% or we are outside \env{paracol} environments and the page does not have
% anything produced in environments. That is, we let
% $\CSIndex{ifpcol@swapcolumn}=\true$ if the page has something produced by
% a \env{paracol} environment, \cswap{} and \parapag{}ing are specified for
% the (last) environment\footnote{
%
% Column-swapping may be enabled {\em after} the last \env{paracol}
% environment was closed but we consider the enablement is effective for the
% page having the environment.},
%
% and the page number is even. Note that a page may have two or more
% (\lpage{}s of) \env{paracol} environements whose \parapag{}ing style can
% be inconsistent including the case some of them are not \parapag{}ed. If
% this inconsistency happens the page is shipped out following the style of
% the last environment. Also note that even if the last environment is not
% \parapag{}ed, the right \parapag{}e kept in \!\pcol@rightpage! is assuredly
% shipped out.
%
% Then if \cswap{} is in effect, we ship out the right \parapag{}e at first
% by \!\pcol@outputpage@r! and then the left one by \!\pcol@outputpage@l! to
% swap the left and right. Otherwise, the ship-out order is normal and thus
% the invocation order is \!\pcol@outputpage@l! then \!\pcol@outputpage@r!.
% Note that if \npaired{} \parapag{}ing is in effect, the page number to
% given to \!\pcol@outputpage@r! as its argument is $\page(p)+1$ if it is
% the second one, i.e., not swapped, while the argument in other cases and
% of \!\pcol@outputpage@l! are always $\page(p)$. Then finally, we
% \!\global!ly let $\CSIndex{ifpcol@havelastpage}=\false$ because so far the
% next page does not have \env{paracol}'s \lpage{} especially when we are
% outside it, let \!\pcol@bg@preposttop@left! and
% \!\pcol@bg@preposttop@right! have 0 because, if we are outside, the next
% \preenv{} should start from the top of a page, and let
% $\mpbout=\!\pcol@mparbottom@out!$ be $\mpboutz=\!\pcol@mparbottom@zero!$
% because so far we have no marginal notes given in \env{paracol}
% environments\footnote{
%
% This assignment in a \env{paracol} environment is meaningless because
% $\mpbout$ is meaningless too, but not harmful.}.
%
% \begin{macrocode}
\let\pcol@@outputpage\@outputpage
\def\@outputpage{\begingroup
\@tempdima\topmargin \advance\@tempdima\headheight \advance\@tempdima\headsep
\ifpcol@output
\setbox\pcol@tempboxa\vtop{\vskip\@tempdima \global\pcol@bg@paintedfalse
\let\pcol@bg@from\z@ \let\pcol@bg@to\pcol@ncolleft
\pcol@bg@paintpage}%
\ifpcol@bg@painted \@tempswatrue \else \@tempswafalse \fi
\setbox\@tempboxa\vtop{\vskip\@tempdima \global\pcol@bg@paintedfalse
\ifpcol@paired\else \advance\c@page\@ne \fi
\let\pcol@bg@from\pcol@ncolleft \let\pcol@bg@to\pcol@ncol
\pcol@bg@paintpage}%
\else
\def\reserved@a{\vskip\@tempdima \global\pcol@bg@paintedfalse
\ifpcol@havelastpage \ifx\set@color\relax\else
\pcol@bg@@paintpage \pcol@bg@@paintbox{Pp}%
\fi\fi}%
\setbox\pcol@tempboxa\vbox{%
\let\pcol@bg@preposttop\pcol@bg@preposttop@left
\let\pcol@bg@from\z@ \let\pcol@bg@to\pcol@ncolleft \reserved@a}%
\ifpcol@bg@painted \@tempswatrue \else \@tempswafalse \fi
\setbox\@tempboxa\vbox{\ifpcol@paired\else \advance\c@page\@ne \fi
\let\pcol@bg@preposttop\pcol@bg@preposttop@right
\let\pcol@bg@from\pcol@ncolleft \let\pcol@bg@to\pcol@ncol
\reserved@a}%
\ifvoid\pcol@rightpage\else
\pcol@Logstart{\@outputpage{rightset}}%
\setbox\pcol@rightpage\vbox to\textheight{\unvbox\pcol@rightpage \vfil}%
\pcol@Logend{\@outputpage{rightset}}%
\fi
\fi
\ht\pcol@tempboxa\z@ \dp\pcol@tempboxa\z@
\ht\@tempboxa\z@ \dp\@tempboxa\z@
\ifodd\c@page \pcol@swapcolumnfalse \fi
\ifnum\pcol@ncolleft<\pcol@ncol\else \pcol@swapcolumnfalse \fi
\ifpcol@output\else \ifpcol@havelastpage\else \pcol@swapcolumnfalse \fi\fi
\@tempcnta\c@page
\ifpcol@paired\else \advance\@tempcnta\@ne \pcol@swapcolumnfalse \fi
\ifpcol@swapcolumn \pcol@outputpage@r\c@page \pcol@outputpage@l\@tempcnta
\else \pcol@outputpage@l\c@page \pcol@outputpage@r\@tempcnta
\fi
\global\pcol@havelastpagefalse \gdef\pcol@bg@preposttop@left{0pt}%
\global\let\pcol@bg@preposttop@right\pcol@bg@preposttop@left
\global\let\pcol@mparbottom@out\pcol@mparbottom@zero
\endgroup}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \KeepSpace{1}
% \begin{macro}{\pcol@outputpage@l}
% \changes{v1.3-2}{2013/09/17}
% {Introduced for shipping out left parallel-pages.}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for column-separating rule drawing and background
% painting in left parallel-pages.}
% \changes{v1.34}{2018/05/07}
% {Rename \cs{pcol@tempbox} as \cs{pcol@tempboxa}.}
% \begin{macro}{\pcol@outputpage@r}
% \changes{v1.3-2}{2013/09/17}
% {Introduced for shipping out right parallel-pages.}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for column-separating rule drawing and background
% painting in right parallel-pages.}
% \begin{macro}{\pcol@outputpage@ev}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
%
% The macro $\!\pcol@outputpage@l!\arg{page}$, used solely in our own
% version of \!\@outputpage!, at first lets \!\c@page! have $\arg{page}$
% which definitely has the value that \!\c@page! had when we start
% \!\@outputpage!. That is, even when this macro is invoked after
% \!\pcol@outputpage@r! due to swapped \parapag{}ing,
%
% \Index{column-swapping}
%
% this assignment cancels the increment of \!\c@page! done in \LaTeX's
% \!\@outputpage! or in other word \!\pcol@@outputpage! because in this case
% \parapag{}es are \paired{}. Then we make \!\@themargin! \!\let!-equal to
% \!\evensidemargin! if two-side typesetting is in effect and \!\c@page! is
% even, or to \!\oddsidemargin! otherwise for the reference in
% \!\pcol@outputpage@ev! as shown shortly.
%
% Next, if \bgpaint{} took place in \!\@outputpage!, we let \!\everyvbox!
% have the macro invocation $\!\pcol@outputpage@ev!\<b_l\>$ to be expanded
% to the following sequence so that they are the leading materials in the
% \!\vbox! to be \!\shipout!; examination if the document is processed by a
% Japanese \LaTeX{} named p\LaTeX{} and then, if so, a control sequence
% \!\yoko! to put materials naturally; the painted \bground{} $b_l$ shifted
% right by \!\@themargin!; \!\nointerlineskip! to inhibit \!\baselineskip!
% insertion after $b_l$; emptying \!\everyvbox! to ensure nothing will be
% inserted into internal \!\vbox!es; and the assignment of \!\yoko! to
% \!\let! it be \!\relax! if necessary. This trick with \!\everyvbox! is
% necessary\footnote{
%
% Unless we rewrite \CSIndex{@outputpage}.}
%
% because $b_l$ should be put {\em before} \!\pcol@@outputpage! puts the
% page header, or the header would be overlaid by regions, e.g.,
% $\bgr_{\{t,T\}}$ in natural cases.
%
% The tricky elements to handle \!\yoko! in the sequence is necessary for
% p\LaTeX{} whose \!\@outputpage! has \!\yoko! as the first element of the
% \!\vbox! to be \!\shipout!, because \!\yoko! must be the first element of
% a box but our \!\everyvbox! to put \bground{} would make it non-first.
% That is by the tricky elements, the \!\vbox! should have \!\yoko! as the
% first element from \!\everyvbox! and then that put by p\LaTeX's
% \!\@outputpage! is nullified by \!\let!\!\yoko!\!\relax! in the
% \!\everyvbox! just for the \!\vbox! to be shipped out. On the other hand
% in ordinary \LaTeX, \!\yoko! does not appear in the \!\vbox! or is
% modified. The examination of the use of p\LaTeX{} is also trickily done
% by comparing the expansion results of \!\meaning!\!\yoko! and
% \!\string!\!\yoko!. Since the former results in the tokens ``\!\yoko!''
% which \!\string!\!\yoko! gives us iff \!\yoko! is a primitive of
% underlying \TeX{} being p\TeX{} if so, the comparison should give us
% equality iff p\LaTeX{} is in use\footnote{
%
% Unless some other \TeX{} has a primitive named \CSIndex{yoko}. This
% examination is more strict than that with \CSIndex{pfmtname} for
% \CSIndex{ifpcol@bfbottom}.}.
%
% Then we invoke \!\pcol@@outputpage! being (p)\LaTeX's original version of
% \!\@outputpage! to ship out \!\@outputbox! finally.
%
% The macro \!\pcol@outputpage@r!$\arg{page}$ performs similar operations but
% it does them only when $\!\pcol@rightpage!\neq\bot$ to mean we are in an
% \env{paracol} environment with \parapag{}ing or outside it but in the page
% in which it resides. Other differences are as follows; $\arg{page}$ can
% be $\page(p)+1$ for \npaired{} right \parapag{}es; \!\@outputbox! is
% locally made \!\let!-equal to \!\pcol@rightpage! prior to the invocation
% of \!\pcol@@outputpage!; and $b_r$ is given to \!\pcol@outputpage@ev! as
% its argument.
%
% \begin{macrocode}
\def\pcol@outputpage@l#1{%
\pcol@Logstart{\@outputpage{left}}%
\global\c@page#1\relax
\let\@themargin\oddsidemargin
\if@twoside\ifodd\c@page\else \let\@themargin\evensidemargin \fi\fi
\if@tempswa \everyvbox{\pcol@outputpage@ev\pcol@tempboxa}\fi
\pcol@@outputpage
\pcol@Logend{\@outputpage{left}}}
\def\pcol@outputpage@r#1{%
\begingroup
\ifvoid\pcol@rightpage\else
\global\c@page#1\relax
\let\@outputbox\pcol@rightpage
\pcol@Logstart{\@outputpage{right}}%
\let\@themargin\oddsidemargin
\if@twoside\ifodd\c@page\else \let\@themargin\evensidemargin \fi\fi
\ifpcol@bg@painted \everyvbox{\pcol@outputpage@ev\@tempboxa}\fi
\pcol@@outputpage
\pcol@Logend{\@outputpage{right}}%
\fi
\endgroup}
\def\pcol@outputpage@ev#1{%
\edef\reserved@a{\meaning\yoko}\edef\reserved@b{\string\yoko}%
\ifx\reserved@a\reserved@b \yoko\fi
\moveright\@themargin\box#1\nointerlineskip \everyvbox{}%
\ifx\reserved@a\reserved@b \let\yoko\relax \fi}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
%
%
%
% \section{Starting New Column-Page}
% \label{sec:imp-startcolumn}
%
% \begin{macro}{\pcol@startcolumn}
% \changes{v1.3-3}{2013/09/17}
% {Add \cs{@colht} and \cs{@tempdimb} as the first and third argument of
% \cs{pcol@shrinkcolbyfn}.}
% \changes{v1.32-2}{2015/10/10}
% {Fix the memory leak caused by mistakingly preserving $\pi^f(p)$
% when $p\EQ p_t$.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% The macro $\!\pcol@startcolumn!\arg{f}$ is invoked from \!\pcol@output!
% with $f=1$ and \!\pcol@freshpage! with $f=0$ to start a new \colpage.
% This macro has two additional functions to \LaTeX's \!\@startcolumn!, one
% for \Scfnote{}s and the other for coloring.
%
% First, if the page $p$ in which the new \colpage{} resides has \Scfnote{}s
% in $\pp^f(p)=\!\pcol@footins!$ because the column is not the leading one,
%
% \Index{leading column}
%
% we temporarily shrink \!\@colht! and \!\@colroom! by the space required to
% put $\pp^f(p)$ by \!\pcol@shrinkcolbyfn! during the trial of deferred
% float placement, remembering the existence of the footnotes by letting
% $\!\@tempdimb!=-\!\skip!\!\pcol@footins!$ which should be 0 otherwise.
% This shrinkage is essentially required when $p<\ptop$ because $\pp^f(p)$
% has been fixed to be a part of $p$ and thus deferred floats cannot push
% footnotes down to succeeding pages. In the case of $p=\ptop$, the
% shrinkage is also desirable to avoid unnecessary pushing down of footnotes
% which \TeX{} has decided to be in $p$.
%
% Then after trying put deferred floats in the \colpage{} by \!\@tryfcolumn!
% and \!\pcol@trynextcolumn! as done in \LaTeX's \!\@startcolumn!, we
% \!\insert! $\pp^f(p)$, if it is has some footnoes, by letting \!\footins!
% have it by \!\pcol@getcurrfoot! so that \TeX{} will be aware of the
% footnotes when it examines the page break of the \colpage{}. That is, if
% $p<\ptop$ the \!\insert!ion is to keep the vertical space for $\pp^f(p)$ in
% the building process of the \colpage{} in $p$ because any \Scfnote{s}
% cannot be added to $p$ any more, and thus $\pp^f(p)$ is preserved until
% the page $p$ is shipped out. On the other hand if $p=\ptop$, \Scfnote{s}
% in $p$ can grow further and thus \!\insert!ed footnotes will be captured
% again by \!\pcol@output@switch! or \!\pcol@startpage!. Therefore, if
% $p=\ptop$, we release $\pp^f(p)$ to \!\@freelist!.
%
% Then if $p=\ptop$, we also \!\insert! deferred footnotes in $\df$ until
% their total height reaches \!\@colht! by \!\pcol@deferredfootins! if $f=1$
% to mean this macro is invoked from \!\pcol@output!\footnote{
%
% The \cs{insert}ion of $\pp^f(p)$ also requiers $f=1$ but this examination
% is redundant because $\pp^f(p)=\bot$ definately if $f=0$.}.
%
% Note that the deferred footnote \!\insert!ion in the case of $f=0$ will
% be done afterward when \!\pcol@freshpage! does \!\pcol@restartcolumn! at
% its tail. Also note that \!\pcol@deferredfootins! examines if
% $\!\@tempdimb!=0$ to mean $\pp^f(p)=\bot$ and thus \!\skip!\!\footins!
% should be taken into account in its extraction of the footnotes from $\df$.
%
% Then after restoring \!\@colht! and canceling the temporary shrinkage of
% \!\@colroom!, we invoke \!\pcol@savecolorstack! to save \colpage{}'s
% \colorctext{} into $\csts$ so that coloring \!\special!s to reestablish
% $\csts$ will be put at its top if it has something when we leave it.
%
% \begin{macrocode}
%% Starting New Column Page
\def\pcol@startcolumn#1{%
\@tempdima\@colht \@tempdimb\z@
\ifvoid\pcol@footins\else
\pcol@shrinkcolbyfn\@colht\pcol@footins\@tempdimb
\fi
\global\@colroom\@colht
\@tryfcolumn\@deferlist
\if@fcolmade\else
\pcol@trynextcolumn
\ifpcol@scfnote \ifnum#1>\z@
\ifvoid\pcol@footins\else
\edef\pcol@currfoot{\pcol@footins}%
\pcol@getcurrfoot\copy
\pcol@Log\pcol@startcolumn{insert}\footins
\insert\footins{\unvbox\footins}%
\ifnum\pcol@page=\pcol@toppage
\pcol@Fb
\@cons\@freelist\pcol@footins
\pcol@Fe{startcolumn(pagefn)}%
\fi
\fi
\ifnum\pcol@page=\pcol@toppage
\pcol@deferredfootins\pcol@startcolumn \fi
\fi\fi
\fi
\advance\@tempdima-\@colht
\global\advance\@colroom\@tempdima
\global\advance\@colht\@tempdima
\pcol@savecolorstack}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@trynextcolumn}
% \changes{v1.2-2}{2013/05/11}
% {No change in the code itself but its explanation is modified
% according to the drastic redesign of \cs{pcol@startcolumn}.}
%
% The macro \!\pcol@trynextcolumn! is invoked from \!\pcol@startcolumn! and
% \!\pcol@flush~column! to try to move deferred floats in \!\@deferlist!
% into \!\@toplist! or \!\@botlist!. The body of this macro is perfectly
% equivalent to the \cs{else} part of \CSIndex{if@fcolmade} in \LaTeX's
% \!\@startcolumn!.
%
% \begin{macrocode}
\def\pcol@trynextcolumn{\begingroup
\let\reserved@b\@deferlist
\global\let\@deferlist\@empty
\let\@elt\@scolelt
\reserved@b
\endgroup}
% \end{macrocode}
% \end{macro}
%
%
%
% \section{Background Painting}
% \label{sec:imp-bgpaint}
%
% \begin{macro}{\pcol@bg@from}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@to}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
%
% The control sequence pair
% $(\!\pcol@bg@from!,\!\pcol@bg@to!)=(\Uidx\CBfrom,\Uidx\CBto)$ are made
% \!\let!-equal to $(0,\CL)$ or $(\CL,\C)$ by \!\pcol@buildcolseprule! and
% \!\@outputpage! for \bgpaint{} of columns and \csepgap{}s, and referred
% to by column scanning loops in \!\pcol@bg@paint@ii! and
% \!\pcol@bg@columnleft!. The control sequence \!\pcol@bg@to! is also
% referred to by \!\pcol@bg@paint@i! to decrement it by one temporarily so
% that the loop in \!\pcol@bg@paint@ii! scans $c\In\CBfrom{\CBto{-}1}$
% rather than $\LBRP\CBfrom\CBto$. Since this decrement is done whenever a
% painting macro is used regardless some setting of $\CBto$, \!\pcol@bg@to!
% has default setting with $\C$ to avoid unbound reference at the
% decrement. Note that since this decrement is done in a \!\vbox! and an
% appropriate setting must have been done if $\CBto$ is referred in
% \!\pcol@bg@paint@ii!, this decrement and default setting are safe.
%
% \begin{macrocode}
%% Background Painting
\let\pcol@bg@to\pcol@ncol
% \end{macrocode}
% \end{macro}\end{macro}
%
% \KeepSpace{4}
% \begin{macro}{\pcol@bg@paintpage}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@@paintpage}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@paintcolumns}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@@paintcolumns}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@paintbox}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@@paintbox}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
%
% The macros \!\pcol@bg@@paintpage!, \!\pcol@bg@@paintcolumns! and
% $\!\pcol@bg@@paintbox!\Arg{A}$ are made \!\let!-equal to their interface
% counterparts \!\pcol@bg@paintpage!, \!\pcol@bg@paint~columns! and
% \!\pcol@bg@paintbox! by \!\pcol@zparacol! if some coloring package has
% been loaded. Otherwise, these interface macros are \!\let!-equal to
% \!\relax! for first two and \!\@gobble! for the last, so that macros in
% \!\output! routine freely use them unaware of coloring capability. One
% exception is in \!\@outputpage! which uses \!\pcol@bg@@paintpage! and
% \!\pcol@bg@@paintbox! explicitly when it is outside \env{paracol}
% environments, examining the availability of coloring.
%
% The macro \!\pcol@bg@paintpage! and \!\pcol@bg@@paintpage! are used in
% \!\@outputpage! to paint \bground{}s of regions $\bgr_a^{[c]}$ for all
% $a\in\{T,B,L,R,G,C,t,b,l,r\}$ and $c\In\CBfrom\CBto$ for $a=C$ while
% $c\In\CBfrom{\CBto{-}1}$ for $a=G$. Therefore, the macro invokes
% \!\pcol@bg@paint@i! with two
% $\!\pcol@bg@paint@ii!\Arg{A_b}\Arg{A_g}\Arg{A_c}$, letting
% $A_b=|TBLR|$, $A_g=|G|$ and $A_c=|C|$ in the first invocation and then
% $A_b=|tblr|$ and $A_g=A_c=\emptyset$ in the second.
%
% The macro \!\pcol@bg@paintcolumns! is used in \!\pcol@buildcolseprule! and
% \!\pcol@buildcselt! to paint \bground{}s of regions $\bgr_g^c(i)$ for
% $c\In\CBfrom{\CBto{-}1}$ and $\bgr_c^c(i)$ for $c\In\CBfrom\CBto$.
% Therefore, the macro invokes \!\pcol@bg@paint@i! with \!\pcol@bg@paint@ii!
% giving it $A_b=\emptyset$, $A_g=|g|$ and $A_c=|c|$.
%
% The macro $\!\pcol@bg@paintbox!\Arg{A}$ is used in the following macros
% with $A$ shown in the parantheses to paint the \bground{}s of regions
% $\bgr_{\{a_1,a_2\}}$ where $(a_1,a_2)\in\{(S,s),(F,f),(N,n),\~(P,p)\}$.
%
% \begin{quote}\raggedright
% \!\pcol@outputelt!\Tie(|Ff|),
% \!\pcol@ioutputelt!\Tie(|Nn|, |Ff|),
% \!\pcol@buildcselt!\Tie(|Ss|),
% \!\pcol@output@start!\Tie(|Pp|),
% \!\pcol@output@clear!\Tie(|Ff|),
% \!\pcol@makeflushedpage!\Tie(|Ff|),
% \!\pcol@imakeflushedpage!\Tie(|Nn|),
% \!\pcol@output@end!\Tie(|Nn|).
% \end{quote}
%
% The macro \!\@outputpage! also uses the function but \!\pcol@bg@@paintbox!
% explicitly with $A=|Pp|$. Therefore \!\pcol@bg@@paintbox! invokes
% \!\pcol@bg@paint@i! with \!\pcol@bg@paint@ii! giving it $A_b=A$ and
% $A_g=A_c=\emptyset$.
%
% \begin{macrocode}
\def\pcol@bg@@paintpage{%
\pcol@bg@paint@i{%
\pcol@bg@paint@ii{TBLR}{G}{C}\pcol@bg@paint@ii{tblr}{}{}}}
\def\pcol@bg@@paintcolumns{\pcol@bg@paint@i{\pcol@bg@paint@ii{}{g}{c}}}
\def\pcol@bg@@paintbox#1{\pcol@bg@paint@i{\pcol@bg@paint@ii{#1}{}{}}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@bg@paint@i}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
%
% The macro $\!\pcol@bg@paint@i!\Arg{body}$ is used in
% \!\pcol@bg@@paintpage!, \!\pcol@bg@@paint~columns! and
% \!\pcol@bg@@paintbox! to paint \bground{}s by a sequence of
% \!\pcol@bg@paint@ii! specified in $\arg{body}$. The painted \bground{} is
% built in \!\@tempboxa! being a \!\vtop! having a null \!\vskip! as its
% first element so that everything put in the box is below its reference
% point at its top. Then, before invoking \!\pcol@bg@paint@ii! in
% $\arg{body}$, we do the followings; \!\global!ly let
% $\CSIndex{ifpcol@bg@painted}=\false$ to indicate so far any painted
% \bground{} are produced; make \!\pcol@bg@leftmargin! \!\let!-equal
% to \!\pcol@lrmargin! to use this \!\dimen! register locally with the
% more appropriate alias; negate \!\pagerim! locally to calculate $\HT$
% easily; decrement $\CBto$ by one locally for the column scanning loop for
% $c\In\CBfrom{\CBto{-}1}$ in \!\pcol@bg@paint@ii!; and \!\offinterlineskip!
% to inhbit inter-line \!\baselineskip! insertion in the box. Then after
% the invocation of the sequence of \!\pcol@bg@paint@ii! in $\arg{body}$ and
% closing the box, we let the height, depth and width of the box be 0 so
% that it does not occupy any real space in the outer box in which the box
% is put. Finally, if $\CSIndex{ifpcol@bg@painted}=\true$ meaning that some
% painted \bground{}s are built in the box, we put the box into the outer
% box surrounding it by \!\nointerlineskip! to inhibit inter-line
% \!\baselineskip! insertion before and after it.
%
% \begin{macrocode}
\def\pcol@bg@paint@i#1{%
\setbox\@tempboxa\vtop{\vskip\z@
\global\pcol@bg@paintedfalse
\let\pcol@bg@leftmargin\pcol@lrmargin
\pagerim-\pagerim \advance\pcol@bg@to\m@ne
\offinterlineskip #1}%
\ht\@tempboxa\z@ \dp\@tempboxa\z@ \wd\@tempboxa\z@
\ifpcol@bg@painted \nointerlineskip \box\@tempboxa \nointerlineskip \fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@bg@paint@ii}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
%
% The macro $\!\pcol@bg@paint@ii!\Arg{A_b}\Arg{A_g}\Arg{A_c}$ appears only
% in the argument of \!\pcol@bg@paint@i! used in
% \!\pcol@bg@@paintpage!, \!\pcol@bg@@paintcolumns! and
% \!\pcol@bg@@paintbox! to paint \bground{}s of regions $\bgr_a$ for
% $a\in{}A_b\subseteq\{T,B,L,R,S,F,N,P,t,b,l,r,s,f,n,p\}$, $\bgr_a^c$ for
% $a\in{}A_g\subseteq\{G,g\}$ and $c\In\CBfrom{\Cto{-}1}$, and $\bgr_a^c$ for
% $a\in A_c\subseteq\{C,c\}$ and $c\In\CBfrom\CBto$.
%
% First we invoke \!\pcol@bg@swappage! with \CSIndex{ifpcol@bg@swap} to
% let \!\pcol@bg@left~margin! and \CSIndex{ifpcol@bg@@swap} have values
% accorging to \CSIndex{ifpcol@bg@swap}, \CSIndex{if@twoside} and the parity
% of $\page(p)$. Then we invoke $\!\pcol@bg@paintregion!\arg{a}\arg{c}$ for
% all $a\in A_b$ and $c=-1$ to paint the \bground{} of $\bgr_a$. Second, we
% invoke \!\pcol@bg@swappage! again but with \CSIndex{ifpcol@swapcolumn}
% instead of \CSIndex{ifpcol@bg@swap}, and \!\pcol@bg@paintregion! as well
% but for $a\in\{A_g,A_c\}$ and $c\In\CBfrom{\CBto{-}1}$. Third and
% finally, we make yet another invocation of \!\pcol@bg@paintregion! for
% $a\in A_c$ and $c=\CBto-1$.
%
% \begin{macrocode}
\def\pcol@bg@paint@ii#1#2#3{%
\pcol@bg@swappage\ifpcol@bg@swap\fi
\@tfor\reserved@b:=#1\do{\pcol@bg@paintregion\reserved@b\m@ne}%
\pcol@bg@swappage\ifpcol@swapcolumn\fi
\@tfor\reserved@b:=#2#3\do{%
\pcol@currcol\pcol@bg@from \@whilenum\pcol@currcol<\pcol@bg@to\do{%
\pcol@bg@paintregion\reserved@b\pcol@currcol
\advance\pcol@currcol\@ne}}%
\@tfor\reserved@b:=#3\do{\pcol@bg@paintregion\reserved@b\pcol@currcol}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@bg@swappage}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
%
% The macro $\!\pcol@bg@swappage!\arg{if}\cs{fi}$ is used solely in
% \!\pcol@bg@paint@ii! but twice with $\arg{if}=\CSIndex{ifpcol@bg@swap}$
% and then with $\arg{if}=\CSIndex{ifpcol@swapcolumn}$, to let
% \!\pcol@bg@leftmargin! and \CSIndex{ifpcol@bg@@swap} have values for
% \mirror{}ing according to the truth values of $\arg{if}$ and
% \CSIndex{if@twoside} and the parity of $\page(p)$ of the page $p$ for
% which \bgpaint{} is taking place. That is, they are let have the values
% as follows.
%
% \begin{eqnarray*}
% W&=&\cases{\CSIndex{oddsidemargin}&
% $\page(p)\bmod2=1\;\lor\CSIndex{if@twoside}=\false$\cr
% \CSIndex{evensidemargin}&
% $\page(p)\bmod2=0\;\land\CSIndex{if@twoside}=\true$}\\
% \rlap{$\displaystyle(\!\pcol@bg@leftmargin!,\CSIndex{ifpcol@bg@@swap})$}
% \phantom{W}\\
% &=&\cases{(W,\;\false)&$\page(p)\bmod2=1\lor\;\arg{if}=\false$\cr
% (\WP-(W+\WT+2\,|in|),\;\true)&
% $\page(p)\bmod2=\land\;\arg{if}=\true$}
% \end{eqnarray*}
%
% Note that $\WP-(W+\WT+2\,|in|)$ means the right margin width minus 1\,|in|
% with given left margin width $W$, and thus
% $\WM=\!\pcol@bg@leftmargin!+1\,|in|$ gives us the right margin width we
% need in \mirror{}ed \bgpaint.
%
% \begin{macrocode}
\def\pcol@bg@swappage#1#2{%
\pcol@bg@leftmargin\oddsidemargin \pcol@bg@@swapfalse
\ifodd\c@page\else
\if@twoside \pcol@bg@leftmargin\evensidemargin \fi
#1% \ifpcol@{bg@swap,swapcolumn}
\pcol@bg@@swaptrue
\advance\pcol@bg@leftmargin\textwidth \advance\pcol@bg@leftmargin2in
\advance\pcol@bg@leftmargin-\paperwidth
\pcol@bg@leftmargin-\pcol@bg@leftmargin
#2% \fi
\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@bg@paintregion}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@paintregion@i}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
%
% The macro $\!\pcol@bg@paintregion!\arg{a}\arg{c}$ is used only in
% $\!\pcol@bg@paint@ii!\Arg{A_b}\Arg{A_g}\Arg{A_c}$ but as many times as
% $\Abs{A_b}+\Abs{A_g}(\CBto-\CBfrom-1)+\Abs{A_c}(\CBto-\CBfrom)$ to paint
% \bground{} region $\bgr_a^{[c]}$ specified by $|\pcol@bg@@|{\cdot}a$
%
% \SpecialArrayIndex{a}{\pcol@bg@@}
%
% with color $\bgc_a^c=|\pcol@bg@color@|{\cdot}a{\cdot}|@|{\cdot}c$
%
% \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
%
% or, if it is undefined, $\bgc_a=|\pcol@bg@color@|{\cdot}a$.
%
% \SpecialArrayIndex{a}{\pcol@bg@color@}
%
% If $\bgr_a^c$ or $\bgr_a$ is defined, the painted \bground{} is built in
% \!\@tempboxa! with \!\vtop! having null vertical skip at its top and by
% $\!\pcol@bg@paintregion@i!\Arg{F_x}\Arg{F_y}\Arg{F_w}\Arg{F_h}$ where
% the arguments are defined in the body of the macro $|\pcol@bg@@|{\cdot}a$
%
% \SpecialArrayIndex{a}{\pcol@bg@@}
%
% and thus we need triple \!\expandafter! to give them to the macro. Prior
% to the invocatoin of the macro, we let $\!\reserved@a!=a'$ have
% $a{\cdot}|@|{\cdot}c$ if $\bgc_a^c$ is defined for $a\in\{G,C,g,c\}$, or
% $a$ otherwise definitely for $a\notin\{G,C,g,c\}$.
%
% Then \!\pcol@bg@paintregion@i! calculates $x_0=\!\@tempdima!$,
% $y_0=\!\@tempdimb!$, $x_1=\!\@tempdimc!$ and $y_1=\!\dimen@!$ of the
% region $\bgr_a^{[c]}$ by $\!\pcol@bg@calculate!\arg{z}\arg{z_0}\Arg{F}$
% giving it
% $(z,z_0,F)\in\{(x_0,0,F_x),(y_0,0,F_y),(x_1,x_0,F_w),(y_1,y_0,F_h)\}$,
% where $(x_0,y_0)$ and $(x_1,y_1)$ is the left-top and right-bottom corner
% of the painting region in the text-area coordinate, i.e., left-right and
% top-down coordinate whose origin is at the left-top corner of the leftmost
% column. Next we modify $\{x,y\}_{\{0,1\}}$ for \bgext{} by
% $\!\pcol@bg@addext!\arg{z}\Arg{s}\Arg{d}$ with $(z,s,d)\in
% \{(x_0,\hbox{`|-|'},|l|),(y_0,\hbox{`|-|'},|t|),
% (x_1,\emptyset,|r|),\~(y_1,\emptyset,|b|)\}$.
%
% Now we have $[(x_0,y_0)(x_1,y_1)]$ and thus, if not \mirror{}ed, we place
% $\bgr_a^{[c]}$ at $(x_0,y_0)$ by a vertical skip of $y_0$ and shifting a
% \!\hbox! for the region right by $x_0$ by \!\moveright!, and paint the box
% putting a \!\vrule! of $(x_1-x_0)$ wide and $(y_1-y_0)$ tall, letting
% \!\current@color! have $\bgc_r^{[c]}=|\pcol@bg@colr|{\cdot}a'$ and then
% invoking \!\pcol@set@color! being the orinigal definition of
% \!\set@color!.
%
% \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
% \SpecialArrayIndex{a}{\pcol@bg@color@}
%
% On the other hand if \mirror{}ing is to be done, the region should be
% $[(\WT{-}x_1,y_0)(\WT{-}x_0,y_1)]$ and thus the shift amount for
% \!\moveright! of the \!\hbox! is $(\WT-x_1)$.
%
% Then after \!\pcol@bg@paintregion@i! finshes its work,
% \!\pcol@bg@paintregion! lets the switch
% \CSIndex{ifpcol@bg@painted}${}=\true$ because we painted $\bgr_a^{[c]}$,
% lets the height, depth and width of \!\@tempboxa! be 0 to make it a
% phantom, and then put it into the outside box opened by
% \!\pcol@bg@paint@i!. On the other hand, if neither $\bgc_r^c$ nor
% $\bgc_r$ defined to mean the \bgpaint{} of the region is not specified, we
% do nothing.
%
% \begin{macrocode}
\def\pcol@bg@paintregion#1#2{%
\@ifundefined{pcol@bg@color@#1@\number#2}%
{\def\reserved@a{#1}}{\edef\reserved@a{#1@\number#2}}%
\@ifundefined{pcol@bg@color@\reserved@a}\relax
{\setbox\@tempboxa\vtop{\vskip\z@
\expandafter\expandafter\expandafter
\pcol@bg@paintregion@i\csname pcol@bg@@#1\endcsname}%
\global\pcol@bg@paintedtrue
\ht\@tempboxa\z@ \dp\@tempboxa\z@ \wd\@tempboxa\z@ \box\@tempboxa}}
\def\pcol@bg@paintregion@i#1#2#3#4{%
\pcol@bg@calculate\@tempdima\z@{#1}%
\pcol@bg@calculate\@tempdimb\z@{#2}%
\pcol@bg@calculate\@tempdimc\@tempdima{#3}%
\pcol@bg@calculate\dimen@\@tempdimb{#4}%
\pcol@bg@addext\@tempdima{-}{l}\pcol@bg@addext\@tempdimc{}{r}%
\pcol@bg@addext\@tempdimb{-}{t}\pcol@bg@addext\dimen@{}{b}%
\vskip\@tempdimb
\ifpcol@bg@@swap
\advance\@tempdima-\@tempdimc \@tempdima-\@tempdima
\advance\@tempdimc-\textwidth \@tempdimc-\@tempdimc
\moveright\@tempdimc\hbox{%
\advance\dimen@-\@tempdimb
\edef\current@color{\@nameuse{pcol@bg@color@\reserved@a}}\pcol@set@color
\vrule\@width\@tempdima\@height\dimen@}%
\else
\moveright\@tempdima\hbox{%
\advance\@tempdimc-\@tempdima \advance\dimen@-\@tempdimb
\edef\current@color{\@nameuse{pcol@bg@color@\reserved@a}}\pcol@set@color
\vrule\@width\@tempdimc\@height\dimen@}%
\fi}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \KeepSpace{3}
% \begin{macro}{\pcol@bg@calculate}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@advance}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@negative}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@nadvance}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@dimen}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
%
% The macro $\!\pcol@bg@calculate!\arg{z}\arg{z_0}\arg{F}$ is used in
% \!\pcol@bg@paintregion@i! and \!\pcol@bg@addext! to accumulate dimensional
% values specified in $F$ into a \!\dimen! register $z$ with initial value
% $z_0$. The specificatoin $F$ is a sequence of $\!\@elt!\Arg{f}$ to add $f$
% to $z$, $\!\pcol@bg@negative!\Arg{F^-}$ to subtract the amount specified
% by $F^-$ from $z$, or macros expanded to either of them.
%
% The macro makes \!\pcol@bg@dimen! \!\let!-equal to $z$ and \!\@elt! to
% \!\pcol@bg@advance!, lets $z=z_0$, and then does what is specified in $F$\@.
% Therefore, $\!\@elt!\arg{f}$ appearing directly or indirectly in $F$ does
% $\!\advance!\arg{z}\arg{f}$ for the accumulation. On the other hand,
% \!\pcol@bg@negative! makes \!\@elt! \!\let!-equal to \!\pcol@bg@nadvance!
% to let $\!\@elt!\arg{f}$ do $\!\advance!\arg{z}{-}\arg{f}$ for
% subtraction, does $F^-$, and then remake $\!\@elt!=\!\pcol@bg@advance!$.
% Note that $f$ may be expanded to a negative amount having `|-|' its
% beginning to results in $\!\@elt!\arg{f}$ expanded to
% $\!\advance!\arg{z}{-}{-}\arg{f'}$ with some positive amount $f'$, but
% this double negation is legitimate in \TeX{} and is equivalent to
% $\!\advance!\arg{z}\arg{f'}$. The macro \!\pcol@bg@negative! is used in
% the following macros.
%
% \begin{quote}\raggedright
% \!\pcol@bg@ext@inf@l!,
% \!\pcol@bg@ext@inf@r!,
% \!\pcol@bg@ext@inf@t!,
% \!\pcol@bg@@t!,
% \!\pcol@bg@@b!,
% \!\pcol@bg@@l!,
% \!\pcol@bg@@r!,
% \!\pcol@bg@@n!,
% \!\pcol@bg@@p!.
% \end{quote}
%
% \begin{macrocode}
\def\pcol@bg@calculate#1#2#3{\let\pcol@bg@dimen#1\relax
\let\@elt\pcol@bg@advance \pcol@bg@dimen#2\relax #3}
\def\pcol@bg@negative#1{\let\@elt\pcol@bg@nadvance #1\relax
\let\@elt\pcol@bg@advance}
\def\pcol@bg@advance#1{\advance\pcol@bg@dimen#1\relax}
\def\pcol@bg@nadvance#1{\advance\pcol@bg@dimen-#1\relax}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \KeepSpace{3}
% \begin{macro}{\pcol@bg@addext}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@ext@inf@l}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@ext@inf@r}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@ext@inf@t}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@ext@inf@b}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
%
% The macro $\!\pcol@bg@addext!\arg{z}\Arg{s}\Arg{d}$ is used only in
% \!\pcol@bg@paintregion@i! but four times with $(z,s,d)\in
% \{(x_0,\hbox{`|-|'},|l|),(y_0,\hbox{`|-|'},|t|),
% (x_1,\emptyset,|r|),\~(y_1,\emptyset,|b|)\}$, to perform \bgext{} on a
% \!\dimen! register $z$.
%
% First the macro gets $e=|\pcol@bg@ext@|{\cdot}d{\cdot}|@|{\cdot}a'
% \in e_a^{[c]}(\{x,y\}^{\{{+},{-}\}})$
%
% \SpecialArrayIndex{d{\cdot}\string\texttt{@}
% {\cdot}a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@ext@}
% \SpecialArrayIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
%
% where $a'=\!\reserved@a!\~\in\{a{\cdot}|@|{\cdot}c,a\}$. Then if
% $e<9000\PT$ being a finite \bgext, we let $z\gets z\pm e$
% according to $s$, i.e. $+$ if $s=\emptyset$ while $-$ if $s={}$`|-|'.
% Otherwise, i.e., $e\geq9000\PT$ for a infinite \bgext, let $e'$
% be the value shown below by invoking $|\pcol@bg@ext@inf@|{\cdot}d$
%
% \SpecialArrayMainIndex{d}{\pcol@bg@ext@inf@}
% $$
% e'=\cases{-(\WM-\WR)&$d=|l|$\cr
% \WP-(\WM-\WR)&$d=|r|$\cr
% -(\HM-\HR)&$d=|t|$\cr
% \HP-(\HM-\HR)&$d=|b|$\cr}
% $$
% where $\WM-\WR$ is specified by \!\pcol@bg@pageleft! and $\HM-\HR$ by
% \!\pcol@bg@pagetop!. Then we let $z=e'\pm(e-10000\PT)$ according to $s$
% again, i.e., move $z$ {\em inside\/} by $(10000\PT-e)$ from $e'$.
%
% \begin{macrocode}
\def\pcol@bg@addext#1#2#3{%
\dimen@ii\@nameuse{pcol@bg@ext@#3@\reserved@a}\relax
\ifdim\dimen@ii<9000\p@\relax \advance#1#2\dimen@ii
\else
\pcol@bg@calculate#1\z@{\@nameuse{pcol@bg@ext@inf@#3}}%
\advance\dimen@ii-\@M\p@ \advance#1#2\dimen@ii
\fi}
\def\pcol@bg@ext@inf@l{\pcol@bg@negative\pcol@bg@pageleft}
\def\pcol@bg@ext@inf@r{\pcol@bg@negative\pcol@bg@pageleft
\pcol@bg@paperwidth}
\def\pcol@bg@ext@inf@t{\pcol@bg@negative\pcol@bg@pagetop}
\def\pcol@bg@ext@inf@b{\pcol@bg@negative\pcol@bg@pagetop
\pcol@bg@paperheight}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \KeepSpace{7}
% \begin{macro}{\pcol@bg@paperwidth}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@paperheight}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@pageleft}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@pagetop}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@textheight}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@columnleft}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@columnright}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@columnwidth}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@columnsep}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
%
% The following macros specify the whole or a part of
% $F\in\{F_x,F_y,F_w,F_h\}$ being the body of $|\pcol@bg@@|{\cdot}a$ for
% \bgpaint{} regions $\bgr_a^{[c]}$.
%
% \begin{eqnarray*}
% \!\pcol@bg@paperwidth!&=& \WP-2\WR=\!\paperwidth!-2\!\pagerim!
% \quad(t,T,b,B,r,R)\\
% \!\pcol@bg@paperheight!&=& \HP-2\HR=\!\paperheight!-2\!\pagerim!
% \quad(b,B)\\
% \!\pcol@bg@pageleft!&=& \WM-\WR=
% (\!\pcol@bg@leftmargin!+1\,|in|)-\!\pagerim!\\
% & \rlap{$(t,T,b,B,l,L,r,R)$}\\
% \!\pcol@bg@pagetop!&=& \HM-\WR\\
% &=&(\!\topmargin!+\!\headheight!+\!\headsep!+1\,|in|)-\!\pagerim!\\
% & \rlap{$(t,T,b,B)$}\\
% \!\pcol@bg@textheight!&=& \HT=\!\textheight!+\!\@maxdepth!\\
% & \rlap{$(b,B,l,L,r,R,C,G,n,N,p,P)$}\\
% \!\pcol@bg@columnleft!&=& \W_c=\sum_{d=\CBfrom}^{c-1}(w_c+g_c)
% \quad(c,C)\\
% \!\pcol@bg@columnright!&=& \W_c+w_c=
% \!\pcol@bg@columnleft!+\!\pcol@bg@columnwidth!\\
% & \rlap{$(g,G)$}\\
% \!\pcol@bg@columnwidth!&=& w_c=|\pcol@columnwidth|{\cdot}c
% \quad(c,C)\\
% \!\pcol@bg@columnsep!&=& g_c=|\pcol@columnsep|{\cdot}c
% \quad(g,G)
% \end{eqnarray*}
%
% \SpecialArrayIndex{c}{\pcol@columnwidth}
% \SpecialArrayIndex{c}{\pcol@columnsep}
%
% Note that \!\pagerim! in $F$ means $-\!\pagerim!$ because its sign is
% reversed by \!\pcol@bg@paint@i!. The macros are used in
% $|\pcol@bg@@|{\cdot}a$
%
% \SpecialArrayIndex{a}{\pcol@bg@@}
%
% whose region identifier $a$ is shown in paretheses above, but besides them
% \!\pcol@bg@paperwidth! is also used in \!\pcol@bg@ext@inf@r!,
% \!\pcol@bg@paperheight! in \!\pcol@bg@ext@inf@b!, \!\pcol@bg@pageleft! in
% \!\pcol@bg@ext@inf@l! and \!\pcol@bg@ext@inf@r!, and \!\pcol@bg@pagetop!
% in \!\pcol@bg@ext@inf@t! and \!\pcol@bg@ext@inf@b!. Also note that
% \!\pcol@bg@textheight! is used in \!\pcol@output@clear! while it is
% temporarily redefined in \!\pcol@output@start! and \!\pcol@output@end!.
%
% \begin{macrocode}
\def\pcol@bg@paperwidth{\@elt\paperwidth \@elt{2\pagerim}}
\def\pcol@bg@paperheight{\@elt\paperheight \@elt{2\pagerim}}
\def\pcol@bg@pageleft{\@elt{1in}\@elt\pcol@bg@leftmargin \@elt\pagerim}
\def\pcol@bg@pagetop{\@elt{1in}\@elt\topmargin \@elt\headheight \@elt\headsep
\@elt\pagerim}
\def\pcol@bg@textheight{\@elt\textheight \@elt\@maxdepth}
\def\pcol@bg@columnleft{%
\@tempcnta\pcol@bg@from \@whilenum\@tempcnta<\pcol@currcol\do{%
\@elt{\@nameuse{pcol@columnwidth\number\@tempcnta}}%
\@elt{\@nameuse{pcol@columnsep\number\@tempcnta}}%
\advance\@tempcnta\@ne}}
\def\pcol@bg@columnright{\pcol@bg@columnleft \pcol@bg@columnwidth}
\def\pcol@bg@columnwidth{\@elt{\@nameuse{pcol@columnwidth\number\pcol@currcol}}}
\def\pcol@bg@columnsep{\@elt{\@nameuse{pcol@columnsep\number\pcol@currcol}}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \KeepSpace{7}
% \begin{macro}{\pcol@bg@preposttop}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@preposttop@left}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@preposttop@right}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@columntop}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@columnheight}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@floatheight}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@footnoteheight}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@spanningtop}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
% \begin{macro}{\pcol@bg@spanningheight}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for background painting.}
%
% Besides the macros shown above, $|\pcol@bg@@|{\cdot}a$ uses the following
% macros defined by macros using \!\pcol@bg@paintpage!,
% \!\pcol@bg@paintcolumns! or \!\pcol@bg@paintbox!.
%
% \begin{itemize}
% \item
% \!\pcol@bg@preposttop! being \!\pcol@bg@preposttop@left! or
% \!\pcol@bg@preposttop@right! for $a\in\{p,P\}$ by \!\@outputpage! and
% \!\pcol@output@end!, the latter of which may define only the left one if
% the closing environment is not \parapag{}ed. That is, both of left and
% right macros are usually equivalent, but the right one can be smaller than
% the left if we have two or more (\lpage{}s of) \env{paracol} environments
% in a page and the closing environment is not \parapag{}ed while some
% others are. In such case, \!\@outputpage! or \!\pcol@output@start!,
% another macro referring to them, must paint the region below
% \!\pcol@bg@preposttop@right! in the right page as a part of \preenv{} or
% \postenv{} by \!\let!ting \!\pcol@bg@preposttop! be
% \!\pcol@bg@preposttop@left! and \!\pcol@bg@preposttop@right! for the left
% and right \parapag{}es respectively. Both macros have common initial
% value 0.
%
% \item
% \!\pcol@bg@columntop! and \!\pcol@bg@columnheight! for $a\in\{c,g\}$ by
% \!\pcol@build~colseprule! and \!\pcol@buildcselt!.
%
% \item
% \!\pcol@bg@spanningtop! and \!\pcol@bg@spanningheight! for $a\in\{s,S\}$ by
% \!\pcol@buildcselt!.
%
% \item
% \!\pcol@bg@floatheight! for $a\in\{f,F\}$ by \!\pcol@outputelt!,
% \!\pcol@ioutputelt!, \!\pcol@output@clear! and \!\pcol@makeflushedpage!
%
% \item
% \!\pcol@bg@footnoteheight! for $a\in\{n,N\}$ by \!\pcol@ioutputelt!,
% \!\pcol@imakeflushed~page! and \!\pcol@output@end!.
% \end{itemize}
%
% \begin{macrocode}
\def\pcol@bg@preposttop@left{0pt}
\let\pcol@bg@preposttop@right\pcol@bg@preposttop@left
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \KeepSpace{18}
% \begin{macro}{\pcol@bg@@c}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@C}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@g}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@G}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@s}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@S}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@t}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@T}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@b}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@B}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@l}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@L}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@r}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@R}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@f}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@F}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@n}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@N}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@p}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
% \begin{macro}{\pcol@bg@@P}
% \changes{v1.3-3}{2013/09/17}{Introduced for background painting.}
%
% The macros $|\pcol@bg@@|{\cdot}a$
%
% \SpecialArrayMainIndex{a}{\pcol@bg@@}
%
% define arguments $F_x$, $F_y$, $F_w$ and $F_h$ to be passed to
% \!\pcol@bg@paintregion@i! in their bodies to calculate $(x_0,y_0)$ and
% $(x_1{-}x_0,y_1{-}y_0)$ for regions $\bgr_a^{[c]}$ as shown below in the
% form of $(x_0,y_0)+(x_1{-}x_0,y_1{-}y_0)$ (to have $(x_1,y_1)$), where
% $H^c=\!\pcol@bg@columntop!$, $h^c=\!\pcol@bg@columnheight!$,
% $H^s=\!\pcol@bg@spanningtop!$, $h^s=\!\pcol@bg@spanningheight!$,
% $h^f=\!\pcol@bg@floatheight!$, $h^n=\!\pcol@bg@footnoteheight!$ and
% $H^p=\!\pcol@bg@preposttop!$ calculated by macros which invoke \bgpaint{}
% macros, while $s^n=\!\skip!\!\footins!$.
%
% \begin{eqnarray*}
% \bgr_c^c&\;:\;&(\W_c\;,\;H^c)\ +\ (w_c\;,\;h^c)\\
% \bgr_C^c&:&(\W_c\;,\;0)\ +\ (w_c\;,\;\HT)\\
% \bgr_g^c&:&((\W_c+w_c)\;,\;H^c)\ +\ (g_c\;,\;h^c)\\
% \bgr_G^c&:&((\W_c+w_c)\;,\;0)\ +\ (g_c\;,\;\HT)\\
% \bgr_{\{s,S\}}&:&(0\;,\;H^s)\ +\ (\WT\;,\;h^s)\\
% \bgr_{\{t,T\}}&:&(-(\WM-\WR)\;,\;-(\HM-\HR))\ +\ ((\WP-2\WR)\;,\;\HM-\HR)\\
% \bgr_{\{b,B\}}&:&(-(\WM-\WR)\;,\;\HT)\ +\
% ((\WP-2\WR)\;,\;(\HP-2\HR)-((\HM-\HR)+\HT))\\
% \bgr_{\{l,L\}}&:&(-(\WM-\WR)\;,\;0)\ +\ ((\WM-\WR)\;,\;\HT)\\
% \bgr_{\{r,R\}}&:&(\WT\;,\;0)\ +\ ((\WP-2\WR)-((\WM-\WR)+\WT)\;,\;\HT)\\
% \bgr_{\{f,F\}}&:&(0\;,\;0)\ +\ (\WT\;,\;h^f)\\
% \bgr_{\{n,N\}}&:&(0\;,\;\HT-(h^n+s^n))\ +\ (\WT\;,\;h^n+s^n)\\
% \bgr_{\{p,P\}}&:&(0\;,\;H^p)\ +\ (\WT\;,\;\HT-H^p)
% \end{eqnarray*}
%
% \begin{macrocode}
\def\pcol@bg@@c{%
{\pcol@bg@columnleft}%
{\@elt\pcol@bg@columntop}%
{\pcol@bg@columnwidth}%
{\pcol@bg@columnheight}}
\def\pcol@bg@@C{%
{\pcol@bg@columnleft}%
{}%
{\pcol@bg@columnwidth}%
{\pcol@bg@textheight}}
\def\pcol@bg@@g{%
{\pcol@bg@columnright}%
{\@elt\pcol@bg@columntop}%
{\pcol@bg@columnsep}%
{\pcol@bg@columnheight}}
\def\pcol@bg@@G{%
{\pcol@bg@columnright}%
{}%
{\pcol@bg@columnsep}%
{\pcol@bg@textheight}}
\def\pcol@bg@@s{%
{}%
{\pcol@bg@spanningtop}%
{\@elt\textwidth}%
{\pcol@bg@spanningheight}}
\def\pcol@bg@@t{%
{\pcol@bg@negative\pcol@bg@pageleft}%
{\pcol@bg@negative\pcol@bg@pagetop}%
{\pcol@bg@paperwidth}%
{\pcol@bg@pagetop}}
\def\pcol@bg@@b{%
{\pcol@bg@negative\pcol@bg@pageleft}%
{\pcol@bg@textheight}%
{\pcol@bg@paperwidth}%
{\pcol@bg@paperheight
\pcol@bg@negative{\pcol@bg@pagetop \pcol@bg@textheight}}}
\def\pcol@bg@@l{%
{\pcol@bg@negative\pcol@bg@pageleft}%
{}%
{\pcol@bg@pageleft}%
{\pcol@bg@textheight}}
\def\pcol@bg@@r{%
{\@elt\textwidth}%
{}%
{\pcol@bg@paperwidth
\pcol@bg@negative{\pcol@bg@pageleft \@elt\textwidth}}%
{\pcol@bg@textheight}}
\def\pcol@bg@@f{%
{}%
{}%
{\@elt\textwidth}%
{\pcol@bg@floatheight}}
\def\pcol@bg@@n{%
{}%
{\pcol@bg@textheight
\pcol@bg@negative{\pcol@bg@footnoteheight \@elt{\skip\footins}}}%
{\@elt\textwidth}%
{\pcol@bg@footnoteheight \@elt{\skip\footins}}}
\def\pcol@bg@@p{%
{}%
{\@elt\pcol@bg@preposttop}%
{\@elt\textwidth}%
{\pcol@bg@textheight \pcol@bg@negative{\@elt\pcol@bg@preposttop}}}
\let\pcol@bg@@S\pcol@bg@@s
\let\pcol@bg@@T\pcol@bg@@t
\let\pcol@bg@@B\pcol@bg@@b
\let\pcol@bg@@L\pcol@bg@@l
\let\pcol@bg@@R\pcol@bg@@r
\let\pcol@bg@@F\pcol@bg@@f
\let\pcol@bg@@N\pcol@bg@@n
\let\pcol@bg@@P\pcol@bg@@p
% \end{macrocode}
% \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}\end{macro}\end{macro}\end{macro}\end{macro}
%
%
%
% \KeepSpace{10}
% \section{Special Output Routines}
% \label{sec:imp-sout}
%
% \subsection{Dispatcher}
% \label{sec:imp-sout-disp}
%
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@op@cpush} was introduced for output request to push color
% stack but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@op@cpush} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@op@cpop} was introduced for output request to pop color
% stack but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@op@cpop} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@op@cset} was introduced for output request to set
% $\gamma_0^c$ but removed in v1.34}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@op@cpop} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
%
% \begin{macro}{\pcol@op@start}
% \begin{macro}{\pcol@op@switch}
% \begin{macro}{\pcol@op@flush}
% \begin{macro}{\pcol@op@clear}
% \begin{macro}{\pcol@op@end}
%
% The macro $|\pcol@op@|{\cdot}f$ where $f\in
% F=\{|start|,|switch|,|flush|,|clear|,|end|\}$ has
% our own \!\outputpenalty! code less than $-10000$ to invoke the
% corresponding macro $|\pcol@output@|{\cdot}f$. The code macros are given
% to \!\pcol@invokeoutput! as its argument by \!\pcol@zparacol! ($f=|start|$),
% \!\pcol@switchcol! ($f=|switch|$), \!\pcol@visitallcols! ($f=|switch|$),
% \!\pcol@com@flushpage! ($f=|flush|$), \!\pcol@com@clearpage!
% ($f=|clear|$), \!\pcol@flushclear! ($f=|switch|$), and \!\endparacol!
% ($f=|end|$) to set one of them into \!\outputpenalty!, so that the other
% user \!\pcol@specialoutput! examines which special function is invoked.
%
% \SpecialIndex{\pcol@output@start}
% \SpecialIndex{\pcol@output@switch}
% \SpecialIndex{\pcol@output@flush}
% \SpecialIndex{\pcol@output@clear}
% \SpecialIndex{\pcol@output@end}
%
% \begin{macrocode}
%% Special Output Routines: Dispatcher
\def\pcol@op@start{-10010}
\def\pcol@op@switch{-10011}
\def\pcol@op@flush{-10012}
\def\pcol@op@clear{-10013}
\def\pcol@op@end{-10014}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \changes{v1.24}{2013/07/27}
% {\cs{pcol@op@mcpush} was introduced for coloring specified in math
% mode but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@op@mcpush} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.24}{2013/07/27}
% {\cs{pcol@op@mcpush@pone} was introduced for coloring specified in
% math mode but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@op@mcpush@pone} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.24}{2013/07/27}
% {\cs{pcol@op@mcpop} was introduced for coloring specified in math
% mode but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@op@mcpop} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.24}{2013/07/27}
% {\cs{pcol@op@mcpop@pone} was introduced for coloring specified in
% math mode but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@op@mcpop@pone} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
%
% \begin{macro}{\pcol@specialoutput}
% \changes{v1.0}{2011/10/10}
% {Remove unnecessary \cs{pcol@latex@specialoutput}.}
% \changes{v1.2-2}{2013/05/11}
% {Add footnote logging if $\cs{outputpenalty}\EQ-10004$.}
% \changes{v1.22}{2013/06/30}
% {Add the invocation of \cs{pcol@output@}${\cdot}f$ for
% $f\in\{\string\texttt{cpush},\string\texttt{cpop},
% \string\texttt{cset}\}$}
% \changes{v1.24}{2013/07/27}
% {Add examination with $P_{\string\rm{push}}$ and $P_{\string\rm{pop}}$
% and invocation of \cs{pcol@output@mcpush} and
% \cs{pcol@output@mcpop}.}
% \changes{v1.34}{2018/05/07}
% {Remove examinations related to $f\in\{{\tt cpush},{\tt cpop},{\tt
% mcpush},{\tt mcpop}\}$.}
%
% The macro \!\pcol@specialoutput! is invoked solely in \!\pcol@output! to
% invoke our own or \LaTeX's special output routine. It examines if
% $P=\!\outputpenalty!\in\Set{\cs{pcol@op@}{\cdot}f}{f\in F}$ and then, if
% so, before invoking $|\pcol@output@|{\cdot}f$, we rebuild \!\@holdpg!
% removing \!\lastbox! and the last vertical skip as done in \LaTeX's
% \!\@specialoutput!. We also let $\!\outputpenalty!=-10000$\footnote{
%
% It can be any value larger than -10004.}
%
% so that \!\vsize! is correctly set to \!\@colroom! in the second half of
% \!\pcol@output! after this macro finishes.
%
% \hfuzz9pt
% Otherwise, i.e., if $P\notin\Set{\cs{pcol@op@}{\cdot}f}{f\in{}F}$,
% we simply invokes \LaTeX's \!\@specialoutput!\footnote{
%
% With footnote logging if $\cs{outputpenalty}=-10004$.}.
%
% \begin{macrocode}
\def\pcol@specialoutput{%
\ifnum\outputpenalty=\pcol@op@start\relax
\let\reserved@a\pcol@output@start
\else\ifnum\outputpenalty=\pcol@op@switch\relax
\let\reserved@a\pcol@output@switch
\else\ifnum\outputpenalty=\pcol@op@flush\relax
\let\reserved@a\pcol@output@flush
\else\ifnum\outputpenalty=\pcol@op@clear\relax
\let\reserved@a\pcol@output@clear
\else\ifnum\outputpenalty=\pcol@op@end\relax
\let\reserved@a\pcol@output@end
\else \let\reserved@a\@specialoutput
\fi\fi\fi\fi\fi
\ifnum\outputpenalty=-\@Miv\relax
\ifvoid\footins\else \pcol@Log\dummy{dummy}\footins \fi
\fi
\ifx\reserved@a\@specialoutput\else
\global\setbox\@holdpg\vbox{\unvbox\@holdpg \unvbox\@cclv
\setbox\@tempboxa\lastbox \unskip}%
\outputpenalty-\@M
\fi
\reserved@a}
% \end{macrocode}
% \end{macro}
%
%
%
% \subsection{Building Starting Page} \label{sec:imp-sout-start}
%
% \begin{macro}{\pcol@output@start}
% \changes{v1.0}{2011/10/10}
% {Change the order of operations.}
% \changes{v1.0}{2011/10/10}
% {Rename \cs{pcol@maxpage} as \cs{pcol@toppage}.}
% \changes{v1.0}{2011/10/10}
% {Add special operation in case of too small room for column-pages.}
% \changes{v1.2-2}{2013/05/11}
% {Add initialization of $\string\mathit{\string\Phi}$ and
% page-wise footnote output operations, and revise reflecting
% the redesign of page context.}
% \changes{v1.2-7}{2013/05/11}
% {Add \cs{pcol@outputtrue} to solve the \cs{output} request sneaking.}
% \changes{v1.2-7}{2013/05/11}
% {Include the effect of the separation of pre-environment bottom
% floats and columns in the starting page into the check of too large
% pre-envronment stuff.}
% \changes{v1.3-6}{2013/09/17}
% {Change the page builder for too tall pre-environment stuff from
% \cs{pcol@makenormalcol} to \cs{@makecol} because the page should be
% built by the ordinary mechanism.}
% \changes{v1.3-3}{2013/09/17}
% {Let $\cs{ifpcol@output}\EQ\string\mathit{false}$ temporarily before
% the invocation of \cs{@outputpage} for too tall pre-environment
% stuff because the page is considered as outside
% \string\texttt{paracol} envrionments.}
% \changes{v1.32-3}{2015/10/10}
% {Add depth clearing of imported deferred floats in case that some of
% them has \texttt{1sp}.}
% \changes{v1.35-4}{2018/12/31}
% {Add \cs{belowfootnoteskip} to $H_f$ being the space for the
% non-merged pre-environment footnotes.}
%
% The macro \!\pcol@output@start! is invoked solely from
% \!\pcol@specialoutput! to process the special \!\output! request made in
% \!\pcol@zparacol! and to build the {\em\Uidx\spage} from which parallel
% columns start possibly with the stuff preceding \beginparacol{}, or
% {\em\Uidx\preenv} in short. First, we turn
% $\CSIndex{ifpcol@output}=\true$ so that \!\output! requests for page
% breaks are processed by our own macros such as \!\pcol@makecol! hereafter.
% Then we let $p=\pbase={\ptop}=0$ and $\PP=\emptyset$ because we have
% nothing for $q<\ptop=0$. We also move \!\@deferlist! to \!\@dbldeferlist!
% and then let \!\@deferlist! be empty because all \cwise{} dererred floats
% become \pwise{}. In this float importation, as discussed in
% item-(\ref{item:ovv-float-@output@start}) of
% \secref{sec:imp-ovv-float}, we force all floats in the list have
% depth 0 to ensure no one has |1sp| to conform our own and old-fashioned
% \pwise{} float placement mechanism\footnote{
%
% Though having \texttt{1sp} is almost imposiible.}.
%
% We then and let $\df=\bot$ because we don't have any deferred footnotes.
%
% Next we caculate $H=H_r-(H_m+H_f+H_b)$ where $H_r=\!\@colroom!$; $H_m$ is
% the height-plus-depth of the main vertical list in \!\@holdpg!; $H_f$ is
% the sum of \!\skip!\!\footins!, the height-plus-depth of \!\footins! and
% \!\belowfootnoteskip!, if \!\footins! is not $\bot$ or 0 otherwise; and
% $H_b=\!\textfloatsep!$ if the \preenv{} has bottom floats or 0 otherwise.
% That is, $H$ is the room for each of \colpage{} in the \spage. Then we
% examine if $H<1.5\times\!\baselineskip!$ to mean \!\pcol@output! would
% force a page break with warning. If so, we assume we have a page break
% before \beginparacol{} to ship out \preenv{} to avoid the warning.
% Therefore, we invoke \LaTeX's \!\@makecol!\footnote{
%
% \Sloppy{2500}%
% We can be unaware of our customization for \sync{}ation in
% \CSIndex{pcol@combinefloats} because \CSIndex{pcol@textfloatsep} is
% made $\infty$ by \CSIndex{pcol@zparacol}.}
%
% giving it \!\@holdpg! through \!\@cclv! to build the ship-out image in
% \!\@outputbox!. Then the box is passed to \!\@outputbox! for which we
% temporarily let $\CSIndex{ifpcol@output}=\false$ because the page is
% assumed to be outside the \env{paracol} environment having just started.
%
% After that we invoke \!\pcol@startpage! to let it produce $\pp(\ptop)$ for
% the \spage{} $\ptop=0$ letting $\!\pcol@currpage!$ be empty so that the
% macro will not refer to it. The page $\pp(0)$ is usually empty but can
% have non-empty $\pp^i(0)$ with imported deferred floats which are now
% \pwise. Moreover, we can have two or more pages if deferred \pwise{}
% floats produce \fpage{s}. However, we can be unaware of these effects of
% floats because the resulting $\PP^+$ with them is correct of course.
%
% Then let $\!\topskip!=\!\pcol@topskip!$ being the value at \beginparacol,
% and $\cs{ifpcol@}\~|firstpage|={\false}$, because we have the \spage{}
% without \preenv{} and thus the first item of each column will be at its
% top.
%
% \CSINDEX{ifpcol@firstpage}
%
% \begin{macrocode}
%% Special Output Routines: Building First Page
\def\pcol@output@start{%
\global\pcol@outputtrue
\global\pcol@page\z@ \global\pcol@toppage\z@ \global\pcol@basepage\z@
\global\let\pcol@pages\@empty
\global\let\@dbldeferlist\@deferlist \global\let\@deferlist\@empty
{\def\@elt##1{\global\dp##1\z@}\@dbldeferlist}%
\setbox\z@\box\pcol@topfnotes
\@tempdima\@colroom
\advance\@tempdima-\ht\@holdpg \advance\@tempdima-\dp\@holdpg
\ifvoid\footins\else
\advance\@tempdima-\skip\footins
\advance\@tempdima-\ht\footins \advance\@tempdima-\dp\footins
\advance\@tempdima-\belowfootnoteskip
\fi
\ifx\@botlist\@empty\else \advance\@tempdima-\textfloatsep \fi
\ifdim\@tempdima<1.5\baselineskip
\setbox\@cclv\box\@holdpg \@makecol
\pcol@outputfalse \@outputpage \pcol@outputtrue
\global\let\pcol@currpage\@empty \pcol@startpage
\global\topskip\pcol@topskip \global\pcol@firstpagefalse
% \end{macrocode}
%
% Otherwise, i.e., if $H\geq1.5\times\!\baselineskip!$, we invoke
% \!\pcol@makenormalcol! to make the \preenv{} as the \spanning{} of the
% \spage. The macro is different from \!\@makecol! as follows; the height
% of resulting \!\@outputbox! is natural rather than \!\textheight!;
% \Mgfnote{}s is excluded if any; and the skip of \!\textfloatsep! is added
% below the bottom floats also if any,
%
% Then we let $h$ be the height-plus-depth of \!\@outputbox! being the
% \spanning{} and shrink \!\@colht! by $h$. Next if
% $h>\HB=\!\pcol@bg@preposttop!
% \in\{\!\pcol@bg@preposttop@left!,\~\!\pcol@bg@preposttop@right!\}$, being
% the bottom of the previous \env{paracol} environment (having right
% \parapag{}e) or 0 if the curret page does not have it, to mean we have
% ordinary single-columned stuff in \preenv{}, we paint its \bground{} by
% \!\pcol@bg@paintbox! temporarily letting $\!\pcol@bg@textheight!=h$ so
% that $y_0=\HB$ and $y_1=h$ for $\bgr_{\{p,P\}}$. This \bgpaint{} is not
% only for $\pp^b(0)$ which we acquire from from \!\@freelist! by \!\@next!
% and let have the \spanning, but also for \!\pcol@rightpage! if $\CL<\C$ to
% mean \parapag{}ing for which we temporarily increment \!\c@page! by one if
% \npaired.
%
% We also let $\pp^h(0)$ be the shrunk \!\@colht!, and $\pp^t(0)$ be
% \!\topskip! if $h=0$ assuming that the page does
% not have any \spanning{}\footnote{
%
% Checking the emptiness by \cs{pcol@ifempty} does not work well for the
% very first page of a document because it has a \cs{write} as the very
% first item.}
%
% to typeset \colpage{}s from the top of the page, or otherwise be 0
% together with \!\topskip! to inhibit the ordinary \!\topskip! insertion.
%
% As for $\pp^m(0)$, we define it as follows, referring to
% $\mpbout=\!\pcol@mparbottom@out!=\{\mpb_L^l,\mpb_L^r,\mpb_R^l,\mpb_R^r\}$,
% where $\mpb_X^x$ has exactly one element $\mpar(h,t)$ which may be the
% position of last marginal notes in the last \env{paracol} environment in
% the page we are working on, or $\mpb_X^x=\{\mpar(0,0)\}$ if such marginal
% note or the environment itself does not exist in the page. On the other
% hand, $B=\!\@mparbottom!$ may have non-zero for the bottom edge of the
% last marginal note in \preenv{} including the last \env{paracol}
% environment if any. Therefore, what we need to do is to let
% $\mpb_L^x=\{\mpar(0,B)\}$ to reflect the marginal node whose bottom is at
% $B$ and which can be different from what $\mpb_L^x$ had, where $x$ is the
% target margin in the \preenv{} determined by \CSIndex{if@mparswitch}, the
% parity of $\page(0)$ and \CSIndex{if@reversemargin}.
%
% The replacement is done by \!\pcol@do@mpbout! which invokes
% $\!\pcol@do@mpbout@whole!\arg{m_L^l}\~\arg{m_L^r}\arg{\mpb_R^l}\arg{\mpb_R^r}$
% where $m_L^x\in\{M_L^x,\,\!\pcol@do@mpbout@elem!\arg{M_L^x}\}$ whose choice
% is made according that $x\in\{l,r\}$ is the target margin (latter) or not
% (former). Therefore, prior to the invocation of \!\pcol@do@mpbout!, we
% \!\def!fine \!\pcol@do@mpbout@whole! so that it \!\xdef!ines
% $\mpbout=\!\pcol@mparbottom@out!$ with its four arguments, and
% \!\pcol@do@mpbout@elem! to let it be expanded to
% $\!\@elt!\Arg{0}\Arg{B}=\mpar(0,B)$. After that, we also invoke
% \!\pcol@bias@mpbout! giving it $-h$ to replace $\mpar(t,b)$ being the sole
% element of each $\mpb_{\{L,R\}}^{\{l,r\}}$ in the resulting $\mpbout$ with
% $\mpar(t-h,b-h)$ to have what we give to $\pp^m(0)$. This replacement
% transforms the coordinates for text area to that for columns, and makes it
% possible for the first marginal note in each margin in the \env{paracol}
% environment we now start to exploit the space for \preenv{} even if it is
% tall extraordinarily.
%
% Then we let $\pp(0)$ have $\pp^i(0)$ and $\pp^m(0)$ shown above, and
% $\pp^p(0)=\!\c@page!$, $\pp^f(0)=\bot$ and $\pp^s(0)=\emptyset$ by
% \!\pcol@defcurrpage!, and let $\CSIndex{ifpcol@firstpage}=\true$ because
% $\pp^b(0)$ has \preenv.
%
% \changes{v1.3-6}{2013/09/17}
% {Delete the argument of \cs{pcol@makenormalcol} because now it is
% not used too tall pre-environment stuff.}
% \changes{v1.3-3}{2013/09/17}
% {Add background painting of pre-environment stuff.}
% \changes{v1.3-4}{2013/09/17}
% {Add initialization of $\pi^m(0)$.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\else
\pcol@makenormalcol
\@tempdima\ht\@outputbox \advance\@tempdima\dp\@outputbox
\global\advance\@colht-\@tempdima
\def\reserved@a{%
\ifdim\pcol@bg@preposttop=\@tempdima\else
\edef\pcol@bg@textheight{\@elt{\number\@tempdima sp}}%
\pcol@bg@paintbox{Pp}%
\fi}
\ifnum\pcol@ncolleft<\pcol@ncol
\global\setbox\pcol@rightpage\vbox{%
\ifpcol@paired\else \advance\c@page\@ne \fi
\let\pcol@bg@preposttop\pcol@bg@preposttop@right
\reserved@a \unvbox\pcol@rightpage}%
\fi
\pcol@Fb
\@next\@currbox\@freelist{\global\setbox\@currbox\vbox{%
\let\pcol@bg@preposttop\pcol@bg@preposttop@left
\reserved@a \unvbox\@outputbox}}\pcol@ovf
\pcol@Fe{output@start(preenv)}%
\global\dimen\@currbox\@colht
\ifdim\@tempdima=\z@ \@tempskipa\topskip \else \@tempskipa\z@ \fi
\global\skip\@currbox\@tempskipa \global\topskip\@tempskipa
\def\pcol@do@mpbout@whole##1##2##3##4{%
\xdef\pcol@mparbottom@out{{##1}{##2}{##3}{##4}}}%
\def\pcol@do@mpbout@elem\@elt##1##2{\@elt{0}{\number\@mparbottom}}%
\pcol@do@mpbout
\pcol@bias@mpbout{-\@tempdima}%
\pcol@defcurrpage{\number\c@page}\@currbox\voidb@x{}{\pcol@mparbottom@out}%
\global\pcol@firstpagetrue
\fi
% \end{macrocode}
%
% Then regardless of $H$, we do the followings for all columns $c\In0\C$ to
% build $\cc_c$, after initializing \!\@colroom! to be \!\@colht!, and
% invoking \!\pcol@floatplacement! to reinitialize the parameters of
% \cwise{} float placement.
%
% First, if we have let $\!\topskip!=0$ with the \preenv,
% we let $\cc_c(\vb^b)$ have an invisible \!\hrule! whose
% height and depth are 0 as the very first vertical item of the \colpage.
% When we visit the column $c$ for the first time afterward, we will
% \!\unvbox! the box to let \TeX's page builder have $\!\topskip!=0$ and the
% invisible rule. Then the first vertical item of the \colpage{} is added
% but it is recognized as non-first by \TeX's page builder and thus it
% inserts \!\baselineskip! referring to \!\prevdepth! as the depth of the
% last item. The important issue is that the \!\prevdepth! to be referred
% is assured having its value at \beginparacol, which is usually the depth
% of the last item of \spanning, by the following mechanism: (1)
% \!\pcol@invokeoutput! invoked in \!\pcol@zparacol! saves \!\prevdepth! in
% \!\pcol@prevdepth! before the \!\output! request for
% \!\pcol@output@start!; (2) \!\pcol@prevdepth! is saved in $\cc_c(\pd)$ by
% \!\pcol@setcurrcolnf! invoked from \!\pcol@output@start! as discussed
% afterward; (3) when the column $c$ is visited for the first time, the
% special output routine \!\pcol@output@start! itself ($c=0$) or
% \!\pcol@output@switch! ($c>0$) restores \!\pcol@prevdepth! from
% $\cc_c(\pd)$ by \!\pcol@getcurrcol!; (4) \!\pcol@invokeoutput! which made
% the \!\output! request for (3) lets \!\prevdepth! have the value of
% \!\pcol@prevdepth! after the request. Therefore, the baseline progress
% from the last line of the \spanning{} to the first line of each
% \colpage{} should be very natural as we see in the third and fourth lines
% of \secref{sec:man-close} of Part \ref{part:man}.
%
% Then we invoke \!\pcol@setcurrcolnf! to save the following values for
% $\cc_c(e)$ ($e\neq\vb$); $\cc_c(\ft)=\!\voidb@x!$ because $c$ does not
% have \Mcfnote{}s so far; $\cc_c(\pd)=\!\prevdepth!$ as discussed above;
% $\cc_c(\tl)=\cc_c(\ml)=\cc_c(\bl)=\emptyset$ because
% \!\pcol@makenormalcol! and \!\@combinefloats! invoked from it emptied
% them; $\cc_c(\dl)=\emptyset$ as discussed above;
% $\cc_c(\tn)=\!\c@topnumber!$, $\cc_c(\bn)=\!\c@botnumber!$ and
% $\cc_c(\tn)=\!\c@totalnumber!$ as initialized by \!\@floatplacement!
% invoked from \!\pcol@floatplacement!;
% $\cc_c(\tr)=\!\topfraction!\times\!\@colht!$ and
% $\cc_c(\br)=\!\bottomfraction!\times\!\@colht!$ as initialized by
% \!\@floatplacement!; $\cc_c(\sw)$ is defined by \CSIndex{if@nobreak} and
% \cs{if@after}\~|indent|
%
% \expandafter\SpecialIndex\csname if@afterindent\endcsname
%
% at the time of \beginparacol; and
% $\cc_c(\ep)=\!\everypar!$ at the time of \beginparacol. We also let
% $\cc_c(\vb^p)=0$ because $p=0$ and $\cc_c(\vb^r)=\!\@colroom!$ defined
% above. In addition, we let $\S_c=\emptyset$ because we don't have any
% \colpage{} having been completed.
%
% \SpecialArrayIndex{c}{\pcol@columncolor}
% \SpecialArrayIndex{c}{\pcol@columncolor@box}
% We also examine if $\Celtshadow^c=\cs{pcol@columncolor}\cdot c$ is defined
% and, if so, acquire an \!\insert! from \!\@freelist! to let
% $\Celt^c=\cs{pcol@columncolor@box}\cdot c$ have the coloring \!\special!
% for the color defined in $\Celtshadow^c$ by invoking \!\pcol@set@color!
% being the origina \!\set@color! with nullification of \!\aftergroup!.
% Otherwise, we let $\Celt^c=\bot$ .
%
% \changes{v1.0}{2011/10/10}
% {Add clearing of $S_c$.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
% \changes{v1.34}{2018/05/07}
% {Add initialization of
% $\gamma_0^c\EQ\cs{pcol@columncolor@box}\cdot c$.}
%
% \begin{macrocode}
\global\@colroom\@colht \pcol@floatplacement
\pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
\pcol@Fb
\@next\@currbox\@freelist{\global\setbox\@currbox\vbox{%
\ifdim\topskip=\z@ \hrule\@height\z@\@width\z@ \fi}}\pcol@ovf
\pcol@Fe{output@start(col)}%
\pcol@setcurrcolnf
\global\count\@currbox\z@
\global\dimen\@currbox\@colroom
\expandafter\gdef\csname pcol@shipped\number\pcol@currcol\endcsname{}%
\pcol@ifccdefined
{\@next\@currbox\@freelist{\global\setbox\@currbox\vbox{%
\def\current@color{\pcol@ccuse{}}\let\aftergroup\@gobble
\pcol@set@color}}\pcol@ovf}%
{\def\@currbox{\voidb@x}}%
\pcol@ccxdef{\@currbox}%
\advance\pcol@currcol\@ne}%
% \end{macrocode}
%
% \changes{v1.2-1}{2013/05/11}
% {Add emptying \cs{pcol@colorstack} and the invocation of
% \cs{pcol@savecolorstack} at the beginnig of the first
% column-page to be built.}
% \changes{v1.2-2}{2013/05/11}
% {Add insertion of \cs{footins} having footnotes to be merged if it
% is not void.}
% \changes{v1.22}{2013/06/30}
% {Move emptying \cs{pcol@colorstack} to \cs{pcol@zparacol}.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
% \changes{v1.35-1}{2018/12/31}
% {Add \cs{interlinepenalty} insertion for the first column to avoid
% vertical overfull due to the first item taller than the column
% room.}
%
% Finally, we let $c=\!\pcol@currcol!=0$ for the first column, and regain the
% parameters in $\cc_0$ by \!\pcol@getcurrcol!. Then before putting
% $\cc_0(\vb^b)$ to the main vertical list by \!\unvbox! returning
% $\cc_0(\vb)$ to \!\@freelist! by \!\@cons! because it has become useless
% so far, we save the \colorctext{} just with $\Celt^c$ into $\csts$ by
% \!\pcol@savecolorstack! because $\CST$ is emptied by \!\pcol@zparacol!.
% Then we \!\insert! \!\footins! through itself to the main vertical list if
% it is not $\bot$ and thus has footnotes to be \mgfnote{}. This
% \!\insert!ion is different from other footnote \!\insert!ion because
% \!\footins! is not \!\unvbox!ed but is put as a whole and is followed by
% \!\penalty!\!\interlinepenalty!, so that footnotes will not be broken by
% \TeX's page builder to prevent the reconnection of a broken footnote with
% innapropriate glue discarding, which we will discuss in
% \secref{sec:imp-fnote}. We also add a penalty 10000 or
% \!\interlinepenalty! according to $\CSIndex{if@nobreak}=\true$ or not to
% allow the first column to start from a new page when its first item is
% taller than the room in the \spage{}.
%
% \begin{macrocode}
\global\pcol@currcol\z@
\pcol@getcurrcol
\pcol@savecolorstack
\pcol@Fb
\@cons\@freelist\@currbox \unvbox\@currbox
\pcol@Fe{output@start(col)}%
\ifvoid\footins\else
\pcol@Log\pcol@output@start{insert}\footins
\insert\footins{\box\footins\penalty\interlinepenalty}%
\fi
\if@nobreak \nobreak \else \addpenalty\interlinepenalty \fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@makenormalcol}
% \changes{v1.2-2}{2013/05/11}
% {Replace the building operation of \cs{@outputbox} with footnotes
% with the invocation of \cs{pcol@combinefootins} and add the
% examination of \cs{ifpcol@mgfnote}.}
% \changes{v1.2-7}{2013/05/11}
% {Turn \cs{ifpcol@lastpage} be $\string\true$ temporarily for
% \cs{pcol@combinefloats} to separate bottom floats in
% pre-environment stuff and the multi-column stuff in
% \string\texttt{paracol} environment by \cs{textfloatsep}.}
% \changes{v1.3-6}{2013/09/17}
% {Completely redesigined to use \cs{@makecol} if pre-environment
% stuff has bottom floats.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% The macro \!\pcol@makenormalcol! is invoked solely from
% \!\pcol@output@start! to let \!\@output~box! have the \preenv{} as
% \spanning{} of the \spage. The operations this macro performs are very
% similar to those of \!\@makecol!, which in fact is used in this macro
% itself, but has the following differences.
%
% \begin{enumerate}\def\labelenumi{(\arabic{enumi})}
% \item
% If $\CSIndex{ifpcol@mgfnote}=\true$, we exclude footnotes in \!\footins!
% from \!\@outputbox!, because they are \mgfnote{} with \Scfnote{}s given in
% columns, by saving it into \!\@tempboxa! during the building process and
% restoring it from the box register.
%
% \item
% If \preenv{} does not have bottom floats, we build \!\@outputbox! by
% ourselves without relying on \!\@makecol! because the skips put into the
% bottom (or near it) by the macro is harmful to making \preenv{} and
% parallel columns naturally connected. Therfore, we move
% \!\@holdpg! to \!\@outputbox! adding \!\footins! to its tail if any by
% \!\pcol@combinefootins!, and then combine top floats if any by
% \!\pcol@combinefloats!\footnote{
%
% Since we do not have bottom floats, the order of materials in the
% resulting \!\@outputbox! being top floats, main text and footnotes should
% be consistent with other pages with any \LaTeX{} including p\LaTeX.}.
%
% In addition, we clear \!\@midlist! and retuns its contents to
% \!\@freelist! as \!\@makecol! does.
%
% \item
% If \preenv{} has bottom floats, on the other hand, we use \!\@makecol! to
% build \preenv{} in \!\@outputbox! moving \!\@holdpg! into \!\box!|255|
% prior to the invocation\footnote{
%
% Therefore the order of footnotes and bottom floats is consistent with
% other pages and columns, i.e., footnote-first in the native \LaTeX{} while
% float-first in p\LaTeX{}, for example.}.
%
% Also before invocation in addition, we temporarily let
% $\CSIndex{ifpcol@lastpage}=\true$ to let
% $\!\@combinefloats!=\!\pcol@combinefloats!$ used in \!\@makecol! put a
% vertical skip of \!\textfloatsep! below the bottom floats so that the
% floats are well seperated from the top of multi-column stuff in the
% \spage. We also nullify \!\@textbottom! by making it \!\let!-equal to
% \!\relax! because it is unncessary to put an infinitely stretchable skip
% at the bottom\footnote{
%
% Even if unharmful.},
%
% and let $\!\vbadness!=10000$ to avoid an inevitable underfull message
% because \!\@makecol! lets \!\@outputbox! as tall as \!\textheight!.
%
% \item
% In both cases but especially that with bottom floats, resulting
% \!\@outputbox! is decapsulated by \!\unvbox! to make its height {\em
% natural}.
% \end{enumerate}
%
% Note that the special function for \sync{}ed \colpage{} in
% \!\pcol@combinefloats! used directly or indirectly in this macro, on the
% other hand, is not active in the invocation because \!\pcol@zparacol!
% initialized $\!\pcol@textfloatsep!=\infty$ to mean we have no \sync{}ation
% points. Also
% note that bottom floats and non-\mgfnote{} footnotes are put in
% \!\@outputbox! and thus they will not appear at the bottom of the page
% but above the \colpage{}s in the page\footnote{
%
% We could put them at the bottom by keeping them somewhere and insert them
% in \!\pcol@outputcolumns!, but it will cause another problem that the
% numbers of the figures and footnotes are smaller than those in \colpage{}s
% which are above them.}.
%
% \begin{macrocode}
\def\pcol@makenormalcol{%
\ifpcol@mgfnote \setbox\@tempboxa\box\footins \fi
\begingroup
\ifx\@botlist\@empty
\ifvoid\footins \setbox\@outputbox\box\@holdpg
\else \pcol@combinefootins\@holdpg\footins
\fi
\pcol@Fb
\let\@elt\relax \xdef\@freelist{\@freelist\@midlist}%
\pcol@Fe{makenormalcol}%
\global\let\@midlist\@empty
\pcol@combinefloats
\else
\pcol@lastpagetrue
\setbox\@cclv\box\@holdpg \let\@textbottom\relax \vbadness\@M
\@makecol
\fi
\global\setbox\@outputbox\vbox{\unvbox\@outputbox}%
\endgroup
\ifpcol@mgfnote \setbox\footins\box\@tempboxa \fi}
% \end{macrocode}
% \end{macro}
%
%
%
% \subsection{Column-Switching}
% \label{sec:imp-sout-switch}
%
% \begin{macro}{\pcol@output@switch}
% \changes{v1.2-1}{2013/05/11}
% {Add \cs{pcol@clearcst@unvbox} to add coloring \cs{special}s at the
% top and bottom of the column-page to be saved.}
% \changes{v1.3-1}{2013/09/17}
% {Add the capture of a spanning text when it is closed.}
% \changes{v1.3-3}{2013/09/17}
% {Add $\pi^s(p)\EQ\cs{pcol@sptextlist}$ to the argument of
% \cs{pcol@defcurrpage}.}
% \changes{v1.3-4}{2013/09/17}
% {Add $\pi^m(p)\EQ\cs{pcol@mparbottom}$ to the argument of
% \cs{pcol@defcurrpage}.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
% \changes{v1.33-2}{2016/11/19}
% {Let \cs{dimen@} have the height of \cs{pcol@prespan} if it is not
% $\bot$, or 0 if $\bot$ for the sake of clarity.}
%
% The macro \!\pcol@output@switch! is invoked from
% \!\pcol@specialoutput! to process the special \!\output! request made in
% \!\pcol@switchcol!, \!\pcol@visitallcols! and \!\pcol@flushclear!, for a
% \cswitch{} from $c=\!\pcol@currcol!$ to $d=\!\pcol@nextcol!$ which can be
% $c$. The macro is also invoked from \!\pcol@makeflushedpage! to \sync{}e
% and to flush all \ccolpage{}s but staying in $c$.
%
% First, we examine if the \cswitch{} is to close a \mctext, i.e.,
% $\CSIndex{ifpcol@sptext}={\true}$ and $c=0$, and if so we do the
% following; let $h_p$ be the height of \!\pcol@prespan! having \prespan{}
% if it is not $\bot$, or 0 if $\bot$ to mean we have had a page break in
% the \mctext; add $h_p$ to \!\@colroom! which we temporarily shrank when
% the \mctext{} starts; add an elemnent $\spt(H,h)$ to the tail of
% $\pp^s(\ptop)=\!\pcol@sptextlist!$ by \!\pcol@getcurrpage! and
% \!\pcol@defcurrpage!, where $H$ is $h_p$ plus the total height of top
% floats measured by \!\pcol@addflhd!, and $h$ is the height-plus-depth of
% \!\@holdpg! having (a part of) \mctext, represented in the form of
% integers and thus expanded with \!\number!; shift \!\@holdpg! left by
% \!\pcol@shiftspanning! if the column-0 is not the leftmost due to \cswap;
% and then put \prespan{} and (maybe shifted) \!\@holdpg! into \!\@holdpg!
% itself so as to let \!\@holdpg! have everything in the \colpage{} 0 as
% usual.
%
% Note that it can be $\!\pcol@prespan!=\bot$ if \mctext{} had a page break
% (or multiple ones) in it as shown above. This empty \prespan{}, however,
% does not always means that we have no top floats because the page break in
% the \mctext{} can produce a \colpage{} with top floats which are deferred
% from the previous page(s), or though unlikely the \mctext{} itself has
% float environments. Therefore, the measurement of the total height of top
% floats are always necessary. Also note that we perform these operations
% at the first \cswitch{} for \cscan{}ing from $c=0$ with
% $\CSIndex{ifpcol@sptext}=\true$, i.e., prior to the \sync{}ation itself
% which takes place afterword, as explained shortly.
%
% Then regardless of the operations above, we acquire an \!\insert! from
% \!\@freelist! by \!\@next! for $\cc_c(\vb)$ to store the \ccolpage{} in
% (maybe modified) \!\@holdpg! by \!\pcol@clearcst@unvbox! to add uncoloring
% \!\special!s to rewind the \colorstack{} $\CST^c$ at the bottom and
% possibly coloring ones to establish that saved in $\csts$ at the top as
% the \colorctext{} for the \colpage{} when it has the first item.
%
% Then if $\!\footins!\neq\bot$, we perform one of the followings.
%
% \begin{itemize}
% \item
% If \Scfnote{} typesetting is in effect and $p=\ptop$, we save \!\footins!
% into $\pp^f(p)$ by the sequence of \!\pcol@getcurrpinfo! to get $\pp(p)$,
% \!\pcol@savefootins! to move it in $\pp^f(p)$, and \!\pcol@defcurrpage! to
% update $\pp(p)$ with $\pp^f(p)$.
%
% \item
% If \Scfnote{} typesetting is in effect but $p<\ptop$, we simply discard
% the contents of \!\footins! by making it $\bot$, because \!\footins!
% should have $\pp^f(p)$ which has been already fixed.
%
% \item
% If \Mcfnote{} typesettinng is in effect, by \!\pcol@savefootins! we save
% \!\footins! into \!\pcol@currfoot!, which should be $\bot$ in other cases,
% so that it will be saved into $\cc_c(\ft)$ by \!\pcol@setcurrcol!
% afterward.
% \end{itemize}
% %
% Then if $c=0$, we invoke \!\pcol@setpageno! to reflect the jump of
% \!\c@page! made in the building process of the \colpage{} to $\pp(q)$ for
% all $q\in[p,\ptop]$. After that, we save $c$'s \cctext{} into $\cc_c$ by
% \!\pcol@setcurrcol! and let $\cc_c(\vb^p)=p$ and
% $\cc_c(\vb^r)=\!\@colroom!$.
%
% \begin{macrocode}
%% Special Output Routines: Column-Switching
\def\pcol@output@switch{%
\ifpcol@sptext\ifnum\pcol@currcol=\z@
\ifvoid\pcol@prespan \dimen@\z@ \else \dimen@\ht\pcol@prespan \fi
\global\advance\@colroom\dimen@
\pcol@addflhd\@toplist\pcol@textfloatsep
\pcol@getcurrpinfo\@tempcnta\@tempdima\@tempskipa
\@tempdimb\ht\@holdpg \advance\@tempdimb\dp\@holdpg
\@cons\pcol@sptextlist{{\number\dimen@}{\number\@tempdimb}}%
\pcol@defcurrpage{\number\@tempcnta}\pcol@spanning\pcol@footins
{\pcol@sptextlist}{\pcol@mparbottom}%
\pcol@shiftspanning\@holdpg
\setbox\@holdpg\vbox{\unvbox\pcol@prespan \unvbox\@holdpg}%
\fi\fi
\pcol@Fb
\@next\@currbox\@freelist{\global\setbox\@currbox\vbox{
\pcol@clearcst@unvbox\@holdpg}}\pcol@ovf
\pcol@Fe{output@switch}%
\def\pcol@currfoot{\voidb@x}%
\ifvoid\footins\else
\ifpcol@scfnote
\ifnum\pcol@page=\pcol@toppage
\pcol@getcurrpinfo\@tempcnta\@tempdima\@tempskipa
\pcol@Log\pcol@output@switch{save}\footins
\pcol@Fb
\pcol@savefootins\pcol@footins
\pcol@Fe{output@switch(pagefn)}%
\pcol@defcurrpage{\number\@tempcnta}\pcol@spanning\pcol@footins
{\pcol@sptextlist}{\pcol@mparbottom}%
\else
\pcol@Log\pcol@output@switch{discard}\footins
\setbox\@tempboxa\box\footins
\fi
\else
\pcol@Log\pcol@output@switch{save}\footins
\pcol@Fb
\pcol@savefootins\pcol@currfoot
\pcol@Fe{output@switch(colfn)}%
\fi
\fi
\ifnum\pcol@currcol=\z@ \pcol@setpageno \fi
\pcol@setcurrcol
\global\count\@currbox\pcol@page
\global\dimen\@currbox\@colroom
% \end{macrocode}
%
% Next, we examine if $\CSIndex{ifpcol@sptext}=\true$ and $c=0$ again, and
% if so we {\em broadcast} \CSIndex{if@nobreak} and
% \CSIndex{if@afterindent}, or in other words $\cc_c(\sw)$, and tokens in
% $\!\everypar!=\cc_c(\ep)$, to pretend all columns follow the \mctext.
% That is, for each column $e$, we restore its \cctext{} from $\cc_e$ by
% \!\pcol@getcurrcol!, let \CSIndex{if@nobreak} and \CSIndex{if@afterindent}
% have the values for $c$ ($\in\{0,\C{-}1\}$) and $\!\everypar!=\cc_c(\ep)$,
% and then save the context to $\cc_e$ by \!\pcol@setcurrcol! so that
% $\cc_e(\sw)=\cc_c(\sw)$ and $\cc_e(\ep)=\cc_c(\ep)$. After that, we
% \!\global!ly turn $\CSIndex{ifpcol@sptext}=\false$ to give it the default
% state.
%
% Note that this broadcast is essential when the \mctext{} has sectioning
% commands to have consistent settings of the page break inhibition, the
% skip above the another sectioning command following them, and the
% indentation of the first paragraph, for all columns. On the other hand,
% broadcasting of \!\everypar! is natural even when it does not have
% sectioning commands because all columns may be considered following the
% \mctext. Also note that, as mentioned in the explanation of the first
% examination at the beginning of this macro, we perform these operations at
% the first \cswitch{} for \cscan{}ning from $c=0$ with
% $\CSIndex{ifpcol@sptext}=\true$ prior to the \sync{ation} following the
% \mctext. This means, if $\CSIndex{if@nobreak}={\true}$,
% $\!\penalty!=10000$ is inserted at the top and bottom end of the space for
% \mctext{} in the columns such that $c\neq0$, the former by this \cscan{}
% and the latter by the \cswitch{} to $c$ made after the synchronization.
% Therefore, if our \sync{ation} mechanism and \TeX's page builder once
% agreed both end can be in a page, both end will not chosen as page
% break points\footnote{
%
% As for $c=0$, its top end of \mctext{} is a feasible break point to make
% the penalty insertion asymmetric. Therefore, we need to reinvestigate if
% the condition of the broadcast is really appropriate, and, if
% inappropriate, have to go back to the old implementation in which
% \cs{ifpcol@sync} is included in the condition. Otherwise, if proved
% appropriate, we will have to consider to make the penalty insertion
% symmetric by adding \cs{nobreak} at the top of \mctext{} in $c=0$.}.
%
% \changes{v1.0}{2011/10/10}
% {Restrict the broadcast of \cs{if@nobreak} and \cs{everypar} only
% when a column-switching is accompanied with spanning text.}
% \changes{v1.2-7}{2013/05/11}
% {Modify broadcasting of $\kappa_c(\sigma)$ so that \cs{@afterindent}
% is broadcasted with \cs{@nobreak}.}
% \changes{v1.3-1}{2013/09/17}
% {Rename \cs{ifpcol@mctext} as \cs{ifpcol@sptext}.}
% \changes{v1.3-6}{2013/09/17}
% {Modify the condition of broadcasting $\kappa_0(\sigma)$ and
% $\kappa_0(\varepsilon)$ accompanied with \cs{ifpcol@sptext} from
% \cs{ifpcol@sync} to $c\EQ0$ so that the broadcast is made in the
% first column-switching in column-scanning.}
%
% \begin{macrocode}
\let\reserved@a\@nobreakfalse \let\reserved@b\@afterindentfalse
\ifpcol@sptext\ifnum\pcol@currcol=\z@
\if@nobreak \let\reserved@a\@nobreaktrue \fi
\if@afterindent \let\reserved@b\@afterindenttrue \fi
\@temptokena\everypar
\pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
\pcol@getcurrcol \reserved@a \reserved@b \everypar\@temptokena
\pcol@setcurrcol
\advance\pcol@currcol\@ne}%
\global\pcol@sptextfalse
\fi\fi
% \end{macrocode}
%
% \changes{v1.2-2}{2013/05/11}
% {Add the case
% $\cs{ifpcol@clear}\EQ\cs{ifpcol@sync}\EQ\string\mathit{true}$ for
% the invocation of \cs{pcol@restartcolumn} for pre-flushing column
% height check.}
% \changes{v1.3-6}{2013/09/17}
% {Modify the code structure to let
% $\cs{if@tempswa}\EQ\string\mathit{true}$ according to the
% modification of the broadcast of $\kappa_0(\sigma)$ and
% $\kappa_0(\varepsilon)$.}
%
% Finally we invoke \!\pcol@sync! for the \sync{}ation if
% \CSIndex{ifpcol@sync} or \CSIndex{ifpcol@clear} is $\true$, and then
% \!\pcol@restartcolumn! to restart the \ccolpage{} $d$ if
% $\CSIndex{ifpcol@clear}={}\false$ to mean ordinary (but possibly
% \sync{}ed) \cswitch{} or $\CSIndex{ifpcol@clear}={}\true$ but
% $\CSIndex{ifpcol@sync}={}\true$ too to mean pre-flushing column height
% check, before finishing \!\output! routine letting
% $\CSIndex{ifpcol@sync}=\false$ for next \cswitch.
%
% \begin{macrocode}
\@tempswafalse \ifpcol@sync \@tempswatrue \fi \ifpcol@clear \@tempswatrue \fi
\if@tempswa \pcol@sync \fi
\@tempswatrue
\ifpcol@clear \ifpcol@sync\else \@tempswafalse \fi\fi
\if@tempswa \pcol@restartcolumn \fi
\global\pcol@syncfalse}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@shiftspanning}
% \changes{v1.3-1}{2013/09/17}
% {Introduced to shift a spanning text to left if the column-0 is not
% leftmost due to column-swapping.}
%
% The macro $\!\pcol@shiftspanning!\arg{b}$ is used in \!\pcol@makecol! and
% \!\pcol@output@switch! to let box register $b$ have itself but shifted
% left by $\WT-w_0=\!\textwidth!-\!\columnwidth!$ so that the left edge of
% its contents \mctext{} is aligned to the left edge of the leftmost column
% being different from column-0 due to \cswap, i.e., if
% $\CSIndex{ifpcol@swapcolumn}=\true$ and $\!\c@page!\bmod2=0$. Note that
% \!\c@page! is {\em not} obtained from $\pp^p(p)$ by the invokers but have
% the value when the \!\output! request is made to let invokers work, and
% thus have the correct value even when a jump occurs prior to the request.
%
% \begin{macrocode}
\def\pcol@shiftspanning#1{%
\ifpcol@swapcolumn\ifodd\c@page\else
\setbox#1\vbox{\@tempdima\textwidth \advance\@tempdima-\columnwidth
\moveleft\@tempdima\box#1}
\fi\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@restartcolumn}
% \changes{v1.0}{2011/10/10}
% {Add \cs{pcol@getcurrfoot} to restore parameters of $\kappa_c(\tau)$
% into \cs{footins}.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% The macro \!\pcol@restartcolumn! is invoked from \!\pcol@output@switch! or
% \!\pcol@freshpage! to restart the \ccolpage{} $d=\!\pcol@nextcol!$ which
% becomes $c=\!\pcol@currcol!$ by the very first assignment in this macro.
% Then we restore the \cctext{} in $\cc_c$ by \!\pcol@getcurrcol! and let
% $p=\cc_c(\vb^p)$ and $\!\@colroom!=\cc_c(\vb^r)$ before returning
% $\cc_c(\vb)$ to \!\@freelist! by \!\@cons! because it has become useless
% so far. We also restore the \pctext{} of $p$ by \!\pcol@getcurrpage!.
%
% \begin{macrocode}
\def\pcol@restartcolumn{%
\global\pcol@currcol\pcol@nextcol
\pcol@getcurrcol
\global\pcol@page\count\@currbox
\global\@colroom\dimen\@currbox
\pcol@Fb
\@cons\@freelist\@currbox
\pcol@Fe{restartcolumn(col)}%
\pcol@getcurrpage
% \end{macrocode}
%
% \changes{v1.2-2}{2013/05/11}
% {Redesign the footnote insertion mechanism to cope with
% page-wise footnotes.}
% \changes{v1.2-1}{2013/05/11}
% {Add \cs{pcol@restorecst@restart} to return main vertical list
% with coloring operations.}
% \changes{v1.3-1}{2013/09/17}
% {Rename \cs{pcol@restorecst@restart} as \cs{pcol@putbackmvl}.}
% \changes{v1.3-6}{2013/09/17}
% {Change the code structure to move the insertion of page break
% penalty for ordinary column-wise footnotes from below the main
% text to below the footnotes.}
% \changes{v1.3-3}{2013/09/17}
% {Add \cs{@colht} and \cs{@tempdimb} as the first and third argument
% of \cs{pcol@shrinkcolbyfn}.}
%
% Then we perform footnote \!\insert!ion as follows.
%
% \begin{enumerate}\def\labelenumi{(\arabic{enumi})}
% \item\label{item:scftop}
% If footnote typesetting is \scfnote{} and $p=\ptop$, we do the followings.
%
% \begin{enumerate}\def\labelenumii{(\alph{enumii})}
% \item\label{item:scftop-main}
% Put the contents of $\cc_c(\vb^b)$ by \!\pcol@putbackmvl! to make
% the \colorctext{} in |.dvi| consistent with the current |.tex|'s one, and
% to save \prespan{} into \!\pcol@prespan! if we are opening a \mctext{}.
%
% \item\label{item:scftop-pen}
% Put $\!\penalty!=10000$ by \!\nobreak! if $\CSIndex{if@nobreak}=\true$ or
% \!\interlinepenalty! by \!\addpenalty!\footnote{
%
% As done in \!\@specialoutput! but \!\penalty!\!\interlinepenalty! should
% be sufficient.}
%
% otherwise, as the page break penalty at the returning point. Note that
% adding the \!\penalty! will be nullified by \TeX{} if $\cc_c(\vb^b)$ has
% nothing and thus, if the \colpage{} is still empty when we leave from it,
% its emptiness without any items is assured. Also note that the penalty
% insertion here {\em looks} essential to keep \TeX's page builder from
% confusing with \scfnote{} footnotes which it has not seen in a
% \colpage\footnote{
%
% At least a test with tall \scfnote{} footnotes gave us a confusing
% result.}.
%
% \item\label{item:scftop-fnote}
% If $\pp^f(p)\neq\bot$, let \!\pcol@currfoot! and then \!\footins! have
% the footnotes in it by an \!\edef! and \!\pcol@getcurrfoot!, return the
% \!\insert! for them to \!\@freelist!, invoke \!\pcol@shrinkcolbyfn! to
% shrink \!\@colht! temporarily by their total height and to remember the
% exsistence of them with $\!\@tempdimb!=-\!\skip!\!\footins!$, and then
% \!\insert! the footnotes so that it contributes to the building process
% of the \colpage{} to be restarted. Otherwise, i.e. if $\pp^f(p)=\bot$,
% \!\@colht! is unchanged and $\!\@tempdimb!=0$.
%
% \item\label{item:scftop-defer}
% Invoke \!\pcol@deferredfootins! to \!\insert! deferred footnotes in $\df$
% until their total height reaches (possibly shrunk) \!\@colht!. This
% height capping is to keep \TeX's page builder from holding too large
% number of footnotes unprocessed causing confused ordering on presenting
% them to \!\output! routine.
% \end{enumerate}
%
% \item
% If footnote typesetting is \scfnote{} but $p<\ptop$, we do the followings.
%
% \begin{enumerate}\def\labelenumii{(\alph{enumii})}
% \item
% If $\pp^f(p)\neq\bot$, get it into \!\footins! as done in
% (\ref{item:scftop-fnote}) but giving \!\copy! to \!\pcol@getcurrfoot!
% because $\pp^f(p)$ has been fixed and thus will be kept until it is
% shipped out, and then \!\insert! it.
%
% \item
% Put $\cc_c(\vb^b)$ and the penalty as done in (\ref{item:scftop-main}) and
% (\ref{item:scftop-pen}).
% \end{enumerate}
%
% Thes order of footnotes, main vertical list and then penalty is essential
% to ensure that the \colpage{} in $p<\ptop$ has room for footnotes whose
% residence in $p$ has already been fixed.
%
% \item
% If footnote typesetting is \mcfnote{}, we do the followings.
%
% \begin{enumerate}\def\labelenumii{(\alph{enumii})}
% \item
% Put $\cc_c(\vb^b)$ as done in (\ref{item:scftop-main}).
%
% \item
% If $\cc_c(ft)\neq\bot$, get it by \!\pcol@getcurrfoot! returning the
% \!\insert! to \!\@freelist!, and then \!\insert! it.
%
% \item
% Put a penalty as done in (\ref{item:scftop-pen}).
% \end{enumerate}
%
% The order of main vertical list, footnotes and then penalty is appropriate
% for \Mcfnote{}s because they definitely have space in the \colpage{} and
% \TeX{} will break the page below the insertion, possibly just below thanks
% to the penalty, to keep the footnotes and references to them in a page.
% \end{enumerate}
%
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\ifpcol@scfnote
\edef\pcol@currfoot{\pcol@footins}%
\ifnum\pcol@page=\pcol@toppage
\@tempdima\@colht \@tempdimb\z@
\pcol@putbackmvl
\if@nobreak \nobreak \else \addpenalty\interlinepenalty \fi
\ifvoid\pcol@footins\else
\pcol@Fb
\pcol@getcurrfoot\box \@cons\@freelist\pcol@currfoot
\pcol@Fe{restartcolumn(pagefn)}%
\pcol@Log\pcol@restartcolumn{insert}\footins
\pcol@shrinkcolbyfn\@colht\footins\@tempdimb
\insert\footins{\unvbox\footins}%
\fi
\pcol@deferredfootins\pcol@restartcolumn
\@colht\@tempdima
\else
\ifvoid\pcol@footins\else
\pcol@getcurrfoot\copy
\pcol@Log\pcol@restartcolumn{insdmy}\footins
\insert\footins{\unvbox\footins}%
\fi
\pcol@putbackmvl
\if@nobreak \nobreak \else \addpenalty\interlinepenalty \fi
\fi
\else
\pcol@putbackmvl
\ifvoid\pcol@currfoot\else
\pcol@Fb
\pcol@getcurrfoot\box \@cons\@freelist\pcol@currfoot
\pcol@Fe{restartcolumn(colfn)}%
\pcol@Log\pcol@restartcolumn{insert}\footins
\insert\footins{\unvbox\footins}%
\fi
\if@nobreak \nobreak \else \addpenalty\interlinepenalty \fi
\fi}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{1}
% \begin{macro}{\pcol@getcurrcol}
% \changes{v1.1}{2012/05/11}
% {Add assignment $w_c$ to \cs{columnwidth}, \cs{hsize} and
% \cs{linewidth}.}
% \changes{v1.2-5}{2013/05/11}
% {Move assignment $w_c$ to \cs{hsize} and \cs{linewidth} to
% \cs{pcol@invokeoutput}.}
% \begin{macro}{\pcol@igetcurrcol}
% \begin{macro}{\pcol@iigetcurrcol}
% \changes{v1.0}{2011/10/10}
% {Add restoration of \cs{pcol@textfloatsep}.}
% \changes{v1.3-4}{2013/09/17}
% {Remove the argument for $\kappa_c(\mu)\EQ\cs{@mparbottom}$ because it
% is no longer in the column context.}
%
% The macro \!\pcol@getcurrcol! is invoked from the following macros to
% restore the typesetting parameters of the column $c=\!\pcol@currcol!$ from
% $\cc_c$, and to let \!\columnwidth! have
% $\w_c=|\pcol@columnwidth|{\cdot}c$\footnote{
%
% \cs{hsize} and \cs{linewidth} are let have $\w_c$ and $\w_c-\lrm$
% respectively in \cs{pcol@invokeoutput}.}.
%
% \SpecialArrayIndex{c}{\pcol@columnwidth}
%
% \begin{itemize}\item[]\begin{tabular}{lll}
% \!\pcol@output@start!&\!\pcol@output@switch!&\!\pcol@restartcolumn!\\
% \!\pcol@flushcolumn!&\!\pcol@measurecolumn!&\!\pcol@synccolumn!\\
% \!\pcol@makeflushedpage!&\!\pcol@imakeflushedpage!&\!\pcol@iflushfloats!\\
% \!\pcol@freshpage!&\!\pcol@output@end!
% \end{tabular}
% \end{itemize}
%
% Since we represent $\cc_c$ as;
%
% \begin{eqnarray*}
% &&\Arg{\cc_c(\vb)}\Arg{\cc_c(\ft)}\Arg{\cc_c(\pd)}\Arg{\cc_c(\tl)}
% \Arg{\cc_c(\ml)}\Arg{\cc_c(\bl)}\Arg{\cc_c(\dl)}\Arg{\cc_c(\tf)}|%|\\
% &&\Arg{\Arg{\cc_c(\fh)}\Arg{\cc_c(\tn)}\Arg{\cc_c(\tr)}
% \Arg{\cc_c(\bn)}\Arg{\cc_c(\br)}\Arg{\cc_c(\cn)}\Arg{\cc_c(\sw)}
% \Arg{\cc_c(\ep)}}
% \end{eqnarray*}
%
% in the body of $|\pcol@col|{\cdot}c$,
%
% \SpecialArrayIndex{c}{\pcol@col}
%
% we restore first eight by \!\pcol@igetcurrcol! giving everything above as
% its arguments by the expansion of
% $$
% \!\csname!| pcol@col|\!\number!\!\pcol@currcol!\!\endcsname!
% $$
% and then of the resulting control sequence. Then this macro gives its
% nineth argument to \!\pcol@iigetcurrcol! which restores the last eight. We
% also do
% $$
% \!\global!\!\columnwidth!|\pcol@columnwidth|{\cdot}c
% $$
%
% \SpecialArrayIndex{c}{\pcol@columnwidth}
%
% by a pair of \!\expandafter! for the first two control sequences.
%
% Note that the restore operations are \!\global!, except for $\cc_c(\vb)$
% and $\cc_d(\ft)$ because they are referred to only in \!\output!,
% including \CSIndex{if@nobreak} for which \!\@nobreaktrue! and
% \!\@nobreakfalse! are defined \!\global! by \LaTeX. Also note that
% \!\dimen!-type parameters are saved in the form of integers and thus
% restoring them needs to specify the unit |sp|.
%
% \begin{macrocode}
\def\pcol@getcurrcol{%
\expandafter\expandafter\expandafter\pcol@igetcurrcol
\csname pcol@col\number\pcol@currcol\endcsname
\expandafter\global\expandafter\columnwidth
\csname pcol@columnwidth\number\pcol@currcol\endcsname}
\def\pcol@igetcurrcol#1#2#3#4#5#6#7#8#9{%
\def\@currbox{#1}\def\pcol@currfoot{#2}\global\pcol@prevdepth#3sp\relax
\gdef\@toplist{#4}\gdef\@midlist{#5}\gdef\@botlist{#6}\gdef\@deferlist{#7}%
\global\pcol@textfloatsep#8sp\pcol@iigetcurrcol#9}
\def\pcol@iigetcurrcol#1#2#3#4#5#6#7#8{%
\global\@textfloatsheight#1sp\relax
\global\@topnum#2\relax \global\@toproom#3sp\relax
\global\@botnum#4\relax \global\@botroom#5sp\relax
\global\@colnum#6\relax
\global\@afterindentfalse \@nobreaktrue
\ifcase#7
\@nobreakfalse \or
\global\@afterindenttrue \else
\relax
\fi
\global\everypar{#8}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@getcurrfoot}
% \changes{v1.2-2}{2013/05/11}
% {Add an argument being \cs{box} or \cs{copy}}
%
% The macro $\!\pcol@getcurrfoot!\arg{com}$ is invoked from
% \!\pcol@startcolumn! (\!\copy!, $\pp^f(p)$),
% \!\pcol@restartcolumn! (\!\copy!\slash\!\box!, $\pp^f(p)$\slash$\cc_c(\ft)$),
% \!\pcol@flushcolumn! (\!\box!, $\cc_c(\ft)$) and \!\pcol@imakeflushedpage!
% (\!\box!, $\cc_c(\ft)$) to put everything in $\!\pcol@currfoot!$, having
% the second element in the parens following macro names, into \!\footins!
% using $\arg{com}$ shown as the first element in parens for the \!\box!
% component. That is, if the source $\pp^f(p)$ or $\cc_c(\ft^b)$ is void,
% we let $\!\box!{\cdot}\!\footins!$ be so. Otherwise, we move \!\box!,
% \!\count!, \!\dimen! and \!\skip! of the source into those of
% \!\footins!\footnote{
%
% Moving \!\count!, \!\dimen! and \!\skip! is redundant almost always
% because it is very unlikely that these footnote parameters are modified
% dynamically. Moreover, dynamic modification of them is hardly consistent
% with repetitive self-\!\insert!ion of \!\footins! in
% \!\pcol@restartcolumn! and \!\@reinserts! of \LaTeX. However, we dare to
% move them in order to, for example, allow each column has its own footnote
% parameters.}.
%
%
% \begin{macrocode}
\def\pcol@getcurrfoot#1{%
\ifvoid\pcol@currfoot \global\setbox\footins\box\voidb@x
\else
\global\setbox\footins#1\pcol@currfoot
\global\count\footins\count\pcol@currfoot
\global\dimen\footins\dimen\pcol@currfoot
\global\skip\footins\skip\pcol@currfoot
\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@setcurrcol}
% \changes{v1.0}{2011/10/10}
% {Add save of \cs{pcol@textfloatsep}.}
% \changes{v1.3-4}{2013/09/17}
% {Remove $\kappa_c(\mu)\EQ\cs{@mparbottom}$ from the body of
% $\cs{pcol@col}{\cdot}c$ because it is no longer in the column
% context.}
%
% \begin{macro}{\pcol@setcurrcolnf}
% The macro \!\pcol@setcurrcol! is invoked from \!\pcol@output@switch!,
% \!\pcol@measurecolumn! and \!\pcol@synccolumn! to save \cctext{} of
% $c=\!\pcol@currcol!$ in $\cc_c$. It is also used in \!\pcol@setcurrcolnf!
% invoked from \!\pcol@output@start!, \!\pcol@flushcolumn!,
% \!\pcol@imakeflushedpage!, \!\pcol@iflushfloats! and \!\pcol@freshpage! for
% the saving when the \colpage{} is known to have no footnotes.
%
% The macro \!\pcol@setcurrcol! at first calculates the combined code for
% \CSIndex{if@nobreak} and \CSIndex{if@afterindent}, and then saves
% parameters into $\cc_c$ by \!\xdef! to have the sequence shown in the
% description of \!\pcol@getcurrcol!. Note that \!\dimen!-type parameters
% are saved by expansions with \!\number! and thus as decimal integers.
%
% The macro \!\pcol@setcurrcolnf! \!\def!ines $\cc_c(\ft)=\!\pcol@currfoot!$
% as \!\voidb@x!, and then invoke \!\pcol@setcurrcol! for saving.
%
% \begin{macrocode}
\def\pcol@setcurrcol{{\let\@elt\relax
\@tempcnta\if@nobreak\if@afterindent\@ne\else\tw@\fi\else\z@\fi
\expandafter\xdef\csname pcol@col\number\pcol@currcol\endcsname{%
{\@currbox}{\pcol@currfoot}{\number\pcol@prevdepth}%
{\@toplist}{\@midlist}{\@botlist}{\@deferlist}{\number\pcol@textfloatsep}%
{{\number\@textfloatsheight}%
{\number\@topnum}{\number\@toproom}{\number\@botnum}{\number\@botroom}%
{\number\@colnum}{\number\@tempcnta}{\the\everypar}}}}}
\def\pcol@setcurrcolnf{\def\pcol@currfoot{\voidb@x}\pcol@setcurrcol}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@putbackmvl}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to restart a column with coloring.}
% \changes{v1.3-1}{2013/09/17}
% {Renamed from \cs{pcol@restorecst@restart} and the operations to
% save pre-spanning-text stuff is added.}
% \changes{v1.33-2}{2016/11/19}
% {Add {\tt\%} to the end of the line to open \cs{vbox} for
% \cs{pcol@prespan} to obey the coding convention.}
% \changes{v1.34}{2018/05/07}
% {Change nullification of
% $\mathit{\Gamma}_s\EQ\cs{pcol@colorstack@saved}$ from \cs{gdef} to
% \cs{box}-assignment of $\bot$ because it is now a \cs{vbox}.}
%
% The macro \!\pcol@putbackmvl!, solely used in
% \!\pcol@restartcolumn!, has two functions; \colorstack{} restoration and
% \prespan{} preservation. It examines the emptiness of the \colpage{} of the
% column $c$ to be restarted in $\cc_c(\vb)=\!\@currbox!$. If so, the
% \colorstack{} $\CST^c$ is saved into $\csts=\!\pcol@colorstack@saved!$ by
% \!\pcol@savecolorstack! as the opening \colorctext{} of the \colpage{},
% and \!\pcol@prespan! for \prespan{} is made $\bot$.
%
% Otherwise, $\csts$ is let $\bot$ because the opening \colorctext{} has
% already been put when we left from the \colpage{}. Then if
% $\CSIndex{ifpcol@sptextstart}=\true$ to mean a \mctext{} is to start, we
% save $\cc_c(\vb)$ into \!\pcol@prespan! adding the colorling \!\special!s
% to restore \colorctext{} from $\CST^c$ by
% \!\pcol@restorecolorstack!\footnote{
%
% If \cs{pcol@prespan} is connected to (the first part of) the \mctext,
% the reestablishment of the \colorstack{} here correctly places coloring
% \cs{special}s in \texttt{.dvi}. On the other hand, if the \mctext{} is
% slown away to the next page as a whole, the reestablishment here is
% essential for the correct paring of the pushes and pops, the latter of
% which are at the bottom of the \colpage{} whose tail is \cs{pcol@prespan}.}.
%
% We also shrink $\cc_c(\vb^r)=\!\@colroom!$ by the height of the \prespan{}
% so that \mctext{} will be captured by \!\pcol@makecol! if it is broken
% into two (or more) pages, and put a invisible \!\hrule! to the main
% vertical list letting $\!\topskip!=0$ to supress \!\topskip! insertion
% prior to the \mctext{} but instead to make the text led by
% \!\baselineskip! (or \!\lineskip!) according to the \!\prevdepth! being
% the depth of the tallest column and the height of the first \!\hbox! in
% the \mctext. Otherwise, i.e., if $\CSIndex{ifpcol@sptextstart}=\false$,
% we simply put back $\cc_c(\vb)$ into the main vertical list and then the
% coloring \!\special!s by \!\pcol@restorecolorstack!.
%
% Note that $\CSIndex{ifpcol@sptextstart}$ is temporarily made $\false$ by
% this macro if the \!\pcol@output@switch! invoking \!\pcol@restartcolumn!
% did not make \sync{}ed \cswitch{}, i.e., if $\CSIndex{ifpcol@flush}=\true$
% to mean the page is flushed before the \sync{}ation, or
% $\CSIndex{ifpcol@sync}=\false$ for \cscan{}ning prior to the \sync{}ation.
%
% \begin{macrocode}
\def\pcol@putbackmvl{%
\ifpcol@flush \pcol@sptextstartfalse \fi
\ifpcol@sync\else \pcol@sptextstartfalse \fi
\pcol@ifempty\@currbox
{\pcol@savecolorstack
\ifpcol@sptextstart \global\setbox\pcol@prespan\box\voidb@x \fi}%
{\global\setbox\pcol@colorstack@saved\box\voidb@x
\ifpcol@sptextstart
\global\setbox\pcol@prespan\vbox{%
\unvbox\@currbox \pcol@restorecolorstack}%
\global\advance\@colroom-\ht\pcol@prespan
\global\topskip\z@ \hrule\@height\z@\@width\z@
\else
\unvbox\@currbox \pcol@restorecolorstack
\fi}}
% \end{macrocode}
% \end{macro}
%
%
%
% \KeepSpace{3}
% \subsection{Color Management}
% \label{sec:imp-sout-color}
%
% \changes{v1.2-1}{2013/05/11}
% {Add the subsection ``Color Management'' to describe newly
% introduced macros for coloring.}
% \changes{v1.3-6}{2013/09/17}
% {Move commands outside \cs{output} routine to the newly introduced
% section ``Commands for Text Coloring'' to distinguish
% macros inside and outside \cs{output} routine.}
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@output@cpush} was introduced for color stack pushing but
% removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@output@cpush} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@output@icpush} was introduced to implement
% \cs{pcol@output@cpush} but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@output@icpush} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.24}{2013/07/27}
% {\cs{pcol@output@mcpush} was introduced for coloring specified in
% math mode but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@output@mcpush} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.24}{2013/07/27}
% {\cs{pcol@output@imcpush} was introduced for coloring specified in
% math mode but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@output@imcpush} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@output@cpop} was introduced for color stack popping but
% removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@output@cpop} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.2-1}{2013/05/11}
% {\cs{pcol@reset@color@elt} was introduced to implement
% \cs{pcol@reset@color@pop} but removed in v1.34.}
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@reset@color@elt} was moved from the position where
% \cs{pcol@reset@color@pop} was defined
% because it became to be used only by \cs{pcol@output@cpop}, but
% removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@reset@color@elt} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.24}{2013/07/27}
% {\cs{pcol@output@mcpop} was introduced for coloring specified in
% math mode but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@output@mcpop} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.24}{2013/07/27}
% {\cs{pcol@output@mcpop@elt} was introduced for coloring specified in
% math mode but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@output@mcpop@elt} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@output@cset} was introduced to set $\gamma_0^c$ but
% removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@output@cset} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@output@icset} was introduced to implement
% \cs{pcol@output@cset} but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@output@icset} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@return@from@color} was introduced to implement
% \cs{pcol@output@cpush}, \cs{pcol@output@cpop} and
% \cs{pcol@output@cset} but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@return@from@color} is removed according to the change of
% text coloring from \cs{output} to \cs{insert}.}
%
% \begin{macro}{\pcol@magicpenalty}
% \begin{macro}{\pcol@ifempty}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to examine the emptiness of the box, extracting the code
% from \cs{pcol@measurecolumn} so as to be used for coloring as
% well.}
%
% The macro $\!\pcol@ifempty!\arg{box}\arg{then}\arg{else}$ is used in
% \!\pcol@putbackmvl!, \!\pcol@clearcst@unvbox! and
% \!\pcol@measurecolumn! to examine if $\arg{box}$ is empty, and to perform
% $\arg{then}$ if so or $\arg{else}$ otherwise. Since \TeX{} does not
% provide any convenient way for the examination unfortunately, we perform a
% series of tricky operations to put the followings into \!\@tempboxa!; a
% penalty of $\!\pcol@magicpenalty!=12345$ whose existence in the
% $\arg{box}$ is (almost) impossible; contents of $\arg{box}$ put by
% \!\unvcopy!; and then a \!\global! \!\def!inition of \!\@gtempa! to let it
% have the decimal representation of \!\lastpenalty!. Since \!\lastpenalty!
% has $\arg{pen}$ if the last item is $\!\penalty!\arg{pen}$, or 0
% otherwise, $\!\@gtempa!=\!\pcol@magicpenalty!$ iff $\arg{box}$ is empty.
%
% \begin{macrocode}
%% Special Output Routines: Color Management
\def\pcol@magicpenalty{12345}
\def\pcol@ifempty#1#2#3{%
\setbox\@tempboxa\vbox{\penalty\pcol@magicpenalty
\unvcopy#1\xdef\@gtempa{\number\lastpenalty}}%
\ifnum\@gtempa=\pcol@magicpenalty\relax \def\reserved@a{#2}%
\else \def\reserved@a{#3}%
\fi
\reserved@a}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@clearcst@unvbox}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to put coloring \cs{special}s above and below of a
% column-page.}
% \begin{macro}{\pcol@clearcolorstack}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to clear color context.}
% \changes{v1.34}{2018/05/07}
% {Completely change its definition according to the new text coloring
% with \cs{insert}.}
%
% The macro \!\pcol@clearcst@unvbox!$\arg{box}$, invoked from \!\pcol@opcol!
% and \!\pcol@output@switch!, puts the following above and below
% $\arg{box}$ containing the main vertical list of a \colpage{} from which
% we are now leaving, if \!\pcol@ifempty! judges that $\arg{box}$ is not
% empty. Above the $\arg{box}$, we put coloring \!\special!s to establish
% the \colorstack{} of |.dvi| saved in $\csts=\!\pcol@colorstack@saved!$ by
% \!\pcol@restorecst! as the opening \colorctext{} of the \colpage{}. The
% stack $\csts$, however, can be $\bot$ if $\arg{box}$ already has the
% \!\special!s, i.e., when we visit the \colpage{} it had already had
% some items. Below $\arg{box}$, on the other hand, we put uncoloring
% \!\special!s by \!\pcol@clearcolorstack! to rewind $\CSTraw^c$ to clear the
% \colorctext{} of the \colpage{} in |.dvi| temporarily so that afterward it
% is made consistent with that in |.tex|.
%
% The macro \!\pcol@clearcolorstack!, solely invoked from
% \!\pcol@clearcst@unvbox! shown above\footnote{
%
% But we have this macro to avoid the complication in \cs{def}ining
% \cs{reserved@a} and \cs{reserved@b} with an argument if we did it in the
% argument of \cs{pcol@ifempty} in \cs{pcol@clearcst@unvbox}.},
%
% scans $\CSTraw^c=(\Celt^c,\cstraw)$ by \!\pcol@scancst! giving
% $\cstraw=\!\pcol@colorins!$ to it as its argument. Since we gives
% $\cstraw$ to the macro, this scan includes removals of all $\celtpop_i$
% and $\mceltpop_{i,m}$, all $\celt_i$ having matching $\celtpop_i$, all
% $\mcelt_{i,m}$ having matching $\mceltpop_{i,m}$, and all elements to
% update $\Celt^c$, from $\cstraw$ to let \!\pcol@colorins! have $\cst$.
% Prior to this invocation, we \!\def!ine $\!\reserved@a!\<\celt_i\>$ and
% $\!\reserved@b!\<\Celt^c\>$ to let them have \!\reset@color! so that
% uncoloring \!\special! will be put into the main vertical list for each
% $\celt_i\in\cst$ and $\Celt^c$ before update if any, regardless of
% coloring \!\special! they have. That is, we invoke \!\reset@color! as
% many times as the appearance of $\celt_i\in\cst$ and once if
% $\Celt^c\neq\bot$ before the invocation, ignoring the color information in
% each element and the order of elements, expecting \!\reset@color! just
% pops printer's \colorstack{} to rewind it as we intend.
%
% Note that in some printer |.def|inition could \!\def!ine \!\reset@color! to
% let printer's text color be \!\current@color! to make the stack rewinding
% resulting in the sequence of coloring operations with \!\current@color! at
% the invocation of \!\output!. This meaningless operations might cause a
% problem when a colored \colpage{} of $c_1$ is physically followed by another
% \colpage{} of the succeeding column $c_2$ without any coloring, because the
% \colpage{} of $c_2$ will be colored with \!\current@color! at the page break
% in $c_1$. If this problem is serious, we could initialize $\Celt^c$ with
% \!\current@color! at \beginparacol{} for all $c$ such that $\Celtshadow^c$
% is undefined, in order to make sure that any \colpage{} has at least one
% coloring \!\special! with $\Celt^c$ at its beginning so that, for example,
% coloring operations at the tail of the \colpage{} of $c_1$ is overridden
% by that of the default color of $c_2$ placed at the head of its \colpage{}.
%
% \begin{macrocode}
\def\pcol@clearcst@unvbox#1{%
\pcol@ifempty#1\relax
{\pcol@restorecst\pcol@colorstack@saved \unvbox#1\pcol@clearcolorstack}}
\def\pcol@clearcolorstack{%
\def\reserved@a##1{\reset@color}\def\reserved@b##1{\reset@color}%
\pcol@scancst\pcol@colorins}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \changes{v1.2-1}{2013/05/11}
% {\cs{pcol@set@color@elt} was introduced to implement color context
% reestablishment but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@set@color@elt} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
%
% \begin{macro}{\pcol@restorecolorstack}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to reestablish color context.}
% \changes{v1.34}{2018/05/07}
% {Completely change its definition according to the new text coloring
% with \cs{insert}.}
% \begin{macro}{\pcol@restorecst}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to reestablish color context.}
% \changes{v1.34}{2018/05/07}
% {Completely change its definition according to the new text coloring
% with \cs{insert}.}
%
% The macro \!\pcol@restorecolorstack!, used in \!\pcol@putbackmvl!
% and \!\pcol@output@end!, makes \colorctext{} in
% |.dvi| consistent with that in |.tex| by giving $\cst=\!\pcol@colorins!$
% to \!\pcol@restorecst! to let it scan $\CST^c=(\Celt^c,\cst)$.
% The callee macro $\!\pcol@restorecst!\arg{box}$, also used in
% \!\pcol@clearcst@unvbox! with $\arg{box}=\csts=\!\pcol@colorstack@saved!$,
% invokes \!\pcol@scancst! after \!\def!ining $\!\reserved@a!\<\celt_i\>$ to
% apply \!\unvbox! to $\celt_i$ in $\cst$ or $\csts$ and
% $\!\reserved@b!\<\Celt^c\>$ to apply \!\unvcopy! to $\Celt^c$ so that
% coloring \!\special!s they have will be put into the main vertical list.
%
% \begin{macrocode}
\def\pcol@restorecolorstack{\pcol@restorecst\pcol@colorins}
\def\pcol@restorecst{%
\def\reserved@a##1{\unvbox##1}\def\reserved@b##1{\unvcopy##1}%
\pcol@scancst}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@scancst}
% \changes{v1.34}{2018/05/07}
% {Introduced to implement new text coloring with \cs{insert}.}
% \begin{macro}{\pcol@iscancst}
% \changes{v1.34}{2018/05/07}
% {Introduced to implement new text coloring with \cs{insert}.}
%
% \begin{Sloppy}{1500}
% The macro $\!\pcol@scancst!\arg{box}$ is invoked from
% \!\pcol@clearcolorstack! and \!\pcol@restorecst!. In the former
% invocation, we have $\arg{box}=\cstraw=\!\pcol@colorins!$ to rewind
% $\CSTraw=(\Celt^c,\cstraw)$ with $\!\reserved@a!\arg{\celt_i}$ and
% $\!\reserved@b!\arg{\Celt^c}$ having \!\reset@color!. In the latter one,
% we have
% $\arg{box}\in\{\cst{=}\!\pcol@colorins!,\,\csts{=}\!\pcol@colorstack@saved!\}$
% to reestablish $\CST^c=(\Celt^c,\cst)$ or $\csts$ with
% $\!\reserved@a!\arg{\celt_i}$ to apply \!\unvbox! to $\celt_i$ and
% $\!\reserved@b!\arg{\Celt^c}$ to apply \!\unvcopy! to $\Celt^c$.
% Therefore, if $\arg{box}=\!\pcol@colorins!$, we at first put (un)coloring
% \!\special! for $\Celt^c$, unless it is $\bot$, to the main vertical
% list applying \!\reserved@b! to it. This means the \!\special! for
% $\Celt^c$ is put first prior to those for elements in $\cstraw$ or $\cst$
% consistently in reestablishing but not in rewinding. However as we
% discussed in the description of \!\pcol@clearcolorstack!, the order of
% rewinding does not affect the result for almost all printers because only
% the number of pop operations is siginficant for them\footnote{
%
% And even for the minority because multiple updates of printer's color with
% one particular color are independent of the order of them.}.
%
% Then if $\arg{box}\neq\bot$ we invoke \!\pcol@iscancst! to examine the
% contents of $\arg{box}$ from its bottom to top. Prior to the invocation,
% we do the following; let \!\@tempboxa! have an empty \!\vbox! as its initial
% value of reformed $\arg{box}$; let \!\pcol@tempboxa! have an empty
% \!\vbox! as its initial value of the sequence of \!\special!s to be put
% into the main vertical list; let $\npop=\!\@tempcntb!=0$; let
% $M=\!\reserved@b!=()$ as its initial value of the list of identifiers of
% math-mode pops; $\CSIndex{if@tempswa}=\true$ to mean the first \!\vbox! to
% update $\Celt^c$ found in the scan (i.e., the bottommost one) is
% effective.
% \end{Sloppy}
%
% In the macro \!\pcol@iscancst!, we repeatedly examine the last \!\vbox! in
% $\arg{box}$ taken by \!\lastbox! into $\celt=\!\pcol@tempboxb!$ until
% $\celt$ becomes $\bot$, and perform one of the following for $\celt$.
%
% \begin{enumerate}\def\labelenumi{(\arabic{enumi})}
% \def\HT{\mathit{height}}\def\DP{\mathit{depth}}\def\WD{\mathit{width}}
% \item
% If $\HT(\celt)=0$ and $\WD(\celt)=0$ to mean $\celt=\celtpop_i$, increment
% $\npop$.
%
% \item
% If $\HT(\celt)=0$ and $\WD(\celt)=m>0$ to mean $\celt=\mceltpop_{i,m}$, let
% $M=(m,M)$.
%
% \item
% If $\HT(\celt)\neq0$, $\DP(\celt)=0$ and $\WD(\celt)=0$ to mean
% $\celt=\celt_i$, decrement $\npop$ if $\npop>0$, or otherwise add $\celt$
% to the head of \!\@tempboxa! and apply $\!\reserved@a!\arg{\celt}$ to add
% its result to the head of \!\pcol@tempboxa!.
%
% \item
% If $\HT(\celt)\neq0$, $\DP(\celt)=0$ and $\WD(\celt)=m>0$ to mean
% $\celt=\mcelt_{i,m}$, do nothing if $m\in M$, or otherwise add $\celt$
% to the head of \!\@tempboxa! and apply $\!\reserved@a!\arg{\celt}$ to add
% its result to the head of \!\pcol@tempboxa!.
%
% \item
% If $\HT(\celt)\neq0$, $\DP(\celt)\neq0$ to mean $\celt$ has a \!\special!
% with which $\Celt^c$ is updated. If $\CSIndex{if@tempswa}=\true$ to mean
% $\celt$ is the first (bottommost) occurence, $\Celt^c$ is updated
% acquiring an \!\insert! from \!\@freelist! if it was $\bot$. In this
% case of $\bot$, we have to put an uncoloring \!\special! by
% \!\reset@color!, because \!\pcol@scancst! did not do it but
% \!\columncolor! or \!\normalcolumncolor! pushed the corresponding color
% \!\special!. Then we let $\CSIndex{if@tempswa}=\false$.
%
% Otherwise, i.e., if $\CSIndex{if@tempswa}=\false$ for second or succeeding
% occurences, we do nothing because updates by them are overridden by the
% first one.
% \end{enumerate}
%
% Note that the cases other than (3) and (4) happen only in rewinding, and
% thus in reestablishing we only have (3) and (4) with $\npop=0$ and $M=()$
% always so that every $\celt$ is kept into new $\arg{box}$ and a coloring
% \!\special! for it will be put into the main vertical list.
%
% Then we go back to \!\pcol@scancst! to let $\arg{box}=\!\@tempboxa!$,
% meaningless in reestablishing but not harmful, and put the contents of
% \!\pcol@tempboxa! to the main vertical list.
%
%
% \begin{macrocode}
\def\pcol@scancst#1{%
\@tempcnta#1\relax
\ifnum\@tempcnta=\pcol@colorins
\ifvoid\pcol@ccuse{@box}\else
\reserved@b{\pcol@ccuse{@box}}\fi
\fi
\ifvoid\@tempcnta\else
\setbox\@tempboxa\vbox{}\setbox\pcol@tempboxa\vbox{}\@tempcntb\z@
\def\reserved@b{}\let\@elt\relax \@tempswatrue \pcol@iscancst
\global\setbox\@tempcnta\box\@tempboxa \unvbox\pcol@tempboxa
\fi}
\def\pcol@iscancst{%
\setbox\@tempcnta\vbox{%
\unvbox\@tempcnta \global\setbox\pcol@tempboxb\lastbox}%
\ifvoid\pcol@tempboxb \let\reserved@c\relax
\else
\let\reserved@c\pcol@iscancst
\ifdim\ht\pcol@tempboxb=\z@
\ifdim\wd\pcol@tempboxb=\z@ \advance\@tempcntb\@ne
\else \edef\reserved@b{\@elt{\number\wd\pcol@tempboxb}\reserved@b}%
\fi
\else\ifdim\dp\pcol@tempboxb=\z@
\ifdim\wd\pcol@tempboxb=\z@
\ifnum\@tempcntb>\z@ \advance\@tempcntb\m@ne
\else
\setbox\@tempboxa\vbox{\copy\pcol@tempboxb \unvbox\@tempboxa}%
\setbox\pcol@tempboxa\vbox{%
\reserved@a\pcol@tempboxb \unvbox\pcol@tempboxa}%
\fi
\else
\count@\wd\pcol@tempboxb \chardef\reserved@d\z@
\def\@elt##1{\ifnum##1=\count@ \chardef\reserved@d\@ne \fi}%
\reserved@b \let\@elt\relax
\ifnum\reserved@d=\z@
\setbox\@tempboxa\vbox{\copy\pcol@tempboxb \unvbox\@tempboxa}%
\setbox\pcol@tempboxa\vbox{%
\reserved@a\pcol@tempboxb \unvbox\pcol@tempboxa}%
\fi
\fi
\else\if@tempswa
\ifvoid\pcol@ccuse{@box}%
\@next\@currbox\@freelist{\global\setbox\@currbox\vbox{}}\pcol@ovf
\pcol@ccxdef{\@currbox}\reset@color
\fi
\global\setbox\pcol@ccuse{@box}\vbox{\unvbox\pcol@tempboxb}%
\@tempswafalse
\fi\fi\fi
\fi
\reserved@c}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@savecolorstack}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to save the opening color context of a column-page.}
% \changes{v1.34}{2018/05/07}
% {Completely change its definition according to the new text coloring
% with \cs{insert}.}
%
% The macro \!\pcol@savecolorstack! is used in \!\pcol@startcolumn!,
% \!\pcol@output@start! and \!\pcol@putbackmvl! to save the opening
% \colorctext{} in $\CST^c$ of a \ccolpage{} $c$ known to be or found empty
% into $\csts=\!\pcol@colorstack@saved!$. If both of
% $\Celt^c=|\pcol@columncolor@box|\cdot c$ and $\cst=\!\pcol@colorins!$ are
% $\bot$, $\csts$ is let be $\bot$. Otherwise, $\csts$ is let be a \!\vbox!
% having a \!\vbox! for $\Celt^c$ at the top if it is not $\bot$ and then the
% contents of $\cst$ if it is not $\bot$.
%
% \SpecialArrayIndex{c}{\pcol@columncolor@box}
%
% \begin{macrocode}
\def\pcol@savecolorstack{%
\ifvoid\pcol@colorins \@tempswafalse \else \@tempswatrue \fi
\ifvoid\pcol@ccuse{@box}%
\setbox\@tempboxa\box\voidb@x
\else
\setbox\@tempboxa\vbox{\unvcopy\pcol@ccuse{@box}}%
\ht\@tempboxa1sp \dp\@tempboxa\z@ \wd\@tempboxa\z@
\@tempswatrue
\fi
\if@tempswa
\global\setbox\pcol@colorstack@saved\vbox{%
\ifvoid\@tempboxa\else \box\@tempboxa \fi
\ifvoid\pcol@colorins\else \unvcopy\pcol@colorins \fi}
\else \global\setbox\pcol@colorstack@saved\box\voidb@x
\fi}
% \end{macrocode}
% \end{macro}
%
% \changes{v1.2-1}{2013/05/11}
% {\cs{pcol@colorstack@full} was introduced to represent
% $\string\mathit{\Gamma}^c$ but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@colorstack@full} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
%
% \KeepSpace{3}
% \begin{macro}{\pcol@ccuse}
% \changes{v1.34}{2018/05/07}
% {Introduced to implement new text coloring with \cs{insert}.}
% \begin{macro}{\pcol@ifccdefined}
% \changes{v1.34}{2018/05/07}
% {Introduced to implement new text coloring with \cs{insert}.}
% \begin{macro}{\pcol@ccxdef}
% \changes{v1.34}{2018/05/07}
% {Introduced to implement new text coloring with \cs{insert}.}
%
% The macro $\!\pcol@ccuse!\arg{pfx}$ is to expand a macro
% $|\pcol@columncolor|\cdot\arg{pfx}\cdot c$ for the current column $c$. It
% is used in \!\pcol@output@start! and \!\pcol@scancst@shadow! with
% $\arg{pfx}=\hbox{`'}$ to have $\Celtshadow^c$, and in \!\pcol@scancst!,
% \!\pcol@iscancst!, \!\pcol@savecolorstack!, \!\pcol@output@end! and
% \!\pcol@icolumncolor! with $\arg{pfx}=|@box|$ to have $\Celt^c$.
%
% \SpecialArrayIndex{c}{\pcol@columncolor}
% \SpecialArrayIndex{c}{\pcol@columncolor@box}
%
% The macro $\!\pcol@ifccdefined!\arg{then}\arg{else}$ is used in
% \!\pcol@output@start! and \!\pcol@scancst@shadow! to examine whether
% $\Celtshadow^c=|\pcol@columncolor|\cdot c$ is defined and to do
% $\arg{then}$ if so or $\arg{else}$ otherwise.
%
% \SpecialArrayIndex{c}{\pcol@columncolor}
%
% The macro $\!\pcol@ccxdef!\arg{body}$ \!\xdef!ines a macro
% $\Celt^c=|\pcol@columncolor@box|\cdot c$ as $\arg{body}$ for the current
% column $c$. It is used in \!\pcol@output@start!, \!\pcol@iscancst! and
% \!\pcol@icolumncolor! with $\arg{body}=\!\@currbox!$ when an \!\insert!
% for $\Celt^c$ is acquired, and in \!\pcol@output@end! with
% $\arg{body}=\!\voidb@x!$ after releasing $\Celt^c$ to \!\@freelist!.
%
% \SpecialArrayIndex{c}{\pcol@columncolor@box}
%
% \begin{macrocode}
\def\pcol@ccuse#1{\@nameuse{pcol@columncolor#1\number\pcol@currcol}}
\def\pcol@ifccdefined#1#2{%
\expandafter\ifx\csname pcol@columncolor\number\pcol@currcol\endcsname\relax
#2\else#1\fi}
\def\pcol@ccxdef#1{%
\expandafter\xdef
\csname pcol@columncolor@box\number\pcol@currcol\endcsname{#1}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
%
%
% \subsection{Footnote Handling}
% \label{sec:imp-sout-scfnote}
% \changes{v1.2-2}{2013/05/11}
% {Add the subsection ``Footnote Handling'' to describe newly
% introduced macros for page-wise footnotes.}
%
% \begin{macro}{\pcol@savefootins}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to save footnotes in multiple occasions.}
%
% The macro $\!\pcol@savefootins!\arg{cs}$, invoked from \!\pcol@makecol!
% for \Scfnote{}s and from \!\pcol@output@switch! for both \mcfnote{} and
% \Scfnote{}s, saves \!\footins! to an \!\insert! register obtained by
% \!\@next! from \!\@freelist!, and \!\def!ines $\arg{cs}$ being
% \!\pcol@currfoot! or \!\pcol@footins! so that it has the register as its
% body and the register is then saved into $\pp^f(p)$ or $\cc_c(\ft)$. We
% save not only \!\box! component of \!\footins! but also \!\count!,
% \!\dimen! and \!\skip!\footnote{
%
% Knowing these three components are virtually constants.}.
%
% \begin{macrocode}
%% Special Output Routines: Footnote Handling
\def\pcol@savefootins#1{%
\@next#1\@freelist{%
\global\setbox#1\box\footins
\global\count#1\count\footins
\global\dimen#1\dimen\footins
\global\skip#1\skip\footins}{\def#1{\voidb@x}\pcol@ovf}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@shrinkcolbyfn}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to shrink \cs{@colht} temporarily by the
% height-plus-depth of page-wise footnotes and the natural size
% of the skip above them.}
% \changes{v1.3-3}{2013/09/17}
% {Add the first argument $\langle\string\mathit{height}\rangle$ for
% the user \cs{pcol@ioutputelt}.}
% \changes{v1.3-6}{2013/09/17}
% {Add the third argument $\langle\string\mathit{skip}\rangle$ to
% avoid accidental destruction of \cs{@tempdimb} which was modified
% unconditionally.}
%
% The macro $\!\pcol@shrinkcolbyfn!\arg{height}\arg{ins}\arg{skip}$, invoked
% from \!\pcol@makecol!, \!\pcol@ioutputelt!, \!\pcol@startcolumn!,
% \!\pcol@restartcolumn!, \!\pcol@flushcolumn! and \!\pcol@makeflushedpage!,
% shrinks $\arg{height}\in\{\!\@colht!,\!\@tempdima!\}$ temporarily so that a
% column or the set of all columns resides in a page with \Scfnote{}s in the
% \!\insert! $\arg{ins}$. The shrinkage is calculated by adding the sum of
% the height plus depth of all footnotes, i.e., that of $\arg{ins}$, and the
% natural component of $\!\skip!\arg{ins}$, i.e., the vertical space
% inserted between the columns and the footnotes. Note that the stretch and
% shrink components of $\!\skip!\arg{ins}$ cannot be incorporated into the
% calculation but their contribution to each \colpage{} is taken care of by
% the following macro \!\pcol@unvbox@cclv! if required. Also note that the
% inverse of $\!\skip!\arg{ins}$ is kept in $\arg{skip}$ if it is not
% \!\relax! so that \!\pcol@deferredfootins! knows $\arg{ins}\neq\bot$ when
% this macro is invoked from \!\pcol@startcolumn! and
% \!\pcol@restartcolumn! with $\arg{skip}=\!\@tempdimb!$.
%
% \begin{macrocode}
\def\pcol@shrinkcolbyfn#1#2#3{%
\ifx#3\relax\else #3-\skip#2\relax \fi
\advance#1-\ht#2\advance#1-\dp#2\advance#1-\skip#2\relax}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@unvbox@cclv}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to add stretch/shrink components of
% \cs{skip}\cs{footins} at the bottom of a column-page if the page has
% page-wise footnotes.}
%
% The macro $\!\pcol@unvbox@cclv!\arg{ins}$, invoked from \!\pcol@makecol! and
% \!\pcol@flushcolumn! when they work on a column-page with \Scfnote{}s,
% adds the stretch and shrink components of $\!\skip!\arg{ins}$ at the end
% of \!\box!|255|, where $\arg{ins}$ is non-void $\pp^f(p)$ having
% \Scfnote{}s. Before the addition, the macro goes back to the baseline of
% \!\box!|255|\footnote{
%
% The comparison of the depth of \cs{box}\texttt{255} and \cs{@maxdepth} and
% taking the latter if it is smaller is really just-in-case.}
%
% to nullify the baseline progress mechanism so as to make it sure the exact
% amount of the vertical skip is added. Then it adds the stretch and shrink
% by at first adding the skip itself and then the negative amount of its
% natural component.
%
% \begin{macrocode}
\def\pcol@unvbox@cclv#1{%
\@tempdima\dp\@cclv \unvbox\@cclv
\vskip \ifdim\@tempdima>\@maxdepth -\@maxdepth \else -\@tempdima \fi
\vskip\skip#1\@tempdima\skip#1\vskip-\@tempdima}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@deferredfootins}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to insert deferred footnotes.}
% \changes{v1.3-6}{2013/09/17}
% {Fix the bug that the height cap was underestimated by the duplicated
% subtraction of \cs{skip}\cs{footins} if the page has already have
% non-deferred footnotes.}
%
% The macro $\!\pcol@deferredfootins!\arg{macro}$, invoked from
% \!\pcol@startcolumn! and \!\pcol@restartcolumn!, tries to \!\insert! some
% of leading deferred footnotes in $\df$ through \!\footins!\footnote{
%
% The argument $\arg{macro}$ has the invoker itself shown in debug
% messages.}.
%
% In order to avoid that \!\footins! has footnotes across three or more
% pages to make confusion in the order of footnotes kept inside of \TeX, we
% cap the total height of footnotes by $h=\!\@colht!$ if it has already
% shrunk by non-deferred footnotes in the page we are working on indicated
% by $\!\@tempdimb!<0$, or $h=\!\@colht!-\!\skip!\!\footins!$ if the page
% does not have non-deferred footnotes indicated by $\!\@tempdimb!=0$. That
% is, we extract leading elements of $\df$ by \!\vsplit! until their total
% height reaches $h$ and, if some elements are obtained in \!\@tempboxa!,
% \!\insert! them through \!\footins!. As for the remaining elements if
% any, we add a leading \!\penalty!\!\interlinepenalty! which should have
% been removed by \!\vsplit!.
%
% Note that we temporarily let $\!\splitmaxdepth!=\!\@maxdepth!$,
% $\!\splittopskip!=0$ and $\!\vbadness!=\infty$ at the \!\vsplit! so that
% the depth of the split first half is \!\@maxdepth! at deepest, the second
% half does not have any skip at its top, and \TeX{} will not complain of
% (almost) inevitable underfull. Also note that the successful extraction
% of the leading elements is examined by checking \!\ht!\!\@tempboxa! and
% thus we need to \!\unvbox! it in itself because \!\vsplit! makes the
% height $h$ regardless of its contents.
%
% \begin{macrocode}
\def\pcol@deferredfootins#1{%
\ifdim\@tempdimb=\z@ \@tempdimb\@colht \advance\@tempdimb-\skip\footins
\else \@tempdimb\@colht
\fi
\ifvoid\pcol@topfnotes\else \ifdim\@tempdimb>\z@
\begingroup
\splitmaxdepth\@maxdepth \splittopskip\z@ \vbadness\@M
\setbox\@tempboxa\vsplit\pcol@topfnotes to\@tempdimb
\ifvoid\pcol@topfnotes\else
\global\setbox\pcol@topfnotes\vbox{\penalty\interlinepenalty
\unvbox\pcol@topfnotes}%
\fi
\setbox\@tempboxa\vbox{\unvbox\@tempboxa}%
\ifdim\ht\@tempboxa>\z@
\pcol@Log#1{add}\@tempboxa
\insert\footins{\unvbox\@tempboxa}%
\fi
\endgroup
\fi\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@combinefootins}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to put footnotes into pre-environment stuff.}
% \changes{v1.35-4}{2018/12/31}
% {Add the insertion of vertical skip \cs{belowfootnoteskip}.}
% \begin{macro}{\pcol@putfootins}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to put page-wise footnotes to a page.}
% \changes{v1.3-2}{2013/09/17}
% {Change users \cs{pcol@outputelt} to \cs{pcol@ioutputelt}.}
% \changes{v1.3-6}{2013/09/17}
% {Remove \cs{pcol@output@end} from users.}
%
% The macro $\!\pcol@combinefootins!\arg{b}\arg{f}$, invoked solely from
% \!\pcol@makenormalcol!\footnote{
%
% And thus having the arguments $\arg{b}$ and $\arg{f}$ is unnecessary, but
% we keep this implementation to avoid unnecessary recoding from a
% development version.},
%
% constructs the \preenv{} in \!\@outputbox!, combining the stuff in the box
% $b$ and pre-environment footnotes in the \!\insert! $f$. It is almost
% equivalent to the \cs{else} part of \!\@makecol! in which the main
% vertical list and \Mcfnote{}s are combined. The operation to put
% footnotes is almost equivalent to the second half of the \cs{else} part
% except that \!\insert! is not always \!\footins! but $f$ and is done by
% \!\pcol@putfootins! in which a null vertical skip is added after $f$ but
% this skip is removed by \!\unskip! after the invocation. The other
% difference is that the vertical space of \!\belowfootnoteskip! is added if
% it is not 0\footnote{
%
% We avoid null space insertion to minimize the difference from older
% versions in traced output.}
%
% to have some space between non-merged \Preenv{} footnotes and the first
% lines in a \env{paracol} environment.
%
% The null vertical skip is put for \Scfnote{}s, for which the macro
% \!\pcol@putfootins! is invoked from \!\pcol@ioutputelt! and
% \!\pcol@makeflushedpage!. Since we shrink the height of \colpage{}s by
% the height-plus-depth of \Scfnote{}s, the natural height of the box in
% which \colpage{}s and \Scfnote{}s are combined would be less than
% \!\textheight! due to the depth of the last footnote line if we simply
% made the footnotes the last items of the box. Though this shortage at
% most \!\maxdepth! is expected to be covered by the stretch factor of
% \!\skip!\!\footins! without too large badness causing an underfull
% message\footnote{
%
% With default settings of $\cs{maxdimen}=5\,|pt|$ and the stretch factor
% 4\,|pt| of \cs{skip}\cs{footins}, the badness $100\times(5/4)^3\approx195$
% is significantly less than the default $\cs{vbadness}=1000$.},
%
% someday we could face an underfull with some unusual settings of
% \!\maxdimen!, \!\skip!\!\footins! and/or \!\vbadness!. Therefore, we put a
% null vertical skip so that the real bottom of the footnotes, instead of
% the last baseline, is placed at the baseline of the box, to make the
% natural height of the box is \!\textheight! exactly. Note that this
% shifting \Scfnote{}s up will not make last baselines of footnotes among
% pages unaligned, because the last line have a strut.
%
% \begin{macrocode}
\def\pcol@combinefootins#1#2{%
\setbox\@outputbox\vbox{%
\boxmaxdepth\@maxdepth
\unvbox#1\relax
\pcol@putfootins#2\unskip
\ifdim\belowfootnoteskip=\z@\else \vskip\belowfootnoteskip \fi}}
\def\pcol@putfootins#1{%
\vskip\skip#1\relax
\color@begingroup
\normalcolor
\footnoterule
\unvbox#1\relax
\color@endgroup \vskip\z@}
% \end{macrocode}
% \end{macro}\end{macro}
%
%
%
% \KeepSpace{3}
% \subsection{Marginal Notes}
% \label{sec:imp-sout-mpar}
% \changes{v1.3-4}{2013/09/17}
% {Add this section ``Marginal Notes''.}
%
% \begin{macro}{\@addmarginpar}
% \changes{v1.3-4}{2013/09/17}
% {Made \cs{let}-equal to \cs{pcol@addmarginpar} in
% \string\texttt{paracol} environments.}
% \begin{macro}{\pcol@addmarginpar}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to make a margin sharable by marginal notes from
% different columns.}
% \changes{v1.35-3}{2018/12/31}
% {Fix the bug referring to \cs{@marbox} inappropriately.}
% \changes{v1.35-3}{2018/12/31}
% {Add vertical shifting of marginal note to emulate of
% \cs{marginnote}.}
% \begin{macro}{\pcol@@addmarginpar}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to keep the original definition of \cs{@addmarginpar}.}
% \def\swap{\mathit{swap}}
%
% The macro \!\pcol@addmarginpar! is our own version of \!\@addmarginpar!,
% which \!\pcol@zparacol! makes \!\let!-equal to \!\pcol@addmarginpar!
% keeping its original definition in \!\pcol@@addmarginpar!. Therefore, in
% an \env{paracol} environment, the \!\output! request made by \LaTeX's
% \!\marginpar! in the column $c$ and page $p$ is processed by
% \!\pcol@addmarginpar! through our own \!\output! routine being
% \!\pcol@output!, \!\pcol@specialoutput! and \LaTeX's \!\@specialoutput!.
% What we do in this macro are as follows; determine the margin which a
% marginal note goes to; temporarily modify the parameter
% $m_w=\!\marginparwidth!$ or $m_s=\!\marginparsep!$ according to the margin
% and the column; determine the position to place the marginal note
% consulting $\pp^m(p)=\!\pcol@mparbottom!$ obtained by
% \!\pcol@getcurrpage!: and update $\pp^m(p)$ according to the postion.
%
% First, there are the following parameters to determine the margin, and thus
% the value of $\CSIndex{if@firstcolumn}$ referred to in \LaTeX's
% \!\@addmarginpar! and meaning left if $\true$ or right if $\false$.
%
% \begin{enumerate}\def\labelenumi{(\arabic{enumi})}
% \item
% The macros \!\pcol@mpthreshold@l! and \!\pcol@mpthreshold@r! defined by
% \!\marginpar~threshold!\ give us the threshold of the column number to let
% columns less than it go to the left margin while those equal to or greater
% than it to the right, according to the \parapag{}e the column belongs to.
% Therefore, we let $\CSIndex{if@firstcolumn}=\true$ iff
% $c<\!\pcol@mpthreshold@l!\land c<\CL$ or $c<\!\pcol@mpthreshold@r!\land
% c\geq\CL$, as the fundamental setting.
%
% \item
% If $\CSIndex{ifpcol@swapmarginpar}=\true$ because the specifier `|m|' is
% given to \!\twosided! explicitly or implicitly, the decision in (1) is
% reversed if $\page(p)\bmod2=0$, and then this decision is reversed again
% if $c\geq\CL$ and $\CSIndex{ifpcol@paired}=\false$ to mean $c$ is in a
% \npaired{} right \parapag{}e. The second reversal is done because
% $\page(p)$ is \emph{common} to both left and right \parapag{}es and is for
% the left page in usual cases without page number jumps. Therefore,
% $(\page(p)\bmod2)$ is for left \parapag{}es and thus for right counterparts
% the decision should be made by $((\page(p)+1)\bmod2)$ and thus the result
% should be reversed.
%
% \item
% If \CSIndex{if@reversemargin} is made $\true$ by \LaTeX's
% \!\reversemarginpar!, the decision made by (1) and then possibly reversed
% by (2) is finally reversed.
% \end{enumerate}
%
% Second, we calculate
% $$
% D=\!\@tempdima!=\sum_{d=\Cfrom}^{\swap(c)-1}(w_{\swap(d)}+g_{\swap'(d)})
% $$
% where $x'=swap(x)$ is given by
% $\!\pcol@swapcolumn!\<x\>\<x'\>\<\Cfrom\>\<\Cto\>$ to let
% $x'=\Cto-(x-\Cfrom)-1$ if $\CSIndex{ifpcol@swapcolumn}=\true$ and
% $\page(p)\bmod2=0$ or $x'=x$ otherwise,
% $\swap'(x)=\!\pcol@colsepid!\in\{\swap(x)-1,x\}$ according to swapped or
% not, $(\Cfrom,\Cto)\in\{(0,\CL),(\CL,\C)\}$ according to $c<\CL$ or not,
% and $\w_x$ and $\gap_x$ are the width of $x$-th column and gap given by
% $|\pcol@columnwidth|{\cdot}x$ and $|\pcol@columnsep|{\cdot}x$
% respectively.
%
% \SpecialArrayIndex{c}{\pcol@columnwidth}
% \SpecialArrayIndex{c}{\pcol@columnsep}
%
% That is, $D$ is the distance from the left edge of the column $c$ to that
% of leftmost column in the (paralell-)
%
% \Index{parallel-paging}
%
% page in which $c$ resides. Then if $\CSIndex{if@firstcolumn}=\true$ to
% let the margial note go to the left margin, we add $D$ to
% $m_w=\!\marginparwidth!$ so that \LaTeX's \!\@addmarginpar! being
% \!\pcol@@addmarginpar! aligns the left edge of the marginal note at the
% point apart from the column's left edge by $(D+m_w)+m_s$ rather than
% $m_w+m_s$, or in other words $m_w+m_s$ apart from the left edge of the
% leftmost column. On the other hand if $\CSIndex{if@firstcolumn}=\false$,
% we add $\WT-(D+w_c)$ where $\WT$ is \!\textwidth!, being the distance from
% the right edge of the column $c$ to that of the rightmost column, to
% $m_s=\!\marginparsep!$ so that \!\pcol@@addmarginpar! aligns the left
% edge of the marginal note at the point apart from the column's right edge
% by $\WT-(D+w_c)+m_s$ rather than $m_s$, or in other words $m_s$ apart from
% the right edge of the rightmost column.
%
% Third, we let \Midx{\!\pcol@marbox!} be the first element of \!\@currlist!
% obtained by \!\@xnext! for the right marginal note if
% $\CSIndex{if@firstcolumn}=\false$, or \!\@currbox! for the left marginal
% note otherwise. Then we let $t=\!\@tempdima!$ be the distance from the
% top edge of the column to that of the marginal note, namely \!\@pageht!
% minus the height of \!\pcol@marbox! plus |\dimen|\!\@currbox! being
% downward shift amount optionally given by \!\marginnote!. We also let
% $h=\!\@tempdimb!$ be the height-plus-depth of the box \!\pcol@marbox!
% plus \!\marginparpush!, or in other words the vertical space the marginal
% note requires. Then we give $t$ and $h$ to \!\pcol@getmparbottom! to let
% \!\@mparbottom! have the bottom of the exisiting marginal text below which
% we put the margial text in \!\pcol@marbox!, and to let \!\pcol@mpblist!
% have the new list to be replaced with $\mpb_{\{L,R\}}^{\{l,r\}}$ in
% $\pp^m(p)$.
%
% Forth, we update $\pp^m(p)$ with the new list in \!\pcol@mpblist! by a
% process similar to \!\pcol@setpageno! but with \!\pcol@setmpbelt! to scan
% the list of pages $\PPP$.
%
% Fifth, we shift down \!\pcol@marbox! by |\dimen|\!\@currbox! and, if the
% shift amount is greater than the height of the box and thus the height of
% shifting result is zero, decrement \!\@mparbottom! by the amount to
% deceive \LaTeX's \!\@addmarginpar! into believing \!\@mparbottom! is above
% the real one by the amount. In other words, by the decrement we let
% \!\@addmarginpar! see the top edge of the shifted marginal note in the
% box, rather than that of the box itself, for the placement with
% \!\@mparbottom!.
%
% Finally, we invoke \LaTeX's original \!\@addmarginpar! being
% \!\pcol@@addmarginpar! to put the marginal note according to
% \CSIndex{if@firstcolumn}, temporarily modified \!\marginparsep! and
% \!\marginparwidth!, and \!\@mparbottom!. Note that since
% \!\pcol@zparacol! lets $\CSIndex{if@twocolumn}\~=\true$,
% \!\pcol@@addmarginpar! determine the margin only by
% \CSIndex{if@firstcolumn}. Also note that it can be $\!\@mparbottom!>t$
% (before decrement with the positive shift amount) to mean the marginal
% note should be shifted down from its natural position, and if so
% \!\pcol@@addmarginpar! will give us a warning as the correct consequence
% of the placement.
%
% \begin{macrocode}
%% Special Output Routines: Marginal Notes
\def\pcol@addmarginpar{%
\pcol@getcurrpage \@firstcolumntrue
\ifnum\pcol@currcol<\pcol@ncolleft
\let\reserved@a\z@ \let\reserved@b\pcol@ncolleft
\ifnum\pcol@mpthreshold@l>\pcol@currcol\else \@firstcolumnfalse \fi
\else
\let\reserved@a\pcol@ncolleft \let\reserved@b\pcol@ncol
\ifnum\pcol@mpthreshold@r>\pcol@currcol\else \@firstcolumnfalse \fi
\fi
\ifpcol@swapmarginpar
\ifodd\c@page\else
\if@firstcolumn \@firstcolumnfalse \else \@firstcolumntrue \fi
\fi
\ifpcol@paired\else \ifnum\pcol@currcol<\pcol@ncolleft\else
\if@firstcolumn \@firstcolumnfalse \else \@firstcolumntrue \fi
\fi\fi
\fi
\if@reversemargin
\if@firstcolumn \@firstcolumnfalse \else \@firstcolumntrue \fi
\fi
\pcol@swapcolumn\pcol@currcol\count@\reserved@a\reserved@b
\@tempdima\z@
\@tempcnta\reserved@a \@whilenum\@tempcnta<\count@\do{%
\pcol@swapcolumn\@tempcnta\@tempcntb\reserved@a\reserved@b
\advance\@tempdima\csname pcol@columnwidth\number\@tempcntb\endcsname\relax
\advance\@tempdima\csname pcol@columnsep\pcol@colsepid\endcsname\relax
\advance\@tempcnta\@ne}%
\if@firstcolumn \advance\marginparwidth\@tempdima
\else
\advance\marginparsep\textwidth \advance\marginparsep-\@tempdima
\advance\marginparsep-\columnwidth
\fi
\expandafter\@xnext\@currlist\@@\pcol@marbox\@gtempa
\if@firstcolumn\let\pcol@marbox\@currbox \fi
\@tempdima\@pageht \advance\@tempdima-\ht\pcol@marbox
\advance\@tempdima\dimen\@currbox
\@tempdimb\ht\pcol@marbox \advance\@tempdimb\dp\pcol@marbox
\advance\@tempdimb\marginparpush
\pcol@getmparbottom\@tempdima\@tempdimb
\begingroup
\@tempcnta\pcol@page \advance\@tempcnta-\pcol@basepage
\edef\reserved@a{\pcol@pages\pcol@currpage}%
\global\let\pcol@pages\@empty \global\let\pcol@currpage\@empty
\let\@elt\pcol@setmpbelt \reserved@a
\endgroup
\ifdim\dimen\@currbox=\z@\else
\ifdim\dimen\@currbox>\ht\pcol@marbox
\advance\@mparbottom-\dimen\pcol@marbox
\fi
\setbox\pcol@marbox\hbox{\lower\dimen\@currbox\box\pcol@marbox}%
\fi
\pcol@@addmarginpar}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \KeepSpace{3}
% \begin{macro}{\pcol@getmparbottom}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to find the space where a marginal note is placed.}
% \begin{macro}{\pcol@getmparbottom@i}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to find the space where a marginal note is placed.}
% \begin{macro}{\pcol@getmpbelt}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to find the space where a marginal note is placed.}
% \changes{v1.33-1}{2016/11/19}
% {Fix the bug by which $t_k$ such that $t_k\geq t$ and $t_k-t\geq h$
% but $t_k-b_{k-1}<h$ is found.}
%
% The macro $\!\pcol@getmparbottom!\<t\>\<h\>$ is solely used in
% \!\pcol@addmarginpar!\footnote{
%
% Thus giving $t$ and $h$ as arguments is not necessary but we dare to do
% it.}
%
% to let $B=\!\@mparbottom!$ point the bottom of the marginal note below
% which a new marginal note $m$, whose natural top is at $t$ and occupancy
% height is $h$, in the current column $c$ and the page $p$ is placed, or 0
% if the side margin has had no marginal notes yet. It is also \!\def!ines
% $M'=\Midx{\!\pcol@mpblist!}$ having $\mpar(t',t'{+}h)$ for the new marginal
% note $m$ placed at $t'$ in it and being replaced with one of
% $\mpb_{\{L,R\}}^{\{l,r\}}$ in $\pp^m(p)$ by \!\pcol@setmpbelt!.
%
% First we examine if $\pp^m(p)=\!\pcol@mparbottom!$ is empty and if so we
% simply let $B=0$ and $M'=(\mpar(t,t+h))$ because there are no marginal
% notes in the page $p$ at all. Otherwise we obtain
% $M\in\Set{\mpb_X^x}{X\in\{L,R\},\;x\in\{l,r\}}$ in \!\reserved@a! according
% to the side margin to which the new marginal note $m$ goes to, i.e.,
% according to $\CSIndex{if@firstcolumn}$ and $c<\CL$ or not, by
% \!\pcol@getmparbottom@i! giving it the body of $\pp^m(p)$ by
% \!\expandafter!. Then we apply $\!\pcol@getmpbelt!$ to each
% $\mpar(t_i,b_i)\in M$ to have
% $t_k=\min\Set{t_i}{t_i\geq{t},\;t_i-\max(t,b_{i-1})\geq{h}}$ and let
% $B=b_{k-1}$ and
%
% \begin{eqnarray*}
% M'&=&(\mpar(t_1,b_1),\;\ldots,\;\mpar(t_{k-1},b_{k-1}),\;
% \mpar(\max(t,B),\,\max(t,B)+h),\\
% &&\phantom{\LP}
% \mpar(t_k,b_k),\;\ldots,\;\mpar(t_n,b_n))
% \end{eqnarray*}
%
% where $n=\Abs{M}$, assuming $b_0=0$. That is, we try to find the first
% avilable gap between marginal notes below $t$ to accommodate the
% marginal note $m$ of $h$ tall. Then if such $t_k$ is not found because
% $t>t_n$ to mean $m$ appears below the last marginal note as in natural
% cases, or $t_i-\max(t,b_{i-1})<h$ for all $t_i$ s.t.\ $t_i>t$ to mean
% there are no available gaps, we let $B=t_n$ and
% $M'=(M,\mpar(\max(t,B),\,\max(t,B)+h))$ to place $m$ at the bottom.
%
% \begin{macrocode}
\def\pcol@getmparbottom#1#2{%
\global\@mparbottom\z@
\ifx\pcol@mparbottom\@empty
\begingroup
\@tempdimc#2\relax \advance\@tempdimc#1\relax \let\@elt\relax
\xdef\pcol@mpblist{\@elt{\number#1}{\number\@tempdimc}}%
\endgroup
\else
\expandafter\pcol@getmparbottom@i\pcol@mparbottom
\begingroup
\@tempdima#1\relax \@tempdimb#2\relax \@tempswafalse
\let\@elt\pcol@getmpbelt \global\let\pcol@mpblist\@empty \reserved@a
\if@tempswa\else
\ifdim\@tempdima<\@mparbottom \@tempdima\@mparbottom \fi
\advance\@tempdimb\@tempdima
\@cons\pcol@mpblist{{\number\@tempdima}{\number\@tempdimb}}%
\fi
\endgroup
\fi}
\def\pcol@getmparbottom@i#1#2#3#4{%
\ifnum\pcol@currcol<\pcol@ncolleft
\if@firstcolumn \def\reserved@a{#1}\else\def\reserved@a{#2}\fi
\else
\if@firstcolumn \def\reserved@a{#3}\else\def\reserved@a{#4}\fi
\fi}
\def\pcol@getmpbelt#1#2{%
\ifdim#1sp<\@tempdima
\global\@mparbottom#2sp\relax \@cons\pcol@mpblist{{#1}{#2}}%
\ifdim\@tempdima<#2sp\relax \@tempdima#2sp\relax \fi
\else
\@tempdimc\@tempdima \advance\@tempdimc\@tempdimb
\ifdim#1sp<\@tempdimc
\@tempdima#2sp\relax \global\@mparbottom#2sp\relax
\@cons\pcol@mpblist{{#1}{#2}}%
\else
\@cons\pcol@mpblist{{\number\@tempdima}{\number\@tempdimc}\@elt{#1}{#2}}%
\@tempswatrue
\def\pcol@getmpbelt##1##2{\@cons\pcol@mpblist{{##1}{##2}}}
\fi
\fi}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@setmpbelt}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to update $\pi^m(p)$.}
% \begin{macro}{\pcol@setmpbelt@i}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to update $\pi^m(p)$.}
%
% The macro $\!\pcol@setmpbelt!
% \Arg{\pp^p(q)}\<\pp^i(q)\>\<\pp^f(q)\>\Arg{\pp^s(q)}\Arg{\pp^m(q)}$ is
% used solely in \!\pcol@addmarginpar! and is applied to $\PPP$ to update an
% element $M\in\Set{\mpb_X^x}{X\in\{L,R\},x\in{l,r}}$ in $\pp^m(p)$ with
% $M'=\!\pcol@mpblist!$ given by \!\pcol@getmparbottom!. The structure of
% the macro is similar to \!\pcol@setpnoelt! to upadate $\pp^p(q)$ s.t.\
% $q\geq p$, but in this macro the target of the update is only $p$. Then
% for $q=p$, we invoke \!\pcol@setmpbelt@i! giving it the body of $\pp^m(p)$
% being
% $\Arg{\mpb_L^l}\Arg{\mpb_L^r}\Arg{\mpb_R^l}\Arg{\mpb_R^r}$, or
% $\<\emptyset\>\<\emptyset\>\<\emptyset\>\<\emptyset\>$ if
% $\pp^m(p)=\emptyset$, to obtain what $\pp^m(p)$ should have in
% $\pp_{\mathit{new}}^m(p)=\!\reserved@a!$ in which $\mpb_X^x$ is replaced
% with $M'$, where $X=L$ or $X=R$ if $c<\CL$ or not respectively, and $x=l$
% or $x=r$ if $\CSIndex{if@firstcolumn}=\true$ or not respectively, and then
% update $\pp^m(p)$ by $\!\pcol@defcurrpage!
% \Arg{\pp^p(p)}\<\pp^i(p)\>\<\pp^f(p)\>\Arg{\pp^s(p)}
% \Arg{\pp_{\mathit{new}}^m(q)}$.
%
% \begin{macrocode}
\def\pcol@setmpbelt#1#2#3#4#5{%
{\let\@elt\relax \xdef\pcol@pages{\pcol@pages\pcol@currpage}}%
\ifnum\@tempcnta=\z@
\def\reserved@a{#5}%
\ifx\reserved@a\@empty \pcol@setmpbelt@i{}{}{}{}\else \pcol@setmpbelt@i#5\fi
\pcol@defcurrpage{#1}{#2}{#3}{#4}{\reserved@a}%
\else \gdef\pcol@currpage{\@elt{#1}#2#3{#4}{#5}}%
\fi
\advance\@tempcnta\m@ne}
\def\pcol@setmpbelt@i#1#2#3#4{%
\ifnum\pcol@currcol<\pcol@ncolleft
\if@firstcolumn \def\reserved@a{{\pcol@mpblist}{#2}{#3}{#4}}%
\else \def\reserved@a{{#1}{\pcol@mpblist}{#3}{#4}}%
\fi
\else
\if@firstcolumn \def\reserved@a{{#1}{#2}{\pcol@mpblist}{#4}}%
\else \def\reserved@a{{#1}{#2}{#3}{\pcol@mpblist}}%
\fi
\fi}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@mparbottom@zero}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to give the default of \cs{pcol@mparbottom@out}.}
% \begin{macro}{\pcol@mparbottom@out}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to keep the last elements of $\pi^m(p_t)$ at
% \cs{end}\string\texttt{\char`\{paracol\char`\}.}}
%
% The macro $\Uidx\mpboutz=\!\pcol@mparbottom@zero!$ is used in
% \!\@outputpage!, \!\pcol@getmparbottom@last! and \!\pcol@output@end! to
% give the default value of $\Uidx\mpbout=\!\pcol@mparbottom@out!$ with
% $\mpar(0,0)$ for all elements $M\in\Set{\mpb_X^x}{X\in\{L,R\},x=\{l,r\}}$
% to mean a page has no marginal notes carrying over from the preceding
% \env{paracol} environments.
%
% As for $\mpbout$, besides the top level initialization to make it
% $\mpboutz$, it is updated in \!\pcol@output@end! through macros
% \!\pcol@getmparbottom@last! and \!\pcol@bias@mpbout! to have the last
% element of each $M\in\Set{\mpb_X^x}{X\in\{L,R\},x=\{l,r\}}$ in
% $\pp^m(\ptop)$ with transformation from coordinates of columns to that of
% text area, or directly with $\mpboutz$ if the \lpage{} will not have
% \postenv. The resulting $\mpbout$ is at first used in \!\pcol@output@end!
% itself through \!\pcol@do@mpbout! to let \!\@mparbottom! have the value
% $b$ of $\mpar(t,b)$ in $\mpb_L^l$ or $\mpb_L^r$ according to the side
% margin which marginal notes in \postenv{} goes to.
%
% Then $\mpbout$ is passed to the next \env{paracol} environment if it
% resides in the page where the previous environment also resides, to be
% referred to by \!\pcol@output@start! which also performs
% \!\pcol@do@mpbout! and \!\pcol@bias@mpbout! to let $\pp^m(0)$ have the
% lists according to $\mpbout$ and $\!\@mparbottom!$ which can be modified
% in \postenv{} of the previous environment or in other word
% in \preenv{} of starting envionment. By this setting of $\pp^m(0)$,
% marginal note placement in the \spage{} is aware of the marginal notes
% having been placed in previous environments and in \preenv{} and thus can
% correctly examines if a marginal note to be added in a margin collide
% the last one in the margin. On the other hand, if the \postenv{}
% encounters a page break before a new environment starts, our own
% \!\@outputpage! should be invoked at the page break to let
% $\mpbout=\mpboutz$ because the marginal notes in previous environments do
% not afffect those in the new environment.
%
% Note that $\mpbout$ is also referred to and updated by
% \!\pcol@do@mpb@all@i! and \!\pcol@do@mpb@all@ii! because they are used in
% \!\pcol@bias@mpbout! and \!\pcol@getmparbottom@last! through
% \!\pcol@do@mpb@all!.
%
% \begin{macrocode}
\gdef\pcol@mparbottom@zero{{\@elt{0}{0}}{\@elt{0}{0}}{\@elt{0}{0}}{\@elt{0}{0}}}
\global\let\pcol@mparbottom@out\pcol@mparbottom@zero
% \end{macrocode}
% \end{macro}\end{macro}
%
% \KeepSpace{2}
% \begin{macro}{\pcol@do@mpbout}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to do specified operations on $\string\cal{M}$ and its
% element $M_L^x$ acccording to the side margin for marginal notes
% outside \texttt{paracol} environments.}
% \begin{macro}{\pcol@do@mpbout@i}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to do specified operations on $\string\cal{M}$ and its
% element $M_L^x$ acccording to the side margin for marginal notes
% outside \texttt{paracol} environments.}
% \begin{macro}{\pcol@do@mpbout@whole}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to do a specified operation on $\string\cal{M}$.}
% \begin{macro}{\pcol@do@mpbout@elem}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to do a specified operation on an element $M_L^x$ in
% $\string\cal{M}$.}
%
% The macro \!\pcol@do@mpbout! is used in \!\pcol@output@start! and
% \!\pcol@output@end! to perform operations specified by
% \!\pcol@do@mpbout@whole! and \!\pcol@do@mpbout@elem!. The macro just
% invokes \!\pcol@do@mpbout@i! giving it all
% $M\in\Set{\mpb_X^x}{X\in\{L,R\},x\in\{l,r\}}$ by \!\expandafter!.
%
% Then \!\pcol@do@mpbout@i! determines the side margin $x\in\{l,r\}$ letting
% $x=l$ iff $\CSIndex{if@mparswitch}=\true$, $\page(p)\bmod2=0$ and
% $\CSIndex{if@reversemargin}=\false$, to invoke \!\pcol@do@mpbout@whole!
% giving it all $M$ but $\mpb_L^x$ whose sole element $\mpar(t,b)$
% may be modified by $\!\pcol@do@mpbout@elem!\!\@elt!\Arg{t}\Arg{b}$.
%
% In \!\pcol@output@start!, \!\pcol@do@mpbout@whole! is to \!\xdef!ine
% $\mpbout$ with all $M$ and \!\pcol@do@mpbout@elem! is expanded to
% $\mpar(0,B)$, where $B=\!\@mparbottom!$, regardless of $\mpb_L^x$ so that
% it is replaced with $(\mpar(0,B))$ in the modified $\mpbout$ keeping other
% elements unchanged. In \!\pcol@output@end!, \!\pcol@do@mpbout@whole! is
% to throw all $M$ away into a \!\hbox! while \!\pcol@do@mpbout@elem! lets
% $B=b$ so that the bottom of the last marginal note in the side margin
% specified by $x$ is passed to \postenv{} through \!\@mparbottom!.
%
% \begin{macrocode}
\def\pcol@do@mpbout{\expandafter\pcol@do@mpbout@i\pcol@mparbottom@out}
\def\pcol@do@mpbout@i#1#2#3#4{\@tempcnta\@ne
\if@mparswitch \ifodd\c@page\else \@tempcnta\m@ne \fi\fi
\if@reversemargin \@tempcnta-\@tempcnta \fi
\ifnum\@tempcnta<\z@
\pcol@do@mpbout@whole{\pcol@do@mpbout@elem#1}{#2}{#3}{#4}%
\else
\pcol@do@mpbout@whole{#1}{\pcol@do@mpbout@elem#2}{#3}{#4}%
\fi}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@bias@mpbout}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to perform coordinate transformation of the elements in
% $\string\cal{M}$.}
% \begin{macro}{\pcol@bias@mpbout@i}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to perform coordinate transformation of the elements in
% $\string\cal{M}$.}
%
% The macro $\!\pcol@bias@mpbout!\Arg{y}$ is used in \!\pcol@output@start!
% with $-y$ being the heigh-plus-depth of \preenv{}, in
% \!\pcol@output@end! with $y$ being that of \spanning{} in the \lpage, and
% in $\!\pcol@getmparbottom@last!\Arg{y}$ with its argument $y$. The macro
% modifies $\mpar(t,b)$ in all $M\in\Set{\mpb_X^x}{X\in\{L,R\},x\in\{l,r\}}$
% of $\mpbout$ so that they have $\mpar(t{+}y,b{+}y)$ for the transformation
% from text area coordinates to columns in the first and third, while for
% the reverse transformation in the second, by invoking \!\pcol@do@mpb@all!
% giving it $\mpbout$ and letting \!\reserved@a! have
% $\!\pcol@bias@mpbout@i!\Arg{y}$. That is,
% $\!\pcol@bias@mpbout@i!\Arg{y}\!\@elt!\Arg{t}\Arg{b}\!\@nil!$ is then
% invoked in \!\pcol@do@mpb@all@ii! with $t$ and $b$ from $\mpar(t,b)$ in
% each $M$, and then it \!\def!ines \!\reserved@b! with $\mpar(t{+}y,b{+}y)$
% so that updated $M$ has it.
%
% \begin{macrocode}
\def\pcol@bias@mpbout#1{\def\reserved@a{\pcol@bias@mpbout@i{#1}}%
\pcol@do@mpb@all\pcol@mparbottom@out}
\def\pcol@bias@mpbout@i#1\@elt#2#3\@nil{%
\dimen@#2sp\relax \advance\dimen@#1\relax
\dimen@ii#3sp\relax \advance\dimen@ii#1\relax
\def\reserved@b{\@elt{\number\dimen@}{\number\dimen@ii}}}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@getmparbottom@last}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to let $\string\cal{M}$ have the occupancy information of
% the bottom marginal note in each margin.}
% \begingroup\let\small\footnotesize
% \begin{macro}{\pcol@getmparbottom@last@i}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to let $\string\cal{M}$ have the occupancy information of
% the bottom marginal note in each margin.}
%
% The macro $\!\pcol@getmparbottom@last!\Arg{y}$ is used solely in
% \!\pcol@output@end! to let
% $\mpbout=\Arg{m_L^l}\Arg{m_L^r}\Arg{m_R^l}\Arg{m_R^r}$, where
% $m_X^x=\mpar(t_n,b_n)\in\mpb_X^x$, $n=\Abs{\mpb_X^x}$ asuming
% $\mpar(t_0,b_0)={\mpar}(y,y)$, and $y$ is the negative counterpart of the
% height-plus-depth of the \spanning{} in the \lpage. Therefore, $\mpbout$
% is let have the occupancy information of the last marginal note if any, or
% the top edge of text area otherwise, in each margin.
%
% The macro at first examines if $\pp^m(\ptop)=\emptyset$ and, if so, lets
% all elements in $\mpbout$ have $(\mpar(y,y))$ by letting it $\mpboutz$ and
% then adding $y$ to each $t=b=0$ by \!\pcol@bias@mpbout! giving it $y$.
% Otherwise, i.e., if $\pp^m(\ptop)\neq\emptyset$, it invokes
% \!\pcol@do@mpb@all! giving it $\pp^m(\ptop)$ and letting \!\reserved@a!
% have $\!\pcol@getmparbottom@last@i!\Arg{y}$. That is,
% $\!\pcol@getmparbottom@last@i!\Arg{y}\~\mpar(t_1,b_1)\cdots
% \mpar(t_n,b_n)\!\@nil!$ is then invoked in \!\pcol@do@mpb@all@ii! for each
% $\mpb_X^x$ to let \!\reserved@b! have $\mpar(y,y)$ at first and then to
% let it have $\mpar(t_i,b_i)$ for all $i\in[1,n]$. Therefore,
% \!\reserved@b! should finally have $\mpar(t_n,b_n)$ assuming $t_0=b_0=y$,
% and then becomes $m_X^x$.
% \end{macro}\endgroup
%
% \begin{macrocode}
\def\pcol@getmparbottom@last#1{%
\ifx\pcol@mparbottom\@empty
\global\let\pcol@mparbottom@out\pcol@mparbottom@zero
\pcol@bias@mpbout{#1}%
\else
\def\reserved@a{\pcol@getmparbottom@last@i{#1}}%
\pcol@do@mpb@all\pcol@mparbottom
\fi}
\def\pcol@getmparbottom@last@i#1#2\@nil{%
\edef\reserved@b{\@elt{\number#1}{\number#1}}%
\def\@elt##1##2{\def\reserved@b{\@elt{##1}{##2}}}%
#2\let\@elt\relax}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{1}
% \begin{macro}{\pcol@do@mpb@all}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to implement \cs{pcol@bias@mpbout} and
% \cs{pcol@getmparbottom@last}.}
% \begin{macro}{\pcol@do@mpb@all@i}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to implement \cs{pcol@bias@mpbout} and
% \cs{pcol@getmparbottom@last}.}
% \begin{macro}{\pcol@do@mpb@all@ii}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to implement \cs{pcol@bias@mpbout} and
% \cs{pcol@getmparbottom@last}.}
%
% The macro $\!\pcol@do@mpb@all!\<L\>$ is used in \!\pcol@bias@mpbout! with
% $L=\mpbout$ and in \!\pcol@getmparbottom@last! with $L=\pp^m(\ptop)$, to
% process all four elements $\mpb_X^x$ in $L$ applying \!\reserved@a! to
% each of them and to let $\mpbout$ have the result through \!\reserved@b!.
% The macro simply invokes \!\pcol@do@mpb@all@i! giving it the body of $L$
% by \!\expandafter!. Then $\!\pcol@do@mpb@all@i!
% \Arg{\mpb_L^l}\Arg{\mpb_L^r}\Arg{\mpb_R^l}\Arg{\mpb_R^r}$ initialize
% $\mpbout=\emptyset$ and then invokes \!\pcol@do@mpb@all@ii! four times
% giving it each $\mpb_X^x$. Then
% $\!\pcol@do@mpb@all@ii!\,\mpar(t_1,b_1)\cdots\~{\mpar}(t_n,b_n)\!\@nil!$
% invokes \!\reserved@a! giving it all of $\mpar(t_i,b_1)$ at once to
% process them and to have the result in \!\reserved@b! being added to
% $\mpbout$.
%
% \begin{macrocode}
\def\pcol@do@mpb@all#1{\expandafter\pcol@do@mpb@all@i#1}
\def\pcol@do@mpb@all@i#1#2#3#4{\begingroup \let\@elt\relax
\gdef\pcol@mparbottom@out{}%
\pcol@do@mpb@all@ii#1\@nil\pcol@do@mpb@all@ii#2\@nil
\pcol@do@mpb@all@ii#3\@nil\pcol@do@mpb@all@ii#4\@nil
\endgroup}
\def\pcol@do@mpb@all@ii#1\@nil{%
\reserved@a#1\@nil
\xdef\pcol@mparbottom@out{\pcol@mparbottom@out{\reserved@b}}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
%
%
% \subsection{Synchronization}
% \label{sec:imp-sout-sync}
%
% \begin{macro}{\pcol@sync}
% \changes{v1.0}{2011/10/10}
% {Add measurement of $D_T$.}
% \changes{v1.2-3}{2013/05/11}
% {Modify the action on the page overflow to return from \cs{output}
% without flushing so that the page is broken outside \cs{output} to
% place top floats above the synchronization point set in the next
% page.}
% \changes{v1.2-2}{2013/05/11}
% {Revise reflecting the redesign of page context.}
% \changes{v1.2-2}{2013/05/11}
% {Add pre-flushing column height check taking page-wise
% footnotes into account.}
% \changes{v1.3-6}{2013/09/17}
% {Add the initialization of
% $\cs{ifpcol@dfloats}\EQ\string\mathit{false}$ before invoking
% \cs{pcol@measurecolumn}.}
%
% The macro \!\pcol@sync! is invoked solely from \!\pcol@output@switch! for
% \exsync{} in the following three cases in which
% $\CSIndex{ifpcol@sync}\lor\CSIndex{ifpcol@clear}=\true$ commonly.
%
% \begin{itemize}
% \item
% $\CSIndex{ifpcol@sync}\land\lnot\CSIndex{ifpcol@clear}$ to mean ordinary
% \sync{}ed \cswitch.
%
% \item
% $\CSIndex{ifpcol@sync}\land\CSIndex{ifpcol@clear}$ to mean \pfcheck.
%
% \item
% $\lnot\CSIndex{ifpcol@sync}\land\CSIndex{ifpcol@clear}$ to mean page
% flushing.
% \end{itemize}
%
% In any cases\footnote{
%
% In the last case of page flushing, invoking \!\pcol@flushcolumn! is
% redundant because it is made $p=\ptop$ by \pfcheck{} always preceding the
% flushing, but the invocation is harmless.},
%
% first we invoke \!\pcol@flushcolumn! for all $c\In0\C$ to flush the
% \ccolpage{} of $c$ into $\S_c$ if the \colpage{} is not in $\ptop$, i.e.,
% $\cc_c(\vb^p)<\ptop$ and then, if we have deferred floats, to ship out
% following \fpage{}s up to $\ptop-1$ into $\S_c$ and to place them in
% $\ptop$. This float placement in $\ptop$ is only for top and bottom
% floats in \sync{}ed \cswitch{}, while a \fcolumn{} may be made in other
% cases. Then we ship out all pages $p$ such that $p<\ptop$ by
% \!\pcol@outputcolumns! giving argument 1. After that, we obtain the
% \pctext{} of $\ptop$ by \!\pcol@getcurrpinfo!.
%
% Next, we measure the vertical sizes of the contents in the \ccolpage{} of
% $c$ which is now in $\ptop$ for all $c\In0\C$ by \!\pcol@measurecolumn! as
% follows, where $h(x)$ and $d(x)$ are the height and depth of an object $x$
% respectively.
%
% \begin{eqnarray*}
% \sigma&=&\rlap{\!\floatsep!}\hskip8em
% \sigma_t=\cases{\cc_c(\tf)& $\cc_c(\tf)<\infty$\cr
% \!\textfloatsep!&$\cc_c(\tf)=\infty$}\qquad
% \sigma_b=\!\textfloatsep!\\
% \Uidx\fc(t)&=&\rlap{$\displaystyle(\cc_c(\tl)\neq())$}\hskip8em
% \fc(m)=(\cc_c(\vb)\neq\!\vbox!|{}|)\\
% \fc(f)&=&\rlap{$\displaystyle(\cc_c(\ft)\neq\bot)$}\hskip8em
% \fc(b)=\fc(b')=(\cc_c(\bl)\neq())\\
% \Uidx\Fc(X)&=&\rlap{$\displaystyle\exists x\in X:\fc(x)$}\hskip8em
% f_b=\CSIndex{ifpcol@bfbottom}\\
% \Uidx\vc(t)&=&\!\skip!{\cdot}\cc_c(\vb)=
% \sum_{\Sub{\phi\in\cc_c(\tl)}}(h(\phi)+d(\phi))+
% (\Abs{\cc_c(\tl)}-1)\cdot\sigma+\sigma_t\\
% \vc(m)&=&h(\cc_c(\vb))+d(\cc_c(\vb))\\
% \vc(f)&=&h(\cc_c(\ft))+d(\cc_c(\ft))\\
% \vc(b)&=&\sum_{\Sub{\phi\in\cc_c(\bl)}}(h(\phi)+d(\phi))+
% (\Abs{\cc_c(\bl)}-1)\cdot\sigma+\sigma_b\\
% \vc(b')&=&\vc(b)+\sigma_b\\
% \pd_c&=&\cases{\cc_c(\pd)&$\fc(m)$\cr
% \infty &$\lnot \fc(m)$}\\
% \Uidx\size_c(x)&=&\cases{\vc(x)&$\fc(x)$\cr
% 0 &$\lnot \fc(x)$}\\
% \Uidx\Size_c(X)&=&\cases{\displaystyle\sum_{x\in X}\size_c(x)&$\Fc(X)$\cr
% -\infty& $\lnot \Fc(X)$}\\
% \Uidx\VT&=&\!\@tempdima!=\max_{0\leq c<\C}\{\Size_c(\{t,m\})\}\\
% \Uidx\VB&=&\!\@tempdimb!=\max_{0\leq c<\C}\{\size_c(f)+\size_c(b)\}\\
% \Uidx\VP&=&\!\@pageht!=\max_{0\leq c<\C}\{\Size_c(\{t,m,f,b\})\}\\
% \Uidx\VPP&=&\!\pcol@colht!=\max_{0\leq c<\C}\{\Size_c(\{t,m,f,b'\})\}\\
% \Uidx\DT&=&\!\@tempdimc!=\min\Set{\pd_c}{\Size_c{\{t,m\}=\VT}}\\
% \Uidx\dc&=&\cases{
% 0& $\fc(b)\land(\lnot \fc(f)\lor f_b)$\cr
% d(\cc_c(\ft))& $\fc(f)\land(\lnot \fc(b)\lor\lnot f_b)$\cr
% d(\cc_c(\pd))& $\lnot \fc(b)\land\lnot \fc(f)$}\\
% \Uidx\DP&=&\!\@pagedp!=\min\Set{\dc}{\Size_c(\{t,m,f,b'\})=\VPP}\\
% \Uidx\cmax&=&\!\@tempcntb!=\ARG\max_{0\leq c<\C}\{\Size_c(\{t,m,f,b\})\}
% \end{eqnarray*}
%
% That is, $\VT$ is the maximum of combined vertical size (height plus
% depth) of the top floats and the main vertical list, $\VB$ is that of
% the footnotes and bottom floats, and $\VP$ is that of all items.
% $\VPP$ is similar to $\VP$ but we add \!\textfloatsep! to the size of
% bottom floats. Note that $\VT$, $\VP$ and $\VPP$ are $-\infty$ if any
% \colpage{}s don't have corresponding items, while $\VB=0$ if so.
% Also note that $\cmax$ is the ordinal of the column whose size is $\VP$.
%
% $\DT$ and $\DP$ are the minimum $\pd_c$ and $\dc$ respectively among those
% gives $\VT$ and $\VPP$ respectively, where $\pd_c$ is $\cc_c(\pd)$ if
% $f_m=\true$ or $\infty$ otherwise, and $\dc$ is 0 if $c$ has bottom float,
% or the depth of the last footnote if any and without any bottom float, or
% $\cc_c(\pd)$ otherwise. The reason why $\DT$ and $\DP$ have minimums is
% that they are set into \!\prevdepth! for the items just following the
% \sync{}ation point, and thus a smaller value results in a larger interline
% skip and the special value $-1000\,|pt|$ to inhibit the skip by, e.g.,
% \!\nointerlineskip!, is given the highest priority.
%
% Note that $\VPP$ and $\DP$ are only for the \lpage{} and thus referred to
% by \!\pcol@output@end! to close the environment, and the former is done by
% \!\pcol@makeflushedpage! if it works on the page. The reason why we add
% \!\textfloatsep! to $\VPP$ is to make the last page well separated from
% the \postenv{} if the tallest column, taking the addition into account,
% has bottom floats. Also note that we let
% $\CSIndex{ifpcol@dfloats}=\false$ before scanning columns with
% \!\pcol@measurecolumn! so that the switch becomes $\true$ after the scan
% iff a column has deferred floats (in the \lpage{}).
%
% \begin{macrocode}
%% Special Output Routines: Synchronization
\def\pcol@sync{%
\pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do\pcol@flushcolumn
\pcol@outputcolumns\@ne
\pcol@getcurrpinfo{\global\c@page}{\global\@colht}{\global\topskip}%
\@tempdima-\maxdimen \@tempdimb-\maxdimen \pcol@colht-\maxdimen
\@pageht-\maxdimen \@tempdimc\maxdimen \@pagedp\maxdimen \@tempcntb\z@
\pcol@dfloatsfalse
\pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do\pcol@measurecolumn
% \end{macrocode}
%
% As described above, any items can be empty, naturally for top floats,
% footnotes and bottom floats, but also including main vertical lists if the
% \ccolpage{}s were not in $\ptop$ before the invocation of
% \!\pcol@flushcolumn!. Moreover, all main vertical lists can be empty if
% all \lcolpage{}s just have started (by \!\newpage!, for example). More
% weirdly, the case of all-empty main vertical lists can be accompanied with
% other non-empty items when columns have floats or footnotes which cannot
% be in $\ptop-1$ but are found their places in $\ptop$.
%
% Taking it into account that any items can be empty and the other item
% of \Scfnote{}s, we have to determine whether the following two operations
% are taken; invocation of \!\pcol@synccolumn! for each \colpage{} to set a
% \sync{}ation point or to add an infinite stretch (and shrink) to its
% bottom; and the examination of the height of each \colpage{}, taking the
% \sync{}ation point to be set into account, to tell the necessity of
% explicit page break with $\CSIndex{ifpcol@flush}=\true$. For the latter
% we calculate the examination target $V=\!\@tempdimb!$ to be compared with
% $\pp^h(\ptop)$, while for the former we determine the value of a switch
% $f=\CSIndex{if@tempswa}$ so that we invoke \!\pcol@synccolumn! iff
% $f=\true$ and $V\geq0$.
%
% For \sync{}ed \cswitch{} with $\CSIndex{ifpcol@clear}=\false$, we let
% $f=(\VT\geq0)$ to mean at least one \colpage{} has a top float or
% non-empty main vertical list, i.e., $\Fc(\{t,m\})={\true}$ for some
% $c\In0\C$. That is if $\VT<0$, since the next items added to all
% \colpage{}s are placed at the top of the page\footnote{
%
% In usual cases, but it can mean some of them have negative vertical
% sizes. Even though we can detect such a very unlikely special case, it is
% very tough to define the reasonable \sync{}ation point above the top of
% $\ptop$. Therefore, we assume the point is at the top of $\ptop$ and thus
% do nothing.},
%
% we don't need to set \sync{}ation points in them. As for $V$, we let
% $V=\max(\VT,0)+\max(\VB,0)+v^f$ where $v^f$ is the sum of
% height-plus-depth of $\pp^f(\ptop)$ and $\!\skip!{\cdot}\pp^f(\ptop)$ if
% $\ptop$ has \Scfnote{}s, or 0 otherwise\footnote{
%
% In the real implementation, $V=-\infty$ if $\VT=\VB=-\infty$ and no
% \Scfnote{}s are presented, but this difference does not affect the
% decisoins because $f\land(V\geq0)=(\VT<0)\land(V\geq0)=\false$ and
% $V\leq\pp^f(\ptop)$ with either $V=0$ or $V=-\infty$.}.
%
% Note that it can be $\VP+v^f\leq\pp^h(\ptop)<\VT+\VB+v^f=V$ to mean
% setting the \sync{}ation point at $\VT$ below $\ptop$'s top edge would
% push bottom stuff beyond its bottom edge and thus we need an explicit page
% break to place the point at the top of $\ptop+1$ (in usual cases).
%
% For \pfcheck{} or page flushing with $\CSIndex{ifpcol@clear}=\true$ on
% the other hand, we let $f=\lnot\!\pcol@sync!$ to invoke \!\pcol@synccolumn!
% only for page flushing and thus not for \pfcheck{}. As for $V$, we let
% $V'=\VPP$ or $V'=\VP$ according as we working on \lpage{} or not, and
% then let $V=\max(V',0)+v^f$ or $V=V'$ according as $\ptop$ has \Scfnote{}s
% or not. That is, we have to invoke \!\pcol@synccolumn! unless $\ptop$ is
% perfectly empty.
%
% Then if $\CSIndex{ifpcol@clear}=\false$ and
% $\max(V,\;V-D'_T+\VE)>\pp^h(\ptop)$ where $D'_T=\DT$ if $0\leq\DT<\infty$ or
% 0 otherwise, or $\CSIndex{ifpcol@clear}=\true$ and
% $V>\pp^h(\ptop)$\footnote{
%
% The examination is redundant in page flushing with
% $\CSIndex{ifpcol@sync}=\false$ because it is assured that no overflow
% happens in any \colpage{} by \pfcheck{} and explicit page breaking, but is
% not harmful.},
%
% we flush the page. That is, if the condition above holds,
% we let $\CSIndex{ifpcol@flush}=\true$ and $d=\!\pcol@nextcol!={\cmax}$ to
% tell \!\pcol@switchcol! or \!\pcol@flushclear! to make an explicit page
% break in the column $\cmax$ from which we restart, and $f=\false$ to skip
% \!\pcol@synccolumn! to postpone the \exsync{}. Note that the bias
% $\VE=\!\pcol@@ensurevspace!$ in \sync{}ed \cswitch{} is to avoid breaking a
% \colpage{} just below the \sync{}ation point due to too small space below
% the point, less than \!\baselineskip! in default but can be other
% threshold explicitly defined by \!\ensurevspace!. That is,
% since $V-\DT+k\!\baselineskip!$ usually means the vertical position at
% which $k$-th baseline below the \sync{}ation point is placed, the flushing
% condition with $\VE=k\!\baselineskip!$ ensures that the page is flushed
% iff the space below the point cannot accommodate $k$ lines. Also note that
% necessary flushing with $V>\pp^h(p)$ assuredly takes place even when
% $\DT$ is unusually large and/or $\VE$ is negative to make $-\DT+\VE<0$.
%
% Finally if $V\geq0$ and $f=\true$, we invoke \!\pcol@synccolumn! for each
% column $c\In0\C$ to set a \sync{}ation point in it or to add an infinite
% stretch (and shrink) at its bottom for flushing.
%
% \changes{v1.3-6}{2013/09/17}
% {Modify the flushing condition of synchronized column switching from
% $V\GT\pi^h(p)$ to $\max(V,V-D_T+V_E)\GT\pi^h(p)$ to avoid page
% break just below the synchronization point as much as possible.}
%
% \begin{macrocode}
\@tempswatrue \global\pcol@flushfalse
\ifpcol@clear
\ifpcol@lastpage \@tempdimb\pcol@colht \else \@tempdimb\@pageht \fi
\ifpcol@sync \@tempswafalse \fi
\else
\ifdim\@tempdima<\z@ \@tempswafalse
\else\ifdim\@tempdimb<\z@ \@tempdimb\@tempdima
\else \advance\@tempdimb\@tempdima
\fi\fi
\fi
\ifpcol@scfnote\ifvoid\pcol@footins\else
\ifdim\@tempdimb<\z@ \@tempdimb\z@ \fi
\advance\@tempdimb\ht\pcol@footins \advance\@tempdimb\dp\pcol@footins
\advance\@tempdimb\skip\pcol@footins
\fi\fi
\dimen@\@tempdimb
\ifpcol@clear\else \ifdim\dimen@<\z@\else
\ifdim\@tempdimc=\maxdimen\else \ifdim\@tempdimc<\z@\else
\advance\dimen@-\@tempdimc
\fi\fi
\advance\dimen@\pcol@@ensurevspace
\ifdim\dimen@<\@tempdimb \dimen@\@tempdimb \fi
\fi\fi
\ifdim\dimen@>\@colht
\global\pcol@flushtrue \@tempswafalse \pcol@nextcol\@tempcntb
\fi
\ifdim\@tempdimb<\z@\else \if@tempswa
\pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do\pcol@synccolumn
\fi\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@flushcolumn}
% \changes{v1.0}{2011/10/10}
% {Rename \cs{pcol@maxpage} as \cs{pcol@toppage}.}
% \changes{v1.0}{2011/10/10}
% {Add \cs{vfil} at the bottom of flushed column-page.}
% \changes{v1.0}{2011/10/10}
% {Change order of the garbage collection of \cs{pcol@currfoot} and
% \cs{pcol@getcurrfoot}.}
% \changes{v1.2-2}{2013/05/11}
% {Revise reflecting the redesign of \cs{pcol@getcurrfoot}.}
% \changes{v1.2-2}{2013/05/11}
% {Add operations for page-wise footnotes.}
% \changes{v1.2-2}{2013/05/11}
% {Add the examination of $\kappa_c(\rho)\EQ\infty$ to cope with a
% rare-case interaction of pre-flushing column height check and float
% columns in last pages.}
% \changes{v1.2-7}{2013/05/11}
% {Save \cs{ifpcol@lastpage} into \cs{ifpcol@lastpagesave} and turn
% \cs{ifpcol@lastpage} $\string\mathit{false}$ temporarily during
% the macro works on non-top and thus non-last pages to fix the bug
% that \cs{@makecol} and \cs{pcol@makefcolumn} misunderstand the page
% they work on is last.}
% \changes{v1.2-7}{2013/05/11}
% {Replace \cs{@makecol} with \cs{pcol@@makecol} to cap the depth of
% \cs{@outputbox} by \cs{@maxdepth} even with p\string\LaTeX.}
% \changes{v1.21}{2013/06/06}
% {Add page and column numbers to logging.}
% \changes{v1.3-6}{2013/09/17}
% {Fix the problem that a flushed column in a non-top page causes
% overfull due to its hight-plus-depth greater than $\pi^h(p)$.}
% \changes{v1.3-3}{2013/09/17}
% {Add \cs{@colht} and \cs{relax} as the first and third argument
% of \cs{pcol@shrinkcolbyfn} for all of three invocations of it.}
% \changes{v1.3-6}{2013/09/17}
% {Add \cs{@maxdepth} as the first argument of \cs{pcol@@makecol}.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% The macro \!\pcol@flushcolumn! is invoked for each column $c\In0\C$ from
% \!\pcol@sync! to ship out the \ccolpage{} of $c$ into $\S_c$ if it is not
% leading one\Index{leading column-page}, i.e., $p=\cc_c(\vb^p)<\ptop$. The
% macro also ships out \fpage{}s from $p+1$ up to $\ptop-1$ if we have
% deferred floats to fill them and, if this float flushing still leaves
% deferred floats, puts some of them to the \lcolpage{} being
% current\Index{current column-page}{} now as its top and/or bottom floats.
%
% First we obtain the \cctext{} in $\cc_c$ by \!\pcol@getcurrcol! and
% examines if $p=\cc_c(\vb^p)<\ptop$. If it does not hold to mean $c$ has
% \lcolpage{}, we do nothing.
%
% Otherwise, we save \CSIndex{ifpcol@lastpage} into
% \CSIndex{ifpcol@lastpagesave} turning the former switch $\false$ because we
% are working on a non-\lcolpage{} definitely in a non-\lpage. Then we put
% the contents of the \ccolpage{} $\cc_c(\vb^b)$ adding \!\vfil! at its tail
% into \!\box!|255| being the \TeX's standard interface to carry the main
% vertical list for \!\output! routine. We also move everything in
% $\cc_c(\ft)$ obtained by \!\pcol@getcurrfoot! into \!\footins! and return
% $\cc_c(\ft)$ to \!\@freelist! if $\cc_c(\ft^b)$ is not void.
%
% Then we obtain $p$'s \pctext{} by \!\pcol@getcurrpage! and, if it has
% \Scfnote{}s in $\pp^f(p)$, we shrink \!\@colht! by the space required for
% the footnotes using \!\pcol@shrinkcolbyfn! and add the stretch\slash
% shrink compontents of $\!\skip!\cdot\pp^f(p)$ at the bottom of
% \!\box!|255| by \!\pcol@unvbox@cclv!, as we did in \!\pcol@makecol!.
% Otherwise we take a special care of the case that the height-plus-depth of
% $\cc_c(\vb^b)$ is greater than $\pp^h(p)$ due to that its height is almost
% equal to $\pi^h(p)$ and thus its depth makes the hight-plus-depth
% exceeding $\pi^h(p)$. This excess is revealed by the \!\vfil! we just
% have added making the height-plus-depth the height of \!\box!|255|, and
% would cause overfull in \!\@makecol! and \!\pcol@@makecol! because they
% need the height, i.e., not height-plus-depth, of \!\box!|255| not
% exceeding $\pp^h(p)$. Therefore if it happens, we we remove the \!\vfil!
% and cap the height of \!\box!|255| by \!\@maxdepth! to pretend as if the
% box is directly passed from \TeX's page builder.
%
% Next we examine if $\cc_c(\tr)$ was made $\infty$ by \!\pcol@makefcolumn!
% invoked from this macro itself when it processed the \colpage{} in the
% previous \pfcheck{} for environment closing, which found a page break
% should be done. That is, $\cc_c(\tr)=\infty$ means the \ccolpage{} was
% once judged to be in the \lpage{} but \pfcheck{} forced a page break to
% make it non-last, it should have all deferred floats now listed in
% $\cc_c(\tl)$ at \Endparacol{}, but their total size is less than the
% threshold to make a usual \fcolumn{} for the \lpage. If so, since the page
% is not last now, we put all floats in $\cc_c(\tl)$ by \!\pcol@makefcolpage!
% as the ship-out image in \!\@outputbox!, ignoring the contents added to
% \!\box!|255| in the operations above because $\cc_c(\vb^b)$ should be
% empty, and letting $\cc_c(\tr)=0$ to mean the floats have been
% processed\footnote{
%
% $\cc_c(\tl)$ can have any values other than $\infty$ because definitely it
% will not be referred to in its inherent sense in the situation with no
% further float additions and no deferred floats.}.
%
% Otherwise, since the \colpage{} can be put as usual, we invoke
% \!\pcol@@makecol!\footnote{
%
% Neither \cs{pcol@makecol} because \!\box!\texttt{255} has \!\vfil! at its
% tail and the \colpage{} should be short enough, nor \cs{@makecol} because
% we need to ensure the depth of resulting \cs{@outputbox} is capped.}
%
% giving \!\@maxdepth! to it to build the complete \colpage{} in
% \!\@outputbox! with depth capping and with the following setting\footnote{
%
% \LaTeX's has another \!\insert! named \!\@kludgeins! for \!\enlargepage!
% but \Paracol{} does not cares about it.}.
% $$
% \begin{array}{lll}
% \!\box!|255|=\cc_c(\vb^b)&
% \!\footins!=\cc_c(\ft)&
% \!\@colht!=\pp^h(\cc_c(\vb^p))\\
% \!\@midlist!=\cc_c(\ml)&
% \!\@toplist!=\cc_c(\tl)&
% \!\@botlist!=\cc_c(\bl)
% \end{array}
% $$
% Finally, regardless of $\cc_c(\tr)=\infty$ or not, the resulting
% \!\@outputbox! becomes $\s_c(p)$ and is added to the tail of $\S_c$
% by \!\@cons!.
%
% \begin{macrocode}
\def\pcol@flushcolumn{%
\pcol@getcurrcol
\ifnum\count\@currbox<\pcol@toppage
\ifpcol@lastpage \pcol@lastpagesavetrue \else \pcol@lastpagesavefalse \fi
\pcol@lastpagefalse
\pcol@page\count\@currbox
\setbox\@cclv\vbox{\unvbox\@currbox \vfil}%
\ifvoid\pcol@currfoot\else
\pcol@Fb
\@cons\@freelist\pcol@currfoot
\pcol@Fe{flushcolumn(colfn)}%
\fi
\pcol@getcurrfoot\box
\pcol@getcurrpage
\ifvoid\pcol@footins
\ifdim\ht\@cclv>\@colht
\setbox\@cclv\vbox{\boxmaxdepth\@maxdepth \unvbox\@cclv \unskip}%
\fi
\else
\pcol@shrinkcolbyfn\@colht\pcol@footins\relax
\setbox\@cclv\vbox{\pcol@unvbox@cclv\pcol@footins}%
\fi
\pcol@Logstart{\pcol@flushcolumn(\number\c@page:\number\pcol@currcol)}
\ifdim\@toproom=\maxdimen
\setbox\@outputbox\pcol@makefcolpage \global\@toproom\z@
\else
\pcol@@makecol\@maxdepth
\fi
\pcol@Logend\pcol@flushcolumn
\global\setbox\@currbox\box\@outputbox
\expandafter\@cons\csname pcol@shipped\number\pcol@currcol\endcsname
\@currbox
% \end{macrocode}
%
% Then for each $q\in[p{+}1,\ptop{-}1]$, we repeat the followings; get $q$'s
% \pctext{} by \!\pcol@getcurrpage!; shrink \!\@colht! by
% \!\pcol@shrinkcolbyfn! if $q$ has \Scfnote{}s; try to make a \fcolumn{} in
% \!\@outputbox! by \!\@makefcolumn! giving it \!\@deferlist! being
% $\cc_c(\dl)$ at initial but will be shrunk; if the \fcolumn{} is made,
% acquire an \!\insert! by \!\@next! to keep the contents of \!\@outputbox!
% and to be added to the tail of $\S_c$ by \!\@cons!.
%
% \changes{v1.2-2}{2013/05/11}
% {Add \cs{@colht} shrinking by page-wise footnotes.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\advance\pcol@page\@ne
\ifx\@deferlist\@empty\else
\@whilenum\pcol@page<\pcol@toppage\do{%
\pcol@getcurrpage
\ifvoid\pcol@footins\else
\pcol@shrinkcolbyfn\@colht\pcol@footins\relax
\fi
\@makefcolumn\@deferlist
\if@fcolmade
\pcol@Fb
\@next\@currbox\@freelist{\global\setbox\@currbox\box\@outputbox}%
\pcol@ovf
\pcol@Fe{flushcolumn(fcol)}%
\expandafter\@cons
\csname pcol@shipped\number\pcol@currcol\endcsname\@currbox
\fi
\advance\pcol@page\@ne}%
\fi
% \end{macrocode}
%
% Next, since we reach $\ptop$ and thus restore \CSIndex{ifpcol@lastpage}
% from \CSIndex{ifpcol@lastpagesave} because the \tpage{} can be last.
% Then we acquire the \ccolpage{} of $c$ which is now in $\ptop$ and thus
% empty, by \!\@next!. Then we let $\!\@colht!=\!\@colroom!=\pp^h(\ptop)$
% by \!\pcol@getcurrpinfo! but shrinking them by \!\pcol@shrinkcolbyfn! if
% $\ptop$ has \Scfnote{}s, and reinitialize the float placement parameters by
% \!\pcol@floatplacement!. Then, if $\cc_c(\dl)$ still has some floats,
% we make a \fcolumn{} for some of them in the \tpage{} by
% \!\pcol@makefcolumn! if $\CSIndex{ifpcol@clear}={}\true$ meaning flushing,
% or try to move some of them to $\cc_c(\tl)=\!\@toplist!$ and/or
% $\cc_c(\bl)=\!\@botlist!$ by \!\pcol@trynextcolumn! otherwise. Note that
% since \!\@colroom! is used in \!\pcol@makefcolumn! as a working register,
% we let $\!\@colroom!=\pp^h(\ptop)$ again after its invocation. After that
% we save \cctext{} including those given by \!\pcol@floatplacement! and
% modified by \!\pcol@makefcolumn! or \!\pcol@trynextcolumn! into $\cc_c$ by
% \!\pcol@setcurrcolnf! because all footnotes are shipped out, and let
% $\cc_c(\vb^p)=\ptop$. We also let $\cc_c(\vb^r)=\!\@colroom!$ possibly
% modified by \!\pcol@trynextcolumn! but after canceling the shrinkage of
% \!\@colht! due to \Scfnote{}s, i.e.,
% $\cc_c(\vb^r)\gets\cc_c(\vb^r)+(H-H')$ where $H$ and $H'$ are \!\@colht!
% before and after the shrinkage respectively.
%
% \changes{v1.0}{2011/10/10}
% {Add $\cs{@colht}\EQ\pi^h(p)$.}
% \changes{v1.0}{2011/10/10}
% {Replace \cs{pcol@trynextcolumn} with \cs{pcol@makefcolumn} for the
% case of $\cs{ifpcol@clear}\EQ\mathit{true}$.}
% \changes{v1.2-2}{2013/05/11}
% {Revise reflecting the redesign of page context.}
% \changes{v1.2-2}{2013/05/11}
% {Add \cs{@colht} shrinking by page-wise footnotes.}
% \changes{v1.2-7}{2013/05/11}
% {Add the restore of \cs{ifpcol@lastpage} from
% \cs{ifpcol@lastpagesave}.}
% \changes{v1.21}{2013/06/06}
% {Fix the bug that $\kappa_c(\beta^p)$ is let have \cs{pcol@page},
% which can be less than $p_t\EQ\cs{pcol@toppage}$, to cause the column
% $c$ is lost or moved to a wrong page.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\ifpcol@lastpagesave \pcol@lastpagetrue \fi
\pcol@Fb
\@next\@currbox\@freelist{\global\setbox\@currbox\vbox{}}\pcol@ovf
\pcol@Fe{flushcolumn(col)}%
\pcol@getcurrpinfo\@tempcnta{\global\@colht}\@tempskipa
\@pageht\@colht
\ifvoid\pcol@footins\else \pcol@shrinkcolbyfn\@colht\pcol@footins\relax \fi
\global\@colroom\@colht \pcol@floatplacement
\ifx\@deferlist\@empty\else
\ifpcol@clear
\pcol@makefcolumn \global\@colroom\@colht
\else
\pcol@trynextcolumn
\fi\fi
\pcol@setcurrcolnf
\global\count\@currbox\pcol@toppage
\advance\@pageht-\@colht \advance\@pageht\@colroom
\global\dimen\@currbox\@pageht
\fi %\ifnum\count\@currbox<\pcol@toppage
\advance\pcol@currcol\@ne}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@makefcolumn}
% \changes{v1.0}{2011/10/10}
% {Introduced to take special care of the float-column in the last
% page. }
% \changes{v1.2-2}{2013/05/11}
% {Encapsulate the float column in a \cs{vbox} of \cs{@colht} so that
% vertical skips at the top and bottom are not lost when the column
% is put back to the main vertical list, and makes the assignment to
% \cs{@currbox} global because the box is now referred to after
% \cs{output} is completed.}
% \changes{v1.2-7}{2013/05/11}
% {Replace the sequence of operations to make a usual float column
% with \cs{@toplist} with the newly introduced
% \cs{pcol@makefcolpage}.}
% \changes{v1.33-2}{2016/11/19}
% {Remove a space after the \cs{vbox} to be assigned to \cs{@currbox}
% to obey the coding convention.}
%
% The macro \!\pcol@makefcolumn! is invoked solely from \!\pcol@flushcolumn!
% to put deferred floats in the currently empty \colpage{} of $c$ in the
% \tpage{} $\ptop$ which is being flushed. Since we have to take special care
% of the case of environment closing, we cannot do this operation by
% \!\@makefcolumn!, while in other cases for \!\flushpage! and \!\clearpage!
% we also have to pay a small attention.
%
% First, we scan the copy of $\cc_c(\dl)$ applying \!\pcol@makefcolelt! to
% each element to have the floats to be put in \!\@toplist!, which is
% assuredly empty because the \ccolpage{} of $c$ has already been shipped
% out to empty it, and those still deferred in $\cc_c(\dl)$. Prior to scan,
% we let $H_r=\pp^h(\ptop)\footnotemark+\alpha$\footnotetext{
%
% $\pp^h(\ptop)$ referred in this macro may have been shrunk by \Scfnote{}s
% in \cs{pcol@flushcolumn}.},
%
% as the space initially available for
% floats each of which being $\phi$ is assumed to consume
% $v(\phi)=h(\phi)+d(\phi)+\alpha$, and $H_t=\!\@colroom!=-\alpha$ as the
% initial value of the accumulated size of $v(\phi)$ for all $\phi$ to be
% put, where $\alpha=\!\floatsep!$ if $\CSIndex{ifpcol@lastpage}=\true$
%
% \SpecialIndex{\ifpcol@lastpage}
%
% as discussed afterward, or $\alpha=\!\@fpsep!$ otherwise.
%
% Then if the resulting \!\@toplist! is not empty\footnote{
%
% It can happen if the first float is larger than $\pp^h(\ptop)$.},
%
% we examine if $\ptop$ is the \lpage{} ($|\ifpcol@|\~|lastpage|=\true$)
%
% \SpecialIndex{\ifpcol@lastpage}
%
% and $\cc_c(\dl)$ is empty to mean the last \colpage{} have all deferred
% floats. This case is subtle because if we make the \colpage{} a \fcolumn{}
% it can be sparse and unnecessarily throw the \postenv{} to the next
% page. Therefore, we intend to pack floats to the page top as top floats
% and thus have let $\alpha=\!\floatsep!$ in the building process of
% \!\@toplist! above\footnote{
%
% We dare to do it knowing the natural component of \!\floatsep! is a little
% bit (4pt) larger than that \!\@fpsep! and the possibility of having
% fewer floats than those given by \!\@makefcolumn!.},
%
% but it may make a too tall \colpage{} only having floats shrinking
% the \postenv{} in the page. In addition, if other columns have
% \fpage{}s in the \lpage, packing the floats as top floats should give
% inconsistent appearance but we don't know whether the columns following
% $c$ has \fpage{}s. Therefore, we performs this float packing if making
% the \fpage{} gives too sparse, more specifically if
% $H_t<\!\floatpagefraction!\times\pp^h(\ptop)=\!\@fpmin!$, but postpone the
% final decision until the \colpage{} is eventually shipped out by
% \!\pcol@flushcolumn! or \!\pcol@makeflushedpage!. That is, if the all
% conditions above hold, we keep \!\@toplist! so that it is saved in
% $\cc_c(\tl)$ and let $\cc_c(\tr)=\infty$ to indicate that the column has
% pending floats. Note that the floats are shipped out by
% \!\pcol@flushcolumn! if the \pfcheck{} currently being performed finds a
% too tall column in $\ptop$ to force a page break making $\ptop$ non-last.
% Also note that, in any cases, letting $\cc_c(\tr)=\infty$ is safe because
% no longer we will have any float additions to the \colpage.
%
% Otherwise, i.e., if we are working on a non-\lpage{} to be flushed or a
% \fcolumn{} is to be made for the \lpage, we put all floats in \!\@toplist!
% in a \!\vbox! of $\pp^h(\ptop)$ tall by \!\pcol@makefcolpage! and then
% let $\cc_c(\vb^b)$ be another \!\vbox! having it. This encapsulation of
% the \fcolumn{} is necessary because $\cc_c(\vb^b)$ can be put back to the
% main vertical list after the \pfcheck{} to remove skips above and below
% the floats, namely \!\@fptop! and \!\@fpbot!, if the contents were not
% encapsulated.
%
% \begin{macrocode}
\def\pcol@makefcolumn{%
\ifpcol@lastpage \@tempdimc\floatsep \else \@tempdimc\@fpsep \fi
\@tempdima\@colht \advance\@tempdima\@tempdimc \global\@colroom-\@tempdimc
\begingroup
\let\@elt\pcol@makefcolelt
\let\reserved@b\@deferlist
\global\let\@deferlist\@empty
\reserved@b
\endgroup
\ifx\@toplist\@empty\else
\@tempswatrue
\ifpcol@lastpage \ifx\@deferlist\@empty \ifdim\@colroom<\@fpmin
\@tempswafalse \global\@toproom\maxdimen
\fi\fi\fi
\if@tempswa \global\setbox\@currbox\vbox{\pcol@makefcolpage}\fi
\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@makefcolelt}
% \changes{v1.0}{2011/10/10}
% {Introduced to take special care of the float-column in the last
% page. }
%
% The macro $\!\pcol@makefcolelt!\<\phi\>$ is invoked solely from
% \!\pcol@makefcolumn! to be applied to each float element $\phi$ in (the
% copy of) $\cc_c(\dl)$. We examine if $v(\phi)=h(\phi)+d(\phi)+\alpha\leq
% H_r$ to mean the \fcolumn{} being built has room large enough for the float
% $\phi$. If so, we add $\phi$ to \!\@toplist! by \!\@cons!, and let
% $H_r\gets H_r-v(\phi)$ and $H_t\gets H_t+v(\phi)$. Otherwise, we add
% $\phi$ to $\cc_c(\dl)$ by \!\@cons! to make it deferred again, and
% let $H_r=-\infty$ so that the examinations for any succeeding elements
% fail.
%
% \begin{macrocode}
\def\pcol@makefcolelt#1{%
\@tempdimb\ht#1{}\advance\@tempdimb\dp#1{}\advance\@tempdimb\@tempdimc
\ifdim\@tempdimb>\@tempdima \@cons\@deferlist#1\relax
\@tempdima-\maxdimen
\else \@cons\@toplist#1\relax
\advance\@tempdima-\@tempdimb \global\advance\@colroom\@tempdimb
\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@makefcolpage}
% \changes{v1.2-7}{2013/05/11}
% {Introduced to implement the operations to make a float column
% performed in three macros.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
% \changes{v1.33-2}{2016/11/19}
% {Add {\tt\%} to the end of the line to open \cs{vbox} to obey the
% coding convention.}
%
% The macro \!\pcol@makefcolpage! is invoked from \!\pcol@flushcolumn!,
% \!\pcol@makefcolumn! and \!\pcol@imakeflushedpage! to build a \fcolumn{}
% having floats in \!\@toplist!, which is then returned to \!\@freelist! and
% then emptied. The floats are put in a \!\vbox! of \!\@colht! tall with
% vertical skips of \!\@fptop!, \!\@fpsep! and \!\@fpbot! above, between and
% below them respectively. The box is then let be $\s_c(p)$ or
% $\cc_c(\vb^b)$ explictly or implicitly by the invokers, with an
% encapsulation in the case of \!\pcol@makefcolumn!.
%
% \begin{macrocode}
\def\pcol@makefcolpage{\vbox to\@colht{%
\vskip\@fptop \vskip-\@fpsep
\def\@elt##1{\vskip\@fpsep\box##1}\@toplist \vskip\@fpbot}%
\pcol@Fb
\xdef\@freelist{\@freelist\@toplist}\global\let\@toplist\@empty
\pcol@Fe{makefcolpage}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@measurecolumn}
% \changes{v1.0}{2011/10/10}
% {Drastically changed to measure $D_T$, to deal with empty
% main vertical list, and to omit \cs{topfigrule} and \cs{botfigrule}
% from float size measurement.}
%
% The macro \!\pcol@measurecolumn! is invoked for each column $c\In0\C$ from
% \!\pcol@sync! to measure the sizes of the top floats $\size_c(t)$, main
% vertical list $\size_c(m)$, footnotes $\size_c(f)$ and bottom floats
% $\size_c(b)$ in the \ccolpage{} in the page $\ptop$. After obtaining the
% \cctext{} in $\cc_c$ by \!\pcol@getcurrcol!, we calculate
% $\size_c(t)=\!\skip!{\cdot}\cc_c(\vb)$ by \!\pcol@addflhd! giving it
% $\cc_c(\tl)$ and $\cc_c(\tf)=\!\pcol@textfloatsep!$ as its arguments also
% to have $\CSIndex{if@tempswa}={\fc(t)}$. Note that $\cc_c(\tf)=\infty$ means
% the \colpage{} does not have any \sync{}ation points yet and thus
% \!\textfloatsep! is used in the calculation as the skip between the top
% floats and main vertical list, while the value itself possibly for a
% \mvlfloat{} discussed later is used if $\cc_c(\tf)<\infty$. We also
% calculate $\size_c(m)=h(\cc_c(\vb))+d(\cc_c(\vb))$, and then the sum of it
% and $\size_c(t)$.
%
% \begin{macrocode}
\def\pcol@measurecolumn{%
\pcol@getcurrcol
\@tempswafalse
\dimen@\z@ \pcol@addflhd\@toplist\pcol@textfloatsep
\global\skip\@currbox\dimen@
\advance\dimen@\ht\@currbox \advance\dimen@\dp\@currbox \dimen@ii\dimen@
% \end{macrocode}
%
% Next we examine if the main vertical list $\cc_c(\vb^b)$ is empty by
% \!\pcol@ifempty! and, if so, we let $\pd_c=\cc_c(\pd)=\infty$ and save it
% (together with others) by \!\pcol@setcurrcol! so that, if the column
% defines the $\VT$ finally by its top floats, $\DT$ is let $\infty$ and the
% fact that the column has empty list is remembered. Otherwise, we let
% $\pd_c=\cc_c(\pd)$ and $\CSIndex{if@tempswa}=\true$ to represent
% $\Fc(\{t,m\})=f_t\lor f_m$ because $f_m=\true$. Then we invoke
% \!\pcol@measureupdate! to let $\VT=\size_c(t)+\size_c(m)=\Size_c(\{t,m\})$
% and $\DT=\pd_c$ if $\Fc(\{t,m\})=\true$ and $\VT<\Size_c(\{t,m\})$.
%
% \begin{macrocode}
\pcol@ifempty\@currbox
{\global\pcol@prevdepth\maxdimen \pcol@setcurrcol}%
{\@tempswatrue}%
\pcol@measureupdate\@tempdima\dimen@ii\@tempdimc\pcol@prevdepth
% \end{macrocode}
%
% \changes{v1.2-2}{2013/05/11}
% {Add calculation of $V_P$ and $c_{\string\max}$.}
%
% Next we let $\size_c(f)=0$ if $\cc_c(\ft^b)$ is void, or otherwise let
% $\size_c(f)=h(\cc_c(\ft^b))+d(\cc_c(\ft^b))+{}\cc_c(\ft^s)$\footnote{
%
% We ignore the height and depth of \!\footnoterule! because they are
% expected to be 0 and are so in the default setting.}
%
% and $\CSIndex{if@tempswa}=\true$ because $\fc(f)=\true$ and thus
% $\Fc(\{t,m,f\})=\true$. After that, we calculate $\size_c(f)+\size_c(b)$
% by \!\pcol@addflhd! giving it $\cc_c(\bl)$ and $\infty$ to mean
% \!\textfloatsep! should be used for the calculation as its argument also
% to have $\CSIndex{if@tempswa}={\Fc}(\{t,m,f,b\})$. Then we let
% $\VB=\size_c(f)+\size_c(b)$ if $\VB<\size_c(f)+\size_c(b)$, and let
% $\VP=\size_c(t)+\size_c(m)+\size_c(f)+\size_c(b)=\Size_c(\{t,m,f,b\})$ and
% $c_{\max}=c$ if $\Fc(\{t,m,f,b\})=\true$ and $\VP<\Size_c(\{t,m,f,b\})$.
%
% \begin{macrocode}
\ifvoid\pcol@currfoot \dimen@\z@
\else
\dimen@\ht\pcol@currfoot \advance\dimen@\dp\pcol@currfoot
\advance\dimen@\skip\pcol@currfoot
\@tempswatrue
\fi
\pcol@addflhd\@botlist\maxdimen
\ifdim\dimen@>\@tempdimb \@tempdimb\dimen@ \fi
\advance\dimen@\dimen@ii
\if@tempswa \ifdim\dimen@>\@pageht
\@pageht\dimen@ \@tempcntb\pcol@currcol
\fi\fi
% \end{macrocode}
%
% Next, we let $\dc$ be the depth of the lowest non-empty items among the
% main vertical list, footnotes and bottom floats. That is, we let
% $\dc\gets\cc_c(\pd)$ at first, and then, if
% $\CSIndex{ifpcol@bfbottom}={\true}$, override it by $\dc\gets
% d(\cc_c(\ft^b))$ if there are footnotes, and finally override it by
% $\dc\gets0$ for the bottom floats if exist adding \!\textfloatsep! to
% $\Size_c(\{t,m,f,b\})$ to have $\Size_c(\{t,m,f,b'\})$. This overriding
% order of $d(\cc_c(\ft^b))$ and then 0 by bottom floats is reversed when
% $\CSIndex{ifpcol@bfbottom}=\false$ according to the implementation of
% \!\@makecol!. Then, we invoke \!\pcol@measureupdate! again to let
% $\VPP=\Size_c(\{t,m,f,b'\})$ and $\DP=\dc$ if $\Fc(\{t,m,f,b\})=\true$ and
% $\VPP<\Size_c(\{t,m,f,b'\})$. It also lets $\DP=\dc$ if
% $\Fc(\{t,m,f,b\})=\true$, $\VPP=\Size_c(\{t,m,f,b'\})$ and $\DP>\dc$.
%
% Finally, we let $\CSIndex{ifpcol@dfloats}=\true$ if
% $\cc_c(\dl)\neq\emptyset$ to tell \!\pcol@makeflushedpage! that the
% \lpage{} must be {\em full size} and \!\pcol@output@end! to flush the
% deferred \cwise{} floats.
%
% \changes{v1.3-6}{2013/09/17}
% {Revise the mechanism to tell \cs{pcol@makeflushedpage} and
% \cs{pcol@output@end} that a column in a last page has deferred
% column-wise floats with newly introduced \cs{ifpcol@dfloats}.}
%
% \begin{macrocode}
\dimen@ii\pcol@prevdepth
\ifpcol@bfbottom
\ifvoid\pcol@currfoot\else \dimen@ii\dp\pcol@currfoot \fi
\ifx\@botlist\@empty\else \dimen@ii\z@ \advance\dimen@\textfloatsep \fi
\else
\ifx\@botlist\@empty\else \dimen@ii\z@ \advance\dimen@\textfloatsep \fi
\ifvoid\pcol@currfoot\else \dimen@ii\dp\pcol@currfoot \fi
\fi
\pcol@measureupdate\pcol@colht\dimen@\@pagedp\dimen@ii
\ifx\@deferlist\@empty\else \pcol@dfloatstrue \fi
\advance\pcol@currcol\@ne}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@addflhd}
% \changes{v1.0}{2011/10/10}
% {Drastically changed to omit \cs{topfigrule} and \cs{botfigrule}
% from float size measurement, to take care of top float enlargement,
% to add the measurement of $D_T$, and to revise the definition of
% $D_P$.}
%
% \begin{macro}{\pcol@hdflelt}
% \def\xl{\lambda_x}
% \changes{v1.3-3}{2013/09/17}
% {Add a user \cs{pcol@makecol}.}
%
% The macro $\!\pcol@addflhd!\arg{list}\arg{tfs}$ is invoked twice from
% \!\pcol@measurecolumn! for a column $c$ to measure $\size_c(x)$
% ($x\in\{t,b\}$) of top ($x=t$) or bottom ($x=b$) floats.
% The arguments and registers referred to in the macro have the folloiwngs
% according to $x=t$ or $x=b$.
% $$
% \nosv\begin{array}{l|ll}
% & x=t& x=b\\\hline
% \arg{list}& \cc_c(\tl)& \cc_c(\bl)\\
% \arg{tfs}& \!\pcol@textfloatsep!& \!\maxdimen!\\
% \CSIndex{if@tempswa}&
% \false& \Fc(\{t,m,f\})\\
% \!\dimen@!& 0& \size(f)
% \end{array}
% $$
% The macro is also used in \!\pcol@makecol! and \!\pcol@output@switch! for
% $x=t$ but with \!\dimen@! having the height of \!\pcol@prespan! for the
% measurement of the total height of \prespan{} including top
% floats\footnote{
%
% In these invocations, \CSIndex{if@tempswa} is meaningless and not examined
% by the invokers.}.
%
% The macro at first examines if $\cc_c(\xl)=\arg{list}$ is empty and does
% nothing if so. Otherwise, \CSIndex{if@tempswa} is turned $\true$ to have
% $\fc(t)=\true$ for $x=t$ or $\Fc(\{t,m,f,b\})=\true$ for $x=b$. Then we
% scan all floats in $\arg{list}$ applying \!\pcol@hdflelt! to each float
% $\phi$ to add $h(\phi)+d(\phi)+\!\floatsep!$ to \!\dimen@!, from/to which
% we then subtract \!\floatsep! and add $\sigma_x$ because the last\slash
% first float is followed\slash preceded by the vertical skip of $\sigma_x$
% instead of \!\floatsep!, to have $\size_c(t)$ for $x=t$ or
% $\size_c(f)+\size_c(b)$ for $x=b$ being {\em returned} to
% \!\pcol@measurecolumn!.
%
% Note that $\sigma_t$ is $\arg{tfs}=\!\pcol@textfloatsep!$ if it is less
% than $\infty$ or \!\textfloatsep! otherwise, while
% $\sigma_b=\!\textfloatsep!$ always because $\arg{tfs}=\!\maxdimen!$. Also
% note that $\sigma_t$ can be biased by 10000\,|pt| and thus larger than
% 5000\,|pt|, if we have a \mvlfloat{} in top floats as discussed later.
% Another caution is that we ignore the contribution by \!\topfigrule! nor
% \!\botfigrule! because they should insert vertical items whose total
% height and depth are 0.
%
% \begin{macrocode}
\def\pcol@addflhd#1#2{%
\ifx#1\@empty\else
\@tempswatrue
\let\@elt\pcol@hdflelt
#1\advance\dimen@-\floatsep
\ifdim#2=\maxdimen \advance\dimen@\textfloatsep
\else
\advance\dimen@\pcol@textfloatsep
\ifdim\pcol@textfloatsep>5000\p@ \advance\dimen@-\@M\p@ \fi
\fi
\let\@elt\relax
\fi}
\def\pcol@hdflelt#1{\advance\dimen@\ht#1\advance\dimen@\dp#1%
\advance\dimen@\floatsep}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@measureupdate}
% \changes{v1.0}{2011/10/10}
% {Introduced to let $D_T$ and $D_P$ have the minimum depth of items
% among those which give $V_T$ and $V_P$.}
%
% The macro $\!\pcol@measureupdate!\<V\>\<v\>\<D\>\<d\>$ is invoked
% twice in \!\pcol@measurecolumn! for $c$ to update $V\in\{\VT,\VPP\}$
% and $D=\{\DT,\DP\}$ as follows if \CSIndex{if@tempswa}, being
% $\Fc(\{t,m\})$ for $V=\VT$ or $\Fc(\{t,m,f,b\})$ for $V=\VPP$, is $\true$.
% $$
% V\gets\max(V,v)\qquad
% D\gets\cases{\min(D,d)&$V=v$\cr
% D& $V\neq v$}
% $$
% The arguments $v$ and $d$ have the followings according to $V$.
% $$
% \arraycolsep0pt
% \begin{array}{rll}
% V=\VT \;{:}\;&v=\Size_c(\{t,m\})&\quad d=\delta_c\\
% V=\VPP\;{:}\;&v=\Size_c(\{t,m,f,b'))&\quad d=\dc
% \end{array}
% $$
%
% \begin{macrocode}
\def\pcol@measureupdate#1#2#3#4{\if@tempswa
\ifdim#1<#2\relax#1#2\relax#3#4\relax
\else\ifdim#1=#2\ifdim#3>#4\relax#3#4\fi\fi\fi\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@synccolumn}
% \changes{v1.0}{2011/10/10}
% {Drastically changed to correctly implement the top float
% enlargement and MVL-float.}
% \changes{v1.2-2}{2013/05/11}
% {Change code structure removing the case for overflown synchronized
% pages.}
% \changes{v1.2-2}{2013/05/11}
% {Remove \cs{penalty}\string\texttt{-10000} made unnecessary by the
% redesign of overflow synchronized pages.}
% \changes{v1.2-7}{2013/05/11}
% {Add an shrink of $1/10000\,\string\texttt{fil}$ to the bottom of
% flushed column pages to cancel finite shrinks just below
% synchronization points.}
%
% The macro \!\pcol@synccolumn! is invoked for each column $c\In0\C$ from
% \!\pcol@sync! to set a \sync{}ation point at $\VT$ from the top of the
% \ccolpage{} of $c$ if $\CSIndex{ifpcol@clear}={\false}$, or flush it
% otherwise. After obtaining $c$'s \cctext{} $\cc_c$ by
% \!\pcol@getcurrcol!, we process one of the following three cases.
%
% The first case is for flushing with $\CSIndex{ifpcol@clear}=\true$. In
% this case we simply add \!\vfil! at the tail of the main vertical list in
% $\cc_c(\vb^b)$ to make the whole \colpage{} possibly with other items fit
% in a box of \!\@colht! tall and, if $\cc_c(\tf)\neq\infty$ to mean the
% column to be flushed has a \sync{}ation point, we also add an infitite
% shrink of $1/10000\,|fil|$ so as to cancel a finite shrink just below the
% point, as done in \!\pcol@makecol!\footnote{
%
% Just in case, because it looks impossible that the natural height of the
% \colpage{} exceeds $\pp^h(\ptop)$ with \pfcheck.}.
%
% We also let $\cc_c(\pd)=1000\,|pt|$ to mimic \TeX's mechanism of
% \!\prevdepth! with the empty main vertical list in the next
% \colpage{}\footnote{
%
% The author is not sure if this setting is really necessary but, at least,
% it looks working well (though other setting looks all right too).}.
%
% \begin{macrocode}
\def\pcol@synccolumn{%
\pcol@getcurrcol
\ifpcol@clear
\global\pcol@prevdepth\@m\p@
\global\setbox\@currbox\vbox{\unvbox\@currbox
\ifdim\pcol@textfloatsep=\maxdimen \vfil
\else \vskip\z@\@plus1fil\@minus.0001fil
\fi}%
% \end{macrocode}
%
% The second and third cases are for \sync{}ed \cswitch{}. The second case
% is for $\DT=\infty$ to mean the \sync{}ation point is set just below the
% top floats of a column whose main vertical list is empty because it is
% definitely $\VT\geq0>-\infty$. In this case, we should not put anything
% back to the main vertical list, because the column having defined the
% point will restart from the top of its \colpage{} with \!\topskip! and
% thus other columns should do so for the stuff following the point.
% Therefore, we put $\cc_c(\vb^b)$ as the last top float, namely
% {\em\Uidx\mvlfloat} because it is for the main vertical list, acquiring an
% \!\insert! from \!\@freelist! by \!\@next! and assigning it to
% \Midx{\!\pcol@float!} so that we pretend main vertical lists of all
% columns are empty.
%
% The float has zero height and depth, and contains the
% followings if we have some real floats; a vertical skip of $-\!\floatsep!$
% to go back to the bottom of the last real float; \!\topfigrule! and a skip
% of \!\textfloatsep! to separate $\cc_c(\vb^b)$ from the last real float;
% and $\cc_c(\vb^b)$ followed by \!\vss! to avoid overfull and underfull.
% Otherwise, i.e., we don't have any real floats, neither of the skips nor
% \!\topfigrule! are put in the \mvlfloat{} because we let
% $\!\floatsep!=\!\textfloatsep!=0$ and $\!\topfigrule!=\!\relax!$
% temporarily in a group. Then we set the \sync{}ation point by enlarging
% the space below the \mvlfloat{} so that the total size of all floats
% including \!\floatsep! and \!\textfloatsep!, which may be 0 as set in the
% process above, is equal to $\VT$. This enlarging is done by letting
% $\cc_c(\tf)=\VT-(\vc(t)-\!\textfloatsep!+\!\floatsep!)$, the second term
% of which is the vertical size of the top float sequence up to the
% \mvlfloat, and by replacing \!\textfloatsep! with $\cc_c(\tf)$ in the top
% float insertion process in \!\pcol@cflt! so that the top floats including
% the \mvlfloat{} consumes $\VT$ as a whole\footnote{
%
% This enlarging cannot be done by making the float's height
% $\VT-\vc(t)-\!\floatsep!$ (or \!\textfloatsep!) because the height can be
% negative.}.
%
% Note that the process above involves \!\floatsep! and \!\textfloatsep!
% with some finite stretch and shrink, but these factors will not contribute
% the final result because they are canceled by \!\vss! in the \mvlfloat{}
% and by the small inifinite stretch and shrink put by \!\pcol@makecol! and
% this macro for flushing. Also note that $\cc_c(\tf)$ is then biased by
% 10000\,|pt| so that \!\pcol@cflt! will not put \!\topfigrule! because it
% has been already put as a part of the \mvlfloat{} or we don't have any
% real floats. We also let $\cc_c(\pd)=1000$ to mean the \colpage{}'s main
% vertical list is empty, so as to mimic \TeX's mechanism of \!\prevdepth!
% with an empty list again.
%
% Another attention we have to pay is that \colpage{}s with
% $\cc_c(\tf)=\infty$ does not have any \sync{}ation points, and thus
% $\cc_c(\tf)<\infty$ means a \sync{}ation has already taken place in them.
% If this $\cc_c(\tf)<\infty$ happens with $\DT=\infty$\footnote{
%
% This can happen when a \sync{}ation with $\DT=\infty$ is immediately
% followed by another \sync{}ation or, more unlikely, by additions of
% items whose total amount is negative and then a \sync{}ation.},
%
% we cannot update $\cc_c(\tf)$ because \!\pcol@measurecolumn! took care of
% its value on measuring $\vc(t)$. Therefore, we do nothing if
% $\cc_c(\tf)<\infty$ but just let succeeding stuff be added to the main
% vertical list as in \cswitch{} without \sync{}ation.
%
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
% \changes{v1.33-2}{2016/11/19}
% {Add {\tt\%} to the end of the line to open \cs{vbox} for
% \cs{pcol@float} to obey the coding convention.}
%
% \begin{macrocode}
\else
\@tempdimb\@tempdima
\advance\@tempdimb-\skip\@currbox
\ifdim\@tempdimc=\maxdimen
\ifdim\pcol@textfloatsep=\maxdimen \begingroup
\ifx\@toplist\@empty
\textfloatsep\z@ \floatsep\z@ \let\topfigrule\relax
\fi
\pcol@Fb
\@next\pcol@float\@freelist{\global\setbox\pcol@float\vbox to\z@{%
\vskip-\floatsep \topfigrule \vskip\textfloatsep
\unvbox\@currbox \vss}}\pcol@ovf
\pcol@Fe{synccolumn(topfloat)}%
\@cons\@toplist\pcol@float
\advance\@tempdimb\textfloatsep \advance\@tempdimb-\floatsep
\advance\@tempdimb\@M\p@
\global\pcol@prevdepth\@m\p@
\global\pcol@textfloatsep\@tempdimb
\endgroup \fi
% \end{macrocode}
%
% The third and last case is for $\DT<\infty$ and thus most usual. In this
% case, we enclose everything in $\cc_c(\vb^b)$ in a \!\vbox! whose height
% is $h_c^v=\VT-\vc(t)$ and let $\cc_c(\vb^b)$ have it so that the item
% following the \sync{}ation point start at $\VT$. An attention we have to
% pay is that it can be $h_c^v<\!\topskip!$ to let \TeX{} insert a vertical
% skip of the difference between them when the box is returned to the main
% vertical list pushing down the \sync{}ation point a little bit\footnote{
%
% This can happen not very unlikely especially with $\vc(t)$ a little bit
% less than $\VT$ and $\cc_c(\vb^b)$ being empty.}.
%
% Therefore, if so, we let $\cc_c(\vb^b)$ have the followings; a \!\vbox! of
% \!\topskip! tall having its old contents at its top above which no
% vertical skip will be inserted; a vertical skip $-\!\topskip!$ going back
% to the page top; and a vertical skip $h_c^v$ going down to the
% \sync{}ation point.
%
% The encapsulation of the old contents $\cc_c(\vb^b)$ in the box of $h_c^v$
% tall gives us the following two features desirable for \sync{}ation.
% First, all vertical glues in the box are {\em frozen}, nullifying finite
% stretches in them because we insert an infinite stretch of
% $1/10000\,|fil|$ at the bottom of $\cc_c(\vb^b)$ to push up its old
% contents respecting other infinite stretches if any, as done by
% \!\raggedbottom!, and also nullifying finite and infinite shrinks because
% $h_c^v\geq\vc(m)$ definitely. This freezing and nullification keeps
% \sync{}ation points already in $\cc_c(\vb^b)$ from being observed moving a
% little bit vertically. That is, if we have a glue just below a
% \sync{}ation point and it were {\em visible} to \TeX's page builder, the
% item below the glue could move up/down when the builder found a break
% point with some shrink\slash stretch. Though this moving up/down is
% inhibited by the small infinite stretch\slash shrink which the \colpage{}
% will at its bottom finally, it is undesirable to make \TeX{}
% misunderstanding that the glues are strethable\slash shrinkable though
% they are not in reality.
%
% Second, since the boxes in all \colpage{} are zero deep due to the
% infinite stretch at their bottoms and these bottoms are aligned at the
% \sync{}ation point, we have a clear view of the baseline progress after
% the \sync{}ation regardless of their contents. That is, we let
% $\cc_c(\pd)=\DT$ to {\em broadcast} $\DT$ to all columns, so that
% the baselines of first items following the \sync{}ation
% point are aligned \!\baselineskip! below the bottom baseline of the column
% which defines $\DT$\footnote{
%
% Since $\DT$ is given by one of the tallest columns whose depth is smallest
% among them, it is very likely that the bottom baseline of the column is
% lowest among all columns. However, another column can have the lowest one
% when its vertical size is a little bit shorter than $\VT$ and its depth is
% small (e.g., 0). Though of course we can define $\DT$ being $\VT$ minus
% the height of the column having the largest height to make the first
% baseline below the \sync{}ation point apart from the lowest one by
% \cs{baselineskip}, we dare to choose the definition of $\DT$ because such
% lowest baseline often means that the column have some skip at its bottom
% to give us the impressoin that the space between the baselines of the
% tallest column and its first item is a little bit too large.},
%
% if $\DT$ plus the hight of each item is less than \!\baselineskip!.
%
% In addition, we let $\cc_c(\tf)=\!\textfloatsep!$ to
% indicate the \colpage{} has the \sync{}ation point we just have set, if it
% was $\infty$ to mean the point is the first one. By this setting,
% \!\pcol@makecol! and this macro itself will know that the \colpage{} needs
% to have a small infinite shrink at its bottom to cancel finite ones below
% the \sync{}ation point, while \!\pcol@cflt! acts as \LaTeX's \!\@cflt!
% because it should be $\cc_c(\tf)\leq5000\,|pt|$ to mean the \colpage{}
% does not have a \mvlfloat.
%
% \changes{v1.33-2}{2016/11/19}
% {Add {\tt\%} to the end of the line to open \cs{vbox} for
% \cs{@currbox} and two lines for \cs{vbox}es in it to obey the
% coding convention.}
%
% \begin{macrocode}
\else
\global\pcol@prevdepth\@tempdimc
\ifdim\pcol@textfloatsep=\maxdimen
\global\pcol@textfloatsep\textfloatsep \fi
\global\setbox\@currbox\vbox{%
\ifdim\@tempdimb<\topskip
\vbox to\topskip{\unvbox\@currbox \vskip\z@\@plus.0001fil}%
\vskip-\topskip \vskip\@tempdimb
\else
\vbox to\@tempdimb{\unvbox\@currbox \vskip\z@\@plus.0001fil}%
\fi}%
\fi
\fi
% \end{macrocode}
%
% Finally, we let $\cc_c(\tn)=0$ to inhibit futher addition of top floats
% because we have fixed the space for them\footnote{
%
% Allowing the addition is tremendously tough even when the \colpage{} has
% sufficiently large space above the \sync{}ation point.},
%
% and save it and other \cctext{} members into $\cc_c$ by \!\pcol@setcurrcol!.
%
% \begin{macrocode}
\global\@topnum\z@ \pcol@setcurrcol
\advance\pcol@currcol\@ne}
% \end{macrocode}
% \end{macro}
%
%
%
% \subsection{Page Flushing}
% \label{sec:imp-sout-flush}
%
% \begin{macro}{\pcol@output@flush}
% \changes{v1.0}{2011/10/10}
% {Rename \cs{pcol@makelastpage} as \cs{pcol@makeflushedpage}.}
% \changes{v1.0}{2011/10/10}
% {Remove unnecessary assignment of \cs{@colht}.}
% \changes{v1.2-2}{2013/05/11}
% {Add \cs{pcol@Logstart} and \cs{pcol@Logend}.}
% \changes{v1.2-7}{2013/05/11}
% {Add $\cs{boxmaxdepth}\EQ\cs{@maxdepth}$ for depth capping.}
% \changes{v1.2-7}{2013/05/11}
% {Add $\cs{boxmaxdepth}\EQ\cs{@maxdepth}$ for depth capping.}
% \changes{v1.3-2}{2013/09/17}
% {Add depth capping of \cs{pcol@rightpage}.}
%
% The macro \!\pcol@output@flush! is invoked solely from
% \!\pcol@specialoutput! to process the \!\output! request made by
% \!\flushpage!. We invoke \!\pcol@makeflushedpage! giving it \!\@colht! as
% the height of each \colpage{} to have the ship-out image of the
% \tpage{} including its \spanning{} and \Scfnote{}s in \!\@outputbox! whose
% height is then set to be \!\textheight!\footnote{
%
% Just in case because the height of source \cs{@outputbox} should be exactly
% \cs{textheight} though not specified so on its construction in
% \cs{pcol@makeflushedpage}.},
%
% ensureing that its depth is capped by $\!\boxmaxdepth!=\!\@maxdepth!$. We
% also perform these height setting and depth capping on \!\pcol@rightpage!
% if $\CL<\C$ to mean \parapag{}ing. Then we invoke \!\@outputpage! for
% shipping out, and then finally \!\pcol@freshpage! to have a new page to
% start new \colpage{}s in it.
%
% \begin{macrocode}
%% Special Output Routines: Page Flushing
\def\pcol@output@flush{%
\pcol@makeflushedpage\@colht
\pcol@Logstart\pcol@output@flush
\setbox\@outputbox\vbox to\textheight{\boxmaxdepth\@maxdepth
\unvbox\@outputbox}%
\ifnum\pcol@ncolleft<\pcol@ncol
\setbox\pcol@rightpage\vbox to\textheight{\boxmaxdepth\@maxdepth
\unvbox\pcol@rightpage}%
\fi
\pcol@Logend\pcol@output@flush
\@outputpage
\pcol@freshpage}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@output@clear}
% \changes{v1.0}{2011/10/10}
% {Rename \cs{pcol@makelastpage} as \cs{pcol@makeflushedpage}.}
% \changes{v1.0}{2011/10/10}
% {Remove unnecessary increment of \cs{pcol@page} and assignment of
% \cs{@colht}.}
% \changes{v1.2-2}{2013/05/11}
% {Add \cs{pcol@Logstart} and \cs{pcol@Logend}.}
% \changes{v1.2-7}{2013/05/11}
% {Add $\cs{boxmaxdepth}\EQ\cs{@maxdepth}$ for depth capping.}
% \changes{v1.3-2}{2013/09/17}
% {Add depth capping of \cs{pcol@rightpage} and building an empty
% right parallel-page for each page-wise float page.}
% \changes{v1.3-3}{2013/09/17}
% {Add background painting of float pages.}
% \changes{v1.32-3}{2015/10/10}
% {Add $\hbox{\cs{f@depth}}\EQ0$ to override
% $\hbox{\cs{f@depth}}\EQ\hbox{\texttt{1sp}}$ done by
% \cs{@dblfloatplacement}.}
%
% The macro \!\pcol@output@clear! is invoked solely from
% \!\pcol@specialoutput! to process the \!\output! request made by
% \!\clearpage!. The first part up to \!\@outputpage! and the last line of
% this macro are same as \!\pcol@output@flush! to flush the \tpage{} and to
% have a newpage. In the remaining mid part, we invoke \!\pcol@flushfloats!
% to ship out all deferred \cwise{} floats in all columns if any, and
% then do it for \pwise{} floats by the following invocations enclosed in a
% group; letting $\!\pcol@rightpage!=\bot$ for ordinary paging;
% \!\@dblfloatplacement! to set up placement parameters followed by
% $\!\f@depth!=0$ to nullify the setting $\!\f@depth!=|1sp|$ possiblly done
% by it as discussed in the item-(\ref{item:ovv-float-@dblfloatplacement})
% of \secref{sec:imp-ovv-float}; \!\@makefcolumn! with
% \!\@dbldeferlist! to have a \fpage{} in \!\@outputbox! if any; and a loop
% of \bgpaint{} of \!\@outputbox! and, if $\CL<\C$, of empty
% \!\pcol@rightpage!, and \!\@outputpage! followed by \!\@makefcolumn!
% repeated while we have a \fpage{}, i.e., $\CSIndex{if@fcolmade}=\true$.
%
% Note that the mid part is same as that found in \!\@doclearpage! but we
% omit various adjuncts surrouding it as follows; examination of
% \CSIndex{if@twocolumn} because we should have multiple columns;
% examination of \CSIndex{if@firstcolumn} because we have to clear the page
% immediately even when we are not in the first column; concatenating
% \!\@dbltoplist! with \!\@dbldeferlist! and clearing it because the author
% believes \!\@dbltoplist! must be empty on the invocation of this macro;
% and letting $\!\@colht!=\!\textheight!$ because \!\pcol@flushfloats! did
% it.
%
% \begin{macrocode}
\def\pcol@output@clear{%
\pcol@makeflushedpage\@colht
\pcol@Logstart\pcol@output@clear
\setbox\@outputbox\vbox to\textheight{\boxmaxdepth\@maxdepth
\unvbox\@outputbox}%
\ifnum\pcol@ncolleft<\pcol@ncol
\setbox\pcol@rightpage\vbox to\textheight{\boxmaxdepth\@maxdepth
\unvbox\pcol@rightpage}%
\fi
\pcol@Logend\pcol@output@clear
\@outputpage
\pcol@flushfloats
\begingroup
\setbox\pcol@rightpage\box\voidb@x
\@dblfloatplacement \let\f@depth\z@
\@makefcolumn\@dbldeferlist
\@whilesw\if@fcolmade\fi{%
\def\pcol@bg@floatheight{\pcol@bg@textheight}%
\setbox\@outputbox\vbox to\textheight{%
\pcol@bg@paintbox{Ff}\unvbox\@outputbox}%
\ifnum\pcol@ncolleft<\pcol@ncol
\setbox\pcol@rightpage\vbox to\textheight{\pcol@bg@paintbox{Ff}\vfil}%
\fi
\@outputpage
\@makefcolumn\@dbldeferlist}%
\endgroup
\pcol@freshpage}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@makeflushedpage}
% \changes{v1.0}{2011/10/10}
% {Renamed from \cs{pcol@makelastpage}.}
% \changes{v1.0}{2011/10/10}
% {Rename \cs{ifpcol@textonly} as \cs{ifpcol@nospan}.}
% \changes{v1.0}{2011/10/10}
% {Judge the last page is empty if $V_P\EQ-\infty$ instead of $V_P<0$.}
% \changes{v1.2-2}{2013/05/11}
% {Revise reflecting the redesign of page context.}
% \changes{v1.3-2}{2013/09/17}
% {Completely redesigned with new macro \cs{pcol@imakeflushedpage}.}
% \changes{v1.3-3}{2013/09/17}
% {Add background painting of page-wise floats, and a part of
% opreations for column-separation rule drawing and background
% painting of page-wise footnotes.}
% \changes{v1.3-6}{2013/09/17}
% {Revise the mechanism of special care about last page introducing
% \cs{ifpcol@dfloats}.}
%
% The macro $\!\pcol@makeflushedpage!\arg{ht}$ is invoked from
% \!\pcol@output@flush! or \!\pcol@output@clear! with $\arg{ht}=\!\@colht!$
% and from \!\pcol@output@end! with $\arg{ht}=\!\pcol@colht!$. At first, we
% invoke \!\pcol@output@switch! with setting $\CSIndex{ifpcol@clear}=\true$
% to flush all pages up to $\ptop-1$ and to let $\cc_c(\vb^b)$ have the
% ship-out image of the main vertical list of each \colpage{} $c$ in
% $\ptop$. This invocatoin also lets $\!\pcol@colht!=\VPP$ so that hereafter
% we will refer $\VPP$ throuth $\arg{ht}$ if it is $\!\pcol@colht!$ for
% \lpage. Then after obtaining $\ptop$'s \pctext{} to have
% $\page(\ptop)=\pp^p(\ptop)$, $\!\@colht!=\pp^h(\ptop)$ and
% \CSIndex{ifpcol@nospan} by \!\pcol@getcurrpinfo!, we build the ship-out
% image of $\ptop$ in \!\@outputbox!, and \!\pcol@rightpage! if
% \parapag{}ing, taking special care of the \lpage{} case as follows.
%
% \begin{enumerate}\def\labelenumi{(\arabic{enumi})}
% \item\label{item:mfp-nonlast}
% If $\CSIndex{ifpcol@lastpage}=\false$, each of $\cc_c(\vb^b)$ has ship-out
% image even if some or all of them are empty. It is unecessary to be aware
% of the perfectly empty case because it should mean the page $\ptop$ is
% made blank intentionally.
%
% \item\label{item:mfp-last-dfloats}
% If $\CSIndex{ifpcol@lastpage}=\true$ but $\CSIndex{ifpcol@dfloats}=\true$
% too, the last page must have {\em full size} because we will have parallel
% columned pages having \fcolumn{}s for deferred floats. However, if the
% page has nothing, i.e., $\pp^i(\ptop)=\pp^f(\ptop)=\bot$ and
% $\VPP=-\infty$, we must let $\!\@outputbox!=\bot$ (and
% $\!\pcol@rightpage!=\bot$ as well) to avoid an unnecessary blank page is
% shipped out. On the other hand, if $\pp^i(\ptop)\neq\bot$ or
% $\pp^f(\ptop)\neq\bot$ while $\VPP=-\infty$, we build a full size page as
% usual but letting $\!\@textbottom!=\!\vfil!$ temporarily to avoid underfull
% in the process of building columns. Note that if $\pp^f(\ptop)\neq\bot$,
% the \Scfnote{}s are always put into \!\@outputbox! regardless
% \CSIndex{ifpcol@mgfnote} because the \lpage{} is not combined with
% \postenv.
%
% \item\label{item:mfp-last-empty}
% If $\CSIndex{ifpcol@lastpage}=\true$, $\CSIndex{ifpcol@dfloats}=\false$
% and $\VPP=-\infty$, we have to let $\!\@outputbox!=\bot$ unless
% $\pp^i(\ptop)\neq\bot$ or $\pp^f(\ptop)\neq\bot$ having non-\Mgfnote{}s.
% If $\pp^f(\ptop)$ has non-\Mgfnote{}s, \!\@outputbox! and
% \!\pcol@rightpage! must have $\pp^f(\ptop)$ possibly with $\pp^i(\ptop)$
% but without any columns, and must be put into the main vertical list as
% the leading part of \postenv{} by modifying $\VPP=0$. On the other hand
% $\pp^f(\ptop)=\bot$ or it has \Mgfnote{}s, \!\@outputbox! must have only
% $\pp^i(\ptop)$\footnote{
%
% \!\pcol@rightpage! must have the couterpart in right \parapag{}e if the
% \spanning{} is \preenv, while it is made $\bot$ by \!\pcol@output@end! if
% the \spanning{} are \pwise{} floats.}.
%
% Since \pwise{} floats become ordinary floats in \postenv, we cannot paint
% its \bground{} and must remove \!\dbltextfloatsep! at the bottom of
% $\pp^i(\ptop)$.
%
% \item\label{item:mfp-last-nonempty}
% If $\CSIndex{ifpcol@lastpage}=\true$, $\CSIndex{ifpcol@dfloats}=\false$
% and $\VPP>-\infty$, \!\@outputpage! and \!\pcol@rightpage! must have short
% columns of $\VPP$ tall, together with $\pp^i(\ptop)$ as in non-\lpage{}s
% but without $\pp^f(\ptop)$ if it has \Mgfnote{}s.
% \end{enumerate}
%
% To implement a part of special cares above, we at first let
% $\CSIndex{if@tempswa}=\true$ iff $\cs{ifpcol@}\~|lastpage|=\false$,
%
% \CSINDEX{ifpcol@lastpage}
%
% $\VPP>-\infty$ or $\pp^f(\ptop)\neq\bot$.
%
% \begin{macrocode}
\def\pcol@makeflushedpage#1{%
\pcol@cleartrue \pcol@output@switch \pcol@clearfalse
\pcol@getcurrpinfo{\global\c@page}{\global\@colht}\@tempskipa
\ifpcol@lastpage \@tempswafalse \else \@tempswatrue \fi
\ifdim\pcol@colht=-\maxdimen\else \@tempswatrue \fi
\ifvoid\pcol@footins\else \@tempswatrue \fi
% \end{macrocode}
%
% Next, if $\CSIndex{ifpcol@nospan}=\true$ to mean the page $\ptop$ does not
% have \spanning{} in $\pp^i(\ptop)$, we initialize both \!\@outputbox! and
% \!\pcol@rightpage! to be $\bot$. Otherwise, after letting
% $\CSIndex{if@tempswa}=\true$ if $\CSIndex{ifpcol@dfloats}=\true$ to make the
% \lpage{} full size if we are working on it as discussed in\Tie
% (\ref{item:mfp-last-dfloats}), we put $\pp^i(\ptop)$ in \!\@outputbox!,
% and paint its \bground{} by \!\pcol@bg@paintbox! \!\edef!ining the height
% paramenter \!\pcol@bg@floatheight! with $h$ being the height-plus-depth of
% $\pp^i(\ptop)$ with the following two exceptions; one is the case of
% $\CSIndex{ifpcol@firstpage}={\true}$ to mean we are in \spage{} and thus
% the \spanning{} is \preenv{} having already been painted by
% \!\pcol@output@start!; and the other is the case of
% $\CSIndex{if@tempswa}=\false$ to mean we are working on a truly \lpage{}
% being empty except for the \spanning{} itself and thus the \pwise{}
% floats become a part of deferred floats in \postenv{} as discussed in\Tie
% (\ref{item:mfp-last-empty}). In the latter exceptional case, excluding
% the case that the \lpage{} is also the \spage\footnote{
%
% Extremely exceptional because the closing environment does not have
% anything.},
%
% we also remove the last skip being \!\dbltextfloatsep! so that those
% floats are naturally connected with other floats given in
% \postenv{} also as discussed in\Tie(\ref{item:mfp-last-empty}). Then we
% {\em pack} the \!\@outputbox! in itself by \!\vbox! so that any
% stretch\slash shrink factors in it cannot affect the ship-out image
% especially when we paint its \bground{}\footnote{
%
% Though that hardly happens.}.
%
% Then we do the similar procedure for \!\pcol@rightpage! and make its height
% and depth equal to those of \!\@outputbox!\footnote{
%
% If \pwise{} floats become a part of \postenv's floats, \!\pcol@rightpage!
% will be made $\bot$ by \!\pcol@output@end! afterward.}.
%
% Finally we temporarily add $h$ to \!\topmargin! as done in
% \!\pcol@ioutputelt! so that \bgpaint{} of columns and so on with
% \bginfext{} can reach the paper top edge.
%
% \changes{v1.3-6}{2013/09/17}
% {Revise the condition of leaving page-wise floats as ordinary
% post-environment floats using \cs{if@tempswa} with
% \cs{ifpcol@dfloats}.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\begingroup
\ifpcol@nospan
\global\setbox\@outputbox\box\voidb@x
\global\setbox\pcol@rightpage\box\voidb@x
\else
\ifpcol@dfloats \@tempswatrue \fi
\let\@elt\relax
\edef\pcol@bg@floatheight{%
\@elt{\number\ht\pcol@spanning sp}\@elt{\number\dp\pcol@spanning sp}}%
\def\reserved@a{%
\ifpcol@firstpage\else \if@tempswa \pcol@bg@paintbox{Ff}\fi\fi}%
\@tempdima\ht\pcol@spanning \advance\@tempdima\dp\pcol@spanning
\global\setbox\@outputbox\vbox{%
\reserved@a \unvbox\pcol@spanning
\ifpcol@firstpage\else \if@tempswa\else \unskip \fi\fi}%
\global\setbox\@outputbox\vbox{\box\@outputbox}%
\pcol@Fb
\@cons\@freelist\pcol@spanning
\pcol@Fe{makeflushedpage(spanning)}%
\ifnum\pcol@ncolleft<\pcol@ncol
\global\setbox\pcol@rightpage\vbox{%
\ifpcol@paired\else \advance\c@page\@ne \fi
\reserved@a \unvbox\pcol@rightpage}%
\global\ht\pcol@rightpage\ht\@outputbox
\global\dp\pcol@rightpage\dp\@outputbox
\global\setbox\pcol@rightpage\vbox{\box\pcol@rightpage}%
\fi
\advance\topmargin\@tempdima
\fi
% \end{macrocode}
%
% Next, after \!\global!ly letting $\CSIndex{ifpcol@firstpage}=\false$ because
% we will ship a page which may be the \spage{} shortly, we build the
% ship-out image of columns if required fundamentally by
% $\CSIndex{if@tempswa}=\true$. First,
% if the page $\ptop$ has \Scfnote{}s, we shrink
% $\!\@colht!={\pp^h}(\ptop)$ by \!\pcol@shrinkcolbyfn! to keep the room for
% the footnotes, to have $H=\!\@pageht!$ being the possibly shrunk
% $\pp^h(\ptop)$ for the reference
% in \!\pcol@imakeflushedpage! after the further possible modification of
% \!\@colht! we will make shortly. Second, if
% $\CSIndex{ifpcol@lastpage}=\true$ but $\CSIndex{ifpcol@dfloats}=\true$
% too, we turn $\CSIndex{ifpcol@lastpage}=\false$ because we need a
% full-sized \lpage{}, temporarily letting $\!\@textbottom!=\!\vfil!$ if
% $\VPP=-\infty$ to avoid underfull due to perfectly empty \colpage{}s as
% discussed in\Tie(\ref{item:mfp-last-dfloats})\footnote{
%
% Each \colpage{} $cc_c(\vb^b)$ itself exists because the empty \colpage{}
% has been visited by \cscan{} prior to \!\output! request for environment
% closing.}.
%
% Third, if we are working on a truly \lpage{} and $\arg{ht}<H$ to mean the
% tallest column is shorter than $H$, we let $\!\@colht!=\arg{ht}$ to let
% \!\@makecol! build short \colpage{}s. Note that it is definitely
% $\arg{ht}\leq H$ because the \pfcheck{} on the \lpage{} makes that sure.
% Fourth and finally, unless all columns in truly \lpage{} are empty as
% discussed in (\ref{item:mfp-last-empty}), we invoke
% $\!\pcol@imakeflushedpage!\<\Cfrom\>\<\Cto\>\<b\>$ once or twice, to put
% columns in right \parapag{}e to $b=\!\pcol@rightpage!$ with
% $\LBRP\Cfrom\Cto=\LBRP\CL\C$ if $\CL<\C$, and then to put left ones in
% $b=\!\@outputbox!$ with $\LBRP\Cfrom\Cto=\LBRP0\CL$ always\footnote{
%
% The order of right to left is not essential in this macro but we follow
% the convention in \!\pcol@outputelt!.}.
%
% \changes{v1.0}{2011/10/10}
% {Let \cs{@colht} be $\langle\mathit{ht}\rangle$ if the former is
% less than the latter.}
% \changes{v1.0}{2011/10/10}
% {Add special care of the float column in the last page.}
% \changes{v1.2-2}{2013/05/11}
% {Add \cs{@colht} shrinking by page-wise footnotes.}
% \changes{v1.3-3}{2013/09/17}
% {Add \cs{@colht} and \cs{relax} as the first and third argument
% of \cs{pcol@shrinkcolbyfn} for all of three invocations of it.}
% \changes{v1.3-6}{2013/09/17}
% {Remove empty column scan for \cs{if@fcolmade} because it is now
% unnecessary thanks to \cs{ifpcol@dfloats}.}
% \changes{v1.3-6}{2013/09/17}
% {Revise the condition of column-page building and setting of
% \cs{@colht}.}
%
% \begin{macrocode}
\global\pcol@firstpagefalse
\if@tempswa
\ifvoid\pcol@footins\else
\pcol@shrinkcolbyfn\@colht\pcol@footins\relax
\fi
\let\pcol@@hfil\relax \@pageht\@colht
\ifpcol@lastpage \ifpcol@dfloats
\ifdim\pcol@colht<\z@ \def\@textbottom{\vfil}\fi
\pcol@lastpagefalse
\fi\fi
\ifpcol@lastpage \ifdim#1<\@colht \@colht#1\fi\fi
\ifdim\@colht<\z@ \else
\ifnum\pcol@ncolleft<\pcol@ncol
\pcol@imakeflushedpage\pcol@ncolleft\pcol@ncol\pcol@rightpage
\fi
\pcol@imakeflushedpage\z@\pcol@ncolleft\@outputbox
\fi
\fi
% \end{macrocode}
%
% After putting all \colpage{}s, we examine if the page $\ptop$ has
% \Scfnote{}s in $\pp^f(\ptop)$. If so, and unless $\ptop$ is a truly
% \lpage{} and \Mgfnote{} typesetting is in effect to mean the \Scfnote{}s
% will be merged with \postenv{}, we put the footnotes in $\pp^f(\ptop)$
% below the \colpage{}s. Prior to this however, we let
% \Midx{\!\pcol@fnheight@lpage!} have the height-plus-depth of the footnote,
% so that \!\pcol@output@end! know the size for the \bgpaint{} of the
% footnotes, which \!\pcol@imakeflushedpage! performed for non-\lpage{}s.
% We also put an empty box of the size into \!\pcol@rightpage! by
% \!\pcol@phantom! together with the \!\skip! component of $\pp^f(\ptop)$ to
% keep the space necessary especially when $\ptop$ is the \lpage. Then we
% put the footnotes in $\pp^f(\ptop)$ into \!\@outputpage! by
% \!\pcol@putfootins!, reclaiming the contents of $\pp^f(\ptop)$ and letting
% $\pp^f(\ptop)=\bot$ so that \!\pcol@output@end! will be unaware of the
% footnotes. We also let $\VPP=\!\pcol@colht!=0$ if $\ptop$ is a truly
% \lpage{} and it had $-\infty$ to indicate that the \lpage{} is not empty
% but has footnotes as discussed in\Tie(\ref{item:mfp-last-empty}).
%
% \changes{v1.2-2}{2013/05/11}
% {Add incorporation of page-wise footnotes.}
% \changes{v1.3-6}{2013/09/17}
% {page-wise footnotes for the last page followed by pages for
% deferred column-wise floats are now put by this macro.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\gdef\pcol@fnheight@lpage{0pt}%
\ifvoid\pcol@footins\else
\@tempswatrue \ifpcol@lastpage \ifpcol@mgfnote \@tempswafalse \fi\fi
\if@tempswa
\pcol@Log\pcol@makeflushedpage{output}\pcol@footins
\@tempdima\ht\pcol@footins \advance\@tempdima\dp\pcol@footins
\xdef\pcol@fnheight@lpage{\number\@tempdima sp}%
\ifnum\pcol@ncolleft<\pcol@ncol
\global\setbox\pcol@rightpage\vbox{\unvbox\pcol@rightpage
\vskip\skip\pcol@footins \nointerlineskip
\pcol@phantom\pcol@footins \vskip\z@}%
\fi
\global\setbox\@outputbox\vbox{%
\unvbox\@outputbox \pcol@putfootins\pcol@footins}%
\pcol@Fb
\@cons\@freelist\pcol@footins \gdef\pcol@footins{\voidb@x}%
\pcol@Fe{makeflushedpage(pagefn)}%
\ifdim\pcol@colht=-\maxdimen \global\pcol@colht\z@ \fi
\fi
\fi
\endgroup}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@imakeflushedpage}
% \changes{v1.3-2}{2013/09/17}
% {Introduced for parallel-paging.}
% \changes{v1.3-3}{2013/09/17}
% {Implement column-separating rule and background paiting of
% columns, column-separating gaps, spanning texts and page-wise
% footnotes.}
% \changes{v1.3-4}{2013/09/17}
% {Implement variable-width column-separating gaps.}
%
% The macro $\!\pcol@imakeflushedpage!\<\Cfrom\>\<\Cto\>\arg{b}$ is invoked
% solely in \!\pcol@makeflushedpage! but can be twice with
% $(\Cfrom,\Cto,b)=(\CL,\C,\!\pcol@rightpage!)$ if \parapag{}ing is in effect
% and with $(\Cfrom,\Cto,b)=(0,\CL,\!\@outputbox!)$ always, to build the
% ship-out image of the right or left \parapag{}e $\ptop$ in the box $b$
% already having \spanning{} or its blank counterpart if any, respectively.
%
% After opening the \!\vbox! of the ship-out image for $b$, at first we
% examine if $\CSIndex{ifpcol@paired}={\false}$ and $\Cfrom>0$, and if so we
% temporarily increment $\page(\ptop)$ by one so that we check its parity
% for \mirror{}ed \bgpaint{} correctly. Then if the page $\ptop$ has
% \Scfnote{}s in $\pp^f(\ptop)$, we paint its \bground, or that of its blank
% counterpart, by \!\pcol@bg@paintbox! \!\def!ining the parameter
% \!\pcol@bg@footnoteheight! with the height-plus-depth of $\pp^f(\ptop)$,
% as the very first element of the ship-out image as done in
% \!\pcol@ioutputelt!, unless $\ptop$ is the truely \lpage{} for which the
% \bgpaint{} is done in \!\pcol@output@end!. Then we put \spanning{} in $b$
% itself if any.
%
% Next, we invoke \!\pcol@buildcolseprule! for \cseprule{} drawing and
% \bgpaint{} giving it $H$ in \!\@colht! possibly shurnk from $\pp^h(\ptop)$
% by \Scfnote{}s, $\LBRP\Cfrom\Cto$ for the set of columns to be put, and
% \!\@maxdepth! for non-\lpage{}s to paint the \bground{}s of columns and
% \csepgap{}s so that those of the last segment reach the page bottom, while
% for \lpage{} we give 0 to let the bottom be the real bottom of the
% columns. Then we put the painted \bground{}s in \!\@tempboxa!
% immediately.
%
% \begin{macrocode}
\def\pcol@imakeflushedpage#1#2#3{\global\setbox#3\vbox{%
\ifpcol@paired\else\ifnum#1=\z@\else \advance\c@page\@ne \fi\fi
\ifvoid\pcol@footins\else \ifpcol@lastpage\else
\def\pcol@bg@footnoteheight{%
\@elt{\ht\pcol@footins}\@elt{\dp\pcol@footins}}%
\pcol@bg@paintbox{Nn}%
\fi\fi
\unvbox#3\nointerlineskip
\ifpcol@lastpage \pcol@buildcolseprule\@colht#1#2\z@
\else \pcol@buildcolseprule\@colht#1#2\@maxdepth
\fi
\unvbox\@tempboxa
% \end{macrocode}
%
% Now we put columns in a \!\hbox! of $\WT=\!\textwidth!$ wide. That is,
% for each $c$, being $c'$ or $\C-1-c'$ for the $c'$-th iteration determined
% by \!\pcol@swapcolumn! according to the effectiveness of \cswap{} and the
% parity of $\page(\ptop)$, we obtain $c$'s \cctext{} $\cc_c$ by
% \!\pcol@getcurrcol!, move $\cc_c(\vb^b)$ into \!\box!|255|, and let
% $\!\footins!=\cc_c(\ft)$ by \!\pcol@getcurrfoot! returning it to
% \!\@freelist! if $c$ has \Mcfnote{}s.
%
% After that we examine if $\cc_c(\tr)=\infty$ to mean we are working on the
% \lpage{} and the \colpage{} is for a \fcolumn{} whose floats can be put as
% top floats, and let $\!\topfigrule!=\!\relax!$ temporarily because the
% floats are not top ones in reality, if so. Note that the abnormal setting
% $\cc_c(\tr)=\infty$ is not recovered because it will never be referred to
% and the register \!\@toproom! it represents will be updated with correct
% value before it is referred to in \postenv. Then we also check
% $\arg{ht}=H$ to mean the \lpage{} is full size. If both of them hold,
% the floats in $\cc_c(\tl)$ should be (or may be) put in the \fcolumn{} as
% usual and thus we put them in \!\@outputbox! of $H$ tall by
% \!\pcol@makefcolpage!. Otherwise we invoke \!\pcol@@makecol!\footnote{
%
% Not \cs{pcol@makecol} because the main vertical list has \!\vfil! and, if
% it has a \sync{}ation point, a infinite shrink by \cs{pcol@synccolumn} at
% its tail already, and we should not do any special operations for
% \Scfnote{}s. Also it is not \cs{@makecol} because we need to ensure the
% depth of resulting \cs{@outputbox} is capped.},
%
% to have the ship-out image of the \colpage{} in \!\@outputbox!, possibily
% only for the deferred floats in $\cc_c(\tl)$ but without \!\topfigrule! in
% this case. Note that we don't take care of the stretch\slash shrink of
% \!\skip!\!\footins! for \Scfnote{}s because \pfcheck{} on the \colpage{}
% makes it sure that the natural height of the \colpage{} cannot be greater
% than \!\@colht!. Also note that we give \!\@maxdepth! to
% \!\pcol@@makecol! for non-\lpage{}s for depth capping, but for the
% \lpage{} we pass 0 to the macro because $H=\!\@colht!$ should be large
% enough to accommodate everything in the column including its last box even
% if the box is unusually deep.
%
% Then we put the \!\@outputbox! above in a \!\hbox! of \!\columnwidth! wide
% preceded by \!\pcol@@hfil! being \!\relax! for the first column, while
% it is $\!\pcol@hfil!\<c^g\>$, where $c^g=\!\pcol@colsepid!$ being $c$ or
% $c-1$ without or with \cswap{} respectively, to put a \csepgap{} possibly
% with \cseprule{} segments in \!\pcol@tempboxa! built by
% \!\pcol@buildcolseprule!. Finally, we save \cctext{} especially those
% for float parameters into $\cc_c$ by \!\pcol@setcurrcolnf! because all
% \Mcfnote{}s have been shipped out.
%
% \changes{v1.2-4}{2013/05/11}
% {Add column-swapping for even pages if specified.}
% \changes{v1.2-2}{2013/05/11}
% {Revise reflecting the redesign of \cs{pcol@getcurrfoot}.}
% \changes{v1.2-2}{2013/05/11}
% {Add \cs{pcol@Logstart} and \cs{pcol@Logend}.}
% \changes{v1.2-7}{2013/05/11}
% {Enclose the column-page building process in a group to fix the bug
% which lets $\cs{topfigrule}\EQ\cs{relax}$ affecting to another
% column.}
% \changes{v1.2-7}{2013/05/11}
% {Replace the sequence of operations to make a usual float column
% with \cs{@toplist} with the newly introduced
% \cs{pcol@makefcolpage}.}
% \changes{v1.2-7}{2013/05/11}
% {Replace \cs{@makecol} with \cs{pcol@@makecol} to cap the depth of
% \cs{@outputbox} by \cs{@maxdepth} even with p\string\LaTeX.}
% \changes{v1.3-6}{2013/09/17}
% {Add \cs{@maxdepth} or 0 as the argument of \cs{pcol@@makecol} to
% fix the problem that the last page is too large due to
% \cs{@maxdepth}, by the latter.}
% \changes{v1.3-6}{2013/09/17}
% {Remove the examination of $\kappa_c(\lambda_d)$ for
% \cs{if@fcolmade} because it is made unnecesary now by
% \cs{ifpcol@dfloats}.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\hb@xt@\textwidth{%
\@tempcntb#1\@whilenum\@tempcntb<#2\do{%
\pcol@swapcolumn\@tempcntb\pcol@currcol#1#2\relax
\pcol@getcurrcol
\setbox\@cclv\box\@currbox
\ifvoid\pcol@currfoot\else
\pcol@Fb
\@cons\@freelist\pcol@currfoot
\pcol@Fe{imakeflushedpage(colfn)}%
\fi
\pcol@getcurrfoot\box
\@tempswafalse
\begingroup
\ifdim\@toproom=\maxdimen
\let\topfigrule\relax \ifdim\@colht=\@pageht \@tempswatrue \fi
\fi
\if@tempswa
\pcol@Logstart{\pcol@makeflushedpage(1)}%
\setbox\@outputbox\pcol@makefcolpage
\pcol@Logend{\pcol@makeflushedpage(1)}%
\else
\pcol@Logstart{\pcol@makeflushedpage(2)}%
\ifpcol@lastpage \pcol@@makecol\z@ \else \pcol@@makecol\@maxdepth \fi
\pcol@Logend{\pcol@makeflushedpage(2)}%
\fi
\pcol@@hfil \hb@xt@\columnwidth{\box\@outputbox\hss}%
\endgroup
\edef\pcol@@hfil{\noexpand\pcol@hfil{\pcol@colsepid}}%
\pcol@setcurrcolnf
\advance\@tempcntb\@ne}}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@flushfloats}
% \changes{v1.0}{2011/10/10}
% {Add reinitialization of \cs{@colht}.}
% \changes{v1.2-4}{2013/05/11}
% {Add column-swapping for even pages if specified.}
% \changes{v1.3-2}{2013/09/17}
% {Completely redesigned with new macro \cs{pcol@iflushfloats}.}
% \begin{macro}{\pcol@iflushfloats}
% \changes{v1.3-2}{2013/09/17}
% {Introduced for parallel-paging.}
% \changes{v1.3-3}{2013/09/17}
% {Implement column-separating rule and background paiting of
% columns and column-separating gaps}
% \changes{v1.3-4}{2013/09/17}
% {Implement variable-width column-separating gaps.}
%
% The macro \!\pcol@flushfloats! is invoked from \!\pcol@output@clear! and
% \!\pcol@output@end! to flush all deferred \cwise{} floats in each
% column if any. After letting $\!\@colht!=\!\textheight!$ for
% \fcolumn{}s, we iterate shipping out a page having \fcolumn{}s while
% $\CSIndex{if@fcolmade}=\exists c\In0\C:(\cc_c(\dl)\neq())$.
%
% In the loop, we initialize $\CSIndex{if@fcolmade}=\false$, and then
% invoke \!\pcol@iflushfloats! twice or once according to $\CL<\C$ or not to
% mean \parapag{}ing is in effect or not, respectively. That is, if
% $\CL<\C$ we invoke the macro with $\LBRP\CL\C$ and \!\pcol@rightpage! for
% the right \parapag{}e, and do it with $\LBRP0\CL$ and \!\@outputbox!
% always. Note that if $\CL=\C$, we let $\!\pcol@rightpage!=\bot$ to tell
% \!\@outputpage!, which we invoke at the end of the loop to ship out a page
% or a \parapag{}e pair, that the \parapag{}ing is not in effect.
%
% The macro $\!\pcol@iflushfloats!\<\Cfrom\>\<\Cto\>\<b\>$ opens
% a \!\vbox! to be set into $b$. Then if $\CSIndex{ifpcol@paired}={\false}$
% and $\Cfrom>0$ to mean we are working on a right \npaired{} \parapag{}e,
% we temporarily add \!\c@page! by one for page parity examination for
% \mirror{}ed \bgpaint. Then, the macro \!\pcol@buildcolseprule! is invoked
% with $\!\@colht!=\!\textheight!$ and $\LBRP\Cfrom\Cto$ for \cseprule{}
% drawing in \!\pcol@tempboxa! and \bgpaint{} for columns and \csepgap{}s in
% \!\@tempboxa! put into $b$ immediately.
%
% Then we open a \!\hbox! of \!\textwidth! wide and initialize
% $f=\CSIndex{if@tempswa}$ to be \CSIndex{if@fcolmade}. Then for each
% $c\In\Cfrom\Cto$, being $c'$ or $\C-1-c'$ for the $c'$-th iteration
% determined by \!\pcol@swapcolumn! according to the effectiveness of
% \cswap{} and the parity of \!\c@page!, we put an inner \!\hbox! of
% $\!\columnwidth!=\w_c$ wide preceded by \!\pcol@@hfil! being \!\relax! at
% initial or $\!\pcol@hfil!\<c_g\>$ otherwise for a \csepgap{} and
% \cseprule{}, where $c_g\in\{c,c{-}1\}$ without or with \cswap{}
% respectively. That is, at first we obtain $c$'s \cctext{} including
% $\cc_c(\dl)$ by \!\pcol@getcurrcol! and pass $\cc_c(\dl)$ to
% \!\@makefcolumn! to produce a \fcolumn{} in \!\@outputbox! to be put into
% the inner \!\hbox!. Then we do $f\gets f\lor(\cc_d(\dl)\neq\emptyset)$
% with $\cc_d(\dl)$ shrunk by \!\@makefcolumn! to let $f$ have
% $\exists{}c\In0\Cto:(\cc_c(\dl)\neq\emptyset)$ at the end of the loop for
% $c$, and then save the \cctext{} into $\cc_c$ by \!\pcol@setcurrcolnf!
% because we have no footnotes in $c$.
%
% After the end of the loop, we move $f$ to \CSIndex{if@fcolmade} for
% the termination check of the loop in \!\pcol@flushfloats!.
%
% \begin{macrocode}
\def\pcol@flushfloats{%
\global\@colht\textheight
\@whilesw\if@fcolmade\fi{%
\global\@fcolmadefalse
\ifnum\pcol@ncolleft<\pcol@ncol
\pcol@iflushfloats\pcol@ncolleft\pcol@ncol\pcol@rightpage
\else
\setbox\pcol@rightpage\box\voidb@x
\fi
\pcol@iflushfloats\z@\pcol@ncolleft\@outputbox
\@outputpage}}
\def\pcol@iflushfloats#1#2#3{\setbox#3\vbox{%
\ifpcol@paired\else\ifnum#1=\z@\else \advance\c@page\@ne \fi\fi
\pcol@buildcolseprule\@colht#1#2\@maxdepth \unvbox\@tempboxa
\hb@xt@\textwidth{%
\let\pcol@@hfil\relax
\if@fcolmade \@tempswatrue \else \@tempswafalse \fi
\@tempcntb#1\@whilenum\@tempcntb<#2\do{%
\pcol@swapcolumn\@tempcntb\pcol@currcol#1#2\relax
\pcol@getcurrcol
\@makefcolumn\@deferlist
\pcol@@hfil \hb@xt@\columnwidth{%
\if@fcolmade \box\@outputbox \else \vbox to\@colht{}\fi \hss}%
\ifx\@deferlist\@empty\else \@tempswatrue \fi
\edef\pcol@@hfil{\noexpand\pcol@hfil{\pcol@colsepid}}%
\pcol@setcurrcolnf
\advance\@tempcntb\@ne}%
\if@tempswa \global\@fcolmadetrue \else \global\@fcolmadefalse \fi}}}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@freshpage}
% \changes{v1.0}{2011/10/10}
% {Rename \cs{pcol@maxpage} as \cs{pcol@toppage}.}
% \changes{v1.0}{2011/10/10}
% {Add save and restore of \cs{@currbox}.}
% \changes{v1.0}{2011/10/10}
% {Remove unnecessary assignment of \cs{pcol@currcol}.}
% \changes{v1.2-2}{2013/05/11}
% {Add argument 0 for the invocations of \cs{pcol@startcolumn} to
% inhibit inserting deferred page-wise footnotes.}
%
% The macro \!\pcol@freshpage! is invoked from \!\pcol@output@flush! and
% \!\pcol@output@clear! to start a new page after column flushing. At
% first, we let $p=\pbase=\ptop=0$ and $\PP=\emptyset$ because we know no
% pages are kept. Then we invoke \!\pcol@startpage! to start a new page
% with a \!\def!inition of $\!\pcol@currpage!=|{}|$ to indicate the invoker
% is this macro (i.e., not \!\pcol@opcol!). Then after keeping \!\@colht!
% in $h=\!\pcol@colht!$, we do the followings for each column $c\In0\C$.
%
% First we obtain $c$'s \cctext{} in $\cc_c$ by \!\pcol@getcurrcol! but let
% $p=0$ and $\!\@colroom!=h$, which can be modified by $c'<c$, without
% referring to $\cc_c(\vb^p)$ nor $\cc_c(\vb^r)$ because they are obsolete.
% We also save \!\@currbox! to \Midx{\!\pcol@currboxsave!} because it may be
% modified by \!\pcol@opcol! if we make \fcolumn{}s afterward. Then we invoke
% \!\pcol@getcurrpage! to have the \pctext{} of $p=0$, because it might be
% modified by a column $c'<c$ by producing \fcolumn{}s. After that and the
% invocation of \!\pcol@floatplacement! for setting float parametners, we
% invoke \!\pcol@startcolumn! for $c$'s \colpage{} at $p=0$, and iterate
% \!\pcol@opcol! and \!\pcol@startcolumn! while a \fcolumn{} is made by the
% latter\footnote{
%
% Each column can have deferred floats on the invocation from
% \!\pcol@output@flush!.}.
%
% Note that we give the argument 0 to each invocation of
% \!\pcol@startcolumn! to keep it from inserting deferred \Scfnote{}s, which
% will be taken care of by \!\pcol@restartcolumn! if any. At last in the
% loop, we restore \!\@currbox! from \!\pcol@currboxsave!, let
% $\cc_c(\vb^b)$ be an empty \!\vbox! because the main vertical list is
% empty, and save the \cctext{} into $\cc_c$ by \!\pcol@setcurrcolnf!
% because of no footnotes obviously, after saving $p$ and \!\@colroom!,
% which might be modified by the \fcolumn{} production, into $\cc_c(\vb^p)$
% and $\cc_c(\vb^r)$.
%
% After the loop above, finally we invoke \!\pcol@restartcolumn! to return
% to the column in which \!\flushpage! or \!\clearpage! was issued.
%
% \begin{macrocode}
\def\pcol@freshpage{%
\global\pcol@page\z@ \global\pcol@toppage\z@ \global\pcol@basepage\z@
\global\let\pcol@pages\@empty \global\let\pcol@currpage\@empty
\pcol@startpage \pcol@colht\@colht
\pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
\pcol@getcurrcol \pcol@page\z@ \@colroom\pcol@colht
\let\pcol@currboxsave\@currbox
\pcol@getcurrpage
\pcol@floatplacement
\pcol@startcolumn\z@
\@whilesw\if@fcolmade\fi{\pcol@opcol \pcol@startcolumn\z@}%
\let\@currbox\pcol@currboxsave
\global\setbox\@currbox\vbox{}%
\global\count\@currbox\pcol@page \global\dimen\@currbox\@colroom
\pcol@setcurrcolnf
\advance\pcol@currcol\@ne}%
\pcol@restartcolumn}
% \end{macrocode}
% \end{macro}
%
%
%
% \subsection{Last Page}
% \label{sec:imp-sout-end}
%
% \begin{macro}{\pcol@output@end}
% \changes{v1.0}{2011/10/10}
% {Drastically changed to take special care of float columns in the
% last page, to deal with the empty last page with and without
% deferred floats, and to try to make post-environment float pages.}
% \changes{v1.2-2}{2013/05/11}
% {Add incorporation of page-wise footnotes in the last ordinary
% pages followed by float-pages.}
% \changes{v1.2-7}{2013/05/11}
% {Add \cs{pcol@outputfalse} to solve the \cs{output} request sneaking.}
% \changes{v1.2-7}{2013/05/11}
% {Add $\cs{boxmaxdepth}\EQ\cs{@maxdepth}$ for depth capping knowing
% it is redundant.}
% \changes{v1.3-2}{2013/09/17}
% {Add parallel-paging operations.}
% \changes{v1.3-3}{2013/09/17}
% {Add background painting of page-wise footnotes and setting
% of \cs{pcol@preposttop}.}
% \changes{v1.3-4}{2013/09/17}
% {Add opeartios to pass $\string\cal{M}$ to the next
% \string\texttt{paracol} environment and \cs{@mparbottom} to post
% environment typesetting.}
%
% The macro \!\pcol@output@end! is invoked solely from
% \!\pcol@specialoutput! to process the \!\output! request made by
% \!\endparacol!. We invoke \!\pcol@makeflushedpage! for the \lpage{}
% production as the setting $\CSIndex{ifpcol@lastpage}=\true$ done by
% \!\endparacol! indicates, giving it $h=\!\pcol@colht!$ in which
% \!\pcol@sync! sets the height of the tallest \colpage{} to have the
% ship-out image of the \tpage{} in \!\@outputbox!.
%
% Next, we define $\mpbout=\!\pcol@mparbottom@out!$ as follows. First, we
% invoke \!\pcol@getmparbottom@last! giving it $y=\VPP-\!\ht!\!\@outputbox!$
% being the negative counterpart of
% the height of \spanning{} in the \lpage, to let $\mpbout$ have the occupancy
% information of the bottom marginal note in each margin if any, or
% $\mpar(y,y)$ otherwise. Then we transform $y$-coordinates in $\mpbout$
% from those for columns to those for text area by
% $\!\pcol@bias@mpbout!\Arg{-y}$ to have the final result. Then to pass
% \!\@mparbottom! for post-environment typesetting,
%
% \Index{post-environment stuff}
%
% we invoke \!\pcol@do@mpbout! \!\def!ining \!\pcol@do@mpbout@whole! to do
% nothing and \!\pcol@do@mpbout@elem! to let $\!\@mparbottom!=b$ where
% $\mpb_L^x=(\mpar(t,b))$ and $x\in\{l,r\}$ according to the margin which
% post-environment marginal notes go to.
%
% \Index{post-environment stuff}
%
% \begin{macrocode}
%% Special Output Routines: Last Page
\def\pcol@output@end{%
\pcol@Logstart\pcol@output@end
\pcol@makeflushedpage\pcol@colht
\@tempdima\pcol@colht \ifdim\pcol@colht<\z@ \@tempdima\z@ \fi
\advance\@tempdima-\ht\@outputbox
\pcol@getmparbottom@last\@tempdima
\pcol@bias@mpbout{-\@tempdima}
\def\pcol@do@mpbout@whole##1##2##3##4{\setbox\@tempboxa\hbox{##1##2##3##4}}%
\def\pcol@do@mpbout@elem\@elt##1##2{\global\@mparbottom##2sp}%
\pcol@do@mpbout
% \end{macrocode}
%
% Next we process one of the following cases.
%
% The first case is for $\CSIndex{ifpcol@dfloats}=\true$ to mean the
% \lpage{} is followed by one or more pages having deferred \cwise{}
% floats and thus \!\pcol@makeflushedpage! builds the ship-out image of the
% \lpage{} in {\em full size} in \!\@outputbox! unless the page has nothing
% perfectly. Therefore, we ship the image out by \!\@outputbox! unless it
% is $\bot$ for perfectly empty case. Then we invoke \!\pcol@flushfloats!
% to produce and ship out \fpage{}s, lettinng $\CSIndex{if@fcolmade}={\true}$
% to tell the macro that at least we will have one \fpage{}. Now we have
% shipped out everyting in the closing environment and thus we let
% $\CSIndex{ifpcol@output}=\false$ to tell \!\output! routine to work
% ordinarily. Then we let $\CSIndex{if@tempswa}=f_{\it sp}=\true$ to
% remember we will start a new page and thus $\!\@pagedp!=\pd=\DP=1000$ to
% mimic \TeX's \!\prevdepth! mechanism. Finally we let
% $\CSIndex{@mparbottom}=0$ and $\mpbout=\mpboutz$ because no marginal notes
% are carried over to post-environment typesetting.
%
% \Index{post-environment stuff}
%
% \changes{v1.3-6}{2013/09/17}
% {Simplify the case with deferred floats thanks to
% \cs{ifpcol@dfloats} and redesign of \cs{pcol@makeflushedpage}.}
%
% \begin{macrocode}
\@tempswafalse
\ifpcol@dfloats
\ifvoid\@outputbox\else \@outputpage \fi
\global\@fcolmadetrue \pcol@flushfloats
\global\pcol@outputfalse
\@tempswatrue \@pagedp\@m\p@ \global\@mparbottom\z@
\global\let\pcol@mparbottom@out\pcol@mparbottom@zero
% \end{macrocode}
%
% Before proceeding to the second and third cases, we let
% $\CSIndex{ifpcol@output}=\false$ because we have nothing to ship out.
%
% Then the second case is for $h=-\infty$ without deferred \cwise{}
% floats to mean all columns in the \lpage{} are empty and the page does not
% have non-merged \Scfnote{}s. In this case, we examine if
% $\Midx{\!\pcol@firstprevdepth!}=\!\relax!$ to mean we have had at least
% one new page in \env{paracol} environment, i.e., \!\pcol@startpage! have
% been invoked at least once. If so, we let $f_{\it sp}=\true$, $\pd=1000$,
% $\!\@mparbottom!=0$ and $\mpbout=\mpboutz$ again and put nothing to the
% main vertical list so that the \postenv{} starts from the top of the page.
% However, we have to take care of the case that $f_{\it ns}=\false$ and
% thus \!\@outputbox! has \spanning. If so, we acquire an \!\insert! from
% \!\@freelist! by \!\@next! to let it have the \spanning, i.e., the
% contents of \!\@outputbox!\footnote{
%
% It does not have \!\dbltextfloatsep! at its tail because the skip has been
% removed by \!\pcol@makeflushedpage!.}.
%
% Then the \!\insert! is added to the head of \!\@dbldeferlist! with the
% float placement code 10 to force \LaTeX's float placement mechanism to put
% it to the page to be started shortly.
%
% On the other hand, $\!\pcol@firstprevdepth!\neq\!\relax!$ means that it
% has $\!\prevdepth!=\pd'$ just before \beginparacol{} in decimal integer
% representation. Since we have not started any pages in the environment,
% and all columns in the \lpage{} is empty, we have almost nothing in the
% environment. Note that the environment can have \pwise{} floats but they
% have not yet put into any pages but are kept in \!\@dbldeferlist!, or
% \Mgfnote{}s but they are merged to those in \postenv. Therefore, the
% \preenv{} and \postenv{} must be {\em connected} naturally and thus we put
% the \preenv{} kept in \!\@outputbox! to the main vertical list by
% \!\unvbox!, letting $\pd=\pd'$ and keeping $f_{\it sp}=\false$\footnote{
%
% The author of course know this situation is very unlikely but he is
% monomaniac.}.
%
% In this case, the setting of \!\@mparbottom! and $\mpbout$ done at the
% beginning of this macro is correct because they describe the marginal
% notes in \preenv{} including \env{paracol} enviroments preceeding it even
% if any.
%
% \changes{v1.3-3}{2013/09/17}
% {Add settings for background painting of post-environment stuff.}
% \changes{v1.3-4}{2013/09/17}
% {Add letting $\cs{@mparbottom}\EQ0$ and
% ${\string\cal{M}}\EQ{\string\cal{M}}_0$ for the simple empty page
% case.}
% \changes{v1.3-6}{2013/09/17}
% {Remove \cs{unskip} from the operation to let page-wise floats be
% ordinary ones because \cs{pcol@makeflushedpage} does it.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\else
\global\pcol@outputfalse
\ifdim\pcol@colht=-\maxdimen
\ifx\pcol@firstprevdepth\relax
\@tempswatrue \@pagedp\@m\p@ \global\@mparbottom\z@
\global\let\pcol@mparbottom@out\pcol@mparbottom@zero
\ifpcol@nospan\else
\pcol@Fb
\@next\@currbox\@freelist{\global\setbox\@currbox\box\@outputbox}%
\pcol@ovf
\pcol@Fe{output@end(spanning)}%
\count\@currbox10\relax
{\let\@elt\relax \xdef\@dbldeferlist{\@elt\@currbox\@dbldeferlist}}%
\global\setbox\pcol@rightpage\box\voidb@x
\fi
\else \unvbox\@outputbox \@pagedp\pcol@firstprevdepth sp\relax
\fi
% \end{macrocode}
%
% The last case without deferred floats and with some non-empty columns or
% non-merged \Scfnote{}s is
% most usual. In this case, we may simply put \!\@outputbox! letting
% $\!\topskip!=0$ because \!\topskip! has already been inserted in
% \colpage{}s or \preenv{} in the box\footnote{
%
% If the \lpage{} has non-merged \Scfnote{}s without any other items,
% \cs{topskip} has not been inserted, but this inconsistency without
% \cs{topskip} is acceptable.}.
%
% However before putting the box back to the main vertical list, we have to
% take care of the \bgpaint{} as follows. First we let
% $\CSIndex{ifpcol@havelastpage}=\true$ to let \!\@outputpage! paint the
% \bground{} of the \postenv{} when the page having the \lpage{} completes.
% Second, we let \!\pcol@bg@preposttop@left! have the height-plus-depth of
% the \!\@outputbox! having the short \lpage{} because the \bground{} of
% \postenv{}, or of \preenv{} if we have another \env{paracol} environment
% in the same page, to be painted is just below the box. We also
% \!\pcol@bg@preposttop@right! have the same value but only if $\CL<\C$,
% because otherwise we have to keep this macro unchanged so that the
% non-existent right \parapag{}e of the closing environment can be the
% \postenv{} of a preceding environment and/or the \preenv{} of a succeeding
% one with \parapag{}ing. Note that in the aforementioned {\em fresh page}
% cases and the perfectly empty case, we may be unaware of these macros
% because it should have been made 0 by the last invocation of
% \!\@outputpage! in the fresh page case or the \preenv{} and \postenv{} are
% contiguous in the empty case.
%
% Third and finally, we have to paint the \bground{} of non-merged
% \Scfnote{}s because the painting is left by \!\pcol@makeflushedpage! for
% this macro. Therefore, if $\!\pcol@fnheight@lpage!>0$ to mean we have
% footnotes whose total height-plus-depth is in the macro, we paint their
% \bground{} by \!\pcol@bg@paintbox! \!\def!ining \!\pcol@bg@footnoteheight!
% with the size and temporarily re\!\def!ining \!\pcol@bg@textheight! to be
% the height-plus-depth of \!\@outputbox! because the foontnotes are at the
% bottom of the box instead of the page. Note that the order of painting is
% right first and then left second if we have \parapag{}es because we refer
% the height-plus-depth of \!\@outputbox! being put into the main vertical
% list making the box $\bot$. Also note that if the right \parapag{}e is
% \npaired, we temporarily increment \!\c@page! in \!\pcol@rightpage! to let
% \!\pcol@bg@paintbox! handle \bginfext{} to side margins correctly.
% Another remark is that we don't modify $\pd=\!\@pagedp!$ and thus it keeps
% $\DP$ in this case, and $f_{sp}$ is kept $\false$.
%
% \changes{v1.3-3}{2013/09/17}
% {Add background painting of page-wise footnotes.}
%
% \begin{macrocode}
\else
\global\pcol@havelastpagetrue
\@tempdima\ht\@outputbox \advance\@tempdima\dp\@outputbox
\xdef\pcol@bg@preposttop@left{\number\@tempdima sp}%
\ifnum\pcol@ncolleft<\pcol@ncol
\global\let\pcol@bg@preposttop@right\pcol@bg@preposttop@left
\fi
\def\pcol@bg@textheight{\@elt{\ht\@outputbox}\@elt{\dp\@outputbox}}%
\def\reserved@a{%
\ifdim\pcol@fnheight@lpage>\z@
\def\pcol@bg@footnoteheight{\@elt\pcol@fnheight@lpage}%
\pcol@bg@paintbox{Nn}%
\fi}%
\ifnum\pcol@ncolleft<\pcol@ncol
\global\setbox\pcol@rightpage\vbox{%
\ifpcol@paired\else \advance\c@page\@ne \fi
\reserved@a \unvbox\pcol@rightpage}%
\fi
\topskip\z@ \vbox{\reserved@a \unvbox\@outputbox}%
\fi
\fi
% \end{macrocode}
%
% Now we have put almost everything in the \lpage{} but we may still have
% \Scfnote{}s in $\pp^f(\ptop)$ to be merged with those in \postenv.
% Therefore, we \!\insert! them through \!\footins! as a part of \postenv,
% and then do that for deferred footnotes in $\df=\!\pcol@topfnotes!$
% without using \!\pcol@deferredfootins! because we don't need the height
% capping.
%
% \changes{v1.2-2}{2013/05/11}
% {Add insertion of page-wise footnotes to be merged.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
%
% \begin{macrocode}
\ifvoid\pcol@footins\else
\pcol@Log\pcol@output@end{insert}\pcol@footins
\pcol@Fb
\insert\footins{\unvbox\pcol@footins}\@cons\@freelist\pcol@footins
\pcol@Fe{output@end(pagefn)}%
\fi
\ifvoid\pcol@topfnotes\else \insert\footins{\unvbox\pcol@topfnotes}\fi
% \end{macrocode}
%
% The following operationss are for clean-up and set-up for the \postenv;
% for all c, return $\cc_c(\vb)$ obtained by \!\pcol@getcurrcol! and
% $\Celt^c\neq\bot$ letting it $\bot$ to \!\@freelist!; reestablish the
% \colorstack{} by \!\pcol@restorecolorstack! for column-0\footnote{
%
% It can be any other column.}
%
% so that the \colorstack{} is just $\cst$ and is rewinded at \Endparacol,
% and let $\cst=\bot$; reload $\cc_d$ for $d=\!\pcol@lastcol!$ being the
% column in which \Endparacol{} occurs to let $\!\everypar!=\cc_d(\ep)$ and
% to let \CSIndex{if@nobreak} and \CSIndex{if@afterindent} have the value
% represented by $\cc_d(\sw)$, so that the first paragraph of the \postenv{}
% is typeset following them\footnote{
%
% For rare cases that the last item of the closing environment is a
% sectioning command, but a user has such very unusual usage.};
%
% let $\!\pcol@prevdepth!=\pd$ so that it is set to \!\prevdepth! by
% \!\pcol@invokeoutput!; let $\!\@colht!=\!\@colroom!=\!\textheight!$ to
% mean the single-column page does not have any floats so far because those
% produced in or before the environment have already been shipped out, are
% put to the main vertical list packed in \!\@outputbox!, or are in
% \!\@dbldeferlist!.
%
% As for deferred \pwise{} floats produced in the environment, including
% those once put in the \lpage{} but returned to the list by the operation
% described above, we move them to \!\@deferlist! because they are now
% \cwise{} floats. Then we invoke \!\pcol@floatplacement! to
% reinitialize float placement parameters. Finally, if $f_{\it sp}=\true$,
% we invoke \!\@startcolumn! and then repeat invocations of \!\@opcol! and
% \!\@startcolumn! while \fpage{}s are produced, after letting
% $\CSIndex{ifpcol@lastpage}=\false$ to make \!\@combinefloats! work as
% \LaTeX's original\footnote{
%
% Letting $\!\pcol@textfloatsep!=\infty$ is done by \!\pcol@floatplacement!.}.
%
% \changes{v1.2-1}{2013/05/11}
% {Add color resetting.}
% \changes{v1.31}{2013/10/10}
% {Add \cs{pcol@getcurrcol} for the column specified by
% \cs{pcol@lastcol} to pass \cs{if@nobreak}, \cs{if@afterindent} and
% \cs{everypar} of the column to post-environment stuff.}
% \changes{v1.32-2}{2015/10/10}
% {Add \cs{pcol@Fb}/\cs{pcol@Fe} pair(s).}
% \changes{v1.34}{2018/05/07}
% {Remove nullification of $\gamma_0^0$ because it is not meaningless
% now, add release of $\gamma_0^c\NEQ\bot$ and then nullification of
% it for all $c$, move color stack reestablishment down to the loop
% with $c$ to ensure $\gamma_0^0\EQ\bot$, and add nullification of
% $\mathit{\Gamma}$.}
%
% \begin{macrocode}
\pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
\pcol@Fb
\pcol@getcurrcol \@cons\@freelist\@currbox
\ifvoid\pcol@ccuse{@box}\else
\@cons\@freelist{\pcol@ccuse{@box}}%
\pcol@ccxdef{\voidb@x}%
\fi
\pcol@Fe{output@end(col)}%
\advance\pcol@currcol\@ne}%
\pcol@currcol\z@ \pcol@restorecolorstack
\global\setbox\pcol@colorins\box\voidb@x
\pcol@currcol\pcol@lastcol\relax \pcol@getcurrcol
\global\pcol@prevdepth\@pagedp
\global\@colht\textheight
\global\@colroom\textheight
\global\let\@deferlist\@dbldeferlist \gdef\@dbldeferlist{}%
\pcol@floatplacement
\pcol@lastpagefalse
\if@tempswa
\@startcolumn \@whilesw\if@fcolmade\fi{\@opcol\@startcolumn}%
\fi
\pcol@Logend\pcol@output@end
}
% \end{macrocode}
% \end{macro}
%
%
%
% \section{Starting Environment}
% \label{sec:imp-startenv}
%
% \begin{macro}{\pcol@invokeoutput}
% \changes{v1.0}{2011/10/10}
% {Let \cs{pcol@prevdepth} have \cs{prevdepth} directly instead of via
% \cs{tempdima}.}
% \changes{v1.2-2}{2013/05/11}
% {Add logging.}
% \changes{v1.2-5}{2013/05/11}
% {Move the setting of \cs{linewidth} and \cs{hsize} from
% \cs{pcol@getcurrcol} to this macro and add \cs{parshape}.}
% \changes{v1.21}{2013/06/06}
% {Add zero-clearing of \cs{deadcycles}.}
%
% Before giving the definition of \env{paracol} environment and commands
% used in it, we define the macro $\!\pcol@invokeoutput!\arg{pen}$ invoked
% from them to make an \!\output!-request with \!\penalty! of
% $\arg{pen}=|\pcol@op@|{\cdot}f$. The macro's structure is similar to that
% for the request sequence in \!\end@float! as follows; insert a \!\penalty!
% of $-10004$ to save the main vertical list in \!\@holdpg!; save
% \!\prevdepth!; insert a \!\vbox! to make it sure the following \!\penalty!
% of $\arg{pen}$ is kept even when we are at the top of a page; and finally
% restore \!\prevdepth!.
%
% A difference is that we zero-clear \!\deadcycles! because it can be reach
% $\!\maxdeadcycles!=100$ easily if a page has many \sync{}ations and many
% columns. Another and more important difference is in the save\slash
% restore of \!\prevdepth!. First, the value of the register is saved in
% our own \!\pcol@prevdepth! instead of \!\@tempdima! by a \!\global!
% assignment so that \!\output!-routine refers to it\footnote{
%
% The assignment is not necessary to be done \!\global!ly but we dare to do
% it to make all assignments to \!\pcol@prevdepth! being \!\global!
% consistently.}.
%
% Second, the value restored to \!\prevdepth! may be different from that we
% just have saved because \!\output!-routine may update \!\pcol@prevdepth!
% to have, for example, the value saved in $\cc_c(\pd)$ when we left from
% $c$ which we are now restarting.
%
% In addition to above, after the invocatoin of \!\output!-routine, we let
% $\!\linewidth!=\w_c-\lrm$ so that the register is shrunk from $\w_c$ by the
% total width of left and right margins of the \env{list}-like environment
% surrounding \env{paracol} if $\lrm=\!\pcol@lrmargin!>0$ to mean that.
% Then if so, we set \!\parshape! to let every line of paragraphs in the
% column $c$ is indented by \!\@totalleftmargin! and has width of
% \!\linewidth!, as \LaTeX's \!\list! does. We also let $\!\hsize!=\w_c$
% because it should have the width of the column even in a \env{list}-like
% environment.
%
% The macro is invoked from \!\pcol@zparacol! ($f=|start|$),
% \!\pcol@switchcol! for \!\switch~column! and \csenv{}s ($f=|switch|$),
% \!\pcol@visitallcols! for \cscan{} prior to \sync{}ed \cswitch{} and page
% flushing ($f=|switch|$), \!\pcol@flushclear! for \pfcheck{}
% ($f=|switch|$), \!\pcol@com@flushpage! for \!\flushpage! ($f=|flush|$),
% \!\pcol@com@clearpage! for \!\clearpage! ($f=|clear|$), and
% \!\endparacol! ($f=|end|$).
% \SpecialIndex{\pcol@op@start}
% \SpecialIndex{\pcol@op@switch}
% \SpecialIndex{\pcol@op@flush}
% \SpecialIndex{\pcol@op@clear}
% \SpecialIndex{\pcol@op@end}
%
% \begin{macrocode}
%% Starting Environment
\def\pcol@invokeoutput#1{\deadcycles\z@
\pcol@Logstart{\pcol@invokeoutput
{#1:\the\pcol@currcol/\the\pcol@nextcol%
\ifnum#1=-10011:\ifpcol@sync s\fi \ifpcol@clear c\fi\fi}}%
\penalty-\@Miv \global\pcol@prevdepth\prevdepth \vbox{}%
\penalty#1\relax \prevdepth\pcol@prevdepth
\linewidth\columnwidth \advance\linewidth-\pcol@lrmargin
\ifdim\pcol@lrmargin>\z@ \parshape\@ne\@totalleftmargin\linewidth \fi
\hsize\columnwidth
\pcol@Logend{\pcol@invokeoutput{#1}}}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{2}
% \begin{macro}{\paracol}
% \changes{v1.0}{2011/10/10}
% {Change the order of operations for sake of clarity.}
% \changes{v1.0}{2011/10/10}
% {Add the mechanism of inter-environment local counter conservation.}
% \changes{v1.0}{2011/10/10}
% {Let $\cs{col@number}\EQ1$ instead of $C$ to keep \cs{maketitle} from
% producing title with \cs{twocolumn}.}
% \changes{v1.0}{2011/10/10}
% {Add initialization of \cs{pcol@textfloatsep}, \cs{ifpcol@lastpage},
% \cs{pcol@firstprevdepth} and \cs{@combinefloats}.}
% \changes{v1.0}{2011/10/10}
% {Make API commands environment-local and inhibit nesting of
% \texttt{paracol}.}
% \changes{v1.3-2}{2013/09/17}
% {Modify to add the optinal argument $C_L$ and optional
% `\string\texttt{*}' for parallel-paging.}
% \begin{macro}{\pcol@xparacol}
% \changes{v1.3-2}{2013/09/17}
% {Introduced to let $C_L\EQ C$ if the optional argument $C_L$ is not
% given to \cs{paracol}.}
% \begin{macro}{\pcol@yparacol}
% \changes{v1.3-2}{2013/09/17}
% {Introduced to process the optional `\string\texttt{*}' given with
% the optioal argument $C_L$ of \cs{paracol}.}
% \begin{macro}{\pcol@zparacol}
% \changes{v1.3-2}{2013/09/17}
% {Introduced to add the optinal argument $C_L$ and optional
% `\string\texttt{*}' to \cs{paracol} for parallel-paging and to do
% what had done by \cs{paracol}.}
%
% The API macro $\!\paracol!|[|\CL|][*]|\Arg{\C}$\oarg{text} is invoked by
% \beginparacol{} to start a \Midx{\env{paracol}} environment. The macro
% sipmly examines the existence of the optional argument $\CL$, whose
% default value $\C$ is given by \!\pcol@xparacol!, to decide the
% number of columns in left \parapag{}es. Then if the optional argument is
% given, \!\pcol@yparacol! examines the existence of `|*|' following it for
% \npaired{} \parapag{}ing to let $\CSIndex{ifpcol@paired}=\false$, while
% \!\paracol! gave the default $\true$ for \paired{} one to the switch.
% Then the all other operations to start the environment is doen by
% \!\pcol@zparacol!.
%
% \begin{macrocode}
\def\paracol{\global\pcol@pairedtrue \@ifnextchar[%]
\pcol@yparacol\pcol@xparacol}
\def\pcol@xparacol#1{\pcol@zparacol[#1]{#1}}
\def\pcol@yparacol[#1]{%
\@ifstar{\global\pcol@pairedfalse \pcol@zparacol[#1]}%
{\pcol@zparacol[#1]}}
% \end{macrocode}
%
% In \!\pcol@zparacol!, after making it sure to be in vertical mode by
% \CSIndex{par}, at first we examine if we are neither in a box by
% \CSIndex{ifinner} nor with ordinary two-column typesetting by
% \CSIndex{if@twocolumn}, and complain about inappropriateness unless our
% expectation is satisfied. Then we let $\CL$ and $\C$ have the value given
% through the corresponding arguments, unless $\CL>\C$ to let us make
% $\CL=\C$ silently. Next we examine $\CL<\C$, and if not we let
% $\CSIndex{ifpcol@paired}=\true$ regardless the setting in
% \!\pcol@yparacol! because \npaired{} typesetting is meaningless without
% \parapag{}ing. On the other hand, if \npaired{} typesetting is specified,
% we let $\CSIndex{ifpcol@swapcolumn}={\false}$ but {\em not} \!\global!ly
% because \cswap{} is meaningless in \npaired{} mode in the environment now
% starting.
%
% Second, we perform the operations done by \!\item! if
% $\CSIndex{if@newlist}=\true$ and $\CSIndex{if@inlabel}\~=\false$ to mean
% the first one in a \env{list}-like environment will appear at the very
% first line of the leftmost column. That is, we invoke \!\@nbitem! if
% $\CSIndex{if@nobreak}=\true$, or add a penalty \!\@beginparpenalty! and a
% vertical skip $\!\@topsep!-\!\parskip!-\!\itemsep!$ so that the first
% \!\item! is \!\@topsep! apart from the last line above the environment,
% and then let $\CSIndex{if@newlist}=\false$. The reason why we do these
% operations here is that, if the \env{paracol} environment is enclosed in a
% \env{list}-like environment without anything between two \!\begin! for
% environments, we have to align all first \!\item!s in all columns. That
% is, if we did not do that, the {\em literally first} \!\item! would do
% that resulting in the column having the \!\item! led by the vertical skip
% of \!\@topsep! while others should have ordinary inter-\!\item! skips.
% Therefore, we perform the operations on behalf of all first \!\item!s in
% all columns to have the skip of \!\@topsep! {\em above} the \env{paracol}
% environment we are opening. Note that if \beginparacol{} immediately
% follows a \!\begin! for a \env{trivlist}-like environment,
% $\CSIndex{if@inlabel}=\true$ because the first \!\item! was given in the
% opening macro and thus the operations shown above has already been
% performed.
%
% \changes{v1.3-6}{2013/09/17}
% {Add operations for the vertical skips at the beginning of a
% \texttt{list}-like environment.}
% \changes{v1.35-6}{2018/12/31}
% {Add error check with \cs{ifinner} and \cs{if@twocolumn}.}
% \changes{v1.35-2}{2018/12/31}
% {Add $\lnot$\cs{if@inlabel} to the condition to perform operations
% for first \cs{item}.}
%
% \begin{macrocode}
\def\pcol@zparacol[#1]#2{\par
\ifinner \@parmoderr \fi
\if@twocolumn \PackageError{paracol}{%
Environment paracol cannot work with ordinary two-column
typesetting.}\@ehb\fi
\global\pcol@ncolleft#1\relax \global\pcol@ncol#2\relax
\ifnum\pcol@ncolleft>\pcol@ncol \global\pcol@ncolleft\pcol@ncol \fi
\ifnum\pcol@ncolleft<\pcol@ncol\else \global\pcol@pairedtrue \fi
\ifpcol@paired\else \pcol@swapcolumnfalse \fi
\if@newlist \if@inlabel\else
\if@nobreak \@nbitem
\else
\addpenalty\@beginparpenalty
\addvspace\@topsep
\addvspace{-\parskip}\addvspace{-\itemsep}%
\fi
\global\@newlistfalse
\fi\fi
% \end{macrocode}
%
% The third operation group is to set up lists for counters as follows.
% First we obtain $\CC=\!\cl@@ckpt!$ to have all counters defined by
% \!\newcounter! and \counter{page}. Then we scan $\CG=\!\pcol@gcounters!$
% applying \!\pcol@remctrelt! to each element to have
% $\CTL=\!\pcol@counters!$ for all \lcounter{}s by removing all $\cg\in\CG$
% from $\CC$, and to move $\clist(\cg)=|\cl@|{\cdot}\cg$ to
% $|\pcol@cl@|{\cdot}\cg$ redefining
% $|\cl@|{\cdot}\cg=\!\pcol@stepcounter!\Arg{\cg}$
%
% \SpecialArrayIndex{\theta}{\cl@}
%
% to clear descendant \lcounter{}s of $\cg$, i.e., those in $\clist(\cg)$.
%
% Next we scan $\CTL$ applying \!\pcol@thectrelt! to each element $\cl\in\CTL$
% to let $|\pcol@thectr@|{\cdot}\~\cl=|\the|{\cdot}\cl$
%
% \SpecialArrayIndex{\theta}{\pcol@thectr@}
% \SpecialArrayIndex{\theta}{\the}
%
% so that the former has the {\em default} \lrep{} of $\cl$. The macro
% \!\pcol@thectrelt! also lets
% $|\the|{\cdot}\cl=|\pcol@thectr@|{\cdot}\cl{\cdot}0$
%
% \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
% \SpecialArrayIndex{\theta}{\the}
%
% if the \lrep{} for $\cl$ and $c=0$ has been defined by
% \!\definethecounter!. This is necessary because in the first visit to the
% leftmost column 0 we will neither invoke \!\pcol@switchcol! nor thus scan
% $\CTL$ with \!\pcol@setctrelt! which defines \lrep{}s, unless a \mctext{}
% is specified with \beginparacol.
%
% Next we give the initial value of $\val_c(\cl)$ for each column $c$ and
% \lcounter{} $\cl\in\CTL$ by the followings enclosed in a group. First we
% scan $\Cc_0$ applying \!\pcol@loadctrelt! to each
% $\cl\in\Cc'_0=\Set{\theta}{\<\theta,\val_0(\theta)\>\in\Cc_0}$ to have
% the value $\val_0(\cl)$ in $|\pcol@ctr@|{\cdot}\cl$
%
% \SpecialArrayIndex{\theta}{\pcol@ctr@}
%
% temporarily. Next we scan $\CTL$ to pick \lcounter{}s $\theta$ such that
% $\Uidx\Val(\theta)\neq\val_0(\theta)$ where $\Val(\theta)$ is the value of
% $\theta$ outside \env{paracol} environment, or $\theta\notin\Cc'_0$, to
% let them be listed in \!\@gtempa!. That is, we pick \lcounter{}s which
% have been updated or defined after the closing of the previous
% \env{paracol}, or everything in $\CTL$ at the first \beginparacol{} because
% $\Cc_0=\emptyset$\footnote{
%
% Undefined in fact.}.
%
% Finally, we invoke \!\pcol@synccounter! giving it \!\@gtempa! as its
% argument to let $\val_c(\theta)=\Val(\theta)$ for all $c$ and for each
% $\theta$ in \!\@gtempa!. That is, when \env{paracol} environment appears
% two or more times, the value of a \lcounter{} at the beginning of the
% second or succeeding environment is kept unchanged from that at the end of
% the previous environment, unless it has been updated between them. Note
% that these scans above are enclosed in a group in order to make
% $|\pcol@ctr@|{\cdot}\cl$
%
% \SpecialArrayIndex{\theta}{\pcol@ctr@}
%
% local and thus collected as a garbage at \!\endgroup!.
%
% \begin{macrocode}
\global\let\pcol@counters\cl@@ckpt
\let\@elt\pcol@remctrelt \pcol@gcounters
\let\@elt\pcol@thectrelt \pcol@counters
\begingroup
\let\@elt\pcol@loadctrelt \csname pcol@counters0\endcsname
\let\@elt\pcol@cmpctrelt \global\let\@gtempa\@empty \pcol@counters
\pcol@synccounter\@gtempa
\endgroup
% \end{macrocode}
%
% Fourth, we set up a few \LaTeX's typesetting parameters which should have
% appropriate values in the environment. We let
% $\CSIndex{if@twocolumn}=\true$ so that \textit{float}|*| environments work
% for \pwise{} floats and LaTeX's \!\@addmarginpar! determine the margin
% for marginal notes by \CSIndex{if@firstcolumn} whose truth value is
% determined by our own \!\@addmarginpar!. We also let $\!\col@number!=1$
% instead of $\C$ so that its (almost surely) sole user \!\maketitle! will
% not produce the title with \!\twocolumn! which cannot be in the
% environment.
%
% Then we invoke $\!\pcol@setcolumnwidth!\<\Cfrom\>\<\Cto\>\<r\>\<s\>$ once
% or twice with
% $(\Cfrom,\Cto,r,s)=(0,\CL,\!\pcol@columnratioleft!,\!\pcol@colwidthspecleft!)$
% always for left \parapag{}e, and with
% $(\CL,\C,\!\pcol@columnratioright!,\!\pcol@colwidthspecright!)$ for right
% one if $\CL<\C$ to define column widths $\w_c=|\pcol@columnwidth|{\cdot}c$
%
% \SpecialArrayIndex{c}{\pcol@columnwidth}
%
% and that of \csepgap{}s $\gap_c=|\pcol@columnsep|{\cdot}c$
%
% \SpecialArrayIndex{c}{\pcol@columnsep}
%
% for all $c\In0\C=\LBRP0\CL\cup\LBRP\CL\C$.
%
% Then we initialize other variables as follows;
% $\lrm=\!\pcol@lrmargin!=\!\textwidth!-\!\linewidth!$ so that, if $\lrm>0$,
% \!\linewidth! for $c$ has $\w_c-\lrm$ reflecting the paragraph shape of the
% \env{list}-like environment surrounding \env{paracol} environment;
% $\!\pcol@topskip!=\!\topskip!$ for the second and succeeding pages;
% $\!\pcol@textfloatsep!=\infty$ to mean we don't have any \sync{}ation
% points so far; $\CSIndex{ifpcol@lastpage}=\false$ because the \spage{} is
% not the last so far; and $\!\pcol@firstprevdepth!=\!\prevdepth!$ in
% decimal integer form for the extreme empty case.
%
% We also make the macro \!\@combinefloats! \!\let!-equal to our own
% \!\pcol@combinefloats! throughout the environment, after saving its
% original definition into \Midx{\!\pcol@@combinefloats!} for processing
% \!\output! request sneaked from outsied of environment, so that our
% customization is in effect for any invocations including those from
% \LaTeX's own macros. Similarly, \!\@addmarginpar! is made \!\let!-equal
% to our own \!\pcol@addmarginpar! while its orginal definition is saved
% into \!\pcol@@addmarginpar! but in this case we need the original for the
% implementaion of our own. On the other hand, \!\end@dblfloat! is simply
% replaced with our own \!\pcol@end@dblfloat! being what \LaTeX{} had had until
% 2014 as discussed in item-(\ref{item:ovv-float-end@dblfloat}) of
% \secref{sec:imp-ovv-float}.
%
% \changes{v1.1}{2012/05/11}
% {Replace the calculation of \cs{columnwidth} with the call of
% \cs{pcol@setcolumnwidth} and the assignment of $w_0$ to it.}
% \changes{v1.2-4}{2013/05/11}
% {Modify the setting of \cs{if@firstcolumn} according to
% column-swapping.}
% \changes{v1.2-5}{2013/05/11}
% {Remove the setting \cs{columnwidth}, \cs{hsize} and \cs{linewidth}
% because they are properly set in and after \cs{pcol@output@start}.}
% \changes{v1.2-5}{2013/05/11}
% {Add the setting of \cs{pcol@lrmargin}.}
% \changes{v1.2-7}{2013/05/11}
% {Add the saving of \cs{@combinefloats}.}
% \changes{v1.3-4}{2013/09/17}
% {Revise the mechanism to define the width of columns and
% column-separating gaps, and add local overriding definition of
% \cs{@addmarginpar}.}
% \changes{v1.3-2}{2013/09/17}
% {Add operations to define the width of columns and column-separating
% gaps in right parallel-pages.}
% \changes{v1.32-3}{2015/10/10}
% {Add replacement of \cs{end@dblfloat} with \cs{pcol@end@dblfloat}.}
%
% \begin{macrocode}
\global\@twocolumntrue \col@number\@ne
\pcol@setcolumnwidth\z@\pcol@ncolleft
\pcol@columnratioleft\pcol@colwidthspecleft
\ifnum\pcol@ncolleft<\pcol@ncol
\pcol@setcolumnwidth\pcol@ncolleft\pcol@ncol
\pcol@columnratioright\pcol@colwidthspecright
\fi
\pcol@lrmargin\textwidth \advance\pcol@lrmargin-\linewidth
\global\pcol@topskip\topskip
\global\pcol@textfloatsep\maxdimen
\pcol@lastpagefalse \xdef\pcol@firstprevdepth{\number\prevdepth}%
\let\pcol@@combinefloats\@combinefloats \let\@combinefloats\pcol@combinefloats
\let\pcol@@addmarginpar\@addmarginpar \let\@addmarginpar\pcol@addmarginpar
\let\end@dblfloat\pcol@end@dblfloat
% \end{macrocode}
%
% Fifth, we save the original definition of \!\set@color! into
% \!\pcol@set@color!, and then examine if $\!\set@color!\neq\!\relax!$
% meaning some coloring package is loaded. If any coloring packages are not
% loaded, we make macros for \bgpaint{}, namely \!\pcol@bg@paintpage!,
% \!\pcol@bg@paintcolumns! and \!\pcol@bg@paintbox!, \!\let!-equal to
% \!\relax! for the first two and to \!\@gobble! for the last so that they do
% nothing without coloring package.
%
% If the coloring is enabled, on the other hand, we redefine \LaTeX's
% \!\set@color! so that it works as \!\pcol@set@color@push! with
% \colorstack. We also prepare the text colring mechanism to let
% $\CSIndex{ifpcol@inner}=\true$ in every \!\vbox! in the \env{paracol}
% environment as follows. First, we let $\CSIndex{ifpcol@inner}=\false$
% because we are not in any \!\vbox!es obviously. Then, to use
% \!\everyvbox! for our own pupose, we do the followings; (1) \!\global!ly
% assign a token \Midx{\!\pcol@dummytoken!}, which should never occurs, to
% \!\pcol@everyvbox!; (2) save \!\everyvbox! into \!\pcol@everyvbox!
% locally; (3) let \!\everyvbox! have a \!\the!-reference to
% \!\pcol@everyvbox! and |\pcol@innerture| to let
% $\CSIndex{ifpcol@inner}={\true}$; and then (4) make \!\everyvbox!
% \!\let!-equal to \!\pcol@everyvbox!. By the last operation (4), any
% \!\everyvbox! appearing in the \env{paracol} environment is replaced with
% \!\pcol@everyvbox! to keep the real \!\everyvbox! from modified nullifying
% our own operation |\pcol@innertrue|. On the other hand, since both
% \!\everyvbox! and \!\pcol@everyvbox! are registers to hold tokens and
% thus any operations applicable to \!\everyvbox! are also applicable to
% \!\pcol@everyvbox!, any updates on \!\everyvbox! and explicit references
% to it are simulated by \!\pcol@everyvbox!. Then the initial tokens given
% to \!\pcol@everyvbox! by the saving operation (2) or tokens given inside
% the environment are correctly processed whenever a \!\vbox! is opened,
% toghether with |\pcol@innertrue| to fulfill our own purpose, because the
% real \!\everyvbox! is let have a \!\the!-reference to \!\pcol@everyvbox!
% by (3). We also reserve the invocation of \!\pcol@restoreeveryvbox! by
% \!\aftergroup! so that the macro is invoked just after \Endparacol{} to
% examine if any \!\global! assignments to \!\everyvbox! has been made in
% the environment. The funny \!\global! assignment (1) is done for this
% examination so that we detect global assignments done in the environment
% having been closed because they should have changed the global value of
% \!\pcol@everyvbox! to something different from \!\pcol@dummytoken!.
%
% Then we continue the case having some coloring package to make \bgpaint{}
% macros \!\pcol@bg@paintpage!, \!\pcol@bg@paintbox! and
% \!\pcol@bg@paintcolumns! activated by making them \!\let!-equal to thier
% |@@| counterparts namely \!\pcol@bg@@paintpage!, \!\pcol@bg@@paintbox! and
% \!\pcol@bg@@paintcolumns! which implement \bgpaint{}.
%
% Finally we empty the shadow \colorstack{}
% $\cstshadow={}$\!\pcol@colorstack@shadow! to give it initial value
% regardless of the availability of coloring package.
%
% \changes{v1.2-1}{2013/05/11}
% {Add redefinitions of \cs{set@color} and \cs{reset@color}.}
% \changes{v1.22}{2013/06/30}
% {Add a trick with \cs{everyvbox} to turn on \cs{ifpcol@inner} in
% every \cs{vbox}.}
% \changes{v1.22}{2013/06/30}
% {Move initial emptying of $\string\mathit{\Gamma}$ from
% \cs{pcol@output@start} to \cs{pcol@zparacol}.}
% \changes{v1.22}{2013/06/30}
% {Add initial emptying of $\string\hat{\mathit{\Gamma}}$ and $\chi$.}
% \changes{v1.3-3}{2013/09/17}
% {Add definition of painting macros dependent to the availability of
% a coloring package.}
% \changes{v1.34}{2018/05/07}
% {Remove the initializations of \cs{pcol@colorstack} and
% \cs{pcol@colorstack@buf} because they no longer exist.}
%
% \begin{macrocode}
\global\let\pcol@set@color\set@color
\ifx\set@color\relax
\let\pcol@bg@paintpage\relax \let\pcol@bg@paintbox\@gobble
\let\pcol@bg@paintcolumns\relax
\else
\let\set@color\pcol@set@color@push
\pcol@innerfalse
\global\pcol@everyvbox{\pcol@dummytoken}%
\pcol@everyvbox\everyvbox
\everyvbox{\the\pcol@everyvbox \pcol@innertrue}
\let\everyvbox\pcol@everyvbox
\aftergroup\pcol@restoreeveryvbox
\let\pcol@bg@paintpage\pcol@bg@@paintpage
\let\pcol@bg@paintbox\pcol@bg@@paintbox
\let\pcol@bg@paintcolumns\pcol@bg@@paintcolumns
\fi
\gdef\pcol@colorstack@shadow{}%
% \end{macrocode}
%
% \changes{v1.2-2}{2013/05/11}
% {Add initialization of \cs{pcol@footnotebase} and
% \cs{pcol@nfootnotes}, and redefinitions of \cs{footnote},
% \cs{footnotemark}, \cs{footnotetext} and \cs{@footnotetext}.}
%
% The sixth settings are for (mainly \mcfnote) footnotes. We initialize two
% footnote-related count registers letting $\bf=\!\pcol@footnotebase!$ have
% \!\c@footnote! and zero-clearing $\nf=\!\pcol@nfootnotes!$. Then we
% redefine \LaTeX's API macros \!\footnote!, \!\footnotemark! and
% \!\footnotetext! to let them be our own \!\pcol@footnote!,
% \!\pcol@footnotemark! and \!\pcol@footnotetext! so that they have
% starred-versions. The other API macro to be redefined, if \Scfnote{}
% typesetting is in effect, is \!\footnoterule! which lets
% $\!\columnwidth!=\!\textwidth!$ before invoking its original version saved
% in \!\pcol@footnoterule! so that it acts as in single-columned typesetting
% rateher than multi-columned. Then we redefine \LaTeX's internal macro
% \!\@footnotetext! letting it be our own \!\pcol@fntext! for encapsulating
% a footnote in a \!\vbox! and for deferred \!\insert!ion with \Scfnote{}
% typesetting.
%
% \begin{macrocode}
\pcol@footnotebase\c@footnote \global\pcol@nfootnotes\z@
\let\footnote\pcol@footnote
\let\footnotemark\pcol@footnotemark
\let\footnotetext\pcol@footnotetext
\ifpcol@scfnote
\def\footnoterule{{\columnwidth\textwidth \pcol@footnoterule}}%
\fi
\let\@footnotetext\pcol@fntext
% \end{macrocode}
%
% Seventh, we let \!\marginpar!, \!\@mn@@marginnote! and \!\@xympar! be our
% own versions \!\pcol@marginpar!, \!\pcol@marginnote! and \!\pcol@xympar!
% respectively for the emulation of \!\marginnote!, saving the original
% version of the first and third into \!\pcol@@marginpar! and
% \!\pcol@@xympar!. Then we inactivate API macros \!\twosided! and
% \!\footnotelayout! together with their backward-compatible macros
% \!\swapcolumninevenpages!, \!\noswapcolumnineven~pages!,
% \!\multi~columnfootnotes!, \!\singlecolumnfootnotes! and
% \!\mergedfootnotes!, so that they commonly invoke \!\pcol@ignore! because
% their inherent operations turning corresponding switches are harmful in
% \env{paracol} environment. Note that the inactivation of \!\twosided! is
% done by redefinition of \!\pcol@twosided! because we need optional
% argument processing by \!\twosided! even when it is inactivated.
%
% \changes{v1.2-4}{2013/05/11}
% {Add nullificaion of \cs{[no]swapcolumninevenpages}.}
% \changes{v1.2-2}{2013/05/11}
% {Add nullificaton of API macros of footnote typesetting definition.}
% \changes{v1.3-3}{2013/09/17}
% {Add new API inactivation for \cs{pcol@twosided}.}
% \changes{v1.3-4}{2013/09/17}
% {Add new API inactivation for \cs{pcol@twosided}.}
% \changes{v1.3-5}{2013/09/17}
% {Add new API inactivation for \cs{footnotelayout}.}
% \changes{v1.35-3}{2018/12/31}
% {Add local modifications of \cs{marginpar}, \cs{@mn@@marginnote} and
% \cs{@xympar} for the emulation of \cs{marginnote}.}
%
% \begin{macrocode}
\let\pcol@@marginpar\marginpar \let\marginpar\pcol@marginpar
\let\@mn@@marginnote\pcol@marginnote
\let\pcol@@xympar\@xympar \let\@xympar\pcol@xympar
\def\pcol@twosided[#1]{\pcol@ignore\twosided}%
\def\swapcolumninevenpages{\pcol@ignore\swapcolumninevenpages}%
\def\noswapcolumninevenpages{\pcol@ignore\noswapcolumninevenpages}%
\def\footnotelayout#1{\pcol@ignore\footnotelayout}%
\def\multicolumnfootnotes{\pcol@ignore\multicolumnfootnotes}%
\def\singlecolumnfootnotes{\pcol@ignore\singlecolumnfootnotes}%
\def\mergedfootnotes{\pcol@ignore\mergedfootnotes}%
% \end{macrocode}
%
% Eigth, we scan the list \!\pcol@localcommands! of $\arg{com}$ being the
% name of commands, e.g., |switchcolumn|, available only in the environment
% or customized for the environment, applying \!\pcol@defcomelt! to each
% $\arg{com}$ to let $|\|\arg{com}=|\pcol@com@|{\cdot}\arg{com}$
%
% \SpecialArrayMainIndex{\<\string\mathit{com}\>}{\pcol@com@}
%
% the latter of which is the real implementation of the former. Note that
% the list does not have all \elocal{} API commands but we omit
% \!\column!(|*|) for \env{column}(|*|) environments because their
% implementations \!\pcol@com@column!(|*|) are modified after the first
% invocation. Therefore, we \!\def!ine \!\column!(|*|) to have
% \!\pcol@com@column!(|*|) in their bodies\footnote{
%
% We can do this for other commands instead of adhearing to \cs{let} to
% eliminate the execption, but the author loves to use \cs{let} as much as
% possible.}.
%
% We also give the first \!\def!initions of
% \!\pcol@com@column!(|*|) to let them do nothing but re\!\def!ine
% themselves by \!\pcol@defcolumn! unless
% \!\pcol@com@column*! is given an optional \mctext{} argument which is
% directly processed by \!\pcol@sptext!, if they appear as the first
% \cswitch{} command\slash environment after \beginparacol. Then we
% re\!\def!ine \!\paracol! itself so that it will complain of illegal
% nesting by \!\PackageError!.
%
% \begin{macrocode}
\let\@elt\pcol@defcomelt \pcol@localcommands
\def\column{\pcol@com@column}%
\@namedef{column*}{\@nameuse{pcol@com@column*}}%
\global\let\pcol@com@column\pcol@defcolumn
\global\@namedef{pcol@com@column*}{\pcol@defcolumn
\@ifnextchar[%]
\pcol@sptext\relax}%
\def\paracol##1{\PackageError{paracol}{%
Environment paracol cannot be nested.}\@eha}%
% \end{macrocode}
%
% Ninth, we let \!\output! have our output routine \!\pcol@output! as its sole
% token, and then make \!\output! request with
% $\!\penalty!=\!\pcol@op@start!$ by \!\pcol@invokeoutput! to invoke
% \!\pcol@output@start! for initialization, after letting
% $\!\@elt!=\!\relax!$ to make it sure that any lists can be manipulated
% without unexpected application of a macro to their elements.
%
% \begin{macrocode}
\output{\pcol@output}%
\let\@elt\relax
\pcol@invokeoutput\pcol@op@start
% \end{macrocode}
%
% Tenth and finally, we let $\!\pcol@nextcol!=0$ in case \beginparacol{} has
% the optional argument for \mctext{}, and invoke \!\pcol@sptext! if it has.
% Otherwise, we invoke $|\pcol@colpream|{\cdot}0$ being the \colpream{} of
% the first column 0, which will be invoked by \!\pcol@switchcol! if
% \mctext{} is given.
%
% \SpecialArrayIndex{c}{\pcol@colpream}
%
% \changes{v1.35-5}{2018/12/31}
% {Add the invocation of $\cs{pcol@colpream}{\cdot}0$.}
%
% \begin{macrocode}
\pcol@nextcol\z@
\@ifnextchar[%]
\pcol@sptext{\@nameuse{pcol@colpream0}}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@paracol}
% The macro \!\pcol@paracol! has the definition of \!\paracol!, which is
% redefined in the macro itself, so that the only referrer
% \!\pcol@icolumncolor! examines if it appears in \env{paracol}, i.e.,
% $\!\pcol@paracol!\neq\!\paracol!$.
%
% \begin{macrocode}
\let\pcol@paracol\paracol
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\thecolumn}
% \changes{v1.3-5}{2013/09/17}
% {Introduced to let users know which column they are working in.}
%
% The API macro \!\thecolumn! gives the value of \!\pcol@currcol! to users
% to let them know which column they are working in so that, for example,
% they do some column-dependent opreations.
%
% \begin{macrocode}
\def\thecolumn{\number\pcol@currcol}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@ignore}
% \changes{v1.2-4}{2013/05/11}
% {Introduced for nullificaion of \cs{[no]swapcolumninevenpages}.}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for nullificaton of API macros of footnote typesetting
% definition.}
%
% The macro \!\pcol@ignore!$\arg{macro}$ is to complain that the
% $\arg{macro}$ being one of the followings appears in \env{paracol}
% environment.
%
% \begin{itemize}\raggedright\item[]
% \!\twosided!,
% \!\swapcolumninevenpages!,
% \!\noswapcolumninevenpages!,
% \!\footnotelayout!,
% \!\multicolumnfootnotes!,
% \!\singlecolumnfootnotes!,
% \!\mergedfootnotes!
% \end{itemize}
%
% That is, these macros, except for \!\twosided!, are re\!\def!ined in
% \!\pcol@zparacol! to invoke this macro with the argument identifying
% themselves, which is shown in the warning message given by
% \!\PackageWarning!. As for \!\twosided!, the target of the
% re\!\def!inition is \!\pcol@twosided! so that its optional argument is
% captured before the complaint.
%
% \begin{macrocode}
\def\pcol@ignore#1{\PackageWarning{paracol}{The command \string#1 is not
effective in paracol environment and thus ignored}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@localcommands}
% \changes{v1.0}{2011/10/10}
% {Introduced to make API commands environment-local.}
% \changes{v1.3-5}{2013/09/17}
% {Add \cs{@elt}\string\texttt{\char`\{cleardoublepage\char`\}} for
% \cs{cleardoublepage}.}
%
% The macro \!\pcol@localcommands! is the list of the names of the following
% {\em\Uidx\elocal} API commands (or {\em\Uidx\lcommand{}s} in short) and is
% solely referred to by \!\pcol@zparacol!.
%
% \begin{center}\begin{tabular}{llll}
% \!\switchcolumn!&
% \!\endcolumn!(|*|)&
% \!\nthcolumn!(|*|)&\!\endnthcolumn!(|*|)\\
% \!\leftcolumn!(|*|)&\!\endleftcolumn!(|*|)&
% \!\rightcolumn!(|*|)&\!\endrightcolumn!(|*|)\\
% \!\flushpage!&
% \!\clearpage!&
% \!\cleardoublepage!\\
% \!\synccounter!&
% \!\syncallcounters!
% \end{tabular}\end{center}
%
% Note that we omit \!\column!(|*|) from the list as discussed in the
% description of \!\pcol@zparacol!.
%
% \begin{macrocode}
\def\pcol@localcommands{%
\@elt{switchcolumn}%
\@elt{endcolumn}\@elt{endcolumn*}%
\@elt{nthcolumn}\@elt{endnthcolumn}\@elt{nthcolumn*}\@elt{endnthcolumn*}%
\@elt{leftcolumn}\@elt{endleftcolumn}\@elt{leftcolumn*}\@elt{endleftcolumn*}%
\@elt{rightcolumn}\@elt{endrightcolumn}%
\@elt{rightcolumn*}\@elt{endrightcolumn*}%
\@elt{flushpage}\@elt{clearpage}\@elt{cleardoublepage}%
\@elt{synccounter}\@elt{syncallcounters}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@defcomelt}
% \changes{v1.0}{2011/10/10}
% {Introduced to make API commands environment-local.}
%
% The macro \!\pcol@defcomelt! is invoked solely from \!\pcol@zparacol! to be
% applied to each element $\arg{com}$ in \!\pcol@localcommands!. Two
% lengthy \!\let!s with \!\expandafter!s are for doing
% $\!\let!|\|\arg{com}|=\pcol@com@|{\cdot}\arg{com}$ to bind the \elocal{}
% API command $|\|\arg{com}$ and its implementation
% $|\pcol@com@|{\cdot}\arg{com}$.
%
% \SpecialArrayIndex{\<\string\mathit{com}\>}{\pcol@com@}
%
% \begin{macrocode}
\def\pcol@defcomelt#1{%
\expandafter\let\expandafter\reserved@a\csname pcol@com@#1\endcsname
\expandafter\let\csname #1\endcsname\reserved@a}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@dbldeferlist}
% \changes{v1.32-3}{2015/10/10}
% {Add top-level definition in case that future \LaTeX{} removes it at
% all.}
% \begin{macro}{\pcol@end@dblfloat}
% \changes{v1.32-3}{2015/10/10}
% {Added to go back to old mechanism.}
% As discussed in \secref{sec:imp-ovv-float}, 2015 version of \LaTeX{}
% no longer uses \!\@dbldeferlist! but the macro itself is still kept in
% \LaTeX{}. However it will be removed in future to make the first
% \!\@cons! with it resulting in an error. Therefore, here we have its top
% level definition with empty duplicatedly in case of its future
% elimination. The macro \!\end@dblfloat!, on the other hand, is replaced
% with a new definition in the new \LaTeX{} of course, and thus we define
% \!\pcol@end@dblfloat! here to keep its old definition and to replace the
% new one in \env{paracol} environment as discussed in
% item-(\ref{item:ovv-float-end@dblfloat}) of \secref{sec:imp-ovv-float}.
%
% \begin{macrocode}
\gdef\@dbldeferlist{}
\def\pcol@end@dblfloat{%
\if@twocolumn
\@endfloatbox
\ifnum\@floatpenalty <\z@
\@largefloatcheck
\@cons\@dbldeferlist\@currbox
\fi
\ifnum \@floatpenalty =-\@Mii \@Esphack\fi
\else
\end@float
\fi
}
% \end{macrocode}
% \end{macro}\end{macro}
%
%
%
% \KeepSpace{6}
% \section{Column Width Setting}
% \label{sec:imp-cwidth}
% \changes{v1.3-4}{2013/09/17}
% {Add the secion ``Column Width Setting'' mainly to discuss the new
% API \cs{setcolumnwidth}.}
%
% \begin{macro}{\columnratio}
% \changes{v1.1}{2012/05/11}
% {Introduced to specify column width fractions.}
% \changes{v1.3-2}{2013/09/17}
% {Add optional second argument for fractions in right
% parallel-pages.}
% \begin{macro}{\pcol@icolumnratio}
% \changes{v1.3-2}{2013/09/17}
% {Introduced to process the optional second argument of
% \cs{columnratio}.}
% \begin{macro}{\pcol@columnratioleft}
% \changes{v1.1}{2012/05/11}
% {Introduced to keep column width fractions.}
% \changes{v1.3-2}{2013/09/17}
% {Renamed from \cs{pcol@columnratio} to clarify it has fractions for
% left parallel-pages.}
% \begin{macro}{\pcol@columnratioright}
% \changes{v1.3-2}{2013/09/17}
% {Introduced to keep column width fractions for right
% parallel-pages.}
%
% The API macro $\!\columnratio!
% \Arg{r^l_0,r^l_1,\cdots,r^l_{k^l-1}}|[|r^r_0,r^r_1,\cdots,r^r_{k^r-1}|]|$
% defines the column width fraction $r^l_c$ for column $c$ in left
% \parapag{}es and optionally $r^r_c$ for those in right \parapag{}es. This
% macro and its callee \!\pcol@icolumnratio! just \!\global!y \!\def!ine
% macros \!\pcol@columnratioleft! and \!\pcol@columnratioright! whose
% bodies have the first and second arguments respectively, or commonly have
% the first if the second optional one is not given, so that they are given
% to \!\pcol@setcolwidth@r! as its third argument through
% \!\pcol@setcolumnwidth! invoked in \!\pcol@zparacol!. Both of
% \!\pcol@columnratioleft! and \!\pcol@columnratioright! are initialized to
% be empty so that all columns have same width and are separated by
% \!\columnsep! as default. Note that \!\pcol@columnratioleft! can be made
% \!\let!-equial to \!\relax! by the related API macro \!\setcolumnwidth! so
% that \!\pcol@setcolumnwidth! knows which of specifications given by two
% API macros is effective and chooses \!\pcol@setcolwidth@r! or
% \!\pcol@setcolwidth@s!.
%
% \begin{macrocode}
%% Column Width Setting
\def\columnratio#1{\global\let\pcol@colwidthspecleft\relax
\gdef\pcol@columnratioleft{#1}%
\@ifnextchar[%]
\pcol@icolumnratio{\gdef\pcol@columnratioright{#1}}}
\def\pcol@icolumnratio[#1]{\gdef\pcol@columnratioright{#1}}
\columnratio{}\relax
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \KeepSpace{2}
% \begin{macro}{\setcolumnwidth}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to specify column widths and column-separating gaps more
% detailedly.}
% \begin{macro}{\pcol@isetcolumnwidth}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to process the optional second argument of
% \cs{setcolumnwidth}.}
% \begin{macro}{\pcol@colwidthspecleft}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to keep column width specifications for left
% parallel-pages.}
% \begin{macro}{\pcol@colwidthspecright}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to keep column width specifications for right
% parallel-pages.}
%
% The API macro $\!\setcolumnwidth!
% \Arg{s^l_0,s^l_1,\cdots,s^l_{k^l-1}}|[|s^r_0,s^r_1,\cdots,s^r_{k^r-1}|]|$
% defines the column width specification $s^l_c$ for column $c$ in left
% \parapag{}es and optionally $s^r_c$ for those in right \parapag{}es, where
% each specification $s^x_c$ has the form of $|[|w_c|][/[|g_c|]]|$ for width
% and gap specifier $\w_c$ and $\gap_c$. After \!\let!ting
% $\!\pcol@columnratioleft!=\!\relax!$ to disable the setting by
% \!\columnratio! and to enable that done by this macro, the macro and its
% callee \!\pcol@isetcolumnwidth! just \!\global!y \!\def!ine macros
% \!\pcol@colwidthspecleft! and \!\pcol@colwidthspecright! whose bodies have
% the first and second arguments respectively, or commonly have the first if
% the second optional one is not given, so that they are given to
% \!\pcol@setcolwidth@s! as its fourth argument through
% \!\pcol@setcolumnwidth! invoked in \!\pcol@zparacol!. Both of
% \!\pcol@colwidthspecleft! and \!\pcol@colwidthspecright! are initially
% undefined because the default specification is given by
% \!\columnratio!|{}|.
%
% \begin{macrocode}
\def\setcolumnwidth#1{\global\let\pcol@columnratioleft\relax
\gdef\pcol@colwidthspecleft{#1}%
\@ifnextchar[%]
\pcol@isetcolumnwidth{\gdef\pcol@colwidthspecright{#1}}}
\def\pcol@isetcolumnwidth[#1]{\gdef\pcol@colwidthspecright{#1}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@setcolumnwidth}
% \changes{v1.3-4}{2013/09/17}
% {Move original functions to \cs{pcol@setcolumnwidth@r} and redefine
% this macro to switch \cs{pcol@setcolumnwidth@r} and
% \cs{pcol@setcolumnwidth@s}.}
%
% \begin{Sloppy}{1500}
% The macro $\!\pcol@setcolumnwidth!\<\Cfrom\>\<\Cto\>\arg{ratio}\arg{spec}$
% is invoked solely from \!\pcol@zparacol! but can be twice, with;
% $$
% (\Cfrom,\Cto,\arg{ratio},\arg{spec})=
% (0,\CL,\!\pcol@columnratioleft!,\!\pcol@colwidthspecleft!)
% $$
% always and with;
% $$
% (\Cfrom,\Cto,\arg{ratio},\arg{spec})=
% (\CL,\C,\!\pcol@columnratioright!,\!\pcol@colwidthspecright!)
% $$
% if $\CL<\C$ for \parapag{}ing. The macro simply invokes
% \!\pcol@setcolwidth@s! if $\!\pcol@columnratioleft!=\!\relax!$ because
% \!\setcolumnwidth! did so, or \!\pcol@setcolwidth@r! otherwise, with all
% arguments given by \!\pcol@zparacol!.
% \end{Sloppy}
%
% \begin{macrocode}
\def\pcol@setcolumnwidth{%
\ifx\pcol@columnratioleft\relax \let\reserved@a\pcol@setcolwidth@s
\else \let\reserved@a\pcol@setcolwidth@r
\fi
\reserved@a}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@setcolwidth@r}
% \changes{v1.1}{2012/05/11}
% {Introduced to calculate $w_c$.}
% \changes{v1.3-4}{2013/09/17}
% {Renamed from \cs{pcol@setcolumnwidth} to make it clear what the
% marco works for.}
% \changes{v1.3-2}{2013/09/17}
% {Add arguments $C^0$, $C^1$, $\langle\string\mathit{ratio}\rangle$
% and $\langle\string\mathit{spec}\rangle$ for columns in right
% parallel-pages.}
% \changes{v1.3-3}{2013/09/17}
% {Add setting of $g_c\EQ\cs{pcol@columnsep}{\cdot}c=\cs{columnsep}.}
%
% \begin{Hfuzz}{0.3pt}%
% The macro $\!\pcol@setcolwidth@r!\<\Cfrom\>\<\Cto\>\arg{ratio}\arg{spec}$
% is invoked solely from \!\pcol@zparacol! through \!\pcol@setcolumnwidth!
% once or twice with the arguments described in the explanation of the
% latter macro. The macro calculates $\w_c=|\pcol@columnwidth|{\cdot}c$
%
% \SpecialArrayIndex{c}{\pcol@columnwidth}
%
% for all $c\In\Cfrom\Cto$, from the fractions $r_0$, $r_1$, \ldots,
% $r_{k-1}$ given through the third argument $\arg{ratio}$, which was given
% to \!\columnratio! and then kept in \!\pcol@columnratioleft! or
% \!\pcol@columnratioright!. The macro also lets
% $\gap_c=|\pcol@columnsep|{\cdot}c=\!\columnsep!$
%
% \SpecialArrayIndex{c}{\pcol@columnsep}
%
% for all $c\In\Cfrom\Cto$.
% \end{Hfuzz}
%
% First, we calculate $W=\!\textwidth!-(\Cto-\Cfrom-1)\times\!\columnsep!$
% being the sum of $\w_c$ for all $c\In\Cfrom\Cto$. Then we let
% $\w_c=r_d{}W$ and $\gap_c=\!\columnsep!$ for all $c\In\Cfrom{k'}$ where
% $k'=\min(k,\Cto-1)$, in the \!\@for! loop scanning $r_d$ for all
% $d=c-\Cfrom\In0k$. Finally, we let
% $\w_c=(W-\sum_{d=\Cfrom}^{k'-1}w_d)/(\Cto-\Cfrom-k')$ and
% $\gap_c=\!\columnsep!$ for all $c\In{k'}\Cto$. Note that
% $|\pcol@columnwidth|{\cdot}c$ and $|\pcol@columnsep|{\cdot}c$ are macros
% having the integer representations of $\w_c$ and $\gap_c$ with the unit
% |sp|.
%
% \begin{macrocode}
\def\pcol@setcolwidth@r#1#2#3#4{%
\@tempcntb#2\advance\@tempcntb-#1\advance\@tempcntb\m@ne
\@tempdima-\columnsep \multiply\@tempdima\@tempcntb
\advance\@tempdima\textwidth \@tempdimb\@tempdima
\@tempcnta#1\relax\@tempcntb#2\advance\@tempcntb\m@ne
\@for\reserved@a:=#3\do{%
\ifnum\@tempcnta<\@tempcntb
\@tempdimc\reserved@a\@tempdima
\expandafter\xdef\csname pcol@columnwidth\number\@tempcnta\endcsname{%
\number\@tempdimc sp}%
\global\@namedef{pcol@columnsep\number\@tempcnta}{\columnsep}%
\advance\@tempdimb-\@tempdimc
\advance\@tempcnta\@ne
\fi}%
\@tempcntb#2\advance\@tempcntb-\@tempcnta
\divide\@tempdimb\@tempcntb
\@whilenum\@tempcnta<#2\do{%
\expandafter\xdef\csname pcol@columnwidth\number\@tempcnta\endcsname{%
\number\@tempdimb sp}%
\global\@namedef{pcol@columnsep\number\@tempcnta}{\columnsep}%
\advance\@tempcnta\@ne}%
}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{3}
% \begin{macro}{\pcol@setcolwidth@s}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to calculate $w_c$ and $g_c$.}
% \begin{macro}{\pcol@setcw@c}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to process column width components in the argument
% $\langle\string\mathit{spec}\rangle$ of \cs{pcol@setcolwidth@s}.}
% \begin{macro}{\pcol@setcw@s}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to process column-separating gap components in the
% argument $\langle\string\mathit{spec}\rangle$ of
% \cs{pcol@setcolwidth@s}.}
% \begin{macro}{\pcol@setcw@filunit}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to define the unit of infinite stretch factors in the
% argument $\langle\string\mathit{spec}\rangle$ of
% \cs{pcol@setcolwidth@s}.}
%
% \begin{Hfuzz}{0.3pt}%
% The macro $\!\pcol@setcolwidth@s!\<\Cfrom\>\<\Cto\>\arg{ratio}\arg{spec}$
% is invoked solely from \!\pcol@zparacol! through \!\pcol@setcolumnwidth!
% once or twice with the arguments described in the explanation of the
% latter macro. The macro calculates $\w_c=|\pcol@columnwidth|{\cdot}c$
%
% \SpecialArrayIndex{c}{\pcol@columnwidth}
%
% for all $c\In\Cfrom\Cto$ and $\gap_c=|\pcol@columnsep|{\cdot}c$
%
% \SpecialArrayIndex{c}{\pcol@columnsep}
%
% for all $c\In\Cfrom{\Cto{-}1}$, from the column\slash gap specifications
% $s_0$, $s_1$, \ldots, $s_{k-1}$ given through the fourth argument
% $\arg{spec}$, which was given to \!\setcolumnwidth! and then kept in
% \!\pcol@colwidthspecleft! or \!\pcol@colwidthspecright!.
% \end{Hfuzz}
%
% Each specification $s_d$ for $\w_c$ and $\gap_c$ where $c=\Cfrom+d$ has
% the form $|[|w'_d|][/[|g'_d|]]|$ to specify the natural width $w^n_d$ and
% $g^n_d$ and inifite stretch factor $w^f_d$ and $g^f_d$ of column\slash gap
% sepcfication as follows;
%
% \begin{eqnarray*}
% w^n_d&=&\cases{0&$w'_d=\emptyset$\cr
% 0&$w'_d=f\!\fill!$\cr
% \mathit{natural}(w'_d)&otherwise}\qquad
% w^f_d = \cases{1&$w'_d=\emptyset$\cr
% f&$w'_d=f\!\fill!$\cr
% \mathit{stretch}(w'_d)&otherwise}\\[1ex]
% g^n_d&=&\cases{\!\columnsep!&$g'_d=\emptyset$\cr
% 0&$g'_d=f\!\fill!$\cr
% \mathit{natural}(g'_d)&otherwise}\qquad
% g^f_d = \cases{0&$g'_d=\emptyset$\cr
% f&$g'_d=f\!\fill!$\cr
% \mathit{stretch}(g'_d)&otherwise}
% \end{eqnarray*}
%
% where $\mathit{natural}(x)$ is the natural width of the skip $x$ and
% $\mathit{stretch}(x)$ is the infinite stretch factor of $x$. Note that
% any finite stretch factors or any shirnk factors do not affect them, and
% infinite strech units |fil|, |fill| and |filll| are not distinguished.
% From factors above, we determine $w_c$ and $\gap_c$ as follows;
%
% \begin{eqnarray*}
% W&=&\sum_{d=0}^{m-2}(w^n_d+g^n_d)+w^n_{m-1}\\
% F&=&\sum_{d=0}^{m-2}(w^f_d+g^f_d)+w^f_{m-1}\\
% x_c&=&\cases{(\WT/W)x^n_{c-\Cfrom}&$W\geq\WT\;\lor\;F\leq0$\cr
% x^n_{c-\Cfrom}+(x^f_{c-\Cfrom}/F)(\WT-W)&$W<\WT\;\land\;F>0$}
% \qquad(x\in{\w,\gap})
% \end{eqnarray*}
% where $\WT=\!\textwidth!$ and $m=\Cto-\Cfrom$.
%
% To perform the assignments above, the macro at first invoke
% $\!\pcol@setcw@scan!\<\Cfrom\>\<\Cto\>\~\ARg{spec}$ letting
% $\!\pcol@setcw@c!=\!\pcol@setcw@s!=\!\pcol@setcw@accumwd!$ and
% \!\pcol@setcw@filunit!${}=1$\,pt to scan $s_d$ for all $d\In0{m}$ and to
% accumulate $W+g^n_{m-1}$ and $F+g^f_{m-1}$ in \!\dimen@! and \!\dimen@ii!
% and then subtract $g^n_{m-1}$ and $g^f_{m-1}$ from them to have $W$ and
% $F$. Note that $F$ is represented by a dimension with the unit of pt by
% the definition of \!\pcol@setcw@filunit!. Then we invoke
% \!\pcol@setcw@calcfactors! to calculate $(\WT/W)=\!\pcol@setcw@scale!$ and
% $(\WT-W)/F=\!\@tempdimb!$. Finally we scan $s_d$ again but in this case
% we let $\!\pcol@setcw@c!=\!\pcol@setcw@set!|{width}|$,
% $\!\pcol@setcw@s!=\!\pcol@setcw@set!|{sep}|$ and
% $\!\pcol@setcw@filunit!=\!\@tempdimb!=(\WT-W)/F$ to let $w_c$ and $\gap_c$
% have the values shown above.
%
% \begin{macrocode}
\def\pcol@setcolwidth@s#1#2#3#4{\begingroup
\dimen@\z@ \dimen@ii\z@ \def\pcol@setcw@filunit{\@ne\p@}%
\let\pcol@setcw@c\pcol@setcw@accumwd \let\pcol@setcw@s\pcol@setcw@accumwd
\pcol@setcw@scan#1#2{#4}%
\advance\dimen@-\@tempdima \advance\dimen@ii-\@tempdimb
\pcol@setcw@calcfactors
\def\pcol@setcw@c{\pcol@setcw@set{width}}%
\def\pcol@setcw@s{\pcol@setcw@set{sep}}%
\let\pcol@setcw@filunit\dimen@ii
\pcol@setcw@scan#1#2{#4}%
\endgroup}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@setcw@scan}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to scan the argument
% $\langle\string\mathit{spec}\rangle$ of \cs{pcol@setcolwidth@s}.}
%
% The macro $\!\pcol@setcw@scan!\<\Cfrom\>\<\Cto\>\~\ARg{spec}$ is to scan
% first $m=\Cto-\Cfrom$ elements in $\arg{spec}=s_0,s_1,\ldots$ being the
% column\slash gap specifications given to \!\setcolumnwidth!. At first we
% add `,' as many as $m$ to the tail of $\arg{spec}$ to make it sure the
% resulting $\arg{spec}$ has $m$ or more elements. Then we scan all
% elements in the extended $\arg{spec}$ by a \!\@for! loop having many
% \!\expandafter! but equivalent to;
%
% \begin{quote}
% |\@for\reserved@a:=|$s_0,s_1,\ldots$|\do{|\textit{body}|}|
% \end{quote}
%
% In the \textit{body} above, we invoke
% $\!\pcol@setcw@getspec!\;s_i|//|\!\@nil!$ to parse $s_i$ to have $w^n_i$,
% $w^f_i$ to be processed by \!\pcol@setcw@c! and $g^n_i$ and $g^f_i$ by
% \!\pcol@setcw@s!, for all $i\In0m$.
%
% \begin{macrocode}
\def\pcol@setcw@scan#1#2#3{\def\reserved@a{#3}%
\@tempcnta#1\relax \@whilenum\@tempcnta<#2\do{
\edef\reserved@a{\reserved@a,}\advance\@tempcnta\@ne}%
\@tempcnta#1\relax
\expandafter\@for\expandafter\reserved@a\expandafter:\expandafter=\reserved@a
\do{%
\ifnum\@tempcnta<#2\relax
\expandafter\pcol@setcw@getspec\reserved@a//\@nil
\fi
\advance\@tempcnta\@ne}}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{1}
% \begin{macro}{\pcol@setcw@getspec}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to parse an element in the argument
% $\langle\string\mathit{spec}\rangle$ of \cs{pcol@setcolwidth@s}.}
% \begin{macro}{\pcol@setcw@getspec@i}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to parse an element in the argument
% $\langle\string\mathit{spec}\rangle$ of \cs{pcol@setcolwidth@s}.}
% \begin{macro}{\pcol@setcw@fill}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to extract \cs{fill} factor from an element in the
% argument $\langle\string\mathit{spec}\rangle$ of
% \cs{pcol@setcolwidth@s}.}
%
% The macro
% $\!\pcol@setcw@getspec!\<w'_d\>|/|\<g'_d\>|/|\arg{garbage}\!\@nil!$ is
% used solely in \!\pcol@setcw@scan! to parse a column\slash gap
% specification $s_d=|[|w'_d|][/[|g'_d|]]|$, to extract factors $w_d^n$,
% $w_d^f$, $g_d^n$ and $g_d^f$, and to process width factors by
% \!\pcol@setcw@c! and gap factors by \!\pcol@setcw@s!. Since the macro is
% invoked with arguments in the form of $s_d|//|\!\@nil!$, if $s_d$ has
% `|/|' in it $w'_d$ and $g'_d$ should have everything preceeding and
% following the `|/|' respectively while $\arg{garbage}$ should have the
% redundant `|/|'. Otherwise, i.e., if $s_d$ does not have `|/|',
% $w'_d=s_d$ and $g'_d=\emptyset$ while $\arg{garbage}=\emptyset$\footnote{
%
% If $s_d$ have two or more `|/|', everything following the second one is
% thrown away into $\arg{garbage}$ together with `|//|'. Therefore we could
% check if $s_d$ has at most one `|/|' by examining $\arg{garbage}$ but we
% abandon it simply ingoring $\arg{garbage}$.}.
%
% Therefore, we invoke $\!\pcol@setcw@getspec@i!\arg{default}\Arg{x'_d}$ twice
% with $(\arg{default},x'_d)=(\!\fill!,w'_d)$ for a column and
% $(\arg{default},x'_d)=(\!\columnsep!,g'_d)$ for a gap, and \!\pcol@setcw@c!
% and \!\pcol@setcw@s! after each invocation respectively.
%
% In this macro, at first we scan all tokens in $x'_d$ by \!\@tfor! to
% remove all space tokens in it\footnote{
%
% A proper skip specification and ``$f\!\fill!$'' is always proper without
% space tokens in them.}.
%
% Then if $x'_d$ after the space removal has nothing, we let
% $x'_d=\arg{default}$. Next we examine if $x'_d=f\!\fill!$ in a trickey
% way by temporarily \!\let!ting $\!\@gtempa!=\!\relax!$, defining \!\fill!
% as ``|1pt|\!\gdef!\!\@gtempa!|{}|'' and making an assignment
% ``\!\@tempskipa! $x'_d$''. That is, if $x'_d=f\!\fill!$, \!\@tempskipa!
% will have $f{\cdot}|1pt|$ being a proper dimension and \!\@gtempa! is made
% empty. Otherwise, \!\@tempskipa! should have $x'_d$ which must be a
% proper skip and \!\@gtempa! remains unchanged from \!\relax!. Therefore,
% if $\!\@gtempa!=\!\relax!$ we let $\!\@tempskipa!=x'_d$ again\footnote{
%
% Because the first assignment is done in a group.}.
%
% Otherwise, we invoke $\!\pcol@setcw@fill!\;x'_d$ to let
% \!\@tempskipa! have $0\,|pt|\ |plus|\ f\,|fil|$ where $f$ is replaced by 1
% if $f=\emptyset$.
%
% Now \!\@tempskipa! has $x_d^n$ as its natural component and may have some
% infinite strectch component $x_d^f$ specified explicitly or with \!\fill!.
% Therefore, we assign \!\@tempskipa! to \!\@tempdima! so that it has
% $x_d^n$, and then, after adding 0\,|pt| |plus| 1000\,|pt| |minus|
% 1000\,|pt| to \!\@tempskipa! to make it sure it has both strech and shrink
% components\footnote{
%
% Almost sure becaues they could be $-1000$\,pt, but we ignore the
% possibility.}
%
% keeping infinite stretch factor if any, invoke \!\pcol@extract@fil! giving
% it \!\the!-expansion of \!\@tempskipa! as the argument to let
% $\!\@tempdimb!=x_d^f\times\!\pcol@setcw@filunit!$.
%
% \begin{macrocode}
\def\pcol@setcw@getspec#1/#2/#3\@nil{%
\pcol@setcw@getspec@i\fill{#1}\pcol@setcw@c
\pcol@setcw@getspec@i\columnsep{#2}\pcol@setcw@s}
\def\pcol@setcw@getspec@i#1#2{%
\def\reserved@a{}%
\@tfor\reserved@b:=#2\do{\edef\reserved@a{\reserved@a\reserved@b}}
\ifx\reserved@a\@empty \let\reserved@a#1\fi
\let\@gtempa\relax
{\def\fill{1\p@\gdef\@gtempa{}}\@tempskipa\reserved@a}%
\ifx\@gtempa\relax \@tempskipa\reserved@a\relax
\else \expandafter\pcol@setcw@fill\reserved@a
\fi
\@tempdima\@tempskipa
\advance\@tempskipa0\p@\@plus\@m\p@\@minus\@m\p@\relax
\expandafter\pcol@extract@fil\the\@tempskipa\@nil}
\def\pcol@setcw@fill#1\fill{\def\reserved@b{#1}%
\ifx\reserved@b\@empty \let\reserved@b\@ne \fi
\@tempskipa0\p@\@plus\reserved@b fil\relax}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@setcw@accumwd}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to accumulate natural and fill factors of the element in
% the argument $\langle\string\mathit{spec}\rangle$ of
% \cs{pcol@setcolwidth@s}.}
%
% The macro \!\pcol@setcw@accumwd! is made \!\let!-equal to \!\pcol@setcw@c!
% and \!\pcol@setcw@s! commonly and thus invoked from \!\pcol@setcw@getspec!
% with setting $\!\@tempdima!=x_d^n$ and $\!\@tempdimb!=x_d^f\times1\,|pt|$,
% where $x\in\{w,g\}$. The macro simply add them to \!\dimen@! and
% \!\dimen@ii! repsectively to accumurate $x_d^n$ and $x_d^f$ in them.
%
% \begin{macrocode}
\def\pcol@setcw@accumwd{\advance\dimen@\@tempdima \advance\dimen@ii\@tempdimb}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@setcw@set}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to define $w_c$ and $g_c$ according to the element in
% the argument $\langle\string\mathit{spec}\rangle$ of
% \cs{pcol@setcolwidth@s}.}
%
% The macro $\!\pcol@setcw@set!\ARg{wors}$ is made the body of
% \!\pcol@setcw@c! with $\arg{wors}=|width|$ and of
% \!\pcol@setcw@s! with $\arg{wors}=|sep|$ and thus invoked from
% \!\pcol@setcw@getspec! with setting $\!\@tempdima!=x_d^n$ and
% $$
% (\!\pcol@setcw@scale!,\!\@tempdimb!)
% \in\{(\emptyset,\,(x_d^f/F)(\WT-W)),\;(\WT/W,\,0)\}
% $$
% Therefore, we calculate
% $x_c=\!\pcol@setcw@scale!\times\!\@tempdima!+\!\@tempdimb!$ and
% \!\xdef!ine $|\pcol@column|{\cdot}\<wors\>{\cdot}c$ to let it have the
% integer representation of $x_c$ with the unit |sp|.
%
% \SpecialArrayIndex{c}{\pcol@columnwidth}
% \SpecialArrayIndex{c}{\pcol@columnsep}
%
% \begin{macrocode}
\def\pcol@setcw@set#1{%
\@tempdima\pcol@setcw@scale\@tempdima \advance\@tempdima\@tempdimb
\expandafter\xdef\csname pcol@column#1\number\@tempcnta\endcsname{%
\number\@tempdima sp}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@setcw@calcfactors}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to caclulate scaling and stretch factors from
% the argument $\langle\string\mathit{spec}\rangle$ of
% \cs{pcol@setcolwidth@s}.}
% \begin{macro}{\pcol@setcw@calcf}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to caclulate scaling or stretch factor from
% the argument $\langle\string\mathit{spec}\rangle$ of
% \cs{pcol@setcolwidth@s}.}
% \changes{v1.31}{2013/10/10}
% {Capitalize the first word of the error message for consistency.}
% \begin{macro}{\pcol@setcw@scale}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to have the scaling factor of $w_c$ and $g_c$.}
%
% The macro \!\pcol@setcw@calcfactors! is used solely in
% \!\pcol@setcolwidth@s! to calculate $\phi_s=\!\pcol@setcw@scale!$ and
% $\phi_f=\!\dimen@ii!$ as follows
% $$
% (\phi_s,\phi_f)=\cases{(\WT/\W,\;0)& $W\geq\WT\;\lor\;F\leq0$\cr
% (1,\;(\WT-W)/F)&$W<\WT\;\land\;F>0$}
% $$
% where $W=\!\dimen@!$, $F\times1\,|pt|=\!\dimen@ii!$ and $\WT=\!\textwidth!$,
% and $\phi_s=1$ is represented by empty body of \!\pcol@setcw@scale!.
% First we deal with the special and trivial case of $W=\WT$ to let
% $\phi_s=1$ and $\phi_f=0$ so as to avoid arithmetic error in the
% calculation of $\WT/W$. If $W\neq\WT$ on the other hand, we calculate
% $\WT/W$ by $\!\pcol@setcw@calcf!\<\WT\>\<W\>\<\phi_s\>$ to have a
% provisional result. Then if $W<\WT$ and $F>0$, we let $\phi_s=1$ and
% invoke \!\pcol@setcw@calcf! again giving it $(\WT-W)$ and $F\times1\,|pt|$
% but throw away the result $(\WT-W)/(F\times1\,|pt|)$ because \!\@tempdimb!
% should have $(\WT-W)/F$ which is then set into $\phi_f=\!\dimen@ii!$.
% Otherwise, we keep the provisional result of $\phi_s$ as the final one and
% let $\phi_f=\!\dimen@ii!=0$.
%
% The macro $\!\pcol@setcw@calcf!\<x\>\<y\>\<z\>$ caclulates $z\approx x/y$
% and let $\!\@tempdimb!=Z=z\times1\,|pt|$ as follows. First we find the
% following three parameters.
%
% \begin{eqnarray*}
% k_1&=&\min\Set{k}{k\geq0,\;x\cdot2^k\geq2^{13}\,|pt|}\\
% k_2&=&\max\Set{k}{y\bmod2^k=0}\\
% k_3&=&\min\Set{k}{k\geq0,\;\lceil y/2^{k_2+k}\rceil\leq2^{15}}
% \end{eqnarray*}
%
% With these parameters, we calculate $z'=\lfloor(x\cdot2^{k_1})/\lceil
% y/2^{k_2+k_3}\rceil\rfloor$ to have a good approximation of
% $(x/y)\cdot2^{k}$ where $k=k_1+k_2+k_3$ without arithmetic overflow. Then
% if $z'/2^k\geq2^{14}$ or in other words $Z$ is larger than \!\maxdimen!,
% we complain that by \!\PackageError! and, in case a user dare to
% continue the typesetting process, we let $Z=10000\,|pt|$. Otherwise, we
% calculate $Z=(z'/2^k)\cdot2^{16}=z'\cdot2^{16-k}$ to have it in
% \!\@tempdimb! by $Z=z'\times2^{16-k}$ if $k<16$, or by $Z=z'/2^{k-16}$
% otherwise. Finally we invoke \!\pcol@extract@pt! giving it
% \!\the!-representaion of $Z$ to have $z$.
%
% Note that it is assured $z\leq x/y$ regardless of successfulness of the
% calculation and thus the scaling $\phi_s x_d^n$ and strething
% $x_d^n+\phi_f x_d^f$ cannot exceed their exact value to make it also sure
% that $\sum_{c=\Cfrom}^{\Cto-2}(\w_c+\gap_c)+\w_{\Cto-1}\leq\WT$ and thus
% the series of columns and \csepgap{}s should not cause overfull when a
% page is shipped out with \!\hfil! added to each \csepgap{} for underfull
% avoidance.
%
% \begin{macrocode}
\def\pcol@setcw@calcfactors{%
\ifdim\dimen@=\textwidth \def\pcol@setcw@scale{}\dimen@ii\z@
\else
\pcol@setcw@calcf\textwidth\dimen@\pcol@setcw@scale
\ifdim\dimen@<\textwidth \ifdim\dimen@ii>\z@
\def\pcol@setcw@scale{}%
\@tempdimc\textwidth \advance\@tempdimc-\dimen@
\pcol@setcw@calcf\@tempdimc\dimen@ii\reserved@a \dimen@ii\@tempdimb
\else \dimen@ii\z@ \fi
\else \dimen@ii\z@ \fi
\fi}
\def\pcol@setcw@calcf#1#2#3{%
\@tempdimb#1\@tempdima#2\@tempcnta\z@
\ifdim\@tempdima=\z@ \@tempdima1sp\relax\fi
\@whiledim\@tempdimb<8192\p@\do{%
\multiply\@tempdimb\tw@ \advance\@tempcnta\@ne}%
\@tempdimc\@tempdima
\@whiledim\@tempdima=\@tempdimc\do{%
\divide\@tempdimc\tw@ \multiply\@tempdimc\tw@
\ifdim\@tempdima=\@tempdimc
\divide\@tempdima\tw@ \divide\@tempdimc\tw@ \advance\@tempcnta\@ne
\fi}
\advance\@tempdima-1sp\relax
\@whilenum\@tempdima>32768\do{\divide\@tempdima\tw@ \advance\@tempcnta\@ne}%
\advance\@tempdima1sp\relax
\divide\@tempdimb\@tempdima \@tempdimc\@tempdimb \@tempcntb\@tempcnta
\@whilenum\@tempcntb>\z@\do{\divide\@tempdimc\tw@ \advance\@tempcntb\m@ne}
\ifnum\@tempdimc>16383\relax
\PackageError{%
Scaling/filling factor for column/gap width is too large.}\@eha
\@tempdimb\@M\p@
\else
\@tempcntb\sixt@@n \advance\@tempcntb-\@tempcnta
\ifnum\@tempcntb<\z@
\@whilenum\@tempcntb<\z@\do{\divide\@tempdimb\tw@ \advance\@tempcntb\@ne}%
\else
\@whilenum\@tempcntb>\z@\do{%
\multiply\@tempdimb\tw@ \advance\@tempcntb\m@ne}%
\fi
\fi
\expandafter\pcol@extract@pt\the\@tempdimb#3}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \KeepSpace{3}
% \begin{macro}{\pcol@defkw}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to define $\cs{pcol@kw@}{\cdot}k$ where
% $k\in\{\string\texttt{pt},\string\texttt{plus},\string\texttt{minus},
% \string\texttt{fil}\}$.}
% \begin{macro}{\pcol@kw@pt}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to have the keyword \string\texttt{pt}.}
% \begin{macro}{\pcol@kw@plus}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to have the keyword \string\texttt{plus}.}
% \begin{macro}{\pcol@kw@minus}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to have the keyword \string\texttt{minus}.}
% \begin{macro}{\pcol@kw@fil}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to have the keyword \string\texttt{fil}.}
%
% The macro
% $\!\pcol@defkw!|1.0|\arg{pt}\verb*| |\arg{plus}\verb*| 1.0|\arg{fil}
% \verb*| |\arg{minus}\verb*| 1.0|\arg{garbage}\!\@nil!$ is used just once at
% the top level to \!\def!ine \!\pcol@kw@pt!, \!\pcol@kw@plus!,
% \!\pcol@kw@minus! and \!\pcol@kw@fil! letting them have $\arg{pt}=|pt|$,
% $\arg{plus}=|plus|$, $\arg{minus}=|minus|$ and $\arg{fil}=|fil|$ in their
% body respectively but with $\!\catcode!=12$ (other) which is used in
% \!\the!-representation of glues. For the definition, we invoke
% \!\pcol@defkw! giving it \!\the!-representation of \!\@tempskipa! letting
% it have $1\,|pt|\ |plus|\ 1\,|fil|\ |minus|\ 1\,|fil|$ having all keywards
% we need to have\footnote{
%
% We can do what \!\pcol@defkw! does by temporarily giving $\!\catcode!=12$
% to the characters for the keywords of course, but this method is much
% easier.}.
%
% The macro \!\pcol@kw@pt! is used in
% $\!\pcol@extract@fil@ii!\arg{unit}\!\@nil!$ to examine if
% $\arg{unit}=|pt|$, and in \!\pcol@def@extract@pt! to \!\def!ine
% \!\pcol@extract@pt! having |pt| in its argument specification. The macros
% \!\pcol@kw@plus! and \!\pcol@kw@minus! are used only in
% \!\pcol@def@extract@fil!, and
% \!\pcol@kw@fil! only in \!\pcol@def@extract@fil@iii!, to \!\def!ine
% \!\pcol@extract@fil! having |plus| and |minus|, and
% \!\pcol@extract@fil@iii! having |fil|, in their argument specifications
% respectively.
%
% \begin{macrocode}
\@tempskipa 1\p@\@plus1fil\@minus1fil\relax
\def\pcol@defkw1.0#1 #2 1.0#3 #4 1.0#5\@nil{%
\def\pcol@kw@pt{#1}\def\pcol@kw@plus{#2}\def\pcol@kw@fil{#3}%
\def\pcol@kw@minus{#4}}
\expandafter\pcol@defkw\the\@tempskipa\@nil
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \KeepSpace{4}
% \begin{macro}{\pcol@def@extract@fil}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to define \cs{pcol@extract@fil}.}
% \begin{macro}{\pcol@extract@fil}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to extract infinite stretch factor from a skip if any.}
% \begin{macro}{\pcol@extract@fil@i}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to extract the factor of \string\texttt{fil} from the
% stretch factor in a skip if any.}
% \begin{macro}{\pcol@extract@fil@ii}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to extract the factor of \string\texttt{fil} from the
% stretch factor in a skip if any.}
% \begin{macro}{\pcol@def@extract@fil@iii}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to define \cs{pcol@extract@fil@iii}.}
% \begin{macro}{\pcol@extract@fil@iii}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to extract the factor of \string\texttt{fil} from the
% stretch factor in a skip.}
%
% The macro
% $\!\pcol@extract@fil!\<\mathit{garbge}_1\>\verb*| plus |\<s\>\verb*| minus|
% \<\mathit{garbage}_2\>\!\@nil!$ is used solely in \!\pcol@setcw@getspec@i!
% to extract the infinite stretch factor $f$ in the stretch component $s$ of
% a column\slash gap specification $x'_d$ and to let
% $\!\@tempdimb!=f\cdot{}u$ where
% $u=\!\pcol@setcw@filunit!\in\{1\,|pt|,\;\phi_f=\!\dimen@ii!\}$ if $f$
% exist or $\!\@tempdimb!=0$ otherwise. First of all, since the macro has
% keywords |plus| and |minus| in $\!\catcode!=12$ in its argument
% specification, we \!\def!ine it using \!\pcol@def@extract@fil!, whose body
% is equivalent to
%
% \begin{itemize}\item[]
% \let\@sverb\latex@sverb
% \verb*|\def\pcol@extract@fil#1 plus #2 minus#3\@nil|
% |{\pcol@extract@fil@i#2\@nil}|
% \end{itemize}
%
% just once at the top level. Then since $s$ should have the form
% $\<n\>|.|\<m\>\arg{unit}$ where $n$ and $m$ are decimal digit sequences and
% $\arg{unit}\in\{|pt|,|fil|,|fill|,|filll|\}$, we examine if
% $\arg{unit}=|pt|$ or not by a trickey way in
% $\!\pcol@extract@fil@i!\<n\>|.|\<m{\cdot}\mathit{unit}\>\!\@nil!$. That
% is, we do $\!\count@!\<m{\cdot}\mathit{unit}\>\!\@nil!$ with
% \!\afterassignment! to invoke $\!\pcol@extract@fil@ii!\arg{unit}\!\@nil!$
% after $m$ is assigned to \!\count@! to capture $\arg{unit}$. Then if it
% is |pt| we let $\!\@tempdimb!=0$, or otherwise invoke
% $\!\pcol@extract@fil@iii!\<f\>|fil|\arg{garbage}\!\@nil!$ giving it $s$
% because it should have a postfix being |fil|, |fill| or |filll|, to have
% $\!\@tempdimb!=f\cdot u$ finally. Note that since
% \!\pcol@extract@fil@iii! also has the keyword |fil| in its argument
% specification, we \!\def!ine it using \!\pcol@def@extract@fil@iii!, whose
% body is equivalent to
%
% \begin{quote}
% \let\@sverb\latex@sverb
% \verb*|\def\pcol@extract@fil@iii#1fil#2\@nil{%|\\
% | \@tempdimb\pcol@setcw@filunit\relax \@tempdimb#1\@tempdimb}|
% \end{quote}
%
% just once at the top level too.
%
% \begin{macrocode}
\edef\pcol@def@extract@fil{%
\def\noexpand\pcol@extract@fil
##1\space\pcol@kw@plus\space##2\space\pcol@kw@minus##3\noexpand\@nil{%
\noexpand\pcol@extract@fil@i##2\noexpand\@nil}}
\pcol@def@extract@fil
\def\pcol@extract@fil@i#1.#2\@nil{\def\reserved@a{#1.#2}%
\afterassignment\pcol@extract@fil@ii\count@#2\@nil}
\def\pcol@extract@fil@ii#1\@nil{\def\reserved@b{#1}%
\ifx\reserved@b\pcol@kw@pt \@tempdimb\z@
\else \expandafter\pcol@extract@fil@iii\reserved@a\@nil
\fi}
\edef\pcol@def@extract@fil@iii{%
\def\noexpand\pcol@extract@fil@iii##1\pcol@kw@fil##2\noexpand\@nil{%
\@tempdimb\noexpand\pcol@setcw@filunit\relax \@tempdimb##1\@tempdimb}}
\pcol@def@extract@fil@iii
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@def@extract@pt}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to define \cs{pcol@extract@pt}.}
% \begin{macro}{\pcol@extract@pt}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to extract the factor of \string\texttt{pt} from the
% \cs{the} representaion of a dimension.}
%
% The macro $\!\pcol@extract@pt!\<f\>|pt|\<scale\>$ is solely used in
% \!\pcol@setcw@calcf! to extract $f$ from a dimension in the form of
% $f|pt|$ and to let the macro $\<scale\>$ have $f$. Since this macro has
% the keyword |pt| in its argument specification, we \!\def!ine it using
% \!\pcol@def@extract@pt!, whose body is equivalent to
%
% \begin{quote}
% \let\@sverb\latex@sverb
% |\def\pcol@extract@pt#1pt#2{\def#2{#1}}|
% \end{quote}
% just once at the top level again.
%
% \begin{macrocode}
\edef\pcol@def@extract@pt{%
\def\noexpand\pcol@extract@pt##1\pcol@kw@pt##2{\def##2{##1}}}
\pcol@def@extract@pt
% \end{macrocode}
% \end{macro}\end{macro}
%
%
%
% \section{Counter Operations}
% \label{sec:imp-counter}
%
% \begin{macro}{\globalcounter}
% \changes{v1.2-7}{2013/05/11}
% {Examine if the argument counter is already in
% $\string\mathit{\Theta}^g$ to avoid the duplicatoin in the list
% which caused a bug.}
% \changes{v1.32-1}{2015/10/10}
% {Modified according to the introduction of \cs{globalcounter*}.}
% \begin{macro}{\pcol@globalcounter@s}
% \changes{v1.32-1}{2015/10/10}
% {Added for \cs{globalcounter*}.}
% \begin{macro}{\pcol@globalcounter}
% \changes{v1.32-1}{2015/10/10}
% {Renamed from \cs{globalcounter} according to the introduction of
% \cs{globalcounter*}.}
% \begin{macro}{\pcol@gcounters}
% The API macro $\!\globalcounter!\ARg{ctr}$, implemented by
% \!\pcol@globalcounter! and also used in \!\pcol@fnlayout@p! to globalize the
% counter \counter{footnote}, defines that $\arg{ctr}$ is a \gcounter, and
% thus adds it to $\CG=\Midx{\!\pcol@gcounters!}$, which has \counter{page}
% at initial. Note that we examines if $\arg{ctr}\in\CG$ prior to the
% addition to avoid the duplication in $\CG$. Also note that initial
% definition of \!\pcol@gcounters! is done by \!\gdef! just for consistent
% \!\global! assignments to it. On the other hand \!\globalcounter!|*|,
% implemented by \!\pcol@globalcounter@s!, makes all counters kept in
% \!\cl@@ckpt! global by letting \!\pcol@gcounters! have the list.
% Switching these two functionality is done by \!\globalcounter! examining
% if it is followed by a |*| by \!\@ifstar!.
%
% \begin{macrocode}
%% Counter Operations
\def\globalcounter{\@ifstar\pcol@globalcounter@s\pcol@globalcounter}
\def\pcol@globalcounter@s{\global\let\pcol@gcounters\cl@@ckpt}
\def\pcol@globalcounter#1{{%
\@tempswafalse \def\reserved@a{#1}%
\def\@elt##1{\def\reserved@b{##1}%
\ifx\reserved@a\reserved@b \@tempswatrue \fi}%
\pcol@gcounters
\if@tempswa\else \@cons\pcol@gcounters{{#1}}\fi}}
\gdef\pcol@gcounters{\@elt{page}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\localcounter}
% \changes{v1.2-6}{2013/05/11}
% {Introduced to remove the argument counter from
% $\string\mathit{\Theta}^g$.}
%
% The API macro \!\localcounter!\marg{ctr}, also used in
% \!\pcol@fnlayout@c! to localize the counter \counter{footnote},
% declares that $\arg{ctr}$ is a \lcounter, and thus removes it from $\CG$
% by \!\pcol@removecounter! if $\arg{ctr}\neq\counter{page}$.
%
% \begin{macrocode}
\def\localcounter#1{%
\expandafter\ifx\csname c@#1\endcsname\c@page\else
\pcol@removecounter\pcol@gcounters{#1}%
\fi}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{1}
% \begin{macro}{\pcol@remctrelt}
% \changes{v1.2-6}{2013/05/11}
% {Recode to use newly introduced \cs{pcol@removecounter}.}
% \begin{macro}{\pcol@removecounter}
% \changes{v1.2-6}{2013/05/11}
% {Introduced for the counter removal operation in
% \cs{localcounter} and \cs{pcol@remctrelt}.}
% \begin{macro}{\pcol@iremctrelt}
% \changes{v1.2-6}{2013/05/11}
% {Add the first argument $\string\mathit{\Theta}'$ as the counter
% list from which the second argument $\theta$ is removed.}
%
% The macro $\!\pcol@remctrelt!\Arg\cg$ is invoked solely from
% \!\pcol@zparacol! and is applied to each \gcounter{} $\cg\in\CG$ to
% remove it from $\CC=\!\pcol@counters!$ in which we have $\CTL$ finally.
% The macro also moves $|\cl@|{\cdot}\cg=\clist(\cg)$
%
% \SpecialArrayIndex{\theta}{\cl@}
%
% to $|\pcol@cl@|{\cdot}\cg$
%
% \SpecialArrayMainIndex{\theta}{\pcol@cl@}
%
% to keep the list of the descendant \lcounter{}s of $\cg$ in it, and then
% re\!\def!ines $|\cl@|{\cdot}\cg=\!\pcol@stepcounter!\Arg\cg$
%
% \SpecialArrayMainIndex{\theta}{\cl@}
%
% so that it is invoked on $\!\stepcounter!\Arg\cg$ to let $\val_c(\cl)=0$
% for all $c\In0\C$ and $\cl\in\clist(\cg)$, if $\cg\neq\counter{page}$.
% These operations are performed by a lengthy sequence with many occurrences
% of \!\expandafter!, \!\csname! and \!\endcsname! but the sequence is
% equivalent to the following.
%
% \begin{quote}
% $\!\let!|\pcol@cl@|{\cdot}\cg|=\cl@|{\cdot}\cg$\\
% $\CSIndex{ifx}|\c@|{\cdot}\cg\!\c@page!|\else |
% |\def\cl@|{\cdot}\cg|{|\!\pcol@stepcounter!|{|\cg|}}\fi|$
% \end{quote}
%
% As for the removal of $\cg$ from $\CC$, we invoke
% $\!\pcol@removecounter!\<\mathit{\Theta}'\>\Arg{\theta}$ giving it
% $\mathit{\Theta}'=\CC$ and $\theta=\cg$. This macro, also invoked from
% $\!\localcounter!\Arg\cl$ with $\mathit{\Theta}'=\CG$ and $\theta=\cl$,
% does $\mathit{\Theta}''\gets\mathit{\Theta}'$,
% $\mathit{\Theta}'=\emptyset$, and then apply
% $\!\pcol@iremctrelt!\arg{\mathit{\Theta}'}$ to each
% $\theta'\in\mathit{\Theta}''$ to let
% $\mathit{\Theta}'\gets\mathit{\Theta}'\cup\{\theta'\}$ by \!\@cons! if
% $\theta'\neq\theta$.
%
% \begin{macrocode}
\def\pcol@remctrelt#1{%
\expandafter\let\expandafter\reserved@a\csname cl@#1\endcsname
\expandafter\let\csname pcol@cl@#1\endcsname\reserved@a
\expandafter\ifx\csname c@#1\endcsname\c@page\else
\@namedef{cl@#1}{\pcol@stepcounter{#1}}%
\fi
\pcol@removecounter\pcol@counters{#1}}
\def\pcol@removecounter#1#2{%
\def\reserved@a{#2}\let\reserved@b#1\relax \global\let#1\@empty
{\def\@elt{\pcol@iremctrelt#1}\reserved@b}}
\def\pcol@iremctrelt#1#2{%
\def\reserved@b{#2}%
\ifx\reserved@a\reserved@b\else \@cons#1{{#2}}\fi}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\definethecounter}
% The API macro $\!\definethecounter!\<\cl\>\<c\>\arg{rep}$ define the
% \lrep{} $\arg{rep}$ for a \lcounter{} $\cl$ in a column $c$. It
% \!\def!ines $|\pcol@thectr@|{\cdot}\cl{\cdot}c$
%
% \SpecialArrayMainIndex{\theta{\cdot}c}{\pcol@thectr@}
%
% to have $\arg{rep}$ in its body.
%
% \begin{macrocode}
\def\definethecounter#1#2#3{\@namedef{pcol@thectr@#1#2}{#3}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@thectrelt}
% The macro $\!\pcol@thectrelt!\<\cl\>$ is invoked solely in \!\pcol@zparacol!
% and is applied to each $\cl\in\CTL$ to define its \lrep{} of
% default and that of the leftmost column 0. It performs a lengthy sequence
% with many occurrences of \!\expandafter!, \!\csname! and \!\endcsname! but
% the sequence is equivalent to the followings.
%
% \begin{quote}
% $\!\let!|\pcol@thectr@|{\cdot}\cl|=\the|{\cdot}\cl$\\
% $\CSIndex{ifx}|\pcol@thectr@|{\cdot}\cl{\cdot}0\!\relax!|\else |
% \!\let!|\the|{\cdot}\cl|=\pcol@thectr@|{\cdot}\cl{\cdot}0| \fi|$
% \end{quote}
%
% \SpecialArrayMainIndex{\theta}{\pcol@thectr@}
% \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
% \SpecialArrayMainIndex{\theta}{\the}
%
% \begin{macrocode}
\def\pcol@thectrelt#1{%
\expandafter\let\expandafter\reserved@a\csname the#1\endcsname
\expandafter\let\csname pcol@thectr@#1\endcsname\reserved@a
\expandafter\let\expandafter\reserved@a\csname pcol@thectr@#10\endcsname
\ifx\reserved@a\relax\else
\expandafter\let\csname the#1\endcsname\reserved@a
\fi}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{1}
% \begin{macro}{\pcol@loadctrelt}
% \changes{v1.0}{2011/10/10}
% {Introduced for inter-environment local counter conservation.}
% \begin{macro}{\pcol@storecounters}
% \changes{v1.0}{2011/10/10}
% {Introduced for inter-environment local counter conservation.}
% \begin{macro}{\pcol@storectrelt}
% \changes{v1.0}{2011/10/10}
% {Introduced for inter-environment local counter conservation.}
%
% The macro $\!\pcol@loadctrelt!\<\cl\>\<\val_c(\cl)\>$ is invoked from
% \!\pcol@zparacol! and \!\pcol@synccounter! and is applied to each element
% $\<\cl,\val_c(\cl)\>\in\Cc_c$ for a column $c$ to define a macro
% $|\pcol@ctr@|{\cdot}\cl=v(\cl)$
%
% \SpecialArrayMainIndex{\theta}{\pcol@ctr@}
%
% having $\val_c(\cl)$ in its body for a temporary use. This macro or its
% redefined version is then referred to by $\!\pcol@cmpctrelt!\<\cl\>$ or
% $\!\pcol@storectrelt!\<\cl\>$. The latter is invoked from
% \!\pcol@storecounters! via \!\pcol@sscounters! to add $\<\cl,v(\cl)\>$ to
% \!\@gtempa! by \!\@cons! to rebuild $\CC_c$ for a column $c$ in
% \!\@gtempa!.
%
% The macro \!\pcol@storecounters! is invoked solely from
% $\!\pcol@synccounter!\<\theta\>$ to update a \lcounter{} $\theta$ with
% $\Val(\theta)$ for \csync. That is, \!\pcol@storecounters! is used to add
% $\<\cl,v(\cl)\>$ to \!\@gtempa! for all $\cl\in\CTL$ by \!\pcol@sscounters!
% giving it \!\pcol@storectrelt! as its argument, where $v(\cl)$ is modified
% if $\cl=\theta$ or unmodifed otherwise after it is defined by
% \!\pcol@loadctrelt!.
%
% \begin{macrocode}
\def\pcol@loadctrelt#1#2{\@namedef{pcol@ctr@#1}{#2}}
\def\pcol@storecounters{\pcol@sscounters\pcol@storectrelt}
\def\pcol@storectrelt#1{\@cons\@gtempa{{#1}{\@nameuse{pcol@ctr@#1}}}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@savecounters}
% \changes{v1.0}{2011/10/10}
% {Move the body to \cs{pcol@sscounters}.}
%
% \begin{macro}{\pcol@savectrelt}
% The macro \!\pcol@savecounters! is invoked from
% \!\pcol@com@syncallcounters!, \!\pcol@stepcounter! and \!\pcol@switchcol!
% to let $\CC_c$ for a column $c$ have the list of $\<\cl,\val_c(\cl)\>$
% where $\val_c(\cl)$ is the value of $|\c@|{\cdot}\cl$ to be saved in
% the list.
%
% \SpecialArrayIndex{\theta}{\c@}
%
% It does this operation invoking \!\pcol@sscounters! giving it
% \!\pcol@savectrelt! as its argument.
%
% The macro $\!\pcol@savectrelt!\<\cl\>$ adds $\<\cl,\val_c(\cl)\>$ to
% \!\@gtempa! by \!\@cons! to rebuild $\CC_c$ for a column $c$ in
% \!\@gtempa!.
%
% \begin{macrocode}
\def\pcol@savecounters{\pcol@sscounters\pcol@savectrelt}
\def\pcol@savectrelt#1{\@cons\@gtempa{{#1}{\number\csname c@#1\endcsname}}}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@sscounters}
% \changes{v1.0}{2011/10/10}
% {Introduced to implement the common operations of
% \cs{pcol@storecounters} and \cs{pcol@savecounters}.}
%
% The macro $\!\pcol@sscounters!\arg{elt}$ is invoked from
% \!\pcol@storecounters! with $\arg{elt}=\!\pcol@storectrelt!$ or
% \!\pcol@savecounters! with $\arg{elt}=\!\pcol@savectrelt!$ to build
% $\CC_c=|\pcol@counters|{\cdot}c$ for a column $c$.
%
% \SpecialArrayMainIndex{c}{\pcol@counters}
%
% To do that, it lets $\!\@gtempa!=()$ and then apply $\arg{elt}$ to all
% $\cl\in\CTL=\!\pcol@counters!$ to have updated $\CC_c$ in \!\@gtempa!.
% Then finally, \!\@gtempa! is moved into $\CC_c$ by \!\xdef!\footnote{
%
% It can be done by \cs{global}\cs{let} more efficiently but it is lengthy
% due to two \cs{expandafter}.}.
%
% \begin{macrocode}
\def\pcol@sscounters#1{\begingroup
\global\let\@gtempa\@empty
\let\@elt#1\relax \pcol@counters
\let\@elt\relax
\expandafter\xdef\csname pcol@counters\number\pcol@currcol\endcsname{%
\@gtempa}%
\endgroup}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@cmpctrelt}
% \changes{v1.0}{2011/10/10}
% {Introduced for inter-environment local counter conservation.}
%
% The macro $\!\pcol@cmpctrelt!\<\theta\>$ is invoked solely from
% \!\pcol@zparacol! and is applied to each $\theta\in\CC$ to examine if
% $\val_0(\theta)=\Val(\theta)$ where $\val_0(\theta)$ is in
% $|\pcol@ctr@|{\cdot}\theta$.
%
% \SpecialArrayIndex{\theta}{\pcol@ctr@}
%
% If the examination fails including due to that $|\pcol@ctr@|{\cdot}\theta$
%
% \SpecialArrayIndex{\theta}{\pcol@ctr@}
%
% is undefined, we add $\theta$ to the list \!\@gtempa! by \!\@cons!.
%
% \begin{macrocode}
\def\pcol@cmpctrelt#1{\@tempswafalse \@tempcnta\@nameuse{c@#1}%
\expandafter\ifx\csname pcol@ctr@#1\endcsname\relax \@tempswatrue
\else\ifnum\@nameuse{pcol@ctr@#1}=\@tempcnta\else \@tempswatrue
\fi\fi
\if@tempswa \@cons\@gtempa{{#1}}\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\synccounter}
% \changes{v1.0}{2011/10/10}
% {Introduced as an environment-local API command.}
% \begin{macro}{\pcol@com@synccounter}
% \changes{v1.0}{2011/10/10}
% {Introduced for the implementation of the new API command
% \cs{synccounter}.}
%
% The macro $\!\pcol@com@synccounter!\<\theta\>$, being the implementation
% of the \elocal{} API macro \!\synccounter!, lets
% $\val_c(\theta)=\Val(\theta)$ for all $c\In0\C$. That is, the value of
% the counter $\theta$ is {\em broadcasted} to all columns for the
% {\em\Uidx\csync} of $\theta$. This broadcast is done by
% \!\pcol@synccounter! with an argument $\!\@elt!|{|\theta|}|$ so that it
% works only on $\theta$.
%
% \begin{macrocode}
\def\pcol@com@synccounter#1{\pcol@synccounter{\@elt{#1}}}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@synccounter}
% \changes{v1.0}{2011/10/10}
% {Introduced for \cs{synccounter} and inter-environment local counter
% conservation.}
% \begin{macro}{\pcol@syncctrelt}
% \changes{v1.0}{2011/10/10}
% {Introduced for \cs{synccounter} and inter-environment local counter
% conservation.}
%
% The macro $\!\pcol@synccounter!\arg{lst}$ is invoked from
% \!\pcol@zparacol! with $\arg{lst}=\!\@gtempa!$ and from
% $\!\pcol@com@synccounter!\arg{ctr}$ with $\arg{lst}=\!\@elt!\Arg{ctr}$, to
% let $\val_c(\theta)=\Val(\theta)$ for all $c\In0\C$ and all $\theta$ in
% $\arg{lst}$. To do that, at first we move $\arg{lst}$ into \!\reserved@a!
% in order to make \!\@gtempa! free so that it can be used in
% \!\pcol@storecounters!. Next, for each $c\In0\C$, we let
% $v(\cl)=\val_c(\cl)$ by applying \!\pcol@loadctrelt! to all
% $\<\cl,\val_c(\cl)\>\in\Cc_c$, then scan $\arg{lst}$ applying
% $\!\pcol@syncctrelt!\<\theta\>$ for each $\theta$ in $\arg{lst}$ to let
% $v(\theta)=\Val(\theta)$, and finally store all $v(\cl)$ back to $\Cc_c$
% by \!\pcol@storecounters!, where $v(\theta)$ is
% $|\pcol@ctr@|{\cdot}\theta$.
%
% \SpecialArrayIndex{\theta}{\pcol@ctr@}
%
% \begin{macrocode}
\def\pcol@synccounter#1{{%
\let\@elt\relax \edef\reserved@a{#1}%
\pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
\let\@elt\pcol@loadctrelt \@nameuse{pcol@counters\number\pcol@currcol}%
\let\@elt\pcol@syncctrelt \reserved@a
\pcol@storecounters
\advance\pcol@currcol\@ne}}}
\def\pcol@syncctrelt#1{%
\expandafter\edef\csname pcol@ctr@#1\endcsname{\number\@nameuse{c@#1}}}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\syncallcounters}
% \changes{v1.0}{2011/10/10}
% {Introduced as an environment-local API command.}
% \begin{macro}{\pcol@com@syncallcounters}
% \changes{v1.0}{2011/10/10}
% {Introduced for the implementation of the new API command
% \cs{syncallcounters}.}
%
% The macro \!\pcol@com@syncallcounters!, being the implementation of the
% \elocal{} API macro \!\syncallcounters!, makes all \lcounter{}s in all
% columns have the value in the current column. That is, for each
% $c\In0\C$, we invoke \!\pcol@savecounters! to let $\val_c(\cl)={\Val}(\cl)$
% for all $\cl\in\CTL$.
%
% \begin{macrocode}
\def\pcol@com@syncallcounters{{%
\pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
\pcol@savecounters \advance\pcol@currcol\@ne}}}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@setctrelt}
% \changes{v1.0}{2011/10/10}
% {Replace \cs{setcounter} with direct assignment with \cs{csname} and
% \cs{endcsname}}
%
% The macro $\!\pcol@setctrelt!\<\cl\>\<\val_c(\cl)\>$ is solely inovked
% from \!\pcol@switchcol! to swich to a column $c$ and is applied to each
% $\<\cl,\val_c(\cl)\>\in\Cc_c$ to let $\Val(\cl)=\val_c(\cl)$ \!\global!ly.
% It also define the \lrep{} of $\cl$, being $|\the|{\cdot}\cl$,
%
% \SpecialArrayIndex{\theta}{\the}
%
% to be $|\pcol@thectr@|{\cdot}\cl{\cdot}c$
%
% \SpecialArrayIndex{\theta{\cdot}c}{\pcol@thectr@}
%
% if it is defined, or otherwise to be $|\pcol@thectr@|{\cdot}\cl$ which keeps
% the original $|\the|{\cdot}\cl$.
%
% \SpecialArrayIndex{\theta}{\the}
%
% This \lrep{} definition is done by a lengthy sequence with many occurrences
% of \!\expandafter!, \!\csname! and \!\endcsname!, but it is equivalent to
% the followings.
%
% \begin{quote}
% $\CSIndex{ifx}|\pcol@thectr@|{\cdot}\cl{\cdot}c\!\relax!| |
% \!\let!|\the|{\cdot}\cl|=\pcol@thectr@|{\cdot}\cl$\\
% $|\else |\!\let!|\the|{\cdot}\cl|=\pcol@thectr@|{\cdot}\cl{\cdot}c$\\
% |\fi|
% \end{quote}
% %
% \begin{macrocode}
\def\pcol@setctrelt#1#2{%
\global\csname c@#1\endcsname#2\relax
\expandafter\ifx\csname pcol@thectr@#1\number\pcol@currcol\endcsname\relax
\expandafter\let\expandafter\reserved@a\csname pcol@thectr@#1\endcsname
\else
\expandafter\let\expandafter\reserved@a
\csname pcol@thectr@#1\number\pcol@currcol\endcsname
\fi
\expandafter\let\csname the#1\endcsname\reserved@a}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{1}
% \begin{macro}{\pcol@stepcounter}
% \changes{v1.0}{2011/10/10}
% {Change the order of operations.}
% \changes{v1.0}{2011/10/10}
% {Replace \cs{csname}/\cs{endcsname} with \cs{@nameuse}.}
% \begin{macro}{\pcol@stpldelt}
% \begin{macro}{\pcol@stpclelt}
%
% The macro $\!\pcol@stepcounter!\<\cg\>$ is invoked from
% $\!\stepcounter!\<\cg\>$ for a \gcounter{} $\cg$ because
% $|\cl@|{\cdot}\cg$
%
% \SpecialArrayIndex{\theta}{\cl@}
%
% is modified by \!\pcol@remctrelt! so as to invoke this macro to zero-clear
% \lcounter{}s $\theta\in\clist(\cg)$. To do that, we do the followings in
% a group for each $c\In0\C$. First we apply
% $\!\pcol@stpldelt!\<\cl\>\<\val_c(\cl)\>$ to each
% $\<\cl,\val_c(\cl)\>\in\Cc_c$ to let $\Val(\cl)=\val_c(\cl)$ locally.
% Then we apply $\!\pcol@stpclelt!\<\theta\>$ to each $\theta\in\clist(\cg)$
% to let $\Val(\theta)=0$. Finally, we invoke \!\pcol@savecounters! to let
% $\val_c(\cl)=\Val(\cl)$ for all $\cl\in\CTL$ to reflect the zero-clear of
% $\theta\in\clist(\cg)$.
%
% After the operations above, we apply $\!\@stpelt!\<\theta\>$ to each
% $\theta\in\clist(\cg)$ for \!\global! zero-clearing.
%
% \begin{macrocode}
\def\pcol@stepcounter#1{\begingroup
\pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
\let\@elt\pcol@stpldelt \@nameuse{pcol@counters\number\pcol@currcol}%
\let\@elt\pcol@stpclelt \@nameuse{pcol@cl@#1}%
\pcol@savecounters
\advance\pcol@currcol\@ne}%
\endgroup
\let\@elt\@stpelt \@nameuse{pcol@cl@#1}}
\def\pcol@stpldelt#1#2{\csname c@#1\endcsname#2\relax}
\def\pcol@stpclelt#1{\csname c@#1\endcsname\z@}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
%
%
% \section{Column-Switching Commands and Environments}
% \label{sec:imp-switch}
%
% \begin{macro}{\pcol@par}
% \changes{v1.0}{2011/10/10}
% {Introduced for \cs{par}-if-necessary operation.}
%
% Before giving the definition of \cswitch{} commands and environments, we
% define a commonly used macro \!\pcol@par!, which do \CSIndex{par} if
% necessary, i.e., we are not in vertical mode. The reason why we don't
% simply do \CSIndex{par} is that it may have some definition different from
% \!\@@par! and thus an incautious repetition of \CSIndex{par} may cause
% undesirable results. This macro is used in \!\pcol@com@switchcolumn!,
% \!\pcol@sptext!, \!\pcol@com@endcolumn!, \!\pcol@flushclear!,
% and \!\endparacol!.
%
% \begin{macrocode}
%% Column-Switching Commands and Environments
\def\pcol@par{\ifvmode\else \par \fi}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{2}
% \begin{macro}{\switchcolumn}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@switchcolumn} for localization.}
% \begin{macro}{\pcol@com@switchcolumn}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implementation of \cs{switchcolumn}.}
% \changes{v1.0}{2011/10/10}
% {Add \cs{pcol@defcolumn} to clarify the behavior of \texttt{column}.}
% \begin{macro}{\pcol@switchcolumn}
% \changes{v1.0}{2011/10/10}
% {Add the check of $d\geq0$.}
% \changes{v1.31}{2013/10/10}
% {Add a space before the number of columns in the error message.}
%
% \begin{macro}{\pcol@iswitchcolumn}
% The macro $\!\pcol@com@switchcolumn!|[|d|]|$, being the implementation of the
% \elocal{} API macro \!\switchcolumn!, switches to the column $d$ if provided
% through its optional argument, or to $d=(c+1)\bmod\C$ otherwise where $c$
% is the ordinal of the current column. After making it sure to be in
% vertical mode by \!\pcol@par!, it invokes \!\pcol@defcolumn! to give
% \!\pcol@com@column!(|*|) their
% \!\def!initions for occurrences not as the very first \cswitch{} command
% or environment of the current \env{paracol} environment. Then, after
% calculating $d=(c+1)\bmod\C$, this macro simply invokes
% $\!\pcol@switchcol!|[|d|]|$ with or without the calculated $d$ depending
% on the existance of the optional argument delimitor `|[|'.
%
% The macro $\!\pcol@switchcolumn!|[|d|]|$ lets $\!\pcol@nextcol!=d$ and
% confirms $0\leq d<\C$ or abort the execution by \!\PackageError! if it
% does not hold. Then it invokes \!\pcol@iswitchcolumn! if
% $\!\switchcolumn!|[|d|]|$ is followed by a `|*|', or \!\pcol@switchcol!
% othewise.
%
% The macro $\!\pcol@iswitchcolumn!|[|\arg{text}|]|$ invokes
% $\!\pcol@sptext!|[|\arg{text}|]|$ if the optional argument is provided, or
% \!\pcol@switchcol! otherwise, after letting $\CSIndex{ifpcol@sync}=\true$
% for \exsync{}.
%
% \begin{macrocode}
\def\pcol@com@switchcolumn{\pcol@par
\pcol@defcolumn
\@tempcnta\pcol@currcol \advance\@tempcnta\@ne
\ifnum\@tempcnta<\pcol@ncol\else \@tempcnta\z@ \fi
\@ifnextchar[%]
\pcol@switchcolumn{\pcol@switchcolumn[\@tempcnta]}}
\def\pcol@switchcolumn[#1]{%
\pcol@nextcol#1\relax
\@tempswafalse
\ifnum#1<\z@ \@tempswatrue \fi
\ifnum#1<\pcol@ncol\else \@tempswatrue \fi
\if@tempswa
\PackageError{paracol}{%
Column number \number#1 must be less than \number\pcol@ncol}\@eha
\pcol@nextcol\z@
\fi
\@ifstar\pcol@iswitchcolumn\pcol@switchcol}
\def\pcol@iswitchcolumn{%
\global\pcol@synctrue
\@ifnextchar[%]
\pcol@sptext\pcol@switchcol}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@sptext}
% \changes{v1.0}{2011/10/10}
% {Made \cs{long} to allow \cs{par} in its argument.}
% \changes{v1.0}{2011/10/10}
% {Replace \cs{par} with \cs{pcol@par}.}
% \changes{v1.0}{2011/10/10}
% {Add $\cs{ifpcol@mctext}\EQ\mathit{true}$ for restriction of the
% broadcast of \cs{if@nobreak} and \cs{everypar}.}
% \changes{v1.2-4}{2013/05/11}
% {Add \cs{pcol@swapcolumn} for column-swapping.}
% \changes{v1.2-5}{2013/05/11}
% {Add setting of \cs{columnwidth}, \cs{linewidth} and \cs{parshape}
% to have indented spanning text with surrounding
% \string\texttt{list}-like environments.}
% \changes{v1.3-1}{2013/09/17}
% {Add $\cs{ifpcol@sptextstart}\EQ\string\mathit{true}$ before first
% synchronized column-switching to let \cs{pcol@output@switch} save
% pre-spanning-text stuff, move the timing of
% $\cs{ifpcol@sptext}\EQ\string\mathit{true}$ from the end of
% spanning text to the beginning so that \cs{output} routine for a
% page break in the text capture the pre-break portion, and remove
% the invocation of \cs{pcol@swapcolumn} because spanning texts are
% now always put into the column-0.}
% \changes{v1.3-6}{2013/09/17}
% {Add globalization of \cs{@svsechd} and \cs{@svsec}.}
%
% The macro $\!\pcol@sptext!|[|\arg{text}|]|$ is invoked from
% \!\pcol@zparacol! and \!\pcol@iswitchcolumn! to put a \Uidx\mctext{}
% $\arg{text}$ given as the optional argument of the former or that of
% \!\switchcolumn!|*| and its relative envrironment openers for the latter.
% The macro has \!\long! attribute because the \mctext{} may have
% \CSIndex{par}. Since the text is put in the column-0 regardless of its
% physical position, we let \!\pcol@nextcol! have 0 after saving the target
% column $d=\!\pcol@nextcol!$ in \!\@tempcnta!. Then we switch to the
% column by \!\pcol@switchcol!, after turning $\CSIndex{ifpcol@sync}=\true$
% to set a \sync{}ation point above the text and
% $\CSIndex{ifpcol@sptextstart}=\true$ to tell \!\pcol@output@switch! to
% prepare the capture of \mctext{} saveing the \prespan{}.
%
% Next, we let $\CSIndex{ifpcol@sptextstart}=\false$ and
% $\CSIndex{ifpcol@sptext}=\true$ to indicate the main vertical list
% contains only the \mctext{} and it is to be captured by \!\output!
% routine. Then the $\arg{text}$ is put in a group in which we let
% $\!\columnwidth!=\!\hsize!=\!\textwidth!$ and
% $\!\linewidth!=\!\textwidth!-\lrm$ with \!\parshape! to indent lines by
% \!\@totalleftmargin! if $\lrm>0$, to let \mctext{} span across all columns
% reflecting the indentation in the \env{list}-like environments surrounding
% \env{paracol} if any. We also let $\!\col@number!=1$ to ensure again that
% \!\maketitle! produces a title without \!\twocolumn! if it is in the
% \mctext.
%
% Then, after invoking \!\pcol@par! to ensure to be in vertical
% mode, we \!\global!ize \!\@svsechd! and \!\@svsec! which may be defined in
% a lower-level sectioning command such as \!\paragraph! in the \mctext{} so
% that they are properly expanded in \!\everypar! inserted at the beginning
% of the first paragraph of the column to which we switch shortly, even when
% the sectioning command is used inappropriately in the \mctext.
% We also \!\global!ize \!\everypar! by a sequence with three
% \!\expandafter! so that \!\pcol@output@switch! for the \sync{}ed
% \cswitch{} we make shortly broadcasts it to other columns. Finally after
% closing the group, we let $\!\pcol@nextcol!=d$ and
% $\CSIndex{pcol@sync}=\true$ to set another \sync{}ation point below the
% \mctext{} and to make the captured text combined with \prespan, and then
% invoke \!\pcol@switchcol! to switch the coloumn $d$.
%
% \begin{macrocode}
\long\def\pcol@sptext[#1]{%
\@tempcnta\pcol@nextcol
\global\pcol@synctrue \pcol@nextcol\z@
\global\pcol@sptextstarttrue
\pcol@switchcol
\global\pcol@sptextstartfalse \global\pcol@sptexttrue
\begingroup
\columnwidth\textwidth \hsize\columnwidth
\linewidth\columnwidth \advance\linewidth-\pcol@lrmargin
\ifdim\pcol@lrmargin>\z@ \parshape\@ne\@totalleftmargin\linewidth \fi
\col@number\@ne #1\pcol@par
\global\let\@svsechd\@svsechd \global\let\@svsec\@svsec
\expandafter\global\expandafter\everypar\expandafter{\the\everypar}%
\endgroup
\pcol@nextcol\@tempcnta \global\pcol@synctrue \pcol@switchcol}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@switchcol}
% \changes{v1.0}{2011/10/10}
% {Add \cs{pcol@aconly} for disabling \cs{addcontentsline}.}
% \changes{v1.2-2}{2013/05/11}
% {Add column-scanning and page-overflow check for synchronized
% column-switching.}
% \changes{v1.2-4}{2013/05/11}
% {Add \cs{pcol@swapcolumn} for column-swapping to turn
% \cs{if@firstcolumn}.}
% \changes{v1.3-4}{2013/09/17}
% {Remove settig \cs{if@firstcolumn} and the invocation of
% \cs{pcol@swapcolumn} for it because the position of marginal notes
% are now controlled by \cs{pcol@addmarginpar}.}
% \changes{v1.3-5}{2013/09/17}
% {Add setting $V_E\EQ\cs{pcol@@ensurevspace}$ and reinitialization of
% \cs{pcol@ensurevspace} for avoidance of post-synchronization
% inconsistent page break.}
% \changes{v1.35-5}{2018/12/31}
% {Add the invocation of $\cs{pcol@colpream}\cdot c$.}
%
% The macro \!\pcol@switchcol! is invoked from \!\pcol@switchcolumn!,
% \!\pcol@iswitchcolumn!, \!\pcol@sptext! and \!\endparacol! to switch the
% column $d=\!\pcol@nextcol!$. First, we save \lcounter{}s in the current
% column $c$ into $\Cc_c$ by \!\pcol@savecounters!.
%
% Next, if $\CSIndex{ifpcol@sync}=\true$, we do the followings. At first we
% let $\VE={}$\!\pcol@@ensure~vspace! have the natrual component of
% \!\pcol@ensurevspace! which can have a glue specified by \!\ensurevspace!,
% so that it is referred to by \!\pcol@sync! as the minimum space required
% below the \sync{}ation point we are now setting. Second, we invoke
% \!\pcol@visitallcols! temporarily turning $\CSIndex{ifpcol@sync}=\false$
% for \cscan{}ning to visit all columns but current one to give \TeX's page
% builder the chance to break \colpage{}s in the \tpage{} with \Scfnote{}s
% which could have not been presented in the last visit of the columns.
% Third, we make an \!\output! request with $\!\penalty!=\!\pcol@op@switch!$
% to invoke \!\pcol@output@switch! by \!\pcol@invokeoutput! with
% $\CSIndex{ifpcol@sync}=\true$ to make \sync{}ed switch to the column $d$.
% This invocation may result in $\CSIndex{ifpcol@flush}=\true$ to mean the
% \tpage{} should be broken before setting the \sync{}ation point.
% Therefore if so, since \!\pcol@output@switch! switched to the tallest
% column rather than $d$, we put \!\vfil! and \!\penalty!|-10000| to force
% page break, make \cscan{} with \!\newpage! put into each column to have
% some floats in the column in the new \tpage{}, and then invoke
% \!\pcol@output@switch! again until it returns
% $\CSIndex{ifpcol@flush}=\false$ telling us it successfully sets the
% \sync{}ation point switching to the column $d$. Then as the last operation
% specific to \sync{}ed \cswitch{}, we invoke \!\ensurevspace! with
% \!\baselineskip! to give the default of $\VE$ for the next \sync{}ation.
%
% Otherwise, i.e., if $\CSIndex{ifpcol@sync}=\false$, we simply make the
% \!\output! request for \!\pcol@output@switch! to switch to the column $d$.
%
% Then we scan $\Cc_d$ applying \!\pcol@setctrelt! to each
% $\<\cl,\val_d(\cl)\>\in\Cc_d$ to let $\Val(\cl)={\val_d(\cl)}$. We also
% scan $\T=\!\pcol@aconly!$ applying \!\pcol@aconlyelt! to each
% $\<t_c,c\>\in T$ to inhibit \!\addcontentsline! to the contents file of
% type $t_d$ as specified so by $\!\addcontentsonly!\arg{t_d}\~\arg{d}$.
% After that, we let $\!\@elt!=\!\relax!$ to make it sure that any lists can
% be manipulated without unexpected application of a macro to their
% elements.
%
% Finally, we invoke $|\pcol@colpream|{\cdot}c$, where $c=-1$ if
% $\CSIndex{ifpcol@sptextstart}=\true$ to mean the \cswitch{} is for a
% \sptext{}, or $c=d$ otherwise.
%
% \SpecialArrayIndex{c}{\pcol@colpream}
%
% \begin{macrocode}
\def\pcol@switchcol{%
\pcol@savecounters
\ifpcol@sync
\@tempdima\pcol@ensurevspace\relax
\edef\pcol@@ensurevspace{\number\@tempdima sp\relax}%
\global\pcol@syncfalse \pcol@visitallcols\@@par \global\pcol@synctrue
\pcol@invokeoutput\pcol@op@switch
\@whilesw\ifpcol@flush\fi{%
\vfil \penalty-\@M
\global\pcol@syncfalse \pcol@visitallcols\newpage \global\pcol@synctrue
\pcol@invokeoutput\pcol@op@switch}%
\ensurevspace{\baselineskip}%
\else
\pcol@invokeoutput\pcol@op@switch
\fi
\let\@elt\pcol@setctrelt
\csname pcol@counters\number\pcol@currcol\endcsname
\let\@elt\pcol@aconlyelt \pcol@aconly \let\@elt\relax
\@nameuse{pcol@colpream\ifpcol@sptextstart-1\else\number\pcol@currcol\fi}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@visitallcols}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for column-scanning in synchronized column-switching and
% page flushing.}
%
% The macro $\!\pcol@visitallcols!\arg{cs}$, invoked from \!\pcol@switchcol!
% and \!\pcol@flushclear!, performs \cscan{}ning putting $\arg{cs}$ into the
% visited columns. That is, we repeat the invocation of
% \!\pcol@output@switch! to visit $d$ through \!\pcol@invokeoutput! with
% $\!\penalty!=\!\pcol@op@switch!$ for all $d\In0\C-\{c\}$. In each visit,
% we put $\arg{cs}\in\{\!\@@par!,\!\newpage!\}$ to have a chance of or to
% force page break in each visited \colpage{}. Finally we go back to $c$ to
% restore its \cctext{} especially when we are leaving the column 0 for
% \mctext. That is, $\cc_c(\sw)$ and $\cc_c(\ep)$ should be presented to
% \!\pcol@output@switch! to broadcast them to other columns.
%
% \begin{macrocode}
\def\pcol@visitallcols#1{\begingroup
\@tempcnta\z@ \@tempcntb\pcol@currcol
\@whilenum\@tempcnta<\pcol@ncol\do{%
\ifnum\@tempcnta=\@tempcntb\else
\pcol@nextcol\@tempcnta \pcol@invokeoutput\pcol@op@switch #1%
\fi
\advance\@tempcnta\@ne}%
\pcol@nextcol\@tempcntb \pcol@invokeoutput\pcol@op@switch
\endgroup}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{3}
% \begin{macro}{\column}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@column} for localization.}
% \begin{macro}{\column*}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@column*} for localization.}
% \begin{macro}{\pcol@com@column}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{column}.}
% \begin{macro}{\pcol@com@column*}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{column*}.}
% \begin{macro}{\pcol@defcolumn}
% \changes{v1.0}{2011/10/10}
% {Replace \cs{column} with \cs{pcol@com@column} and \cs{switchcolumn}
% with \cs{pcol@switchenv}.}
%
% The macros \!\pcol@com@column!(|*|), the implementations of the \elocal{}
% API commands \!\column!(*), starts the environment |column(*)|.
%
% \Midx{\EnvIndex{column}}\Midx{\EnvIndex{column*}}
%
% Basically, the macros do \!\switch~column!\~(|*|), but if the environment
% starts just after \beginparacol{} the macro have to switch to the column
% 0. Therefore, the definitions for this very-beginning appearance are
% given in \!\pcol@zparacol! to do (almost) nothing, and then those for
% other ones are given by \!\pcol@defcolumn! invoked in
% \!\pcol@com@switchcolumn! to invoke
% \!\pcol@switchenv!|{column|(|*|)|}|(|*|) which then invokes
% \!\switchcolumn!. Note that the definition of non-starred
% \!\pcol@com@column! has \!\relax! after the invocatoin of
% \!\pcol@switchenv! so that \!\@ifnextchar! and \!\@ifstar! to examine the
% existence of `|[|' and `|*|' definitely tells us no even if the body of the
% environment starts with a `|[|' or `|*|'.
%
% \begin{macrocode}
\def\pcol@defcolumn{%
\gdef\pcol@com@column{\pcol@switchenv{column}\relax}%
\global\@namedef{pcol@com@column*}{\pcol@switchenv{column*}*}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \KeepSpace{10}
% \begin{macro}{\nthcolumn}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@nthcolumn} for localization.}
% \begin{macro}{\nthcolumn*}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@nthcolumn*} for localization.}
% \begin{macro}{\pcol@com@nthcolumn}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{nthcolumn} with the
% inhibition of column-switching in the environment.}
% \begin{macro}{\pcol@com@nthcolumn*}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{nthcolumn*} with the
% inhibition of column-switching in the environment.}
% \begin{macro}{\leftcolumn}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@leftcolumn} for localization.}
% \begin{macro}{\leftcolumn*}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@leftcolumn*} for localization.}
% \begin{macro}{\pcol@com@leftcolumn}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{leftcolumn} with the
% inhibition of column-switching in the environment.}
% \begin{macro}{\pcol@com@leftcolumn*}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{leftcolumn*} with the
% inhibition of column-switching in the environment.}
% \begin{macro}{\rightcolumn}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@rightcolumn} for localization.}
% \begin{macro}{\rightcolumn*}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@rightcolumn*} for localization.}
% \begin{macro}{\pcol@com@rightcolumn}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{rightcolumn} with the
% inhibition of column-switching in the environment.}
% \begin{macro}{\pcol@com@rightcolumn*}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{rightcolumn*} with the
% inhibition of column-switching in the environment.}
%
% The macros $\!\pcol@com@nthcolumn!(|*|)\arg{d}$,
% \!\pcol@com@leftcolumn!(|*|) and |\pcol@com@right|\~|column|(|*|) are the
% implementations of \elocal{} API macros \!\nthcolumn!(|*|)$\arg{d}$,
% \!\leftcolumn!(|*|) and \!\rightcolumn!(|*|) respectively. They start
% corresponding environments |nthcolumn|(|*|), |leftcolumn|(|*|), and
% |rightcolumn|(|*|)
%
% \Midx{\EnvIndex{nthcolumn}}\Midx{\EnvIndex{nthcolumn*}}
% \Midx{\EnvIndex{leftcolumn}}\Midx{\EnvIndex{leftcolumn*}}
% \Midx{\EnvIndex{rightcolumn}}\Midx{\EnvIndex{rightcolumn*}}
%
% simply invoking \!\pcol@switchenv!$\Arg{env}$\~(|*|), where $\arg{env}$ is
% the name of each environment, giving it $d$, 0 and 1 repectively as its
% optional argument for the target column.
%
% \begin{macrocode}
\def\pcol@com@nthcolumn#1{\pcol@switchenv{nthcolumn}[#1]\relax}
\@namedef{pcol@com@nthcolumn*}#1{\pcol@switchenv{nthcolumn*}[#1]*}
\def\pcol@com@leftcolumn{\pcol@switchenv{leftcolumn}[0]\relax}
\@namedef{pcol@com@leftcolumn*}{\pcol@switchenv{leftcolumn*}[0]*}
\def\pcol@com@rightcolumn{\pcol@switchenv{rightcolumn}[1]\relax}
\@namedef{pcol@com@rightcolumn*}{\pcol@switchenv{rightcolumn*}[1]*}
% \end{macrocode}
% \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{macro}{\pcol@switchenv}
% \changes{v1.0}{2011/10/10}
% {Introduced to inhibit column-switching in the environment.}
% \changes{v1.31}{2013/10/10}
% {Fix the misspell ``swicthing'' in the error message.}
%
% The macro $\!\pcol@switchenv!\arg{env}$ is invoked from
% $|\pcol@com@|{\cdot}\arg{env}$ where $\arg{env}\in
% \{\env{column}\~(|*|),\env{nthcolumn}(|*|),\env{leftcolumn}(|*|),
% \env{rightcolumn}(|*|)\}$ to invoke \!\switchcolumn! with the arguments
% following $\arg{env}$ given by the invoker macros. Before invoking
% \!\switchcolumn!, we save it in \!\reserved@a! for the invocation and
% re\!\def!ine it so that it will complain the illegal usage of \cswitch{}
% commands\slash environments in the environment $\arg{env}$ by
% \!\PackageError!.
%
% \begin{macrocode}
\def\pcol@switchenv#1{\let\reserved@a\switchcolumn
\def\switchcolumn{\PackageError{paracol}{%
Column switching commands and environments cannot be used in #1}\@eha}
\reserved@a}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{14}
% \begin{macro}{\endcolumn}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@endcolumn} for localization.}
% \begin{macro}{\endcolumn*}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@endcolumn*} for localization.}
% \begin{macro}{\pcol@com@endcolumn}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{endcolumn} with the
% globalizatoin of \cs{everypar}.}
% \begin{macro}{\pcol@com@endcolumn*}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{endcolumn*} with the
% globalizatoin of \cs{everypar}.}
% \begin{macro}{\endnthcolumn}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@endnthcolumn} for localization.}
% \begin{macro}{\endnthcolumn*}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@endnthcolumn*} for
% localization.}
% \begin{macro}{\pcol@com@endnthcolumn}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{endnthcolumn} with the
% globalizatoin of \cs{everypar}.}
% \begin{macro}{\pcol@com@endnthcolumn*}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{endnthcolumn*} with the
% globalizatoin of \cs{everypar}.}
% \begin{macro}{\endleftcolumn}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@endleftcolumn} for
% localization.}
% \begin{macro}{\endleftcolumn*}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@endleftcolumn*} for
% localization.}
% \begin{macro}{\pcol@com@endleftcolumn}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{endleftcolumn} with the
% globalizatoin of \cs{everypar}.}
% \begin{macro}{\pcol@com@endleftcolumn*}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{endleftcolumn*} with the
% globalizatoin of \cs{everypar}.}
% \begin{macro}{\endrightcolumn}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@endrightcolumn} for
% localization.}
% \begin{macro}{\endrightcolumn*}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@endrightcolumn*} for
% localization.}
% \begin{macro}{\pcol@com@endrightcolumn}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{endrightcolumn} with the
% globalizatoin of \cs{everypar}.}
% \begin{macro}{\pcol@com@endrightcolumn*}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{endrightcolumn*} with the
% globalizatoin of \cs{everypar}.}
%
% The macro \!\pcol@com@endcolumn! is the implementation of the \elocal{}
% API macro \!\endcolumn! to close \env{column} environment. The macro
% makes it sure we are in vertical mode by \!\pcol@par! and \!\global!ize
% \!\everypar! so that it is saved in $\cc_c(\ep)$ of the current column
% $c$ on the switch to another column. The macro also gives the commmon
% definition of \!\pcol@com@endcolumn*! for \!\endcolumn*!,
% \!\pcol@com@endnthcolumn!(|*|) for \!\endnthcolumn!(|*|),
% \!\pcol@com@endleftcolumn!(|*|) for \!\endleftcolumn!(|*|), and
% \!\pcol@com@endrightcolumn!(|*|) for \!\endrightcolumn!(|*|).
%
% \begin{macrocode}
\def\pcol@com@endcolumn{\pcol@par
\expandafter\global\expandafter\everypar\expandafter{\the\everypar}}
\expandafter\let\csname pcol@com@endcolumn*\endcsname\pcol@com@endcolumn
\let\pcol@com@endnthcolumn\pcol@com@endcolumn
\expandafter\let\csname pcol@com@endnthcolumn*\endcsname\pcol@com@endcolumn
\let\pcol@com@endleftcolumn\pcol@com@endcolumn
\expandafter\let\csname pcol@com@endleftcolumn*\endcsname\pcol@com@endcolumn
\let\pcol@com@endrightcolumn\pcol@com@endcolumn
\expandafter\let\csname pcol@com@endrightcolumn*\endcsname\pcol@com@endcolumn
% \end{macrocode}
% \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{macro}{\definecolumnpreamble}
% \changes{v1.35-5}{2018/12/31}
% {Introduced to define a column preamble.}
%
% The API macro \!\definecolumnpreamble!\marg{c}\marg{pream} is to define
% the \colpream{} $\arg{pream}$ for the column $c$ or that for \sptext{}s if
% $c=-1$. After assiging $c$ to \!\@tempcnta! to ensure $c$ is a number,
% the macro $|\pcol@colpream|{\cdot}c$ is |\def|ined to have $\arg{pream}$.
%
% \SpecialArrayMainIndex{c}{\pcol@colpream}
%
% \begin{macrocode}
\def\definecolumnpreamble#1#2{\@tempcnta#1\relax
\expandafter\gdef\csname pcol@colpream\number\@tempcnta\endcsname{#2}}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\ensurevspace}
% \changes{v1.3-5}{2013/09/17}
% {Introduced to declare the minimum space $V_E$ below a
% synchronization point to let it stay in a page.}
% \begin{macro}{\pcol@ensurevspace}
% \changes{v1.3-5}{2013/09/17}
% {Introduced to keep $V_E$ declared by \cs{ensurevspace}.}
% \begin{macro}{\pcol@@ensurevspace}
% \changes{v1.3-5}{2013/09/17}
% {Introduced to pass $V_E$ declared by \cs{ensurevspace} to
% \cs{output} routine.}
%
% The API macro $\!\ensurevspace!\ARg{space}$ is to declare that the
% \sync{}ation point following it must be thrown to the next page unless the
% page has the vertical $\arg{space}$ below the \sync{}ation point. The
% macro makes a dummy assignment of $\arg{space}$ to \!\@tempdima! to ensure
% the argument is a dimension including forced one, or in other words to
% raise an error if not in this macro rather than at the time $\arg{space}$
% is {\em evaluated} in \!\pcol@switchcol!. Then $\arg{space}$ is kept in
% \!\pcol@ensurevspace! so that $\arg{space}$ is evaluated in
% \!\pcol@switchcol! for the \sync{}ation in question to pass the value to
% \!\pcol@sync! through the macro $\!\pcol@@ensurevspace!=\Uidx\VE$,
% especially when it has register references, for example to
% \!\baselineskip!. To give the default of \!\pcol@ensurevspace!, we invoke
% \!\ensurevspace! at the top level with \!\baselineskip!.
%
% \begin{macrocode}
\def\ensurevspace#1{{\@tempdima#1\relax \gdef\pcol@ensurevspace{#1}}}
\ensurevspace{\baselineskip}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
%
%
% \section{Disabling \cs{addcontentsline}}
% \label{sec:imp-aconly}
%
% \begin{macro}{\addcontentsonly}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
% \begin{macro}{\pcol@aconly}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
%
% The API macro $\!\addcontentsonly!\arg{t}\arg{c}$ makes the type $t$
% contents file written by commands appearing only in the column $c$. The
% macro simply add the pair $\<t,c\>$ to the list $\Uidx\T=\!\pcol@aconly!$
% being empty at initial, after confirming we know the type $t$, one of
% |toc|, |lof| and |lot| so far, by the fact $|\pcol@ac@def|{\cdot}t$ is
% defined, or abort execution by \!\PackageError!.
%
% \begin{macrocode}
%% Disabling \addcontentsline
\def\addcontentsonly#1#2{%
\@ifundefined{pcol@ac@def@#1}
{\PackageError{paracol}{Unknown contents type #1}\@eha}\relax
\@cons\pcol@aconly{{#1}{#2}}}
\gdef\pcol@aconly{}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@aconlyelt}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
%
% The macro $\!\pcol@aconlyelt!\arg{t_d}\arg{d}$ is invoked solely in
% \!\pcol@switchcol! for the \cswitch{} to column $c$, and is applied to
% each $\<t_d,d\>\in\T$ to enable \!\addcontentsline! for $t_d$ if $d=c$ by
% the invocation of $|\pcol@ac@def@|{\cdot}t_d$
%
% \SpecialArrayMainIndex{t}{\pcol@ac@def@}
%
% with an argument |enable|, or to disable if $d\neq c$ with |disable|.
%
% \begin{macrocode}
\def\pcol@aconlyelt#1#2{%
\ifnum#2=\pcol@currcol \@nameuse{pcol@ac@def@#1}{enable}%
\else \@nameuse{pcol@ac@def@#1}{disable}%
\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pcol@gobblethree}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
% \begin{macro}{\pcol@addcontentsline}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
%
% \hfuzz0.39pt
% The macro $\!\pcol@gobblethree!\arg{file}\arg{sec}\arg{entry}$ is used in
% \!\pcol@ac@disable@toc! and \!\pcol@ac@caption! to make
% \!\addcontentsline! \!\let!-equal to this macro, which does nothing but
% discarding three arguments, for disabling. The macro
% \!\pcol@addcontentsline! is the \LaTeX's original \!\addcontentsline! and
% is used in the macros mentioned above to let \!\addcontentsline! act as
% original.
%
% \begin{macrocode}
\def\pcol@gobblethree#1#2#3{}
\let\pcol@addcontentsline\addcontentsline
% \end{macrocode}
% \end{macro}\end{macro}
%
% \KeepSpace{1}
% \begin{macro}{\pcol@ac@def@toc}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
% \begin{macro}{\pcol@ac@enable@toc}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
% \begin{macro}{\pcol@ac@disable@toc}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
%
% The macro $\!\pcol@ac@def@toc!\arg{eord}$ is invoked solely in
% $\!\pcol@aconlyelt!|{toc}|\arg{c}$ to enable or disable
% \!\addcontentsline! according to $\arg{eord}$ by making \!\@sect!
% \!\let!-equal to \!\pcol@ac@enable@toc! which is the \LaTeX's original
% \!\@sect!, or to \!\pcol@ac@disable@toc! respectively. The macro
% $\!\pcol@ac@disable@toc!
% \<a_1\>\<a_2\>\<a_3\>\<a_4\>\<a_5\>\<a_6\>|[|\<a_7\>|]|\<a_8\>$ at first
% disables \!\addcontentsline! by making it \!\let!-equal to
% \!\pcol@gobblethree!, then invokes the original \!\@sect! saved in
% \!\pcol@ac@enable@toc! ginving it all arguments $a_1$ to $a_8$, and
% finally enables it by making it \!\let!-equal to \!\pcol@addcontentsline!.
% Note that the argument $a_7$ is surrounded by |{| and |}| on the
% invocation of \!\@sect! to conceal `|]|' in $a_7$.
%
% \begin{macrocode}
\def\pcol@ac@def@toc#1{%
\expandafter\let\expandafter\@sect\csname pcol@ac@#1@toc\endcsname}
\let\pcol@ac@enable@toc\@sect
\def\pcol@ac@disable@toc#1#2#3#4#5#6[#7]#8{%
\let\addcontentsline\pcol@gobblethree
\pcol@ac@enable@toc{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}%
\let\addcontentsline\pcol@addcontentsline}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \KeepSpace{5}
% \begin{macro}{\pcol@ac@def@lof}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
% \begin{macro}{\pcol@ac@def@lot}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
% \begin{macro}{\pcol@ac@caption@enable}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
% \begin{macro}{\pcol@ac@caption@disable}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
% \begin{macro}{\pcol@ac@caption@def}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
% \begin{macro}{\pcol@ac@caption@if@lof}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
% \begin{macro}{\pcol@ac@caption@if@lot}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
%
% The macro $\!\pcol@ac@def@lof!\arg{eord}$ and
% $\!\pcol@ac@def@lot!\arg{eord}$ are invoked solely in
% $\!\pcol@aconlyelt!\<t\>\<c\>$ when $t$ is |lof| or |lot|
% respectively. They invoke \!\pcol@ac@caption@enable!$\<t\>$ or
% $\!\pcol@ac@caption@disable!\<t\>$ according to $\arg{eord}$, and then
% these macros invoke $\!\pcol@ac@caption@def!\<s\>\<t\>$ where
% $s=\!\@tempswatrue!$ or $s=\!\@tempswafalse!$ respectievely to let
% $\!\@caption!=\!\pcol@ac@caption!$ and $|\pcol@ac@caption@if@|{\cdot}t=s$
% which are \!\let!-equal to \!\@tempswatrue! in default. That is,
% $|\pcol@ac@catption@if@|{\cdot}t$ lets $\CSIndex{if@tempswa}={}\true$ iff
% \!\addcontentsline! for $t$ is to be enable.
%
% \begin{macrocode}
\def\pcol@ac@def@lof#1{\@nameuse{pcol@ac@caption@#1}{lof}}
\def\pcol@ac@def@lot#1{\@nameuse{pcol@ac@caption@#1}{lot}}
\def\pcol@ac@caption@enable{\pcol@ac@caption@def\@tempswatrue}
\def\pcol@ac@caption@disable{\pcol@ac@caption@def\@tempswafalse}
\def\pcol@ac@caption@def#1#2{\let\@caption\pcol@ac@caption
\expandafter\let\csname pcol@ac@caption@if@#2\endcsname#1}
\let\pcol@ac@caption@if@lof\@tempswatrue
\let\pcol@ac@caption@if@lot\@tempswatrue
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@ac@caption}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
% \begin{macro}{\pcol@ac@caption@latex}
% \changes{v1.0}{2011/10/10}
% {Introduced for disabling \cs{addcontentsline}.}
%
% The macro $\!\pcol@ac@caption!\arg{type}|[|\arg{lcap}|]|\<cap\>$ is made
% \!\let!-equal to \!\@caption! by \!\pcol@ac@caption@def! to do what
% \!\@caption! do but with enabling\slash disabling \!\addcontentsline!. At
% first, it invokes $|\pcol@ac@cation@if@|{\cdot}t$ where
% $t=|\ext@|{\cdot}\arg{type}$
%
% \SpecialIndex{\ext@figure}\SpecialIndex{\ext@table}
%
% to let \CSIndex{if@tempswa} be $\true$ or $\false$ according to the
% enable\slash disable status of $t$. Then, after letting
% $\!\addcontentsline!=\!\pcol@gobblethree!$ for disabling if $\false$, we
% invoke \!\pcol@ac@caption@latex!, being the \LaTeX's orignial \!\@caption!,
% giving all three arguments of \!\pcol@ac@caption! itself surrounding
% $\arg{lcap}$ with |{| and |}| for the concealment of `|]|'. Finally, we
% let $\!\addcontentsline!=\!\pcol@addcontentsline!$ so that other macros
% uses it with its original definition.
%
% \begin{macrocode}
\long\def\pcol@ac@caption#1[#2]#3{%
\@nameuse{pcol@ac@caption@if@\@nameuse{ext@#1}}%
\if@tempswa\else \let\addcontentsline\pcol@gobblethree \fi
\pcol@ac@caption@latex{#1}[{#2}]{#3}%
\let\addcontentsline\pcol@addcontentsline}
\let\pcol@ac@caption@latex\@caption
% \end{macrocode}
% \end{macro}\end{macro}
%
%
%
% \KeepSpace{7}
% \section{Page Flushing Commands}
% \label{sec:imp-flush}
%
% \begin{macro}{\flushpage}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@flushpage} for
% localization.}
% \begin{macro}{\pcol@com@flushpage}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{flushpage} with the
% replacement of \cs{par} with \cs{pcol@par}.}
% \begin{macro}{\clearpage}
% \changes{v1.0}{2011/10/10}
% {Made \cs{let}-equal to \cs{pcol@com@clearpage} for
% localization.}
% \begin{macro}{\pcol@com@clearpage}
% \changes{v1.0}{2011/10/10}
% {Introduced as the implemenatation of \cs{clearpage} with the
% replacement of \cs{par} with \cs{pcol@par}.}
% \begin{macro}{\cleardoublepage}
% \changes{v1.3-5}{2013/09/17}
% {Added as a member of local commands and made \cs{let}-equal to
% \cs{pcol@com@cleardoublepage}.}
% \begin{macro}{\pcol@com@cleardoublepage}
% \changes{v1.3-5}{2013/09/17}
% {Introduced as the implemenatation of \cs{cleardoulbepage}.}
%
% The macros \!\pcol@com@flushpage!, \!\pcol@com@clearpage! and
% \!\pcol@com@cleardoublepage! are the implementations of \elocal{} API
% macro \!\flushpage!, \!\clearpage! and \!\cleardoublepage! respectively.
% The first two have a common structure in which we at first invoke
% \!\pcol@flushclear! for \cscan{} and \pfcheck, and then make an \!\output!
% request by \!\pcol@invokeoutput! with \!\penalty! being \!\pcol@op@flush!
% or \!\pcol@op@clear! according to the commands. On the other hand the
% last one simply invokes \!\pcol@com@clearpage! unconditionally, and then
% \!\pcol@com@flushpage!\footnote{
%
% Unlike \LaTeX's \!\cleardoublepage!, it is unnecessary to put an empty
% \!\hbox! before \!\flushpage! because it is active even at the top of a
% page.}
%
% if two-sided paging is enabled by $\CSIndex{if@twoside}=\true$, we are
% in an even-numbered page, and $\CSIndex{ifpcol@paired}=\false$ to mean we
% are not doing \npaired{} \parapag{}ing.
%
% \begin{macrocode}
%% Page Flushing Commands
\def\pcol@com@flushpage{\pcol@flushclear\voidb@x
\pcol@invokeoutput\pcol@op@flush}
\def\pcol@com@clearpage{\pcol@flushclear\voidb@x
\pcol@invokeoutput\pcol@op@clear}
\def\pcol@com@cleardoublepage{\pcol@com@clearpage
\if@twoside \ifodd\c@page\else \ifpcol@paired\else \pcol@com@flushpage
\fi\fi\fi}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@flushclear}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for column-scanning in synchronized column-switching and
% page flushing.}
%
% The macro $\!\pcol@flushclear!\arg{box}$, invoked from
% \!\pcol@com@flushpage!, \!\pcol@com@clear~page! and \!\endparacol!,
% performs \cscan{} and \pfcheck{} prior to page flushing or environment
% closing. After confirming we are in vertical mode by \!\pcol@par! and
% letting $d=\!\pcol@nextcol!$ be $c=\!\pcol@currcol!$ to stay in $c$, we
% invoke \!\pcol@visitallcols! for \cscan{} to give \TeX's page builder the
% chance to break the \tpage{} prior to flushing it.
%
% Then we repeat \pfcheck{} invoking \!\pcol@output@switch! through
% \!\pcol@invokeoutput! with $\!\penalty!=\!\pcol@op@switch!$ and
% $\CSIndex{ifpcol@clear}=|\ifpcol@|\~|sync|=\true$
%
% \SpecialIndex{\ifpcol@sync}
%
% until the special \!\output! routine finishes with
% $\CSIndex{ifpcol@flush}=\false$ and $\arg{box}=\bot$, where
% $\arg{box}=\df=\!\pcol@topfnotes!$ if this macro is invoked from
% \!\endparacol! with non-merged \Scfnote{} typesetting. In the repetition,
% we put \!\vfil! and \!\penalty!|-10000| to force page break into the
% tallest column, temporarily turning $\CSIndex{ifpcol@lastpage}=\false$
% using \!\ifpcol@lastpagesave! because the broken page is not last one,
% each time the \pfcheck{} tells us to do it. That is, we repeat the check
% while we have too tall columns due to \Scfnote{}s or, when closing
% \env{paracol} environment, deferred non-merged \Scfnote{}s.
%
% Finally we let $\CSIndex{ifpcol@clear}$ have its default setting, i.e.,
% $\false$.
%
% \begin{macrocode}
\def\pcol@flushclear#1{\pcol@par
\pcol@nextcol\pcol@currcol
\pcol@visitallcols\@@par
\pcol@cleartrue \global\pcol@synctrue
\ifpcol@lastpage \pcol@lastpagesavetrue \else \pcol@lastpagesavefalse \fi
\pcol@invokeoutput\pcol@op@switch \ifvoid#1\else \global\pcol@flushtrue \fi
\@whilesw\ifpcol@flush\fi{%
\pcol@lastpagefalse
\vfil \penalty-\@M \pcol@cleartrue \global\pcol@synctrue
\ifpcol@lastpagesave \pcol@lastpagetrue \fi
\pcol@invokeoutput\pcol@op@switch
\ifvoid#1\else \global\pcol@flushtrue \fi}%
\pcol@clearfalse}
% \end{macrocode}
% \end{macro}
%
%
%
%
% \KeepSpace{8}
% \section{Commands for Footnotes}
% \label{sec:imp-fnote}
% \changes{v1.2-2}{2013/05/11}
% {Add the subsection ``Commands for Footnotes'' to describe newly
% introduced macros for page-wise footnotes.}
%
% \begin{macro}{\footnotelayout}
% \changes{v1.3-5}{2013/09/17}
% {Introduced for easier declaration of footnote layout.}
% \begin{macro}{\pcol@fnlayout@c}
% \changes{v1.3-5}{2013/09/17}
% {Introduced for easier declaration of column-wise footnotes.}
% \begin{macro}{\pcol@fnlayout@p}
% \changes{v1.3-5}{2013/09/17}
% {Introduced for easier declaration of page-wise footnotes.}
% \begin{macro}{\pcol@fnlayout@m}
% \changes{v1.3-5}{2013/09/17}
% {Introduced for easier declaration of merged footnotes.}
% \begin{macro}{\multicolumnfootnotes}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to delclare the defalut column-wise footnote
% typesetting explicitly.}
% \begin{macro}{\singlecolumnfootnotes}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to delclare the page-wise but non-merged footnote
% typesetting.}
% \begin{macro}{\mergedfootnotes}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to delclare the page-wise and merged footnote
% typesetting.}
%
% The API macros $\!\footnotelayout!\Arg{l}$ is to determine that footnotes
% are \mcfnote{} ($l=|c|$), \scfnote{} without merging ($l=|p|$), or
% \mgfnote{} and \scfnote{} ($l=m$). The macro examines if
% $l\in\{|c|,|p|,|m|\}$ by the existence of the corresponding macro
% $|\pcol@fnlayout@|{\cdot}l$
%
% \SpecialArrayIndex{l}{\pcol@fnlayout@}
%
% and invokes it, or complains if not by \!\PackageError!.
%
% The macros \!\pcol@fnlayout@c!, \!\pcol@fnlayout@p! and
% \!\pcol@fnlayout@m! turn switches $f_s=\CSIndex{ifpcol@scfnote}$,
% $f_m=\CSIndex{ifpcol@mgfnote}$ and
% $f_a=\CSIndex{ifpcol@fncounteradjustment}$ and make the counter
% \counter{footnote} global or local as follows.
% $$
% \nosv\begin{array}{l|llll}
% l&f_s&f_m&f_a&\counter{footnote}\\\hline
% \verb|c|&\false&\false&\false&\hbox{local}\\
% \verb|p|&\true&\false&\true&\hbox{global}\\
% \verb|m|&\true&\true&\true&\hbox{global}
% \end{array}
% $$
% Note that turning \CSIndex{ifpcol@fncounteradjustment} is done by
% \!\fncounteradjustment! ($\true$) or \!\nofncounteradjustment! ($\false$).
% Also note that the setting of |\ifpcol@fncounter|\~|adjustment|
%
% \SpecialIndex{\ifpcol@fncounteradjustment}
%
% and the globalization\slash localization of \counter{footnote} are just to
% give defaults and thus can be overridden by API macros giving non-default
% settings. Another remark is that backward-compatible macros
% \!\multicolumnfootnotes!, \!\singlecolumnfootnotes! and
% \!\mergedfootnotes! are \!\let!-equal to \!\pcol@fnlayout@c!,
% \!\pcol@fnlayout@p! and \!\pcol@fnlayout@m! respectively.
%
% \begin{macrocode}
%% Commands for Footnotes
\def\footnotelayout#1{\@ifundefined{pcol@fnlayout@#1}%
{\PackageError{paracol}{Unknown footnote layout specifier #1}}%
{\@nameuse{pcol@fnlayout@#1}}}
\def\pcol@fnlayout@c{\global\pcol@scfnotefalse \global\pcol@mgfnotefalse
\localcounter{footnote}\nofncounteradjustment}
\def\pcol@fnlayout@p{\global\pcol@scfnotetrue \global\pcol@mgfnotefalse
\globalcounter{footnote}\fncounteradjustment}
\def\pcol@fnlayout@m{\pcol@fnlayout@p\global\pcol@mgfnotetrue}
\let\multicolumnfootnotes\pcol@fnlayout@c
\let\singlecolumnfootnotes\pcol@fnlayout@p
\let\mergedfootnotes\pcol@fnlayout@m
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \KeepSpace{2}
% \begin{macro}{\@footnotetext}
% \begin{macro}{\pcol@fntext}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for footnote encapsulation and deferring.}
% \begin{macro}{\pcol@fntexttop}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for footnote encapsulation.}
% \begin{macro}{\pcol@fntextother}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for footnote encapsulation and deferring.}
%
% The macro \!\pcol@fntext!\marg{text} is our own version of \LaTeX's
% \!\@footnotetext! used in \!\footnote! and \!\footnotetext! to \!\insert!
% the footnote $\arg{text}$ through \!\footins!. Since the original and our
% own are made \!\let!-equal by \!\pcol@zparacol!, our own is active
% throughout the environment. The customization is done to examine if the
% footnote should be deferred and to encapsulate the footnote in a \!\vbox!.
%
% The deferred footnote insertion is in effect if the footnote typesetting
% is \scfnote{} and \!\footnote! or \!\footnotetext! appears in a page
% $p<\ptop$. If so, we put the footnote $\arg{text}$ encapsulated in a
% \!\vbox! by \!\pcol@fntextbody! to the tail of $\df=\!\pcol@topfnotes!$
% with \!\penalty!\!\interlinepenalty! preceding it for the split in
% \!\pcol@deferredfootins!, using \!\pcol@fntextother!\marg{text} whose sole
% user is this macro. Note that the decision of deferring is done based on
% $p=\!\pcol@page!$ which could be less than that of the page in which the
% footnoted text appears because the paragraph having the text will have a
% page break before the text. Therefore, $p$ for the footnote can be
% $\ptop$, but this misjudment will not cause problems because the footnote
% will eventually be put in $\ptop$ through $\df$ when the page break
% occurs.
%
% Otherwise the footnote $\arg{text}$ is processed by
% \!\pcol@fntexttop!\marg{text}, also used solely in this macro, to
% \!\insert! it through \!\footins! as usual but after the encapsulation by
% \!\pcol@fntextbody! and with \!\penalty!\!\interlinepenalty! following it
% to allow \TeX's page builder to split footnotes.
%
% Note that \!\pcol@fntexttop! and \!\pcol@fntextother! have \!\long!
% property because $\arg{text}$ may have two or more paragraphs.
%
% \begin{macrocode}
\def\pcol@fntext{%
\let\reserved@a\pcol@fntexttop
\ifpcol@scfnote \ifnum\pcol@page<\pcol@toppage
\let\reserved@a\pcol@fntextother
\fi\fi
\reserved@a}
\long\def\pcol@fntexttop#1{%
\pcol@Logfn{\pcol@fntexttop{\@thefnmark}}%
\insert\footins{\pcol@fntextbody{#1}\penalty\interlinepenalty}}
\long\def\pcol@fntextother#1{%
\global\setbox\pcol@topfnotes\vbox{\unvbox\pcol@topfnotes
\penalty\interlinepenalty\pcol@fntextbody{#1}}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@fntextbody}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for footnote encapsulation and height capping.}
%
% The macro \!\pcol@fntextbody!\marg{text}, invoked from \!\pcol@fntexttop!
% and \!\pcol@fntext~other!, encapsulates the footnote $\arg{text}$ in a
% \!\vbox! whose height is $h_{\max}=\!\textheight!-\!\skip!\~\!\footins!$ at
% tallest. The encapsulation is to inhibit page breaks in a footnote
% because the split by the break will make some skips and other items
% eliminated causing a weird result when split portions are {\em joined}.
% The height capping is thus required to find a page in which the footnote
% resides.
%
% The macro at first does operations done in \LaTeX's
% \!\@footnotetext! to put $\arg{text}$ in \!\@tempboxa! but with one
% exception that $\!\hsize!=\!\textwidth!$ rather than \!\columnwidth! when
% \Scfnote{} typesetting is in effect. Note that this part is blindly copied
% from the original though it should be meaningless to set
% \!\interlinepenalty!, \!\splittopskip!, \!\splitmaxdepth! and
% \!\floatingpenalty! because $\arg{text}$ is encapsulated.
%
% Then the height-plus-depth of the box is compared with $h_{\max}$ and, if
% it exceeds the limit, the height of the box is set $h_{\max}$, the
% footnote is made followed by a \!\vss! to avoid overfull, and a warning
% message of too tall is put by \!\PackageWarning!. Finally, the box is put
% into \!\footins! or $\df$ by the invoker of this macro.
%
% \begin{macrocode}
\long\def\pcol@fntextbody#1{\setbox\@tempboxa\vbox{%
\reset@font\footnotesize
\interlinepenalty\interfootnotelinepenalty
\splittopskip\footnotesep
\splitmaxdepth\dp\strutbox \floatingpenalty\@MM
\hsize \ifpcol@scfnote \textwidth \else \columnwidth \fi
\@parboxrestore
\protected@edef\@currentlabel{\p@footnote\@thefnmark}%
\color@begingroup
\@makefntext{%
\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
\color@endgroup}%
\@tempdima\ht\@tempboxa \advance\@tempdima\dp\@tempboxa
\@tempdimb\textheight \advance\@tempdimb-\skip\footins
\ifdim\@tempdima>\@tempdimb
\setbox\@tempboxa\vbox to\@tempdimb{\unvbox\@tempboxa\vss}%
\PackageWarning{paracol}{Too tall footnote}%
\fi
\box\@tempboxa}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\fncounteradjustment}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to make \string\texttt{footnote} counter is consistent
% with its origin at the beginning of \string\texttt{paracol} and the
% number of footnotes given in the environment at its end.}
% \begin{macro}{\nofncounteradjustment}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to disable the footnote counter adjustment.}
%
% The API macros \!\fncounteradjustment! and \!\nofncounteradjustment! turns
% |\ifpcol@|\~|fncounteradjustment|
%
% \SpecialIndex{\ifpcol@fncounteradjustment}
%
% $\true$ or $\false$, to enable or disable the \counter{footnote} counter
% adjustment letting $\!\c@footnote!=\bf+\nf$ in \Endparacol, respectively.
% After the definition we disable the adjustment to give the default setting.
%
% \begin{macrocode}
\def\fncounteradjustment{\global\pcol@fncounteradjustmenttrue}
\def\nofncounteradjustment{\global\pcol@fncounteradjustmentfalse}
\nofncounteradjustment
% \end{macrocode}
% \end{macro}\end{macro}
%
% \KeepSpace{2}
% \begin{macro}{\pcol@footnoterule}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to keep the original definition of \cs{footnoterule}.}
% \begin{macro}{\pcol@@footnote}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to keep the original definition of \cs{footnote}.}
% \begin{macro}{\pcol@@footnotemark}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to keep the original definition of \cs{footnotemark}.}
% \begin{macro}{\pcol@@footnotetext}
% \changes{v1.2-2}{2013/05/11}
% {Introduced to keep the original definition of \cs{footnotetext}.}
%
% The macros \!\pcol@footnoterule!, \!\pcol@@footnote!,
% \!\pcol@@footnotemark! and \!\pcol@@footnotetext! are to keep the original
% defitions of \!\footnoterule!, \!\footnote!, \!\footnotemark! and
% \!\footnotetext! in them, respectively, so that we define our own versions
% with references to the originals.
%
% \begin{macrocode}
\let\pcol@footnoterule\footnoterule
\let\pcol@@footnote\footnote
\let\pcol@@footnotemark\footnotemark
\let\pcol@@footnotetext\footnotetext
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \KeepSpace{4}
% \begin{macro}{\footnote}
% \begin{macro}{\pcol@footnote}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for \cs{footnote*} and footnote counter adjustment.}
% \begin{macro}{\pcol@ifootnote}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for \cs{footnote*} and footnote counter adjustment.}
% \begin{macro}{\footnotemark}
% \begin{macro}{\pcol@footnotemark}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for \cs{footnotemark*} and footnote counter adjustment.}
% \begin{macro}{\pcol@ifootnotemark}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for \cs{footnotemark*} and footnote counter adjustment.}
%
% The macros \!\pcol@footnote! and \!\pcol@footnotemark! are the
% implementations of our own versions of \!\footnote! and \!\footnotemark!
% which are made \!\let!-equal to them by \!\pcol@zparacol!, respectively.
% The reasons why we need to have our own are two-fold; to have starred
% version of them; and to maintain $\nf=\!\pcol@nfootnotes!$ for the
% \counter{footnote} counter adjustment.
%
% The implementations of the starred versions
% \!\footnote!|*|\oarg{num}\marg{text} and
% \!\footnotemark!|*|\~\oarg{num} have common structure in which we invoke
% \!\pcol@adjustfnctr!$\arg{macro}$\oarg{num} if `|*|' is given, to let
% \!\c@footnote! have the number relative to $\bf=\!\pcol@footnotebase!$ or
% to itself. Then the macros \!\pcol@ifootnote! or \!\pcol@ifootnotemark!
% are invoked from \!\pcol@adjustfnctr! or the else-part of \!\@ifstar! to
% perform the operations common to both cases with and without `|*|', i.e.,
% invoking the original version \!\pcol@@footnote! or \!\pcol@@footnotemark!
% after incrementing $\nf$. One caution is that
% $\arg{macro}=\!\pcol@ifootnote!$ for \!\footnote!, but
% $\arg{macro}=|{|\!\pcol@ifootnotemark!\!\relax!|}|$ for \!\footnotemark!
% so that \!\@ifnextchar! in \!\pcol@@footnotemark! invoked from
% \!\pcol@ifootnotemark! eats \!\relax! to terminate space skipping and thus
% spaces following \oarg{num} are kept.
%
% \begin{macrocode}
\def\pcol@footnote{\@ifstar{\pcol@adjustfnctr\pcol@ifootnote}\pcol@ifootnote}
\def\pcol@ifootnote{\global\advance\pcol@nfootnotes\@ne \pcol@@footnote}
\def\pcol@footnotemark{\@ifstar
{\pcol@adjustfnctr{\pcol@ifootnotemark\relax}}%
\pcol@ifootnotemark}
\def\pcol@ifootnotemark{\global\advance\pcol@nfootnotes\@ne
\pcol@@footnotemark}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \KeepSpace{1}
% \begin{macro}{\pcol@adjustfnctr}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for \cs{footnote*} and \cs{footnotemark*}.}
% \begin{macro}{\pcol@iadjustfnctr}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for \cs{footnote*} and \cs{footnotemark*}.}
% \begin{macro}{\pcol@calcfnctr}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for \cs{footnote*}, \cs{footnotemark*} and
% \cs{footnotetext*}.}
%
% The macro \!\pcol@adjustfnctr!$\arg{macro}$\oarg{num}, invoked from the
% then-part of \!\@ifstar! in \!\pcol@footnote! and \!\pcol@footnotemark!,
% calculates the number to be set into \!\c@footnote! by
% \!\pcol@calcfnctr!$\arg{num}$\!\@nil! after processing the optional
% argument $\arg{num}$ by \!\pcol@iadjustfnctr! with default `|+1|', and
% then invoke $\arg{macro}$ being \!\pcol@ifootnote! or
% \!\pcol@ifootnotemark!\!\relax!. Since \!\pcol@calcfnctr! returns the
% number \!\c@footnote! should have and the counter is incremented by
% \!\stepcounter! in \!\pcol@@footnote! or \!\pcol@@footnotemark!, we
% decrement the counter prior to invoke $\arg{macro}$.
%
% The macro \!\pcol@calcfnctr!$\arg{num}$\!\@nil!, also invoked from
% \!\pcol@iifootnotetext!, calculate $m$ specified by $\arg{num}$ as follows,
% where $f=\!\c@footnote!$, to return it through \!\@tempcnta!.
% $$
% m=\cases{f+k&$\arg{num}=|+|k$\cr
% f-k&$\arg{num}=|-|k$\cr
% \bf+k&$\arg{num}=k$}
% $$
%
% \begin{macrocode}
\def\pcol@adjustfnctr#1{\@ifnextchar[%]
{\pcol@iadjustfnctr{#1}}{\pcol@iadjustfnctr{#1}[+1]}}
\def\pcol@iadjustfnctr#1[#2]{\pcol@calcfnctr#2\@nil
\global\c@footnote\@tempcnta \global\advance\c@footnote\m@ne#1}
\def\pcol@calcfnctr#1#2\@nil{\@tempcnta\c@footnote
\def\reserved@a{#1}\def\reserved@b{+}%
\ifx\reserved@a\reserved@b \advance\@tempcnta#2\relax
\else \def\reserved@b{-}%
\ifx\reserved@a\reserved@b \advance\@tempcnta-#2\relax
\else \@tempcnta\pcol@footnotebase \advance\@tempcnta#1#2\relax
\fi\fi}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \KeepSpace{2}
% \begin{macro}{\footnotetext}
% \begin{macro}{\pcol@footnotetext}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for \cs{footnotetext*}.}
% \begin{macro}{\pcol@ifootnotetext}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for \cs{footnotetext*}.}
% \begin{macro}{\pcol@iifootnotetext}
% \changes{v1.2-2}{2013/05/11}
% {Introduced for \cs{footnotetext*}.}
%
% The macros \!\pcol@footnotetext! is the implementation of our own versions
% of \!\footnotetext! which is made \!\let!-equal to it by
% \!\pcol@zparacol!. The reasons why we need to have our own is to have the
% starred version. That is, if `|*|' is not given, we simply invoke the
% original version \!\pcol@@footnotetext!. Otherwise we invoke
% \!\pcol@ifootnotetext! which then examines if the optional argument
% \oarg{num} is presented. If so, we invoke \!\pcol@iifootnotetext! in
% which \!\pcol@calcfnctr!$\arg{num}$\!\@nil! is invoked to have the value
% $m$ being the footnote ordinal with which we invoke
% \!\pcol@@footnotetext!\oarg{\mbox{$m$}} with two \!\expandafter!s to
% extract $m$ from \!\@tempcnta!. Otherwise, i.e., \oarg{num} is not given,
% we increment \!\c@footnote! by \!\stepcounter! before invoking
% \!\pcol@@footnotetext!.
%
% \begin{macrocode}
\def\pcol@footnotetext{\@ifstar\pcol@ifootnotetext\pcol@@footnotetext}
\def\pcol@ifootnotetext{\@ifnextchar[%]
\pcol@iifootnotetext{\stepcounter{footnote}\pcol@@footnotetext}}
\def\pcol@iifootnotetext[#1]{\pcol@calcfnctr#1\@nil
\expandafter\pcol@@footnotetext\expandafter[\number\@tempcnta]}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
%
%
% \KeepSpace{13}
% \section{Commands for Marginal Notes}
% \label{sec:imp-mpar}
% \changes{v1.35-3}{2018/12/31}
% {Add the section ``Commands for Marginal Notes'' to describe newly
% introduced macros for the emulation of \cs{marginnote}.}
%
% \begin{macro}{\marginpar}
% \changes{v1.35-3}{2018/12/31}
% {Locally modified in \cs{pcol@zparacol} for the emulation of
% \cs{marginnote}.}
% \begin{macro}{\pcol@marginpar}
% \changes{v1.35-3}{2018/12/31}
% {Introduced as the in-\texttt{paracol} version of \cs{marginpar} for
% the emulation of \cs{marginnote}.}
% \begin{macro}{\pcol@@marginpar}
% \changes{v1.35-3}{2018/12/31}
% {Introduced to keep the orginal version of \cs{marginpar} for
% the emulation of \cs{marginnote}.}
% \begin{macro}{\@mn@@marginnote}
% \changes{v1.35-3}{2018/12/31}
% {Locally modified in \cs{pcol@zparacol} for the emulation of
% \cs{marginnote}.}
% \begin{macro}{\pcol@marginnote}
% \changes{v1.35-3}{2018/12/31}
% {Introduced as the in-\texttt{paracol} version of
% \cs{@mn@@marginnote} for the emulation of \cs{marginnote}.}
% \begin{macro}{\pcol@mn@warning}
% \changes{v1.35-3}{2018/12/31}
% {Introduced to put a warning message to show \cs{marginnote} is
% emulated.}
% \begin{macro}{\@xympar}
% \changes{v1.35-3}{2018/12/31}
% {Locally modified in \cs{pcol@zparacol} for the emulation of
% \cs{marginnote}.}
% \begin{macro}{\pcol@xympar}
% \changes{v1.35-3}{2018/12/31}
% {Introduced as the in-\texttt{paracol} version of
% \cs{@xympar} for the emulation of \cs{marginnote}.}
% \begin{macro}{\pcol@@xympar}
% \changes{v1.35-3}{2018/12/31}
% {Introduced to keep the orginal version of \cs{@xympar} for the
% emulation of \cs{marginnote}.}
% \begin{macro}{\pcol@mparoffset}
% \changes{v1.35-3}{2018/12/31}
% {Introduced to have the vertical offset for the emulation of
% \cs{marginnote}.}
% The API macro \!\marginnote!\oarg{left}\marg{right}\oarg{voffset} given by
% the package \textsf{marginnote} is emulated using
% \!\marginpar!\oarg{left}\marg{right} and \!\pcol@addmarginpar! in
% \!\output! routine. The basic mechanism is to pass the vertical offset
% $\arg{voffset}$ to \!\pcol@addmarginpar! through $|\dimen|\arg{b}$ where
% $b$ is the \!\insert! to carry $\arg{left}$. The offset passing is
% implemented as follows.
%
% \begin{itemize}
% \item
% \!\marginpar! is made \!\let!-equal to our own version \!\pcol@marginpar!
% in \!\pcol@zparacol! so that it \!\let! the macro \!\pcol@mparoffset! be
% \!\z@! and then invoke \LaTeX's origincal version kept in
% \!\pcol@@marginpar!, because the marginal note given by \!\marginpar! will
% not be shifted.
%
% \item
% The internal macro
% \!\@mn@@marginnote!\oarg{left}\marg{right}\oarg{voffset} defined in
% \textsf{marginnote} is made \!\let!-equal to our own version
% \!\pcol@marginnote! in \!\pcol@zparacol! so that it |\def|ines
% \!\pcol@mparoffset! to have $\arg{voffset}$ and then invoke
% \!\pcol@@marginpar!\oarg{left}\~\marg{right} for the emulation. In the
% invokation, \textsf{marginnote}'s typesetting macros \!\margin~font!,
% \!\raggedleftmarginnote! and \!\raggedrightmarginnote! are attached to
% $\arg{left}$ and $\arg{right}$.
%
% \item
% \LaTeX's internal macro \!\@xympar! for the last operations of
% \!\marginpar! is made \!\let!-equal to our own version in
% \!\pcol@zparacol! so that it assigns the offset in \!\pcol@mparoffset! to
% |\dimen|\!\@marbox! for $\arg{left}$, if $\!\@floatpenalty!<0$ to mean
% other macros for \!\marginpar! have not detected any errors.
% \end{itemize}
%
% In addition, we raise a warning that \!\marginnote! is emulated by
% \!\pcol@mn@warning!, which is made \!\let!-equal to \!\relax! in the caller
% \!\pcol@marginnote! after the invokation so that the warning message is
% put just once.
%
% \begin{macrocode}
%% Commands for Marginal Notes
\def\pcol@marginpar{\let\pcol@mparoffset\z@ \pcol@@marginpar}
\long\def\pcol@marginnote[#1]#2[#3]{\endgroup
\pcol@mn@warning \global\let\pcol@mn@warning\relax
\def\pcol@mparoffset{#3}%
\pcol@@marginpar[\marginfont\raggedleftmarginnote#1]%
{\marginfont\raggedrightmarginnote#2}}
\def\pcol@mn@warning{%
\PackageWarning{paracol}{\string\margninnote\space is emulated by
\string\marginpar.}}
\def\pcol@xympar{%
\ifnum\@floatpenalty<\z@ \global\dimen\@marbox\pcol@mparoffset\relax \fi
\pcol@@xympar}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
%
% \KeepSpace{9}
% \section{Two-Sided Typesetting}
% \label{sec:imp-swap}
% \changes{v1.2-4}{2013/05/11}
% {Add the section ``Column-Swapping'' to describe newly
% introduced macros for column-swapping.}
% \changes{v1.3-5}{2013/09/17}
% {Rename the section title from ``Column-Swapping'' to ``Two-Sided
% Typesetting''.}
%
% \begin{macro}{\twosided}
% \changes{v1.3-5}{2013/09/17}
% {Introduced as an easier API for various two-sided typesetting.}
% \changes{v1.3-3}{2013/09/17}
% {Add two-sided background painting.}
% \changes{v1.3-4}{2013/09/17}
% {Add two-sided marginal note placement.}
% \begin{macro}{\pcol@twosided}
% \changes{v1.3-5}{2013/09/17}
% {Introduced to implement \cs{twosided}.}
% \changes{v1.31}{2013/10/10}
% {Fix spelling ``twosiding'' replacing it with ``two-siding'' in the
% error message.}
% \begin{macro}{\pcol@twosided@p}
% \changes{v1.3-5}{2013/09/17}
% {Introduced to implement \cs{twosided} with \string\texttt{[p]}.}
% \begin{macro}{\pcol@twosided@c}
% \changes{v1.3-5}{2013/09/17}
% {Introduced to implement \cs{twosided} with \string\texttt{[c]}.}
% \begin{macro}{\pcol@twosided@m}
% \changes{v1.3-5}{2013/09/17}
% {Introduced to implement \cs{twosided} with \string\texttt{[m]}.}
% \changes{v1.3-4}{2013/09/17}
% {Introduced for two-sided marginal note placement.}
% \begin{macro}{\pcol@twosided@b}
% \changes{v1.3-5}{2013/09/17}
% {Introduced to implement \cs{twosided} with \string\texttt{[b]}.}
% \changes{v1.3-3}{2013/09/17}
% {Introduced for two-sided background painting.}
% \begin{macro}{\swapcolumninevenpages}
% \changes{v1.2-4}{2013/05/11}
% {Introduced to enable column-swapping.}
% \begin{macro}{\noswapcolumninevenpages}
% \changes{v1.2-4}{2013/05/11}
% {Introduced to disable column-swapping.}
%
% \def\inornot{\mathrel{{\in}/{\notin}}}
%
% The API macro $\!\twosided!|[|T|]|$ where $T=t_1t_2\cdots$ is to
% enable\slash disable two-sided paging with
% $\CSIndex{if@twoside}=\true/\false$ ($|p|\inornot T$), two-sided \cswap{}
% with $\CSIndex{ifpcol@swapcolumn}\~={\true/\false}$ ($|c|\inornot T$),
% two-sided % marginal note placement with
% $\CSIndex{ifpcol@swapmarginpar}={\true/\false}$ ($|m|\inornot T$), and/or
% two-sided \bgpaint{} with $\CSIndex{ifpcol@bg@swap}={\true/\false}$
% ($|b|\inornot{}T$) individually, or to enable all of them as a whole
% when the optional argument is not given.
%
% The macro invokes \!\pcol@twosided! with the optional argument $T$ if
% provided, or with $T=|pcmb|$ otherwise to enable all features. Then
% \!\pcol@twosided! at first turns all the switches $\false$ an then scans
% all non-space tokens $t\in T$ invoking $|\pcol@twosided@|{\cdot}t$ if it
% is defined and thus $t\in\{|p|,|c|,|m|,|b|\}$ to turn the corresponding
% switch $\true$, or complains that the feature $t$ is unknown.
%
% Note that backward-compatible API macros
% \!\swapcolumninevenpages! and \!\noswapcolumn~inevenpages! are still
% availabel to turn $\CSIndex{ifpcol@swapcolumn}$ $\true$ an $\false$
% respectivey.
%
% \begin{macrocode}
%% Column Swapping
\def\twosided{\@ifnextchar[%]
{\pcol@twosided}{\pcol@twosided[pcmb]}}
\def\pcol@twosided[#1]{%
\global\@twosidefalse \global\pcol@swapcolumnfalse
\global\pcol@swapmarginparfalse \global\pcol@bg@swapfalse
\@tfor\reserved@a:=#1\do{%
\@ifundefined{pcol@twosided@\reserved@a}%
{\PackageError{paracol}{Unknown two-siding feature \reserved@a}}%
{\@nameuse{pcol@twosided@\reserved@a}}}}
\def\pcol@twosided@p{\global\@twosidetrue}
\def\pcol@twosided@c{\global\pcol@swapcolumntrue}
\def\pcol@twosided@m{\global\pcol@swapmarginpartrue}
\def\pcol@twosided@b{\global\pcol@bg@swaptrue}
\def\swapcolumninevenpages{\global\pcol@swapcolumntrue}
\def\noswapcolumninevenpages{\global\pcol@swapcolumnfalse}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@swapcolumn}
% \changes{v1.2-4}{2013/05/11}
% {Introduced to convert column ordinal and its position.}
% \changes{v1.3-2}{2013/09/17}
% {Add two arguments $C^0$ and $C^1$ as the third and fourth ones to
% modifiy the calculation of $c_2$ with them for column-swapping with
% parallel-paging.}
% \changes{v1.3-3}{2013/09/17}
% {Add the assignment of \cs{pcol@colsepid} to let it have $c_2-1$ if
% swapped or $c_2$ otherwise.}
% \changes{v1.3-4}{2013/09/17}
% {Add a user \cs{pcol@addmarginpar} and remove \cs{paracol},
% \cs{pcol@sptxt} and \cs{pcol@switchcol}.}
% \begin{macro}{\pcol@colsepid}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to be let have $c_2-1$ if swapped or $c_2$ otherwise by
% \cs{pcol@swapcolumn}.}
%
% The macro \!\pcol@swapcolumn!$\<c_1\>\<c_2\>\<\Cfrom\>\<\Cto\>$ converts
% the column ordinal $c$ or position $c'$ in the \!\count!
% register\footnote{
%
% Or the \!\dimen! register \!\z@!.}
%
% $c_1$ to the position or ordinal to set it in the \!\count! register
% $c_2$, for a \parapag{}e having columns $c\In\Cfrom\Cto$. That is, we let
% $c_2=(\Cto-1)-(c_1-\Cfrom)$ if $\CSIndex{ifpcol@swapcolumn}=\true$ to mean
% the \cswap{} is in effect and \!\c@page! is even, while $c_2=c_1$
% otherwise. We also let $c^g=\!\pcol@colsepid!=c_2-1$ if swapped, or
% $c^g=c_2$ otherwise, so that it has the ordinal of the \csepgap{}
% {\em physically} following the column $c_2$.
%
% The macro is used in \!\pcol@ioutputelt!, \!\pcol@addmarginpar!,
% \!\pcol@imakeflushedpage! and \!\pcol@iflushfloats! with
% $(c_1,c_2)=(c',c)$, and in \!\pcol@addmarginpar! (another use) with
% $(c_1,c_2)=(c,c')$. Note that in the uses in the macros above except for
% \!\pcol@addmarginpar!, \!\c@page! definitely has the page number for the
% page to be shipped out. As for \!\pcol@addmarginpar! on the other hand,
% \!\c@page! can be different from the ship-out page number to produce a
% weird result if their parities are different, due to page jump. However
% this problem is not so severe because it just affects the position of
% marginal notes which \LaTeX{} itself may misplace.
%
% \begin{macrocode}
\def\pcol@swapcolumn#1#2#3#4{%
\edef\pcol@colsepid{\number#1}%
\ifpcol@swapcolumn
\ifodd\c@page\relax #2#1\relax
\else
#2#4\relax \advance#2-#1\relax \advance#2#3\relax \advance#2-\tw@
\edef\pcol@colsepid{\number#2}%
\advance#2\@ne
\fi
\else #2#1\relax
\fi}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \KeepSpace{2}
% \begin{macro}{\marginparthreshold}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to spacify the smallest ordinal of columns whose marginal
% notes go to the right margin if not swapped.}
% \begin{macro}{\pcol@marginparthreshold}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to implement \cs{marginparthreshold}.}
% \begin{macro}{\pcol@mpthreshold@l}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to keep the value specified by \cs{marginparthreshold}
% for columns in left parallel-pages.}
% \begin{macro}{\pcol@mpthreshold@r}
% \changes{v1.3-4}{2013/09/17}
% {Introduced to keep the value specified by \cs{marginparthreshold}
% for columns in right parallel-pages.}
%
% The API macro $\!\marginparthreshold!\Arg{t_l}|[|t_r|]|$ determines the
% smallest ordinal $t_l$ of columns in left \parapag{}es whose marginal
% notes go to the right margin in fundamental setting of marginal note
% positioning, while the threshold in right \parapag{}es is given by $t_r$
% if provided or by $t_l$ otherwise. That is, marginal notes given in a
% column $c$ in a page $p$ s.t.\ $c\In0\CL$ (resp.\ $\LBRP\CL\C$) go left if
% $c<t_l$ (resp.\ $c<t_r$) while they go right if $c\geq t_l$ (resp.\ $c\geq
% t_r$), providing
% $$
% (\CSIndex{ifpcol@swapmarginpar}\;\land\;\page(p)\bmod2=0)
% \not\equiv\CSIndex{if@reversemargin}=\false
% $$
% or the margins are swapped otherwise.
%
% The macro \!\def!ines \!\pcol@mpthreshold@l! to let it have $t_l$ after a
% assigning $t_l$ to \!\@tempcnta! to ensure $t_l$ gives some number, and
% then do the same for \!\pcol@mpthreshold@r! with $t_r$ by
% \!\pcol@marginparthreshold! if $t_r$ is provided, or let the marco have
% $t_l$ otherwise. Note that at the top level we do
% \!\marginparthreshold!|{1}| to give defaults. Also note that
% \!\pcol@mpthreshold@l! and \!\pcol@mpthreshold@r! are referred to solely
% in \!\pcol@addmarginpar!.
%
% \begin{macrocode}
\def\marginparthreshold#1{\@tempcnta#1\relax
\xdef\pcol@mpthreshold@l{\number\@tempcnta}%
\@ifnextchar[%]
\pcol@marginparthreshold{\xdef\pcol@mpthreshold@r{\number\@tempcnta}}}
\def\pcol@marginparthreshold[#1]{\@tempcnta#1\relax
\xdef\pcol@mpthreshold@r{\number\@tempcnta}}
\marginparthreshold{1}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
%
% \KeepSpace{5}
% \section{Commands for Text Coloring}
% \label{sec:imp-commcolor}
% \changes{v1.3-6}{2013/09/17}
% {Add the section ``Commands for Text Coloring'' to distinguish
% macros inside and outside \cs{output} routine and describe latters
% in this section.}
%
% \begin{macro}{\columncolor}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to define the default color of a column.}
% \changes{v1.22}{2013/06/30}
% {Add the definition of \cs{pcol@colorcommand} for warning in
% \cs{pcol@icolumncolor}.}
% \begin{macro}{\pcol@xcolumncolor}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to implement \cs{columncolor}.}
% \begin{macro}{\pcol@ycolumncolor}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to implement \cs{columncolor}.}
% \begin{macro}{\pcol@columncolor}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to implement \cs{columncolor}.}
%
% The API macro \!\columncolor!\oarg{mode}\marg{color}\oarg{c} defines the
% default color specified by $\arg{color}$ optionally with color
% $\arg{mode}$ of the column $c$ being the current column or that specified
% by the optional argument. After \!\def!ining \Midx{\!\pcol@colorcommand!}
% being the \!\string! of this macro itself, and processing two optional
% arguments $\arg{mode}$ and $c$ through macros \!\pcol@xcolumncolor!,
% \!\pcol@ycolumncolor! and \!\pcol@columncolor!, the macro
% \!\pcol@icolumncolor!\marg{cmd}\oarg{c} is invoked to perform real
% operations with the coloring command
% $\arg{cmd}=\!\color!$\oarg{mode}\marg{color}.
%
% \begin{macrocode}
%% Commands for Text Coloring
\def\columncolor{\def\pcol@colorcommand{\string\columncolor}%
\@ifnextchar[%]
\pcol@xcolumncolor\pcol@ycolumncolor}
\def\pcol@xcolumncolor[#1]#2{\pcol@columncolor{\color[#1]{#2}}}
\def\pcol@ycolumncolor#1{\pcol@columncolor{\color{#1}}}
\def\pcol@columncolor#1{\@ifnextchar[%]
{\pcol@icolumncolor{#1}}{\pcol@icolumncolor{#1}[\number\pcol@currcol]}}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\normalcolumncolor}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to define the default color of a column is
% \cs{normalcolor}.}
% \changes{v1.22}{2013/06/30}
% {Add the definition of \cs{pcol@colorcommand} for warning in
% \cs{pcol@icolumncolor}.}
%
% The API macro \!\normalcolumncolor!\oarg{c} defines the default color of
% the column $c$, being the current column or that specified by the optional
% argument, is \!\normalcolor!. That is, after \!\def!ining
% \Midx{\!\pcol@colorcommand!} being the \!\string! of this macro itself,
% this macro simply invokes \!\pcol@icolumncolor!\marg{cmd}\oarg{c} to
% perform real operations with the coloring command
% $\arg{cmd}=\!\normalcolor!$.
%
% \begin{macrocode}
\def\normalcolumncolor{\def\pcol@colorcommand{\string\normalcolumncolor}%
\@ifnextchar[%]
{\pcol@icolumncolor\normalcolor}%
{\pcol@icolumncolor\normalcolor[\number\pcol@currcol]}}
% \end{macrocode}
% \end{macro}
%
% \KeepSpace{1}
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@getshadowcc} was introduced for setting $\hat\gamma_0^c$
% into $\gamma_0^c$ locally, but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@getshadowcc} is removed according to the change of text
% coloring from \cs{output} to \cs{insert}.}
% \begin{macro}{\pcol@icolumncolor}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to implement \cs{columncolor} and
% \cs{normalcolumncolor}.}
% \changes{v1.22}{2013/06/30}
% {Add warning of ineffective uses of \cs{columncolor} and
% \cs{normalcolumncolor}, and modify the mechanism to update
% $\gamma_0^c$ and to rewind\slash reestablish color stack.}
% \changes{v1.23}{2013/07/08}
% {Add an argument of \cs{relax} to \cs{pcol@color@invokeoutput}
% because any insertion after \cs{vadjust} is not required or
% justified.}
% \changes{v1.24}{2013/07/27}
% {Add math mode to the cases of ineffective use.}
% \changes{v1.34}{2018/05/07}
% {Remove the invocations of \cs{pcol@iicolumncolor} for
% $\cs{pcol@columncolor@shadow}\cdot c$ because it no longer exists,
% completly change the opearations in the case the target column $c$
% is the current one according to the new method with \cs{insert},
% and add immediate setting of $\gamma_0^c$ in the case $c$ is not
% current.}
% \begin{macro}{\pcol@iicolumncolor}
% \changes{v1.22}{2013/06/30}
% {Introduced for setting $\gamma_0^c$ and $\hat\gamma_0^c$, and
% pushing $\chi$.}
% \changes{v1.34}{2018/05/07}
% {Remove the third argument, change the second argument from a
% control sequence name to the target column, add a grouping to
% surround the entire body of the macro, and change the body of
% $\gamma_0^c$ so that it only has the color information.}
% \begin{macro}{\pcol@scancst@shadow}
% \changes{v1.34}{2018/05/07}
% {Introduced to rewind or establish the color stack $\hat\Gamma^c$.}
%
% The macro \!\pcol@icolumncolor!\marg{cmd}\oarg{c}, invoked from
% \!\pcol@columncolor! and \!\normal~columncolor!, performs the operations to
% define the default color of the column $c$ with the coloring command
% $\arg{cmd}\in\{\!\color!\hbox{\oarg{mode}}\ARg{color},\,\!\normalcolor!\}$
% as follows. First we examine if \!\set@color! is not \!\relax! and we are
% in non-internal vertical or non-restricted horizontal mode and, if not, we
% complain the command whose name is in \!\pcol@colorcommand! is ineffective
% by \!\PackageWarning! and do nothing.
%
% Otherwise and if we are not in a \env{paracol} environment, i.e.,
% \!\paracol! is not \!\let!-equal to \!\pcol@paracol!, we simply invoke
% \!\pcol@iicolumncolor! to let $\Celtshadow^c=|\pcol@columncolor|\cdot c$
% have the color $\chi$ specified by $\arg{cmd}$ so that the next
% \beginparacol{} will let $\Celt^c$ have the coloring \!\special! for
% $\chi$. If we are in a \env{paracol} environment but in a column $c'\neq
% c$, on the other hand, we also let $\Celtshadow=\chi$ but in addition let
% $\Celt^c=|\pcol@columncolor@box|\cdot c$ have the coloring \!\special! for
% $\chi$ immediately so that it is effective in the next \cswitch{} to $c$.
% This immediate setting of $\Celt^c$ is done by invoking $\arg{cmd}$ with
% the original \!\set@color! saved in \!\pcol@set@color! and the
% nullification of \!\aftergroup!, after acquiring an \!\insert! for it if
% necessary,
%
% \SpecialArrayIndex{c}{\pcol@columncolor}
% \SpecialArrayIndex{c}{\pcol@columncolor@box}
%
% Otherwise, i.e., if we are in a \env{paracol} environment and in the
% column $c$, at first we invoke \!\pcol@scancst@shadow! to rewind
% $\CSTshadow^c$ applying $\!\@elt!=\!\reset@color!$ to
% $\celtshadow_i\in\CSTshadow^c$. Then, after letting $\Celtshadow^c=\chi$,
% we invoke \!\pcol@scancst@shadow! again to reestablish $\CSTshadow^c$ with
% the new $\Celtshadow^c$ so that $\Celtshadow^c$ is at the bottom of the
% \colorstack{} in |.tex|. In this scan $\!\@elt!\arg{\celtshadow_i}$
% \!\def!ines \!\current@color! to let it have $\celtshadow_i$ and then
% invokes \!\pcol@set@color! to put the coloring \!\special! for
% $\celtshadow_i$ nullifying \!\aftergroup!. Then we \!\insert! a \!\vbox!,
% whose height and depth are 1\,|pt| and width is 0, having the coloring
% \!\special! for $\chi$ so that \!\output! will let $\Celt^c$ have the
% \!\special! in a synchronous manner. After that we put a
% $\!\penalty!=10000$ if $\CSIndex{if@nobreak}=\true$ to keep the
% \!\insert!ion from being followed by a page break.
%
% The macro $\!\pcol@iicolumncolor!\arg{cmd}\arg{c}$ at first
% invokes $\arg{cmd}$ to let \!\current@color! have the printer-specific color
% information $\chi$ of $\arg{color}$ or what \!\normalcolor! specifies,
% temporarily letting \!\set@color! be \!\relax! to let \!\color! or
% \!\normalcolor! just do the \!\def!inition of \!\current@color! without
% putting coloring \!\special!s nor preparing \colorstack{} popping. Then
% we \!\xdef!ine $\Celtshadow^c=|\pcol@columncolor|{\cdot}c$ to have $\chi$.
%
% \SpecialArrayIndex{c}{\pcol@columncolor}
%
% \begingroup\hfuzz3.1pt
% The macro \!\pcol@scancst@shadow! applies \!\@elt! to $\Celtshadow^c$ to
% put a coloring or uncoloring \!\special! for it if it is defined, and then
% do the same for all
% $\celtshadow_i\in\cstshadow=\!\pcol@colorstack@shadow!$.
% \par\endgroup
%
% \begin{macrocode}
\def\pcol@icolumncolor#1[#2]{%
\@tempswafalse
\ifpcol@inner \@tempswatrue \fi
\ifinner \@tempswatrue \fi
\ifmmode \@tempswatrue \fi
\ifx\set@color\relax
\PackageWarning{paracol}{\pcol@colorcommand\space is not effective
without some coloring package}%
\else\if@tempswa
\PackageWarning{paracol}{\pcol@colorcommand\space is not effective
when not in outer par mode}%
\else
\begingroup
\let\@elt\relax
\ifx\pcol@paracol\paracol
\pcol@iicolumncolor{#1}{#2}%
\else\ifnum#2=\pcol@currcol
\def\@elt##1{\reset@color}\pcol@scancst@shadow
\pcol@iicolumncolor{#1}{#2}%
\def\@elt##1{\def\current@color{##1}\let\aftergroup\@gobble
\pcol@set@color}%
\pcol@scancst@shadow
\setbox\@tempboxa\vbox{\let\set@color\pcol@set@color
\let\aftergroup\@gobble #1}%
\ht\@tempboxa1sp \dp\@tempboxa1sp \wd\@tempboxa\z@\relax
\insert\pcol@colorins{\box\@tempboxa}%
\ifvmode\if@nobreak \nobreak \fi\fi
\else
\pcol@iicolumncolor{#1}{#2}%
\pcol@currcol#2\relax
\ifvoid\pcol@ccuse{@box}%
\@next\@currbox\@freelist{}\pcol@ovf
\pcol@ccxdef{\@currbox}%
\fi
\global\setbox\pcol@ccuse{@box}\vbox{\let\set@color\pcol@set@color
\let\aftergroup\@gobble #1}%
\fi\fi
\endgroup
\fi\fi
\ignorespaces}
\def\pcol@iicolumncolor#1#2{{\let\set@color\relax #1%
\expandafter\xdef\csname pcol@columncolor#2\endcsname{\current@color}}}
\def\pcol@scancst@shadow{%
\pcol@ifccdefined{\@elt{\pcol@ccuse{}}}\relax
\pcol@colorstack@shadow}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \KeepSpace{1}
% \begin{macro}{\pcol@mcpushlimit}
% \changes{v1.24}{2013/07/27}
% {Introduced for coloring specified in math mode.}
% \changes{v1.34}{2018/05/07}
% {Move down to place it just before the \cs{def}inition of
% \cs{pcol@set@color@push} being the sole referrer, and change its
% body from 100 to 1000.}
% \begin{macro}{\set@color}
% \begin{macro}{\pcol@set@color}
% \begin{macro}{\pcol@set@color@push}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to work as \cs{set@color}.}
% \changes{v1.22}{2013/06/30}
% {Modified to push color stack by \cs{output} always.}
% \changes{v1.23}{2013/07/08}
% {Add an argument of null \cs{hskip} to \cs{pcol@color@invokeoutput}
% so that the first word of a colored text is hyphenated.}
% \changes{v1.24}{2013/07/27}
% {Add the mechanism special for math mode.}
% \changes{v1.3-6}{2013/09/17}
% {Change the second argument of \cs{pcol@color@invokeoutput} from
% \cs{hskip}\cs{z@} to \cs{pcol@fcwhyphenate} to make null skip
% insertion conditional.}
% \changes{v1.34}{2018/05/07}
% {Completely change its definition according to the new text coloring
% with \cs{insert}.}
%
% The macro \!\pcol@set@color@push! is invoked whenever \LaTeX's
% counterpart \!\set@color! appears in a \env{paracol} environment through
% coloring commands such as \!\color!, because \!\pcol@zparacol! replaces
% \LaTeX's macro with it saving the original version in \!\pcol@set@color!,
% if the original \!\set@color! is not \!\relax! to mean some coloring
% package is in use. This original version is used through
% \!\pcol@set@color! by \!\pcol@bg@paintregion@i!, \!\pcol@output@start! and
% \!\pcol@icolumncolor! besides this macro \!\pcol@set@color@push!,
% while \!\output! lets $\!\set@color!=\!\pcol@set@color!$ for the references
% outside of our control.
%
% The macro at first invokes its original version being \!\pcol@set@color!
% to put an appropriate coloring \!\special! to |.dvi| and reserve the
% invocation of \!\reset@color! by \!\aftergroup!. Then, it performs one of
% two different operations depending on TeX's mode, i.e., math mode or not.
% If we are in math mode and not in a \!\vbox!, at first we increment
% $m=\!\pcol@mcid!$ and examine if $m>\!\pcol@mcpushlimit!=1000$, and if so
% we stop the execution with \!\PackageError!\footnote{
%
% And let $m=1$ to allow a user to continue the execution bravely.}
%
% in order to avoid too many macros $|\pcol@reset@color@mpop@|\cdot m$ are
% defined\footnote{
%
% \SpecialArrayIndex{m}{\pcol@reset@color@mpop@}
%
% We could make the number of math-mode coloring operations virtually
% unlimited by putting all digits of the decimal representation of $m$
% followed by a terminator by multiple
% \cs{aftergroup}s so that \cs{pcol@reset@color@mpop} is put by
% \cs{aftergroup} prior to them to capture them as its argument, but
% limiting with $2^{31}-1$ is still necessary and that with 1000 is
% reasonable.}.
%
% Otherwise, i.e., if $m\leq\!\pcol@mcpushlimit!$, we
% reserve the invocation of the macro $|\pcol@reset@color@mpop@|{\cdot}i$
%
% \SpecialArrayMainIndex{m}{\pcol@reset@color@mpop@}
%
% for our own pop by \!\aftergroup! defining the macro as
% $\!\pcol@reset@color@mpop!\Arg{m}$. If we are not in math mode, on the
% other hand, and neither in a \!\vbox! nor in restricted horizontal mode,
% we simply reserve the invocation of the macro $\pcol@reset@color@pop$.
%
% Then, regardless that we are in math mode or not, we push the contents of
% \!\current@color!, which \!\set@color! should refer to as the color
% information to be set, into the shadow \colorstack{}
% $\cstshadow=\!\pcol@colorstack@shadow!$ for the stack rewinding\slash
% reestablishing in \!\columncolor! and \!\normalcolumncolor!. Since this
% push is done non-\!\global!ly with \!\edef!, we save\slash restore the
% definition of \!\@elt! to\slash from \Midx{\!\pcol@elt@save!} before\slash
% after the push, resepctively\footnote{
%
% Just in case.}.
%
% Then we \!\insert! a \!\vbox! through \!\pcol@colorins! for the push of
% $\celt_i$ or $\mcelt_{i,m}$ to $\cstraw$ synchronous with a page break or
% \cswitch{}. The height of the \!\vbox! is 1\,|pt|, depth is 0 and
% width is $m$\,|sp| if we are in math mode or 0 otherwise, and its
% contents is the coloring \!\special! given by \!\pcol@set@color! so that
% the \!\special! is what the macro put at the beginning of this macro but
% without the reservation of \!\reset@color!. After the insertion, we put
% \!\pcol@fcwhyphenate!, being \!\hskip!\!\z@! when
% \!\coloredwordhyphenated! is effective, to split the coloring \!\special!
% from the first colored word so that the word may be hyphenated if we are
% in horizontal mode. If we are in vertical mode, on the other hand, we do
% \!\nobreak! if $\CSIndex{if@nobreak}=\true$ to keep the \!\insert!ion from
% being followed by a page break.
%
% \begin{macrocode}
\def\pcol@mcpushlimit{1000}
\def\pcol@set@color@push{\pcol@set@color
\ifmmode\else\ifinner \pcol@innertrue \fi\fi
\ifpcol@inner\else
\ifmmode
\global\advance\pcol@mcid\@ne
\ifnum \pcol@mcid>\pcol@mcpushlimit\relax
\PackageError{paracol}{Too many coloring commands in math mode}\@ehb
\global\pcol@mdid\@ne
\fi
\@tempdima\pcol@mcid sp\relax
\expandafter\aftergroup
\csname pcol@reset@color@mpop@\number\pcol@mcid\endcsname
\expandafter\xdef
\csname pcol@reset@color@mpop@\number\pcol@mcid\endcsname
{\noexpand\pcol@reset@color@mpop{\number\pcol@mcid}}%
\else
\aftergroup\pcol@reset@color@pop \@tempdima\z@
\fi
\let\pcol@elt@save\@elt \let\@elt\relax
\edef\pcol@colorstack@shadow{\pcol@colorstack@shadow\@elt{\current@color}}%
\let\@elt\pcol@elt@save
\setbox\@tempboxa\vbox{\let\aftergroup\@gobble \pcol@set@color}%
\ht\@tempboxa1sp \dp\@tempboxa\z@ \wd\@tempboxa\@tempdima
\insert\pcol@colorins{\box\@tempboxa}\ifhmode \pcol@fcwhyphenate \fi
\ifvmode\if@nobreak \nobreak \fi\fi
\fi}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@reset@color@pop}
% \changes{v1.2-1}{2013/05/11}
% {Introduced to work as \cs{reset@color}.}
% \changes{v1.22}{2013/06/30}
% {Modified to pop color stack by \cs{output} and to examine if
% $\cs{ifpcol@output}\EQ\mathit{true}$.}
% \changes{v1.23}{2013/07/08}
% {Add an argument of \cs{relax} to \cs{pcol@color@invokeoutput}
% so that the last word of a colored text is not followed by a line
% break candidate.}
% \changes{v1.34}{2018/05/07}
% {Completely change its definition according to the new text coloring
% with \cs{insert}.}
% \begin{macro}{\pcol@reset@color@mpop}
% \changes{v1.24}{2013/07/27}
% {Introduced for coloring specified in math mode.}
% \changes{v1.34}{2018/05/07}
% {Completely change its definition according to the new text coloring
% with \cs{insert}.}
%
% The macro \!\pcol@reset@color@pop! and its math-mode relative
% $\!\pcol@reset@color@mpop!\~\Arg{m}$ are invoked by
% \!\aftergroup! mechanism in \!\pcol@set@color@push!, directly for the
% former and through the macro $|\pcol@reset@color@mpop@|{\cdot}m$
%
% \SpecialArrayIndex{m}{\pcol@reset@color@mpop@}
%
% for the latter. They \!\insert! a \!\vbox! for $\celtpop_i$ or
% $\mceltpop_{i,m}$ to add it to $\cstraw$ synchronously with a page break
% or \cswitch{}. Therefore, the height and depth of the \!\vbox! are 0 and
% width is 0 for $\celtpop_i$ or $m$\,|sp| for $\mceltpop_{i,m}$. The
% contents of the \!\vbox! is an uncoloring \!\special! given by
% \!\reset@color! but this is done just for debugging to show what
% \!\pcol@colorins! has by, for example, \!\pcol@ShowBox!. Then if we are
% in vertical mode and $\CSIndex{if@nobreak}=\true$, we do \!\nobreak! to
% keep the \!\insert!ion from being followed by a page break even in
% \!\pcol@reset@color@mpop! because its corresponding
% \!\pcol@set@color@push! may have been in a displayed math construct after
% which we are in vertical mode.
%
% One caution is that \!\pcol@reset@color@pop! can be invoked outside the
% \env{paracol} environment in which the corresponding
% \!\pcol@set@color@push! appears. In this case with
% $\CSIndex{ifpcol@output}=\false$, we don't need to do the pop operation
% and cannot make the \!\insert!ion for it because \!\output! is not for
% \env{paracol}.
%
% \begin{macrocode}
\def\pcol@reset@color@pop{%
\ifpcol@output
\setbox\@tempboxa\vbox{\reset@color}%
\ht\@tempboxa\z@ \dp\@tempboxa\z@ \wd\@tempboxa\z@
\insert\pcol@colorins{\box\@tempboxa}%
\ifvmode\if@nobreak \nobreak \fi\fi
\fi}
\def\pcol@reset@color@mpop#1{%
\setbox\@tempboxa\vbox{\reset@color}%
\ht\@tempboxa\z@ \dp\@tempboxa\z@ \wd\@tempboxa#1sp\relax
\insert\pcol@colorins{\box\@tempboxa}%
\ifvmode\if@nobreak \nobreak \fi\fi
}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@color@invokeoutput} was introduced for \cs{output}
% request for coloring but removed in v1.34.}
% \changes{v1.23}{2013/07/08}
% {\cs{pcol@color@invokeoutput} was modified to add second argument
% $s$ to insert a null skip after \cs{vadjust} only when the macro is
% invoked from \cs{pcol@set@color@push} in horizontal mode.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@color@invokeoutput} is removed according to the change of
% text coloring from \cs{output} to \cs{insert}.}
% \changes{v1.22}{2013/06/30}
% {\cs{pcol@color@invokeoutput@v} was introduced for \cs{output}
% request for coloring but removed in v1.34.}
% \changes{v1.34}{2018/05/07}
% {\cs{pcol@color@invokeoutput@v} is removed according to the change of
% text coloring from \cs{output} to \cs{insert}.}
%
% \KeepSpace{1}
% \begin{macro}{\coloredwordhyphenated}
% \changes{v1.3-6}{2013/09/17}
% {Introduced to enable null skip insertion before the first word
% after a coloring command not always but conditionally.}
% \begin{macro}{\nocoloredwordhyphenated}
% \changes{v1.3-6}{2013/09/17}
% {Introduced to disable null skip insertion before the first word
% after a coloring command.}
% \begin{macro}{\pcol@fcwhyphenate}
% \changes{v1.3-6}{2013/09/17}
% {Introduced to enable null skip insertion before the first word
% after a coloring command not always but conditionally.}
%
% The API macro \!\coloredwordhyphenated! \!\def!ines the macro
% \!\pcol@fcwhyphenate! being \!\hskip!\!\z@! so that the null space is
% inserted after the coloring \!\special! and \!\insert! put by
% \!\pcol@set@color@push! if we are in horizontal mode, so that the word
% following them can be hyphenated. The other API macro
% \!\nocoloredwordhyphenated! makes $\!\pcol@fcwhyphenate!=\!\relax!$ to
% inhibit the insertion. Since the null skip is a line break candidate, the
% skip might cause an unexpected and undesirable line break. However, this
% demerit is less important than the merit of making it possible to
% hyphenate the first word in multi-column documents with narrow lines, and
% thus we make \!\coloredwordhyphenated! effective in default while giving
% users a means to disable the insertion (occasionally) by
% \!\nocoloredwordhyphenated!.
%
% \begin{macrocode}
\def\coloredwordhyphenated{\def\pcol@fcwhyphenate{\hskip\z@}}
\def\nocoloredwordhyphenated{\let\pcol@fcwhyphenate\relax}
\coloredwordhyphenated
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
%
%
% \KeepSpace{8}
% \section{Commands for Column-Separating Rule Color and Background Painting}
% \label{sec:imp-commbg}
% \changes{v1.3-3}{2013/09/17}
% {Add the subsection ``Commands for Column-Separating Rule Color and
% Background Painting'' to describe newly
% introduced API macros to specify colors of column-separating rules
% and background painting.}
%
% \begin{macro}{\colseprulecolor}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to spcify the colors of column-separating rules.}
% \begin{macro}{\pcol@defcseprulecolor@x}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{colseprulecolor}.}
% \begin{macro}{\pcol@defcseprulecolor@y}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{colseprulecolor}.}
% \begin{macro}{\pcol@defcseprulecolor}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{colseprulecolor}.}
% \begin{macro}{\normalcolseprulecolor}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to spcify that color of column-separating rules is normal.}
% \begin{macro}{\pcol@defcseprulecolor@i}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{colseprulecolor} and
% \cs{normalcolseprulecolor}.}
% \begin{macro}{\pcol@colseprulecolor}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to keep the color for all column-separating rules.}
%
% The macro \!\colseprulecolor!\oarg{mode}\marg{color}$|[|c|]|$ \!\def!ines
% \!\pcol@colseprulecolor! to have the $\arg{color}$ optionally with
% coloring $\arg{mode}$ of all \cseprule{}s if the optional argument $c$ is
% not provided, or $|\pcol@colseprulecolor|{\cdot}c$
%
% \SpecialArrayMainIndex{c}{\pcol@colseprulecolor}
%
% that of the rule drawn between a particular column pair $c$ and $c+1$.
% After \!\def!ining \Midx{\!\pcol@colorcommand!} to be \!\colseprulecolor!
% in case we have to give a warning, the macro invokes
% \!\pcol@defcseprulecolor@x!\oarg{mode}\marg{color} or
% \!\pcol@defcseprulecolor@y!\marg{color} according to the provision of the
% optional argument $\arg{mode}$ to invoke \!\pcol@defcseprulecolor! with
% argument \marg{cmd}${}={}$\!\color!\oarg{mode}\marg{color} so that this
% macro invokes $\!\pcol@defcseprulecolor@i!\ARg{cmd}|[|c|]|$ where
% $c=\emptyset$ if the optional arguemnt $c$ is not provided.
%
% The macro $\!\normalcolseprulecolor!|[|c|]|$, on the other hand, defines
% $|\pcol@colseprule|\~|color|[{\cdot}c]$
%
% \SpecialArrayIndex{c}{\pcol@colseprulecolor}
% \SpecialIndex{\pcol@colseprulecolor}
%
% with whatever \!\normalcolor! gives, and thus it invokes
% \!\pcol@defcseprulecolor@i! letting $\arg{cmd}=\!\normalcolor!$, after
% \!\def!ining \!\pcol@colorcommand! to be \!\normalcolsep~rule~color!.
%
% The macro $\!\pcol@defcseprulecolor@i!\ARg{cmd}|[|c|]|$ examines if
% $\!\set@color!=\!\relax!$ to mean no coloring packages have been loaded
% and, if so, do nothing giving a warning the command in
% \!\pcol@colorcommand! is not effective. Otherwise, we examine if
% $\arg{cmd}$ has proper arguments by invoking it but temporally nullifying
% \!\set@color! and then \!\def!ine $|\pcol@colseprulecolor|[{\cdot}c]$
%
% \SpecialArrayIndex{c}{\pcol@colseprulecolor}
% \SpecialIndex{\pcol@colseprulecolor}
%
% to be $\arg{cmd}$.
%
% Note that at the top level we \!\def!ine \!\pcol@colseprulecolor! to be
% \!\normalcolor! to give the default for all \cseprule{}s. Also note that
% macros $|\pcol@colseprulecolor|{\cdot}c$
%
% \SpecialArrayIndex{c}{\pcol@colseprulecolor}
%
% are referred to solely in \!\pcol@hfil!
% which also uses \!\pcol@colseprulecolor! for columns for which
% $|\pcol@colseprulecolor|{\cdot}c$
%
% \SpecialArrayIndex{c}{\pcol@colseprulecolor}
%
% is not defined.
%
% \begin{macrocode}
%% Commands for Column-Separating Rule Color and Background Painting
\def\colseprulecolor{\def\pcol@colorcommand{\string\colseprulecolor}%
\@ifnextchar[%]
\pcol@defcseprulecolor@x\pcol@defcseprulecolor@y}
\def\pcol@defcseprulecolor@x[#1]#2{\pcol@defcseprulecolor{\color[#1]{#2}}}
\def\pcol@defcseprulecolor@y#1{\pcol@defcseprulecolor{\color{#1}}}
\def\pcol@defcseprulecolor#1{\@ifnextchar[%]
{\pcol@defcseprulecolor@i{#1}}{\pcol@defcseprulecolor@i{#1}[]}}
\def\normalcolseprulecolor{%
\def\pcol@colorcommand{\string\normalcolseprulecolor}%
\@ifnextchar[%]
{\pcol@defcseprulecolor@i\normalcolor}%
{\pcol@defcseprulecolor@i\normalcolor[]}}
\def\pcol@defcseprulecolor@i#1[#2]{%
\ifx\set@color\relax
\PackageWarning{paracol}{\pcol@colorcommand\space is not effective
without some coloring package}%
\else
{\let\set@color\relax #1}%
\global\@namedef{pcol@colseprulecolor#2}{#1}%
\fi}
\gdef\pcol@colseprulecolor{\normalcolor}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \KeepSpace{8}
% \begin{macro}{\backgroundcolor}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to define colors for background painting.}
% \begin{macro}{\nobackgroundcolor}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to undefine colors for background painting.}
% \begin{macro}{\pcol@backgroundcolor@e}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor} and
% \cs{nobackgroundcolor}.}
% \begin{macro}{\pcol@backgroundcolor}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor} and
% \cs{nobackgroundcolor}.}
% \changes{v1.31}{2013/10/10}
% {Fix the mispell ``colorling'' in the error message.}
% \begin{macro}{\pcol@backgroundcolor@i}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor} and
% \cs{nobackgroundcolor}.}
% \begin{macro}{\pcol@bg@region}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor} and
% \cs{nobackgroundcolor}.}
% \begin{macro}{\pcol@backgroundcolor@ii}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor} and
% \cs{nobackgroundcolor}.}
% \begin{macro}{\pcol@backgroundcolor@iii}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor}.}
% \begin{macro}{\pcol@backgroundcolor@iv}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor}.}
% \begin{macro}{\pcol@backgroundcolor@v}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor}.}
%
% {\nosv\gdef\|{\;|\;}}
% \def\fdef{f_{\mathit{def}}}
%
% The macro
% \!\backgroundcolor!\marg{region}\oarg{mode}\marg{color}
% defines the $\arg{color}$ optionally with $\arg{mode}$ of the
% $\arg{region}$ whose syntax is specified as follows.
%
% % \begin{eqnarray*}
% \arg{region}&{:}{:}{=}&\arg{regionid}\arg{extension}\\
% \arg{regionid}&{:}{:}{=}&\<a\>\|\arg{corg}|[|c|]|\\
% \arg{a}&{:}{:}{=}&\arg{corg}\||s|\||S|\||t|\||T|\||l|\||L|\||r|\||R|\|
% |f|\||F|\||n|\||N|\||p|\||P|\\
% \arg{corg}&{:}{:}{=}&|c|\||C|\||g|\||G|\\
% \arg{extension}&{:}{:}{=}&\emptyset\||(|x_0|,|y_0|)|\|
% |(|x_0|,|y_0|)(|x_1|,|y_1|)|
% \end{eqnarray*}
% %
% On the other hand, the counteraprt macro
% \!\nobackgroundcolor!\marg{region} undefines the color of $\arg{region}$.
% Both macros invoke \!\pcol@backgroundcolor! giving all arguments to it to
% parse the argument $\arg{region}$, after letting
% $\fdef=\CSIndex{if@tempswa}=\true$ and
% $\!\pcol@backgroundcolor@e!=\!\pcol@backgroundcolor@w!$ in
% \!\backgroundcolor!, or $\fdef=\CSIndex{if@tempswa}=\true$ and
% $\!\pcol@backgroundcolor@e!=\!\pcol@backgroundcolor@z!$ in
% \!\nobackgroundcolor!. Note that the \!\let!-assignment to
% \!\pcol@backgroundcolor@e! is effective when we found an error in the
% parse of the argument $\arg{region}$ to throw away what remains in the
% argument unprocessed and, for \!\backgroundcolor!, the other arguments
% \oarg{mode}\marg{color}.
%
% Then the macro \!\pcol@backgroundcolor! examines if $|\pcol@bg@@|{\cdot}a$
%
% \SpecialArrayIndex{a}{\pcol@bg@@}
%
% is defined, and if not, raises an error that $a$ is invalid and then, in case
% the user dare to continue the execution, invokes
% \!\pcol@backgroundcolor@e! to throw all arguments away after letting
% $a'=\!\pcol@bg@region!=|xx|$ so that the undefining
% $|\pcol@bg@color|{\cdot}a'$ does not cause any troubles.
%
% \SpecialArrayIndex{a}{\pcol@bg@color@}
% \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
%
% Otherwise, i.e., if $|\pcol@bg@@|{\cdot}a$ is defined, it
% invokes $\!\pcol@backgroundcolor@i!|[|c|]|$ or \!\pcol@backgroundcolor@ii!
% according to the provision of the optional argument $|[|c|]|$, after
% \!\def!ining $a'=\Midx{\!\pcol@bg@region!}$ to be $a$. Then
% \!\pcol@backgroundcolor@i! examines if $|\pcol@bg@|\~|mayhavecol@|{\cdot}a$
%
% \SpecialIndex{\pcol@bg@mayhavecol@c}\SpecialIndex{\pcol@bg@mayhavecol@C}
% \SpecialIndex{\pcol@bg@mayhavecol@g}\SpecialIndex{\pcol@bg@mayhavecol@G}
%
% is defined, and if not, raises an error again in a similar way, or
% otherwise invokes \!\pcol@backgroundcolor@ii! after re\!\def!ining
% $a'=a{\cdot}|@|{\cdot}c$.
%
% Then if $\fdef=\true$, the macro \!\pcol@backgroundcolor@ii! examines if
% $\!\set@color!=\!\relax!$, and if so it complains that any coloring
% packages have not been loaded and invokes \!\pcol@backgroundcolor@w! just
% for throwing away optional arguments for \bgext{} and
% \oarg{mode}\marg{color}. Otherwise, i.e., if $\!\set@color!\neq\!\relax!$,
% it invokes \!\pcol@backgroundcolor@iii! after adding $a'$ to the tail of
% \!\pcol@bg@defined!. On the other hand if $\fdef=\false$, it invokes
% \!\pcol@backgroundcolor@z! without checking the availability of coloring
% macros.
%
% The macro \!\pcol@backgroundcolor@iii! at first invokes
% $\!\pcol@bg@defext!\Arg{d}\Arg{e}$ with $e=0$ for all
% $d\in\{|l|,|r|,|t|,|b|\}$ to have default (no) \bgext{}s. Then if
% $|(|x_0|,|y_0|)|$ is provided, \!\pcol@bg@defext! is invoked again by
% \!\pcol@backgroundcolor@iv! for all
% $d\in\{|l|,|r|,|t|,|b|\}$ but with $e=x_0$ for
% $d\in\{|l|,|r|\}$ and with $e=y_0$ for $d\in\{|t|,|b|\}$.
% Further, if % $|(|x_1|,|y_1|)|$ is also provided, \!\pcol@bg@defext! is
% invoked once again by \!\pcol@backgroundcolor@v! for all
% $(d,e)\in\{(|r|,x_1),(|b|,y_1)\}$. Finally \!\pcol@backgroundcolor@v!
% invokes \!\pcol@backgroundcolor@x!, which is also invoked from
% \!\pcol@backgroundcolor@iii! and \!\pcol@backgroundcolor@iv! if they find no
% (further) \bgext{}s.
%
% \begin{macrocode}
\def\backgroundcolor#1{\@tempswatrue
\let\pcol@backgroundcolor@e\pcol@backgroundcolor@w
\pcol@backgroundcolor#1\@nil}
\def\nobackgroundcolor#1{\@tempswafalse
\let\pcol@backgroundcolor@e\pcol@backgroundcolor@z
\pcol@backgroundcolor#1\@nil}
\def\pcol@backgroundcolor#1{%
\@ifundefined{pcol@bg@@#1}%
{\PackageError{paracol}%
{Invalid background coloring region identifier #1}%
\def\pcol@bg@region{xx}\pcol@backgroundcolor@e}%
{\def\pcol@bg@region{#1}%
\@ifnextchar[%]
\pcol@backgroundcolor@i \pcol@backgroundcolor@ii}}
\def\pcol@backgroundcolor@i[#1]{%
\@ifundefined{pcol@bg@mayhavecol@\pcol@bg@region}%
{\PackageError{paracol}%
{Column number \number#1 is not effective for background coloring region
\pcol@bg@region}%
\def\pcol@bg@region{xx}\pcol@backgroundcolor@e}%
{\edef\pcol@bg@region{\pcol@bg@region @#1}%
\pcol@backgroundcolor@ii}}
\def\pcol@backgroundcolor@ii{%
\if@tempswa
\ifx\set@color\relax
\PackageWarning{paracol}{\string\backgroundcolor\space is not effective
without some coloring package}%
\let\reserved@b\pcol@backgroundcolor@w
\else
\let\reserved@b\pcol@backgroundcolor@iii
\@cons\pcol@bg@defined{{\pcol@bg@region}}%
\fi
\else
\let\reserved@b\pcol@backgroundcolor@z
\fi
\reserved@b}
\def\pcol@backgroundcolor@iii{%
\pcol@bg@defext{l}\z@ \pcol@bg@defext{r}\z@
\pcol@bg@defext{t}\z@ \pcol@bg@defext{b}\z@
\@ifnextchar(%)
\pcol@backgroundcolor@iv \pcol@backgroundcolor@x}
\def\pcol@backgroundcolor@iv(#1,#2){%
\pcol@bg@defext{l}{#1}\pcol@bg@defext{r}{#1}%
\pcol@bg@defext{t}{#2}\pcol@bg@defext{b}{#2}%
\@ifnextchar(%)
\pcol@backgroundcolor@v \pcol@backgroundcolor@x}
\def\pcol@backgroundcolor@v(#1,#2){%
\pcol@bg@defext{r}{#1}\pcol@bg@defext{b}{#2}%
\pcol@backgroundcolor@x}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@backgroundcolor@x}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor}.}
% \begin{macro}{\pcol@backgroundcolor@y}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor}.}
%
% The macro \!\pcol@backgroundcolor@x! is used in
% \!\pcol@backgroundcolor@iii!, \!\pcol@backgroundcolor@iv! and
% \!\pcol@backgroundcolor@v! to define the color for \bgpaint{} of the
% region $a'=\!\pcol@bg@region!$. Since the macro is followed by the
% arguments \oarg{mode}\marg{color} of \!\backgroundcolor!, the macro
% invokes \!\color! to let it \!\def!ine \!\current@color! but without real
% coloring operations by letting
% \!\set@color!${}={}$\!\pcol@backgroundcolor@y!. Therefore
% \!\pcol@backgroundcolor@y! is invoked in \!\color! and it \!\xdef!ines
% $|\pcol@bg@colpr|{\cdot}a'$ to let it have whatever \!\current@color! has.
%
% \SpecialArrayIndex{a}{\pcol@bg@color@}
% \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
%
% \begin{macrocode}
\def\pcol@backgroundcolor@x#1\@nil{\begingroup
\let\set@color\pcol@backgroundcolor@y \color}
\def\pcol@backgroundcolor@y{%
\expandafter\xdef\csname pcol@bg@color@\pcol@bg@region\endcsname
{\current@color}%
\endgroup}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \KeepSpace{2}
% \begin{macro}{\pcol@backgroundcolor@z}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{nobackgroundcolor}.}
% \begin{macro}{\pcol@backgroundcolor@w}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor}.}
% \begin{macro}{\pcol@backgroundcolor@wi}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor} and
% \cs{nobackgroundcolor}.}
% \begin{macro}{\pcol@bg@color@xx}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor} and
% \cs{nobackgroundcolor}.}
%
% The macro \!\pcol@backgroundcolor@z! is invoked from
% \!\pcol@backgroundcolor@ii! directly to work for \!\nobackgroundcolor! to
% disable the \bgpaint{} for a region $a'=\!\pcol@bg@region!$, or from
% \!\pcol@backgroundcolor! and \!\pcol@backgroundcolor@i! through
% \!\pcol@backgroundcolor@e! when they find an error in the argument
% $\arg{region}$ of \!\nobackground~color!. Similarly the macro
% \!\pcol@backgroundcolor@w! is invoked from \!\pcol@background~color@ii!
% directly when it finds no coloring packages have not been loaded, or
% \!\pcol@backgroundcolor! and \!\pcol@backgroundcolor@i! through
% \!\pcol@backgroundcolor@e! on error too but in the argument of
% \!\backgroundcolor!. Both macros throw away whatever remains in
% $\arg{region}$ unprocessed and then invoke \!\pcol@backgroundcolor@wi!,
% but \!\pcol@backgroundcolor@z! gives it a dummy argument pair, while
% \!\pcol@backgroundcolor@w! passes \oarg{mode}\marg{color} to it.
%
% Then \!\pcol@backgroundcolor@wi! throw all arguments away and lets
% $|\pcol@bg@color@|{\cdot}a'\~=\!\relax!$ so that the region $a'$ is
% untouched in \bgpaint{} macros. Note that since
% $a'=|xx|$ being an absolutely non-exsistent region when this macro is used
% for error recovery, undefining \pcol@bg@color@xx is not harmful.
%
% \begin{macrocode}
\def\pcol@backgroundcolor@z#1\@nil{\pcol@backgroundcolor@wi[]{}}
\def\pcol@backgroundcolor@w#1\@nil{\@ifnextchar[%]
\pcol@backgroundcolor@wi{\pcol@backgroundcolor@wi[]}}
\def\pcol@backgroundcolor@wi[#1]#2{%
\expandafter\global\expandafter\let
\csname pcol@bg@color@\pcol@bg@region\endcsname\relax}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \KeepSpace{2}
% \begin{macro}{\pcol@bg@mayhavecol@c}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor} and
% \cs{nobackgroundcolor}.}
% \begin{macro}{\pcol@bg@mayhavecol@C}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor} and
% \cs{nobackgroundcolor}.}
% \begin{macro}{\pcol@bg@mayhavecol@g}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor} and
% \cs{nobackgroundcolor}.}
% \begin{macro}{\pcol@bg@mayhavecol@G}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor} and
% \cs{nobackgroundcolor}.}
%
% The macros $|\pcol@bg@mayhavecol@|{\cdot}a$ where $a\in\{|c|,|C|,|g|,|G|\}$
% are used in \!\pcol@background~color@i! when the region specifier $a$ in
% $\arg{region}$ argument of \!\backgroundcolor! or \!\noback~groundcolor! is
% followed by optional $|[|c|]|$, so that the invoker macro examines if $a$
% can have the optional column oridinal.
%
% \SpecialArrayMainIndex{a}{\pcol@bg@mayhavecol@}
%
% Therefore, the macros just need not to be \!\relax! and thus commonly have
% empty bodies.
%
% \begin{macrocode}
\def\pcol@bg@mayhavecol@c{}
\def\pcol@bg@mayhavecol@C{}
\def\pcol@bg@mayhavecol@g{}
\def\pcol@bg@mayhavecol@G{}
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\pcol@bg@defext}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{backgroundcolor}.}
% The macro $\!\pcol@bg@defext!\Arg{d}\Arg{e}$ is used by
% \!\pcol@backgroundcolor@iii!,
% \!\pcol@back~groundcolor@iv! and \!\pcol@backgroundcolor@v! to \!\def!ine
% $|\pcol@bg@ext@|{\cdot}d{\cdot}|@|{\cdot}a'$ be $e=0$ for all
% $d\in\{|l|,|r|,|t|,|b|\}$ in the first, be $e=x_0$ for $d\in\{|l|,|r|\}$
% and $e=y_0$ for $d\in\{|t|,|b|\}$ in the second, and be $e=x_0$, $x_1$,
% $y_0$ and $y_1$ for $d$ being |l|, |r|, |t|, |b| respectively in the last.
%
% \SpecialArrayMainIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
% \SpecialArrayMainIndex
% {d{\cdot}\string\texttt{@}{\cdot}a{\cdot}\string\texttt{@}{\cdot}c}
% {\pcol@bg@ext@}
%
% The macro at first lets \!\@tempdima! have $e$ to confirm $e$ is a proper
% dimension and then \!\xdef!ines
% $|\pcol@bg@ext@|{\cdot}d{\cdot}|@|{\cdot}a'$ to let it have the integer
% representaion of $e$ followed by |sp|.
%
% \SpecialArrayMainIndex{d{\cdot}\string\texttt{@}{\cdot}a}{\pcol@bg@ext@}
% \SpecialArrayMainIndex
% {d{\cdot}\string\texttt{@}{\cdot}a{\cdot}\string\texttt{@}{\cdot}c}
% {\pcol@bg@ext@}
%
%
% \begin{macrocode}
\def\pcol@bg@defext#1#2{%
\@tempdima#2\relax
\expandafter\xdef\csname pcol@bg@ext@#1@\pcol@bg@region\endcsname{%
\number\@tempdima sp}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\resetbackgroundcolor}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to disable background-paiting for all regions.}
% \begingroup \let\SMALL\small \let\small\footnotesize
% \begin{macro}{\pcol@resetbackgroundcolor}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{resetbackgroundcolor}.}
% \let\small\SMALL
% \begin{macro}{\pcol@bg@defined}
% \changes{v1.3-3}{2013/09/17}
% {Introduced to implement \cs{resetbackgroundcolor}.}
%
% The API macro \!\resetbackgroundcolor! disables \bgpaint{} of all regions
% whose colors have been specified by \!\backgroundcolor!. Since the region
% specifiers $a'_1$, $a'_2$, \ldots, $a'_n$ for which \bgpaint{} is specified
% are recorded in $\!\pcol@bg@defined!=
% \!\@elt!\Arg{a'_1}\!\@elt!\Arg{a'_2}\cdots\!\@elt!\Arg{a'_n}$ by
% \!\pcol@backgroundcolor!, the macro invokes \!\pcol@bg@defined!
% temporarily letting $\!\@elt!=\!\pcol@resetbackgroundcolor!$ to let
% $|\pcol@bg@|\~|color@|{\cdot}a'_i$ be \!\relax! for all $i\in[1,n]$, and
% clears \!\pcol@bg@defined!, whose initial state is also empty.
%
% \SpecialArrayIndex{a}{\pcol@bg@color@}
% \SpecialArrayIndex{a{\cdot}\string\texttt{@}{\cdot}c}{\pcol@bg@color@}
%
% \begin{macrocode}
\def\resetbackgroundcolor{{%
\let\@elt\pcol@resetbackgroundcolor \pcol@bg@defined
\gdef\pcol@bgdefined{}}}
\def\pcol@resetbackgroundcolor#1{%
\expandafter\global\expandafter\let\csname pcol@bg@color@#1\endcsname\relax}
\gdef\pcol@bg@defined{}
% \end{macrocode}
% \end{macro}\end{macro}\endgroup\end{macro}
%
%
%
% \section{Closing Environment}
% \label{sec:imp-end}
%
% \begin{macro}{\endparacol}
% \changes{v1.0}{2011/10/10}
% {Replace \cs{par} with \cs{pcol@par}.}
% \changes{v1.2-2}{2013/05/11}
% {Add pre-flushing column height check and footnote counter
% adjustment.}
% \changes{v1.2-5}{2013/05/11}
% {Remove \cs{global} assignment of \cs{hsize} and \cs{linewidth}
% because assigments of them in \string\texttt{paracol} are now
% perfectly local.}
% \changes{v1.31}{2013/10/10}
% {Add saving $c$ into \cs{pcol@lastcol} to let \cs{pcol@output@end}
% know the column visited last.}
% \begin{macro}{\pcol@lastcol}
% \changes{v1.31}{2013/10/10}
% {Introduced to keep the column visited last to pass its typesetting
% parameters to post-environment.}
%
% The macro \!\endparacol! is invoked from \Endparacol{} to close
% \env{paracol} environment. After making it sure to be in vertical mode by
% \!\pcol@par!, we switch to the column 0 by \!\pcol@switchcol! to let
% \lcounter{} have the values for the column 0 so that they are referred to
% outside the environment, after saving the current column $c$ in
% \!\pcol@lastcol! to be referred to in \!\pcol@output@end! so that
% $\cc_c(\sw)$ and $\cc_c(\ep)$ are passed to \postenv.
%
% \begin{Sloppy}{1800}
% Then we invoke \!\pcol@flushclear! for \pfcheck{}, turning
% $\CSIndex{ifpcol@lastpage}=\true$ to tell \!\pcol@output@switch! for the
% check that it works on the \lpage, and giving $\bot$ to \!\pcol@flushclear!
% as its argument, unless footnote typesetting is \scfnote{} but not
% \mgfnote{} for which we give $\df$ to ensure all deferred footnotes are
% put in the checking process. Note that the argument for \Mcfnote{}
% typesetting is $\df$ but it is definitely $\bot$ in this mode. After that
% we make an \!\output! request by \!\pcol@invokeoutput! with
% $\!\penalty!=\!\pcol@op@end!$ and still with
% $\CSIndex{ifpcol@lastpage}=\true$ to build the \lpage.
% \end{Sloppy}
%
% Next, we let $\!\columnwidth!=\!\textwidth!$ and
% $\CSIndex{if@twocolumn}=\false$ for single-column typesetting, and also
% let $\!\topskip!=\!\pcol@topskip!$ to make it sure that the parameter has
% the value used outside in \env{paracol} environment. Finally, if the
% \counter{footnote} counter adjustment is required by
% $\CSIndex{ifpcol@fncounteradjustment}=\true$, we let
% $\!\c@footnote!=\bf+\nf$.
%
% \begin{macrocode}
%% Closing Environment
\def\endparacol{\pcol@par
\edef\pcol@lastcol{\number\pcol@currcol}%
\pcol@nextcol\z@ \pcol@switchcol
\pcol@lastpagetrue
\ifpcol@mgfnote \pcol@flushclear\voidb@x
\else \pcol@flushclear\pcol@topfnotes
\fi
\pcol@invokeoutput\pcol@op@end
\global\columnwidth\textwidth
\global\@twocolumnfalse
\global\topskip\pcol@topskip
\ifpcol@fncounteradjustment
\global\c@footnote\pcol@footnotebase
\global\advance\c@footnote\pcol@nfootnotes
\fi}
% \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\pcol@restoreeveryvbox}
% \changes{v1.22}{2013/06/30}
% {Introduced to reflect \cs{global} updates on \cs{everyvbox} in
% \string\texttt{paracol} environments.}
%
% The macro \!\pcol@restoreeveryvbox! is invoked just after \Endparacol{} by
% \!\aftergroup! mechanism activated by \!\pcol@zparacol!. It examines if
% \!\pcol@everyvbox! has tokens different from \!\pcol@dummytoken! which
% \!\pcol@zparacol! \!\global!ly assigned to the register. Since the dummy
% token cannot be assigned to \!\everyvbox!\footnote{
%
% Unless a very surprising coincidence happens or a user intentionally
% violates the coherence of the implementation.},
%
% the difference means the \!\everyvbox! has been \!\global!ly updated with
% the value that \!\pcol@everyvbox! has now. Therefore if so, we
% globally update \!\everyvbox! with \!\pcol@everyvbox! to refrect the
% global update in the environment.
%
% \begin{macrocode}
\def\pcol@restoreeveryvbox{%
\expandafter\def\expandafter\reserved@a\expandafter{\the\pcol@everyvbox}%
\def\reserved@b{\pcol@dummytoken}%
\ifx\reserved@a\reserved@b\else \global\everyvbox\pcol@everyvbox \fi}
% \end{macrocode}
% \end{macro}
%\iffalse
%</paracol>
%\fi
\endinput
|