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
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665
21666
21667
21668
21669
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
21707
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
21740
21741
21742
21743
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772
21773
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863
21864
21865
21866
21867
21868
21869
21870
21871
21872
21873
21874
21875
21876
21877
21878
21879
21880
21881
21882
21883
21884
21885
21886
21887
21888
21889
21890
21891
21892
21893
21894
21895
21896
21897
21898
21899
21900
21901
21902
21903
21904
21905
21906
21907
21908
21909
21910
21911
21912
21913
21914
21915
21916
21917
21918
21919
21920
21921
21922
21923
21924
21925
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940
21941
21942
21943
21944
21945
21946
21947
21948
21949
21950
21951
21952
21953
21954
21955
21956
21957
21958
21959
21960
21961
21962
21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
21974
21975
21976
21977
21978
21979
21980
21981
21982
21983
21984
21985
21986
21987
21988
21989
21990
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
22006
22007
22008
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020
22021
22022
22023
22024
22025
22026
22027
22028
22029
22030
22031
22032
22033
22034
22035
22036
22037
22038
22039
22040
22041
22042
22043
22044
22045
22046
22047
22048
22049
22050
22051
22052
22053
22054
22055
22056
22057
22058
22059
22060
22061
22062
22063
22064
22065
22066
22067
22068
22069
22070
22071
22072
22073
22074
22075
22076
22077
22078
22079
22080
22081
22082
22083
22084
22085
22086
22087
22088
22089
22090
22091
22092
22093
22094
22095
22096
22097
22098
22099
22100
22101
22102
22103
22104
22105
22106
22107
22108
22109
22110
22111
22112
22113
22114
22115
22116
22117
22118
22119
22120
22121
22122
22123
22124
22125
22126
22127
22128
22129
22130
22131
22132
22133
22134
22135
22136
22137
22138
22139
22140
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150
22151
22152
22153
22154
22155
22156
22157
22158
22159
22160
22161
22162
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174
22175
22176
22177
22178
22179
22180
22181
22182
22183
22184
22185
22186
22187
22188
22189
22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
22215
22216
22217
22218
22219
22220
22221
22222
22223
22224
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
22248
22249
22250
22251
22252
22253
22254
22255
22256
22257
22258
22259
22260
22261
22262
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281
22282
22283
22284
22285
22286
22287
22288
22289
22290
22291
22292
22293
22294
22295
22296
22297
22298
22299
22300
22301
22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
22321
22322
22323
22324
22325
22326
22327
22328
22329
22330
22331
22332
22333
22334
22335
22336
22337
22338
22339
22340
22341
22342
22343
22344
22345
22346
22347
22348
22349
22350
22351
22352
22353
22354
22355
22356
22357
22358
22359
22360
22361
22362
22363
22364
22365
22366
22367
22368
22369
22370
22371
22372
22373
22374
22375
22376
22377
22378
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390
22391
22392
22393
22394
22395
22396
22397
22398
22399
22400
22401
22402
22403
22404
22405
22406
22407
22408
22409
22410
22411
22412
22413
22414
22415
22416
22417
22418
22419
22420
22421
22422
22423
22424
22425
22426
22427
22428
22429
22430
22431
22432
22433
22434
22435
22436
22437
22438
22439
22440
22441
22442
22443
22444
22445
22446
22447
22448
22449
22450
22451
22452
22453
22454
22455
22456
22457
22458
22459
22460
22461
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485
22486
22487
22488
22489
22490
22491
22492
22493
22494
22495
22496
22497
22498
22499
22500
22501
22502
22503
22504
22505
22506
22507
22508
22509
22510
22511
22512
22513
22514
22515
22516
22517
22518
22519
22520
22521
22522
22523
22524
22525
22526
22527
22528
22529
22530
22531
22532
22533
22534
22535
22536
22537
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558
22559
22560
22561
22562
22563
22564
22565
22566
22567
22568
22569
22570
22571
22572
22573
22574
22575
22576
22577
22578
22579
22580
22581
22582
22583
22584
22585
22586
22587
22588
22589
22590
22591
22592
22593
22594
22595
22596
22597
22598
22599
22600
22601
22602
22603
22604
22605
22606
22607
22608
22609
22610
22611
22612
22613
22614
22615
22616
22617
22618
22619
22620
22621
22622
22623
22624
22625
22626
22627
22628
22629
22630
22631
22632
22633
22634
22635
22636
22637
22638
22639
22640
22641
22642
22643
22644
22645
22646
22647
22648
22649
22650
22651
22652
22653
22654
22655
22656
22657
22658
22659
22660
22661
22662
22663
22664
22665
22666
22667
22668
22669
22670
22671
22672
22673
22674
22675
22676
22677
22678
22679
22680
22681
22682
22683
22684
22685
22686
22687
22688
22689
22690
22691
22692
22693
22694
22695
22696
22697
22698
22699
22700
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711
22712
22713
22714
22715
22716
22717
22718
22719
22720
22721
22722
22723
22724
22725
22726
22727
22728
22729
22730
22731
22732
22733
22734
22735
22736
22737
22738
22739
22740
22741
22742
22743
22744
22745
22746
22747
22748
22749
22750
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775
22776
22777
22778
22779
22780
22781
22782
22783
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
22798
22799
22800
22801
22802
22803
22804
22805
22806
22807
22808
22809
22810
22811
22812
22813
22814
22815
22816
22817
22818
22819
22820
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840
22841
22842
22843
22844
22845
22846
22847
22848
22849
22850
22851
22852
22853
22854
22855
22856
22857
22858
22859
22860
22861
22862
22863
22864
22865
22866
22867
22868
22869
22870
22871
22872
22873
22874
22875
22876
22877
22878
22879
22880
22881
22882
22883
22884
22885
22886
22887
22888
22889
22890
22891
22892
22893
22894
22895
22896
22897
22898
22899
22900
22901
22902
22903
22904
22905
22906
22907
22908
22909
22910
22911
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932
22933
22934
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
22950
22951
22952
22953
22954
22955
22956
22957
22958
22959
22960
22961
22962
22963
22964
22965
22966
22967
22968
22969
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
23017
23018
23019
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
23035
23036
23037
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
23053
23054
23055
23056
23057
23058
23059
23060
23061
23062
23063
23064
23065
23066
23067
23068
23069
23070
23071
23072
23073
23074
23075
23076
23077
23078
23079
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101
23102
23103
23104
23105
23106
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119
23120
23121
23122
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
23137
23138
23139
23140
23141
23142
23143
23144
23145
23146
23147
23148
23149
23150
23151
23152
23153
23154
23155
23156
23157
23158
23159
23160
23161
23162
23163
23164
23165
23166
23167
23168
23169
23170
23171
23172
23173
23174
23175
23176
23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323
23324
23325
23326
23327
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
23389
23390
23391
23392
23393
23394
23395
23396
23397
23398
23399
23400
23401
23402
23403
23404
23405
23406
23407
23408
23409
23410
23411
23412
23413
23414
23415
23416
23417
23418
23419
23420
23421
23422
23423
23424
23425
23426
23427
23428
23429
23430
23431
23432
23433
23434
23435
23436
23437
23438
23439
23440
23441
23442
23443
23444
23445
23446
23447
23448
23449
23450
23451
23452
23453
23454
23455
23456
23457
23458
23459
23460
23461
23462
23463
23464
23465
23466
23467
23468
23469
23470
23471
23472
23473
23474
23475
23476
23477
23478
23479
23480
23481
23482
23483
23484
23485
23486
23487
23488
23489
23490
23491
23492
23493
23494
23495
23496
23497
23498
23499
23500
23501
23502
23503
23504
23505
23506
23507
23508
23509
23510
23511
23512
23513
23514
23515
23516
23517
23518
23519
23520
23521
23522
23523
23524
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
23540
23541
23542
23543
23544
23545
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563
23564
23565
23566
23567
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580
23581
23582
23583
23584
23585
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602
23603
23604
23605
23606
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619
23620
23621
23622
23623
23624
23625
23626
23627
23628
23629
23630
23631
23632
23633
23634
23635
23636
23637
23638
23639
23640
23641
23642
23643
23644
23645
23646
23647
23648
23649
23650
23651
23652
23653
23654
23655
23656
23657
23658
23659
23660
23661
23662
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690
23691
23692
23693
23694
23695
23696
23697
23698
23699
23700
23701
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
23713
23714
23715
23716
23717
23718
23719
23720
23721
23722
23723
23724
23725
23726
23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752
23753
23754
23755
23756
23757
23758
23759
23760
23761
23762
23763
23764
23765
23766
23767
23768
23769
23770
23771
23772
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824
23825
23826
23827
23828
23829
23830
23831
23832
23833
23834
23835
23836
23837
23838
23839
23840
23841
23842
23843
23844
23845
23846
23847
23848
23849
23850
23851
23852
23853
23854
23855
23856
23857
23858
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934
23935
23936
23937
23938
23939
23940
23941
23942
23943
23944
23945
23946
23947
23948
23949
23950
23951
23952
23953
23954
23955
23956
23957
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967
23968
23969
23970
23971
23972
23973
23974
23975
23976
23977
23978
23979
23980
23981
23982
23983
23984
23985
23986
23987
23988
23989
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
24012
24013
24014
24015
24016
24017
24018
24019
24020
24021
24022
24023
24024
24025
24026
24027
24028
24029
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
24087
24088
24089
24090
24091
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
24113
24114
24115
24116
24117
24118
24119
24120
24121
24122
24123
24124
24125
24126
24127
24128
24129
24130
24131
24132
24133
24134
24135
24136
24137
24138
24139
24140
24141
24142
24143
24144
24145
24146
24147
24148
24149
24150
24151
24152
24153
24154
24155
24156
24157
24158
24159
24160
24161
24162
24163
24164
24165
24166
24167
24168
24169
24170
24171
24172
24173
24174
24175
24176
24177
24178
24179
24180
24181
24182
24183
24184
24185
24186
24187
24188
24189
24190
24191
24192
24193
24194
24195
24196
24197
24198
24199
24200
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
24251
24252
24253
24254
24255
24256
24257
24258
24259
24260
24261
24262
24263
24264
24265
24266
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289
24290
24291
24292
24293
24294
24295
24296
24297
24298
24299
24300
24301
24302
24303
24304
24305
24306
24307
24308
24309
24310
24311
24312
24313
24314
24315
24316
24317
24318
24319
24320
24321
24322
24323
24324
24325
24326
24327
24328
24329
24330
24331
24332
24333
24334
24335
24336
24337
24338
24339
24340
24341
24342
24343
24344
24345
24346
24347
24348
24349
24350
24351
24352
24353
24354
24355
24356
24357
24358
24359
24360
24361
24362
24363
24364
24365
24366
24367
24368
24369
24370
24371
24372
24373
24374
24375
24376
24377
24378
24379
24380
24381
24382
24383
24384
24385
24386
24387
24388
24389
24390
24391
24392
24393
24394
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
24408
24409
24410
24411
24412
24413
24414
24415
24416
24417
24418
24419
24420
24421
24422
24423
24424
24425
24426
24427
24428
24429
24430
24431
24432
24433
24434
24435
24436
24437
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448
24449
24450
24451
24452
24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
24468
24469
24470
24471
24472
24473
24474
24475
24476
24477
24478
24479
24480
24481
24482
24483
24484
24485
24486
24487
24488
24489
24490
24491
24492
24493
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506
24507
24508
24509
24510
24511
24512
24513
24514
24515
24516
24517
24518
24519
24520
24521
24522
24523
24524
24525
24526
24527
24528
24529
24530
24531
24532
24533
24534
24535
24536
24537
24538
24539
24540
24541
24542
24543
24544
24545
24546
24547
24548
24549
24550
24551
24552
24553
24554
24555
24556
24557
24558
24559
24560
24561
24562
24563
24564
24565
24566
24567
24568
24569
24570
24571
|
.ig
Mom -- a typesetting/document-processing macro set for groff.
Copyright (C) 2002-2020 Free Software Foundation, Inc.
Written by Peter Schaffter <peter@schaffter.ca>
PDF integration contributed by Deri James <deri.james@chuzzlewit.co.uk>
This file is part of groff.
groff is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
groff is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Version 2.5_d
-------------
Antoine de St-Exupéry asserted that elegance in engineering is
achieved not when there is nothing left to add, but when there is
nothing left to take away.
By those standards, mom is a Rube Goldberg contraption. She was
created over the years while groff, and my understanding of it,
changed and evolved. However, I'm a firm believer in "if it ain't
broke, don't fix it." Version 2.0 removed some of the redundancies
and cruft, but mom still needs some nip and tuck.
"<anything>" in the description of arguments that can be passed
to a macro means that any argument turns the feature off.
Thanks to everyone who has contributed suggestions and patches,
and to those whose GPL'd work has been plundered. Special thanks
to Werner Lemberg (margin notes), Tadziu Hoffman (underlining),
Deri James (pdf integration), Robin Haberkorn (tbl integration, eqn
extensions, and float management).
..
\#
\# ====================================================================
\#
.if \n(.C \
. ab [mom]: The groff mom macros do not work in compatibility mode.
\# Check that GNU troff is being run
.if !\n[.g]=1 \
. ab [mom]: The mom macros require that you be running GNU troff.
\# Check which version of groff is being run
.if (\n[.x]\n[.y] < 118) \
. ab [mom]: You need GNU troff version 1.18 or higher to run this version of mom.
\# Mom version
.ds version 2.5_d
.if dVERSION \{\
. ab [mom]: Version \*[version]
.\}
\# Groff revision
.ds short_revision \n[.Y]
.substring short_revision 0 0
\#
\# Add supplementary styles
.sty \n[.fp] UL \" Ultra Light
.sty \n[.fp] ULI \" Ultra Light Italic
.sty \n[.fp] ULCD \" Ultra Light Condensed
.sty \n[.fp] ULCDI \" Ultra Light Condensed Italic
.sty \n[.fp] ULEX \" Ultra Light Extended
.sty \n[.fp] ULEXI \" Ultra Light Extended Italic
\#
.sty \n[.fp] XL \" Extra Light
.sty \n[.fp] XLI \" Extra Light Italic
.sty \n[.fp] XLCD \" Extra Light Condensed
.sty \n[.fp] XLCDI \" Extra Light Condensed Italic
.sty \n[.fp] XLEX \" Extra Light Extended
.sty \n[.fp] XLEXI \" Extra Light Extended Italic
\#
.sty \n[.fp] TH \" Thin
.sty \n[.fp] THI \" Thin Italic
.sty \n[.fp] THCD \" Thin Condensed
.sty \n[.fp] THCDI \" Thin Condensed Italic
.sty \n[.fp] THEX \" Thin Extended
.sty \n[.fp] THEXI \" Thin Extended Italic
\#
.sty \n[.fp] L \" Light Roman
.sty \n[.fp] LI \" Light Italic
.sty \n[.fp] LCD \" Light Condensed
.sty \n[.fp] LCDI \" Light Condensed Italic
.sty \n[.fp] LEX \" Light Extended
.sty \n[.fp] LEXI \" Light Extended Italic
\#
.sty \n[.fp] BK \" Book Roman
.sty \n[.fp] BKI \" Book Italic
.sty \n[.fp] BKCD \" Book Condensed
.sty \n[.fp] BKCDI \" Book Condensed Italic
.sty \n[.fp] BKEX \" Book Extended
.sty \n[.fp] BKEXI \" Book Extended Italic
\#
.sty \n[.fp] CD \" Medium Condensed
.sty \n[.fp] CDI \" Medium Condensed Italic
.sty \n[.fp] EX \" Medium Extended
.sty \n[.fp] EXI \" Medium Extended Italic
\#
.sty \n[.fp] DB \" DemiBold Roman
.sty \n[.fp] DBI \" DemiBold Italic
.sty \n[.fp] DBCD \" DemiBold Condensed
.sty \n[.fp] DBCDI \" DemiBold Condensed Italic
.sty \n[.fp] DBEX \" DemiBold Extended
.sty \n[.fp] DBEXI \" DemiBold Extended Italic
\#
.sty \n[.fp] SB \" SemiBold Roman
.sty \n[.fp] SBI \" SemiBold Italic
.sty \n[.fp] SBCD \" SemiBold Condensed
.sty \n[.fp] SBCDI \" SemiBold Condensed Italic
.sty \n[.fp] SBEX \" SemiBold Extended
.sty \n[.fp] SBEXI \" SemiBold Extended Italic
\#
.sty \n[.fp] BCD \" Bold Condensed
.sty \n[.fp] BCDI \" Bold Condensed Italic
.sty \n[.fp] BEX \" Bold Extended
.sty \n[.fp] BEXI \" Bold Extended Italic
.sty \n[.fp] BO \" Bold Outline
\#
.sty \n[.fp] XB \" Extra Bold
.sty \n[.fp] XBI \" Extra Bold Italic
.sty \n[.fp] XBCD \" Extra Bold Condensed
.sty \n[.fp] XBCDI \" Extra Bold Condensed Italic
.sty \n[.fp] XBEX \" Extra Bold Extended
.sty \n[.fp] XBEXI \" Extra Bold Extended Italic
\#
.sty \n[.fp] UB \" Ultra Bold
.sty \n[.fp] UBI \" Ultra Bold Italic
.sty \n[.fp] UBCD \" Ultra Bold Condensed
.sty \n[.fp] UBCDI \" Ultra Bold Condensed Italic
.sty \n[.fp] UBEX \" Ultra Bold Extended
.sty \n[.fp] UBEXI \" Ultra Bold Extended Italic
\#
.sty \n[.fp] HV \" Heavy
.sty \n[.fp] HVI \" Heavy Italic
.sty \n[.fp] HVCD \" Heavy Condensed
.sty \n[.fp] HVCDI \" Heavy Condensed Italic
.sty \n[.fp] HVEX \" Heavy Extended
.sty \n[.fp] HVEXI \" Heavy Extended Italic
\#
.sty \n[.fp] BL \" Black
.sty \n[.fp] BLI \" Black Italic
.sty \n[.fp] BLCD \" Black Condensed
.sty \n[.fp] BLCDI \" Black Condensed Italic
.sty \n[.fp] BLEX \" Black Extended
.sty \n[.fp] BLEXI \" Black Extended Italic
.sty \n[.fp] BLO \" Black Outline
\#
.sty \n[.fp] XBL \" Extra Black
.sty \n[.fp] XBLI \" Extra Black Italic
.sty \n[.fp] XBLCD \" Extra Black
.sty \n[.fp] XBLCDI \" Extra Black
.sty \n[.fp] XBLEX \" Extra Black Italic
.sty \n[.fp] XBLEXI \" Extra Black Italic
\#
.sty \n[.fp] UBL \" Ultra Black
.sty \n[.fp] UBLI \" Ultra Black Italic
.sty \n[.fp] UBLCD \" Ultra Black Condensed
.sty \n[.fp] UBLCDI \" Ultra Black Condensed Italic
.sty \n[.fp] UBLEX \" Ultra Black Extended
.sty \n[.fp] UBLEXI \" Ultra Black Extended Italic
\#
.sty \n[.fp] SC \" Small Caps Roman
.sty \n[.fp] SCI \" Small Caps Italic
.sty \n[.fp] SCDB \" Small Caps Demibold
.sty \n[.fp] SCDBI \" Small Caps Demibold Italic
.sty \n[.fp] SCSB \" Small Caps Semibold
.sty \n[.fp] SCSBI \" Small Caps Semibold Italic
\#
\# Instruct grops to use square linecaps and joins.
\# This instruction is also executed in DO_B_MARGIN, NEWPAGE, and HEADER
\#
.if !n \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
\#
\# The following PostScript, provided by Tadziu Hoffmann, permits
\# no-fail underlining
\#
.de ul*ps
ps: def
grops begin
/decornone { grops begin /X { } def /Y { } def /y2 -1 def end } def
/decorline { grops begin u neg /uld exch def u /ulw exch def
/X { currentpoint /y0 exch def /x0 exch def } def
/Y { currentpoint /y1 exch def /x1 exch def
drawline /x2 x1 def /y2 y1 def } def end } def
/drawline { gsave ulw setlinewidth 0 setlinecap x1 y1 uld sub moveto
y2 y0 eq { x2 y2 } { x0 y0 } ifelse uld sub lineto stroke
grestore } def
decornone
/uld 0 def
/ulw 0 def
/A { X show Y } def
/B { 0 SC 3 -1 roll X widthshow Y } def
/C { 0 exch X ashow Y } def
/D { 0 exch 0 SC 5 2 roll X awidthshow Y } def
/E { 0 rmoveto X show Y } def
/F { 0 rmoveto 0 SC 3 -1 roll X widthshow Y } def
/G { 0 rmoveto 0 exch X ashow Y } def
/H { 0 rmoveto 0 exch 0 SC 5 2 roll X awidthshow Y } def
/I { 0 exch rmoveto X show Y } def
/J { 0 exch rmoveto 0 SC 3 -1 roll X widthshow Y } def
/K { 0 exch rmoveto 0 exch X ashow Y } def
/L { 0 exch rmoveto 0 exch 0 SC 5 2 roll X awidthshow Y } def
/M { rmoveto X show Y } def
/N { rmoveto 0 SC 3 -1 roll X widthshow Y } def
/O { rmoveto 0 exch X ashow Y } def
/P { rmoveto 0 exch 0 SC 5 2 roll X awidthshow Y } def
/Q { moveto X show Y } def
/R { moveto 0 SC 3 -1 roll X widthshow Y } def
/S { moveto 0 exch X ashow Y } def
/T { moveto 0 exch 0 SC 5 2 roll X awidthshow Y } def
end
..
\#
.if !n \Y[ul*ps]
.if n .color 0
.nr TOC.RELOCATE 0 \" TOC.RELOCATE is off by default
.ds PDFHREF.TEXTCOL.DEFAULT 0.0 0.3 0.9
.nr PDFHREF.VIEW.LEADING.C 3i
.nr PDFHREF.VIEW.LEADING.T 1i
.nr PDFHREF.VIEW.LEADING 0
.nr PDFHREF.VIEW.LEADING.H \n[PDFHREF.VIEW.LEADING]
\#
\# ====================================================================
\#
\# TYPESETTING MACROS, STRINGS, AND ALIASES
\# ========================================
\#
\# +++ALIASES+++
\#
\# Alias .als as ALIAS, and .aln (number registers) as ALIASN
\#
.als ALIAS als
.als ALIASN aln
\#
\# ALIASES FOR GROFF REQUESTS
\# --------------------------
\#
.ALIAS MAC de
.ALIAS BR br
.ALIAS SPREAD brp
.ALIAS ESC_CHAR ec
.ALIAS STRING ds
.ALIAS INCLUDE so
\#
\# ALIASES FOR NUMBER REGISTERS
\# ----------------------------
\#
.ALIASN #PT_SIZE .ps \"fractional point size in units
.ALIASN #DIVER_DEPTH dn \"diversion depth
.ALIASN #DIVER_WIDTH dl \"diversion width
.ALIASN #TRAP_DISTANCE .t \"distance to next trap
.ALIASN #LEAD .v \"line space
.ALIASN #PAGE_LENGTH .p \"page length
.ALIASN #NUM_ARGS .$ \"number of arguments passed to a macro
.ALIASN #INDENT .i \"value of current indent
\#
\# ====================================================================
\#
\# MISCELLANEOUS
\# =============
.nr #L_MARGIN \n[.o] \" Tabs, etc require #L_MARGIN
.cflags 4 /\[en] \" So slash and en-dashes get broken
\#
\# 'END' is used throughout as the 2nd arg to 'MAC' (alias of .de)
\# Defining it as a macro here prevents groff from complaining
\# that 'END' isn't defined.
\#
.de END
..
\#
\# ====================================================================
\#
\# +++PAGE LAYOUT+++
\#
\# Macros that control the physical layout of the page: paper size
\# and margins.
\#
\# PAGE WIDTH
\# ----------
\# *Argument:
\# <width of printer sheet>
\# *Function:
\# Stores user supplied page width in register #PAGE_WIDTH.
\# *Notes:
\# #PAGE_WIDTH is used to establish the default LL (and right margin).
\# Requires unit of measure.
\#
.MAC PAGEWIDTH END
. br
. nr #PAGE_WIDTH \\$1
. if !r#L_MARGIN .L_MARGIN \\n[.o]
. if !r#R_MARGIN .R_MARGIN 1i
. if '\\*[.T]'pdf' \X'papersize=\\n[#PAGE_WIDTH]z,\\n[#PAGE_LENGTH]z'\c
.END
\#
\# L_MARGIN
\# --------
\# *Argument:
\# <offset from page left>
\# *Function:
\# Stores user supplied page offset in register #L_MARGIN.
\# Sets .po to user supplied offset.
\# *Notes:
\# Requires unit of measure.
\#
.MAC L_MARGIN END
. br
. nr #L_MARGIN (\\$1)
. po \\n[#L_MARGIN]u
.END
\#
\# R_MARGIN
\# --------
\# *Argument:
\# <width of right margin>
\# *Function:
\# Stores user supplied right margin in register #R_MARGIN.
\# *Notes:
\# This is a pseudo-margin. Right margin is actually a function of
\# line length. The macro calculates line length from the page offset
\# and the value plugged into #R_MARGIN.
\#
\# N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
\#
\# Requires unit of measure.
\#
.MAC R_MARGIN END
. br
. nr #R_MARGIN (\\$1)
. ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u
. ta \\n[.l]u
. nr #L_LENGTH \\n[.l]
.END
\#
\# T_MARGIN
\# --------
\# *Argument:
\# <distance to advance from top of page>
\# *Function:
\# Stores the user supplied top margin in register #T_MARGIN.
\# Advances user supplied depth from the top of the page.
\# *Notes:
\# Requires unit of measure.
\#
.MAC T_MARGIN END
. nr #T_MARGIN (\\$1)
. if !\\n[#DOCS] .sp |\\n[#T_MARGIN]u-1v
. wh 0i DO_T_MARGIN
.END
\#
\# B_MARGIN
\# --------
\# *Argument:
\# <space to leave at the bottom of the page>
\# *Function:
\# Stores the user supplied bottom margin in register #B_MARGIN.
\# *Notes:
\# Requires unit of measure.
\#
.MAC B_MARGIN END
. br
. nr #B_MARGIN (\\$1)
. nr #ORIGINAL_B_MARGIN \\n[#B_MARGIN]
. nr #B_MARGIN_SET 1
. wh -\\n[#B_MARGIN]u DO_B_MARGIN
.END
\#
\# PAGE
\# ----
\# *Arguments:
\# <pagewidth> [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]]
\# *Function:
\# Page set-up. Collects arguments and passes them to the appropriate
\# macros.
\# *Notes:
\# All arguments after pagewidth are optional, but must appear
\# in the order given above. (User can fill in as much or as
\# little as desired.)
\#
\# All arguments require a unit of measure.
\#
.MAC PAGE END
. br
. PAGEWIDTH \\$1
. PAGELENGTH \\$2
. ie '\\$3'' .L_MARGIN \\n[.o]
. el .L_MARGIN \\$3
. ie '\\$4'' .R_MARGIN 1i
. el .R_MARGIN \\$4
. if !'\\$5'' .T_MARGIN \\$5
. if !'\\$6'' .B_MARGIN \\$6
.END
\#
\# gropdf: pass pagelength to postprocessor; no need for -P-p
\#
.MAC PAGELENGTH END
. pl \\$*
. if '\\*[.T]'pdf' \X'papersize=\\n[#PAGE_WIDTH]z,\\n[#PAGE_LENGTH]z'\c
.END
\#
\# =====================================================================
\#
\# +++PAGE CONTROL+++
\#
\# Generic macros for breaking pages.
\#
\# DO_T_MARGIN
\# -----------
\# *Argument:
\# <none>
\# *Function:
\# Plants the top margin at the top of each page.
\# *Notes:
\# The trap is set in .T_MARGIN or .PAGE
\#
.MAC DO_T_MARGIN END
. ev T_MARGIN
. sp |\\n[#T_MARGIN]u-1v
. ev
.END
\#
\# DO_B_MARGIN
\# -----------
\# *Argument:
\# <none>
\# *Function:
\# Plants the bottom margin at the bottom of each page.
\# *Notes:
\# The trap is set in .B_MARGIN or .PAGE.
\#
.MAC DO_B_MARGIN END
. nr #T_MARGIN_LEAD_ADJ \\n[#LEAD]-12000
. ev B_MARGIN
. if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
. ie \\n[#DOCS] \
. if !\\n[#NEWPAGE] .bp
. el .bp
. ev
.END
\#
\# NEWPAGE
\# -------
\# *Argument:
\# <none>
\# *Function:
\# Breaks to a new page.
\# *Notes:
\# If a B_MARGIN has been set, processes that, otherwise, just
\# breaks to a new page.
\#
.MAC NEWPAGE END
. br
. if \\n[#DOC_TYPE]=5 \{\
. if \\n[#NUM_ARGS]>0 \
. pdftransition PAGE \\$1
. \}
. if !\\n[defer] \{\
. nr #NEWPAGE 1
. rr tbl*no-print-header
. \}
. ie !\\n[#DOCS]=1 \
. if \\n[#B_MARGIN_SET]=1 .DO_B_MARGIN
. el \{\
. if (\\n[#COLUMNS]=1):(\\n[#COLUMNS]=2) .nr #COL_NUM \\n[#NUM_COLS]
. if !\\n[#FN_DEPTH] \{\
. ch FN_OVERFLOW_TRAP
. nr #RESET_FN_OVERFLOW_TRAP 1
. \}
. \}
. if dPDF.EXPORT \
. if \\n[#FLEX_ACTIVE] \
. if !\\n[#NO_FLEX] \
. tm .ds pre-newpage-\\n% \\n%@\\n[#COL_NUM]
. ie \\n[#DOCS]=1 \{\
. if (\\n[@TOP]=0):(\\n[#END_COVER]=1) .bp
. rr #END_COVER
. if \\n[#RESET_FN_OVERFLOW_TRAP] \{\
. wh -\\n[#FN_OVERFLOW_TRAP_POS]u FN_OVERFLOW_TRAP
. rr #RESET_FN_OVERFLOW_TRAP_POS
. \}
. \}
. el .if !\\n[#B_MARGIN_SET]=1 .bp
.END
\#
.ALIAS NEWSLIDE NEWPAGE
\#
\# =====================================================================
\#
\# +++GENERAL STYLE MACROS+++
\#
\# LINE LENGTH
\# -----------
\# *Argument:
\# <line length>
\# *Function:
\# Stores user supplied line length in register #L_LENGTH.
\# Sets .ll to #L_LENGTHu
\# *Notes:
\# Requires unit of measure.
\#
.MAC LL END
. nr #USER_SET_L_LENGTH 1
. ll \\$1
. nr #L_LENGTH \\n[.l]
. ta \\n[.l]u
.END
\#
\# +++FAMILY AND FONT+++
\#
\# FALLBACK FONT
\# -------------
\# *Argument:
\# <fallback font> [ ABORT | WARN ] | ABORT | WARN
\# *Function:
\# Sets register #ABORT_FT_ERRORS to 1, or defines a fallback font
\# called "dummy" at font position 0.
\# *Notes:
\# Calls to non-existent families cause mom to continue processing
\# files using the fallback font until a valid family is entered.
\#
\# Calls to non-existent fonts generate warnings. If ABORT is passed
\# to FALLBACK_FONT, mom stops processing files after the warning.
\# Otherwise, she continues to process files using the fallback font
\# after the warning is issued. The default fallback font is CR; the
\# default for font warnings is to abort.
\#
.MAC FALLBACK_FONT END
. if \\n[#NUM_ARGS]=1 \{\
. if '\\$1'ABORT' .nr #ABORT_FT_ERRORS 1
. if '\\$1'WARN' \
. if r #ABORT_FT_ERRORS .nr #ABORT_FT_ERRORS 0
. if !'\\$1'ABORT' \
. if !'\\$1'WARN' .fp 0 dummy \\$1
. \}
. if \\n[#NUM_ARGS]=2 \{\
. fp 0 dummy \\$1
. if '\\$2'ABORT' .nr #ABORT_FT_ERRORS 1
. if '\\$2'WARN' .nr #ABORT_FT_ERRORS 0
. \}
.END
\#
.FALLBACK_FONT CR ABORT
\#
\# FAMILY
\# ------
\# *Argument:
\# <font family>
\# *Function:
\# Stores user supplied font family in string $FAMILY. Sets .fam
\# to $FAMILY.
\#
.MAC FAMILY END
. if '\\n[.ev]'COVER_TEXT' .ds $SAVED_DOC_FAM \\n[.fam]
. if \\n[#COLLATE] .rm $SAVED_DOC_FAM
. ds $FAMILY \\$1
. if \\n[#PRINT_STYLE]=1 \{\
. fam \\*[$TYPEWRITER_FAM]
. return
. \}
. if \\n[#IGNORE] \{\
. fam \\*[$TYPEWRITER_FAM]
. return
. \}
. if (\\n[.x]\\n[.y]\\*[short_revision] >= 1192) .ds $SAVED_STYLE \\n[.sty]
. ft 0
. fam \\*[$FAMILY]
. if (\\n[.x]\\n[.y]\\*[short_revision] >= 1192) \{\
. ft \\*[$SAVED_STYLE]
. if !F\\n[.fn] .ft 0
. \}
. ie \\n[#PRE_COLLATE]=1 .
. el \{\
. if \\n[#COLLATE]=1 \
. if !r#START .ds $DOC_FAM \\*[$FAMILY]
. \}
.END
\#
\# FONT
\# ----
\# *Argument:
\# R | I | B | BI | <other style extension>
\# *Function:
\# Stores user supplied font in $FONT and sets .ft to $FONT.
\#
.MAC FT END
. ds $FONT \\$1
. if \\n[#PRINT_STYLE]=1 \{\
. ie '\\$1'I' \{\
. if \\n[#UNDERLINE_ITALIC]=1 \{\
. UNDERLINE
. return
. \}
. if \\n[#ITALIC_MEANS_ITALIC]=1 \{\
. ds $FONT \\$1
. ft \\*[$FONT]
. return
. \}
. \}
. el .UNDERLINE OFF
. return
. \}
. ft 0
. ft \\*[$FONT]
. if (\\n[.x]\\n[.y]\\*[short_revision] >= 1192) \{\
. if '\\n[.sty]'' \{\
. if !F\\n[.fn] \{\
. if !S\\*[$FONT] \{\
. tm1 "[mom]: Font style "\\*[$FONT]" at line \\n[.c] has not been registered.
. ie \\n[#ABORT_FT_ERRORS]=0 \
. tm1 " Continuing to process using fallback font.
. el .ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. if \\n[.f]=0 \{\
. tm1 "[mom]: Either font style "\\*[$FONT]" at line \\n[.c] does not exist in family "\\n[.fam]",
. tm1 " or family "\\n[.fam]" has not been installed.
. ie \\n[#ABORT_FT_ERRORS]=0 \
. tm1 " Continuing to process using fallback font.
. el .ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. \}
. \}
. \}
.END
\#
\# POINT SIZE
\# ----------
\# *Arguments:
\# <point size of type>
\# *Function:
\# Sets point size to user supplied value in scaled points.
\# If #AUTO_LEAD is on, resets lead accordingly.
\# *Notes:
\# Must NOT use a unit of measure.
\#
.MAC PT_SIZE END
. if \\n[#PRINT_STYLE]=1 .return
. if \\n[#IGNORE] .return
. ps \\$1
. nr #PT_SIZE_IN_UNITS \\n[.ps]
. ie '\\$0'DOC_PT_SIZE' \{\
. if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0
. br
. nr #NEW_DOC_PT_SIZE \\n[.ps]
. if \\n[#DOC_AUTOLEAD] \{\
. ie !\\n[#DOC_AUTOLEAD_FACTOR] .nr #AUTOLEADING \\n[#DOC_AUTOLEAD]
. el .nr #AUTOLEADING \\n[.ps]*\\n[#DOC_AUTOLEAD]/1000-\\n[.ps]
. nr #DOC_LEAD \\n[.ps]+\\n[#AUTOLEADING]
. nr #RESET_TRAPS 1
. \}
. \}
. el \{\
. if \\n[#AUTO_LEAD] \{\
. nr #SAVED_VS \\n[.v]
. vs \\n[.ps]u+\\n[#AUTOLEADING]u
. \}
. \}
. if \\n[pdfbx-running]=1 \{\
. nr #VS_DIFF \\n[#SAVED_VS]-\\n[.v]
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#VS_DIFF]u
. \}
.END
\#
\# SIZE (inline)
\# -------------
\# *Arguments:
\# <point size of type>
\# *Function:
\# Sets point size to user supplied value in scaled points.
\# Intended to be called inline with \*[SIZE <n><unit>]
\# *Notes:
\# Can be used with a unit of measure or not.
\#
.MAC SIZE END
\c
.ps \\$1
.END
\#
\# LEADING
\# -------
\# *Argument:
\# <leading between lines of text>
\# *Function:
\# Turns off #AUTOLEAD if it's on.
\# Sets .vs to user supplied value.
\# *Notes:
\# Does not require unit of measure. LS automatically turns off AUTOLEAD.
\#
.MAC LS END
. br
. if \\n[#PRINT_STYLE]=1 .return
. if \\n[#IGNORE] .return
. if \\n[#AUTO_LEAD] \{\
. rr #AUTO_LEAD
. rr #AUTOLEAD_VALUE
. rr #AUTOLEADING
. \}
. nr #SAVED_VS \\n[.v]
. vs \\$1
. if \\n[pdfbx-running]=1 \{\
. nr #VS_DIFF \\n[#SAVED_VS]-\\n[.v]
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#VS_DIFF]u
. \}
. if !\\n[#START] \
. if \\n[.t]<\\n[.v] 'bp
.END
\#
\# AUTOLEAD
\# --------
\# *Argument:
\# <leading value to add to #PT_SIZE> [FACTOR]
\# *Function:
\# Stores user supplied auto-lead value in register #AUTOLEAD_VALUE.
\# Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading.
\# All subsequent PT_SIZE requests reset the leading in the same way until
\# AUTOLEAD is turned off.
\# *Notes:
\# With the optional FACTOR argument, the current point size is
\# multiplied by #AUTOLEAD_VALUE/1000 instead of the two being added
\# together.
\#
.MAC AUTOLEAD END
. if \\n[#PRINT_STYLE]=1 .return
. if \\n[#IGNORE] .return
. nr #AUTO_LEAD 1 \" autolead on or off
. nr #AUTOLEAD_VALUE (p;\\$1) \" arg x 1000
. ie '\\$2'FACTOR' \{\
. if !\\n[#DOCS] .nr #DOC_AUTOLEAD_FACTOR \\n[#AUTOLEAD_VALUE] \" save for DOC_PT_SIZE
. nr #AUTOLEADING \\n[.ps]*\\n[#AUTOLEAD_VALUE]/1000-\\n[.ps]
. \}
. el .nr #AUTOLEADING \\n[#AUTOLEAD_VALUE]
. vs \\n[.ps]u+\\n[#AUTOLEADING]u
.END
\#
\# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE
\# ------------------------------------------------
.ds ROM \Ef[R]
.ds IT \Ef[I]
.ds BD \Ef[B]
.ds BDI \Ef[BI]
.ds PREV \Ef[]
.ds S \Es
\#
\# =====================================================================
\#
\# +++KERNING+++
\#
\# AUTOMATIC PAIRWISE KERNING
\# --------------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Turns automatic pairwise kerning on or off.
\#
.MAC KERN END
. ie '\\$1'' \{\
. kern
. nr #KERN 1
. \}
. el \{\
. kern 0
. nr #KERN 0
. \}
.END
\#
\# INLINE KERNING AND HORIZONTAL MOVEMENT
\# --------------------------------------
\#
\# Inline kerning provides a simple way to adjust the amount of
\# space between any two letters. It's predicated on a unit of
\# measure "U", which, by default, is 1/36 of the current point
\# size as returned by \n[.ps]; e.g., if the current point size is
\# 18, \n[.ps] returns 18000u, therefore U=500u. Since U remains
\# proportional relative to the current point size, the amount of
\# kerning between two letters as expressed in Us remains visually
\# similar regardless of changes in point size.
\#
\# The default value for U may be changed or reset with the
\# KERN_UNIT macro.
\#
.MAC KERN_UNIT END
. ie '\\$1'DEFAULT' .ds $KERN_UNIT 36
. el .ds $KERN_UNIT \\$1
.END
\#
.ds $KERN_UNIT 36
.ds BU \h'-(\En[.ps]u/\E*[$KERN_UNIT]u*\\$1u)'
.ds FU \h'(\En[.ps]u/\E*[$KERN_UNIT]u*\\$1u)'
\#
\# Initialize strings for pre-1.1.3c-style BU and FU
\#
.nr #LOOP 0 1
.while \n+[#LOOP]<37 \{\
. ds BU\n[#LOOP] \h'-(\En[.ps]u/\E*[$KERN_UNIT]u*\n[#LOOP]u)'
. ds FU\n[#LOOP] \h'(\En[.ps]u/\E*[$KERN_UNIT]u*\n[#LOOP]u)'
.\}
\#
\# Horizontal movements
\# --------------------
\# BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
\# specified number of points.
\#
.ds BCK \h'-\\$1'
.ds FWD \h'\\$1'
\#
.ds BP.25 \h'-.25'
.ds BP.5 \h'-.5'
.ds BP.75 \h'-.75'
.ds BP1 \h'-1p'
.ds BP1.25 \h'-1.25p'
.ds BP1.5 \h'-1.5p'
.ds BP1.75 \h'-1.75p'
.ds BP2 \h'-2p'
.ds BP2.25 \h'-2.25p'
.ds BP2.5 \h'-2.5p'
.ds BP2.75 \h'-2.75p'
.ds BP3 \h'-3p'
.ds BP3.25 \h'-3.25p'
.ds BP3.5 \h'-3.5p'
.ds BP3.75 \h'-3.75p'
.ds BP4 \h'-4p'
.ds BP4.25 \h'-4.25p'
.ds BP4.5 \h'-4.5p'
.ds BP4.75 \h'-4.75p'
.ds BP5 \h'-5p'
.ds BP5.25 \h'-5.25p'
.ds BP5.5 \h'-5.5p'
.ds BP5.75 \h'-5.75p'
.ds BP6 \h'-6p'
.ds BP6.25 \h'-6.25p'
.ds BP6.5 \h'-6.5p'
.ds BP6.75 \h'-6.75p'
.ds BP7 \h'-7p'
.ds BP7.25 \h'-7.25p'
.ds BP7.5 \h'-7.5p'
.ds BP7.75 \h'-7.75p'
.ds BP8 \h'-8p'
.ds BP8.25 \h'-8.25p'
.ds BP8.5 \h'-8.5p'
.ds BP8.75 \h'-8.75p'
.ds BP9 \h'-9p'
.ds BP9.25 \h'-9.25p'
.ds BP9.5 \h'-9.5p'
.ds BP9.75 \h'-9.75p'
.ds BP10 \h'-10p'
.ds BP10.25 \h'-10.25p'
.ds BP10.5 \h'-10.5p'
.ds BP10.75 \h'-10.75p'
.ds BP11 \h'-11p'
.ds BP11.25 \h'-11.25p'
.ds BP11.5 \h'-11.5p'
.ds BP11.75 \h'-11.75p'
.ds BP12 \h'-12p'
.ds BP12.25 \h'-12.25p'
.ds BP12.5 \h'-12.5p'
.ds BP12.75 \h'-12.75p'
\#
.ds FP.25 \h'.25'
.ds FP.5 \h'.5'
.ds FP.75 \h'.75'
.ds FP1 \h'1p'
.ds FP1.25 \h'1.25p'
.ds FP1.5 \h'1.5p'
.ds FP1.75 \h'1.75p'
.ds FP2 \h'2p'
.ds FP2.25 \h'2.25p'
.ds FP2.5 \h'2.5p'
.ds FP2.75 \h'2.75p'
.ds FP3 \h'3p'
.ds FP3.25 \h'3.25p'
.ds FP3.5 \h'3.5p'
.ds FP3.75 \h'3.75p'
.ds FP4 \h'4p'
.ds FP4.25 \h'4.25p'
.ds FP4.5 \h'4.5p'
.ds FP4.75 \h'4.75p'
.ds FP5 \h'5p'
.ds FP5.25 \h'5.25p'
.ds FP5.5 \h'5.5p'
.ds FP5.75 \h'5.75p'
.ds FP6 \h'6p'
.ds FP6.25 \h'6.25p'
.ds FP6.5 \h'6.5p'
.ds FP6.75 \h'6.75p'
.ds FP7 \h'7p'
.ds FP7.25 \h'7.25p'
.ds FP7.5 \h'7.5p'
.ds FP7.75 \h'7.75p'
.ds FP8 \h'8p'
.ds FP8.25 \h'8.25p'
.ds FP8.5 \h'8.5p'
.ds FP8.75 \h'8.75p'
.ds FP9 \h'9p'
.ds FP9.25 \h'9.25p'
.ds FP9.5 \h'9.5p'
.ds FP9.75 \h'9.75p'
.ds FP10 \h'10p'
.ds FP10.25 \h'10.25p'
.ds FP10.5 \h'10.5p'
.ds FP10.75 \h'10.75p'
.ds FP11 \h'11p'
.ds FP11.25 \h'11.25p'
.ds FP11.5 \h'11.5p'
.ds FP11.75 \h'11.75p'
.ds FP12 \h'12p'
.ds FP12.25 \h'12.25p'
.ds FP12.5 \h'12.5p'
.ds FP12.75 \h'12.75p'
\#
\# WHOLE LINE (TRACK) KERNING
\# --------------------------
\# *Argument:
\# <amount of track kerning>
\# *Function:
\# Invokes .tkf (track kerning) for the current font with
\# 1 as both the upper and lower point size limits, so that
\# the value entered by the user applies regardless of point
\# size. RW ("Reduce Whitespace") reduces the amount of space
\# between all characters by an equal amount. EW ("Extra
\# Whitespace") increases the amount of space.
\# *Notes:
\# Decimal values are acceptable.
\#
\# A value of 1 will produce an unacceptably tight or loose line
\# at most text point sizes; therefore, effective use of RW and
\# EW is in the fractional range below 1.
\#
\# \n[.f] holds the current font number, which is acceptable to .tkf.
\#
\# RW and EW must be reset to 0 to cancel their effect on subsequent
\# output lines.
\#
.MAC RW END
. if \\n[#BR_AT_LINE_KERN] \{\
. ie \\n[#JUSTIFY]=1 .brp
. el .br
. \}
. rr #EW
. rm $EW
. nr #RW 1
. ds $RW \\$1
. tkf \\n[.f] 1 -\\$1 1 -\\$1
.END
\#
.MAC EW END
. if \\n[#BR_AT_LINE_KERN] \{\
. ie \\n[#JUSTIFY]=1 .brp
. el .br
. \}
. rr #RW
. rm $RW
. nr #EW 1
. ds $EW \\$1
. tkf \\n[.f] 1 \\$1 1 \\$1
.END
\#
\# BREAK AT LINE KERN
\# ------------------
\# *Arguments:
\# toggle
\# *Function:
\# Enables/disables .br's before .RW and .EW
\# *Notes:
\# Mostly, users will want .br's before any kind of line kerning, but
\# there may be cases where they don't. BR_AT_LINE_KERN is off by
\# default and must be invoked explicitly.
\#
.MAC BR_AT_LINE_KERN END
. ie '\\$1'' .nr #BR_AT_LINE_KERN 1
. el .rr #BR_AT_LINE_KERN
.END
\#
\# =====================================================================
\#
\# +++HYPHENATION+++
\#
\# AUTO HYPHENATION
\# ----------------
\# *Arguments:
\# <none> | <anything> | DEFAULT
\# or
\# LINES <n> | MARGIN <n> | SPACE <n>
\# *Function:
\# Turns auto hyphenation on or off, resets the hyphenation style
\# to default, or permits the setting of various hyphenation
\# parameters.
\# *Notes:
\# HY, by itself, defaults to .hy 14, i.e. no hyphens after the
\# first two or before the last two characters of a word, and no
\# hyphenation of the last line prior to a trap (e.g., at the
\# bottom of a page).
\#
\# HY DEFAULT resets the hyphenation style to .hy 14 (see
\# above) if that behaviour is desired after changes have been
\# made to LINES, MARGIN, or SPACE.
\#
\# HY LINES <n> sets the number of allowable consecutive hyphenated lines.
\#
\# HY MARGIN <n> sets the amount of space (ipPcm) allowed at the end
\# of a line in QUAD mode before hyphenation is tripped (e.g. if there's
\# only 6 points left, groff won't try to hyphenate the next word).
\#
\# HY SPACE sets the amount of extra interword space (ipPcm) that can
\# be added in JUSTIFY mode to prevent a line from being hyphenated.
\#
.MAC HY END
. ie '\\$1'' \{\
. hy 14
. if \\n[#LINES] .hlm \\n[#LINES]
. if \\n[#MARGIN] .hym \\n[#MARGIN]]
. if \\n[#SPACE] .hys \\n[#SPACE]
. nr #HYPHENATE 1
. \}
. el \{\
. if !'\\$1'LINES' \{\
. nh
. nr #HYPHENATE 0
. \}
. if !'\\$1'MARGIN' \{\
. nh
. nr #HYPHENATE 0
. \}
. if !'\\$1'SPACE' \{\
. nh
. nr #HYPHENATE 0
. \}
. if !'\\$1'DEFAULT' \{\
. nh
. nr #HYPHENATE 0
. \}
. if '\\$1'LINES' \{\
. hlm \\$2
. nr #HY_LINES \\$2
. \}
. if '\\$1'MARGIN' \{\
. hym \\$2
. nr #HY_MARGIN \\$2
. \}
. if '\\$1'SPACE' \{\
. hys \\$2
. nr #HY_SPACE \\$2
. \}
. if '\\$1'DEFAULT' \{\
. hlm -1
. hym 0
. hys 0
. rr #HY_LINES
. rr #HY_SPACE
. rr #HY_MARGIN
. \}
. \}
.END
\#
\# HYPHENATION PARAMETERS
\# ----------------------
\# *Arguments:
\# <# of lines> | <size of margin> | <amount of interword space>
\# *Function:
\# Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
\#
.MAC HY_SET END
. nr #HY_SET 1
. hlm \\$1
. hym \\$2
. hys \\$3
.END
\#
\# =====================================================================
\#
\# +++VERTICAL SPACING+++
\#
\# ADVANCE LEAD
\# ------------
\# *Argument:
\# <user supplied lead to advance below current baseline>
\# *Function:
\# Creates or modifies register #ALD. Adds user supplied lead
\# below current baseline.
\# *Notes:
\# Requires a unit of measure.
\#
.MAC ALD END
. if '\\$0'ALD' \{\
. nr #ALD (u;\\$1)
. sp \\n[#ALD]u
. \}
. if '\\$0'ADD_SPACE' \{\
. vpt 0
. nr #ALD \\$1
. rs
. nop \&
. br
. sp |\\n[#T_MARGIN]u-1v+\\n[#ALD]u
. rr @TOP
. nr #SPACE_ADDED 1
. vpt
. \}
. if '\\$0'SPACE' .sp \\$1
. if '\\$0'SP' .sp \\$1
.END
\#
\# REVERSE LEAD
\# ------------
\# *Argument:
\# <user supplied lead to reverse above current baseline>
\# *Function:
\# Creates or modifies register #RLD. Reverses user supplied
\# lead above current baseline.
\# *Notes:
\# Requires a unit of measure.
\#
.MAC RLD END
. br
. nr #RLD (u;\\$1)
. sp -\\n[#RLD]u
.END
\#
\# ALD/RLD STRINGS
\# ---------------
\# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding
\# \*[RLD] forms have been left in for backward compatibility with
\# documents created using mom-1.1.3c or earlier. The preferred methods
\# of advancing and reversing on the page inline are \*[UP <n><unit>]
\# and \*[DOWN <n><unit>].
\#
.ds DOWN \v'\\$1'
.ds UP \v'-\\$1'
\#
.ds ALD.25 \v'.25p'
.ds ALD.5 \v'.5p'
.ds ALD.75 \v'.75p'
.ds ALD1 \v'1p'
.ds ALD1.25 \v'1.25p'
.ds ALD1.5 \v'1.5p'
.ds ALD1.75 \v'1.75p'
.ds ALD2 \v'2p'
.ds ALD2.25 \v'2.25p'
.ds ALD2.5 \v'2.5p'
.ds ALD2.75 \v'2.75p'
.ds ALD3 \v'3p'
.ds ALD3.25 \v'3.25p'
.ds ALD3.5 \v'3.5p'
.ds ALD3.75 \v'3.75p'
.ds ALD4 \v'4p'
.ds ALD4.25 \v'4.25p'
.ds ALD4.5 \v'4.5p'
.ds ALD4.75 \v'4.75p'
.ds ALD5 \v'5p'
.ds ALD5.25 \v'5.25p'
.ds ALD5.5 \v'5.5p'
.ds ALD5.75 \v'5.75p'
.ds ALD6 \v'6p'
.ds ALD6.25 \v'6.25p'
.ds ALD6.5 \v'6.5p'
.ds ALD6.75 \v'6.75p'
.ds ALD7 \v'7p'
.ds ALD7.25 \v'7.25p'
.ds ALD7.5 \v'7.5p'
.ds ALD7.75 \v'7.75p'
.ds ALD8 \v'8p'
.ds ALD8.25 \v'8.25p'
.ds ALD8.5 \v'8.5p'
.ds ALD8.75 \v'8.75p'
.ds ALD9 \v'9p'
.ds ALD9.25 \v'9.25p'
.ds ALD9.5 \v'9.5p'
.ds ALD9.75 \v'9.75p'
.ds ALD10 \v'10p'
.ds ALD10.25 \v'10.25p'
.ds ALD10.5 \v'10.5p'
.ds ALD10.75 \v'10.75p'
.ds ALD11 \v'11p'
.ds ALD11.25 \v'11.25p'
.ds ALD11.5 \v'11.5p'
.ds ALD11.75 \v'11.75p'
.ds ALD12 \v'12p'
.ds ALD12.25 \v'12.5p'
.ds ALD12.5 \v'12.5p'
.ds ALD12.75 \v'12.75p'
\#
.ds RLD.25 \v'-.25p'
.ds RLD.5 \v'-.5p'
.ds RLD.75 \v'-.75p'
.ds RLD1 \v'-1p'
.ds RLD1.25 \v'-1.25p'
.ds RLD1.5 \v'-1.5p'
.ds RLD1.75 \v'-1.75p'
.ds RLD2 \v'-2p'
.ds RLD2.25 \v'-2.25p'
.ds RLD2.5 \v'-2.5p'
.ds RLD2.75 \v'-2.75p'
.ds RLD3 \v'-3p'
.ds RLD3.25 \v'-3.25p'
.ds RLD3.5 \v'-3.5p'
.ds RLD3.75 \v'-3.75p'
.ds RLD4 \v'-4p'
.ds RLD4.25 \v'-4.25p'
.ds RLD4.5 \v'-4.5p'
.ds RLD4.75 \v'-4.75p'
.ds RLD5 \v'-5p'
.ds RLD5.25 \v'-5.25p'
.ds RLD5.5 \v'-5.5p'
.ds RLD5.75 \v'-5.75p'
.ds RLD6 \v'-6p'
.ds RLD6.25 \v'-6.25p'
.ds RLD6.5 \v'-6.5p'
.ds RLD6.75 \v'-6.75p'
.ds RLD7 \v'-7p'
.ds RLD7.25 \v'-7.25p'
.ds RLD7.5 \v'-7.5p'
.ds RLD7.75 \v'-7.75p'
.ds RLD8 \v'-8p'
.ds RLD8.25 \v'-8.25p'
.ds RLD8.5 \v'-8.5p'
.ds RLD8.75 \v'-8.75p'
.ds RLD9 \v'-9p'
.ds RLD9.25 \v'-9.25p'
.ds RLD9.5 \v'-9.5p'
.ds RLD9.75 \v'-9.75p'
.ds RLD10 \v'-10p'
.ds RLD10.25 \v'-10.25p'
.ds RLD10.5 \v'-10.5p'
.ds RLD10.75 \v'-10.75p'
.ds RLD11 \v'-11p'
.ds RLD11.25 \v'-11.25p'
.ds RLD11.5 \v'-11.5p'
.ds RLD11.75 \v'-11.75p'
.ds RLD12 \v'-12p'
.ds RLD12.25 \v'-12.5p'
.ds RLD12.5 \v'-12.5p'
.ds RLD12.75 \v'-12.75p'
\#
\# =====================================================================
\#
\# +++REFINEMENTS+++
\#
\# AUTOMATIC LIGATURES
\# -------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Turns automatic ligature generation on or off.
\# *Notes:
\# Ligatures may be supplied manually with \[fi], \[fl], etc.
\#
.MAC LIGATURES END
. ie '\\$1'' \{\
. lg
. nr #LIGATURES 1
. \}
. el \{\
. lg 0
. nr #LIGATURES 0
. \}
.END
\#
\# SMARTQUOTES
\# -----------
\# *Arguments:
\# [ ,, ] | [ << ] | [ >> ] | <anything>
\# or
\# [ DA | DE | EN | ES | FR | IT | NL | NO | PT | SV ] | <anything>
\# *Function:
\# Turns smartquotes on (optionally with a quoting style from the
\# argument list, or off).
\# If no quoting style is given, then EN (English) is used by default.
\# If no quoting style is given and smart quotes have been turned off
\# previously, the old quoting style will be restored.
\# *Notes:
\# The " character is read outside the macro when mom is
\# processed. The strings for open/close ($QUOTE<n>) are then
\# defined in the macro.
\#
.char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
.nr #SQ_ON 0
\#
.MAC SMARTQUOTES END
.\" First " will be translated to $QUOTE0
. nr #OPEN_CLOSE 0
. if '\\$1'' \{\
. if !'\\*[$RESTORE_SQ]'' \{\
. SMARTQUOTES \\*[$RESTORE_SQ]
. return
. \}
.\" Default smart quotes (English)
. ds $QUOTE0 \[lq]
. ds $QUOTE1 \[rq]
. ds $RESTORE_SQ EN
. nr #SQ_ON 1
. return
. \}
. if '\\$1',,' \{\
. ds $QUOTE0 \[Bq]
. ds $QUOTE1 \[lq]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
. if '\\$1'<<' \{\
. ds $QUOTE0 \[Fo]
. ds $QUOTE1 \[Fc]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
. if '\\$1'>>' \{\
. ds $QUOTE0 \[Fc]
. ds $QUOTE1 \[Fo]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
. if '\\$1'DA' \{\
. ds $QUOTE0 \[Fc]
. ds $QUOTE1 \[Fo]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
. if '\\$1'DE' \{\
. ds $QUOTE0 \[Bq]
. ds $QUOTE1 \[lq]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
. if '\\$1'EN' \{\
. ds $QUOTE0 \[lq]
. ds $QUOTE1 \[rq]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
. if '\\$1'ES' \{\
. ds $QUOTE0 \[lq]
. ds $QUOTE1 \[rq]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
. if '\\$1'FR' \{\
. ds $QUOTE0 \[Fo]\|
. ds $QUOTE1 \|\[Fc]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
. if '\\$1'IT' \{\
. ds $QUOTE0 \[Fo]\|
. ds $QUOTE1 \|\[Fc]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
. if '\\$1'NL' \{\
. ds $QUOTE0 \[rq]
. ds $QUOTE1 \[rq]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
. if '\\$1'NO' \{\
. ds $QUOTE0 \[Fo]
. ds $QUOTE1 \[Fc]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
. if '\\$1'PT' \{\
. ds $QUOTE0 \[Fo]
. ds $QUOTE1 \[Fc]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
. if '\\$1'SV' \{\
. ds $QUOTE0 \[Fc]
. ds $QUOTE1 \[Fc]
. ds $RESTORE_SQ \\$1
. nr #SQ_ON 1
. return
. \}
.\" None of the above -> turn smartquotes off
. ds $QUOTE0 \[dq]
. ds $QUOTE1 \[dq]
. nr #SQ_ON 0
.END
\#
.ds $QUOTE0 \[lq]
.ds $QUOTE1 \[rq]
\#
\# Strings for foot and inch marks
\#
.ds FOOT \[fm]
.ds INCH \[fm]\[fm]
\#
\# =====================================================================
\#
\# +++LINE BREAKS+++
\#
\# NO-SPACE BREAK
\# --------------
\# *Argument:
\# <none>
\# *Function:
\# Breaks a line without advancing.
\# *Notes:
\# EL is the mnemonic used on older, dedicated typesetting machines
\# to indicate "process the line, without advancing the galley
\# medium." It stands for End Line.
\#
\# The \c inline must be appended to the end of input lines when in
\# nofill mode; in fill modes, the \c inline must not be used.
\#
.MAC EL END
. TRAP OFF
. if \\n[#PSEUDO_FILL]=1 \&
. br
. sp -1v
. TRAP
.END
\#
\# An inline escape to accomplish the same thing.
\# Preferable, since it works with filled and non-filled copy and
\# doesn't require the user to remember whether to use (or not use)
\# \c.
\#
.ds B \h'|0'\R'#NO_ADVANCE 1'\c
\#
\# =====================================================================
\#
\# +++FILLING/QUADDING/JUSTIFYING+++
\#
\# JUSTIFY
\# -------
\# *Argument:
\# <none>
\# *Function:
\# Turns fill on and sets .ad to b.
\# *Notes:
\# Justifies text left and right.
\#
.MAC JUSTIFY END
\#. if r pdfbx-top 'sp -1
. if \\n[#TAB_ACTIVE]=0 \{\
. nr #QUAD 1
. ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
. \}
' ce 0
. QUAD J
. if \\n[#PRINT_STYLE]=1 .QUAD L
. nr #PSEUDO_FILL 0
.END
\#
\# QUAD
\# ----
\# *Arguments:
\# L | LEFT | R | RIGHT | C | CENTER/CENTRE
\# *Function:
\# Turns fill on and sets .ad to l, r, or c.
\# *Notes:
\# Terminology is a problem here. Some people call quad left
\# left justified, flush left, or flush left/rag right (and the
\# reverse for quad right). Quad center is sometimes called rag
\# both. For our purposes, all "quad" modes mean that groff fill
\# mode is enabled.
\#
.MAC QUAD END
. if r pdfbx-top \{\
' sp -1
. rr pdfbx-top
. \}
.\" The QUAD in PP adds an unwanted linespace after a HEADING at the
.\" top of a pdf box because of this .br, so HEADING assigns the
.\" tmp register "bx-top\n[stack]" to inhibit it.
. ie !r pdfbx-top\\n[stack] .br
. el .rr pdfbx-top\\n[stack]
. if \\n[#COVERTEXT_PP] \
. ds $RESTORE_DOC_QUAD \\*[$QUAD_VALUE]
. ds $QUAD_VALUE \\$1
. substring $QUAD_VALUE 0 0
. if \\n[#TAB_ACTIVE]=0 \{\
. nr #QUAD 1
. ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
. \}
' ce 0
' fi
. if '\\*[$QUAD_VALUE]'L' \{\
. nr #JUSTIFY 0
. ad l
. \}
. if '\\*[$QUAD_VALUE]'R' \{\
. nr #JUSTIFY 0
. ad r
. \}
. if '\\*[$QUAD_VALUE]'C' \{\
. nr #JUSTIFY 0
. ad c
. \}
. if '\\*[$QUAD_VALUE]'J' \{\
. nr #JUSTIFY 1
. ad b
. \}
. nr #PSEUDO_FILL 0
.END
\#
\# LEFT, RIGHT, AND CENTER
\# -----------------------
\# The purpose of these macros is to allow the user to enter lines
\# of text that will be quadded LRC without having to stick .BR
\# or .br between lines. For the sake of consistency, all three
\# appear to behave similarly (from the point of view of the user),
\# although the underlying primitives don't. For this reason, LEFT,
\# RIGHT, and CENTER must be followed by .QUAD [L R C J] or .JUSTIFY
\# to restore text to fill mode.
\#
\# LEFT
\# ----
\# *Argument:
\# <none>
\# *Function:
\# Turns fill mode off. Allows user to quad lines left without
\# requiring the .BR or .br macro.
\# *Notes:
\# LEFT simply turns fill off. Lines that exceed the current LL
\# will not be broken. Note that this behaviour differs from the
\# RIGHT and CENTER macros.
\#
.MAC LEFT END
. if \\n[#TAB_ACTIVE]=0 \{\
. rr #QUAD
. ds $RESTORE_QUAD_VALUE LEFT
. \}
. ce 0
. nf
. nr #PSEUDO_FILL 1
.\" Fix for a little conflict with DOCTYPE LETTER
. if '\\n[.z]'LETTERHEAD1' .rr #DATE_FIRST
.END
\#
\# RIGHT
\# -----
\# *Argument:
\# <none>
\# *Function:
\# Turns fill on. Allows user to quad lines right without
\# requiring the .BR or .br macro.
\# *Notes:
\# Lines that exceed the current LL will be broken, with the excess
\# text quadded right.
\#
.MAC RIGHT END
. if \\n[#TAB_ACTIVE]=0 \{\
. rr #QUAD
. ds $RESTORE_QUAD_VALUE RIGHT
. \}
. nf
. rj 100000
. nr #PSEUDO_FILL 1
.END
\#
\# CENTER
\# ------
\# *Argument:
\# <none>
\# *Function:
\# Turns fill off. Allows user to center lines without
\# requiring the .BR or .br macro.
\# *Notes:
\# Lines that exceed the current LL will be broken, with the excess
\# text centered.
\#
.MAC CENTER END
. if \\n[#TAB_ACTIVE]=0 \{\
. rr #QUAD
. ds $RESTORE_QUAD_VALUE CENTER
. \}
. nf
. ce 100000
. nr #PSEUDO_FILL 1
.END
\#
\# CENTER BLOCKS OF TYPE
\# ---------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Allows users to centre blocks of type on the page without
\# altering their quad.
\#
.MAC CENTER_BLOCK END
. br
. ie !\\n[.$] .di CENTER*BLOCK
. el \{\
. di
. in \\n[.l]u-\\n[dl]u/2u
. if \\n[.u] .nr #FILLED 1
. nf
. CENTER*BLOCK
. if \\n[#FILLED] .fi
. rr #FILLED
. in
. \}
.END
\#
.ALIAS CENTRE_BLOCK CENTER_BLOCK
\#
\# =====================================================================
\#
\# +++TABS+++
\#
\# There are two different kinds of tabs: typesetting tabs and
\# string tabs.
\#
\# Typesetting tabs are set with TAB_SET, which requires a tab number,
\# an indent (offset) from the left margin and a length (optionally
\# with a quad direction and an instruction to fill lines). After tabs
\# are set with TAB_SET, they are called with .TAB n, where "n"
\# corresponds to the number passed to TAB_SET as a valid tab number.
\#
\# String tabs allow the user to mark off tab positions inline. Tab
\# indents and lengths are calculated from the beginning and end
\# positions of the marks. Up to 19 string tabs may be created,
\# numbered 1-19. Once created, they are called with .TAB n,
\# just like typesetting tabs.
\#
\# Setting up string tabs is a two-step procedure. First, the user
\# enters an input line in which s/he wants to mark off string tabs.
\# The beginning of a tab is marked with \*[STn], where "n" is
\# the desired number of the tab. The end of the tab is marked
\# with \*[STnX]. All ST's must have a matching STX. String tabs
\# may be nested.
\#
\# Next, the user invokes .ST n for every string tab defined, and
\# optionally passes quad information to it. That done, string tabs
\# can be called just like typesetting tabs.
\#
\# Strings for string tab inlines
\# ------------------------------
\# Initialize string tab markers numbered 1 to 19.
\#
.nr #LOOP 0 1
.while \n+[#LOOP]<20 \{\
. ds ST\n[#LOOP] \Ek[#ST\n[#LOOP]_OFFSET]
.\}
\#
.nr #LOOP 0 1
.while \n+[#LOOP]<20 \{\
. ds ST\n[#LOOP]X \Ek[#ST\n[#LOOP]_MARK]
.\}
.rr #LOOP
\#
\# These are reserved ST numbers for internal use
.ds ST100 \Ek[#ST100_OFFSET]
.ds ST100X \Ek[#ST100_MARK]
.ds ST101 \Ek[#ST101_OFFSET]
.ds ST101X \Ek[#ST101_MARK]
.ds ST102 \Ek[#ST102_OFFSET]
.ds ST102X \Ek[#ST102_MARK]
.ds ST103 \Ek[#ST103_OFFSET]
.ds ST103X \Ek[#ST103_MARK]
\#
\# QUAD AND SET STRING TABS
\# ------------------------
\# *Arguments:
\# <stringtab number> L | R | C | J [QUAD]
\# *Function:
\# Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
\# tab based on the collected information.
\# *Notes:
\# Like TAB_SET, ST invoked without a quad direction will default to LEFT.
\# If lines should be filled and quadded, use the optional argument QUAD.
\# N.B. -- indents *must* be turned off before setting string tabs
\# inside .PAD
\#
.MAC ST END
. ds $ST\\$1_QUAD_DIR \\$2
. if \\n[#NUM_ARGS]=3 .ds $ST\\$1_FILL QUAD
. nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
. ie \\n[#IN_TAB] \
. TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \
\\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
. el \
. TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \
\\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
.END
\#
\# TAB SET
\# -------
\# *Arguments:
\# <n> ident(ipPcm) length(ipPcm) [L | R | C | J [QUAD]]
\# *Function:
\# Creates macros TABn and TAB n, where "n" is any arbitrary number.
\# TABn is a typesetting tab (i.e. a tab defined as an indent
\# from the page left offset plus a line length.)
\# *Notes:
\# n = arbitrary digit to identify the tab
\# indent = indent from left margin; unit of measure required
\# length = length of tab (unit of measure required; can be
\# \w'<string>'u--if more than one word in string, surround
\# with double quotes "\w'<three word string>'"
\# LRCJ = quad for tab (left, right, center, justified)
\# If option QUAD afterwards is not given, quad is line for line
\# (no fill mode), meaning that there's no need for .BR or .br
\# between lines.
\# QUAD = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
\# had been given).
\#
\# N.B. -- indents *must* be turned off before setting tabs
\#
\# Tabs are not columnar in behaviour. .TN and \*[TB+] permit
\# bottom-line to bottom-line tab movement.
\#
\# When resetting tabs, .TQ must be invoked before .TAB_SET.
\#
\# Indents are turned off automatically whenever a new tab is called
\# with TAB <n>.
\#
\# Generally, it's a good idea to make sure all indents are off
\# before setting tabs.
\#
.MAC TAB_SET END
. br
. nr #TAB_NUMBER \\$1
. ds $CURRENT_TAB \\n[#TAB_NUMBER]
. nr #TAB_OFFSET (\\$2)
. nr #TAB_LENGTH (\\$3)
. MAC TAB\\n[#TAB_NUMBER]
. if !\\\\n[#TB+]=1 .br
. if \\\\n[#TB+]=1 \{\
. EL
. vpt 0
. rr #TB+
. \}
. in 0
. nr #TAB_ACTIVE 1
. nr #CURRENT_TAB \\n[#TAB_NUMBER]
. ds $CURRENT_TAB \\*[$CURRENT_TAB]
. nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
. nr #ST_OFFSET \\n[#TAB_OFFSET]
. ie !'\\\\n[.z]'' \
\!. po \\\\\\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
. el \
. po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
. ll \\n[#TAB_LENGTH]u
. ta \En[.l]u
. ie '\\$5'QUAD' \{\
. if '\\$4'L' .QUAD L
. if '\\$4'R' .QUAD R
. if '\\$4'C' .QUAD C
. if '\\$4'J' .JUSTIFY
. \}
. el \{\
. if '\\$4'' .LEFT
. if '\\$4'L' .LEFT
. if '\\$4'R' .RIGHT
. if '\\$4'C' .CENTER
. if '\\$4'J' .JUSTIFY
. \}
. if \\\\n[#TN]=1 \{\
. TRAP
. rr #TN
. \}
..
. rr #TAB_ACTIVE
.END
\#
\# TAB
\# ---
\# *Arguments:
\# <tab number to tab into>
\# *Function:
\# Moves to tab number passed as an argument.
\#
.MAC TAB END
. ds $TAB_NUMBER \\$1
. TAB\\*[$TAB_NUMBER]
. nr #IN_TAB 1
.END
\#
\# TAB NEXT
\# --------
\# *Argument:
\# <none>
\# *Function:
\# Automatically moves to TAB<n+1> on the same line as the last
\# line of the previous tab.
\# *Notes:
\# The \c inline must be appended to the end of input lines when in
\# nofill mode; in fill modes, the \c inline must not be used.
\#
.MAC TN END
. nr #TN 1
. vpt 0
. sp -1v
. nr #NEXT_TAB \\n[#CURRENT_TAB]+1
. TAB\\n[#NEXT_TAB]
. vpt
.END
\#
\# An inline escape to accomplish the same thing. Preferable, since
\# it works with filled and non-filled copy and doesn't require the
\# user to remember to use (or not use) the \c.
\#
.ds TB+ \
"\c\R'#TB+ 1'\R'#TN 1'\R'#NEXT_TAB \\n[#CURRENT_TAB]+1'\\*[TAB\\n[#NEXT_TAB]]\c
\#
\# TAB QUIT
\# --------
\# *Argument:
\# <none>
\# *Function:
\# Sets #TAB_ACTIVE to "0" (off).
\# Resets left margin to value in effect prior to tabs.
\# Resets line length to value in effect prior to tabs.
\# Checks #QUAD to see if we were in flush or quad mode
\# prior to tabs (0=off, 1=on).
\# Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
\# in effect prior to tabs.
\# *Notes:
\# TQ must precede setting new tabs to get the tabs' indents
\# measured from page left. Otherwise, the tabs' indents are
\# measured from the left margin of the currently active tab.
\#
.MAC TQ END
. br
. rr #TAB_ACTIVE
. rr #IN_TAB
. nr #LOOP 0 1
. while \\n+[#LOOP]<20 \{\
. rm $ST\\n[#LOOP]_FILL
. \}
. rr #LOOP
. ie !'\\n[.z]'' \{\
\!. po \\n[#L_MARGIN]u
\!. ll \\n[#L_LENGTH]u
. \}
. el \{\
. po \\n[#L_MARGIN]u
. ll \\n[#L_LENGTH]u
. \}
. ll \\n[#L_LENGTH]u
. ta \\n[.l]u
. ie \\n[#QUAD] \{\
. ie '\\*[$RESTORE_QUAD_VALUE]'J' .JUSTIFY
. el .QUAD \\*[$RESTORE_QUAD_VALUE]
. \}
. el \{\
. if '\\*[$RESTORE_QUAD_VALUE]'LEFT' .LEFT
. if '\\*[$RESTORE_QUAD_VALUE]'RIGHT' .RIGHT
. if '\\*[$RESTORE_QUAD_VALUE]'CENTER' .CENTER
. \}
.END
\#
\# ====================================================================
\#
\# COLOR HANDLING
\# ==============
\#
\# COLOR
\# -----
\# *Arguments:
\# <pre-defined NEWCOLOR or XCOLOR>
\# *Function:
\# Allows the inline escape for setting color to be called
\# as a macro.
\#
.MAC COLOR END
. ie \\n[.u]=1 \{\
\c
\\*[\\$1]\c
. \}
. el \\*[\\$1]
.END
\#
\# NEWCOLOR
\# --------
\# *Arguments:
\# <color name> [<color scheme>] <color definition>
\# *Function:
\# Based on .defcolor, allows users to name and define colors using
\# one of the four color schemes rgb, cmy, cmyk and grey. The new
\# color is then defined as a string so that it can be called inline
\# with \*[COLORNAME] or with .COLOR.
\# *Notes:
\# With only two args, the default color scheme is rgb.
\#
\# It is highly recommended that users define new colors as
\# all-cap strings, to differentiate them from x colors, which must
\# be in lower case.
\#
.MAC NEWCOLOR END
. if \\n[#NUM_ARGS]=2 .defcolor \\$1 rgb \\$2
. if \\n[#NUM_ARGS]=3 \{\
. if '\\$2'RGB' .ds $COLOR_SCHEME rgb
. if '\\$2'CYM' .ds $COLOR_SCHEME cym
. if '\\$2'CMYK' .ds $COLOR_SCHEME cmyk
. if '\\$2'GRAY' .ds $COLOR_SCHEME gray
. if '\\$2'GREY' .ds $COLOR_SCHEME gray
. defcolor \\$1 \\*[$COLOR_SCHEME] \\$3
. \}
. ds \\$1 \\m[\\$1]
.END
\#
\# XCOLOR
\# ------
\# *Arguments:
\# <x color name> [<alias>]
\# *Function:
\# Defines a string of x color name (i.e. a predefined x
\# color). If <alias> is given, creates a string of <alias name>
\# that references the x color name of the first argument.
\# *Notes:
\# The color name must be a valid color name from rgb.txt, and
\# must be given entirely in lower case, all one word.
\#
.MAC XCOLOR END
. ds \\$1 \m[\\$1]
. if \\n[#NUM_ARGS]=2 \{\
. ds \\$2 \m[\\$1]
. ds $\\$2_FILL \\$1
. ds COLAL_\\$2 \\$1
. \}
.END
\#
\# Pre-define xcolors black and white
\#
.ds black \m[black]
.ds BLACK \m[black]
.ds white \m[white]
.ds WHITE \m[white]
.ds default black
\#
\# =====================================================================
\#
\# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
\#
.nr _w 500
.nr _d 1250
\#
\# These string are used for creating aliases within loops that set
\# style for doc-cover, cover, and docheader items. They're defined
\# here because underscoring needs them.
\#
.ds TITLE_TYPE_1 ATTRIBUTE
.ds TITLE_TYPE_2 AUTHOR
.ds TITLE_TYPE_3 CHAPTER
.ds TITLE_TYPE_4 CHAPTER_TITLE
.ds TITLE_TYPE_5 COVERTITLE
.ds TITLE_TYPE_6 DOCTITLE
.ds TITLE_TYPE_7 DOCTYPE
.ds TITLE_TYPE_8 DOC_COVERTITLE
.ds TITLE_TYPE_9 SUBTITLE
.ds TITLE_TYPE_10 TITLE
.ds TITLE_TYPE_11 MISC
.ds TITLE_TYPE_12 COPYRIGHT
.ds TITLE_TYPE_13 DOC_COVER_TITLE
.ds TITLE_TYPE_14 COVER_TITLE
\#
\# UNDERLINE
\# ---------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Simulates typewriter-style underlining of italic passages.
\# *Notes:
\# Defaults for rule weight and distance from baseline are below.
\# UNDERLINE_SPECS lets user change them
\#
.MAC UNDERLINE_SPECS END
. ie \B'\\$1' .nr _w (u;\\$1)
. el \{\
. ie '\\$1'DEFAULT' .nr _w 500
. el \{\
. nr _w 500
. tm1 "[mom]: The first argument to \\$0 must be a numeric
. tm1 " argument with a unit of measure appended, or DEFAULT.
. tm1 " Setting underline weight to DEFAULT.
. \}
. \}
. shift
. ie \B'\\$1' .nr _d (u;\\$1)
. el \{\
. ie '\\$1'DEFAULT' .nr _d 1250
. el \{\
. nr _d 1250
. tm1 "[mom]: The second argument to \\$0 must be a numeric
. tm1 " argument with a unit of measure appended, or DEFAULT.
. tm1 " Setting underline distance from baseline to DEFAULT.
. \}
. \}
.END
\#
.MAC UNDERLINE END
. ds $SAVED_SS_VAR \\*[$SS_VAR]
. ie '\\$1'' \{\
. nr #UNDERLINE_ON 1
. ss \\n[.ss] 0
. ie !n .nop \X'ps: exec \\n[_w] \\n[_d] decorline'\c
. el .cu 1000
. \}
. el \{\
. nr #UNDERLINE_ON 0
. if !'\\*[$SAVED_SS_VAR]'' .SS \\*[$SAVED_SS_VAR]
. ie !n .nop \X'ps: exec decornone'\c
. el .cu 0
. \}
.END
\#
\# UL/ULX
\# ------
\# *Arguments:
\# <none>
\# *Function:
\# Simulates typewriter-style underlining of italic passages.
\# *Notes:
\# Intended to be called with inline escapes \*[UL] (underline
\# on) and \*[ULX] (underline off).
\#
.MAC UL END
\c
. ds $SAVED_SS_VAR \\*[$SS_VAR]
. ss \\n[.ss] 0
. ie !'\\n[.z]'' \{\
\c
. ie !n \{\
. if !\\n[.k]=0 \?\h'-\w'\\n[.ss]'u'\?
\?\R'#UNDERLINE_ON 1'\X'ps: exec \\n[_w] \\n[_d] decorline'\?\c
. \}
. el \{\
\?\R'#UNDERLINE_ON 1'\?\c
. cu 1000
. \}
. \}
. el \{\
. ie !n \{\
. nr #UNDERLINE_ON 1
. nop \X'ps: exec \\n[_w] \\n[_d] decorline'\c
. \}
. el \{\
\R'#UNDERLINE_ON 1'\c
. cu 1000
. \}
. \}
.END
\#
.MAC ULX END
\c
. SS \\*[$SAVED_SS_VAR]
. rm $SAVED_SS_VAR
. ie !'\\n[.z]'' \{\
\c
. ie !n \{\
\?\R'#UNDERLINE_ON 0'\X'ps: exec decornone'\?\c
. \}
. el \{\
\?\R'#UNDERLINE_ON 0'\?\c
. cu 0
. \}
. \}
. el \{\
. ie !n \{\
. nr #UNDERLINE_ON 0
. nop \X'ps: exec decornone'\c
. \}
. el \{\
. nr #UNDERLINE_ON 0
. cu 0
. \}
. \}
.END
\#
\# UNDERSCORE
\# ----------
\# *Arguments:
\# [<points below baseline>] "text"
\# *Function:
\# Places an underscore 2 points under the string if no lead given,
\# otherwise places underscore under string by user specified amount.
\# *Notes:
\# When using this macro, the string to be underscored must begin
\# with double-quotes ("), regardless of whether it's the sole
\# argument or the second.
\# E.g.:
\# .UNDERSCORE "Text to be underscored
\# or
\# .UNDERSCORE 2p "Text to be underscored
\#
\# UNDERSCORE does not work across line breaks. Each line of text
\# must be entered separately. If the UNDERSCORE begins in the
\# middle of a line and crosses over a break, the portion before
\# the break and the portion afterwards must be entered
\# separately.
\#
.MAC UNDERSCORE END
. nr #SAVED_UNDERSCORE_WEIGHT \\n[#UNDERSCORE_WEIGHT]
. nr #SAVED_UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT_ADJ]
. ds $SAVED_UNDERSCORE_GAP \\*[$UNDERSCORE_GAP]
. if \\n[#NUM_ARGS]>=2 \{\
. if \B'\\$1' \{\
. ds $UNDERSCORE_GAP \\$1
. shift
. \}
. if '\\$1'PREFIX' \{\
. ds $PREFIX \\$2
. shift 2
. \}
. if '\\$1'SUFFIX' \{\
. ds $SUFFIX \\$2
. shift 2
. \}
. \}
. if !'\\*[$TITLE_TYPE]'' \{\
. nr #UNDERSCORE_WEIGHT \\n[#\\*[$TITLE_TYPE]_UNDERLINE_WEIGHT]
. nr #UNDERSCORE_WEIGHT_ADJ \\n[#\\*[$TITLE_TYPE]_UNDERLINE_WEIGHT_ADJ]
. ds $UNDERSCORE_GAP \\*[$\\*[$TITLE_TYPE]_UNDERLINE_GAP]
. \}
. nr #TEXT_WIDTH \w'\\$1'
. ie \\n[.u]=1 \{\
\\*[$PREFIX]\Z'\\$1'\
\Z'\D't \\n[#UNDERSCORE_WEIGHT]''\
\v'\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
\D'l \\n[#TEXT_WIDTH]u 0'\
\Z'\D't \\n[#RULE_WEIGHT]''\
\v'-(\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u)'\\*[$SUFFIX]\c
. nop
. \}
. el \{\
\\*[$PREFIX]\Z'\\$1'\
\Z'\D't \\n[#UNDERSCORE_WEIGHT]''\
\v'\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
\D'l \\n[#TEXT_WIDTH]u 0'\
\Z'\D't \\n[#RULE_WEIGHT]''\
\v'-(\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u)'\\*[$SUFFIX]
. \}
. nr #UNDERSCORE_WEIGHT \\n[#SAVED_UNDERSCORE_WEIGHT]
. nr #UNDERSCORE_WEIGHT_ADJ \\n[#SAVED_UNDERSCORE_WEIGHT_ADJ]
. ds $UNDERSCORE_GAP \\*[$SAVED_UNDERSCORE_GAP]
. rr #SAVED_UNDERSCORE_WEIGHT
. rr #SAVED_UNDERSCORE_WEIGHT_ADJ
. rm $SAVED_UNDERSCORE_GAP
. rm $PREFIX
. rm $SUFFIX
. rm $TITLE_TYPE
.END
\#
\# DOUBLE UNDERSCORE
\# -----------------
\# *Arguments:
\# [points below baseline] [points distance between rules] "text"
\# *Function:
\# Same as UNDERSCORE, except it produces a double underscore. The default
\# distance between the rules is 2 points.
\# *Notes:
\# The same double-quote requirement as UNDERSCORE.
\#
.MAC UNDERSCORE2 END
. nr #SAVED_UNDERSCORE_WEIGHT \\n[#UNDERSCORE_WEIGHT]
. nr #SAVED_UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT_ADJ]
. ds $SAVED_UNDERSCORE_GAP \\*[$UNDERSCORE_GAP]
. ds $SAVED_RULE_GAP \\*[$RULE_GAP]
. if \\n[#NUM_ARGS]>=2 \{\
. if \B'\\$1' \{\
. ds $UNDERSCORE_GAP \\$1
. shift
. \}
. if \B'\\$1' \{\
. ds $RULE_GAP \\$1
. shift
. \}
. if '\\$1'PREFIX' \{\
. ds $PREFIX \\$2
. shift 2
. \}
. if '\\$1'SUFFIX' \{\
. ds $SUFFIX \\$2
. shift 2
. \}
. if \\n[#NUM_ARGS]=3 \{\
. ds $UNDERSCORE_GAP \\$1
. ds $RULE_GAP \\$2
. shift 2
. \}
. if !'\\*[$TITLE_TYPE]'' \{\
. nr #UNDERSCORE_WEIGHT \\n[#\\*[$TITLE_TYPE]_UNDERLINE_WEIGHT]
. nr #UNDERSCORE_WEIGHT_ADJ \\n[#\\*[$TITLE_TYPE]_UNDERLINE_WEIGHT_ADJ]
. ds $UNDERSCORE_GAP \\*[$\\*[$TITLE_TYPE]_UNDERLINE_GAP]
. ds $RULE_GAP \\*[$\\*[$TITLE_TYPE]_RULE_GAP]
. \}
. nr #TEXT_WIDTH \w'\\$1'
. ie \\n[.u]=1 \{\
\\*[$PREFIX]\Z'\\$1'\
\Z'\D't \\n[#UNDERSCORE_WEIGHT]''\
\v'\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
\Z'\D'l \\n[#TEXT_WIDTH]u 0''\
\v'\\*[$RULE_GAP]+\\n[#UNDERSCORE_WEIGHT]u'\
\D'l \\n[#TEXT_WIDTH]u 0'\
\Z'\D't \\n[#RULE_WEIGHT]''\
\v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])-(\\n[#UNDERSCORE_WEIGHT]u*2u)'\\*[$SUFFIX]\c
. \}
. el \{\
\\*[$PREFIX]\Z'\\$1'\
\Z'\D't \\n[#UNDERSCORE_WEIGHT]''\
\v'\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
\Z'\D'l \\n[#TEXT_WIDTH]u 0''\
\v'\\*[$RULE_GAP]+\\n[#UNDERSCORE_WEIGHT]u'\
\D'l \\n[#TEXT_WIDTH]u 0'\
\Z'\D't \\n[#RULE_WEIGHT]''\
\v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])-(\\n[#UNDERSCORE_WEIGHT]u*2u)'\\*[$SUFFIX]
. \}
. nr #UNDERSCORE_WEIGHT \\n[#SAVED_UNDERSCORE_WEIGHT]
. nr #UNDERSCORE_WEIGHT_ADJ \\n[#SAVED_UNDERSCORE_WEIGHT_ADJ]
. ds $UNDERSCORE_GAP \\*[$SAVED_UNDERSCORE_GAP]
. rr #SAVED_UNDERSCORE_WEIGHT
. rr #SAVED_UNDERSCORE_WEIGHT_ADJ
. rm $PREFIX
. rm $SUFFIX
. rm $SAVED_UNDERSCORE_GAP
. rm $SAVED_RULE_GAP
. rm $TITLE_TYPE
.END
\#
\# Default underscoring underline and rule gaps
\#
.ds $BIB_STRING_RULE_GAP 2p
.ds $BIB_STRING_UNDERLINE_GAP 2p
.ds $EN_STRING_RULE_GAP 2p
.ds $EN_STRING_UNDERLINE_GAP 2p
.ds $EN_TITLE_UNDERLINE_GAP 2p
.ds $RULE_GAP 2p
.ds $TOC_HEADER_RULE_GAP 2p
.ds $TOC_HEADER_UNDERLINE_GAP 2p
.ds $UNDERSCORE_GAP 2p
\#
.nr #LOOP 0 1
.while \n+[#LOOP]<=14 \{\
. ds $\*[TITLE_TYPE_\n[#LOOP]]_RULE_GAP 2p
. ds $COVER_\*[TITLE_TYPE_\n[#LOOP]]_RULE_GAP 2p
. ds $DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_RULE_GAP 2p
. ds $\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_GAP 2p
. ds $COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_GAP 2p
. ds $DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_GAP 2p
.\}
\#
\# SUPERSCRIPT
\# -----------
\# *Function:
\# Prints everything after inline invocation as superscript.
\# *Notes:
\# \*[SUP] and \*[SUPX] turn superscript on and off respectively.
\# If running type is pseudo-condensed/expanded, invoke the superscript
\# strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
\# and \*[EXTSUPX] respectively.
\#
\# Default raise/lower amount
.ds $SUP_RAISE \v'-.3m'
.ds $SUP_LOWER \v'.3m'
\#
\# SUPERSCRIPT RAISE
\# -----------------
\# *Argument:
\# <amount to raise superscript>
\# *Function:
\# Defines strings $SUP_RAISE and $SUP_LOWER for use with \*[SUP],
\# \*[CONDSUP] and \*[EXTSUP].
\#
.MAC SUPERSCRIPT_RAISE_AMOUNT END
. ds $SUP_RAISE_AMOUNT \\$1
. ds $SUP_RAISE \v'-\\*[$SUP_RAISE_AMOUNT]'
. ds $SUP_LOWER \v'\\*[$SUP_RAISE_AMOUNT]'
.END
\#
.ds SUP \
\R'#PT_SIZE_IN_UNITS \En[.ps]'\
\R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
\s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_RAISE]\s[\En[#SUP_PT_SIZE]u]
\#
.ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_LOWER]
\#
.ds CONDSUP \
\R'#PT_SIZE_IN_UNITS \En[.ps]'\
\R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
\s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_RAISE]\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
\#
.ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_LOWER]\E*[COND]
\#
.ds EXTSUP \
\R'#PT_SIZE_IN_UNITS \En[.ps]'\
\R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
\s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_RAISE]\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
\#
.ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_LOWER]\E*[EXT]
\#
\# SLANT
\# -----
\#
\# SETSLANT
\# --------
\# *Arguments:
\# <number of degrees> | RESET
\# *Function:
\# Modifies register #DEGREES for use with \*[SLANT], or resets
\# it to the default. Defines string \*[SLANTX]
\# *Notes:
\# \*[SLANT] permits pseudo-italicizing of a font in cases where
\# no italic font exists in a particular family.
\#
\# Default # of degrees is 15.
\#
\# Do not use unit of measure with arg to SETSLANT.
\#
\# It may be necessary to adjust the spacing on either side of
\# [SLANT] and [SLANTX].
\#
\# In docs, SLANT carries over from para to para.
\#
.nr #DEGREES 15
.ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
.ds SLANTX \ER'#SLANT_ON 0'\ES'0'
\#
.MAC SETSLANT END
. ie '\\$1'RESET' \{\
. nr #DEGREES 15
. if \\n[#PRINT_STYLE]=1 \
. if \\n[#UNDERLINE_SLANT] .return
. ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
. \}
. el \{\
. nr #DEGREES \\$1
. if \\n[#PRINT_STYLE]=1 \
. if \\n[#UNDERLINE_SLANT] .return
. ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
. \}
. ds SLANTX \ER'#SLANT_ON 0'\ES'0'
.END
\#
\# BOLDER
\# ------
\#
\# SETBOLDER
\# ---------
\# *Arguments:
\# <amount of emboldening> | RESET
\# *Function:
\# Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
\# it to the default 700 units.
\# *Notes:
\# \*[BOLDER] allows pseudo-emboldening of a font where no bold
\# font exists in a particular family.
\#
\# Default for SETBOLDER is 700 units. Do not use unit of measure
\# with arg to SETBOLDER.
\#
.nr #BOLDER_UNITS 700
\#
.MAC SETBOLDER END
. if \\n[#IGNORE]=1 .return
. ie '\\$1'RESET' .nr #BOLDER_UNITS 700
. el .nr #BOLDER_UNITS \\$1
.END
\#
.MAC BOLDER END
\c
.bd \\n[.f] \\n[#BOLDER_UNITS]
.END
\#
.MAC BOLDERX END
\c
.bd \\n[.f]
.END
\#
\# +++CONDENSE/EXTEND+++
\#
\# CONDENSE/EXTEND
\# ---------------
\# *Arguments:
\# <percentage to condense/expand type size>
\# *Function:
\# Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
\# new point size (for character width) from arg, and defines string
\# COND or EXT, which set the type size to the new character width,
\# and sets the height of type to the value stored in CURRENT_PT_SIZE
\# *Notes:
\# CONDENSE_OR_EXTEND is invoked from the aliases
\# CONDENSE and EXTEND. CONDENSE implies <100, EXTEND
\# implies >100. Do not use a percent sign in the argument.
\#
\# There is no default setting for CONDENSE or EXTEND.
\# 80 is a good approximation of condensed type, 120 is okay
\# for extended.
\#
\# The value set by CONDENSE or EXTEND applies to all
\# subsequent \*[COND] or \*[EXT] escapes until a new value is set.
\#
\# \*[COND] or \*[EXT] must be turned off before all changes of point
\# size, and reinvoked afterwards (if so desired). This refers to
\# changes of point size via control lines AND via inlines.
\#
.MAC CONDENSE_OR_EXTEND END
. if '\\$0'CONDENSE' \{\
. ds $COND_PERCENT \\$1
. if \\n[#PRINT_STYLE]=1 \{\
. rm $COND_PERCENT
. ds $COND_PERCENT 100
. \}
. ds COND \
\R'#PT_SIZE_IN_UNITS \En[.ps]'\
\R'#CONDENSE 1'\
\R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
\Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
. ds COND_FOR_SUP \
\R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
\Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
. \}
. if '\\$0'EXTEND' \{\
. ds $EXT_PERCENT \\$1
. if \\n[#PRINT_STYLE]=1 \{\
. rm $EXT_PERCENT
. ds $EXT_PERCENT 100
. \}
. ds EXT \
\R'#PT_SIZE_IN_UNITS \En[.ps]'\
\R'#EXTEND 1'\
\R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
\Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
. ds EXT_FOR_SUP \
\R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
\Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
. \}
.END
\#
.ds CONDX \
\ER'#CONDENSE 0'\Es[0]\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
.ds EXTX \
\ER'#EXTEND 0'\Es[0]\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
\#
\# +++PAD LINES+++ (insert space)
\#
\# PAD MARKER
\# ----------
\# *Arguments:
\# <character to use for marking pad points>
\# *Function:
\# Defines string $PAD_MARKER, used in PAD
\# *Notes:
\# $PAD_MARKER is normally # (the pound sign).
\#
.MAC PAD_MARKER END
. ds $PAD_MARKER \\$1
.END
\#
\# PAD
\# ---
\# *Arguments:
\# "<string of text with padding markers inserted>"
\# "<id of bookmark created by .PDF_BOOKMARK>"
\# *Function:
\# Defines and redefines padding character (default=pound sign
\# unless padding character has been set with PAD_MARKER)
\# several times so that when the string is output at the end
\# of the macro, every # has been converted to an equal-sized
\# amount of padding (blank space) on a line.
\# *Notes:
\# String tabs may be marked off during PAD.
\#
.MAC PAD END
. if \\n[.u]=1 .nr fill 1
. nf
. if !d$PAD_MARKER .ds $PAD_MARKER #
. char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
. ds $FAMILY_FOR_PAD \\n[.fam]
.\" .if !n .fp \\n[.fp] \\n[.sty]
. ds $FONT_FOR_PAD \\n[.sty]
. nr #SIZE_FOR_PAD \\n[.ps]
. ds $PAD_STRING \\$1
. as $PAD_STRING \Ekp
. di PAD_STRING
. fam \\*[$FAMILY_FOR_PAD]
\f[\\*[$FONT_FOR_PAD]]\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
. br
. di
. if \\n[#INDENT_ACTIVE] \{\
. if \\n[#INDENT_LEFT_ACTIVE] .ll -\\n[#L_INDENT]u
. if \\n[#INDENT_RIGHT_ACTIVE] .ll -\\n[#R_INDENT]u
. if \\n[#INDENT_BOTH_ACTIVE] .ll -\\n[#BR_INDENT]u
. \}
. char \\*[$PAD_MARKER] \
\R'#SPACE_TO_END \En[.l]-\En[p]'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
. di PAD_STRING
. fam \\*[$FAMILY_FOR_PAD]
\f[\\*[$FONT_FOR_PAD]]\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
. br
. di
. if \\n[#INDENT_ACTIVE] \
. if (\\n[#INDENT_LEFT_ACTIVE]=1):(\\n[#INDENT_BOTH_ACTIVE]) .ll
. char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
. if \\n[#SILENT] .SILENT
. fam \\*[$FAMILY_FOR_PAD]
\f[\\*[$FONT_FOR_PAD]]\s[\\n[#SIZE_FOR_PAD]u]
. ie '\\$2'' .nop \\*[$PAD_STRING]
. el \{\
. ie !'\\$2'NOBREAK' .pdfhref L -D "\\$2" -E -- \&\\*[$PAD_STRING]
. el .nop \\*[$PAD_STRING]
. \}
. if \\n[#SILENT] .SILENT OFF
. br
. if \\n[fill] \{\
. fi
. rr fill
. \}
. rr #PAD_COUNT
. rr #SPACE_TO_END
. rr #PAD_SPACE
. rm $PAD_STRING
. rm PAD_STRING
. rchar \\*[$PAD_MARKER]
. if '\\$2'NOBREAK' \{\
. TRAP OFF
. EOL
. TRAP
. \}
.END
\#
\# +++LEADERS+++
\#
\# The leader mechanism is primitive, but it works. Basically, every
\# macro in this set that includes a line length also sets a single
\# groff tab stop at the right hand end of the line. That way,
\# whenever Ctrl-A is invoked (always at the end of an input line),
\# leader of the correct length gets deposited. Ctrl-A is accessed by
\# the string LEADER (i.e. inline, as \*[LEADER]). Leaders within tabs
\# get their length from the tab line length.
\#
\# SET LEADER CHARACTER
\# --------------------
\# *Arguments:
\# <character to use whenever \*[LEADER] is invoked>
\# *Function:
\# Set leader character.
\#
.MAC LEADER_CHARACTER END
. lc \\$1
.END
\#
.ds LEADER
\#
\# +++DROP CAPS+++
\#
\# DROP CAP FAMILY
\# ---------------
\# *Argument:
\# <family of drop cap>
\# *Function:
\# Creates or modifies string $DC_FAM.
\#
.MAC DROPCAP_FAMILY END
. ds $DC_FAM \\$1
.END
\#
\# DROP CAP FONT
\# -------------
\# *Argument:
\# <font of drop cap>
\# *Function:
\# Creates or modifies string $DC_FT.
\#
.MAC DROPCAP_FONT END
. ds $DC_FT \\$1
.END
\#
\# DROPCAP COLOR
\# -------------
\# *Arguments:
\# <pre-defined XCOLOR or NEWCOLOR>
\# *Function:
\# Defines string $DC_COLOR to argument.
\# *Notes:
\# User must define an XCOLOR or NEWCOLOR before using
\# DC_COLOR.
\#
.MAC DROPCAP_COLOR END
. if \\n[#PRINT_STYLE]=1 .return
. nr #DC_COLOR 1
. ds $DC_COLOR \\$1
.END
\#
\# DROP CAP GUTTER
\# ---------------
\# *Argument:
\# <width of gutter between drop cap and indented text>
\# *Function:
\# Creates or modifies register #DC_GUT.
\# *Notes:
\# Requires unit of measure. Default is 3p.
\#
.MAC DROPCAP_GUTTER END
. nr #DC_GUT (\\$1)
.END
\#
\# DROP CAP ADJUST
\# ---------------
\# *Argument:
\# <+|- # of points to in/decrease point size of drop cap letter>
\# *Function:
\# Creates or modifies string $DC_ADJUST.
\# *Notes:
\# Despite its best efforts, DROPCAP doesn't always get the point
\# size of the drop cap critically perfect. DROPCAP_ADJUST lets
\# the user add or subtract points (or fractions of points) to
\# get the size right.
\#
\# Requires the + or - sign.
\#
.MAC DROPCAP_ADJUST END
. ds $DC_ADJUST \\$1
.END
\#
\# DROP CAP
\# --------
\# *Arguments:
\# <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
\# *Function:
\# Calculates point size of dropcap based on # of lines passed as
\# arg 2. Sets indent for text based on dropcap width+gutter.
\# Advances and prints dropcap; reverses and prints indented text
\# to bottom of dropcap, then resets indent to left margin (plus
\# any indent that was in effect prior to invoking DROPCAP).
\# *Notes:
\# Drop caps when using the doc processing macro PP only work with
\# initial paragraphs (i.e. at doc start, or after heads), only when
\# DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
\# is TYPESET. If these conditions aren't met, DROPCAPS is silently
\# ignored.
\#
\# The COND or EXT argument are processed separately from all
\# other COND or EXT inlines or macros, hence passing COND or
\# EXT has no effect on running type.
\#
.MAC DROPCAP END
. if \\n[#IGNORE]=1 \{\
. PRINT \\$1\c
. return
. \}
. br
. if n \{\
. PRINT \\$1\c
. return
. \}
. if \\n[#DOCS] \{\
. if \\n[#PRINT_STYLE]=1 \{\
. PRINT \\$1\c
. return
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. sp -1
. if \\n[#PP_STYLE]=2 \{\
. PRINT \\$1\c
. return
. \}
. if \\n[#PP]>1 \{\
. if \\n[#PP_INDENT] .ti \\n[#PP_INDENT]u
. PRINT \\$1\c
. return
. \}
. ti 0
. \}
. \}
. ds $DROPCAP \\$1
. nr #DC_LINES \\$2-1
. if \\n[#CONDENSE]=1 \{\
. ds $RESTORE_COND \\*[$COND_PERCENT]
\\*[CONDX]
. nr #CONDENSE_WAS_ON 1
. \}
. if \\n[#EXTEND]=1 \{\
. ds $RESTORE_EXT \\*[$EXT_PERCENT]
\\*[EXTX]
. nr #EXTEND_WAS_ON 1
. \}
. if '\\$3'COND' .CONDENSE \\$4
. if '\\$3'EXT' .EXTEND \\$4
. if !r#DC_GUT .nr #DC_GUT 3p
. ie \\n[#DOCS] .ds $RESTORE_FAM \\*[$DOC_FAM]
. el .ds $RESTORE_FAM \\n[.fam]
. ie \\n[#DOCS] .ds $RESTORE_FT \\*[$PP_FT]
. el .ds $RESTORE_FT \\*[$FONT]
. nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
. nr #RESTORE_INDENT \\n[.i]
. SIZESPECS
. nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
. ie !d$DC_FAM .FAM \\n[.fam]
. el .FAM \\*[$DC_FAM]
. ie !d$DC_FT .FT \\*[$FONT]
. el .FT \\*[$DC_FT]
. while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
. ps \\n[#PT_SIZE]u+100u
. SIZESPECS
. nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
. \}
. if d$DC_ADJUST .ps \\*[$DC_ADJUST]p
. nr #DC_LINES +1
. if (\\n[#DC_LINES]v-1v)>(\\n[.t]-1) \{\
. nr pgnum \\n%+\\n[#PAGE_NUM_ADJ] 1
. if \\n[#COLUMNS]=1 .ds col-num ", column \\n[#COL_NUM]
. tm1 \
"[mom]: Dropcap at line \\n[.c] does not fit on page \\n[pgnum]\\*[col-num].
. tm1 \
" Shifting paragraph to next page or column.
. ie \\n[#COLUMNS] .COL_NEXT
. el .NEWPAGE
. \}
. ie \\n[#DC_COLOR]=1 \{\
. ie !'\\$3'' \{\
. ie '\\$3'COND' \
. PRINT \
\\*[DOWN \\n[#DC_LINES]v]\
\m[\\*[$DC_COLOR]]\\*[COND]\\*[$DROPCAP]\\*[CONDX]\m[]\\*[UP \\n[#DC_LINES]v]
. el \
. PRINT \
\\*[DOWN \\n[#DC_LINES]v]\
\m[\\*[$DC_COLOR]]\\*[EXT]\\*[$DROPCAP]\\*[EXTX]\m[]\\*[UP \\n[#DC_LINES]v]
. \}
. el .PRINT \
\\*[DOWN \\n[#DC_LINES]v]\
\m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[]\\*[UP \\n[#DC_LINES]v]
. \}
. el \{\
. ie !'\\$3'' \{\
. ie '\\$3'COND' \
. PRINT \
\\*[DOWN \\n[#DC_LINES]v]\
\\*[COND]\\*[$DROPCAP]\\*[CONDX]\\*[UP \\n[#DC_LINES]v]
. el \
. PRINT \
\\*[DOWN \\n[#DC_LINES]v]\
\\*[EXT]\\*[$DROPCAP]\\*[EXTX]\\*[UP \\n[#DC_LINES]v]
. \}
. el .PRINT \
\\*[DOWN \\n[#DC_LINES]v]\
\\*[$DROPCAP]\\*[UP \\n[#DC_LINES]v]
. \}
. if '\\$3'COND' \E*[COND]
. if '\\$3'EXT' \E*[EXT]
. ie \\n[.i] \{\
. vs 0
. br
. in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u
. vs
. \}
. el \{\
. vs 0
. br
. in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u
. vs
. \}
. if '\\$3'COND' \E*[CONDX]\c
. if '\\$3'EXT' \E*[EXTX]\c
. FAM \\*[$RESTORE_FAM]
. FT \\*[$RESTORE_FT]
. ps \\n[#RESTORE_PT_SIZE]u
. if \\n[#CONDENSE_WAS_ON] \{\
. CONDENSE \\*[$RESTORE_COND]
\\*[COND]\c
. \}
. if \\n[#EXTEND_WAS_ON] \{\
. EXTEND \\*[$RESTORE_EXT]
\\*[EXT]\c
. \}
. ie \\n[.u] .wh \\n[.d]u+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF
. el .wh \\n[.d]u+\\n[#DC_HEIGHT]u DROPCAP_OFF
. rr #CONDENSE_WAS_ON
. rr #EXTEND_WAS_ON
. rm $DROPCAP
. rr #DC_LINES
. rm $RESTORE_COND
. rm $RESTORE_EXT
. rm $RESTORE_FAM
. rm $RESTORE_FT
. rr #RESTORE_PT_SIZE
. rr #RESTORE_INDENT
. rr #DC_HEIGHT
. rr #GET_DC_HEIGHT
. rr x
.END
\#
.MAC DROPCAP_OFF END
' in \\n[#RESTORE_INDENT]u
. ch DROPCAP_OFF
.END
\#
\# =====================================================================
\#
\# +++GRAPHICAL OBJECTS+++
\#
\# Set params for graphical objects.
\#
.MAC GRAPHICAL_OBJ END
. rr #FILLED
. rr #FILL_MODE
. rr #NOFILL
. rr #NOFILL_MODE
. if \\n[.vpt]=1 \{\
. vpt 0
. nr #RESTORE_TRAP 1
. \}
. ie !\\n[#NO_ADVANCE]=1 .br
. el \{\
. sp -1v
. rr #NO_ADVANCE
. \}
. ie \\n[.u]=1 \{\
. nr #FILLED 1
. nr #FILL_MODE \\n[.j]
. \}
. el \{\
. nr #NOFILL 1
. if \\n[.ce]>0 .nr #NOFILL_MODE 3
. if \\n[.rj]>0 .nr #NOFILL_MODE 5
. ce 0
. rj 0
. \}
. nf
.END
\#
\# HORIZONTAL RULE - DRH
\# ---------------------
\# *Arguments:
\# <none> | <rule weight> <indent> <length> [ <color> ]
\# *Function:
\# With no arg, draws a full measure rule. With args, draws
\# described horizontal rule.
\# *Notes:
\# Rules are drawn left-to-right, from the baseline down, and
\# return to their point of origin. If no arg given (full measure
\# rule), the rule weight is the one set by RULE_WEIGHT.
\#
.MAC DRH END
. GRAPHICAL_OBJ
. ds $RL_WEIGHT \\$1
. ds $RL_INDENT \\$2
. ds $RL_LENGTH \\$3
. ie !'\\$4'' .ds $RL_COLOR \\$4
. el \{\
. ie '\\n[.m]'' .ds $RL_COLOR \\*[default]
. el .ds $RL_COLOR \\n[.m]
. \}
. nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
. nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ]
. di NULL
. if \\n[#NUM_ARGS]>=1 .RULE_WEIGHT \\*[$RL_WEIGHT]
. di
. COLOR \\*[$RL_COLOR]
. ie \\n[#NUM_ARGS]=0 \{\
. ie \\n[#INDENT_ACTIVE] \{\
. nr #RESTORE_L_LENGTH \\n[.l]
. if \\n[#INDENT_BOTH_ACTIVE] .ll \\n[.l]u-\\n[#BL_INDENT]u
. if \\n[#INDENT_LEFT_ACTIVE] .ll \\n[.l]u-\\n[#L_INDENT]u
\Z'\D't \\n[#RULE_WEIGHT]''\
\h'\\*[$RL_INDENT]+\\n[#RULE_WEIGHT_ADJ]u'\
\v'\\n[#RULE_WEIGHT_ADJ]u'\
\D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\
\v'-\\n[#RULE_WEIGHT_ADJ]u'\
\Z'\D't \\n[#SAVED_RULE_WEIGHT]''
. ll \\n[#RESTORE_L_LENGTH]u
. rr #RESTORE_L_LENGTH
. \}
. el \{\
\Z'\D't \\n[#RULE_WEIGHT]''\
\h'\\*[$RL_INDENT]+\\n[#RULE_WEIGHT_ADJ]u'\
\v'\\n[#RULE_WEIGHT_ADJ]u'\
\D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\
\v'-\\n[#RULE_WEIGHT_ADJ]u'\
\Z'\D't \\n[#SAVED_RULE_WEIGHT]''
. \}
. \}
. el \{\
\Z'\D't \\n[#RULE_WEIGHT]''\
\h'\\*[$RL_INDENT]+\\n[#RULE_WEIGHT_ADJ]u'\
\v'\\n[#RULE_WEIGHT_ADJ]u'\
\D'l \\*[$RL_LENGTH] 0'\
\v'-\\n[#RULE_WEIGHT_ADJ]u'\
\Z'\D't \\n[#SAVED_RULE_WEIGHT]''
. rr #RESTORE_L_LENGTH
. \}
. if \\n[#FILLED]=1 \{\
. if \\n[#FILL_MODE]=0 .QUAD LEFT
. if \\n[#FILL_MODE]=1 .JUSTIFY
. if \\n[#FILL_MODE]=3 .QUAD CENTER
. if \\n[#FILL_MODE]=5 .QUAD RIGHT
. rr #FILLED
. \}
. sp -1v
. if \\n[#NOFILL]=1 \{\
. if \\n[#NOFILL_MODE]=3 .CENTER
. if \\n[#NOFILL_MODE]=5 .RIGHT
. \}
. gcolor
. nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
. nr #RULE_WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
. rr #SAVED_WEIGHT
. rr #SAVED_WEIGHT_ADJ
. if \\n[#RESTORE_TRAP]=1 \{\
. vpt
. rr #RESTORE_TRAP
. \}
. if '\\n[.z]'FLOAT*DIV' \
. if !(\\n[.d]+\\n[#WEIGHT])<\\n[D-float] .nr D-float \\n[.d]+\\n[#WEIGHT]
.END
\#
\# RULE
\# ----
\# *Argument:
\# <none>
\# *Function:
\# Draws a rule the length of the current measure.
\# *Notes:
\# A convenience macro. DRH with no argument does the same thing.
\# Kept in for backward compatibility.
\#
.MAC RULE END
. if \\n[.u]=1 \{\
. nr fill 1
. ds $CURRENT_QUAD \\*[$QUAD_VALUE]
. nf
. \}
. ie \\n[#INDENT_ACTIVE] \{\
. if \\n[#INDENT_BOTH_ACTIVE] .ll \\n[.l]u-\\n[#BL_INDENT]u
. if \\n[#INDENT_LEFT_ACTIVE] .ll \\n[.l]u-\\n[#L_INDENT]u
. PRINT \
\Z'\D't \\n[#RULE_WEIGHT]''\
\v'\\n[#RULE_WEIGHT_ADJ]u'\
\h'\\n[#RULE_WEIGHT_ADJ]u'\
\D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\h'|0'\c
. ll
. rr #RESTORE_L_LENGTH
. \}
. el \{\
. PRINT \
\Z'\D't \\n[#RULE_WEIGHT]''\
\v'\\n[#RULE_WEIGHT_ADJ]u'\
\h'\\n[#RULE_WEIGHT_ADJ]u'\
\D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\h'|0'\c
. \}
. if \\n[fill] \{\
. fi
. rr fill
. QUAD \\*[$CURRENT_QUAD]
. rm $CURRENT_QUAD
. \}
. EOL
.END
\#
\# VERTICAL RULE - DRV
\# -------------------
\# *Arguments:
\# <rule weight> <indent> <depth> [ <color> ]
\# *Function:
\# Draws described vertical rule.
\# *Notes:
\# Rules are drawn left-to-right, from the baseline down, and
\# return to their point of origin.
.MAC DRV END
. GRAPHICAL_OBJ
. ds $RL_WEIGHT \\$1
. ds $RL_INDENT \\$2
. ds $RL_DEPTH \\$3
. ie !'\\$4'' \
. ds $RL_COLOR \\$4
. el \{\
. ie '\\n[.m]'' .ds $RL_COLOR \\*[default]
. el .ds $RL_COLOR \\n[.m]
. \}
. nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
. nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ]
. RULE_WEIGHT \\*[$RL_WEIGHT]
. COLOR \\*[$RL_COLOR]
\Z'\D't \\n[#RULE_WEIGHT]''\
\h'\\*[$RL_INDENT]+\\n[#RULE_WEIGHT]u+\\n[#RULE_WEIGHT_ADJ]u'\
\D'l 0 \\*[$RL_DEPTH]'\
\D't \\n[#SAVED_RULE_WEIGHT]'
. if \\n[#FILLED]=1 \{\
. if \\n[#FILL_MODE]=0 .QUAD LEFT
. if \\n[#FILL_MODE]=1 .JUSTIFY
. if \\n[#FILL_MODE]=3 .QUAD CENTER
. if \\n[#FILL_MODE]=5 .QUAD RIGHT
. rr #FILLED
. \}
. sp -1v
. if \\n[#NOFILL]=1 \{\
. if \\n[#NOFILL_MODE]=3 .CENTER
. if \\n[#NOFILL_MODE]=5 .RIGHT
. \}
. gcolor
. nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
. nr #RULE_WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
. if \\n[#RESTORE_TRAP]=1 \{\
. vpt
. rr #RESTORE_TRAP
. \}
. if '\\n[.z]'FLOAT*DIV' \
. if !(\\n[.d]+\\*[$RL_DEPTH])<\\n[D-float] .nr D-float \\n[.d]+\\*[$RL_DEPTH]
.END
\#
\# BOXES - DBX
\# -----------
\# *Arguments:
\# <rule weight>|SOLID <indent> <width>|FULL_MEASURE <depth> [ <color> ]
\# *Function:
\# Draws described box.
\# *Notes:
\# Boxes are drawn left-to-right, from the baseline down, and
\# return to their point of origin. Box rules are drawn from the
\# perimeter inwards.
\#
.MAC DBX END
. GRAPHICAL_OBJ
. ie '\\$1'SOLID' .nr #BX_SOLID 1
. el .ds $BX_WEIGHT \\$1
. ds $BX_INDENT \\$2
. ie '\\$3'FULL_MEASURE' \{\
. ie (\\n[#INDENT_LEFT_ACTIVE]+\\n[#INDENT_RIGHT_ACTIVE]+\\n[#INDENT_BOTH_ACTIVE])=0 \{\
. nr #WIDTH \\n[.l]
. ds $BX_WIDTH \\n[#WIDTH]u
. \}
. el \{\
. if \\n[#INDENT_LEFT_ACTIVE] \{\
. nr #WIDTH \\n[.l]-\\n[#L_INDENT]
. ds $BX_WIDTH \\n[#WIDTH]u
. \}
. if \\n[#INDENT_RIGHT_ACTIVE] \{\
. nr #WIDTH \\n[.l]
. ds $BX_WIDTH \\n[#WIDTH]u
. \}
. if \\n[#INDENT_BOTH_ACTIVE] \{\
. nr #WIDTH \\n[.l]-(\\n[#BL_INDENT])
. ds $BX_WIDTH \\n[#WIDTH]u
. \}
. \}
. \}
. el .ds $BX_WIDTH \\$3
. ds $BX_DEPTH \\$4
. ie !'\\$5'' \{\
. ie d$\\$5_FILL .ds $BX_COLOR \\*[$\\$5_FILL]
. el .ds $BX_COLOR \\$5
. \}
. el \{\
. ie '\\n[.m]'' .ds $BX_COLOR \\*[default]
. el .ds $BX_COLOR \\n[.m]
. \}
. nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
. nr #SAVED_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
. if !'\\$1'SOLID' .RULE_WEIGHT \\*[$BX_WEIGHT]
. ds $BX_INDENT \\*[$BX_INDENT]-\\n[#WEIGHT_ADJ]u
. ie \\n[#BX_SOLID]=1 \{\
. fcolor \\*[$BX_COLOR]
\h'\\*[$BX_INDENT]+\\n[#BOX_WEIGHT_ADJ]u+\\n[#RULE_WEIGHT]u'\
\D'P \\*[$BX_WIDTH] 0 0 \\*[$BX_DEPTH] -\\*[$BX_WIDTH] 0 0 -\\*[$BX_DEPTH]'
. fcolor
. rr #BX_SOLID
. \}
. el \{\
. COLOR \\*[$BX_COLOR]
\Z'\D't \\n[#RULE_WEIGHT]''\
\h'\\*[$BX_INDENT]+\\n[#RULE_WEIGHT]u+\\n[#RULE_WEIGHT_ADJ]u'\
\v'\\n[#WEIGHT_ADJ]u'\
\D'p \\*[$BX_WIDTH]-\\n[#RULE_WEIGHT]u 0 0 \\*[$BX_DEPTH]-\\n[#RULE_WEIGHT]u -\\*[$BX_WIDTH]+\\n[#RULE_WEIGHT]u 0 0 -\\*[$BX_DEPTH]+\\n[#RULE_WEIGHT]u'\
\v'-\\n[#WEIGHT_ADJ]u'\
\Z'\D't \\n[#SAVED_RULE_WEIGHT]''
. gcolor
. \}
. sp -1v
. if \\n[#FILLED]=1 \{\
. if \\n[#FILL_MODE]=0 .QUAD LEFT
. if \\n[#FILL_MODE]=1 .JUSTIFY
. if \\n[#FILL_MODE]=3 .QUAD CENTER
. if \\n[#FILL_MODE]=5 .QUAD RIGHT
. \}
. if \\n[#NOFILL]=1 \{\
. if \\n[#NOFILL_MODE]=3 .CENTER
. if \\n[#NOFILL_MODE]=5 .RIGHT
. \}
. nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
. nr #WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
. rr #SAVED_WEIGHT
. rr #SAVED_WEIGHT_ADJ
. if \\n[#RESTORE_TRAP]=1 \{\
. vpt
. rr #RESTORE_TRAP
. \}
. if '\\n[.z]'FLOAT*DIV' \
. if !(\\n[.d]+\\*[$BX_DEPTH])<\\n[D-float] .nr D-float \\n[.d]+\\*[$BX_DEPTH]
.END
\#
\# ELLIPSES - DCL
\# --------------
\# *Arguments:
\# <rule weight>|SOLID <indent> <width>|FULL_MEASURE <depth> [ <color> ]
\# *Function:
\# Draws described ellipses.
\# *Notes:
\# Ellipses (circles) are drawn left-to-right, from the baseline
\# down, and return to their point of origin. Ellipse rules are
\# drawn from the perimeter inwards.
\#
.MAC DCL END
. GRAPHICAL_OBJ
. ie '\\$1'SOLID' .nr #CL_SOLID 1
. el .ds $CL_WEIGHT \\$1
. ds $CL_INDENT \\$2
. ds $CL_WIDTH \\$3
. ie '\\$3'FULL_MEASURE' \{\
. ie (\\n[#INDENT_LEFT_ACTIVE]+\\n[#INDENT_RIGHT_ACTIVE]+\\n[#INDENT_BOTH_ACTIVE])=0 \
. nr #WIDTH \\n[.l]
. ds $CL_WIDTH \\n[#WIDTH]u
. el \{\
. if \\n[#INDENT_LEFT_ACTIVE] \{\
. nr #WIDTH \\n[.l]-\\n[#L_INDENT]
. ds $CL_WIDTH \\n[#WIDTH]u
. \}
. if \\n[#INDENT_RIGHT_ACTIVE] \{\
. nr #WIDTH \\n[.l]
. ds $CL_WIDTH \\n[#WIDTH]u
. \}
. if \\n[#INDENT_BOTH_ACTIVE] \{\
. nr #WIDTH \\n[.l]-(\\n[#BL_INDENT])
. ds $CL_WIDTH \\n[#WIDTH]u
. \}
. \}
. \}
. el .ds $CL_WIDTH \\$3
. ds $CL_DEPTH \\$4
. ie !'\\$5'' \{\
. ie d$\\$5_FILL .ds $CL_COLOR \\*[$\\$5_FILL]
. el .ds $CL_COLOR \\$5
. \}
. el \{\
. ie '\\n[.m]'' .ds $CL_COLOR \\*[default]
. el .ds $CL_COLOR \\n[.m]
. \}
. nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
. nr #SAVED_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
. if !'\\$1'SOLID' .RULE_WEIGHT \\*[$CL_WEIGHT]
. ds $CL_INDENT \\*[$CL_INDENT]-\\n[#WEIGHT_ADJ]u
. ie \\n[#CL_SOLID]=1 \{\
. fcolor \\*[$CL_COLOR]
\h'\\*[$CL_INDENT]+\\n[#RULE_WEIGHT]u'\
\v'\\*[$CL_DEPTH]/2u'\
\D'E \\*[$CL_WIDTH]-\\n[#RULE_WEIGHT]u \\*[$CL_DEPTH]-\\n[#RULE_WEIGHT]u'\
\v'-\\*[$CL_DEPTH]/2u'
. fcolor
. rr #CL_SOLID
. \}
. el \{\
. COLOR \\*[$CL_COLOR]
\Z'\D't \\n[#RULE_WEIGHT]''\
\h'\\*[$CL_INDENT]+\\n[#RULE_WEIGHT]u+\\n[#RULE_WEIGHT_ADJ]u'\
\v'\\*[$CL_DEPTH]/2u'\
\D'e \\*[$CL_WIDTH]-\\n[#RULE_WEIGHT]u \\*[$CL_DEPTH]-\\n[#RULE_WEIGHT]u'\
\v'-(\\*[$CL_DEPTH]/2u)'\
\Z'\D't \\n[#SAVED_RULE_WEIGHT]''
. gcolor
. \}
. sp -1v
. if \\n[#FILLED]=1 \{\
. if \\n[#FILL_MODE]=0 .QUAD LEFT
. if \\n[#FILL_MODE]=1 .JUSTIFY
. if \\n[#FILL_MODE]=3 .QUAD CENTER
. if \\n[#FILL_MODE]=5 .QUAD RIGHT
. rr #FILLED
. \}
. if \\n[#NOFILL]=1 \{\
. if \\n[#NOFILL_MODE]=3 .CENTER
. if \\n[#NOFILL_MODE]=5 .RIGHT
. \}
. nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
. nr #WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
. rr #SAVED_WEIGHT
. rr #SAVED_WEIGHT_ADJ
. if \\n[#RESTORE_TRAP]=1 \{\
. vpt
. rr #RESTORE_TRAP
. \}
. if '\\n[.z]'FLOAT*DIV' \
. if !(\\n[.d]+\\*[$CL_DEPTH])<\\n[D-float] .nr D-float \\n[.d]+\\*[$CL_DEPTH]
.END
\#
\# RULE WEIGHT
\# -----------
\# *Argument:
\# <weight of rules in points>
\# *Function:
\# Sets \D't <n>' to the correct number of machine units for the
\# argument given in points.
\# *Notes:
\# Decimal fractions are allowed. Rule weight must be < 100.
\#
.MAC RULE_WEIGHT END
. di NULL \" Diverted so there's no problem with breaks, spacing, etc.
. ds $ARG \\$1
. substring $ARG -1
. if !\B'\\*[$ARG]' \{\
. tm1 "[mom]: The argument to \\$0 must not have a unit of measure appended.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. length #STR_LENGTH \\$1
. ds $ARG \\$1
. substring $ARG 0 0
. ie '\\*[$ARG]'.' \{\
. ds $ARG \\$1
. substring $ARG 1 \\n[#STR_LENGTH]-1
. nr #WEIGHT \\*[$ARG]*100
. if (\\n[#WEIGHT]>=1000) \{\
. while (\\n[#WEIGHT]>=1000) \{\
. nr #WEIGHT \\n[#WEIGHT]/10
. \}
. \}
. \}
. el \{\
. ds $ARG \\$1
. length #ARG_LENGTH \\*[$ARG]
. if \\n[#ARG_LENGTH]>1 .substring $ARG 1 1
. ie '\\*[$ARG]'.' \{\
. ds $LHS \\$1
. substring $LHS 0 0
. ds $RHS \\$1
. substring $RHS 2
. nr #WEIGHT \\*[$LHS]\\*[$RHS]*100
. if (\\n[#WEIGHT]>=10000) \{\
. while (\\n[#WEIGHT]>=10000) \{\
. nr #WEIGHT \\n[#WEIGHT]/10
. \}
. \}
. \}
. el \{\
. ie \\n[#STR_LENGTH]<=2 .nr #WEIGHT \\$1*1000
. el \{\
. ds $ARG \\$1
. substring $ARG 2 2
. ie !'\\*[$ARG]'.' \{\
. tm1 "[mom]: Invalid argument given to macro \\$0 at line \\n[.c].
. tm1 " Rule weight must be < 100 points.
. tm1 " Falling back to default weight .5 points.
. nr #WEIGHT 500
. \}
. el \{\
. ds $LHS \\$1
. substring $LHS 0 1
. ds $RHS \\$1
. substring $RHS 3
. nr #WEIGHT \\*[$LHS]\\*[$RHS]*1000
. if (\\n[#WEIGHT]>=100000) \{\
. while (\\n[#WEIGHT]>=100000) \{\
. nr #WEIGHT \\n[#WEIGHT]/10
. \}
. \}
. \}
. \}
. \}
. \}
. nr #WEIGHT_ADJ \\n[#WEIGHT]/2
. if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT' \
. ds $TITLE_TYPE BIB_STRING_
. if '\\$0'ENDNOTE_TITLE_UNDERLINE_WEIGHT' \
. ds $TITLE_TYPE EN_TITLE_
. if '\\$0'EN_HEADER_UNDERLINE_WEIGHT' \
. ds $TITLE_TYPE EN_STRING_
. if !'\\*[$TITLE_TYPE]'BIB_STRING' \
. if !'\\*[$TITLE_TYPE]'EN_TITLE' \
. if !'\\*[$TITLE_TYPE]'EN_STRING' \
. ds _TYPE \\$0
. length type-len _TYPE
. if \\n[type-len]>17 \{\
. substring _TYPE 0 -17
. ds $TITLE_TYPE \\*[_TYPE]
. \}
. if !'\\*[$TITLE_TYPE]'' \{\
. nr #\\*[$TITLE_TYPE]UNDERLINE_WEIGHT \\n[#WEIGHT]
. nr #\\*[$TITLE_TYPE]UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
. \}
. if '\\$0'RULE_WEIGHT' \{\
. nr #RULE_WEIGHT \\n[#WEIGHT]
. nr #RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
. \}
. if '\\$0'UNDERSCORE_WEIGHT' \{\
. nr #UNDERSCORE_WEIGHT \\n[#WEIGHT]
. nr #UNDERSCORE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
. \}
. if '\\$0'FOOTER_RULE_WEIGHT' \{\
. nr #FOOTER_RULE_WEIGHT \\n[#WEIGHT]
. nr #FOOTER_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
. \}
. if '\\$0'FOOTNOTE_RULE_WEIGHT' \{\
. nr #FN_RULE_WEIGHT \\n[#WEIGHT]
. nr #FN_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
. \}
. if '\\$0'HEADER_RULE_WEIGHT' \{\
. nr #HEADER_RULE_WEIGHT \\n[#WEIGHT]
. nr #HEADER_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
. \}
. di
.END
\#
\# Aliases for RULE_WEIGHT
\#
.ALIAS BIB_STRING_UNDERLINE_WEIGHT RULE_WEIGHT
.ALIAS DOCTYPE_UNDERLINE_WEIGHT RULE_WEIGHT
.ALIAS EN_STRING_UNDERLINE_WEIGHT RULE_WEIGHT
.ALIAS EN_TITLE_UNDERLINE_WEIGHT RULE_WEIGHT
.ALIAS FN_RULE_WEIGHT RULE_WEIGHT
.ALIAS FOOTER_RULE_WEIGHT RULE_WEIGHT
.ALIAS FOOTNOTE_RULE_WEIGHT RULE_WEIGHT
.ALIAS HEADER_RULE_WEIGHT RULE_WEIGHT
.ALIAS RULE_WEIGHT RULE_WEIGHT
.ALIAS TOC_HEADER_UNDERLINE_WEIGHT RULE_WEIGHT
.ALIAS UNDERSCORE_WEIGHT RULE_WEIGHT
\#
\# Default rule weights
\#
.nr #BIB_STRING_UNDERLINE_WEIGHT 500
.nr #DOCTYPE_UNDERLINE_WEIGHT 500
.nr #EN_STRING_UNDERLINE_WEIGHT 500
.nr #EN_TITLE_UNDERLINE_WEIGHT 500
.nr #FN_RULE_WEIGHT 500
.nr #FOOTER_RULE_WEIGHT 500
.nr #HEADER_RULE_WEIGHT 500
.nr #RULE_WEIGHT 500
.nr #TOC_HEADER_UNDERLINE_WEIGHT 500
.nr #UNDERSCORE_WEIGHT 500
\#
.nr #BIB_STRING_UNDERLINE_WEIGHT_ADJ \n[#BIB_STRING_UNDERLINE_WEIGHT]/2
.nr #DOCTYPE_UNDERLINE_WEIGHT_ADJ \n[#DOCTYPE_UNDERLINE_WEIGHT]/2
.nr #EN_STRING_UNDERLINE_WEIGHT_ADJ \n[#EN_STRING_UNDERLINE_WEIGHT]/2
.nr #EN_TITLE_UNDERLINE_WEIGHT_ADJ \n[#EN_TITLE_UNDERLINE_WEIGHT]/2
.nr #FN_RULE_WEIGHT_ADJ \n[#FN_RULE_WEIGHT]/2
.nr #FOOTER_RULE_WEIGHT_ADJ \n[#FOOTER_RULE_WEIGHT]/2
.nr #HEADER_RULE_WEIGHT_ADJ \n[#HEADER_RULE_WEIGHT]/2
.nr #RULE_WEIGHT_ADJ \n[#RULE_WEIGHT]/2
.nr #TOC_HEADER_UNDERLINE_WEIGHT_ADJ \n[#TOC_HEADER_UNDERLINE_WEIGHT]/2
.nr #UNDERSCORE_WEIGHT_ADJ \n[#UNDERSCORE_WEIGHT]/2
\#
\# Read in remaining aliases and default rule weights
\#
.nr #LOOP 0 1
.while \n+[#LOOP]<=14 \{\
. ALIAS \*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_WEIGHT RULE_WEIGHT
. ALIAS COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_WEIGHT RULE_WEIGHT
. ALIAS DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_WEIGHT RULE_WEIGHT
. nr #\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_WEIGHT 500
. nr #COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_WEIGHT 500
. nr #DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_WEIGHT 500
. nr #\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_WEIGHT_ADJ \
\n[#\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_WEIGHT]/2
. nr #COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_WEIGHT_ADJ \
\n[#COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_WEIGHT]/2
. nr #DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_WEIGHT_ADJ \
\n[#DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE_WEIGHT]/2
.\}
\#
\# Set default rule weight
\#
.di NULL
\D't 500'
.di
\#
\# =====================================================================
\#
\# +++WORD AND SENTENCE SPACING+++
\#
\# WORD SPACE CONTROL
\# ------------------
\# *Argument:
\# <+|->wordspace | DEFAULT
\# *Function:
\# Increases or decreases interword space by user supplied amount.
\# If DEFAULT, value is set to 12 (groff default).
\# *Notes:
\# $WS_CONSTANT is the groff default word space.
\# $WS_VAR is the user supplied amount by which to in/decrease word space.
\# $WS is a concatenation of WS_CONSTANT and WS_VAR.
\#
\# \n[.sss] holds the current sentence space value.
\#
.MAC WS END
. ds $WS_CURR \\n[.ss]
. ds $WS_VAR \\$1
. ie '\\$1'DEFAULT' .ss 12 \\n[.sss]
. el \{\
. ds $WS (\\*[$WS_CURR]+\\*[$WS_VAR])
. ie \\n[.sss]=12 .ss \\*[$WS] 12
. el \{\
. ss \\*[$WS] (\\*[$WS]+\\*[$SS_VAR])
. SS \\*[$SS_VAR]
. \}
. \}
.END
\#
\# SENTENCE SPACE CONTROL
\# ----------------------
\# *Argument:
\# <+-sentencespace> | 0 | DEFAULT
\# *Function:
\# Increases or decreases sentence space by user supplied amount.
\# If 0, sentence spaces are ignored. If DEFAULT, value is
\# set to 12 (groff default).
\# *Notes:
\# Because the user supplied value requires a literal + or - sign,
\# the macro argument is stored in a string.
\#
\# Sentence space applies only to input where sentences are separated
\# by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
\# Changing .SS when sentences are separated by only one space has
\# no effect on the space between sentences.
\#
\# \n[.ss] holds the current wordspace value.
\# \n[.sss] holds the current sentence space value.
\#
.MAC SS END
. ds $SS_VAR \\$1
. ie '\\$1'0' .ss \\n[.ss] 0
. el \{\
. ie '\\$1'DEFAULT' .ss \\n[.ss]
. el .ss \\n[.ss] \\*[$SS_VAR]
. \}
.END
\#
\# =====================================================================
\#
\# INDENTS
\# -------
\#
\# +++INDENT LEFT+++
\#
.MAC IL END
. if \\n[#INDENT_STYLE_BOTH] .IBX
. nr #INDENT_STYLE_LEFT 1
. nr #INDENT_ACTIVE 1
. nr #INDENT_LEFT_ACTIVE 1
. ie '\\$1'' \{\
. br
. in \\n[#L_INDENT]u
. ta \\n[.l]u-\\n[#L_INDENT]u
. if \\n[#IN_ITEM] .nr #IN_ITEM_L_INDENT 0
. \}
. el \{\
. br
. nr #L_INDENT +(u;\\$1)
. in \\n[#L_INDENT]u
. ta \\n[.l]u-\\n[#L_INDENT]u
. if \\n[#IN_ITEM] .nr #IN_ITEM_L_INDENT +(u;\\$1)
. \}
.END
\#
\# +++INDENT RIGHT+++
\#
.MAC IR END
. if \\n[#INDENT_STYLE_BOTH] .IBX
. nr #INDENT_STYLE_RIGHT 1
. nr #INDENT_ACTIVE 1
. nr #INDENT_RIGHT_ACTIVE 1
. ie '\\$1'' \{\
. br
. ie \\n[#TAB_ACTIVE] \{\
. ll \\n[.l]u-\\n[#R_INDENT]u
. ta \\n[.l]u-\\n[#L_INDENT]u
. \}
. el \{\
. ll \\n[.l]u-\\n[#R_INDENT]u
. ta \\n[.l]u-\\n[#L_INDENT]u
. \}
. \}
. el \{\
. br
. nr #R_INDENT (u;\\$1)
. ie \\n[#TAB_ACTIVE] \{\
. ll \\n[.l]u-\\n[#R_INDENT]u
. ta \\n[.l]u-\\n[#L_INDENT]u
. \}
. el \{\
. ll \\n[.l]u-\\n[#R_INDENT]u
. ta \\n[.l]u-\\n[#L_INDENT]u
. \}
. \}
.END
\#
\# +++INDENT BOTH+++
\#
.MAC IB END
. br
. if \\n[#INDENT_STYLE_LEFT] .ILX
. if \\n[#INDENT_STYLE_RIGHT] .IRX
. nr #INDENT_STYLE_BOTH 1
. nr #INDENT_ACTIVE 1
. nr #INDENT_BOTH_ACTIVE 1
. ie '\\$1'' \{\
. ie \\n[#DOCS] \
. ll \\n[#DOC_L_LENGTH]u-\\n[#BR_INDENT]u
. el .ll \\n[.l]u-\\n[#BR_INDENT]u
. in \\n[#BL_INDENT]u
. ta \\n[.l]u
. \}
. el \{\
. nr #BL_INDENT (\\n[#INDENT]+\\$1)
. ie \\n[#NUM_ARGS]=2 .nr #BR_INDENT +(\\$2)
. el .nr #BR_INDENT \\n[#BL_INDENT]
. if '\\n[.z]'' .ll
. ll \\n[.l]u-\\n[#BR_INDENT]u
. in \\n[#BL_INDENT]u
. ta \\n[.l]u-\\n[#BR_INDENT]u
. \}
.END
\#
\# +++TEMPORARY INDENT+++
\#
.MAC TI END
. br
. ie '\\$1'' \{\
. ti \\n[#T_INDENT]u
. if \\n[#INDENT_LEFT_ACTIVE] .ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
. if \\n[#INDENT_BOTH_ACTIVE] .ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
. \}
. el \{\
. nr #T_INDENT (\\$1)
. ti \\n[#T_INDENT]u
. \}
.END
\#
\# +++HANGING INDENT+++
\#
.MAC HI END
. ie '\\$1'' .ti -\\n[#HL_INDENT]u
. el \{\
. nr #HL_INDENT (\\$1)
. ti -\\n[#HL_INDENT]u
. \}
.END
\#
\# +++INDENTS OFF+++
\#
.MAC ILX END
. ie \\n[#IN_ITEM] .nr #L_INDENT -\\n[#IN_ITEM_L_INDENT]
. el \{\
. br
. ie \\n[pdfbx-running]=1 \
. ie !r pdfbx-clear \{\
. in \\*[wt\\n[stack]]+\\*[gap\\n[stack]]u+\\n[#IL_ACTIVE]u
. el .in \\*[wt\\n[stack]]+\\*[gap\\n[stack]]u
. \}
. el .in 0
. rr #INDENT_LEFT_ACTIVE
. nr #L_INDENT_ILX \\n[#L_INDENT]
. \}
. if '\\$1'CLEAR' \{\
. if \\n[pdfbx-running]=1 \
. if !r pdfbx-clear \
. in \\*[wt\\n[stack]]+\\*[gap\\n[stack]]u
. rr #L_INDENT
. rr #INDENT_STYLE_LEFT
. rr #L_INDENT_ILX
. rr #INDENT_ACTIVE
. \}
.END
\#
.MAC IRX END
. br
. rr #INDENT_RIGHT_ACTIVE
. ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
. el \{\
. ie \\n[#COLUMNS] \{\
. ll \\n[#COL_L_LENGTH]u
. ta \\n[.l]u
. \}
. el \{\
. ie \\n[pdfbx-running]=1 \{\
. if !r pdfbx-clear \
. ll \\n[pdfbx-ll]u
. \}
. el .ll \\n[#DOC_L_LENGTH]u
. ta \\n[.l]u
. \}
. \}
. if '\\$1'CLEAR' \{\
. if \\n[pdfbx-running]=1 \{\
. if !r pdfbx-clear \
. ll \\n[#L_LENGTH]u-(\\*[wt\\n[stack]]+\\*[gap\\n[stack]]u)
. \}
. rr #R_INDENT
. rr #INDENT_STYLE_RIGHT
. \}
.END
\#
.MAC IBX END
. br
. in 0
. rr #INDENT_ACTIVE
. rr #INDENT_BOTH_ACTIVE
. ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
. el \{\
. ie \\n[#COLUMNS] \{\
. ll \\n[#COL_L_LENGTH]u
. ta \\n[.l]u
. \}
. el \{\
. ll \\n[#L_LENGTH]u
. ta \\n[.l]u
. \}
. \}
. if '\\$1'CLEAR' \{\
. rr #BL_INDENT
. rr #BR_INDENT
. rr #INDENT_STYLE_BOTH
. \}
.END
\#
.MAC IX END
. if '\\$0'IX' \{\
. if !\\n[#IX_WARN] \{\
. tm1 "[mom]: Use of .IX is deprecated. Use .IQ instead.
. tm1 " .IX will continue to behave as before, but to
. tm1 " avoid this message, please update your document.
. nr #IX_WARN 1
. \}
. \}
. br
. in 0
. rr #INDENT_LEFT_ACTIVE
. rr #INDENT_RIGHT_ACTIVE
. rr #INDENT_BOTH_ACTIVE
. rr #INDENT_ACTIVE
. if \\n[#INDENT_STYLE_RIGHT] \{\
. ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
. el \{\
. ie \\n[#COLUMNS] \{\
. ll \\n[#COL_L_LENGTH]u
. ta \\n[.l]u
. \}
. el \{\
. ll \\n[#L_LENGTH]u
. ta \\n[.l]u
. \}
. \}
. \}
. if \\n[#INDENT_STYLE_BOTH] \{\
. ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
. el \{\
. ie \\n[#COLUMNS] \{\
. ll \\n[#COL_L_LENGTH]u
. ta \\n[.l]u
. \}
. el \{\
. ll \\n[#L_LENGTH]u
. ta \\n[.l]u
. \}
. \}
. \}
. if '\\$1'CLEAR' \{\
. if \\n[#INDENT_STYLE_RIGHT] \{\
. ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
. el \{\
. ie \\n[#COLUMNS] \{\
. ll \\n[#COL_L_LENGTH]u
. ta \\n[.l]u
. \}
. el \{\
. ll \\n[#L_LENGTH]u
. ta \\n[.l]u
. \}
. \}
. \}
. if \\n[#INDENT_STYLE_BOTH] \{\
. ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
. el \{\
. ie \\n[#COLUMNS] \{\
. ll \\n[#COL_L_LENGTH]u
. ta \\n[.l]u
. \}
. el \{\
. ll \\n[#L_LENGTH]u
. ta \\n[.l]u
. \}
. \}
. \}
. rr #L_INDENT
. rr #R_INDENT
. rr #BL_INDENT
. rr #BR_INDENT
. rr #T_INDENT
. rr #H_INDENT
. rr #INDENT_STYLE_LEFT
. rr #INDENT_STYLE_RIGHT
. rr #INDENT_STYLE_BOTH
. \}
.END
\#
\# =====================================================================
\#
\# +++HANGING CHARACTERS+++
\#
\# LEFT_HANG hangs its argument to the left of the left margin.
\# If enclosed in double-quotes, the argument may contain local
\# horizontal motions. Input text after LEFT_HANG must begin
\# by repeating the text of the argument including horizontal
\# motions. If the hung character is a left double-quote,
\# \[lq] must be used in the argument and the usual keyboard
\# double-quote (") used for the input text (so as not to confuse
\# SMARTQUOTES).
\#
\# HANG is called inline with \*[HANG <character>]. Hangs its
\# single-character argument, typically a punctuation mark, to the
\# right of the right margin in justified copy. Unlike LEFT_HANG,
\# does not require repeating the character as part of input text.
\#
\# Except for hung hyphens, HANG may be used mid-line in input
\# text. Hung hyphens must come at the end of input lines. If
\# the hung character is a right double-quote, "\[rq]" must be
\# used as the argument (that is, the rq character surrounded by
\# double-quotes). The double-quotes are required for all special
\# characters that have the form \[c].
\#
.MAC LEFT_HANG END
. nr hang-char-width \w'\\$1'
. ds hang-char-gutter \\$2
. ie '\\*[hang-char-gutter]'' \
. nr hang-char \\n[hang-char-width]
. el \
. nr hang-char \\n[hang-char-width]+\\*[hang-char-gutter]
\h'-\\n[hang-char]u'\c
.END
\#
.MAC HANG END
\c
.if '\\$1'\[rq]' .nr #OPEN_CLOSE 0
\c
\&\\$1\c
\h'-\w'\\$1'u'\c
.END
\#
\# =====================================================================
\#
\# +++MULTIPLE COLUMNS+++
\#
\# MULTIPLE COLUMNS ON
\# -------------------
\# *Arguments:
\# <none>
\# *Function:
\# Marks the top of a column set
\#
.MAC MCO END
. mk c
.END
\#
\# MULTIPLE COLUMN RETURN
\# ----------------------
\# *Arguments:
\# <none>
\# *Function:
\# Returns to the top of a column set
\#
.MAC MCR END
. vpt 0
. sp |\\n[c]u
. vpt
.END
\#
\# MULTIPLE COLUMNS OFF
\# --------------------
\# *Arguments:
\# <none> | <lead to advance beneath bottom of deepest column>
\# *Function:
\# Advances to the end of a column set
\# *Notes:
\# With no argument, advances to the next baseline (at the current
\# leading value) beneath the longest column. With an argument
\# (which requires a unit of measure), advances arg distance
\# beneath the baseline of the deepest column. If the argument
\# is zero, advances to the baseline of the deepest column.
\#
.MAC MCX END
. vpt 0
. ie '\\$1'' \{\
. if '\\n[.z]'FLOAT*DIV' \!.TQ
. TQ
. sp |\\n[.h]u
. \}
. el \{\
. nr #MCX_ALD (\\$1)
. TQ
. ie \\n[#MCX_ALD]=0 .sp |\\n[.h]u-1v
. el .sp |\\n[.h]u+\\n[#MCX_ALD]u
. rr #MCX_ALD
. \}
. vpt
.END
\#
\# =====================================================================
\#
\# +++TYPESETTING SUPPORT MACROS+++
\#
\# TRAP
\# ----
\# *Arguments:
\# toggle
\# *Function:
\# Enables/disables traps.
\# *Notes:
\# EL and TN don't function as advertised on the last line before
\# a trap (when they break the preceding line, they spring the
\# trap, and groff won't back up to the line preceding the trap).
\# TRAP is a kludge to get EL and TN work properly on last lines.
\# The user simply encloses the offending lines in TRAP OFF/TRAP.
\#
.MAC TRAP END
. ie '\\$1'' .vpt
. el .vpt 0
.END
\#
\# SILENT
\# ------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Diverts text so that it doesn't print, or turns the function off.
\# *Notes:
\# Useful for setting up autotabs where you don't want the line with
\# the tab marks to print.
\#
\# Also aliased as COMMENT, in case user wants to input a batch of
\# text that doesn't print.
\#
.MAC SILENT END
. nr #SILENT 1
. if \\n[#QUAD] .br
. ie '\\$1'' .di NO_FLASH
. el \{\
. br
. di
. rm NO_FLASH
. rr #SILENT
. \}
.END
\#
\# PRINT
\# -----
\# *Function:
\# Prints anything. A macro that helps keep my code nicely indented.
\#
.MAC PRINT END
. nop \\$*
.END
\#
\# Numbered strings for while loop in SMALLCAPS.
\#
.ds $c1 a
.ds $c2 b
.ds $c3 c
.ds $c4 d
.ds $c5 e
.ds $c6 f
.ds $c7 g
.ds $c8 h
.ds $c9 i
.ds $c10 j
.ds $c11 k
.ds $c12 l
.ds $c13 m
.ds $c14 n
.ds $c15 o
.ds $c16 p
.ds $c17 q
.ds $c18 r
.ds $c19 s
.ds $c20 t
.ds $c21 u
.ds $c22 v
.ds $c23 w
.ds $c24 x
.ds $c25 y
.ds $c26 z
.ds $c27 \[`a]
.ds $c28 \[^a]
.ds $c29 \['a]
.ds $c30 \[:a]
.ds $c31 \[oa]
.ds $c32 \[~a]
.ds $c33 \[ae]
.ds $c34 \[`e]
.ds $c35 \[^e]
.ds $c36 \['e]
.ds $c37 \[:e]
.ds $c38 \[`i]
.ds $c39 \[^i]
.ds $c40 \['i]
.ds $c41 \[:i]
.ds $c42 \[`o]
.ds $c43 \[^o]
.ds $c44 \['o]
.ds $c45 \[:o]
.ds $c46 \[~o]
.ds $c47 \[/o]
.ds $c48 \[`u]
.ds $c49 \[^u]
.ds $c50 \['u]
.ds $c51 \[:u]
.ds $c52 \[,c]
.ds $c53 \[Sd]
.ds $c54 \[~n]
.ds $c55 \[Sd]
.ds $c56 \[Tp]
.ds $c57 \['y]
.ds $c58 \[:y]
\#
.ds $C1 A
.ds $C2 B
.ds $C3 C
.ds $C4 D
.ds $C5 E
.ds $C6 F
.ds $C7 G
.ds $C8 H
.ds $C9 I
.ds $C10 J
.ds $C11 K
.ds $C12 L
.ds $C13 M
.ds $C14 N
.ds $C15 O
.ds $C16 P
.ds $C17 Q
.ds $C18 R
.ds $C19 S
.ds $C20 T
.ds $C21 U
.ds $C22 V
.ds $C23 W
.ds $C24 X
.ds $C25 Y
.ds $C26 Z
.ds $C27 \[`A]
.ds $C28 \[^A]
.ds $C29 \['A]
.ds $C30 \[:A]
.ds $C31 \[oA]
.ds $C32 \[~A]
.ds $C33 \[AE]
.ds $C34 \[`E]
.ds $C35 \[^E]
.ds $C36 \['E]
.ds $C37 \[:E]
.ds $C38 \[`I]
.ds $C39 \[^I]
.ds $C40 \['I]
.ds $C41 \[:I]
.ds $C42 \[`O]
.ds $C43 \[^O]
.ds $C44 \['O]
.ds $C45 \[:O]
.ds $C46 \[~O]
.ds $C47 \[/O]
.ds $C48 \[`U]
.ds $C49 \[^U]
.ds $C50 \['U]
.ds $C51 \[:U]
.ds $C52 \[,C]
.ds $C53 \[-D]
.ds $C54 \[~N]
.ds $C55 \[-D]
.ds $C56 \[TP]
.ds $C57 \['Y]
.ds $C58 \[:Y]
\#
\# CAPS
\# ----
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Converts text to caps, or, if OFF, reverts to normal caps/lc.
\# *Notes:
\# For inline control of capitalization style, use \*[UC] and
\# \*[LC].
\#
.MAC CAPS END
. ie '\\$1'' \{\
. LC_TO_CAPS
. nr #CAPS_ON 1
. \}
. el \{\
. CAPS_TO_LC
. rr #CAPS_ON
. \}
.END
\#
.MAC UC END
\c
. LC_TO_CAPS
. nr #CAPS_ON 1
.END
\#
.MAC LC END
\c
. CAPS_TO_LC
. rr #CAPS_ON
.END
\#
\# Perform lowercase conversion to caps or revert to lowercase
\#
.MAC CONVERT_CASE END
. if '\\$0'LC_TO_CAPS' \{\
. nr #LOOP 0 1
. while \\n+[#LOOP]<=58 \{\
. tr \\*[$c\\n[#LOOP]]\\*[$C\\n[#LOOP]]
. \}
. \}
. if '\\$0'CAPS_TO_LC' \{\
. nr #LOOP 0 1
. while \\n+[#LOOP]<=58 \{\
. tr \\*[$c\\n[#LOOP]]\\*[$c\\n[#LOOP]]
. \}
. \}
.END
.
.ALIAS LC_TO_CAPS CONVERT_CASE
.ALIAS CAPS_TO_LC CONVERT_CASE
.
\#
\# SMALLCAPS
\# ---------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Converts text to smallcaps, or, if <anything>, reverts to normal
\# caps/lc.
\# *Notes:
\# SMALLCAPS has no inline escape eqiv. to \*[UC].
\#
.MAC SMALLCAPS END
. if \\n[#PRINT_STYLE]=2 \{\
. if !\\n[.u] \
. if \\n[.int] .nop \& \c
. nr sc*size \\n[.ps]*\\n[sc*factor]/1000
. if \\n[sc*wt-adj] .nr sc*wt-adj-factor \\n[sc*size]*\\n[sc*wt-adj]/1000
. if \\n[sc*extend] .nr sc*extend-factor \\n[sc*size]*\\n[sc*extend]/1000
. ie '\\$1'' \{\
. nr #SMALLCAPS_ON 1
. nr #LOOP 0 1
. while \\n+[#LOOP]<=58 \{\
. char \\*[$c\\n[#LOOP]] \
\Z'\s[\\n[sc*size]u+\\n[sc*extend-factor]u]\H'-\\n[sc*extend-factor]u'\
\\*[$C\\n[#LOOP]]'\
\h'\\n[sc*wt-adj-factor]u'\\*[$C\\n[#LOOP]]\s[0]
. \}
. \}
. el \{\
. nr #LOOP 0 1
. while \\n+[#LOOP]<=58 \{\
. rchar \\*[$c\\n[#LOOP]]
. \}
. rr sc*wt-adj-factor
. rr sc*extend-factor
. rr #SMALLCAPS_ON
. \}
. \}
.END
\#
\# SMALLCAPS_SIZE
\# --------------
\# *Arguments:
\# <size> [ <weight adjustment>
\# *Function:
\# Sets registers 'sc*factor', 'sc*wt-adj', and sc*extend.
\# *Notes:
\# Weight adjustment pseudo-emboldens small caps to visually match the
\# weight of the larger real caps.
\#
\# Both sc*factor (size) and sc*wt-adj (weight adjustment) args are
\# expressed as percentages of type size.
\#
.MAC SMALLCAPS_STYLE END
. nr #LOOP 0 1
. while \\n+[#LOOP]<=\\n[#NUM_ARGS] \{\
. if '\\$1'SIZE' \{\
. shift
. nr sc*factor (z;\\$1)/100
. shift
. \}
. if '\\$1'WEIGHT_ADJ' \{\
. shift
. nr sc*wt-adj (z;\\$1)/100
. shift
. \}
. if '\\$1'EXTEND' \{\
. shift
. nr sc*extend (z;\\$1)/100
. shift
. \}
. \}
. if \\n[sc*wt-adj]=0 .rr sc*wt-adj
. if \\n[sc*extend]=0 .rr sc*extend
.END
.
.SMALLCAPS_STYLE \
SIZE 74 \
WEIGHT_ADJ .3 \
EXTEND 5
\#
\# SIZESPECS
\# ---------
\# Argument:
\# <none>
\# Function:
\# Gets cap-height, x-height, and descender depth of the
\# current font at the current point size.
\# *Notes:
\# The routine is diverted so it remains invisible to output.
\#
.MAC SIZESPECS END
. if !'\\n[.z]'' \
. if \\n[dn] .nr saved-dn \\n[dn]
. di TYPESIZE
E\R'#CAP_HEIGHT \\n[.cht]'
e\R'#X_HEIGHT \\n[.cht]'
y\R'#DESCENDER \\n[.cdp]'
. br
. ds $CAP_HEIGHT \\n[#CAP_HEIGHT]u
. ds $X_HEIGHT \\n[#X_HEIGHT]u
. ds $DESCENDER \\n[#DESCENDER]u
. di
. if !'\\n[.z]'' \
. nr dn \\n[saved-dn]
.END
\#
\# =====================================================================
\#
\# +++TYPESETTING ALIASES+++
\#
.ALIAS ADD_SPACE ALD
.ALIAS CENTRE CENTER
.ALIAS COLOUR COLOR
.ALIAS COMMENT SILENT
.ALIAS CONDENSE CONDENSE_OR_EXTEND
.ALIAS EXTEND CONDENSE_OR_EXTEND
.ALIAS FAM FAMILY
.ALIAS FONT FT
.ALIAS HYPHENATE HY
.ALIAS HYPHENATION HY
.ALIAS HYSET HY_SET
.ALIAS IBQ IBX
.ALIAS ILQ ILX
.ALIAS IQ IX
.ALIAS IRQ IRX
.ALIAS LIG LIGATURES
.ALIAS NEWCOLOUR NEWCOLOR
.ALIAS PADMARKER PAD_MARKER
.ALIAS SP ALD
.ALIAS SPACE ALD
.ALIAS TABSET TAB_SET
.ALIAS TB TAB
.ALIAS UNDERSCORE_2 UNDERSCORE2
.ALIAS XCOLOUR XCOLOR
\#
\# ====================================================================
\#
\# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
\# ===============================================
\#
\# DOC_MACRO_ERROR
\# ---------------
\# *Arguments:
\# None.
\# *Function:
\# Warning message if DOC_<PARAMETER> called before START.
\#
.MAC DOC_MACRO_ERROR END
. if '\\$1'DOC_L_MARGIN' .ds $REPLACEMENT L_MARGIN
. if '\\$1'DOC_R_MARGIN' .ds $REPLACEMENT R_MARGIN
. if '\\$1'DOC_LINE_LENGTH' .ds $REPLACEMENT LL
. if '\\$1'DOC_FAMILY' .ds $REPLACEMENT "FAMILY or FAM
. if '\\$1'DOC_PT_SIZE' .ds $REPLACEMENT PT_SIZE
. if '\\$1'DOC_LEAD' .ds $REPLACEMENT LS
. if '\\$1'DOC_QUAD' .ds $REPLACEMENT QUAD
. tm1 "[mom]: \\$1 at line \\n[.c] of '\\n[.F]' should not be used before START.
. tm1 " Use \\*[$REPLACEMENT] instead.
. ab [mom]: Aborting.
.END
\#
\# +++PAGE DIMENSIONS+++
\#
\# PAPER SIZE
\# ----------
\# *Arguments:
\# LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
\# *Function:
\# Sets up dimensions for different paper sizes.
\# *Notes:
\# LANDSCAPE may be given after papersize arg.
\#
.MAC PAPER END
. vs 0
. ds $PAPER \\$1
. if '\\*[$PAPER]'LETTER' \{\
. PAGEWIDTH 8.5i
. PAGELENGTH 11i
. \}
. if '\\*[$PAPER]'LEGAL' \{\
. PAGEWIDTH 8.5i
. PAGELENGTH 14i
. \}
. if '\\*[$PAPER]'STATEMENT' \{\
. PAGEWIDTH 5.5i
. PAGELENGTH 8.5i
. \}
. if '\\*[$PAPER]'TABLOID' \{\
. PAGEWIDTH 11i
. PAGELENGTH 17i
. \}
. if '\\*[$PAPER]'LEDGER' \{\
. PAGEWIDTH 17i
. PAGELENGTH 11i
. \}
. if '\\*[$PAPER]'FOLIO' \{\
. PAGEWIDTH 8.5i
. PAGELENGTH 13i
. \}
. if '\\*[$PAPER]'QUARTO' \{\
. PAGEWIDTH 610p
. PAGELENGTH 780p
. \}
. if '\\*[$PAPER]'10x14' \{\
. PAGEWIDTH 10i
. PAGELENGTH 14i
. \}
. if '\\*[$PAPER]'EXECUTIVE' \{\
. PAGEWIDTH 7.25i
. PAGELENGTH 10.5i
. \}
. if '\\*[$PAPER]'A3' \{\
. PAGEWIDTH 842p
. PAGELENGTH 1190p
. \}
. if '\\*[$PAPER]'A4' \{\
. PAGEWIDTH 595p
. PAGELENGTH 842p
. \}
. if '\\*[$PAPER]'A5' \{\
. PAGEWIDTH 421p
. PAGELENGTH 595p
. \}
. if '\\*[$PAPER]'B4' \{\
. PAGEWIDTH 709p
. PAGELENGTH 1002p
. \}
. if '\\*[$PAPER]'B5' \{\
. PAGEWIDTH 501p
. PAGELENGTH 709p
. \}
. if '\\$2'LANDSCAPE' \{\
. nr #PAGE_WIDTH_TMP \\n[#PAGE_WIDTH]
. PAGEWIDTH \\n[#PAGE_LENGTH]u
. PAGELENGTH \\n[#PAGE_WIDTH_TMP]u
. as $PAPER " LANDSCAPE\"
. \}
. if !r#L_MARGIN .L_MARGIN \\n[.o]
. if !r#R_MARGIN .R_MARGIN \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-1i
. if '\\*[.T]'pdf' .br
. vs
.END
\#
\# ====================================================================
\#
\# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
\#
\# PRINTSTYLE
\# ----------
\# *Arguments:
\# TYPESET | TYPEWRITE [SINGLESPACE]
\# *Function:
\# Sets type specs for typewriter-style or typeset output.
\# *Notes:
\# Number registers: TYPEWRITE=1, TYPESET=2.
\#
.MAC PRINTSTYLE END
. if n \{\
. if '\\$1'TYPESET' \{\
. pl 1
. ab [mom]: Terminal output requires PRINTSTYLE TYPEWRITE. Aborting.
. \}
. \}
. if !\\n[#COLLATE]=1 \{\
. if !d$PAPER \{\
. PAGELENGTH 11i
. PAGEWIDTH 8.5i
. \}
. if '\\$1'TYPEWRITE' \{\
. nr #PRINT_STYLE 1
. if !\\n[#DOC_TYPE]=4 \{\
. L_MARGIN 6P
. R_MARGIN 6P
. \}
. ds $TYPEWRITER_FAM C
. ds $TYPEWRITER_PS 12
. TYPEWRITER
. color 0
. ie '\\$2'SINGLESPACE' \{\
. nr #SINGLE_SPACE 1
. vs 12
. ie \\n[#DOC_TYPE]=4 .nr #FOOTER_ADJ \\n[.v]
. el .nr #FOOTER_ADJ \\n[.v]
. nr #ORIGINAL_DOC_LEAD \\n[.v]
. \}
. el \{\
. if !\\n[#DOC_TYPE]=4 \{\
. vs 24
. nr #FOOTER_ADJ \\n[.v]/2
. nr #ORIGINAL_DOC_LEAD \\n[.v]
. \}
. \}
. QUAD L
. HY OFF
. SMARTQUOTES OFF
. if !\\n[#PP_INDENT] .nr #PP_INDENT 3P
. HDRFTR_RIGHT_CAPS
. nr #BOLDER_UNITS 0
. nr #CONDENSE 0
. nr #EXTEND 0
. if !\\n[#ITALIC_MEANS_ITALIC] \{\
. rm IT
. rm PREV
. UNDERLINE_ITALIC
. \}
. rm BD
. rm BDI
. if !\\n[#SLANT_MEANS_SLANT] .UNDERLINE_SLANT
. if !\\n[#UNDERLINE_QUOTES] .UNDERLINE_QUOTES
. nr #IGNORE_COLUMNS 1
. nr #RULE_WEIGHT 500
. char \[em] --
. tr `'
. tr \[lq]"
. tr \[rq]"
. \}
. if '\\$1'TYPESET' \{\
. nr #PRINT_STYLE 2
. if !\\n[#DOC_TYPE]=5 \{\
. if !\\n[#DOC_TYPE]=4 \{\
. L_MARGIN 6P
. R_MARGIN 6P
. \}
. \}
. FAMILY T
. FT R
. if !\\n[#DOC_TYPE]=4 .ps 12.5
. if !\\n[#DOC_TYPE]=4 .vs 16
.\" In DEFAULTS, TRAPS is run with this leading, so we need a register to
.\" hold it for use with the .sp in FOOTER
. nr #FOOTER_ADJ 12000
. JUSTIFY
. HY
. HY_SET 2 36p 1p
. KERN
. LIG
. SS 0
. SMARTQUOTES
. if !\\n[#PP_INDENT] \{\
. in 2m \"Set indent
. nr #PP_INDENT \\n[.i] \"Read into #PP_INDENT
. in 0 \"Remove indent
. \}
. HDRFTR_RIGHT_CAPS
. rr #IGNORE_COLUMNS
. \}
.\" Set up default style for nine levels of headings
. nr #HD_LEVEL 0 1 \" loop step
. nr #LOOP 9 \" loop count
. while \\n+[#HD_LEVEL]<=\\n[#LOOP] \{\
. HEADING_STYLE \\n[#HD_LEVEL] \
FONT B \
SIZE +0 \
QUAD L \
NEEDS 1 \
COLOR black
.\" Set up default style for nine levels of TOC headings
. TOC_ENTRY_STYLE \\n[#HD_LEVEL] \
FONT R \
SIZE +0 \
COLOR black
. \}
.\" Set up decreasing sizes for headings levels 1 - 3, starting at +3
. nr #HD_LEVEL 0 1 \" loop step
. nr #LOOP 3 \" loop count
. nr #HD_SIZE 4 1
. while \\n+[#HD_LEVEL]<=\\n[#LOOP] \{\
. nr #HD_SIZE_CHANGE \\n-[#HD_SIZE]
. ds $HEAD_\\n[#HD_LEVEL]_SIZE +\\n[#HD_SIZE_CHANGE]
. \}
.\" Set up TOC title style
. TOC_TITLE_STYLE FONT R SIZE +0 INDENT 0
.\" Set up captions, labels, sources
. LABELS ALL FONT B AUTOLEAD 2
. LABELS EQN FONT R QUAD RIGHT
. CAPTIONS ALL AUTOLEAD 2
. CAPTIONS EQN QUAD CENTER
. SOURCES TBL AUTOLEAD 2
. \}
.END
\#
\# Set limited parameters to TYPEWRITE.
\#
.MAC TYPEWRITER_FAMILY END
. ds $TYPEWRITER_FAM \\$1
.END
\#
.ALIAS TYPEWRITER_FAM TYPEWRITER_FAMILY
\#
.MAC TYPEWRITER_SIZE END
. ds $TYPEWRITER_PS \\$1
.END
\#
.MAC TYPEWRITER END
. fam \\*[$TYPEWRITER_FAM]
. ft R
. ps \\*[$TYPEWRITER_PS]
.END
\#
\# ITALIC MEANS ITALIC
\# -------------------
\# *Argument:
\# <none>
\# *Function:
\# Instructs TYPEWRITE to treat italics as italics, whether
\# invoked via control lines or inline.
\# *Notes:
\# ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mutually exclusive,
\# hence invoking the one automatically turns off the other.
\#
.MAC ITALIC_MEANS_ITALIC END
. if \\n[#PRINT_STYLE]=1 \{\
. nr #ITALIC_MEANS_ITALIC 1
. rr #UNDERLINE_ITALIC
. rm ROM
. rm IT
. rm PREV
. ds ROM \Ef[R]
. ds IT \Ef[I]
. ds PREV \Ef[]
. \}
.END
\#
\# UNDERLINE ITALIC
\# ----------------
\# *Argument:
\# <none>
\# *Function:
\# Instructs TYPEWRITE to underline italics, whether invoked
\# via control lines or inline.
\# *Notes:
\# UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mutually exclusive,
\# hence invoking the one automatically turns off the other.
\#
\# UNDERLINE_ITALIC is the default for TYPEWRITE.
\#
.MAC UNDERLINE_ITALIC END
. if \\n[#PRINT_STYLE]=1 \{\
. nr #UNDERLINE_ITALIC 1
. rr #ITALIC_MEANS_ITALIC
. rm ROM
. rm IT
. rm PREV
. ds ROM \E*[ULX]
. ds IT \E*[UL]
. ds PREV \f[P]\E*[ULX]
. \}
.END
\#
\# UNDERLINE SLANT
\# ---------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Instructs TYPEWRITE to underline occurrences of \*[SLANT], or
\# turns feature off.
\# *Notes:
\# Users may want \*[SLANT] to mean slant in TYPEWRITE, although
\# most of the time, \*[SLANT] most likely means the user wanted
\# italic but didn't have it, ergo the need to tell TYPEWRITE to
\# treat \*[SLANT] as italic (i.e. underlined).
\#
\# UNDERLINE_SLANT and SLANT_MEANS_SLANT are mutually exclusive,
\# hence invoking the one automatically turns off the other.
\#
\# UNDERLINE_SLANT is the default for TYPEWRITE.
\#
.MAC UNDERLINE_SLANT END
. if \\n[#PRINT_STYLE]=1 \{\
. rr #SLANT_MEANS_SLANT
. nr #UNDERLINE_SLANT 1
. rm SLANT
. rm SLANTX
. ds SLANT \ER'#SLANT_ON 1'\E*[UL]
. ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
. \}
.END
\#
.MAC SLANT_MEANS_SLANT END
. if \\n[#PRINT_STYLE]=1 \{\
. rr #UNDERLINE_SLANT
. nr #SLANT_MEANS_SLANT 1
. rm SLANT
. rm SLANTX
. ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
. ds SLANTX \ER'#SLANT_ON 0'\ES'0'
. \}
.END
\#
.MAC IGNORE_COLUMNS END
. if \\n[#PRINT_STYLE]=1 .nr #NO_COLUMNS 1
.END
\#
\# ====================================================================
\#
\# +++COPY STYLE -- DRAFT OR FINAL+++
\#
\# COPY STYLE
\# ----------
\# *Arguments:
\# DRAFT | FINAL
\# *Function:
\# Sets registers that are used to determine what to put
\# in the default header, and how to number pages.
\# *Notes:
\# DOCTYPE must come before COPYSTYLE.
\#
.MAC COPYSTYLE END
. ds $COPY_STYLE \\$1
. if '\\*[$COPY_STYLE]'DRAFT' \{\
. nr #COPY_STYLE 1
. if !d$DRAFT .DRAFT 1
. \}
. if '\\*[$COPY_STYLE]'FINAL' .nr #COPY_STYLE 2
. if '\\*[$CHAPTER_STRING]'' .CHAPTER_STRING "Chapter"
. if '\\*[$DRAFT_STRING]'' .DRAFT_STRING "Draft"
. if '\\*[$REVISION_STRING]'' .REVISION_STRING "Rev."
.\" Default
. if \\n[#DOC_TYPE]=1 \{\
. ie \\n[#COPY_STYLE]=1 \{\
. ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
. el .PAGENUM_STYLE roman
. if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
. ie \\n[#DRAFT_WITH_PAGENUM] .ds $HDRFTR_CENTER
. el \{\
. ie '\\*[$REVISION]'' \{\
. ds $HDRFTR_CENTER \
\\*[$DRAFT_STRING]\\*[$DRAFT]
. \}
. el \{\
. ds $HDRFTR_CENTER \
\\*[$DRAFT_STRING]\\*[$DRAFT], \
\\*[$REVISION_STRING] \\*[$REVISION]
. \}
. \}
. \}
. \}
. el \{\
. ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
. el .PAGENUM_STYLE DIGIT
. if \\n[#DRAFT_WITH_PAGENUM] .rr #DRAFT_WITH_PAGENUM
. if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
. ds $HDRFTR_CENTER
. rr #USER_DEF_HDRFTR_CENTER
. \}
. \}
. \}
.\" Chapter
. if \\n[#DOC_TYPE]=2 \{\
.\" Copystyle DRAFT
. ie \\n[#COPY_STYLE]=1 \{\
. ie \\n[#PAGENUM_STYLE_SET] \
. PAGENUM_STYLE \\*[$PAGENUM_STYLE]
. el \
. PAGENUM_STYLE roman
. if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
. ie \\n[#DRAFT_WITH_PAGENUM] \{\
. ie '\\*[$CHAPTER]'' \{\
. ie !'\\*[$CHAPTER_TITLE_1]'' \
. ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
. el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
. \}
. el \{\
. ie !'\\*[$CHAPTER_TITLE_1]'' \
. ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
. el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
. \}
. \}
. el \{\
. ie '\\*[$REVISION]'' \{\
. ie '\\*[$CHAPTER]'' \{\
. ie !'\\*[$CHAPTER_TITLE_1]'' \{\
. ie '\\*[$DRAFT]'' \
. ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
. el \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_TITLE], \
\\*[$DRAFT_STRING]\\*[$DRAFT]
. \}
. \}
. el \{\
. ie '\\*[$DRAFT]'' \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_STRING]
. \}
. el \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_STRING], \
\\*[$DRAFT_STRING]\\*[$DRAFT]
. \}
. \}
. \}
. el \{\
. ie !'\\*[$CHAPTER_TITLE_1]'' \{\
. ie '\\*[$DRAFT]'' \
. ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
. el \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_TITLE_1], \
\\*[$DRAFT_STRING]\\*[$DRAFT]
. \}
. \}
. el \{\
. ie '\\*[$DRAFT]'' \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_STRING] \\*[$CHAPTER]
. \}
. el \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_STRING] \\*[$CHAPTER], \
\\*[$DRAFT_STRING]\\*[$DRAFT]
. \}
. \}
. \}
. \}
. el \{\
. ie '\\*[$CHAPTER]'' \{\
. ie !'\\*[$CHAPTER_TITLE_1]'' \{\
. ie '\\*[$DRAFT]'' \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_TITLE], \
\\*[$REVISION_STRING] \\*[$REVISION]
. \}
. el \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_TITLE], \
\\*[$DRAFT_STRING]\\*[$DRAFT], \
\\*[$REVISION_STRING] \\*[$REVISION]
. \}
. \}
. el \{\
. ie '\\*[$DRAFT]'' \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_STRING], \
\\*[$REVISION_STRING] \\*[$REVISION]
. \}
. el \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_STRING], \
\\*[$DRAFT_STRING]\\*[$DRAFT], \
\\*[$REVISION_STRING] \\*[$REVISION]
. \}
. \}
. \}
. el \{\
. ie !'\\*[$CHAPTER_TITLE_1]'' \{\
. ie '\\*[$DRAFT]'' \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_TITLE], \
\\*[$REVISION_STRING] \\*[$REVISION]
. \}
. el \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_TITLE], \
\\*[$DRAFT_STRING]\\*[$DRAFT], \
\\*[$REVISION_STRING] \\*[$REVISION]
. \}
. \}
. el \{\
. ie '\\*[$DRAFT]'' \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_STRING] \\*[$CHAPTER], \
\\*[$REVISION_STRING] \\*[$REVISION]
. \}
. el \{\
. ds $HDRFTR_CENTER \
\\*[$CHAPTER_STRING] \\*[$CHAPTER], \
\\*[$DRAFT_STRING]\\*[$DRAFT], \
\\*[$REVISION_STRING] \\*[$REVISION]
. \}
. \}
. \}
. \}
. \}
. \}
. \}
.\" Copystyle FINAL
. el \{\
. if \\n[#DRAFT_WITH_PAGENUM] .rr #DRAFT_WITH_PAGENUM
. if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
. ie \\n[#PAGENUM_STYLE_SET] \
. PAGENUM_STYLE \\*[$PAGENUM_STYLE]
. el .PAGENUM_STYLE DIGIT
. ie '\\*[$CHAPTER]'' \{\
. ie !'\\*[$CHAPTER_TITLE_1]'' \
. ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
. el \
. ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
. \}
. el \{\
. ie !'\\*[$CHAPTER_TITLE_1]'' \
. ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
. el \
. ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
. \}
. \}
. \}
. \}
.\" Named
. if \\n[#DOC_TYPE]=3 \{\
. ie \\n[#COPY_STYLE]=1 \{\
. ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
. el .PAGENUM_STYLE roman
. ie \\n[#DRAFT_WITH_PAGENUM] \
. ds $HDRFTR_CENTER \\*[$DOC_TYPE]
. el \{\
. if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
. ie '\\*[$REVISION]'' \{\
. ie '\\*[$DRAFT]'' \
. ds $HDRFTR_CENTER \\*[$DOC_TYPE]
. el \{\
. ds $HDRFTR_CENTER \
\\*[$DOC_TYPE], \
\\*[$DRAFT_STRING]\\*[$DRAFT]
. \}
. \}
. el \{\
. ie '\\*[$DRAFT]'' \{\
. ds $HDRFTR_CENTER \
\\*[$DOC_TYPE], \
\\*[$REVISION_STRING] \\*[$REVISION]
. \}
. el \{\
. ds $HDRFTR_CENTER \
\\*[$DOC_TYPE], \
\\*[$DRAFT_STRING]\\*[$DRAFT], \
\\*[$REVISION_STRING] \\*[$REVISION]
. \}
. \}
. \}
. \}
. \}
. el \{\
. if \\n[#DRAFT_WITH_PAGENUM] .rr #DRAFT_WITH_PAGENUM
. if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
. ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
. el .PAGENUM_STYLE DIGIT
. ds $HDRFTR_CENTER \\*[$DOC_TYPE]
. \}
. \}
. \}
.END
\#
\# ====================================================================
\#
\# +++COLLECT DOC INFO (reference macros, metadata)+++
\#
\# *Arguments:
\# various string/register arguments
\# *Function:
\# Set strings and registers for covers, docheaders, page headers.
\#
.MAC DOCTITLE END
. rr #DOCTITLE_NUM
. nr #DOCTITLE_NUM 0 1
. while \\n[#NUM_ARGS]>\\n[#DOCTITLE_NUM] \{\
. ds $DOCTITLE_\\n+[#DOCTITLE_NUM] \\$\\n[#DOCTITLE_NUM]
. \}
. ds $DOCTITLE \\$*
. PDF_TITLE \\*[$DOCTITLE]
.END
\#
.MAC TITLE END \"Document title
. if '\\$1'DOC_COVER' \{\
. shift
. DOC_COVERTITLE \\$@
. return
. \}
. if '\\$1'COVER' \{\
. shift
. COVERTITLE \\$@
. return
. \}
. ie \\n[#NUM_ARGS]=0 \{\
. if \\n[#TITLE_NUM] \{\
. nr #ITEM 0 1
. while \\n[#TITLE_NUM]>\\n[#ITEM] \{\
. rm $TITLE_\\n+[#ITEM]
. \}
. rr #TITLE_NUM
. \}
. \}
. el \{\
. nr #TITLE_NUM 0 1
. while \\n[#NUM_ARGS]>\\n[#TITLE_NUM] \{\
. ds $TITLE_\\n+[#TITLE_NUM] \\$\\n[#TITLE_NUM]
. \}
. ds $TITLE \\$*
. \}
.END
\#
.MAC SUBTITLE END \"Document sub-title
. ie \\n[#NUM_ARGS]=0 \{\
. if \\n[#DOC_COVER_SUBTITLE_NUM] \
. ds COVER_ DOC_COVER_
. if \\n[#COVER_SUBTITLE_NUM] \
. ds COVER_ COVER_
. if \\n[#\\*[COVER_]SUBTITLE_NUM] \{\
. nr #ITEM 0 1
. while \\n[#\\*[COVER_]SUBTITLE_NUM]>\\n[#ITEM] \{\
. rm $\\*[COVER_]SUBTITLE_\\n+[#ITEM]
. \}
. rr #\\*[COVER_]SUBTITLE_NUM
. rm $SUBTITLE
. \}
. \}
. el \{\
. if '\\$1'DOC_COVER' \{\
. ds COVER_ DOC_COVER_
. shift
. \}
. if '\\$1'COVER' \{\
. ds COVER_ COVER_
. shift
. \}
. nr #\\*[COVER_]SUBTITLE_NUM 0 1
. while \\n[#NUM_ARGS]>\\n[#\\*[COVER_]SUBTITLE_NUM] \{\
. ds $\\*[COVER_]SUBTITLE_\\n+[#\\*[COVER_]SUBTITLE_NUM] \
\\$\\n[#\\*[COVER_]SUBTITLE_NUM]
. \}
. rm COVER_
. ds $SUBTITLE \\$*
. \}
.END
\#
.MAC CHAPTER END \"If document is a chapter, the chapter number
. nr #CHAPTER_CALLED 1
. ds $CHAPTER \\$1
. if \B'\\*[$CHAPTER]' .nr #CH_NUM \\*[$CHAPTER]
. if !r #CH_NUM .nr #CH_NUM 1
.END
.
.MAC CHAPTER_NUMBER END
. nr #CH_NUM \\$1
.END
\#
.MAC CHAPTER_TITLE END \" This defines what comes after Chapter #
. ie \\n[#NUM_ARGS]=0 \{\
. if \\n[#CHAPTER_TITLE_NUM] \{\
. nr #ITEM 0 1
. while \\n[#CHAPTER_TITLE_NUM]>\\n[#ITEM] \{\
. rm $CHAPTER_TITLE_\\n+[#ITEM]
. \}
. rr #CHAPTER_TITLE_NUM
. rm $CHAPTER_TITLE
. \}
. \}
. el \{\
. rr #CHAPTER_TITLE_NUM
. nr #CHAPTER_TITLE_NUM 0 1
. while \\n[#NUM_ARGS]>\\n[#CHAPTER_TITLE_NUM] \{\
. ds $CHAPTER_TITLE_\\n+[#CHAPTER_TITLE_NUM] \
\\$\\n[#CHAPTER_TITLE_NUM]
. \}
. ds $CHAPTER_TITLE \\$*
. \}
.END
\#
.MAC DRAFT END \"Draft number
. ie '\\$1'' .ds $DRAFT
. el .ds $DRAFT " \\$1
.END
\#
.MAC REVISION END \"Revision number
. ds $REVISION \\$1
.END
\#
.MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
. nr #DRAFT_WITH_PAGENUM 1
.END
\#
.MAC AUTHOR END \"Author. Enclose all args fully in double quotes.
. rr #NO_PRINT_AUTHOR
. if '\\$1'DOC_COVER' \{\
. ds COVER_ DOC_COVER_
. shift
. \}
. if '\\$1'COVER' \{\
. ds COVER_ COVER_
. shift
. \}
. nr #\\*[COVER_]AUTHOR_NUM 0 1
. while \\n[#NUM_ARGS]>\\n[#\\*[COVER_]AUTHOR_NUM] \{\
. ds $\\*[COVER_]AUTHOR_\\n+[#\\*[COVER_]AUTHOR_NUM] \
\\$\\n[#\\*[COVER_]AUTHOR_NUM]
. if !'\\*[$\\*[COVER_]AUTHOR_\\n[#\\*[COVER_]AUTHOR_NUM]]'' \
. as $AUTHORS \
"\\*[$\\*[COVER_]AUTHOR_\\n[#\\*[COVER_]AUTHOR_NUM]], \"
. \}
. ds $AUTHOR \\*[$AUTHOR_1]
. substring $AUTHORS 0 -2
. ds PDF_AUTHORS \\*[$AUTHORS]
. pdfmomclean PDF_AUTHORS
. nop \!x X ps:exec [/Author (\\*[PDF_AUTHORS]) /DOCINFO pdfmark
.END
.
.ALIAS EDITOR AUTHOR
\#
.MAC COPYRIGHT END \"For use on cover pages only
. ie \\n[#NUM_ARGS]=1 \
. ds $COVER_COPYRIGHT \[co]\\$1
. el \{\
. if '\\$1'COVER' .ds $COVER_COPYRIGHT \[co]\\$2
. if '\\$1'DOC_COVER' .ds $DOC_COVER_COPYRIGHT \[co]\\$2
. \}
.END
\#
.MAC COPYRIGHT_V_ADJUST END
. ds $COPYRIGHT_V_ADJ \\$1
.END
\#
.MAC MISC END \"Doc cover and cover pages only; enclose all args in double quotes
. rm COVER_
. ie \\n[#NUM_ARGS]=0 \{\
. if \\n[#DOC_COVER_MISC_LINES] \
. ds COVER_ DOC_COVER_
. if \\n[#COVER_MISC_LINES] \
. ds COVER_ COVER_
. if \\n[#\\*[COVER_]MISC_LINES] \{\
. nr #LINE 0 1
. while \\n[#\\*[COVER_]MISC_LINES]>\\n[#LINE] \{\
. rm $\\*[COVER_]MISC_\\n+[#LINE]
. \}
. rr #\\*[COVER_]MISC_LINES
. \}
. \}
. el \{\
. if '\\$1'DOC_COVER' \{\
. ds COVER_ DOC_COVER_
. shift
. \}
. if '\\$1'COVER' \{\
. ds COVER_ COVER_
. shift
. \}
. nr #\\*[COVER_]MISC_LINE 0 1
. while \\n[#NUM_ARGS]>\\n[#\\*[COVER_]MISC_LINE] \{\
. ds $\\*[COVER_]MISC_\\n+[#\\*[COVER_]MISC_LINE] \
\\$[\\n[#\\*[COVER_]MISC_LINE]]
. \}
. nr #\\*[COVER_]MISC_LINES \\n[#NUM_ARGS]
. rm COVER_
. \}
.END
\#
\# Page number that appears on page one.
.MAC PAGENUMBER END
. nr #n%_AT_PAGENUM_SET \\n%
. nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
. rr #n%_AT_PAGENUM_SET
. nr #PAGE_NUM_SET 1
.END
\#
\# Replacement string for pagenumber.
.MAC PAGENUMBER_STRING END
. ds $PAGENUM_STRING \\$1
.END
\#
\# ====================================================================
\#
\# +++TYPE OF DOCUMENT+++
\#
\# DOCUMENT TYPE
\# -------------
\# *Argument:
\# DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
\# *Function:
\# Creates strings and sets registers for document types.
\# *Notes:
\# Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4,
\# SLIDES=5
\#
.MAC DOCTYPE END
. if '\\$1'DEFAULT' .nr #DOC_TYPE 1
. if '\\$1'CHAPTER' .nr #DOC_TYPE 2
. if '\\$1'NAMED' \{\
. rr #NO_PRINT_DOCTYPE
. ds $DOC_TYPE \\$2
. nr #DOC_TYPE 3
. \}
. if '\\$1'LETTER' \{\
. nr #DOC_TYPE 4
. L_MARGIN 1.125i
. R_MARGIN 1.125i
. ps 12
. vs 13.5
. nr #FOOTER_ADJ \\n[.v]
. DOCHEADER OFF
. PARA_INDENT 3m
. INDENT_FIRST_PARAS
. PARA_SPACE
. ds $SUITE \En[#SUITE]
. HEADER_MARGIN 3P+6p
. HEADER_GAP 3P
. FOOTERS
. FOOTER_RULE OFF
. FOOTER_LEFT ""
. FOOTER_CENTER ""
. FOOTER_RIGHT_SIZE +0
. FOOTER_RIGHT "\&.../\E*[$SUITE]
. FOOTER_ON_FIRST_PAGE
. em ALL_DONE
. \}
. if '\\$1'SLIDES' \{\
. shift
. nr #DOC_TYPE 5
. PRINTSTYLE TYPESET
. FAMILY H
. QUAD CENTER
. QUOTE_STYLE QUAD CENTER
. BLOCKQUOTE_STYLE \
QUAD J \
INDENT \\n[.l]u/5u
. PARA_INDENT 0
. NO_SHIM
. NO_FLEX
. HEADING_STYLE 1 \
SIZE +8 \
QUAD CENTER
. HEADING_STYLE 2 \
SIZE +4 \
QUAD CENTER
. HEADING_STYLE 3 \
SIZE +2 \
QUAD CENTER
. DOCHEADER off
. PAGINATION off
. PAGENUM_HYPHENS off
. HEADERS off
. FOOTERS off
. HEADERS_PLAIN
. FOOTERS_PLAIN
. nr loop-count 0 1
. nr loop-counter \\n[#NUM_ARGS]
.\" Default 16:9 setup if no ASPECT
. PAGE 11i 6.1875i 36p 36p 80p 72p
. PT_SIZE 14
. AUTOLEAD 4
. HEADER_SIZE -2
. while \\n+[loop-count]<=\\n[loop-counter] \{\
. if '\\$1'ASPECT' \{\
. if '\\$2'4:3' \{\
. PAGE 11i 8.25i 36p 36p 90p 84p
. PT_SIZE 16
. AUTOLEAD 6
. HEADER_SIZE -3
. \}
. if '\\$2'16:9' \{\
. PAGE 11i 6.1875i 36p 36p 80p 72p
. PT_SIZE 14
. AUTOLEAD 4
. HEADER_SIZE -2
. \}
. shift 2
. \}
. if '\\$1'HEADER' \{\
. shift 1
. nr #SLIDE_HEADERS 1
. ds $SLIDE_HDR_L \\$1
. ds $SLIDE_HDR_C \\$2
. ds $SLIDE_HDR_R \\$3
. HEADER_MARGIN 45p
. shift 3
. \}
. if '\\$1'FOOTER' \{\
. shift 1
. nr #SLIDE_FOOTERS 1
. ds $SLIDE_FTR_L \\$1
. ds $SLIDE_FTR_C \\$2
. ds $SLIDE_FTR_R \\$3
. shift 3
. \}
. if '\\$1'TRANSITION' \{\
. shift 1
. ds $TRANS_TYPE \\$1
. shift 1
. \}
. if '\\$1'PAUSE' \{\
. shift 1
. ds $PAUSE_TYPE \\$1
. shift 1
. \}
. \}
. if d $TRANS_TYPE \
. pdftransition PAGE \\*[$TRANS_TYPE]
. if d $PAUSE_TYPE \
. pdftransition BLOCK \\*[$PAUSE_TYPE]
. \}
. ie \\n[#SLIDE_HEADERS]+\\n[#SLIDE_FOOTERS]=2 \{\
. HEADERS_AND_FOOTERS L "^\\*[$SLIDE_HDR_L]#\\*[$SLIDE_HDR_C]#\\*[$SLIDE_HDR_R]^" \
L "^\\*[$SLIDE_FTR_L]#\\*[$SLIDE_FTR_C]#\\*[$SLIDE_FTR_R]^"
. \}
. el \{\
. if \\n[#SLIDE_HEADERS] \{\
. HEADERS
. HEADER_RECTO L "^\\*[$SLIDE_HDR_L]#\\*[$SLIDE_HDR_C]#\\*[$SLIDE_HDR_R]^" \
. \}
. if \\n[#SLIDE_FOOTERS] \{\
. FOOTERS
. FOOTER_RECTO L "^\\*[$SLIDE_FTR_L]#\\*[$SLIDE_FTR_C]#\\*[$SLIDE_FTR_R]^"
. \}
. \}
.END
\#
\# +++LETTER MACROS+++
\#
\# First, create a register to hold incrementing numbers to be
\# appended to LETTERHEAD.
\#
.nr #FIELD 0 1
\#
\# DATE
\# ----
\# *Arguments:
\# <none>
\# *Function:
\# Stores date (entered on the line after .DATE) in diversion
\# LETTERHEAD<n>
\#
.MAC DATE END
. if !'\\n[.z]'' .di
. di LETTERHEAD\\n+[#FIELD]
. ie \\n[#FIELD]=1 \{\
. nr #DATE_FIRST 1
. RIGHT
. \}
. el .LEFT
.END
\#
\# TO
\# --
\# *Arguments:
\# <none>
\# *Function:
\# Stores addressee address (entered on the line after .TO) in
\# diversion LETTERHEAD<n>
\#
.MAC TO END
. if !'\\n[.z]'' .di
. di LETTERHEAD\\n+[#FIELD]
. LEFT
.END
\#
\# FROM
\# ----
\# *Arguments:
\# <none>
\# *Function:
\# Stores addresser address (entered on the line after .FROM) in
\# diversion LETTERHEAD<n>
\#
.MAC FROM END
. if !'\\n[.z]'' .di
. di LETTERHEAD\\n+[#FIELD]
. LEFT
.END
\#
\# GREETING
\# --------
\# *Arguments:
\# <none>
\# *Function:
\# Stores greeting (entered on the line after .GREETING) in
\# diversion LETTERHEAD<n>
\#
.MAC GREETING END
. if !'\\n[.z]'' .di
. di LETTERHEAD\\n+[#FIELD]
. LEFT
.END
\#
\# CLOSING
\# -------
\# *Arguments:
\# <closing string>
\# *Function:
\# Stores greeting in diversion CLOSING.
\#
.MAC CLOSING END
. if '\\*[$SIG_SPACE]'' .ds $SIG_SPACE 3v
. ie ( (2v+\\*[$SIG_SPACE]) > \\n[.t] ) \{\
. ie !\\n[@TOP] \{\
. ch HEADER
. ch FOOTER
. br
. tm1 "[mom]: Insufficient room for \\$0 and signature line.
. ab [mom]: Terminating '\\n[.F]' before closing.
. \}
. el .sp
. \}
. el .br
. nr #CLOSING 1
. di CLOSING_TEXT
.END
\#
\# CLOSING INDENT
\# --------------
\# *Argument:
\# <amount to indent closing from left margin>
\# *Function:
\# Defines string $CLOSE_INDENT for use in macro, ALL_DONE.
\#
.MAC CLOSING_INDENT END
. ds $CLOSE_INDENT \\$1
.END
\#
\# SIGNATURE_SPACE
\# ---------------
\# *Argument:
\# <amount of space to leave for signature>
\# *Function:
\# Defines string $SIG_SPACE for use in macro, ALL_DONE.
\#
.MAC SIGNATURE_SPACE END
. ds $SIG_SPACE \\$1
.END
\#
\# NO SUITE
\# --------
\# *Arguments:
\# <none>
\# *Function:
\# Redefines $FOOTER_RIGHT to blank so that a suite number doesn't
\# appear at the bottom of letter pages.
\#
.MAC NO_SUITE END
. FOOTER_RIGHT ""
.END
\#
\# ====================================================================
\#
\# +++DEFAULTS FOR DOCUMENT PROCESSING+++
\#
\# TYPE-STYLE CONTROL MACROS
\# -------------------------
\# The control macros for family, font, size, color and quad are
\# here grouped together. Each (e.g., _FAMILY) uses the calling alias
\# to determine the document element to which the style parameter
\# applies. Defaults for all these guys are set in DEFAULTS, and
\# listed in the "Control Macros" section of the documentation
\# pertinent to the element whose style is to be changed.
\#
.MAC _FAMILY END
. ds PARAM FAM
. ds ELEMENT \\$0
. if '\\$0'COPYRIGHT_FAMILY' \
. ds ELEMENT COVER_COPYRIGHT_FAMILY
. ds FROM_ALIAS \\$0
. substring ELEMENT 0 -4 \" Strip 'ILY' from FAMILY
. ASSIGN_ELEMENT \\$1
.END
\#
.MAC _FONT END
. ds PARAM FT
. ds ELEMENT \\$0
. ds FROM_ALIAS \\$0
. if '\\$0'COPYRIGHT_FONT' \
. ds ELEMENT COVER_COPYRIGHT_FONT
. substring ELEMENT 0 -5
. ds ELEMENT \\*[ELEMENT]FT \" ELEMENT is now \\$0_FT
. ASSIGN_ELEMENT \\$1
.END
\#
.MAC _SIZE END
. ds PARAM SIZE_CHANGE
. ds ELEMENT \\$0_CHANGE
. if '\\$0'CODE_SIZE' \{\
. ds PARAM SIZE_ADJ
. ds ELEMENT \\$0_ADJ
. \}
. if '\\$0'COPYRIGHT_SIZE' \
. ds ELEMENT COVER_COPYRIGHT_SIZE_CHANGE
. ds FROM_ALIAS \\$0
. ASSIGN_ELEMENT \\$1
.END
\#
.MAC _COLOR END
. if \\n[#PRINT_STYLE]=1 .return
. ds PARAM COLOR
. ds ELEMENT \\$0
. if '\\$0'COPYRIGHT_COLOR' \
. ds ELEMENT COVER_COPYRIGHT_COLOR
. ds FROM_ALIAS \\$0
. ASSIGN_ELEMENT \\$1
.END
\#
.MAC _CAPS END
. ds CAPS_TYPE \\$0
. substring CAPS_TYPE 0 7
. ds CALLED_AS \\$0
. substring CALLED_AS -7
. ie '\\*[CALLED_AS]'NO_CAPS' \{\
. ie '\\*[CAPS_TYPE]'BIBLIOGR' \{\
. if '\\$0'BIBLIOGRAPHY_HEADER_NO_CAPS' .rr #BIB_STRING_CAPS
. if '\\$0'BIBLIOGRAPHY_STRING_NO_CAPS' .rr #BIB_STRING_CAPS
. \}
. el \{\
. ie '\\*[CAPS_TYPE]'ENDNOTES' \{\
. if '\\$0'ENDNOTES_HEADER_NO_CAPS' .rr #EN_STRING_CAPS
. if '\\$0'ENDNOTES_STRING_NO_CAPS' .rr #EN_STRING_CAPS
. \}
. el \{\
. ie '\\$0'TOC_HEADER_NO_CAPS' .rr #TOC_STRING_CAPS
. el \{\
. ds REGISTER_TYPE \\$0
. substring REGISTER_TYPE 0 -8
. as REGISTER_TYPE CAPS
. rr #\\*[REGISTER_TYPE]
. \}
. \}
. \}
. \}
. el \{\
. ie '\\*[CAPS_TYPE]'BIBLIOGR' \{\
. if '\\$0'BIBLIOGRAPHY_HEADER_CAPS' .nr #BIB_STRING_CAPS 1
. if '\\$0'BIBLIOGRAPHY_STRING_CAPS' .nr #BIB_STRING_CAPS 1
. \}
. el .nr #\\$0 1
. \}
.END
.
.ALIAS _NO_CAPS _CAPS
\#
.MAC _SMALLCAPS END
. ds SMALLCAPS_TYPE \\$0
. substring SMALLCAPS_TYPE 0 7
. ds CALLED_AS \\$0
. substring CALLED_AS -12
. ie '\\*[CALLED_AS]'NO_SMALLCAPS' \{\
. ie '\\*[SMALLCAPS_TYPE]'BIBLIOGR' \{\
. if '\\$0'BIBLIOGRAPHY_HEADER_NO_SMALLCAPS' .rr #BIB_STRING_SMALLCAPS
. if '\\$0'BIBLIOGRAPHY_STRING_NO_SMALLCAPS' .rr #BIB_STRING_SMALLCAPS
. \}
. el \{\
. ie '\\*[SMALLCAPS_TYPE]'ENDNOTES' \{\
. if '\\$0'ENDNOTES_HEADER_NO_SMALLCAPS' .rr #EN_STRING_SMALLCAPS
. if '\\$0'ENDNOTES_STRING_NO_SMALLCAPS' .rr #EN_STRING_SMALLCAPS
. \}
. el \{\
. ie '\\$0'TOC_HEADER_NO_SMALLCAPS' .rr #TOC_STRING_SMALLCAPS
. el \{\
. ds REGISTER_TYPE \\$0
. substring REGISTER_TYPE 0 -13
. as REGISTER_TYPE SMALLCAPS
. rr #\\*[REGISTER_TYPE]
. \}
. \}
. \}
. \}
. el \{\
. ie '\\*[SMALLCAPS_TYPE]'BIBLIOGR' \{\
. if '\\$0'BIBLIOGRAPHY_HEADER_SMALLCAPS' .nr #BIB_STRING_SMALLCAPS 1
. if '\\$0'BIBLIOGRAPHY_STRING_SMALLCAPS' .nr #BIB_STRING_SMALLCAPS 1
. \}
. el .nr #\\$0 1
. \}
.END
.
.ALIAS _NO_SMALLCAPS _SMALLCAPS
\#
.MAC _QUAD END
. if '\\$0'BIBLIOGRAPHY_QUAD' \{\
. if '\\$1'R' .QUAD-ERROR \\$0
. if '\\$1'C' .QUAD-ERROR \\$0
. \}
. if '\\$0'ENDNOTE_QUAD' \{\
. if '\\$1'R' .QUAD-ERROR \\$0
. if '\\$1'C' .QUAD-ERROR \\$0
. \}
. if '\\$0'DOC_QUAD' \
. if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0
. ds PARAM QUAD
. ds ELEMENT \\$0
. if '\\$0'COPYRIGHT_QUAD' \
. ds ELEMENT COVER_COPYRIGHT_QUAD
. ds FROM_ALIAS \\$0
. ASSIGN_ELEMENT \\$1
.END
\#
\# Special handling for QUOTE quadding
\#
.MAC QUOTE_QUAD END
. ds $Q_QUAD \\$0
. substring $Q_QUAD 6
.END
.
.ALIAS QUOTE_LEFT QUOTE_QUAD
.ALIAS QUOTE_CENTER QUOTE_QUAD
.ALIAS QUOTE_RIGHT QUOTE_QUAD
\#
.MAC QUAD-ERROR END
. tm1 "[mom]: \\$1 at line \\n[.c] of '\\n[.F]' must be set to either L or J.
. ab [mom]: Aborting.
.END
\#
.MAC ASSIGN_ELEMENT END
. rm $\\*[ELEMENT] \" Clear this first
.\" HDRFTR_<POSITION>_<PARAMETER> need special handling.
. ds hdrftr \\*[FROM_ALIAS]
. substring hdrftr 0 5
. if '\\*[hdrftr]'HDRFTR' \{\
. ds hdrftr-pos-element \\*[ELEMENT]
.\" See if ELEMENT is of the form HDRFTR_<pos>_<param>
. substring hdrftr-pos-element 0 7
. substring hdrftr-pos-element -1
. if !'\\*[ELEMENT]'HDRFTR_COLOR' \{\
. if '\\*[hdrftr-pos-element]'L' .nr hdrftr-pos-element 1
. if '\\*[hdrftr-pos-element]'C' .nr hdrftr-pos-element 1
. if '\\*[hdrftr-pos-element]'R' .nr hdrftr-pos-element 1
. \}
. \}
. if !\\n[hdrftr-pos-element] \{\
. ds c1-c5 \\*[ELEMENT]
. substring c1-c5 0 4 \" Grab first five letters of the alias
. \}
.\" If none of the following, convert the substring of the
.\" calling alias, ie \*[ELEMENT], into the parameter string, e.g.,
.\" $TITLE_FAM, assign arg, and set register.
. if !'\\*[c1-c5]'BIBLI' \
. if !'\\*[c1-c5]'BLOCK' \
. if !'\\*[c1-c5]'CITAT' \
. if !'\\*[c1-c5]'ENDNO' \
. if !'\\*[c1-c5]'EPIGR' \
. if !'\\*[c1-c5]'FOOTN' \
. if !'\\*[c1-c5]'HDRFT' \
. if !'\\*[c1-c5]'LINEN' \
. if !'\\*[c1-c5]'PAGEN' \{\
. ie '\\*[ELEMENT]'CODE_SIZE_ADJ' .nr #\\*[ELEMENT] \\$1
. el \{\
. ds $\\*[ELEMENT] \\$1
. nr #\\*[ELEMENT] 1
. \}
. \}
. if '\\*[$\\*[ELEMENT]]'' \{\
. if '\\*[c1-c5]'BIBLI' .ASSIGN_PARAM BIB \\$1
. if '\\*[c1-c5]'BLOCK' .ASSIGN_PARAM BQUOTE_ \\$1
. if '\\*[c1-c5]'CITAT' .ASSIGN_PARAM BQUOTE_ \\$1
. if '\\*[c1-c5]'ENDNO' .ASSIGN_PARAM EN \\$1
. if '\\*[c1-c5]'EPIGR' .ASSIGN_PARAM EPI_ \\$1
. if '\\*[c1-c5]'FOOTN' .ASSIGN_PARAM FN_ \\$1
. if '\\*[c1-c5]'HDRFT' .ASSIGN_PARAM HDRFTR_ \\$1
. if '\\*[c1-c5]'LINEN' .ASSIGN_PARAM LN_ \\$1
. if '\\*[c1-c5]'PAGEN' .ASSIGN_PARAM PAGE_NUM_ \\$1
. \}
. if \\n[hdrftr-pos-element] \{\
. if '\\*[hdrftr-pos-element]'L' .ds hdrftr-pos-element LEFT
. if '\\*[hdrftr-pos-element]'C' .ds hdrftr-pos-element CENTER
. if '\\*[hdrftr-pos-element]'R' .ds hdrftr-pos-element RIGHT
. if '\\*[ELEMENT]'HDRFTR_\\*[hdrftr-pos-element]_FAM' \
. ds $HDRFTR_\\*[hdrftr-pos-element]_FAM \\$1
. \}
. rr hdrftr-pos-element
. rm hdrftr-pos-element
.END
\#
.MAC ASSIGN_PARAM END
. if '\\*[PARAM]'FAM' .nr substr-index -7
. if '\\*[PARAM]'FT' .nr substr-index -5
. if '\\*[PARAM]'SIZE_CHANGE' .nr substr-index -5
. if '\\*[PARAM]'COLOR' .nr substr-index -6
. if '\\*[PARAM]'QUAD' .nr substr-index -5
. if '\\$1'BIB' \{\
. ds ELEMENT \\*[FROM_ALIAS]
. substring ELEMENT 12 \\n[substr-index]
. if '\\*[ELEMENT]'_HEADER_' \
. ds ELEMENT _STRING_
. \}
. if '\\$1'BQUOTE_' .rm ELEMENT
. if '\\$1'EN' \{\
. ds ELEMENT \\*[FROM_ALIAS]
. substring ELEMENT 7 \\n[substr-index]
. if '\\*[ELEMENT]'S_HEADER_' \
. ds ELEMENT _STRING_
. if '\\*[ELEMENT]'_LINENUMBER_' \
. ds ELEMENT _LN_
. \}
. if '\\$1'EPI_' .rm ELEMENT
. if '\\$1'FN_' .rm ELEMENT
. if '\\$1'HDRFTR_' \{\
. if '\\*[ELEMENT]'HDRFTR_FAM' \{\
. nr #HDRFTR 1
. ds $HDRFTR_FAM \\$2
. ds $HDRFTR_LEFT_FAM \\$2
. ds $HDRFTR_CENTER_FAM \\$2
. ds $HDRFTR_RIGHT_FAM \\$2
. \}
. if '\\*[ELEMENT]'HDRFTR_COLOR' \{\
. nr #HDRFTR 1
. nr #HDRFTR_COLOR 1
. ds $HDRFTR_COLOR \\$2
. \}
. if '\\*[ELEMENT]'HDRFTR_SIZE_CHANGE' \{\
. nr #HDRFTR 1
. ds $HDRFTR_SIZE_CHANGE \\$2
. \}
. if '\\*[PARAM]'SIZE_CHANGE' \{\
. nr #HDRFTR 1
. if '\\*[hdrftr-pos-element]'L' \
. ds $HDRFTR_LEFT_SIZE_CHANGE \\$2
. if '\\*[hdrftr-pos-element]'C' \
. ds $HDRFTR_CENTER_SIZE_CHANGE \\$2
. if '\\*[hdrftr-pos-element]'R' \
. ds $HDRFTR_RIGHT_SIZE_CHANGE \\$2
. \}
. if !r #HDRFTR \{\
. substring ELEMENT 7 \\n[substr-index]
. if '\\*[ELEMENT]'_LEFT' .ds ELEMENT _STRING_
. \}
. \}
. if '\\$1'LN_' .rm ELEMENT
. if '\\$1'PAGE_NUM_' .rm ELEMENT
. if !r #HDRFTR \{\
. ds $\\$1\\*[ELEMENT]\\*[PARAM] \\$2
. nr #\\$1\\*[ELEMENT]\\*[PARAM] 1
. \}
. rr #HDRFTR
. rm hdrftr-pos-element
. rr substr-index
. rm FROM_ALIAS
. rm ELEMENT
.END
\#
.MAC TITLE_LEAD END
. ds $TYPE \\$0
. substring $TYPE 0 2
. if '\\*[$TYPE]'DOC' .nr DOC_ 1
. ds $TYPE \\$0
. ie '\\*[$TYPE]'MISC_LEAD' .ds $TYPE COVER_MISC
. el .substring $TYPE -6 0
. ds $\\*[$TYPE]_LEAD \\$1
. nr #\\*[$TYPE]_LEAD 1
. rm $TYPE
.END
\#
\# The _STYLE macro, called by various aliases, allows grouping
\# style parameters for most document elements in a single macro
\# using 'KEYWORD value' pairs.
\#
.MAC _STYLE END
. SILENT \" Some of the invoked macros cause unwanted breaks
. ds $STYLE_TYPE \\$0
. substring $STYLE_TYPE 0 -7
. ds $HDR_FTR \\*[$STYLE_TYPE]
. length #HDR_FTR_STRING $HDR_FTR
. if \\n[#HDR_FTR_STRING]<=5 .substring $HDR_FTR 0 5 \" HEADER or FOOTER
. if '\\*[$HDR_FTR]'HEADER' .ds $HDR_FTR HEADER
. if '\\*[$HDR_FTR]'FOOTER' .ds $HDR_FTR FOOTER
. ds $POS \\$0
. substring $POS 7 7
. if '\\*[$POS]'L' .ds $POS LEFT
. if '\\*[$POS]'C' .ds $POS CENTER
. if '\\*[$POS]'R' .ds $POS RIGHT
. if '\\*[$STYLE_TYPE]'\\*[$HDR_FTR]_\\*[$POS]' \{\
. ds $\\*[$HDR_FTR]_\\*[$POS] \\*[$HDR_FTR]_\\*[$POS]
. ds $STYLE_TYPE HDRFTR_\\*[$POS]
. \}
. if '\\*[$STYLE_TYPE]'ENDNOTES_HEADER' \
. ds $BIB-EN-TOC EN_STRING
. if '\\*[$STYLE_TYPE]'ENDNOTE_STRING' \
. ds $BIB-EN-TOC EN_STRING
. if '\\*[$STYLE_TYPE]'BIBLIOGRAPHY_HEADER' \
. ds $BIB-EN-TOC BIB_STRING
. if '\\*[$STYLE_TYPE]'BIBLIOGRAPHY_STRING' \
. ds $BIB-EN-TOC BIB_STRING
. if '\\*[$STYLE_TYPE]'TOC_HEADER' \
. ds $BIB-EN-TOC TOC_STRING
. if '\\*[$STYLE_TYPE]'PAGENUMBER' \
. ds $STYLE_TYPE PAGENUM
. nr #LOOP 0 1
. nr #STYLE_PARAMS \\n[#NUM_ARGS]
. while \\n+[#LOOP]<=\\n[#STYLE_PARAMS] \{\
. if '\\$1'FAMILY' \{\
. shift
. \\*[$STYLE_TYPE]_FAMILY \\$1
. shift
. \}
. if '\\$1'FONT' \{\
. shift
. \\*[$STYLE_TYPE]_FONT \\$1
. shift
. \}
. if '\\$1'SIZE' \{\
. shift
. \\*[$STYLE_TYPE]_SIZE \\$1
. shift
. \}
. if '\\$1'COLOR' \{\
. shift
. \\*[$STYLE_TYPE]_COLOR \\$1
. shift
. \}
. if '\\$1'CAPS' \{\
. if \\n[#\\*[$STYLE_TYPE]_SMALLCAPS] \{\
. tm1 \
"[mom]: '\\*[$STYLE_TYPE]_STYLE' contains CAPS and SMALLCAPS. \
CAPS takes precedence.
. rr #\\*[$STYLE_TYPE]_SMALLCAPS
. \}
. \\*[$STYLE_TYPE]_CAPS
. if d $\\*[$HDR_FTR]_LEFT .HEADER_LEFT_CAPS
. if d $\\*[$HDR_FTR]_CENTER .HEADER_CENTER_CAPS
. if d $\\*[$HDR_FTR]_CENTRE .HEADER_CENTER_CAPS
. if d $\\*[$HDR_FTR]_RIGHT .HEADER_RIGHT_CAPS
. shift
. \}
. if '\\$1'NO_CAPS' \{\
. nr #\\*[$STYLE_TYPE]_CAPS 0
. if !'\\*[$BIB-EN-TOC]'' \
. rr #\\*[$BIB-EN-TOC]_CAPS
. shift
. \}
. if '\\$1'SMALLCAPS' \{\
. if \\n[#\\*[$STYLE_TYPE]_CAPS] \{\
. tm1 \
"[mom]: '\\*[$STYLE_TYPE]_STYLE' contains CAPS and SMALLCAPS. \
SMALLCAPS takes precedence.
. rr #\\*[$STYLE_TYPE]_CAPS
. \}
. \\*[$STYLE_TYPE]_SMALLCAPS
. shift
. \}
. if '\\$1'NO_SMALLCAPS' \{\
. rr #\\*[$STYLE_TYPE]_SMALLCAPS
. if !'\\*[$BIB-EN-TOC]'' \
. rr #\\*[$BIB-EN-TOC]_SMALLCAPS
. shift
. \}
. if '\\$1'LEAD' \{\
. shift
. \\*[$STYLE_TYPE]_LEAD \\$1
. shift
. \}
. if '\\$1'AUTOLEAD' \{\
. shift
. \\*[$STYLE_TYPE]_AUTOLEAD \\$1
. shift
. \}
. if '\\$1'SPACE' \{\
. shift
. \\*[$STYLE_TYPE]_SPACE \\$1
. shift
. \}
. if '\\$1'QUAD' \{\
. shift
. ie '\\*[$STYLE_TYPE]'QUOTE' \{\
. ds $QUAD_TYPE \\$1
. substring $QUAD_TYPE 0 0
. if '\\*[$QUAD_TYPE]'L' .QUOTE_LEFT
. if '\\*[$QUAD_TYPE]'C' .QUOTE_CENTER
. if '\\*[$QUAD_TYPE]'R' .QUOTE_RIGHT
. \}
. el .\\*[$STYLE_TYPE]_QUAD \\$1
. shift
. \}
. if '\\$1'INDENT' \{\
. shift
. \\*[$STYLE_TYPE]_INDENT \\$1
. shift
. \}
.\" UNDERLINE and UNDERSCORE are identical but we can't use : or &
.\" in string comparisons.
. if '\\$1'UNDERLINE' \{\
. shift
. if '\\$1'DOUBLE' \{\
. as ul-args \\$1 \"
. shift
. \}
. nr #COUNT 0 1
. while \\n+[#COUNT]<=3 \{\
. if \B'\\$1' \{\
. as ul-args \\$1 \"
. shift
. \}
. \}
. \\*[$STYLE_TYPE]_UNDERSCORE \\*[ul-args]
. \}
. if '\\$1'UNDERSCORE' \{\
. shift
. if '\\$1'DOUBLE' \{\
. as ul-args \\$1 \"
. shift
. \}
. nr #COUNT 0 1
. while \\n+[#COUNT]<=3 \{\
. if \B'\\$1' \{\
. as ul-args \\$1 \"
. shift
. \}
. \}
. \\*[$STYLE_TYPE]_UNDERSCORE \\*[ul-args]
. \}
. if '\\$1'NO_UNDERSCORE' \{\
. rr #\\*[$STYLE_TYPE]_UNDERLINE
. if !'\\*[$BIB-EN-TOC]'' \
. rr #\\*[$BIB-EN-TOC]_UNDERLINE
. shift
. \}
. if '\\$1'NO_UNDERLINE' \{\
. rr #\\*[$STYLE_TYPE]_UNDERLINE
. if !'\\*[$BIB-EN-TOC]'' \
. rr #\\*[$BIB-EN-TOC]_UNDERLINE
. shift
. \}
. if '\\$1'V_ADJUST' \{\
. shift
. COPYRIGHT_V_ADJUST \\$1
. shift
. \}
. \}
. rm $STYLE_TYPE
. rm $HDR_FTR
. rm $POS
. rm $HEADER_LEFT
. rm $HEADER_CENTER
. rm $HEADER_RIGHT
. rm $BIB-EN-TOC
. rm ul-args
. SILENT off
.END
.
.ds STYLE_TYPE_1 ATTRIBUTE
.ds STYLE_TYPE_2 AUTHOR
.ds STYLE_TYPE_3 BIBLIOGRAPHY_HEADER
.ds STYLE_TYPE_4 BIBLIOGRAPHY_STRING
.ds STYLE_TYPE_5 BLOCKQUOTE
.ds STYLE_TYPE_6 CHAPTER
.ds STYLE_TYPE_7 CHAPTER_TITLE
.ds STYLE_TYPE_8 CODE
.ds STYLE_TYPE_9 COPYRIGHT
.ds STYLE_TYPE_10 COVER
.ds STYLE_TYPE_11 COVERTITLE
.ds STYLE_TYPE_12 DOC_COVERTITLE
.ds STYLE_TYPE_13 DOCHEADER
.ds STYLE_TYPE_14 DOCTITLE
.ds STYLE_TYPE_15 DOCTYPE
.ds STYLE_TYPE_16 ENDNOTE_TITLE
.ds STYLE_TYPE_17 ENDNOTES_HEADER
.ds STYLE_TYPE_18 ENDNOTE_STRING
.ds STYLE_TYPE_19 EPIGRAPH
.ds STYLE_TYPE_20 FINIS
.ds STYLE_TYPE_21 FOOTER_LEFT
.ds STYLE_TYPE_22 FOOTER_CENTER
.ds STYLE_TYPE_23 FOOTER_CENTRE
.ds STYLE_TYPE_24 FOOTER_RIGHT
.ds STYLE_TYPE_25 FOOTNOTE
.ds STYLE_TYPE_26 HEADER_LEFT
.ds STYLE_TYPE_27 HEADER_CENTER
.ds STYLE_TYPE_28 HEADER_CENTRE
.ds STYLE_TYPE_29 HEADER_RIGHT
.ds STYLE_TYPE_30 LEAD
.ds STYLE_TYPE_31 LINENUMBER
.ds STYLE_TYPE_32 MISC
.ds STYLE_TYPE_33 QUOTE
.ds STYLE_TYPE_34 PAGENUMBER
.ds STYLE_TYPE_35 SUBTITLE
.ds STYLE_TYPE_36 TITLE
.ds STYLE_TYPE_37 TOC_HEADER
.
.nr #LOOP 0 1
.while \n+[#LOOP]<=37 \{\
. ALIAS \*[STYLE_TYPE_\n[#LOOP]]_STYLE _STYLE
. ALIAS COVER_\*[STYLE_TYPE_\n[#LOOP]]_STYLE _STYLE
. ALIAS DOC_COVER_\*[STYLE_TYPE_\n[#LOOP]]_STYLE _STYLE
.\}
\#
\# UNDERLINE CONTROL
\# -----------------
\# *Arguments:
\# [ DOUBLE ] [ <underline weight> [<underline gap>] ] | <none> | <anything>
\# *Function:
\# Toggles underlining of the element indicated by the calling alias
\# on or off. Uses #<element>_UNDERLINE_WEIGHT to set the weight,
\# and defines string $<element>_UNDERLINE_GAP.
\#
.MAC _UNDERLINE END
. ds $GET_TITLE_TYPE \\$0
. substring $GET_TITLE_TYPE -2
. ie '\\*[$GET_TITLE_TYPE]'NE' \{\
.\" Called as _UNDERLINE
. ds $GET_TITLE_TYPE \\$0
. substring $GET_TITLE_TYPE 0 -10
. ds $TITLE_TYPE \\*[$GET_TITLE_TYPE]
. \}
. el \{\
.\" Called as _UNDERSCORE
. ds $GET_TITLE_TYPE \\$0
. substring $GET_TITLE_TYPE 0 -11
. ds $TITLE_TYPE \\*[$GET_TITLE_TYPE]
. \}
. ds $GET_TITLE_TYPE \\$0
. substring $GET_TITLE_TYPE 0 2
. if '\\*[$GET_TITLE_TYPE]'BIB' .ds $TITLE_TYPE BIB_STRING_
. if '\\*[$GET_TITLE_TYPE]'SUB' .ds $TITLE_TYPE SUBTITLE_
. ds $GET_TITLE_TYPE \\$0
. substring $GET_TITLE_TYPE 0 7
. if '\\*[$GET_TITLE_TYPE]'ENDNOTES' .ds $TITLE_TYPE EN_STRING_
. ds $GET_TITLE_TYPE \\$0
. substring $GET_TITLE_TYPE 0 10
. if '\\*[$GET_TITLE_TYPE]'ENDNOTE_STR' .ds $TITLE_TYPE EN_STRING_
. if '\\*[$GET_TITLE_TYPE]'ENDNOTE_TIT' .ds $TITLE_TYPE EN_TITLE_
. ie '\\$1'' .nr #\\*[$TITLE_TYPE]UNDERLINE 1
. el \{\
. ie \\n[#NUM_ARGS]=1 \{\
. ie \B'\\$1' \{\
. if !\\n[#PRINT_STYLE]=1 \{\
. \\*[$TITLE_TYPE]UNDERLINE_WEIGHT \\$1
. nr #\\*[$TITLE_TYPE]UNDERLINE 1
. \}
. \}
. el \{\
. ie '\\$1'DOUBLE' .nr #\\*[$TITLE_TYPE]UNDERLINE 2
. el .nr #\\*[$TITLE_TYPE]UNDERLINE 0
. \}
. \}
. el \{\
. if !\\n[#PRINT_STYLE]=1 \{\
. nr #\\*[$TITLE_TYPE]UNDERLINE 1
. if '\\$1'DOUBLE' \{\
. nr #\\*[$TITLE_TYPE]UNDERLINE 2
. shift
. \}
. \\*[$TITLE_TYPE]UNDERLINE_WEIGHT \\$1
. if !'\\$2'' \
. ds $\\*[$TITLE_TYPE]UNDERLINE_GAP \\$2
. if !'\\$3'' \
. ds $\\*[$TITLE_TYPE]RULE_GAP \\$3
. \}
. \}
. \}
. rm $TITLE_TYPE
.END
.
.ALIAS ENDNOTE_STRING_UNDERLINE _UNDERLINE
.ALIAS ENDNOTE_STRING_UNDERSCORE _UNDERLINE
\#
\# DEFAULTS
\# --------
\# *Arguments:
\# <none>
\# *Function:
\# Sets up defaults if no values are entered prior to START.
\# *Notes:
\# The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
\# $REVISION_STRING are in the COPYSTYLE macro.
\#
.MAC DEFAULTS END
. if !\\n[#DOC_TYPE]=5 \{\
. ie !d $PAPER \{\
. PAGEWIDTH \\n[#PAGE_WIDTH]u
. PAGELENGTH \\n[.p]u
. \}
. el .PAPER \\*[$PAPER]
. \}
. if !\\n[#DOC_TYPE] .DOCTYPE DEFAULT
. if !r #CH_NUM .nr #CH_NUM 1
. ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
. el \
. if !\\n[#COPY_STYLE]=1 .PAGENUM_STYLE DIGIT
. if !\\n[#COPY_STYLE] .COPYSTYLE FINAL
. if \\n[#DRAFT_WITH_PAGENUM] .COPYSTYLE \\*[$COPY_STYLE]
. if \\n[#DOC_TYPE]=4 \{\
. if !\\n[#USER_SET_L_LENGTH] \{\
. R_MARGIN \\n[#R_MARGIN]u
. rr #USER_SET_L_LENGTH
. \}
. if \\n[#PRINT_STYLE]=1 .PRINTSTYLE TYPEWRITE SINGLESPACE
. \}
. if \\n[#COPY_STYLE]=1 \{\
. COPYSTYLE DRAFT
. PAGENUMBER 1
. \}
. if !r #DOC_HEADER .DOCHEADER
. if !r #HEADERS_ON .HEADERS
. if !r #PAGINATE .PAGINATE
. if !r #HEADER_MARGIN .HEADER_MARGIN 4P+6p
. if !r #HEADER_GAP .HEADER_GAP 3P
. if \\n[#FOOTERS_ON] \{\
. HEADERS OFF
. ie \\n[#PAGINATE] \
. if \\n[#PAGE_NUM_POS_SET]=0 .PAGENUM_POS TOP CENTER
. el \
. if !\\n[#T_MARGIN] .T_MARGIN 6P
. \}
. if !\\n[#HEADERS_ON] \{\
. if !\\n[#FOOTERS_ON] \{\
. ie \\n[#PAGE_NUM_V_POS]=1 \{\
. HEADER_MARGIN \\n[#HEADER_MARGIN]
. HEADER_GAP \\n[#HEADER_GAP]
. \}
. el .if !r #T_MARGIN .T_MARGIN 6P
. \}
. \}
. if !r #T_MARGIN \
. T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP]
. if !r #DOCHEADER_ADVANCE \
. nr #DOCHEADER_ADVANCE \\n[#T_MARGIN]
. if !r #FOOTER_MARGIN .FOOTER_MARGIN 3P
. if !r #FOOTER_GAP .FOOTER_GAP 3P
. if !r #B_MARGIN \
. B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u
. if !\\n[#HEADER_RULE_GAP] .HEADER_RULE_GAP 4p
. if !\\n[#FOOTER_RULE_GAP] .FOOTER_RULE_GAP 4p
. if !r #HDRFTR_RULE .HDRFTR_RULE
. if !r #PAGE_NUM_SET .PAGENUMBER 1
.\" Read in number registers and strings for type parameters
. nr #DOC_L_MARGIN \\n[#L_MARGIN]
. nr #DOC_L_LENGTH \\n[#L_LENGTH]
. nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
. ie !'\\*[$SAVED_DOC_FAM]'' \{\
. ds $DOC_FAM \\*[$SAVED_DOC_FAM]
. rm $SAVED_DOC_FAM
. \}
. el .ds $DOC_FAM \\*[$FAMILY]
. ie !r #DOC_PT_SIZE .nr #DOC_PT_SIZE \\n[#PT_SIZE]
. el \
. if !\\n[#DOC_PT_SIZE]=\\n[#PT_SIZE] \
. nr #DOC_PT_SIZE \\n[#PT_SIZE]
. if \\n[#TOC] .nr #DOC_PT_SIZE \\n[#TOC_PS]
. if \\n[#ENDNOTES] .nr #DOC_PT_SIZE \\n[#EN_PS]
. if \\n[#BIBLIOGRAPHY] .nr #DOC_PT_SIZE \\n[#BIB_PS]
. if \
(\\n[#TOC]=0)&\
(\\n[#LIST_OF_FIGURES]=0)&\
(\\n[#LIST_OF_TABLES]=0)&\
(\\n[#LIST_OF_EQUATIONS]=0) \
. nr #DOC_LEAD \\n[.v]
. nr #DOC@LEAD \\n[#DOC_LEAD]
. if \\n[#AUTO_LEAD] .nr #DOC_AUTOLEAD \\n[#AUTOLEAD_VALUE]
.\" #SAVED_DOC_LEAD is set in COLLATE
. if \\n[#SAVED_DOC_LEAD] \{\
. if \
(\\n[#TOC]=0)&\
(\\n[#LIST_OF_FIGURES]=0)&\
(\\n[#LIST_OF_TABLES]=0)&\
(\\n[#LIST_OF_EQUATIONS]=0) \{\
. ie !\\n[#DOC_LEAD]=\\n[#SAVED_DOC_LEAD] .nr #RERUN_TRAPS 1
. el .nr #SKIP_TRAPS 1
. \}
. \}
. ie \\n[#ADJ_DOC_LEAD]=1 .
. el \
. if !\\n[#DOC_LEAD_ADJUST_OFF] .DOC_LEAD_ADJUST
. ie d$RESTORE_DOC_QUAD \{\
. ds $DOC_QUAD \\*[$RESTORE_DOC_QUAD]
. rm $RESTORE_DOC_QUAD
. \}
. el .ds $DOC_QUAD \\*[$QUAD_VALUE]
. if '\\*[$FONT]'' .FT R
. if '\\*[$PP_FT]'' .ds $PP_FT \\*[$FONT]
. FT \\*[$PP_FT]
.\" Counters
. nr #PP 0
. nr #FN_NUMBER 0 1
. nr #EN_NUMBER 0 1
. nr #FN_COUNT_FOR_COLS 0 1
. nr #DONE_ONCE 0 1
.\" Enable shimming if user hasn't turned it off
. if \\n[#NO_SHIM]=2 \{\
. rr #NO_SHIM
. nr #NO_FLEX 1
. \}
.\" General style defaults for both PRINTSTYLEs
. nr #PP_STYLE 1
. PARA_INDENT \\n[#PP_INDENT]u
. if !d $HDRFTR_FAM .ds $HDRFTR_FAM \\*[$DOC_FAM]
. if !d $HDRFTR_SIZE_CHANGE .HDRFTR_SIZE +0
. if !d $PAGE_NUM_FAM .PAGENUM_FAMILY \\*[$DOC_FAM]
. if !d $PAGE_NUM_FT .PAGENUM_FONT R
. if !d $PAGE_NUM_SIZE_CHANGE .PAGENUM_SIZE +0
. if !r #PAGE_NUM_POS_SET .PAGENUM_POS BOTTOM CENTER
. ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
. if \\n[#PAGE_NUM_HYPHENS]=0 .PAGENUM_HYPHENS OFF
. if \\n[#PAGE_NUM_HYPHENS]=1 .PAGENUM_HYPHENS
. \}
. el \
. if !d$PAGENUM_STRING .PAGENUM_HYPHENS
. if !d $FN_FAM .FOOTNOTE_FAMILY \\*[$DOC_FAM]
. if !d $FN_FT .FOOTNOTE_FONT R
. if !d $FN_QUAD .FOOTNOTE_QUAD \\*[$DOC_QUAD]
. if !r #FN_RULE .FOOTNOTE_RULE
. if !r #FN_MARKERS .FOOTNOTE_MARKERS
. if \\n[#FN_MARKERS]=1 \{\
. if \\n[#FN_REF]=1 \
. if !\\n[#FN_MARKER_STYLE] .FOOTNOTE_MARKER_STYLE NUMBER
. if !\\n[#FN_MARKER_STYLE] .FOOTNOTE_MARKER_STYLE STAR
. \}
. if !r #EN_MARKER_STYLE .ENDNOTE_MARKER_STYLE SUPERSCRIPT
. if !d $EN_PN_STYLE .ENDNOTES_PAGENUM_STYLE digit
. if !d $EN_FAM .ENDNOTE_FAMILY \\*[$DOC_FAM]
. if !d $EN_FT .ENDNOTE_FONT R
. if !d $EN_QUAD \{\
. ds quad-check \\*[$DOC_QUAD]
. substring quad-check 0 0
. if '\\*[$DOC_QUAD]'C' .nr quad-check 1
. if '\\*[$DOC_QUAD]'R' .nr quad-check 1
. ie \\n[quad-check] .ENDNOTE_QUAD J
. el .ENDNOTE_QUAD \\*[$DOC_QUAD]
. rr quad-check
. \}
. if !d $EN_STRING .ENDNOTES_HEADER_STRING "Endnotes"
. if !d $EN_STRING_FAM .ENDNOTES_HEADER_FAMILY \\*[$EN_FAM]
. if !d $EN_STRING_QUAD .ENDNOTES_HEADER_QUAD CENTER
. if !d $EN_TITLE \{\
. ie \\n[#DOC_TYPE]=2 \{\
. ie !'\\*[$CHAPTER_TITLE_1]'' \{\
. ie '\\*[$CHAPTER]'' .ENDNOTE_TITLE "\\*[$CHAPTER_TITLE]"
. el .ENDNOTE_TITLE \
"\\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]"
. \}
. el \{\
. ie '\\*[$CHAPTER]'' .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]"
. el .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
. \}
. \}
. el .ENDNOTE_TITLE "\\*[$TITLE]"
. \}
. if !d $EN_TITLE_FAM .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM]
. if !d $EN_TITLE_QUAD .ENDNOTE_TITLE_QUAD LEFT
. if !d $EN_NUMBER_FAM .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM]
. if !d $EN_LN_FAM .ENDNOTE_LINENUMBER_FAMILY \\*[$EN_FAM]
. if !r #EN_NUMBERS_ALIGN_LEFT \{\
. if !r #EN_NUMBERS_ALIGN_RIGHT \{\
. ie !\\n[#EN_MARKER_STYLE]=2 .ENDNOTE_NUMBERS_ALIGN RIGHT 2
. el .ENDNOTE_NUMBERS_ALIGN RIGHT 4
. \}
. \}
. if !r #EN_LN_GAP .ENDNOTE_LINENUMBER_GAP 1m
. if !r #EN_ALLOWS_HEADERS .ENDNOTES_ALLOWS_HEADERS
. if !d $BIB_PN_STYLE .BIBLIOGRAPHY_PAGENUM_STYLE digit
. if !d $BIB_FAM .BIBLIOGRAPHY_FAMILY \\*[$DOC_FAM]
. if !d $BIB_FT .BIBLIOGRAPHY_FONT R
. if !d $BIB_QUAD \{\
. ds quad-check \\*[$DOC_QUAD]
. substring quad-check 0 0
. if '\\*[$DOC_QUAD]'C' .nr quad-check 1
. if '\\*[$DOC_QUAD]'R' .nr quad-check 1
. ie \\n[quad-check] .BIBLIOGRAPHY_QUAD J
. el .BIBLIOGRAPHY_QUAD \\*[$DOC_QUAD]
. rr quad-check
. \}
. if !d $BIB_STRING .BIBLIOGRAPHY_STRING "Bibliography"
. if !d $BIB_STRING_FAM .BIBLIOGRAPHY_STRING_FAMILY \\*[$BIB_FAM]
. if !d $BIB_STRING_QUAD .BIBLIOGRAPHY_STRING_QUAD CENTER
. if !d $TOC_HEADER_STRING .TOC_HEADER_STRING "Contents"
. if !d $TOC_HEADER_QUAD .TOC_HEADER_QUAD LEFT
. if !d $TOC_PN_STYLE .TOC_PAGENUM_STYLE roman
. if !r #TOC_PN_PADDING .TOC_PADDING 3
.\" Line numbering
. if !r #LN_GUTTER .nr #LN_GUTTER 2
. if !r #Q_LN_GUTTER .nr #Q_LN_GUTTER 2
. if !r #BQ_LN_GUTTER .nr #BQ_LN_GUTTER 2
. if !d $LN_FAM .ds $LN_FAM \\*[$DOC_FAM]
. if !d $LN_FT .ds $LN_FT R
. if !d $LN_SIZE_CHANGE .ds $LN_SIZE_CHANGE +0
. if !d $LN_COLOR .ds $LN_COLOR black
.\" PDF link colour
. if !\\n[PDFHREF_COLOR_SET] .PDF_LINK_COLOR 0.0 0.3 0.9
.\" PDF frame
. if !d pdf-img:frame-weight .ds pdf-img:frame-weight .5
. if !d pdf-img:frame-color .ds pdf-img:frame-color black
.\" Captions, labels, sources
.\" All at default doc specs except leading, which is autolead 2
. nr label-type-counter 0 1
. while \\n+[label-type-counter]<=5 \{\
. if \\n[label-type-counter]=1 .ds label-type eqn
. if \\n[label-type-counter]=2 .ds label-type pdf-img
. if \\n[label-type-counter]=3 .ds label-type pic
. if \\n[label-type-counter]=4 .ds label-type tbl
. if \\n[label-type-counter]=5 .ds label-type floating
. nr spec-type-counter 0 1
. while \\n+[spec-type-counter]<=3 \{\
. if \\n[spec-type-counter]=1 .ds spec-type label
. if \\n[spec-type-counter]=2 .ds spec-type caption
. if \\n[spec-type-counter]=3 .ds spec-type source
. set-defaults
. set-inline-specs
. \}
. rm label-type
. rm spec-type
. \}
.\" String defaults for both PRINTSTYLEs
. ie \\n[#DOC_TYPE]=1 \{\
. ie '\\*[$DOCTITLE]'' \{\
. if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
. if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
. \}
. el \{\
. if \\n[#COPY_STYLE]=1 .DRAFT_WITH_PAGENUMBER
. if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
. if \\n[#USER_DEF_HDRFTR_CENTER]=0 .ds $HDRFTR_CENTER \\*[$TITLE]
. if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$DOCTITLE]
. \}
. \}
. el \{\
. if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
. if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
. \}
. if !d $ATTRIBUTE_STRING .ds $ATTRIBUTE_STRING by
. if !d $FINIS_STRING .FINIS_STRING "End"
. if !r #FINIS_STRING_CAPS .nr #FINIS_STRING_CAPS 1
.\" Covers
. if !r #DOC_COVERS_OFF .nr #DOC_COVERS 1
. if !r #COVERS_OFF .nr #COVERS 1
. if !d $COVER_COPYRIGHT_QUAD .COVER_COPYRIGHT_QUAD R
. if !d $COVER_MISC_QUAD .COVER_MISC_QUAD L
. if !d $MISC_QUAD .MISC_QUAD L
. if !d $DOC_COVER_COPYRIGHT_QUAD .DOC_COVER_COPYRIGHT_QUAD R
. if !d $DOC_COVER_MISC_QUAD .DOC_COVER_MISC_QUAD L
.\" Defaults for printstyle TYPEWRITE
. if \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
. SS DEFAULT
. if \\n[#UNDERLINE_QUOTES]=1 .UNDERLINE_QUOTES
. if \\n[#UNDERLINE_QUOTES]=0 .UNDERLINE_QUOTES OFF
. if !\\n[#HDRFTR_PLAIN] \{\
. if !r #HDRFTR_RIGHT_CAPS .nr #HDRFTR_RIGHT_CAPS 1
. if \\n[#HDRFTR_RIGHT_CAPS]=0 \
. if !d $HDRFTR_RIGHT_SIZE_CHANGE .HDRFTR_RIGHT_SIZE +0
. \}
.\" +Doctype underlining (if NAMED)
. if !r #DOCTYPE_UNDERLINE .nr #DOCTYPE_UNDERLINE 1
.\" +Quotes and blockquotes
. if !r #Q_OFFSET_VALUE \
. if '\\*[$Q_OFFSET_VALUE]'' \
. QUOTE_INDENT \\n[#PP_INDENT]u+(\\n[#PP_INDENT]u/2u)
. if !d $Q_QUAD .QUOTE_LEFT
. if !d $BQUOTE_QUAD .BLOCKQUOTE_QUAD LEFT
. if !r #BQ_OFFSET_VALUE \
. if '\\*[$BQ_OFFSET_VALUE]'' \
. BLOCKQUOTE_INDENT \\n[#PP_INDENT]u+(\\n[#PP_INDENT]u/2u)
.\" +Epigraphs
. if !r #EPI_OFFSET_VALUE \
. if '\\*[$EPI_OFFSET_VALUE]'' .EPIGRAPH_INDENT 2
.\" +Linebreaks
. if !d $LINEBREAK_CHAR .LINEBREAK_CHAR * 3 2p
.\" +Footnotes
. if !d $FN_SIZE_CHANGE .FOOTNOTE_SIZE +0
. if !r #FN_RULE_LENGTH .FOOTNOTE_RULE_LENGTH 2i
.\" +Endnotes
. if !r #EN_PP_INDENT .ENDNOTE_PARA_INDENT \\n[#PP_INDENT]
. if !r #EN_STRING_CAPS .ENDNOTES_HEADER_CAPS
. if !r #EN_STRING_UNDERLINE .nr #EN_STRING_UNDERLINE 2
.\" +Footnotes
. if !r #FN_RULE_ADJ .FOOTNOTE_RULE_ADJ 6p
.\" +Slant stuff
. if !r #SLANT_MEANS_SLANT \{\
. ie \\n[#UNDERLINE_SLANT]=1 .UNDERLINE_SLANT
. el .UNDERLINE_SLANT OFF
. \}
.\" +Bibliography
. if !r #BIB_STRING_UNDERLINE .nr #BIB_STRING_UNDERLINE 2
. if !r #BIB_STRING_CAPS .BIBLIOGRAPHY_STRING_CAPS
. \}
.\" Defaults for printstyle TYPESET
. if \\n[#PRINT_STYLE]=2 \{\
. if !d $DOCHEADER_LEAD_ADJ .DOCHEADER_LEAD +0
.\" +Cover
. if !d $COVER_LEAD_ADJ .COVER_LEAD +0
. if !d $COVER_FAM .COVER_FAMILY \\*[$DOC_FAM]
.\" (title)
. if !d $COVER_TITLE_FAM \{\
. ie !d $COVER_FAM .COVER_TITLE_FAMILY \\*[$DOC_FAM]
. el .COVER_TITLE_FAMILY \\*[$COVER_FAM]
. \}
. if !d $COVER_TITLE_FT .COVER_TITLE_FONT B
. if !d $COVER_TITLE_SIZE_CHANGE .COVER_TITLE_SIZE +3.5
.\" (doctitle)
. if !d $COVER_DOCTITLE_FAM \{\
. ie !d $DOC_COVER_FAM .COVER_DOCTITLE_FAMILY \\*[$DOC_FAM]
. el .COVER_DOCTITLE_FAMILY \\*[$COVER_FAM]
. \}
. if !d $COVER_DOCTITLE_FT .COVER_DOCTITLE_FONT B
. if !d $COVER_DOCTITLE_SIZE_CHANGE .COVER_DOCTITLE_SIZE +3.5
.\" (covertitle)
. if !d $COVER_COVERTITLE_FAM \{\
. ie !d $COVER_FAM .COVER_COVERTITLE_FAMILY \\*[$DOC_FAM]
. el .COVER_COVERTITLE_FAMILY \\*[$COVER_FAM]
. \}
. if !d $COVER_COVERTITLE_FT .COVER_COVERTITLE_FONT B
. if !d $COVER_COVERTITLE_SIZE_CHANGE .COVER_COVERTITLE_SIZE +3.5
.\" (doc_covertitle)
. if !d $COVER_DOC_COVERTITLE_FAM \{\
. ie !d $COVER_FAM .COVER_DOC_COVERTITLE_FAMILY \\*[$DOC_FAM]
. el .COVER_DOC_COVERTITLE_FAMILY \\*[$COVER_FAM]
. \}
. if !d $COVER_DOC_COVERTITLE_FT .COVER_DOC_COVERTITLE_FONT B
. if !d $COVER_DOC_COVERTITLE_SIZE_CHANGE .COVER_DOC_COVERTITLE_SIZE +3.5
.\" (chapter)
. if !d $COVER_CHAPTER_FAM \{\
. ie !d $COVER_FAM .COVER_CHAPTER_FAMILY \\*[$DOC_FAM]
. el .COVER_CHAPTER_FAMILY \\*[$COVER_FAM]
. \}
. if !d $COVER_CHAPTER_FT .COVER_CHAPTER_FONT B
. if !d $COVER_CHAPTER_SIZE_CHANGE .COVER_CHAPTER_SIZE +3.5
.\" (chapter title)
. if !d $COVER_CHAPTER_TITLE_FAM \{\
. ie !d $COVER_FAM .COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM]
. el .COVER_CHAPTER_TITLE_FAMILY \\*[$COVER_FAM]
. \}
. if !d $COVER_CHAPTER_TITLE_FT .COVER_CHAPTER_TITLE_FONT BI
. if !d $COVER_CHAPTER_TITLE_SIZE_CHANGE .COVER_CHAPTER_TITLE_SIZE +4
.\" (subtitle)
. if !d $COVER_SUBTITLE_FAM \{\
. ie !d $COVER_FAM .COVER_SUBTITLE_FAMILY \\*[$DOC_FAM]
. el .COVER_SUBTITLE_FAMILY \\*[$COVER_FAM]
. \}
. if !d $COVER_SUBTITLE_FT .COVER_SUBTITLE_FONT R
. if !d $COVER_SUBTITLE_SIZE_CHANGE .COVER_SUBTITLE_SIZE +0
.\" (attribution and author[s])
. if !d $COVER_ATTRIBUTE_FAM \{\
. ie !d $COVER_FAM .COVER_ATTRIBUTE_FAMILY \\*[$DOC_FAM]
. el .COVER_ATTRIBUTE_FAMILY \\*[$COVER_FAM]
. \}
. if !d $COVER_ATTRIBUTE_FT .COVER_ATTRIBUTE_FONT I
. if !d $COVER_ATTRIBUTE_SIZE_CHANGE .COVER_ATTRIBUTE_SIZE +0
. if !d $COVER_AUTHOR_FAM \{\
. ie !d $COVER_FAM .COVER_AUTHOR_FAMILY \\*[$DOC_FAM]
. el .COVER_AUTHOR_FAMILY \\*[$COVER_FAM]
. \}
. if !d $COVER_AUTHOR_FT .COVER_AUTHOR_FONT I
. if !d $COVER_AUTHOR_SIZE_CHANGE .COVER_AUTHOR_SIZE +0
.\" (doctype if "named")
. if !d $COVER_DOCTYPE_FAM \{\
. ie !d $COVER_FAM .COVER_DOCTYPE_FAMILY \\*[$DOC_FAM]
. el .COVER_DOCTYPE_FAMILY \\*[$COVER_FAM]
. \}
. if !d $COVER_DOCTYPE_FT .COVER_DOCTYPE_FONT BI
. if !d $COVER_DOCTYPE_SIZE_CHANGE .COVER_DOCTYPE_SIZE +3
.\" (copyright)
. if !d $COVER_COPYRIGHT_FAM \{\
. ie !d $COVER_FAM .COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM]
. el .COVER_COPYRIGHT_FAMILY \\*[$COVER_FAM]
. \}
. if !d $COVER_COPYRIGHT_FT .COVER_COPYRIGHT_FONT R
. if !d $COVER_COPYRIGHT_SIZE_CHANGE .COVER_COPYRIGHT_SIZE -2
.\" (misc)
. if !d $COVER_MISC_FAM .COVER_MISC_FAMILY \\*[$DOC_FAM]
. if !d $COVER_MISC_FT .COVER_MISC_FONT R
. if !d $COVER_MISC_SIZE_CHANGE .COVER_MISC_SIZE -2
. if !r #COVER_MISC_LEAD .COVER_MISC_LEAD 14.5
.\" +Doc cover
. if !d $DOC_COVER_LEAD_ADJ .DOC_COVER_LEAD +0
. if !d $DOC_COVER_FAM .DOC_COVER_FAMILY \\*[$DOC_FAM]
.\" (title)
. if !d $DOC_COVER_TITLE_FAM \{\
. ie !d $DOC_COVER_FAM .DOC_COVER_TITLE_FAMILY \\*[$DOC_FAM]
. el .DOC_COVER_TITLE_FAMILY \\*[$DOC_COVER_FAM]
. \}
. if !d $DOC_COVER_TITLE_FT .DOC_COVER_TITLE_FONT B
. if !d $DOC_COVER_TITLE_SIZE_CHANGE .DOC_COVER_TITLE_SIZE +3.5
.\" (doctitle)
. if !d $DOC_COVER_DOCTITLE_FAM \{\
. ie !d $DOC_COVER_FAM .DOC_COVER_DOCTITLE_FAMILY \\*[$DOC_FAM]
. el .DOC_COVER_DOCTITLE_FAMILY \\*[$DOC_COVER_FAM]
. \}
. if !d $DOC_COVER_DOCTITLE_FT .DOC_COVER_DOCTITLE_FONT B
. if !d $DOC_COVER_DOCTITLE_SIZE_CHANGE .DOC_COVER_DOCTITLE_SIZE +3.5
.\" (covertitle)
. if !d $DOC_COVER_COVERTITLE_FAM \{\
. ie !d $COVER_FAM .DOC_COVER_COVERTITLE_FAMILY \\*[$DOC_FAM]
. el .DOC_COVER_COVERTITLE_FAMILY \\*[$COVER_FAM]
. \}
. if !d $DOC_COVER_COVERTITLE_FT .DOC_COVER_COVERTITLE_FONT B
. if !d $DOC_COVER_COVERTITLE_SIZE_CHANGE .DOC_COVER_COVERTITLE_SIZE +3.5
.\" (doc_covertitle)
. if !d $DOC_COVER_DOC_COVERTITLE_FAM \{\
. ie !d $COVER_FAM .DOC_COVER_DOC_COVERTITLE_FAMILY \\*[$DOC_FAM]
. el .DOC_COVER_DOC_COVERTITLE_FAMILY \\*[$COVER_FAM]
. \}
. if !d $DOC_COVER_DOC_COVERTITLE_FT .DOC_COVER_DOC_COVERTITLE_FONT B
. if !d $DOC_COVER_DOC_COVERTITLE_SIZE_CHANGE .DOC_COVER_DOC_COVERTITLE_SIZE +3.5
.\" (chapter)
. if !d $DOC_COVER_CHAPTER_FAM \{\
. ie !d $DOC_COVER_FAM .DOC_COVER_CHAPTER_FAMILY \\*[$DOC_FAM]
. el .DOC_COVER_CHAPTER_FAMILY \\*[$DOC_COVER_FAM]
. \}
. if !d $DOC_COVER_CHAPTER_FT .DOC_COVER_CHAPTER_FONT B
. if !d $DOC_COVER_CHAPTER_SIZE_CHANGE .DOC_COVER_CHAPTER_SIZE +3.5
.\" (chapter title)
. if !d $DOC_COVER_CHAPTER_TITLE_FAM \{\
. ie !d $DOC_COVER_FAM .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM]
. el .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_COVER_FAM]
. \}
. if !d $DOC_COVER_CHAPTER_TITLE_FT .DOC_COVER_CHAPTER_TITLE_FONT BI
. if !d $DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE .DOC_COVER_CHAPTER_TITLE_SIZE +4
.\" (subtitle)
. if !d $DOC_COVER_SUBTITLE_FAM \{\
. ie !d $DOC_COVER_FAM .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_FAM]
. el .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_COVER_FAM]
. \}
. if !d $DOC_COVER_SUBTITLE_FT .DOC_COVER_SUBTITLE_FONT R
. if !d $DOC_COVER_SUBTITLE_SIZE_CHANGE .DOC_COVER_SUBTITLE_SIZE +0
.\" (attribution and author[s])
. if !d $DOC_COVER_ATTRIBUTE_FAM \{\
. ie !d $DOC_COVER_FAM .DOC_COVER_ATTRIBUTE_FAMILY \\*[$DOC_FAM]
. el .DOC_COVER_ATTRIBUTE_FAMILY \\*[$DOC_COVER_FAM]
. \}
. if !d $DOC_COVER_ATTRIBUTE_FT .DOC_COVER_ATTRIBUTE_FONT I
. if !d $DOC_COVER_ATTRIBUTE_SIZE_CHANGE .DOC_COVER_ATTRIBUTE_SIZE +0
. if !d $DOC_COVER_AUTHOR_FAM \{\
. ie !d $DOC_COVER_FAM .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_FAM]
. el .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_COVER_FAM]
. \}
. if !d $DOC_COVER_AUTHOR_FT .DOC_COVER_AUTHOR_FONT I
. if !d $DOC_COVER_AUTHOR_SIZE_CHANGE .DOC_COVER_AUTHOR_SIZE +0
.\" (doctype if "named")
. if !d $DOC_COVER_DOCTYPE_FAM \{\
. ie !d $DOC_COVER_FAM .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_FAM]
. el .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_COVER_FAM]
. \}
. if !d $DOC_COVER_DOCTYPE_FT .DOC_COVER_DOCTYPE_FONT BI
. if !d $DOC_COVER_DOCTYPE_SIZE_CHANGE .DOC_COVER_DOCTYPE_SIZE +3
.\" (copyright)
. if !d $DOC_COVER_COPYRIGHT_FAM \{\
. ie !d $DOC_COVER_FAM .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM]
. el .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_COVER_FAM]
. \}
. if !d $DOC_COVER_COPYRIGHT_FT .DOC_COVER_COPYRIGHT_FONT R
. if !d $DOC_COVER_COPYRIGHT_SIZE_CHANGE .DOC_COVER_COPYRIGHT_SIZE -2
.\" (misc)
. if !d $DOC_COVER_MISC_FAM .DOC_COVER_MISC_FAMILY \\*[$DOC_FAM]
. if !d $DOC_COVER_MISC_FT .DOC_COVER_MISC_FONT R
. if !d $DOC_COVER_MISC_SIZE_CHANGE .DOC_COVER_MISC_SIZE -2
. if !r #DOC_COVER_MISC_LEAD .DOC_COVER_MISC_LEAD 14.5
.\" +Docheader
. if !d $DOCHEADER_FAM .DOCHEADER_FAMILY \\*[$DOC_FAM]
. if !d $TITLE_FAM \{\
. ie !d $DOCHEADER_FAM .TITLE_FAMILY \\*[$DOC_FAM]
. el .TITLE_FAMILY \\*[$DOCHEADER_FAM]
. \}
. if !d $TITLE_FT .TITLE_FONT B
.\" Title size change
. if !d $TITLE_SIZE_CHANGE \{\
. ie \\n[#DOC_TYPE]=2 .TITLE_SIZE +4
. el .TITLE_SIZE +3.5
. \}
. if !d $CHAPTER_FAM \{\
. ie !d $DOCHEADER_FAM .CHAPTER_FAMILY \\*[$DOC_FAM]
. el .CHAPTER_FAMILY \\*[$DOCHEADER_FAM]
. \}
. if !d $CHAPTER_FT .CHAPTER_FONT B
. if !d $CHAPTER_SIZE_CHANGE .CHAPTER_SIZE +4
. if !d $CHAPTER_TITLE_FAM \{\
. ie !d $DOCHEADER_FAM .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM]
. el .CHAPTER_TITLE_FAMILY \\*[$DOCHEADER_FAM]
. \}
. if !d $CHAPTER_TITLE_FT .CHAPTER_TITLE_FONT BI
. if !d $CHAPTER_TITLE_SIZE_CHANGE .CHAPTER_TITLE_SIZE +4
. if !d $SUBTITLE_FAM \{\
. ie !d $DOCHEADER_FAM .SUBTITLE_FAMILY \\*[$DOC_FAM]
. el .SUBTITLE_FAMILY \\*[$DOCHEADER_FAM]
. \}
. if !d $SUBTITLE_FT .SUBTITLE_FONT R
. if !d $SUBTITLE_SIZE_CHANGE .SUBTITLE_SIZE +0
. if !d $ATTRIBUTE_FAM \{\
. ie !d $DOCHEADER_FAM .ATTRIBUTE_FAMILY \\*[$DOC_FAM]
. el .ATTRIBUTE_FAMILY \\*[$DOCHEADER_FAM]
. \}
. if !d $ATTRIBUTE_FT .ATTRIBUTE_FONT I
. if !d $ATTRIBUTE_SIZE_CHANGE .ATTRIBUTE_SIZE +0
. if !d $AUTHOR_FAM \{\
. ie !d $DOCHEADER_FAM .AUTHOR_FAMILY \\*[$DOC_FAM]
. el .AUTHOR_FAMILY \\*[$DOCHEADER_FAM]
. \}
. if !d $AUTHOR_FT .AUTHOR_FONT I
. if !d $AUTHOR_SIZE_CHANGE .AUTHOR_SIZE +0
. if !d $DOCTYPE_FAM \{\
. ie !d $DOCHEADER_FAM .DOCTYPE_FAMILY \\*[$DOC_FAM]
. el .DOCTYPE_FAMILY \\*[$DOCHEADER_FAM]
. \}
. if !d $DOCTYPE_FT .DOCTYPE_FONT BI
. if !d $DOCTYPE_SIZE_CHANGE .DOCTYPE_SIZE +3
.\" +Headers and footers
. if !\\n[#HDRFTR_PLAIN] \{\
. if !d $HDRFTR_LEFT_FAM \
. HDRFTR_LEFT_FAMILY \\*[$DOC_FAM]
. if !d $HDRFTR_LEFT_FT \
. HDRFTR_LEFT_FONT R
. if \\n[#HDRFTR_LEFT_CAPS] \
. if !d $HDRFTR_LEFT_SIZE_CHANGE \
. HDRFTR_LEFT_SIZE -2
. if !d $HDRFTR_LEFT_SIZE_CHANGE \
. HDRFTR_LEFT_SIZE -.5
. if !d $HDRFTR_CENTER_FAM \
. HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
. if !d $HDRFTR_CENTER_FT .HDRFTR_CENTER_FONT I
. if \\n[#HDRFTR_CENTER_CAPS] \
. if !d $HDRFTR_CENTER_SIZE_CHANGE \
. HDRFTR_CENTER_SIZE -2
. if !d $HDRFTR_CENTER_SIZE_CHANGE \
. HDRFTR_CENTER_SIZE -.5
. if !d $HDRFTR_RIGHT_FAM \
. HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]
. if !d $HDRFTR_RIGHT_FT .HDRFTR_RIGHT_FONT R
. ie !r #HDRFTR_RIGHT_CAPS \{\
. nr #HDRFTR_RIGHT_CAPS 1
. if !d $HDRFTR_RIGHT_SIZE_CHANGE \
. HDRFTR_RIGHT_SIZE -2
. \}
. el \{\
. if \\n[#HDRFTR_RIGHT_CAPS]=0 \
. if !d $HDRFTR_RIGHT_SIZE_CHANGE \
. HDRFTR_RIGHT_SIZE -.5
. \}
. ie !\\n[#HDRFTR_RIGHT_SMALLCAPS] \{\
. if \\n[#HDRFTR_RIGHT_CAPS] \
. if !d $HDRFTR_RIGHT_SIZE_CHANGE \
. HDRFTR_RIGHT_SIZE -2
. \}
. el \{\
. nr #SKIP_CAPS_SMALLCAPS_WARNING 1
. if \\n[#HDRFTR_RIGHT_CAPS] .HDRFTR_RIGHT_CAPS OFF
. \}
. if !d $HDRFTR_RIGHT_SIZE_CHANGE .HDRFTR_RIGHT_SIZE -.5
. \}
.\" +Quotes
. if !d $QUOTE_FAM .QUOTE_FAMILY \\*[$DOC_FAM]
. if !d $QUOTE_FT .QUOTE_FONT I
. if !d $QUOTE_SIZE_CHANGE .QUOTE_SIZE +0
. if !r #Q_OFFSET_VALUE \
. if '\\*[$Q_OFFSET_VALUE]'' .QUOTE_INDENT 3
. if !d $Q_QUAD .QUOTE_LEFT
.\" +Blockquotes
.\" Note: the leading for quotes and blockquotes is set after .DEFAULTS in START
. if !d $BQUOTE_FAM .BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
. if !d $BQUOTE_FT .BLOCKQUOTE_FONT R
. if !d $BQUOTE_SIZE_CHANGE .BLOCKQUOTE_SIZE -1
. if !d $BQUOTE_QUAD .BLOCKQUOTE_QUAD LEFT
. if !r #BQ_OFFSET_VALUE \
. if '\\*[$BQ_OFFSET_VALUE]'' .BLOCKQUOTE_INDENT 3
.\" +Epigraphs
. if !d $EPI_FAM .EPIGRAPH_FAMILY \\*[$DOC_FAM]
. if !d $EPI_FT .EPIGRAPH_FONT R
. if !d $EPI_SIZE_CHANGE .EPIGRAPH_SIZE -1.5
. if !r #EPI_AUTOLEAD .EPIGRAPH_AUTOLEAD 2
. if !d $EPI_QUAD .EPIGRAPH_QUAD \\*[$DOC_QUAD]
. if !r #EPI_OFFSET_VALUE \
. if '\\*[$EPI_OFFSET_VALUE]'' .EPIGRAPH_INDENT 3
.\" +Linebreaks
. if !d $LINEBREAK_CHAR .LINEBREAK_CHAR * 3 3p
. if !d $LINEBREAK_COLOR .LINEBREAK_COLOR black
.\" +Footnotes
. if !r #FN_RULE_LENGTH .FOOTNOTE_RULE_LENGTH 4P
. if !r #FN_RULE_ADJ .FOOTNOTE_RULE_ADJ 3p
. if !d $FN_SIZE_CHANGE .FOOTNOTE_SIZE -2
. if !r #FN_AUTOLEAD .FOOTNOTE_AUTOLEAD 2
.\" +Endnotes
. if !r #EN_PS .ENDNOTE_PT_SIZE (\\n[#DOC_PT_SIZE]u)
. if !d $EN_STRING_FT .ENDNOTES_HEADER_FONT B
. if !d $EN_STRING_SIZE_CHANGE .ENDNOTES_HEADER_SIZE +3.5
. if !d $EN_TITLE_FT .ENDNOTE_TITLE_FONT B
. if !d $EN_TITLE_SIZE_CHANGE .ENDNOTE_TITLE_SIZE +0
. if !d $EN_NUMBER_FT .ENDNOTE_NUMBER_FONT B
. if !d $EN_LN_FT .ENDNOTE_LINENUMBER_FONT R
. if !d $EN_NUMBER_SIZE_CHANGE .ENDNOTE_NUMBER_SIZE +0
. if !d $EN_LN_SIZE_CHANGE .ENDNOTE_LINENUMBER_SIZE +0
. if !r #EN_PP_INDENT .ENDNOTE_PARA_INDENT 1.5m
. if !d $EN_SPACE .ENDNOTE_SPACING 0
.\" +Bibliography
. if !r #BIB_LIST .BIBLIOGRAPHY_TYPE PLAIN
. if !r #BIB_PS .BIBLIOGRAPHY_PT_SIZE (\\n[#DOC_PT_SIZE]u)
. if !d $BIB_STRING_FT .BIBLIOGRAPHY_STRING_FONT B
. if !d $BIB_STRING_SIZE_CHANGE .BIBLIOGRAPHY_STRING_SIZE +3.5
.\" +Table of contents
. if !d $TOC_FAM .TOC_FAMILY \\*[$DOC_FAM]
. if !r #TOC_PS .TOC_PT_SIZE (\\n[#DOC_PT_SIZE]u)
. if '\\*[$TOC_LEAD]'' .TOC_LEAD \\n[#DOC@LEAD]u ADJUST
. if !d $TOC_HEADER_FAM .TOC_HEADER_FAMILY \\*[$TOC_FAM]
. if !d $TOC_HEADER_SIZE_CHANGE .TOC_HEADER_SIZE +3.5
. if !d $TOC_HEADER_FT .TOC_HEADER_FONT B
. if !d $TOC_PN_FAM .TOC_PN_FAMILY \\*[$TOC_FAM]
. if !d $TOC_PN_FT .TOC_PN_FONT R
. if !d $TOC_PN_SIZE_CHANGE .TOC_PN_SIZE +0
. if !d $TOC_TITLE_FAM .TOC_TITLE_FAMILY \\*[$TOC_FAM]
. \}
.\" +Refer support
. if !r #EN_REF .nr #FN_REF 1
. if !d $REF_FN_INDENT \{\
. if \\n[#PRINT_STYLE]=1 .INDENT_REFS FOOTNOTE .5i
. if \\n[#PRINT_STYLE]=2 .INDENT_REFS FOOTNOTE 2m
. \}
. if !d $REF_EN_INDENT \{\
. if \\n[#PRINT_STYLE]=1 .INDENT_REFS ENDNOTE .5i
. if \\n[#PRINT_STYLE]=2 .INDENT_REFS ENDNOTE 2m
. \}
. if !d $REF_BIB_INDENT \{\
. if \\n[#PRINT_STYLE]=1 .INDENT_REFS BIBLIO .5i
. if \\n[#PRINT_STYLE]=2 .INDENT_REFS BIBLIO 2m
. \}
.\" Define strings for idem entries
. if \\n[#PRINT_STYLE]=1 .char \[idem] \[hy]\[hy]\[hy]
. if \\n[#PRINT_STYLE]=2 .char \[idem] \v'-.3m'\l'3m'\v'.3m'
.\" Adjust doc leading for PRINTSTYLE TYPESET
. if \\n[#PRINT_STYLE]=2 \
. if \\n[#ADJ_DOC_LEAD]=1 .DOC_LEAD_ADJUST
.\" This diversion is to get a value for #FN_AUTOLEAD
. di NULL
. if \\n[#AUTO_LEAD] \{\
. nr #RESTORE_AUTO_LEAD 1
. nr #SAVED_AUTOLEAD_VALUE \\n[#AUTOLEAD_VALUE]
. \}
. ev NULL
. if \\n[#PRINT_STYLE]=1 \{\
. ps \\*[$TYPEWRITER_PS]
. ie \\n[#SINGLE_SPACE]=1 .vs \\n[#ORIGINAL_DOC_LEAD]u
. el .vs \\n[#ORIGINAL_DOC_LEAD]u/2u
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. ps \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
. vs \\n[.ps]u+\\n[#FN_AUTOLEAD]u
. \}
. nr #FN_LEAD \\n[#LEAD]
. ev
. di
. if \\n[#RESTORE_AUTO_LEAD] \{\
. nr #AUTO_LEAD 1
. nr #AUTOLEAD_VALUE \\n[#SAVED_AUTOLEAD_VALUE]
. \}
. if !\\n[#SKIP_TRAPS] .TRAPS
. rr #SKIP_TRAPS
. if \\n[#REMOVE_ADJ] .DOC_LEAD \\n[#DOC_LEAD]u-\\n[#DOC_LEAD_ADJ]u
. if (\\n[#FOOTER_MARGIN]+\\n[.v]>=\\n[#B_MARGIN]) \{\
. tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin.
. tm1 " No footers or bottom-of-page page numbers will be printed.
. tm1 " Please reset B_MARGIN or FOOTER_MARGIN to allow enough space.
. tm1 " If no footers or bottom-of-page page numbers are required,
. tm1 " invoke .FOOTER_MARGIN 0 before .START
. nr #SKIP_FOOTER 1
. \}
.\" Endnote, bibliography and toc leading
. nr #OK_PROCESS_LEAD 1
. nr #RESTORE_DOC_LEAD \\n[.v]
. nr #RESTORE_B_MARGIN \\n[#B_MARGIN]
. if \\n[#PRINT_STYLE]=1 \{\
. ie \\n[#SINGLE_SPACE] \{\
. ENDNOTE_LEAD 12 ADJUST
. BIBLIOGRAPHY_LEAD 12 ADJUST
. \}
. el \{\
. ie \\n[#EN_SINGLESPACE] .ENDNOTE_LEAD 12 ADJUST
. el .ENDNOTE_LEAD 24 ADJUST
. ie \\n[#BIB_SINGLESPACE] .BIBLIOGRAPHY_LEAD 12 ADJUST
. el .BIBLIOGRAPHY_LEAD 24 ADJUST
. \}
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. ie !d $EN_LEAD .ENDNOTE_LEAD \\n[#UNADJUSTED_DOC_LEAD]u ADJUST
. el .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD]
. ie !d $BIB_LEAD .BIBLIOGRAPHY_LEAD \\n[#UNADJUSTED_DOC_LEAD]u ADJUST
. el .BIBLIOGRAPHY_LEAD \\*[$BIB_LEAD] \\*[$ADJUST_BIB_LEAD]
. ie !d $TOC_LEAD .TOC_LEAD \\n[#UNADJUSTED_DOC_LEAD]u \\*[$ADJUST_TOC_LEAD]
. el .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD]
. \}
. ie !d $BIB_SPACE .BIBLIOGRAPHY_SPACING 0
. el \{\
. if \\n[#DEFER_BIB_SPACING]=1 \{\
. BIBLIOGRAPHY_SPACING \\*[$BIB_SPACE]
. rr #DEFER_BIB_SPACING
. \}
. \}
. nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
. nr #B_MARGIN \\n[#RESTORE_B_MARGIN]
. vs \\n[#DOC_LEAD]u
. if !\\n[#PRINT_STYLE]=1 \{\
. if \\n[#RERUN_TRAPS] \{\
. TRAPS
. rr #RERUN_TRAPS
. \}
. \}
.\" Set default heading and toc-entry family if not done already
. nr #HD_LEVEL 0 1 \" loop step
. nr #LOOP 9 \" loop count
. while \\n+[#HD_LEVEL]<=\\n[#LOOP] \{\
. if '\\*[$HEAD_\\n[#HD_LEVEL]_FAM]'' \
. ds $HEAD_\\n[#HD_LEVEL]_FAM \\*[$DOC_FAM]
. if '\\*[$HEAD_\\n[#HD_LEVEL]_BASELINE_ADJ]'' \
. ds $HEAD_\\n[#HD_LEVEL]_BASELINE_ADJ \\n[.v]/10
. if '\\*[$TOC_HEAD_\\n[#HD_LEVEL]_FAM]'' \
. ds $TOC_HEAD_\\n[#HD_LEVEL]_FAM \\*[$TOC_FAM]
. \}
. if '\\*[$TOC_TITLE_FAM]'' .TOC_TITLE_FAMILY \\*[$DOC_FAM]
.\" TOC heading (single, non-pagenumbered line insertion)
. if !d $TOC_HEADING_FAM .ds $TOC_HEADING_FAM \\*[$DOC_FAM]
. if !d $TOC_HEADING_FT .ds $TOC_HEADING_FT R
. if !d $TOC_HEADING_SIZE .ds $TOC_HEADING_SIZE +0
. if !d $TOC_HEADING_COLOR .ds $TOC_HEADING_COLOR black
. if !d $TOC_HEADING_QUAD .ds $TOC_HEADING_QUAD L
. if !d $SPACE_ABOVE .ds $SPACE_ABOVE .75v
. if !d $SPACE_BENEATH .ds $SPACE_BENEATH .25v
.\" Re-run MNinit to capture strings and registers set in DEFAULTS.
. if !'\\*[$MN-arg1]'' \{\
. MNinit \
\\*[$MN-arg1] \\*[$MN-arg2] \
\\*[$MN-arg3] \\*[$MN-arg4] \
\\*[$MN-arg5] \\*[$MN-arg6] \
\\*[$MN-arg7] \\*[$MN-arg8] \
\\*[$MN-arg9]
. \}
. if \\n[#PRINT_STYLE]=1 .nr #IGNORE 1
. if \\n[#AUTO_LEAD] \{\
. rr #AUTO_LEAD
. rr #AUTOLEAD_VALUE
. \}
.END
\#
\# =================================================================
\#
\# Macros and aliases needed for doccover, cover, and docheader in
\# START.
\#
.MAC DOC_HEADER_QUAD END
. if '\\$0'DOC_HEADER_QUAD' .ds $CALLING_MACRO DOCHEADER
. if '\\$0'COVER_H_POS' .ds $CALLING_MACRO COVER
. if '\\$0'DOC_COVER_H_POS' .ds $CALLING_MACRO DOC_COVER
. ie !'\\*[$\\*[$CALLING_MACRO]_QUAD]'' \{\
. substring $\\*[$CALLING_MACRO]_QUAD 0 0
. if '\\*[$\\*[$CALLING_MACRO]_QUAD]'L' .LEFT
. if '\\*[$\\*[$CALLING_MACRO]_QUAD]'C' .CENTER
. if '\\*[$\\*[$CALLING_MACRO]_QUAD]'C' .RIGHT
. \}
. el .CENTER
.END
.
.ALIAS COVER_H_POS DOC_HEADER_QUAD
.ALIAS DOC_COVER_H_POS DOC_HEADER_QUAD
\#
.MAC DO_TITLE_OR_AUTHOR END
. ie '\\$0'DO_AUTHORS' .ds $TTL_AUTH AUTHOR
. el .ds $TTL_AUTH TITLE
. if '\\*[$\\*[$PRFX]\\*[$TTL_AUTH]_1]'' \{\
. if !'\\*[$\\*[$PRFX]DOC\\*[$TTL_AUTH]_1]'' \
. ds $\\*[$PRFX]\\*[$TTL_AUTH]_1 "\&"
. if !'\\*[$AUTHOR_1]'' .rm $PRFX
. \}
. if !'\\*[$\\*[$PRFX]\\*[$TTL_AUTH]_1]'' \{\
. if '\\$0'DO_SUBTITLE' \{\
. if '\\*[$PRFX]'\\*[DOC_]COVER_SUB' \{\
. ds $PRFX SUB
. nr #\\*[DOC_]COVER_SUB 1
. \}
. \}
. if !\\n[#PRINT_STYLE]=1 \{\
. if (\\n[#COVER]=1):(\\n[#DOC_COVER]=1) \
. if !'\\*[$PRFX]'SUB' \
. rn $PRFX $PRFX_SAVED
. fam \\*[$\\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]_FAM]
. ft \\*[$\\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]_FT]
. ps \
\\n[#DOC_PT_SIZE]u\\*[$\\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]_SIZE_CHANGE]
. if '\\*[$COVER_TYPE]'' .vs \\n[#DOCHEADER_LEAD]u
. if !'\\*[$\\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]_LEAD]'' \{\
. vs \\*[$\\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]_LEAD]
. if \\n[#DOCHEADER] .sp |\\n[#T_MARGIN]u-1v
. \}
. if \\n[#CHAPTER+TITLE]=1 .ALD \\n[.v]u/4u \" A little space before the chapter title
. if \\n[#\\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]_COLOR]=1 \
. COLOR \\*[$\\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]_COLOR]
. if \\n[#\\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]_CAPS]=1 .CAPS
. if \\n[#\\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]_SMALLCAPS]=1 .SMALLCAPS
. if (\\n[#COVER]=1):(\\n[#DOC_COVER]=1) \
. rn $PRFX_SAVED $PRFX
. if \\n[#\\*[DOC_]COVER_TITLE]=2 \
. ds $PRFX DOC
. \}
. if \\n[#\\*[DOC_]COVER_SUB] \{\
. rr #\\*[DOC_]COVER_SUB
. ds $PRFX \\*[DOC_]COVER_SUB
. ds $SAVED_COVER_TYPE \\*[$COVER_TYPE]
. rm $COVER_TYPE
. \}
. nr #ARG_NUM 0 1
. while \\n[#\\*[$PRFX]\\*[$TTL_AUTH]_NUM]>=\\n+[#ARG_NUM] \{\
. ie \\n[#\\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]_UNDERLINE] \{\
. ds $TITLE_TYPE \\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]
. ie \\n[#\\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]_UNDERLINE]=2 \{\
. ie !\\n[#PRINT_STYLE]=1 \
. UNDERSCORE2 \\*[$\\*[$PRFX]\\*[$TTL_AUTH]_UNDERLINE_GAP] \
\\*[$\\*[$PRFX]\\*[$TTL_AUTH]_RULE_GAP] \
"\\*[$\\*[$PRFX]\\*[$TTL_AUTH]_\\n[#ARG_NUM]]
. el .UNDERSCORE "\\*[$\\*[$PRFX]\\*[$TTL_AUTH]_\\n[#ARG_NUM]]
. \}
. el \{\
. ie !\\n[#PRINT_STYLE]=1 \
. UNDERSCORE "\\*[$\\*[$PRFX]\\*[$TTL_AUTH]_\\n[#ARG_NUM]]
. el .PRINT "\\*[$\\*[$PRFX]\\*[$TTL_AUTH]_\\n[#ARG_NUM]]
. \}
. \}
. el \{\
. PRINT "\\*[$\\*[$PRFX]\\*[$TTL_AUTH]_\\n[#ARG_NUM]]
. \}
. if \\n[#ARG_NUM]>1 .as PDF_BM " \"
. as PDF_BM \\*[$\\*[$PRFX]\\*[$TTL_AUTH]_\\n[#ARG_NUM]]
. \}
. rm $TITLE_TYPE
. if \\n[#PRINT_STYLE]=2 .vs
. if \\n[#\\*[$COVER_TYPE]\\*[$PRFX]\\*[$TTL_AUTH]_COLOR]=1 \
. gcolor
. SMALLCAPS off
. CAPS off
. \}
. if !'\\*[$SAVED_COVER_TYPE]'' \{\
. ds $COVER_TYPE \\*[$SAVED_COVER_TYPE]
. rm $SAVED_COVER_TYPE
. \}
.END
.
.ALIAS DO_TITLE DO_TITLE_OR_AUTHOR
.ALIAS DO_SUBTITLE DO_TITLE_OR_AUTHOR
.ALIAS DO_AUTHORS DO_TITLE_OR_AUTHOR
\#
.MAC DO_CHAPTER END
. fam \\*[$\\*[DOC_]COVER_CHAPTER_FAM]
. ft \\*[$\\*[DOC_]COVER_CHAPTER_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$\\*[DOC_]COVER_CHAPTER_SIZE_CHANGE]
. if \\n[#\\*[DOC_]COVER_CHAPTER_COLOR]=1 \
. COLOR \\*[$\\*[DOC_]COVER_CHAPTER_COLOR]
. if \\n[#\\*[DOC_]COVER_CHAPTER_CAPS]=1 .CAPS
. if \\n[#\\*[DOC_]COVER_CHAPTER_SMALLCAPS]=1 .SMALLCAPS
. ie \\n[#\\*[DOC_]COVER_CHAPTER_UNDERLINE] \{\
. ds $TITLE_TYPE \\*[$COVER_TYPE]CHAPTER
. ie \\n[#\\*[DOC_]COVER_CHAPTER_UNDERLINE]=2 \
. UNDERSCORE2 \\*[$\\*[DOC_]COVER_CHAPTER_UNDERLINE_GAP] \
\\*[$\\*[DOC_]COVER_CHAPTER_RULE_GAP] "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
. el .UNDERSCORE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
. \}
. el .PRINT "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
. gcolor
. SMALLCAPS off
. CAPS off
.END
.
.ALIAS DO_TITLE DO_TITLE_OR_AUTHOR
.ALIAS DO_SUBTITLE DO_TITLE_OR_AUTHOR
.ALIAS DO_AUTHORS DO_TITLE_OR_AUTHOR
\#
.MAC DO_CHAPTER END
. fam \\*[$\\*[DOC_]COVER_CHAPTER_FAM]
. ft \\*[$\\*[DOC_]COVER_CHAPTER_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$\\*[DOC_]COVER_CHAPTER_SIZE_CHANGE]
. if \\n[#\\*[DOC_]COVER_CHAPTER_COLOR]=1 \
. COLOR \\*[$\\*[DOC_]COVER_CHAPTER_COLOR]
. if \\n[#\\*[DOC_]COVER_CHAPTER_CAPS]=1 .CAPS
. if \\n[#\\*[DOC_]COVER_CHAPTER_SMALLCAPS]=1 .SMALLCAPS
. ie \\n[#\\*[DOC_]COVER_CHAPTER_UNDERLINE] \{\
. ds $TITLE_TYPE \\*[$COVER_TYPE]CHAPTER
. ie \\n[#\\*[DOC_]COVER_CHAPTER_UNDERLINE]=2 \
. UNDERSCORE2 \\*[$\\*[DOC_]COVER_CHAPTER_UNDERLINE_GAP] \
\\*[$\\*[DOC_]COVER_CHAPTER_RULE_GAP] "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
. el .UNDERSCORE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
. \}
. el .PRINT "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
. gcolor
. SMALLCAPS off
. CAPS off
.END
\#
\# Spacing adjustments for (doc)cover and docheader elements
\#
.MAC _SPACE END
. ds $\\$0R \\$1
.END
.
.ds SPACER_TYPE_1 SUBTITLE
.ds SPACER_TYPE_2 ATTRIBUTE
.ds SPACER_TYPE_3 AUTHOR
.ds SPACER_TYPE_4 CHAPTER_TITLE
.ds SPACER_TYPE_5 DOCTYPE
.
.nr #LOOP 0 1
.while \n+[#LOOP]<=5 \{\
. ALIAS \*[SPACER_TYPE_\n[#LOOP]]_SPACE _SPACE
. ALIAS COVER_\*[SPACER_TYPE_\n[#LOOP]]_SPACE _SPACE
. ALIAS DOC_COVER_\*[SPACER_TYPE_\n[#LOOP]]_SPACE _SPACE
.\}
\#
.MAC DEFAULT_DOCHEADER END
. nr #DOCHEADER 1
. DOC_HEADER_QUAD
. vs \\n[#DOCHEADER_LEAD]u
. if \\n[#PRINT_STYLE]=2 \
. if \\n[#DOCHEADER_COLOR]=1 \
. COLOR \\*[$DOCHEADER_COLOR]
. DO_TITLE
. rr #DOCHEADER
. if !'\\*[$SUBTITLE_1]'' \{\
. ds $PRFX SUB
. if !'\\*[$SUBTITLE_SPACER]'' .sp \\*[$SUBTITLE_SPACER]
. if \\n[#PRINT_STYLE]=2 \
. if \\n[#DOCHEADER_COLOR]=1 \
. COLOR \\*[$DOCHEADER_COLOR]
. DO_SUBTITLE
. rm $PRFX
. \}
. if !\\n[#NO_PRINT_AUTHOR] \{\
. if !'\\*[$AUTHOR_1]'' \{\
. ie \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
. ie \\n[#SINGLE_SPACE]=1 .vs \\n[#DOC_LEAD]u
. el .vs \\n[#DOC_LEAD]u/2u
. sp
. \}
. el .vs \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ]
. if d$ATTRIBUTE_STRING \{\
. FAMILY \\*[$ATTRIBUTE_FAM]
. FT \\*[$ATTRIBUTE_FT]
. ps \
\\n[#DOC_PT_SIZE]u\\*[$ATTRIBUTE_SIZE_CHANGE]
. if \\n[#DOCHEADER_COLOR]=1 \
. COLOR \\*[$DOCHEADER_COLOR]
. if \\n[#ATTRIBUTE_COLOR]=1 \
. COLOR \\*[$ATTRIBUTE_COLOR]
. if \\n[#ATTRIBUTE_CAPS]=1 .CAPS
. if !'\\*[$ATTRIBUTE_SPACER]'' \
. sp \\*[$ATTRIBUTE_SPACER]
. ie \\n[#ATTRIBUTE_UNDERLINE] \{\
. ds $TITLE_TYPE ATTRIBUTE
. ie \\n[#ATTRIBUTE_UNDERLINE]=2 \
. UNDERSCORE2 \\*[$ATTRIBUTE_UNDERLINE_GAP] \
\\*[$ATTRIBUTE_RULE_GAP] "\\*[$ATTRIBUTE_STRING]"
. el .UNDERSCORE "\\*[$ATTRIBUTE_STRING]"
. \}
. el .PRINT "\\*[$ATTRIBUTE_STRING]"
. if \\n[#ATTRIBUTE_COLOR]=1 .gcolor
. CAPS off
. \}
. if !'\\*[$AUTHOR_SPACER]'' .sp \\*[$AUTHOR_SPACER]
. if \\n[#DOCHEADER_COLOR]=1 \
. COLOR \\*[$DOCHEADER_COLOR]
. DO_AUTHORS
. \}
. \}
. FAMILY \\*[$DOC_FAM]
. FT R
.END
\#
.MAC DEFAULT_DOCHEADER_TYPEWRITE END
. CENTER
. TYPEWRITER
. if !\\n[#SINGLE_SPACE] \{\
. vs \\n[#DOC_LEAD]u/2u
. sp |\\n[#T_MARGIN]u-1v
. \}
. if !'\\*[$TITLE_1]'' \{\
. ie \\n[#SINGLE_SPACE] \
. vs \\n[#DOC_LEAD]u+(\\n[#DOC_LEAD]u/4u)
. el .vs (\\n[#DOC_LEAD]u/2u)+(\\n[#DOC_LEAD]u/4u)
. CAPS
. DO_TITLE
. CAPS OFF
. vs
. \}
. if !'\\*[$SUBTITLE]'' \{\
. ds $PRFX SUB
. sp
. DO_SUBTITLE
. rm $PRFX
. \}
. if !\\n[#NO_PRINT_AUTHOR] \{\
. if !'\\*[$AUTHOR_1]'' \{\
. sp
. if d$ATTRIBUTE_STRING .PRINT "\\*[$ATTRIBUTE_STRING]
. sp
. DO_AUTHORS
. \}
. \}
.END
\#
.MAC CHAPTER_DOCHEADER END
. DOC_HEADER_QUAD
. FAMILY \\*[$CHAPTER_FAM]
. FT \\*[$CHAPTER_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_SIZE_CHANGE]
. vs \\n[#DOCHEADER_LEAD]u
.\" Chapter title only
. ie '\\*[$CHAPTER]'' \{\
. if \\n[#PRINT_STYLE]=2 \
. if \\n[#DOCHEADER_COLOR]=1 \
. COLOR \\*[$DOCHEADER_COLOR]
. if !'\\*[$CHAPTER_TITLE_1]'' \{\
. ds $PRFX CHAPTER_
. nr #DOCHEADER 1
. DO_TITLE
. rr #DOCHEADER
. rm $PRFX
. \}
. \}
.\" Chapter string, possibly with a chapter title
. el \{\
. if \\n[#PRINT_STYLE]=2 \{\
. if \\n[#DOCHEADER_COLOR]=1 \
. COLOR \\*[$DOCHEADER_COLOR]
. if \\n[#CHAPTER_COLOR]=1 \
. COLOR \\*[$CHAPTER_COLOR]
. \}
. if \\n[#CHAPTER_CAPS]=1 .CAPS
. ie \\n[#CHAPTER_UNDERLINE] \{\
. ds $TITLE_TYPE CHAPTER
. ie \\n[#CHAPTER_UNDERLINE]=2 \
. UNDERSCORE2 \\*[$CHAPTER_UNDERLINE_GAP] \
\\*[$CHAPTER_RULE_GAP] "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
. el .UNDERSCORE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
. \}
. el .PRINT "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
. rm $TITLE_TYPE
. if \\n[#PRINT_STYLE]=2 \
. if \\n[#CHAPTER_COLOR]=1 .gcolor
. CAPS off
. if !'\\*[$CHAPTER_TITLE_1]'' \{\
. ds $PRFX CHAPTER_
. if \\n[#PRINT_STYLE]=2 \{\
. nr #CHAPTER+TITLE 1
. if \\n[#DOCHEADER_COLOR]=1 \
. COLOR \\*[$DOCHEADER_COLOR]
. \}
. if !'\\*[$CHAPTER_TITLE_SPACER]'' \
. sp \\*[$CHAPTER_TITLE_SPACER]
. DO_TITLE
. rm $PRFX
. rr #CHAPTER+TITLE
. \}
. \}
. FAMILY \\*[$DOC_FAM]
. FT R
.END
\#
.MAC CHAPTER_DOCHEADER_TYPEWRITE END
. CENTER
. TYPEWRITER
. if !\\n[#SINGLE_SPACE] \{\
. vs \\n[#DOC_LEAD]u/2u
. sp |\\n[#T_MARGIN]u-1v
. \}
. ie '\\*[$CHAPTER]'' \{\
. CAPS
. ie !'\\*[$CHAPTER_TITLE]'' \{\
. vs \\n[.v]u+(\\n[.v]u/3u)
. nr #ARG_NUM 0 1
. while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
. UNDERSCORE 3p "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
. \}
. vs
. \}
. el \{\
. CAPS
. UNDERSCORE 3p "\\*[$CHAPTER_STRING]"
. \}
. CAPS OFF
. RLD 1v
. \}
. el \{\
. CAPS
. UNDERSCORE 3p "\\*[$CHAPTER_STRING] \\*[$CHAPTER]
. CAPS OFF
. if !'\\*[$CHAPTER_TITLE]'' \{\
. sp
. nr #ARG_NUM 0 1
. while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
. PRINT "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
. \}
. \}
. sp -1
. \}
. vs \\n[#DOC_LEAD]u
. if \\n[#SINGLE_SPACE] .sp 2
.END
\#
.MAC NAMED_DOCHEADER END
. DEFAULT_DOCHEADER
. if !\\n[#NO_PRINT_DOCTYPE] \{\
. FAMILY \\*[$DOCTYPE_FAM]
. FT \\*[$DOCTYPE_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
. vs \\n[#DOCHEADER_LEAD]u
. ALD \\n[#DOCHEADER_LEAD]u
. if \\n[#DOCHEADER_COLOR]=1 \
. COLOR \\*[$DOCHEADER_COLOR]
. if \\n[#DOCTYPE_COLOR]=1 \
. COLOR \\*[$DOCTYPE_COLOR]
. if \\n[#DOCTYPE_CAPS]=1 .CAPS
. if !'\\*[$DOCTYPE_SPACER]'' .sp \\*[$DOCTYPE_SPACER]
. ie \\n[#DOCTYPE_UNDERLINE] \{\
. ds $TITLE_TYPE DOCTYPE
. ie \\n[#DOCTYPE_UNDERLINE]=2 \
. UNDERSCORE2 \\*[$DOCTYPE_UNDERLINE_GAP] \
\\*[$DOCTYPE_RULE_GAP] "\\*[$DOC_TYPE]
. el .UNDERSCORE "\\*[$DOC_TYPE]
. \}
. el .PRINT "\\*[$DOC_TYPE]
. gcolor
. CAPS off
. \}
. FAMILY \\*[$DOC_FAM]
. FT R
.END
\#
\# COVER PAGE
\# ----------
\# *Arguments:
\# TITLE | DOCTITLE | CHAPTER | CHAPTER_TITLE | CHAPTER+TITLE | COVERTITLE \
\# [ SUBTITLE AUTHOR DOCTYPE COPYRIGHT MISC BLANKPAGE PDF_OUTLINE_LABEL ]
\# *Function:
\# Toggles the number register for each cover page element
\# passed as an argument.
\# *Notes:
\# TITLE, DOCTITLE, CHAPTER, CHAPTER_TITLE or CHAPTER+TITLE must
\# be supplied. After that, users may enter as many or as few of
\# the arguments as they like. BLANKPAGE inserts a blank page
\# after the cover.
\#
\# If called as DOC_COVER, performs the same operations, but
\# applies everything to a doc cover.
\#
.MAC COVER END
. rm DOC_
. ie '\\$0'DOC_COVER' \{\
. nr #DOC_COVER 1
. ds DOC_ DOC_
. \}
. el .nr #COVER 1
. if \\n[#NUM_ARGS]=1 \{\
. if '\\$1'\\*[DOC_]COVERTEXT' \
. nr #\\*[DOC_]COVERTEXT_ONLY 1
. \}
. if \\n[#NUM_ARGS]=3 \{\
. if '\\$1'\\*[DOC_]COVERTEXT' \
. if '\\$2'PDF_OUTLINE_LABEL' \
. nr #\\*[DOC_]COVERTEXT_ONLY 1
. if '\\$1'PDF_OUTLINE_LABEL' \
. if '\\$2'\\*[DOC_]COVERTEXT' \
. nr #\\*[DOC_]COVERTEXT_ONLY 1
. \}
. nr #ARG_NUM 0 1
. nr #COVER_ITEM \\n[#NUM_ARGS] \"loop count
. while \\n+[#ARG_NUM]<=\\n[#COVER_ITEM] \{\
. if '\\$1'DOCTITLE' \{\
. nr #\\*[DOC_]COVER_TITLE 2
. shift
. \}
. if '\\$1'TITLE' \{\
. nr #\\*[DOC_]COVER_TITLE 1
. if \\n[#FROM_\\*[DOC_]COVERTITLE] \{\
. nr #\\*[DOC_]COVER_TITLE 7
. rr #FROM_\\*[DOC_]COVERTITLE
. \}
. shift
. \}
. if '\\$1'CHAPTER' \{\
. nr #\\*[DOC_]COVER_TITLE 3
. shift
. \}
. if '\\$1'CHAPTER_TITLE' \{\
. nr #\\*[DOC_]COVER_TITLE 4
. shift
. \}
. if '\\$1'CHAPTER+TITLE' \{\
. nr #\\*[DOC_]COVER_TITLE 5
. shift
. \}
. if '\\$1'COVERTITLE' \{\
. nr #COVERTITLE 1
. nr #\\*[DOC_]COVER_TITLE 6
. shift
. \}
. if '\\$1'DOC_COVERTITLE' \{\
. nr #DOC_COVERTITLE 1
. nr #\\*[DOC_]COVER_TITLE 7
. shift
. \}
. if '\\$1'SUBTITLE' \{\
. nr #\\*[DOC_]COVER_SUBTITLE 1
. shift
. \}
. if '\\$1'AUTHOR' \{\
. nr #\\*[DOC_]COVER_AUTHOR 1
. shift
. \}
. if '\\$1'EDITOR' \{\
. nr #\\*[DOC_]COVER_AUTHOR 1
. shift
. \}
. if '\\$1'DOCTYPE' \{\
. nr #\\*[DOC_]COVER_DOCTYPE 1
. shift
. \}
. if '\\$1'COPYRIGHT' \{\
. nr #\\*[DOC_]COVER_COPYRIGHT 1
. shift
. \}
. if '\\$1'MISC' \{\
. nr #\\*[DOC_]COVER_MISC 1
. shift
. \}
. if '\\$1'\\*[DOC_]COVERTEXT' \{\
. nr #\\*[DOC_]COVERTEXT 1
. shift
. \}
. if '\\$1'\\*[DOC_]COVER_IMAGE' \{\
. nr #\\*[DOC_]COVER_IMAGE 1
. shift
. \}
. if '\\$1'PDF_OUTLINE_LABEL' \{\
. shift
. ds $PDF_\\*[DOC_]COVER_LABEL \\$1
. shift
. \}
. if '\\$1'BLANKPAGE' \{\
. nr #\\*[DOC_]COVER_BLANKPAGE 1
. shift
. \}
. \}
. if '\\$0'DOC_COVER' .rm DOC_
.END
\#
\# COVER TITLE
\# -----------
\# *Arguments:
\# <covertitle>
\# *Function:
\# Stores cover title in string(s) for output on cover pages.
\#
.MAC COVERTITLE END
. rm DOC_
. if '\\$0'DOC_COVERTITLE' \
. ds DOC_ DOC_
. nr #FROM_\\*[DOC_]COVERTITLE 1
. ie \\n[#NUM_ARGS]=0 \{\
. nr argc 0 1
. while \\n+[argc]<=3 \{\
. if \\n[#\\*[DOC_]COVER_TITLE_NUM] \{\
. nr #ITEM 0 1
. while \\n[#\\*[DOC_]COVERTITLE_NUM]>\\n[#ITEM] \{\
. rm $\\*[DOC_]COVERTITLE_\\n+[#ITEM]
. \}
. rr #\\*[DOC_]COVERTITLE_NUM
. rm $\\*[DOC_]COVERTITLE
. \}
. \}
. \}
. el \{\
. nr #\\*[DOC_]COVERTITLE_NUM 0 1
. while \\n[#NUM_ARGS]>\\n[#\\*[DOC_]COVERTITLE_NUM] \{\
. ds \
$\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM] \\$\\n[#\\*[DOC_]COVERTITLE_NUM]
. nr #\\*[DOC_]COVERTITLE_NUM \\n[#\\*[DOC_]COVERTITLE_NUM]
. \}
. ds $\\*[DOC_]COVERTITLE \\$*
. \}
.END
\#
.MAC COVER_ATTRIBUTE_STRING END
. if '\\$0'DOC_COVER_ATTRIBUTE_STRING' \
. ds DOC_ DOC_
. ds $\\*[DOC_]COVER_ATTRIBUTE_STRING \\$1
. rm DOC_
.END
.
.ALIAS DOC_COVER_ATTRIBUTE_STRING COVER_ATTRIBUTE_STRING
\#
\# COVER TEXT
\# ----------
\# *Arguments:
\# [ START <vertical pos> ] | <anything>
\# *Function:
\# With no arg, begins a diversion holding the cover text for
\# output on the cover page. With START <pos>, sets a vertical
\# starting position relative to the top edge of the page. With
\# any other arg, ends the diversion.
\# *Notes:
\# Aliased as DOC_COVERTEXT.
\#
\# If no other items assigned to cover pages, starts 1/3 of the
\# way down the cover page unless START pos is given, otherwise
\# starts underneath the last of title, subtitle, author(s) or
\# doctype, preceded by a blank line.
\#
\# Does not persist.
\#
.MAC COVERTEXT END
. rm DOC_
. if '\\$0'DOC_COVERTEXT' .ds DOC_ DOC_
. if '\\$1'START' \{\
. shift
. nr #\\*[DOC_]COVERTEXT_START_POS (u;\\$1)
. shift
. \}
. ie '\\$1'' \{\
. nr #COVERTEXT_PP 1
. di \\*[DOC_]COVER_TEXT
. ev COVER_TEXT
. evc 0
\!. if \\\\n[#\\*[DOC_]COVERTEXT_ONLY] \
. sp |\\\\n[#T_MARGIN]u-\\\\n[#DOC_LEAD]u
\!. ie !\\n[#\\*[DOC_]COVERTEXT_START_POS] \{\
\!. sp |\\n[.p]u/3u-1v
\!. \}
\!. el \{\
\!. vs 0
\!. sp |0i
\!. vs \\\\n[#DOC_LEAD]u+\\\\*[$\\*[DOC_]COVER_LEAD_ADJ]
\!. sp |\\n[#\\*[DOC_]COVERTEXT_START_POS]u-1
\!. \}
\!. vpt
. \}
. el \{\
. br
\!. vpt 0
. ev
. di
. rm $FONT
. rr #COVERTEXT_PP
. IQ CLEAR
. \}
. rm DOC_
.END
.
.ALIAS DOC_COVERTEXT COVERTEXT
\#
\# COVER IMAGE
\# -----------
\#*Arguments:
\# <image file> <width> <height> [ -L|-C|-R|-I <ind> Y-pos [ X-pos ] ]
\#*Function:
\# Places an image on doccovers and covers.
\#*Notes:
\# Aliased as DOC_COVER_IMAGE.
\#
\# <width> and <height> are required. With no further args, images
\# are set at 0,0 by default so that full page images fill the entire
\# printer sheet.
\#
\# Positioning args are the same as PDF_IMAGE. -L, -R, -C and -I <ind>
\# observe the left and right margins.
\#
\# Y-pos is required for all but full page images; without it, images
\# are flush with the top of the page. X-pos is only needed if the
\# user prefers to give absolute X,Y positioning.
\#
\# Note that Y-pos comes before X-pos in the args.
\#
.MAC COVER_IMAGE END
. if '\\$0'DOC_COVER_IMAGE' .ds DOC_ DOC_
. ds \\*[DOC_]COVER_IMG_FILE \\$1
. nr \\*[DOC_]COVER_IMG_W (z;\\$2)
. nr \\*[DOC_]COVER_IMG_H (z;\\$3)
. if !'\\$4'' \{\
. ie !\B'\\$4' \{\
. if '\\$4'-L' .nr \\*[DOC_]COVER_IMG_IND \
\\n[#L_MARGIN]u
. if '\\$4'-C' .nr \\*[DOC_]COVER_IMG_IND \
\\n[#PAGE_WIDTH]u-\\n[\\*[DOC_]COVER_IMG_W]u/2
. if '\\$4'-R' .nr \\*[DOC_]COVER_IMG_IND \
\\n[#L_MARGIN]+\\n[.l]u-\\n[\\*[DOC_]COVER_IMG_W]u
. if '\\$4'-I' \{\
. nr \\*[DOC_]COVER_IMG_IND \\n[#L_MARGIN]+\\$5
. if !'\\$6'' .nr \\*[DOC_]COVER_IMG_Y (u;\\$6)
. shift \\n[#NUM_ARGS]
. \}
. if \B'\\$5' .nr \\*[DOC_]COVER_IMG_Y (u;\\$5)
. \}
. el \{\
. nr \\*[DOC_]COVER_IMG_Y (u;\\$4)
. if \B'\\$5' .nr \\*[DOC_]COVER_IMG_X (u;\\$5)
. \}
. \}
. rm DOC_
.END
.
.ALIAS DOC_COVER_IMAGE COVER_IMAGE
\#
.MAC DO_COVER_IMAGE END
. ll \\n[#PAGE_WIDTH]u
. po 0
. vs 0
. sp |0i
. if \\n[\\*[DOC_]COVER_IMG_Y] .sp \\n[\\*[DOC_]COVER_IMG_Y]u
. if \\n[\\*[DOC_]COVER_IMG_X] .in \\n[\\*[DOC_]COVER_IMG_X]u
. if \\n[\\*[DOC_]COVER_IMG_IND] .in \\n[\\*[DOC_]COVER_IMG_IND]u
. if \\n[.u]=1 .nf
. nop \X'pdf: pdfpic \\*[\\*[DOC_]COVER_IMG_FILE] -L \
\\n[\\*[DOC_]COVER_IMG_W]z \\n[\\*[DOC_]COVER_IMG_H]z'
. in
. vs
. po
. ll
.END
.
.ALIAS DO_DOC_COVER_IMAGE DO_COVER_IMAGE
\#
\# COVER PAGE LEADING
\# ------------------
\# *Arguments:
\# <+|- amount by which to in/decrease leading of cover/doc cover>
\# *Function:
\# Stores user supplied lead in/decrease in string $COVER_LEAD_ADJ
\# or $DOC_COVER_LEAD_ADJ, depending on whether the macro was called
\# with an alias (DOC_COVER_LEAD).
\# *Notes:
\# A unit of measure must be supplied. Decimal fractions OK.
\# Default is +0, i.e. same as DOC_LEAD.
\#
.MAC COVER_LEAD END
. ie '\\$0'DOC_COVER_LEAD' .ds $DOC_COVER_LEAD_ADJ \\$1
. el .ds $COVER_LEAD_ADJ \\$1
.END
\#
\# MISC_AUTOLEAD functionality has been removed. Leading for MISCs
\# is now entered as an absolute value. The macro emits a warning.
\#
.MAC MISC_AUTOLEAD END
. ds replacement \\$0
. substring replacement 0 -9
. ds replacement \\*[replacement]LEAD
. ds cover-type \\$0
. substring cover-type 0 2
. ie '\\*[cover-type]'COV' .ds cover-type cover
. el .ds cover-type doc-cover
. tm1 "[mom]: \\$0 at line \\n[.c] of '\\n[.F]' is no longer valid.
. tm1 " Leading of \\*[cover-type] MISC items is now set with \\*[replacement], which
. tm1 " takes an absolute leading value. Please update your document.
. ab [mom]: Aborting.
.END
.
.ALIAS DOC_COVER_MISC_AUTOLEAD MISC_AUTOLEAD
.ALIAS COVER_MISC_AUTOLEAD MISC_AUTOLEAD
\#
\# COVER PAGE START POSITION
\# -------------------------
\# *Arguments:
\# <distance from page top at which to start cover/doc cover>
\# *Function:
\# Stores user supplied lead in/decrease in #COVER_START_POS
\# or #DOC_COVER_START_POS, depending on whether the macro was
\# called by an alias (DOC_COVER_ADVANCE).
\# *Notes:
\# A unit of measure must be supplied. Decimal fractions OK.
\# If user doesn't invoke this macro, the default starting
\# position for both covers and doc covers is 1/3 of the way
\# down the page (setup in DO_COVER).
\#
.MAC COVER_ADVANCE END
. ds COVER_TYPE \\$0
. substring COVER_TYPE 0 2
. ie 'COVER_TYPE'DOC' .nr #DOC_COVER_START_POS (\\$1)
. el .nr #COVER_START_POS (\\$1)
.END
.
.ALIAS DOC_COVER_ADVANCE COVER_ADVANCE
.ALIAS DOC_COVER_START_POS COVER_ADVANCE
.ALIAS COVER_ADVANCE COVER_ADVANCE
.ALIAS COVER_START_POS COVER_ADVANCE
\#
\# COVERS - WHETHER TO PRINT
\# -------------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Creates or removes registers #COVERS and #COVERS_OFF, checked for
\# in DEFAULTS (in START) prior to printing
\#
.MAC COVERS END
. ie '\\$0'DOC_COVERS' \{\
. ie '\\$1'' \{\
. rr #DOC_COVERS_OFF
. nr #DOC_COVERS 1
. \}
. el \{\
. rr #DOC_COVERS
. nr #DOC_COVERS_OFF 1
. \}
. \}
. el \{\
. ie '\\$1'' \{\
. rr #COVERS_OFF
. nr #COVERS 1
. \}
. el \{\
. rr #COVERS
. nr #COVERS_OFF 1
. \}
. \}
.END
\#
\# COVER_COUNTS_PAGES
\# ------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Creates or removes registers #COVERS_COUNT or #DOCCOVERS_COUNT,
\# used in END_COVER to determine whether to increment the page
\# number silently when doc covers or covers are output.
\#
.MAC COVER_COUNTS_PAGES END
. if '\\$0'DOC_COVER_COUNTS_PAGES' \{\
. ie '\\$1'' .nr #DOCCOVERS_COUNT 1
. el .rr #DOCCOVERS_COUNT
. return
. \}
. if '\\$0'COVER_COUNTS_PAGES' \{\
. ie '\\$1'' .nr #COVERS_COUNT 1
. el .rr #COVERS_COUNT
. return
. \}
.END
\#
.MAC DO_COVER END
. nr #DOING_COVER 1
. ev COVER
. evc 0
. vpt 0
. if \\n[#PAGINATE]=1 \{\
. nr #PAGINATION_WAS_ON 1
. rr #PAGINATE
. \}
. if \\n[#HEADERS_ON]=1 \{\
. nr #HEADERS_WERE_ON 1
. HEADERS OFF
. \}
. if \\n[#FOOTERS_ON]=1 \{\
. nr #FOOTERS_WERE_ON 1
. FOOTERS OFF
. \}
. if \\n[#COLUMNS]=1 \{\
. nr #COLUMNS_WERE_ON 1
. rr #COLUMNS
. \}
. ds PDF_BM
. ie '\\$0'DO_DOC_COVER' \{\
. ds DOC_ DOC_
. nr #DOC_COVER_DONE 1
. if '\\*[$PDF_DOC_COVER_LABEL]'' \
. ds $PDF_DOC_COVER_LABEL Cover:
. \}
. el \
. if '\\*[$PDF_COVER_LABEL]'' \
. ds $PDF_COVER_LABEL Title Page:
. ds $COVER_TYPE \\*[DOC_]COVER_
. if !r#\\*[DOC_]COVER_START_POS \
. nr #\\*[DOC_]COVER_START_POS \\n[#PAGE_LENGTH]/3
. if \\n[#PRINT_STYLE]=1 \
. if !\\n[#SINGLE_SPACE]=1 .vs \\n[#DOC_LEAD]u/2u
. if \\n[#PRINT_STYLE]=2 \{\
. vs \\n[#DOC_LEAD]u\\*[$\\*[DOC_]COVER_LEAD_ADJ]
. nr #\\*[DOC_]COVER_LEAD \\n[.v]
. \}
. if \\n[.ns] .rs
. if '\\$0'DO_COVER' \{\
. if \\n[TOC.RELOCATE]==5 \
. if !rTOC_BH .TOC_BEFORE_HERE
. \}
. if '\\$0'DO_DOC_COVER' \{\
. if \\n[TOC.RELOCATE]==3 \
. if !rTOC_BH .TOC_BEFORE_HERE
. \}
. RV_HARD_SET_MARGINS
.\" Cover image
. if \\n[#\\*[DOC_]COVER_IMAGE]=1 \{\
. DO_\\*[DOC_]COVER_IMAGE
. rr #\\*[DOC_]COVER_IMAGE
. \}
.\" Start cover
. sp |\\n[#\\*[DOC_]COVER_START_POS]u-1v
. if !\\n[#PRINT_STYLE]=1 \
. if \\n[#\\*[DOC_]COVER_COLOR]=1 \
. COLOR \\*[$\\*[DOC_]COVER_COLOR]
. \\*[DOC_]COVER_H_POS
. if (\\n[#\\*[DOC_]COVER_TITLE]=1):(\\n[#\\*[DOC_]COVER_TITLE]=2) .ds DOC DOC
. fam \\*[$\\*[DOC_]COVER_\\*[DOC]TITLE_FAM]
. ft \\*[$\\*[DOC_]COVER_\\*[DOC]TITLE_FT]
. ps \\*[$\\*[DOC_]COVER_\\*[DOC]TITLE_SIZE_CHANGE]
. ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
. el .vs \\n[#\\*[DOC_]COVER_LEAD]u
. nr PDFHREF.VIEW.LEADING \\n[PDFHREF.VIEW.LEADING.C]
.\" Title and/or doctitle
. if (\\n[#\\*[DOC_]COVER_TITLE]=1):(\\n[#\\*[DOC_]COVER_TITLE]=2) \{\
. ie \\n[#PRINT_STYLE]=1 \{\
. vs \\n[.v]u*2u
. sp -1.5
. CAPS
. nr #ARG_NUM 0 1
. while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
. UNDERSCORE "\\*[$TITLE_\\n[#ARG_NUM]]"
. if \\n[#ARG_NUM]>1 .as PDF_BM " \"
. as PDF_BM \\*[$TITLE_\\n[#ARG_NUM]]
. \}
. CAPS OFF
. vs
. \}
. el \{\
. DO_TITLE
. rm $PRFX
. \}
. PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
. \}
.\" Chapter
. if \\n[#\\*[DOC_]COVER_TITLE]=3 \{\
. ie \\n[#PRINT_STYLE]=1 \{\
. CAPS
. UNDERSCORE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]
. CAPS OFF
. \}
. el .DO_CHAPTER
. PDF_BOOKMARK 1 \
\\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[$CHAPTER_STRING] \\*[$CHAPTER]
. if \\n[#\\*[DOC_]COVER_CHAPTER_CAPS]=1 .CAPS off
. \}
.\" Chapter title
. if \\n[#\\*[DOC_]COVER_TITLE]=4 \{\
. ie \\n[#PRINT_STYLE]=1 \{\
. CAPS
. nr #ARG_NUM 0 1
. vs \\n[.v]u*2u
. sp -1.5
. while \\n[#CHAPTER_TITLE_NUM]>=\\n[#ARG_NUM] \{\
. UNDERSCORE "\\*[$CHAPTER_TITLE_\\n+[#ARG_NUM]]"
. if \\n[#ARG_NUM]>1 .as PDF_BM " \"
. as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
. \}
. CAPS OFF
. vs
. \}
. el \{\
. ds $PRFX CHAPTER_
. DO_TITLE
. rm $PRFX
. \}
. PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
. \}
.\" Chapter + chapter title
. if \\n[#\\*[DOC_]COVER_TITLE]=5 \{\
. ie \\n[#PRINT_STYLE]=1 \{\
. CAPS
. UNDERSCORE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]
. CAPS OFF
. \}
. el .DO_CHAPTER
. if !'\\*[$CHAPTER_TITLE_1]'' \{\
. ie \\n[#PRINT_STYLE]=1 \{\
. ie \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u/2u
. el .vs \\n[#DOC_LEAD]u
. sp
. nr #ARG_NUM 0 1
. while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
. PRINT "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
. if \\n[#ARG_NUM]>1 .as PDF_BM " \"
. as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
. \}
. if \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u
. \}
. el \{\
. ds $PRFX CHAPTER_
. if \\n[#PRINT_STYLE]=2 .nr #CHAPTER+TITLE 1
. if !'\\*[$\\*[DOC_]COVER_CHAPTER_TITLE_SPACER]'' \
. sp \\*[$\\*[DOC_]COVER_CHAPTER_TITLE_SPACER]
. DO_TITLE
. rr #CHAPTER+TITLE
. rm $PRFX
. \}
. \}
. PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
. \}
.\" (Doc)covertitle
.\" Titles to (doc)covers that are entered with
.\" .TITLE DOC_COVER title
.\" and included in (DOC)COVER with TITLE get treated as
.\" (DOC_)COVERTITLEs, so we define the appropriate strings and
.\" registers from their (DOC_)COVER_TITLE equivalents.
.\"
. if (\\n[#\\*[DOC_]COVER_TITLE]=6):(\\n[#\\*[DOC_]COVER_TITLE]=7) \{\
. ds $\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_FAM \
\\*[$\\*[DOC_]COVER_TITLE_FAM]
. ds $\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_FT \
\\*[$\\*[DOC_]COVER_TITLE_FT]
. ds $\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_COLOR \
\\*[$\\*[DOC_]COVER_TITLE_COLOR]
. nr #\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_COLOR \
\\n[#\\*[DOC_]COVER_TITLE_COLOR]
. nr #\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_CAPS \
\\n[#\\*[DOC_]COVER_TITLE_CAPS]
. nr #\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_SMALLCAPS \
\\n[#\\*[DOC_]COVER_TITLE_SMALLCAPS]
. ds $\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_LEAD \
\\*[$\\*[DOC_]COVER_TITLE_LEAD]
. ds $\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_SIZE_CHANGE \
\\*[$\\*[DOC_]COVER_TITLE_SIZE_CHANGE]
. nr #\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_UNDERLINE \
\\n[#\\*[DOC_]COVER_TITLE_UNDERLINE]
. nr #\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_UNDERLINE_WEIGHT \
\\n[#\\*[DOC_]COVER_TITLE_UNDERLINE_WEIGHT]
. nr #\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_UNDERLINE_WEIGHT_ADJ \
\\n[#\\*[DOC_]COVER_TITLE_UNDERLINE_WEIGHT_ADJ]
. ds $\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_UNDERLINE_GAP \
\\*[$\\*[DOC_]COVER_TITLE_UNDERLINE_GAP]
. ds $\\*[DOC_]COVER_\\*[DOC_]COVERTITLE_RULE_GAP \
\\*[$\\*[DOC_]COVER_TITLE_RULE_GAP]
. ie \\n[#PRINT_STYLE]=1 \{\
. CAPS
. vs \\n[.v]u*2u
. nr #ARG_NUM 0 1
. while \\n[#\\*[DOC_]COVERTITLE_NUM]>=\\n+[#ARG_NUM] \{\
. UNDERSCORE "\\*[$\\*[DOC_]COVERTITLE_\\n[#ARG_NUM]]"
. if \\n[#ARG_NUM]>1 .as PDF_BM " \"
. as PDF_BM \\*[$\\*[DOC_]COVERTITLE_\\n[#ARG_NUM]]
. \}
. vs
. CAPS OFF
. \}
. el \{\
. ds $PRFX \\*[DOC_]COVER
. DO_TITLE
. rm $PRFX
. \}
. PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
. \}
. ie !'\\*[DOC_]'' \{\
. if !\\n[#DOC_COVER_TITLE] \
. if '\\*[$PDF_\\*[DOC_]COVER_LABEL]'' \
. PDF_BOOKMARK 1 Cover page
. \}
. el \{\
. if !\\n[#COVER_TITLE] \
. if '\\*[$PDF_\\*[DOC_]COVER_LABEL]'' \
. PDF_BOOKMARK 1 Title page
. \}
. rr #\\*[DOC_]COVER_TITLE
.\" Subtitle
. if \\n[#\\*[DOC_]COVER_SUBTITLE]=1 \{\
. ie \\n[#PRINT_STYLE]=1 \{\
. if !'\\*[$\\*[DOC_]COVER_SUBTITLE_1]'' \
. ds $PRFX \\*[DOC_]COVER_
. sp 2
. nr #ARG_NUM 0 1
. while \\n[#\\*[$PRFX]SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
. PRINT "\\*[$\\*[$PRFX]SUBTITLE_\\n[#ARG_NUM]]"
. \}
. rm $PRFX
. \}
. el \{\
. ie !'\\*[$\\*[DOC_]COVER_SUBTITLE_1]'' .ds $PRFX \\*[DOC_]COVER_SUB
. el .ds $PRFX SUB
. if !'\\*[$\\*[DOC_]COVER_SUBTITLE_SPACER]'' \
. sp \\*[$\\*[DOC_]COVER_SUBTITLE_SPACER]
. DO_SUBTITLE
. rm $PRFX
. \}
. \}
. if \\n[#PRINT_STYLE]=1 \
. if !r#\\*[DOC_]COVER_SUBTITLE .sp
.\" Author (plus attribution)
. if \\n[#\\*[DOC_]COVER_AUTHOR]=1 \{\
. ie \\n[#PRINT_STYLE]=1 \
. sp
. el \{\
. ie !'\\*[$\\*[DOC_]COVER_AUTHOR_LEAD]'' \
. vs \\*[$\\*[DOC_]COVER_AUTHOR_LEAD]
. el .vs \\n[#\\*[DOC_]COVER_LEAD]u
. \}
. if '\\*[$\\*[DOC_]COVER_ATTRIBUTE_STRING]'' \
. ds $\\*[DOC_]COVER_ATTRIBUTE_STRING \
\\*[$ATTRIBUTE_STRING]
. ie !\\n[#PRINT_STYLE]=1 \{\
. fam \\*[$\\*[DOC_]COVER_ATTRIBUTE_FAM]
. ft \\*[$\\*[DOC_]COVER_ATTRIBUTE_FT]
. ps \
\\n[#DOC_PT_SIZE]u\\*[$\\*[DOC_]COVER_ATTRIBUTE_SIZE_CHANGE]
. if \\n[#\\*[DOC_]COVER_ATTRIBUTE_COLOR]=1 \
. COLOR \\*[$\\*[DOC_]COVER_ATTRIBUTE_COLOR]
. if \\n[#\\*[DOC_]COVER_ATTRIBUTE_CAPS]=1 .CAPS
. if \\n[#\\*[DOC_]COVER_ATTRIBUTE_SMALLCAPS]=1 .SMALLCAPS
. if !'\\*[$\\*[DOC_]COVER_ATTRIBUTE_SPACER]'' \
. sp \\*[$\\*[DOC_]COVER_ATTRIBUTE_SPACER]
. ie \\n[#\\*[DOC_]COVER_ATTRIBUTE_UNDERLINE] \{\
. ds $TITLE_TYPE \\*[DOC_]COVER_ATTRIBUTE
. ie \\n[#\\*[DOC_]COVER_ATTRIBUTE_UNDERLINE]=2 \
. UNDERSCORE2 \\*[$\\*[DOC_]COVER_ATTRIBUTE_UNDERLINE_GAP] \
\\*[$\\*[DOC_]COVER_ATTRIBUTE_RULE_GAP] "\\*[$\\*[DOC_]COVER_ATTRIBUTE_STRING]"
. el .UNDERSCORE \\*[$\\*[DOC_]COVER_ATTRIBUTE_STRING]
. \}
. el .PRINT "\\*[$\\*[DOC_]COVER_ATTRIBUTE_STRING]"
. SMALLCAPS off
. CAPS off
. if \\n[#\\*[DOC_]COVER_ATTRIBUTE_COLOR]=1 \
. gcolor
. \}
. el \
. PRINT "\\*[$\\*[DOC_]COVER_ATTRIBUTE_STRING]"
. ie \\n[#PRINT_STYLE]=1 .sp
. el \{\
. if !'\\*[$\\*[DOC_]COVER_AUTHOR_SPACER]'' \
. sp \\*[$\\*[DOC_]COVER_AUTHOR_SPACER]
. \}
. if '\\$0'DO_COVER' \
. ds $PRFX COVER_
. if '\\$0'DO_DOC_COVER' \
. ds $PRFX DOC_COVER_
. DO_AUTHORS
. rm $PRFX
. \}
.\" Named doctype string
. if \\n[#DOC_TYPE]=3 \{\
. if \\n[#\\*[DOC_]COVER_DOCTYPE]=1 \{\
. ie \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
. sp 1.5
. UNDERSCORE2 3p 2p "\\*[$DOC_TYPE]
. \}
. el \{\
. fam \\*[$\\*[DOC_]COVER_DOCTYPE_FAM]
. ft \\*[$\\*[DOC_]COVER_DOCTYPE_FT]
. ps \
\\n[#DOC_PT_SIZE]u\\*[$\\*[DOC_]COVER_DOCTYPE_SIZE_CHANGE]
. if \\n[#\\*[DOC_]COVER_DOCTYPE_COLOR]=1 \
. COLOR \\*[$\\*[DOC_]COVER_DOCTYPE_COLOR]
. sp
. if \\n[#\\*[DOC_]COVER_DOCTYPE_CAPS]=1 .CAPS
. if \\n[#\\*[DOC_]COVER_DOCTYPE_SMALLCAPS]=1 .SMALLCAPS
. if !'\\*[$\\*[DOC_]COVER_DOCTYPE_SPACER]'' \
. sp \\*[$\\*[DOC_]COVER_DOCTYPE_SPACER]
. ie \\n[#\\*[DOC_]COVER_DOCTYPE_UNDERLINE] \{\
. ds $TITLE_TYPE \\*[DOC_]COVER_DOCTYPE
. ie \\n[#\\*[DOC_]COVER_DOCTYPE_UNDERLINE]=2 \
. UNDERSCORE2 \\*[$\\*[DOC_]COVER_DOCTYPE_UNDERLINE_GAP] \
\\*[$\\*[DOC_]COVER_DOCTYPE_RULE_GAP] "\\*[$DOC_TYPE]"
. el .UNDERSCORE "\\*[$DOC_TYPE]"
. \}
. el .PRINT "\\*[$DOC_TYPE]"
. SMALLCAPS off
. CAPS off
. if \\n[#\\*[DOC_]COVER_DOCTYPE_COLOR]=1 \
. gcolor
. \}
. \}
. \}
.\" Covertext
. if \\n[#\\*[DOC_]COVERTEXT]=1 \{\
. nr #DOING_COVERTEXT 1
. if !\\n[#\\*[DOC_]COVERTEXT_START_POS] .sp
. if \\n[#\\*[DOC_]COVERTEXT]=1 \{\
. ev \\*[DOC_]COVERTEXT
. nf
. \\*[DOC_]COVER_TEXT
. ev
. \}
. if \\n[#\\*[DOC_]COVERTEXT_ONLY] \
. PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
. rr #\\*[DOC_]COVERTEXT
. rm \\*[DOC_]COVER_TEXT
. rr #DOING_COVERTEXT
. rr #\\*[DOC_]COVERTEXT_START_POS
. \}
. sp |\\n[#VISUAL_B_MARGIN]u
.\" Copyright
. ie \\n[#PRINT_STYLE]=1 \
. if !\\n[#SINGLE_SPACE] .sp
. el \{\
. fam \\*[$\\*[DOC_]COVER_COPYRIGHT_FAM]
. ft \\*[$\\*[DOC_]COVER_COPYRIGHT_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$\\*[DOC_]COVER_COPYRIGHT_SIZE_CHANGE]
. nr #COPYRIGHT_V_POS \\n[#DOC_LEAD]-\\n[.v]
. sp \\n[#COPYRIGHT_V_POS]u
. rr #COPYRIGHT_V_POS
. \}
. if \\n[#\\*[DOC_]COVER_COPYRIGHT]=1 \{\
. if '\\*[$\\*[DOC_]COVER_COPYRIGHT]'' \
. ds $\\*[DOC_]COVER_COPYRIGHT \\*[$COVER_COPYRIGHT]
. QUAD \\*[$\\*[DOC_]COVER_COPYRIGHT_QUAD]
. if \\n[#\\*[DOC_]COVER_COPYRIGHT_COLOR]=1 \
. COLOR \\*[$\\*[DOC_]COVER_COPYRIGHT_COLOR]
. ie !'\\*[$COPYRIGHT_V_ADJ]'' \
. PRINT \v'\\*[$COPYRIGHT_V_ADJ]'\\*[$\\*[DOC_]COVER_COPYRIGHT]
. el \
. PRINT \\*[$\\*[DOC_]COVER_COPYRIGHT]
. if \\n[#\\*[DOC_]COVER_COPYRIGHT_COLOR]=1 \
. gcolor
. \}
. sp |\\n[#VISUAL_B_MARGIN]u
.\" Misc
. if \\n[#\\*[DOC_]COVER_MISC]=1 \{\
. if \\n[#PRINT_STYLE]=2 \{\
. fam \\*[$\\*[DOC_]COVER_MISC_FAM]
. ft \\*[$\\*[DOC_]COVER_MISC_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$\\*[DOC_]COVER_MISC_SIZE_CHANGE]
. vs \\*[$\\*[DOC_]COVER_MISC_LEAD]
. if \\n[#\\*[DOC_]COVER_MISC_COLOR]=1 \
. COLOR \\*[$\\*[DOC_]COVER_MISC_COLOR]
. \}
. ie !'\\*[$\\*[DOC_]COVER_MISC_1]'' \{\
. QUAD \\*[$\\*[DOC_]COVER_MISC_QUAD]
. da MISC_DIV
. nr #NEXT_MISC 0 1
. while \\n[#\\*[DOC_]COVER_MISC_LINES]>=\\n+[#NEXT_MISC] \{\
. nop \\*[$\\*[DOC_]COVER_MISC_\\n[#NEXT_MISC]]
. br
. \}
. da
. \}
. el \{\
. QUAD \\*[$MISC_QUAD]
. da MISC_DIV
. nr #NEXT_MISC 0 1
. while \\n[#MISC_LINES]>=\\n+[#NEXT_MISC] \{\
. nop \\*[$MISC_\\n[#NEXT_MISC]]
. br
. \}
. da
. \}
. nr #MISC_V_ADJ \\n[#DOC_LEAD]-\\n[.v]
. sp \\n[#MISC_V_ADJ]u
. sp -\\n[dn]u+1
. nf
. MISC_DIV
. if \\n[#MISC_COLOR]=1 .gcolor
. if \\n[#\\*[DOC_]COVER_MISC_COLOR]=1 .gcolor
. rm MISC_DIV
. rr #MISC_DEPTH
. \}
. if \\n[TOC.RELOCATE]==1 \{\
. if !\\n[#COVER_BLANKPAGE] \
. if !rTOC_BH .TOC_AFTER_HERE
. \}
. if '\\$0'DO_COVER' \{\
. if \\n[TOC.RELOCATE]==6 \
. if !rTOC_BH .TOC_AFTER_HERE
. \}
. if '\\$0'DO_DOC_COVER' \{\
. if \\n[TOC.RELOCATE]==4 \
. if !rTOC_BH .TOC_AFTER_HERE
. \}
. END_COVER
.END
\#
\# Macro to terminate (doc)cover processing
\#
.MAC END_COVER END
. EOL
. vpt
. rr #\\*[DOC_]COVERTEXT_ONLY
. rr #\\*[DOC_]COVER_TITLE
. rr #\\*[DOC_]COVERTITLE
. rr #\\*[DOC_]COVER_SUBTITLE
. rr #\\*[DOC_]COVER_AUTHOR
. rr #\\*[DOC_]COVER_DOCTYPE
. rr #\\*[DOC_]COVER_COPYRIGHT
. rr #\\*[DOC_]COVER_MISC
. rr #\\*[DOC_]COVERTEXT
. rr #\\*[DOC_]COVER_IMAGE
. rr #\\*[DOC_]COVER_BLANKPAGE
. rm $PDF_\\*[DOC_]COVER_LABEL
. rr #\\*[DOC_]COVER
. if '\\*[$COVER_TYPE]'DOC_COVER_' .ds DOC DOC
. rm $COVER_TYPE
. if \\n[#DOC_TYPE]=5 .nr #SKIP 1
. nr #END_COVER 1
. NEWPAGE
. rr #NEWPAGE
. rr #SKIP
. if \\n[#PAGINATION_WAS_ON]=1 .nr % +1
. ie \\n[#\\*[DOC_]COVER_BLANKPAGE]=1 \{\
. if \\n[TOC.RELOCATE] \
. if !\\n[#TOC_BH] .TOC_AFTER_HERE
.\" Without the empty PDF_BOOKMARK, (doc)cover BLANKPAGE causes
.\" the PDF outline to place the first doc or chapter before the TOC,
.\" even though PDF output is correct.
. PDF_BOOKMARK 1
. nop \&
. bp
. rr #\\*[DOC_]COVER_BLANKPAGE
. if !\\n[#\\*[DOC]COVERS_COUNT]=1 .nr % -2
. rm DOC_
. \}
. el \
. if !\\n[#\\*[DOC]COVERS_COUNT]=1 .nr #PAGE_NUM_ADJ -1
. if !'\\n[.ev]'0' .ev
. if \\n[#PAGINATION_WAS_ON] \{\
. rr #PAGINATION_WAS_ON
. PAGINATE
. PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]-1
. \}
. if \\n[#HEADERS_WERE_ON] \{\
. rr #HEADERS_WERE_ON
. HEADERS
. \}
. if \\n[#FOOTERS_WERE_ON] \{\
. rr #FOOTERS_WERE_ON
. FOOTERS
. \}
. if \\n[#COLUMNS_WERE_ON]=1 \{\
. rr #COLUMNS_WERE_ON 1
. nr #COLUMNS 1
. \}
. rr #DOING_COVER
. if \\n[.ns] .nop \&
. if \\n[#RECTO_VERSO] .nr #RV_POST_COVER 1
. rm DOC_
.END
\#
\# +++START THE DOCUMENT+++
\#
\# THE START MACRO
\# ---------------
\# *Arguments:
\# <none>
\# *Function:
\# Macro to start document processing. Reads in default document
\# style parameters and any parameters the user has changed before
\# issuing START. Using the information gathered in the opening
\# macros, prints appropriate title (or chapter #), subtitle,
\# author and document type (if appropriate).
\# *Notes:
\# The .PRINT \& (zero-width character) is required to get the
\# subsequent .sp request to work as advertised.
\#
\# The overall document line length, family, and point-size
\# are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
\# use in the HEADER and FOOTER macros.
\#
.MAC START END
. nr #DOCS 1
. if \\n[TOC.RELOCATE]==2 \
. if !\\n[TOC_BH] .TOC_BEFORE_HERE
. if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
. if !\\n[#PRINT_STYLE] \{\
. PRINTSTYLE TYPEWRITE
. PRINT \&
. po 6P
. ll 39P
. ta \\n[.l]u
. sp |1i-1v
. CENTER
. PRINT "You neglected to enter a PRINTSTYLE."
. ab [mom]: PRINTSTYLE missing. Aborting '\\n[.F]'.
. \}
. if \\n[#LINENUMBERS]=1 \{\
. nm
. NUMBER_LINES OFF
. nr #LINENUMBERS 2
. \}
. if \\n[#COLLATE] \{\
. COPYSTYLE \\*[$COPY_STYLE]
. nr #HEADERS_ON \\n[#HEADER_STATE]
. if \\n[#PAGE_NUM_V_POS]=1 .nr #PAGINATE \\n[#PAGINATION_STATE]
. PRINT \&
. if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
. PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
. rm $RESTORE_PAGENUM_STYLE
. \}
. if \\n[#PAGINATE_WAS_ON] \{\
. PAGINATE
. rr #PAGINATE_WAS_ON
. \}
. \}
. DEFAULTS
. nr #PAGE_TOP \\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
. rr #RESET_TRAPS
. if !r#EN_Q_AUTOLEAD .nr #EN_Q_LEAD \\n[#EN_LEAD]
. if !r#EN_BQ_AUTOLEAD .nr #EN_BQ_LEAD \\n[#EN_LEAD]
.\" TOC/recto-verso stuff
. nr @L_MARGIN \\n[#DOC_L_MARGIN]
. nr @R_MARGIN \\n[#DOC_R_MARGIN]
.\" Covers and doc covers
. if \\n[#DOC_COVERS]=1 \{\
. if \\n[#DOC_COVER]=1 .DO_DOC_COVER
. \}
. if \\n[#COVERS]=1 \{\
. if \\n[#COVER]=1 .DO_COVER
. \}
. nr PDFHREF.VIEW.LEADING \\n[PDFHREF.VIEW.LEADING.T]
. if !\\n[#TOC] .RV_HARD_SET_MARGINS
. if \\n[#COLUMNS] .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u
. sp |\\n[#DOCHEADER_ADVANCE]u-\\n[#DOC_LEAD]u
.\" Collect TITLE for TOC.
. if !\\n[#TOC]=1 \{\
. nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
. af #TOC_ENTRY_PN \\g[#PAGENUMBER]
. ie \\n[#USER_SET_TITLE_ITEM] \{\
. ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]
. rr #USER_SET_TITLE_ITEM
. rm $USER_SET_TITLE_ITEM
. \}
. el \{\
. ie \\n[#DOC_TYPE]=2 \{\
. ie '\\*[$CHAPTER_TITLE]'' \
. ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]
. el \{\
. ie '\\*[$CHAPTER]'' \
. ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]
. el \
. ds $TOC_TITLE_ITEM \
\\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]
. \}
. \}
. el \
. ds $TOC_TITLE_ITEM \\*[$TITLE]
. \}
. if \\n[#TOC_AUTHORS]=1 \{\
. ie '\\*[$TOC_AUTHORS]'' \
. as $TOC_TITLE_ITEM / \\*[$AUTHOR_1]
. el \{\
. as $TOC_TITLE_ITEM / \\*[$TOC_AUTHORS]
. rm $TOC_AUTHORS
. \}
. \}
. as $TOC_TITLE_ITEM \|
. if \\n[#PREFIX_CH_NUM] \
. ds $TOC_CH_NUM \
\\n[#CH_NUM].\[toc-hd-num-spacer]
. if \\n[#TOC_PREFIX_CH_NUM] \{\
. rn $TOC_TITLE_ITEM $TOC_TITLE_ITEM_OLD
. ds $TOC_CH_NUM \
\\n[#CH_NUM].\[toc-hd-num-spacer]
. if (\\n[#PAD_TOC_CH_NUM]=2)&(\\n[#CH_NUM]<10) \
. ds $TOC_CH_NUM \h'\w'\0'u'\\*[$TOC_CH_NUM]
. if \\n[#PAD_TOC_CH_NUM]=3 \{\
. if \\n[#CH_NUM]<10 \
. ds $TOC_CH_NUM \h'\w'\0'u*2u'\\*[$TOC_CH_NUM]
. if (\\n[#CH_NUM]>=10)&(\\n[#CH_NUM]<100) \
. ds $TOC_CH_NUM \h'\w'\0'u'\\*[$TOC_CH_NUM]
. \}
. if \\n[#PAD_TOC_CH_NUM]=4 \{\
. if \\n[#CH_NUM]<10 \
. ds $TOC_CH_NUM \h'\w'\0'u*3u'\\*[$TOC_CH_NUM]
. if (\\n[#CH_NUM]>=10)&(\\n[#CH_NUM]<100) \
. ds $TOC_CH_NUM \h'\w'\0'u*2u'\\*[$TOC_CH_NUM]
. if (\\n[#CH_NUM]>=100)&(\\n[#CH_NUM]<1000) \
. ds $TOC_CH_NUM \h'\w'\0'u'\\*[$TOC_CH_NUM]
. \}
. ds $TOC_TITLE_ITEM \\*[$TOC_CH_NUM]\\*[$TOC_TITLE_ITEM_OLD]
. rm $TOC_TITLE_ITEM_OLD
. \}
. \}
. if !'\\*[$TOC_HEADING]'' \{\
. HEADING_TO_TOC
. rm $TOC_HEADING
. \}
. if !\\n[#TOC] \{\
. if !'\\*[$TOC_TITLE_ITEM]'' \{\
. PDF_BOOKMARK 1 \\*[$TOC_TITLE_ITEM]
. if !r #NO_TOC_ENTRY .TITLE_TO_TOC
. if r #NO_TOC_ENTRY .rr #NO_TOC_ENTRY
. \}
. \}
. if !\\n[#TOC] .nr #POST_TOP 1
.\" End TITLE collection
. if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
. if \\n[#PAGE_NUM_V_POS]=1 \{\
. br
. sp |\\n[#HEADER_MARGIN]u
. PRINT_PAGE_NUMBER
. \}
. \}
. rr #COLLATE
. rr #PAGINATION_STATE
.\" End collate stuff
. if \\n[#DOC_TYPE]=5 \{\
. rr @TOP
. ch RR_@TOP
. \}
. sp |\\n[#DOCHEADER_ADVANCE]u-\\n[#DOC_LEAD]u
. ie \\n[#DOC_HEADER]=0 \{\
. if \\n[.ns] .rs
. if \\n[#DOC_TYPE]=4 \
. if !'\\n[.z]'' .di
. nr #STORED_PP_INDENT \\n[#PP_INDENT]
. PARA_INDENT 0
. PP
. PARA_INDENT \\n[#STORED_PP_INDENT]u
. rr #STORED_PP_INDENT
. ie r #ADVANCE_FROM_TOP \{\
. br
. sp |\\n[#ADVANCE_FROM_TOP]u-1v
. if \\n[#ADJ_DOC_LEAD]=1 \
. if !\\n[#DOCHEADER_NO_SHIM] .SHIM_1
. \}
. el \{\
. br
. sp |\\n[#T_MARGIN]u-1v
. \}
. if \\n[#COLUMNS] \{\
. mk dc
. nr #COL_NUM 0 1
. po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n[.o]
. ll \\n[#COL_L_LENGTH]u
. \}
. nr #PP 0
. \}
. el \{\
. if \\n[#AUTO_LEAD] .nr #RESTORE_AUTO_LEAD 1
. nr #CURRENT_LEAD \\n[.v]
. if \\n[#PRINT_STYLE]=2 .vs \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ]
. nr #DOCHEADER_LEAD_DIFF \\n[#CURRENT_LEAD]-\\n[.v]
. sp +\\n[#DOCHEADER_LEAD_DIFF]u
. if \\n[#RESTORE_AUTO_LEAD] \{\
. nr #AUTO_LEAD 1
. nr #AUTOLEAD_VALUE \\n[#SAVED_AUTOLEAD_VALUE]
. \}
. nr #DOCHEADER_LEAD \\n[.v]
. vpt 0
.\" Default doctype
. if \\n[#DOC_TYPE]=1 \{\
. if \\n[.ns] \{\
. rs
. nop \&
. sp -1
. \}
. ev DOCHEADER
. evc 0
. L_MARGIN \\n[#DOC_L_MARGIN]u
. LL \\n[#DOC_L_LENGTH]u
. ta \\n[.l]u
. if \\n[#PRINT_STYLE]=1 .DEFAULT_DOCHEADER_TYPEWRITE
. if \\n[#PRINT_STYLE]=2 .DEFAULT_DOCHEADER
. ev
. \}
.\" Chapter doctype
. if \\n[#DOC_TYPE]=2 \{\
. if \\n[.ns] .rs
. ev DOCHEADER
. evc 0
. if \\n[#DOCHEADER_COLOR]=1 \
. COLOR \\*[$DOCHEADER_COLOR]
. L_MARGIN \\n[#DOC_L_MARGIN]u
. LL \\n[#DOC_L_LENGTH]u
. ta \\n[.l]u
. if \\n[#PRINT_STYLE]=1 .CHAPTER_DOCHEADER_TYPEWRITE
. if \\n[#PRINT_STYLE]=2 .CHAPTER_DOCHEADER
. ev
. \}
.\" Named
. if \\n[#DOC_TYPE]=3 \{\
. if \\n[.ns] \{\
. rs
. nop \&
. sp -1
. \}
. ev DOCHEADER
. evc 0
. if \\n[#DOCHEADER_COLOR]=1 \
. COLOR \\*[$DOCHEADER_COLOR]
. L_MARGIN \\n[#DOC_L_MARGIN]u
. LL \\n[#DOC_L_LENGTH]u
. ta \\n[.l]u
. if \\n[#PRINT_STYLE]=1 \{\
. DEFAULT_DOCHEADER_TYPEWRITE
. if !\\n[#NO_PRINT_DOCTYPE] \{\
. sp
. UNDERSCORE2 3p 2p "\\*[$DOC_TYPE]"
. \}
. \}
. if \\n[#PRINT_STYLE]=2 .NAMED_DOCHEADER
. ev
. \}
. if !\\n[#DOC_TYPE]=4 \{\
. if \\n[#PRINT_STYLE]=1 .sp
. if \\n[#PRINT_STYLE]=2 .sp \\n[#DOC_LEAD]u*2u
. if \\n[#COLUMNS] \{\
. nr #COL_NUM 0 1
. nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
. ie \\n[#RV_POST_COVER] \{\
. nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#DOC_L_MARGIN]
. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n[.o]
. rr #RV_POST_COVER
. \}
. el \{\
. po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n[.o]
. \}
. LL \\n[#COL_L_LENGTH]u
. ta \\n[.l]u
. \}
. \}
. nr #NO_PRINT_AUTHOR 1
. nr #NO_PRINT_DOCTYPE 1
. \}
. vs \\n[#DOC_LEAD]u
. if \\n[#PRINT_STYLE]=1 \
. if \\n[#SINGLE_SPACE]=1 .sp
. if \\n[#ADJ_DOC_LEAD]=1 \
. if \\n[#ADVANCE_FROM_TOP]=0 \
. if \\n[#DOC_HEADER]=1 \
. if !\\n[#DOCHEADER_NO_SHIM] .SHIM_1
. if \\n[#COLUMNS] .mk dc
. FAMILY \\*[$DOC_FAM]
. QUAD \\*[$DOC_QUAD]
. CLEANUP_DEFAULTS
. nr #START_FOR_FOOTERS 1
. if !\\n[#DOC_TYPE]=4 .em TERMINATE
. if \\n[#LINENUMBERS]=2 \{\
. ie \\n[#PER_SECTION] .NUMBER_LINES 1
. el .NUMBER_LINES RESUME
. nr #LINENUMBERS 1
. \}
. if \\n[#RUN_ON]=1 \{\
. if \\n[#FN_MARKER_STYLE]=1 .RUNON_WARNING
. if \\n[#FN_MARKER_STYLE]=2 .RUNON_WARNING
. \}
. nr PDFHREF.VIEW.LEADING \\n[PDFHREF.VIEW.LEADING.H]
. vpt
. if !r flex .nr flex 1
. nr flex-spaces 0
.\" If one-page, don't flex.
. if !dPDF.EXPORT \{\
. if \\n[#FLEX_ACTIVE] \{\
. if !\\n[#NO_FLEX] \{\
. if d pre-toc-\\n%@\\n[#COL_NUM] \
. nr #NO_FLEX 1
. if d pre-list-\\n%@\\n[#COL_NUM] \
. nr #NO_FLEX 1
. if d page-\\n%@\\n[#COL_NUM] \
. nr #NO_FLEX 1
. if '\\*[last-page]'\\n%@\\n[#COL_NUM]' \
. nr #NO_FLEX 1
. \}
. \}
. \}
. if \\n[#DOC_TYPE]=5 \{\
. if \\n[#HDRFTR_BOTH] \
. HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
. if \\n[#SLIDE_HEADERS] .HEADER
. if \\n[#HDRFTR_BOTH] \
. FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
. if \\n[#SLIDE_FOOTERS] \
. PRINT_FOOTER
. sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
. vpt
. \}
.END
\#
.MAC RR_ADVANCE_FROM_TOP END
. rr #ADVANCE_FROM_TOP
. ch RR_ADVANCE_FROM_TOP
.END
\#
.MAC CLEANUP_DEFAULTS END
. nr #START 1
. if \\n[#DOC_HEADER]=1 .nr #DOC_HEADER 2
. rm $TOC_TITLE_ITEM
. rr #MISC_NUM
. rr #MISCS
. rr #NEXT_AUTHOR
. rr #NEXT_MISC
. wh \\n[nl]u+1u RR_ADVANCE_FROM_TOP
. rr #DOCHEADER_NO_SHIM
.END
\#
\# ====================================================================
\#
\# +++MACROS TO CHANGE SOME DEFAULTS+++
\#
\# DOCUMENT HEADER
\# ---------------
\# *Argument:
\# <none> | <anything> [distance to advance from top of page] [NO_SHIM]
\# *Function:
\# Turns printing of document header on or off. If a second
\# numeric argument with units of measure is given, advances that
\# distance from the top of the page without printing the document
\# header.
\# *Notes:
\# Default is on. If the 1st argument is <anything> (which turns
\# document headers off), the optional 2nd argument may be given
\# (with a unit of measure).
\#
.MAC DOCHEADER END
. if \\n[#NUM_ARGS]=0 .nr #DOC_HEADER 1
. if \\n[#NUM_ARGS]=1 \{\
. ie '\\$1'NO_SHIM' .nr #DOCHEADER_NO_SHIM 1
. el .nr #DOC_HEADER 0
. \}
. if \\n[#NUM_ARGS]>1 \{\
. nr #DOC_HEADER 0
. if \B'\\$2' .nr #ADVANCE_FROM_TOP \\$2
. if '\\$3'NO_SHIM' .nr #DOCHEADER_NO_SHIM 1
. \}
.END
\#
\# DOCUMENT HEADER LEADING
\# -----------------------
\# *Arguments:
\# <+|- amount by which to in/decrease leading of doc header>
\# *Function:
\# Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ.
\# *Notes:
\# A unit of measure must be supplied. Decimal fractions OK.
\# Default is +0, i.e. same as DOC_LEAD.
\#
.MAC DOCHEADER_LEAD END
. ds $DOCHEADER_LEAD_ADJ \\$1
.END
\#
\# DOCHEADER ADVANCE
\# -----------------
\# *Arguments:
\# <docheader start position>
\# *Function:
\# Creates register #DOCHEADER_ADVANCE, used in START.
\# *Notes:
\# Unit of measure required.
\# Default is same as T_MARGIN.
\#
.MAC DOCHEADER_ADVANCE END
. nr #DOCHEADER_ADVANCE \\$1
.END
\#
\# DOCUMENT LEFT MARGIN
\# --------------------
\# *Argument:
\# <left margin of document>
\# *Function:
\# Creates or modifies register #DOC_L_MARGIN.
\# *Notes:
\# Affects everything on the page.
\#
.MAC DOC_LEFT_MARGIN END
. if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0
. br
. nr #DOC_L_MARGIN (\\$1)
. L_MARGIN \\n[#DOC_L_MARGIN]u
.END
\#
\# DOCUMENT RIGHT MARGIN
\# ---------------------
\# *Argument:
\# <right margin of document>
\# *Function:
\# Creates or modifies register #DOC_R_MARGIN.
\# *Notes:
\# Affects everything on the page.
\#
.MAC DOC_RIGHT_MARGIN END
. br
. nr #DOC_R_MARGIN (\\$1)
. R_MARGIN \\n[#DOC_R_MARGIN]
. nr #DOC_L_LENGTH \\n[#L_LENGTH]
.END
\#
\# DOCUMENT LINE LENGTH
\# --------------------
\# *Argument:
\# <line length of document>
\# *Function:
\# Creates or modifies register #DOC_L_LENGTH.
\# *Notes:
\# Affects everything on the page.
\#
.MAC DOC_LINE_LENGTH END
. if !\\n[DOCS] .DOC_MACRO_ERROR \\$0
. br
. nr #DOC_L_LENGTH (\\$1)
. LL \\n[#DOC_L_LENGTH]u
. ta \\n[.l]u
.END
\#
\# DOCUMENT FAMILY
\# ---------------
\# *Argument:
\# <family of running text>
\# *Function:
\# Creates or modifies string $DOC_FAM.
\# *Notes:
\# Affects everything except headers and footers.
\#
.MAC DOC_FAMILY END
. if !\\n[DOCS] .DOC_MACRO_ERROR \\$0
. br
. ds $DOC_FAM \\$1
. ds $FAMILY \\*[$DOC_FAM]
. AUTHOR_FAMILY \\*[$DOC_FAM]
. BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
. DOCHEADER_FAMILY \\*[$DOC_FAM]
. DOCTYPE_FAMILY \\*[$DOC_FAM]
. EPIGRAPH_FAMILY \\*[$DOC_FAM]
. FOOTNOTE_FAMILY \\*[$DOC_FAM]
. HDRFTR_FAMILY \\*[$DOC_FAM]
. LINENUMBER_FAMILY \\*[$DOC_FAM]
. QUOTE_FAMILY \\*[$DOC_FAM]
. SUBTITLE_FAMILY \\*[$DOC_FAM]
. TITLE_FAMILY \\*[$DOC_FAM]
.END
\#
\# DOCUMENT POINT SIZE
\# -------------------
\# *Argument:
\# <point size of running text>
\# *Function:
\# Creates or modifies register #DOC_PT_SIZE.
\# *Notes:
\# DOC_PT_SIZE is the basis for calculating all type sizes in
\# a document. Ignored if PRINTSTYLE TYPEWRITE.
\#
.ALIAS DOC_PT_SIZE PT_SIZE
\#
\# DOCUMENT LEAD
\# -------------
\# *Argument:
\# <lead (".vs") of running text> [ADJUST]
\# *Function:
\# Creates or modifies register #DOC_LEAD. If the optional
\# ADJUST argument is given, adjusts leading so that the last
\# line of text falls exactly on #B_MARGIN.
\# *Notes:
\# DOC_LEAD is the basis for calculating all leading changes in
\# a document. Default for TYPESET is 16; 24 for TYPEWRITE.
\#
\# Because the visible bottom or footer margin of a page depends
\# on the overall document lead supplied by the register #DOC_LEAD,
\# DOC_LEAD, in the body of a document, should always be associated
\# with the start of a new page (in other words, just before or
\# just after a manual NEWPAGE). Ignored if PRINTSTYLE TYPEWRITE.
\#
.MAC DOC_LEAD END
. if \\n[#IGNORE] .return
. if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0
. br
. if '\\$0'DOC_LEAD' \{\
. vs \\$1
. rr #DOC_AUTOLEAD
. rr #DOC_AUTOLEAD_FACTOR
. nr #DOC_LEAD \\n[.v]
. \}
. nr #RESET_TRAPS 1
. if !\\n[#ADJ_DOC_LEAD] .nr #REMOVE_ADJ 1
. if !'\\$0'DOC_LEAD' \{\
. if '\\$0'EN_LEAD' .nr #DOC_LEAD \\n[#EN_LEAD]
. if '\\$0'BIB_LEAD' .nr #DOC_LEAD \\n[#BIB_LEAD]
. if '\\$0'TOC_LEAD' .nr #DOC_LEAD \\n[#TOC_LEAD]
. if '\\$2'ADJUST' .TRAPS
. rr #RESET_TRAPS
. \}
.END
\#
\# ADJUST DOCUMENT LEAD
\# --------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Adjusts document lead so that the last line of text falls exactly
\# on #B_MARGIN.
\#
.MAC DOC_LEAD_ADJUST END
. ie '\\$1'' \{\
. nr #ADJ_DOC_LEAD 1
. rr #DOC_LEAD_ADJUST_OFF
. \}
. el \{\
. nr #ADJ_DOC_LEAD 0
. nr #DOC_LEAD_ADJUST_OFF 1
. \}
.END
\#
\# SHIM
\# ----
\# *Argument:
\# None
\# *Function:
\# Advances to the next valid baseline.
\# *Notes:
\# If a user plays around with spacing in a doc (say, with ALD),
\# it isn't easy to get mom back on track so she can achieve
\# perfectly flush bottom margins. Any time SHIM is used, it
\# ensures that the next output line falls on a valid baseline.
\#
\# First, a little convenience macro
\#
.MAC PROCESS_SHIM END
. if !\\n[nl]=\\n[#VALID_BASELINE] \{\
. while \\n+[#VALID_BASELINE]<\\n[#CURRENT_V_POS] .
. nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS]
. \}
.END
\#
\# And a macro to disable SHIM
\#
.MAC NO_SHIM END
. ie '\\$1'' \{\
. nr #NO_SHIM 1
. nr #FLEX_ACTIVE 1
. \}
. el \{\
. rr #NO_SHIM
. rr #SHIM
. rr #FLEX_ACTIVE
. \}
.END
\#
.nr #NO_SHIM 2 \" Restored to 1 in DEFAULTS.
\#
.MAC SHIM END
. if \\n[#NO_SHIM] \
. if !'\\$0'SHIM_1' .return
. if !\\n[#NO_FLEX] \{\
. if !'\\$0'SHIM_1' \{\
. tm1 "[mom]: \
SHIM, line \\n[.c], is incompatible with flex-spacing, which is enabled.
. tm1 " \
Flex-spacing must be disabled with NO_FLEX before using SHIM.
. ab [mom]: Aborting '\\n[.F]', line \\n[.c].
. \}
. \}
. nr #VALID_BASELINE \\n[#T_MARGIN]-\\n[#DOC_LEAD] \\n[#DOC_LEAD]
. if !r#CURRENT_V_POS .nr #CURRENT_V_POS \\n[.d]
. ie \\n[#ADVANCE_FROM_TOP] \{\
. ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\
. while \\n-[#VALID_BASELINE]>\\n[#CURRENT_V_POS] .
. nr #VALID_BASELINE +\\n[#DOC_LEAD]
. nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS]
. \}
. el .PROCESS_SHIM
. \}
. el .PROCESS_SHIM
. nr #SHIM_MAX \\n[#DOC_LEAD]*10/15
. if !\\n[#CALCULATE_ONLY] \{\
. if !\\n[defer-count] \
. if \\n[#SHIM]>\\n[#SHIM_MAX] .sp -1
' sp \\n[#SHIM]u
. \}
. rr #CURRENT_V_POS
.END
\#
.ALIAS SHIM_1 SHIM
\#
\# ====================================================================
\#
\# +++FLEX SPACING+++
\#
\# INSERT FLEX SPACE
\# -----------------
\# *Arguments:
\# FORCE
\# *Function:
\# Inserts flexible whitespace ("flex-space").
\# *Notes:
\# FORCE restores flex-spacing if an .ns is preventing it.
\# Useful in conjunction with deferred floated material that
\# plants an .ns after outputting the last deferred float.
\#
.MAC FLEX END
. if !\\n[#NO_SHIM] \{\
. if \\n[#NO_FLEX] \{\
. tm1 "[mom]: \
FLEX, line \\n[.c], is incompatible with shimming, which is presently enabled.
. tm1 " \
Shimming must be disabled with NO_SHIM before using FLEX.
. ab [mom]: Aborting '\\n[.F]', line \\n[.c].
. \}
. \}
. if '\\$1'FORCE' \{\
. nr flex:force 1
. return
. \}
. if !\\n[#NO_FLEX] \{\
. if !\\n[.ns] \{\
. if !\\n[.t]<=\\n[.v] \{\
. nr flex-spaces +1
. if dflex-space:\\n[flex]@\\n[#COL_NUM] \{\
. sp \\*[flex-space:\\n[flex]@\\n[#COL_NUM]]
. \}
. \}
. \}
. \}
.END
\#
.MAC NO_FLEX END
. rr flexed
. ie '\\$1'' \{\
. nr #NO_FLEX 1
. if \\n[#FLEX_ACTIVE] .rr #FLEX_ACTIVE
. \}
. el \
. if !\\n[#DOC_TYPE]=5 .rr #NO_FLEX
.END
\#
\# CALCULATE FLEX SPACES
\# ---------------------
\# *Function:
\# Derives flex-space size by dividing the space remaining before
\# FOOTER by the number of times FLEX was used on the page/col.
\# *Notes:
\# .h is reliable for determining space remaining, but can't be used
\# for columns because it can't be zeroed from one col to the
\# next. Workaround is to use nl for columns and compensate for
\# .br's, .sp's, and .ne's. Here be dragons.
\#
.MAC CALCULATE_FLEX END
. nr flex:target-pos \\n[.p]+\\n[#VARIABLE_FOOTER_POS]-1
. nr flex:current-pos \\n[.h]-\\n[.v]
. if \\n[#COLUMNS] \{\
. ie \\n[.trunc] \
. nr flex:current-pos \\n[nl]-\\n[.v]-(\\n[.trunc]-1)
. el .nr flex:current-pos \\n[nl]-\\n[.v]
. if '\\n[.ev]'tbl*end' \{\
. nr flex:current-pos \\n[nl]-(\\n[.trunc]-1)
. if \\n[tbl*boxed] .nr flex:current-pos -.65v
. \}
. ie \\n[nl-from-heading] \{\
. nr flex:current-pos \\n[nl-from-heading]-\\n[.v]
. rr nl-from-heading
. \}
. el \{\
. if !\\n[.pe] \{\
. if \\n[nl]=(\\n[.p]+(\\n[#VARIABLE_FOOTER_POS]-1)) \
. nr flex-spaces -1
. \}
. \}
. \}
. nr flex:space-remaining \
\\n[flex:target-pos]-\\n[flex:current-pos]
. if \\n[flex-spaces] \{\
. nr flex-space:\\n[flex]@\\n[#COL_NUM] \
\\n[flex:space-remaining]/\\n[flex-spaces]
. if dPDF.EXPORT \{\
. tm .ds flex-space:\\n[flex]@\\n[#COL_NUM] \
\\n[flex-space:\\n[flex]@\\n[#COL_NUM]]u
.\" For debugging: catch edge-cases that result in negative
.\" flex-spacing and don't apply flex to the page/column.
. if \\n[flex-space:\\n[flex]@\\n[#COL_NUM]]<0 \{\
. tm .ds flex-space:\\n[flex]@\\n[#COL_NUM] 0
. tm .ds Negative flex space \\n%@\\n[#COL_NUM] (\\n[flex-space:\\n[flex]@\\n[#COL_NUM]])
. \}
. \}
. \}
.END
\#
\# ====================================================================
\#
\# +++INTERNATIONALIZATION+++
\#
\# ATTRIBUTE STRING
\# ----------------
\# *Argument:
\# <what goes in the "by" slot before author in the document header>
\# *Function:
\# Creates or modifies string $ATTRIBUTE_STRING.
\# *Notes:
\# Default is "by". A blank string ("") may be used if no
\# attribution is desired. Blank line results.
\#
.MAC ATTRIBUTE_STRING END
. if !'\\$1'DOC_COVER' \
. if !'\\$1'COVER' .nr #NEITHER 1
. if !'\\$1'COVER' \
. if !'\\$1'DOC_COVER' .nr #NEITHER 1
. if '\\$1'DOC_COVER' \{\
. ds $DOC_COVER_ATTRIBUTE_STRING \\$2
. if '\\*[$DOC_COVER_ATTRIBUTE_STRING]'' \
. ds $DOC_COVER_ATTRIBUTE_STRING \&
. \}
. if '\\$1'COVER' \{\
. ds $COVER_ATTRIBUTE_STRING \\$2
. if '\\*[$COVER_ATTRIBUTE_STRING]'' \
. ds $COVER_ATTRIBUTE_STRING \&
. \}
. if \\n[#NEITHER]=1 \{\
. ds $ATTRIBUTE_STRING \\$1
. rr #NEITHER
. \}
.END
\#
\# CHAPTER STRING
\# --------------
\# *Argument:
\# <what to print any time the word "chapter" is required>
\# *Function:
\# Creates or modifies string $CHAPTER_STRING.
\# *Notes:
\# Default is "chapter".
\#
.MAC CHAPTER_STRING END
. ds $CHAPTER_STRING \\$1
.END
\#
\# DRAFT STRING
\# ------------
\# *Argument:
\# <what to print any time the word "draft" is required>
\# *Function:
\# Creates or modifies string $DRAFT_STRING.
\# *Notes:
\# Default is "draft".
\#
.MAC DRAFT_STRING END
. ds $DRAFT_STRING \\$1
.END
\#
\# REVISION STRING
\# ---------------
\# *Argument:
\# <what to print any time the word "revision" is required>
\# *Function:
\# Creates or modifies string $REVISION_STRING.
\# *Notes:
\# Default is "revision".
\#
.MAC REVISION_STRING END
. ds $REVISION_STRING \\$1
.END
\#
\# FINIS STRING
\# ------------
\# *Argument:
\# <what to print with the finis macro>
\# *Function:
\# Creates or modifies string $FINIS_STRING.
\# *Notes:
\# Default is "END".
\#
.MAC FINIS_STRING END
. ds $FINIS_STRING \\$1
.END
\#
\# ====================================================================
\#
\# +++RECTO/VERSO+++
\#
\# RECTO_VERSO
\# -----------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages. Also
\# switches page numbers left and right if either is chosen rather
\# than the default centered page numbers. Switches left and right
\# margins if differing values have been entered.
\# *Notes:
\# Default is OFF.
\#
.MAC RECTO_VERSO END
. ie '\\$1'' .nr #RECTO_VERSO 1
. el .nr #RECTO_VERSO 0
.END
\#
\# FORCE RECTO
\# -----------
\# *Function:
\# Forces doccover and cover pages to recto
\#
.MAC FORCE_RECTO END
. ie '\\$1'' \{\
. nr #FORCE_RECTO 1
. nr #DOC_COVER_BLANKPAGE 1
. nr #COVER_BLANKPAGE 1
. \}
. el \{\
. rr #FORCE_RECTO
. rr #DOC_COVER_BLANKPAGE
. rr #COVER_BLANKPAGE
. \}
.END
\#
.MAC RV_HARD_SET_MARGINS END
. DOC_LEFT_MARGIN \\n[@L_MARGIN]u
. DOC_RIGHT_MARGIN \\n[@R_MARGIN]u
. po \\n[#DOC_L_MARGIN]u
. LL \\n[#DOC_L_LENGTH]u
.END
\#
\# ====================================================================
\#
\# +++EPIGRAPHS+++
\#
\# EPIGRAPH INDENT
\# ---------------
\# *Argument:
\# <value by which to multiply PP_INDENT for block epigraphs>
\# *Function:
\# Creates or modifies register #EPI_OFFSET_VALUE.
\# *Notes:
\# Default is 2 for TYPEWRITE, 3 for TYPESET.
\#
.MAC EPIGRAPH_INDENT END
. rr #EPI_OFFSET_VALUE
. rm $EPI_OFFSET_VALUE
. ds $EVAL_EI_ARG \\$1
. substring $EVAL_EI_ARG -1
. ie \B'\\*[$EVAL_EI_ARG]' .nr #EPI_OFFSET_VALUE \\$1
. el .ds $EPI_OFFSET_VALUE \\$1
. rm $EVAL_EI_ARG
.END
\#
\# EPIGRAPH AUTOLEAD
\# -----------------
\# *Argument:
\# <amount of lead to add to the epigraph ps for epigraph leading>
\# *Function:
\# Creates or modifies register #EPI_AUTOLEAD.
\# *Notes:
\# Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
\#
.MAC EPIGRAPH_AUTOLEAD END
. nr #EPI_AUTOLEAD (p;\\$1)
.END
\#
\# EPIGRAPH
\# --------
\# *Arguments:
\# BLOCK | <anything>
\# *Function:
\# Places an epigraph before the document's text, after the
\# document header, or after a HEAD.
\# *Notes:
\# #EPIGRAPH 1 = centered; 2 = block
\#
\# By default, epigraphs are centered, allowing the user
\# to input them on a line per line basis. To change this
\# behaviour, the user can supply the argument BLOCK, which
\# will produce indented, filled text similar to BLOCKQUOTE.
\#
\# If a block epigraph contains more than one para, ALL paras of
\# the epigraph must be preceded by PP. Otherwise, PP is optional.
\#
.MAC EPIGRAPH END
. nr #PP_STYLE 2
. nr #Q_PP 0
. if \\n[#LINENUMBERS]=1 \{\
. NUMBER_LINES OFF
. nr #LINENUMBERS 2
. \}
. if \\n[#START] \{\
. if \\n[#PRINT_STYLE]=1 \
. if \\n[#AUTHOR_LINES]=1 .sp \\n[#DOC_LEAD]u
. \}
. ie '\\$1'' \{\
. nr #EPIGRAPH 1
. ev EPIGRAPH
. nr #IN_DIVER 1
. ll \\n[#L_LENGTH]u
. ta \\n[.l]u
. CHECK_INDENT
. if \\n[#COLUMNS] \{\
. ie \\n[#START] \{\
. ll \\n[#DOC_L_LENGTH]u
. ta \\n[.l]u
. \}
. el \{\
. ll \\n[#COL_L_LENGTH]u
. ta \\n[.l]u
. \}
. \}
. CENTER
. if \\n[#PRINT_STYLE]=1 \{\
. fam \\*[$TYPEWRITER_FAM]
. ft R
. if '\\*[$EPI_FT]'I' .FT I
. ps \\*[$TYPEWRITER_PS]
. ie \\n[#SINGLE_SPACE] .vs \\n[#DOC_LEAD]u
. el .vs \\n[#DOC_LEAD]u/2u
. nr #EPI_LEAD \\n[#LEAD]
. nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. FAMILY \\*[$EPI_FAM]
. FT \\*[$EPI_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
. if \\n[#EPI_COLOR]=1 \{\
. nf
\m[\\*[$EPI_COLOR]]
. EOL
. \}
. vs \\n[.ps]u+\\n[#EPI_AUTOLEAD]u
. nr #EPI_LEAD \\n[#LEAD]
. nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
. \}
. di EPI_TEXT
. nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
. HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
. hy 14
. nr #EPI_ACTIVE 1
. \}
. el \{\
. ie '\\$1'BLOCK' \{\
. nr #EPIGRAPH 2
. ev EPIGRAPH
. evc 0
. ie \\n[#START] \{\
. ie \\n[#COLUMNS] \{\
. ie r#EPI_OFFSET_VALUE \
. ll \
\\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
. el \
. ll \
\\n[#L_LENGTH_FOR_EPI]u-(\\*[$EPI_OFFSET_VALUE]u*2u)
. ta \\n[.l]u
. \}
. el \{\
. ie r#EPI_OFFSET_VALUE \
. ll \
\\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
. el \
. ll \\n[#L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
. ta \\n[.l]u
. \}
. \}
. el \{\
. ie r#EPI_OFFSET_VALUE \
. ll \
\\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
. el \
. ll \\n[#L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
. ta \\n[.l]u
. if \\n[#COLUMNS] \{\
. ie r#EPI_OFFSET_VALUE \
. ll \
\\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
. el \
. ll \\n[#COL_L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
. ta \\n[.l]u
. \}
. CHECK_INDENT
. \}
. if \\n[#PRINT_STYLE]=1 \{\
. fam \\*[$TYPEWRITER_FAM]
. ft R
. if '\\*[$EPI_FT]'I' .FT I
. ps \\*[$TYPEWRITER_PS]
. ie \\n[#SINGLE_SPACE] .vs \\n[#DOC_LEAD]u
. el .vs \\n[#DOC_LEAD]u/2u
. QUAD LEFT
. HY OFF
. nr #EPI_LEAD \\n[#LEAD]
. nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
. di EPI_TEXT
. nr #EPI_ACTIVE 1
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. FAMILY \\*[$EPI_FAM]
. FT \\*[$EPI_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
. if \\n[#EPI_COLOR]=1 \{\
. nf
\m[\\*[$EPI_COLOR]]
. EOL
. \}
. vs \\n[.ps]u+\\n[#EPI_AUTOLEAD]u
. QUAD \\*[$EPI_QUAD]
. nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
. HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
. hy 14
. nr #EPI_LEAD \\n[#LEAD]
. nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
. di EPI_TEXT
. nr #EPI_ACTIVE 1
. \}
. \}
. el .DO_EPIGRAPH
. \}
.END
\#
\# DO EPIGRAPH
\# -----------
\# *Arguments:
\# <none>
\# *Function:
\# Ends diversion started in EPIGRAPH. Makes spacing
\# adjustments to compensate for the difference between epigraph
\# leading and overall document leading, so that the bottom of
\# the pages remain flush.
\# *Notes:
\# In addition to its usual place at the beginning of a
\# document, EPIGRAPH may also be used after HEAD.
\#
.MAC DO_EPIGRAPH END
. br
. di
. rr #IN_DIVER
. if \\n[#RESET_FN_COUNTERS]=2 \{\
. if !\\n[#FN_COUNT]=1 \{\
. if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
. DIVER_FN_2_POST
. rr #RESET_FN_COUNTERS
. \}
. \}
. \}
. nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
. nr #DONE_ONCE 0 1
. REMOVE_INDENT
. ev
. nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
. nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
. ie \\n[#START] \{\
. if !\\n[#NO_SHIM] .RLD \\n[#SHIM]u
. nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
. nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
. \}
. if \\n[#PRINT_STYLE]=1 \
. if !\\n[#SINGLE_SPACE]=1 .ALD \\n[#DOC_LEAD]u
. if \\n[#PRINT_STYLE]=2 \{\
. ie !\\n[#DOC_TYPE]=2 .RLD \\n[#DOC_LEAD]u
. el \{\
. ie '\\*[$CHAPTER_TITLE]'' .RLD \\n[#DOC_LEAD]u
. el .if '\\*[$CHAPTER]'' .RLD \\n[#DOC_LEAD]u
. \}
. if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
. ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
. if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
. ALD \
\\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
. \}
. \}
. el \{\
. ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
. nr #EPI_FITS 1
. nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
. nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
. \}
. ie \\n[#PRINT_STYLE]=1 \
. ALD \\n[#DOC_LEAD]u/2u
. el \{\
. if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
. ALD \
\\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
. if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
. ALD \
\\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
. \}
. if \\n[#DIVER_FN]=2 .rr #DIVER_FN
. \}
. el \{\
. nr #EPI_LINES_TO_TRAP 0 1
. while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{\
. nr #LOOP 1
. \}
. nr #EPI_LINES_TO_TRAP -1
. nr #EPI_WHITESPACE \
(\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
. nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
. \}
. if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
. ALD \\n[#EPI_WHITESPACE]u
. if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
. ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u
. \}
. \}
. SET_EPI_OFFSET
. nf
. EPI_TEXT
. br
. ie \\n[#START] \{\
. if \\n[#PRINT_STYLE]=1 .SHIM_1
. if \\n[#PRINT_STYLE]=2 \{\
. if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
. ALD \\n[#EPI_WHITESPACE]u/2u
. if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
. ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
. SHIM
. \}
. \}
. el \{\
. rr #EPI_ACTIVE
. ie \\n[#EPI_FITS] \{\
. ie \\n[#FN_FOR_EPI] \{\
. nr #EPI_LINES_TO_END 1
. nr #EPI_WHITESPACE \
(\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
. nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
. \}
. ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
. \}
. el \{\
. ie \\n[#PRINT_STYLE]=1 \
. SHIM_1
. el \{\
. if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
. ALD \\n[#EPI_WHITESPACE]u/2u
. if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
. ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
. \}
. \}
. SHIM
. \}
. el \{\
. nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
. if \\n[#LOOP] .nr #EPI_LINES_TO_END +1
. rr #LOOP
. nr #EPI_WHITESPACE \
(\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
. nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
. \}
. ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
. if \\n[#PRINT_STYLE]=1 \{\
. if !\\n[#SINGLE_SPACE] \{\
. nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
. ie \\n[#EPI_LINES_EVEN] .ALD .5v
. el .RLD .5v
. rr #EPI_LINES_EVEN
. \}
. \}
. \}
. \}
. nr #PP_STYLE 1
. rr #EPI_FITS
. ALD \\n[#DOC_LEAD]u
. QUAD \\*[$DOC_QUAD]
. po \\n[#L_MARGIN]u
. if \\n[#COLUMNS] \{\
. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n[.o]
. \}
. if \\n[#START] \{\
. if \\n[#COLUMNS] \{\
. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n[.o]
. mk dc
. \}
. \}
. if \\n[#LINENUMBERS]=2 \{\
. NUMBER_LINES RESUME
. nr #LINENUMBERS 1
. \}
.END
\#
.MAC SET_EPI_OFFSET END
. if \\n[#EPIGRAPH]=1 \{\
. po \\n[#L_MARGIN]u
. if \\n[#COLUMNS] \{\
. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n[.o]
. \}
. \}
. if \\n[#EPIGRAPH]=2 \{\
. ie !\\n[#EPI_OFFSET_VALUE]=0 \
. nr #EPI_OFFSET \
\\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
. el \
. if !'\\*[$EPI_OFFSET_VALUE]'' \
. nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
. if \\n[#COLUMNS] \{\
. ie !\\n[#EPI_OFFSET_VALUE]=0 \
. nr #EPI_OFFSET \
\\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
. el \
. if !'\\*[$EPI_OFFSET_VALUE]'' \
. nr #EPI_OFFSET \
\\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
. \}
. if !'\\$0'GET_EPI_OFFSET' \
. if !\\n[#EPI_OFFSET]=0 .po \\n[#EPI_OFFSET]u
. \}
.END
.
.ALIAS GET_EPI_OFFSET SET_EPI_OFFSET
\#
\# ====================================================================
\#
\# +++FINIS MACRO+++
\#
\# FINIS
\# -----
\# *Arguments:
\# <none>
\# *Function:
\# Deposits --END-- at the end of a document.
\#
.MAC FINIS END
. if !\\n[@TOP] \{\
. if \\n[.t]<=2v \{\
. tm1 "[mom]: '\\n[.F]': Insufficient room to print \\$0 on last page.
. return
. \}
. \}
. br
. ev FINIS
. evc 0
. if \\n[#TAB_ACTIVE] .TQ
. if \\n[#INDENT_ACTIVE] .IQ CLEAR
. nr #EM_ADJUST (1m/8)
. if \\n[#COLUMNS] \{\
. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n[.o]
. \}
. ALD \\n[#DOC_LEAD]u
. CENTER
. if \\n[#FINIS_STRING_CAPS]=1 .CAPS
. if \\n[#PRINT_STYLE]=1 \{\
. ie !\\n[#FINIS_NO_DASHES] .PRINT "--\\*[$FINIS_STRING]--
. el .PRINT "\\*[$FINIS_STRING]
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. if \\n[#FINIS_COLOR]=1 .COLOR \\*[$FINIS_COLOR]
. ie !\\n[#FINIS_NO_DASHES] .ds $FINIS_DASH \
\v'-\\n[#EM_ADJUST]u'\[em]\v'+\\n[#EM_ADJUST]u'
. el .rm $FINIS_DASH
. PRINT \
\\*[$FINIS_DASH]\\*[$FINIS_STRING]\\*[$FINIS_DASH]\c
. \}
. EL
. if \\n[#FINIS_COLOR]=1 .gcolor
. if \\n[#FINIS_STRING_CAPS]=1 .CAPS OFF
. ev
. pdfsync
.END
\#
.MAC FINIS_STRING_CAPS END
. ie '\\$1'' .nr #FINIS_STRING_CAPS 1
. el .nr #FINIS_STRING_CAPS 0
.END
.
.ALIAS FINIS_CAPS FINIS_STRING_CAPS
\#
.MAC FINIS_NO_DASHES END
. nr #FINIS_NO_DASHES 1
.END
\#
\# ====================================================================
\#
\# +++HEADERS/FOOTERS+++
\#
\# Define a string so that the current page number can be incorporated
\# into the strings for hdrftr left, right, and center. NOTE: This is
\# not the same thing as using the shortform # in hdrftr strings.
\#
.ds PAGE# \En[#PAGENUMBER]
.ALIAS SLIDE# PAGE#
\#
.MAC RESTORE_SPACE END
. if !\\n[#START] .vpt 0
. if \\n[@TOP] \{\
. ch RR_@TOP
. rr @TOP
. \}
. if \\n[#NEWPAGE] .rr #NEWPAGE
. if \\n[.u]=1 .nr #FILLED 1
. nf
. rs
. nop \&
. sp -1
. if \\n[#FILLED] \{\
. fi
. rr #FILLED
. \}
. if !\\n[#START] .vpt
.END
\#
\# HDRFTR RULE GAP
\# ---------------
\# *Argument:
\# <amount of space between header/footer and header/footer rule>
\# *Function:
\# Creates or modifies register #HDRFTR_RULE_GAP to hold amount
\# of space between header/footer and header/footer rule.
\# *Notes:
\# Default is 4p.
\#
.MAC HDRFTR_RULE_GAP END
. nr #HDRFTR_RULE_GAP (\\$1)
. if '\\$0'HEADER_RULE_GAP' \
. nr #HEADER_RULE_GAP \\n[#HDRFTR_RULE_GAP]
. if '\\$0'FOOTER_RULE_GAP' \
. nr #FOOTER_RULE_GAP \\n[#HDRFTR_RULE_GAP]
.END
\#
\# HDRFTR LEFT
\# -----------
\# *Argument:
\# <what to put in the left position of page header/footers>
\# *Function:
\# Creates or modifies string $HDRFTR_LEFT.
\# Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
\# overrides the $HDRFTR_LEFT string created by default
\# in DEFAULTS.
\# *Notes:
\# Especially useful if doc has more than one author, and a list
\# of authors by last name is desired in header/footers.
\# Default is author.
\#
\# If the argument is the # character, simply prints the current
\# page number.
\#
\# If the user wants to incorporate the page number into the string,
\# \*[PAGE#] must be used. For example, if the user wants to put
\# an ellipsis before the page number in the string, s/he should use
\# ...\*[PAGE#], not ...#
\#
.MAC HDRFTR_LEFT END
. nr #USER_DEF_HDRFTR_LEFT 1
. ds $HDRFTR_LEFT \\$1
.END
\#
\# HDRFTR <POSITION> CAPS AND SMALLCAPS
\# ------------------------------------
\# *Argument:
\# <none> | <anything>
\# *Function:
\# Turns capitalisation of $HDRFTR_<POSITION> on or off.
\# *Notes:
\# Default for RIGHT (ie AUTHOR) is on.
\#
.MAC CAPS_SMALLCAPS_WARNING END
. tm1 "[mom]: At line \\n[.c], both CAPS and SMALLCAPS have been enabled for HEADER_\\$1.
. tm1 " CAPS takes precedence.
.END
.
.MAC _HDRFTR_CAPS END
. ds $HDR_FTR \\$0
. substring $HDR_FTR 0 5 \" HEADER or FOOTER
. ds POSITION \\$0
. substring POSITION 7 7
. if '\\*[POSITION]'L' .ds POSITION LEFT
. if '\\*[POSITION]'C' .ds POSITION CENTER
. if '\\*[POSITION]'R' .ds POSITION RIGHT
. if \\n[#HDRFTR_\\*[POSITION]_SMALLCAPS]=1 \
. CAPS_SMALLCAPS_WARNING \\*[POSITION]
. ie '\\$1'' .nr #HDRFTR_\\*[POSITION]_CAPS 1
. el \{\
. nr #HDRFTR_\\*[POSITION]_CAPS 0
. ds $HDRFTR_\\*[POSITION]_SIZE_CHANGE +0
. \}
.END
.
.MAC _HDRFTR_SMALLCAPS END
. ds $HDR_FTR \\$0
. substring $HDR_FTR 0 5 \" HEADER or FOOTER
. ds POSITION \\$0
. substring POSITION 7 7
. if '\\*[POSITION]'L' .ds POSITION LEFT
. if '\\*[POSITION]'C' .ds POSITION CENTER
. if '\\*[POSITION]'R' .ds POSITION RIGHT
. if \\n[#HDRFTR_\\*[POSITION]_CAPS]=1 \
. CAPS_SMALLCAPS_WARNING \\*[POSITION]
. ie '\\$1'' .nr #HDRFTR_\\*[POSITION]_SMALLCAPS 1
. el \
. nr #HDRFTR_\\*[POSITION]_SMALLCAPS 0
.END
\#
\# HDRFTR CENTER
\# -------------
\# *Argument:
\# <what to put in the centre position of page header/footers>
\# *Function:
\# Creates or modifies string $HDRFTR_CENTER.
\# Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
\# overrides the $HDRFTR_CENTER string created by default
\# in COPYSTYLE.
\# *Notes:
\# Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
\# CHAPTER, draft and revision number if COPYSTYLE DRAFT.
\#
\# If the argument is the # character, simply prints the current
\# page number.
\#
\# If the user wants to incorporate the page number into the string,
\# \*[PAGE#] must be used. For example, if the user wants to put
\# an ellipsis before the page number in the string, s/he should use
\# ...\*[PAGE#], not ...#
\#
.MAC HDRFTR_CENTER END
. nr #USER_DEF_HDRFTR_CENTER 1
. if '\\$0'HEADER_CENTER' \{\
. ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
. ds $HDRFTR_CENTER_NEW \\$1
. \}
. if '\\$0'FOOTER_CENTRE' \{\
. ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
. ds $HDRFTR_CENTER_NEW \\$1
. \}
. ie '\\$1'TOC' .ds $TOC_HDRFTR_CENTER \\$2
. el .ds $HDRFTR_CENTER \\$1
.END
\#
\# HDRFTR CENTER CAPS AND SMALLCAPS
\# --------------------------------
\# *Argument:
\# <none> | <anything>
\# *Function:
\# Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
\# the document) on or off.
\# *Notes:
\# Default is on.
\#
.MAC HDRFTR_CENTER_SMALLCAPS END
. if \\n[#HDRFTR_CENTER_SMALLCAPS]=1 \
. CAPS_SMALLCAPS_WARNING CENTER
. ie '\\$1'' .nr #HDRFTR_CENTER_SMALLCAPS 1
. el \
. nr #HDRFTR_CENTER_SMALLCAPS 0
.END
\#
\# HDRFTR CENTER PADDING
\# ---------------------
\# *Argument:
\# LEFT | RIGHT <amount of padding to put left or right of hdrftr
\# center string>
\# *Function:
\# Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
\# #HDRFTR_CTR_PAD_RIGHT.
\# *Notes:
\# By default, the HDRFTR_CENTER string is centered on the doc
\# line length. Long titles or long author names can screw up
\# visual centering, or create overprints. This macro allows the
\# user to pad the center string by the specified amount of space
\# to fix these problems.
\#
\# A unit of measure is required.
\#
.MAC HDRFTR_CENTER_PAD END
. if '\\$1'LEFT' .nr #HDRFTR_CTR_PAD_LEFT (\\$2)
. if '\\$1'RIGHT' .nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
.END
\#
\# SWITCH HDRFTR CENTER PADDING SIDE (support macro)
\# -------------------------------------------------
\# *Argument:
\# <none>
\# *Function:
\# Switches the padding side of hdrftr center padding.
\# *Notes:
\# Required to keep spacing around hdrftr string constant
\# in recto/verso documents.
\#
.MAC SWITCH_HDRFTR_CENTER_PAD END
. nr #HDRFTR_CTR_PAD_TMP \\n[#HDRFTR_CTR_PAD_LEFT]
. HDRFTR_CENTER_PAD LEFT \\n[#HDRFTR_CTR_PAD_RIGHT]u
. HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
.END
\#
\# HDRFTR RIGHT
\# ------------
\# *Argument:
\# <what to put in the right position of page header/footers>
\# *Function:
\# Creates or modifies string $HDRFTR_RIGHT.
\# Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
\# overrides the $HDRFTR_RIGHT string created by default
\# in DEFAULTS.
\# *Notes:
\# Default is document title.
\#
\# If the argument is the # character, simply prints the current
\# page number.
\#
\# If the user wants to incorporate the page number into the string,
\# \*[PAGE#] must be used. For example, if the user wants to put
\# an ellipsis before the page number in the string, s/he should use
\# ...\*[PAGE#], not ...#
\#
.MAC HDRFTR_RIGHT END
. nr #USER_DEF_HDRFTR_RIGHT 1
. ds $HDRFTR_RIGHT \\$1
.END
\#
\# HDRFTR RIGHT CAPS AND SMALLCAPS
\# -------------------------------
\# *Argument:
\# <none> | <anything>
\# *Function:
\# Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
\# the document) on or off.
\# *Notes:
\# Default is on.
\#
.MAC HDRFTR_RIGHT_SMALLCAPS END
. if \\n[#HDRFTR_RIGHT_SMALLCAPS]=1 \
. CAPS_SMALLCAPS_WARNING RIGHT
. ie '\\$1'' .nr #HDRFTR_RIGHT_SMALLCAPS 1
. el \
. nr #HDRFTR_RIGHT_SMALLCAPS 0
.END
\#
\# HDRFTR RULE
\# -----------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
\# under the header/over the footer. Otherwise, turns HDRFTR_RULE
\# on or off.
\#
.MAC HDRFTR_RULE END
. if r #HEADERS_ON \
. if \\n[#HEADERS_ON]=1 .nr #HDRFTR_RULE_GAP \\n[#HEADER_RULE_GAP]
. if r #FOOTERS_ON \
. if \\n[#FOOTERS_ON]=1 .nr #HDRFTR_RULE_GAP \\n[#FOOTER_RULE_GAP]
. if '\\$0'HDRFTR_RULE_INTERNAL' \{\
. ie \\n[#USERDEF_HDRFTR] \{\
. nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
. if \\n[#HEADERS_ON] \{\
. rt \\n[y]u
. ALD \\n[#HDRFTR_RULE_GAP]u
. nr #HDRFTR_RULE_WEIGHT \\n[#HEADER_RULE_WEIGHT]
. nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT_ADJ]
. \}
. if \\n[#FOOTERS_ON] \{\
. rt \\n[y]u
. RLD \
\\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+\\n[#FOOTER_RULE_WEIGHT]u
. nr #HDRFTR_RULE_WEIGHT \\n[#FOOTER_RULE_WEIGHT]
. nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT_ADJ]
. \}
. ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
\m[\\*[$HDRFTR_RULE_COLOR]]\
\D't \\n[#HDRFTR_RULE_WEIGHT]u'\
\h'|0'\
\v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
\D'l \\n[#DOC_L_LENGTH]u 0'\
\D't \\n[#RULE_WEIGHT]u'\
\h'-\\n[#RULE_WEIGHT]u'\
\m[]
. \}
. el \{\
\D't \\n[#HDRFTR_RULE_WEIGHT]u'\
\h'|0'\
\v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
\D'l \\n[#DOC_L_LENGTH]u 0'\
\D't \\n[#RULE_WEIGHT]u'\
\h'-\\n[#RULE_WEIGHT]u'
. \}
. br
. \}
. el \{\
. if \\n[#PRINT_STYLE]=1 .nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
. if \\n[#PRINT_STYLE]=2 \{\
. ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \
. nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
. el .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT]
. ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \
. nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
. el .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT]
. \}
. if \\n[#HEADERS_ON] \{\
. rt \\n[y]u
. ALD \\n[#HDRFTR_RULE_GAP]u
. nr #HDRFTR_RULE_WEIGHT \\n[#HEADER_RULE_WEIGHT]
. nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT_ADJ]
. \}
. if \\n[#FOOTERS_ON] \{\
. rt \\n[y]u
. RLD \
\\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+\\n[#FOOTER_RULE_WEIGHT]u
. nr #HDRFTR_RULE_WEIGHT \\n[#FOOTER_RULE_WEIGHT]
. nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT_ADJ]
. \}
. ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
\m[\\*[$HDRFTR_RULE_COLOR]]\
\D't \\n[#HDRFTR_RULE_WEIGHT]u'\
\h'|0'\
\v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
\D'l \\n[#DOC_L_LENGTH]u 0'\
\D't \\n[#RULE_WEIGHT]u'\
\h'-\\n[#RULE_WEIGHT]u'\
\m[]
. \}
. el \{\
\D't \\n[#HDRFTR_RULE_WEIGHT]u'\
\h'|0'\
\v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
\D'l \\n[#DOC_L_LENGTH]u 0'\
\D't \\n[#RULE_WEIGHT]u'\
\h'-\\n[#RULE_WEIGHT]u'
. \}
. br
. \}
. \}
. if '\\$0'HEADER_RULE' \{\
. ie '\\$1'' \{\
. nr #HEADER_RULE 1
. nr #HDRFTR_RULE 1
. \}
. el \{\
. nr #HEADER_RULE 0
. nr #HDRFTR_RULE 0
. \}
. \}
. if '\\$0'FOOTER_RULE' \{\
. ie '\\$1'' \{\
. nr #FOOTER_RULE 1
. nr #HDRFTR_RULE 1
. \}
. el \{\
. nr #FOOTER_RULE 0
. nr #HDRFTR_RULE 0
. \}
. \}
. if '\\$0'HDRFTR_RULE' \{\
. ie '\\$1'' .nr #HDRFTR_RULE 1
. el .nr #HDRFTR_RULE 0
. \}
.END
.
.ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
\#
\# HDRFTR PLAIN
\# ------------
\# *Arguments:
\# <none>
\# *Function:
\# Sets the family, font, and point size of all strings in
\# header/footers to the same family and point size as running
\# text. Font for the header/footer becomes roman throughout.
\#
.MAC HDRFTR_PLAIN END
. nr #HDRFTR_PLAIN 1
. rm $HDRFTR_FAMILY
. rm #HDRFTR_PT_SIZE
. rm $HDRFTR_COLOR
. rm $HDRFTR_LEFT_FAMILY
. rm $HDRFTR_LEFT_FONT
. rm $HDRFTR_LEFT_SIZE_CHANGE
. rr #HDRFTR_LEFT_CAPS
. rr #HDRFTR_LEFT_SMALLCAPS
. rr #HDRFTR_LEFT_COLOR
. rm $HDRFTR_CENTER_FAMILY
. rm $HDRFTR_CENTER_FONT
. rm $HDRFTR_CENTER_SIZE_CHANGE
. rr #HDRFTR_CENTER_CAPS
. rr #HDRFTR_CENTER_SMALLCAPS
. rr #HDRFTR_CENTER_COLOR
. rm $HDRFTR_RIGHT_FAMILY
. rm $HDRFTR_RIGHT_FONT
. rm $HDRFTR_RIGHT_SIZE_CHANGE
. rr #HDRFTR_RIGHT_CAPS
. rr #HDRFTR_RIGHT_SMALLCAPS
. rr #HDRFTR_RIGHT_COLOR
.END
\#
\# SWITCH HDRFTR
\# -------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Creates or modifies register #SWITCH_HDRFTR, used to switch
\# default location of HDRFTR_LEFT and HDRFTR_RIGHT.
\# *Notes:
\# Default is OFF.
\#
\# Typically, the author string appears at the left of header/footers,
\# and the title string appears at the right. This switches the
\# location of the two. Useful in conjunction with RECTO_VERSO to tweak
\# switches on alternate pages to come out as the user wishes. The
\# assumption of RECTO_VERSO is that the first page of the document
\# (recto) is odd, and even though it has no header/footer, if it did
\# have one, it would print as AUTHOR...CENTER...TITLE (or whatever
\# strings the user has supplied for HDRFTR_LEFT/RIGHT), meaning that
\# the next page, which does have a header/footer, will come out as
\# TITLE...CENTER...AUTHOR (or whatever strings the user has supplied
\# for HDRFTR_LEFT/RIGHT). SWITCH_HDRFTRS allows the user to get the
\# desired string in the desired place on the desired recto/verso page.
\#
.MAC SWITCH_HDRFTR END
. ie '\\$1'' .nr #SWITCH_HDRFTR 1
. el .nr #SWITCH_HDRFTR 0
.END
\#
\# USER DEFINED HDRFTR RECTO
\# -------------------------
\# *Arguments:
\# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
\# *Function:
\# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
\# stores string in $USERDEF_HDRFTR_RECTO.
\# *Notes:
\# For use when users don't want 3-part headers/footers, but rather
\# want to design their own headers/footers and need different
\# headers/footers on recto and verso pages. Using just
\# HEADER_RECTO or FOOTER_RECTO, even when recto/verso is not on,
\# allows users to design their own headers/footers for doc pages.
\#
.MAC HDRFTR_RECTO END
. nr #USERDEF_HDRFTR 1
. ds $QUAD_TYPE \\$1
. substring $QUAD_TYPE 0 0
. if '\\*[$QUAD_TYPE]'L' .nr #USERDEF_HDRFTR_RECTO_QUAD 1
. if '\\*[$QUAD_TYPE]'C' .nr #USERDEF_HDRFTR_RECTO_QUAD 2
. if '\\*[$QUAD_TYPE]'R' .nr #USERDEF_HDRFTR_RECTO_QUAD 3
. shift
. ie '\\$1'CAPS' \{\
. nr #HDRFTR_RECTO_CAPS 1
. ds $USERDEF_HDRFTR_RECTO \\$2
. \}
. el .ds $USERDEF_HDRFTR_RECTO \\$1
.END
\#
\# USER DEFINED HDRFTR VERSO
\# -------------------------
\# *Arguments:
\# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
\# *Function:
\# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
\# stores string in $USERDEF_HDRFTR_VERSO.
\# *Notes:
\# For use when users don't want 3-part headers/footers, but rather
\# want to design their own headers/footers and need different
\# headers/footers on recto and verso pages.
\#
.MAC HDRFTR_VERSO END
. nr #USERDEF_HDRFTR 1
. ds $QUAD_TYPE \\$1
. if !'\\*[$QUAD_TYPE]'' .substring $QUAD_TYPE 0 0
. if '\\*[$QUAD_TYPE]'L' .nr #USERDEF_HDRFTR_VERSO_QUAD 1
. if '\\*[$QUAD_TYPE]'C' .nr #USERDEF_HDRFTR_VERSO_QUAD 2
. if '\\*[$QUAD_TYPE]'R' .nr #USERDEF_HDRFTR_VERSO_QUAD 3
. shift
. ie '\\$1'CAPS' \{\
. nr #HDRFTR_VERSO_CAPS 1
. ds $USERDEF_HDRFTR_VERSO \\$2
. \}
. el .ds $USERDEF_HDRFTR_VERSO \\$1
.END
\#
\# PRINT FOOTER ON FIRST PAGE
\# --------------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Toggles register #PRINT_FOOTER_ON_PAGE_1
\# *Notes:
\# Lets user choose whether to print footer on first
\# page of doc.
\#
.MAC FOOTER_ON_FIRST_PAGE END
. ie '\\$1'' .nr #PRINT_FOOTER_ON_PAGE_1 1
. el .rr #PRINT_FOOTER_ON_PAGE_1
.END
\#
\# PRINT PAGE NUMBER ON FIRST PAGE
\# -------------------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Toggles register #PRINT_PAGENUM_ON_PAGE_1
\# *Notes:
\# Lets user choose whether to print page number on first
\# page of doc and after collate when footers are on or page numbering
\# has been user set at top of page.
\#
.MAC PAGENUM_ON_FIRST_PAGE END
. ie '\\$1'' .nr #PRINT_PAGENUM_ON_PAGE_1 1
. el .rr #PRINT_PAGENUM_ON_PAGE_1
.END
\#
\# PRINT HEADER/FOOTER
\# -------------------
\# *Arguments:
\# <none>
\# *Function:
\# Based on defaults or values entered by user, prints a
\# three-part title at either the top or the bottom of the page.
\# *Notes:
\# Called from within either HEADER or FOOTER.
\#
.MAC PRINT_HDRFTR END
. if \\n[#DOC_TYPE]=4 .nr #SUITE \En[.pn]
. if \\n[#FOOTERS_ON] \{\
. if \\n[#START_FOR_FOOTERS] \{\
. rr #START_FOR_FOOTERS
. if \\n[#DOC_TYPE]=5 \{\
. if !\\n[#HDRFTR_BOTH] .PRINT_USERDEF_HDRFTR
. return
. \}
. if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{\
. ie !\\n[#HDRFTR_BOTH] .return
. el \{\
. rr #FOOTERS_ON
. if !\\n[#COLLATE] .nr #HEADERS_ON 1
. ie \\n[#HEADER_RULE]=1 .HEADER_RULE
. el .HEADER_RULE OFF
. ie \\n[#HDRFTR_BOTH] .HEADER_VERSO \\*[$HDR_VERSO_QUAD] "\\*[$HDR_VERSO_STRING]"
. el .HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
. return
. \}
. \}
. \}
. \}
. if \\n[#USERDEF_HDRFTR] \{\
. PRINT_USERDEF_HDRFTR
. return
. \}
. if \\n[#SWITCH_HDRFTR] \{\
. ds $HDRFTR_TMP_SWITCH \\*[$HDRFTR_LEFT]
. ds $HDRFTR_LEFT \\*[$HDRFTR_RIGHT]
. ds $HDRFTR_RIGHT \\*[$HDRFTR_TMP_SWITCH]
. ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
. ds $HDRFTR_LEFT_SIZE_CHANGE \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
. ds $HDRFTR_RIGHT_SIZE_CHANGE \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
. nr #HDRFTR_TMP_CAPS_SWITCH \\n[#HDRFTR_LEFT_CAPS]
. nr #HDRFTR_LEFT_CAPS \\n[#HDRFTR_RIGHT_CAPS]
. nr #HDRFTR_TMP_SMALLCAPS_SWITCH \\n[#HDRFTR_LEFT_SMALLCAPS]
. nr #HDRFTR_LEFT_SMALLCAPS \\n[#HDRFTR_RIGHT_SMALLCAPS]
. nr #HDRFTR_RIGHT_CAPS \\n[#HDRFTR_TMP_CAPS_SWITCH]
. ds $HDRFTR_TMP_COLOR_SWITCH \\*[$HDRFTR_LEFT_COLOR]
. ds $HDRFTR_LEFT_COLOR \\*[$HDRFTR_RIGHT_COLOR]
. ds $HDRFTR_RIGHT_COLOR \\*[$HDRFTR_TMP_COLOR_SWITCH]
. rr #HDRFTR_TMP_CAPS_SWITCH
. rm $HDRFTR_TMP_SWITCH
. rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
. rm $HDRFTR_TMP_COLOR_SWITCH
. nr #SWITCH_HDRFTR 0
. \}
. nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
. if \\n[#ENDNOTES] .PAGENUM_STYLE \\*[$EN_PN_STYLE]
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
. nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
. di
. \}
. if o .RIGHT
. if e .LEFT
. if \\n[#RECTO_VERSO]=0 .LEFT
. if \\n[#HDRFTR_LEFT_CAPS] .CAPS
. ie '\\*[$HDRFTR_LEFT]'#' .PRINT \\n[#PAGENUMBER]
. el \{\
. ie !'\\*[$HDRFTR_LEFT]'' .PRINT \\*[$HDRFTR_LEFT]
. el .PRINT \&
. \}
. if \\n[#HDRFTR_LEFT_CAPS] .CAPS OFF
. CENTER
. if \\n[#HDRFTR_CENTER_CAPS] .CAPS
. rt \\n[y]u
. ie '\\*[$HDRFTR_CENTER]'#' .PRINT \
\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
. el \{\
. ie !'\\*[$HDRFTR_CENTER]'' .PRINT \
\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
. el .PRINT \&
. \}
. if \\n[#HDRFTR_CENTER_CAPS] .CAPS OFF
. if o .LEFT
. if e .RIGHT
. if \\n[#RECTO_VERSO]=0 .RIGHT
. if \\n[#HDRFTR_RIGHT_CAPS] .CAPS
. rt \\n[y]u
. ie '\\*[$HDRFTR_RIGHT]'#' .PRINT \\n[#PAGENUMBER]
. el \{\
. ie !'\\*[$HDRFTR_RIGHT]'' .PRINT \\*[$HDRFTR_RIGHT]
. el .PRINT \&
. \}
. if \\n[#HDRFTR_RIGHT_CAPS] .CAPS OFF
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. if \\n[#HDRFTR_COLOR]=1 \{\
. nf
\m[\\*[$HDRFTR_COLOR]]
. \}
. fam \\*[$HDRFTR_LEFT_FAM]
. ft \\*[$HDRFTR_LEFT_FT]
. ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
. nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
. di
. \}
. if o .LEFT
. if e .RIGHT
. if \\n[#RECTO_VERSO]=0 .LEFT
. if \\n[#HDRFTR_LEFT_SMALLCAPS] .SMALLCAPS
. if \\n[#HDRFTR_LEFT_CAPS] .CAPS
. ie '\\*[$HDRFTR_LEFT]'#' \{\
. ie \\n[#HDRFTR_LEFT_COLOR]=1 \
. PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\n[#PAGENUMBER]\m[]
. el \
. PRINT \\n[#PAGENUMBER]
. \}
. el \{\
. ie !'\\*[$HDRFTR_LEFT]'' \{\
. ie \\n[#HDRFTR_LEFT_COLOR]=1 \
. PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\*[$HDRFTR_LEFT]\m[]
. el \
. PRINT \\*[$HDRFTR_LEFT]
. \}
. el .nop \&
. \}
. if \\n[#HDRFTR_LEFT_CAPS] .CAPS OFF
. if \\n[#HDRFTR_LEFT_SMALLCAPS] .SMALLCAPS OFF
. fam \\*[$HDRFTR_CENTER_FAM]
. ft \\*[$HDRFTR_CENTER_FT]
. ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
. nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
. di
. \}
. CENTER
. if \\n[#HDRFTR_CENTER_SMALLCAPS] .SMALLCAPS
. if \\n[#HDRFTR_CENTER_CAPS] .CAPS
. rt \\n[y]u
. ie '\\*[$HDRFTR_CENTER]'#' \{\
. ie \\n[#HDRFTR_CENTER_COLOR]=1 .PRINT \
\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\
\\n[#PAGENUMBER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
. el .PRINT \
\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
. \}
. el \{\
. ie !'\\*[$HDRFTR_CENTER]'' \{\
. ie \\n[#HDRFTR_CENTER_COLOR]=1 .PRINT \
\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\
\\*[$HDRFTR_CENTER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
. el .PRINT \
\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
. \}
. el .PRINT \&
. \}
. if \\n[#HDRFTR_CENTER_CAPS] .CAPS OFF
. if \\n[#HDRFTR_CENTER_SMALLCAPS] .SMALLCAPS OFF
. fam \\*[$HDRFTR_RIGHT_FAM]
. ft \\*[$HDRFTR_RIGHT_FT]
. ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
. nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
. di
. \}
. if o .RIGHT
. if e .LEFT
. if \\n[#RECTO_VERSO]=0 .RIGHT
. if \\n[#HDRFTR_RIGHT_SMALLCAPS] .SMALLCAPS
. if \\n[#HDRFTR_RIGHT_CAPS] .CAPS
. rt \\n[y]u
. ie '\\*[$HDRFTR_RIGHT]'#' \{\
. ie \\n[#HDRFTR_RIGHT_COLOR]=1 \
. PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\n[#PAGENUMBER]\m[]
. el \
. PRINT \\n[#PAGENUMBER]
. \}
. el \{\
. ie !'\\*[$HDRFTR_RIGHT]'' \{\
. ie \\n[#HDRFTR_RIGHT_COLOR]=1 \
. PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\*[$HDRFTR_RIGHT]\m[]
. el \
. PRINT \\*[$HDRFTR_RIGHT]
. \}
. el .PRINT \&
. \}
. if \\n[#HDRFTR_RIGHT_CAPS] .CAPS OFF
. if \\n[#HDRFTR_RIGHT_SMALLCAPS] .SMALLCAPS OFF
. \}
. if \\n[#HDRFTR_RULE] .HDRFTR_RULE_INTERNAL
. br
.END
\#
\# PRINT USER DEFINED HEADER/FOOTER
\# --------------------------------
\# *Arguments:
\# <none>
\# *Function:
\# Based on defaults or values entered by user, prints a single part
\# (i.e. not 3-part) title at either the top or the bottom of the page.
\# *Notes:
\# Called from within PRINT_HDRFTR.
\#
.MAC PRINT_USERDEF_HDRFTR END
. nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
. fc ^ #
. if \\n[#PRINT_STYLE]=2 \{\
. fam \\*[$HDRFTR_FAM]
. ft R
. ps \\n[#HDRFTR_PT_SIZE]u
. if \\n[#HDRFTR_COLOR]=1 \{\
. nf
. COLOR \\*[$HDRFTR_COLOR]
. \}
. \}
. ie \\n[#RECTO_VERSO] \{\
. if o \{\
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 .LEFT
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 .CENTER
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 .RIGHT
. if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS
. if '\\n[.ev]'FOOTER' .vs 0
. PRINT \\*[$USERDEF_HDRFTR_RECTO]
. if '\\n[.ev]'FOOTER' .vs
. if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS OFF
. EOL
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
. nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
. di
. \}
. \}
. if e \{\
. ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
. if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 .LEFT
. if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 .CENTER
. if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 .RIGHT
. if \\n[#HDRFTR_VERSO_CAPS]=1 .CAPS
. if '\\n[.ev]'FOOTER' .vs 0
. PRINT \\*[$USERDEF_HDRFTR_VERSO]
. if '\\n[.ev]'FOOTER' .vs
. if \\n[#HDRFTR_VERSO_CAPS]=1 .CAPS OFF
. EOL
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
. nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
. di
. \}
. \}
. el \{\
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 .LEFT
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 .CENTER
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 .RIGHT
. if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS
. if '\\n[.ev]'FOOTER' .vs 0
. PRINT \\*[$USERDEF_HDRFTR_RECTO]
. if '\\n[.ev]'FOOTER' .vs
. if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS OFF
. EOL
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
. nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
. di
. \}
. \}
. \}
. \}
. el \{\
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 .LEFT
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 .CENTER
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 .RIGHT
. if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS
. if '\\n[.ev]'FOOTER' .vs 0
. if !r #SKIP .PRINT \\*[$USERDEF_HDRFTR_RECTO]
. if '\\n[.ev]'FOOTER' .vs
. if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS OFF
. EOL
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
. nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
. di
. \}
. \}
. fc
. if \\n[#PRINT_STYLE]=2 \{\
. ie \\n[#HDRFTR_COLOR]=1 \m[\\*[$HDRFTR_COLOR]]
. el \m[black]
. \}
. if \\n[#HDRFTR_RULE] \
. HDRFTR_RULE_INTERNAL
.END
\#
\# +++HEADERS+++
\#
\# HEADERS (off or on)
\# -------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Turns headers at the top of the page off or on.
\# *Notes:
\# Default is on.
\#
.MAC HEADERS END
. ie '\\$1'' .nr #HEADERS_ON 1
. el .nr #HEADERS_ON 0
.END
\#
\# HEADER MARGIN
\# -------------
\# *Argument:
\# <amount of space between top of page and header>
\# *Function:
\# Creates or modifies register #HEADER_MARGIN to hold amount
\# of space between top of page and header.
\# *Notes:
\# Requires unit of measure. Default is 4P+6p, measured top-of-page
\# to baseline.
\#
.MAC HEADER_MARGIN END
. nr #HEADER_MARGIN (\\$1)
.END
\#
\# HEADER GAP
\# ----------
\# *Argument:
\# <amount of space between header and running text>
\# *Function:
\# Creates or modifies register #HEADER_GAP to hold amount
\# of space between header and running text.
\# *Notes:
\# Default is 1P+6p.
\#
.MAC HEADER_GAP END
. nr #HEADER_GAP (\\$1)
.END
\#
\# HEADER
\# ------
\# *Arguments:
\# <none>
\# *Function:
\# Resets margin notes, processes footnote and margin note
\# leftover, takes care of recto-verso, prepares for columns after
\# first, determines whether to flex-space the page,,outputs
\# deferred floats, and does some tbl magic. If headers are
\# enabled, prints header appropriate to DOC_TYPE, PRINTSTYLE, and
\# COPYSTYLE.
\#
.MAC HEADER END
. vpt 0
. if \\n[#DOC_TYPE]=5 \{\
. if \\n[#SLIDE_FOOTERS] \{\
. PRINT_FOOTER
. if \\n[#HDRFTR_BOTH] \
. HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
. \}
. \}
. nr flex-spaces 0
. nr flex +1
. if \\n[#NEW_DOC_PT_SIZE] .nr #DOC_PT_SIZE \\n[#NEW_DOC_PT_SIZE]
. rr #NEW_DOC_PT_SIZE
. if \\n[#RESET_TRAPS] \{\
. TRAPS
. if \\n[#REMOVE_ADJ] .nr #DOC_LEAD -\\n[#DOC_LEAD_ADJ]
. \}
. rr #REMOVE_ADJ
. rr #RESET_TRAPS
. MNtop
. rr #FROM_FOOTER
. nr #FROM_HEADER 1
. nr #LAST_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]
. if \\n[#FN_DEPTH] .PROCESS_FN_LEFTOVER
. rr #RULED
. if \\n[#RESET_FN_NUMBER] .nr #FN_NUMBER 0 1
. if !\\n[#DIVERTED] .rr #PREV_FN_DEFERRED
. po \\n[#DOC_L_MARGIN]u
. if \\n[#RECTO_VERSO] \{\
. if !\\n[#TOC_RV_SWITCH]=2 \{\
. nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
. DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u
. if \\n[#CROPS] .DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u+\\n[cropmarks]u
. DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
. if \\n[#CROPS] .DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u-\\n[cropmarks]u
. SWITCH_HDRFTR_CENTER_PAD
. \}
. \}
. ev HEADER
. if \\n[#PAGE_NUM_V_POS]=1 .vs 0
. sp |\\n[#HEADER_MARGIN]u-1v
. mk y
. ll \\n[#DOC_L_LENGTH]u
. ta \\n[.l]u
. if \\n[#PRINT_STYLE]=1 \{\
. fam \\*[$TYPEWRITER_FAM]
. ft R
. ps \\*[$TYPEWRITER_PS]\\*[$HDRFTR_SIZE_CHANGE]
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. fam \\*[$HDRFTR_FAM]
. ft R
. ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
. \}
. nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
. if \\n[#CAPS_ON] \{\
. nr #CAPS_WAS_ON 1
. CAPS OFF
. \}
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#ENDNOTES]=1 \{\
.\" Single-spaced endnotes have a different lead
. if \\n[#EN_SINGLESPACE] \{\
. nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
. nr #DOC_LEAD \\n[#EN_LEAD]u
. \}
. \}
. \}
. if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
. sp -1v
. if \\n[#DOC_TYPE]=5 \{\
. if \\n[#SLIDE_HEADERS] \{\
. HEADERS
. if \\n[#SLIDE_FOOTERS] \{\
. FOOTERS off
.\" So rule prints after header on first page
. if !r #SKIP_RULE \{\
. sp
. if \\n[#HEADER_RULE] .HEADER_RULE
. nr #SKIP_RULE 1
. \}
. \}
. \}
. \}
. ie \\n[#HEADERS_ON] .PRINT_HDRFTR
. el \{\
. if \\n[#PAGE_NUM_V_POS]=1 \
. if \\n[#PAGINATE] .PRINT_PAGE_NUMBER
. \}
. sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#ENDNOTES]=1 \{\
. if \\n[#EN_SINGLESPACE] \{\
. nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
. rr #RESTORE_DOC_LEAD
. \}
. \}
. \}
. nr #PAGE_TOP \\n[nl]
. ev
.\" PDF boxes
. if \\n[pdfbx-running]=1 \{\
. if !\\n[pdfbx-div-start] \{\
. ps \\n[#SIZE_AT_FOOTER]u
. SIZESPECS
. ds pdfbx-cap-adj \\*[$CAP_HEIGHT]
. ps
. sp |\\n[t]u-\\n[#LEAD_AT_FOOTER]u
. sp (\\*[wt\\n[stack]]/2u)+\\*[pdfbx-cap-adj]+\\*[gap\\n[stack]]u
. ch FOOTER \\n[#VFP\\n[stack]]u
. \}
. \}
. po \\n[#L_MARGIN]u
. if \\n[#RECTO_VERSO] .nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
. if \\n[#CAPS_WAS_ON] \{\
. CAPS
. rr #CAPS_WAS_ON
. \}
. if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
. if \\n[#QUOTE] \{\
. ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
. el \{\
. ie r #\\*[BQ]_OFFSET_VALUE .nr #\\*[BQ]_OFFSET \
\\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#\\*[BQ]_OFFSET_VALUE])
. el .nr #\\*[BQ]_OFFSET \\n[#L_MARGIN]+\\*[$\\*[BQ]_OFFSET_VALUE]
. ie \\n[#QUOTE]=1 \{\
. if !'\\*[$Q_QUAD]'CENTER' \
. if !'\\*[$Q_QUAD]'RIGHT' \
. po \\n[#Q_OFFSET]u
. \}
. el .po \\n[#\\*[BQ]_OFFSET]u
. \}
. if !\\n[pdfbx-running]=0 \{\
. if \\n[#PRINT_STYLE]=2 .sp \\n[#Q_LEAD_DIFF]u
. \}
. \}
. if \\n[#IN_LIST] \
. po +\\n[#LIST_OFFSET_VALUE]u
. if \\n[#RESET_FN_COUNTERS]=1 \{\
. rr #RESET_FN_COUNTERS
. PROCESS_FN_IN_DIVER
. nr #FN_COUNT \\n[#SAVED_FN_COUNT] 1
. if \\n[#COLUMNS]=1 .nr #FN_COUNT_FOR_COLS \\n[#SAVED_FN_COUNT_FOR_COLS] 1
. ie \\n[#RESET_FN_NUMBER]=1 .nr #FN_NUMBER \\n[#SAVED_FN_NUMBER] 1
. el .nr #FN_NUMBER \\n[#FN_NUMBER] 1
. rm FN_IN_DIVER
. if dRUNON_FN_IN_DIVER .rm RUNON_FN_IN_DIVER
. \}
. if \\n[#EPIGRAPH] \{\
. ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
. el \{\
. ie r#EPI_OFFSET_VALUE \
. nr #EPI_OFFSET \
\\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
. el \
. nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
. po \\n[#EPI_OFFSET]u
. \}
. \}
. ie \\n[#EPIGRAPH] \{\
. ie !\\n[#EPI_ACTIVE] \{\
. ns
. rr #EPI_ACTIVE
. \}
. el \{\
. ie \\n[#EPI_FITS] .ns
. el .sp \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u
. \}
. \}
. el .ns
. if \\n[#COLUMNS] \{\
. nr #FN_COUNT_FOR_COLS 0 1
. nr #L_MARGIN \\n[#DOC_L_MARGIN]
. if \\n[#RECTO_VERSO] .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u
. nr #COL_NUM 0 1
. mk dc
. po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n[.o]
. if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
. ll \\n[#COL_L_LENGTH]u
. ta \\n[.l]u
. if \\n[#QUOTE] \{\
. ie \\n[#\\*[BQ]_OFFSET_VALUE] \
. po +(\\n[#PP_INDENT]u*\\n[#\\*[BQ]_OFFSET_VALUE]u)
. el \
. po +\\*[$\\*[BQ]_OFFSET_VALUE]
. \}
. if \\n[#EPIGRAPH] \{\
. if \\n[#EPI_ACTIVE] \{\
. ie \\n[#EPI_FITS] .
. el .nr dc -\\n[#EPI_LEAD_DIFF]
. \}
. ie r#EPI_OFFSET_VALUE \{\
. po \
\\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
. \}
. el .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+\\*[$EPI_OFFSET_VALUE]
. \}
. \}
. rr #FROM_HEADER
. rr #DEFER_SPACE_ADDED
. if !\\n[#FN_DEPTH] .if r #DIVERTED .rr #DIVERTED
. if \\n[#MN_OVERFLOW_LEFT]=1 \{\
. MN LEFT
. nf
. MN_OVERFLOW_LEFT
. MN
. \}
. if \\n[#MN_OVERFLOW_RIGHT]=1 \{\
. MN RIGHT
. nf
. MN_OVERFLOW_RIGHT
. MN
. \}
. rm MN_OVERFLOW_LEFT
. rr #MN_OVERFLOW_LEFT
. rr #no-repeat-MN-left
. rm MN_OVERFLOW_RIGHT
. rr #MN_OVERFLOW_RIGHT
. rr #no-repeat-MN-right
. if \\n[#PRE_COLLATE]=1 .rr #PRE_COLLATE
. if \\n[#UNDERLINE_WAS_ON]=1 \{\
. vs 0
. ie !n \
. nop \R'#UNDERLINE_ON 1'\X'ps: exec \\n[_w] \\n[_d] decorline'
. el .cu 1000
. br
. ns
. rr #UNDERLINE_WAS_ON
. \}
. if \\n[#RESTORE_PAGINATION] \{\
. PAGINATE
. rr #RESTORE_PAGINATION
. \}
. ch RR_@TOP
. ie \\n[tbl*have-header] .rr @TOP
. el .wh \\n[nl]u+1u RR_@TOP
. if \\n[#FLEX_ACTIVE] \{\
. if \\n[#RESTORE_FLEX] \{\
. rr #NO_FLEX
. rr #RESTORE_FLEX
. \}
. if \\n[#RESTORE_COL_FLEX] \{\
. rr #NO_FLEX
. rr #RESTORE_COL_FLEX
. \}
. \}
.\" Don't flex the last page/col, or the page/col before a COLLATE,
.\" NEWPAGE, COL_NEXT, or BLANKPAGE.
. if !dPDF.EXPORT \{\
. if \\n[#FLEX_ACTIVE] \
. if !\\n[#NO_FLEX] \
. nr #RESTORE_FLEX 1
. if '\\*[last-page]'\\n%@\\n[#COL_NUM]' \
. if !\\n[#NO_FLEX] .nr #NO_FLEX 1
. if '\\*[pre-collate-\\n%]'\\n%@\\n[#COL_NUM]' \
. if !\\n[#NO_FLEX] .nr #NO_FLEX 1
. if '\\*[pre-newpage-\\n%]'\\n%@\\n[#COL_NUM]' \
. if !\\n[#NO_FLEX] .nr #NO_FLEX 1
. if d page-\\n%@\\n[#COL_NUM] .nr #NO_FLEX 1
. \}
. ie \\n[defer] .PROCESS_FLOATS
. el \{\
.\" These two sets of conditions only occur if the .br in .TS causes
.\" a page break.
. if !\\n[doing-tbl] \{\
. if (\\n[tbl*have-caption]=1)&(\\n[tbl*caption-after-label]=0) \{\
. RESTORE_SPACE
. if !\\n[span] \{\
. ie \\n[#MLA] .sp \\n[tbl*label-lead-diff]u
. el .sp \\n[tbl*caption-lead-diff]u
. \}
. \}
. \}
. \}
.\" So tables without TH that don't fit don't overprint first row
.\" at top of page
. ie \\n[tbl*no-header] \{\
. rs
. nop \&
. vpt
. rr \\n[tbl*no-header]
. SHIM_1
. \}
. el .vpt
. if \\n[span] \{\
. ev FLOAT
. if \\n[#INDENT_LEFT_ACTIVE] .in \\n[#L_INDENT]u/2u
. nf
. RESTORE_SPACE
. if !\\n[tbl*no-top-hook] \
. if \\n[tbl*have-header:1] .tbl*print-header
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
. \}
. if !\\n[begin-tbl] \
. if !r tbl*no-top-hook .tbl@top-hook
. rr tbl*no-top-hook
. if r flex:force .rr flex:force
. rr ref*last
. if !\\n[float*defer] .ev 0
. if (\\n[pdfbx-running]=1):(\\n[#DOC_TYPE]=5) \{\
. rr @TOP
. ch RR_@TOP
. \}
. if \\n[pdfbx-running]=1 \
. ch FOOTER \\n[#VFP\\n[stack]]u
.END
\#
\# ====================================================================
\#
\# +++FOOTERS+++
\#
\# FOOTERS (off or on)
\# -------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Turns footers at the bottom of the page off or on.
\# *Notes:
\# Default is off. If on, page numbers automatically go at
\# the top, centered, unless pagination has been turned off,
\# or the pagenumber position has been changed to left or right.
\#
.MAC FOOTERS END
. ie '\\$1'' \{\
. rr #HEADERS_ON
. nr #FOOTERS_ON 1
. PAGENUM_POS TOP CENTER
. \}
. el .nr #FOOTERS_ON 0
.END
\#
\# FOOTER MARGIN
\# -------------
\# *Argument:
\# <footer margin>
\# *Function:
\# Creates or modifies register #FOOTER_MARGIN which holds the
\# amount of space to leave between the page number and the bottom
\# of the page.
\# *Notes:
\# Unit of measure required. Default is 3P.
\#
.MAC FOOTER_MARGIN END
. ie \\n%>0 .nr #FOOTER_MARGIN (\\$1)
. el .
.END
\#
\# FOOTER GAP
\# ----------
\# *Argument:
\# <distance from end of running text to page # or footer>
\# *Function:
\# Creates or modifies register #FOOTER_GAP which holds the
\# amount of space to leave between running text and the page number.
\# *Notes:
\# Requires unit of measure. Default is 3P. Measured baseline to
\# baseline.
\#
.MAC FOOTER_GAP END
. ie \\n%>0 .nr #FOOTER_GAP (\\$1)
. el .
.END
\#
\# FOOTER
\# ------
\# *Arguments:
\# <none>
\# *Function:
\# Gathers strings for flex-spacing, processes margin notes and
\# footnotes, prepares for move to next column or page. Places
\# footer at bottom of page if #FOOTERS=1, otherwise places page
\# number at bottom of page (if #PAGINATE=1). Page numbers are
\# in arabic or roman according to COPYSTYLE. DRAFT starts the
\# document at page 1 regardless of PAGENUMBER. FINAL respects
\# PAGENUMBER.
\#
.MAC FOOTER END
. if r #START .rr #START
. if \\n[pdfbx-running] \{\
. if \\n[#FN_COUNT] \{\
. nr pdfbx-fn-trap \\n[nl]+\\*[wt\\n[stack]]+\\*[gap\\n[stack]]
. nop \!x X pdf: background footnote \\n[pdfbx-fn-trap]z
. rr pdfbx-fn-trap
. \}
. \}
. CALCULATE_FLEX
. if \\n[#DOING_COVERTEXT] \{\
. tm1 "[mom]: COVERTEXT exceeds cover page depth.
. ab [mom]: Aborting '\\n[.F]'.
. \}
. vpt 0
. rr #LB_4_HD
. rr #QUOTE_4_HD
. nr #LEAD_AT_FOOTER \\n[.v]
. nr #SIZE_AT_FOOTER \\n[.ps]
. if !r pg-trans .nr pg-trans 0 1
. ev PAGE_TRANSITION\\n+[pg-trans]
. pdfmarksuspend
. ie !n .nop \X'ps: exec decornone'
. el .cu 0
. br
. if \\n[#UNDERLINE_ON]=1 .nr #UNDERLINE_WAS_ON 1
. if \\n[MN-left]>0 \{\
. if !\\n[#no-repeat-MN-left]=1 \{\
. MNbottom-left
. nr #no-repeat-MN-left 1
. \}
. if '\\n[.z]'MN_OVERFLOW_LEFT' \{\
. di
. nr #MN_OVERFLOW_LEFT 1
. rr #OVERFLOW_LEFT
. \}
. \}
. if \\n[MN-right]>0 \{\
. if !\\n[#no-repeat-MN-right]=1 .MNbottom-right
. if '\\n[.z]'MN_OVERFLOW_RIGHT' \{\
. di
. nr #MN_OVERFLOW_RIGHT 1
. rr #OVERFLOW_RIGHT
. \}
. \}
\# Table bottom hook, draws the table borders in
\# multipage boxed tables.
. tbl@bottom-hook
. ch MN_OVERFLOW_TRAP
. nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
. if !\\n[#FN_DEFER] \{\
. nr #DIVER_DEPTH 0
. if \\n[#FN_DEPTH] \{\
. if \\n[#DIVERTED]=3 .nr #FN_DEPTH +\\n[#VFP_DIFF]
. vpt 0
. sp \
|\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u-\\n[#DOC_LEAD]u)
. vpt
. po \\n[#DOC_L_MARGIN]u
. if \\n[#COLUMNS] \{\
. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n[.o]
. nr #FROM_FOOTER 1
. \}
. nf
. ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
. FOOTNOTES
. rm FOOTNOTES
. if d RUNON_FOOTNOTES .rm RUNON_FOOTNOTES
. if \\n[#PRINT_STYLE]=1 .vs \\n[#LEAD_AT_FOOTER]u
. if \\n[#PRINT_STYLE]=2 .vs \\n[#LEAD_AT_FOOTER]u
. if '\\n[.z]'FN_OVERFLOW' \{\
. di
. nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
. \}
. nr #FN_COUNT_AT_FOOTER \\n[#FN_COUNT]
. nr #FN_COUNT 0
. if \\n[#COL_NEXT] \{\
. ie !\\n[#COL_NUM]=\\n[#NUM_COLS] .nr #COL_NUM \\n-[#COL_NUM]
. el .nr #COL_NUM \\n[#NUM_COLS] 1
. \}
. \}
. rr #DIVERTED
. \}
. nr @TOP 1
. ie \\n[#COLUMNS]=1 \{\
. ie (\\n[#COL_NUM]=\\n[#NUM_COLS]):(\\n[#NEWPAGE]=1) \{\
. rr #NEWPAGE
. DO_FOOTER
. \}
. el \{\
. ie (\\n[#ENDNOTES]=1):(\\n[#BIBLIOGRAPHY]=1) \{\
. if \\n[#ENDNOTES] .sp |\\n[ec]u-\\n[#EN_LEAD]u
. if \\n[#BIBLIOGRAPHY] .sp |\\n[bc]u-\\n[#BIB_LEAD]u
. \}
. el \{\
. vs \\n[#LEAD_AT_FOOTER]u
. rt \\n[dc]u
. nr flex-spaces 0
. \}
. if d page-\\n%@\\n[#COL_NUM] \{\
. rr #NO_FLEX
. rr #RESTORE_COL_FLEX
. \}
. po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
. if !dPDF.EXPORT \{\
. if \\n[#FLEX_ACTIVE] \{\
. if !\\n[#NO_FLEX] \{\
. if '\\*[last-page]'\\n%@\\n[#COL_NUM]' \
. nr #NO_FLEX 1
. if '\\*[pre-collate]'\\n%@\\n[#COL_NUM]' \
. nr #NO_FLEX 1
. if '\\*[pre-newpage-\\n%]'\\n%@\\n[#COL_NUM]' \{\
. nr #NO_FLEX 1
. nr #RESTORE_FLEX 1
. \}
. if d page-\\n%@\\n[#COL_NUM] \{\
. nr #NO_FLEX 1
. nr #RESTORE_COL_FLEX 1
. \}
. \}
. \}
. \}
. nr #L_MARGIN \\n[.o]
. if \\n[#FN_DEPTH] .PROCESS_FN_LEFTOVER
. vs \\n[#LEAD_AT_FOOTER]u
. if \\n[#PREV_FN_DEFERRED] .nr #PREV_FN_DEFERRED 2
. rr #RULED
. if !\\n[#EPIGRAPH] .rr #COL_NEXT
. if !\\n[#QUOTE] .rr #COL_NEXT
. if \\n[#RESET_FN_COUNTERS]=1 \{\
. rr #RESET_FN_COUNTERS
. PROCESS_FN_IN_DIVER
. LS \\n[#LEAD_AT_FOOTER]u
. nr #FN_COUNT \\n[#FN_COUNT] 1
. nr #FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS] 1
. rm FN_IN_DIVER
. if dRUNON_FN_IN_DIVER .rm RUNON_FN_IN_DIVER
. \}
. rr #DEFER_SPACE_ADDED
. if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
. if \\n[#QUOTE] \{\
. ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
. el \{\
. ie \\n[#Q_OFFSET_VALUE] \
. nr #Q_OFFSET \
\\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
. el \
. nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
. if \\n[#COLUMNS] \{\
. ie \\n[#Q_OFFSET_VALUE] .nr #Q_OFFSET \
\\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
. el .nr #Q_OFFSET \
\\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$Q_OFFSET_VALUE]
. \}
. po \\n[#Q_OFFSET]u
. \}
. \}
. if \\n[#EPIGRAPH] \{\
. ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
. el \{\
. ie r#EPI_OFFSET_VALUE .nr #EPI_OFFSET \
\\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
. el .nr #EPI_OFFSET \
\\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
. if \\n[#COLUMNS] \{\
. ie r#EPI_OFFSET_VALUE .nr #EPI_OFFSET \
\\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
. el .nr #EPI_OFFSET \
\\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
. \}
. po \\n[#EPI_OFFSET]u
. \}
. \}
. ie \\n[tbl*interrupted] \{\
. tbl*print-header
. rr tbl*interrupted
. \}
. el .if !r tbl*no-top-hook .tbl@top-hook
. rr tbl*no-top-hook
. ie \\n[#EPIGRAPH] \{\
. ie !\\n[#EPI_ACTIVE] \{\
. ns
. rr #EPI_ACTIVE
. \}
. el \{\
. sp |\\n[dc]u+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
. rr #EPI_ACTIVE
. \}
. \}
. el .ns
. ev
. \}
. ns
. rr #DIVERTED
. ch RR_@TOP
. wh \\n[nl]u+1u RR_@TOP
. if \\n[tbl*have-header] .tbl@bottom-hook
. if \\n[defer] .PROCESS_FLOATS
. ie \\n[tbl*no-header] \{\
. rs
. nop \&
. vpt
. rr \\n[tbl*no-header]
. SHIM_1
. \}
. el .vpt
. if '\\n[.ev]'caption' .rs
. if \\n[tbl*interrupted] .tbl*print-header
. rr tbl*interrupted
. \}
. el .DO_FOOTER
. pdfmarkrestart
.END
\#
\# PROCESS FOOTER
\# --------------
\# *Arguments:
\# <none>
\# *Function:
\# Prints footer (page number, or 3-part footer).
\# Resets CAPS and UNDERLINE if they were on.
\#
.MAC DO_FOOTER END
.\" Kill pdfbackground if BoxStop causes a page break
. if r pdfbxstop \{\
. pdfbackground off
. rr pdfbx-running
. \}
.\" Part of workaround for refer spitting out a blank page if the
.\" last reference falls on the bottom line.
. if \\n[num*refs] \{\
. if \\n[ref*num]=\\n[num*refs] \{\
. rr num*refs
. nr ref*last 1
. \}
. \}
. ie !\\n[#DOC_TYPE]=5 .PRINT_FOOTER
. el .vpt
. if !\\n[ref*last] \{\
. ie \\n[defer]>0 \{\
\c
' bp
. \}
. el 'bp
. \}
.END
\#
.MAC PRINT_FOOTER END
. if r #SAVED_FOOTER_POS .ch FOOTER \\n[#SAVED_FOOTER_POS]u
. rr #SAVED_FOOTER_POS
. vpt 0
. sp -1
. ev FOOTER
. ie n \
. sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u
. el \
. sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-\\n[#FOOTER_ADJ]u
. mk y
. UNDERLINE OFF
. po \\n[#DOC_L_MARGIN]u
. ll \\n[#DOC_L_LENGTH]u
. ta \\n[.l]u
. if \\n[#PRINT_STYLE]=1 .TYPEWRITER
. if \\n[#PRINT_STYLE]=2 \{\
. fam \\*[$HDRFTR_FAM]
. ft R
. ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
. \}
. nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
. if \\n[#CAPS_ON] \{\
. nr #CAPS_WAS_ON 1
. CAPS OFF
. \}
. ie \\n[#FOOTERS_ON] \{\
. if !\\n[#SKIP_FOOTER]>0 .PRINT_HDRFTR
. if \\n[#HDRFTR_BOTH] \
. HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
. if \\n[#DOC_TYPE]=5 .FOOTERS
. \}
. el \{\
. if \\n[#PAGINATE] \{\
. if \\n[#PAGE_NUM_V_POS]=2 \
. if !\\n[#SKIP_FOOTER]>0 .PRINT_PAGE_NUMBER
. \}
. \}
. rr #SKIP_FOOTER
. if \\n[#CAPS_WAS_ON] \{\
. CAPS
. rr #CAPS_WAS_ON
. \}
. ev
. vpt
.END
\#
\# ====================================================================
\#
\# +++HEADERS AND FOOTERS+++
\#
\# HEADERS_AND_FOOTERS
\# -------------------
\# *Arguments:
\# HEADER_RECTO_QUAD \
\# HEADER_RECTO_STRING \
\# FOOTER_RECTO_QUAD \
\# FOOTER_RECTO_STRING \
\# HEADER_VERSO_QUAD \
\# HEADER_VERSO_STRING \
\# FOOTER_VERSO_QUAD \
\# FOOTER_VERSO_STRING
\# | <anything>
\# *Function:
\# Allows having both headers and footers. Sets register
\# #HDRFTR_BOTH to 1; collects HEADER/FOOTER_RECTO/VERSO
\# information; appends FOOTER_RECTO and FOOTER_VERSO to
\# START and turns off pagination; appends to macros
\# PRINT_USERDEF_HDRFTR and HEADER the necessary number
\# register manipulations and redefinitions of the
\# HEADER/FOOTER_RECTO/VERSO strings so that both
\# headers and footers get printed, with the appropriate
\# strings for each
\# *Notes:
\# Works in conjunction with HDRFTR_RECTO and HDRFTR_VERSO (qqv.),
\# ergo all style changes must be done inline in the strings
\# passed as arguments.
\#
.MAC HEADERS_AND_FOOTERS END
. ie \\n[#NUM_ARGS]>1 \{\
. nr #HDRFTR_BOTH 1
. nr #FOOTERS_ON 1
. if !r#HEADER_RULE .nr #HEADER_RULE 1
. if !r#FOOTER_RULE .nr #FOOTER_RULE 1
. ds $HDR_RECTO_QUAD \\$1
. ds $HDR_RECTO_STRING \\$2
. ds $FTR_RECTO_QUAD \\$3
. ds $FTR_RECTO_STRING \\$4
. ds $HDR_VERSO_QUAD \\$5
. ds $HDR_VERSO_STRING \\$6
. ds $FTR_VERSO_QUAD \\$7
. ds $FTR_VERSO_STRING \\$8
.am START DONE
. if \\\\n[#HDRFTR_BOTH]=1 \{\
. FOOTER_RECTO \\\\*[$FTR_RECTO_QUAD] "\\\\*[$FTR_RECTO_STRING]"
. FOOTER_VERSO \\\\*[$FTR_VERSO_QUAD] "\\\\*[$FTR_VERSO_STRING]"
. if \\\\n[#HEADER_RULE]=1 .HEADER_RULE
. ie \\\\n[#FOOTER_RULE]=1 .FOOTER_RULE
. el .FOOTER_RULE OFF
. if r #PAGINATE .rr #PAGINATE
. if r #PAGE_NUM_V_POS .rr #PAGE_NUM_V_POS
. \}
.DONE
.am PRINT_USERDEF_HDRFTR DONE
. if \\\\n[#HDRFTR_BOTH]=1 \{\
. if \\n[#FOOTERS_ON]=1 \{\
. if !\\\\n[#COLLATE]=1 \{\
. HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
. HEADER_VERSO \\*[$HDR_VERSO_QUAD] "\\*[$HDR_VERSO_STRING]"
. rr #FOOTERS_ON
. nr #HEADERS_ON 1
. ie \\\\n[#HEADER_RULE]=1 .HEADER_RULE
. el .HEADER_RULE OFF
. \}
. \}
. if \\n[#HEADERS_ON]=1 \{\
. FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
. FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
. \}
. \}
.DONE
.am HEADER DONE
. if \\\\n[#HDRFTR_BOTH]=1 \{\
. if r #START_FOR_FOOTERS .rr #START_FOR_FOOTERS
. rr #HEADERS_ON
. nr #FOOTERS_ON 1
. FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
. FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
. ie \\\\n[#FOOTER_RULE]=1 .FOOTER_RULE
. el .FOOTER_RULE OFF
. \}
.DONE
. \}
. el \{\
. rr #HDRFTR_BOTH
. rr #USERDEF_HDRFTR
. rm $USERDEF_HDRFTR_RECTO
. rm $USERDEF_HDRFTR_VERSO
. FOOTERS OFF
. HEADERS
. if \\n[#COLLATE]=1 \{\
. nr #HEADER_STATE 1
. nr #PAGINATION_STATE 1
. \}
. PAGINATE
. PAGENUM_POS BOTTOM CENTER
. nr #HF_OFF 1
. \}
.END
\#
\# ====================================================================
\#
\# +++HEADINGS+++
\#
.char \[hd-num-spacer] \0
.char \[parahead-spacer] \~\~
.char \[toc-hd-num-spacer] \h'\w'\[en]'u'
.ds toc-word-space \ \" ie an unbreakable space
\#
\# HEADING
\# -------
\# *Arguments:
\# <heading level> [PARAHEAD] [NAMED <pdf-id>] <heading text>
\# *Function:
\# Assigns a heading level to the heading text and prints heading
\# in the style set up for that level. If PARAHEAD given, the
\# heading is attached to the body of the paragraph. If NAMED
\# given, creates a target for pdf links. Collects the heading
\# for the TOC and sets TOC indenting appropriate for the level.
\# *Notes:
\# If PARAHEAD given, HEADING must come after PP.
\#
.MAC HEADING END
. ie !r pdfbx-top \{\
' br
. if \\n[@TOP] .br
. \}
. el \{\
. if r pdfbx-running .nr pdfbx-top 1
. \}
. if !\B'\\$1' \{\
. tm1 "[mom]: The first argument to \\$0 must be a numeric heading level.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. if r #QUOTE .rr #QUOTE
. if r #END_QUOTE .rr #END_QUOTE
. if r #EPIGRAPH .rr #EPIGRAPH
. vs \\n[#DOC_LEAD]u
. if \\$1<\\n[#LEVEL] \
. nr #ACTIVE_LEVELS \\n[#LEVEL] \" loop count for resetting numbering registers
. nr #LAST_LEVEL \\n[#LEVEL] \" used during TOC collection, if SPACE_TOC_ITEMS
. nr #LEVEL \\$1 \" resets #LEVEL to arg
. shift
. nr #ARG_NUM 0 1
. while \\n+[#ARG_NUM]<=2 \{\
. if '\\$1'NAMED' \{\
. ds PDF_NM "\\$1 \\$2
. shift 2 \" \\$1 is now heading text
. \}
. if '\\$1'PARAHEAD' \{\
. nr #PARAHEAD 1
. shift \" \\$1 is now NAMED, if we have it; otherwise heading text
. \}
. \}
.\" Spacing
. if \\n[#Q_LEAD_DIFF_CHECK] .sp -1
. if \\n[.t]<\\n[.v] .nr nl-from-heading \\n[nl]
. ie !\\n[#PARAHEAD] \{\
. if !\\n[@TOP] \{\
. nr #HEAD 1
. ie !\\n[#START] \{\
. nr #HEADING_NEEDS \\n[#NUM_ARGS]v+\\*[$HEAD_\\n[#LEVEL]_NEEDS]v+1v
. if \\n[#HEAD_\\n[#LEVEL]_SPACE_AFTER] .nr #HEADING_NEEDS +1v
. if \\n[.t]<\\n[#HEADING_NEEDS] .sp \\n[.t]u
. vpt 0
. if !r pdfbx-top \
. if !\\n[#SPACE_ADDED] .if !\\n[#LINEBREAK] .sp
. \}
. el \{\
. ie !\\n[#PP] \{\
. rr #START
. RESTORE_SPACE
. if !\\n[#SPACE_ADDED] \
. if !\\n[#COLUMNS] .sp
. \}
. el .sp
. \}
. if \\n[#EPIGRAPH] \
. if \\n[#SINGLE_SPACE] .sp
. \}
. if \\n[#PP_SPACE] \
. if \\n[#QUOTE_4_HD] .sp .5v
. ie !\\n[#SPACE_ADDED] \{\
. if !\\n[.ns] \{\
. ie !\\n[#NO_SHIM] \
. if !\\n[#HEAD_\\n[#LEVEL]_NO_SHIM] \
. if !r pdfbx-top .SHIM
. el \{\
. if !\\n[#NO_FLEX] \
. if !\\n[#HEAD_\\n[#LEVEL]_NO_FLEX] \
. if !r pdfbx-top .FLEX
. \}
. \}
. \}
. el .rr #SPACE_ADDED
. vpt
. \}
. el \{\
. if \\n[#NUM_ARGS]>1 \{\
. tm1 "[mom]: Error at line \\n[.c], \\$0.
. tm1 " PARAHEAD may not be given more than 1 line of text.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. vpt 0
. if !(\\n[#PRINT_STYLE]=1)&(\\n[#SINGLE_SPACE]=1) .sp -1v
. if \\n[#QUOTE_4_HD] \{\
. sp -1v
. if \\n[#PP_SPACE] \{\
. sp .5v
. SHIM
. \}
. \}
. if (\\n[#QUOTE_4_HD]=0)&(\\n[#LB_4_HD]=0)&(\\n[#START]=0) \
. if !\\n[#LB_4_PARAHEAD] .sp -1v
. \}
. ev HEADING
. evc 0
.\" Style
. if \\n[#PRINT_STYLE]=2 \{\
. fam \\*[$HEAD_\\n[#LEVEL]_FAM]
. ft \\*[$HEAD_\\n[#LEVEL]_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$HEAD_\\n[#LEVEL]_SIZE]
. if r pdfbx-top \{\
. SIZESPECS
. ie \\n[#PP]=0 \{\
. rt
. ds pdfbx-cap-adj \\*[$CAP_HEIGHT]
. sp (\\*[wt\\n[stack]]/2u)+\\*[pdfbx-cap-adj]+\\*[gap\\n[stack]]u
. \}
. el \{\
. nr pdfbx-cap-adj \\*[$CAP_HEIGHT]-\\*[pdfbx-cap-adj]
. sp \\n[pdfbx-cap-adj]u
. \}
. \}
. nf
. \}
.\" Numbering
. ds $TOC_HD_NUM_PREV \\*[$TOC_HD_NUM]
. rm $TOC_HD_NUM
. rm $PDF_HD_NUM
. ie \\n[#NUMBER_HEAD_\\n[#LEVEL]] \{\
. if \\n[#PREFIX_CH_NUM] .ds $HD_NUM \\n[#CH_NUM].
. nr #HEAD_\\n[#LEVEL]_NUM +1 \" incremented manually here; still auto-increments
.\" Reset numbering registers for headings beneath current level
. nr @LEVEL \\n[#LEVEL] 1 \" loop step
. nr #LOOP \\n[#ACTIVE_LEVELS] \" loop count
. while \\n+[@LEVEL]<=\\n[#LOOP] \
. if \\n[#HEAD_\\n[@LEVEL]_NUM] \
. nr #HEAD_\\n[@LEVEL]_NUM 0 1
.\" Build numbering strings for body and toc
. nr @LEVEL 0 1 \" loop step
. nr #LOOP \\n[#LEVEL] \" loop count
. while \\n+[@LEVEL]<=\\n[#LOOP] \
. if \\n[#HEAD_\\n[@LEVEL]_NUM] \
. as $HD_NUM \\n[#HEAD_\\n[@LEVEL]_NUM].
. ie \\n[#TRUNC_TOC_HD_NUM] \
. ds $TOC_HD_NUM \\n[#HEAD_\\n[#LEVEL]_NUM].
. el .ds $TOC_HD_NUM \\*[$HD_NUM]
. if \\n[#LEVEL]=1 \
. ds $TOC_HD_NUM_PREV \\*[$TOC_HD_NUM]
. if \\n[#TOC_NO_HD_NUM] .rm $TOC_HD_NUM
. if !\\n[#HEAD_\\n[#LEVEL]_NUM]] .rm $TOC_HD_NUM
. as $HD_NUM \[hd-num-spacer]
. ds $PDF_HD_NUM \\*[$TOC_HD_NUM]
. if !'\\*[$TOC_HD_NUM]'' .as $TOC_HD_NUM \[toc-hd-num-spacer]
. if !'\\*[$PDF_HD_NUM]'' .as $PDF_HD_NUM " "
. \}
. el .nr @LEVEL \\n[#LEVEL] 1
.\" TOC collection and formatting
. nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
. af #TOC_ENTRY_PN \\g[#PAGENUMBER]
. nr #ARG_NUM 0 1
. while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
. as $TOC_HEAD_\\n[#LEVEL]_ITEM "\\$[\\n+[#ARG_NUM]]
. if \\n[#NUM_ARGS]>\\n[#ARG_NUM] \
. as $TOC_HEAD_\\n[#LEVEL]_ITEM "\\*[toc-word-space]
. \}
. PDF_BOOKMARK \
\\*[PDF_NM] \\n[#LEVEL]+1 \
\\*[$PDF_HD_NUM] \\*[$TOC_HEAD_\\n[#LEVEL]_ITEM]
. rm PDF_NM
. rm $PDF_HD_NUM
. ev TOC_EV
. ie \\n[#PRINT_STYLE]=1 \{\
. fam \\*[$TYPEWRITER_FAM]
. ft R
. ps \\*[$TYPEWRITER_PS]
. \}
. el \{\
. FAMILY \\*[$TOC_HEAD_\\n[#LEVEL]_FAM]
. FT \\*[$TOC_HEAD_\\n[#LEVEL]_FT]
. ps \\n[#TOC_PS]u\\*[$TOC_HEAD_\\n[#LEVEL]_SIZE]
. \}
.\" Indents for TOC heading levels.
.\" First, numbered heads. @LEVEL here is #LEVEL+1
. ie \\n[#NUMBER_HEAD_\\n[#LEVEL]] \{\
. ie !\\n[#TOC_NO_HD_NUM] \{\
. ie \\n[#TRUNC_TOC_HD_NUM] \{\
. if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \{\
. ie !\\n[#FROM_STYLE_\\n[@LEVEL]] \{\
. ie !\\n[#NUMBER_HEAD_\\n[@LEVEL]] \
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
\\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\
\w'\\*[$TOC_HD_NUM]'+\
1.5m
. el \
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
\\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\
\w'\\*[$TOC_HD_NUM]'
. \}
. el \
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
\\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]
. \}
. \}
. el \{\
. if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \{\
. ie !\\n[#FROM_STYLE_\\n[@LEVEL]] \{\
. ie \\n[#NUMBER_HEAD_\\n-[@LEVEL]] \{\
. ie !\\n[#NUMBER_HEAD_\\n+[@LEVEL]] \
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
\\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\
\w'\\*[$TOC_HD_NUM_PREV]'+\
1.5m
. el \{\
.\" Get the number of digits in the chapter number
. ds ch-num-width \\n[#CH_NUM]
. length ch-num-width \\*[ch-num-width]
. nr ch-num-width -1
. nr num-ch-digits \w'\0'*\\n[ch-num-width]
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
\\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\
\\n[num-ch-digits]+\
\w'.\[toc-hd-num-spacer]'
. \}
. \}
. el \
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
\\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\
\w'\\n[#TOC_HD_NUM].'
. ie \\n[#LEVEL]=1 \
. nr #TOC_HEAD_\\n+[@LEVEL]_INDENT +\w'\0'
. el \{\
. if !\\n[#NUMBER_HEAD_\\n[@LEVEL]] \{\
. nr @LEVEL \\n+[@LEVEL] 1
. nr #TOC_HEAD_\\n+[@LEVEL]_INDENT +\w'\0'
. \}
. \}
. \}
. el \
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
\\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\
\\n[#TOC_HEAD_\\n+[@LEVEL]_INDENT]
. \}
. if \\n[#LEVEL]=1 \{\
. if \\n[#NUMBER_HEAD_\\n[@LEVEL]] \{\
. if \\n[#PREFIX_CH_NUM] \
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
\w'\\*[$TOC_HD_NUM]'
. \}
. \}
. \}
. \}
. el \{\
. ie !\\n[#FROM_STYLE_\\n[@LEVEL]] \{\
. if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
\\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+1.5m
. \}
. el \{\
. if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
\\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\
\\n[#TOC_HEAD_\\n+[@LEVEL]_INDENT]
. \}
. \}
. \}
.\" Non-numbered heads
. el \{\
. nr @LEVEL \\n[#LEVEL] 1
.\" increments @LEVEL even if false
. ie \\n[#FROM_STYLE_\\n+[@LEVEL]] \{\
. if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \{\
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
\\n[#TOC_HEAD_\\n[#LEVEL]_INDENT]+\
\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT]
. if !\\n[#LEVEL]=\\n[#LAST_LEVEL] \{\
. if \\n[#NUMBER_HEAD_\\n[@LEVEL]] \
. nr #TOC_HEAD_\\n[#LEVEL]_INDENT \
\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT]+\
\w'\\*[$TOC_HD_NUM_PREV]'
. \}
. \}
. \}
. el \{\
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
\\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+1.5m
. if \\n[#LEVEL]=1 \{\
. if !\\n[#FROM_STYLE_1] \
. nr #TOC_HEAD_1_INDENT 0
. \}
. \}
. \}
. nr #TOC_HEAD_\\n[@LEVEL]_INDENT_SET 1
. HD_TO_TOC
. rm $TOC_HEAD_\\n[#LEVEL]_ITEM
.\" Print heading
. if !\\n[#PARAHEAD] .\\*[$HEAD_\\n[#LEVEL]_QUAD]
. if \\n[#CAPS_ON] \{\
. CAPS OFF
. nr #CAPS_RESTORE 1
. \}
. if \\n[#HEAD_\\n[#LEVEL]_CAPS] \{\
. CAPS
. nr #CAPS_OFF 1
. \}
. if \\n[#SMALLCAPS_ON] \{\
. SMALLCAPS OFF
. nr #SMALLCAPS_RESTORE 1
. \}
. if \\n[#HEAD_\\n[#LEVEL]_SMALLCAPS] \{\
. SMALLCAPS
. nr #SMALLCAPS_OFF 1
. \}
. if !'\\*[$HEAD_\\n[#LEVEL]_COLOR]'' \
. COLOR \\*[$HEAD_\\n[#LEVEL]_COLOR]
. nop \X'ps: exec decornone'\c
. if r pdfbx-top \{\
. ds $RESTORE_ADJ \\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]
. ds $HEAD_\\n[#LEVEL]_BASELINE_ADJ 0
. \}
. nr #ARG_NUM 0 1
. while \\n+[#ARG_NUM]<=\\n[#NUM_ARGS] \{\
. if \\n[#PARAHEAD] \
. nr #PP_TEXT_OFFSET \
\w'\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]'+\w'\[parahead-spacer]'
. if (\\n[#HEAD_\\n[#LEVEL]_UNDERSCORE]=0)&(\\n[#HEAD_\\n[#LEVEL]_UNDERSCORE2]=0) \{\
. ie \\n[#HD_NUM_INDENT] \{\
. if !'\\*[$HEAD_\\n[#LEVEL]_QUAD]'CENTER' \
. ti \\n[#HD_NUM_INDENT]u
. PRINT \
"\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\$[\\n[#ARG_NUM]]
. br
. \}
. el \{\
. ie !\\n[#PARAHEAD] \{\
. PRINT \
"\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
. br
. \}
. el \{\
. if (\\n[#PP]>0):(\\n[#INDENT_FIRST_PARAS]) \{\
. if !\\n[#LB_4_PARAHEAD] \{\
. if !\\n[#START] \{\
. if \\n[#PP_ACTIVE] \{\
. ie \\n[#PP]=1 .br
. el \{\
. nr #PP_TEXT_OFFSET +\\n[#PP_INDENT]
. ie !\\n[pdfbx-running] .ti \\n[#PP_INDENT]u
. el .ti \\n[#PP_INDENT]u+\\*[wt\\n[stack]]+\\*[gap\\n[stack]]u
. \}
. \}
. \}
. \}
. \}
. ie \\n[#PRINT_STYLE]=1 \
. PRINT "\\*[UL]\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]\\*[ULX]
. el .PRINT "\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
. rr #LB_4_PARAHEAD
. sp -1v
. \}
. \}
. \}
. if \\n[#HEAD_\\n[#LEVEL]_UNDERSCORE] \{\
. nr #SAVED_UL_WEIGHT \\n[#UNDERSCORE_WEIGHT]
. UNDERSCORE_WEIGHT \\*[$HEAD_\\n[#LEVEL]_UL_WEIGHT]
. ie \\n[#HD_NUM_INDENT] \{\
. if !'\\*[$HEAD_\\n[#LEVEL]_QUAD]'CENTER' \
. ti \\n[#HD_NUM_INDENT]u
. UNDERSCORE \\*[$HEAD_\\n[#LEVEL]_UL_GAP] \
"\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\$[\\n[#ARG_NUM]]
. br
. \}
. el \{\
. ie !\\n[#PARAHEAD] \{\
. UNDERSCORE \\*[$HEAD_\\n[#LEVEL]_UL_GAP] \
"\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
. br
. \}
. el \{\
. if (\\n[#PP]>0):(\\n[#INDENT_FIRST_PARAS]) \{\
. if !\\n[#LB_4_HD] \{\
. if !\\n[#START] \{\
. if \\n[#PP_ACTIVE] \{\
. nr #PP_TEXT_OFFSET +\\n[#PP_INDENT]
. if (\\n[#PRINT_STYLE]=1)&(\\n[#SINGLE_SPACE]=1) .sp -1v
. ti \\n[#PP_INDENT]u
. \}
. \}
. \}
. \}
. UNDERSCORE \\*[$HEAD_\\n[#LEVEL]_UL_GAP] \
"\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
. sp -1v
. \}
. \}
. nr #UNDERSCORE_WEIGHT \\n[#SAVED_UL_WEIGHT]
. \}
. if \\n[#HEAD_\\n[#LEVEL]_UNDERSCORE2] \{\
. nr #SAVED_UL2_WEIGHT \\n[#UNDERSCORE_WEIGHT]
. UNDERSCORE_WEIGHT \\*[$HEAD_\\n[#LEVEL]_UL2_WEIGHT]
. ie \\n[#HD_NUM_INDENT] \{\
. if !'\\*[$HEAD_\\n[#LEVEL]_QUAD]'CENTER' \
. ti \\n[#HD_NUM_INDENT]u
. UNDERSCORE2 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_1] \
\\*[$HEAD_\\n[#LEVEL]_UL2_GAP_2] \
"\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\$[\\n[#ARG_NUM]]
. br
. \}
. el \{\
. ie !\\n[#PARAHEAD] \{\
. UNDERSCORE2 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_1] \
\\*[$HEAD_\\n[#LEVEL]_UL2_GAP_2] \
"\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
. br
. \}
. el \{\
. if (\\n[#PP]>0):(\\n[#INDENT_FIRST_PARAS]) \{\
. if !\\n[#LB_4_HD] \{\
. if !\\n[#START] \{\
. if \\n[#PP_ACTIVE] \{\
. nr #PP_TEXT_OFFSET +\\n[#PP_INDENT]
. if (\\n[#PRINT_STYLE]=1)&(\\n[#SINGLE_SPACE]=1) \
. sp -1v
. ti \\n[#PP_INDENT]u
. \}
. \}
. \}
. \}
. UNDERSCORE2 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_1] \
\\*[$HEAD_\\n[#LEVEL]_UL2_GAP_2] "\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
. sp -1v
. \}
. \}
. nr #UNDERSCORE_WEIGHT \\n[#SAVED_UL2_WEIGHT]
. \}
. if !\\n[#HD_NUM_INDENT] .nr #HD_NUM_INDENT \w'\\*[$HD_NUM]'
. \}
. if r pdfbx-top \{\
. ds $HEAD_\\n[#LEVEL]_BASELINE_ADJ \\*[$RESTORE_ADJ]
. if !\\n[#PARAHEAD] .sp \\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]
. \}
. if !\\n[#PARAHEAD] \
. if \\n[#HEAD_\\n[#LEVEL]_SPACE_AFTER] .sp
. if \\n[#CAPS_OFF] \{\
. CAPS OFF
. rr #CAPS_OFF
. \}
. if \\n[#CAPS_RESTORE] \{\
. CAPS
. rr #CAPS_RESTORE
. \}
. if \\n[#SMALLCAPS_OFF] \{\
. SMALLCAPS OFF
. rr #SMALLCAPS_OFF
. \}
. if \\n[#SMALLCAPS_RESTORE] \{\
. SMALLCAPS
. rr #SMALLCAPS_RESTORE
. \}
. ev
. rm $HD_NUM
. rr #HD_NUM_INDENT
. if \\n[@TOP] \{\
. ch RR_@TOP
. rr @TOP
. rs
. nop \&
. sp -1
. \}
. if \\n[#PARAHEAD] \{\
. ie !\\n[pdfbx-running] .ti \\n[#PP_TEXT_OFFSET]u
. el .ti \\n[#PP_TEXT_OFFSET]u+\\*[wt\\n[stack]]+\\*[gap\\n[stack]]u
. \}
. if !\\n[#PARAHEAD] .nr #PP 0
. rr #PARAHEAD
. if \\n[#LB_4_HD] .rr #LB_4_HD
. if \\n[#QUOTE_4_HD] .rr #QUOTE_4_HD
. vpt
. rr nl-from-heading
. if r pdfbx-top \{\
. rr pdfbx-top
. nr pdfbx-top\\n[stack] 1
. \}
.END
\#
\# HEADING_STYLE
\# -------------
\# *Arguments:
\# <level>
\# FAMILY <family>
\# FONT <font>
\# SIZE <+|-n>
\# COLOR <color>
\# CAPS | NO_CAPS
\#---when called as HEADING_STYLE, these are also available---
\# QUAD <direction>
\# NUMBER | NO_NUMBER
\# SPACE_AFTER | NO_SPACE_AFTER
\# UNDERSCORE <weight> <gap> | UNDERSCORE2 <weight> <gap1> <gap2>
\# NO_UNDERSCORE | NO_UNDERSCORE2
\# BASELINE_ADJUST
\#---when called as TOC_ENTRY_STYLE this is also available---
\# INDENT
\# *Function:
\# Sets up complete style parameters for HEADING <level>. If
\# invoked as TOC_ENTRY_STYLE, sets up parameters for the
\# corresponding TOC entry at <level>.
\# *Notes:
\# Arguments may be given in any order. Any not given retain
\# their current values. Defaults for an initial 9 levels of
\# heading are set up in PRINTSTYLE.
\#
\# NUMBER indicates that hierarchic numbering of <level> should be
\# prepended to heading text. If invoked as TOC_ENTRY_STYLE,
\# prepend numbering to TOC entries at <level> (only works if
\# NUMBER is given to the corresponding HEADING <level>).
\#
\# INDENT refers to the indent for <level> in the TOC. It is
\# measured from the left offset of the entry level above it
\# (including numbering, if present). TOC entry levels beneath
\# <level> will have their indents adjusted accordingly.
\#
.MAC HEADING_STYLE END
. if !'\\$0'TOC_HEADING_STYLE' \{\
. if !\B'\\$1' \{\
. tm1 "[mom]: The first argument to \\$0 must be a numeric heading level.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. nr #LEVEL \\$1
. if \\n[#FROM_OLDSTYLE] .nr #LEVEL_\\n[#LEVEL]_SET 1
. shift
.\" Prepend TOC_ to style strings if called as TOC_ENTRY_STYLE
. \}
. if '\\$0'TOC_ENTRY_STYLE' .ds $TOC TOC_
. nr #ARG_NUM 0 1
. nr #ATTRIB \\n[#NUM_ARGS]
. while \\n+[#ARG_NUM]<=\\n[#ATTRIB] \{\
. if '\\$1'UNDERSCORE' \{\
. nr #HEAD_\\n[#LEVEL]_UNDERSCORE 1
. shift
. if '\\$1'' \{\
. tm1 "[mom]: The UNDERSCORE argument to \\$0 requires a rule weight.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. ds $HEAD_\\n[#LEVEL]_UL_WEIGHT \\$1
. shift
. if '\\$1'' \{\
. tm1 "[mom]: The UNDERSCORE argument to \\$0 requires a rule gap.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. ds $HEAD_\\n[#LEVEL]_UL_GAP \\$1
. shift
. \}
. if '\\$1'NO_UNDERSCORE' \{\
. rr #HEAD_\\n[#LEVEL]_UNDERSCORE
. shift
. \}
. if '\\$1'UNDERSCORE2' \{\
. nr #HEAD_\\n[#LEVEL]_UNDERSCORE2 1
. shift
. if '\\$1'' \{\
. tm1 "[mom]: The UNDERSCORE2 argument to \\$0 requires a rule weight.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. ds $HEAD_\\n[#LEVEL]_UL2_WEIGHT \\$1
. shift
. if '\\$1'' \{\
. tm1 "[mom]: The UNDERSCORE2 argument to \\$0 requires a rule gap.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. ds $HEAD_\\n[#LEVEL]_UL2_GAP_1 \\$1
. shift
. if '\\$1'' \{\
. tm1 "[mom]: The UNDERSCORE2 argument to \\$0 requires an inter-rule gap.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. ds $HEAD_\\n[#LEVEL]_UL2_GAP_2 \\$1
. shift
. \}
. if '\\$1'NO_UNDERSCORE2' \{\
. rr #HEAD_\\n[#LEVEL]_UNDERSCORE2
. shift
. \}
. if '\\$1'SPACE_ABOVE' \{\
. shift
. ds $SPACE_ABOVE \\$1
. shift
. \}
. if '\\$1'SPACE_BENEATH' \{\
. shift
. ds $SPACE_BENEATH \\$1
. shift
. \}
. if '\\$1'SPACE_AFTER' \{\
. nr #HEAD_\\n[#LEVEL]_SPACE_AFTER 1
. shift
. \}
. if '\\$1'NO_SPACE_AFTER' \{\
. rr #HEAD_\\n[#LEVEL]_SPACE_AFTER
. shift
. \}
. if '\\$1'FAMILY' \{\
. shift
. ds $\\*[$TOC]HEAD_\\n[#LEVEL]_FAM \\$1
. if '\\$0'TOC_HEADING_STYLE' .ds $TOC_HEADING_FAM \\$1
. shift
. \}
. if '\\$1'FONT' \{\
. shift
. ds $\\*[$TOC]HEAD_\\n[#LEVEL]_FT \\$1
. if '\\$0'TOC_HEADING_STYLE' .ds $TOC_HEADING_FT \\$1
. shift
. \}
. if '\\$1'SIZE' \{\
. shift
. ds $\\*[$TOC]HEAD_\\n[#LEVEL]_SIZE \\$1
. if '\\$0'TOC_HEADING_STYLE' .ds $TOC_HEADING_SIZE \\$1
. shift
. \}
. if '\\$1'QUAD' \{\
. shift
. ds $QUAD_TYPE \\$1
. substring $QUAD_TYPE 0 0
. ie !'\\$0'TOC_HEADING_STYLE' \{\
. if '\\*[$QUAD_TYPE]'L' .ds $HEAD_\\n[#LEVEL]_QUAD LEFT
. if '\\*[$QUAD_TYPE]'C' .ds $HEAD_\\n[#LEVEL]_QUAD CENTER
. if '\\*[$QUAD_TYPE]'R' .ds $HEAD_\\n[#LEVEL]_QUAD RIGHT
. \}
. el \{\
. if '\\*[$QUAD_TYPE]'L' .ds $TOC_HEADING_QUAD LEFT
. if '\\*[$QUAD_TYPE]'C' .ds $TOC_HEADING_QUAD CENTER
. if '\\*[$QUAD_TYPE]'R' .ds $TOC_HEADING_QUAD RIGHT
. \}
. shift
. \}
. if '\\$1'COLOR' \{\
. shift
. ds $\\*[$TOC]HEAD_\\n[#LEVEL]_COLOR \\$1
. if '\\$0'TOC_HEADING_STYLE' .ds $TOC_HEADING_COLOR \\$1
. shift
. \}
. if '\\$1'BASELINE_ADJUST' \{\
. shift
. ds $HEAD_\\n[#LEVEL]_BASELINE_ADJ \\$1
. shift
. \}
. if '\\$1'CAPS' \{\
. nr #\\*[$TOC]HEAD_\\n[#LEVEL]_CAPS 1
. shift
. \}
. if '\\$1'NO_CAPS' \{\
. rr #HEAD_\\n[#LEVEL]_CAPS
. shift
. \}
. if '\\$1'SMALLCAPS' \{\
. nr #\\*[$TOC]HEAD_\\n[#LEVEL]_SMALLCAPS 1
. shift
. \}
. if '\\$1'NO_SMALLCAPS' \{\
. rr #HEAD_\\n[#LEVEL]_SMALLCAPS
. shift
. \}
. if '\\$1'NUMBER' \{\
. nr #NUMBER_HEAD_\\n[#LEVEL] 1
. nr #HEAD_\\n[#LEVEL]_NUM 0 1
. shift
. \}
. if '\\$1'NO_NUMBER' \{\
. rr #NUMBER_HEAD_\\n[#LEVEL]
. shift
. \}
. if '\\$1'PREFIX_CHAPTER' \{\
. shift
. ie \B'\\$1' \{\
. PREFIX_CHAPTER_NUMBER \\$1
. \}
. el .PREFIX_CHAPTER_NUMBER
. \}
. if '\\$1'INDENT' \{\
. shift
. nr #TOC_HEAD_\\n[#LEVEL]_INDENT \\$1
. nr #FROM_STYLE_\\n[#LEVEL] 1
. shift
. \}
. if '\\$1'NEEDS' \{\
. shift
. ds $HEAD_\\n[#LEVEL]_NEEDS \\$1
. shift
. \}
. if '\\$1'SHIM' \{\
. rr #HEAD_\\n[#LEVEL]_NO_SHIM
. shift
. \}
. if '\\$1'NO_SHIM' \{\
. nr #HEAD_\\n[#LEVEL]_NO_SHIM 1
. shift
. \}
. if '\\$1'FLEX' \{\
. rr #HEAD_\\n[#LEVEL]_NO_FLEX
. shift
. \}
. if '\\$1'NO_FLEX' \{\
. nr #HEAD_\\n[#LEVEL]_NO_FLEX 1
. shift
. \}
. \}
. rr #LEVEL
. if d$TOC .rm $TOC
.END
.
.ALIAS TOC_ENTRY_STYLE HEADING_STYLE
.ALIAS TOC_HEADING_STYLE HEADING_STYLE
\#
\# OLDSTYLE HEADINGS
\# -----------------
\# *Arguments:
\# None.
\# *Function:
\# Called from HEAD, SUBHEAD, and SUBSUBHEAD, sets style
\# parameters for HEADINGs 1-3 to former mom defaults for those macros.
\# Any styles already assigned to those levels are retained.
\#
\# Called by user with no argument, allows use of old style HEAD,
\# SUBHEAD, and SUBSUBHEAD without generating the deprecated msg.
\# *Notes:
\# For backward compatibility, and to ease the transition to
\# the HEADING scheme for heads.
\#
\# Paraheads must be set with .HEADING <level> PARAHEAD; attempts
\# to call PARAHEAD abort with an instructive message.
\#
.MAC OLDSTYLE_HEADINGS END
. if '\\$1'' .nr #SKIP_MSG 1
. nr #FROM_OLDSTYLE 1 \" Used in HEADING
. if \\n[#PRINT_STYLE]=1 \{\
. if !\\n[#LEVEL_1_SET] \{\
. HEADING_STYLE 1 \
FONT R \
SIZE +0 \
QUAD C \
CAPS \
UNDERSCORE .5 2p \
BASELINE_ADJUST 0 \
SPACE_AFTER
. nr #OLDSTYLE_HD 1
. return
. \}
. if !\\n[#LEVEL_2_SET] \{\
. HEADING_STYLE 2 \
FONT R \
SIZE +0 \
UNDERSCORE .5 2p \
BASELINE_ADJUST \\n[.v]/8
. nr #OLDSTYLE_SH 1
. return
. \}
. if !\\n[#LEVEL_3_SET] \{\
. HEADING_STYLE 3 \
FONT R \
SIZE +0 \
BASELINE_ADJUST \\n[.v]/8
. nr #OLDSTYLE_SSH 1
. return
. \}
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. if !\\n[#LEVEL_1_SET] \{\
. HEADING_STYLE 1 \
FAMILY \E*[$DOC_FAM] \
FONT B \
SIZE +1 \
QUAD C \
CAPS \
UNDERSCORE .5 2p \
BASELINE_ADJUST 0 \
SPACE_AFTER
. nr #OLDSTYLE_HD 1
. return
. \}
. if !\\n[#LEVEL_2_SET] \{\
. HEADING_STYLE 2 \
FAMILY \E*[$DOC_FAM] \
FONT B \
SIZE +.5 \
BASELINE_ADJUST \\n[.v]/8
. nr #OLDSTYLE_SH 1
. return
. \}
. if !\\n[#LEVEL_3_SET] \{\
. HEADING_STYLE 3 \
FAMILY \E*[$DOC_FAM] \
FONT I \
SIZE +.5 \
BASELINE_ADJUST \\n[.v]/8
. nr #OLDSTYLE_SSH 1
. return
. \}
. \}
. rr #FROM_OLDSTYLE
.END
\#
\# "Deprecated" message
\#
.MAC DEPRECATED END
. if !\\n[#SKIP_MSG] \{\
. tm1 "[mom]: Macro '\\$1' at line \\n[.c] is deprecated.
. tm1 " Invoking HEADING \\$2 instead and assigning style defaults
. tm1 " from former \\$1 as described in the documentation.
. tm1 " If another style is desired, use HEADING_STYLE \\$2 to
. tm1 " create it (see docs).
. tm1 " Further warnings will not be emitted for \\$1.
. tm1 " To avoid this message when using the deprecated HEAD,
. tm1 " SUBHEAD, and SUBSUBHEAD macros, add '.OLDSTYLE_HEADINGS'
. tm1 " after PRINTSTYLE before START.
. rm $MACRO
. \}
.END
\#
\# Wrappers around old-style headings.
\#
.MAC HEAD END
. if !\\n[#OLDSTYLE_HD] \{\
. DEPRECATED HEAD 1
. OLDSTYLE_HEADINGS HEAD
. \}
. HEADING 1 \\$@
.END
\#
.MAC SUBHEAD END
. if !\\n[#OLDSTYLE_SH] \{\
. DEPRECATED SUBHEAD 2
. OLDSTYLE_HEADINGS SUBHEAD
. \}
. HEADING 2 \\$@
.END
\#
.MAC SUBSUBHEAD END
. if !\\n[#OLDSTYLE_SSH] \{\
. DEPRECATED SUBSUBHEAD 3
. OLDSTYLE_HEADINGS SUBSUBHEAD
. \}
. HEADING 3 \\$@
.END
\#
.MAC PARAHEAD END
. tm1 "[mom]: \\$0 is no longer a valid macro.
. tm1 " Use 'HEADING <level> PARAHEAD <text>' instead.
. tm1 " You will probably want to invoke HEADING_STYLE to set
. tm1 " the type parameters for the parahead. See docs.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
.END
\#
\# Wrapper macro for oldstyle NUMBER_HEADS, NUMBER_SUBHEADS...
\#
.MAC HEADING_NUMBERS END
. if '\\$0'NUMBER_PARAHEADS' \{\
. tm1 "[mom]: \\$0 is no longer a valid macro.
. tm1 " Use 'HEADING_STYLE <level> NUMBER' instead. See docs.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. return
. \}
. if '\\$0'NUMBER_HEADS' .nr level 1
. if '\\$0'NUMBER_SUBHEADS' .nr level 2
. if '\\$0'NUMBER_SUBSUBHEADS' .nr level 3
. ds mom "[mom]:\"
. ie '\\$1'' .ds $PARAM NUMBER
. el \{\
. ds $PARAM NO_NUMBER
. ds $SWITCH " \\$1
. \}
. HEADING_STYLE \\n[level] \\*[$PARAM]
. if (\\n[#OLDSTYLE_HD]=1):(\\n[#OLDSTYLE_SH]=1):(\\n[#OLDSTYLE_SSH]=1) \{\
. tm1 "\\*[mom] OLDSTYLE_HEADINGS detected.
. ds mom " \"
. \}
. tm1 "\\*[mom] Setting HEADING_STYLE \\n[level] to '\\*[$PARAM]' at '\\$0\\*[$SWITCH]', line \\n[.c].
. rm $PARAM
. rm $SWITCH
.END
.
.ALIAS NUMBER_HEADS HEADING_NUMBERS
.ALIAS NUMBER_SUBHEADS HEADING_NUMBERS
.ALIAS NUMBER_SUBSUBHEADS HEADING_NUMBERS
.ALIAS NUMBER_PARAHEADS HEADING_NUMBERS
\#
\# PREFIX CHAPTER NUMBERS TO HEADINGS/TOC ENTRIES
\# ----------------------------------------------
\# *Arguments:
\# <none> | <chapter number> | <anything>
\# *Function:
\# Toggles register #PREFIX_CH_NUM. Uses $CHAPTER to set #CH_NUM
\# if $CHAPTER is a digit; if <chapter number> given, sets #CH_NUM
\# to arg.
\# *Notes:
\# Default is OFF.
\#
.MAC PREFIX_CHAPTER_NUMBER END
. if \\n[#NUM_ARGS]=0 \{\
. if !'\\*[$CHAPTER]'' \{\
. if !\B'\\*[$CHAPTER]' \{\
. tm1 "[mom]: \\$0 at line \\n[.c] cannot determine a chapter number.
. tm1 " Enter the current chapter number as a digit after PREFIX_CHAPTER.
. ab [mom]: Aborting '\\n[.F]', line \\n[.c].
. \}
. \}
. \}
. ie '\\$1'' .nr #PREFIX_CH_NUM 1
. el \{\
. ie \B'\\$1' \{\
. nr #PREFIX_CH_NUM 1
. nr #CH_NUM \\$1
. \}
. el .rr #PREFIX_CH_NUM
. \}
.END
\#
\# ====================================================================
\#
\# +++LINE BREAKS+++
\#
\# LINEBREAK CHARACTER
\# -------------------
\# *Arguments:
\# [character] [iterations] [vertical adjustment]
\# *Function:
\# Allows user to specify a line break character and the number
\# of times to repeat it horizontally.
\# *Notes:
\# Without an argument, LINEBREAK_CHAR will deposit a blank line.
\#
\# Vertical adjustment requires a unit of measure (most likely
\# "p"), and has to be preceded by +|-
\#
.MAC LINEBREAK_CHAR END
. nr #REPEAT 1
. ds $LINEBREAK_CHAR \\$1
. if !'\\$2'' .nr #LB_CHAR_ITERATIONS \\$2
. if !'\\$3'' .ds $LINEBREAK_CHAR_V_ADJ \\$3
. if '\\*[$LINEBREAK_CHAR_V_ADJ]'' .ds $LINEBREAK_CHAR_V_ADJ +0
. if \\n[#LB_CHAR_ITERATIONS] \{\
. while (\\n[#LB_CHAR_ITERATIONS]>\\n[#REPEAT]) \{\
. as $LINEBREAK_CHAR "\\ \\$1
. nr #REPEAT \\n[#REPEAT]+1
. \}
. \}
. rr #REPEAT
. rr #LB_CHAR_ITERATIONS
.END
\#
\# LINE BREAK
\# ----------
\# *Arguments:
\# <none>
\# *Function:
\# Deposits line break character.
\# *Notes:
\# If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
\#
.MAC LINEBREAK END
. if r #Q_AT_TOP .rr #Q_AT_TOP
. if \\n[@TOP] .RESTORE_SPACE
. ie '\\*[$LINEBREAK_CHAR]'' \{\
. br
. nop \&
. sp
. \}
. el \{\
. ie \\n[#END_QUOTE] .
. el .sp
. ev LINEBREAK
. evc 0
. CENTER
. PRINT \
\m[\\*[$LINEBREAK_COLOR]]\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\
\\*[$LINEBREAK_CHAR]\m[]
. sp
. ev
. QUAD \\*[$DOC_QUAD]
. \}
. nr #LINEBREAK 1
. if r #QUOTE .rr #QUOTE
. if r #END_QUOTE .rr #END_QUOTE
. nr #PP 0
. nr #LB_4_HD 1
. nr #LB_4_PARAHEAD 1
.END
\#
\# ====================================================================
\#
\# +++PARAGRAPHS+++
\#
\# PARAGRAPH FONT
\# --------------
\# *Argument:
\# <font of running text>
\# *Function:
\# Creates or modifies string $PP_FT.
\# *Notes:
\# Affects all paragraphs.
\#
.MAC PP_FONT END
. if \\n[#PRINT_STYLE]=1 \{\
. ie \\n[#ITALIC_MEANS_ITALIC] .nop
. el .return
. \}
. if \\n[#COLLATE]=1 \
. if !'\\*[$SAVED_PP_FT]'' .rm $SAVED_PP_FT
. ds $PP_FT \\$1
. FT \\*[$PP_FT]
.END
\#
\# PARAGRAPH INDENT
\# ----------------
\# *Argument:
\# <amount to indent paragraphs in running text (ipPcm)>
\# *Function:
\# Allows user to change the default para indent. The change will
\# affect the indent of QUOTEs and BLOCKQUOTEs as well.
\# *Notes:
\# Default for printstyle TYPEWRITE is 1/2-inch. Default for
\# printstyle TYPESET is 2 ems. The defaults are set in
\# PRINTSTYLE, not DEFAULTS.
\#
.MAC PARA_INDENT END
. ie \B'\\$1' \{\
. nr #PP_INDENT (\\$1)
. nr #SAVED_PP_INDENT \\n[#PP_INDENT]
. \}
. el \{\
. ie '\\$1'' \{\
. nr #PP_INDENT \\n[#SAVED_PP_INDENT]
. rr #SAVED_PP_INDENT
. \}
. el \{\
. nr #SAVED_PP_INDENT \\n[#PP_INDENT]
. rr #PP_INDENT
. \}
. \}
.END
\#
\# INDENT FIRST PARAGRAPHS
\# -----------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# By default, the first para of a document, as well as the first
\# paras of blockquotes and block-style epigraphs are not indented.
\# When invoked, this macro will indent all paras.
\# *Notes:
\# Default is OFF.
\#
.MAC INDENT_FIRST_PARAS END
. ie '\\$1'' .nr #INDENT_FIRST_PARAS 1
. el .rr #INDENT_FIRST_PARAS
.END
\#
\# INTER-PARAGRAPH SPACING
\# -----------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Adds a line space between paragraphs in body text. Block quotes
\# are unaffected.
\# *Notes:
\# Default is OFF. PARA_SPACE is not recommended for use with
\# PRINTSTYLE TYPEWRITE without SINGLESPACE.
\#
.MAC PARA_SPACE END
. ie '\\$1'' \
. nr #PP_SPACE 1
. el \{\
. ie \B'\\$1' \{\
. nr #PP_SPACE 1
. ds $PP_SPACE_AMOUNT \\$1
. \}
. el .rr #PP_SPACE
. \}
.END
\#
\# PARAGRAPH
\# ---------
\# *Arguments:
\# <none>
\# *Function:
\# Figures out what to do with paragraphs under differing conditions.
\# *Notes:
\# Note the use of transparent line break (\!.br) to get
\# PP to work within blockquotes and epigraphs.
\#
\# PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
\#
.MAC PP END
. if \\n[#COVERTEXT_PP] \{\
. ie \\n[#INDENT_ACTIVE] .ti \\n[#INDENT]u+\\n[#PP_INDENT]u
. el .ti \\n[#PP_INDENT]u
. return
. \}
. if \\n[#PP]>0 .br
. if \\n[#DOC_TYPE]=4 \{\
. if !'\\n[.z]'' .di
. nr #TOTAL_FIELDS \\n[#FIELD]
. nr #FIELD 0 1
. nr #NUM_FIELDS 0 1
. if \\n[#TOTAL_FIELDS]>0 \{\
. while \\n+[#NUM_FIELDS]<=\\n[#TOTAL_FIELDS] \{\
. nf
. LETTERHEAD\\n+[#FIELD]
. QUAD \\*[$DOC_QUAD]
. ALD \\n[#DOC_LEAD]u
. if \\n[#DATE_FIRST]=1 .ALD \\n[#DOC_LEAD]u
. rr #DATE_FIRST
. rm LETTERHEAD\\n[#FIELD]
. \}
. rr #FIELD
. rr #NUM_FIELDS
. rr #TOTAL_FIELDS
. \}
. \}
. rr #PP_ACTIVE
. if r #Q_AT_TOP .rr #Q_AT_TOP
. if \\n[#PP_STYLE]=1 \{\
. if \\n[#ENDNOTE] \{\
. nr #RESET_PARA_SPACE \\n[#PP_SPACE]
. ie \\n[#EN_PP_SPACE] .PARA_SPACE
. el .PARA_SPACE OFF
. \}
. if !\\n[#ENDNOTE] .po \\n[#L_MARGIN]u
. if \\n[#COLUMNS] \{\
. if !\\n[#ENDNOTE] \{\
. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n[.o]
. \}
. \}
. if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
. ie \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
. ie \\n[#ENDNOTE] .vs \\n[#EN_LEAD]u
. el .vs \\n[#DOC_LEAD]u
. QUAD \\*[$DOC_QUAD]
. if \\n[#SLANT_ON] \
. if \\n[#UNDERLINE_SLANT] .UNDERLINE
. if '\\*[$PP_FT]'I' \
. if \\n[#ITALIC_MEANS_ITALIC] .FT I
. \}
. el \{\
. ie \\n[#ENDNOTE] \{\
. FAMILY \\*[$EN_FAM]
. FT \\*[$EN_FT]
. ps \\n[#EN_PS]u
. vs \\n[#EN_LEAD]u
. QUAD \\*[$EN_QUAD]
. \}
. el \{\
. FAMILY \\*[$DOC_FAM]
. if !'\\*[$SAVED_PP_FT]'' \{\
. ds $PP_FT \\*[$SAVED_PP_FT]
. rm $SAVED_PP_FT
. \}
. FT \\*[$PP_FT]
. ps \\n[#DOC_PT_SIZE]u
. vs \\n[#DOC_LEAD]u
. QUAD \\*[$DOC_QUAD]
. \}
. \}
. ie \\n[#PP]=0 \{\
. if \\n[#INDENT_FIRST_PARAS] \{\
. ie \\n[#INDENT_ACTIVE] .ti \\n[#INDENT]u+\\n[#PP_INDENT]u
. el .ti \\n[#PP_INDENT]u
. if '\\n[.z]'END_NOTES' \
. ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
. \}
. if r #END_QUOTE \{\
. if \\n[#END_QUOTE] \{\
. if !\\n[#LINEBREAK] \{\
. ie \\n[#INDENT_ACTIVE] .ti \\n[#INDENT]u+\\n[#PP_INDENT]u
. el .ti \\n[#PP_INDENT]u
. if '\\n[.z]'END_NOTES' \
. ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
. \}
. \}
. \}
. \}
. el \{\
. if \\n[#PP_SPACE] \{\
. ie \\n[#END_QUOTE] \{\
. ie !'\\*[$PP_SPACE_AMOUNT]'' .sp \\*[$PP_SPACE_AMOUNT]
. el .sp
. rr #END_QUOTE
. nr #NO_SPACE 1
. nr #BASELINE_MARK \\n[nl]
. \}
. el \{\
. if \\n[#NO_SPACE]=1 .rr #NO_SPACE
. if \\n[post-float] \{\
. if (\\n[.t]-1)<\\*[$PP_SPACE_AMOUNT] \{\
. ie \\n[#COLS] .COL_NEXT
. el .NEWPAGE
. \}
. rr post-float
. \}
. if !\\n[nl]=\\n[#BASELINE_MARK] \{\
. ie !'\\*[$PP_SPACE_AMOUNT]'' .sp \\*[$PP_SPACE_AMOUNT]
. el .sp
. rr #BASELINE_MARK
. \}
. \}
. \}
. if \\n[restore-pp-space] \{\
. rr restore-pp-space
. PARA_SPACE
. \}
. ie \\n[#INDENT_ACTIVE] .ti \\n[#INDENT]u+\\n[#PP_INDENT]u
. el .ti \\n[#PP_INDENT]u
. if '\\n[.z]'END_NOTES' \
. ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
. \}
. if r #START .rr #START
. if r #QUOTE .rr #QUOTE
. if r #END_QUOTE .rr #END_QUOTE
. if r #HEAD .rr #HEAD
. if r #SUBHEAD .rr #SUBHEAD
. if r #EPIGRAPH .rr #EPIGRAPH
. if r #Q_FITS .rr #Q_FITS
. if r #LINEBREAK .rr #LINEBREAK
. if \\n[#ENDNOTE] \{\
. ie \\n[#RESET_PARA_SPACE] .PARA_SPACE
. el .PARA_SPACE OFF
. \}
. if \\n[#CONDENSE] \{\
\E*[COND]\c
. \}
. if \\n[#EXTEND]=1 \{\
\E*[EXT]\c
. \}
. nr #PP +1
. \}
. if \\n[#PP_STYLE]=2 \{\
\!. br
. ie \\n[#Q_PP]=0 \{\
. if \\n[#INDENT_FIRST_PARAS] \
. ti \\n[#PP_INDENT]u/2u
. if \\n[#ENDNOTE] \{\
. ie \\n[#INDENT_FIRSTS] .ti \\n[#PP_INDENT]u/2u
. el .ti 0
. \}
. \}
. el \{\
. ti \\n[#PP_INDENT]u/2u
. if \\n[#PP_SPACE]=1 \{\
. ie !'\\*[$PP_SPACE_AMOUNT]'' .ALD \\*[$PP_SPACE_AMOUNT]
. el .sp
. \}
. \}
. if \\n[#CONDENSE] \{\
\E*[COND]\c
. \}
. if \\n[#EXTEND]=1 \{\
\E*[EXT]\c
. \}
. nr #Q_PP +1
. \}
.\" This takes care of multi-paragraph dialogue, where each para
.\" is introduced by an open quote whereas the previous para has
.\" no close quote.
. if \\n[#OPEN_CLOSE]=1 .nr #OPEN_CLOSE 0
. nr #PP_ACTIVE 1
. UNDERLINE OFF
. if r #QUOTE_4_HD .rr #QUOTE_4_HD
. if r #LB_4_HD .rr #LB_4_HD
.END
\#
\# ====================================================================
\#
\# +++QUOTES+++
\#
\# ---Line for line quotes, e.g. poetry or code snippets---
\#
\# UNDERLINE QUOTES
\# ----------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Creates or modifies register #UNDERLINE_QUOTES (toggle).
\# If on, line for line quotes are underlined when printstyle
\# is TYPEWRITE.
\# *Notes:
\# Default is ON for printstyle TYPEWRITE.
\#
.MAC UNDERLINE_QUOTES END
. ie '\\$1'' .nr #UNDERLINE_QUOTES 1
. el .rr #UNDERLINE_QUOTES
.END
\#
\# QUOTE INDENT
\# ------------
\# *Argument:
\# <integer> | <integer with unit of measure appended>
\# *Function:
\# Creates or modifies register #Q_OFFSET_VALUE or string
\# $Q_OFFSET_VALUE.
\# *Notes:
\# If just an integer given, value by which to multiply PARA_INDENT
\# to get quote indent. If integer with a unit of measure appended,
\# absolute value of quote indent.
\#
\# Default is 3 for typeset; 2 for typewrite.
\#
.MAC QUOTE_INDENT END
. if '\\$0'BLOCKQUOTE_INDENT' .ds BQ BQ
. if '\\$0'QUOTE_INDENT' .ds BQ Q
. rr #\\*[BQ]_OFFSET_VALUE
. rm $\\*[BQ]_OFFSET_VALUE
. ds $EVAL_QI_ARG \\$1
. substring $EVAL_QI_ARG -1
. ie \B'\\*[$EVAL_QI_ARG]' .nr #\\*[BQ]_OFFSET_VALUE \\$1
. el .ds $\\*[BQ]_OFFSET_VALUE \\$1
. rm BQ
.END
.
.ALIAS BLOCKQUOTE_INDENT QUOTE_INDENT
\#
\# QUOTE_AUTOLEAD
\# --------------
\# *Arguments:
\# <autolead value>
\# *Function:
\# Sets autolead for quotes and/or blockquotes.
\#
.MAC QUOTE_AUTOLEAD END
. rr #\\$0_DEFAULT
. if '\\$0'QUOTE_AUTOLEAD' .nr #Q_AUTOLEAD (p;\\$1)
. if '\\$0'BLOCKQUOTE_AUTOLEAD' .nr #BQ_AUTOLEAD (p;\\$1)
. if '\\$0'ENDNOTE_QUOTE_AUTOLEAD' .nr #EN_Q_AUTOLEAD (p;\\$1)
. if '\\$0'ENDNOTE_BLOCKQUOTE_AUTOLEAD' .nr #EN_BQ_AUTOLEAD (p;\\$1)
.END
.
.ALIAS BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
.ALIAS ENDNOTE_QUOTE_AUTOLEAD QUOTE_AUTOLEAD
.ALIAS ENDNOTE_BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
\#
\# ALWAYS FULLSPACE QUOTES
\# -----------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Toggles register #FULLSPACE_QUOTES.
\# *Notes:
\# If user doesn't like the default 1/2 line space above and below
\# quotes, s/he can turn it off here. Has no effect in TYPEWRITE.
\#
.MAC ALWAYS_FULLSPACE_QUOTES END
. if '\\$1'' .nr #FULLSPACE_QUOTES 1
. el .rr #FULLSPACE_QUOTES
.END
\#
\# QUOTE
\# -----
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Indents quoted text on a line for line basis, or turns QUOTE off.
\# *Notes:
\# Owing to the need to bottom align TYPESET pages, quoted text gets
\# diverted so its depth can be measured (in DO_QUOTE) for determining
\# how much space to put before and after.
\#
.MAC QUOTE END
. ie \\n[@TOP] \
. br
. el 'br
. if \\n[#PP]>0 .rr #START
. if '\\n[.z]'FLOAT*DIV' .nr Q-float 1
. if \\n[#LINENUMBERS]=1 \{\
. nr #LINENUMBERS 2
. nr #NEXT_LN \\n[ln]
. nm
. \}
. if '\\$1'ADJUST' \{\
. ds $Q_SPACE_ADJUST \\$2
. shift 2
. \}
. ie '\\$1'' \{\
. ev QUOTE
. evc 0
. if \\n[.i] .in 0
. if \\n[#LINENUMBERS]=2 \
. if \\n[#SILENT_QUOTE_LN]=1 .nm \\n[#NEXT_LN] 1000 -4
. nr #IN_DIVER 1
. nr #QUOTE 1
. di P_QUOTE
. if '\\*[$Q_QUAD]'RIGHT' \{\
. ie !'\\*[$Q_OFFSET_VALUE]'' .ll \\n[#L_LENGTH]u-\\*[$Q_OFFSET_VALUE]
. el .ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
. \}
. ta \\n[.l]u
. if \\n[#COLUMNS] \{\
. ie \\n[#Q_OFFSET_VALUE] \
. ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
. el .ll \\n[#COL_L_LENGTH]u-\\*[$Q_OFFSET_VALUE]
. ta \\n[.l]u
. \}
. if \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
. vs \\n[#DOC_LEAD]u
. LEFT
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. FAMILY \\*[$QUOTE_FAM]
. FT \\*[$QUOTE_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
. ie !r #Q_AUTOLEAD .vs \\n[#DOC_LEAD]u
. el \{\
. vs \\n[.ps]u+\\n[#Q_AUTOLEAD]u
. nr #Q_LEAD \\n[.v]
. \}
. if \\n[#ENDNOTE] \{\
. ps \\n[#EN_PS]u\\*[$QUOTE_SIZE_CHANGE]
. ie !r #EN_Q_AUTOLEAD .vs \\n[#EN_Q_LEAD]u
. el \{\
. vs \\n[.ps]u+\\n[#EN_Q_AUTOLEAD]u
. nr #EN_Q_LEAD \\n[.v]
. \}
. \}
. nr #Q_LEAD_REAL \\n[.v]
. if \\n[#QUOTE_COLOR]=1 \{\
. nf
. COLOR \\*[$QUOTE_COLOR]
. \}
. \\*[$Q_QUAD]
. \}
. if \\n[#LINENUMBERS]=2 \{\
. ie \\n[#QUOTE_LN]=1 \{\
. if '\\n[#Q_LN_GUTTER]'' .nr #Q_LN_GUTTER \\n[#LN_GUTTER]
. LN_PARAMS
. nm \\n[ln] "" \\n[#Q_LN_GUTTER] -3-\\n[#Q_LN_GUTTER]
. RESTORE_PARAMS
. \}
. el \
. if !\\n[#SILENT_QUOTE_LN] .NUMBER_LINES OFF
. \}
. nr #Q_TOP \\n[nl]
. if \\n[#PRINT_STYLE]=1 \
. if \\n[#UNDERLINE_QUOTES] .FT I
. \}
. el .DO_QUOTE
.END
\#
\# CODE
\# ----
\# *Arguments:
\# <none> [ BR | BREAK | SPREAD ]
\# or
\# <anything> [ BR | BREAK | SPREAD ]
\# *Function:
\# Takes care of administrivia associated with setting code snippets.
\#
.MAC CODE END
\c
. if '\\$1'BR' \{\
. ie '\\n[.z]'FLOAT*DIV' 'br
. el .br
. shift
. \}
. if '\\$1'BREAK' \{\
. ie '\\n[.z]'FLOAT*DIV' 'br
. el .br
. shift
. \}
. if '\\$1'SPREAD' \{\
. ie '\\n[.z]'FLOAT*DIV' 'brp
. el .brp
. shift
. \}
. ie '\\$1'' \{\
. ds $RESTORE_FAM \\n[.fam]
. ds $RESTORE_FT \\n[.sty]
. ie \\n[#PRINT_STYLE]=1 \{\
. CODE_FAMILY C
. ie \\n[#CODE_FT]=1 .ft \\*[$CODE_FT]
. el \{\
. CODE_FONT R
. ft R
. char ' \[aq]
. \}
. if \\n[#UNDERLINE_QUOTES]=1 \{\
. nr #RESTORE_UNDERLINE 1
. UNDERLINE_QUOTES OFF
. FT \\*[$CODE_FT]
. char ' \[aq]
. \}
. \}
. el \{\
. ie \\n[#CODE_FAM]=1 .fam \\*[$CODE_FAM]
. el \{\
. CODE_FAMILY C
. fam \\*[$CODE_FAM]
. \}
. ie \\n[#CODE_FT]=1 .ft \\*[$CODE_FT]
. el \{\
. CODE_FONT R
. ft \\*[$CODE_FT]
. \}
. if \\n[#CODE_COLOR]=1 .COLOR \\*[$CODE_COLOR]
. char ' \[aq]
. if !\\n[#CODE_SIZE_ADJ]=0 \{\
. ds $RESTORE_SIZE \\n[.s]
. ps \\n[#PT_SIZE]u*\\n[#CODE_SIZE_ADJ]u/100u
. \}
. if \\n[#SQ_ON] \{\
. nr #SQ_WAS_ON 1
. SMARTQUOTES OFF
. \}
. \}
. \}
. el \{\
. fam \\*[$RESTORE_FAM]
. ft \\*[$RESTORE_FT]
. if !\\n[#CODE_SIZE_ADJ]=0 .ps \\*[$RESTORE_SIZE]
. rm $RESTORE_FAM
. rm $RESTORE_FT
. rm $RESTORE_SIZE
. if \\n[#PRINT_STYLE]=2 .char ' \[cq]
. if !'\\n[.z]'' \
. if \\n[#LINENUMBERS] .nn
. if \\n[#CODE_COLOR]=1 .gcolor
. if \\n[#RESTORE_UNDERLINE]=1 \{\
. rr #RESTORE_UNDERLINE
. UNDERLINE_QUOTES
. \}
. if \\n[#SQ_WAS_ON]=1 \{\
. rr #SQ_WAS_ON
. SMARTQUOTES
. \}
. if \\n[#QUOTE] .sp -1
. if \\n[pdfbx-end] .if !\\n[#QUOTE] .sp -1
. \}
.END
\#
\# ---Blockquotes---
\#
\# BLOCKQUOTE
\# ----------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Indents quoted text in fill mode and shortens line length
\# equivalently, or turns BLOCKQUOTE off.
\# *Notes:
\# Owing to the need to bottom align TYPESET pages, quoted text gets
\# diverted so its depth can be measured (in DO_QUOTE) for determining
\# how much space to put before and after.
\#
\# .PP after blockquote is optional if there's only one para,
\# but required if there's more than one.
\#
.MAC BLOCKQUOTE END
. ie \\n[@TOP] \
. br
. el 'br
. if \\n[#PP]>0 .rr #START
. if '\\n[.z]'FLOAT*DIV' .nr Q-float 1
. if \\n[#LINENUMBERS]=1 \{\
. nr #LINENUMBERS 2
. nr #NEXT_LN \\n[ln]
. nm
. \}
. if '\\$1'ADJUST' \{\
. ds $BQ_SPACE_ADJUST \\$2
. shift 2
. \}
. ie '\\$1'' \{\
. ev BLOCKQUOTE
. evc 0
. if \\n[.i] .in 0
. if \\n[#LINENUMBERS]=2 \
. if \\n[#SILENT_BQUOTE_LN]=1 .nm \\n[#NEXT_LN] 1000 -4
. nr #IN_DIVER 1
. nr #QUOTE 2
. nr #PP_STYLE 2
. nr #Q_PP 0
. di B_QUOTE
. ie !'\\*[$BQ_OFFSET_VALUE]'' .ll \\n[#L_LENGTH]u-(\\*[$BQ_OFFSET_VALUE]*2u)
. el .ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#BQ_OFFSET_VALUE]u*2u))
. if \\n[#ENDNOTE] \{\
. if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
. ie r#BQ_OFFSET_VALUE \
. ll \
\\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#BQ_OFFSET_VALUE]u*2u))
. el \
. ll \
\\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\*[$BQ_OFFSET_VALUE]*2u)
. \}
. if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
. ie r#BQ_OFFSET_VALUE \
. ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#BQ_OFFSET_VALUE]u*2u))
. el \
. ll \\n[#L_LENGTH]u-(\\*[$BQ_OFFSET_VALUE]u*2u)
. \}
. \}
. ta \\n[.l]u
. CHECK_INDENT
. if \\n[#COLUMNS] \{\
. ie r#BQ_OFFSET_VALUE \
. ll \
\\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#BQ_OFFSET_VALUE]u*2u))
. el \
. ll \\n[#COL_L_LENGTH]u-(\\*[$BQ_OFFSET_VALUE]*2u)
. if \\n[#ENDNOTE] \{\
. if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
. ie r#BQ_OFFSET_VALUE \
. ll \
\\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#BQ_OFFSET_VALUE]u*2u))
. el \
. ll \
\\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\*[$BQ_OFFSET_VALUE]*2u)
. \}
. if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
. ie r#BQ_OFFSET_VALUE \
. ll \
\\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#BQ_OFFSET_VALUE]u*2u))
. el \
. ll \\n[#COL_L_LENGTH]u-(\\*[$BQ_OFFSET_VALUE]*2u)
. \}
. \}
. ta \\n[.l]u
. \}
. if \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
. vs \\n[#DOC_LEAD]u
. QUAD LEFT
. HY OFF
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. FAMILY \\*[$BQUOTE_FAM]
. FT \\*[$BQUOTE_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
. ie !r #BQ_AUTOLEAD .vs \\n[#DOC_LEAD]u
. el \{\
. vs \\n[.ps]u+\\n[#BQ_AUTOLEAD]u
. nr #BQ_LEAD \\n[.v]
. \}
. if \\n[#ENDNOTE] \{\
. ps \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
. ie !r#EN_BQ_AUTOLEAD .vs \\n[#EN_BQ_LEAD]u
. el \{\
. vs \\n[.ps]u+\\n[#EN_BQ_AUTOLEAD]u
. nr #EN_BQ_LEAD \\n[.v]
. \}
. \}
. nr #BQ_LEAD_REAL \\n[.v]
. if \\n[#BQUOTE_COLOR]=1 \{\
. nf
. COLOR \\*[$BQUOTE_COLOR]
. \}
. QUAD \\*[$BQUOTE_QUAD]
. nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
. HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
. hy 14
. \}
. if \\n[#LINENUMBERS]=2 \{\
. ie \\n[#BQUOTE_LN]=1 \{\
. if '\\n[#BQ_LN_GUTTER]'' .nr #BQ_LN_GUTTER \\n[#LN_GUTTER]
. LN_PARAMS
. nm \\n[ln] "" \\n[#BQ_LN_GUTTER] -3-\\n[#BQ_LN_GUTTER]
. RESTORE_PARAMS
. \}
. el \
. if !\\n[#SILENT_BQUOTE_LN] .NUMBER_LINES OFF
. \}
. nr #Q_TOP \\n[nl]
. if \\n[#INDENT_FIRST_PARAS] \{\
. ie !\\n[#ENDNOTE] \{\
. if \\n[#PRINT_STYLE]=1 .ti \\n[#PP_INDENT]u/2u
. if \\n[#PRINT_STYLE]=2 .ti \\n[#PP_INDENT]u/2u
. \}
. el \{\
. if \\n[#INDENT_FIRSTS]=1 \{\
. if \\n[#PRINT_STYLE]=1 .ti \\n[#EN_PP_INDENT]u/2u
. if \\n[#PRINT_STYLE]=2 .ti \\n[#EN_PP_INDENT]u/2u
. \}
. \}
. \}
. \}
. el .DO_BLOCKQUOTE
.END
\#
\# DO QUOTE
\# --------
\# *Arguments:
\# <none>
\# *Function:
\# Ends the diversion P_QUOTE or B_QUOTE. Spaces them according to
\# PRINTSTYLE, whether there's inter-paragraph spacing, and page
\# position. TYPEWRITE treats spacing the same way in all circumstance
\# (viz. an extra line space). TYPESET puts in only half
\# line spaces if the entire quote plus 1 line of body under the quote
\# fits on the page; otherwise it puts in a full extra blank
\# line. (This is to ensure the page remains bottom aligned).
\#
.MAC DO_QUOTE END
. br
. if \\n[#DIVER_LN_OFF] \{\
\!. NUMBER_LINES OFF
. rr #DIVER_LN_OFF
. \}
. nr #Q_DEPTH \\n[.d]
. di
. if '\\$0'DO_BLOCKQUOTE' .ds BQ BQ
. if '\\$0'DO_QUOTE' .ds BQ Q
. rr #IN_DIVER
. if \\n[#RESET_FN_COUNTERS]=2 \{\
. if !\\n[#FN_COUNT]=1 \{\
. if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
. DIVER_FN_2_POST
. rr #RESET_FN_COUNTERS
. \}
. \}
. \}
. nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
. nr #DONE_ONCE 0 1
. REMOVE_INDENT
. ev
. nr #Q_LEAD_DIFF \\n[#LEAD]-\\n[#\\*[BQ]_LEAD_REAL]
. nr q-lead-diff \\n[#Q_LEAD_DIFF]
. if !\\n[pdfbx-running] \{\
. if !'\\n[.z]'FLOAT*DIV' \{\
. br
. nr #CALCULATE_ONLY 1
. nr #CURRENT_V_POS \\n[nl]+\\n[#Q_DEPTH]
. SHIM
. rr #CALCULATE_ONLY
. nr #Q_SPACE_EQ (\\n[#SHIM]/2)
. nr #TRAP \\n[.t]-1
. \}
. \}
. if \\n[#ENDNOTE] \{\
. nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
. ALWAYS_FULLSPACE_QUOTES
. \}
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#START]=1 .
. if \\n[#START]=0 \
. if !\\n[#LINEBREAK] .ALD \\n[#DOC_LEAD]u
. if \\n[#HEAD] \
. if \\n[#HEAD]=1 .RLD \\n[#DOC_LEAD]u
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. ie \\n[#PP_SPACE] \{\
. ie \\n[#HEAD] .
. el \{\
. ie \\n[#START] .
. el \{\
. ie \\n[#FULLSPACE_QUOTES] .ALD \\n[#DOC_LEAD]u
. el .ALD \\n[#DOC_LEAD]u/2u
. \}
. \}
. \}
. el \{\
. if !\\n[nl]=\\n[#PAGE_TOP] \{\
. ie \\n[#Q_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
. ie ((\\n[#TRAP_DISTANCE]-1)-\\n[#Q_DEPTH])<\\n[#DOC_LEAD] \
. Q_NOFIT
. el \{\
. ie (\\n[#TRAP_DISTANCE]-\\n[#DOC_LEAD])<\\n[#DOC_LEAD] \
. Q_NOFIT
. el \{\
. ie (\\n[#Q_DEPTH]+\\n[.v])=(\\n[#TRAP_DISTANCE]-1) \
. Q_NOFIT
. el .Q_FITS
. \}
. \}
. \}
. el .Q_NOFIT
. \}
. \}
. if \\n[#LINEBREAK] \{\
. vpt 0
. ie !\\n[@TOP] .sp -\\n[#DOC_LEAD]u
. el \{\
. nop
. sp |\\n[#T_MARGIN]u-\\n[#BQ_LEAD]u
. \}
. vpt
. \}
. \}
. ie !'\\*[$\\*[BQ]_OFFSET_VALUE]'' \
. nr #\\*[BQ]_OFFSET \\n[#L_MARGIN]+(\\*[$\\*[BQ]_OFFSET_VALUE])
. el \
. nr #\\*[BQ]_OFFSET \
\\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#\\*[BQ]_OFFSET_VALUE])
. if \\n[#COLUMNS] \{\
. ie r#\\*[BQ]_OFFSET_VALUE \
. nr #\\*[BQ]_OFFSET \
\\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#\\*[BQ]_OFFSET_VALUE])
. el .nr #\\*[BQ]_OFFSET \
\\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$\\*[BQ]_OFFSET_VALUE]
. \}
. if !\\n[#ENDNOTE] \{\
. ie '\\*[BQ]'Q' \{\
. if '\\*[$Q_QUAD]'LEFT' \{\
. po \\n[#Q_OFFSET]u
. if '\\n[.z]'FLOAT*DIV' \!.po \\n[#Q_OFFSET]u
. \}
. \}
. el \{\
. po \\n[#\\*[BQ]_OFFSET]u
. if '\\n[.z]'FLOAT*DIV' \!.po \\n[#\\*[BQ]_OFFSET]u
. \}
. \}
. if \\n[#ENDNOTE] \{\
. ie \\n[#\\*[BQ]_OFFSET_VALUE] \
. in +\\n[#EN_PP_INDENT]u*\\n[#\\*[BQ]_OFFSET_VALUE]u
. el .in +\\*[$\\*[BQ]_OFFSET_VALUE]
. \}
. ie \\n[#START]=1 \
. RLD 0-\\n[#Q_LEAD_DIFF]u
. el \{\
. if \\n[#PRINT_STYLE]=2 \{\
. ie !\\n[pdfbx-post-q] \{\
. ie !\\n[#NO_SHIM] \
. sp \\n[#Q_SPACE_EQ]u+(\\n[#Q_LEAD_DIFF]u/2u)
. el .if !\\n[#NO_FLEX] .FLEX
. \}
. el .sp -.5
. \}
. \}
. if \\n[#QUOTE]=1 \{\
. if !'\\*[$Q_SPACE_ADJUST]'' .sp +\\*[$Q_SPACE_ADJUST]
. nf
. P_QUOTE
. if !'\\*[$Q_SPACE_ADJUST]'' \{\
. sp -\\*[$Q_SPACE_ADJUST]
. rm $Q_SPACE_ADJUST
. \}
. \}
. if \\n[#QUOTE]=2 \{\
. if !'\\*[$BQ_SPACE_ADJUST]'' .sp +\\*[$BQ_SPACE_ADJUST]
. nf
. B_QUOTE
. if !'\\*[$BQ_SPACE_ADJUST]'' \{\
. sp -\\*[$BQ_SPACE_ADJUST]
. rm $BQ_SPACE_ADJUST
. \}
. \}
. if !\\n[#START] .rr #QUOTE
. rr delay-ev-pop
. if !'\\n[.z]'FLOAT*DIV' \{\
. if \\n[#PRINT_STYLE]=1 \{\
. if !\\n[.v]=\\n[#DOC_LEAD] \{\
. if !r pdfbx-post-q \{\
. ie !\\n[#NO_SHIM] .SHIM
. el \
. if !\\n[#NO_FLEX] .FLEX
. \}
. \}
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. ie \\n[#START] \{\
. ie \\n[#PP_SPACE] .
. el \{\
. sp \\n[#DOC_LEAD]u/2u
. if !r pdfbx-post-q \{\
. ie !\\n[#NO_SHIM] .SHIM
. el \
. if !\\n[#NO_FLEX] .FLEX
. \}
. \}
. \}
. el \{\
. ie \\n[#HEAD]=1 \{\
. sp \\n[#DOC_LEAD]u
. if !r pdfbx-post-q \{\
. ie !\\n[#NO_SHIM] .SHIM
. el \
. if !\\n[#NO_FLEX] .FLEX
. \}
. \}
. el \{\
. ie \\n[#FULLSPACE_QUOTES] \{\
. ie \\n[#ENDNOTE] .ALD \\n[#EN_LEAD]u
. el .if !'\\n[.z]'FLOAT*DIV' .ALD \\n[#DOC_LEAD]u
. \}
. el \
. if !'\\n[.z]'FLOAT*DIV' .ALD \\n[#DOC_LEAD]u/2u
. ie \\n[#Q_FITS] \{\
. ie (\\n[#Q_TOP]=\\n[#PAGE_TOP]):(\\n[@TOP]=1) \{\
. if \\n[has-label] .sp \\n[#DOC_LEAD]u/2u
. if !'\\n[.z]'FLOAT*DIV' \{\
. nr #Q_AT_TOP 1
. nr #DELAY_SHIM 1
. \}
. \}
. el \{\
. ie !\\n[#NO_SHIM] .SHIM
. el .if !\\n[#NO_FLEX] .FLEX
. \}
. \}
. el \{\
. ie r pdfbx-post-q \{\
. if \\n[.t]>1v \{\
. ie !\\n[#NO_SHIM] .SHIM
. el \
. if !\\n[#NO_FLEX] .FLEX
. \}
. \}
. el \{\
. ie !\\n[#NO_SHIM] .SHIM
. el \
. if !\\n[#NO_FLEX] .FLEX
. \}
.\" Make sure that Q_LEAD_DIFF is not added to the first line of
.\" normal text at the top of any page following output of a quote
.\" whose last line falls on B_MARGIN of the previous page.
. if \\n[#Q_LEAD_DIFF] \{\
. if \\n[nl]=(\\n[#T_MARGIN]-\\n[#DOC_LEAD]+\\n[#Q_LEAD_DIFF]) \{\
. PRINT \&
. br
. sp -1v-\\n[#Q_LEAD_DIFF]u
. nr #Q_LEAD_DIFF_CHECK 1
. \}
. \}
. \}
. \}
. \}
. \}
. \}
. if \\n[#RESTORE_NO_SHIM] .nr #NO_SHIM 1
. rr #Q_SPACE_EQ
. if \\n[#LINENUMBERS]=2 \{\
. nr #LINENUMBERS 1
. if !\\n[#ENDNOTE] \{\
. ie \\n[#RESTORE_LN_NUM]=1 \{\
. LN_PARAMS
. nm \\n[#NEXT_LN]
. RESTORE_PARAMS
. \}
. el \{\
. LN_PARAMS
. nm +0
. RESTORE_PARAMS
. \}
. \}
. \}
. if \\n[#ENDNOTE] \
. nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING]
. if r #HEAD .rr #HEAD
. if r #EPIGRAPH .rr #EPIGRAPH
. rr #Q_PP
. rr #LINEBREAK
. nr #PP_STYLE 1
. nr #END_QUOTE 1
. if !\\n[#ENDNOTE] \
. po \\n[#L_MARGIN]u
. if \\n[#ENDNOTE] .in \\n[#EN_TEXT_INDENT]u
. if \\n[#COLUMNS] \{\
. if !\\n[#ENDNOTE] \{\
. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n[.o]
. \}
. if \\n[#ENDNOTE] .in \\n[#EN_TEXT_INDENT]u
. \}
. ie !\\n[#ENDNOTE] .QUAD \\*[$DOC_QUAD]
. el .QUAD \\*[EN_QUAD]
. if r #DELAY_SHIM \{\
. ie !\\n[#NO_SHIM] .SHIM
. el \
. if !\\n[#NO_FLEX] .FLEX
. rr #DELAY_SHIM
. \}
. if \\n[#PRINT_STYLE]=1 \
. if \\n[#UNDERLINE_QUOTES] .FT R
. nr #QUOTE_4_HD 1
. rr #\\*[BQ]_LEAD_REAL
. rm BQ
. if \\n[#DOC_TYPE]=5 .NO_SHIM
. if '\\n[.z]'FLOAT*DIV' \!.po \\n[#L_MARGIN]u
.END
.
.ALIAS DO_BLOCKQUOTE DO_QUOTE
\#
\# Utility macros for DO_QUOTE
\# ---------------------------
\#
.MAC Q_FITS END
. nr #Q_FITS 1
. ie \\n[#HEAD]=1 .ALD \\n[#Q_LEAD_DIFF]u
. el \{\
. ie \\n[#START] .
. el \{\
. ie \\n[#FULLSPACE_QUOTES] \{\
. ie \\n[#ENDNOTE] .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u
. el .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u
. \}
. el \{\
.\" This seems to be the only way to get the baseline of quotes that
.\" start at the top of the page to fall on the first line of the
.\" grid (ie. on the first valid baseline of the page).
. ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
. if \\n[#QUOTE]=1 .ds $QUOTE_TYPE Q
. if \\n[#QUOTE]=2 .ds $QUOTE_TYPE B
. rn \\*[$QUOTE_TYPE]_QUOTE Q_TEMP
. di \\*[$QUOTE_TYPE]_QUOTE
. nf
. if \\n[#QUOTE]=1 .vs \\n[#Q_LEAD]u
. if \\n[#QUOTE]=2 .vs \\n[#BQ_LEAD]u
. PRINT \&
. sp -1v+\\n[#Q_LEAD_DIFF]u
. Q_TEMP
. di
. rm Q_TEMP
. sp \\n[#DOC_LEAD]u/2u
. \}
. el \
. sp \\n[#DOC_LEAD]u/2u
. \}
. \}
. if \\n[#DIVER_FN]=2 .rr #DIVER_FN
. if !\\n[#NO_FLEX] .FLEX
. \}
. rm $QUOTE_TYPE
.END
\#
.MAC Q_NOFIT END
. rr #Q_FITS
. if \\n[#QUOTE]=1 \{\
. ds $QUOTE_TYPE Q
. ds quote-type quote
. \}
. if \\n[#QUOTE]=2 \{\
. ds $QUOTE_TYPE B
. ds quote-type blockquote
. \}
. if \\n[has-caption] \{\
. if !\\n[@TOP] \
. if !\\n[nl]=\\n[#PAGE_TOP] \
. if (\\n[.t]-1)<\
\\n[#DOC_LEAD]+(\\n[#DOC_LEAD]/4)\
+\\n[#\\*[QUOTE_TYPE]_LEAD] \{\
. tm1 "[mom]: Insufficient room for caption and at least one line of \\*[quote-type]
. tm1 " on page \\n[%] (line \\n[.c]). Moving quote to next page or column.
. ie \\n[#COLUMNS] .COL_NEXT
. el .NEWPAGE
. \}
. \}
. ie r#HEAD \
. if \\n[#HEAD]=1 .
. el \{\
. if \\n[#Q_DEPTH]=0 \
. if \\n[.ns] .rs
. ie \\n[#FULLSPACE_QUOTES] \{\
. ie \\n[#ENDNOTE] .sp \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u
. el .sp \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u
. \}
. el \{\
. sp .5
. if \\n[@TOP] .rs
. \}
. ie \\n[#Q_LEAD_REAL] \
. nr #Q_PARTIAL_DEPTH 0 \\n[#Q_LEAD_REAL]
. el .nr #Q_PARTIAL_DEPTH 0 \\n[#BQ_LEAD_REAL]
. while \\n+[#Q_PARTIAL_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
.
. \}
. if !\\n[#Q_LEAD_REAL]=\\n[#DOC_LEAD] \{\
. ie \\n[#Q_LEAD_REAL] \
. nr #Q_PARTIAL_DEPTH -\\n[#Q_LEAD_REAL]
. el .nr #Q_PARTIAL_DEPTH -\\n[#BQ_LEAD_REAL]
. \}
. nr #Q_SPACE_EQ \
(\\n[#TRAP_DISTANCE]-1)-\\n[#Q_PARTIAL_DEPTH]+(\\n[#Q_LEAD_DIFF]u/2u)
. if \\n[#FN_COUNT]>0 .nr #Q_SPACE_EQ (\\n[#Q_SPACE_EQ] / 2u)
.\" Hack to deal with the fact that even though the above routine
.\" makes the bottom line of the quote fall exactly on the bottom
.\" margin when traps are disabled, it refuses to do so when traps
.\" are on. The difference by which it's off is #Q_LEAD_DIFF
.\" (the +\\n[#Q_LEAD_DIFF] at the end of the line, above). Hack
.\" solution: temporarily lower the FOOTER trap position.
. if !\\n[pdfbx-running] \{\
. if !\\n[#Q_DEPTH]=0 \{\
. nr #SAVED_FOOTER_POS \\n[#VARIABLE_FOOTER_POS]
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+.25v
. \}
. \}
.\}
.END
\#
\# ====================================================================
\#
\# +++PAGINATION+++
\#
\# PAGINATE
\# --------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Turns page numbering off or on during document processing.
\# *Notes:
\# Default is on.
\#
.MAC PAGINATE END
. ie '\\$1'' \{\
. nr #PAGINATE 1
. if \\n[#SAVED_V_POS] \{\
. nr #PAGE_NUM_V_POS \\n[#SAVED_V_POS]
. rr #SAVED_V_POS
. \}
. \}
. el \{\
. nr #PAGINATE 0
. nr #SAVED_V_POS \\n[#PAGE_NUM_V_POS]
. rr #PAGE_NUM_V_POS
. \}
. if \\n[#HF_OFF]=1 \{\
. rr #PAGINATION_STATE
. rr #HF_OFF
. \}
.END
\#
\# SUSPEND PAGINATION (before ENDNOTES)
\# ------------------
\# *Argument:
\# <none>
\# *Function:
\# Creates register #SUSPEND_PAGINATION
\# *Notes:
\# Useful only to suspend pagination before outputting endnotes.
\#
.MAC SUSPEND_PAGINATION END
. nr #SUSPEND_PAGINATION 1
.END
\#
\# RESTORE PAGINATION (after ENDNOTES)
\# ------------------
\# *Argument:
\# <none>
\# *Function:
\# Removes register #SUSPEND_PAGINATION. Creates register
\# #DEFER_PAGINATION
\# *Notes:
\# Useful only to restore pagination after outputting endnotes.
\#
.MAC RESTORE_PAGINATION END
. rr #SUSPEND_PAGINATION
. if \\n[#PAGE_NUM_V_POS]=1 .PAGINATE
. if \\n[#PAGE_NUM_V_POS]=2 .nr #DEFER_PAGINATION 1
.END
\#
\# PAGE NUMBER FORMAT
\# ------------------
\# *Arguments:
\# DIGIT | ROMAN | roman | ALPHA | alpha
\# *Function:
\# Assigns user entered format to #PAGENUMBER.
\#
.MAC PAGENUM_STYLE END
. nr #PAGENUM_STYLE_SET 1
. if '\\$1'DIGIT' \{\
. ds $PAGENUM_STYLE \\$1
. af #PAGENUMBER 1
. \}
. if '\\$1'ROMAN' \{\
. ds $PAGENUM_STYLE \\$1
. af #PAGENUMBER I
. \}
. if '\\$1'roman' \{\
. ds $PAGENUM_STYLE \\$1
. af #PAGENUMBER i
. \}
. if '\\$1'ALPHA' \{\
. ds $PAGENUM_STYLE \\$1
. af #PAGENUMBER A
. \}
. if '\\$1'alpha' \{\
. ds $PAGENUM_STYLE \\$1
. af #PAGENUMBER a
. \}
.END
\#
\# HYPHENS AROUND PAGE NUMBERS
\# ---------------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Creates or modifies register #PAGE_NUM_HYPHENS.
\# Used to dis/enable hyphens on either side of page numbers.
\# *Notes:
\# Default is on.
\#
.MAC PAGENUM_HYPHENS END
. nr #PAGE_NUM_HYPHENS_SET 1
. ie '\\$1'' .nr #PAGE_NUM_HYPHENS 1
. el .rr #PAGE_NUM_HYPHENS
.END
\#
\# PAGENUMBER POSITION
\# -------------------
\# *Arguments:
\# TOP | BOTTOM LEFT | CENTER | RIGHT
\# *Function:
\# Creates or modifies various PAGE_NUM_H | V_POS registers.
\# Used to position page numbers.
\# *Notes:
\# Default is center/bottom.
\#
.MAC PAGENUM_POS END
. nr #PAGE_NUM_POS_SET 1
. if '\\$1'TOP' .nr #PAGE_NUM_V_POS 1
. if '\\$1'BOTTOM' .nr #PAGE_NUM_V_POS 2
. if '\\$2'LEFT' .nr #PAGE_NUM_H_POS 1
. if '\\$2'CENTER' .nr #PAGE_NUM_H_POS 2
. if '\\$2'CENTRE' .nr #PAGE_NUM_H_POS 2
. if '\\$2'RIGHT' .nr #PAGE_NUM_H_POS 3
.END
\#
.MAC PN_WITH_HYPHENS END
. nr #HYPHEN_ADJ \\n[#CAP_HEIGHT]/12
. ds $HYPHEN \v'-\En[#HYPHEN_ADJ]u'-\v'\En[#HYPHEN_ADJ]u'
. ds $PN_FOR_KN \\n[#PAGENUMBER]
.\" Check for initial or terminal 1's or 7's, and apply a little kerning
. substring $PN_FOR_KN 0 0 \" 1st digit
. if '\\*[$PN_FOR_KN]'1' .ds $PRE_HY_KN \*[BU3]
. if '\\*[$PN_FOR_KN]'7' .ds $PRE_HY_KN \*[BU3]
. ds $PN_FOR_KN \\n[#PAGENUMBER]
. substring $PN_FOR_KN -1 -1 \" last digit
. if '\\*[$PN_FOR_KN]'1' .ds $POST_HY_KN \*[BU3]
. if '\\*[$PN_FOR_KN]'7' .ds $POST_HY_KN \*[BU3]
. PRINT \
\m[\\*[$PAGE_NUM_COLOR]]\
\\*[$HYPHEN]\|\\*[$PRE_HY_KN]\\n[#PAGENUMBER]\\*[$POST_HY_KN]\|\\*[$HYPHEN]
. br
. rm $PRE_HY_KERN
. rm $POST_HY_KERN
.END
\#
\# PRINT PAGE NUMBER
\# -----------------
\# *Arguments:
\# <none>
\# *Function:
\# Prints page number if PAGINATE=1.
\#
.MAC PRINT_PAGE_NUMBER END
. ev PAGENUMBER
. nf
. po \\n[#DOC_L_MARGIN]u
. ll \\n[#DOC_L_LENGTH]u
. ta \\n[.l]u
. fam \\*[$PAGE_NUM_FAM]
. ft \\*[$PAGE_NUM_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
. if \\n[#PRINT_STYLE]=1 .TYPEWRITER
. if \\n[#PAGE_NUM_V_POS]=1 .vs 0
. if o \{\
. ie \\n[#PAGE_NUM_H_POS]=1 .LEFT
. el .RIGHT
. \}
. if e \{\
. ie \\n[#PAGE_NUM_H_POS]=1 .RIGHT
. el .LEFT
. \}
. if \\n[#PAGE_NUM_H_POS]=2 .CENTER
. if \\n[#RECTO_VERSO]=0 \{\
. if \\n[#PAGE_NUM_H_POS]=1 .LEFT
. if \\n[#PAGE_NUM_H_POS]=2 .CENTER
. if \\n[#PAGE_NUM_H_POS]=3 .RIGHT
. \}
. nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
. if \\n[#EN_FIRST_PAGE] \{\
. if \\n[#EN_FIRST_PN] .PAGENUMBER \\n[#EN_FIRST_PN]
. rr #EN_FIRST_PAGE
. \}
. if \\n[#BIB_FIRST_PAGE] \{\
. if \\n[#BIB_FIRST_PN] .PAGENUMBER \\n[#BIB_FIRST_PN]
. rr #BIB_FIRST_PAGE
. \}
. ie \\n[#DRAFT_WITH_PAGENUM] \{\
. ie '\\*[$REVISION]'' \
. PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT] / \\n[#PAGENUMBER]"
. el \{\
. ie '\\*[$DRAFT]'' \
. PRINT "\\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
. el \
. PRINT \
"\\*[$DRAFT_STRING]\\*[$DRAFT], \\*[$REVISION_STRING] \\*[$REVISION] / \
\\n[#PAGENUMBER]"
. \}
. \}
. el \{\
. ie \\n[#PAGE_NUM_HYPHENS] \{\
. if '\\*[$PAGENUM_STYLE]'DIGIT' \{\
. di NULL
1\\R'#CAP_HEIGHT \\n[.cht]'
. di
. PN_WITH_HYPHENS
. \}
. if '\\*[$PAGENUM_STYLE]'ROMAN' \{\
. di NULL
I\\R'#CAP_HEIGHT \\n[.cht]'
. di
. PN_WITH_HYPHENS
. \}
. if '\\*[$PAGENUM_STYLE]'ALPHA' \{\
. di NULL
E\\R'#CAP_HEIGHT \\n[.cht]'
. di
. PN_WITH_HYPHENS
. \}
. if '\\*[$PAGENUM_STYLE]'roman' \
. PRINT \m[\\*[$PAGE_NUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
. if '\\*[$PAGENUM_STYLE]'alpha' \
. PRINT \m[\\*[$PAGE_NUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
. \}
. el \{\
. ie !d$PAGENUM_STRING .PRINT \m[\\*[$PAGE_NUM_COLOR]]\\n[#PAGENUMBER]
. el .PRINT \m[\\*[$PAGE_NUM_COLOR]]\\*[$PAGENUM_STRING]
. \}
. \}
. ev
. nr #DIVER_DEPTH 0
.END
\#
\# ====================================================================
\#
\# +++FOOTNOTES+++
\#
\# Mom's footnote handling is baroque, to say the least. There are
\# redundancies in a number of the macros involved, as well as some
\# registers that probably don't get used anymore. The baggage is left
\# in in case some new footnote oddity/challenge gets thrown at her.
\#
\# The macros are heavily commented.
\#
\# FOOTNOTE AUTOLEAD
\# -----------------
\# *Arguments:
\# <autolead value for footnotes>
\# *Function:
\# Creates or modifies register #FN_AUTOLEAD.
\# *Notes:
\# Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
\#
.MAC FOOTNOTE_AUTOLEAD END
. nr #FN_AUTOLEAD (p;\\$1)
.END
\#
\# FOOTNOTE MARKERS
\# ----------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Turns generation of footnote markers on or off.
\# *Notes:
\# Default is on.
\#
.MAC FOOTNOTE_MARKERS END
. ie '\\$1'' .nr #FN_MARKERS 1
. el .nr #FN_MARKERS 0
.END
\#
\# FOOTNOTE MARKER STYLE
\# ---------------------
\# *Arguments:
\# STAR | NUMBER | LINE
\# *Function:
\# Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
\# the style of footnote markers.
\# *Notes:
\# 1=STAR; 2=NUMBER; 3=LINE. LINE means "use output line numbers".
\# Default is STAR.
\#
.MAC FOOTNOTE_MARKER_STYLE END
. if '\\$1'STAR' \{\
. if \\n[#FN_MARKER_STYLE]=3 \{\
. if !\\n[#NEWPAGE]=1 \{\
. tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is LINE.
. tm1 " You cannot change footnote marker style without
. tm1 " first breaking to a new page with NEWPAGE.
. tm1 " Ignoring request FOOTNOTE_MARKER_STYLE STAR at line \\n[.c].
. return
. \}
. \}
. if \\n[#RUN_ON]=1 \{\
. tm1 "[mom]: FOOTNOTE_MARKER_STYLE STAR at line \\n[.c] is incompatible
. tm1 " with RUN_ON footnotes. Ignoring request.
. return
. \}
. nr #FN_MARKER_STYLE 1
. if \\n[#NEWPAGE]=1 .rr #NEWPAGE
. FOOTNOTE_MARKERS
. \}
. if '\\$1'NUMBER' \{\
. if \\n[#FN_MARKER_STYLE]=3 \{\
. if !\\n[#NEWPAGE]=1 \{\
. tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is NUMBER.
. tm1 " You cannot change footnote marker style without
. tm1 " first breaking to a new page with NEWPAGE.
. tm1 " Ignoring request FOOTNOTE_MARKER_STYLE NUMBER at line \\n[.c].
. return
. \}
. \}
. if \\n[#RUN_ON]=1 \{\
. tm1 "[mom]: FOOTNOTE_MARKER_STYLE NUMBER at line \\n[.c] is incompatible
. tm1 " with RUN_ON footnotes. Ignoring request.
. return
. \}
. nr #FN_MARKER_STYLE 2
. shift
. if '\\$1'NO_SUPERSCRIPT' .nr #NO_SUPERSCRIPT 1
. if \\n[#NEWPAGE]=1 .rr #NEWPAGE
. FOOTNOTE_MARKERS
. \}
. if '\\$1'LINE' \{\
. nr #FN_MARKER_STYLE 3
. FOOTNOTE_MARKERS OFF
. if !\\n[#FN_LN_SEP] \
. if !\\n[#FN_LN_BRACKETS] .FOOTNOTE_LINENUMBER_BRACKETS SQUARE
. \}
.END
\#
\# FOOTNOTE NUMBER PLACEHOLDERS
\# ----------------------------
\# *Argument:
\# <number of placeholders>
\# *Function:
\# Sets register #FN_NUMBER_PLACEHOLDERS, used to establish whether to
\# right pad a footnote number (in the footnote itself, not body copy).
\# *Notes:
\# No default is set for this; user must determine if, and where, it's
\# required
\#
.MAC FOOTNOTE_NUMBER_PLACEHOLDERS END
. nr #FN_NUMBER_PLACEHOLDERS \\$1
.END
\#
\# FOOTNOTE LINENUMBER MARK
\# ------------------------
\# *Function:
\# This string, when called inline, stores the current output line
\# number in register #FN_MARK for use with FOOTNOTE.
\#
.ds FN_MARK \R'#FN_MARK \En[ln]'
\#
\# FOOTNOTE LINENUMBER SEPARATOR
\# -----------------------------
\# *Argument:
\# <user-defined separator>
\# *Function:
\# Stores user-defined separator (for use then
\# FOOTNOTE_MARKER_STYLE is LINE) in string $FN_LN_SEP. The
\# separator is intended to be used when the user wishes a
\# separator, rather than the choice of brackets offered by
\# FOOTNOTE_LINENUMBER_BRACKETS.
\#
.MAC FOOTNOTE_LINENUMBER_SEPARATOR END
. rr #FN_LN_BRACKETS
. nr #FN_LN_SEP 1
. ds $FN_LN_SEP "\\$1
.END
\#
\# FOOTNOTE LINENUMBER BRACKETS
\# ----------------------------
\# *Argument:
\# PARENS | SQUARE | BRACES or ( | [ | {
\# *Function:
\# Sets register #FN_LN_BRACKETS to 1, and creates strings
\# $FN_OPEN_BRACKET and $FN_CLOSE_BRACKET according to the given
\# argument.
\#
.MAC FOOTNOTE_LINENUMBER_BRACKETS END
. rr #FN_LN_SEP
. nr #FN_LN_BRACKETS 1
. if '\\$1'PARENS' \{\
. ds $FN_OPEN_BRACKET (
. ds $FN_CLOSE_BRACKET )
. \}
. if '\\$1'(' \{\
. ds $FN_OPEN_BRACKET (
. ds $FN_CLOSE_BRACKET )
. \}
. if '\\$1'SQUARE' \{\
. ds $FN_OPEN_BRACKET [
. ds $FN_CLOSE_BRACKET ]
. \}
. if '\\$1'[' \{\
. ds $FN_OPEN_BRACKET [
. ds $FN_CLOSE_BRACKET ]
. \}
. if '\\$1'BRACES' \{\
. ds $FN_OPEN_BRACKET {
. ds $FN_CLOSE_BRACKET }
. \}
. if '\\$1'{' \{\
. ds $FN_OPEN_BRACKET {
. ds $FN_CLOSE_BRACKET }
. \}
.END
\#
\# RESET FOOTNOTE NUMBER
\# ---------------------
\# *Arguments:
\# <none> | PAGE
\# *Function:
\# Resets register #FN_NUMBER to 1. If argument is PAGE, creates
\# toggle #RESET_FN_NUMBER which is checked in HEADER. If 1,
\# numbered footnotes on every page start at 1.
\#
.MAC RESET_FOOTNOTE_NUMBER END
. ie '\\$1'' .nr #FN_NUMBER 0 1
. el .nr #RESET_FN_NUMBER 1
.END
\#
\# FOOTNOTE RULE LENGTH
\# --------------------
\# *Arguments:
\# <length of rule used to separate footnotes from running text>
\# *Function:
\# Creates or modifies registers #FN_RULE_LENGTH.
\# *Notes:
\# Requires unit of measure (iPpcm).
\# Default is 4P for both PRINTSTYLEs.
\#
.MAC FOOTNOTE_RULE_LENGTH END
. nr #FN_RULE_LENGTH (\\$1)
.END
\#
\# FOOTNOTE_RULE_ADJ
\# -----------------
\# *Arguments:
\# <number of points to raise footnote rule from it's baseline position>
\# *Function:
\# Creates or modifies register #FN_RULE_ADJ.
\# *Notes:
\# Default is 3p for both TYPESTYLES.
\#
\# Requires unit of measure.
\#
.MAC FOOTNOTE_RULE_ADJ END
. nr #FN_RULE_ADJ (\\$1)
.END
\#
\# FOOTNOTE RULE
\# -------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Turns printing of footnote separator rule on or off. If invoked as
\# PRINT_FOOTNOTE_RULE, prints footnote separator rule.
\# *Notes:
\# Default is on.
\#
\# Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
\# if the footnote number (#FN_COUNT) is 1.
\#
.MAC FOOTNOTE_RULE END
. ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
. if \\n[#FN_RULE]=0 .RLD 1v
. RLD 1v
. LEFT
\v'-\\n[#FN_RULE_ADJ]u-\\n[#FN_RULE_WEIGHT_ADJ]u'\
\D't \\n[#FN_RULE_WEIGHT]'\
\h'-\\n[#FN_RULE_WEIGHT]u'\
\D'l \\n[#FN_RULE_LENGTH]u 0'\
\v'+\\n[#FN_RULE_ADJ]u+\\n[#FN_RULE_WEIGHT_ADJ]u'
\!. ps \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
. QUAD \\*[$FN_QUAD]
. \}
. el \{\
. ie '\\$1'' .nr #FN_RULE 1
. el .nr #FN_RULE 0
. \}
.END
\#
\# FOOTNOTE SPACING
\# ----------------
\# *Arguments:
\# <per item post footnote spacing> | <anything>
\# *Function:
\# Enables printing of post footnote spacing.
\# *Notes:
\# Default is no space.
\#
.MAC FOOTNOTE_SPACING END
. ie \B'\\$1' .ds $FN_SPACE \\$1
. el .rm $FN_SPACE
.END
\#
\# FOOTNOTE FIRST LINE INDENT
\# --------------------------
\# *Arguments:
\# <indent>
\# *Function:
\# Indents first line of footnotes.
\# *Notes:
\# Default is no indent.
\#
.MAC FOOTNOTE_INDENT END
. nr #FN_INDENT \\$1
.END
\#
\# RUN ON FOOTNOTES
\# ----------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Toggles run-on footnotes on or off.
\#
.MAC FOOTNOTES_RUN_ON END
. ie '\\$1'' \{\
. if \\n[#FN_COUNT]>0 \{\
. tm1 "[mom]: Switching to run-on footnotes at line \\n[.c] will cause
. tm1 " you to loose footnotes already formatted for this page.
. tm1 " Ignoring request FOOTNOTES_RUN_ON.
. rr #RUN_ON
. return
. \}
. nr #RUN_ON 1
. if \\n[#FN_MARKER_STYLE]=1 .RUNON_WARNING
. if \\n[#FN_MARKER_STYLE]=2 .RUNON_WARNING
. \}
. el \{\
. if \\n[#FN_COUNT]>0 \{\
. if \\n[#RUN_ON]=1 \{\
. tm1 "[mom]: Switching off run-on footnotes at line \\n[.c] will cause
. tm1 " you to loose footnotes already formatted for this page.
. tm1 " Ignoring request FOOTNOTES_RUN_ON \\$1.
. return
. \}
. \}
. rr #RUN_ON
. \}
.END
\#
.MAC RUNON_WARNING END
. if \\n[#FN_MARKER_STYLE]=1 \{\
. tm1 "[mom]: The footnote marker style active at line \\n[.c] is STAR,
. tm1 " which is incompatible with run-on footnotes. Please change
. tm1 " the footnote marker style to LINE. Continuing to process,
. tm1 " but ignoring request FOOTNOTES_RUN_ON.
. rr #RUN_ON
. \}
. if \\n[#FN_MARKER_STYLE]=2 \{\
. tm1 "[mom]: The footnote marker style active at line \\n[.c] is NUMBER,
. tm1 " which is incompatible with run-on footnotes. Please change
. tm1 " the footnote marker style to LINE. Continuing to process,
. tm1 " but ignoring request FOOTNOTES_RUN_ON.
. rr #RUN_ON
. \}
.END
\#
\# FOOTNOTE
\# --------
\# *Arguments:
\# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value> | <anything>
\# *Function:
\# Begins collecting and diverting footnote text if no argument
\# given. Otherwise, ends diversion FOOTNOTES, measures footnote
\# depth, and sets footnote trap.
\# *Notes:
\# The input line preceding a footnote call MUST terminate with \c
\# or the footnote marker will be spaced away from the word it
\# should be joined to.
\#
\# If FOOTNOTE is invoked with INDENT, the footnote will
\# be indented. An indent style and an indent value must be given.
\# Subsequent footnotes will NOT be indented; INDENT must be given
\# for each footnote the user wants indented.
\#
.MAC FOOTNOTE END
. ie '\\$1'' \{\
. if \\n[#UNDERLINE_ON] \{\
. UNDERLINE OFF
. nr #UNDERLINE_WAS_ON_FN 1
. \}
. if \\n[#FN_MARKER_STYLE]=3 \{\
. if !\\n[#LINENUMBERS] \{\
. tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
. tm1 " FOOTNOTE_MARKER_STYLE is LINE.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. if \\n[#FN_MARK]=0 .nr #FN_MARK \\n[ln]
. nr #FN_MARK_2 \\n[ln]
. if '\\n[.z]'P_QUOTE' \{\
. nr #FN_MARK -1
. nr #FN_MARK_2 -1
. \}
. if \\n[#IN_DIVER]=1 \{\
. if '\\n[.z]'P_QUOTE' \{\
. if !\\n[#QUOTE_LN]=1 \{\
. if !\\n[#SILENT_QUOTE_LN]=1 \{\
. tm1 "[mom]: You have requested a line-numbered footnote inside a
. tm1 " QUOTE at line \\n[.c], but line-numbering has not been enabled
. tm1 " for QUOTES. Printing footnote with label "0".
. rr #FN_MARK
. rr #FN_MARK_2
. \}
. \}
. \}
. if '\\n[.z]'B_QUOTE' \{\
. if !\\n[#BQUOTE_LN]=1 \{\
. if !\\n[#SILENT_BQUOTE_LN]=1 \{\
. tm1 "[mom]: You have requested a line-numbered footnote inside a
. tm1 " BLOCKQUOTE at line \\n[.c], but line-numbering has not been enabled
. tm1 " for BLOCKQUOTES. Printing footnote with label "0".
. rr #FN_MARK
. rr #FN_MARK_2
. \}
. \}
. \}
. \}
. \}
.\" Begin processing footnotes that occur inside QUOTE, BLOCKQUOTE
.\" or EPIGRAPH.
. if \\n[#IN_DIVER]=1 \{\
. nr #PAGE_POS \\n[nl]+\\n[.d]+\\n[#DOC_LEAD]
. nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS]-1)
. nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
.\" Are we on a "defer" line? If so, defer the text of the footnote.
. ie \\n[#SPACE_TO_FOOTER]<=\\n[#DOC_LEAD] \
. nr #DIVER_FN 2 \" treat like a normal deferred footnote
. el \
. nr #DIVER_FN 2 \" treat like a normal footnote
. if \\n[#PAGE_POS]>\\n[#FOOTER_POS] \
. nr #DIVER_FN 1 \" move this footnote
.\" Test for situation where, because a final line of QUOTE, BLOCKQUOTE
.\" or EPIGRAPH isn't yet adjusted at this point, the last word on the
.\" line may *seem* to belong to the final line of the page, but will,
.\" in fact, become the first word of the subsequent page. In such
.\" circumstances, we want the footnote to be treated as a "moved"
.\" diversion footnote.
. if \\n[.k]>\\n[.l] .nr #DIVER_FN 1
. if r #DIVER_FN \{\
. if !\\n[#DIVER_FN]=2 .\\n+[#DONE_ONCE]
.\" A footnote inside a diversion will become the 1st footnote on the
.\" following page/column.
. if \\n[#DIVER_FN]=1 .DIVER_FN_1_PRE
.\" A footnote inside a diversion that should be treated like a
.\" normal footnote (including defers.)
. if \\n[#DIVER_FN]=2 .DIVER_FN_2_PRE
. \}
. nr #SAVED_FN_COUNT \\n[#FN_COUNT]+1
. nr #SAVED_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]+1
. \}
.\" End processing footnotes that occur inside QUOTE, BLOCKQUOTE or
.\" EPIGRAPH.
.\"
.\" Test for situation where, because a final line of running text
.\" isn't yet adjusted at this point, the last word on the line may
.\" *seem* to belong to the final line of the page, but will, in
.\" fact, become the first word of the subsequent page. In such
.\" circumstances, we want the footnote marker in running text to
.\" be the correct one for the 1st footnote on the page.
. if \\n[.k]>\\n[.l] \{\
. if (\\n[nl]+\\n[#DOC_LEAD])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
. ie \\n[#COLUMNS]=1 \{\
. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
. if \\n[#FN_MARKER_STYLE]=1 .nr #FN_COUNT_FOR_COLS 0 1
. if \\n[#FN_MARKER_STYLE]=2 \{\
. if \\n[#RESET_FN_NUMBER] \{\
. nr #FN_NUMBER 0 1
. nr #NOT_YET_ADJUSTED 1
. \}
. \}
. \}
. \}
. el \{\
. if \\n[#FN_MARKER_STYLE]=1 .nr #FN_COUNT 0 1
. if \\n[#FN_MARKER_STYLE]=2 \{\
. if \\n[#RESET_FN_NUMBER] \{\
. nr #FN_NUMBER 0 1
. nr #NOT_YET_ADJUSTED 1
. \}
. \}
. \}
. \}
. \}
. if \\n[#FN_MARKERS] \{\
.\" Housekeeping
. if \\n[#CONDENSE] \*[CONDX]\c
. if \\n[#EXTEND] \*[EXTX]\c
.\" Add footnote markers to running text...
. if !\\n[#NO_FN_MARKER] \{\
.\" ...but not if TERMINATE has not been called
. if !r#TERMINATE \{\
.\" Marker style star/dagger/double-dagger
. if \\n[#FN_MARKER_STYLE]=1 \{\
.\" Columnar docs either move col to col, or last col to next page.
.\" They require their own special FN_COUNT because regular FN_COUNT
.\" is used to figure out things like whether or not to put a rule
.\" above footnotes (in addition to keeping track of the footnote
.\" count in non-columnar docs).
. ie \\n[#COLUMNS]=1 \{\
. if \\n[#FN_COUNT_FOR_COLS]=0 .PRINT \*[BU2]*\c
. if \\n[#FN_COUNT_FOR_COLS]=1 .PRINT \*[BU1]\[dg]\c
. if \\n[#FN_COUNT_FOR_COLS]=2 .PRINT \[dd]\c
. if \\n[#FN_COUNT_FOR_COLS]=3 .PRINT \*[BU2]**\c
. if \\n[#FN_COUNT_FOR_COLS]=4 .PRINT \*[BU1]\[dg]\[dg]\c
. if \\n[#FN_COUNT_FOR_COLS]=5 .PRINT \[dd]\[dd]\c
. if \\n[#FN_COUNT_FOR_COLS]=6 .PRINT \*[BU2]***\c
. if \\n[#FN_COUNT_FOR_COLS]=7 .PRINT \*[BU1]\[dg]\[dg]\[dg]\c
. if \\n[#FN_COUNT_FOR_COLS]=8 .PRINT \[dd]\[dd]\[dd]\c
. if \\n[#FN_COUNT_FOR_COLS]=9 .PRINT \*[BU2]****\c
. \}
. el \{\
. if \\n[#FN_COUNT]=0 .PRINT \*[BU2]*\c
. if \\n[#FN_COUNT]=1 .PRINT \*[BU1]\[dg]\c
. if \\n[#FN_COUNT]=2 .PRINT \[dd]\c
. if \\n[#FN_COUNT]=3 .PRINT \*[BU2]**\c
. if \\n[#FN_COUNT]=4 .PRINT \*[BU1]\[dg]\[dg]\c
. if \\n[#FN_COUNT]=5 .PRINT \[dd]\[dd]\c
. if \\n[#FN_COUNT]=6 .PRINT \*[BU2]***\c
. if \\n[#FN_COUNT]=7 .PRINT \*[BU1]\[dg]\[dg]\[dg]\c
. if \\n[#FN_COUNT]=8 .PRINT \[dd]\[dd]\[dd]\c
. if \\n[#FN_COUNT]=9 .PRINT \*[BU2]****\c
. \}
. \}
.\" Marker style superscript numbers
. if \\n[#FN_MARKER_STYLE]=2 \{\
. if \\n[#PRINT_STYLE]=1 \
. PRINT \
"\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#FN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c"
. if \\n[#PRINT_STYLE]=2 \
. PRINT \
"\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]\c"
. \}
. \}
. \}
. \}
.\" More housekeeping
.\"
.\" #SPACE_REMAINING is the space left between where we are
.\" on the page and the bottom margin. It's used to determine whether
.\" or not the footnote will overflow, and how many lines of
.\" footnotes will fit on the page if some have to overflow.
. ie \\n[#DIVER_FN]=2 \
. nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-(\\n[#PAGE_POS])
. el \
. nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[nl]
. if \\n[#FROM_DIVERT_FN]=1 \{\
. nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]
. rr #FROM_DIVERT_FN
. \}
. nr #PP_STYLE_PREV \\n[#PP_STYLE]
. nr #PP_STYLE 2
. if \\n[#INDENT_FIRST_PARAS] .nr #INDENT_FIRSTS 1
. INDENT_FIRST_PARAS
.\" Prepare FOOTNOTE to receive footnote text.
. if \\n[.hy] .nr #RESTORE_HY_PARAMS \\n[.hy]
. ev FOOTNOTES
. ll \\n[#DOC_L_LENGTH]u
. ta \\n[.l]u
. if \\n[#COLUMNS]=1 \{\
. ll \\n[#COL_L_LENGTH]u
. ta \\n[.l]u
. \}
. if \\n[#FN_R_INDENT] \{\
. ll -\\n[#FN_R_INDENT]u
. ta \\n[.l]u
. \}
. if \\n[#FN_BR_INDENT] \{\
. ll -\\n[#FN_BR_INDENT]u
. ta \\n[.l]u
. \}
. FAMILY \\*[$FN_FAM]
. FT \\*[$FN_FT]
. ps \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
. vs \\n[.ps]u+\\n[#FN_AUTOLEAD]u
. QUAD \\*[$FN_QUAD]
. if \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
. ie \\n[#SINGLE_SPACE] .vs \\n[#ORIGINAL_DOC_LEAD]u
. el .vs \\n[#ORIGINAL_DOC_LEAD]u/2u
. QUAD LEFT
. HY OFF
. \}
. nr #FN_LEAD \\n[#LEAD]
.\" Begin diversion FOOTNOTES or FN_IN_DIVER
. ie r#COUNTERS_RESET \{\
. ie \\n[#DONE_ONCE]=1 \{\
. ie \\n[#RUN_ON] \{\
. di RUNON_FN_IN_DIVER
. nr #RUNON_FN_IN_DIVER 1
. \}
. el .di FN_IN_DIVER
. \}
. el \{\
. ie \\n[#RUN_ON] \{\
. da RUNON_FN_IN_DIVER
. nr #RUNON_FN_IN_DIVER 1
. \}
. el .da FN_IN_DIVER
. \}
. \\n+[#DONE_ONCE]
. \}
. el \{\
. ie \\n[#RUN_ON] \{\
. nh
. da RUNON_FOOTNOTES
. nr #RUNON_FOOTNOTES 1
. \}
. el .da FOOTNOTES
. \}
. if \\n[#FOOTNOTE_COLOR]=1 \{\
. TRAP OFF
. nf
\m[\\*[$FOOTNOTE_COLOR]]
. EOL
. fi
. TRAP
. \}
. if \\n[#EPIGRAPH] .nr #FN_FOR_EPI 1
.\" When a deferred footnote is also the 1st footnote on the page,
.\" and when the page it's output on also has footnotes, some
.\" whitespace is needed between the deferred footnote and the
.\" first footnote belonging to the output page so that there's
.\" no confusion when two stars (or two number 1s) appear in
.\" footnotes...
. if \\n[#FN_DEFER_SPACE] \{\
.\" ...but only add the extra space if TERMINATE has not been called
. if !r#TERMINATE \{\
.\" ...and not if defer space has already been added
. if !\\n[#DEFER_SPACE_ADDED] \{\
.\" ...and not if the footnote count the last time we checked for
.\" a defer situation inside a diversion is greater than 1.
. if !\\n[#SAVED_DIVER_FN_COUNT]>1 \{\
. if \\n[#FN_MARKER_STYLE]=1 .ALD 1v
. if \\n[#RESET_FN_NUMBER] .ALD 1v
. nr #DEFER_SPACE_ADDED 1
. \}
. \}
. \}
. rr #FN_DEFER_SPACE
. rr #SAVED_DIVER_FN_COUNT
. \}
. if \\n[#DIVERTED]=3 \{\
. if \\n[#FN_COUNT]>0 \{\
\!. RLD 1v
. \}
. \}
.\" Add footnote rule (or, if no rule, some whitespace).
.\" N.B.- this line increments #FN_COUNT each and every time FOOTNOTE
.\" is run.
. if \\n+[#FN_COUNT]=1 \{\
.\" If a footnote is called in a diversion, and the footnote has to
.\" be moved, don't put in the rule now (it's taken care of when
.\" FN_IN_DIVER is output into FOOTNOTE in PROCESS_FN_IN_DIVER).
. if !\\n[#DONT_RULE_ME]=1 \{\
. if !\\n[#FN_DEPTH] \{\
. if \\n[#PRINT_STYLE]=1 \
. if !\\n[#RUN_ON] .sp \\n[#DOC_LEAD]u
. ie \\n[#FN_RULE]=1 \{\
. if !\\n[#RUN_ON] \{\
. if \\n[#SINGLE_SPACE] .sp \\n[#DOC_LEAD]u
. PRINT_FOOTNOTE_RULE
. if !'\\*[$FN_SPACE]'' .sp -\\*[$FN_SPACE]
. \}
. \}
. el .sp
. nr #RULED 1
. \}
. \}
. \}
. rr #DONT_RULE_ME
. ds $RESTORE_SS_VAR \\*[$SS_VAR]
. SS 0
.\" Add footnote markers to footnote text...
. ie \\n[#FN_MARKERS] \{\
. if !'\\*[$FN_SPACE]'' \
. if \\n[#FN_COUNT]>0 .ALD \\*[$FN_SPACE]
. if !\\n[#NO_FN_MARKER] \{\
.\" ...but not if TERMINATE has been called.
. if !r#TERMINATE \{\
. if \\n[#REF]=1 \{\
. nr #REF_FN_INDENT (u;\\*[$REF_FN_INDENT])
. ti \\n[#REF_FN_INDENT]u
. \}
. if \\n[#FN_MARKER_STYLE]=1 \{\
. ie \\n[#COLUMNS]=1 \{\
. \\n+[#FN_COUNT_FOR_COLS]
. if \\n[#FN_COUNT_FOR_COLS]=1 .PRINT \h'0+\\n[#FN_INDENT]u'*\c
. if \\n[#FN_COUNT_FOR_COLS]=2 .PRINT \h'0+\\n[#FN_INDENT]u'\[dg]\c
. if \\n[#FN_COUNT_FOR_COLS]=3 .PRINT \h'0+\\n[#FN_INDENT]u'\[dd]\c
. if \\n[#FN_COUNT_FOR_COLS]=4 .PRINT \h'0+\\n[#FN_INDENT]u'**\c
. if \\n[#FN_COUNT_FOR_COLS]=5 .PRINT \h'0+\\n[#FN_INDENT]u'\[dg]\[dg]\c
. if \\n[#FN_COUNT_FOR_COLS]=6 .PRINT \h'0+\\n[#FN_INDENT]u'\[dd]\[dd]\c
. if \\n[#FN_COUNT_FOR_COLS]=7 .PRINT \h'0+\\n[#FN_INDENT]u'***\c
. if \\n[#FN_COUNT_FOR_COLS]=8 .PRINT \h'0+\\n[#FN_INDENT]u'\[dg]\[dg]\[dg]\c
. if \\n[#FN_COUNT_FOR_COLS]=9 .PRINT \h'0+\\n[#FN_INDENT]u'\[dd]\[dd]\[dd]\c
. if \\n[#FN_COUNT_FOR_COLS]=10 .PRINT \h'0+\\n[#FN_INDENT]u'****\c
. \}
. el \{\
. if \\n[#FN_COUNT]=1 .PRINT \h'0+\\n[#FN_INDENT]u'*\c
. if \\n[#FN_COUNT]=2 .PRINT \h'0+\\n[#FN_INDENT]u'\[dg]\c
. if \\n[#FN_COUNT]=3 .PRINT \h'0+\\n[#FN_INDENT]u'\[dd]\c
. if \\n[#FN_COUNT]=4 .PRINT \h'0+\\n[#FN_INDENT]u'**\c
. if \\n[#FN_COUNT]=5 .PRINT \h'0+\\n[#FN_INDENT]u'\[dg]\[dg]\c
. if \\n[#FN_COUNT]=6 .PRINT \h'0+\\n[#FN_INDENT]u'\[dd]\[dd]\c
. if \\n[#FN_COUNT]=7 .PRINT \h'0+\\n[#FN_INDENT]u'***\c
. if \\n[#FN_COUNT]=8 .PRINT \h'0+\\n[#FN_INDENT]u'\[dg]\[dg]\[dg]\c
. if \\n[#FN_COUNT]=9 .PRINT \h'0+\\n[#FN_INDENT]u'\[dd]\[dd]\[dd]\c
. if \\n[#FN_COUNT]=10 .PRINT \h'0+\\n[#FN_INDENT]u'****\c
. \}
. \}
. if \\n[#FN_MARKER_STYLE]=2 \{\
. ds $FN_NUMBER \\n[#FN_NUMBER]
. length #FN_NUMBER_LENGTH \\*[$FN_NUMBER]
. if \\n[#COLUMNS]=1 \
. \\n+[#FN_COUNT_FOR_COLS]
. if \\n[#NOT_YET_ADJUSTED]=1 \{\
. nr #FN_NUMBER 1 1
. rr #NOT_YET_ADJUSTED
. \}
. if \\n[#PRINT_STYLE]=1 \{\
. ie \\n[#NO_SUPERSCRIPT] \{\
. ie \\n[#FN_NUMBER_LENGTH]<\\n[#FN_NUMBER_PLACEHOLDERS] \
. PRINT "\h'0+\\n[#FN_INDENT]u'\0(\\n[#FN_NUMBER])\|\c"
. el \
. PRINT "\h'0+\\n[#FN_INDENT]u'(\\n[#FN_NUMBER])\|\c"
. \}
. el \{\
. ie \\n[#FN_NUMBER_LENGTH]<\\n[#FN_NUMBER_PLACEHOLDERS] \
. PRINT \
"\h'0+\\n[#FN_INDENT]u'\s-2\v'-\\n[.v]u/5u'\0\\n[#FN_NUMBER]\|\v'+\\n[.v]u/5u'\s+2\|\c"
. el \
. PRINT \
"\h'0+\\n[#FN_INDENT]u'\s-2\v'-\\n[.v]u/5u'\\n[#FN_NUMBER]\|\v'+\\n[.v]u/5u'\s+2\|\c"
. \}
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. ie \\n[#FN_NUMBER_LENGTH]<\\n[#FN_NUMBER_PLACEHOLDERS] \
. PRINT "\h'0+\\n[#FN_INDENT]u'\*[SUP]\0\\n[#FN_NUMBER]\*[SUPX]\*[FU 3]\c"
. el \
. PRINT "\h'0+\\n[#FN_INDENT]u'\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\*[FU 3]\c"
. \}
. \}
. \}
. \}
. \}
. el \{\
.\" Line-numbered footnotes handling
. if \\n[#FN_MARKER_STYLE]=3 \{\
. if \\n[#FN_SPACE]>0 \{\
. if !\\n[#RUN_ON]=1 \
. if \\n[#FN_COUNT]>0 .ALD \\n[#FN_SPACE]u
. \}
. if \\n[#REF]=1 \{\
. if !\\n[#RUN_ON]=1 \{\
\!. ti +\\n[#REF_FN_INDENT]uu
. \}
. \}
. ie \\n[#FN_LN_BRACKETS]=1 \{\
. ds $FN_LINENUMBER \h'0+\\n[#FN_INDENT]u'\v'-.085m'\\*[$FN_OPEN_BRACKET]\v'.085m'
. ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \
. as $FN_LINENUMBER \
\\n[#FN_MARK]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m'\h'.25m'
. el \
. as $FN_LINENUMBER \
\\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\v'-.085m'\
\\*[$FN_CLOSE_BRACKET]\v'.085m'\h'.25m'
. \}
. el \{\
. ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \
. ds $FN_LINENUMBER \\n[#FN_MARK]\\*[$FN_LN_SEP]
. el \
. ds $FN_LINENUMBER \
\h'0+\\n[#FN_INDENT]u'\\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\\*[$FN_LN_SEP]
. \}
. \}
. if !\\n[#NO_FN_MARKER] \
. PRINT \\*[$FN_LINENUMBER]\c
. rm $FN_LINENUMBER
. nr #FN_MARK 0
. \}
. \}
. el \{\
.\" If INDENT arg is passed to FOOTNOTE, calculate the indent...
. ie '\\$1'INDENT' \{\
. ev FOOTNOTES
. if '\\$2'L' .in (\\$3)
. if '\\$2'LEFT' .in (\\$3)
. if '\\$2'R' .nr #FN_R_INDENT (\\$3)
. if '\\$2'RIGHT' .nr #FN_R_INDENT (\\$3)
. if '\\$2'B' \{\
. nr #FN_BL_INDENT (\\$3)
. ie '\\$4'' .nr #FN_BR_INDENT \\n[#FN_BL_INDENT]
. el .nr #FN_BR_INDENT (\\$4)
. in \\n[#FN_BL_INDENT]u
. \}
. if '\\$2'BOTH' \{\
. nr #FN_BL_INDENT (\\$3)
. ie '\\$4'' .nr #FN_BR_INDENT \\n[#FN_BL_INDENT]
. el .nr #FN_BR_INDENT (\\$4)
. in \\n[#FN_BL_INDENT]u
. \}
. ev
.\" ...then re-run FOOTNOTE without an argument.
. FOOTNOTE
. \}
. el \{\
. br
.\" Add "defer space" if the previously diverted footnote was the
.\" 1st footnote proper to its page (i.e. it looks like a deferred
.\" footnote but it's really an overflow).
. if \\n[#DIVERTED] \{\
. if \\n[#PREV_FN_DEFERRED]=1 \{\
. if \\n[#FN_MARKER_STYLE]=1 .ALD \\n[#FN_LEAD]u
. if \\n[#RESET_FN_NUMBER] .ALD \\n[#FN_LEAD]u
. nr #PREV_FN_DEFERRED 2
. \}
. \}
. if \\n[#REF]=1 \{\
\!. in
. \}
.\" Terminate FOOTNOTES or FN_IN_DIVER diversion
. di
. HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
. if \\n[#RESTORE_HY_PARAMS] .hy \\n[#RESTORE_HY_PARAMS]
.\" More housekeeping
.\" Turn off indent possibly set by FOOTNOTE INDENT
. in 0
. ev
. if \\n[#UNDERLINE_WAS_ON_FN] \{\
. UNDERLINE
. rr #UNDERLINE_WAS_ON_FN
. \}
.\" Restore sentence spacing
. if \\n[#PRINT_STYLE]=2 \{\
. if d $RESTORE_SS_VAR .SS \\*[$RESTORE_SS_VAR]
. rm $RESTORE_SS_VAR
. \}
. rr #FN_R_INDENT
. rr #FN_BR_INDENT
. nr #PP_STYLE \\n[#PP_STYLE_PREV]
. if !\\n[#INDENT_FIRSTS] .INDENT_FIRST_PARAS OFF
. rr #INDENT_FIRSTS
.\" Calculate footnote depth, but not if #COUNTERS_RESET (created in
.\" DIVER_FN_1_PRE) to instruct FOOTNOTES to skip this step for now
.\" (it's taken care of when FN_IN_DIVER is output into FOOTNOTES in
.\" PROCESS_FN_IN_DIVER).
. ie r#COUNTERS_RESET .rr #COUNTERS_RESET
. el \{\
. nr #GET_DEPTH 1
.\" If the footnote is the 1st on the page and it falls too close
.\" to the bottom margin, defer the footnote text to the next page...
. if (\\n[#SPACE_REMAINING]-1)<=(\\n[.v]) \{\
.\" ...but not if PROCESS_FN_LEFTOVER has set #PREV_FN_DEFERRED to 1
. if !\\n[#PREV_FN_DEFERRED]=1 \{\
. nr #FN_DEFER 1
. nr #FN_DEPTH +\\n[#DIVER_DEPTH]
. rr #GET_DEPTH
.\" This is required so that the defer space clause can distinguish
.\" a real #FN_COUNT=1 from one generated if FOOTNOTE is run inside
.\" QUOTE, BLOCKQUOTE or EPIGRAPH
. if \\n[#DIVER_FN]=2 \{\
. nr #SAVED_DIVER_FN_COUNT \\n[#FN_COUNT]
. rr #DIVER_FN
. \}
. \}
. \}
.\" Calculate the footnote depth.
. if \\n[#GET_DEPTH]=1 \{\
.\" Save the previous footnote depth (for use when there will be
.\" some overflowed footnote text).
. nr #SAVED_FN_DEPTH_1 \\n[#FN_DEPTH]
.\" Add the depth of the current footnote to any already existent
.\" footnotes.
. nr #FN_DEPTH +\\n[#DIVER_DEPTH]
.\" Special handling for run-on footnotes
. if \\n[#RUN_ON]=1 \{\
. if \\n[#RUNON_FOOTNOTES] .unformat RUNON_FOOTNOTES
. if \\n[#RUNON_FN_IN_DIVER] .unformat RUNON_FN_IN_DIVER
. ev FOOTNOTES
.\" Recreate FOOTNOTES with rule followed by text of unformatted
.\" run-on footnotes.
. di FOOTNOTES
. ie \\n[#FN_RULE]=0 .RLD 1v
. el \{\
\v'-\\n[#FN_RULE_ADJ]u-\\n[#FN_RULE_WEIGHT_ADJ]u'\
\D't \\n[#FN_RULE_WEIGHT]'\
\h'-\\n[#FN_RULE_WEIGHT]u'\
\D'l \\n[#FN_RULE_LENGTH]u 0'\
\v'+\\n[#FN_RULE_ADJ]u+\\n[#FN_RULE_WEIGHT_ADJ]u'
. \}
. br
. if \\n[#RUNON_FOOTNOTES] \{\
. RUNON_FOOTNOTES
. rr #RUNON_FOOTNOTES
. \}
. if \\n[#RUNON_FN_IN_DIVER] \{\
. RUNON_FN_IN_DIVER
. rr #RUNON_FN_IN_DIVER
. \}
. br
. di
. ev
. nr #FN_DEPTH \\n[#DIVER_DEPTH]
. nr #SAVED_VFP 0+\\n[#VARIABLE_FOOTER_POS]
. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
. \}
.\" Save the new depth
. nr #SAVED_FN_DEPTH_2 \\n[#FN_DEPTH]
.\" Signal that defer space should be added when PROCESS_FN_LEFTOVER
.\" processes deferred footnotes.
. if \\n[#FN_DEFER] \{\
. if \\n[#FN_COUNT]=2 \{\
. ie \\n[#COLUMNS] \{\
. if !\\n[#FROM_FOOTER] \{\
. if \\n[#FN_DEFER]=1 .nr #FN_DEFER_SPACE 1
. if \\n[#FN_COUNT_FOR_COLS]>=1 .rr #FN_DEFER_SPACE
. if \\n[#FROM_HEADER] .nr #FN_DEFER_SPACE 1
. \}
. \}
. el .nr #FN_DEFER_SPACE 1
. \}
. rr #FN_DEFER
. \}
.\" If the depth of the whole footnote won't fit in the space
.\" between where we are on the page and the bottom margin, calculate
.\" how much of it will fit.
. if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
. nr #FN_LINES 0 1
. while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
. nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
. \}
. nr #VFP_DIFF \\n[#FN_DEPTH]-\\n[#SAVED_FN_DEPTH_1]
. nr #OVERFLOW 1
.\" Very occasionally, #VFP_DIFF, on a 1st footnote that isn't to
.\" be deferred, comes up with a depth equal to exactly 1 line
.\" of footnotes, i.e. enough room to print the rule and nothing
.\" else. The following tests for such a condition, and rather than
.\" attempting to treat the footnote as an overflow, it tells mom to
.\" treat it as a special kind of deferred footnote (#FN_DEFER 2).
. if \\n[#SAVED_FN_DEPTH_1]=0 \{\
. if \\n[#FN_DEPTH]=\\n[#FN_LEAD] \{\
. nr #FN_DEFER 2
. nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_2]
. rr #OVERFLOW
. \}
. \}
. \}
.\" Calculate VFP based on whether the footnote overflows, or is to
.\" be treated normally.
. ie \\n[#OVERFLOW]=1 \{\
. if \\n[#RUN_ON] \{\
. rr #VARIABLE_FOOTER_POS
. nr #VARIABLE_FOOTER_POS \\n[#SAVED_VFP]
. \}
. ie \\n[#FN_COUNT]=1 \{\
. ie \\n[#RULED]=1 \{\
. ie \\n[#COLUMNS]=1 \{\
. ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
. ie \\n[#FROM_FOOTER] \{\
. ie \\n[#FN_COUNT_FOR_COLS]>1 \{\
. nr #FN_DEPTH -\\n[#FN_DEPTH]
. if \\n[#DIVERTED]=1 .nr #DIVERTED 3
. if !\\n[#PREV_FN_DEFERRED]=1 \
. nr #FN_DEPTH -\\n[#VFP_DIFF]
. \}
. el \{\
. nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
. if \\n[#DIVERTED]=1 .nr #DIVERTED 3
. \}
. \}
. el .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
. \}
. el .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
. \}
. el .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
. \}
. el \{\
. nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
. if \\n[#DIVERTED]=1 .nr #DIVERTED 3
. if !\\n[#PREV_FN_DEFERRED]=1 \{\
. ie \\n[#COLUMNS]=1 \
. if !\\n[#FROM_FOOTER] .
. el .nr #FN_DEPTH -\\n[#VFP_DIFF]
. \}
. if \\n[#DIVERTED]=3 \{\
. if !\\n[#PREV_FN_DEFERRED] \{\
. if !\\n[#FROM_FOOTER] \{\
. if \\n[#FN_COUNT]=1 \{\
. if !\\n[#VFP_DIFF] \{\
. if \\n[#FN_MARKER_STYLE]=1 \{\
. da FOOTNOTES
\!. ALD \\n[#FN_LEAD]u
. di
. \}
. if \\n[#RESET_FN_NUMBER] \{\
. da FOOTNOTES
\!. ALD \\n[#FN_LEAD]u
. di
. \}
. \}
. \}
. \}
. \}
. \}
. \}
. nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
. \}
. el \{\
. nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
. nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
. \}
. rr #OVERFLOW
. rr #RULED
. \}
. el \{\
. nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
. if \\n[#PREV_FN_DEFERRED]=1 \{\
. if \\n[#DIVERTED] \{\
. if !\\n[#FN_DEPTH]=\\n[#SAVED_FN_DEPTH_1] \{\
. nr #FN_DEPTH +\\n[#FN_LEAD]
. nr #VARIABLE_FOOTER_POS -\\n[#FN_LEAD]
. rr #PREV_FN_DEFERRED
. \}
. \}
. \}
. if \\n[#FN_COUNT]>1 \{\
. nr #NO_BACK_UP 1
. rr #DIVERTED
. rr #RULED
. \}
. \}
. \}
. \}
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
.\" If we have a footnote whose text has to be deferred to the next
.\" page, reset the FOOTER trap to its original location.
. if \\n[#FN_DEFER] \{\
. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. \}
. \}
. nr #NO_FN_MARKER 0
. \}
. if \\n[#NUM_ARGS]=2 \{\
. if '\\$2'BREAK' .BR
. if '\\$2'BR' .BR
. \}
.END
\#
\# Utility macros to manage footnotes that occur inside diversions
\# ---------------------------------------------------------------
\#
\# There are some redundancies here; they're left in in case unforeseen
\# footnote situations crop up in the future that might require
\# manipulation of them.
\#
\# 1. Pre-footnote processing for footnotes in diversions
\#
\# a) A footnote inside a diversion will be moved entirely (marker
\# in running text and text of footnote) to the next page/column.
\#
.MAC DIVER_FN_1_PRE END
. nr #RESET_FN_COUNTERS 1
. nr #COUNTERS_RESET 1
. if \\n[#DONE_ONCE]=1 \{\
. if \\n[#FN_DEFER] \{\
. if \\n[#SAVED_DIVER_FN_COUNT]=1 \{\
. ie \\n[#COLUMNS]=1 \
. if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_DEFER_SPACE 1
. el .nr #FN_DEFER_SPACE 1
. \}
. \}
. if \\n[#FN_MARKER_STYLE]=1 \{\
. if \\n[#FN_COUNT]>0 .nr #FN_COUNT 0 1
. if \\n[#COLUMNS]=1 \
. if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_COUNT_FOR_COLS 0 1
. \}
. if \\n[#FN_MARKER_STYLE]=2 \{\
. if \\n[#RESET_FN_NUMBER]=1 \{\
. ie \\n[#COLUMNS]=1 \
. if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_NUMBER 0 1
. el .nr #FN_NUMBER 0 1
. \}
. \}
. \}
.END
\#
\# b) Treat as a normal footnote, including defers.
\#
.MAC DIVER_FN_2_PRE END
. nr #RESET_FN_COUNTERS 2
.END
\#
\# 2. Post-footnote processing for footnotes in diversions
\#
\# Even when a footnote inside a diversion is treated as
\# "normal," some manipulation of registers is required. The
\# macro is called in DO_QUOTE (i.e. at the termination of
\# quotes and blockquotes) and in DO_EPIGRAPH.
\#
.MAC DIVER_FN_2_POST END
. if \\n[#DONE_ONCE]=1 \{\
. if \\n[#FN_MARKER_STYLE]=1 \{\
. if \\n[#FN_COUNT]=0 .nr #DONT_RULE_ME 1
. if \\n[#FN_COUNT]>0 .nr #FN_COUNT 0 1
. if \\n[#COLUMNS]=1 \{\
. if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_COUNT_FOR_COLS 0 1
. if !\\n[#COL_NUM]=\\n[#NUM_COLS] .
. \}
. \}
. if \\n[#FN_MARKER_STYLE]=2 \{\
. if \\n[#FN_COUNT]=0 .nr #DONT_RULE_ME 1
. if \\n[#FN_COUNT]>0 .nr #FN_COUNT 0 1
. if \\n[#RESET_FN_NUMBER]=1 \{\
. ie \\n[#COLUMNS]=1 \
. if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_NUMBER 0 1
. el .nr #FN_NUMBER 0 1
. \}
. \}
. \}
.END
\#
\# The main macros that handle footnote processing.
\# -----------------------------------------------
\#
\# FN_OVERFLOW_TRAP starts off "underneath" FOOTER, but is revealed
\# as #VARIABLE_FOOTER_POSITION changes the position of FOOTER.
\# FN_OVERFLOW_TRAP simply starts diversion FN_OVERFLOW to "catch"
\# the overflow. The diversion is ended in FOOTER, immediately after
\# FOOTER outputs the diversion, FOOTNOTES, before PROCESS_FN_LEFTOVER
\# is run (either in HEADER, or in FOOTER if moving col to col).
\#
.MAC FN_OVERFLOW_TRAP END
. if \\n[#FN_COUNT] \{\
. di FN_OVERFLOW
. ie !\\n[#NO_BACK_UP]=1 \{\
. if \\n[#PREV_FN_DEFERRED] \{\
. ie \\n[#COLUMNS]=1 \{\
. if \\n[#FROM_FOOTER] \{\
. if \\n[#PREV_FN_DEFERRED] \{\
. if !\\n[#COL_NUM]=\\n[#NUM_COLS] \
. rr #PREV_FN_DEFERRED
. \}
. \}
. if !\\n[#FROM_FOOTER] \{\
. if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
. if !\\n[#LAST_FN_COUNT_FOR_COLS]>1 \{\
\!. RLD \\n[#FN_LEAD]u
. \}
. \}
. \}
. \}
. el \{\
\!. RLD \\n[#FN_LEAD]u
. \}
. \}
. \}
. el \{\
. rr #NO_BACK_UP
. rr #PREV_FN_DEFERRED
. \}
. \}
.\" When #FROM_DIVERT_FN is 1, it signals to FOOTNOTE, when run from
.\" within DIVERT_FN_LEFTOVER, to set #SPACE_REMAINING to the total
.\" area allowable for running text.
. nr #FROM_DIVERT_FN 1
.END
\#
\# PROCESS_FN_LEFTOVER is called at the top of HEADER, and in
\# FOOTER if we're moving from one column to the next (i.e. after
\# outputting FOOTNOTES). It checks for whether we have a "deferred
\# footnote" situation, and resets counters and number registers
\# accordingly. Lastly, if we have some footnote overflow, it calls
\# DIVERT_FN_LEFTOVER.
\#
.MAC PROCESS_FN_LEFTOVER END
. if \\n[#PREV_FN_DEFERRED]=2 \
. if \\n[#FN_COUNT_AT_FOOTER]>1 .rr #PREV_FN_DEFERRED
. ie !\\n[#FN_DEFER] \{\
. nr #FN_COUNT 0 1
. nr #FN_DEPTH 0
. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
. \}
. el \{\
. if \\n[#FN_DEFER]=1 .nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
. if \\n[#FN_DEFER]=2 \{\
. nr #FN_DEPTH 0
. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
. \}
. \}
. nr #SPACE_REMAINING 0
. ch FOOTER -\\n[#B_MARGIN]u
. if \\n[#FN_DEFER] \{\
. nr #NO_FN_MARKER 1
. rn FOOTNOTES DEFERRED-FOOTNOTE
. nr #FN_DEPTH 0
. FOOTNOTE
. nf
. DEFERRED-FOOTNOTE
. FOOTNOTE OFF
. ie \\n[#COLUMNS]=1 \{\
. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
. if !\\n[#FROM_FOOTER] \
. if \\n[#FN_COUNT_FOR_COLS]=1 .nr #PREV_FN_DEFERRED 1
. \}
. \}
. el .nr #PREV_FN_DEFERRED 1
. \}
. if !\\n[#FN_DEFER] \
. if \\n[#FN_OVERFLOW_DEPTH] .DIVERT_FN_LEFTOVER
. ie \\n[#COLUMNS]=1 \{\
. if \\n[#COL_NUM]>1 \
. if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_COUNT 0 1
. \}
. el .nr #FN_COUNT 0 1
. if \\n[#DIVER_FN]=2 .rr #DIVER_FN
. rr #FROM_DIVERT_FN
.END
\#
\# DIVERT_FN_LEFTOVER is called in PROCESS_FN_LEFTOVER (at
\# the top of HEADER, and in FOOTER if we're moving from one column
\# to the next).
\#
.MAC DIVERT_FN_LEFTOVER END
. nr #NO_FN_MARKER 1
. nr #DIVERTED 1
. FOOTNOTE
. nf
. FN_OVERFLOW
. FOOTNOTE OFF
. if \\n[#PREV_FN_DEFERRED] \{\
. nr #FN_DEPTH -\\n[#FN_LEAD]
. nr #VARIABLE_FOOTER_POS +\\n[#FN_LEAD]
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. if \\n[#PREV_FN_DEFERRED]=2 \{\
. nr #PREV_FN_DEFERRED 1
. rr #DIVERTED
. \}
. \}
. rr #FN_OVERFLOW_DEPTH
.END
\#
\# This is a special macro to deal with footnotes that are set inside
\# diversions (QUOTE, BLOCKQUOTE and EPIGRAPH). It's called in HEADER
\# (and in FOOTER, if we're moving from column to column), and comes
\# after PROCESS_FOOTNOTE_LEFTOVER in those two macros.
\#
.MAC PROCESS_FN_IN_DIVER END
. nr #SPACE_REMAINING 0
. ch FOOTER -\\n[#B_MARGIN]u
. nr #NO_FN_MARKER 1
. if !\\n[#RESET_FN_COUNTERS]=2 .rr #RESET_FN_COUNTERS
. FOOTNOTE
. if \\n[#FN_OVERFLOW_DEPTH] .nf
. ie dRUNON_FN_IN_DIVER \{\
. RUNON_FN_IN_DIVER
. rm RUNON_FN_IN_DIVER
. \}
. el \{\
. nf
. FN_IN_DIVER
. \}
. FOOTNOTE OFF
. rr #DIVER_FN
.END
\#
\# ====================================================================
\#
\# +++ENDNOTES+++
\#
\# When endnotes are output, the spacing between the notes is always
\# 1 extra linespace. This can have bottom margin consequences. If
\# this doesn't bother you, don't worry about it. If it does bother
\# you, and you want to adjust the spacing between any two endnotes (as
\# they're output), make the spacing adjustments (.ALD/.RLD) at the
\# *end* of endnotes (i.e. just before .ENDNOTE OFF), not at the top.
\#
\# Endnotes must be output manually with .ENDNOTES. This allows user
\# the flexibility to output endnotes at the end of each collated
\# document, or to output them at the end of the entire document.
\#
\# Control macros
\# --------------
\#
\# ENDNOTE POINT SIZE
\# ------------------
\# *Argument:
\# <base point size for endnotes>
\# *Function:
\# Creates or modifies register #EN_PS.
\# *Notes:
\# Default is same as running text in body of document.
\#
\# This size control macro differs from other size control macros
\# in that it sets an absolute point size, not a relative one. This
\# is because a) endnotes always appear separate from the body of
\# a document and therefore don't need to be relative to the body
\# of the document, and b) there are quite a few elements of the
\# endnotes page(s) that need to be relative to the base point size
\# of that page. If the base endnote point size were relative to
\# the body of the document (i.e. a _SIZE macro taking a +|- value)
\# getting the rest of the endnote elements sized properly could
\# become very confusing.
\#
.MAC ENDNOTE_PT_SIZE END
. nr #EN_PS (p;\\$1)
.END
\#
\# ENDNOTE SPACING
\# ----------------
\# *Arguments:
\# <per item endnote spacing> | <anything>
\# *Function:
\# Enables space between endnotes items.
\# *Notes:
\# Default is no space.
\#
.MAC ENDNOTE_SPACING END
. ie \B'\\$1' .ds $EN_SPACE \\$1
. el .rm $EN_SPACE
.END
\#
\# ENDNOTES_HDRFTR_CENTER
\# ----------------------
\# *Argument:
\# toggle
\# *Function:
\# Creates or removes toggle register #EN_HDRFTR_CENTER, used to
\# determine whether mom should print a/the hdrftr center string
\# on the endnotes page. Primarily to enable/disable printing of the
\# chapter name in hdrftrs when DOCTYPE CHAPTER.
\# *Notes:
\# Default is OFF
\#
.MAC ENDNOTES_HDRFTR_CENTER END
. ie '\\$1'' .nr #EN_HDRFTR_CENTER 1
. el .rr #EN_HDRFTR_CENTER
.END
\#
\# ENDNOTE STRING
\# --------------
\# *Argument:
\# <title for endnotes page>
\# *Function:
\# Creates or modifies string $EN_STRING.
\# *Notes:
\# Default is "Endnotes"
\#
.MAC ENDNOTES_HEADER_STRING END
. ds $EN_STRING \\$1
.END
.
.ALIAS ENDNOTE_STRING ENDNOTES_HEADER_STRING
\#
\# ENDNOTE STRING START POSITION
\# ----------------------------
\# *Argument:
\# <distance from page top>
\# *Function:
\# Creates or modifies register #EN_STRING_V_POS
\#
.MAC ENDNOTES_HEADER_V_POS END
. nr #EN_STRING_V_POS (\\$1)
.END
.
.ALIAS ENDNOTE_STRING_ADVANCE ENDNOTES_HEADER_V_POS
.ALIAS ENDNOTE_STRING_V_POS ENDNOTES_HEADER_V_POS
.ALIAS ENDNOTES_HEADER_V_POS ENDNOTES_HEADER_V_POS
\#
\# ENDNOTE HEADER CAPS and SMALLCAPS
\# ---------------------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Turns capitalization or smallcaps style of the endnotes pages
\# title string "Endnotes" on or off.
\# *Notes:
\# Users may want the endnotes pages title string to be in
\# caps, but the toc entry for endnotes in lower case. If the
\# argument to ENDNOTES_HEADER_STRING is in lower case and
\# ENDNOTES_HEADER_CAPS is turned on, this is exactly what will
\# happen. Ditto for smallcaps.
\#
\# Default for CAPS is on.
\#
.MAC ENDNOTES_HEADER_CAPS END
. ie '\\$1'' .nr #EN_STRING_CAPS 1
. el .nr #EN_STRING_CAPS 0
.END
.
.ALIAS ENDNOTE_STRING_CAPS ENDNOTES_HEADER_CAPS
.
.MAC ENDNOTES_HEADER_SMALLCAPS END
. ie '\\$1'' .nr #EN_STRING_SMALLCAPS 1
. el .nr #EN_STRING_SMALLCAPS 0
.END
.
.ALIAS ENDNOTE_STRING_SMALLCAPS ENDNOTES_HEADER_SMALLCAPS
\#
\# ENDNOTE TITLE
\# -------------
\# *Argument:
\# <string that appears before the first endnote pertaining to any document>
\# *Function:
\# Creates string $EN_TITLE.
\# *Notes:
\# Default is the document title, or, if doc is a chapter, "Chapter #"
\#
.MAC ENDNOTE_TITLE END
. ds $EN_TITLE \\$1
.END
\#
\# ENDNOTE MARKER STYLE
\# --------------------
\# *Arguments:
\# NUMBER | LINE | SUPERSCRIPT
\# *Function:
\# Sets register #EN_MARKER_STYLE, used in ENDNOTE to determine
\# the style of endnote markers (labels).
\# *Notes:
\# 1=NUMBER; 2=LINE. LINE means "use output line numbers".
\# Default is NUMBER.
\#
.MAC ENDNOTE_MARKER_STYLE END
. if '\\$1'NUMBER' .nr #EN_MARKER_STYLE 1
. if '\\$1'LINE' \{\
. nr #EN_MARKER_STYLE 2
. if !\\n[#EN_LN_SEP] \
. if !\\n[#EN_LN_BRACKETS] .ENDNOTE_LINENUMBER_BRACKETS SQUARE
. \}
. if '\\$1'SUPERSCRIPT' .nr #EN_MARKER_STYLE 3
.END
\#
\# ENDNOTE LINENUMBER MARK
\# -----------------------
\# *Function:
\# This string, when called inline, stores the current output line
\# number in register #EN_MARK for use with ENDNOTE.
\#
.ds EN_MARK \R'#EN_MARK \En[ln]'
\#
\# ENDNOTE LINENUMBER SEPARATOR
\# ----------------------------
\# *Argument:
\# <user-defined separator>
\# *Function:
\# Stores user-defined separator (for use then
\# ENDNOTE_MARKER_STYLE is LINE) in string $EN_LN_SEP. The
\# separator is intended to be used when the user wishes a
\# separator, rather than the choice of brackets offered by
\# ENDNOTE_LINENUMBER_BRACKETS.
\#
.MAC ENDNOTE_LINENUMBER_SEPARATOR END
. rr #EN_LN_BRACKETS
. nr #EN_LN_SEP 1
. ds $EN_LN_SEP "\\$1
.END
\#
\# ENDNOTE LINENUMBER BRACKETS
\# ---------------------------
\# *Argument:
\# PARENS | SQUARE | BRACES or ( | [ | {
\# *Function:
\# Sets register #EN_LN_BRACKETS to 1, and creates strings
\# $EN_OPEN_BRACKET and $EN_CLOSE_BRACKET according to the given argument.
\#
.MAC ENDNOTE_LINENUMBER_BRACKETS END
. rr #EN_LN_SEP
. nr #EN_LN_BRACKETS 1
. if '\\$1'PARENS' \{\
. ds $EN_OPEN_BRACKET (
. ds $EN_CLOSE_BRACKET )
. \}
. if '\\$1'(' \{\
. ds $EN_OPEN_BRACKET (
. ds $EN_CLOSE_BRACKET )
. \}
. if '\\$1'SQUARE' \{\
. ds $EN_OPEN_BRACKET [
. ds $EN_CLOSE_BRACKET ]
. \}
. if '\\$1'[' \{\
. ds $EN_OPEN_BRACKET [
. ds $EN_CLOSE_BRACKET ]
. \}
. if '\\$1'BRACES' \{\
. ds $EN_OPEN_BRACKET {
. ds $EN_CLOSE_BRACKET }
. \}
. if '\\$1'{' \{\
. ds $EN_OPEN_BRACKET {
. ds $EN_CLOSE_BRACKET }
. \}
.END
\#
\# ENDNOTE LINENUMBER GAP
\# ----------------------
\# *Argument:
\# <space between line-number labels and endnotes text>
\# *Function:
\# Defines string $EN_LN_GAP, used during printing of line-number
\# labels in ENDNOTE.
\#
.MAC ENDNOTE_LINENUMBER_GAP END
. nr #EN_LN_GAP (u;\\$1)
.END
\#
\# ENDNOTE NUMBERS ALIGNMENT
\# -------------------------
\# *Argument:
\# LEFT | RIGHT <max. number of digit placeholders that will appear in endnotes>
\# *Function:
\# Creates registers for _LEFT or _RIGHT; creates register
\# #EN_NUMBER_PLACEHOLDERS.
\# *Notes:
\# Default is for endnote numbers to be right aligned to 2 placeholders.
\#
.MAC ENDNOTE_NUMBERS_ALIGN END
. if '\\$1'LEFT' \{\
. rr #EN_NUMBERS_ALIGN_RIGHT
. nr #EN_NUMBERS_ALIGN_LEFT 1
. \}
. if '\\$1'RIGHT' \{\
. rr #EN_NUMBERS_ALIGN_LEFT
. nr #EN_NUMBERS_ALIGN_RIGHT 1
. \}
. nr #EN_NUMBER_PLACEHOLDERS \\$2
.END
\#
\# ENDNOTE PARAGRAPH INDENT
\# ------------------------
\# *Argument:
\# <first line indent of paras subsequent to 1st in endnotes>
\# *Function:
\# Creates register #EN_PP_INDENT for use in .PP.
\# *Notes:
\# Requires a unit of measure.
\#
\# Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
\#
.MAC ENDNOTE_PARA_INDENT END
. nr #EN_PP_INDENT (\\$1)
.END
\#
\# TURN OFF COLUMN MODE FOR ENDNOTES
\# ---------------------------------
\# *Argument:
\# <none> | <anything>
\# *Function:
\# Creates or removes register #EN_NO_COLS
\# *Notes:
\# Allows user to tell mom not to set endnotes in columnar
\# documents in columns. Default is to set endnotes in columns.
\#
.MAC ENDNOTES_NO_COLUMNS END
. ie '\\$1'' .nr #EN_NO_COLS 1
. el .rr #EN_NO_COLS
.END
\#
\# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
\# -------------------------------------------
\# *Argument:
\# <none> | <anything>
\# *Function:
\# Creates or removes register #EN_NO_FIRST_PN
\# *Notes:
\# For use if FOOTERS are on. Tells ENDNOTES not to put a page
\# number on the first endnotes page. Some users may want this.
\# Default is to print a page number at the top of the first
\# endnotes page when footers are on.
\#
.MAC ENDNOTES_NO_FIRST_PAGENUM END
. ie '\\$1'' .nr #EN_NO_FIRST_PN 1
. el .rr #EN_NO_FIRST_PN
.END
\#
\# PAGE HEADERS ON ENDNOTES PAGES
\# ------------------------------
\# *Argument:
\# <none> | ALL
\# *Function:
\# Creates or removes register #EN_ALLOWS_HEADERS or
\# #EN_ALLOWS_HEADERS_ALL
\# *Notes:
\# Whether ENDNOTES puts a page header at the top of endnotes
\# pages if page headers are used throughout the document.
\# Default is to insert the page headers, but not on the first
\# page. If the optional argument ALL is given, ENDNOTES puts a
\# page header on the first page as well.
\#
.MAC ENDNOTES_ALLOWS_HEADERS END
. ie '\\$1'' .nr #EN_ALLOWS_HEADERS 1
. el \{\
. ie '\\$1'ALL' \{\
. nr #EN_ALLOWS_HEADERS 1
. nr #EN_ALLOWS_HEADERS_ALL 1
. \}
. el \{\
. nr #EN_ALLOWS_HEADERS 0
. nr #EN_ALLOWS_HEADERS_ALL 0
. \}
. \}
.END
\#
\# ENDNOTES PAGES PAGE NUMBERING STYLE
\# -----------------------------------
\# *Argument:
\# DIGIT | ROMAN | roman | ALPHA | alpha
\# *Function:
\# Creates or modifies $EN_PN_STYLE.
\# *Notes:
\# Allows user to define what style should be used for endnotes
\# pages page numbering. Arguments are the same as for
\# PAGENUM_STYLE.
\#
\# Default is DIGIT.
\#
.MAC ENDNOTES_PAGENUM_STYLE END
. ds $EN_PN_STYLE \\$1
.END
\#
\# FIRST PAGE NUMBER FOR ENDNOTES
\# ------------------------------
\# *Argument:
\# <page number that appears on page 1 of endnotes pages>
\# *Function:
\# Creates or modifies string $EN_FIRST_PN
\# *Notes:
\# To be used with caution, only if all endnotes
\# are to be output at once, i.e. not at the end of the separate
\# docs of a collated doc
\#
.MAC ENDNOTES_FIRST_PAGENUMBER END
. nr #EN_FIRST_PN \\$1
.END
\#
\# SINGLESPACE ENDNOTES
\# --------------------
\# *Argument:
\# <none> | <anything>
\# *Function:
\# Sets lead of endnotes pages in TYPEWRITE to 12 points,
\# adjusted.
\# *Notes:
\# Default is to double-space endnotes pages.
\#
.MAC SINGLESPACE_ENDNOTES END
. if \\n[#PRINT_STYLE]=1 \{\
. ie \\n[#SINGLE_SPACE] \{\
. nr #EN_SINGLESPACE 1
. rr #IGNORE
. if \\n[#OK_PROCESS_LEAD] \{\
. ENDNOTE_LEAD 12 ADJUST
. nr #IGNORE 1
. \}
. \}
. el \{\
. ie '\\$1'' \{\
. nr #EN_SINGLESPACE 1
. rr #IGNORE
. if \\n[#OK_PROCESS_LEAD] \{\
. ENDNOTE_LEAD 12 ADJUST
. nr #IGNORE 1
. \}
. \}
. el \{\
. rr #EN_SINGLESPACE
. rr #IGNORE
. if \\n[#OK_PROCESS_LEAD] \{\
. ENDNOTE_LEAD 24 ADJUST
. nr #IGNORE 1
. \}
. \}
. \}
. \}
.END
\#
\# ENDNOTE PARAGRAPH SPACE
\# -----------------------
\# *Argument:
\# toggle
\# *Function:
\# Creates toggle register #EN_PP_SPACE for use in .PP.
\# *Notes:
\# Like PARA_SPACE. Default is not to space endnote paras.
\#
.MAC ENDNOTE_PARA_SPACE END
. ie '\\$1'' .nr #EN_PP_SPACE 1
. el .rr #EN_PP_SPACE
.END
\#
\# ENDNOTE
\# -------
\# *Argument:
\# toggle
\# *Function:
\# Places superscript endnote number in text, then collects and
\# processes endnote in diversion END_NOTES.
\# *Notes:
\# \c must be appended to the word immediately preceding .ENDNOTE
\# when ENDNOTE_MARKER_STYLE is NUMBER.
\#
.MAC ENDNOTE END
. ie '\\$1'' \{\
. nr #ENDNOTE 1
. ie !\\n[#EN_MARKER_STYLE]=2 \{\
. if \\n[#CONDENSE] .nop \*[CONDX]\c
. if \\n[#EXTEND] .nop \*[EXTX]\c
. if \\n[#UNDERLINE_ON] \{\
. nr #UNDERLINE_WAS_ON 1
. UNDERLINE OFF
. \}
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#SLANT_ON] \{\
. nr #SLANT_WAS_ON 1
. nop \*[SLANTX]\c
. \}
.\" Vertical raise amount here is more than when the same string is printed in
.\" the endnotes so bottom of number aligns with top of bowl.
. PRINT \
"\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c"
. \}
. if \\n[#PRINT_STYLE]=2 .PRINT \*[SUP]\\n+[#EN_NUMBER]\*[SUPX]\c
. \}
. el \{\
. ie r#EN_NUMBER .nr #EN_NUMBER \\n[#EN_NUMBER]+1
. el .nr #EN_NUMBER 1 1
. if !\\n[#LINENUMBERS] \{\
. tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
. tm1 " ENDNOTE_MARKER_STYLE is LINE.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. if \\n[#EN_MARK]=0 .nr #EN_MARK \\n[ln]
. nr #EN_MARK_2 \\n[ln]
. if '\\n[.z]'P_QUOTE' \{\
. nr #EN_MARK -1
. nr #EN_MARK_2 -1
. \}
. \}
. nr #PP_STYLE_PREV \\n[#PP_STYLE]
. nr #PP_STYLE 1
. if \\n[#INDENT_FIRST_PARAS] .nr #INDENT_FIRSTS 1
. INDENT_FIRST_PARAS
. ev EN
. da END_NOTES
. LL \\n[#DOC_L_LENGTH]u
. ta \\n[.l]u
. if \\n[#COLUMNS] \{\
. ie \\n[#EN_NO_COLS] .LL \\n[#DOC_L_LENGTH]u
. el .LL \\n[#COL_L_LENGTH]u
. ta \\n[.l]u
. \}
\!. if \\\\n[.vpt]=0 .vpt
\!. ne 3
. vs \\n[#EN_LEAD]u
.\" Print identifying doc title (e.g., Chapter n)
. if \\n[#EN_NUMBER]=1 \{\
. if \\n[#PRINT_STYLE]=1 .TYPEWRITER
. if \\n[#PRINT_STYLE]=2 \{\
. FAMILY \\*[$EN_TITLE_FAM]
. FT \\*[$EN_TITLE_FT]
. ps \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
. if \\n[#EN_TITLE_COLOR] .COLOR \\*[$EN_TITLE_COLOR]
. if \\n[#ENDNOTE_TITLE_SMALLCAPS] .SMALLCAPS
. if \\n[#ENDNOTE_TITLE_CAPS] .CAPS
. \}
. ie \\n[#SINGLE_SPACE]=1 .sp 2
. el .sp
. if !'\\*[$EN_TITLE]'' \{\
. substring $EN_TITLE_QUAD 0 0
. if '\\*[$EN_TITLE_QUAD]'L' .LEFT
. if '\\*[$EN_TITLE_QUAD]'C' .CENTER
. if '\\*[$EN_TITLE_QUAD]'R' .RIGHT
\!. vpt 0
. sp -.25v
. ie \\n[#EN_TITLE_UNDERLINE] \
. UNDERSCORE "\\*[$EN_TITLE]"
. el \{\
. ie \\n[#PRINT_STYLE]=1 \
. UNDERSCORE "\\*[$EN_TITLE]"
. el .PRINT "\\*[$EN_TITLE]"
. \}
. sp .25v
\!. vpt
. \}
. if \\n[#EN_TITLE_COLOR] .gcolor
. if \\n[#ENDNOTE_TITLE_SMALLCAPS] .SMALLCAPS OFF
. if \\n[#ENDNOTE_TITLE_CAPS] .CAPS OFF
. \}
.\" Get indent from endnotes point size; convert string to reg in
.\" case indent string is, e.g., m or n
. ps \\n[#EN_PS]u
. nr #REF_EN_INDENT (u;\\*[$REF_EN_INDENT])
. if \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
. if \\n[#EN_NUMBER]=1 \{\
. ie \\n[#SINGLE_SPACE]=1 .sp
. el .sp .25
. \}
. if \\n[#EN_MARKER_STYLE]=3 .ps -2
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. if \\n[#EN_MARKER_STYLE]=1 \{\
. FAMILY \\*[$EN_NUMBER_FAM]
. FT \\*[$EN_NUMBER_FT]
. ps \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
. \}
. if \\n[#EN_MARKER_STYLE]=2 \{\
. FAMILY \\*[$EN_LN_FAM]
. FT \\*[$EN_LN_FT]
. ps \\n[#EN_PS]u\\*[$EN_LN_SIZE_CHANGE]
. \}
. if \\n[#EN_MARKER_STYLE]=3 \{\
. FAMILY \\*[$EN_NUMBER_FAM]
. FT \\*[$EN_NUMBER_FT]
. ps \\n[#PT_SIZE_IN_UNITS]u*6u/10u
. \}
. \}
.\" Build string for line-numbered endnotes
. if \\n[#EN_MARKER_STYLE]=2 \{\
. ie \\n[#EN_LN_BRACKETS]=1 \{\
. ds $EN_LINENUMBER \v'-.085m'\\*[$EN_OPEN_BRACKET]\v'.085m'
. ie \\n[#EN_MARK_2]=\\n[#EN_MARK] .as $EN_LINENUMBER \
\\n[#EN_MARK]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m'\"
. el .as $EN_LINENUMBER \
\\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\v'-.085m'\
\\*[$EN_CLOSE_BRACKET]\v'.085m'\"
. \}
. el \{\
. ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \
. ds $EN_LINENUMBER \
\\n[#EN_MARK]\\*[$EN_LN_SEP]
. el \
. ds $EN_LINENUMBER \
\\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\\*[$EN_LN_SEP]
. \}
. nr #EN_MARK 0
. \}
. vpt 0
. ie \\n[#EN_NUMBERS_ALIGN_RIGHT] .RIGHT
. el .LEFT
. if \\n[#EN_MARKER_STYLE]=1 \
. nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
. if \\n[#EN_MARKER_STYLE]=2 \{\
. ie \\n[#EN_LN_BRACKETS]=1 .nr #EN_NUMBER_L_LENGTH \
(\w'\0'*(\\n[#EN_NUMBER_PLACEHOLDERS]*2))+\w'-[]'
. el .nr #EN_NUMBER_L_LENGTH \
(\w'\0'*(\\n[#EN_NUMBER_PLACEHOLDERS]*2))+\w'-\\*[$EN_LN_SEP]'
. RIGHT
. \}
. if \\n[#EN_MARKER_STYLE]=3 \{\
. nr #EN_NUMBER_L_LENGTH \
\w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+.15m
. RIGHT
. \}
. ie \\n[#REF]=1 \
. ll \\n[#EN_NUMBER_L_LENGTH]u+\\n[#REF_EN_INDENT]u
. el .ll \\n[#EN_NUMBER_L_LENGTH]u
. if \\n[#EN_MARKER_STYLE]=1 \{\
. if \\n[#REF]=1 .ti \\n[#REF_EN_INDENT]u
. nop \En[#EN_NUMBER].
. \}
. if \\n[#EN_MARKER_STYLE]=2 \{\
. nop \\*[$EN_LINENUMBER]
. rm $EN_LINENUMBER
. \}
. if \\n[#EN_MARKER_STYLE]=3 \{\
\!. vpt 0
. ps \" Reset ps changed to get width of s-script numbers
. ie \\n[#PRINT_STYLE]=1 \{\
.\" Vertical raise amount here is less than when the same string is printed in
.\" the body of the text because number precedes a cap.
. nop \
\s-2\v'-\\n[#DOC_LEAD]u/7u'\\n[#EN_NUMBER]\|\v'+\\n[#DOC_LEAD]u/7u'\s+2
. \}
. el .nop \E*[SUP]\\n[#EN_NUMBER]\E*[SUPX]\h'.15m'
. \}
. EOL
. ll
\!. vpt
. nr #EN_FIGURE_SPACE \w'\0'
. if \\n[#EN_MARKER_STYLE]=1 \{\
. ie \\n[#REF]=1 .ti \
\\n[#EN_NUMBER_L_LENGTH]u+\\n[#REF_EN_INDENT]u+\\n[#EN_FIGURE_SPACE]u
. el .in \
\\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_FIGURE_SPACE]u
. \}
. if \\n[#EN_MARKER_STYLE]=2 \{\
. ie \\n[#REF]=1 .ti \
\\n[#EN_NUMBER_L_LENGTH]u+\\n[#REF_EN_INDENT]u+\\n[#EN_LN_GAP]u
. el .ti \
\\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_LN_GAP]u
. \}
. if \\n[#EN_MARKER_STYLE]=3 \{\
. ie \\n[#REF]=1 .ti \
\\n[#EN_NUMBER_L_LENGTH]u+\\n[#REF_EN_INDENT]u+\w'\|'u
. el .in \
\\n[#EN_NUMBER_L_LENGTH]u
. \}
. nr #EN_TEXT_INDENT \\n[.i]
. QUAD \\*[$EN_QUAD]
. vpt
. if \\n[#PRINT_STYLE]=1 .TYPEWRITER
. if \\n[#PRINT_STYLE]=2 \{\
. FAMILY \\*[$EN_FAM]
. FT \\*[$EN_FT]
. ps \\n[#EN_PS]u
. \}
. \}
. el \{\
\!. ie \\n[#EN_NUMBER]=\\\\n[#LAST_EN] .vpt 0
\!. el .br
. if \\n[#PRINT_STYLE]=2 .sp \\*[$EN_SPACE]
. in 0
. if \\n[#EN_MARKER_STYLE]=2 \{\
\!. in 0
. \}
. da
.\" Restore sentence spacing
. if \\n[#PRINT_STYLE]=2 \{\
. if d$RESTORE_SS_VAR .SS \\*[$RESTORE_SS_VAR]
. rm $RESTORE_SS_VAR
. \}
. ev
.\" Restore lead -- need
. nr #PP_STYLE \\n[#PP_STYLE_PREV]
. if !\\n[#INDENT_FIRSTS] .INDENT_FIRST_PARAS OFF
. rr #INDENT_FIRSTS
. rr #ENDNOTE
. if \\n[#UNDERLINE_WAS_ON] \{\
. rr #UNDERLINE_WAS_ON
. UNDERLINE
. \}
. if \\n[#SLANT_WAS_ON] \{\
. rr #SLANT_WAS_ON
\*[SLANT]\c
. \}
. \}
. if \\n[#NUM_ARGS]=2 \{\
. if '\\$2'BREAK' .BR
. if '\\$2'BR' .BR
. \}
.END
\#
\# Endnotes (user space macro)
\# ---------------------------
\#
\# ENDNOTES
\# --------
\# *Arguments:
\# none
\# *Function:
\# Sets new document leading from #EN_LEAD, breaks to a new page,
\# sets up an endnotes page based on registers and strings associated
\# with endnotes, then outputs diversion END_NOTES.
\#
.MAC ENDNOTES END
. if \\n[defer] .NEWPAGE
. nr #LAST_EN \\n[#EN_NUMBER]
. nr #ENDNOTES 1
. nr #EN_FIRST_PAGE 1
. SETUP_ENDNOTES
. if !\\n[#PRINT_STYLE]=1 .chop END_NOTES
. nf
. END_NOTES
. rm END_NOTES
. ps \\n[#DOC_PT_SIZE]u
. if \\n[#PRINT_STYLE]=1 .vs \\n[#DOC_LEAD]u
. if \\n[#PRINT_STYLE]=2 \{\
. ie \\n[#ADJ_EN_LEAD] \
. nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
. el .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
. rr #RESTORE_DOC_LEAD
. \}
. if \\n[#COLUMNS_WERE_ON] .nr #COLUMNS 1
. if \\n[#HEADER_STATE]=1 .HEADERS
. if \\n[#LINENUMBERS]=2 \{\
. NUMBER_LINES RESUME
. nr #LINENUMBERS 1
. \}
. rr #ENDNOTES
.END
\#
\# Macros common to endnotes, bibliography, and toc
\# ------------------------------------------------
\#
.MAC SETUP_BIB_EN END
. if '\\$0'SETUP_BIBLIOGRAPHY' .ds EN-OR-BIB BIB
. if '\\$0'SETUP_ENDNOTES' .ds EN-OR-BIB EN
. nr #HEADER_STATE \\n[#HEADERS_ON]
. ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
. if \\n[#LINENUMBERS]=1 \{\
. NUMBER_LINES OFF
. nr #LINENUMBERS 2
. \}
. if \\n[#HEADERS_ON]=1 \
. if !\\n[#\\*[EN-OR-BIB]_ALLOWS_HEADERS_ALL] .HEADERS OFF
. if \\n[#HEADER_STATE]=1 \{\
. ie \\n[#\\*[EN-OR-BIB]_HDRFTR_CENTER]=1 .
. el .rm $HDRFTR_CENTER
. \}
. ie !\\n[#SUSPEND_PAGINATION] \{\
. if \\n[#PAGINATE]=1 \{\
. if \\n[#PAGE_NUM_V_POS]=1 \{\
. PAGENUM_STYLE \\*[$\\*[EN-OR-BIB]_PN_STYLE]
. if \\n[#\\*[EN-OR-BIB]_FIRST_PN] .PAGENUMBER \\n[#\\*[EN-OR-BIB]_FIRST_PN]-1
. if r #\\*[EN-OR-BIB]_NO_FIRST_PN .nr #PAGINATE 0
. \}
. \}
. \}
. el \{\
. ie \\n[#PAGE_NUM_V_POS]=2 .nr #PAGINATE 1
. el .nr #PAGINATE 0
. \}
. if \\n[#FOOTERS_ON]=1 \{\
. if !'\\*[$HDRFTR_CENTER_OLD]'' \
. ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
. \}
. NEWPAGE
. if \\n[#FOOTERS_ON]=1 \{\
. ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
. rm $HDRFTR_CENTER_OLD
. rm $HDRFTR_CENTER_NEW
. \}
. ie !\\n[#SUSPEND_PAGINATION] \{\
. if \\n[#PAGE_NUM_V_POS]=1 \{\
. if r #\\*[EN-OR-BIB]_NO_FIRST_PN \
. if \\n[#PAGINATION_STATE]=1 .nr #PAGINATE 1
. \}
. \}
. el \
. if \\n[#PAGE_NUM_V_POS]=2 .nr #PAGINATE 0
. rr #PAGINATION_STATE
. PAGENUM_STYLE \\*[$\\*[EN-OR-BIB]_PN_STYLE]
. if \\n[#\\*[EN-OR-BIB]_FIRST_PN] .PAGENUMBER \\n[#\\*[EN-OR-BIB]_FIRST_PN]
. if \\n[#HEADER_STATE]=1 \
. if \\n[#\\*[EN-OR-BIB]_ALLOWS_HEADERS] .HEADERS
.\" Collect endnotes title string for TOC
. nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
. af #TOC_ENTRY_PN \\g[#PAGENUMBER]
. ds $TOC_TITLE_ITEM \\*[$\\*[EN-OR-BIB]_STRING]\|
. PDF_BOOKMARK 1 \\*[$\\*[EN-OR-BIB]_STRING]
. TITLE_TO_TOC
.\" End collection of endnotes title string for TOC
.\" Process endnotes
. if \\n[#PRINT_STYLE]=1 .vs \\n[#\\*[EN-OR-BIB]_LEAD]u
. if \\n[#PRINT_STYLE]=2 \{\
. if \\n[#\\*[EN-OR-BIB]_NO_COLS] \{\
. if \\n[#COLUMNS] .nr #COLUMNS_WERE_ON 1
. nr #COLUMNS 0
. \}
. nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
. ie \\n[#ADJ_\\*[EN-OR-BIB]_LEAD] .nr #DOC_LEAD \\n[#\\*[EN-OR-BIB]_LEAD]
. el .DOC_LEAD \\n[#\\*[EN-OR-BIB]_LEAD]u
. \}
. vpt 0
. RESTORE_SPACE
. ie r#\\*[EN-OR-BIB]_STRING_V_POS .sp |\\n[#\\*[EN-OR-BIB]_STRING_V_POS]u-1v
. el .sp |\\n[#T_MARGIN]u-\\n[#\\*[EN-OR-BIB]_LEAD]u
. vpt
. mk ec
. if \\n[#SLANT_ON] \{\
\*[SLANTX]\c
. \}
. sp
. if !'\\*[$\\*[EN-OR-BIB]_STRING]'' \{\
. if \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
. vs \\n[#\\*[EN-OR-BIB]_LEAD]u
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. LL \\n[#DOC_L_LENGTH]u
. ta \\n[.l]u
. if \\n[#COLUMNS] \{\
. ie \\n[#\\*[EN-OR-BIB]_NO_COLS] .LL \\n[#DOC_L_LENGTH]u
. el .LL \\n[#COL_L_LENGTH]u
. ta \\n[.l]u
. \}
. FAMILY \\*[$\\*[EN-OR-BIB]_STRING_FAM]
. FT \\*[$\\*[EN-OR-BIB]_STRING_FT]
. ps \\n[#\\*[EN-OR-BIB]_PS]u\\*[$\\*[EN-OR-BIB]_STRING_SIZE_CHANGE]
. vs \\n[#\\*[EN-OR-BIB]_LEAD]u
. \}
. substring $\\*[EN-OR-BIB]_STRING_QUAD 0 0
. if '\\*[$\\*[EN-OR-BIB]_STRING_QUAD]'L' .LEFT
. if '\\*[$\\*[EN-OR-BIB]_STRING_QUAD]'C' .CENTER
. if '\\*[$\\*[EN-OR-BIB]_STRING_QUAD]'R' .RIGHT
. EOL
. if \\n[#\\*[EN-OR-BIB]_STRING_COLOR]=1 .COLOR \\*[$\\*[EN-OR-BIB]_STRING_COLOR]
. if \\n[#\\*[EN-OR-BIB]_STRING_CAPS] .CAPS
. if \\n[#\\*[EN-OR-BIB]_STRING_SMALLCAPS] .SMALLCAPS
. ie \\n[#\\*[EN-OR-BIB]_STRING_UNDERLINE] \{\
. if \\n[#PRINT_STYLE]=2 .ds $TITLE_TYPE \\*[EN-OR-BIB]_STRING
. ie \\n[#PRINT_STYLE]=1 \
. UNDERSCORE2 3p 2p "\\*[$\\*[EN-OR-BIB]_STRING]"
. el \{\
. ie \\n[#\\*[EN-OR-BIB]_STRING_UNDERLINE]=2 \
. UNDERSCORE2 \\*[$\\*[EN-OR-BIB]_UNDERLINE_GAP] \\*[$\\*[EN-OR-BIB]_RULE_GAP] "\\*[$\\*[EN-OR-BIB]_STRING]"
. el .UNDERSCORE "\\*[$\\*[EN-OR-BIB]_STRING]"
. \}
. \}
. el .PRINT "\\*[$\\*[EN-OR-BIB]_STRING]
. \}
. SMALLCAPS OFF
. if \\n[#\\*[EN-OR-BIB]_STRING_COLOR]=1 .gcolor
. CAPS OFF
. FAMILY \\*[$\\*[EN-OR-BIB]_FAMILY]
. FT \\*[$\\*[EN-OR-BIB]_FT]
. ps -\\*[$\\*[EN-OR-BIB]_STRING_SIZE_CHANGE]
. ie \\n[#PRINT_STYLE]=1 \{\
. ie \\n[#SINGLE_SPACE]=1 .sp
. el \{\
. ie \\n[#\\*[EN-OR-BIB]_SINGLESPACE]=1 .sp
. el .
. \}
. \}
. el \{\
. ie '\\*[EN-OR-BIB]'BIB' .sp 2
. el .sp
. \}
. SHIM
. QUAD \\*[$\\*[EN-OR-BIB]_QUAD]
.END
.
.ALIAS SETUP_BIBLIOGRAPHY SETUP_BIB_EN
.ALIAS SETUP_ENDNOTES SETUP_BIB_EN
\#
\# ENDNOTES, BIBLIOGRAPHY and TOC LEADING
\# --------------------------------------
\# *Argument:
\# <leading> [ ADJUST ]
\# *Function:
\# Depending on the name by which it's called, creates or modifies
\# register #<type>_LEAD, where <type> is BIB, EN, or TOC. Creates or removes
\# register #ADJ_<type>_LEAD. Stores arguments in strings if BIB,
\# EN, or TOC leading are set before START.
\# *Notes:
\# Default is same as doc lead for TYPESET, adjusted; 24 for TYPEWRITE.
\#
.MAC _LEAD END
. if '\\$0'BIBLIOGRAPHY_LEAD' .ds $SECTION BIB
. if '\\$0'ENDNOTE_LEAD' .ds $SECTION EN
. if '\\$0'TOC_LEAD' .ds $SECTION TOC
. rr #ADJ_\\*[$SECTION]_LEAD
. ds $\\*[$SECTION]_LEAD \\$1
. rm $ADJUST_\\*[$SECTION]_LEAD
. if '\\$2'ADJUST' \{\
. nr #ADJ_\\*[$SECTION]_LEAD 1
. ds $ADJUST_\\*[$SECTION]_LEAD ADJUST
. \}
. if !\\n[#OK_PROCESS_LEAD] .return
. nr #\\*[$SECTION]_LEAD (p;\\$1)
.END
.
.ALIAS BIBLIOGRAPHY_LEAD _LEAD
.ALIAS ENDNOTE_LEAD _LEAD
.ALIAS TOC_LEAD _LEAD
\#
\# ====================================================================
\#
\# +++BIBLIOGRAPHY+++
\#
\# Mom treats bibliographies and endnotes very similarly. The chief
\# difference is that endnotes are collected and formatted inside a
\# diversion, while bibliographies are built "by hand." ENDNOTES sets
\# up the endnotes page and outputs the formatted diversion.
\# BIBLIOGRAPHY sets up the bibliography page, then awaits refer
\# commands.
\#
\# All of the bibliography control macros have their exact
\# counterparts in the endnotes control macros. See, therefore,
\# Arguments, Functions, and Notes in the Endnotes section.
\#
\# Bibliography control macros
\#
.MAC BIBLIOGRAPHY_PT_SIZE END
. nr #BIB_PS (p;\\$1)
.END
\#
.MAC BIBLIOGRAPHY_HDRFTR_CENTER END
. ie '\\$1'' .nr #BIB_HDRFTR_CENTER 1
. el .rr #BIB_HDRFTR_CENTER
.END
\#
.MAC BIBLIOGRAPHY_STRING END
. ds $BIB_STRING \\$1
.END
\#
.MAC BIBLIOGRAPHY_STRING_ADVANCE END
. nr #BIB_STRING_V_POS (u;\\$1)
.END
\#
.MAC BIBLIOGRAPHY_STRING_V_POS END
. nr #BIB_STRING_V_POS (u;\\$1)
.END
.
.ALIAS BIBLIOGRAPHY_HEADER_V_POS BIBLIOGRAPHY_STRING_V_POS
\#
.MAC BIBLIOGRAPHY_NO_COLUMNS END
. ie '\\$1'' .nr #BIB_NO_COLS 1
. el .rr #BIB_NO_COLS
.END
\#
.MAC BIBLIOGRAPHY_NO_FIRST_PAGENUM END
. ie '\\$1'' .nr #BIB_NO_FIRST_PN 1
. el .rr #BIB_NO_FIRST_PN
.END
\#
.MAC BIBLIOGRAPHY_ALLOWS_HEADERS END
. ie '\\$1'' .nr #BIB_ALLOWS_HEADERS 1
. el \{\
. ie '\\$1'ALL' \{\
. nr #BIB_ALLOWS_HEADERS 1
. nr #BIB_ALLOWS_HEADERS_ALL 1
. \}
. el \{\
. rr #BIB_ALLOWS_HEADERS
. rr #BIB_ALLOWS_HEADERS_ALL
. \}
. \}
.END
\#
.MAC BIBLIOGRAPHY_PAGENUM_STYLE END
. ds $BIB_PN_STYLE \\$1
.END
\#
.MAC BIBLIOGRAPHY_FIRST_PAGENUMBER END
. nr #BIB_FIRST_PN \\$1
.END
\#
.MAC SINGLESPACE_BIBLIOGRAPHY END
. if \\n[#PRINT_STYLE]=1 \{\
. ie \\n[#SINGLE_SPACE] \{\
. nr #BIB_SINGLESPACE 1
. rr #IGNORE
. if \\n[#OK_PROCESS_LEAD] \{\
. BIBLIOGRAPHY_LEAD 12 ADJUST
. nr #IGNORE 1
. \}
. \}
. el \{\
. ie '\\$1'' \{\
. nr #BIB_SINGLESPACE 1
. rr #IGNORE
. if \\n[#OK_PROCESS_LEAD] \{\
. BIBLIOGRAPHY_LEAD 12 ADJUST
. nr #IGNORE 1
. \}
. \}
. el \{\
. rr #BIB_SINGLESPACE
. rr #IGNORE
. if \\n[#OK_PROCESS_LEAD] \{\
. BIBLIOGRAPHY_LEAD 24 ADJUST
. nr #IGNORE 1
. \}
. \}
. \}
. \}
.END
\#
\# Style for outputting collected bibliographic references
\# -------------------------------------------------------
\# *Argument:
\# LIST | PLAIN [ <list separator> ] [ <list prefix> ]
\# *Function:
\# Sets #BIB_LIST to 1 for numbered list style, 0 for plain output
\# *Notes:
\# Technically, user is supposed to enter PLAIN if s/he wants an
\# unnumbered bibliography, but the el clause says "any arg but
\# LIST means unnumbered." Effectively, any arg but LIST produces
\# a "plain" bibliographic list.
\#
\# The 2nd and 3rd args have the same options as the 2nd and 3rd
\# args to LIST.
\#
.MAC BIBLIOGRAPHY_TYPE END
. ie '\\$1'LIST' \{\
. nr #BIB_LIST 1
. ie '\\$2'' \
. if '\\*[$BIB_LIST_SEPARATOR]'' .ds $BIB_LIST_SEPARATOR .
. el .ds $BIB_LIST_SEPARATOR \\$2
. ie '\\$3'' .ds $BIB_LIST_PREFIX
. el .ds $BIB_LIST_PREFIX \\$3
. \}
. el .nr #BIB_LIST 0
.END
\#
\# Spacing between items in bibliographies
\# ---------------------------------------
\# *Argument:
\# <amount of space>
\# *Function:
\# Gets value for $BIB_SPACE.
\# *Notes:
\# Requires a unit of measure.
\#
.MAC BIBLIOGRAPHY_SPACING END
. ds $BIB_SPACE \\$1
.END
\#
\# Bibliography (user space macro)
\# -------------------------------
\# *Function:
\# Sets up a new page, with title, ready to accept the output
\# of refer's $LIST$ or .R1 bibliography .R2
\# *Notes:
\# Bibliography pages are set up almost identically to endnotes pages.
\#
.MAC BIBLIOGRAPHY END
. if \\n[defer] .NEWPAGE
. ie '\\$1'' \{\
. rr #FN_REF
. rr #EN_REF
. nr #BIBLIOGRAPHY 1
. nr #BIB_FIRST_PAGE 1
\#. nr #SKIP_FOOTER +1
. SETUP_BIBLIOGRAPHY
\#. nr #SKIP_FOOTER -1
. if \\n[#PRINT_STYLE]=1 \{\
. ie \\n[#SINGLE_SPACE]=1 .vs \\n[#BIB_LEAD]u
. el \{\
. ie \\n[#BIB_SINGLESPACE]=1 .vs \\n[#BIB_LEAD]u
. el .vs \\n[#BIB_LEAD]u
. \}
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. ie \\n[#ADJ_BIB_LEAD] \
. nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
. el .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
. rr #RESTORE_DOC_LEAD
. \}
. if \\n[#COLUMNS_WERE_ON] .nr #COLUMNS 1
. if \\n[#HEADER_STATE]=1 .HEADERS
. if \\n[#LINENUMBERS]=2 \{\
. NUMBER_LINES RESUME
. nr #LINENUMBERS 1
. \}
. di BIB
. \}
. el \{\
. br
. di
.\" Part of workaround for refer spitting out a blank page if the
.\" last ref falls on the bottom line.
. nr num*refs \\n[ref*num*first-pass]
. nf
. chop BIB
. BIB
. \}
. rr #BIBLIOGRAPHY
.END
\#
\# ====================================================================
\#
\# +++TABLE OF CONTENTS+++
\#
\# Strings to allocate space for leaders and entry page numbers
\#
.ds $TOC_PN \\*[ST102]\F[\\*[$TOC_PN_FAM]]\f[\\*[$TOC_PN_FT]]\
\s[\\n[#TOC_PS]u]^\\*[ST102X]\\*[ST103]\s[\\*[$TOC_PN_SIZE_CHANGE]]\
\h'.2n'\h'\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST103X]
\#
.ds $TOC_PN_TYPEWRITE \\*[ST102]^\\*[ST102X]\\*[ST103]\
\h'\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST103X]
\#
\# Macro to remove titles from the TOC.
\# Primarily to remove the copyright page from the TOC.
\#
.MAC NO_TOC_ENTRY END
. nr #NO_TOC_ENTRY 1
.END
\#
\# USER-INSERTED HEADING IN TOC
\# ----------------------------
\# *Arguments:
\# <text>
\# *Function:
\# Inserts a single line of non-pagenumbered text into the TOC.
\#
.MAC TOC_HEADING END
. ds $TOC_HEADING \\$1
.END
\#
\# TOC collector
\#
.MAC TO_TOC END
. if !'\\n[.ev]'TOC_EV' .ev TOC_EV
. nr #TOC_CH_NUM_INDENT \w'\\*[$TOC_CH_NUM]'
. da TOC_ENTRIES
\!. ie \\\\n[#SKIP_ENTRY]=1 \{\
. rr #SKIP_ENTRY
\!. \}
\!. el \{\
. TQ
. ie \\n[#PRINT_STYLE]=1 \{\
\!. fam \\*[$TYPEWRITER_FAM]
\!. ft R
\!. ps \\*[$TYPEWRITER_PS]
. ds _TYPEWRITE _TYPEWRITE
. \}
. el \{\
. ie '\\$0'HD_TO_TOC' \{\
\!. ps \\n[#TOC_PS]u\\*[$TOC_HEAD_\\n[#LEVEL]_SIZE]
. \}
. el \{\
\!. FAMILY \\*[$TOC_TITLE_FAM]
\!. FT \\*[$TOC_TITLE_FT]
\!. ps \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE]
. \}
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. rm _TYPEWRITE
. if \\n[#SPACE_TOC_ITEMS] \{\
. if \\n[#POST_TOP]=1 \{\
. ie !\\n[#LEVEL]=\\n[#LAST_LEVEL] \{\
. ie \\n[#LEVEL]>\\n[#LAST_LEVEL] \!.sp .2v
. el \!.sp .4v
. \}
. el \{\
. if \\n[#COLLATED_DOC] \
. if '\\$0'TITLE_TO_TOC' \!.sp .4v
. \}
. \}
. \}
. \}
\!. vpt 0
\!. PAD_MARKER ^
. if !'\\$0'HD_TO_TOC' \{\
\!. if \\n[#TOC_TITLE_CAPS]=1 .CAPS
. \}
. if '\\$0'HD_TO_TOC' \{\
. nr #POST_TOP 1
\!. if \\n[#TOC_HEAD_\\n[#LEVEL]_CAPS]=1 .CAPS
. \}
. ie '\\$0'HD_TO_TOC' \{\
. if \\n[#PRINT_STYLE]=1 \{\
. ds $TOC_HEAD_\\n[#LEVEL]_FAM] \\*[$TYPEWRITER_FAM]
. ds $TOC_HEAD_\\n[#LEVEL]_FT] R
. \}
\!. PAD \
"\f[\\*[$TOC_HEAD_\\n[#LEVEL]_FAM]\
\\*[$TOC_HEAD_\\n[#LEVEL]_FT]]\
\h'\\\\n[#TOC_INDENT_ADJ]u'\h'\\n[#TOC_HEAD_\\n[#LEVEL]_INDENT]u'\
\\*[$TOC_HD_NUM]\\*[$TOC_HEAD_\\n[#LEVEL]_ITEM]\\*[$TOC_PN\\*[_TYPEWRITE]]" \
"\\*[PDFBOOKMARK.NAME]"
. \}
. el \{\
. ie '\\$0'HEADING_TO_TOC' \{\
. if \\n[#PRINT_STYLE]=1 \{\
. ds $TOC_TITLE_FAM \\*[$TYPEWRITER_FAM]
. ds $TOC_TITLE_FT R
. \}
. if !'\\*[$TOC_HEADING_QUAD]'' \{\
. substring $TOC_HEADING_QUAD 0 0
. if '\\*[$TOC_HEADING_QUAD]'L' \!.LEFT
. if '\\*[$TOC_HEADING_QUAD]'C' \!.CENTER
. if '\\*[$TOC_HEADING_QUAD]'R' \!.RIGHT
. \}
\!. vpt
\!. ne \\*[$SPACE_ABOVE]+\\*[$SPACE_BENEATH]+2v
\!. vpt 0
. if \\n[#PRINT_STYLE]=2 \
. if \\n[#POST_TOP] \!.sp \\*[$SPACE_ABOVE]
. ie \\n[#PRINT_STYLE]=1 \!.nop \\*[$TOC_HEADING]
. el \{\
\!. nop \
\f[\\*[$TOC_HEADING_FAM]\\*[$TOC_HEADING_FT]]\
\s[\\*[$TOC_HEADING_SIZE]]\
\m[\\*[$TOC_HEADING_COLOR]]\
\\*[$TOC_HEADING]\
\m[]\s[0]\f[P]
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. ie \\n[#SPACE_TOC_ITEMS] \
. if \\n[#POST_TOP]=0 \!.sp \\*[$SPACE_BENEATH]
. el \!.sp \\*[$SPACE_BENEATH]
. \}
\!. vpt
. da
. ev
. return
. \}
. el \{\
\!. PAD \
"\f[\\*[$TOC_TITLE_FAM]\\*[$TOC_TITLE_FT]]\
\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN\\*[_TYPEWRITE]]" \
"\\*[PDFBOOKMARK.NAME]"
. \}
. \}
. ie '\\$0'HD_TO_TOC' \
\!. if \\n[#TOC_HEAD_\\n[#LEVEL]_CAPS]=1 .CAPS OFF
. el \
\!. if \\n[#TOC_TITLE_CAPS]=1 .CAPS OFF
\!. PAD_MARKER #
\!. EOL
\!. ST 102 L
\!. ST 103 R QUAD
. if \\n[#PRINT_STYLE]=2 \{\
\!. FAMILY \\*[$TOC_PN_FAM]
\!. FT \\*[$TOC_PN_FT]
\!. ps \\n[#TOC_PS]u
. \}
\!. TAB 102
\!. PRINT \fR\\*[LEADER]\f[]
\!. TN
. if \\n[#PRINT_STYLE]=2 \{\
\!. ps \\*[$TOC_PN_SIZE_CHANGE]
. \}
\!. PRINT \\n[#TOC_ENTRY_PN]
\!. \}
. da
. ev
.END
.
.ALIAS HD_TO_TOC TO_TOC
.ALIAS TITLE_TO_TOC TO_TOC
.ALIAS HEADING_TO_TOC TO_TOC
\#
\# Control macros for toc
\# ----------------------
\#
\# TOC TITLE STYLE
\# ---------------
\# *Arguments:
\# FAMILY <family>
\# FONT <font>
\# SIZE <+|-n>
\# COLOR <color>
\# CAPS
\# INDENT
\# *Function:
\# Assigns complete style parameters to TITLEs (doc titles,
\# chapter titles, etc) in the TOC.
\# *Notes:
\# TITLEs are not headings, therefore they require their own style
\# macro. Otherwise, the same as TOC_ENTRY_STYLE.
\#
.MAC TOC_TITLE_STYLE END
. nr #ARG_NUM 0 1
. nr #ATTRIB \\n[#NUM_ARGS]
. while \\n+[#ARG_NUM]<=\\n[#ATTRIB] \{\
. if '\\$1'FAMILY' \{\
. shift
. ds $TOC_TITLE_FAM \\$1
. shift
. \}
. if '\\$1'FONT' \{\
. shift
. ds $TOC_TITLE_FT \\$1
. shift
. \}
. if '\\$1'SIZE' \{\
. shift
. ds $TOC_TITLE_SIZE \\$1
. shift
. \}
. if '\\$1'CAPS' \{\
. nr #TOC_TITLE_CAPS 1
. shift
. \}
. if '\\$1'NO_CAPS' \{\
. rr #TOC_TITLE_CAPS
. shift
. \}
. if '\\$1'SMALLCAPS' \{\
. nr #TOC_TITLE_SMALLCAPS 1
. shift
. \}
. if '\\$1'NO_SMALLCAPS' \{\
. rr #TOC_TITLE_SMALLCAPS
. shift
. \}
. if '\\$1'INDENT' \{\
. shift
. nr #TOC_TITLE_INDENT \\$1
. shift
. \}
. \}
.END
\#
\# TOC HEADER STRING
\# -----------------
\# *Argument:
\# <string for "doc header" of first toc page>
\# *Function:
\# Creates or modifies string $TOC_HEADER_STRING
\# *Notes:
\# Default is "Contents".
\#
.MAC TOC_HEADER_STRING END
. ds $TOC_HEADER_STRING \\$1
.END
\#
\# TOC HEADER CAPS and SMALLCAPS
\# -----------------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Turns capitalization or smallcaps style of the toc title string
\# on or off.
\# *Notes:
\# Users may want the toc title string to be in
\# caps, but the page header to be in lower case. If the
\# argument to TOC_HEADER_STRING is in lower case and
\# TOC_HEADER_CAPS is turned on, this is exactly what will
\# happen. Ditto for SMALLCAPS.
\#
.MAC TOC_HEADER_CAPS END
. ie '\\$1'' .nr #TOC_STRING_CAPS 1
. el .nr #TOC_STRING_CAPS 0
.END
.
.MAC TOC_HEADER_SMALLCAPS END
. ie '\\$1'' .nr #TOC_STRING_SMALLCAPS 1
. el .nr #TOC_STRING_SMALLCAPS 0
.END
.
\#
\# TOC VERTICAL PLACEMENT
\# ----------------------
\# *Argument:
\# <distance from page top>
\# *Function:
\# Creates register #TOC_HEADER_V_POS.
\# *Notes:
\# Default is same as normal docheader position.
\#
.MAC TOC_HEADER_V_POS END
. nr #TOC_HEADER_V_POS (u;\\$1)
.END
\#
\#
\# TOC POINT SIZE
\# --------------
\# *Argument:
\# <base point size for toc pages>
\# *Function:
\# Creates or modifies register #TOC_PS.
\# *Notes:
\# This size control macro differs from other size control macros
\# in that it sets an absolute point size, not a relative one.
\# See notes for ENDNOTE_PT_SIZE for explanation.
\#
\# No unit of measure required (points assumed). Default is 12.5
\# for TYPESET.
\#
.MAC TOC_PT_SIZE END
. nr #TOC_PS (p;\\$1)
.END
\#
\# TOC ENTRIES PAGE NUMBERS PADDING
\# --------------------------------
\# *Argument:
\# <number of placeholders for toc entries page numbers>
\# *Function:
\# Creates or modifies register #TOC_PN_PADDING.
\# *Notes:
\# "Placeholders" is the maximum number of digits in a page
\# number numeral.
\#
\# Default is 3.
\#
.MAC TOC_PADDING END
. nr #TOC_PN_PADDING \\$1
.END
\#
\# PAGINATE TOC
\# ------------
\# *Argument:
\# <none> | <anything>
\# *Function:
\# Creates or removes register #PAGINATE_TOC.
\# *Notes:
\# Default is to paginate toc.
\#
.MAC PAGINATE_TOC END
. ie '\\$1'' .nr #PAGINATE_TOC 1
. el .nr #PAGINATE_TOC 0
.END
\#
.MAC TOC_FIRST_PAGENUM END
. nr #TOC_START_PAGENUM \\$1
.END
\#
\# TOC PAGES PAGE-NUMBERING STYLE
\# ------------------------------
\# *Argument:
\# DIGIT | ROMAN | roman | ALPHA | alpha
\# *Function:
\# Creates or modifies string $TOC_PN_STYLE
\# *Notes:
\# Page numbering style for page numbers that appear in the
\# headers/footers of toc pages. See notes for PAGENUM_STYLE.
\#
\# Default is roman.
\#
.MAC TOC_PAGENUM_STYLE END
. ds $TOC_PN_STYLE \\$1
.END
\#
\# TOC RECTO_VERSO SWITCH
\# ----------------------
\# *Argument:
\# <none> | <anything>
\# *Function:
\# Creates or removes register #TOC_RV_SWITCH
\# *Notes:
\# Allows switching of L/R margins if a doc is recto/verso and
\# the first toc page happens to fall the wrong way
\#
.MAC TOC_RV_SWITCH END
. ie '\\$1'' .nr #TOC_RV_SWITCH 1
. el .rr #TOC_RV_SWITCH
.END
\#
\# TOC ENTRY SPACING
\# -----------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Toggles whether a small amount of space is inserted between TOC
\# entries for greater legibility.
\#
.MAC SPACE_TOC_ITEMS END
. ie !'\\$1'' .rr #SPACE_TOC_ITEMS
. el .nr #SPACE_TOC_ITEMS 1
.END
\#
\# NUMBERING OF TOC CHAPTER/SECTION ENTRIES
\# ----------------------------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Determines whether chapter numbers are prefixed to title
\# entries in the TOC (title here means chapter/chapter-title
\# or, if the doctype is DEFAULT or NAMED, the section title.
\# *Notes:
\# Aliased as TOC_PREFIX_SECTION_NUMBER.
\#
.MAC TOC_PREFIX_CHAPTER_NUMBER END
. ie '\\$1'' .nr #TOC_PREFIX_CH_NUM 1
. el .rr #TOC_PREFIX_CH_NUM
.END
.
.ALIAS TOC_PREFIX_SECTION_NUMBER TOC_PREFIX_CHAPTER_NUMBER
\#
\# PADDING OF TOC CHAPTER/SECTION NUMBERS
\# --------------------------------------
\# *Arguments:
\# <amount of padding> | <anything>
\# *Function:
\# Insert figure spaces before toc chapter numbers so they
\# right align.
\# *Notes:
\# Aliased as PAD_TOC_SECTION_NUMBERS.
\#
.MAC PAD_TOC_CHAPTER_NUMBERS END
. ie !'\\$1'' .nr #PAD_TOC_CH_NUM \\$1
. el .rr #PAD_TOC_CH_NUM
.END
.
.ALIAS PAD_TOC_SECTION_NUMBERS PAD_TOC_CHAPTER_NUMBERS
\#
\# NUMBERING OF TOC HEAD ENTRIES
\# -----------------------------
\# *Arguments:
\# FULL | TRUNCATE | NONE
\# *Function:
\# Determines how, or whether, to prepend heading numbers to TOC
\# entries.
\# *Notes:
\# FULL means the complete numbering string (default).
\#
\# TRUNCATE means prepend a single digit sufficient to identify
\# an entry's place in the numbering scheme with reference to the
\# level above it. Thus, if a HEADING 1 is the second HEADING 1
\# and therefore numbered "2.", a HEADING 2 beneath it (in the TOC)
\# will have only "1." prepended to the entry; TOC indenting makes it
\# evident under which level the HEADING 2 belongs.
\#
\# Note that TRUNCATE also removes chapter numbers, if
\# PREFIX_CHAPTER_NUMBER is on.
\#
.MAC TOC_ENTRY_NUMBERS END
. if '\\$1'TRUNCATE' .nr #TRUNC_TOC_HD_NUM 1
. if '\\$1'FULL' .nr #TRUNC_TOC_HD_NUM 0
. if '\\$1'NONE' .nr #TOC_NO_HD_NUM 1
.END
\#
\# User defined TITLE entry string
\#
.MAC TOC_TITLE_ENTRY END
. nr #USER_SET_TITLE_ITEM 1
. ds $USER_SET_TITLE_ITEM \\$1
.END
\#
\# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
\# -----------------------------------------
\# *Argument:
\# <none> | <name(s) of author(s) as they should appear in toc doc title entries>
\# *Function:
\# Creates register #TOC_AUTHORS (to tell TOC to append authors
\# to toc doc title entries). Optionally creates string
\# $TOC_AUTHORS.
\# *Notes:
\# Normally, TOC does not append the author(s) to a toc doc title
\# entry. This special macro instructs TOC to do so.
\#
\# If user has multiple authors for each doc when collating,
\# TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
\# COLLATE and START in each doc. Otherwise, mom prints only the
\# first author given to AUTHOR.
\#
.MAC TOC_APPENDS_AUTHOR END
. nr #TOC_AUTHORS 1
. if !'\\$1'' .ds $TOC_AUTHORS \\$1
.END
\#
\# TABLE OF CONTENTS PAGE SETUP
\# ----------------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Some changes to the TOC layout (e.g. margins and page headers)
\# are not covered by the TOC and endnotes control macros. This
\# macro permits access to any and all page setup macros not so
\# covered.
\# *Notes
\# Wraps a diversion that ends when the macro is invoked with an
\# argument. The contained formatting macros must be preceded by
\# '\!'. The diversion is output before START in TOC.
\#
.MAC TOC_PAGE_SETTINGS END
. nr #TOC_PAGE_PARAMS 1
. ie '\\$1'' \
. di TOC_PAGE_PARAMS
. el .di
.END
\#
\# TABLE OF CONTENTS
\# -----------------
\# *Arguments:
\# none
\# *Function:
\# Takes care of the administrivia of setting up the TOC as if
\# it's a collated doc, then outputs the formatted TOC_ENTRIES
\# diversion.
\#
.MAC TOC END
. ie (\\n[@TOP]=0)&(\\n[.t]<=\\n[.v]) \
' br \" When last line of text is on or near b-margin.
. el .br \" All other cases
. if dPDF.EXPORT \
. if \\n[#FLEX_ACTIVE] \
. if !\\n[#NO_FLEX] \
. tm .ds pre-toc-\\n%@\\n[#COL_NUM] 1
. if \\n[#TOC_RV_SWITCH]=1 .nr #TOC_RV_SWITCH 2
. char \[leader] " .
. LEADER_CHARACTER \[leader]
. if !\\n[#TOC_HEAD_1_INDENT] \
. nr #TOC_INDENT_ADJ 1.5m
. if \\n[#TOC_PREFIX_CH_NUM] \
. nr #TOC_INDENT_ADJ \\n[#TOC_CH_NUM_INDENT]
. if !\\n[#DOC_TYPE]=2 \{\
. if !'\\$1'INCLUDE_TITLE' \{\
. if r #LEVEL .nr #SKIP_ENTRY 1
. nr #TOC_INDENT_ADJ 0
. \}
. \}
. nr #TOC 1
. nr TOC.RELOCATE 0
. if \\n[#LINENUMBERS]=1 \{\
. NUMBER_LINES OFF
. nr #LINENUMBERS 2
. \}
. if !r #PAGINATE_TOC .PAGINATE_TOC
. nr #TOC_FIRST_PAGE 1
. if \\n[#FINIS] \{\
. if \\n[#FOOTERS_WERE_ON] \
. FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
. \}
. if \\n[#FOOTERS_ON]=1 \{\
. if !'\\*[$HDRFTR_CENTER_OLD]'' \
. ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
. ie \\n[#PAGINATE_TOC]=1 .PAGINATE
. el .PAGINATION OFF
. \}
. if \\n[#FOOTERS_WERE_ON] .FOOTERS OFF \" But have to turn FOOTERS off again so they don't print when FINIS was called
. rr #COLUMNS
. COLLATE
. if \\n[#PRINT_STYLE]=1 \{\
. rr #IGNORE
. if \\n[#SINGLE_SPACE] .DOC_LEAD 24
. DOC_LEAD_ADJUST
. TRAPS
. nr #IGNORE 1
. \}
. if \\n[#FINIS] \{\
. if \\n[#FOOTERS_WERE_ON] .FOOTERS \" Finally, turn footers on if they were on
. rr #FOOTERS_WERE_ON
. if \\n[#PAGINATION_WAS_ON] \{\
. nr #PAGINATE 1
. rr #PAGINATION_WAS_ON
. \}
. rr #FINIS
. \}
. ie \\n[#PAGINATE_TOC]=1 .PAGINATE
. el .PAGINATION OFF
. ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
. rm $HDRFTR_CENTER_OLD
. rm $HDRFTR_CENTER_NEW
. rr #COLLATED_DOC
. if !r #TOC_START_PAGENUM .nr #TOC_START_PAGENUM 1
. PAGENUMBER \\n[#TOC_START_PAGENUM]
. if \\n[#LINENUMBERS]=2 .nr #LINENUMBERS 3
. L_MARGIN \\n[#DOC_L_MARGIN]u
. LL \\n[#DOC_L_LENGTH]u
. HEADER_CENTER "\\*[$TOC_HEADER_STRING]
. if \\n[#SLANT_ON] .nop \\*[SLANTX]
. PAGENUM_STYLE \\*[$TOC_PN_STYLE]
. PAGENUM_FAMILY \\*[$TOC_PN_FAM]
. if r #TOC_PAGE_PARAMS .TOC_PAGE_PARAMS
. ie \\n[#ADJ_TOC_LEAD] \{\
. DOC_LEAD \\*[$TOC_LEAD] ADJUST
. TRAPS
. \}
. el .DOC_LEAD \\*[$TOC_LEAD]
. ie \\n[#TOC_HEADER_V_POS] \
. DOCHEADER OFF \\n[#TOC_HEADER_V_POS]u-\\n[#DOC_LEAD]u
. el .DOCHEADER OFF \\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
. if (\\n[#PRINT_STYLE]=1)&(\\n[#SINGLE_SPACE]=1) \
. DOCHEADER OFF \\n[#T_MARGIN]u-(\\n[#DOC_LEAD]u*2u)
. START
. PDF_BOOKMARK 1 \\*[$TOC_HEADER_STRING]
. if \\n[#PRINT_STYLE]=1 .TYPEWRITER
. if \\n[#PRINT_STYLE]=2 \{\
. FAMILY \\*[$TOC_HEADER_FAM]
. FT \\*[$TOC_HEADER_FT]
. ps \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
. if \\n[#TOC_HEADER_COLOR]=1 \
. COLOR \\*[$TOC_HEADER_COLOR]
. \}
. QUAD \\*[$TOC_HEADER_QUAD]
. if \\n[#TOC_STRING_CAPS] .CAPS
. if \\n[#TOC_STRING_SMALLCAPS] .SMALLCAPS
. if \\n[#PRINT_STYLE]=1 \
. UNDERSCORE 3p "\\*[$TOC_HEADER_STRING]"
. if \\n[#PRINT_STYLE]=2 \{\
. ie \\n[#TOC_HEADER_UNDERLINE] \{\
. ds $TITLE_TYPE TOC_HEADER
. ie \\n[#TOC_HEADER_UNDERLINE]=2 \
. UNDERSCORE2 \\*[$TOC_UNDERLINE_GAP] \\*[$TOC_RULE_GAP] "\\*[$TOC_HEADER_STRING]"
. el .UNDERSCORE "\\*[$TOC_HEADER_STRING]"
. \}
. el .PRINT \\*[$TOC_HEADER_STRING]
. \}
. SMALLCAPS OFF
. CAPS OFF
. if \\n[#TOC_HEADER_COLOR]=1 .gcolor
. br
. sp
. SHIM_1
. nf
. TOC_ENTRIES
. if \\n[#LINENUMBERS]=3 \{\
. NUMBER_LINES RESUME
. nr #LINENUMBERS 1
. nn 1
. \}
. rr #TOC
. rr #TOC_RV_SWITCH
. pdfsync
.END
\#
\# ====================================================================
\#
\# +++COLUMNS+++
\#
\# COLUMNS
\# -------
\# *Arguments:
\# <number of columns> <width of gutters>
\# *Function:
\# Creates registers associated with setting docs in columns.
\# Calculates column line lengths and offsets
\# *Notes:
\# COLUMNS, if used, s/b the last macro invoked before START.
\#
.MAC COLUMNS END
. if \\n[#IGNORE_COLUMNS]=1 .return
. nr #COLUMNS 1
. nr #NUM_COLS \\$1
. nr #GUTTER (\\$2)
. nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
. nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
. nr #COL_NUM 0 1
. while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
. nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
. nr #COL_TOTAL \\n+[#COL_TOTAL]
. \}
. if \\n[#NUM_COLS]=1 \
. if !\\n[#COLLATE]=1 .MN_INIT
. rr #COL_TOTAL
. rr #COL_NUM
.END
\#
\# MARK COL V-POSITION AFTER DOCHEADER
\# -----------------------------------
\# *Arguments:
\# none
\# *Function:
\# Sets 1st page dc register.
\# *Notes:
\# Only required if manual spacing, positive or negative, precedes
\# start of columns on first page of doc.
\#
.MAC COL_MARK END
. mk dc
.END
\#
\# NEXT COLUMN
\# -----------
\# *Arguments:
\# <none>
\# *Function:
\# Breaks current column and moves to next column.
\# If current column is the last on the page, breaks
\# to a new page.
\#
.MAC COL_NEXT END
. if \\n[#COLUMNS] \{\
. nr #COL_NEXT 1
. vpt 0
. if !'\\$1'internal' \
. if dPDF.EXPORT \
. if \\n[#FLEX_ACTIVE] \
. if !\\n[#NO_FLEX] \
. if \\n[#COL_NUM]>1 \
. tm .ds page-\\n%@\\n[#COL_NUM] 1
. ie '\\$0'COL_NEXT' .br
. el \{\
. brp
. RLD 1v
. \}
. vpt
. ie \\n[#COL_NUM]=\\n[#NUM_COLS] .NEWPAGE
. el .FOOTER
. \}
.END
\#
\# ====================================================================
\#
\# +++LISTS+++
\#
\# LIST
\# ----
\# *Arguments:
\# [ BULLET | DASH | DIGIT | alpha | ALPHA | roman | ROMAN | USER ] \
\# [ <separator> | NONE ] [ <prefix> ] [ <anything> ]
\# *Function:
\# Stores indent information in effect prior to invocation and
\# initializes a list with the supplied enumerator (and separator).
\# *Notes:
\# Default enumerator is a bullet.
\#
\# Enumerator *must* be supplied for every list that's to the
\# right of another list, every time, unless the default bullet is
\# desired.
\#
\# <anything> moves back one list level intuitively, or exits lists
\# completely if the level in which it's invoked is the first.
\#
.MAC LIST END
. br
. if r pdfbx-top 'sp -1
. ds $1ST_LETTER \\$1
. if !'\\*[$1ST_LETTER]'' .substring $1ST_LETTER 0 0
. if '\\*[$1ST_LETTER]'r' .ds $1ST_LETTER R
. ie '\\*[$1ST_LETTER]'R' \{\
. if r #ROMAN_LIST .rr #ROMAN_LIST
. if '\\$1'ROMAN' .nr #ROMAN_LIST 1
. if '\\$1'roman' .nr #ROMAN_LIST 1
. ds $LAST_CHAR \\$1
. substring $LAST_CHAR -1
. if !\B'\\*[$LAST_CHAR]' \{\
. if !r #ROMAN_LIST \{\
. LIST OFF
. return
. \}
. tm1 "[mom]: You must append a number to the '\\$1' argument to \\$0.
. tm1 " The number should be the total number of items in this list.
. tm1 " See the documentation.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. ds $ROMAN_WIDTH \\$1
. substring $ROMAN_WIDTH 1
. while !\B'\\*[$ROMAN_WIDTH]' \{\
. substring $ROMAN_WIDTH 1
. \}
. length #ROMAN_LENGTH \\*[$ROMAN_WIDTH]
. ds $LIST_ARG_1 \\$1
. substring $LIST_ARG_1 0 -(\\n[#ROMAN_LENGTH]+1)
. \}
. el .ds $LIST_ARG_1 \\$1
. if !r#DEPTH \{\
. if \\n[#INDENT_ACTIVE] \{\
. nr #STORED_HL_INDENT \\n[#HL_INDENT]
. nr #STORED_T_INDENT \\n[#T_INDENT]
. if \\n[#INDENT_STYLE_LEFT] \
. nr #STORED_L_INDENT \\n[#L_INDENT]
. if \\n[#INDENT_STYLE_RIGHT] \
. nr #STORED_R_INDENT \\n[#R_INDENT]
. if \\n[#INDENT_STYLE_BOTH] \{\
. nr #STORED_BL_INDENT \\n[#BL_INDENT]
. nr #STORED_BR_INDENT \\n[#BR_INDENT]
. \}
. \}
. nr #CURRENT_L_LENGTH \\n[.l]
. nr #DEPTH 0 1
. if \\n[#INDENT_ACTIVE]=1 \{\
. if \\n[#INDENT_LEFT_ACTIVE]=1 \
. nr #RESTORE_PREV_INDENT 1
. if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
. ie \\n[#DOC_TYPE]=5 .IBX CLEAR
. el .IBX
. nr #ORIG_L_LENGTH \\n[.l]
. IB
. nr #RESTORE_PREV_INDENT 2
. \}
. if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
. ie \\n[#DOC_TYPE]=5 .IRX CLEAR
. el .IRX
. nr #ORIG_L_LENGTH \\n[.l]
. IR
. nr #RESTORE_PREV_INDENT 3
. if \\n[#INDENT_LEFT_ACTIVE]=1 \
. nr #RESTORE_PREV_INDENT 4
. \}
. \}
. \}
. ds pre-list-quad \\*[$QUAD_VALUE]
. substring pre-list-quad 0 0
. if '\\*[pre-list-quad]'C' \{\
. if !'\\n[.z]'LIST*DIV' \{\
. nr #PRE_LIST_QUAD \\n[.j]
. nr #LIST_CENTER 1
. if !'\\n[.z]'LIST*DIV' .di LIST*DIV
\!. nr #IN_LIST 1
. ad l
. \}
. \}
. if '\\*[pre-list-quad]'R' \{\
. if !'\\n[.z]'LIST*DIV' \{\
. nr #PRE_LIST_QUAD \\n[.j]
. nr #LIST_RIGHT 1
. if !'\\n[.z]'LIST*DIV' .di LIST*DIV
\!. nr #IN_LIST 1
. ad l
. \}
. \}
. ie \\n[#NUM_ARGS]=0 \{\
. nr #ARGS_TO_LIST 1 \" So default behaves as if LIST BULLET
. ds $ENUMERATOR\\n+[#DEPTH] \[bu]
. ds $ENUMERATOR_TYPE\\n[#DEPTH] other
. ds $SEPARATOR
. ds $PREFIX
. ds $SEPARATOR\\n[#DEPTH]
. ds $PREFIX\\n[#DEPTH]
. \}
. el \{\
. rr #ARGS_TO_LIST \" Clear this before processing arg 1.
. if '\\*[$LIST_ARG_1]'DASH' \{\
. nr #ARGS_TO_LIST 1
. ds $ENUMERATOR\\n+[#DEPTH] \[en]
. ds $ENUMERATOR_TYPE\\n[#DEPTH] other
. ds $SEPARATOR\\n[#DEPTH]
. ds $PREFIX\\n[#DEPTH]
. \}
. if '\\*[$LIST_ARG_1]'BULLET' \{\
. nr #ARGS_TO_LIST 1
. ds $ENUMERATOR\\n+[#DEPTH] \[bu]
. ds $ENUMERATOR_TYPE\\n[#DEPTH] other
. ds $SEPARATOR\\n[#DEPTH]
. ds $PREFIX\\n[#DEPTH]
. \}
. if '\\*[$LIST_ARG_1]'DIGIT' \{\
. nr #ARGS_TO_LIST 1
. nr #ENUMERATOR\\n+[#DEPTH] 0 1
. ds $ENUMERATOR_TYPE\\n[#DEPTH] register
. ds $SEPARATOR\\n[#DEPTH] .
. ds $PREFIX\\n[#DEPTH]
. if \\n[#NUM_ARGS]>=2 \{\
. ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
. el .ds $SEPARATOR\\n[#DEPTH] \\$2
. if \\n[#NUM_ARGS]=3 .ds $PREFIX\\n[#DEPTH] \\$3
. \}
. \}
. if '\\*[$LIST_ARG_1]'alpha' \{\
. nr #ARGS_TO_LIST 1
. nr #ENUMERATOR\\n+[#DEPTH] 0 1
. af #ENUMERATOR\\n[#DEPTH] a
. ds $ENUMERATOR_TYPE\\n[#DEPTH] register
. ds $SEPARATOR\\n[#DEPTH] )
. ds $PREFIX\\n[#DEPTH]
. if \\n[#NUM_ARGS]>=2 \{\
. ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
. el .ds $SEPARATOR\\n[#DEPTH] \\$2
. if \\n[#NUM_ARGS]=3 .ds $PREFIX\\n[#DEPTH] \\$3
. \}
. \}
. if '\\*[$LIST_ARG_1]'ALPHA' \{\
. nr #ARGS_TO_LIST 1
. nr #ENUMERATOR\\n+[#DEPTH] 0 1
. af #ENUMERATOR\\n[#DEPTH] A
. ds $ENUMERATOR_TYPE\\n[#DEPTH] register
. ds $SEPARATOR\\n[#DEPTH] )
. ds $PREFIX\\n[#DEPTH]
. if \\n[#NUM_ARGS]>=2 \{\
. ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
. el .ds $SEPARATOR\\n[#DEPTH] \\$2
. if \\n[#NUM_ARGS]=3 \
. ds $PREFIX\\n[#DEPTH] \\$3
. \}
. \}
. if '\\*[$1ST_LETTER]'R' \{\
. nr #ARGS_TO_LIST 1
. nr #ENUMERATOR\\n+[#DEPTH] 0 1
. if '\\*[$LIST_ARG_1]'roman' .af #ENUMERATOR\\n[#DEPTH] i
. if '\\*[$LIST_ARG_1]'ROMAN' .af #ENUMERATOR\\n[#DEPTH] I
. ds $ENUMERATOR_TYPE\\n[#DEPTH] roman
. ds $SEPARATOR\\n[#DEPTH] )
. ds $PREFIX\\n[#DEPTH]
. if \\n[#NUM_ARGS]>=2 \{\
. ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
. el .ds $SEPARATOR\\n[#DEPTH] \\$2
. if \\n[#NUM_ARGS]=3 .ds $PREFIX\\n[#DEPTH] \\$3
. \}
. \}
. if '\\*[$LIST_ARG_1]'USER' \{\
. nr #ARGS_TO_LIST 1
. ds $ENUMERATOR\\n+[#DEPTH] \\$2
. ds $ENUMERATOR_TYPE\\n[#DEPTH] other
. ds $SEPARATOR\\n[#DEPTH]
. ds $PREFIX\\n[#DEPTH]
. \}
. if '\\*[$LIST_ARG_1]'VARIABLE' \{\
. if \\n[#NUM_ARGS]<2 \{\
. tm1 "[mom]: You must follow the \\$1 argument to \\$0 with the widest
. tm1 " enumerator to be used. See the documentation.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. nr #ARGS_TO_LIST 1
. ds $ENUMERATOR\\n+[#DEPTH]
. ds $ENUMERATOR_TYPE\\n[#DEPTH] variable
. ds $ENUMERATOR_WIDTH\\n[#DEPTH] \w'\\$2\ '
. ds $SEPARATOR\\n[#DEPTH]
. ds $PREFIX\\n[#DEPTH]
. \}
. if '\\*[$LIST_ARG_1]'PLAIN' \{\
. nr #ARGS_TO_LIST 1
. ds $ENUMERATOR\\n+[#DEPTH]
. ds $ENUMERATOR_TYPE\\n[#DEPTH] plain
. ds $SEPARATOR\\n[#DEPTH]
. ds $PREFIX\\n[#DEPTH]
. \}
. if \\n[#NUM_ARGS]=1 \{\
. if !r#ARGS_TO_LIST \{\
. ie \\n[#DEPTH]=1 \{\
. ie \\n[#NEXT_DEPTH_BACK]=0 \{\
. SET_LIST_INDENT
. if \\n[#QUIT]=1 \{\
. QUIT_LISTS
. return
. \}
. return
. \}
. el \{\
. QUIT_LISTS
. return
. \}
. \}
. el \{\
. SET_LIST_INDENT
. return
. \}
. \}
. \}
. \}
. nr #TOTAL_LISTS \\n[#DEPTH]
. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]m\\*[$SEPARATOR\\n[#DEPTH]]\ '
. if '\\*[$LIST_ARG_1]'ALPHA' .nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]M\\*[$SEPARATOR\\n[#DEPTH]]\ '
. \}
. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \
. GET_ROMAN_INDENT
. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \
. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$ENUMERATOR\\n[#DEPTH]]\ '
. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'variable' \
. nr #LIST_INDENT\\n[#DEPTH] \\*[$ENUMERATOR_WIDTH\\n[#DEPTH]]
. ll \\n[#CURRENT_L_LENGTH]u
. ie \\n[#DEPTH]=1 \{\
. ie \\n[#INDENT_ACTIVE]=1 \{\
. if \\n[#INDENT_STYLE_LEFT]=1 \{\
. if \\n[#L_INDENT_ILX] \{\
. rr #L_INDENT
. rr #L_INDENT_ILX
. \}
. nr #L_INDENT \\n[#L_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
. nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
. nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
. \}
. if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
. nr #L_INDENT \\n[#BL_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
. nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
. nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
. \}
. if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
. ie \\n[#INDENT_LEFT_ACTIVE]=1 \{\
. \" Don't do anything; we already have a left indent
. \}
. el \{\
. nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
. nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
. \}
. \}
. \}
. el \{\
. nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
. nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
. \}
. \}
. el \{\
. nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
. nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
. \}
.END
\#
\# ITEM
\# ----
\# *Arguments:
\# <none> | <space before item>
\# *Function:
\# Prints enumerator for a given list depth and prepares mom to
\# receive the text of an item.
\#
.MAC ITEM END
. ie \\n[#NUM_ARGS]=2 .sp \\$2
. el \
. if \B'\\$1' .sp \\$1
. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'plain' .nop
. if !r#DEPTH .return
. if \\n[#LINENUMBERS]=1 \{\
. NUMBER_LINES OFF
. nr #LINENUMBERS 2
. \}
. if \\n[#KERN]=1 \{\
. nr #KERN_WAS_ON 1
. KERN OFF
. \}
. rr #IN_ITEM
. IL
. nr #IN_ITEM 1
. ll \\n[#CURRENT_L_LENGTH]u \" Set ll again because IL turns IB off.
. ie !'\\n[.z]'' \!.TRAP OFF
. el .TRAP OFF
. HI \\n[#HL_INDENT\\n[#DEPTH]]u
. if '\\*[$SEPARATOR\\n[#DEPTH]]')' .nr #SEP_TYPE 1
. if '\\*[$SEPARATOR\\n[#DEPTH]]']' .nr #SEP_TYPE 1
. if '\\*[$SEPARATOR\\n[#DEPTH]]'}' .nr #SEP_TYPE 1
. ie \\n[#IN_BIB_LIST]=1 \{\
. ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
. ie \\n[#SEP_TYPE]=1 .PRINT \
\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\
\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
. el .PRINT \
\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
. \}
. el \{\
. ie \\n[#SEP_TYPE]=1 .PRINT \
\h'-\w'\0'u'\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\
\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
. el .PRINT \
\h'-\w'\0'u'\
\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
. \}
. \}
. el \{\
. ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
.\" DIGIT
. ie '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
. ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
. ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
. ie \\n[#SEP_TYPE]=1 .PRINT \
\0\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
. el .PRINT \
\0\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
. \}
. el \{\
. ie \\n[#SEP_TYPE]=1 .PRINT \
\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
. el .PRINT \
\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
. \}
. \}
. el \{\
. ie \\n[#SEP_TYPE]=1 .PRINT \
\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
. el .PRINT \
\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
. \}
. \}
. el \{\
.\" ALPHA
. ie '\\g[#ENUMERATOR\\n[#DEPTH]]'A' \{\
. ie \\n[#SEP_TYPE]=1 .PRINT \
\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
. el .PRINT \
\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
. \}
.\" alpha
. el .PRINT \
\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
. \}
. \}
. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
. ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
.\" ROMAN I, padded
. ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
. ie \\n[#SEP_TYPE]=1 .PRINT \
\h'\\n[#HL_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\
\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]\0'u'\
\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n[#ENUMERATOR\\n[#DEPTH]]\
\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
. el .PRINT \
\h'\\n[#HL_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\
\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]\
\0'u'\\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\
\\*[$SEPARATOR\\n[#DEPTH]]
. \}
.\" roman i, padded
. el .PRINT \
\h'\\n[#HL_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\
\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]\0'u'\
\\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
. \}
.\" No pad
. el \{\
.\" ROMAN I, no pad
. ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
. ie \\n[#SEP_TYPE]=1 .PRINT \
\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
. el .PRINT \
\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
. \}
.\" roman i, no pad
. el .PRINT \
\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
. \}
. \}
. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \
. PRINT \\*[$ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'variable' \
. PRINT \\$1
. \}
. rr #SEP_TYPE
. EOL
. if \\n[#REF]=1 \{\
. IL +\\n[#REF_BIB_INDENT]u
. ti \\n[#L_INDENT]u-\\n[#REF_BIB_INDENT]u
. \}
. ie !'\\n[.z]'' \!.TRAP
. el .TRAP
. if \\n[#KERN_WAS_ON]=1 \{\
. KERN
. rr #KERN_WAS_ON
. \}
. if \\n[#LINENUMBERS]=2 \{\
. NUMBER_LINES RESUME
. nr #LINENUMBERS 1
. \}
.END
\#
\# A utility macro that determines the space to reserve for
\# roman numeral enumerated lists. Limit is 20 roman numerals
\# per list. If this isn't enough, the user can add to the
\# macro.
\#
.MAC GET_ROMAN_INDENT END
. if '\\*[$LIST_ARG_1]'roman' \{\
. if '\\*[$ROMAN_WIDTH]'1' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 1
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]i\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'2' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 2
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]ii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'3' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 3
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'4' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 4
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'5' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 5
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'6' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 6
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'7' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 7
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]vii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'8' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 8
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'9' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 9
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'10' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 10
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'11' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 11
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'12' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 12
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'13' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 13
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'14' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 14
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'15' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 15
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'16' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 16
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'17' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 17
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]xvii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'18' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 18
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'19' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 19
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'20' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 20
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. \}
. if '\\*[$LIST_ARG_1]'ROMAN' \{\
. if '\\*[$ROMAN_WIDTH]'1' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 1
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]I\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'2' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 2
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]II\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'3' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 3
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]III\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'4' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 4
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'5' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 5
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'6' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 6
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'7' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 7
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]VII\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'8' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 8
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'9' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 9
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'10' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 10
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'11' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 11
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'12' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 12
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'13' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 13
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]XIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'14' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 14
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'15' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 15
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'16' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 16
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'17' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 17
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]XVII\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'18' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 18
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'19' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 19
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. if '\\*[$ROMAN_WIDTH]'20' \{\
. ds $ROMAN_WIDTH\\n[#DEPTH] 20
. nr #LIST_INDENT\\n[#DEPTH] \
\w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
. \}
. \}
.END
\#
\# SHIFT LIST
\# ----------
\# *Arguments:
\# <amount by which to indent a list to the right>
\# *Function:
\# Adds the value of the arg to the current list's indent.
\# *Notes:
\# Requires a unit of measure.
\#
.MAC SHIFT_LIST END
. nr #SHIFT_LIST\\n[#DEPTH] (\\$1)
. nr #L_INDENT +\\n[#SHIFT_LIST\\n[#DEPTH]]
.END
\#
\# PAD LIST DIGITS
\# ---------------
\# *Arguments:
\# [ LEFT ]
\# *Function:
\# Adds a figure space to a list's hanging and left indent. If
\# LEFT is given, sets reg. #PAD_LIST_DIGITS to 1 for use in ITEM.
\#
.MAC PAD_LIST_DIGITS END
. if '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
. nr #LIST_INDENT\\n[#DEPTH] +\\w'\\0'
. nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#LIST_INDENT\\n-[#DEPTH]]
. nr #HL_INDENT\\n+[#DEPTH] +\\w'\\n[#ENUMERATOR\\n[#DEPTH]]'
. if '\\$1'LEFT' .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1
. \}
. if '\\g[#ENUMERATOR\\n[#DEPTH]]'i' \
. if '\\$1'LEFT' .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1
. if '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \
. if '\\$1'LEFT' .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1
.END
\#
\# RESET LIST
\# ----------
\# *Arguments:
\# none
\# *Function:
\# Resets register enumerators to 1, a, i...
\#
.MAC RESET_LIST END
. ie '\\$1'' .nr #ENUMERATOR\\n[#DEPTH] 0 1
. el .nr #ENUMERATOR\\n[#DEPTH] \\$1-1 1
.END
\#
\# QUIT LISTS
\# ----------
\# *Arguments:
\# none
\# *Function:
\# Exits lists cleanly and restores any indents that were in
\# effect prior to LIST.
\#
.MAC QUIT_LISTS END
. br
. if '\\n[.z]'LIST*DIV' \{\
\!. rr #IN_LIST
. di
. \}
. IQ CLEAR
. nr #HL_INDENT \\n[#STORED_HL_INDENT]
. nr #T_INDENT \\n[#STORED_T_INDENT]
. nr #L_INDENT \\n[#STORED_L_INDENT]
. nr #R_INDENT \\n[#STORED_R_INDENT]
. nr #BL_INDENT \\n[#STORED_BL_INDENT]
. nr #BR_INDENT \\n[#STORED_BR_INDENT]
. rr #STORED_HL_INDENT
. if \\n[#LIST_CENTER] \
. nr #LIST_OFFSET_VALUE \\n[.l]-\\n[dl]/2
. if \\n[#LIST_RIGHT] \{\
. nr #LIST_OFFSET_VALUE \\n[.l]-\\n[dl]
. if r pdfbx-running \
. nr #LIST_OFFSET_VALUE \
\\n[.l]-\\n[dl]-\\*[gap\\n[stack]]-(\\*[wt\\n[stack]]/2)
. \}
. po +\\n[#LIST_OFFSET_VALUE]u
. if \\n[.u] .nr #FILLED 1
. nf
. if dLIST*DIV \{\
. LIST*DIV
. rm LIST*DIV
. \}
. if \\n[#FILLED] .fi
. if !\\n[#PRE_LIST_QUAD]=\\n[.j] .ad \\n[#PRE_LIST_QUAD]
. rr #FILLED
. po
. rr #PRE_LIST_QUAD
. if \\n[#RESTORE_PREV_INDENT]=1 \
. IL
. if \\n[#RESTORE_PREV_INDENT]=2 \{\
. ll \\n[#ORIG_L_LENGTH]u
. IB
. \}
. if \\n[#RESTORE_PREV_INDENT]=3 \{\
. ll \\n[#ORIG_L_LENGTH]u
. IR
. \}
. if \\n[#RESTORE_PREV_INDENT]=4 \{\
. nr #R_INDENT \\n[#STORED_R_INDENT]
. nr #L_INDENT \\n[#STORED_L_INDENT]
. ll \\n[#ORIG_L_LENGTH]u
. IR
. IL
. \}
.\" Clean up after exiting last depth of list
. nr #REMOVE 0 1
. while \\n+[#REMOVE]<=\\n[#TOTAL_LISTS] \{\
. rr #LIST_INDENT\\n[#REMOVE]
. rr #ENUMERATOR\\n[#REMOVE]
. rm $ENUMERATOR\\n[#REMOVE]
. rm $SEPARATOR\\n[#REMOVE]
. rm $ENUMERATOR_TYPE\\n[#REMOVE]
. rr #PAD_LIST_DIGITS\\n[#REMOVE]
. rr #SHIFT_LIST\\n[#REMOVE]
. \}
. rr #STORED_L_INDENT
. rr #STORED_BL_INDENT
. rr #STORED_BR_INDENT
. rr #STORED_R_INDENT
. rr #STORED_R_INDENT
. rr #REMOVE
. rr #TOTAL_LISTS
. rr #QUIT
. rr #DEPTH
. rr #NEXT_DEPTH_BACK
. rr #RESTORE_PREV_INDENT
. rr #ORIG_L_LENGTH
. rr #CURRENT_L_LENGTH
. rr #IN_ITEM
. rr #IN_ITEM_L_INDENT
.END
\#
\# SET LIST INDENT
\# ---------------
\# *Arguments:
\# none
\# *Function:
\# Restores indent of prev. list in nested lists. Also sets the
\# #QUIT register if an invocation of LIST OFF applies to the first
\# level of list.
\#
.MAC SET_LIST_INDENT END
. nr #NEXT_DEPTH_BACK \\n[#DEPTH]-1
. if \\n[#NEXT_DEPTH_BACK]=0 \{\
. nr #QUIT 1
. if \\n[#INDENT_ACTIVE]=1 \{\
. if \\n[#INDENT_STYLE_BOTH]=1 \{\
. ie \\n[#DOCS] \
. ll \\n[#DOC_L_LENGTH]u-\\n[#STORED_BR_INDENT]u
. el \
. ll \\n[#L_LENGTH]u-\\n[#STORED_BR_INDENT]u
. in \\n[#BL_INDENT]u
. \}
. if \\n[#INDENT_STYLE_LEFT] \{\
. in \\n[#STORED_L_INDENT]u
. \}
. if \\n[#INDENT_STYLE_RIGHT] \{\
. ie \\n[#DOCS] \
. ll \\n[#DOC_L_LENGTH]u-\\n[#STORED_R_INDENT]u
. el \
. ll \\n[#L_LENGTH]u-\\n[#STORED_R_INDENT]u
. \}
. \}
. return
. \}
. nr #L_INDENT -\\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#SHIFT_LIST\\n[#DEPTH]]
. nr #HL_INDENT \\n[#HL_INDENT\\n-[#DEPTH]]
.END
\#
\# ====================================================================
\#
\# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
\#
\# COLLATE
\# -------
\# *Arguments:
\# <none>
\# *Function:
\# Turns headers off (if on) and saves header state, sets register
\# #COLLATE to 1 (toggle), and breaks to a new page.
\# *Notes:
\# COLLATE exists primarily to allow putting multiple chapters in
\# a single file, although it can be used for any document type. After
\# COLLATE, any of the macros that normally precede START may be
\# used, and should behave as expected.
\#
\# N.B.--the START macro must be used after every COLLATE
\#
.MAC COLLATE END
. if dPDF.EXPORT .tm .ds pre-collate-\\n% \\n%@\\n[#COL_NUM]
. if \\n[defer] \{\
. nr #BLANKPAGE_AFTER_DEFER 1
. bp
. \}
. nr #HEADER_STATE \\n[#HEADERS_ON]
. if (\\n[defer]=0)&(\\n[float*defer]=0) .HEADERS OFF
. if \\n[#LINENUMBERS] \{\
. NUMBER_LINES off
. nr #LINENUMBERS 2
. \}
. if \\n[#BLANKPAGE] \{\
. if \\n[nl]=\\n[#PAGE_TOP] \{\
. nr #NO_NEWPAGE 1
. RESTORE_SPACE
. \}
. rr #BLANKPAGE
. \}
. if \\n[defer] \
. DO_FOOTER
. EOL
. ds $SAVED_DOC_FAM \\*[$DOC_FAM]
. ds $SAVED_PP_FT \\*[$PP_FT]
. nr #COLLATE 1
. nr #PRE_COLLATE 1
. nr #POST_TOP 1
. nr #HEAD_1_NUM 0 1
. if !\\n[#LISTS] \{\
. if \\n[eqn*label-with-chapter]=1 .nr eqn*label-num 0 1
. if \\n[float*label-with-chapter]=1 .nr fig*label-num 0 1
. if \\n[pdf-img*label-with-chapter]=1 .nr fig*label-num 0 1
. if \\n[pic*label-with-chapter]=1 .nr fig*label-num 0 1
. if \\n[tbl*label-with-chapter]=1 .nr tbl*label-num 0 1
. \}
. if \\n[#DOC_HEADER]=2 .nr #DOC_HEADER 1
. if \\n[#PAGE_NUM_V_POS]=1 \{\
. nr #PAGINATION_STATE \\n[#PAGINATE]
. PAGINATION OFF
. \}
. IQ CLEAR
. TQ
. LL \\n[#DOC_L_LENGTH]u
. PT_SIZE \\n[#DOC_PT_SIZE]u
. QUAD \\*[$DOC_QUAD]
. nr #SAVED_DOC_LEAD \\n[#DOC_LEAD]
. nr #COLLATED_DOC 1
. vs \\n[#DOC_LEAD]u
\*[SLANTX]
\*[CONDX]
\*[EXTX]
. if \\n[#TOC] \{\
. if \\n[TOC_BH]=1 .pdfswitchtopage before MOM:TOC
. if \\n[TOC_BH]=2 .pdfswitchtopage after MOM:TOC
. \}
. if !\\n[#NO_NEWPAGE] .NEWPAGE
. if !\\n[#TOC] \{\
. if \\n[#FORCE_RECTO] \{\
. ds $PN_FORMAT_CURR \\g[#PAGENUMBER]
. af #PAGENUMBER 1
. if \\n[#PAGENUMBER]%2=1 .nr #ODD_PAGENUM 1
. af #PAGENUMBER \\*[$PN_FORMAT_CURR]
. if \\n[#ODD_PAGENUM] .BLANKPAGE 1 DIVIDER
. rr #ODD_PAGENUM
. rr #BLANKPAGE_AFTER_DEFER
. \}
. \}
. rr #NO_NEWPAGE
. ch RR_@TOP
. rr @TOP
. if \\n[.ns] \{\
. rs
. nop \&
. \}
. if '\\n[.ev]'PAGE_TRANSITION\\n[pg-trans]' .ev
. if \\n[#DEFER_PAGINATION] .PAGINATE
. if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
. PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
. rm $RESTORE_PAGENUM_STYLE
. \}
. if \\n[#CH_NUM] \
. if \\n[#TOC]=0 .nr #CH_NUM +1
. rm $EN_TITLE
. COVERTITLE
. DOC_COVERTITLE
. TITLE
. CHAPTER
. CHAPTER_TITLE
. SUBTITLE
. MISC
. rr #COVER_TITLE
. rr #DOC_COVER_TITLE
. rr #FROM_COVERTITLE
. rr #FROM_DOC_COVERTITLE
. rr #MISC
. rr #COVER_MISC
. rr #DOC_COVER_MISC
. rr #COPYRIGHT
. rr #COVER_COPYRIGHT
. rr #DOC_COVER_COPYRIGHT
. rr #COVER_AUTHOR
. rr #DOC_COVER_AUTHOR
. rm COVER_TEXT
. rm DOC_COVER_TEXT
. rm $COPYRIGHT
. rm $COVER_COPYRIGHT
. rm $DOC_COVER_COPYRIGHT
. rr #END_QUOTE
. rr #PAGENUM_STYLE_SET
. rr #DOC_COVER
. rr #COVER
. rr #LAST_LEVEL
. rr #LEVEL
. if \\n[#RESTORE_PN_V_POS] \{\
. nr #PAGE_NUM_V_POS \\n[#RESTORE_PN_V_POS]
. rr #RESTORE_PN_V_POS
. \}
. nr #LOOP 0 1
. while \\n+[#LOOP]<=\\n[@LEVEL] \
. rr #TOC_HEAD_\\n[#LOOP]_INDENT_SET
. if \\n[#FLEX_ACTIVE] .rr #NO_FLEX
.END
\#
\# NUMBER_LINES
\# ------------
\# *Arguments:
\# <starting line number> [ <increment> [ <gutter> ] ]
\# or
\# <anything> | RESUME
\# *Function:
\# Begin, suspend/turn off, or resume numbering of output lines.
\#
.MAC NUMBER_LINES END
. if '\\n[.z]'EPI_TEXT' .return
. if '\\$1'' \{\
. tm1 "[mom]: NUMBER_LINES at line \\n[.c] has no argument.
. tm1 " You have forgotten to give a starting line number or 'RESUME'.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. if !\\n[#LINENUMBERS]=2 .nr #LINENUMBERS 1
.\" Test whether the first arg is a digit.
. if \B'\\$1' \{\
. if \\n[#QUOTE] \{\
. if \\n[#QUOTE]=1 .ds macro QUOTE
. if \\n[#QUOTE]=2 .ds macro BLOCKQUOTE
. tm1 "[mom]: \\$0 at line \\n[.c] may not be used inside \\*[macro].
. tm1 " Please set NUMBER_LINES before \\*[macro], followed by
. tm1 " NUMBER_\\*[macro]_LINES.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. nr #LN \\$1
. ds $LN_NUM \\$1
. if !'\\n[.z]'' .nr #RESTORE_LN_NUM 1
. ie '\\$2'' \
. if '\\*[$LN_INC]'' .ds $LN_INC 1
. el .ds $LN_INC \\$2
. ie '\\$3'' \
. if !\\n[#LN_GUTTER] .nr #LN_GUTTER 2
. el .nr #LN_GUTTER \\$3
. \}
. ie !\\n[#LN] \{\
.\" In other words, the first arg was not a digit.
. rr #LN
. ie '\\$1'RESUME' \{\
. LN_PARAMS
. nm \\*[$LN_NUM]
. RESTORE_PARAMS
. \}
. el \{\
. nm
.\" Register ln is still set and may confuse preprocessors like tbl.
.\" Still, resuming line numbering must be possible, so save ln in
.\" $LN_NUM
. ds $LN_NUM \\n[ln]
. if !\\n[#QUOTE] .nr ln 0
. if !\\n[#LINENUMBERS]=2 .rr #LINENUMBERS
. \}
. \}
. el \{\
. LN_PARAMS
. nm \\*[$LN_NUM] \\*[$LN_INC] \\n[#LN_GUTTER] -3-\\n[#LN_GUTTER]
. RESTORE_PARAMS
. if !'\\n[.z]'' .nr #DIVER_LN_OFF 1
. \}
. rr #LN
.END
\#
\# LINENUMBER STYLE PARAMETERS
\# ---------------------------
\# *Arguments:
\# none
\# *Function:
\# LN_PARAMS sets parameters for line numbers.
\# RESTORE_PARAMS restores them after internal calls to .nm
\# *Notes:
\# It's not documented, but groff's linenumbering is processed
\# in a unique environment reserved for the numbers, such that
\# whatever style params were in effect prior to the invocation
\# of .nm remain in effect for the numbers even if the running
\# text has different params. Eg, If you set .gcolor to 'purple'
\# before .nm then set it back to what it was, the numbers will be
\# purple while the text remains at the default color.
\#
.MAC LN_PARAMS END
. ie d$LN_FAM .fam \\*[$LN_FAM]
. el .fam \\n[.fam]
. ie d$LN_FT .ft \\*[$LN_FT]
. el .ft \\n[.sty]
. ie d$LN_SIZE_CHANGE .ps \\*[$LN_SIZE_CHANGE]
. el .ps \\n[.s]
. ie d$LN_COLOR .COLOR \\*[$LN_COLOR]
. el .gcolor \\n[.m]
.END
\#
.MAC RESTORE_PARAMS END
. fam
. ft
. ps
. gcolor
.END
\#
\# Whether, at COLLATE, to reset line number to 1.
\#
\# NUMBER LINES PER SECTION
\# ------------------------
\# *Argument:
\# none
\# *Function:
\# Sets register that determines whether, at COLLATE, to reset
\# line number to 1.
\# *Notes:
\# The default is to continue the line numbering from where it
\# left off.
\#
.MAC NUMBER_LINES_PER_SECTION END
. nr #PER_SECTION 1
.END
\#
\# NUMBER QUOTE AND BLOCKQUOTE LINES AS PART OF RUNNING TEXT
\# ---------------------------------------------------------
\# *Argument:
\# <gutter> | <anything>
\# *Function:
\# Sets #(B)QUOTE_LN to 1 if no argument, or a single numeric
\# argument, is given; otherwise, turns (BLOCK)QUOTE linenumbering
\# off.
\# *Notes:
\# #(B)QUOTE is checked for in QUOTE and BLOCKQUOTE.
\# The single numeric argument allows establishing a different gutter from
\# the one used for line numbers in running text.
\#
.MAC NUMBER_QUOTE_LINES END
. ie \\n[#NUM_ARGS]=0 .nr #QUOTE_LN 1
. el \{\
. ie \B'\\$1' \{\
. nr #QUOTE_LN 1
. nr #Q_LN_GUTTER \\$1
. \}
. el \{\
. ie '\\$1'SILENT' .nr #SILENT_QUOTE_LN 1
. el \{\
. rr #QUOTE_LN
. rr #SILENT_QUOTE_LN
. \}
. \}
. \}
.END
\#
.MAC NUMBER_BLOCKQUOTE_LINES END
. ie \\n[#NUM_ARGS]=0 .nr #BQUOTE_LN 1
. el \{\
. ie \B'\\$1' \{\
. nr #BQUOTE_LN 1
. nr #BQ_LN_GUTTER \\$1
. \}
. el \{\
. ie '\\$1'SILENT' .nr #SILENT_BQUOTE_LN 1
. el \{\
. rr #BQUOTE_LN
. rr #SILENT_BQUOTE_LN
. \}
. \}
. \}
.END
\#
\# OUTPUT BLANK PAGES
\# ------------------
\# *Argument:
\# <number of blank pages to output> [ DIVIDER [ NULL ] ]
\# *Function:
\# Outputs blank pages.
\# *Notes:
\# If recto/verso, each page is recto/verso, even if there's
\# nothing on it.
\#
\# The 1st argument to BLANKPAGE is non-optional. DIVIDER is for
\# blank pages before endnotes, bibliographies, tocs, new chapters.
\#
.MAC BLANKPAGE END
. nr #BLANKPAGE 1
. nr #HOW_MANY \\$1
. shift
. nr #PAGES 0 1
. if \\n[#LINENUMBERS] \{\
. nr #LINENUMBERS_WERE_ON 1
. NUMBER_LINES OFF
. \}
. while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
. if \\n[#HEADERS_ON]=1 \{\
. nr #HEADERS_WERE_ON 1
. HEADERS OFF
. \}
. if \\n[#PAGE_NUM_V_POS]=1 \{\
. if \\n[#PAGINATE]=1 .nr #PAGINATE_WAS_ON 1
. nr #RESTORE_PN_V_POS \\n[#PAGE_NUM_V_POS]
. PAGINATION OFF
. \}
. if \\n[#COLUMNS]=1 .nr #COLUMNS +1
. NEWPAGE \" Break to blank page
. nop \&
. br
. if \\n[#FOOTERS_ON]=1 \{\
. nr #FOOTERS_WERE_ON 1
. FOOTERS OFF
. \}
. if \\n[#PAGE_NUM_V_POS]=2 \{\
. if \\n[#PAGINATE]=1 .nr #PAGINATE_WAS_ON 1
. nr #RESTORE_PN_V_POS \\n[#PAGE_NUM_V_POS]
. PAGINATION OFF
. \}
. if !'\\$1'DIVIDER' .if \\n[#HEADERS_WERE_ON] .HEADERS
. \}
. if \\n[#COLUMNS]=2 .nr #COLUMNS -1
. NEWPAGE \" Break to text page
. ie '\\$1'DIVIDER' \{\
. if \\n[#BLANKPAGE_AFTER_DEFER] .bp
. if \\n[#FOOTERS_WERE_ON] .FOOTERS
. if \\n[#RESTORE_PN_V_POS] \{\
. if \\n[#PAGINATE_WAS_ON] .PAGINATE
. nr #PAGE_NUM_V_POS \\n[#RESTORE_PN_V_POS]
. \}
. if \\n[#HEADERS_WERE_ON] .HEADERS
. shift
. if '\\$1'NULL' .nr #PAGE_NUM_ADJ -\\n[#HOW_MANY]
. \}
. el \{\
. if '\\$1'' \{\
. if \\n[#FOOTERS_WERE_ON] .FOOTERS
. if \\n[#RESTORE_PN_V_POS] \{\
. if \\n[#PAGINATE_WAS_ON] .PAGINATE
. nr #PAGE_NUM_V_POS \\n[#RESTORE_PN_V_POS]
. \}
. \}
. if '\\$1'NULL' \{\
. if \\n[#FOOTERS_WERE_ON] .FOOTERS
. if \\n[#RESTORE_PN_V_POS]=2 \
. nr #PAGE_NUM_V_POS \\n[#RESTORE_PN_V_POS]
. if \\n[#PAGE_NUM_V_POS]=2 \
. if \\n[#PAGINATE_WAS_ON] .PAGINATE
. nr #PAGE_NUM_ADJ -\\n[#HOW_MANY]
. \}
. \}
. if \\n[#PAGINATE]=1 \
. if \\n[#RESTORE_PN_V_POS]=1 \{\
. RESTORE_SPACE
. sp |\\n[#HEADER_MARGIN]u
. PRINT_PAGE_NUMBER
. \}
. if \\n[#LINENUMBERS_WERE_ON] .NUMBER_LINES RESUME
. rr #HOW_MANY
. rr #HEADERS_WERE_ON
. rr #FOOTERS_WERE_ON
. rr #PAGINATE_WAS_ON
. rr #RESTORE_PN_V_POS
.END
\#
\# FLOATS
\# ------
\#
.am PSPIC \" Need to do this for PSPIC inside a float
. vpt 0
\h'(\\n[ps-offset]u + \\n[ps-deswid]u)'
. sp -1
. vpt
..
\#
.MAC PROCESS_FLOATS END
. if \\n[#TAB_ACTIVE] \{\
. nr #RESTORE_TAB 1
. TQ
. \}
. if !\\n[tbl*no-top-hook] .tbl@top-hook
. rr tbl*no-top-hook
. sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
. if r pdfbx-defer \{\
. nr lead-diff \\n[#LEAD_AT_FOOTER]-\\n[.v]
. sp |\\n[t]u-\\n[.v]u+\\n[lead-diff]u
. rr pdfbx-defer
. \}
. nr defer-count \\n[defer]
. nr #TMP_PAGE_OFFSET \\n[.o]
. po \\n[#L_MARGIN]u
. ev protect
. evc FLOAT
. nf
. RESTORE_SPACE
. if '\\*[float*type:\\n[defer]]'boxed-tbl:\\n[defer]' \{\
. ch RR_@TOP
.\" Get depth of the first deferred float when there's more than one.
. if (\\n[.t] >= 1)&(\\n[float-depth:\\n[defer]] > (\\n[.t]+\\n[#DOC_LEAD])) \
. tbl*float-warning
. if \\n[#MLA] .sp \\n[tbl*label-lead-diff]u
. if (\\n[tbl*have-caption:\\n[defer]]=1)&(\\n[tbl*caption-after-label]=0) \
. sp \\n[tbl*caption-lead-diff]u
. if \\n[tbl*caption-after-label] \
. sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
. \}
. if \\n[float*pic:1] \{\
. if (\\n[pic*have-caption]=1)&(\\n[pic*caption-after-label]=0) \{\
. ie \\n[#COLUMNS] \
. sp |\\n[dc]u+\\n[pic*caption-lead-diff]u
. el .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u+\\n[pic*caption-lead-diff]u
. \}
. rr pic*caption-lead-diff
. rr pic*top-lead-diff
. rr float*pic
. \}
. if \\n[float*img:1] \{\
. ie \\n[#COLUMNS] \
. sp |\\n[dc]u
. el \
. sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
. if \\n[pdf-img:frame] \{\
. sp -(\\*[pdf-img:frame-weight]p*2u)
. rr pdf-img:frame
. \}
. \}
. if \\n[defers] .rr defers
. nr loop-count 0 1
. nr new-defer 0 1
. while \\n+[loop-count]<=\\n[defer-count] \{\
. nr tbl*no-top-hook 1
. rnn defer float*defer \" So '.if \n[defer]' is skipped during float output
. vpt
. ch RR_@TOP
. rr @TOP
. if \\n[pdf-img*have-caption] \
. if !\\n[pdf-img*caption-after-label] .sp -.5v
. rr pdf-img*have-caption
. rr pic*have-caption
. if '\\*[float*type:\\n[loop-count]]'table:\\n[loop-count]' \{\
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
. \}
. ie !\\n[float-span:\\n[loop-count]] \{\
. ie ((\\n[float-depth:\\n[loop-count]]-\\n[.v])>\\n[.t]):(\\n[D-float:\\n[loop-count]]>\\n[.t]):(\\n[defers]=1) \{\
.\" Insufficient space, defer to next page
. nr defers 1
. rn FLOAT*DIV:\\n[loop-count] NEW*FLOAT*DIV:\\n+[new-defer]
. rnn float-depth:\\n[loop-count] new-float-depth:\\n[new-defer]
. rnn D-float:\\n[loop-count] new-D-float:\\n[new-defer]
. \}
. el \{\
. output-float
. ie !r pdfboxed \{\
. ie (\\n[.t]-2)<(\\n[#DOC_LEAD]u/2) .SHIM_1
. el .sp .5
. \}
. el .rr pdfboxed
. \}
. \}
. el \{\
. rr tbl*no-top-hook
. if \\n[float-span:\\n[loop-count]] \
. rn tbl*header-div:\\n[loop-count] tbl*header-div:span
. ie !r pdfboxed \{\
. output-float
. sp .5
. \}
. el .rr pdfboxed
. \}
. if !\\n[loop-count]=\\n[defer-count] .rr flexed
. rr float-span:\\n[loop-count]
. rr float*tbl:\\n[loop-count]
. rr tbl*have-caption:\\n[loop-count]
. rr float*tbl*center:\\n[loop-count]
. rr tbl*have-header:\\n[loop-count]
. rm float*div:\\n[loop-count]
. rr float-depth:\\n[loop-count]
. rm tbl*header-div:\\n[loop-count]
. rm float*type:\\n[loop-count]
. \}
. if !\\n[float*defer]=1 \{\
. if !(\\n[loop-count]-1)=1 \{\
. if !\\n[.t]=1 .sp -.5
. \}
. \}
. if !\\n[@no-shim] \
. if !\\n[q-float] \
. if !\\n[#NO_SHIM] .SHIM
.\" FLOAT arrays are empty now
.\" Rename new arrays (FLOATs deferred to next page) to proper names
. rr float*defer
. rnn new-defer defer
. nr loop-count 0 1
. while \\n+[loop-count]<=\\n[defer] \{\
. rn NEW*FLOAT*DIV:\\n[loop-count] FLOAT*DIV:\\n[loop-count]
. rnn new-float-depth:\\n[loop-count] float-depth:\\n[loop-count]
. rnn new-D-float:\\n[loop-count] D-float:\\n[loop-count]
. \}
. if !\\n[#TMP_PAGE_OFFSET]=\\n[.o] .po \\n[#TMP_PAGE_OFFSET]u
. rr #TMP_PAGE_OFFSET
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
. if \\n[float-depth:1]>\\n[.t] .bp
. ie !\\n[#NO_SHIM] .SHIM
. el \{\
. if !\\n[#NO_FLEX] \
. if !\\n[flexed] .FLEX
. \}
. if !\\n[#NO_SHIM] \
. if \\n[#SHIM]>(\\n[#DOC_LEAD]-(\\n[#DOC_LEAD]/4)) \
' sp -\\n[#DOC_LEAD]u
. ie !\\n[flex:force] .ns
. el \{\
. rr flex:force
. if !\\n[#NO_FLEX] .FLEX
. \}
. nr tbl*have-header 0
. rr tbl*have-caption
. rr loop-count
. rr defer-count
. rr float*before-shim
. rr float*after-shim
. rm float-adj
. rr check-indent
. if \\n[#NEWPAGE] \{\
. vpt
' bp
. rr #NEWPAGE
. \}
. rr float*img
. rr float*eqn
. rr float*tbl
. rr float*pic
. if \\n[#RESTORE_TAB] \{\
. TAB \\n[#CURRENT_TAB]
. rr #RESTORE_TAB
. \}
.END
\#
.MAC output-float END
. if \\n[float*img] \{\
. if \\n[loop-count]=1 .nr no-top-space:1 1
. \}
. vpt 0
. if \\n[.ns] \{\
. rs
. nop \&
. sp -1
. \}
. if \\n[no-top-space:1] \{\
. ie !\\n[#COLUMNS] \{\
. sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
. ns
. \}
. el .sp |\\n[dc]u
. if \\n[float*tbl:1] \{\
. if !\\n[no-top-space:1] .RESTORE_SPACE
. ie \\n[tbl*caption-top-lead-diff] \{\
. sp \\n[tbl*caption-top-lead-diff]u
. rr tbl*caption-top-lead-diff
. \}
. el \{\
. if '\\*[float*type:1]'boxed-tbl:1' \{\
. ie (\\n[tbl*have-caption]=1)&(\\n[tbl*caption-after-label]=0) .sp .3n
. el .sp (\\n[#DOC_LEAD]u/2u)+.3n
. \}
. \}
. rr float*tbl:1
. \}
. if \\n[float*img:1] \{\
. RESTORE_SPACE
. if \\n[pdf-img*caption-top-lead-diff] \{\
. sp \\n[pdf-img*caption-top-lead-diff]u
. rr pdf-img*caption-top-lead-diff
. \}
. \}
. \}
. if \\n[float*pic] \{\
. nr pic*top-space-adj \\n[#DOC_LEAD]-\\n[pic@text-lead]
. if (\\n[pic*have-caption]=0):(\\n[pic*caption-after-label]=1) \
. sp \\n[pic*top-space-adj]u
. if \\n[#COLUMNS] \
. if !'\\*[pic*space-adj:\\n[loop-count]]'' \
. sp \\*[pic*space-adj:\\n[loop-count]]
. \}
. nf
. if \\n[q-float] \
. if !\\n[has-caption] .sp \\n[#Q_LEAD_DIFF]u
. if \\n[Q-float]=2 .sp |\\n[t]u-.5v
. ns
. vpt
. if \\n[check-indent] \{\
. if \\n[#INDENT_LEFT_ACTIVE] \{\
. in \\n[#L_INDENT]u/2u
. \}
. \}
. rr no-top-space:1
. if \\n[loop-count]>1 \{\
. if !'\\*[float-adj:\\n[loop-count]]'' \{\
. rs
. sp \\*[float-adj:\\n[loop-count]]
. ns
. nr restore-v-pos 1
. \}
. \}
. nr check-indent 1
. FLOAT*DIV:\\n[loop-count]
. if \\n[no-top-space:1] \
. RESTORE_SPACE
. if \\n[restore-v-pos] \{\
. sp -\\*[float-adj:\\n[loop-count]]
. rm float-adj:\\n[loop-count]
. rr restore-v-pos
. \}
. if r float*img:1 \{\
. sp .5
. rr float*img:1
. \}
. if r Q-float:1 \{\
. if !\\n[#FULLSPACE_QUOTES] .sp -.5
. rr Q-float:1
. \}
. if \\n[#COLUMNS] \
. if !'\\*[pic*space-adj:\\n[loop-count]]'' \
. sp -\\*[pic*space-adj:\\n[loop-count]]
. rm pic*space-adj:\\n[loop-count]
. if \\n[D-float:1] .rr D-float:1
. rr D-float
. rr @no-shim
. rr q-float
. rm B_QUOTE
. rm P_QUOTE
.END
\#
\# FLOAT
\# -----
\# *Arguments:
\# [ ADJUST +|-<amount> ] [ FORCE] [ SPAN] [ NO_SHIM] | [ NO_FLEX ] [ TARGET ] | <anything>
\# *Function:
\# Captures input in a diversion, which is output immediately if
\# there's room on the page; otherwise outputs diversion at top of
\# next page.
\# *Notes:
\# ADJUST allows for raising or lowering the contents of
\# the diversion within the space allotted. FORCE breaks to
\# a new page immediately.
\#
\#
.MAC FLOAT END
. nr ll-pre-float \\n[.l]
. if \\n[#NUM_ARGS]>0 \{\
. nr loop-count 0 1
. nr loop-counter \\n[#NUM_ARGS]
. while \\n+[loop-count]<=\\n[loop-counter] \{\
. if '\\$1'FORCE' \{\
. nr #FORCE 1
. shift
. \}
. if '\\$1'SPAN' \{\
. nr float-span 1
. shift
. \}
. if '\\$1'ADJUST' \{\
. shift
. ds float-adj \\$1
. shift
. \}
. if '\\$1'CENTER' \{\
. nr center-float 1
. shift
. \}
. if '\\$1'CENTRE' \{\
. nr center-float 1
. shift
. \}
. if '\\$1'INDENT' \{\
. shift
. nr indent-float \\$1
. shift
. \}
. if '\\$1'RIGHT' \{\
. nr right-float 1
. shift
. \}
. if '\\$1'NO_SHIM' \{\
. nr @no-shim 1
. shift
. \}
. if '\\$1'NO_FLEX' \{\
. nr @no-flex 1
. shift 1
. \}
. if '\\$1'TARGET' \{\
. shift
. ds float*target "\\$1
. shift 1
. \}
. \}
. \}
. ie \\n[float*started] .rr float*started
. el \{\
. while !'\\$1'' .shift 1
. nr float*started 1
. \}
. ie '\\$1'' \{\
.\" Harmonize floats treated as defers and floats proper to the top
.\" of the next page between passes when flex is enabled.
.\"
.\" Without this, floats near the bottom of the page may be deferred
.\" on the first pass, but when flex-spacing moves the line just
.\" before the float to the bottom of the page, the upcoming .br
.\" causes the float to be proper to the next page instead of
.\" deferred to it.
. nr floatnum +1
. ie !\\n[#NO_FLEX] \{\
.\" Only on 2nd pass
. if !dPDF.EXPORT \{\
. ie d float\\n[floatnum]:no-defer .br
. el \{\
.\" .v in the following is arbitrary. Groff rounds down decimal
.\" fractions so flex-spacing may be slightly short. Since there
.\" are no conditions under which a .t-1 (bottom margin) < .v
.\" on the 1st pass doesn't cause a float to be deferred, all floats
.\" on the second pass that meet the condition are also, correctly,
.\" deferred.
. if (\\n[.t]-1)<\\n[.v] \
. if !\\n[@TOP] .nr no-break 1
. \}
. \}
.\" Only on 1st pass
. ie !\\n[no-break] \{\
. ds pre-float:page@col \\n%@\\n[#COL_NUM]
. br
. ds post-float:page@col \\n%@\\n[#COL_NUM]
. if dPDF.EXPORT \{\
. if !'\\*[pre-float:page@col]'\\*[post-float:page@col]' \
. tm .ds float\\n[floatnum]:no-defer 1
. \}
. \}
. el .rr no-break
. \}
. el .br
. if \\n[nl]=\\n[#PAGE_TOP] \
. RESTORE_SPACE
. ds ev-pre-float \\n[.ev]
. ev FLOAT
. evc \\*[ev-pre-float]
. if \\n[.u] .nr fill-pre-float 1 \" Needed for tbl
. di FLOAT*DIV
. if !'\\*[float*target]'' .PDF_TARGET "\\*[float*target]
. rm float*target
. nf
. \}
. el \{\
. br
.\" So @no-shim persists if float output with output-float
. if r @no-shim .nr float*no-shim 1
. if \\n[float-span] \{\
. nr span 1
\!. rr span
. \}
\!. rm tbl*header-div:span
\!. nr tbl*no-print-header 1
. di
. if \\n[float-span] \{\
. nr dn-save \\n[dn]
. da FLOAT*DIV
\!. rr float-span
. da
. nr dn \\n[dn-save]
. rr dn-save
. \}
. ie \\n[float*tbl] \
. if !\\n[tbl*have-header] .ev 0
. el .ev 0
. if \\n[tbl*boxed] \{\
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#DOC_LEAD]u
. ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u+\\n[#DOC_LEAD]u
. ie !\\n[#MLA] \{\
. ie (\\n[tbl@label]=1):(\\n[tbl@source]=1):(\\n[tbl*autolabel]=1) .nr dn -.65v
. el .nr dn +.65v
. rr tbl@label
. rr tbl@source
. \}
. el .if !\\n[tbl@source] .nr dn -1.65v
. \}
.\" Defer float
. if (\\n[dn]>\\n[.t]):(\\n[D-float]>\\n[.t]):(\\n[defer]>0) \{\
. if !\\n[float-span] \{\
. if (\\n[dn]+(\\n[.v]*2)>(\\n[.p]-\\n[#TOP_MARGIN]-\\n[#DOC_LEAD]-\\n[#B_MARGIN])) \{\
. tm1 "[mom]: Floated element exceeds page depth.
. ab [mom]: Aborting '\\n[.F]' at line \\n[.c].
. \}
. \}
.\" Save depth of diversion here. The .da zeroes it.
. nr dn-save \\n[dn]
. if \\n[#FLEX_ACTIVE] \{\
. if !\\n[@no-flex] \{\
. da FLOAT*DIV
\!. FLEX
\!. nr flexed 1
. da
. \}
. \}
. nr dn \\n[dn-save]
. rr dn-save
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
. ev 0
. ie \\n[@TOP] \{\
. br
. if \\n[tbl*boxed] .rs
. rr tbl*boxed
. \}
. el \{\
. if !\\n[defer] .nr defer 0 1
. rn FLOAT*DIV FLOAT*DIV:\\n+[defer]
. if !'\\*[float-adj]'' \
. rn float-adj float-adj:\\n[defer]
. if \\n[float-span] \
. if !\\n[tbl*boxed] .rnn float-span float-span:\\n[defer]
. if \\n[float*tbl] \{\
. if \\n[defer]>0 \{\
. nr no-top-space:\\n[defer] 1
. nr float*tbl:\\n[defer] 1
. if \\n[tbl*have-caption] \
. nr tbl*have-caption:\\n[defer] 1
. \}
. ie \\n[tbl*boxed] \
. ds float*type:\\n[defer] boxed-tbl:\\n[defer]
. el .ds float*type:\\n[defer] table:\\n[defer]
. if \\n[tbl*center] .nr float*tbl-center:\\n[defer] 1
. if \\n[tbl*have-header] .rnn tbl*have-header tbl*have-header:\\n[defer]
. rn tbl*header-div tbl*header-div:\\n[defer]
. rr tbl*center
. \}
. if \\n[float*eqn] \{\
. if \\n[defer]=1 .nr no-top-space:\\n[defer] 1
. ds float*type:\\n[defer] eqn
. \}
. if \\n[float*pic] \{\
. ds float*type:\\n[defer] pic
. nr float*pic:\\n[defer] 1
. rn pic*space-adj pic*space-adj:\\n[defer]
. \}
. if \\n[float*img] \{\
. ds float*type:\\n[defer] img
. nr float*img:\\n[defer] 1
. nr no-top-space:\\n[defer] 1
. \}
. if \\n[D-float] .nr D-float:\\n[defer] \\n[D-float]
. if \\n[Q-float] .nr Q-float:\\n[defer] \\n[#Q-float]
. nr float-depth:\\n[defer] \\n[dn]
. if \\n[#FORCE] \{\
. ie \\n[#COLUMNS] .COL_NEXT
. el .NEWPAGE
. rr #FORCE
. \}
. if \\n[tbl*boxed] .rr tbl*boxed
. if \\n[table] .rr table
. br
. return \" output div after header
. \}
. \}
. nr dn-save \\n[dn]
. if \\n[#FLEX_ACTIVE] \{\
. if !\\n[@no-flex] \{\
. da FLOAT*DIV
\!. FLEX
\!. nr flexed 1
. da
. \}
. \}
. nr dn \\n[dn-save]
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
. vpt 0
. if !'\\*[float-adj]'' .sp \\*[float-adj]
. if \\n[.u] .nr fill 1
. if \\n[@TOP] \{\
. nr no-adjust 1
. rr @TOP
. \}
. if \\n[float*tbl] \{\
. if (\\n[#MLA]=1)&(\\n[tbl@source]=0) \
. chop FLOAT*DIV
. if \\n[nl]=\\n[#PAGE_TOP] \{\
. ie (\\n[tbl*have-caption]=1)&(\\n[tbl*caption-after-label]=0) \{\
. ie !\\n[#MLA] .sp \\n[tbl*caption-lead-diff]u
. el .ch RR_@TOP
. \}
. el \{\
. ev protect
. evc FLOAT
. nf
. rs
. ie \\n[tbl*boxed] .sp |\\n[#PAGE_TOP]u+.3n
. el .sp |\\n[#PAGE_TOP]u-.25v
. \}
. \}
. \}
. if \\n[float*img] \
. if \\n[pdf-img:frame] \
. sp -(\\*[pdf-img:frame-weight]p*2u)
. if !'\\n[.ev]'protect' \{\
. ev protect
. evc FLOAT
' nf
. \}
. if \\n[float*tbl] \{\
. if \\n[tbl*boxed] \
. if \\n[tbl*center] \
. if \\n[#L_INDENT] \
. in -\\n[#L_INDENT]u/2u
. \}
. if \\n[center-float] \
. in (\\n[.l]u-\\n[dl]u)/2u
. if \\n[indent-float] \
. in \\n[indent-float]u
. if \\n[right-float] \
. in \\n[.l]u-\\n[dl]u
. FLOAT*DIV
. if (\\n[center-float]>0):(\\n[indent-float]>0):(\\n[right-float]>0) \
. in
. ev
. if \\n[float*tbl] \{\
. rr tbl*no-print-header
. ie \\n[tbl*boxed] \{\
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
. ie \\n[nl]>(\\n[.p]+\\n[#VARIABLE_FOOTER_POS]) \{\
. ie \\n[#COLUMNS] .COL_NEXT
. el .NEWPAGE
. \}
. el \{\
. if \\n[dn-save]=\\n[bx-tbl-depth] .sp .35v
. rr dn-save
. if !\\n[tbl*plain-boxed] \{\
. if !\\n[tbl*autolabel] \{\
. if !\\n[#MLA] \{\
. if \\n[tbl@label]=1 .sp .5
. \}
. \}
. \}
. rr tbl*boxed
. rr bx-tbl-depth
. \}
. \}
. el \{\
. if !'\\*[tbl*label]'' \
. if \\n[tbl*autolabel]=0 .sp .5
. \}
. rr float*tbl
. rr tbl*center
. rm tbl*header-div
. rr tbl*have-caption
. rr tbl*have-label
. rr tbl*have-source
. rm tbl*caption
. rm tbl*label
. rm tbl*source
. \}
. if \\n[float*img] \
. if (\\n[.t]-1)>(\\n[#DOC_LEAD]u/2u) .sp .5
. if \\n[D-float] \{\
. ie \\n[dn]=0 .sp \\n[D-float]u+\\n[#DOC_LEAD]u
. el \
. if \\n[dn]<\\n[D-float] \
. sp \\n[D-float]u+\\n[#DOC_LEAD]u-\\n[dn]u
.\" Flex won't grab .h of D-floats without a dummy text line.
. vpt 0
. nop \&
. sp -1
. vpt 1
. \}
. if \\n[fill] \{\
. fi
. rr fill
. \}
. rm FLOAT*DIV
. if !'\\*[float-adj]'' \
. if !\\n[no-adjust] .sp -\\*[float-adj]
. vpt
. if \\n[Q-float] \{\
. sp .5
. rr Q-float
. \}
. if !\\n[#NO_SHIM] \
. if !\\n[@no-shim] .SHIM
. rm float-adj
. rm no-adjust
. rr center-float
. rr indent-float
. rr right-float
. rr D-float
. rr @no-shim
. rr @no-flex
. rr #FORCE
. rm P_QUOTE
. rm B_QUOTE
. if \\n[float*img] .rr float*img
. if \\n[float*pic] .rr float*pic
. if \\n[float*eqn] .rr float*eqn
. rr float*target
. rm float*target
. if \\n[#NO_SHIM] \
. if !\\n[#NO_FLEX] .nr post-float 1
. ev \\*[ev-pre-float]
. rr fill-pre-float
. rm ev-pre-float
. \}
.END
\#
\# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
\# ---------------------------------------
\# *Arguments:
\# <none>
\# *Function:
\# Sets header/footer/footnotes/etc... traps.
\#
\# TRAPS calculates the number of lines that actually fit on a
\# page based on #B_MARGIN and resets page bottom trap to coincide
\# with the depth of that number of lines, or, if #ADJ_DOC_LEAD=1,
\# adjusts #DOC_LEAD so that the last line of text on a page falls
\# exactly on #B_MARGIN.
\#
.MAC RR_@TOP END \" Trap-invoked after first line of text on a new page
. rr @TOP
. if \\n[.ns] \{\
. vpt 0
. rs
. if \\n[.u] .nr fill 1
. nf
. nop \&
. sp -1
. if \\n[fill] .fi
. if r #NEWPAGE .rr #NEWPAGE
. \}
. if \\n[.vpt]=0 .vpt
.END
\#
.MAC TRAPS END
. if !\\n[#UNADJUSTED_DOC_LEAD] .nr #UNADJUSTED_DOC_LEAD \\n[#DOC@LEAD]
.\" Remove all header/footer traps
. if !\\n[#NO_TRAP_RESET] \{\
. ch DO_T_MARGIN
. ch DO_B_MARGIN
. ch HEADER
. ch FOOTER
. ch FN_OVERFLOW_TRAP
.\" Plant header trap
. wh 0 HEADER
. \}
.\" Adjust lead so last line of text falls on B_MARGIN
. nr #LINES_PER_PAGE 0 1
. nr #DOC_LEAD_ADJ 0 1
. nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#ORIGINAL_B_MARGIN]-\\n[#DOC_LEAD]
.\" Get the number of unadjusted lines that fit on the page; always a
.\" bit short of the bottom margin
. while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
.
. \}
. nr #LINES_PER_PAGE -1
.\" Add machine units, 1 at a time, increasing the leading until the
.\" new leading fills the page properly
. while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<=\\n[#DEPTH_TO_B_MARGIN] \{\
.
. \}
. DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
.\" The "visual" bottom margin is what \n[nl] would report on the
.\" last line before the FOOTER trap is sprung
. nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD])
.\" Get the difference between #B_MARGIN and #VISUAL_B_MARGIN
. nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
.\" Set #B_MARGIN to 1 machine unit lower on the page than #VISUAL_B_MARGIN
. nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
.\" Set the FN_OVERFLOW_TRAP position
. nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]-\\n[#FN_LEAD]
. if \\n[#PRINT_STYLE]=1 .nr #FN_OVERFLOW_TRAP_POS \\n[#ORIGINAL_B_MARGIN]u
.\" Set footer and footnote overflow traps
. if !\\n[#NO_TRAP_RESET] \{\
. nr #FN_COUNT 0 1
. nr #SPACE_REMAINING 0
. nr #FN_DEPTH 0
. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
. wh \\n[.p]u FOOTER
. wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
. ch FOOTER -\\n[#B_MARGIN]u
. \}
.END
\#
\# CHECK INDENT
\# ------------
\# *Arguments:
\# <none>
\# *Function:
\# Adds left, right, or both indent values to document elements
\# like heads and subheads that are processed in environments.
\#
.MAC CHECK_INDENT END
. if \\n[#INDENT_LEFT_ACTIVE] \{\
. in \\n[#L_INDENT]u
. if \\n[#QUOTE] \{\
. in -\\n[#L_INDENT]u \"Because we added an indent in 2nd line of macro
. ll -\\n[#L_INDENT]u
. ta \\n[.l]u
. \}
. if \\n[#EPIGRAPH] \{\
. in -\\n[#L_INDENT]u
. ll -\\n[#L_INDENT]u
. ta \\n[.l]u
. \}
. \}
. if \\n[#INDENT_RIGHT_ACTIVE] \{\
. ll -\\n[#R_INDENT]u
. ta \\n[.l]u
. \}
. if \\n[#INDENT_BOTH_ACTIVE] \{\
. in \\n[#BL_INDENT]u
. ll -\\n[#BR_INDENT]u
. ta \\n[.l]u
. if \\n[#QUOTE] \{\
. in -\\n[#BL_INDENT]u
. ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
. ll -\\n[#BR_INDENT]u
. ta \\n[.l]u
. \}
. el \{\
. ll -(\\n[#BR_INDENT]u/2u)
. ta \\n[.l]u
. \}
. \}
. if \\n[#EPIGRAPH] \{\
. in -\\n[#BL_INDENT]u
. ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
. ll -\\n[#BR_INDENT]u
. ta \\n[.l]u
. \}
. el \{\
. ll -(\\n[#BR_INDENT]u/2u)
. ta \\n[.l]u
. \}
. \}
. \}
.END
\#
\# REMOVE INDENT
\# -------------
\# *Arguments:
\# <none>
\# *Function:
\# Removes left, right, or both indent values from document elements
\# like heads and subheads that are processed in environments.
\#
.MAC REMOVE_INDENT END
. in 0
. ll \\n[#L_LENGTH]u
. ta \\n[.l]u
.END
\#
\# This .em (for all DOC_TYPEs, except 4 [LETTER]) ensures that
\# deferred footnotes and floats that happen on the 2nd to last page
\# get output, and the last page/col isn't flexed.
\#
.MAC TERMINATE END
. if dPDF.EXPORT .tm .ds last-page \\n%@\\n[#COL_NUM]
. ie \\n[#FN_DEPTH] \{\
. ie \\n[#FN_DEFER] \{\
. br
. nr #TERMINATE 1
. FOOTNOTE
. nf
. FOOTNOTE OFF
. \}
. el \{\
. br
. ch FN_OVERFLOW_TRAP
. FOOTER
. \}
. \}
. el \{\
. br
. ch FN_OVERFLOW_TRAP
. FOOTER
. \}
. if \\n[defer] \
' bp
.END
\#
\# END MACRO FOR LETTERS
\# ---------------------
\# *Arguments:
\# none
\# *Function:
\# The .em macro executed at the end of letters. Turns footers
\# and pagination off, terminates and outputs diversion CLOSING
\# (indented with the author's name underneath).
\#
.MAC ALL_DONE END
. ch FOOTER
. ch HEADER
. br
. if \\n[#DOC_TYPE]=4 \{\
. if !'\\n[.z]'' \{\
. br
. ALD \\*[$SIG_SPACE]
. di
. \}
. IQ CLEAR
. TQ
. LEFT
. ie !'\\*[$CLOSE_INDENT]'' .IL \\*[$CLOSE_INDENT]
. el .IL \\n[#DOC_L_LENGTH]u/2u
. sp
. if \\n[#CLOSING] \{\
. CLOSING_TEXT
. br
. \}
. PRINT \\*[$AUTHOR_1]
. \}
.END
\#
\# Set up a default papersize of US letter
\#
.PAGEWIDTH 8.5i
.PAGELENGTH 11i
\#
\# ====================================================================
\#
\# +++DOCUMENT PROCESSING ALIASES+++
\#
\# Create aliases to make life easier for users: synonyms, short forms
\# and alternate spellings.
\#
.ALIAS CITATION BLOCKQUOTE
.ALIAS CITE BLOCKQUOTE
.ALIAS DOC_R_MARGIN DOC_RIGHT_MARGIN
.ALIAS DOC_L_MARGIN DOC_LEFT_MARGIN
.ALIAS DOC_L_LENGTH DOC_LINE_LENGTH
.ALIAS DOC_RMARGIN DOC_RIGHT_MARGIN
.ALIAS DOC_LMARGIN DOC_LEFT_MARGIN
.ALIAS DOC_LLENGTH DOC_LINE_LENGTH
.ALIAS DOC_FAM DOC_FAMILY
.ALIAS DOC_LS DOC_LEAD
.ALIAS DOC_PS DOC_PT_SIZE
.ALIAS FILL QUAD
.ALIAS PAGENUM PAGENUMBER
.ALIAS PAGINATION PAGINATE
.ALIAS PP_FT PP_FONT
.ALIAS TOC_PS TOC_PT_SIZE
\#
\# HEADER and FOOTER macros
\# ------------------------
\# Because the type-style of headers and footers are managed
\# identically, and the type-style macros (_<type parameter>) all
\# require the correct name of the calling macro, it's necessary
\# to create HEADER_ and FOOTER_ macros here that are basically
\# aliases with an argument.
\#
.MAC FOOTER_CENTER_COLOR END
. HDRFTR_CENTER_COLOR \\$1
.END
\#
.MAC FOOTER_CENTER_COLOUR END
. HDRFTR_CENTER_COLOR \\$1
.END
\#
.MAC FOOTER_CENTER_FAM END
. HDRFTR_CENTER_FAMILY \\$1
.END
\#
.MAC FOOTER_CENTER_FAMILY END
. HDRFTR_CENTER_FAMILY \\$1
.END
\#
.MAC FOOTER_CENTER_FONT END
. HDRFTR_CENTER_FONT \\$1
.END
\#
.MAC FOOTER_CENTER_FT END
. HDRFTR_CENTER_FONT \\$1
.END
\#
.MAC FOOTER_CENTER_PS END
. HDRFTR_CENTER_SIZE \\$1
.END
\#
.MAC FOOTER_CENTER_SIZE END
. HDRFTR_CENTER_SIZE \\$1
.END
\#
.MAC FOOTER_CENTRE_CAPS END
. HDRFTR_CENTER_CAPS \\$1
.END
\#
.MAC FOOTER_CENTRE_COLOR END
. HDRFTR_CENTER_COLOR \\$1
.END
\#
.MAC FOOTER_CENTRE_COLOUR END
. HDRFTR_CENTER_COLOR \\$1
.END
\#
.MAC FOOTER_CENTRE_FAM END
. HDRFTR_CENTER_FAMILY \\$1
.END
\#
.MAC FOOTER_CENTRE_FAMILY END
. HDRFTR_CENTER_FAMILY \\$1
.END
\#
.MAC FOOTER_CENTRE_FONT END
. HDRFTR_CENTER_FONT \\$1
.END
\#
.MAC FOOTER_CENTRE_FT END
. HDRFTR_CENTER_FONT \\$1
.END
\#
.MAC FOOTER_CENTRE_PS END
. HDRFTR_CENTER_SIZE \\$1
.END
\#
.MAC FOOTER_CENTRE_SIZE END
. HDRFTR_CENTER_SIZE \\$1
.END
\#
.MAC FOOTER_COLOR END
. HDRFTR_COLOR \\$1
.END
\#
.MAC FOOTER_COLOUR END
. HDRFTR_COLOR \\$1
.END
\#
.MAC FOOTER_FAM END
. HDRFTR_FAMILY \\$1
.END
\#
.MAC FOOTER_FAMILY END
. HDRFTR_FAMILY \\$1
.END
\#
.MAC FOOTER_LEFT_COLOR END
. HDRFTR_LEFT_COLOR \\$1
.END
\#
.MAC FOOTER_LEFT_COLOUR END
. HDRFTR_LEFT_COLOR \\$1
.END
\#
.MAC FOOTER_LEFT_FAM END
. HDRFTR_LEFT_FAMILY \\$1
.END
\#
.MAC FOOTER_LEFT_FAMILY END
. HDRFTR_LEFT_FAMILY \\$1
.END
\#
.MAC FOOTER_LEFT_FONT END
. HDRFTR_LEFT_FONT \\$1
.END
\#
.MAC FOOTER_LEFT_FT END
. HDRFTR_LEFT_FONT \\$1
.END
\#
.MAC FOOTER_LEFT_PS END
. HDRFTR_LEFT_SIZE \\$1
.END
\#
.MAC FOOTER_LEFT_SIZE END
. HDRFTR_LEFT_SIZE \\$1
.END
\#
.MAC FOOTER_RIGHT_COLOR END
. HDRFTR_RIGHT_COLOR \\$1
.END
\#
.MAC FOOTER_RIGHT_COLOUR END
. HDRFTR_RIGHT_COLOR \\$1
.END
\#
.MAC FOOTER_RIGHT_FAM END
. HDRFTR_RIGHT_FAMILY \\$1
.END
\#
.MAC FOOTER_RIGHT_FAMILY END
. HDRFTR_RIGHT_FAMILY \\$1
.END
\#
.MAC FOOTER_RIGHT_FONT END
. HDRFTR_RIGHT_FONT \\$1
.END
\#
.MAC FOOTER_RIGHT_FT END
. HDRFTR_RIGHT_FONT \\$1
.END
\#
.MAC FOOTER_RIGHT_PS END
. HDRFTR_RIGHT_SIZE \\$1
.END
\#
.MAC FOOTER_RIGHT_SIZE END
. HDRFTR_RIGHT_SIZE \\$1
.END
\#
.MAC FOOTER_RULE_COLOR END
. HDRFTR_RULE_COLOR \\$1
.END
\#
.MAC FOOTER_SIZE END
. HDRFTR_SIZE \\$1
.END
\#
.MAC HEADER_CENTER_COLOR END
. HDRFTR_CENTER_COLOR \\$1
.END
\#
.MAC HEADER_CENTER_COLOUR END
. HDRFTR_CENTER_COLOR \\$1
.END
\#
.MAC HEADER_CENTER_FAM END
. HDRFTR_CENTER_FAMILY \\$1
.END
\#
.MAC HEADER_CENTER_FAMILY END
. HDRFTR_CENTER_FAMILY \\$1
.END
\#
.MAC HEADER_CENTER_FONT END
. HDRFTR_CENTER_FONT \\$1
.END
\#
.MAC HEADER_CENTER_FT END
. HDRFTR_CENTER_FONT \\$1
.END
\#
.MAC HEADER_CENTER_PS END
. HDRFTR_CENTER_SIZE \\$1
.END
\#
.MAC HEADER_CENTER_SIZE END
. HDRFTR_CENTER_SIZE \\$1
.END
\#
.MAC HEADER_CENTRE_COLOR END
. HDRFTR_CENTER_COLOR \\$1
.END
\#
.MAC HEADER_CENTRE_COLOUR END
. HDRFTR_CENTER_COLOR \\$1
.END
\#
.MAC HEADER_CENTRE_FAM END
. HDRFTR_CENTER_FAMILY \\$1
.END
\#
.MAC HEADER_CENTRE_FAMILY END
. HDRFTR_CENTER_FAMILY \\$1
.END
\#
.MAC HEADER_CENTRE_FONT END
. HDRFTR_CENTER_FONT \\$1
.END
\#
.MAC HEADER_CENTRE_FT END
. HDRFTR_CENTER_FONT \\$1
.END
\#
.MAC HEADER_CENTRE_PS END
. HDRFTR_CENTER_SIZE \\$1
.END
\#
.MAC HEADER_CENTRE_SIZE END
. HDRFTR_CENTER_SIZE \\$1
.END
\#
.MAC HEADER_COLOR END
. HDRFTR_COLOR \\$1
.END
\#
.MAC HEADER_COLOUR END
. HDRFTR_COLOR \\$1
.END
\#
.MAC HEADER_FAM END
. HDRFTR_FAMILY \\$1
.END
\#
.MAC HEADER_FAMILY END
. HDRFTR_FAMILY \\$1
.END
\#
.MAC HEADER_LEFT_COLOR END
. HDRFTR_LEFT_COLOR \\$1
.END
\#
.MAC HEADER_LEFT_COLOUR END
. HDRFTR_LEFT_COLOR \\$1
.END
\#
.MAC HEADER_LEFT_FAM END
. HDRFTR_LEFT_FAMILY \\$1
.END
\#
.MAC HEADER_LEFT_FAMILY END
. HDRFTR_LEFT_FAMILY \\$1
.END
\#
.MAC HEADER_LEFT_FONT END
. HDRFTR_LEFT_FONT \\$1
.END
\#
.MAC HEADER_LEFT_FT END
. HDRFTR_LEFT_FONT \\$1
.END
\#
.MAC HEADER_LEFT_PS END
. HDRFTR_LEFT_SIZE \\$1
.END
\#
.MAC HEADER_LEFT_SIZE END
. HDRFTR_LEFT_SIZE \\$1
.END
\#
.MAC HEADER_RIGHT_COLOR END
. HDRFTR_RIGHT_COLOR \\$1
.END
\#
.MAC HEADER_RIGHT_COLOUR END
. HDRFTR_RIGHT_COLOR \\$1
.END
\#
.MAC HEADER_RIGHT_FAM END
. HDRFTR_RIGHT_FAMILY \\$1
.END
\#
.MAC HEADER_RIGHT_FAMILY END
. HDRFTR_RIGHT_FAMILY \\$1
.END
\#
.MAC HEADER_RIGHT_FONT END
. HDRFTR_RIGHT_FONT \\$1
.END
\#
.MAC HEADER_RIGHT_FT END
. HDRFTR_RIGHT_FONT \\$1
.END
\#
.MAC HEADER_RIGHT_PS END
. HDRFTR_RIGHT_SIZE \\$1
.END
\#
.MAC HEADER_RIGHT_SIZE END
. HDRFTR_RIGHT_SIZE \\$1
.END
\#
.MAC HEADER_RULE_COLOR END
. HDRFTR_RULE_COLOR \\$1
.END
\#
.MAC HEADER_SIZE END
. HDRFTR_SIZE \\$1
.END
\#
\# Aliases for other HEADER and FOOTER macros.
\#
.ALIAS BIBLIOGRAPHY_FOOTER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
.ALIAS BIBLIOGRAPHY_FOOTER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTER
.ALIAS BIBLIOGRAPHY_HEADER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
.ALIAS BIBLIOGRAPHY_HEADER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTER
.
.ALIAS ENDNOTES_FOOTER_CENTER ENDNOTES_HDRFTR_CENTER
.ALIAS ENDNOTES_FOOTER_CENTRE ENDNOTES_HDRFTR_CENTER
.ALIAS ENDNOTES_HEADER_CENTER ENDNOTES_HDRFTR_CENTER
.ALIAS ENDNOTES_HEADER_CENTRE ENDNOTES_HDRFTR_CENTER
.
.ALIAS FOOTER_CENTER HDRFTR_CENTER
.ALIAS TOC_PAGEFOOTER_CENTER HDRFTR_CENTER
.ALIAS TOC_PAGEFOOTER_CENTRE HDRFTR_CENTER
.ALIAS FOOTER_CENTER_CAPS _HDRFTR_CAPS
.ALIAS FOOTER_CENTER_PAD HDRFTR_CENTER_PAD
.ALIAS FOOTER_CENTER_SMALLCAPS _HDRFTR_SMALLCAPS
.ALIAS FOOTER_CENTRE HDRFTR_CENTER
.ALIAS FOOTER_CENTRE_CAPS _HDRFTR_CAPS
.ALIAS FOOTER_CENTRE_PAD HDRFTR_CENTER_PAD
.ALIAS FOOTER_CENTRE_SMALLCAPS _HDRFTR_SMALLCAPS
.ALIAS FOOTER_LEFT HDRFTR_LEFT
.ALIAS FOOTER_LEFT_CAPS _HDRFTR_CAPS
.ALIAS FOOTER_LEFT_SMALLCAPS _HDRFTR_SMALLCAPS
.ALIAS FOOTER_PLAIN HDRFTR_PLAIN
.ALIAS FOOTER_RECTO HDRFTR_RECTO
.ALIAS FOOTER_RIGHT HDRFTR_RIGHT
.ALIAS FOOTER_RIGHT_CAPS _HDRFTR_CAPS
.ALIAS FOOTER_RIGHT_SMALLCAPS _HDRFTR_SMALLCAPS
.ALIAS FOOTER_RULE HDRFTR_RULE
.ALIAS FOOTER_RULE_GAP HDRFTR_RULE_GAP
.ALIAS FOOTER_VERSO HDRFTR_VERSO
.
.ALIAS HEADER_CENTER HDRFTR_CENTER
.ALIAS TOC_PAGEHEADER_CENTER HDRFTR_CENTER
.ALIAS TOC_PAGEHEADER_CENTRE HDRFTR_CENTER
.ALIAS HEADER_CENTER_CAPS _HDRFTR_CAPS
.ALIAS HEADER_CENTER_PAD HDRFTR_CENTER_PAD
.ALIAS HEADER_CENTER_SMALLCAPS _HDRFTR_SMALLCAPS
.ALIAS HEADER_CENTRE HDRFTR_CENTER
.ALIAS HEADER_CENTRE_CAPS _HDRFTR_CAPS
.ALIAS HEADER_CENTRE_PAD HDRFTR_CENTER_PAD
.ALIAS HEADER_CENTRE_SMALLCAPS _HDRFTR_SMALLCAPS
.ALIAS HEADER_LEFT HDRFTR_LEFT
.ALIAS HEADER_LEFT_CAPS _HDRFTR_CAPS
.ALIAS HEADER_LEFT_SMALLCAPS _HDRFTR_SMALLCAPS
.ALIAS HEADER_PLAIN HDRFTR_PLAIN
.ALIAS HEADER_RECTO HDRFTR_RECTO
.ALIAS HEADER_RIGHT HDRFTR_RIGHT
.ALIAS HEADER_RIGHT_CAPS _HDRFTR_CAPS
.ALIAS HEADER_RIGHT_SMALLCAPS _HDRFTR_SMALLCAPS
.ALIAS HEADER_RULE HDRFTR_RULE
.ALIAS HEADER_RULE_GAP HDRFTR_RULE_GAP
.ALIAS HEADER_VERSO HDRFTR_VERSO
.
.ALIAS SWITCH_FOOTERS SWITCH_HDRFTR
.ALIAS SWITCH_HEADERS SWITCH_HDRFTR
\#
\# Create type-style aliases for tags, titles, and page elements
\#
\# These are used for creating aliases with while loops
\#
.ds ELEMENT_TYPE_1 BIBLIOGRAPHY_STRING
.ds ELEMENT_TYPE_2 BIBLIOGRAPHY_HEADER
.ds ELEMENT_TYPE_3 BLOCKQUOTE
.ds ELEMENT_TYPE_4 CITATION
.ds ELEMENT_TYPE_5 CITE
.ds ELEMENT_TYPE_6 ENDNOTES_HEADER
.ds ELEMENT_TYPE_7 ENDNOTE_STRING
.ds ELEMENT_TYPE_8 EPIGRAPH
.ds ELEMENT_TYPE_9 HDRFTR_CENTER
.ds ELEMENT_TYPE_10 HDRFTR_LEFT
.ds ELEMENT_TYPE_11 HDRFTR_RIGHT
.ds ELEMENT_TYPE_12 LINENUMBER
.ds ELEMENT_TYPE_13 PAGENUM
.ds ELEMENT_TYPE_14 QUOTE
.ds ELEMENT_TYPE_15 TOC_HEADER
.ds ELEMENT_TYPE_16 CODE
.ds ELEMENT_TYPE_17 FINIS
.ds ELEMENT_TYPE_18 COPYRIGHT
\#
\# Create aliases for _FAMILY
.ALIAS BIBLIOGRAPHY_FAMILY _FAMILY
.ALIAS COVER_FAMILY _FAMILY
.ALIAS DOCHEADER_FAMILY _FAMILY
.ALIAS DOC_COVER_FAMILY _FAMILY
.ALIAS ENDNOTE_FAMILY _FAMILY
.ALIAS ENDNOTE_LINENUMBER_FAMILY _FAMILY
.ALIAS ENDNOTE_NUMBER_FAMILY _FAMILY
.ALIAS ENDNOTE_STRING_FAMILY _FAMILY
.ALIAS ENDNOTE_TITLE_FAMILY _FAMILY
.ALIAS FOOTNOTE_FAMILY _FAMILY
.ALIAS HDRFTR_FAMILY _FAMILY
.ALIAS PAGENUMBER_FAMILY _FAMILY
.ALIAS TOC_FAMILY _FAMILY
.ALIAS TOC_PAGENUMBER_FAMILY _FAMILY
.ALIAS TOC_PN_FAMILY _FAMILY
.ALIAS TOC_TITLE_FAMILY _FAMILY
\#
.nr #LOOP 0 1
.while \n+[#LOOP]<=18 \{\
. ALIAS \*[ELEMENT_TYPE_\n[#LOOP]]_FAMILY _FAMILY
.\}
\# Covers, docheader
.nr #LOOP 0 1
.while \n+[#LOOP]<=12 \{\
. ALIAS \*[TITLE_TYPE_\n[#LOOP]]_FAMILY _FAMILY
. ALIAS COVER_\*[TITLE_TYPE_\n[#LOOP]]_FAMILY _FAMILY
. ALIAS DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_FAMILY _FAMILY
.\}
\#
\# Create aliases for _FONT
.ALIAS BIBLIOGRAPHY_FONT _FONT
.ALIAS ENDNOTE_FONT _FONT
.ALIAS ENDNOTE_LINENUMBER_FONT _FONT
.ALIAS ENDNOTE_NUMBER_FONT _FONT
.ALIAS ENDNOTE_TITLE_FONT _FONT
.ALIAS FOOTNOTE_FONT _FONT
.ALIAS TOC_PN_FONT _FONT
\#
.nr #LOOP 0 1
.while \n+[#LOOP]<=18 \{\
. ALIAS \*[ELEMENT_TYPE_\n[#LOOP]]_FONT _FONT
.\}
\# Covers, docheader
.nr #LOOP 0 1
.while \n+[#LOOP]<=12 \{\
. ALIAS \*[TITLE_TYPE_\n[#LOOP]]_FONT _FONT
. ALIAS COVER_\*[TITLE_TYPE_\n[#LOOP]]_FONT _FONT
. ALIAS DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_FONT _FONT
.\}
\#
\# Create aliases for _SIZE
.ALIAS ENDNOTE_LINENUMBER_SIZE _SIZE
.ALIAS ENDNOTE_NUMBER_SIZE _SIZE
.ALIAS ENDNOTE_TITLE_SIZE _SIZE
.ALIAS FOOTNOTE_SIZE _SIZE
.ALIAS HDRFTR_SIZE _SIZE
.ALIAS TOC_PN_SIZE _SIZE
\#
.nr #LOOP 0 1
.while \n+[#LOOP]<=18 \{\
. ALIAS \*[ELEMENT_TYPE_\n[#LOOP]]_SIZE _SIZE
.\}
\# Covers, docheader
.nr #LOOP 0 1
.while \n+[#LOOP]<=12 \{\
. ALIAS \*[TITLE_TYPE_\n[#LOOP]]_SIZE _SIZE
. ALIAS COVER_\*[TITLE_TYPE_\n[#LOOP]]_SIZE _SIZE
. ALIAS DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_SIZE _SIZE
.\}
\#
\# Create aliases for TITLE_LEAD
.nr #LOOP 0 1
.while \n+[#LOOP]<=12 \{\
. ALIAS \*[TITLE_TYPE_\n[#LOOP]]_LEAD TITLE_LEAD
. ALIAS COVER_\*[TITLE_TYPE_\n[#LOOP]]_LEAD TITLE_LEAD
. ALIAS DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_LEAD TITLE_LEAD
.\}
\#
\# Create aliases for _UNDERLINE
.ALIAS BIBLIOGRAPHY_HEADER_UNDERLINE _UNDERLINE
.ALIAS BIBLIOGRAPHY_HEADER_UNDERSCORE _UNDERLINE
.ALIAS BIBLIOGRAPHY_STRING_UNDERLINE _UNDERLINE
.ALIAS BIBLIOGRAPHY_STRING_UNDERSCORE _UNDERLINE
.ALIAS BIB_STRING_UNDERLINE _UNDERLINE
.ALIAS ENDNOTES_HEADER_UNDERLINE _UNDERLINE
.ALIAS ENDNOTES_HEADER_UNDERSCORE _UNDERLINE
.ALIAS ENDNOTES_STRING_UNDERLINE _UNDERLINE
.ALIAS ENDNOTES_STRING_UNDERSCORE _UNDERLINE
.ALIAS ENDNOTE_TITLE_UNDERLINE _UNDERLINE
.ALIAS ENDNOTE_TITLE_UNDERSCORE _UNDERLINE
.ALIAS EN_STRING_UNDERLINE _UNDERLINE
.ALIAS EN_STRING_UNDERSCORE _UNDERLINE
.ALIAS TOC_HEADER_UNDERLINE _UNDERLINE
.ALIAS TOC_HEADER_UNDERSCORE _UNDERLINE
\#
.nr #LOOP 0 1
.while \n+[#LOOP]<=12 \{\
. ALIAS \*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE _UNDERLINE
. ALIAS \*[TITLE_TYPE_\n[#LOOP]]_UNDERSCORE _UNDERLINE
. ALIAS COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE _UNDERLINE
. ALIAS COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERSCORE _UNDERLINE
. ALIAS DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERLINE _UNDERLINE
. ALIAS DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_UNDERSCORE _UNDERLINE
.\}
\#
\# Create aliases for _COLOR
.ALIAS BIBLIOGRAPHY_HEADER_COLOR _COLOR
.ALIAS COVER_COLOR _COLOR
.ALIAS DOCHEADER_COLOR _COLOR
.ALIAS ENDNOTE_TITLE_COLOR _COLOR
.ALIAS FINIS_COLOR _COLOR
.ALIAS FOOTNOTE_COLOR _COLOR
.ALIAS HDRFTR_COLOR _COLOR
.ALIAS HDRFTR_RULE_COLOR _COLOR
.ALIAS LINEBREAK_COLOR _COLOR
.ALIAS SECTION_COLOR _COLOR
\#
.nr #LOOP 0 1
.while \n+[#LOOP]<=18 \{\
. ALIAS \*[ELEMENT_TYPE_\n[#LOOP]]_COLOR _COLOR
.\}
\# Covers, docheader
.nr #LOOP 0 1
.while \n+[#LOOP]<=12 \{\
. ALIAS \*[TITLE_TYPE_\n[#LOOP]]_COLOR _COLOR
. ALIAS COVER_\*[TITLE_TYPE_\n[#LOOP]]_COLOR _COLOR
. ALIAS DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_COLOR _COLOR
.\}
\#
\# Create aliases for _CAPS
.ALIAS BIBLIOGRAPHY_HEADER_CAPS _CAPS
.ALIAS BIBLIOGRAPHY_STRING_CAPS _CAPS
.ALIAS ENDNOTE_TITLE_CAPS _CAPS
\#
.nr #LOOP 0 1
.while \n+[#LOOP]<=12 \{\
. ALIAS \*[TITLE_TYPE_\n[#LOOP]]_CAPS _CAPS
. ALIAS COVER_\*[TITLE_TYPE_\n[#LOOP]]_CAPS _CAPS
. ALIAS DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_CAPS _CAPS
.\}
\#
\# Create aliases for _SMALLCAPS
.ALIAS BIBLIOGRAPHY_HEADER_SMALLCAPS _SMALLCAPS
.ALIAS BIBLIOGRAPHY_STRING_SMALLCAPS _SMALLCAPS
.ALIAS ENDNOTE_TITLE_SMALLCAPS _SMALLCAPS
.ALIAS HDRFTR_CENTER_SMALLCAPS _SMALLCAPS
.ALIAS HDRFTR_LEFT_SMALLCAPS _SMALLCAPS
.ALIAS HDRFTR_RIGHT_SMALLCAPS _SMALLCAPS
\#
.nr #LOOP 0 1
.while \n+[#LOOP]<=12 \{\
. ALIAS \*[TITLE_TYPE_\n[#LOOP]]_SMALLCAPS _SMALLCAPS
. ALIAS COVER_\*[TITLE_TYPE_\n[#LOOP]]_SMALLCAPS _SMALLCAPS
. ALIAS DOC_COVER_\*[TITLE_TYPE_\n[#LOOP]]_SMALLCAPS _SMALLCAPS
.\}
\#
\# Create aliases for _QUAD
.ALIAS BIBLIOGRAPHY_HEADER_QUAD _QUAD
.ALIAS BIBLIOGRAPHY_QUAD _QUAD
.ALIAS BIBLIOGRAPHY_STRING_QUAD _QUAD
.ALIAS BLOCKQUOTE_QUAD _QUAD
.ALIAS COPYRIGHT_QUAD _QUAD
.ALIAS COVER_COPYRIGHT_QUAD _QUAD
.ALIAS COVER_MISC_QUAD _QUAD
.ALIAS COVER_QUAD _QUAD
.ALIAS DOCHEADER_QUAD _QUAD
.ALIAS DOC_COVER_COPYRIGHT_QUAD _QUAD
.ALIAS DOC_COVER_MISC_QUAD _QUAD
.ALIAS DOC_COVER_QUAD _QUAD
.ALIAS DOC_QUAD _QUAD
.ALIAS ENDNOTES_HEADER_QUAD _QUAD
.ALIAS ENDNOTE_QUAD _QUAD
.ALIAS ENDNOTE_STRING_QUAD _QUAD
.ALIAS ENDNOTE_TITLE_QUAD _QUAD
.ALIAS EPIGRAPH_QUAD _QUAD
.ALIAS FOOTNOTE_QUAD _QUAD
.ALIAS MISC_QUAD _QUAD
.ALIAS TOC_HEADER_QUAD _QUAD
\#
\# Support aliases
\#
.ALIAS COL_BREAK COL_NEXT
.ALIAS DOC_COVER COVER
.ALIAS DOC_COVERS COVERS
.ALIAS DOC_COVERTITLE COVERTITLE
.ALIAS DOC_COVER_COUNTS_PAGES COVER_COUNTS_PAGES
.ALIAS DOC_COVER_LEAD COVER_LEAD
.ALIAS DOC_DOC_COVERTITLE COVERTITLE
.ALIAS DO_DOC_COVER DO_COVER
.ALIAS PRINT_FOOTNOTE_RULE FOOTNOTE_RULE
\#
\# Miscellaneous aliases
.ALIAS SECTION LINEBREAK
.ALIAS SECTION_CHAR LINEBREAK_CHAR
\#
\# Miscellaneous macros to take care of backward compatibility
\# -----------------------------------------------------------
\#
\# As of 1.1.9, EL and TN got changed to make TRAP...TRAP OFF
\# unnecessary for users. However, I used both macros extensively
\# throughout this file (in conjunction with TRAP...TRAP OFF).
\# EOL is the old EL; used only in om.tmac.
\#
.MAC EOL END
. if \\n[.vpt] \{\
. vpt 0
. nr #RESTORE_TRAP 1
. \}
. br
. sp -1v
. if \\n[#RESTORE_TRAP] \{\
. vpt
. rr #RESTORE_TRAP
. \}
.END
\#
\# PREPROCESSOR SUPPORT
\# ====================
\#
\# Utility macros--label and caption styles, lists collector, lists
\# generator.
\#
.nr lists*target 0 1
.
.MAC get-label-type END
. if \\n[all]=1 .ds label-type eqn
. if \\n[all]=2 .ds label-type pdf-img
. if \\n[all]=3 .ds label-type pic
. if \\n[all]=4 .ds label-type tbl
. if \\n[all]=5 .ds label-type floating
.END
\#
.MAC set-defaults END
. if '\\*[\\*[label-type]*\\*[spec-type]-family]'' \
. ds \\*[label-type]*\\*[spec-type]-family \\*[$DOC_FAM]\"
. if '\\*[\\*[label-type]*\\*[spec-type]-font]'' \
. ds \\*[label-type]*\\*[spec-type]-font R\"
. if '\\*[\\*[label-type]*\\*[spec-type]-size-change]'' \
. ds \\*[label-type]*\\*[spec-type]-size-change +0\"
. if !r \\*[label-type]*\\*[spec-type]-autolead \
. nr \\*[label-type]*\\*[spec-type]-autolead 2
. if '\\*[\\*[label-type]*\\*[spec-type]-space]'' \
. ds \\*[label-type]*\\*[spec-type]-space +0\"
. if '\\*[\\*[label-type]*\\*[spec-type]-color]'' \
. ds \\*[label-type]*\\*[spec-type]-color black\"
. if '\\*[\\*[label-type]*\\*[spec-type]-quad]'' \{\
. ie '\\*[label-type]'eqn' \{\
. if '\\*[spec-type]'caption' \
. ds \\*[label-type]*\\*[spec-type]-quad C\"
. \}
. el .ds \\*[label-type]*\\*[spec-type]-quad L\"
. \}
. if '\\n[\\*[label-type]*\\*[spec-type]-quad-on-ll]'' \
. nr \\*[label-type]*\\*[spec-type]-quad-on-ll 1
. if '\\*[spec-type]'caption' \
. nr default-left 1
.END
\#
.MAC set-inline-specs END
. ds \\*[label-type]*\\*[spec-type]-specs \
\f[\\*[\\*[label-type]*\\*[spec-type]-family]\\*[\\*[label-type]*\\*[spec-type]-font]]\
\s[\\*[\\*[label-type]*\\*[spec-type]-size-change]]\
\m[\\*[\\*[label-type]*\\*[spec-type]-color]]
.END
\#
\# Line lengths, indents, and quads for captions and labels.
\# Aliased for eqn, pic, pdf-image, and tbl.
\#
.MAC SET_QUAD END
. ds label-type \\$0
. substring label-type 0 2
. if '\\*[label-type]'PDF' .ds label-type pdf-img
. if '\\*[label-type]'TBL' .ds label-type tbl
. if '\\*[label-type]'PIC' .ds label-type pic
. if '\\*[label-type]'EQN' .ds label-type eqn
. ds spec-type \\$0
. substring spec-type -6 -10
. if '\\*[spec-type]'PTION' .ds spec-type caption
. if '\\*[spec-type]'LABEL' .ds spec-type label
. if '\\*[spec-type]'OURCE' .ds spec-type source
. QUAD \\$1
. ds \\*[label-type]*\\*[spec-type]-quad \\$1
. substring \\*[label-type]*\\*[spec-type]-quad 0 0
. if '\\*[label-type]'pdf-img' \{\
. if '\\*[\\*[label-type]*\\*[spec-type]-quad]'L' \{\
. if !\\n[pdf-img*\\*[spec-type]-quad-on-ll] \{\
. ie !'\\*[pdf-img:pos]'-R' \
. ll \\n[pdf-img:ind]u+\\n[pdf-img:width]u+\\n[pdf-img:frame-inset]u
. el .ll -\\n[ind-pre-img]u
. if '\\*[pdf-img:pos]'-C' \
. in \\n[pdf-img:ind]u-\\n[pdf-img:frame-inset]u
. if '\\*[pdf-img:pos]'-R' \
. in \\n[.l]u-(\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u))
. if '\\*[pdf-img:pos]'-I' \
. in \\n[pdf-img:ind]u
. \}
. \}
. if '\\*[\\*[label-type]*\\*[spec-type]-quad]'C' \{\
. if !\\n[pdf-img*\\*[spec-type]-quad-on-ll] \{\
. if '\\*[pdf-img:pos]'-L' \
. ll \\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u)
. if '\\*[pdf-img:pos]'-C' \{\
. ll (\\n[ll-pre-img]u-\\n[pdf-img:width]u/2u+(\\n[pdf-img:frame-inset]u))+\\n[pdf-img:width]u
. in \\n[.l]u-(\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u))
. \}
. if '\\*[pdf-img:pos]'-R' \{\
. ll -\\n[ind-pre-img]u
. in \\n[.l]u-(\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u))
. \}
. if '\\*[pdf-img:pos]'-I' \{\
. ll \\n[pdf-img:ind]u+\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u)
. in \\n[pdf-img:ind]u
. \}
. \}
. \}
. if '\\*[\\*[label-type]*\\*[spec-type]-quad]'R' \{\
. if !\\n[pdf-img*\\*[spec-type]-quad-on-ll] \{\
. if '\\*[pdf-img:pos]'-L' \
. ll \\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u]
. if '\\*[pdf-img:pos]'-C' \{\
. ll (\\n[.l]u-\\n[ind-pre-img]u-\\n[pdf-img:width]u/2u)+\\n[pdf-img:width]u+\\n[pdf-img:frame-inset]u
. in \\n[pdf-img:ind]u
. \}
. if '\\*[pdf-img:pos]'-R' \{\
. ll -\\n[ind-pre-img]u
. in \\n[.l]u-\\n[pdf-img:width]u
. \}
. if '\\*[pdf-img:pos]'-I' \{\
. ll \\n[pdf-img:ind]u+\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u)
. in \\n[pdf-img:ind]u
. \}
. \}
. \}
. \}
. if '\\*[label-type]'pic' \{\
. if !\\n[pic*\\*[spec-type]-quad-on-ll] \{\
. ie \\n[pic*left] .ll \\n[pic*div-width]u
. el \{\
. ll \\n[pic*div-width]u
. in (\\n[ll-pre-float]u-\\n[pic*div-width]u)/2u
. \}
. \}
. \}
. if '\\*[label-type]'tbl' \{\
. if !\\n[tbl*\\*[spec-type]-quad-on-ll] \{\
. ie \\n[tbl*center] \{\
. ie '\\*[spec-type]'label' \{\
.\" Differentiate between a tbl label and a float label
. ie !'\\*[ev-current]'FLOAT' \{\
. ll \\n[ll-pre-tbl]u-\\n[TW]u/2u+\\n[TW]u
. if \\n[tbl*have-header] \
. in (\\n[ll-pre-tbl]u-\\n[.i]u)-\\n[TW]u/2u+\\n[.i]u
. \}
. el \{\
. in \\n[ll-pre-tbl]u+\\n[.i]u-\\n[TW]u/2u
. ll \\n[.l]u-\\n[.i]u
. \}
. \}
. el \{\
. if '\\*[spec-type]'source' \{\
. ie \\n[float*tbl] \{\
. ll \\n[TW]u
\!. in \\n[ll-pre-tbl]u-\\n[TW]u/2u+\\n[tmp-ind]u
. \}
. el \{\
. ll \\n[TW]u+\\n[ind-pre-tbl]u
. ie \\n[ind-pre-tbl] \
\!. in \\n[ll-pre-tbl]u-\\n[TW]u/2u
. el \
\!. in \\n[ll-pre-tbl]u-\\n[TW]u/2u+\\n[tmp-ind]u
. \}
\!. ti -\\n[tmp-ind]u
. \}
. if '\\*[spec-type]'caption' \{\
. ll \\n[ll-pre-tbl]u+\\n[.i]u-\\n[TW]u/2u+\\n[TW]u
. in \\n[ll-pre-tbl]u+\\n[.i]u-\\n[TW]u/2u
. \}
. \}
. \}
. el \{\
. ll \\n[TW]u+\\n[.i]u
.\" Check the effect of setting a source in non-MLA mode.
. if '\\*[spec-type]'source' \{\
. if \\n[#MLA] \{\
. ie \\n[float*tbl] \{\
\!. ll \\n[TW]u+\\n[ind-pre-tbl]u
\!. in \\n[tmp-ind]u+\\n[ind-pre-tbl]u
\!. ti -\\n[tmp-ind]u
. \}
. el \{\
. ll \\n[TW]u+\\n[ind-pre-tbl]u
\!. in \\n[tmp-ind]u
\!. ti -\\n[tmp-ind]u
. \}
. \}
. \}
. \}
. \}
. \}
.END
\#
.ALIAS TBL*SET_CAPTION_QUAD SET_QUAD
.ALIAS TBL*SET_LABEL_QUAD SET_QUAD
.ALIAS TBL*SET_SOURCE_QUAD SET_QUAD
.ALIAS PDF_IMG*SET_CAPTION_QUAD SET_QUAD
.ALIAS PDF_IMG*SET_LABEL_QUAD SET_QUAD
.ALIAS PIC*SET_CAPTION_QUAD SET_QUAD
.ALIAS PIC*SET_LABEL_QUAD SET_QUAD
\#
.MAC style END
. ds label-type \\$0
. substring label-type 0 2
. if '\\*[label-type]'img' .ds label-type pdf-img
. if '\\*[label-type]'tbl' .ds label-type tbl
. if '\\*[label-type]'pic' .ds label-type pic
. ds spec-type \\$0
. substring spec-type 4 6
. if '\\*[spec-type]'cap' .ds spec-type caption
. if '\\*[spec-type]'lab' .ds spec-type label
. if '\\*[spec-type]'sou' .ds spec-type source
. ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
. el \{\
' fam \\*[\\*[label-type]*\\*[spec-type]-family]
' ft \\*[\\*[label-type]*\\*[spec-type]-font]
' ps \\n[#DOC_PT_SIZE]u\\*[\\*[label-type]*\\*[spec-type]-size-change]
. \m[\\*[\\*[label-type]*\\*[spec-type]-color]]
. \}
.END
\#
.ALIAS tbl*caption-style style
.ALIAS tbl*label-style style
.ALIAS tbl*source-style style
.ALIAS img*caption-style style
.ALIAS img*label-style style
.ALIAS img*source-style style
.ALIAS pic*caption-style style
.ALIAS pic*label-style style
.ALIAS pic*source-style style
\#
\# User style macros
\#
\# TYPE SPECS FOR LABELS, CAPTIONS, AND SOURCES
\# --------------------------------------------
\# Aliased as CAPTIONS and LABELS for eqn, pic, tbl, and pdf images.
\# *Arguments:
\# EQN | IMG | PIC | TBL | FLOATING \
\# Remaining arguments are optional
\# FAMILY fam \
\# FONT sty \
\# SIZE +|-size \
\# QUAD LEFT | CENTRE | RIGHT [ ON_LL ] \
\# COLOR color \
\# AUTOLEAD n \
\# ADJUST +|-n
\# *Function:
\# Sets type specs for captions, labels, and sources according to
\# calling alias name
\# *Notes:
\# SIZE is relative to running text.
\# QUAD optional arg says quad on full line length rather than
\# pdf-img or pre-processor output.
\#
.MAC CAPTION_LABEL_SPECS END
. if '\\$0'CAPTIONS' .ds spec-type caption
. if '\\$0'LABELS' .ds spec-type label
. if '\\$0'SOURCES' .ds spec-type source
. ds $LABEL-TYPE \\$1
. if '\\$1'EQN' .ds label-type eqn
. if '\\$1'FLOATING' .ds label-type floating
. if '\\$1'IMG' .ds label-type pdf-img
. if '\\$1'PIC' .ds label-type pic
. if '\\$1'TBL' .ds label-type tbl
. if '\\$1'ALL' .nr all 1
. shift
. nr loop-counter \\n[#NUM_ARGS]
. nr loop-count 0 1
. while \\n+[loop-count]<=\\n[loop-counter] \{\
. if '\\$1'FAMILY' \{\
. shift
. ie r all \{\
. nr all 0 1
. while \\n+[all]<=5 \{\
. get-label-type
. ds \\*[label-type]*\\*[spec-type]-family \\$1
. \}
. \}
. el .ds \\*[label-type]*\\*[spec-type]-family \\$1
. if \\n[#PRINT_STYLE]=1 \
. ds \\*[label-type]*\\*[spec-type]-family \\*[$TYPEWRITER_FAM]
. shift
. \}
. if '\\$1'FONT' \{\
. shift
. ie r all \{\
. nr all 0 1
. while \\n+[all]<=5 \{\
. get-label-type
. ds \\*[label-type]*\\*[spec-type]-font \\$1
. \}
. \}
. el .ds \\*[label-type]*\\*[spec-type]-font \\$1
. if \\n[#PRINT_STYLE]=1 \
. ds \\*[label-type]*\\*[spec-type]-font R
. shift
. \}
. if '\\$1'SIZE' \{\
. shift
. ie r all \{\
. nr all 0 1
. while \\n+[all]<=5 \{\
. get-label-type
. ds \\*[label-type]*\\*[spec-type]-size-change \\$1
. \}
. \}
. el .ds \\*[label-type]*\\*[spec-type]-size-change \\$1
. if \\n[#PRINT_STYLE]=1 \
. ds \\*[label-type]*\\*[spec-type]-size-change +0
. shift
. \}
. if '\\$1'AUTOLEAD' \{\
. shift
. ie r all \{\
. nr all 0 1
. while \\n+[all]<=5 \{\
. get-label-type
. nr \\*[label-type]*\\*[spec-type]-autolead (p;\\$1)
. \}
. \}
. el .nr \\*[label-type]*\\*[spec-type]-autolead (p;\\$1)
. shift
. \}
. if '\\$1'QUAD' \{\
. shift
. ie r all \{\
. nr all 0 1
. while \\n+[all]<=5 \{\
. get-label-type
. ds \\*[label-type]*\\*[spec-type]-quad \\$1
. substring \\*[label-type]*\\*[spec-type]-quad 0 0
. if '\\$2'ON_LL' \
. nr \\*[label-type]*\\*[spec-type]-quad-on-ll 1
. \}
. \}
. el \{\
. ds \\*[label-type]*\\*[spec-type]-quad \\$1
. substring \\*[label-type]*\\*[spec-type]-quad 0 0
. if \\n[\\*[label-type]*\\*[spec-type]-quad-on-ll] \
. rr \\*[label-type]*\\*[spec-type]-quad-on-ll
. if '\\$2'ON_LL' \
. nr \\*[label-type]*\\*[spec-type]-quad-on-ll 1
. \}
. ie '\\$2'ON_LL' .shift 2
. el .shift
. \}
. if '\\$1'COLOR' \{\
. shift
. ie r all \{\
. nr all 0 1
. while \\n+[all]<=5 \{\
. get-label-type
. ds \\*[label-type]*\\*[spec-type]-color \\$1
. \}
. \}
. el .ds \\*[label-type]*\\*[spec-type]-color \\$1
. if \\n[#PRINT_STYLE]=1 \
. ds \\*[label-type]*\\*[spec-type]-color black
. shift
. \}
. if '\\$1'ADJUST' \{\
. shift
. ie r all \{\
. nr all 0 1
. while \\n+[all]<=5 \{\
. get-label-type
. ds \\*[label-type]*\\*[spec-type]-space \\$1
. \}
. \}
. el .ds \\*[label-type]*\\*[spec-type]-space \\$1
. if \\n[#PRINT_STYLE]=1 \
. ds \\*[label-type]*\\*[spec-type]-space +0
. shift
. \}
. if '\\$1'INDENT' \{\
. shift
. ie '\\*[label-type]'floating' \{\
. ie \B'\\$1' \{\
. nr \\*[label-type]*\\*[spec-type]-indent-l \\$1
. shift
. \}
. el \{\
. ie '\\$1'RIGHT' \{\
. shift
. nr \\*[label-type]*\\*[spec-type]-indent-r \\$1
. shift
. \}
. el \{\
. tm1 \
"[mom]: Missing value for INDENT in macro '\\$0' at line \\n[.c].
. ab \
[mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. \}
. \}
. el \{\
. shift
. if !\\n[#SKIP_INDENT_WARNING] \{\
. tm1 \
"[mom]: '\\$0 \\*[$LABEL-TYPE]' at line \\n[.c] does not take an indent.
. tm1 \
" No indent(s) will be applied.
. nr #SKIP_INDENT_WARNING 1
. \}
. if '\\$1'INDENT' .shift
. if '\\$1'RIGHT' .shift
. if \B'\\$1' .shift
. \}
. \}
. \}
. ie r all \{\
. nr all 0 1
. while \\n+[all]<=5 \{\
. get-label-type
. set-defaults
. set-inline-specs
. \}
. \}
. el \{\
. set-defaults
. set-inline-specs
. \}
. ds revert-specs \f[]\s[0]\m[]
. rr #SKIP_INDENT_WARNING
. rr all
.END
.
.ALIAS CAPTIONS CAPTION_LABEL_SPECS
.ALIAS LABELS CAPTION_LABEL_SPECS
.ALIAS SOURCES CAPTION_LABEL_SPECS
\#
\# LABELS and CAPTIONS (floats and [block]quotes)
\# ----------------------------------------------
\# *Arguments:
\# <text of label or caption> [ CAPTION <text of caption> ] \
\# [ TO_LIST FIGURES | EQUATIONS | TABLES ]
\# *Function:
\# Add label/caption to float, quotes, and blockquotes
\# *Notes:
\# Aliased as CAPTION. If called as CAPTION, prints all
\# double-quoted text strings including ".br" or ".sp";
\# may come at top or bottom of labelled object, or both.
\# If called as LABEL, optional arg CAPTION attaches caption
\# text to the label; may only come at bottom of object and
\# can only take one double-quoted text string.
\#
\# These strings allow users to create labels of the form
\# 'Fig. \*[chapter].\*[fig-label]', e.g. 'Fig. 1.1'
\#
.ds chapter \\n[#CH_NUM]
.ds fig-label \\n+[fig*label-num]
.ds tbl-label \\n+[tbl*label-num]
.ds eqn-label \\n+[eqn*label-num]
\#
\#
.MAC LABEL END
. br
. if \\n[.ns] \{\
. vpt 0
. rs
. nop \&
. sp -1
. vpt
. \}
. if r chop-space .sp -1
. rr chop-space
. if \\n[#QUOTE] .nr q-float 1
. if '\\$0'CAPTION' \{\
. ds labelcap caption
. ds $FLOATING_CAPTION \\$*
. \}
. if '\\$0'LABEL' \{\
. ds labelcap label
. ds $FLOATING_LABEL \\$1
. shift
. nr loop-counter 0 1
. nr loop-count \\n[#NUM_ARGS]
. while \\n+[loop-counter]<=\\n[loop-count] \{\
. if '\\$1'CAPTION' \{\
. nr with-caption 1
. ds $FLOATING_CAPTION \\$2
. shift 2
. \}
. if '\\$1'SHORT_CAPTION' \{\
. ds $LIST_CAPTION \\$2
. shift 2
. \}
. if '\\$1'TO_LIST' \{\
. nr to-list 1
. if '\\$2'FIGURES' .ds $LIST_OF FIGURES
. if '\\$2'EQUATIONS' .ds $LIST_OF EQUATIONS
. if '\\$2'TABLES' .ds $LIST_OF TABLES
. shift 2
. \}
. \}
. \}
. if \\n[D-float] \
. if \\n[.d]>\\n[D-float] \
. sp \\n[.d]u-\\n[D-float]u
. rr has-\\*[labelcap]
. nr has-\\*[labelcap] 1
. rr @bottom
. if !\\n[.d]=0 .nr @bottom 1
. ds ev-current \\n[.ev]
. ev floating*labelcap
. evc \\*[ev-current]
. ps \\n[#DOC_PT_SIZE]u
. if \\n[floating*\\*[labelcap]-indent-l] \
. in \\n[floating*\\*[labelcap]-indent-l]u
. if \\n[floating*\\*[labelcap]-indent-r] \
. ll -\\n[floating*\\*[labelcap]-indent-r]u
. ds $QUAD_PREV \\*[$QUAD_VALUE]
. QUAD \\*[floating*\\*[labelcap]-quad]
.\" 1/4 space before both captions and labels
\!. if \\\\n[nl]=\\\\n[#PAGE_TOP] .nr deferred-float 1
. if !\\n[deferred-float] \{\
. ie !\\n[@bottom] \{\
. ie '\\n[.z]'' \
. sp \\n[#DOC_LEAD]u/4u
. el \
. if '\\n[.z]'FLOAT*DIV' .sp \\n[#DOC_LEAD]u/4u
. \}
. el \{\
. sp \\n[#DOC_LEAD]u/4u
. rr @bottom
. \}
. \}
\!. if \\\\n[deferred-float] \{\
. if !\\n[#QUOTE] .sp -(\\n[#DOC_LEAD]u/4u)
\!. \}
. nr floating*\\*[labelcap]-lead-diff \\n[.v]
. vs \\n[.ps]u+\\n[floating*\\*[labelcap]-autolead]u
. nr floating*\\*[labelcap]-lead-diff \
\\n[floating*\\*[labelcap]-lead-diff]-\\n[.v]
. if !\\n[deferred-float] \
. RESTORE_SPACE
. ie '\\*[labelcap]'label' \{\
. if \\n[to-list] \{\
.\" Strip prefix from label if list-type is being autolabelled
.\" Becomes $LIST_LABEL
. if '\\*[$LIST_OF]'FIGURES' \
. if r fig*label-num .STRIP_PRFX_SFFX "\\*[$FLOATING_LABEL]"
. if '\\*[$LIST_OF]'TABLES' \
. if r tbl*label-num .STRIP_PRFX_SFFX "\\*[$FLOATING_LABEL]"
. if '\\*[$LIST_OF]'EQUATIONS' \
. if r eqn*label-num .STRIP_PRFX_SFFX "\\*[$FLOATING_LABEL]"
. \}
. ds $FLOATING_LABEL \
\F[\\\\*[floating*label-family]]\
\f[\\\\*[floating*label-font]]\
\s[\\\\*[floating*label-size-change]]\
\m[\\\\*[floating*label-color]]\
\\*[$FLOATING_LABEL]
. \}
. el \{\
. if !\\n[deferred-float] \
. sp \\n[floating*caption-lead-diff]u
. if !'\\*[floating*caption-space]'' \
. sp \\*[floating*caption-space]
. while !'\\$1'' \{\
. nop \
\F[\\*[floating*caption-family]]\
\f[\\*[floating*caption-font]]\
\s[\\*[floating*caption-size-change]]\
\m[\\*[floating*caption-color]]\
\\$1
. if \\n[.u]=1 .br
. shift
. \}
. if !'\\*[floating*caption-space]'' \
. sp -\\*[floating*caption-space]
. \}
. if \\n[with-caption] \{\
. nr width-label \w'\\*[$FLOATING_LABEL]'
. if !\\n[width-label]=0 \
. as $FLOATING_LABEL \0
. as $FLOATING_LABEL \
\F[\\\\*[floating*caption-family]]\
\f[\\\\*[floating*caption-font]]\
\s[\\\\*[floating*caption-size-change]]\
\m[\\\\*[floating*caption-color]]\
\\*[$FLOATING_CAPTION]
. if '\\*[$LIST_CAPTION]'' \
. ds $LIST_CAPTION \\*[$FLOATING_CAPTION]
. \}
. if !'\\*[$FLOATING_LABEL]'' \{\
. sp \\n[floating*label-lead-diff]u
. if !'\\*[floating*label-space]'' \
. sp \\*[floating*label-space]
. nop \\*[$FLOATING_LABEL]
. if \\n[.u]=1 .br
. if !'\\*[floating*label-space]'' \
. sp -\\*[floating*label-space]
. \}
.\" 1/4 space after captions and labels
. ie !\\n[@bottom] \
. sp \\n[#DOC_LEAD]u/4u
. el \{\
. if '\\n[.z]'FLOAT*DIV' \{\
. sp \\n[#DOC_LEAD]u/4u
\!. if \\\\n[deferred-float] \
. sp -(\\n[#DOC_LEAD]u/4u)
. \}
. \}
\!. rr deferred-float
. ll
. vs
. QUAD \\*[$QUAD_PREV]
. in
. ev
. if \\n[to-list] \{\
. nr loop-counter 0 1
. nr loop-count 2
. ds labelcap label
. while \\n+[loop-counter]<=\\n[loop-count] \{\
. ds \\*[labelcap]-family \\*[floating*\\*[labelcap]-family]
. ds \\*[labelcap]-font \\*[floating*\\*[labelcap]-font]
. ds \\*[labelcap]-size-change \\*[floating*\\*[labelcap]-size-change]
. ds \\*[labelcap]-color \\*[floating*\\*[labelcap]-color]
. ie '\\*[$LISTS_FAM]'' \
. ds floating*\\*[labelcap]-family \\*[$DOC_FAM]
. el \
. ds floating*\\*[labelcap]-family \\*[$LISTS_FAM]
. if '\\*[$LISTS_FT]'' \
. ds floating*\\*[labelcap]-font R
. ds floating*\\*[labelcap]-size-change +0
. ds floating*\\*[labelcap]-color pdf:href.colour
. ds labelcap caption
. \}
. ie '\\*[$LIST_LABEL]'' .TO_\\*[$LIST_OF] "\\*[$FLOATING_LABEL]
. el .TO_\\*[$LIST_OF] "\\*[$LIST_LABEL]" "\\*[$LIST_CAPTION]
. rr to-list
. nr loop-counter 0 1
. nr loop-count 2
. ds labelcap label
. while \\n+[loop-counter]<=\\n[loop-count] \{\
. ds floating*\\*[labelcap]-family \\*[\\*[labelcap]-family]
. ds floating*\\*[labelcap]-font \\*[\\*[labelcap]-font]
. ds floating*\\*[labelcap]-size-change \\*[\\*[labelcap]-size-change]
. ds floating*\\*[labelcap]-color \\*[\\*[labelcap]-color]
. ds labelcap caption
. \}
. \}
. rr with-caption
. rm $FLOATING_CAPTION
. rm $FLOATING_LABEL
. rm $LIST_LABEL
. rm $LIST_CAPTION
.END
.
.ALIAS CAPTION LABEL
.
.MAC STRIP_PRFX_SFFX END
.\" Strip suffix from label string
. ds suffix \\$1
. substring suffix -1
.\" If suffix is '.' ',' ':' or ')', remove it.
. if '\\*[suffix]'.' .nr strip-suffix 1
. if '\\*[suffix]',' .nr strip-suffix 1
. if '\\*[suffix]':' .nr strip-suffix 1
. if '\\*[suffix]')' .nr strip-suffix 1
. if \\n[strip-suffix] \{\
. ds $LIST_LABEL \\$1
. substring $LIST_LABEL 0 -2
. \}
. rr strip-suffix
. if '\\*[$LIST_LABEL]'' .ds $LIST_LABEL \\$1
.\" Remove prefix (e.g. "Fig. ") by looping through $LIST_LABEL
.\" until a digit is encountered
. nr loop-counter 100 \" arbitrary
. nr loop-count 0 1
. while \\n+[loop-count]<=\\n[loop-counter] \{\
. substring $LIST_LABEL 1
. if \B'\\*[$LIST_LABEL]' .break
. \}
. substring $LIST_LABEL 1
.END
\#
\# CAPTION_AFTER_LABEL
\# -------------------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Sets register indicating non-MLA captions should come after labels.
\#
.MAC CAPTION_AFTER_LABEL END
. if '\\$1'IMG' .ds type pdf-img
. if '\\$1'PIC' .ds type pic
. if '\\$1'TBL' .ds type tbl
. if !\\n[#MLA] \{\
. nr \\*[type]*caption-after-label 1
. if '\\$1'ALL' \{\
. nr pdf-img*caption-after-label 1
. nr tbl*caption-after-label 1
. nr pic*caption-after-label 1
. \}
. if !'\\$2'' \{\
. ie !'\\$1'ALL' .rr \\*[type]*caption-after-label
. el \{\
. rr pdf-img*caption-after-label
. rr tbl*caption-after-label
. rr pic*caption-after-label
. \}
. \}
. \}
.END
\#
\# AUTOLABELLING
\# -------------
\# *Argument:
\# [ PREFIX <prefix> SUFFIX <suffix> ] | <anything>
\# *Function:
\# Turns label autonumbering on of off; optionally lets user set
\# prefix and suffix for labels.
\# *Notes:
\# Aliased for images (pdf), tbl, pic, and eqn.
\#
.MAC AUTOLABEL END
. if '\\$0'AUTOLABEL_EQUATIONS' .ds label-type eqn
. if '\\$0'AUTOLABEL_TABLES' .ds label-type tbl
. if '\\$0'AUTOLABEL_PIC' \{\
. ds label-type pic
. nr fig*autolabel 1
. \}
. if '\\$0'AUTOLABEL_IMAGES' \{\
. ds label-type pdf-img
. nr fig*autolabel 1
. \}
. if !'\\$1'' \{\
. ds \\*[label-type]-label-args \\$1
. substring \\*[label-type]-label-args -1 -3
. \}
. if '\\*[\\*[label-type]-label-args]'FIX' .nr \\*[label-type]-label-args 1
. if '\\*[\\*[label-type]-label-args]'TER' .nr \\*[label-type]-label-args 1
. if !\\n[\\*[label-type]*label-num] \
. nr \\*[label-type]*label-num 0 1
. if '\\*[label-type]'pdf-img' \
. if !\\n[fig*label-num] .nr fig*label-num 0 1
. if '\\*[label-type]'pic' \
. if !\\n[pic*label-num] .nr fig*label-num 0 1
. nr \\*[label-type]*autolabel 1
. nr loop-counter 0 1
. nr loop-count \\n[#NUM_ARGS]
. while \\n+[loop-counter]<=\\n[loop-count] \{\
. if '\\$1'PREFIX' \{\
. ds \\*[label-type]*label-prfx \\$2
. nr \\*[label-type]*label-prfx-set 1
. shift 2
. \}
. if '\\$1'SUFFIX' \{\
. ds \\*[label-type]*label-sffx \\$2
. nr \\*[label-type]*label-sffx-set 1
. shift 2
. \}
. if '\\$1'PREFIX_CHAPTER' \{\
. if \\n[fig*autolabel] .nr fig*label-with-chapter 1
. nr \\*[label-type]*label-with-chapter 1
. shift 1
. if \B'\\$1' \{\
. nr #CH_NUM \\$1
. shift
. \}
. \}
. \}
. if '\\*[\\*[label-type]*label-prfx]'' \{\
. if '\\*[label-type]'eqn' \
. if !\\n[\\*[label-type]*label-prfx-set] \
. ds \\*[label-type]*label-prfx (\"
. if '\\*[label-type]'pic' \
. if !\\n[\\*[label-type]*label-prfx-set] \
. ds \\*[label-type]*label-prfx Fig. \"
. if '\\*[label-type]'pdf-img' \
. if !\\n[\\*[label-type]*label-prfx-set] \
. ds \\*[label-type]*label-prfx Fig. \"
. if '\\*[label-type]'tbl' \
. if !\\n[\\*[label-type]*label-prfx-set] \
. ds \\*[label-type]*label-prfx Table \"
. \}
. if '\\*[\\*[label-type]*label-sffx]'' \{\
. if '\\*[label-type]'eqn' \
. if !\\n[\\*[label-type]*label-sffx-set] \
. ds \\*[label-type]*label-sffx )\"
. if '\\*[label-type]'pic' \
. if !\\n[\\*[label-type]*label-sffx-set] \
. ds \\*[label-type]*label-sffx .\"
. if '\\*[label-type]'pdf-img' \
. if !\\n[\\*[label-type]*label-sffx-set] \
. ds \\*[label-type]*label-sffx .\"
. if '\\*[label-type]'tbl' \
. if !\\n[\\*[label-type]*label-sffx-set] \
. ds \\*[label-type]*label-sffx .\"
. \}
. if \\n[\\*[label-type]-label-args]>0 \{\
. if \\n[\\*[label-type]*label-prfx-set]+\\n[\\*[label-type]*label-sffx-set]=1 \{\
. ie (\\n[\\*[label-type]*label-prfx-set]=1)&(\\n[\\*[label-type]*label-sffx-set]=0) \
. ds missing-arg SUFFIX
. el .ds missing-arg PREFIX
. tm1 "[mom]: You must supply a \\*[missing-arg] argument to \\$0.
. tm1 " If you wish the \\*[missing-arg] to be blank, use \\*[missing-arg] "".
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. \}
. if \\n[#NUM_ARGS]=1 \{\
. rr fig*autolabel
. rr \\*[label-type]*autolabel
. rr \\*[label-type]*label-prfx-set
. rr \\*[label-type]*label-sffx-set
. \}
. rr \\*[label-type]-label-args
.END
\#
.ALIAS AUTOLABEL_EQUATIONS AUTOLABEL
.ALIAS AUTOLABEL_IMAGES AUTOLABEL
.ALIAS AUTOLABEL_PIC AUTOLABEL
.ALIAS AUTOLABEL_TABLES AUTOLABEL
\#
\# SET AUTOLABEL NUMBER
\# --------------------
\# *Argument:
\# FIG | TBL | PIC | EQN <n>
\# *Function:
\# Sets the autolabel number for the corresponding label type.
\# *Notes:
\# Used to set autolabel number when manual labelling of floats
\# (in conjunction with TO_LIST) disrupts auto-incrementing.
\#
.MAC SET_AUTOLABEL END
. rm labelnum-type
. if '\\$1'FIG' .ds labelnum-type fig
. if '\\$1'TBL' .ds labelnum-type tbl
. if '\\$1'PIC' .ds labelnum-type pic
. if '\\$1'EQN' .ds labelnum-type eqn
. nr labelnum \\$2-1
. nr \\*[labelnum-type]*label-num \\n[labelnum] 1
.END
\#
\# MLA STYLE
\# ---------
\# *Argument:
\# <none> | <anything>
\# *Function:
\# Sets or removes register #MLA.
\# *Notes:
\# MLA formatting differs from other styles wrt caption and
\# label placement.
\#
.MAC MLA END
. ie '\\$1'' \{\
. nr #MLA 1
. nr pdf-img*caption-after-label 1
. nr pic*caption-after-label 1
. rr tbl*caption-after-label
. \}
. el \
. rr #MLA
.END
\#
.MAC mla@error END
. tm1 "[mom]: MLA style enabled, but \\$1 has no corresponding \\$2.
. ab [mom]: Aborting '\\$3' at \\$4, line \\$5.
.END
\#
\# LISTS_OF
\# --------
\# *Aliases:
\# LIST_OF_EQUATIONS
\# LIST_OF_FIGURES
\# LIST_OF_TABLES
\# *Arguments:
\# [ TITLE_STRING <string> ] [ START_PAGENUM <pagenumber> ]
\# *Function:
\# Generates lists-of based on calling alias.
\# *Notes:
\# Called at end of file.
\# If after TOC, and TOC is being auto-relocated, lists are also
\# relocated. If called before, lists are output at end of file.
\#
.MAC LISTS_OF END
. EOL
. ds $LIST_TYPE \\$0
. nr #LISTS 1
. substring $LIST_TYPE -1 -4
. if '\\*[$LIST_TYPE]'URES' \{\
. ds $LIST_TYPE FIGURES
. ds list-type fig
. ds label-type fig
. ds \\*[$LIST_TYPE]_TITLE_STRING "List of Figures
. \}
. if '\\*[$LIST_TYPE]'BLES' \{\
. ds $LIST_TYPE TABLES
. ds list-type tbl
. ds label-type tbl
. ds \\*[$LIST_TYPE]_TITLE_STRING "List of Tables
. \}
. if '\\*[$LIST_TYPE]'IONS' \{\
. ds $LIST_TYPE EQUATIONS
. ds list-type eqn
. ds label-type eqn
. ds \\*[$LIST_TYPE]_TITLE_STRING "List of Equations
. \}
. nr #LIST_OF_\\*[$LIST_TYPE] 1
. nr loop-count 0 1
. nr loop-counter \\n[#NUM_ARGS]
. while \\n+[loop-count]<=\\n[loop-counter] \{\
. if '\\$1'TITLE_STRING' \{\
. ds \\*[$LIST_TYPE]_TITLE_STRING \\$2
. shift 2
. \}
. if '\\$1'START_PAGENUM' \{\
. nr #\\*[$LIST_TYPE]_START_PAGENUM \\$2
. shift 2
. \}
. \}
. if dPDF.EXPORT \
. if \\n[#FLEX_ACTIVE] \
. if !\\n[#NO_FLEX] \
. tm .ds pre-list-\\n%@\\n[#COL_NUM] 1
. char \[leader] " .
. LEADER_CHARACTER \[leader]
. if \\n[#LINENUMBERS]=1 \{\
. NUMBER_LINES OFF
. nr #LINENUMBERS 2
. \}
. if \\n[#FINIS] \{\
. if \\n[#FOOTERS_WERE_ON] \
. FOOTERS
. \}
. if \\n[#FOOTERS_ON]=1 \{\
. if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
. ie \\n[#LISTS_NO_PAGENUM]=1 .PAGINATION OFF
. el .PAGINATE
. \}
. if \\n[#FOOTERS_WERE_ON] \
. if !\\n[#FINIS] .FOOTERS OFF
. rr #COLUMNS
. COLLATE
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#SINGLE_SPACE] .LS 24
. DOC_LEAD_ADJUST
. \}
. if \\n[#FINIS] \{\
. if \\n[#FOOTERS_WERE_ON] .FOOTERS
. rr #FOOTERS_WERE_ON
. if \\n[#PAGINATION_WAS_ON] \{\
. nr #PAGINATE 1
. rr #PAGINATION_WAS_ON
. \}
. rr #FINIS
. \}
. ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
. rm $HDRFTR_CENTER_OLD
. rm $HDRFTR_CENTER_NEW
. rr #COLLATED_DOC
. DOCTYPE DEFAULT
. DOCHEADER
. rr #DOCHEADER_ADVANCE
. TITLE "\\*[\\*[$LIST_TYPE]_TITLE_STRING]
. AUTHOR ""
. L_MARGIN \\n[#DOC_L_MARGIN]u
. LL \\n[#DOC_L_LENGTH]u
. if '\\*[$LISTS_FAM]'' \
. ds $LISTS_FAM \\*[$TOC_FAM]
. if '\\*[$LISTS_FT]'' \
. ds $LISTS_FT \\*[$TOC_TITLE_FT]
. if !\\n[#LISTS_PS] \
. nr #LISTS_PS \\n[#TOC_PS]
. ps \\n[#LISTS_PS]u
. if !\\n[#LISTS_LEAD] \
. nr #LISTS_LEAD \\n[#TOC_LEAD]
. if \\n[#PRINT_STYLE]=2 \{\
. ie \\n[#LISTS_LEAD_ADJUST]=1 \{\
. nr #DOC_LEAD \\n[#LISTS_LEAD]
. DOC_LEAD_ADJUST
. TRAPS
. \}
. el \{\
. nr #DOC_LEAD \\n[#LISTS_LEAD]
. DOC_LEAD_ADJUST OFF
. \}
. \}
. ie !'\\*[$LISTS_TITLE_QUAD]'' \
. DOCHEADER_QUAD \\*[$LISTS_TITLE_QUAD]
. el .DOCHEADER_QUAD \\*[$TOC_HEADER_QUAD]
. if !'\\*[$LISTS_TITLE_FAM]'' \
. TITLE_FAMILY \\*[$LISTS_TITLE_FAM]
. if !'\\*[$LISTS_TITLE_FT]'' \
. TITLE_FONT \\*[$LISTS_TITLE_FT]
. if !'\\*[$LISTS_TITLE_SIZE]'' \
. TITLE_SIZE \\*[$LISTS_TITLE_SIZE]
. if !'\\*[$LISTS_TITLE_COLOR]'' \
. TITLE_COLOR \\*[$LISTS_TITLE_COLOR]
. if \\n[#LISTS_TITLE_CAPS] \
. TITLE_CAPS
. if \\n[#LISTS_TITLE_SMALLCAPS] \
. TITLE_SMALLCAPS
. if \\n[#LISTS_TITLE_UNDERSCORE] \{\
. TITLE_UNDERSCORE \
\\*[DOUBLE] \
\\*[$LISTS_OF_UL_WT] \
\\*[$LISTS_OF_UL_GAP] \
\\*[$LISTS_OF_RULE_GAP]
. \}
. if '\\*[$LISTS_PN_FAM]'' \
. ds $LISTS_PN_FAM \\*[$TOC_PN_FAM]
. if '\\*[$LISTS_PN_FT]'' \
. ds $LISTS_PN_FT \\*[$TOC_PN_FT]
. if '\\*[$LISTS_PN_SIZE_CHANGE]'' \
. ds $LISTS_PN_SIZE_CHANGE \\*[$TOC_PN_SIZE_CHANGE]
. if !\\n[#EQN_PN_PADDING] \
. nr #EQN_PN_PADDING \\n[#TOC_PN_PADDING]
. if !\\n[#FIG_PN_PADDING] \
. nr #FIG_PN_PADDING \\n[#TOC_PN_PADDING]
. if !\\n[#TBL_PN_PADDING] \
. nr #TBL_PN_PADDING \\n[#TOC_PN_PADDING]
. ie '\\*[$LISTS_PAGENUM_STYLE]'' \
. PAGENUM_STYLE \\*[$TOC_PAGENUM_STYLE]
. el \
. PAGENUM_STYLE \\*[$LISTS_PAGENUM_STYLE]
. if r #\\*[$LIST_TYPE]_START_PAGENUM \
. PAGENUMBER \\n[#\\*[$LIST_TYPE]_START_PAGENUM]
. if r #LISTS_NO_PAGENUM .PAGINATION off
. HEADER_LEFT "\\*[$HDRFTR_LEFT]
. HEADER_RIGHT "\\*[$HDRFTR_RIGHT]
. HEADER_CENTER "\\*[\\*[$LIST_TYPE]_TITLE_STRING]
. if \\n[#LINENUMBERS]=2 .nr #LINENUMBERS 3
.\" Get num placeholders for ch. num and label num.
. if \\n[\\*[list-type]*autolabel] \{\
. if \\n[\\*[label-type]*label-with-chapter] \{\
. if \\n[#CH_NUM]<1000 .nr chapno-width 3
. if \\n[#CH_NUM]<100 .nr chapno-width 2
. if \\n[#CH_NUM]<10 .nr chapno-width 1
. \}
. if \\n[\\*[list-type]*label-num]<1000 .nr label-width 3
. if \\n[\\*[list-type]*label-num]<100 .nr label-width 2
. if \\n[\\*[list-type]*label-num]<10 .nr label-width 1
.\" Calculate width of label-num tab
. nr label-width \\n[\\*[list-type]*label-width]
. \}
. if \\n[#SLANT_ON] .nop \\*[SLANTX]
. if \\n[#COLUMNS]=1 .nr #COLUMNS 0
. START
. if \\n[#PRINT_STYLE]=2 .sp -1
. if '\\*[$LIST_TYPE]'FIGURES' .LIST_OF_FIG
. if '\\*[$LIST_TYPE]'TABLES' .LIST_OF_TBL
. if '\\*[$LIST_TYPE]'EQUATIONS' .LIST_OF_EQN
. if \\n[#LINENUMBERS]=3 \{\
. NUMBER_LINES RESUME
. nr #LINENUMBERS 1
. nn 1
. \}
. rr #LISTS
. pdfsync
.END
.\"
.ALIAS LIST_OF_EQUATIONS LISTS_OF
.ALIAS LIST_OF_FIGURES LISTS_OF
.ALIAS LIST_OF_TABLES LISTS_OF
\#
\# LISTS-OF STYLE
\# --------------
\# *Arguments:
\# FAMILY fam \
\# FONT sty \
\# PT_SIZE size \
\# LEAD leading [ADJUST] \
\# TITLE_FAMILY fam \
\# TITLE_FONT sty \
\# TITLE_SIZE +|-size \
\# TITLE_QUAD LEFT | CENTER | RIGHT \
\# TITLE_COLOR color \
\# TITLE_CAPS \
\# TITLE_NO_CAPS \
\# TITLE_SMALLCAPS \
\# TITLE_NO_SMALLCAPS \
\# TITLE_UNDERSCORE [ DOUBLE] <wt> <gap> (dbl-rule-gap) \
\# NO_PAGINATION \
\# PAGENUM_STYLE format \
\# PN_FAMILY fam \
\# PN_FONT sty \
\# PN_SIZE +|-size \
\# PN_PADDING n
\# *Function:
\# Allows setting of all style parameters for lists-of.
\# *Notes:
\# Assumption is that lists-of will all have the same style.
\# TOC style is used if LISTS_STYLE is omitted.
\#
.MAC LISTS_STYLE END
. nr loop-count 0 1
. nr loop-counter \\n[#NUM_ARGS]
. while \\n+[loop-count]<=\\n[loop-counter] \{\
. if '\\$1'FAMILY' \{\
. ds $LISTS_FAM \\$2
. shift 2
. \}
. if '\\$1'FONT' \{\
. ds $LISTS_FT \\$2
. shift 2
. \}
. if '\\$1'TITLE_FAMILY' \{\
. ds $LISTS_TITLE_FAM \\$2
. shift 2
. \}
. if '\\$1'TITLE_FONT' \{\
. ds $LISTS_TITLE_FT \\$2
. shift 2
. \}
. if '\\$1'TITLE_SIZE' \{\
. ds $LISTS_TITLE_SIZE \\$2
. shift 2
. \}
. if '\\$1'TITLE_QUAD' \{\
. ds $LISTS_TITLE_QUAD \\$2
. shift 2
. \}
. if '\\$1'TITLE_COLOR' \{\
. ds $LISTS_TITLE_COLOR \\$2
. shift 2
. \}
. if '\\$1'TITLE_CAPS' \{\
. nr #LISTS_TITLE_CAPS 1
. shift 1
. \}
. if '\\$1'TITLE_NO_CAPS' \{\
. rr #LISTS_TITLE_CAPS
. shift 1
. \}
. if '\\$1'TITLE_SMALLCAPS' \{\
. nr #LISTS_TITLE_SMALLCAPS 1
. shift 1
. \}
. if '\\$1'TITLE_NO_SMALLCAPS' \{\
. rr #LISTS_TITLE_NO_SMALLCAPS
. shift 1
. \}
.\" UNDERSCORE and UNDERLINE are identical, but we can't evaluate
.\" the results of two string comparisons.
. if '\\$1'TITLE_UNDERSCORE' \{\
. nr #LISTS_TITLE_UNDERSCORE 1
. shift
. ie '\\$1'DOUBLE' \{\
. ds DOUBLE DOUBLE
. shift
. if \B'\\$1' \{\
. ds $LISTS_OF_UL_WT \\$1
. shift
. \}
. if \B'\\$1' \{\
. ds $LISTS_OF_UL_GAP \\$1
. shift
. \}
. if \B'\\$1' \{\
. ds $LISTS_OF_RULE_GAP \\$1
. shift
. \}
. \}
. el \{\
. if \B'\\$1' \{\
. ds $LISTS_OF_UL_WT \\$1
. shift
. \}
. if \B'\\$1' \{\
. ds $LISTS_OF_UL_GAP \\$1
. shift
. \}
. \}
. \}
. if '\\$1'TITLE_UNDERLINE' \{\
. nr #LISTS_TITLE_UNDERSCORE 1
. shift
. ie '\\$1'DOUBLE' \{\
. ds DOUBLE DOUBLE
. shift
. if \B'\\$1' \{\
. ds $LISTS_OF_UL_WT \\$1
. shift
. \}
. if \B'\\$1' \{\
. ds $LISTS_OF_UL_GAP \\$1
. shift
. \}
. if \B'\\$1' \{\
. ds $LISTS_OF_RULE_GAP \\$1
. shift
. \}
. \}
. el \{\
. if \B'\\$1' \{\
. ds $LISTS_OF_UL_WT \\$1
. shift
. \}
. if \B'\\$1' \{\
. ds $LISTS_OF_UL_GAP \\$1
. shift
. \}
. \}
. \}
. if '\\$1'TITLE_NO_UNDERSCORE' \{\
. rr #LISTS_TITLE_UNDERSCORE 1
. rm DOUBLE
. rm $LISTS_OF_UL_WT
. rm $LISTS_OF_UL_GAP
. rm $LISTS_OF_RULE_GAP
. shift
. \}
. if '\\$1'TITLE_NO_UNDERLINE' \{\
. rr #LISTS_TITLE_UNDERSCORE 1
. rm DOUBLE
. rm $LISTS_OF_UL_WT
. rm $LISTS_OF_UL_GAP
. rm $LISTS_OF_RULE_GAP
. shift
. \}
. if '\\$1'PT_SIZE' \{\
. nr #LISTS_PS (p;\\$2)
. shift 2
. \}
. if '\\$1'LEAD' \{\
. nr #LISTS_LEAD (p;\\$2)
. ie !'\\$3'ADJUST' \{\
. nr #LISTS_LEAD_ADJUST 0
. shift 2
. \}
. el \{\
. nr #LISTS_LEAD_ADJUST 1
. shift 3
. \}
. \}
. if '\\$1'NO_PAGINATION' \{\
. nr #LISTS_NO_PAGENUM 1
. shift 1
. \}
. if '\\$1'PAGENUM_STYLE' \{\
. ds $LISTS_PAGENUM_STYLE \\$2
. shift 2
. \}
. if '\\$1'PN_FAMILY' \{\
. ds $LISTS_PN_FAM \\$2
. shift 2
. \}
. if '\\$1'PN_FONT' \{\
. ds $LISTS_PN_FT \\$2
. shift 2
. \}
. if '\\$1'PN_SIZE' \{\
. ds $LISTS_PN_SIZE_CHANGE \\$2
. shift 2
. \}
. if '\\$1'EQN_PN_PADDING' \{\
. nr #EQN_PN_PADDING \\$2
. shift 2
. \}
. if '\\$1'FIG_PN_PADDING' \{\
. nr #FIG_PN_PADDING \\$2
. shift 2
. \}
. if '\\$1'TBL_PN_PADDING' \{\
. nr #TBL_PN_PADDING \\$2
. shift 2
. \}
. \}
.END
\#
\# Lists-of collector
\# Strings to allocate space for leaders and entry page numbers
\#
.ds $LISTS_PN \\*[ST102]\F[\\*[$LISTS_PN_FAM]]\f[\\*[$LISTS_PN_FT]]\
\s[\\n[#LISTS_PS]u]^\\*[ST102X]\\*[ST103]\s[\\\\*[$LISTS_PN_SIZE_CHANGE]]\
\h'.5m'\h'\w'0'u*\\\\n[#LISTS_PN_PADDING]u'\\*[ST103X]
\#
.ds $LISTS_PN_TYPEWRITE \\*[ST102]^\\*[ST102X]\\*[ST103]\|\
\h'\w'\0'u*\\\\n[#LISTS_PN_PADDING]u'\\*[ST103X]
\#
.MAC LISTS_COLLECTOR END
. nr #LISTS_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
. if \\n[#KERN] .nr #RESTORE_KERN 1
. KERN OFF
. if '\\$0'TO_EQUATIONS' \{\
. ds list-type eqn
. ds label-type eqn
. da LIST_OF_EQN
\!. nr #LISTS_PN_PADDING \\\\n[#EQN_PN_PADDING]
. \}
. if '\\$0'TO_FIGURES' \{\
. ds list-type fig
. ds label-type fig
. if (\\n[pdf-img*have-label]=1):(\\n[pdf-img*autolabel]=1):\
(\\n[pic*autolabel]=1):(\\n[pic*have-label]=1) \{\
. nr \\*[label-type]*have-label 1
. if !'\\*[pdf-img*label]'' .rn pdf-img*label \\*[label-type]*label
. if !'\\*[pic*label]'' .rn pic*label \\*[label-type]*label
. \}
. da LIST_OF_FIG
\!. nr #LISTS_PN_PADDING \\\\n[#FIG_PN_PADDING]
. \}
. if '\\$0'TO_TABLES' \{\
. ds list-type tbl
. ds label-type tbl
. da LIST_OF_TBL
\!. nr #LISTS_PN_PADDING \\\\n[#TBL_PN_PADDING]
. \}
. br
. ie \\n[#PRINT_STYLE]=1 \{\
\!. fam \\*[$TYPEWRITER_FAM]
\!. ft R
\!. ps \\*[$TYPEWRITER_PS]
. ds _TYPEWRITE _TYPEWRITE
. \}
. el \{\
\!. FAMILY \\\\*[$LISTS_FAM]
\!. FONT \\\\*[$LISTS_FT]
\!. ps \\\\n[#LISTS_PS]u
. \}
. if \\n[#PRINT_STYLE]=2 .rm _TYPEWRITE
\!. PAD_MARKER ^
\!. vpt 0
. ie !\\n[\\*[label-type]*autolabel] \{\
.\" If there is a label...
. if !'\\*[\\*[label-type]*label]'' \
\!. PAD \
"\\*[ST100]\h'\w'\\*[\\*[label-type]*label]'u'\\*[ST100X]\0\\*[ST101]\h'\w'\\$2'u'\\*[ST101X]\\\\*[$LISTS_PN\\*[_TYPEWRITE]]" \
"\*[PDFBOOKMARK.NAME]"
.\" If there is no label...
. if '\\*[\\*[label-type]*label]'' \
\!. PAD \
"\\*[ST100]\\*[ST100X]\\*[ST101]\h'\w'\\$1'u'\0\\*[ST101X]\\\\*[$LISTS_PN\\*[_TYPEWRITE]]" \
"\*[PDFBOOKMARK.NAME]"
. \}
.\" If autolabelling...
. el \
\!. PAD \
"\\*[ST100]\h'\\\\n[label-width]u'\\*[ST100X]\ \ \ \\*[ST101]\h'\w'\\$2'u'\\*[ST101X]\\\\*[$LISTS_PN\\*[_TYPEWRITE]]" \
"\*[PDFBOOKMARK.NAME]"
\!. PAD_MARKER #
\!. EOL
. ie !\\n[\\*[label-type]*autolabel] \
\!. ST 100 L
. el \
\!. ST 100 R
\!. ST 101 L
\!. ST 102 L
\!. ST 103 R
. if \\n[#PRINT_STYLE]=2 \{\
\!. FAMILY \\\\*[$LISTS_FAM]
\!. FT \\\\*[$LISTS_FT]
\!. ps \\\\n[#LISTS_PS]u
. \}
\!. TAB 100
\!. PDF_LINK \\*[list-type]:\\n[lists*target] "\\$1"
\!. TN
\!. vpt 0
\!. PDF_LINK \\*[list-type]:\\n[lists*target] "\\$2"
\!. TN
\!. vpt 0
\!. PRINT \fR\\*[LEADER]\f[]
\!. TN
. if \\n[#PRINT_STYLE]=2 \{\
\!. FAMILY \\\\*[$LISTS_PN_FAM]
\!. FT \\\\*[$LISTS_PN_FT]
\!. ps \\\\*[$LISTS_PN_SIZE_CHANGE]
. \}
\!. PRINT \\n[#LISTS_ENTRY_PN]
\!. TQ
\!. vpt
. da
. if \\n[#RESTORE_KERN] .KERN
.END
.
.ALIAS TO_EQUATIONS LISTS_COLLECTOR
.ALIAS TO_FIGURES LISTS_COLLECTOR
.ALIAS TO_TABLES LISTS_COLLECTOR
\#
\# ***tbl***
\#
\# Support for multipage tables with headers borrowed from ms and
\# mommified by Robin Haberkorn <robin.haberkorn@googlemail.com>
\# with extensions by Peter Schaffter.
\#
.nr tbl*have-header 0
.ds T&
\#
.MAC TS END
. if \\n[.t]<\\n[#DOC_LEAD] .nr begin-tbl 1
. br
. rr tbl*pdfbx
. if r pdfbx-top \{\
. rt
. sp (\\*[wt\\n[stack]]/2u)+\\*[gap\\n[stack]]u
. \}
. rr begin-tbl
. rm tbl*caption
. rm tbl*label
. rr tbl*have-caption
. rr tbl*have-label
. rr tbl*have-header
. rr float*tbl
. rr tbl*boxed
. nr ind-pre-tbl \\n[.i]
. nr ll-pre-tbl \\n[.l]
. nr lead-pre-tbl \\n[.v]
. nr tbl*needs 1
. nr doing-tbl 1
. nf
. if '\\n[.z]'FLOAT*DIV' .nr float*tbl 1
. if !'\\n[.z]'FLOAT*DIV' \{\
. if \\n[.t]=1 \{\
. if (\\n[@TOP]=0)&(\\n[#START]=0) \{\
. ie \\n[#COLUMNS] .COL_NEXT internal
. el .NEWPAGE
. \}
. \}
. \}
. nr loop-count 0 1
. nr loop-counter \\n[#NUM_ARGS]
. ie \\n[#NUM_ARGS]=1 \{\
. if '\\$1'H' \{\
. nr tbl*have-header 1
. nr tbl*plain 1
. \}
. \}
. el \{\
. while \\n+[loop-count]<=\\n[loop-counter] \{\
. if '\\$1'H' \{\
. nr tbl*have-header 1
. shift
. \}
. if '\\$1'BOXED' \{\
. nr tbl*boxed 1
. shift
. \}
. if '\\$1'CENTER' \{\
. if \\n[#INDENT_BOTH_ACTIVE] \{\
. IBX
. nr #RESTORE_INDENT_BOTH 1
. \}
. nr tbl*center 1
. shift
. \}
. if '\\$1'CENTRE' \{\
. if \\n[#INDENT_BOTH_ACTIVE] \{\
. IBX
. nr #RESTORE_INDENT_BOTH 1
. \}
. nr tbl*center 1
. shift
. \}
. if '\\$1'NEEDS' \{\
. nr tbl*needs \\$2
. shift 2
. \}
. if '\\$1'NO_SHIM' \{\
. nr tbl*no-shim 1
. shift
. \}
. if '\\$1'NO_FLEX' \{\
. nr tbl*no-flex 1
. shift
. \}
. if '\\$1'ADJUST' \{\
. ds tbl*space-adj \\$2
. shift 2
. \}
. if '\\$1'CAPTION' \{\
. nr tbl*have-caption 1
. ds tbl*caption \\$2
. shift 2
. \}
. if '\\$1'SHORT_CAPTION' \{\
. ds tbl*caption-short \\$2
. shift 2
. \}
. if '\\$1'LABEL' \{\
. nr tbl*have-label 1
. ds tbl*label \\$2
. shift 2
. \}
. if '\\$1'TARGET' \{\
. ds target "\\$2
. PDF_TARGET "\\*[target]
. shift 2
. \}
. \}
. \}
. if (\\n[tbl*have-caption]=0):(\\n[tbl*caption-after-label]=1) \{\
. rr pdfbx-top
. if \\n[tbl*boxed] .sp -1p
. \}
. if \\n[tbl*have-header] .nr tbl*needs +1
. if (\\n[tbl*have-label]=1):(\\n[tbl*autolabel]=1) \
. ds label-type tbl
. if (\\n[tbl*have-caption]=1)&(\\n[tbl*have-header]=0) \
. tbl*caption-warning
. if \\n[tbl*boxed] \{\
. if (\\n[tbl*have-label]=0)&(\\n[tbl*have-caption]=0)&\
(\\n[tbl*autolabel]=0)&(\\n[tbl*have-source]=0) \
. nr tbl*plain-boxed 1
. \}
. if !\\n[tbl*have-header] .nr tbl*no-header 1
. ds tbl*label-sffx-tmp \\*[tbl*label-sffx]
. if !'\\*[tbl*label-sffx-tmp]'' .substring tbl*label-sffx-tmp -1
. if '\\*[tbl*label-sffx-tmp]'.' \
. if (\\n[tbl*caption-after-label]=0):(\\n[#MLA]=1) .chop tbl*label-sffx
. if \\n[tbl*caption-after-label] \{\
. if !'\\*[tbl*label-sffx]'' \
. if '\\*[tbl*caption]'' .chop tbl*label-sffx
. \}
. if !'\\*[tbl*caption-short]'' .ds short -short
. if \\n[tbl*autolabel] \{\
. if \\n[tbl*label-with-chapter] \
. ds chapno \\n[#CH_NUM].
. ds tbl*label \
\\*[tbl*label-prfx]\\*[chapno]\\n+[tbl*label-num]\\*[tbl*label-sffx]\"
. nr tbl*label-width \w'\\*[tbl*label]'
. \}
. ie \\n[@TOP] \{\
. if !'\\n[.z]'FLOAT*DIV' \{\
. RESTORE_SPACE
. nr @TOP 1
. if \\n[#COLUMNS] \
. if !'\\*[tbl*space-adj]'' \
. sp \\*[tbl*space-adj]-1v
. if \\n[tbl*boxed] .nr tbl*boxed 2
. vpt
. \}
. \}
. el \
. if !'\\*[tbl*space-adj]'' .sp \\*[tbl*space-adj]u
. if !\\n[#MLA] \{\
. if (\\n[tbl*have-caption]=0):(\\n[tbl*caption-after-label]=1) \{\
. ie !'\\n[.z]'FLOAT*DIV' \{\
. ie !\\n[tbl*boxed]=2 \{\
. if \\n[tbl*have-header] .nr tbl*restore-header 1
. if !\\n[@TOP] .sp .5v
. if \\n[tbl*boxed] .sp .25v
. if \\n[tbl*restore-header]=1 .nr tbl*have-header 1
. \}
. el \{\
. if !\\n[tbl*boxed] .ns
. sp .25v
. \}
. \}
. el .sp .5v
. \}
. \}
. if \\n[nl]=\\n[#PAGE_TOP] .ns
. if '\\n[.z]'FLOAT*DIV' \{\
. ie \\n[defer]>0 .sp .5v
. el .sp .25v
. \}
. if \\n[@TOP] .rr @TOP
. ds ev-current \\n[.ev]
. if (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \
. nr tbl*caption-lead-diff-adj 1
. if \\n[#MLA] \
. if \\n[tbl*have-label]+\\n[tbl*have-caption]=0 \
. sp .5v
. if \\n[tbl*boxed]=2 \{\
. if \\n[#MLA]=0 \
. if (\\n[tbl*caption-after-label]=1):(\\n[tbl*have-caption]=0) \
. sp 1n
. \}
. fi
. if \\n[tbl*have-header] \{\
. di tbl*header-div
. ev table-header
. evc \\*[ev-current]
. if !\\n[float-span] \{\
. ie '\\*[ev-current]'FLOAT' \{\
. ie !\\n[tbl*center] \
. in 0
. el \{\
. in 0
\!. in 0
. \}
. \}
. el \!.in 0
. \}
. \}
.END
\#
.MAC TH END
. ie '\\n[.z]'tbl*header-div' \{\
. nr T. 0
. T#
. di
. ev
. if \\n[#PDF_BOOKMARKS] \{\
. ie !'\\n[.z]'' \{\
. if (\\n[float*img]=0)&(\\n[float*pic]=0)&(\\n[float*eqn]=0) \{\
\!. PDF_TARGET tbl:\\\\n+[lists*target]
. ie !'\\*[tbl*label]'' \
\!. TO_TABLES "\\*[tbl*label]" "\\*[tbl*caption\\*[short]]"
. el \
\!. TO_TABLES "\\*[tbl*caption\\*[short]]"
. \}
. \}
. el \{\
. if '\\n[.z]'' .PDF_TARGET tbl:\\n+[lists*target]
. ie !'\\*[tbl*label]'' \
. TO_TABLES "\\*[tbl*label]" "\\*[tbl*caption\\*[short]]"
. el \
. TO_TABLES "\\*[tbl*caption\\*[short]]"
. \}
. \}
. if \\n[#MLA] .if !\\n[tbl*have-caption] \
. mla@error label caption \\n[.F] \\$0 \\n[.c]
. if !'\\n[.z]'FLOAT*DIV' \{\
. ie !\\n[tbl*boxed] \{\
. nr th*needs (u;\\n[dn]+\\n[tbl*needs]v)
. if \\n[th*needs]>\\n[.t] \{\
. if dPDF.EXPORT \
. if \\n[#FLEX_ACTIVE] \
. if !\\n[#NO_FLEX] \
. tm .ds pre-newpage-\\n% \\n%@\\n[#COL_NUM]
. ne \\n[dn]u+\\n[tbl*needs]v
. nr tbl@needs 1
. \}
. \}
. el \{\
. nr th*needs (u;\\n[dn]+.3n+\\n[tbl*needs]v)
. if \\n[th*needs]>\\n[.t] \{\
. if \\n[#COLUMNS] \
. if !\\n[#COL_NUM]=\\n[#NUM_COLS] \
. nr tbl*no-top-hook 1
. nr tbl*no-print-header 1
. if dPDF.EXPORT \
. if \\n[#FLEX_ACTIVE] \
. if !\\n[#NO_FLEX] \
. tm .ds pre-newpage-\\n% \\n%@\\n[#COL_NUM]
. ne \\n[dn]u+\\n[tbl*needs]v
. nr tbl@needs 1
. \}
. \}
. \}
. ie (\\n[dn]-\\n[.v])>\\n[.t] \{\
. if !\\n[@TOP] .@error ridiculously long table header
. if \\n[tbl@needs] \{\
. if \\n[tbl*boxed] \{\
. RESTORE_SPACE
. sp -1n
. \}
. rr tbl@needs
. \}
. if \\n[tbl*have-caption] .TBL*CAPTION
. \}
. el \{\
. nr tbl*header-ht \\n[dn]
. if \\n[tbl@needs] \{\
. if \\n[tbl*boxed] \{\
. RESTORE_SPACE
. if !\\n[#MLA] \{\
. if (\\n[tbl*have-caption]=0):(\\n[tbl*caption-after-label]=1) \
. nop \&
. sp -1n
. \}
. \}
. rr tbl@needs
. \}
. if (\\n[tbl*have-caption]=1)&(\\n[tbl*caption-after-label]=0) \{\
. TBL*CAPTION
. vs
. \}
. tbl*print-header
. \}
. \}
. el \{\
. if \\n[tbl*have-caption] \{\
. TBL*CAPTION
. nr skip-th-warning 1
. \}
. if !\\n[skip-th-warning] .@error .TH without .TS H
. rr skip-th-warning
. \}
.\" When centering a boxed table inside a float, .T# won't place
.\" vertical rules in the correct horizontal position unless .ll is
.\" given a nominal value (can be anything) and an indent is set
.\" manually.
. if '\\n[.z]'FLOAT*DIV' \{\
. if \\n[tbl*center] \{\
. nr float*ll \\n[.l]
. ll 0
. in \\n[float*ll]u-\\n[TW]u/2u
. \}
. \}
.END
\#
.MAC TE END
. if !r TW \{\
. tm1 "[mom]: '\\n[.F]' contains tbl(1) data but '-t' flag is missing from
. tm1 " the command line.
. ab Aborting.
. \}
. ev tbl*end \" Needed because of .ad changes
. evc \\*[ev-current]
. nh
. nf
. rr tbl*no-header
. if !'\\$1'' \{\
. if '\\$1'SOURCE' \{\
. ie !\\n[#MLA] \{\
. tm1 "[mom]: \\$1 argument to \\$0 at line \\n[.c], but MLA style not enabled.
. tm1 " Ignoring \\$1, but continuing to process.
. \}
. el \{\
. nr tbl*have-source 1
. shift
. \}
. \}
. \}
. if (\\n[#MLA]=1)&(\\n[tbl*have-source]=0) .tbl*source-warning
. if !'\\n[.z]'FLOAT*DIV' \{\
. if \\n[.t]<(\\n[.v]/2u) \{\
. ie (\\n[tbl*have-label]=1):\
(\\n[tbl*caption-after-label]=1):\
(\\n[tbl*have-source]=1):\
(\\n[tbl*autolabel]=1) \{\
. rm tbl*header-div
. nr tbl*no-top-hook 1
. ie \\n[tbl*autolabel] \
. if \\n[#MLA] \
. if !\\n[tbl*have-source] .
. el \{\
. nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
. if \\n[#COLUMNS]=1 .ds col-num ", column \\n[#COL_NUM]
. tm1 "[mom]: '\\n[.F]', macro \\$0, line \\n[.c]:
. tm1 " Insufficient room for label, caption, and/or source after
. tm1 " table on page \\n[pgnum]\\*[col-num]. Omitting, but continuing to process table.
. \}
. nr tbl*skip-source 1
. nr tbl*skip-label 1
. rr tbl*have-caption
. ie \\n[#COLUMNS] \
. COL_NEXT internal
. el .NEWPAGE
. \}
. el \{\
.\" Don't print tbl-header at top of next page or column if tbl
.\" finishes without room for further input at bottom of page
. rm tbl*header-div
. nr tbl*no-print-header 1
. nr tbl*no-top-hook 1
. ie \\n[#COLUMNS] \
. COL_NEXT internal
. el .NEWPAGE
. \}
. \}
. \}
. if !\\n[#MLA] \{\
. if (\\n[tbl*have-label]=1):(\\n[tbl*autolabel]=1):(\\n[tbl*caption-after-label]=1) \{\
. ev label
. if '\\*[ev-current]'FLOAT' .evc 0
. ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
. el \{\
. tbl*label-style
. vs \\n[.ps]u+\\n[tbl*label-autolead]u
. \}
. SIZESPECS
. if \\n[tbl*label-with-chapter] \
. ds chapno \\n[#CH_NUM].
. TBL*SET_LABEL_QUAD \\*[tbl*label-quad]
. di tbl*label-div
. ie \\n[tbl*boxed] .sp \\n[#CAP_HEIGHT]u
. el .sp \\n[#DOC_LEAD]u/4u
. if (\\n[tbl*have-label]=1):(\\n[tbl*autolabel]=1) \{\
. if !'\\*[tbl*label-space]'' .sp \\*[tbl*label-space]
. ie \\n[tbl*autolabel] \{\
. ie !\\n[tbl*caption-after-label] .nop \
\\*[tbl*label]
. el \{\
. nop \
\\*[tbl*label]\|
. tbl*caption-style
. vs \\n[.ps]u+\\n[tbl*caption-autolead]u
. ds tbl*caption-old \\*[tbl*caption]
. ds tbl*caption " \\*[tbl*caption]
. nop \\*[tbl*caption]
. ds tbl*caption \\*[tbl*caption-old]
. \}
. \}
. el \{\
. ie !\\n[tbl*caption-after-label] .nop \\*[tbl*label]
. el \{\
. nop \\*[tbl*label]\ \|\c
. tbl*caption-style
. vs \\n[.ps]u+\\n[tbl*caption-autolead]u
. ds tbl*caption " \\*[tbl*caption]
. nop \\*[tbl*caption]
. \}
. \}
. \}
. br
. di
. in 0
. ev
. nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
. ie !'\\n[.z]'FLOAT*DIV' \{\
. rr tbl*have-header
. rr tbl*have-caption
. ie (\\n[dn]-\\n[.v])>\\n[.t] \{\
. if \\n[#COLUMNS]=1 .ds col-num ", column \\n[#COL_NUM]
. tm1 "[mom]: '\\n[.F]', macro \\$0, line \\n[.c]:
. tm1 " Insufficient room for label, caption, and/or source after
. tm1 " table on page \\n[pgnum]\\*[col-num]. Omitting, but continuing to process.
. ie \\n[#COLUMNS] \
. COL_NEXT internal
. el .NEWPAGE
. if d tbl*header-div .rm tbl*header-div
. rr tbl*caption-top-lead-diff
. nr tbl*skip-source 1
. nr tbl*skip-label 1
. \}
. el .print-label
. \}
. el .print-label
. \}
. \}
. if \\n[tbl*autolabel] \{\
. ds tbl*label \\*[chapno]\\n[tbl*label-num]
. if dLABEL.REFS \
. tm .ds \\*[target] \\*[chapno]\\n[tbl*label-num]
. rm target
. \}
. if !\\n[tbl*skip-source] \{\
. if \\n[tbl*have-source] \{\
. ds tbl*source \\$1
. SIZESPECS
. ev source
. evc \\*[ev-current]
. nf
. nh
. ie \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
. sp
. \}
. el \{\
. tbl*source-style
. vs \\n[.ps]u+\\n[tbl*source-autolead]u
. \}
. di tbl*source-div
. TBL*SET_SOURCE_QUAD \\*[tbl*source-quad]
. if (\\n[tbl*have-label]=0)&(\\n[#MLA]=0) \
. if !\\n[tbl*autolabel] .sp \\n[#CAP_HEIGHT]u
. if \\n[#MLA] \
. sp \\n[#CAP_HEIGHT]u
. if !'\\*[tbl*source-space]'' .sp \\*[tbl*source-space]
. nop \\*[tbl*source]
. br
. di
. nf
. tbl*source-div
. ev
. \}
. \}
. if '\\n[.z]'FLOAT*DIV' .nr bx-tbl-depth \\n[.d]-1v
. if '\\n[.z]'tbl*header-div' \{\
. @error .TS with 'H' flag but no corresponding .TH
. ab Aborting.
. \}
. ev
. if !\\n[tbl*plain] \{\
. ie \\n[tbl*plain-boxed] \{\
. ie \\n[#MLA] .if !\\n[tbl*have-source] .sp .6v
. el .sp
. \}
. el \{\
. if !\\n[tbl*have-source] \{\
. if (\\n[tbl*have-label]=0)&\
(\\n[tbl*caption-after-label]=0)&(\\n[tbl*autolabel]=0) \
. sp 1v
. if (\\n[tbl*have-label]=1):(\\n[tbl*autolabel]=1) \
. sp .5v
. \}
. if '\\n[.z]'FLOAT*DIV' .nr chop-space 1
. \}
. \}
. ll \\n[ll-pre-tbl]u
. if (\\n[nl]=\\n[dc]):(\\n[nl]=\\n[#PAGE_TOP]) .ns
. if !'\\*[tbl*space-adj]'' .sp -\\*[tbl*space-adj]u
. if \\n[#MLA] \
. sp .5v
. if !r pdfbx-running \{\
. ie !\\n[tbl*no-shim] \{\
. ie !\\n[#NO_SHIM] \
. if !'\\n[.z]'FLOAT*DIV' .SHIM
. el \
. if !\\n[tbl*no-flex] \
. if !\\n[#NO_FLEX] \
. if !'\\n[.z]'FLOAT*DIV' .FLEX
. \}
. el \
. if !\\n[tbl*no-flex] \
. if !\\n[#NO_FLEX] \
. if !'\\n[.z]'FLOAT*DIV' .FLEX
. \}
. ie \\n[tbl*boxed] \{\
. nr tbl*pdfbx 2
. if \\n[tbl*have-label] .nr tbl*pdfbx 3
. \}
. el .nr tbl*pdfbx 1
. TBL*CLEANUP
. it 2 rr-tbl*pdfbx
.END
\#
\# Utility macros for tbl
\#
.MAC TBL*CAPTION END
. ev caption
. evc \\*[ev-current]
. vs \\n[.ps]u+\\n[tbl*caption-autolead]u
. nr caption-lead \\n[.v]
. nr tbl*caption-lead-diff \\n[lead-pre-tbl]-\\n[.v]
. nr tbl*caption-top-lead-diff \\n[tbl*caption-lead-diff]
. ie !\\n[#MLA] \{\
. if \\n[tbl*have-caption] \{\
.\" Get rid of these guys when you're sure you don't need them.
\#. if !'\\n[.z]'FLOAT*DIV' \{\
. if !\\n[tbl*caption-after-label] \{\
. ie (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \{\
. RESTORE_SPACE
. ie \\n[#COLUMNS] .sp |\\n[dc]u
. el .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
. sp \\n[tbl*caption-lead-diff]u
. \}
. el \{\
. if \\n[.ns] .if !(\\n[nl]=\\n[#PAGE_TOP]) .rs
. if !\\n[pdfbx-top] .sp \\n[#DOC_LEAD]u/2u
. \}
. if \\n[pdfbx-top] \{\
. ps \\*[tbl*caption-size-change]
. SIZESPECS
. ps
. nr pdfbx-top 1 \" SIZESPECS trips rr-pdfbx-top
. rt
. sp \\*[gap\\n[stack]]u+\\*[wt\\n[stack]]\
+\\n[tbl*caption-top-lead-diff]u+\\*[$CAP_HEIGHT]+.5p
. \}
. \}
\#. \}
. nh
. \}
. \}
. el \{\
. if !\\n[tbl*autolabel] \{\
. ie !\\n[tbl*have-label] \
. mla@error caption label \\n[.F] \\$0 \\n[.c]
. el .ev label
. \}
. \}
. ie \\n[#PRINT_STYLE]=1 .nr tmp-ind 2m
. el .nr tmp-ind 1.25m
. ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
. el \{\
. if !\\n[#MLA] \{\
. tbl*caption-style
. nr lead-current \\n[.v]
. \}
. \}
. ie !\\n[#MLA] \{\
. ie !\\n[tbl*caption-after-label] \{\
. di tbl*caption-div
. ie \\n[tbl*center] \!.in -\\n[ind-pre-tbl]u
. el \!.in 0
. TBL*SET_CAPTION_QUAD \\*[tbl*caption-quad]
. nop \\*[tbl*caption]
. br
. di
. evc 0
. if !'\\n[.z]'FLOAT*DIV' \{\
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#DOC_LEAD]u
. ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u+\\n[#DOC_LEAD]u
. nr caption-needs 2
. ie \\n[tbl*boxed] .nr tbl*lead \\n[.v]+3n
. el .nr tbl*lead \\n[.v]
. if \
(\\n[dn]+(\\n[tbl*lead]*(\\n[tbl*needs]+1)))>=\\n[.t] \{\
. nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
. if \\n[#COLUMNS]=1 .ds col-num ", column \\n[#COL_NUM]
. tm1 \
"[mom]: Table with caption at line \\n[.c] \
does not fit on page \\n[pgnum]\\*[col-num].
. tm1 \
" Shifting table to next page or column.
. ie (\\n[#COLUMNS]=1)&(\\n[#COL_NUM]=\\n[#NUM_COLS]) \{\
. rr tbl*no-header
. NEWPAGE
. \}
. el \{\
. nr tbl*no-top-hook -1
. sp \\n[.t]u
. ie \\n[#COLUMNS] \
. sp |\\n[dc]u+\\n[tbl*caption-lead-diff]u
. el .sp |\\n[#PAGE_TOP]u+\\n[tbl*caption-lead-diff]u
. \}
. \}
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
. \}
. if \\n[.u] .nr fill 1
. nf
. if \\n[.ns] .RESTORE_SPACE
. tbl*caption-div
. if \\n[#PRINT_STYLE]=1 .sp .5v
. if !'\\*[tbl*caption-space]'' \
. sp \\*[tbl*caption-space]
. if \\n[tbl*caption-lead-diff-adj] \{\
. sp -\\n[tbl*caption-lead-diff]u
. rr tbl*caption-lead-diff-adj
. \}
. if \\n[fill-pre-float] .fi
. \}
. el \{\
. if (\\n[tbl*have-label]=0) \{\
. if !\\n[tbl*autolabel] \{\
. tm1 "[mom]: CAPTION_AFTER_LABEL enabled, but no label given
. tm1 " for table at line \\n[.c].
. tm1 " Skipping caption but continuing to process.
. \}
. \}
. \}
. \}
. el \{\
. if (\\n[tbl*have-label]=1):(\\n[tbl*autolabel]=1) \{\
. ie !\\n[tbl*have-caption] \
. mla@error label caption \\n[.F] \\$0 \\n[.c]
. el \{\
. ie !'\\n[.z]'FLOAT*DIV' \{\
. ie (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \{\
. ie !\\n[#COLUMNS] \
. sp |\\n[#PAGE_TOP]u+\\n[tbl*caption-lead-diff]u
. el .sp |\\n[dc]u+\\n[tbl*caption-lead-diff]u
. \}
. el .sp .5v
. \}
. el .sp .5v
. \}
. ev label
. evc \\*[ev-current]
. nh
. ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
. el \{\
. tbl*label-style
. vs \\n[.ps]u+\\n[tbl*label-autolead]u
. nr tbl*label-lead-diff \\n[lead-pre-tbl]-\\n[.v]
. \}
. if \\n[tbl*label-with-chapter] \
. ds chapno \\n[#CH_NUM].
. if r pdfbx-top \
. if \\n[#MLA] .nr pdfbx-mla-tbl-top 1
. TBL*SET_LABEL_QUAD \\*[tbl*label-quad]
. if \\n[pdfbx-mla-tbl-top] \{\
. sp
. sp \\n[tbl*label-lead-diff]u
. rr pdfbx-mla-tbl-top
. \}
. di tbl*mla-label-caption
\!. in 0
. ie \\n[tbl*autolabel] \{\
. ds label \
\\*[tbl*label-prfx]\\*[chapno]\\n[tbl*label-num]\\*[tbl*label-sffx]\"
. nop \\*[label]
. nr tbl*label-width \w'\\*[label]'
. rr label
. \}
. el \{\
. if !'\\*[tbl*label]'' \{\
. nop \\*[tbl*label]
. nr tbl*label-width \w'\\*[tbl*label]'
. \}
. \}
. if \\n[tbl*autolabel] \
. ds tbl*label \\*[chapno]\\n[tbl*label-num]
. br
. di
. \}
. da tbl*mla-label-caption
. ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
. el .tbl*caption-style
. if '\\*[tbl*caption-quad]'L' \{\
. EOL
. ie \\n[float*tbl] \{\
. ie \\n[tbl*center] \
. ll \\n[ll-pre-tbl]u-\\n[TW]u/2u+\\n[TW]u-\\n[tmp-ind]u
. el \
. ll \\n[TW]u+\\n[.i]u-\\n[tmp-ind]u
\!. in \\n[tmp-ind]u
. ti -\\n[tmp-ind]u
. \}
. el \{\
. ie \\n[tbl*center] \{\
. if '\\*[tbl*label-quad]'L' \{\
. ll \\n[ll-pre-tbl]u-\\n[TW]u/2u+\\n[TW]u
\!. in \\n[tmp-ind]u
. \}
. \}
. el \
. in \\n[tmp-ind]u+\\n[ind-pre-tbl]u
. \}
. ti -\\n[tmp-ind]u
. \}
. nop \\*[tbl*caption]
. br
\!. in
. da
. if !'\\n[.z]'FLOAT*DIV' \{\
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#DOC_LEAD]u
. ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u+\\n[#DOC_LEAD]u
. ie \\n[#MLA] .nr caption-needs 3
. el .nr caption-needs 2
. if \
(\\n[dn]+(\\n[#DOC_LEAD]*\\n[tbl*needs])+(\\n[caption-needs]*\\n[caption-lead]))>\\n[.t] \{\
. nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
. if \\n[#COLUMNS] .ds col-num ", column \\n[#COL_NUM]
. tm1 \
"[mom]: Table with caption at line \\n[.c] \
does not fit on page \\n[pgnum]\\*[col-num].
. tm1 \
" Shifting table to next column or page.
. ie (\\n[#COLUMNS]=1)&(\\n[#COL_NUM]=\\n[#NUM_COLS]) \{\
. rr tbl*no-header
. if \\n[defer] .nr skip-th-warning 1
. NEWPAGE
. \}
. el \{\
. nr tbl*no-top-hook 1
. sp \\n[.t]u
. if (\\n[tbl*caption-after-label]=1):(\\n[tbl*plain]=1) \
. sp 1n-.3n
. \}
. \}
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
. \}
. nf
. if (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \
. nr tbl*label-lead-diff-adj 1
. ie (\\n[.t]>1)&(\\n[@TOP]=0) \{\
. if !\\n[#NO_FLEX] \{\
. NO_FLEX
. nr #RESTORE_FLEX 1
. \}
. if \\n[.ns] .rs
. sp \\n[tbl*label-lead-diff]u
. \}
. el \{\
. if \\n[.t]=1 .sp \\n[.t]u
. ie \\n[#COL_NUM]>1 \
. ie (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \
. sp |\\n[dc]u+\\n[tbl*label-lead-diff]u
. el .sp .5v
. \}
. tbl*mla-label-caption
. \}
. ie \\n[#PRINT_STYLE]=1 .sp .5v
. el .sp .5n
. if \\n[tbl*label-lead-diff-adj] \{\
. sp -\\n[tbl*label-lead-diff]u
. rr tbl*label-lead-diff-adj
. \}
. br
. if !'\\*[tbl*caption-space]'' .sp \\*[tbl*caption-space]
. ie \\n[float*tbl] .ev FLOAT
. el .ev \\*[ev-current]
.END
\#
.MAC TBL*CLEANUP END
. if !'\\n[.z]'FLOAT*DIV' \{\
. rm tbl*header-div
. rm short
. rm tbl*caption
. rm tbl*caption-short
. rm tbl*label
. rr tbl*center
. rr tbl*caption-top-lead-diff
. rr tbl*have-header
. rr tbl*no-print-header
. rr tbl*have-caption
. rr tbl*have-label
. rr tbl*plain-boxed
. rr tbl*boxed
. \}
. rr doing-tbl
. rm tbl*space-adj
. rr tbl*skip-label
. rr tbl*skip-source
. rr tbl*label-warning
. rr tbl*no-shim
. rr tbl*no-flex
. rr tbl*plain
. rr tbl*caption-top-lead-diff
. rnn tbl*have-label tbl@label
. rnn tbl*have-source tbl@source
. if '\\*[tbl*label-sffx-tmp]'.' .ds tbl*label-sffx .
. if \\n[#RESTORE_INDENT_BOTH] \{\
. IB
. rr #RESTORE_INDENT_BOTH
. \}
. if \\n[#RESTORE_INDENT_LEFT] \{\
. IL
. rr #RESTORE_INDENT_LEFT
. \}
. if \\n[#RESTORE_FLEX] \{\
. NO_FLEX off
. rr #RESTORE_FLEX
. \}
.END
\#
.MAC print-label END
. if \\n[.u] .nr fill 1
. nf
. if \\n[tbl*center] \{\
. if '\\n[.z]'' \{\
. ll \\n[.l]u-\\n[TW]u/2u+\\n[TW]u
. if \\n[ind-pre-tbl] \
. in \\n[ind-pre-tbl]u-(\\n[ind-pre-tbl]u/2u)
. \}
. \}
. if !\\n[tbl*skip-label] \
. tbl*label-div
. if \\n[tbl*center] \{\
. if '\\n[.z]'' \{\
. ll
. in 0
. \}
. \}
. if \\n[fill] .fi
. rr fill
.END
\#
.MAC tbl@top-hook END
. if (\\n[tbl*have-header:1]=1):(\\n[tbl*have-header]=1) \{\
. if !r tbl*no-print-header \{\
. nf
. rr @TOP
. ch RR_@TOP
. ev top-hook
. evc 0
. rs
. nop \&
. ie !\\n[tbl*boxed] .sp -1
. el .sp -1n
. tbl*print-header
. ev
. \}
. \}
.END
\#
.MAC tbl*print-header END
. if \\n[.u]=1 \{\
. nf
. nr fill 1
. \}
. if \\n[#COL_NUM]>1 \
. if !\\n[tbl*have-caption] \
. if (\\n[@TOP]=1):(\\n[nl]=\\n[dc]) \
. sp .3n
. if \\n[tbl*center] \!.in \\n[ind-pre-tbl]u/2u
. ie d tbl*header-div:span .tbl*header-div:span
. el .tbl*header-div
. if '\\n[.z]'FLOAT*DIV' \
. if \\n[tbl*center] .ce 1000
. mk #T
.END
\#
.MAC tbl@bottom-hook END
. rr #DIVERTED
. rr @TOP
. ch RR_@TOP
.END
\#
.MAC tbl*float-warning END
. tm1 "[mom]: Table in FLOAT, output page \\n[#PAGENUMBER], exceeds page vertical limits.
. tm1 " Multipage boxed tables cannot be contained within floats.
. ab [mom]: Aborting '\\n[.F]', approx. line \\n[.c].
.END
\#
.MAC tbl*caption-warning END
. tm1 "[mom]: TS at line \\n[.c] has CAPTION but no H argument.
. tm1 " CAPTION requires H with a corresponding .TH.
. ab [mom]: Aborting '\\n[.F]'.
.END
\#
.MAC tbl*source-warning END
. tm1 "[mom]: MLA enabled, but TE at line \\n[.c] has no SOURCE.
. tm1 " MLA style for tables requires that a source be cited.
. ab [mom]: Aborting '\\n[.F]'.
.END
\#
.MAC ds@need END \" Move vertically until there is enough space for \$1
. if '\\n(.z'' \{\
. while \\n[.t]<=(\\$1)&(\\n[nl]>\\n[#PAGE_TOP]) \{\
. rs
' sp \\n[.t]u
. \}
. \}
.END
\#
\# ***eqn***
\#
\# EQ/EN macros borrowed from ms, mommified by Robin Haberkorn
\# <robin.haberkorn@googlemail.com>, expanded by Peter Schaffter.
\#
\# EQ [ -L | -C | -I <indent> ] [label]
\# EN [ CONT | CONTINUED | ... ]
\#
\# Equations are centered by default, but can be left-justified
\# (EQ -L), explicitly centered, or indented (EQ -I).
\#
\# Each eqn block for multi-line equations aligned with 'mark' and
\# 'lineup' should be terminated by passing 'CONT' or 'CONTINUED'
\# or '...' to EN.
\#
\# Note that geqn mark and lineup work correctly in centered equations.
\#
.MAC EQ END
. if \\n[eqn*copy-in]=1 \{\
. if !\\n[eqn-linenum] .nr eqn-linenum \\n[.c]
. if !\\n[pgnum] .nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
. br
. if \\n[.u] .nr fill 1
. rr float*eqn
. if '\\n[.z]'FLOAT*DIV' .nr float*eqn 1
. nr eqn*restore-adj \\n[.j]
. na
. if !\\n[continued] \{\
. PDF_TARGET eqn:\\n+[lists*target]
. rr eqn*type
. nr loop-counter \\n[#NUM_ARGS]
. nr loop-count 0 1
. while \\n+[loop-count]<=\\n[loop-counter] \{\
. if '\\$1'-L' \{\
. nr eqn*left 1
. nr eqn*type 1
. shift
. \}
. if '\\$1'-I' \{\
. nr eqn*ind 1
. nr eqn*type 2
. shift
. ds DI \\$1
. ds DI@cont \\*[DI]
. shift
. \}
. if '\\$1'-C' \{\
. nr eqn*center 1
. nr eqn*type 3
. shift
. \}
. if '\\$1'ADJUST' \{\
. ds eqn*space-adj \\$2
. shift 2
. \}
. if '\\$1'LABEL' \{\
. ds eqn*label \\$2
. shift 2
. \}
. if '\\$1'SHIFT_LABEL' \{\
. ds eqn*shift-label \\$2
. shift 2
. \}
. if '\\$1'CAPTION' \{\
. ds eqn*caption \\$2
. shift 2
. \}
. if '\\$1'SHORT_CAPTION' \{\
. ds eqn*caption-short \\$2
. shift 2
. \}
. if '\\$1'TARGET' \{\
. ds target "\\$2
. PDF_TARGET "\\*[target]
. shift 2
. \}
. if '\\$1'NO_SHIM' \{\
. nr @no-shim 1
. shift 1
. \}
. if '\\$1'NO_FLEX' \{\
. nr eqn*no-flex
. shift
. \}
. \}
. \}
. if (\\n[eqn*have-label]=1):(\\n[eqn*autolabel]=1) \
. ds label-type eqn
. if '\\*[eqn*shift-label]'' .ds eqn*shift-label 0
. if !\\n[eqn*type] \{\
. nr eqn*center 1
. nr eqn*type 3
. shift
. \}
. if !'\\*[eqn*caption]'' \{\
. if '\\*[caption-quad]'L' \{\
. if \\n[default-left] .ds caption-quad R
. rr default-left
. \}
. \}
. if !\\n[continued] \{\
. if !'\\*[eqn*caption-short]'' .ds short -short
. if \\n[eqn*autolabel] \{\
. if \\n[eqn*label-with-chapter] \
. ds chapno \\n[#CH_NUM].
. ds eqn*label \\*[chapno]\\n+[eqn*label-num]
. nr eqn*label-width \w'\\*[eqn*label]'
. if dLABEL.REFS \
. tm .ds \\*[target] \\*[chapno]\\n[eqn*label-num]
. rm target
. nr eqn*label-num -1
. \}
. ie !'\\n[.z]'' \{\
. if (\\n[float*img]=0)&(\\n[float*pic]=0)&(\\n[float*tbl]=0) \{\
\!. PDF_TARGET eqn:\\\\n+[lists*target]
. ie !'\\*[eqn*label]'' \
\!. TO_EQUATIONS "\\*[eqn*label]" "\\*[eqn*caption\\*[short]]"
. el \
\!. TO_EQUATIONS "\\*[eqn*caption\\*[short]]"
. \}
. \}
. el \{\
. PDF_TARGET eqn:\\n+[lists*target]
. ie !'\\*[eqn*label]'' \
. TO_EQUATIONS "\\*[eqn*label]" "\\*[eqn*caption\\*[short]]"
. el \
. TO_EQUATIONS "\\*[eqn*caption\\*[short]]"
. \}
. \}
. if \\n[continued] \{\
. rm continued
. rr continued
. \}
. if \\n[eqn@left*cont] .nr eqn*type 1
. if \\n[eqn@ind*cont] \{\
. nr eqn*type 2
. ds DI \\*[DI@cont]
. \}
. \}
. if \\n[eqn@center*cont] .nr eqn*type 3
. ev EQN
. evc 0
. di eqn*div
. in 0
. nf
.END
\#
.MAC EN END
. if !'\\n[.z]'eqn*div' \{\
. @error mismatched EN
. return
. \}
. br
. di
. ev
. if !'\\*[eqn*label]'' .nr eqn*have-label 1
. if !'\\*[eqn*caption]'' .nr eqn*have-caption 1
. if !'\\$1'' \{\
. ie '\\$1'...' .ds continued CONT
. el .ds continued \\$1
. substring continued 0 3
. ie '\\*[continued]'CONT' \{\
. nr continued 1
. rm continued
. if \\n[eqn*ind] .nr eqn@ind*cont 1
. if \\n[eqn*left] .nr eqn@left*cont 1
. if \\n[eqn*center] .nr eqn@center*cont 1
. \}
. el \{\
. tm1 "[mom]: Invalid argument \\$1 to \\$0.
. tm1 " Must be 'CONTINUED', 'CONT', or '...'
. ab [mom]: Aborting '\\n[.F]' at line \\n[.c].
. \}
. \}
. if \\n[dl]:\\n[eqn*have-label] \{\
. ds eqn*tabs \\n[.tabs]
. ie \\n[dl] \{\
. if !'\\n[.z]'FLOAT*DIV' \{\
. ie \\n[eqn*have-caption] .ne \\n[dn]u-\\n[.V]
. el .ne \\n[dn]u-1v-\\n[.V]
. \}
. chop eqn*div
. if '\\*[DD]'' \{\
. ds DD .5v
. if !\\n[@TOP] \{\
. ie r pdfbx-top \{\
. SIZESPECS
. rt
. sp (\\*[wt\\n[stack]]/2u)+\\*[gap\\n[stack]]u+\\*[$CAP_HEIGHT]
. \}
. el .sp \\*[DD]
. if !'\\*[eqn*space-adj]'' .sp \\*[eqn*space-adj]u
. \}
. \}
. ie \\n[eqn*type]=1 \{\
. ta (u;\\n[.l]-\\n[.i])R
. ie \\n[continued] .nop \\*[eqn*div]
. el \{\
. ie \\n[eqn*autolabel] \
.nop \
\\*[eqn*div]\
\\*[eqn*label-specs]\
\t\v'+\\*[eqn*shift-label]'\
\\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
\v'-\\*[eqn*shift-label]'\
\\*[revert-specs]
. el \
.nop \
\\*[eqn*div]\
\\*[eqn*label-specs]\
\t\v'+\\*[eqn*shift-label]'\
\\*[eqn*label]\
\v'-\\*[eqn*shift-label]'\
\\*[revert-specs]
. \}
. if !\\n[continued] \{\
. if \\n[eqn*have-caption] \
. ADD_CAPTION
. \}
. \}
. el \{\
. ie \\n[eqn*type]=2 \{\
. ie '\\*[eqn*label-quad]'L' \{\
. ta \\*[DI]
. ie \\n[continued] .nop \t\\*[eqn*div]
. el \{\
. ie \\n[eqn*autolabel] \
.nop \
\\*[eqn*label-specs]\
\v'+\\*[eqn*shift-label]'\
\\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
\v'-\\*[eqn*shift-label]'\
\t\\*[eqn*div]\
\\*[revert-specs]
. el \
.nop \
\\*[eqn*label-specs]\
\v'+\\*[eqn*shift-label]'\
\\*[eqn*label]\
\v'-\\*[eqn*shift-label]'\
\\*[revert-specs]\
\t\\*[eqn*div]
. \}
. \}
. el \{\
. ta \\*[DI] (u;\\n[.l]-\\n[.i])R
. ie \\n[continued] .nop \t\\*[eqn*div]
. el \{\
. ie \\n[eqn*autolabel] \
.nop \
\t\\*[eqn*div]\
\\*[eqn*label-specs]\
\t\v'+\\*[eqn*shift-label]'\
\\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
\v'-\\*[eqn*shift-label]'\
\\*[revert-specs]
. el \
.nop \
\t\\*[eqn*div]\
\\*[eqn*label-specs]\
\t\v'+\\*[eqn*shift-label]'\
\\*[eqn*label]\
\v'-\\*[eqn*shift-label]'\
\\*[revert-specs]
. \}
. \}
. if !\\n[continued] \{\
. if \\n[eqn*have-caption] \
. ADD_CAPTION
. \}
. \}
. el \{\
. ie '\\*[eqn*label-quad]'L' \{\
. ta (u;\\n[.l]-\\n[.i]/2)C
. ie \\n[continued] .nop \t\\*[eqn*div]
. el \{\
. ie \\n[eqn*autolabel] \
.nop \
\\*[eqn*label-specs]\
\v'+\\*[eqn*shift-label]'\
\\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
\v'-\\*[eqn*shift-label]'\
\t\\*[eqn*div]\
\\*[revert-specs]
. el \
.nop \
\\*[eqn*label-specs]\
\v'+\\*[eqn*shift-label]'\
\\*[eqn*label]\
\v'-\\*[eqn*shift-label]'\
\\*[revert-specs]\
\t\\*[eqn*div]
. \}
. \}
. el \{\
. ta (u;\\n[.l]-\\n[.i]/2)C (u;\\n[.l]-\\n[.i])R
. ie \\n[continued] .nop \t\\*[eqn*div]
. el \{\
. ie \\n[eqn*autolabel] \
.nop \
\t\\*[eqn*div]\
\\*[eqn*label-specs]\
\t\v'+\\*[eqn*shift-label]'\
\\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
\v'-\\*[eqn*shift-label]'\
\\*[revert-specs]
. el \
.nop \
\t\\*[eqn*div]\
\\*[eqn*label-specs]\
\t\v'+\\*[eqn*shift-label]'\
\\*[eqn*label]\
\v'-\\*[eqn*shift-label]'\
\\*[revert-specs]
. \}
. \}
. if !\\n[continued] \{\
. if \\n[eqn*have-caption] \
. ADD_CAPTION
. \}
. \}
. \}
. \}
. el \{\
. ta (u;\\n[.l]-\\n[.i])R
.nop \
\\*[eqn*label-specs]\
\t\v'+\\*[eqn*shift-label]'\
\t\\*[eqn*label]\
\v'-\\*[eqn*shift-label]'\
\\*[revert-specs]
. \}
. ta \\*[eqn*tabs]
.\" if continuing (ie is a multi-line equation), don't space and SHIM
. if !\\n[continued] \{\
. br
. if !\\n[@TOP] \{\
. if !\\n[.t]<(\\*[DD]+1) \{\
. sp \\*[DD]
. ie !\\n[eqn*have-caption] \{\
. sp .25v
. if \\n[pdfbx-running] .nr eqn*pdfbx 1
. \}
. el .if \\n[pdfbx-running] .nr eqn*pdfbx 2
. \}
. \}
. if !'\\*[eqn*space-adj]'' .sp -\\*[eqn*space-adj]u
. ie !\\n[eqn*no-shim] \{\
. ie !\\n[#NO_SHIM] \
. if !'\\n[.z]'FLOAT*DIV' .SHIM
. el \
. if !\\n[eqn*no-flex] \
. if !\\n[#NO_FLEX] \
. if !'\\n[.z]'FLOAT*DIV' .FLEX
. \}
. el \
. if !\\n[eqn*no-flex] \
. if !\\n[#NO_FLEX] \
. if !'\\n[.z]'FLOAT*DIV' .FLEX
. rm DD
. rm eqn*caption
. rm eqn*caption-short
. rm eqn*label
. rm short
. rr eqn*copy-in
. \}
. rm DI@cont
. rr eqn*center
. rr eqn@center*cont
. rr eqn*have-label
. rr eqn*have-caption
. rr eqn*ind
. rr eqn@ind*cont
. rr eqn*left
. rr eqn@left*cont
. \}
. nr eqn*copy-in 1
. ad \\n[eqn*restore-adj]
. if \\n[fill] .fi
. rr fill
.END
\#
.MAC ADD_CAPTION END
. ie \\n[.t]<\\n[.v] \{\
. if !'\\n[.z]'FLOAT*DIV' \{\
. if \\n[#COLUMNS]=1 .ds col-num ", column \\n[#COL_NUM]
. tm1 "[mom]: '\\n[.F]', macro EQ, line \\n[eqn-linenum]:
. tm1 " Insufficient room for equation caption on page \\n[pgnum]\\*[col-num].
. tm1 " Skipping caption but continuing to process.
. if !\\n[@TOP] \{\
. ie \\n[#COLUMNS] \
. COL_NEXT internal
. el .NEWPAGE
. \}
. rr eqn-linenum
. rr pgnum
. \}
. \}
. el \{\
. if \\n[#PRINT_STYLE]=2 \{\
. ps \\*[eqn*caption-size-change]
. nr lead-curr \\n[.v]
. sp .5v
. vs \\n[.ps]u+\\n[eqn*caption-autolead]u
. nr eqn*caption-lead-diff \\n[lead-curr]-\\n[.v]
. sp \\n[eqn*caption-lead-diff]u
. ps
. if !'\\*[eqn*caption-space]'' \
. sp \\*[eqn*caption-space]
. \}
. if '\\*[eqn*caption-quad]'L' \{\
. fi
. ad l
. nop \
\\*[eqn*caption-specs]\
\\*[eqn*caption]\
\\*[revert-specs]
. nf
. \}
. if '\\*[eqn*caption-quad]'C' \{\
. fi
. ad c
. nop \
\\*[eqn*caption-specs]\
\\*[eqn*caption]\
\\*[revert-specs]
. nf
. \}
. if '\\*[eqn*caption-quad]'R' \{\
. fi
. ad r
. nop \
\\*[eqn*caption-specs]\
\\*[eqn*caption]\
\\*[revert-specs]
. nf
. \}
. if !'\\*[eqn*caption-space]'' \
. sp -\\*[eqn*caption-space]
. vs
. \}
.END
\#
\# ***pic***
\#
.MAC have-adjust END
. nr #ARGS 0 1
. nr #COUNT \\n[#NUM_ARGS]
. while \\n+[#ARGS]<=\\n[#COUNT] \{\
. if '\\$1'ADJUST' \{\
. ds pic*space-adj \\$2
. break
. \}
. shift
. \}
.END
\#
\# User settable text style for pic
\#
\# PIC_TEXT_STYLE
\# --------------
\# *Argument:
\# <offset from page left>
\# *Function:
\# Stores user supplied page offset in register #L_MARGIN.
\# Sets .po to user supplied offset.
\# *Notes:
\# Requires unit of measure.
\#
.MAC PIC_TEXT_STYLE END
. nr #ARGS 0 1
. nr #COUNT \\n[#NUM_ARGS]
. while \\n+[#ARGS]<=\\n[#COUNT] \{\
. if '\\$1'FAMILY' \{\
. shift
. ds pic*text-family \\$1
. shift
. \}
. if '\\$1'FONT' \{\
. shift
. ds pic*text-font \\$1
. shift
. \}
. if '\\$1'SIZE' \{\
. shift
. ds pic*text-size-change \\$1
. shift
. \}
. if '\\$1'AUTOLEAD' \{\
. shift
. nr pic*text-autolead \\$1
. shift
. \}
. \}
.END
\#
\# Main macros
\#
.MAC PS END
. if \\n[pdfbx-running] \{\
. ie !r pdfbx-top .nr pic*pdfbx 2
. el .nr pic*pdfbx 1
. \}
. if !\\n[#PP] .nop
. br
. have-adjust \\$@ \" Adjusting is handled by FLOAT
. if !'\\n[.z]'FLOAT*DIV' \
. FLOAT ADJUST \\*[pic*space-adj]
. PDF_TARGET fig:\\n+[lists*target]
. ds ev-current \\n[.ev]
. rr float*pic
. rr pic*have-label
. rr grap
. nr float*pic 1
. nr ind-pre-pic \\n[.i]
. nr lead-pre-pic \\n[.v]
. if \\n[#MLA] \
. if !\\n[pdfbx-running] .sp .5v
. in 0
. ev PIC
. evc \\n[ev-current]
. nf
. ie \\n[#NUM_ARGS]<2 .@error bad arguments to PS (not preprocessed with pic?)
. el \{\
. if \B'\\$1' \{\
. ie !\B'\\$2' .ds pic*scale-width \\$1
. el .ds pic*scale-width \\$2
. \}
. \}
.\" This is a bit confusing. pic is decorated with 2 args (width
.\" and height), which are read during pre-processing but have to be
.\" ignored when parsing args during main processing. We shift pic's
.\" args out of the way, then pop them off the arg stack because
.\" they're not needed during macro processing.
. while \B'\\$1' .shift
. nr loop-counter \\n[#NUM_ARGS]
. nr loop-count 0 1
. while \\n+[loop-count]<=\\n[loop-counter] \{\
. if '\\$1'LEFT' \{\
. nr pic*left 1
. shift 1
. \}
. if '\\$1'CAPTION' \{\
. nr pic*have-caption 1
. ds pic*caption \\$2
. shift 2
. \}
. if '\\$1'SHORT_CAPTION' \{\
. ds pic*caption-short \\$2
. shift 2
. \}
. if '\\$1'LABEL' \{\
. nr pic*have-label 1
. ds pic*label \\$2
. shift 2
. \}
. if '\\$1'TARGET' \{\
. ds target "\\$2
. PDF_TARGET "\\*[target]
. shift 2
. \}
. if '\\$1'NO_SHIM' \{\
. nr @no-shim 1
. shift 1
. \}
. if '\\$1'NO_FLEX' \{\
. nr @no-flex 1
. shift 1
. \}
. if '\\$1'GRAP' \{\
. nr grap 1
. shift 1
. \}
. \}
. if (\\n[pic*have-label]=1):(\\n[pic*autolabel]=1) \
. ds label-type pic
. ds pic*label-sffx-tmp \\*[pic*label-sffx]
. if !'\\*[pic*label-sffx-tmp]'' \
. substring pic*label-sffx-tmp -1
. if '\\*[pic*label-sffx-tmp]'.' \
. if \\n[pic*caption-after-label]=0 .chop pic*label-sffx
. if \\n[#MLA] \{\
. if (\\n[pic*have-label]=1):(\\n[pic*autolabel]=1) \{\
. if !\\n[pic*have-caption] \
. mla@error label caption \\n[.F] \\$0 \\n[.c]
. \}
. if \\n[pic*have-caption] \{\
. if !\\n[pic*have-label] \{\
. if !\\n[pic*autolabel] \
. mla@error caption label \\n[.F] \\$0 \\n[.c]
. \}
. \}
. \}
. if !'\\*[pic*text-family]'' \
. fam \\*[pic*text-family]
. if !'\\*[pic*text-font]'' \
. ft \\*[pic*text-font]
. if !'\\*[pic*text-size-change]'' \
. ps \\n[#DOC_PT_SIZE]u\\*[pic*text-size-change]
. nr lead-current \\n[.v]
. ie \\n[pic*text-autolead] \
. vs \\n[.ps]u+(\\n[pic*text-autolead]u*1000u)
. el .vs \\n[.ps]u
. nr pic@text-lead \\n[.v]
. nr pic@text-size \\n[.ps]
. if !'\\*[pic*text-color]'' .COLOR \\*[pic*text-color]
. if \\n[@TOP] \{\
. RESTORE_SPACE
. nr pic*top-lead-adj 1
. \}
. nr pic*top-lead-diff \\n[lead-pre-pic]u-\\n[.v]u
. if (\\n[pic*have-caption]=0):(\\n[pic*caption-after-label]=1) \{\
. ie \\n[pic*top-lead-adj] \{\
. sp \\n[pic*top-lead-diff]u
. rr pic*top-lead-adj
. \}
. el .if (\\n[pic*caption-after-label]=0):(\\n[#MLA]=0) \
. sp \\n[lead-pre-pic]u/2u
. \}
. if \\n[pic*label-with-chapter] \
. ds chapno \\n[#CH_NUM].
. if \\n[pic*autolabel] \
. ds pic*label \\*[pic*label-prfx]\\*[chapno]\\n+[fig*label-num]\\*[pic*label-sffx]
. nr fig*label-width \w'\\*[pic*label]'
. if !'\\*[pic*caption-short]'' .ds short -short
. if \\n[#PDF_BOOKMARKS] \{\
. ie !'\\*[pic*label]'' \
\!. TO_FIGURES "\\*[pic*label]" "\\*[pic*caption\\*[short]]"
. el \
\!. TO_FIGURES "\\*[pic*caption\\*[short]]"
. \}
. di pic*div
.END
\#
.MAC PE END
. di
. nr pic*div-width \\n[dl]
. if \\n[@TOP] \
. RESTORE_SPACE
. if !\\n[nl]=\\n[#PAGE_TOP] .sp \\n[lead-pre-pic]u/2u
. if (\\n[pic*have-caption]=1)&(\\n[pic*caption-after-label]=0) \{\
. ev caption
. evc \\*[ev-current]
. nh
. ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
. el \{\
. if \\n[.u] \{\
. nr fill 1
. nf
. \}
. pic*caption-style
. if \\n[fill] .fi
. rr fill
. nr lead-current \\n[.v]
. vs \\n[.ps]u+\\n[pic*caption-autolead]u
. nr pic*caption-lead-diff \\n[lead-current]-\\n[.v]
. in \\n[ind-pre-pic]u
. \}
. PIC*SET_CAPTION_QUAD \\*[pic*caption-quad]
. if \\n[@TOP] .RESTORE_SPACE
\!. in -\\n[ind-pre-pic]u
. sp \\n[pic*caption-lead-diff]u
\!. if \\\\n[.ns] .rs
. if \\n[pic*pdfbx]=1 \{\
. SIZESPECS
. if \\n[PIC]=1 \!.rt
. if \\n[PIC]=2 .rt
. sp \\n[pic*caption-lead-diff]u
. sp \\*[wt\\n[stack]]+\\*[gap\\n[stack]]u+\\*[$CAP_HEIGHT]
. nr pic*pdfbx 2
. \}
. nop \\*[pic*caption]
. if \\n[#PRINT_STYLE]=1 .sp .5
. if !'\\*[pic*caption-space]'' \
. sp \\*[pic*caption-space]-\\n[pic*text-autolead]p
. br
. ev
. \}
. if \\n[pic*pdfbx]=1 \{\
. if (\\n[pic*have-caption]=0):(\\n[pic*caption-after-label]=1) \{\
. if \\n[PIC]=1 \!.rt
. if \\n[PIC]=2 .rt
. sp \\n[#DOC_LEAD]u/2u
. sp \\*[wt\\n[stack]]+\\*[gap\\n[stack]]u
.\" Correct for wandering top of pic
. sp -\\n[pic*text-autolead]p
. \}
. \}
. if !\\n[pic*left] \
. in (\\n[ll-pre-float]u-\\n[pic*div-width]u)/2u
. if \\n[grap] \
\!. sp -2
. if (\\n[grap]=1)&(\\n[pic*caption-after-label]=1) \
\!. sp -2
. if \\n[pdfbx-running] \{\
. if \\n[pdfbx-top] \{\
. ie !\\n[pic*left] \!.in -\\*[gap\\n[stack]]u*2u
. el .in -\\*[wt\\n[stack]]
. \}
. \}
. if (\\n[pic*pdfbx]=0):(\\n[pic*pdfbx]=2) \
. if (\\n[pic*have-caption]=0)&(\\n[pic*caption-after-label]=0) \
\!. sp -.5-\\n[pic*text-autolead]p
. pic*div
. br
. if (\\n[pic*have-label]=1):(\\n[pic*autolabel]=1):(\\n[pic*caption-after-label]=1) \{\
. nr lead-pre-label \\n[.v]
. ev label
. evc \\*[ev-current]
. ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
. el \{\
. pic*label-style
. nr lead-current \\n[.v]
. vs \\n[.ps]u+\\n[pic*label-autolead]u
. in \\n[ind-pre-pic]u
. sp \\n[lead-current]u-\\n[.v]u
. \}
. PIC*SET_LABEL_QUAD \\*[pic*label-quad]
\!. in -\\n[ind-pre-pic]u
. if !'\\*[pic*label-space]'' .sp \\*[pic*label-space]
. if \\n[#PRINT_STYLE]=1 .sp .5v
. if \\n[#PRINT_STYLE]=2 \{\
. SIZESPECS
. if !\\n[pic*pdfbx] \{\
. ie !\\n[grap] .sp -1
. el .sp -1.5
. \}
. sp \\*[$CAP_HEIGHT]+.5
. if \\n[grap] .if !\\n[pic*have-label] .sp -.5
. \}
. ie \\n[pic*autolabel] \
. nop \
\\*[pic*label-prfx]\\*[chapno]\\n[fig*label-num]\\*[pic*label-sffx]\|
. el \
. if !'\\*[pic*label]'' .nop \\*[pic*label]
. if dLABEL.REFS \{\
. if \\n[pic*autolabel] \
. tm .ds \\*[target] \\*[chapno]\\n[fig*label-num]
. if \\n[pic*have-label] \
. tm .ds \\*[target] \\*[pic*label]
. \}
. rm target
. fam
. ft
. ps
. gcolor
. ie !\\n[pic*caption-after-label] .br
. el \{\
. if !'\\*[pic*caption]'' .nop \
\\*[pic*caption-specs]\\*[pic*caption]\\*[revert-specs]
. br
. \}
. ev
. in 0
. \}
. if \\n[pic*pdfbx] .nr pic*pdfbx 2
. ev
. if !\\n[pdfbx-running] \
. sp .5
. if \\n[pic*pdfbx]=2 .if !\\n[grap] .sp .5
. ie \\n[pdfbx-running] \
. if \\n[PIC]=1 .FLOAT off
. el .FLOAT off
. it 1 rr-pic*pdfbx
. in \\n[ind-pre-pic]u
. if !\\n[defer] .rr pic*have-caption
. rm pic*left
. rm short
. rr float*pic
. if '\\*[pic*label-sffx-tmp]'.' .ds pic*label-sffx .
. if \\n[pdfbx-running]=0 .rr pdfbx-running
. if r pdfbx-top .rr pdfbx-top
. if '\\*[pic*label-sffx-tmp]'.' .ds pic*label-sffx .
.END
\#
\# ***refer***
\#
\# Footnote references
\# -------------------
\# *Function:
\# Instruct REF to put references in footnotes.
\#
.MAC FOOTNOTE_REFS END
. ie !'\\$1'' .rr #FN_REF
. el \{\
. if r #EN_REF .rr #EN_REF
. nr #FN_REF 1
. \}
.END
\#
\# Endnote references
\# ------------------
\# *Function:
\# Instruct REF to collect references for endnotes output.
\#
.MAC ENDNOTE_REFS END
. ie !'\\$1'' .rr #EN_REF
. el \{\
. if r #FN_REF .rr #FN_REF
. nr #EN_REF 1
. if !r#EN_MARKER_STYLE .ENDNOTE_MARKER_STYLE SUPERSCRIPT
. \}
.END
\#
\# Prepare mom for a reference
\# ---------------------------
\# *Argument:
\# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value>
\# *Function:
\# Calls FOOTNOTE or ENDNOTE, depending on whether #REF_FN or
\# #REF_EN is set to 1.
\# *Notes:
\# For convenience, REF is a toggle.
\#
\# REF optionally takes the same arguments as FOOTNOTE, allowing
\# users to indent references that go in footnotes when footnote
\# indenting is required. FOOTNOTE_REFS must be on for this.
\#
.MAC REF END
. ie \\n[#FN_REF]+\\n[#EN_REF]=0 \{\
. if !\\n[#REF_WARNING]=1 \{\
. tm1 "[mom]: Before REF at line \\n[.c], neither FOOTNOTE_REFS nor ENDNOTE_REFS
. tm1 " has been selected. If "sort" and "accumulate" are in your refer
. tm1 " commands, references will be collected for later output with $LIST$.
. tm1 " Otherwise, they will disappear.
. nr #REF_WARNING 1
. \}
. \}
. el \{\
. ie \\n[#REF]=1 \{\
. if \\n[#FN_REF]=1 .FOOTNOTE OFF
. if \\n[#EN_REF]=1 .ENDNOTE OFF
. rr #REF
. \}
. el \{\
. rr #REF_WARNING
. nr #REF 1
. if \\n[#FN_REF]=1 .FOOTNOTE \\$1 \\$2 \\$3
. if \\n[#EN_REF]=1 .ENDNOTE
. \}
. \}
.END
\#
\# Embedded references in text (with brackets)
\# -------------------------------------------
\#
.MAC REF_BRACKETS_NOTICE END
. tm1 "[mom]: \\$1 has been removed from mom. See the mom documentation 'refer.html'
. tm1 " for instructions on parenthetical insertions of references into text.
. ie '\\$1'REF_STYLE' .tm1 " Continuing to process '\\n[.F]' from line \\n[.c].
. el .ab [mom]: Aborting '\\n[.F]' at \\$1, line \\n[.c].
.END
\#
.MAC REF_BRACKETS_START END
. REF_BRACKETS_NOTICE \\$0
.END
\#
.MAC REF_BRACKETS_END END
. REF_BRACKETS_NOTICE \\$0
.END
\#
\# These four pairs of aliases used to allow users to embed
\# references in text and have them surrounded by (), [], {} or <>.
\# bracket-label should be used in the refer block instead.
\#
.ALIAS REF( REF_BRACKETS_START
.ALIAS REF) REF_BRACKETS_END
\#
.ALIAS REF[ REF_BRACKETS_START
.ALIAS REF] REF_BRACKETS_END
\#
.ALIAS REF{ REF_BRACKETS_START
.ALIAS REF} REF_BRACKETS_END
\#
.ALIAS REF< REF_BRACKETS_START
.ALIAS REF> REF_BRACKETS_END
\#
\# Refer indenting
\# ---------------
\# *Argument:
\# FOOTNOTE | ENDNOTE | BIBLIO <indent for 2nd and subsequent lines of discrete reference entries>
\# *Function:
\# Sets registers #REF_FN_INDENT, #REF_EN_INDENT or #REF_BIB_INDENT.
\# *Notes:
\# Indent value requires a unit of measure. If refs are going
\# into footnotes or endnotes, first lines get indented; if going
\# into a bibliography, second lines get indented
\#
.MAC INDENT_REFS END
. if '\\$1'FOOTNOTE' .ds $REF_FN_INDENT \\$2
. if '\\$1'ENDNOTE' .ds $REF_EN_INDENT \\$2
. if '\\$1'BIBLIO' .ds $REF_BIB_INDENT \\$2
.END
\#
.ALIAS REF_INDENT INDENT_REFS
\#
\# Hyphenation of references
\# -------------------------
\# *Argument:
\# <none> | <anything>
\# *Function:
\# Sets register #REF_HY
\#
.MAC HYPHENATE_REFS END
. ie '\\$1'' .nr #REF_HY 1
. el \
. if r #REF_HY .rr #REF_HY
.END
\#
\# The remainder of the definitions in this section are modified
\# versions of the definitions found in the refer module of s.tmac.
\#
.de @error
.tm [mom]: '\\n[.F]', line \\n[.c]: \\$*
..
\#
\# Underlining unavoidably turns off sentence spacing.
\#
.de ref*restore-ss
\c
.SS \\*[$SAVED_SS_VAR]
.if '\\n[.z]'END_NOTES' \{\
\c
\E*[PREV]\c
.\}
..
\# The following strings define the order of entries for different
\# types of references. Each letter in the string refers to a database
\# field (A for author, T1/T2 for article and book titles, etc).
\#
.de ref*specs
.if \\n[#PRINT_STYLE]=1 \{\
. char ' \[aq]
. char \[oq] \[aq]
.\}
.\" Internet site - type 0
.ds ref*spec!0 i Q A m p T2 s o D c a u n
.\" Journal article - type 1
.ds ref*spec!1 i Q A m p T2 q O J V S N D P n
.\" Book - type 2
.ds ref*spec!2 i Q A m p T1 q b d l r E S e V O C I D P t n
.\" Article within book - type 3
.ds ref*spec!3 i Q A m p T2 B b d l r E S e V O C I D P t n
.\" Tech report - type 4
.ds ref*spec!4 i Q A m p T1 R G O C I D P n
.\" Magazine or newspaper article - type 5
.ds ref*spec!5 i Q A m p T2 O M V S N D P n
..
\#
\# Refer's "1st" macro. Since it is possible to define database
\# fields using any single letter, we remove all possible string
\# definitions of the form [X and [x. Also, reset ref*spec!<n>
\# strings to their defaults.
\#
.de ]-
.ref*specs
.rm [A [B [C [D [E [F [G [H [I [J [K [L [M \
[N [O [P [Q [R [S [T [U [V [W [X [Y [Z \
[a [b [c [d [e [f [g [h [i [j [k [l [m \
[n [o [p [q [r [s [t [u [v [w [x [y [z
.if r [e .rr [e \" [e persists if %e field is last
.rr ref*type
.rm ref*string
..
\#
\# Refer's "2nd" macro; builds up a reference with ref*build, and
\# prints it with ref*print.
\#
.de ][
.nr ref*type \\$1
.if \\n[ref*type]=0 \{\
. ie d [C \{\
. if !d [I \{\
. nr pre-1900 1 \" If pre-1900, MLA allows excluding publisher
. nr ref*type 2
. \}
. \}
. el .nr ref*type 2
. if d [q .nr ref*type 2
.\}
.if d [u .nr ref*type 0 \" If %u exists, always treat as Internet ref
.if \\n[ref*type]=3 \{\
. if !'\\*([R'' \{\
. nr ref*type 4
. ds ref*spec!4 i Q A m p T2 B R O C I D P n
. \}
. if !'\\*([G'' \{\
. nr ref*type 4
. ds ref*spec!4 i A m p T2 B G O C I D P O n
. \}
.\}
.if r [T \{\
. als [T1 [T
. als [T2 [T
.\}
.ie d ref*spec!\\n[ref*type] .ref*build \\*[ref*spec!\\n[ref*type]]
.el \{\
. @error unknown reference type '\\n[ref*type]'
. ref*build \\*[ref*spec!0]
.\}
.if !\\n[.hy]=0 \{\
.nr #RESTORE_HY \\n[.hy]
.if !r#REF_HY .nh
.\}
.ref*print
.if !\\n[#RESTORE_HY]=0 .hy \\n[#RESTORE_HY]
.rr #RESTORE_HY
.rm ref*string
.rm [F [T1 [T2
..
\#
\# Refer's "3rd" macros, which set up and terminate the output
\# of collected references
\#
.de ]<
.rm author \" If not, persists over multiple 'bibliography' commands
.als ref*print ref*end-print
.nr #REF 1
.if \\n[#BIB_LIST]=1 \{\
. nr #IN_BIB_LIST 1
. LIST DIGIT \\*[$BIB_LIST_SEPARATOR] \\*[$BIB_LIST_PREFIX]
.\}
..
\#
.de ]>
.LIST OFF
.rr #REF
.rr #IN_BIB_LIST
.als ref*print ref*normal-print
..
\#
\# Output
\# ------
\#
\# Output normal, non-collected refs
\#
.de ref*normal-print
.nr #CURRENT_HY \\n[.hy]
\\*[ref*string]
..
\#
\# Output collected refs
\#
.de ref*end-print
.\" 10 is arbitrary
.nn 10
.nr #REF_BIB_INDENT (u;\\*[$REF_BIB_INDENT])
.ie \\n[#BIB_LIST]=0 \{\
. in +\\n[#REF_BIB_INDENT]u
. ti -\\n[#REF_BIB_INDENT]u
.\}
.el .ITEM
.\" Part of workaround for refer spitting out a blank page if the
.\" last ref falls on the bottom line.
\\*[ref*string]\R'ref*num*first-pass +1'\?\R'ref*num +1'\?
.sp \\*[$BIB_SPACE]
.ie \\n[#BIB_LIST]=0 .in
.el .IL -\\n[#REF_BIB_INDENT]u
.nn 0
..
\#
.als ref*print ref*normal-print
\#
\# Build up the ref*string
\#
\# Correct MLA "typewritten" style (printstyle TYPEWRITE) demands
\# two spaces after each period. The spaces are hardwired into the
\# string definitions (ref*add-<x>), so we have to make sure that there
\# aren't two spaces when the printstyle is TYPESET. Since I find that
\# references look a bit crowded with 0 sentence space, I've bumped it
\# up to +8. User's sentence spacing is reset in FOOTNOTES and ENDNOTES.
\#
.de ref*build
.if \\n[#PRINT_STYLE]=2 \
. if (\\n[#FN_REF]+\\n[#EN_REF])>0 .SS +8
.rm ref*string
.while \\n[.$] \{\
. if d [\\$1 \{\
. ie d ref*add-\\$1 .ref*add-\\$1
. el .ref*add-dflt \\$1
. \}
. shift
.\}
.\" now add a final period
.ie d ref*string \{\
. if !\\n[ref*suppress-period] .as ref*string .
. if d ref*post-punct \{\
. as ref*string "\\*[ref*post-punct]
. rm ref*post-punct
. \}
.\}
.el .ds ref*string
..
\#
\# The following macros determine how entries are formatted WRT
\# punctuation, type style, additional strings, etc.
\#
\# o First argument is the database field letter.
\# o Second argument is the punctuation character to use to separate this
\# field from the previous field.
\# o Third argument is a string with which to prefix this field.
\# o Fourth argument is a string with which to postfix this field.
\# o Fifth argument is a string to add after the punctuation character
\# supplied by the next field.
\#
\# %A Author(s)
.de ref*add-A
.ds eval*[A \\*([A
.substring eval*[A -1
.if !\\n[skip-[A] \{\
. if '\\*[eval*[A]'.' \
. if !\\n[#FN_REF]+\\n[#EN_REF] .chop [A
.\" Per MLA, footnotes and endnotes should not use idem, therefore
.\" if %i contains other than idem (e.g., ed., trans.), transpose it
.\" to after author's name
. ie \\n[#FN_REF]+\\n[#EN_REF]=1 \{\
. ie !'\\*[idem]'' .ref*field A "" "" "? \\*[idem]"
. el .ref*field A
. rm idem
. el .ref*field A
. \}
.\}
.if \\n([A .nr ref*suppress-period 1
.rr skip-[A
..
\# %i Idem.
\#
\# In bibliographies, per MLA, replace %A with long dash after
\# first entry with author's name; if %i field contains other than
\# the word 'idem', appends it to the dash.
\# In foot/endnotes, idem is ignored; MLA requires full name for
\# each foot/endnote entry.
\#
.de ref*add-i
.\" Is a foot/endnote.
.ie \\n[#FN_REF]+\\n[#EN_REF]=1 \{\
. ie '\\*([i'idem' .rm [i
. el .ds idem \\*([i
.\}
.el \{\
. rr skip-[A
.\" %i is idem
. ie '\\*([i'idem' \{\
.\" If [A (%A) is the same as the last [A, captured in 'author'.
. if '\\*([A'\\*[author]' \{\
. rm [i
. ref*field i "" \[idem] "" " "
. nr skip-[A 1
. \}
. ds author \\*([A
. \}
.\" %i is not 'idem'; attach to long dash
. el \{\
. ds eval*[i \\*([i
. substring eval*[i -1
. if '\\*[eval*[i]'.' \{\
. chop [i
. ds idem \\*([i
. \}
. rm [i
. rm [A
. ref*field i "" \[idem] ", \\*[idem]" " "
. \}
.\}
..
\# %m Multiple authors (et al.)
.de ref*add-m
.if !\\n[#FN_REF]+\\n[#EN_REF] \{\
. ds eval*[m \\*([m
. substring eval*[m -1
. if '\\*[eval*[m]'.' .chop [m
.\}
.ref*field m ,
..
\# %p Post-author string (e.g., Preface, Foreword, etc)
.de ref*add-p
.\" Convert first letter to uppercase, per MLA, if BIBLIO
.if !\\n[#FN_REF]+\\n[#EN_REF] \{\
. ds initial*cap \\*([p
. substring initial*cap 0 0
. ds [p*string \\*([p
. substring [p*string 1
. ds [p \E*[UC]\\*[initial*cap]\E*[LC]\\*[[p*string]
.\}
.ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field p ,
.el .ref*field p . " "
..
\# %Q Author(s) when author is not a person
.de ref*add-Q
.ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field Q
.el .ref*field Q
..
\# %T Title (generic)
.de ref*add-T1
.ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field T , \E*[IT] \E*[ref*restore-ss]
.el \{\
. ie !'\\*([A'' .ref*field T . " \E*[IT]" \E*[ref*restore-ss]
. el \{\
. ie !'\\*([Q'' .ref*field T . " \E*[IT]" \E*[ref*restore-ss]
. el .ref*field T . \E*[IT] \E*[ref*restore-ss]
. \}
.\}
.if \\n([T .nr ref*suppress-period \\n([T
..
\# %T Title of a chapter or article
.de ref*add-T2
.ie \\n[#FN_REF]+\\n[#EN_REF] \
. ref*field T , \[lq] "" \[rq]
.el \{\
. ie '\\*([A'' \{\
. ref*field T . \[lq] "" \[rq]
. if !'\\*([Q''.ref*field T . " \[lq]" "" \[rq]
. \}
. el .ref*field T . " \[lq]" "" \[rq]
.\}
.if \\n([T .nr ref*suppress-period \\n([T
..
\# %B Book title (when citing an article from a book)
.de ref*add-B
.ie \\n[#FN_REF]+\\n[#EN_REF] \{\
. ie \\n([T .ref*field B "" \E*[IT] \E*[ref*restore-ss]
. el .ref*field B , \E*[IT] \E*[ref*restore-ss]
.\}
.el \{\
. ie \\n([T .ref*field B "" ".\E*[IT]" \E*[ref*restore-ss]
. el .ref*field B . " \E*[IT]" \E*[ref*restore-ss]
.\}
\# refer doesn't set reg [T to 1 for these book titles, so we do it here
.ds eval*[B \\*([B
.substring eval*[B -1
.rr [T
.if '\\*[eval*[B]'!' .nr [T 1
.if '\\*[eval*[B]'?' .nr [T 1
.rm eval*[B
..
\# %q Titles that must go in quotes (e.g. an unpublished dissertation)
.de ref*add-q
.ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field q , \[lq] "" \[rq]
.el \{\
. ie !'\\*([A'' .ref*field q . " \[lq]" "" \[rq]
. el \{\
. ie !'\\*([Q'' .ref*field q . " \[lq]" "" \[rq]
. el .ref*field q . \[lq] "" \[rq]
. \}
.\}
..
\# %R Report number for technical reports
.de ref*add-R
.ref*field R . " "
..
\# %J Journal name
.de ref*add-J
.ie \\n[#FN_REF]+\\n[#EN_REF] \{\
. ie \\n([T .ref*field J "" "\E*[IT]" \E*[ref*restore-ss]
. el .ref*field J , "\E*[IT]" \E*[ref*restore-ss]
.\}
.el \{\
. ie \\n([T .ref*field J "" " \E*[IT]" \E*[ref*restore-ss]
. el .ref*field J . " \E*[IT]" \E*[ref*restore-ss]
.\}
..
\# %M Magazine or newspaper name
.de ref*add-M
.ie \\n[#FN_REF]+\\n[#EN_REF] \{\
. ie \\n([T .ref*field M "" "\E*[IT]" \E*[ref*restore-ss]
. el .ref*field M , "\E*[IT]" \E*[ref*restore-ss]
.\}
.el \{\
. ie \\n([T .ref*field M "" " \E*[IT]" \E*[ref*restore-ss]
. el .ref*field M . " \E*[IT]" \E*[ref*restore-ss]
.\}
..
\# %E Editor(s)
.de ref*add-E
.ds eval*[E \\*([E
.substring eval*[E -1
.if '\\*[eval*[E]'.' \{\
. if !\\n[#FN_REF]+\\n[#EN_REF] .chop [E
. rm eval*[E
.\}
.\" Workaround for join-authors also joining editors. MLA style
.\" requires a comma after first editor only if there are more than
.\" two, whereas join-authors always puts a comma after the first if
.\" there's more than one.
.rm eval*[E
.nr position 1 1
.nr counter 1 1
.while !'\\*[eval*[E]',' \{\
. ds eval*[E \\*([E
. substring eval*[E \\n+[position] \\n[position]
. if \\n+[counter]>30 .break \" 30 is arbitrary
.\}
.\" Check for " and"
.if '\\*[eval*[E]',' \{\
. ds eval*[E \\*([E
. nr and-check \\n[position]+4
. substring eval*[E \\n+[position] \\n[and-check]
.\}
.if '\\*[eval*[E]' and' \{\
. nr counter 1 1
. nr start-range -1 1
. nr end-range 3 1
. while !'\\*[eval*[E]', and' \{\
. ds eval*[E \\*([E
. substring eval*[E \\n+[start-range] \\n+[end-range]
. if \\n+[counter]>50 .break \" just in case; 50 is arbitrary
. \}
. if '\\*[eval*[E]', and' \{\
. length len*[E \\*([E
. nr rhs \\n[len*[E]-\\n[start-range]
. ds lhs \\*([E
. ds rhs \\*([E
. substring lhs 0 \\n[start-range]-1
. substring rhs -(\\n[rhs]-1)
. ds [E \\*[lhs]\\*[rhs]
. \}
. rm lhs
. rm rhs
. rr and-check
. rr counter
. rr start-range
. rr end-range
. rr len*[E
.\}
.\" End workaround
.ie !\\n[ref*type]=0 \{\
. ie \\n([E>0 \{\
. ie \\n[#FN_REF]+\\n[#EN_REF] \{\
. ie \\n([T .ref*field E "" "ed. "
. el .ref*field E , "ed. "
. \}
. el \{\
. ie \\n([T .ref*field E "" " Eds. "
. el .ref*field E . " Eds. "
. \}
. \}
. el \{\
. ie \\n[#FN_REF]+\\n[#EN_REF] \{\
. ie \\n([T .ref*field E "" "ed. "
. el .ref*field E , "ed. "
. \}
. el \{\
. ie \\n([T .ref*field E "" " Ed. "
. el .ref*field E . " Ed. "
. \}
. \}
.\}
.el \{\
. ie \\n([T .ref*field E "" " "
. el .ref*field E . " "
.\}
.rr [T
.rr [E
..
\# %e Edition
.de ref*add-e
.ie \\n([T .ref*field e "" "" " ed."
.el \{\
. ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field e , "" " ed."
. el .ref*field e . " " " ed."
.\}
.nr ref*suppress-period 1
.nr [e 1
.rr [T
..
\# %V Volume (of a journal, or series of books); for journals, %N may be preferable
.de ref*add-V
.if \\n[ref*type]=1 \
. ref*field V
.if \\n[ref*type]=2 \{\
. ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field V , "vol. "
. el \{\
. ie \\n([T .ref*field V "" " Vol. "
. el .ref*field V . " Vol. "
. \}
.\}
.if \\n[ref*type]=3 \{\
. ie \\n([T .ref*field V "" " "
. el .ref*field V . " "
.\}
.rr [T
..
\# %N Journal number
.de ref*add-N
.ref*field N
..
\# %S Series (books or journals)
.de ref*add-S
.if \\n[ref*type]=1 \
. ref*field S
.if \\n[ref*type]=2 \{\
. ie \\n[#FN_REF]+\\n[#EN_REF] \{\
. ie \\n([T .ref*field S
. el .ref*field S ,
. \}
. el \{\
. ie \\n([T .ref*field S "" " "
. el .ref*field S . " "
. \}
.\}
.if \\n[ref*type]=3 \{\
. ie \\n([T .ref*field S "" " "
. el .ref*field S . " "
.\}
.rr [T
\# refer doesn't set reg [T to 1 for series titles, so we do it here
.ds eval*[S \\*([S
.substring eval*[S -1
.if '\\*[eval*[S]'!' .nr [T 1
.if '\\*[eval*[S]'?' .nr [T 1
.rm eval*[S
..
\# %C City
.de ref*add-C
.ie \\n[#FN_REF]+\\n[#EN_REF] \{\
. ie r [d \{\
. ref*field C
. rr [d
. \}
. el \
. ref*field C "" \*[FU 2](
. if \\n([T .nr ref*suppress-period \\n([T
.\}
.el \{\
. ie \\n([T .ref*field C "" " "
. el \{\
. ie r [e .ref*field C "" " "
. el .ref*field C . " "
. \}
.\}
.rr [T
.rr [e
..
\# %I Publisher (I stands for Issuer)
.de ref*add-I
.ie \\n[#FN_REF]+\\n[#EN_REF] \{\
. ie !'\\*([C'' .ref*field I :
. el .ref*field I "" (
.\}
.el \{\
. ie !'\\*([C'' .ref*field I :
. el \{\
. ie \\n([T .ref*field I "" " "
. el .ref*field I . " "
. \}
.\}
.rr [T
..
\# %D Date of publication
.de ref*add-D
.if \\n[ref*type]=0 \{\
. ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field D ,
. el .ref*field D . " "
.\}
.if \\n[ref*type]=1 \
. ref*field D "" "(" ")"
.if \\n[ref*type]=2 \{\
. ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field D , "" )
. el .ref*field D ,
.\}
.if \\n[ref*type]=3 \{\
. ie !'\\*([C'' \{\
. ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field D , "" )
. el .ref*field D ,
. \}
. el \{\
. if '\\*([I'' \{\
. ds eval*[D \\*([D
. substring eval*[D 0 -4
. ie '\\*[eval*[D]'1' .ds kern \*[BU3]
. el .ds kern \*[BU2]
. ie \\n[#PRINT_STYLE]=2 \
. if \\n[#FN_REF]+\\n[#EN_REF] .ref*field D "" (\\*[kern] )
. el .ref*field D
. \}
. rm eval*[D
. rm kern
. \}
.\}
.if \\n[ref*type]=4 .ref*field D ,
.if \\n[ref*type]=5 .ref*field D
.ds eval*[D \\*([D
.substring eval*[D -1
.if '\\*[eval*[D]'.' .nr ref*suppress-period 1
..
\# %P Page number(s)
.de ref*add-P
.if \\n[ref*type]=5 .nr ref*type 1
.ie \\n[#FN_REF]+\\n[#EN_REF] \{\
. ie \\n[ref*type]=1 .ref*field P : "" .
. el .ref*field P "" "\|"
. if \\n[ref*type]=1 .nr ref*suppress-period 1
.\}
.el \{\
. ie \\n[ref*type]=1 .ref*field P \|:
. el \{\
. ie d [n .ref*field P . \| .
. el .ref*field P . " "
. \}
.\}
..
\# %G Gov't. ordering number
.de ref*add-G
.ie \\n[#FN_REF]+\\n[#EN_REF] ref*field G ,
.el .ref*field G . " "
..
\# %O Other (info that goes after %T [or %B] but is hard to categorize; e.g., a dissertation)
.de ref*add-O
.ds eval*[O \\*([O
.substring eval*[O -1
.if '\\*[eval*[O]'.' .nr [O 1
.ds initial*cap \\*([O
.substring initial*cap 0 0
.ds [O*string \\*([O
.substring [O*string 1
.if !\\n[#FN_REF]+\\n[#EN_REF] \
. ds [O \E*[UC]\\*[initial*cap]\E*[LC]\\*[[O*string]
.ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field O ,
.el \{\
. if \\n([O=1 .chop [O
. ie r [e .ref*field O "" " "
. el \{\
. ie !d [A .ref*field O
. el .ref*field O . " "
. \}
.\}
.rr [O
.rr [e
..
\# %n Annotations (after ref)
.de ref*add-n
.ds eval*[n \\*([n
.substring eval*[n -1
.if '\\*[eval*[n]'.' .chop [n
.if '\\*[eval*[n]'?' .nr [n 1
.if '\\*[eval*[n]'!' .nr [n 1
.ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field n ,
.el \{\
. ie !'\\*([P'' .ref*field n "" " "
. el .ref*field n . " "
.\}
.if r [n .nr ref*suppress-period 1
.rr [n
..
\#
.de ref*add-dflt
.ref*field \\$1 ,
..
\#
\# Book reprints
\# -------------
\# %d date of publication (the original date of publication)
.de ref*add-d
.ie \\n[#FN_REF]+\\n[#EN_REF] \{\
. ref*field d "" ( ;
. nr [d 1
.\}
.el \{\
. ie \\n([T .ref*field d "" " "
. el .ref*field d . " "
.\}
.rr [T
..
\# %b main author when citing from a preface, introduction, foreword
\# or afterword
.de ref*add-b
.ie \\n[#FN_REF]+\\n[#EN_REF] \{\
. ie \\n([T .ref*field b "" "by"
. el .ref*field b , "by "
.\}
.el \{\
. ie \\n([T .ref*field b "" " By "
. el .ref*field b . " By "
.\}
.rr [T
..
\# %t title, if different from original title (the T field, which s/b
\# the original title)
.de ref*add-t
.ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field t , "rpt. of \E*[IT] " \E*[ref*restore-ss]
.el \{\
. ie \\n([T .ref*field t "" " Rpt. of \E*[IT] " \E*[ref*restore-ss]
. el .ref*field t . " Rpt. of \E*[IT] " \E*[ref*restore-ss]
.\}
.rr [T
..
\#
\# Translated works
\# ----------------
\# %l Trans(l)ator
.de ref*add-l
.ie \\n[#FN_REF]+\\n[#EN_REF] \{\
. ie \\n([T .ref*field l "" "trans. "
. el .ref*field l , "trans. "
.\}
.el \{\
. ie \\n([T .ref*field l "" " Trans. "
. el .ref*field l . " Trans. "
.\}
.rr [T
..
\# %r Translato(r) and edito(r)
.de ref*add-r
.ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field r , "trans. and ed. "
.el \{\
. ie \\n([T .ref*field r "" " Trans. and ed. "
. el .ref*field r . " Trans. and ed. "
.\}
.rr [T
..
\#
\# Internet
\# --------
\# %s Site name
.de ref*add-s
.ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field s , \E*[IT] \E*[ref*restore-ss]
.el \{\
.ie \\n([s .ref*field s "" ".\E*[IT]" \E*[ref*restore-ss]
.el .ref*field s . " \E*[IT]" \E*[ref*restore-ss]
.\}
.\" refer doesn't set reg [T to 1 for these titles, so we do it here
.if !\\n[#FN_REF]+\\n[#EN_REF] \{\
. ds eval*[s \\*([s
. substring eval*[s -1
. rr [T
. if '\\*[eval*[s]'.' .nr [T 1
. if '\\*[eval*[s]'!' .nr [T 1
. if '\\*[eval*[s]'?' .nr [T 1
. rm eval*[s
.\}
..
\# %c content of site (ie. Web, Online posting, etc)
.de ref*add-c
.ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field c ,
.el \{\
. ie \\n([T .ref*field c "" " "
. el .ref*field c . " "
.\}
.rr [T
..
\# %o organization, group or sponsor of site
.de ref*add-o
.ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field o ,
.el \{\
. ie \\n([T .ref*field o "" " "
. el .ref*field o . " "
.\}
.rr [T
..
\# %a access date, i.e. the date you read it
.de ref*add-a
.ie \\n[#FN_REF]+\\n[#EN_REF] .ref*field a ,
.el \{\
. ie \\n([T .ref*field a "" " "
. el .ref*field a . " "
.\}
.rr [T
..
\# %u URL
.de ref*add-u
.ref*field u "" < >
.rr [T
..
.de ref*add-z
.ref*field z
..
\#
\# Build up reference string from ref*add-<x> macros.
\#
\# First, a string to ensure next field's font is reset to roman
\# (TYPESET) or non-underlined (TYPEWRITE)
\#
.ie !n .ds ref*roman \f[R]\X'ps: exec decornone'\?\R'#UNDERLINE_ON 0'\?
.el .ds ref*roman \f[R]\?\R'#UNDERLINE_ON 0'\?
\#
.de ref*field
.if d ref*string \{\
. ie d ref*post-punct \{\
. as ref*string "\\$2\\*[ref*post-punct] \"
. rm ref*post-punct
. \}
. el .as ref*string "\\$2 \"
.\}
.as ref*string "\\$3\\*([\\$1\\$4\E*[ref*roman]
.if \\n[.$]>4 .ds ref*post-punct "\\$5\E*[ref*roman]
.nr ref*suppress-period 0
..
\#
\# MARGIN NOTES
\# ------------
\#
\# Wrapper for MNinit.
\#
.MAC MN_INIT END
. if \B'\\$2' \{\
. tm1 "[mom]: 1.x-style \\$0 detected, but you are using v2.x.
. tm1 " v2.x requires flags before arguments to \\$0.
. tm1 " Please read docelement.html#mn-init and update your file.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. nr #ARGS 0 1
. nr #COUNT 9
. while \\n+[#ARGS]<=\\n[#COUNT] \
. ds $MN-arg\\n[#ARGS] @
. nr #FLAG 0 1
. nr #COUNT \\n[#NUM_ARGS]
. while \\n+[#FLAG]<=\\n[#COUNT] \{\
. if '\\$1'RAGGED' \{\
. ds $MN-arg1 \\$1
. shift
. \}
. if '\\$1'SYMMETRIC' \{\
. ds $MN-arg1 \\$1
. shift
. \}
. if '\\$1'L_WIDTH' \{\
. shift
. ds $MN-arg2 \\$1
. shift
. \}
. if '\\$1'R_WIDTH' \{\
. shift
. ds $MN-arg3 \\$1
. shift
. \}
. if '\\$1'GUTTER' \{\
. shift
. ds $MN-arg4 \\$1
. shift
. \}
. if '\\$1'FONTSTYLE' \{\
. shift
. ds $MN-arg5 \\$1
. shift
. \}
. if '\\$1'SIZE' \{\
. shift
. ds $MN-arg6 \\$1
. shift
. \}
. if '\\$1'LEAD' \{\
. shift
. ds $MN-arg7 \\$1
. shift
. \}
. if '\\$1'COLOR' \{\
. shift
. ds $MN-arg8 \\$1
. shift
. \}
. if '\\$1'HY' \{\
. shift
. ds $MN-arg9 \\$1
. shift
. \}
. \}
. if '\\*[$MN-arg5]'@' .ds $MN-arg5 \E*[$DOC_FAM]R
. MNinit \
\\*[$MN-arg1] \\*[$MN-arg2] \
\\*[$MN-arg3] \\*[$MN-arg4] \
\\*[$MN-arg5] \\*[$MN-arg6] \
\\*[$MN-arg7] \\*[$MN-arg8] \
\\*[$MN-arg9]
.END
\#
.MAC MN_OVERFLOW_TRAP END
. if \\n[#OVERFLOW_LEFT]=1 \{\
. nr #no-repeat-MN-left 1
. di MN_OVERFLOW_LEFT
. \}
. if \\n[#OVERFLOW_RIGHT]=1 \{\
. nr #no-repeat-MN-right 1
. di MN_OVERFLOW_RIGHT
. \}
. rr #OVERFLOW_LEFT
. rr #OVERFLOW_RIGHT
.END
\#
\# The remainder of the margin notes macros and routines are adapted
\# from Werner Lemberg's MN.tmac.
\#
\# MNinit
\# ------
\# Usage:
\# MNinit [ragged|symmetric] \
\# left-width right-width separation \
\# font fontsize vertical-spacing \
\# color hyphenation-flags
\#
\# Initialize margin notes. Empty arguments (denoted with "") set
\# default values. If the first argument is the string 'ragged',
\# left and right margin notes are printed ragged-right. If it is
\# 'symmetric', left margin notes are printed ragged-left and right
\# margin notes ragged-right. If omitted, margin notes are left
\# and right adjusted.
\#
.de MNinit
. nr #MNinit 1
. ds MN-left-ad b\"
. ds MN-right-ad b\"
. if '\\$1'@' .shift
. if '\\$1'RAGGED' \{\
. ds MN-left-ad l\"
. ds MN-right-ad l\"
. shift
. \}
. if '\\$1'SYMMETRIC' \{\
. ds MN-left-ad r\"
. ds MN-right-ad l\"
. shift
. \}
. ie \B'\\$3' .nr MN-sep (n;\\$3)
. el .nr MN-sep 1m
. if ((\\n[.o] - \\n[MN-sep]) < 1n) \
. ab MN: Left margin too small (<1n) for requested margin notes separation.
. ie \B'\\$1' \{\
. nr MN-left-width (n;\\$1)
. nr MN-left-start (\\n[.o] - \\n[MN-sep] - \\n[MN-left-width])
. \}
. el \{\
. nr MN-left-width (\\n[.o] - \\n[MN-sep])
. nr MN-left-start 0
. \}
. if (\\n[MN-left-start] < 0) \
. ab MN: Left margin too small for requested margin notes settings.
. if (\\n[MN-left-width] < 1n) \
. ab MN: Left margin notes width too small (<1n).
. ie \B'\\$2' \{\
. nr MN-right-width (n;\\$2)
. nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
. if \\n[#COLUMNS]=1 \{\
. if !\\n[#NUM_COLS]=1 \
. nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
. \}
. \}
. el \{\
. nr MN-right-width \\n[MN-left-width]
. nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
. if \\n[#COLUMNS]=1 \{\
. if !\\n[#NUM_COLS]=1 \
. nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
. \}
. \}
. ie \A'\\$4' \{\
. ds MN-font \\$4\"
. if \\n[#PRINT_STYLE]=1 .ds MN-font CR
. \}
. el \{\
. ds MN-font \\*[$PP_FT]
. if \\n[#PRINT_STYLE]=1 .ds MN-font CR
. \}
. ie \B'\\$5' \{\
. ps \\$5
. nr MN-size \\n[.ps]
. ps
. if \\n[#PRINT_STYLE]=1 \{\
. ps \\*[$TYPEWRITER_PS]
. nr MN-size \\n[.ps]
. ps
. \}
. \}
. el \
. nr MN-size \\n[#DOC_PT_SIZE]
. ie \B'\\$6' \{\
' vs \\$6
. nr MN-spacing \\n[.v]
' vs
. if \\n[#PRINT_STYLE]=1 \
. nr MN-spacing \\n[#DOC_LEAD]
. \}
. el .nr MN-spacing \\n[#DOC_LEAD]
. ie \A'\\$7' \
. if !\\n[#PRINT_STYLE]=1 .ds MN-color \\$7\"
. el \
. if !\\n[#PRINT_STYLE]=1 .ds MN-color
. ie \B'\\$8' .nr MN-hy \\$8
. el .nr MN-hy \\n[.hy]
. ev MNbottom-left-env
. if \A'\\*[MN-font]' .ft \\*[MN-font]
. if \\n[MN-size] .ps \\n[MN-size]u
. if \\n[MN-spacing] .vs \\n[MN-spacing]u
. ll \\n[MN-left-width]u
. ad \\*[MN-left-ad]
. hy \\n[MN-hy]
' in 0
. nop \m[\\*[MN-color]]\c
. ev
. ev MNbottom-right-env
. if \A'\\*[MN-font]' .ft \\*[MN-font]
. if \\n[MN-size] .ps \\n[MN-size]u
. if \\n[MN-spacing] .vs \\n[MN-spacing]u
. ll \\n[MN-right-width]u
. ad \\*[MN-right-ad]
. hy \\n[MN-hy]
' in 0
. nop \m[\\*[MN-color]]\c
. ev
. nr MN-active 0
..
\# MN
\# --
\# Usage:
\#
\# MN LEFT|RIGHT
\# margin note text
\# MN
\#
\# With a parameter, start a margin note, otherwise end a margin note.
\# If the parameter is the string 'left', define a left margin note,
\# otherwise define a right margin note.
\#
.de MN
. ds MN-dir \\$1
. if !'\\$1'LEFT' \{\
. if !'\\$1'RIGHT' \{\
. MN_QUIT
. return
. \}
. \}
. if \\n[#COLUMNS]=1 \{\
. if \\n[#NUM_COLS]>2 \{\
. tm [mom]: Macro MN: More than two columns. Ignoring margin notes.
. return
. \}
. if !\\n[#NUM_COLS]=1 \{\
. ie \\n[#COL_NUM]=1 .ds MN-dir LEFT
. el .ds MN-dir RIGHT
. \}
. \}
. if !\\n[#MNinit]=1 \{\
. tm1 "[mom]: Macro MN: You must set parameters with MN_INIT before using MN.
. ab [mom]: Aborting '\\n[.F]' at MN, line \\n[.c].
. \}
. ie !'\\$1'' \{\
. if \\n[MN-active] \{\
. tm [mom]: Macro MN: Can't handle nested margin notes, line \\n[.c].
. return
. \}
. nr MN-active 1
. ev MN-env
. ie '\\*[MN-dir]'LEFT' \{\
. nr MN-left +1
. ds MN-curr l-\\n[MN-left]\"
. evc MNbottom-left-env
. \}
. el \{\
. nr MN-right +1
. ds MN-curr r-\\n[MN-right]\"
. evc MNbottom-right-env
. \}
. mk MN-mk-\\*[MN-curr]
. di MN-div-\\*[MN-curr]
. \}
. el .MN_QUIT
..
\#
\# MN_QUIT
\# -------
\# Utility macro to handle .MN OFF | QUIT | X etc
\#
.de MN_QUIT
. if \\n[MN-active] \{\
. br
. di
. nr MN-div-\\*[MN-curr]-depth \\n[dn]
. ev
. \}
. nr MN-active 0
..
\#
\# MNtop
\# -----
\# Resets these registers (called in HEADER)
.de MNtop
. nr MN-left 0
. nr MN-right 0
. nr MN-active 0
. rr MN-shifted
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
..
\#
\# MNbottom
\# --------
\# Executed in FOOTER.
\#
.de MNbottom
. if '\\$0'MNbottom-left' \{\
. ds MN-pos left
. ds l-r l
. ds Left-Right Left
. \}
. if '\\$0'MNbottom-right' \{\
. ds MN-pos right
. ds l-r r
. ds Left-Right Right
. \}
. nr MN-curr 0
. nr MN-last-pos 0
. nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
. vpt 0
. if \\n[MN-active] \{\
. di
. tm [mom]: Macro MN: Margin note finished by new page. Ignored.
. \}
. if \\n[#RECTO_VERSO] \{\
. if e \{\
. if '\\*[MN-pos]'right' \
. nr MN-\\*[MN-pos]-start (\\n[.o]+\\n[.l]+\\n[MN-sep])
. if '\\*[MN-pos]'left' \
. nr MN-\\*[MN-pos]-start (\\n[.o]-\\n[MN-sep]-\\n[MN-left-width])
. \}
. \}
. po \\n[MN-\\*[MN-pos]-start]u
. ev MNbottom-\\*[MN-pos]-env
. nr #P \\n%+\\n[#PAGE_NUM_ADJ]
. while (\\n[MN-curr] < \\n[MN-\\*[MN-pos]]) \{\
. nr MN-curr +1
. ie (\\n[MN-last-pos] < \\n[MN-mk-\\*[l-r]-\\n[MN-curr]]) \
. sp |\\n[MN-mk-\\*[l-r]-\\n[MN-curr]]u+\\n[MN-lead-adj]u
. el \{\
. nr MN-shifted 1
. sp 1v
. SHIM
. if \\n[#SHIM]>\\n[MN-spacing] .sp -(1v+\\n[MN-lead-adj]u)
. tm [mom]: Macro MN: Warning: \\*[Left-Right] margin note #\\n[MN-curr] on page \\n[#P] shifted down.
. \}
.\" If last margin note doesn't fit
. if ( (\\n[nl]+\\n[MN-div-\\*[l-r]-\\n[MN-curr]-depth]) > (\\n[.p]+\\n[#VARIABLE_FOOTER_POS]-1) ) \{\
. if \\n[MN-shifted]=1 \{\
. sp -(1v+\\n[#SHIM]u)
. rm MN-div-\\*[l-r]-\\n[MN-curr]
. tm1 "[mom]: \
No room to start \\*[MN-pos] margin note #\\n[MN-curr] on page \\n[#P].
. tm1 " Ignoring margin note.
. rr MN-shifted
. \}
. nr #no-repeat-MN-\\*[MN-pos] 1
. if '\\*[MN-pos]'left' .nr #OVERFLOW_LEFT 1
. if '\\*[MN-pos]'right' .nr #OVERFLOW_RIGHT 1
. ie \\n[#FN_COUNT]=0 \{\
. ch FOOTER \\n[.p]u
. wh \\n[#VARIABLE_FOOTER_POS]u+\\n[MN-lead-adj]u+1u MN_OVERFLOW_TRAP
. \}
. el \
. wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
. vpt
. \}
. nf
. MN-div-\\*[l-r]-\\n[MN-curr]
. fi
. br
. nr MN-last-pos \\n[nl]
. \}
. ev
. po
. if !\\n[#no-repeat-MN-\\*[MN-pos]]=1 .vpt
..
.
.ALIAS MNbottom-right MNbottom
.ALIAS MNbottom-left MNbottom
\#
\# PDF SUPPORT
\# ===========
\#
\# Initial setup
\#
.nr CURRENT_LEVEL 0
.nr VIRTUAL_LEVEL 0
.nr #PDF_BOOKMARKS 1
.nr #PDF_BOOKMARKS_OPEN 1
.pdfview /PageMode /UseOutlines
\#
\# TOC_BEFORE_HERE
\# ---------------
\#
\# Call this and the TOC will be placed preceding this page
\#
.MAC TOC_BEFORE_HERE END
. nr TOC_BH 1
. pdfpagename MOM:TOC
.END
\#
\# TOC_AFTER_HERE
\# ---------------
\#
\# Call this and the TOC will be placed after this page
\#
.MAC TOC_AFTER_HERE END
. nr TOC_BH 2
. pdfpagename MOM:TOC
.END
\#
\# PDF_LINK_COLOR
\# -----------------
\#
\# Arguments:-
\# <name defined by previous call to XCOLOR or NEWCOLOR> or
\# <red> <green> <blue> all 0.0 -> 1.0
\# Notes
\# Should be called before START but can also be called at any time to change colour
\# The colour assigned at the end of the document is used for all links in the TOC
\#
.MAC PDF_LINK_COLOR END
. ie \\n[.$]==3 \{\
. ds PDFHREF.COLOUR \\$*
. if !(\B'\\$1' & \B'\\$2' & \B'\\$3') \{\
. tm1 "[mom]: All three arguments to \\$0 at line \\n[.c] must be decimal.
. tm1 " Continuing to process using default link color.
. ds PDFHREF.COLOUR 0.0 0.3 0.9
. \}
. defcolor pdf:href.colour rgb \\*[PDFHREF.COLOUR]
. ds PDFHREF.TEXT.COLOUR pdf:href.colour
. \}
. el \{\
. ie \\n[.$]==0 \{\
. if dPDFHREF.TEXTCOL.DEFAULT \
. PDF_LINK_COLOR \\*[PDFHREF.TEXTCOL.DEFAULT]
. \}
. el \{\
. ds ARG_1 \\$1
. substring ARG_1 0 0
. ie '\\*[ARG_1]'#' \{\
. defcolor pdf:href.colour rgb \\$1
. ds PDFHREF.TEXT.COLOUR pdf:href.colour
. \}
. el \{\
. ie dCOLAL_\\$1 .ds PDFHREF.TEXT.COLOUR \\*[COLAL_\\$1]
. el .ds PDFHREF.TEXT.COLOUR \\$1
. \}
. \}
. \}
. if !\\n[PDFHREF_COLOR_SET]=1 \
. nr PDFHREF_COLOR_SET 1
.END
\#
.ALIAS PDF_LINK_COLOUR PDF_LINK_COLOR
\#
\# AUTO_RELOCATE_TOC
\# -----------------
\#
\# Call before START to have TOC automatically relocated to after the
\# DOC COVER (if there is one) or the COVER if there isn't
\#
.MAC AUTO_RELOCATE_TOC END
. if '\\$1'' .nr TOC.RELOCATE 1
. if '\\$1'TOP' .nr TOC.RELOCATE 2
. if '\\$1'BEFORE_DOCCOVER' .nr TOC.RELOCATE 3 \" Same as TOP unless no DOCCOVER
. if '\\$1'AFTER_DOCCOVER' .nr TOC.RELOCATE 4
. if '\\$1'BEFORE_COVER' .nr TOC.RELOCATE 5
. if '\\$1'AFTER_COVER' .nr TOC.RELOCATE 6
.END
\#
.ALIAS AUTO_TOC_RELOCATE AUTO_RELOCATE_TOC
\#
\# PDF_BOOKMARK
\# ------------
\# *Argument:
\# Hierarchy Level
\# Bookmark Text
\# *Function:
\# Creates a bookmark using the given text
\# The level controls the hierarchy of the bookmarks
\# *Notes
\# Bookmarks can be turned off (will not be added to document outline) by calling
\# "PDF_BOOKMARKS NO" and turned on with "PDF_BOOKMARKS".
\#
\# Bookmarks can be open or closed by calling PDF_BOOKMARKS_OPEN
\#
.MAC PDF_BOOKMARK END
. if \\n[#PDF_BOOKMARKS] \{\
. ie '\\$1'NAMED' \{\
. ds PDF_NM -T \\$2
. ds PDF_NM2 \\$2
. shift 2
. \}
. el .ds PDF_NM
. nr LEVEL_REQ \\$1
. shift
. ie \\n[LEVEL_REQ]>\\n[VIRTUAL_LEVEL] \{\
. nr VIRTUAL_LEVEL \\n[LEVEL_REQ]
. nr LEVEL_REQ \\n[CURRENT_LEVEL]+1
. \}
. el \{\
. ie \\n[LEVEL_REQ]<\\n[VIRTUAL_LEVEL] \{\
. nr VIRTUAL_DIFF \\n[VIRTUAL_LEVEL]-\\n[LEVEL_REQ]
. nr VIRTUAL_LEVEL \\n[LEVEL_REQ]
. nr LEVEL_REQ (\\n[CURRENT_LEVEL]-\\n[VIRTUAL_DIFF])>?1
. \}
. el .nr LEVEL_REQ \\n[CURRENT_LEVEL]
. \}
. ds PDF_TX \\$*
. pdfmomclean PDF_TX
. nr PDF_LEV (\\n[LEVEL_REQ]*\\n[#PDF_BOOKMARKS_OPEN])
. ie '\\*[.T]'ps' \{\
. if !'\\*[PDF_NM]'' \{\
. pdfhref M -N \\*[PDF_NM2] -- \\*[PDF_TX]
. if !dpdf:href.map .tm gropdf-info:href \\*[PDF_NM2] \\*[PDF_TX]
. \}
. pdfbookmark \\n[PDF_LEV] \\*[PDF_TX]
. \}
. el .pdfbookmark \\*[PDF_NM] \\n[PDF_LEV] \\$*
. nr CURRENT_LEVEL \\n[LEVEL_REQ]
. rr LEVEL_REQ
. rr PDF_LEV
. rr VIRTUAL_DIFF
. rm PDF_NM
. \}
.END
\#
\# PDF_TITLE
\# ---------
\# *Argument:
\# Title Text
\# *Function
\# Set the PDF title (this is often used by PDF readers to title the main window)
\#
.MAC PDF_TITLE END
. ds pdftitle \\$*
. pdfmomclean pdftitle
. nop \!x X ps:exec [/Title (\\*[pdftitle]) /DOCINFO pdfmark
.END
\#
\# PDF_BOOKMARKS
\# -------------
\# *Argument:
\# <nothing> | <anything>
\# *Function:
\# With no parameter turns on outline bookmarks
\# With any parameter turns off outline bookmarks
\#
.MAC PDF_BOOKMARKS END
. ie '\\$1'' .nr #PDF_BOOKMARKS 1
. el .nr #PDF_BOOKMARKS 0
.END
\#
\# PDF_BOOKMARKS_OPEN
\# ------------------
\# *Argument:
\# <number> | <nothing> | <text>
\# *Function:
\# If arg is numeric all Bookmark levels > arg are closed
\# If arg is empty all bookmarks are open
\# If arg is any text then any following bookmarks are closed
\#
.MAC PDF_BOOKMARKS_OPEN END
. ie \B'\\$1' \{\
. nr PDFOUTLINE.FOLDLEVEL \\$1
. nr #PDF_BOOKMARKS_OPEN 1
. \}
. el .if '\\*[.T]'pdf' \{\
. nr PDFOUTLINE.FOLDLEVEL 10000
. ie '\\$1'' .nr #PDF_BOOKMARKS_OPEN 1
. el .nr #PDF_BOOKMARKS_OPEN 0-1
. \}
.END
\#
\# PDF_LINK
\# --------
\# *Arguments:
\# $1 = named link
\# [PREFIX text] : text to prefix link
\# [SUFFIX text] : text after link
\# text
\# *Notes
\# Text is output as a hotspot link to named destination.
\# If text has final '*' it is replaced with the text associated with the link
\#
.MAC PDF_LINK END
. ds PDF_NM \\$1
. shift
. ie '\\$1'PREFIX' \{\
. ds PDF_PRE -P "\&\\$2"
. shift 2
. \}
. el .ds PDF_PRE
. ie '\\$1'SUFFIX' \{\
. ds PDF_POST -A "\\$2"
. shift 2
. \}
. el .ds PDF_POST
. ds PDF_AST_Q
. ds PDF_TXT \&\\$1
. ds PDF_AST \\*[PDF_TXT]
. substring PDF_AST -1 -1
. if '\\*[PDF_AST]'+' \{\
. ds PDF_AST *
. ds PDF_AST_Q ""
. \}
. if '\\*[PDF_AST]'*' \{\
. chop PDF_TXT
. ie '\\*[.T]'pdf' \{\
. ie d pdf:look(\\*[PDF_NM]) \
. as PDF_TXT \&\\*[PDF_AST_Q]\\*[pdf:look(\\*[PDF_NM])]\\*[PDF_AST_Q]
. el \{\
. as PDF_TXT Unknown
. if !rPDF_UNKNOWN .tm \
\\n[.F]:\\n[.c]: forward reference detected (please run using 'pdfmom')
. nr PDF_UNKNOWN 1
. \}
. \}
. el \{\
. ie d pdf:href(\\*[PDF_NM]).info \
. as PDF_TXT \&\\*[PDF_AST_Q]\\*[pdf:href(\\*[PDF_NM]).info]\\*[PDF_AST_Q]
. el .as PDF_TXT Unknown
. \}
. \}
. pdfhref L \\*[PDF_PRE] \\*[PDF_POST] -D \\*[PDF_NM] -- \\*[PDF_TXT]
. rm PDF_NM
. rm PDF_PRE
. rm PDF_POST
. rm PDF_TXT
. rm PDF_AST
. rm PDF_AST_Q
.END
\#
.MAC PDF_WWW_LINK END
. ds PDF_NM \\$1
. shift
. ie '\\$1'PREFIX' \{\
. ds PDF_PRE -P "\\$2"
. shift 2
. \}
. el .ds PDF_PRE
. ie '\\$1'SUFFIX' \{\
. ds PDF_POST -A "\\$2"
. shift 2
. \}
. el .ds PDF_POST
. ds PDF_AST_Q
. ds PDF_TXT \\$1
. ie !'\\*[PDF_TXT]'' \{\
. ds PDF_AST \\*[PDF_TXT]
. substring PDF_AST -1 -1
. if '\\*[PDF_AST]'+' \{\
. ds PDF_AST *
. ds PDF_AST_Q ""
. \}
. if '\\*[PDF_AST]'*' \{\
. chop PDF_TXT
. as PDF_TXT \&\\*[PDF_AST_Q]\\*[PDF_NM]\\*[PDF_AST_Q]
. \}
. \}
. el .ds PDF_TXT \\*[PDF_NM]
. pdfhref W -D "\\*[PDF_NM]" \\*[PDF_PRE] \\*[PDF_POST] -- \\*[PDF_TXT]
. rm PDF_NM
. rm PDF_PRE
. rm PDF_POST
. rm PDF_TXT
. rm PDF_AST PDF_AST_Q
.END
\#
.MAC PDF_TARGET END
. ds ARG_1 \\$1
. shift
. ie '\\$*'' .pdfhref M -N \\*[ARG_1] -- \\$*
. el .pdfhref M -N \\*[ARG_1] -E -- \\$*
. if '\\*[.T]'ps' .if !dpdf:href.map .tm gropdf-info:href \\*[ARG_1] \\$*
.END
\#
\# PDF_IMAGE
\# ---------
\# *Arguments:
\# [ -L -| -R | -C | -I <indent> ] \
\# <image file> <width> <height> \
\# [ SCALE <factor> ] [ ADJUST +|-<vertical shift> ] [ TARGET <pdf target> ] \
\# [ NO_SHIM ] [ NO_FLEX ]
\# *Function:
\# Allows embedding of PDF images with the same arguments as PSPIC
\# plus SCALE and ADJUST options.
\# *Notes:
\# <image file> <width> <height> are required.
\#
.MAC PDF_IMAGE END
. br
. if !'\\n[.z]'FLOAT*DIV' \{\
. nr pdf-img:float 1
. FLOAT
. \}
. PDF_TARGET fig:\\n+[lists*target]
. nr float*img 1
. ds ev-current \\n[.ev]
. ev IMG
. evc \\*[ev-current]
. if \\n[#HYPHENATE] .nh
. nr ind-pre-img \\n[.i]
. nr ll-pre-img \\n[.l]
. in 0
. ds pos:tmp \\$1
. substring pos:tmp 0 0
. ie !'\\*[pos:tmp]'-' .ds pdf-img:pos -C
. el \{\
. ds pdf-img:pos \\$1
. shift
. \}
. if '\\*[pdf-img:pos]'-I' \{\
. nr pdf-img:ind \\$1
. shift
. \}
. ds pdf-img:file \\$1
. ds pdf-img@file \\$1
. substring pdf-img@file -1 -3
. if !'\\*[pdf-img@file]'pdf' \{\
. tm1 "[mom]: Image file '\\*[pdf-img:file]' at line \\n[.c] not found, or not a PDF image.
. ab [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
. \}
. nr pdf-img:width \\$2
. nr pdf-img:depth \\$3
. shift 3
. nr loop-counter \\n[#NUM_ARGS]
. nr loop-count 0 1
. while \\n+[loop-count]<=\\n[loop-counter] \{\
. if '\\$1'SCALE' \{\
. shift
. nr pdf-img:scale \\$1
. shift
. nr pdf-img:width \\n[pdf-img:width]*\\n[pdf-img:scale]/100
. nr pdf-img:depth \\n[pdf-img:depth]*\\n[pdf-img:scale]/100
. \}
. if '\\$1'ADJUST' \{\
. shift
. ds pdf-img:adj \\$1
. shift
. \}
. if '\\$1'FRAME' \{\
. nr pdf-img:frame 1
. if !r pdf-img:frame-inset .nr pdf-img:frame-inset 6p
. shift
. \}
. if '\\$1'CAPTION' \{\
. nr pdf-img*have-caption 1
. ds pdf-img*caption \\$2
. shift 2
. \}
. if '\\$1'SHORT_CAPTION' \{\
. ds pdf-img*caption-short \\$2
. shift 2
. \}
. if '\\$1'LABEL' \{\
. nr pdf-img*have-label 1
. ds pdf-img*label \\$2
. ds label-type pdf-img
. shift 2
. \}
. if '\\$1'TARGET' \{\
. ds target "\\$2
. PDF_TARGET "\\*[target]
. shift 2
. \}
. if '\\$1'NO_SHIM' \{\
. if !'\\n[.z]'FLOAT*DIV' .nr pdf-img*no-shim 1
. nr @no-shim 1
. shift 1
. \}
. if '\\$1'NO_FLEX' \{\
. nr pdf-img*no-flex 1
. nr @no-flex 1
. shift 1
. \}
. \}
. if (\\n[pdf-img*have-label]=1):(\\n[pdf-img*autolabel]=1) \
. ds label-type pdf-img
. if !'\\*[pdf-img*label-sffx]'' \{\
. ds pdf-img*label-sffx-tmp \\*[pdf-img*label-sffx]
. substring pdf-img*label-sffx-tmp -1
. if '\\*[pdf-img*label-sffx-tmp]'.' \
. if \\n[pdf-img*caption-after-label]=0 .chop pdf-img*label-sffx
. \}
. if '\\*[pdf-img:pos]'-C' \
. nr pdf-img:ind (\\n[.ll]-\\n[ind-pre-img]-\\n[pdf-img:width])/2
. if '\\*[pdf-img:pos]'-R' \
. nr pdf-img:ind \\n[.ll]-\\n[pdf-img:width]-\\n[ind-pre-img]
. if \\n[pdf-img*label-with-chapter] \
. ds chapno \\n[#CH_NUM].
. if \\n[pdf-img*autolabel] \{\
. ds pdf-img*label \\*[pdf-img*label-prfx]\\*[chapno]\\n+[fig*label-num]\\*[pdf-img*label-sffx]
. nr fig*label-width \w'\\*[pdf-img*label]'
. nr fig*label-num -1
. \}
. if !'\\*[pdf-img*caption-short]'' .ds short -short
. if \\n[#PDF_BOOKMARKS] \{\
. ie (\\n[pdf-img*have-label]=1):(\\n[pdf-img*autolabel]=1) \{\
\!. TO_FIGURES "\\*[pdf-img*label]" "\\*[pdf-img*caption\\*[short]]"
. \}
. el \{\
\!. if !'\\*[pdf-img*caption\\*[short]]'' \
\!. TO_FIGURES "\\*[pdf-img*caption\\*[short]]"
. \}
. \}
. if r IMG \{\
. if \\n[pdfbx-top] \
. rt
. sp (\\*[wt\\n[stack]]/2u)+\\*[gap\\n[stack]]u
. nr img*pdfbx 1
. \}
. di PDF*IMAGE
. if \\n[@TOP] \{\
. ch RR_@TOP
. rs
. nop \&
. sp -1v
. \}
. if \\n[pdf-img*have-caption] \{\
. if !\\n[pdf-img*autolabel] \{\
. if !\\n[pdf-img*have-label] \{\
. if \\n[#MLA] \
. mla@error caption label \\n[.F] \\$0 \\n[.c]
. \}
. \}
. if !\\n[pdf-img*caption-after-label] \{\
. if !r pdfbx-top \
. if !\\n[@TOP] \!.sp .5v
. nr lead-pre-caption \\n[.v]
. ev caption
. evc IMG
. ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
. el \{\
. img*caption-style
. vs \\n[.ps]u+\\n[pdf-img*caption-autolead]u
. \}
. if r pdfbx-top .nr restore-pdfbx-top 1
. PDF_IMG*SET_CAPTION_QUAD \\*[pdf-img*caption-quad]
. if r restore-pdfbx-top \{\
. nr pdfbx-top 1
. rr restore-pdfbx-top
. \}
. nr pdf-img*caption-top-lead-diff \\n[lead-pre-caption]-\\n[.v]
. if r pdfbx-top \{\
. SIZESPECS
. rt
. sp \\n[pdf-img*caption-top-lead-diff]u
. sp (\\*[wt\\n[stack]])+\\*[gap\\n[stack]]u+\\*[$CAP_HEIGHT]
. rr pdfbx-top
. \}
. if \\n[pdfbx-running] \{\
. in -(\\*[wt\\n[stack]])+\\*[gap\\n[stack]]u
. ll -(\\*[wt\\n[stack]])+\\*[gap\\n[stack]]u
. \}
. nop \\*[pdf-img*caption]
. if r pdfbx-running \{\
. in
. ll
. \}
. br
. if !'\\*[pdf-img*caption-space]'' .sp \\*[pdf-img*caption-space]
. ev
. in 0
. sp -.5v
. \}
. \}
. nf
. if \\n[pdf-img:frame] \{\
. nr frame-width \\n[pdf-img:width]+(\\n[pdf-img:frame-inset]*2)
. nr frame-depth \\n[pdf-img:depth]+(\\n[pdf-img:frame-inset]*2)
. if '\\*[pdf-img:pos]'-L' \{\
. nr pdf-img:ind \\n[pdf-img:frame-inset]
. nr pdf-img:dbx-ind 0
. \}
. if '\\*[pdf-img:pos]'-C' \{\
. nr pdf-img:dbx-ind \
\\n[.ll]-\\n[ind-pre-img]-\\n[pdf-img:width]/2-\\n[pdf-img:frame-inset]
. \}
. if '\\*[pdf-img:pos]'-R' \{\
. nr pdf-img:ind -\\n[pdf-img:frame-inset]
. nr pdf-img:dbx-ind \
\\n[.l]u-(\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u)+\\n[ind-pre-img]u)
. \}
. if '\\*[pdf-img:pos]'-I' \{\
. nr pdf-img:ind +\\n[pdf-img:frame-inset]
. nr pdf-img:dbx-ind \\n[pdf-img:ind]-\\n[pdf-img:frame-inset]
. \}
. DBX \\*[pdf-img:frame-weight] \
\\n[pdf-img:dbx-ind]u \
\\n[frame-width]u \
\\n[frame-depth]u \
\\*[pdf-img:frame-color]
. sp \\n[pdf-img:frame-inset]u
. nr pdf-img:ind -\\n[pdf-img:frame-inset]
. \}
. ti \\n[pdf-img:ind]u+\\n[pdf-img:frame-inset]u
. nop \X'pdf: pdfpic \\*[pdf-img:file] -L \\n[pdf-img:width]z \\n[pdf-img:depth]z'
. if r pdfbx-top .rr pdfbx-top
. if '\\*[pdf-img:pos]'-C' .nr pdf-img:ind +\\n[pdf-img:frame-inset]
. sp \\n[pdf-img:depth]u
. if \\n[pdf-img:frame] .sp \\n[pdf-img:frame-inset]u
. if (\\n[pdf-img*have-label]=1):(\\n[pdf-img*autolabel]=1):(\\n[pdf-img*caption-after-label]=1) \{\
. if \\n[#MLA] \{\
. if (\\n[pdf-img*have-label]=1):(\\n[pdf-img*autolabel]=1) \{\
. if !\\n[pdf-img*have-caption] \
. mla@error label caption \\n[.F] \\$0 \\n[.c]
. \}
. \}
. nr lead-pre-label \\n[.v]
. ev label
. evc IMG
. ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
. el \{\
. img*label-style
. vs \\n[.ps]u+\\n[pdf-img*label-autolead]u
. \}
. if \\n[pdf-img*label-with-chapter] \
. ds chapno \\n[#CH_NUM].
. PDF_IMG*SET_LABEL_QUAD \\*[pdf-img*label-quad]
. SIZESPECS
. nr pdf-img*label-lead-diff \\n[lead-pre-label]-\\n[.v]
. sp -.5+\\*[$CAP_HEIGHT]+\\n[pdf-img*label-lead-diff]u
. if !'\\*[pdf-img*label-space]'' .sp \\*[pdf-img*label-space]
. if \\n[pdfbx-running] \{\
. in -(\\*[wt\\n[stack]])+\\*[gap\\n[stack]]u
. ll -(\\*[wt\\n[stack]])+\\*[gap\\n[stack]]u
. \}
. ie \\n[pdf-img*autolabel] \{\
. nop \
\\*[pdf-img*label-prfx]\\*[chapno]\\n+[fig*label-num]\\*[pdf-img*label-sffx]\|
. ds pdf-img*label \\*[chapno]\\n[fig*label-num]
. if dLABEL.REFS \
. tm .ds \\*[target] \\*[chapno]\\n[fig*label-num]
. rm target
. \}
. el .if !'\\*[pdf-img*label]'' .nop \\*[pdf-img*label]
. fam
. ft
. ps
. if r pdfbx-running \{\
. in
. ll
. \}
. gcolor
. if !'\\*[pdf-img*caption]'' \{\
. if \\n[pdf-img*caption-after-label] \{\
. ds pdf-img*caption-old \\*[pdf-img*caption]
. ds pdf-img*caption " \\*[pdf-img*caption]
. nop \\*[pdf-img*caption-specs]\\*[pdf-img*caption]\\*[revert-specs]
. ds pdf-img*caption \\*[pdf-img*caption-old]
. \}
. \}
. br
. ev
. in 0
. \}
\!. in
. di
. nf
. vpt 0
. if !'\\*[pdf-img:adj]'' \{\
. if \\n[@TOP] \
. if \\n[#COLUMNS]>1 \
\!. rs
\!. sp \\*[pdf-img:adj]
. \}
. PDF*IMAGE
. if !'\\*[pdf-img:adj]'' \
. if !\\n[@TOP] \!.sp -\\*[pdf-img:adj]
. vpt
. ev
. if \\n[pdf-img:float] \{\
. FLOAT off
. nr dl \\n[pdf-img:width]
. \}
. if \\n[img*pdfbx] \{\
. sp .5
. nr img*pdfbx 2
. \}
. if !\\n[pdf-img:float] \{\
. ie !\\n[#NO_SHIM] \
. if !\\n[pdf-img*no-shim] .SHIM
. el \
. if !\\n[#NO_FLEX] \
. if !\\n[pdf-img*no-flex] .FLEX
. \}
. PDF_IMAGE_CLEAN
.END
\#
\# PDF_IMAGE_FRAME
\# ---------------
\# *Arguments:
\# [ <inset> ] [ <rule weight> ] [ <color> ]
\# *Function:
\# Sets parameters for pdf image frames.
\# *Notes:
\# Defaults are '6p' '.5' 'black'. Arguments to be left at default
\# must be entered as "".
\#
.MAC PDF_IMAGE_FRAME END
. ie !'\\$1''\{\
. ds frame-arg \\$1
. substring frame-arg -1
. ie \B'\\*[frame-arg]' \{\
. tm1 "[mom]: \\$0 inset argument at line \\n[.c]
. tm1 " of '\\n[.F]' requires a unit of measure.
. tm1 " Default 6 point inset will be used instead.
. \}
. el \{\
. nr pdf-img:frame-inset \\$1
. shift
. \}
. \}
. el .shift
. ie !'\\$1'' \{\
. ds frame-arg \\$1
. substring frame-arg -1
. ie \B'\\*[frame-arg]' \{\
. ds pdf-img:frame-weight \\$1
. shift
. \}
. el \{\
. ds frame-arg \\$1
. substring frame-arg -1
. length arg-len \\*[frame-arg]
. if \\n[arg-len]=1 \{\
. tm1 "[mom]: \\$0 rule weight argument at line \\n[.c]
. tm1 " of '\\n[.F]' must not have a unit of measure appended.
. tm1 " Default .5 rule weight will be used instead.
. shift
. \}
. \}
. \}
. el .shift
. if !'\\$1'' \{\
. ie m \\$1 .ds pdf-img:frame-color \\$1
. el \{\
. tm1 "[mom]: \\$0 color argument '\\$1' at line \\n[.c]
. tm1 " of '\\n[.F]' is not a valid color.
. tm1 " Default black will be used instead.
. \}
. \}
.END
\#
.MAC PDF_IMAGE_CLEAN END
. rm PDF*IMAGE
. rm pdf-img:adj
. rm pdf-img*caption
. rm pdf-img*caption-short
. rm pdf-img:file
. rm pdf-img*label
. rm pdf-img:pos
. rm short
. rr ind-pre-img
. rr pdf-img:depth
. rr pdf-img:float
. if !\\n[pdf-img:frame] \
. rr pdf-img:frame
. rr pdf-img:ind
. rr pdf-img:no-shim
. rr pdf-img:no-flex
. rr pdf-img:scale
. if !\\n[defer] \
. rr pdf-img*have-caption
. rr pdf-img:frame-inset
. rr pdf-img:width
. if '\\*[pdf-img*label-sffx-tmp]'.' .ds pdf-img*label-sffx .
. it 1 rr-img*pdfbx
.END
\#
.de pdfmomclean
. ie '\\n[.z]'' \{\
. ds pdfcleaned \\$*
. ev pdfcln
. tr \[em]-
. nf
. box pdf:clean
. nop \\*[\\*[pdfcleaned]]
. fl
. box
. chop pdf:clean
. asciify pdf:clean
. ev
. ds \\*[pdfcleaned] "\\*[pdf:clean]
. rm pdf:clean
. tr \[em]\[em]
. \}
. el .nop \!.pdfmomclean \\$@
..
\#
.MAC PAUSE END
. nr pdfbx-inhibit-space 1
. if \\n[pdfbx-running] \{\
. nr pdfbx-pause 1
. rr pdfbx-inhibit-space
. BoxStop
. \}
. vpt 0
. br
. vpt
. ie !'\\n[.z]'' \{\
\!. pdfpause
\!. pdftransition BLOCK \\$1
. \}
. el \{\
. pdfpause
. pdftransition BLOCK \\$1
. \}
. if \\n[pdfbx-pause] \{\
. BoxStart \\*[pdfbx-args]
. rr pdfbx-pause
. rr pdfbx-inhibit-space
. \}
.END
\#
.MAC TRANSITION END
. ie !'\\n[.z]'' \
\!. pdftransition PAGE \\$1
. el .pdftransition PAGE \\$1
.END
\#
\# Shaded backgrounds and frames (pdf boxes), page colour
\#
\# BOX
\# ---
\# *Arguments:
\# SHADED <color> | OUTLINED <color> \
\# [ WEIGHT <wt> ] [ INSET <dist> ] \
\# [ ADJUST +|-<amount> ] \
\# [ EQN | PIC | GRAP | IMG ]
\# *Function:
\# Calls BoxStart with the supplied arguments or stops a running
\# box.
\# *Notes:
\# If OUTLINED given but no WEIGHT, the default weight is .5p.
\# Otherwise, args have no defaults.
\#
.MAC BOX END
. nr #FROM_BOX 1
. ie \\n[#NUM_ARGS]=0 \
. BoxStart SHADED grey85 INSET 1P
. el \{\
. ie \\n[#NUM_ARGS]=1 .BoxStop
. el .BoxStart \\$*
. \}
. rr #FROM_BOX
.END
\#
\# PAGE COLOUR
\# -----------
\# *Arguments:
\# <color> | OFF | off
\# *Function:
\# Sets pagefill to <color> or stops pagefill.
\# *Notes:
\# OFF|off is required instead of the usual <anything>.
\#
.MAC PAGE_COLOR END
. ie !'\\$1'OFF' \{\
. ie !'\\$1'off' \{\
. fcolor \\$1
. device pdf: background pagefill
. \}
. el .device pdf: background off
. \}
. el .device pdf: background off
.END
\#
.ALIAS PAGE_COLOUR PAGE_COLOR
.ALIAS SLIDE_COLOR PAGE_COLOR
.ALIAS SLIDE_COLOUR PAGE_COLOR
\#
\# Begin or end a box; called from BoxStart
\#
.de pdfbackground
. device pdf: background \\$*
. if '\\$1'off' \{\
. ie (\\n[stack]-1)=0 \{\
. if \\n[.t]>(1.6v+(\\*[wt\\n[stack]]/2u)) \
. sp \\*[wt\\n[stack]]/2u
. \}
. el \{\
. nr pdfbx-container \\n[stack]-1
. if \\n[.t]>=((\\*[wt\\n[stack]]/2u)+(\\*[gap\\n[pdfbx-container]])+(\\*[wt\\n[pdfbx-container]])) \
. sp \\*[wt\\n[stack]]/2u
. \}
. \}
..
\#
\# Input trap macros
\#
.de rr-pdfbx-top
. rr pdfbx-top
..
\#
.de rr-pdfbx-end
. rr pdfbx-end
..
\#
.de rr-pdfbxstop
. rr pdfbxstop
..
\#
.de rr-pic*pdfbx
. rr pic*pdfbx
..
\#
.de rr-tbl*pdfbx
. rr tbl*pdfbx
..
\#
.de rr-img*pdfbx
. rr img*pdfbx
..
\#
.de rr-pdfbx-post-q
. rr pdfbx-post-q
..
\#
.de rr-pdfbx-div-start
. rr pdfbx-div-start
..
\#
\# Heavy lifting macros called from BOX.
\#
.de BoxStart
. ds pdfbx-args \\$*
. if \\n[pdfbx-inhibit-space] .sp -1
. rr pdfbx-inhibit-space
. if \\n[#PP_SPACE] \{\
. nr restore-pp-space 1
. PARA_SPACE off
. \}
. if \\n[#PRINT_STYLE]=1 \{\
. tm1 "[mom]: PRINTSTYLE TYPEWRITE does not permit shaded backgrounds and frames.
. tm1 " Continuing to process without backgrounds or frames.
. return
. \}
. if \\n[#COLUMNS] \{\
. tm1 "[mom]: Shaded backgrounds and frames are not available when COLUMNS are enabled.
. tm1 " Continuing to process without backgrounds or frames.
. return
. \}
. if \\n[Q-float]=1 .nr Q-float 2
. if !'\\n[.z]'' \{\
. nr pdfbx-div-start 1
\!. it 1 rr-pdfbx-div-start
. \}
. if !\\n[#NO_SHIM] \{\
. NO_SHIM
. nr pdfbx-restore-shim 1
. \}
. if !\\n[#NO_FLEX] \{\
. NO_FLEX
. nr pdfbx-restore-flex 1
. \}
. if (\\n[#NO_SHIM]=0)&(\\n[#NO_FLEX]=1) .nr pdfbx-restore-shim 1
. if (\\n[#NO_SHIM]=1)&(\\n[#NO_FLEX]=0) .nr pdfbx-restore-flex 1
. rr shad
. rr outl
. rm wt
. rm pdfbx-adj
. nr pdfbx-running 1
. nr pdfbx-top 1
. nr stack +1
. nr pdfbx-prev \\n[stack]-1
. ds type " "
. ie r #FROM_BOX .ds calling-macro BOX
. el .ds calling-macro \\$0
. while \\n[.$] \{\
. if !'\\$1'SHADED' \
. if !'\\$1'OUTLINED' \
. if !'\\$1'WEIGHT' \
. if !'\\$1'INSET' \
. if !'\\$1'PIC' \
. if !'\\$1'GRAP' \
. if !'\\$1'EQN' \
. if !'\\$1'IMG' \
. if !'\\$1'ADJUST' \{\
. tm [mom]: Invalid argument '\\$1' to \\*[calling-macro], line \\n[.c].
. shift 1
. \}
. if '\\$1'SHADED' \{\
. nop \\M[\\$2]\c
. nr shad 1
. chop type
. as type "fill"
. shift 2
. \}
. if '\\$1'OUTLINED' \{\
. nop \\m[\\$2]\c
. nr outl 1
. chop type
. as type "box"
. shift 2
. \}
. if '\\$1'WEIGHT' \{\
. ds wt \\$2
. shift 2
. \}
. if '\\$1'INSET' \{\
. nr gap \\$2
. shift 2
. \}
. if '\\$1'ADJUST' \{\
. ds pdfbx-adj \\$2
. shift 2
. \}
. if '\\$1'PIC' \{\
. ie '\\n[.z]'FLOAT*DIV' .nr PIC 2
. el .nr PIC 1
. shift 1
. \}
. if '\\$1'GRAP' \{\
. ie '\\n[.z]'FLOAT*DIV' .nr PIC 2
. el .nr PIC 1
. shift 1
. \}
. if '\\$1'EQN' \{\
. nr EQN 1
. shift 1
. \}
. if '\\$1'IMG' \{\
. nr IMG 1
. shift 1
. \}
. \}
. if '\\*[type]' ' .ds type "fill "
. chop type
. if !r gap .nr gap 1P
. ie \\n[outl] \
. if '\\*[wt]'' .ds wt .5p
. el .ds wt 0
. if d pdfbx-adj .sp \\*[pdfbx-adj]
. if \\n[@TOP] \{\
. RESTORE_SPACE
. sp -1
. nr @TOP 1
. \}
. nr pdfbxstop 1 \" Stop box in footer if .br causes a page break
. br
. if \\n[Q-float]=2 .sp -.5
. rr pdfbxstop
. fl
. SIZESPECS
. ds pdfbx-cap-adj \\*[$CAP_HEIGHT]
.\" Top spacing
. if \\n[#EPIGRAPH]+\\n[#QUOTE]=0 \
. if \\n[#START] .sp -2
. if \\n[#EPIGRAPH] \{\
. ie \\n[#START] \!.sp -2
. el \!.sp -1.5
. \}
. if \\n[#QUOTE] \{\
. if !\\n[@TOP] \!.sp -.5-\\*[pdfbx-cap-adj]
. if \\n[#START] \!.sp .5+\\*[wt]
. rr @TOP
. \}
. if '\\n[.z]'FLOAT*DIV' \{\
. if !\\n[#START] \!.sp -1
. nr no-top-space:1 1
. nr pdfboxed 1
. \}
. if \\n[stack]=1 \{\
. if \\n[#INDENT_LEFT_ACTIVE] .nr #IL_ACTIVE \\n[#L_INDENT]
. if \\n[#INDENT_RIGHT_ACTIVE] .nr #IR_ACTIVE \\n[#R_INDENT]
. if \\n[#INDENT_BOTH_ACTIVE] \{\
. nr #IBL_ACTIVE \\n[#BL_INDENT]
. nr #IBR_ACTIVE \\n[#BR_INDENT]
. \}
. if \\n[#IN_ITEM] \
. if \\n[#BR_INDENT] .nr #IBR_ACTIVE \\n[#BR_INDENT]
. \}
.\" Set l
. nr pdfbx-l \\n[#L_MARGIN]
. if \\n[#EPIGRAPH]=2 \{\
. GET_EPI_OFFSET
. nr pdfbx-l \\n[#EPI_OFFSET]
. \}
. if \\n[#QUOTE]=2 \{\
. ie \\n[#BQ_OFFSET_VALUE] \
. nr pdfbx-l \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#BQ_OFFSET_VALUE])
. el \
. nr pdfbx-l \\n[#L_MARGIN]+(\\*[$BQ_OFFSET_VALUE])
. \}
. ie \\n[stack]=1 \
. nr l \\n[pdfbx-l]+(\\*[wt]/2)+\\n[#IL_ACTIVE]+\\n[#IBL_ACTIVE]
. el .nr l +(\\*[wt\\n[pdfbx-prev]]/2)+\\*[gap\\n[pdfbx-prev]]+(\\*[wt]/2)
.\" Set r
. nr r \\n[pdfbx-l]+\\n[.l]-(\\*[wt]/2u)
. if \\n[#QUOTE]=1 .nr r \\n[pdfbx-l]+\\n[#L_LENGTH]-(\\*[wt]/2)
. if \\n[#IR_ACTIVE] .nr r \\n[pdfbx-l]+\\n[#L_LENGTH]-\\n[#IR_ACTIVE]-(\\*[wt]/2)
. if \\n[#IBR_ACTIVE] .nr r \\n[pdfbx-l]+\\n[#L_LENGTH]-\\n[#IBR_ACTIVE]-(\\*[wt]/2)
.\" Set t
. ie \\n[stack]=1 .nr t \\n[#T_MARGIN]+(\\*[wt]/2)
. el .nr t +(\\*[wt\\n[pdfbx-prev]]/2)+\\*[gap\\n[pdfbx-prev]]+(\\*[wt]/2)
.\" Set b
. nr b \\n[.p]+\\n[#VARIABLE_FOOTER_POS]-(\\*[wt]/2)+\\n[#DOC_LEAD]u
.\" Clear indents
. if \\n[stack]=1 \{\
. nr pdfbx-clear 1
. ILX CLEAR
. IRX CLEAR
. if !\\n[#QUOTE]=2 \
. if !\\n[#EPIGRAPH]=2 \
. IBX CLEAR
. if \\n[#IR_ACTIVE] .nr pdfbx-pre-ll \\n[#L_LENGTH]
. rr pdfbx-clear
. \}
.\" See if box fits
.\" PIC and IMG are in floats, which take care of fit/defer.
. if (\\n[PIC]=0)&(\\n[IMG]=0) \{\
. if '\\n[.z]'' \{\
. nr pdfbx-min \
(\\*[wt]*2)+\\*[pdfbx-cap-adj]+(\\n[gap]*2)
. if r EQN .nr pdfbx-min +1v
. if \\n[.t]<\\n[pdfbx-min] \{\
. rr pdfbx-running
. bp
. nr pdfbx-running 1
. RESTORE_SPACE
. \}
. \}
. \}
.\" FOOTER trap
. if !r #VFP0 .nr #VFP0 \\n[#VARIABLE_FOOTER_POS]
. nr #VFP\\n[stack] 0\\n[#VFP\\n[pdfbx-prev]]-\\*[wt]-\\n[gap]
. nr #VARIABLE_FOOTER_POS 0\\n[#VFP\\n[stack]]
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. mk
. sp \\*[wt]/2u
.
. pdfbackground \\*[type] \\n[l]z \\n[t]z \\n[r]z \\n[b]z \\*[wt]
.
.\" Always start at wt+gap
. ie \\n[#IL_ACTIVE]:\\n[#IBL_ACTIVE] \
. IL \\n[gap]u+\\*[wt]+\\n[#IL_ACTIVE]u+\\n[#IBL_ACTIVE]u
. el .IL \\n[gap]u+\\*[wt]
. ie \\n[#IR_ACTIVE]:\\n[#IBR_ACTIVE] \
. IR \\n[gap]u+\\*[wt]+\\n[#IR_ACTIVE]u+\\n[#IBR_ACTIVE]u
. el .IR \\n[gap]u+\\*[wt]
. nr pdfbx-ll \\n[.l]
. rt
. sp \\*[wt]+\\*[pdfbx-cap-adj]+\\n[gap]u
. if (\\n[shad]=1) .nop \\M[]\c
. if (\\n[outl]=1) .nop \\m[]\c
. ds gap\\n[stack] \\n[gap]
. ds wt\\n[stack] \\*[wt]
. rm wt type
. it 2 rr-pdfbx-top
..
\#
.de BoxStop
. if \\n[#PRINT_STYLE]=1 .return
. if \\n[#COLUMNS]=1 .return
. if \\n[#QUOTE]=1 .nr pdfboxed 1
. if \\n[pdfbx-end]=\\n[nl] \{\
. ie !'\\n[.z]'FLOAT*DIV' .nr pdfbxstop-consec 1
. el \
\!. if '\\n[.z]'FLOAT*DIV' .nr pdfbxstop-consec 1
. rr pdfbx-end
. \}
. nr pdfbxstop 1 \" Stop box in footer if EOL causes a page break
. if !'\\n[.z]'' \!.nr pdfbxstop 1
. EOL
. rr pdfbxstop
. if (\\n[.ns]+\\n[@TOP])>0 .RESTORE_SPACE
. nr pdfbx-prev \\n[stack]-1
. nr #VARIABLE_FOOTER_POS 0\\n[#VFP\\n[pdfbx-prev]]
. if \\n[stack]=1 \{\
. if !\\n[#FN_COUNT] .nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
. \}
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. if !'\\n[.z]'' \!.ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. ie !r pdfbxstop-consec \{\
. sp \\*[gap\\n[stack]]u+(\\*[wt\\n[stack]]/2u)
. if r tbl*pdfbx \{\
. if \\n[tbl*pdfbx]=1 .sp -.6
. if \\n[tbl*pdfbx]=2 .sp -.6-1p
. if \\n[tbl*pdfbx]=3 .sp -.6+1.5p
. \}
. if r eqn*pdfbx \{\
. if \\n[eqn*pdfbx]=1 .sp -.75
. if \\n[eqn*pdfbx]=2 .sp -.5
. rr eqn*pdfbx
. \}
. \}
. el \{\
. sp
. if r pdfbx-post-space .sp -\\n[pdfbx-post-space]u
. rr pdfbx-post-space
. sp (\\*[wt\\n[stack]]/2u)+\\*[gap\\n[stack]]u
. if \\n[.t]<(\\*[wt\\n[stack]]+\\*[gap\\n[stack]]) \{\
. nr pdfbx-container \\n[stack]+1
. sp \\*[wt\\n[pdfbx-container]]/2u
. \}
. \}
. if \\n[pic*pdfbx]=2 \
. sp -.5
. if \\n[grap] \
. if \\n[pic*have-label] \
. sp .5
. if \\n[img*pdfbx]=2 \
. sp -.5
.
. pdfbackground off
.
. EOL
. if \\n[.t]<1v \{\
. nr pdfbxstop 1 \" Stop box in footer if .br causes a page break
. br
. \}
. if \\n[pdfbx-pause] .sp -2
. if \\n[pic*pdfbx] \
. if \\n[pic*have-label] .sp .5
. IL -(\\*[gap\\n[stack]]u+\\*[wt\\n[stack]])
. IR -(\\*[gap\\n[stack]]u+\\*[wt\\n[stack]])
.\" Bottom spacing
.\" If the .sp or .br in the ie/el clause causes a break, tell
.\" HEADER to skip the PDF boxes stanza.
. nr pdfbxstop 1
. if !'\\n[.z]'' \!.nr pdfbxstop 1
. if '\\n[.z]'FLOAT*DIV' .if \\n[float*tbl] .sp -.5
. ie \\n[.t]>1v \{\
. nr pdfbx-post-space 1.6v
. if \\n[#EPIGRAPH] \
. nr pdfbx-post-space .6v
. \}
. el .br
. rr pdfbxstop
. if '\\n[.z]'FLOAT*DIV' \!.rr pdfbxstop
. sp \\n[pdfbx-post-space]u
. if \\n[pic*pdfbx] \
. sp -.5
. if \\n[img*pdfbx] \
. sp -.5
. if \\n[#QUOTE] .sp -.5+(\\*[wt\\n[stack]]/2u)
. nr pdfbx-end \\n[nl]
. it 2 rr-pdfbx-end
. rr pdfbxstop-consec
. ie '\\n[.z]'' .rr pdfbx-running
. el \{\
\!. rr pdfbx-running
\!. nr pdfbx-defer 1
. \}
. ie '\\n[.z]'' .nr stack \\n[stack]-1
. el \{\
\!.nr stack-for-float \\n[stack]
\!.nr stack \\n[stack]-1
. \}
. if \\n[pic*pdfbx] .rr pic*pdfbx
. if \\n[tbl*pdfbx] .rr tbl*pdfbx
. if \\n[img*pdfbx] .rr img*pdfbx
. if \\n[stack]=0 \{\
. ILX CLEAR
. IRX CLEAR
. IBX CLEAR
. if \\n[#IL_ACTIVE] \{\
. nr #L_INDENT \\n[#IL_ACTIVE]
. IL
. rr #IL_ACTIVE
. \}
. if \\n[#IR_ACTIVE] \{\
. nr #R_INDENT \\n[#IR_ACTIVE]
. ll \\n[pdfbx-pre-ll]u
. IR
. rr pdfbx-pre-ll
. rr #IR_ACTIVE
. \}
. if \\n[#IBR_ACTIVE] \{\
. ll \\n[pdfbx-pre-ll]u
. IB \\n[#IBL_ACTIVE]u \\n[#IBR_ACTIVE]u
. rr pdfbx-pre-ll
. rr #IBR_ACTIVE
. rr #IBL_ACTIVE
. \}
. if r PIC \{\
. rr pic*pdfbx
. rr PIC
. \}
. if r EQN \{\
. rr eqn*pdfbx
. rr EQN
. \}
. if r IMG \{\
. rr img*pdfbx
. rr IMG
. \}
. \}
. if '\\n[.z]'P_QUOTE' \{\
. nr pdfbx-post-q 1
. it 2 rr-pdfbx-post-q
. \}
. if d pdfbx-adj .rm pdfbx-adj
. if \\n[restore-pp-space] \{\
. rr restore-pp-space
. PARA_SPACE
. \}
. if \\n[pdfbx-restore-shim] \{\
. NO_SHIM off
. rr pdfbx-restore-shim
. \}
. if \\n[pdfbx-restore-flex] \{\
. NO_FLEX off
. rr pdfbx-restore-flex
. \}
. ie '\\n[.z]'' \{\
. if \\n[stack]=0 \{\
. rr #VFP0
. if !\\n[#NO_SHIM] .SHIM
. if !\\n[#NO_FLEX] .FLEX
. \}
. \}
. el \{\
\!. if (\\\\n[stack]=0) \{\
. rr #VFP0
. if !r #EPIGRAPH \!.SHIM
. \}
. \}
..
\#
\# Local Variables:
\# mode: nroff
\# End:
\# vim: filetype=groff:
|