summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tugboat/tugboat.dtx
blob: 6ed75cece1195d8fbf164b44d7a012cd932ed7ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
% \iffalse (this is a meta-comment (so they say))
% $Id: tugboat.dtx 274 2020-03-12 16:47:21Z karl $
% tugboat.dtx - main source for LaTeX TUGboat classes.
%
% Copyright 1994-2020 TeX Users Group.
%
% This file is part of the tugboat package.
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% \fi
%
% \section{Document preambles}
%
%    \begin{macrocode}
%<ltugboatcls|ltugproccls|ltugcomn>\NeedsTeXFormat{LaTeX2e}[1994/12/01]
%<*dtx>
\ProvidesFile                 {tugboat.dtx}
%</dtx>
%<ltugboatcls>\ProvidesClass  {ltugboat}
%<ltugproccls>\ProvidesClass  {ltugproc}
%<ltugboatsty>\ProvidesPackage{ltugboat}
%<ltugprocsty>\ProvidesPackage{ltugproc}
%<ltugcomn>   \ProvidesPackage{ltugcomn}
                   [2020-03-12 v2.23
%<ltugboatcls>                       TUGboat journal class%
%<ltugproccls>                       TUG conference proceedings class%
%<ltugboatsty|ltugprocsty>           TUG compatibility package%
%<ltugcomn>                          TUGboat `common macros' package%
%<*dtx>
                                     TUG macros source file%
%</dtx>
                   ]
%    \end{macrocode}
%
% ^^A behold, a horrible hack...
%    \begin{macrocode}
%<*dtx>
\newif\ifoldlongtable
%</dtx>
%    \end{macrocode}
%
% \iffalse
%
% Note that the version control Id above relates to the number of times
% the file has been checked-in, which relates to a development process
% taking place on several machines, rather than the incidence of
% significant change; the definitive version number is that in the
% \Provides* things, while the $Id may provide a clue as to the latest
% date the documentation was worked on
%
% Code to compile the thing using \LaTeXe.
%
%    \begin{macrocode}
%<*driver>
\documentclass{ltxdoc}
%
\usepackage{ltugcomn} % generated using the .ins file
%
\usepackage{array,longtable}
%
% If longtable.sty is not ancient, then it doesn't need
% \cs{setlongtables}, so we avoid the setlong.tab game.
\GetFileInfo{longtable.sty}
\def\extractdate#1/#2/#3\relax{\def\fileyear{#1}%
  \def\filemonth{#2}%
  \def\fileday{#3}}
\expandafter\extractdate\filedate\relax
\expandafter\ifnum\fileyear>1996\relax
  \oldlongtablefalse
\else
  \oldlongtabletrue
  \expandafter\ifnum\fileyear=1996\relax
    \expandafter\ifnum\filemonth>5\relax
      \oldlongtablefalse
    \else
      \expandafter\ifnum\filemonth=5\relax
        \expandafter\ifnum\fileday>23\relax
          \oldlongtablefalse
        \fi
      \fi
    \fi
  \fi
\fi
\ifoldlongtable
  \InputIfFileExists{setlong.tab}{}% if this file exists, it should
%                                  % contain (only) \setlongtables
    {\typeout{*** create a file `setlong.tab' containing only}
     \typeout{***\space\space\space\string\setlongtables}
     \typeout{*** to get the tables of commands, etc., lined up}}
\fi
%
\begin{document}
 \GetFileInfo{tugboat.dtx}
 \title{The \textsf{tugboat} package\thanks{This file
        has version number \fileversion, last
        revised \filedate}}
    \author{The \TUB{} team}
 \date{\filedate}
 \maketitle
 \tableofcontents
 \DocInput{tugboat.dtx}
\end{document}
%</driver>
%    \end{macrocode}
%
% \fi
%
% \section{Introduction}
%
% This file contains all the macros for typesetting \TUB{} with
% both plain \TeX\ and \LaTeXe.
% \subsection{Summary of control sequences}
%
% Abbreviations.  Just a listing with indications of expansion where
% that may not be obvious.  For full definitions, see real code below
% (Section~\ref{abbr-logo}).
%
% \begin{longtable}{lp{3in}}
% |\AllTeX|&        (\La)\TeX\\
% |\AMS|&           American Mathematical Society\\
% |\AmSTeX|&\\
% |\aw|&            \aw\ (abbreviation for Addison-Wesley)\\
% |\API|&\\
% |\AW|&            Addison-Wesley\\
% |\BibTeX|&\\
% |\CandT|&         Computers \& Typesetting\\
% |\ConTeXt|&       \ConTeXt\\
% |\Cplusplus|&     C++\\
% |\DTD|&\\
% |\DVD|&\\
% |\DVI|&\\
% |\DVIPDFMx|&      \DVIPDFMx\\
% |\DVItoVDU|&      DVItoVDU\\
% |\ECMA|&\\
% |\EPS|&\\
% |\eTeX|&          \eTeX\\
% |\ExTeX|&         \ExTeX\\
% |\Ghostscript|&\\
% |\Hawaii|&        \Hawaii\\
% |\HTML|&\\
% |\ISBN|&          ISBN\\
% |\ISO|&\\
% |\ISSN|&          ISSN\\
% |\JTeX|&\\
% |\JoT|&           The Joy of \TeX\\
% |\LaTeX|&\\
% |\LyX|&\\
% |\MacOSX|&        Mac OS X\\
% |\MathML|&\\
% |\Mc|&            M with raised c\\
% |\MF|&            \MF\\
% |\mf|&            \textsc{Metafont}\\
% |\MFB|&           The Metafontbook\\
% |\MP|&            \MP\\
% |\mp|&            MetaPost (in text only: still `\ensuremath{\mp}' in math)\\
% |\OMEGA|&         Omega `logo' (\ensuremath{\Omega})\\
% |\OCP|&           Omega compiled process\\
% |\OOXML|&\\
% |\OTP|&           Omega translation process\\
% |\mtex|&          multilingual \TeX\\
% |\NTS|&           New Typesetting System\\
% |\pcMF|&          pcMF\\
% |\PCTeX|&\\
% |\pcTeX|&\\
% |\Pas|&           Pascal\\
% |\PiCTeX|&\\
% |\plain|&         plain (in typewriter font)\\
% |\POBox|&         P. O. Box\\
% |\PS|&            PostScript (with hyphenation)\\
% |\SC|&            Steering Committee\\
% |\SGML|&          SGML\\
% |\SliTeX|&\\
% |\slMF|&          Metafont, slanted: deprecated: use
%                   \cs{textsl} instead \\
% |\stTeX|&         \TeX{} for the Atari ST\\
% |\SVG|&\\
% |\TANGLE|&\\
% |\TB|&            The \TeX book\\
% |\TeX|&           (Although nearly every package defines this,
%                   most, including plain, are missing the
%                   spacefactor adjustment)\\
% |\TeXhax|&\\
% |\TeXMaG|&        (defunct)\\
% |\TeXtures|&\\
% |\TeXXeT|&\\
% |\Thanh|&\\
% |\TFM|&           \TFM\\
% |\TUB|&           \TUB\\
% |\TUG|&           \TeX{} Users Group\\
% |\UNIX|&\\
% |\VAX|&\\
% |\VnTeX|&\\
% |\VorTeX|&\\
% |\XeT|&\\
% |\XeTeX|&         reflected and lowered first `E'\\
% |\XeLaTeX|&       with extra space before `L'\\
% |\XML|&\\
% |\WEB|&\\
% |\WEAVE|&\\
% |\WYSIWYG|&\\
% \end{longtable}
%
% Macros for things that are slightly more significant.
%
% \begin{longtable}{lp{.6\textwidth}}
% |\NoBlackBoxes|&   turns off marginal rules marking overfull boxes\\
% |\BlackBoxes|&  turns them back on\\
% |\newline|&    horizontal glue plus a break\\
% |\ifundefined#1|&   checks argument with |\csname| against |\relax|\\
% |\topsmash|&   smashes above baseline (from AMSTeX)\\
% |\botsmash|&   smashes below baseline (from AMSTeX)\\
% |\smash|&   smashes both  (from plain)\\
% |\ulap|&   lap upwards\\
% |\dlap|&   lap downwards\\
% |\xlap|&   reference point at center horizontally; 0 width\\
% |\ylap|&   reference point at center vertically; 0 height, depth\\
% |\zlap|&   combination |\xlap| and |\ylap|\\
% |\basezero|&   to avoid insertion of baselineskip and lineskip glue\\
% |\nullhrule|&   empty |\hrule|\\
% |\nullvrule|&   empty |\vrule|\\
% |\makestrut[#1;#2]|& ad hoc struts; |#1|=height, |#2|=depth\\
% |\today|&   today's date\\
% |\SetTime|&    converts |\time| to hours, minutes\\
% |\now|&    displays time in hours and minutes\\
% |\Now|&    shows current date and time\\
% |\ifPrelimDraft|&   flag to indicate status as preliminary draft\\
% |\rtitlex|&    \TUB{} volume and number info for running head\\
% |\midrtitle|&   information for center of running head\\
% |\rtitlenexttopage|&   next to page number in running head\\
% |\HorzR@gisterRule|& pieces of registration marks (`trimmarks')\\
% |\DownShortR@gisterRule|&\\
% |\UpShortR@gisterRule|&\\
% |\ttopregister|&   top registration line with `T' in center\\
% |\tbotregister|&   bottom registration line with inverted `T' in center\\
% |\topregister|&  register actually used\\
% |\botregister|&\\
% |\raggedskip|&  parameters used for ragged settings\\
% |\raggedstretch|&\\
% |\raggedparfill|&\\
% |\raggedspaces|&\\
% |\raggedright|&\\
% |\raggedleft|&\\
% |\raggedcenter|&\\
% |\normalspaces|&\\
% |\raggedbottom|&\\
% |\bull|&       square bullet\\
% |\cents|&      `cents' sign\\
% |\Dag|&        superscripted dagger\\
% |\careof|&     c/o\\
% |\sfrac|&      slashed fraction (arguments optionally\\
% &              separated by a slash)\\
% |\cs|&         control sequence name\\
%      &         |\cs{name}|$\rightarrow$\cs{name}\\
% |\env|&        environment name \\
%       &        |\env{name}|$\rightarrow$\env{name}\\
% |\meta|&       meta-argument name\\
%        &       |\meta{name}|$\rightarrow$\meta{name}\\
% |\dash|&       en-dash surrounded by thinspaces; only breakable AFTER\\
% |\Dash|&       em-dash, as above\\
% |\hyph|&       permit automatic hyphenation after an actual hyphen\\
% |\slash|&      `breakable' slash\\
% |\nth|&        for obtaining `1\textsuperscript{st}',
%                `2\textsuperscript{nd}', 3\textsuperscript{rd},
%                etc.\\
% |\tubissue|&   gets |\TUB| followed by volume and issue numbers\\
% |\xEdNote|&    Editor's Note:\\
% |\Review:|&    Review: (for title of book review article)\\
% |\reviewitem|& begin data for item being reviewed\\
% |\revauth|&    with one argument, author(s) of item being reviewed\\
% |\revtitle|&   with one argument, title of \ldots \\
% |\revpubinfo|& with one argument, other info pertaining to \ldots \\
% |\endreviewitem|& end data for item being reviewed\\
% |\booktitle|&  with one argument, format book title as straight text\\
% |\Input|&      |\input| with some other bookkeeping for
%                case where multiple articles are put together\\
% |\TBremark|&   reminder to \TUB{} editorial staff\\
% |\TBEnableRemarks|& enable \cs{TBremark}s (normally suppressed)\\
% |\pagexref|&   used to write out page numbers to screen and\\
% |\pagexrefON|& external files\\
% |\pagexrefOFF|&\\
% |\xrefto|&     used for symbolic cross-reference to other pages\\
% |\xreftoON|&   in \TUB{}\\
% |\xreftoOFF|&\\
% |\TBdriver|&   marks code which only takes effect when articles
%               are run together in a driver file\\
% \iffalse % these two were defined but never used! -- remove them
%          % from the documentation, at least (further research needed)
% |\signatureat|&  \\
% |\signaturepercent|&\\
% \fi
% |\signaturemark|& items for signatures\\
% |\signaturewidth|&\\
% \end{longtable}
%
% \StopEventually{}
%
% \section{\LaTeXe{} \TUB{} class file}
%
% \subsection{Setup and options}
%
% Check for reloading.  Hmmm\dots  Does this happen with \LaTeXe\
% classes?  Probably, in fact, as well that it doesn't, since the
% \cs{tugstyinit} referenced here doesn't exist; however, it's
% possible that we might need a similar mechanism in the future, so we
% retain its skeleton, without fleshing out the \cs{tugstyinit} bones.
%
%    \begin{macrocode}
%<*ltugboatcls>
\csname tugstyloaded@\endcsname
\def\tugstyloaded@{\tugstyinit\endinput}
%    \end{macrocode}
%
% Acquire a name for this class if we don't already have one (by
% virtue of having been loaded by |tugproc.cls|).  This name will be
% used in error messages and the like.
%
%    \begin{macrocode}
\providecommand{\@tugclass}{ltugboat}
%    \end{macrocode}
%
% Warnings/error messages/information messages\Dash if we're using
% \LaTeXe{} we can use the \cs{Class*} commands:
%
%    \begin{macrocode}
\def\TBInfo{\ClassInfo{\@tugclass}}
\def\TBError{\ClassError{\@tugclass}}
\def\TBWarning{\ClassWarning{\@tugclass}}
\def\TBWarningNL{\ClassWarningNoLine{\@tugclass}}
%    \end{macrocode}
%
% |draft| vs.\ |preprint| vs.\ |final|.
%
%    \begin{macrocode}
\newif\ifpreprint
\def\preprint{\preprinttrue}
\DeclareOption{draft}{%
  \AtEndOfClass{%
    \setcounter{page}{901}%
    %
    % Put a question mark into the page number in draft mode.
    \let\tuborigthepage = \thepage
    \def\thepage{%
      \ifnum\value{page}>900
        \textsl{?\texorpdfstring{\,}{}\@arabic{\numexpr\the\c@page-900\relax}}%
      \else
        \arabic{page}%
      \fi}%
    %
    \BlackBoxes
    \def\MakeRegistrationMarks{}%
    \PrelimDrafttrue
  }%
}
\DeclareOption{preprint}{%
   \preprinttrue
}
\DeclareOption{final}{%
  \AtEndOfClass{%
    \let\thepage=\tuborigthepage
    \NoBlackBoxes
    % Insert draft date into the header even with [final], if we are not
    % doing a production run. (tugboat.dates sets up page numbers
    % above 900 in such pseudo-draft mode.) We use [final] in the first
    % place for this case because draft can change page layout, wrt
    % registration marks, etc.
    \ifnum\value{page}>900 \PrelimDrafttrue \else \PrelimDraftfalse \fi
    \@tubrunningfull
    }%
}
%    \end{macrocode}
%
% We want to use \texttt{hyperref}'s \cs{texorpdfstring}, e.g., in the
% \texttt{draft} option above. If \texttt{hyperref} is not loaded,
% define our own trivial fallback to expand to the \TeX\ (first) argument.
%    \begin{macrocode}
\AtBeginDocument{%
  \ifx\undefined\texorpdfstring
    \DeclareRobustCommand{\texorpdfstring}[2]{#1}%
  \fi
}
%    \end{macrocode}
%
% \TUB\ uses only 10pt for the main text.
%
%    \begin{macrocode}
\DeclareOption{11pt}{%
  \TBWarning{The \@tugclass\space class only supports 10pt fonts:
    \MessageBreak option \CurrentOption\space ignored}%
}
\DeclareOption{12pt}{\csname ds@11pt\endcsname}
%    \end{macrocode}
%
% Similarly, ignore one/two-side options.
%
%    \begin{macrocode}
\DeclareOption{oneside}{\TBWarning{Option \CurrentOption\space ignored}}
\DeclareOption{twoside}{\ds@oneside}
%    \end{macrocode}
%
% There are these people who seem to think |tugproc| is an option rather
% than a class\dots{}  (Note that it's already been filtered out if we
% were calling from |ltugproc|.)
%
%    \begin{macrocode}
\DeclareOption{tugproc}{%
  \TBWarning{Option \CurrentOption\space ignored: use class ltugproc
    instead of \@tugclass}%
}
%    \end{macrocode}
%
% Option |rawcite| (the default) specifies the default citation
% mechanism (as built-in to \LaTeX); option |harvardcite| specifies
% the author-date citation mechanism defined in
% section~\ref{sec:citations} below.
%
%    \begin{macrocode}
\DeclareOption{rawcite}{\let\if@Harvardcite\iffalse}
\DeclareOption{harvardcite}{\let\if@Harvardcite\iftrue}
%    \end{macrocode}
%
% Option |extralabel| (the default) specifies that the publication
% years of two successive references with otherwise identical labels
% will be tagged with distinguishing letters; option |noextralabel|
% causes those letters to be suppressed.  Note that (a) no two
% references will in any case have the same labels in the default
% (plain) |rawcite| setup, and that (b) the distinguishing letters
% appear in the labels themselves; the reader can work out the
% correspondence one with the other\dots
%
%    \begin{macrocode}
\DeclareOption{extralabel}{\let\UseExtraLabel\@firstofone}
\DeclareOption{noextralabel}{\let\UseExtraLabel\@gobble}
%    \end{macrocode}
%
% The section-numbering style, so that we can allow the same heading
% layout as in the plain macros.
% \changes{v1.4a}{1996/09/14}{Added nonumber and numbersec (default)
% options}
%
%    \begin{macrocode}
\DeclareOption{numbersec}{\let\if@numbersec\iftrue}
\DeclareOption{nonumber}{\let\if@numbersec\iffalse}
%    \end{macrocode}
% 
% Minimal running headers/footers contain just the TUGboat volume/issue
% identification and page numbers.  `runningfull' is the default, and
% includes title and author.  `runningoff' makes both headers and
% footers empty.
%
%    \begin{macrocode}
\DeclareOption{runningoff}{\AtEndOfClass{\@tubrunningoff}}
\DeclareOption{runningminimal}{\AtEndOfClass{\@tubrunningminimal}}
\DeclareOption{runningfull}{\AtEndOfClass{\@tubrunningfull}}
%    \end{macrocode}
%
% \begin{macro}{\if@tubtwocolumn}
% Occasionally (|tb107jackowski|, and past conference preprints), we
% need the option |onecolumn|.  For alternative approaches to one-column
% articles, see |tb92hagen-euler| and |tb78milo|.
%
%    \begin{macrocode}
\newif\if@tubtwocolumn  \@tubtwocolumntrue
\DeclareOption{onecolumn}{\@tubtwocolumnfalse}
%    \end{macrocode}
% \end{macro}
%
% Any other options, we pass on to |article.cls| before we load it:
%
%    \begin{macrocode}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
%    \end{macrocode}
%
% Request default options (draft mode, standard citation, numbered
% sections, etc.), process all options, and then get the base document
% class on top of which we reside, namely |article|.  Always call
% |article| with the |twoside| option, since we want the ability to have
% odd/even headers/footers.
%
%    \begin{macrocode}
\ExecuteOptions{draft,extralabel,numbersec,rawcite,runningminimal}
\ProcessOptions
\LoadClass[twoside]{article}
%    \end{macrocode}
%
% Various fonts used throughout.  Some effort has been made to
% suppress these things with explicit sizes in the macro name
% (\cs{tensl} is an example below), but keeping in step with the
% documentation is one thing that restricts such a move.
%
%    \begin{macrocode}
\def\sectitlefont{\fontfamily\sfdefault\fontseries{bx}\fontshape{n}%
         \fontsize\@xviipt\stbaselineskip\selectfont}
\def\tensl{\fontseries{m}\fontshape{sl}\fontsize\@xpt\@xiipt
          \selectfont}
%    \end{macrocode}
%
% This font selection command is used \emph{only} for the `Editor's
% Note' introduction to notes; sadly it makes explicit reference to
% \textsc{cmr}, and Barbara Beeton has agreed that the reference may be
% constructed to use the current family such that, if no upright
% italic is defined, ordinary italics are used.  A project for
% later\dots
%
%    \begin{macrocode}
\def\EdNoteFont{\fontfamily{cmr}\fontseries{m}\fontshape{ui}%
          \selectfont}
%</ltugboatcls>
%    \end{macrocode}
%
%
% If Ulrik Vieth's |mflogo.sty| is around, we'll use it.  Otherwise
% (pro tem, at least) we'll warn the user and define the absolute
% minimum of machinery that \TUB{} requires (that which was used
% prior to the invention of \LaTeXe).
%    \begin{macrocode}
%<*common>
\IfFileExists{mflogo.sty}%
  {\RequirePackage{mflogo}}%
%<!ltugcomn> {\TBWarning
%<ltugcomn>  {\PackageWarning{ltugcomn}
     {Package mflogo.sty not available --\MessageBreak
       Proceeding to emulate mflogo.sty}
   \DeclareRobustCommand{\logofamily}{%
     \not@math@alphabet\logofamily\relax
     \fontencoding{U}\fontfamily{logo}\selectfont}
   \DeclareTextFontCommand{\textlogo}{\logofamily}
   \def\MF{\textlogo{META}\-\textlogo{FONT}\@}
   \def\MP{\textlogo{META}\-\textlogo{POST}\@}
   \DeclareFontFamily{U}{logo}{}
   \DeclareFontShape{U}{logo}{m}{n}{%
     <8><9>gen*logo%
     <10><10.95><12><14.4><17.28><20.74><24.88>logo10%
   }{}
   \DeclareFontShape{U}{logo}{m}{sl}{%
     <8><9>gen*logosl%
     <10><10.95><12><14.4><17.28><20.74><24.88>logosl10%
   }{}
   \DeclareFontShape{U}{logo}{m}{it}{%
     <->ssub*logo/m/sl%
   }{}%
  }
%    \end{macrocode}
%
% \subsection{Resetting at start of paper}
%
% \begin{macro}{\ResetCommands}
% \begin{macro}{\AddToResetCommands}
% \begin{macro}{\StartNewPaper}
% We store a set of commands that should be executed at the start of
% each paper, before any paper-specific customisation.  These commands
% (stored in the token register \cs{ResetCommands}) include things
% such as resetting section and footnote numbers, re-establishing
% default settings of typesetting parameters, and so on.  The user (or
% more typically, editor) may execute the commands by using the
% command \cs{StartNewPaper}.  Things I've not yet thought of may be
% added to the list of commands, by
%    \begin{macrocode}
\newtoks\ResetCommands
\ResetCommands{%
  \setcounter{part}{0}%
  \setcounter{section}{0}%
  \setcounter{footnote}{0}%
  \authornumber\z@
}
\newcommand{\AddToResetCommands}[1]{%
  \AddToResetCommands\expandafter{\AddToResetCommands#1}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Helpful shorthands (common code with Plain styles)}
%
% \cs{makeescape}, \dots, \cs{makecomment} allow users to change the
% category code of a single character a little more easily.  These
% require that the character be addressed as a control sequence:
% e.g., |\makeescape\/| will make `|/|' an escape character.
%
%    \begin{macrocode}
%<*!latex>
\def\makeescape#1{\catcode`#1=0 }
\def\makebgroup#1{\catcode`#1=1 }
\def\makeegroup#1{\catcode`#1=2 }
\def\makemath  #1{\catcode`#1=3 }
%</!latex>
%<*latex>
\def\makeescape#1{\catcode`#1=\z@}
\def\makebgroup#1{\catcode`#1=\@ne}
\def\makeegroup#1{\catcode`#1=\tw@}
\def\makemath  #1{\catcode`#1=\thr@@}
%</latex>
\def\makealign #1{\catcode`#1=4 }
\def\makeeol   #1{\catcode`#1=5 }
\def\makeparm  #1{\catcode`#1=6 }
\def\makesup   #1{\catcode`#1=7 }
\def\makesub   #1{\catcode`#1=8 }
\def\makeignore#1{\catcode`#1=9 }
\def\makespace #1{\catcode`#1=10 }
\def\makeletter#1{\catcode`#1=11 }
\chardef\other=12
\let\makeother\@makeother
\def\makeactive#1{\catcode`#1=13 }
\def\makecomment#1{\catcode`#1=14 }
%    \end{macrocode}
% |\savecat#1| and |\restorecat#1| will save and restore the category
% of a given character.  These are useful in cases where one doesn't
% wish to localize the settings and therefore be required to globally
% define or set things.
%    \begin{macrocode}
\def\savecat#1{%
  \expandafter\xdef\csname\string#1savedcat\endcsname{\the\catcode`#1}}
\def\restorecat#1{\catcode`#1=\csname\string#1savedcat\endcsname}
%<!latex>\savecat\@
%<!latex>\makeletter\@
%    \end{macrocode}
%
% |\SaveCS#1| and |\RestoreCS#1| save and restore `meanings' of control
% sequences.  Again this is useful in cases where one doesn't want to
% localize or where global definitions clobber a control sequence which
% is needed later with its `old' definition.
%
%    \begin{macrocode}
\def\SaveCS#1{\expandafter\let\csname saved@@#1\expandafter\endcsname
  \csname#1\endcsname}
\def\RestoreCS#1{\expandafter\let\csname#1\expandafter\endcsname
  \csname saved@@#1\endcsname}
%    \end{macrocode}
% To distinguish between macro files loaded
%    \begin{macrocode}
\def\plaintubstyle{plain}
\def\latextubstyle{latex}
%    \end{macrocode}
%
% Control sequences that were first defined in \LaTeXe{} of
% 1995/06/01 (or later), but which we merrily use.  Only define if
% necessary:
%
%    \begin{macrocode}
\providecommand\hb@xt@{\hbox to}
\providecommand\textsuperscript[1]{\ensuremath{\m@th
                                     ^{\mbox{\fontsize\sf@size\z@
                                         \selectfont #1}}}}
%    \end{macrocode}
% (Note that that definition of \cs{textsuperscript} isn't robust, but
% probably doesn't need to be\dots  What's more, it doesn't appear in
% the mythical 2.09 version of the package.)
%
% \subsection{Abbreviations and logos}
% \label{abbr-logo}
%
% Font used for the METAFONT logo, etc.
%    \begin{macrocode}
\DeclareRobustCommand{\AllTeX}{(\La\kern-.075em)\kern-.075em\TeX}
\def\AMS{American Mathematical Society}
\def\AmS{$\mathcal{A}$\kern-.1667em\lower.5ex\hbox
    {$\mathcal{M}$}\kern-.125em$\mathcal{S}$}
\def\AmSLaTeX{\AmS-\LaTeX}
\def\AmSTeX{\AmS-\TeX}
\def\ANSI{\acro{ANSI}}
\def\API{\acro{API}}
\def\ASCII{\acro{ASCII}}
\def\aw{\acro{A\kern.04em\raise.115ex\hbox{-}W}}
\def\AW{Addison\kern.1em-\penalty\z@\hskip\z@skip Wesley}
%
% make \BibTeX work in slanted contexts too; it's common in titles, and
% especially burdensome to hack in .bib files.
\def\Bib{%
  \ifdim \fontdimen1\font>0pt
     B{\SMC\SMC IB}%
  \else
     B\textsc{ib}%
  \fi
}
\def\BibLaTeX{\Bib\kern.02em \LaTeX}
\def\BibTeX{\Bib\kern-.08em \TeX}
% no good way to determine bold font, and we want to lose the kern, too:
% (we \let BibTeX to this in maketitle)
\def\bfBibTeX{B{\SMC\SMC IB}\TeX}
%
\def\BSD{\acro{BSD}}
\def\CandT{\textsl{Computers \& Typesetting}}
% must not define \CJK, because the CJK package does.
%    \end{macrocode}
% We place our \cs{kern} after \cs{-} so that it disappears if the
% hyphenation is taken:
%    \begin{macrocode}
\def\ConTeXt{C\kern-.0333emon\-\kern-.0667em\TeX\kern-.0333emt}
\def\CMkIV{\ConTeXt\ \MkIV}
\def\Cplusplus{C\plusplus}
\def\plusplus{\raisebox{.7ex}{$_{++}$}}
\def\CPU{\acro{CPU}}
\def\CSczabbr{\ensuremath{\cal C}\kern-.1667em\lower.5ex\hbox{$\cal S$}}
\def\CSS{\acro{CSS}}
\def\CSTUG{\CSczabbr\acro{TUG}}
\def\CSV{\acro{CSV}}
\def\CTAN{\acro{CTAN}}
\def\DTD{\acro{DTD}}
\def\DTK{\acro{DTK}}
\def\DVD{\acro{DVD}}
\def\DVI{\acro{DVI}}
\def\DVIPDFMx{\acro{DVIPDFM}$x$}
\def\DVItoVDU{DVIto\kern-.12em VDU}
\def\ECMA{\acro{ECMA}}
\def\EPS{\acro{EPS}}
% no line break at this hyphen please
\DeclareRobustCommand{\eTeX}{\ensuremath{\varepsilon}\mbox{-}\kern-.125em\TeX}
\DeclareRobustCommand{\ExTeX}{%
  \ensuremath{\textstyle\varepsilon_{\kern-0.15em\cal{X}}}\kern-.2em\TeX}
\def\FAQ{\acro{FAQ}}
\def\FTP{\acro{FTP}}
\def\Ghostscript{Ghost\-script}
\def\GNU{\acro{GNU}}
\def\GUI{\acro{GUI}}
\def\Hawaii{Hawai`i}
\def\HTML{\acro{HTML}}
\def\HTTP{\acro{HTTP}}
\def\iOS{i\acro{OS}}
\def\IDE{\acro{IDE}}
\def\IEEE{\acro{IEEE}}
\def\ISBN{\acro{ISBN}}
\def\ISO{\acro{ISO}}
\def\ISSN{\acro{ISSN}}
\def\JPEG{\acro{JPEG}}
\def\JTeX{\leavevmode\hbox{\lower.5ex\hbox{J}\kern-.18em\TeX}}
\def\JoT{\textsl{The Joy of \TeX}}
\DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em%
     M\kern.05em A\kern.1em-\kern.1em Script}}
\def\LAMSTeX{L\raise.42ex\hbox{\kern-.3em
                   $\m@th$\fontsize\sf@size\z@\selectfont
                   $\m@th\mathcal{A}$}%
    \kern-.2em\lower.376ex\hbox{$\m@th\mathcal{M}$}\kern-.125em
    {$\m@th\mathcal{S}$}-\TeX}
% This code
% is hacked from its definition of \cs{LaTeX}; it allows slants (for
% example) to propagate into the raised (small) `A':
%    \begin{macrocode}
\DeclareRobustCommand{\La}%
   {L\kern-.36em
        {\setbox0\hbox{T}%
         \vbox to\ht0{\hbox{$\m@th$%
                            \csname S@\f@size\endcsname
                            \fontsize\sf@size\z@
                            \math@fontsfalse\selectfont
                            A}%
                      \vss}%
        }}
%    \end{macrocode}
%
% We started with the intention that we wouldn't redefine \cs{LaTeX}
% when we're running under it, so as not to trample on an existing
% definition.  However, this proves less than satisfactory; a single
% logo may be OK for the run of documents, but for \TUB{}, we find
% that something noticeably better is necessary; see section
% \ref{sec:latex-logo}.
%
%    \begin{macrocode}
%<!latex>\def\LaTeX{\La\kern-.15em\TeX}
\def\LuaHBTeX{Lua\acro{HB}\-\TeX}%
\def\LuaHBLaTeX{Lua\acro{HB}\-\LaTeX}%
\def\LuaLaTeX{Lua\-\LaTeX}% dtk-logos defines it and people like to use it
\def\LuaTeX{Lua\-\TeX}% ditto
\def\LyX{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX}
\def\macOS{mac\acro{OS}}
\def\MacOSX{Mac\,\acro{OS\,X}}
\def\MathML{Math\acro{ML}}
\def\Mc{\setbox\TestBox=\hbox{M}M\vbox
   to\ht\TestBox{\hbox{c}\vfil}} %  for Robert McGaffey
%    \end{macrocode}
%
% If we're running under \LaTeXe, we use Ulrik Vieth's |mflogo.sty| if
% it's present.  Otherwise, we're using a short extract of Vieth's
% stuff.  Either way, we don't need to specify \cs{MF} or \cs{MP}.
%
%    \begin{macrocode}
\def\mf{\textsc{Metafont}}
\def\MFB{\textsl{The \MF\kern1pt book}}
\def\MkIV{Mk\acro{IV}}
\let\TB@@mp\mp
\DeclareRobustCommand{\mp}{\ifmmode\TB@@mp\else MetaPost\fi}
%
% In order that the \cs{OMEGA} command will switch to using the TS1
% variant of the capital Omega character if \texttt{textcomp.sty} is
% loaded, we define it in terms of the \cs{textohm} command.  Note
% that this requires us to interpose a level of indirection, rather
% than to use \cs{let}\dots
%
%    \begin{macrocode}
\DeclareRobustCommand{\NTG}{\acro{NTG}}
\DeclareRobustCommand{\NTS}{\ensuremath{\mathcal{N}\mkern-4mu
  \raisebox{-0.5ex}{$\mathcal{T}$}\mkern-2mu \mathcal{S}}}
\DeclareTextSymbol{\textohm}{OT1}{'012}
\DeclareTextSymbolDefault{\textohm}{OT1}
\newcommand{\OMEGA}{\textohm}
\DeclareRobustCommand{\OCP}{\OMEGA\acro{CP}}
\DeclareRobustCommand{\OOXML}{\acro{OOXML}}
\DeclareRobustCommand{\OTF}{\acro{OTF}}
\DeclareRobustCommand{\OTP}{\OMEGA\acro{TP}}
\def\mtex{T\kern-.1667em\lower.424ex\hbox{\^E}\kern-.125emX\@}
%    \end{macrocode}
% Revised definition of \cs{NTS} based on that used by Phil Taylor.
%    \begin{macrocode}
\def\Pas{Pascal}
\def\pcMF{\leavevmode\raise.5ex\hbox{p\kern-.3\p@ c}MF\@}
\def\PCTeX{PC\thinspace\TeX}
\def\pcTeX{\leavevmode\raise.5ex\hbox{p\kern-.3\p@ c}\TeX}
\def\pdflatex{pdf\-\LaTeX}% dtk-logos
\def\pdftex{pdf\-\TeX}% dtk-logos
\def\PDF{\acro{PDF}}
\def\PGF{\acro{PGF}}
\def\PHP{\acro{PHP}}
\def\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC\@}
\def\PiCTeX{\PiC\kern-.11em\TeX}
\def\plain{\texttt{plain}}
\def\PNG{\acro{PNG}}
\def\POBox{P.\thinspace O.~Box }
\def\PS{{Post\-Script}}
\def\PSTricks{\acro{PST}ricks}
\def\RTF{\acro{RTF}}
\def\SC{Steering Committee}
\def\SGML{\acro{SGML}}
\def\SliTeX{\textrm{S\kern-.06em\textsc{l\kern-.035emi}%
                     \kern-.06em\TeX}}
\def\slMF{\textsl{\MF}} % should never be used
\def\SQL{\acro{SQL}}
\def\stTeX{\textsc{st}\kern-0.13em\TeX}
\def\STIX{\acro{STIX}}
\def\SVG{\acro{SVG}}
\def\TANGLE{\texttt{TANGLE}\@}
\def\TB{\textsl{The \TeX book}}
\def\TIFF{\acro{TIFF}}
\def\TP{\textsl{\TeX}: \textsl{The Program}}
\DeclareRobustCommand{\TeX}{T\kern-.1667em\lower.424ex\hbox{E}\kern-.125emX\@}
\def\TeXhax{\TeX hax}
\def\TeXMaG{\TeX M\kern-.1667em\lower.5ex\hbox{A}%
   \kern-.2267emG\@}
\def\TeXtures{\textit{Textures}}
\let\Textures=\TeXtures
\def\TeXworks{\TeX\kern-.07em works}
\def\TeXXeT{\TeX-{}-\XeT}
\def\TFM{\acro{TFM}}
\ifx\Umathchardef\@thisisundefined % xetex|luatex
\def\Thanh{H\`an~Th\^e\llap{\raise 0.5ex\hbox{\'{}}}~Th\`anh}% non-XeTeX
\else
\def\Thanh{H\`an~Th\textcircumacute{e}~Th\`anh}% else xunicode drops the acute
\fi
\def\TikZ{Ti{\em k}Z}
\def\ttn{\textsl{TTN}\@}
\def\TTN{\textsl{\TeX{} and TUG News}}
\let\texttub\textsl              % redefined in other situations
\def\TUB{\texttub{TUGboat}}
\def\TUG{\TeX\ \UG}
\def\tug{\acro{TUG}}
\def\UG{Users Group}
\def\UNIX{\acro{UNIX}}
% omit \UTF, since other packages use it for Unicode character access.
\def\VAX{V\kern-.12em A\kern-.1em X\@}
\def\VnTeX{V\kern-.03em n\kern-.02em \TeX}
\def\VorTeX{V\kern-2.7\p@\lower.5ex\hbox{O\kern-1.4\p@ R}\kern-2.6\p@\TeX}
\def\XeT{X\kern-.125em\lower.424ex\hbox{E}\kern-.1667emT\@}
\def\XML{\acro{XML}}
\def\WEB{\texttt{WEB}\@}
\def\WEAVE{\texttt{WEAVE}\@}
\def\WYSIWYG{\acro{WYSIWYG}}
%    \end{macrocode}
%
% Xe\TeX{} requires reflecting the first E, hence we complain if the
% graphics package is not present.  (For plain documents, this can be
% loaded via Eplain.)  Also, at Barbara's suggestion, if the current
% font is slanted, we rotate by 180 instead of reflecting so there is at
% least a chance to look ok.  (The magic values here seem more or less
% ok for \texttt{cmsl} and \texttt{cmti}.)
%
%    \begin{macrocode}
\def\tubreflect#1{%
  \@ifundefined{reflectbox}{%
    \TBerror{A graphics package must be loaded for \string\XeTeX}%
  }{%
    \ifdim \fontdimen1\font>0pt
      \raise 1.75ex \hbox{\kern.1em\rotatebox{180}{#1}}\kern-.1em
    \else
      \reflectbox{#1}%
    \fi
  }%
}
\def\tubhideheight#1{\setbox0=\hbox{#1}\ht0=0pt \dp0=0pt \box0 }
\def\XekernbeforeE{-.125em}
\def\XekernafterE{-.1667em}
\DeclareRobustCommand{\Xe}{\leavevmode
  \tubhideheight{\hbox{X%
    \setbox0=\hbox{\TeX}\setbox1=\hbox{E}%
    \ifdim \fontdimen1\font>0pt
      % XeTeX logo needs tinkering when slanted/italic font.
      \def\XekernbeforeE{-.11em}%
      \def\XekernafterE{-.11em}%
      \dp1=-.17ex
    \fi
    \lower\dp0\hbox{\raise\dp1\hbox{\kern\XekernbeforeE\tubreflect{E}}}%
    \kern\XekernafterE}}}
\def\XeTeX{\Xe\TeX}
\def\XeLaTeX{\Xe{\kern.11em \LaTeX}}
%
\def\XHTML{\acro{XHTML}}
\def\XSL{\acro{XSL}}
\def\XSLFO{\acro{XSL}\raise.08ex\hbox{-}\acro{FO}}
\def\XSLT{\acro{XSLT}}
%    \end{macrocode}
%
% \subsection{General typesetting rules}
%
%    \begin{macrocode}
\newlinechar=`\^^J
\normallineskiplimit=\p@
\clubpenalty=10000
\widowpenalty=10000
\def\NoParIndent{\parindent=\z@}
\newdimen\normalparindent
\normalparindent=20\p@
\def\NormalParIndent{\global\parindent=\normalparindent}
\NormalParIndent
\def\BlackBoxes{\overfullrule=5\p@}
\def\NoBlackBoxes{\overfullrule=\z@}
\def\newline{\hskip\z@\@plus\pagewd\break}
%    \end{macrocode}
%
% Hyphen control: first, we save the hyphenpenalties in
% \cs{allowhyphens}.  This allows us to permit hyphens temporarily in
% things like \cs{netaddress}es, which typically occur when
% \cs{raggedright} is set,  but which need to be allowed to break at
% their artificial discretionaries.
%
%    \begin{macrocode}
\edef\allowhyphens{\noexpand\hyphenpenalty\the\hyphenpenalty\relax
  \noexpand\exhyphenpenalty\the\exhyphenpenalty\relax}
\def\nohyphens{\hyphenpenalty\@M\exhyphenpenalty\@M}
%    \end{macrocode}
%
% \subsection{Utility registers and definitions}
%
% We define a few scratch registers (and the like) for transient use;
% they're all paired: an internal one (\cs{T@st*}) and an external one
% (\cs{Test*}).
%
% \begin{description}
% \item[\emph{Comment:}] Exercise for an idle day: find whether all
%   these are necessary, or whether we can use the \LaTeX{} temporaries
%   for some (or all) of the \cs{T@st*} ones.
% \item[\emph{Comment:}] (bb) All these registers are used in the
%   plain version, |tugboat.sty|.
% \end{description}
%
%    \begin{macrocode}
\newbox\T@stBox                 \newbox\TestBox
\newcount\T@stCount             \newcount\TestCount
\newdimen\T@stDimen             \newdimen\TestDimen
\newif\ifT@stIf                 \newif\ifTestIf
%    \end{macrocode}
%
% Control sequence existence test, stolen from \TeX book exercise 7.7
% (note that this provides functionality that in some sense duplicates
% something within \LaTeX).
%
%    \begin{macrocode}
\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax }
%    \end{macrocode}
%
% \LaTeX\ conventions which are also useful here.
%
%    \begin{macrocode}
%<*!latex>
  \let\@@input\input
  \def\iinput#1{\@@input#1 }
  \def\@inputcheck{\if\@nextchar\bgroup
    \expandafter\iinput\else\expandafter\@@input\fi}
  \def\input{\futurelet\@nextchar\@inputcheck}
%</!latex>
%    \end{macrocode}
%
% Smashes repeated from AMS-\TeX; plain \TeX{} implements only full
% |\smash|.
%
%    \begin{macrocode}
\newif\iftop@           \newif\ifbot@
\def\topsmash{\top@true\bot@false\smash@}
\def\botsmash{\top@false\bot@true\smash@}
\def\smash{\top@true\bot@true\smash@}
\def\smash@{\relax\ifmmode\def\next{\mathpalette\mathsm@sh}%
        \else\let\next\makesm@sh\fi \next }
\def\finsm@sh{\iftop@\ht\z@\z@\fi\ifbot@\dp\z@\z@\fi\box\z@}
%    \end{macrocode}
%
%       Vertical `laps'; cf.\ |\llap| and |\rlap|
%
%    \begin{macrocode}
\long\def\ulap#1{\vbox to \z@{\vss#1}}
\long\def\dlap#1{\vbox to \z@{#1\vss}}
%    \end{macrocode}
%       And centered horizontal and vertical `laps'
%    \begin{macrocode}
\def\xlap#1{\hb@xt@\z@{\hss#1\hss}}
\long\def\ylap#1{\vbox to \z@{\vss#1\vss}}
\long\def\zlap#1{\ylap{\xlap{#1}}}
%    \end{macrocode}
%       Avoid unwanted vertical glue when making up pages.
%    \begin{macrocode}
\def\basezero{\baselineskip\z@skip \lineskip\z@skip}
%    \end{macrocode}
%  Empty rules for special occasions
%    \begin{macrocode}
\def\nullhrule{\hrule \@height\z@ \@depth\z@ \@width\z@ }
\def\nullvrule{\vrule \@height\z@ \@depth\z@ \@width\z@ }
%    \end{macrocode}
%       Support ad-hoc strut construction.
%    \begin{macrocode}
\def\makestrut[#1;#2]{\vrule \@height#1 \@depth#2 \@width\z@ }
%    \end{macrocode}
%       Construct box for figure pasteup, etc.;
%       height = \#1, width = \#2, rule thickness = \#3
%    \begin{macrocode}
\def\drawoutlinebox[#1;#2;#3]{\T@stDimen=#3
        \vbox to#1{\hrule \@height\T@stDimen \@depth\z@
            \vss\hb@xt@#2{\vrule \@width\T@stDimen
                \hfil\makestrut[#1;\z@]%
                \vrule \@width\T@stDimen}\vss
            \hrule \@height\T@stDimen \@depth\z@}}
%    \end{macrocode}
%       Today's date, to be printed on drafts.  Based on \TeX book, p.406.
%    \begin{macrocode}
%<*!latex>
\def\today{\number\day\space \ifcase\month\or
        Jan \or Feb \or Mar \or Apr \or May \or Jun \or
        Jul \or Aug \or Sep \or Oct \or Nov \or Dec \fi
        \number\year}
%</!latex>
%    \end{macrocode}
%       Current time; this may be system dependent!
%    \begin{macrocode}
\newcount\hours
\newcount\minutes
\def\SetTime{\hours=\time
        \global\divide\hours by 60
        \minutes=\hours
        \multiply\minutes by 60
        \advance\minutes by-\time
        \global\multiply\minutes by-1 }
\SetTime
\def\now{\number\hours:\ifnum\minutes<10 0\fi\number\minutes}
\def\Now{\today\ \now}
\newif\ifPrelimDraft
\def\midrtitle{} % center of running heads
\def\rtitlenexttopage{\ifPrelimDraft \textsl{\small draft: \Now}\fi}
%    \end{macrocode}
%
% \subsection{Ragged right and friends}
%
% \begin{macro}{\raggedskip}
% \begin{macro}{\raggedstretch}
% \begin{macro}{\raggedparfill}
% \begin{macro}{\raggedspaces}
% Plain \TeX{}'s definition of |\raggedright| doesn't permit any
% stretch, and results in too many overfull boxes.  We also turn off
% hyphenation.  This code lies somewhere between that of Plain \TeX{}
% and of \LaTeX{}.
%    \begin{macrocode}
\newdimen\raggedskip    \raggedskip=\z@
\newdimen\raggedstretch \raggedstretch=5em    % ems of font set now (10pt)
\newskip\raggedparfill  \raggedparfill=\z@\@plus 1fil
\def\raggedspaces{\spaceskip=.3333em \relax \xspaceskip=.5em \relax }
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\raggedright}
% \begin{macro}{\raggedleft}
% \begin{macro}{\raggedcenter}
% \begin{macro}{\normalspaces}
% Some applications may have to add stretch, in order to avoid
% all overfull boxes.  We define the following uses of the above
% skips, etc.
%    \begin{macrocode}
\def\raggedright{%
  \nohyphens
  \rightskip=\raggedskip\@plus\raggedstretch \raggedspaces
  \parfillskip=\raggedparfill
}
\def\raggedleft{%
  \nohyphens
  \leftskip=\raggedskip\@plus\raggedstretch \raggedspaces
  \parfillskip=\z@skip
}
\def\raggedcenter{%
  \nohyphens
  \leftskip=\raggedskip\@plus\raggedstretch
  \rightskip=\leftskip \raggedspaces
  \parindent=\z@ \parfillskip=\z@skip
}
\def\normalspaces{\spaceskip\z@skip \xspaceskip\z@skip}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Assorted user-level markup}
%
% \LaTeXe{} defines a robust \cs{,}, but that we provide a new definition
% of |~| by redefining \cs{\nobreakspace} (\cs{DeclareRobustCommand}
% doesn't mind redefinition, fortunately). This is based on the version
% in AMS-\TeX---the \LaTeXe{} version (|ltspace.dtx|) has \cs{leavevmode}
% and does not do anything with the surrounding space(s). Our version
% messes up with the \cs{pfill} used in |doc|-generated indexes
% (\url{github.com/latex3/latex2e/issues/75}), but later (2018++)
% versions of |doc| should be protected against our redefinition.
%
%    \begin{macrocode}
\let\latexnobreakspace=\nobreakspace
\DeclareRobustCommand{\nobreakspace}{\unskip\nobreak\ \ignorespaces}
%    \end{macrocode}
%
% Plain \TeX{} defines \cs{newbox} as \cs{outer}.  We solemnly
% preserve the following, which removes the \cs{outer}ness; of course,
% we carefully exclude it from what we generate\dots{}  (\cs{outer}ness is a
% spawn of the devil, is it not?  Barbara Beeton responded to the
% previous sentence ``\cs{outer}ness has its place: it avoids register
% buildup, hence running out of memory''.  In another context, David
% Carlisle remarked that an error control mechanism that causes more
% confusing errors than it prevents is rather a poor one.  This is
% perhaps not the place to conduct a serious debate\dots)
%
%    \begin{macrocode}
\def\boxcs#1{\box\csname#1\endcsname}
\def\setboxcs#1{\setbox\csname#1\endcsname}
\def\newboxcs#1{\expandafter\newbox\csname#1\endcsname}
\let\gobble\@gobble
\def\vellipsis{%
  \leavevmode\kern0.5em
  \raise\p@\vbox{\baselineskip6\p@\vskip7\p@\hbox{.}\hbox{.}\hbox{.}}
  }
\def\bull{\vrule \@height 1ex \@width .8ex \@depth -.2ex }
\def\cents{{\rm\raise.2ex\rlap{\kern.05em$\scriptstyle/$}c}}
\def\careof{\leavevmode\hbox{\raise.75ex\hbox{c}\kern-.15em
                /\kern-.125em\smash{\lower.3ex\hbox{o}}} \ignorespaces}
\def\Dag{\raise .6ex\hbox{$\scriptstyle\dagger$}}
%
\DeclareRobustCommand{\sfrac}[1]{\@ifnextchar/{\@sfrac{#1}}%
                                            {\@sfrac{#1}/}}
\def\@sfrac#1/#2{\leavevmode\kern.1em\raise.5ex
         \hbox{$\m@th\mbox{\fontsize\sf@size\z@
                           \selectfont#1}$}\kern-.1em
         /\kern-.15em\lower.25ex
          \hbox{$\m@th\mbox{\fontsize\sf@size\z@
                            \selectfont#2}$}}
%
% don't stay bold in description items, bold italic is too weird.
\DeclareRobustCommand\meta[1]{%
  \ensuremath{\langle}%
  \ifmmode \expandafter\mbox \fi % if in math
  {\it #1\/}% no typewriter italics, please
  \ensuremath{\rangle}%
}
%
% Use \tt rather than \texttt because italic typewriter is just too ugly,
% and upright works well enough in both italic and bold contexts.
\DeclareRobustCommand{\cs}[1]{{\tt \char`\\#1}}
%
% This command was defined much later than the others around here, so
% let's not conflict with any existing definitions that might be out there.
% Don't allow hyphenations or other line breaks.
\DeclareRobustCommand{\tubbraced}[1]{\mbox{\texttt{\char`\{#1\char`\}}}}
%
% Well, just the \begin part.  Never seen it used.
\DeclareRobustCommand{\env}[1]{\cs{begin}\tubbraced{#1}}
%
% Not sure why we ever want this instead of LaTeX's \, (using \kern),
% but fine, just keeping it.
\DeclareRobustCommand{\thinskip}{\hskip 0.16667em\relax}
%
% Ah, urls. Nowadays, we like the visible url to not have any protocol,
% if it is \texttt{http://} or \texttt{https://}. But we need to include
% the protocol if we are making live links, since a string like
% \texttt{tug.org/whatever} will be taken as a local filename by
% browsers and PDF readers. Since we need to check for
% \texttt{hyperref}, make the definition \cs{AtBeginDocument}. In the
% end, \cs{tbsurl}\tubbraced{foo} produces \texttt{https://foo} and
% \cs{tbhurl}\tubbraced{foo}  produces \texttt{http://foo}.
\AtBeginDocument{%
\ifx\hyper@normalise\undefined
  \def\tbsurl{\url}% no hyperref, so just \url is fine.
  \def\tbhurl{\url}%
\else
  % This hyperref hook-in is due to Ulrike Fischer.
  % \url{https://github.com/latex3/hyperref/issues/125}.
  \DeclareRobustCommand*{\tbsurl}{\hyper@normalise\tbsurl@}%
    \def\tbsurl@#1{\hyper@linkurl{\Hurl{#1}}{https://#1}}%
  \DeclareRobustCommand*{\tbhurl}{\hyper@normalise\tbhurl@}
    \def\tbhurl@#1{\hyper@linkurl{\Hurl{#1}}{http://#1}}%
\fi
}
%
% Make \! work in text mode.
\DeclareRobustCommand{\!}{\ifmmode\mskip-\thinmuskip \else\kern-0.16667em \fi}
%
% Half a thinspace.
\DeclareRobustCommand{\tubthinnerspace}
  {\ifmmode\mskip.5\thinmuskip \else\kern0.08333em \fi}
\DeclareRobustCommand{\tubthinnerspaceneg}
  {\ifmmode\mskip-.5\thinmuskip \else\kern-0.08333em \fi}
%
%    \end{macrocode}
%
% We play a merry game with dashes, providing all conceivable options
% of breakability before and after.
%
%    \begin{macrocode}
\def\endash{--}
\def\emdash{\endash-}
\def\d@sh#1#2{\unskip#1\thinskip#2\thinskip\ignorespaces}
\def\dash{\d@sh\nobreak\endash}
\def\Dash{\d@sh\nobreak\emdash}
\def\ldash{\d@sh\empty{\hbox{\endash}\nobreak}}
\def\rdash{\d@sh\nobreak\endash}
\def\Ldash{\d@sh\empty{\hbox{\emdash}\nobreak}}
\def\Rdash{\d@sh\nobreak\emdash}
%    \end{macrocode}
%
% Hacks to permit automatic hyphenation after an actual hyphen, or
% after a slash.
%
%    \begin{macrocode}
\def\hyph{-\penalty\z@\hskip\z@skip }
\def\slash{/\penalty\z@\hskip\z@skip }
%    \end{macrocode}
%
% Adapted from |comp.text.tex| posting by Donald Arseneau, 26 May 93.
% \LaTeXe-isation added by Robin Fairbairns.  Destroys both the
% |TestCount|s.
%
%    \begin{macrocode}
\def\nth#1{%
    \def\reserved@a##1##2\@nil{\ifcat##1n%
           0%
          \let\reserved@b\ensuremath
      \else##1##2%
          \let\reserved@b\relax
      \fi}%
    \TestCount=\reserved@a#1\@nil\relax
    \ifnum\TestCount <0 \multiply\TestCount by\m@ne \fi % subdue negatives
    \T@stCount=\TestCount
    \divide\T@stCount by 100 \multiply\T@stCount by 100
    \advance\TestCount by-\T@stCount     % n mod 100
    \ifnum\TestCount >20 \T@stCount=\TestCount
      \divide\T@stCount by 10 \multiply\T@stCount by 10
      \advance\TestCount by-\T@stCount   % n mod 10
    \fi
     \reserved@b{#1}%
       \textsuperscript{\ifcase\TestCount th%    0th
                        \or   st%                1st
                        \or   nd%                2nd
                        \or   rd%                3rd
                        \else th%                nth
                        \fi}%
}
%    \end{macrocode}
%
% \subsection{Reviews}
%
% Format information on reviewed items for book review articles.
% For the \LaTeXe{} version, we follow Fairbairns' maxim, and define
% something that can even look like a \LaTeX{} macro\dots
%
%    \begin{macrocode}
\def\Review{\@ifnextchar:{\@Review}{\@Review:}}
\def\@Review:{\@ifnextchar[%]
  {\@Rev}%
  {\@Rev[Book review]}}
\def\@Rev[#1]#2{{\ignorespaces#1\unskip:\enspace\ignorespaces
                                        \slshape\mdseries#2}}
\def\reviewitem{\addvspace{\BelowTitleSkip}%
  \def\revauth##1{\def\therevauth{##1, }\ignorespaces}%
  \def\revtitle##1{\def\therevtitle{{\slshape##1}. }\ignorespaces}%
  \def\revpubinfo##1{\def\therevpubinfo{##1.}\ignorespaces}%
}
\def\endreviewitem{{\noindent\interlinepenalty=10000
  \therevauth\therevtitle\therevpubinfo\endgraf}%
  \vskip\medskipamount
}
\def\booktitle#1{{\slshape#1\/}}
%    \end{macrocode}
%
%  \subsection{Dates, volume and issue numbers, etc.}
%
% Dates and other items which identify the volume and issue.
% \cs{issueseqno} is a sequential issue number starting from the
% first issue published; volume 15,4 has \cs{issueseqno=45}.
%
% To use: \begin{tabular}{l}
%              |\vol 19, 1.|\\
%              |\issdate March 1998.|\\
%              |\issueseqno=58|\\
%         \end{tabular}
%
% Starting with volume 23 (nominal 2002), we have \cs{issyear} instead
% of \cs{issdate}, because issues don't have months any more.
%
% For production, these are set in a separate file,
% |tugboat.dates|, which is issue-specific.
%
% \begin{description}
% \item[\emph{Comment:}] I would like to make the code read a file
%   |tugboat.dates| in the current directory or its parent.
%   This is easy except under `odd' operating systems ({\small VMS} is
%   an example that springs to mind, {\small RISC}os may be even
%   worse) whose syntax is out of the ordinary.
% \end{description}
%
%    \begin{macrocode}
\newcount\issueseqno            \issueseqno=-1
\def\v@lx{\gdef\volx{Volume~\volno~(\volyr), No.~\issno}}
\def\volyr{}
\def\volno{}
\def\vol #1,#2.{\gdef\volno{#1\unskip}%
        \gdef\issno{\ignorespaces#2\unskip}%
        \setbox\TestBox=\hbox{\volyr}%
        \ifdim \wd\TestBox > .2em \v@lx \fi }
\def\issyear #1.{\gdef\issdt{#1}\gdef\volyr{#1}%
        \gdef\bigissdt{#1}%
        \setbox\TestBox=\hbox{\volno}%
        \ifdim \wd\TestBox > .2em \v@lx \fi }
\def\issdate #1#2 #3.{\gdef\issdt{#1#2 #3}\gdef\volyr{#3}%
        \gdef\bigissdt{#1{\smc\uppercase{#2}} #3}%
        \setbox\TestBox=\hbox{\volno}%
        \ifdim \wd\TestBox > .2em \v@lx \fi }
\vol 0, 0.
\issdate Thermidor, 9999.
%    \end{macrocode}
%
% (The curious should know that \emph{Thermidor} was one of the French
% revolutionary month names\dots)
%
% For \LaTeX{} use, define a version of the issue declaration that can
% take or leave the old plain syntax
%
%    \begin{macrocode}
%<!latex>\def\tubissue#1(#2)%
%<*latex>
\def\tubissue#1{\@ifnextchar(%)
  {\@tubissue@b{#1}}
  {\@tubissue@a{#1}}}
\def\@tubissue@b#1(#2){\@tubissue@a{#1}{#2}}
\def\@tubissue@a#1#2%
%</latex>
  {\TUB~#1, no.~#2}
%    \end{macrocode}
%
%  \TUB{} conventions include the sequential issue number in the file name.
%  Permit this to be incorporated into file names automatically.
%  If \(\mbox{issue number} = 11\), \cs{Input filnam} will read
%  |tb11filnam.tex|
%
%    \begin{macrocode}
\def\infil@{\jobname}
\def\Input #1 {\ifnum\issueseqno<0
    \def\infil@{#1}%
  \else
    \def\infil@{tb\number\issueseqno#1}
  \fi
  \edef\jobname{\infil@}\@readFLN
  \@@input \infil@\relax
  \if@RMKopen
    \immediate\closeout\@TBremarkfile\@RMKopenfalse
  \fi
}
%    \end{macrocode}
%
% \cs{TBremark}s are things that need to be drawn to the attention of
% the editors; the conscientious author will include such things in
% the article file.  By default, remarks are suppressed, but their
% appearance may be enabled by the \cs{TBEnableRemarks} command, which
% can be included in the configuration file |ltugboat.cfg| (or
% |ltugproc.cfg|, if that's what we're at).
%
%    \begin{macrocode}
\newif\if@RMKopen        \@RMKopenfalse
\newwrite\@TBremarkfile
\def\@TBremark#1{%
  \if@RMKopen
  \else
    \@RMKopentrue\immediate\openout\@TBremarkfile=\infil@.rmk
  \fi
  \toks@={#1}%
  \immediate\write\@TBremarkfile{^^J\the\toks@}%
  \immediate\write16{^^JTBremark:: \the\toks@^^J}%
}
%    \end{macrocode}
%
% We initialise \cs{TBremark} to ignore its argument (this used to
% involve a \cs{TBremarkOFF} which was cunningly defined exactly the
% same as \cs{gobble})
%
%    \begin{macrocode}
\let\TBremark=\gobble
%    \end{macrocode}
%
% \cs{TBEnableRemarks} simply involves setting \cs{TBremark} to use
% the functional \cs{@TBremark} defined above.
%
%    \begin{macrocode}
\def\TBEnableRemarks{\let\TBremark\@TBremark}
%    \end{macrocode}
%
% For marking locations in articles that pertain to remarks
% in another file of editorial comments
%
%    \begin{macrocode}
\def\TUBedit#1{}
%    \end{macrocode}
%
% For using different filenames in the production process than those
% supplied by authors
%
%    \begin{macrocode}
\def\TUBfilename#1#2{\expandafter\def\csname file@@#1\endcsname{#2}}
\newread\@altfilenames
\def\@readFLN{\immediate\openin\@altfilenames=\jobname.fln
  \ifeof\@altfilenames\let\@result\relax\else
  \def\@result{\@@input\jobname.fln }\fi
  \immediate\closein\@altfilenames
  \@result}
\@readFLN
\everyjob=\expandafter{\the\everyjob\@readFLN}
\InputIfFileExists{\jobname.fln}%
     {\TBInfo{Reading alternative file file \jobname.fln}}{}
%    \end{macrocode}
%
% The following needs to work entirely in \TeX's mouth
%    \begin{macrocode}
\def\@tubfilename#1{\expandafter\ifx\csname file@@#1\endcsname\relax
  #1\else\csname file@@#1\endcsname\fi}
\def\fileinput#1{\@@input\@tubfilename{#1} }
%    \end{macrocode}
%
% Write out (both to a file and to the log) the starting page number
% of an article, to be used for cross references and in contents.
% |\pagexref|  is used for articles fully processed in the \TUB{}
% run.  |\PageXref|  is used for `extra' pages, where an item is
% submitted as camera copy, and only running heads (at most) are run.
%
%    \begin{macrocode}
%<*!latex>
\def\pagexrefON#1{%
        \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}%
        \write\ppoutfile{%
                \def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}%
        }
\def\PageXrefON#1{%
        \immediate\write-1{\def\expandafter
                        \noexpand\csname#1\endcsname{\number\pageno}}%
        \immediate\write\ppoutfile{\def\expandafter
                        \noexpand\csname#1\endcsname{\number\pageno}}}
%</!latex>
%<*latex>
\def\pagexrefON#1{%
        \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}%
        \write\ppoutfile{%
                \def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}%
        }
\def\PageXrefON#1{%
        \immediate\write-1{\def\expandafter
                        \noexpand\csname#1\endcsname{\number\c@page}}%
        \immediate\write\ppoutfile{\def\expandafter
                        \noexpand\csname#1\endcsname{\number\c@page}}}
%</latex>
\def\pagexrefOFF#1{}
\let\pagexref=\pagexrefOFF
\def\PageXrefOFF#1{}
\let\PageXref=\PageXrefOFF
\def\xreftoON#1{%
  \ifundefined{#1}%
    ???\TBremark{Need cross reference for #1.}%
  \else\csname#1\endcsname\fi}
\def\xreftoOFF#1{???}
\let\xrefto=\xreftoOFF
%    \end{macrocode}
%
% \cs{TBdriver} `marks code for use when articles are run together in
% a driver file'.  Since we don't yet have a definition of that
% arrangement, we don't have a definition of \cs{TBdriver}.  Its
% argument (which one presumes was intended as the code for this
% unusual state) is just gobbled.
%
%    \begin{macrocode}
\let\TBdriver\gobble
%    \end{macrocode}
%
% Some hyphenation exceptions:
%
%    \begin{macrocode}
\ifx\tubomithyphenations\@thisisundefined
\hyphenation{Del-a-ware Dijk-stra Duane Eijk-hout
  Flor-i-da Free-BSD Ghost-script Ghost-view
  Hara-lam-bous Jac-kow-ski Karls-ruhe
  Mac-OS Ma-la-ya-lam Math-Sci-Net
  Net-BSD Open-BSD Open-Office
  Pfa-Edit Post-Script Rich-ard Skoup South-all
  Vieth VM-ware Win-Edt
  acro-nym acro-nyms analy-sis ap-pen-di-ces ap-pen-dix asyn-chro-nous
  bib-lio-graph-i-cal bit-map bit-mapped bit-maps buf-fer buf-fers bool-ean
  col-umns com-put-able com-put-abil-ity cus-tom-iz-able
  data-base data-bases
   de-allo-cate de-allo-cates de-allo-cated de-allo-ca-tion
   de-riv-a-tive de-riv-a-tives de-riv-a-ble der-i-va-tion dis-trib-ut-able
  es-sence
  fall-ing
  half-way
  in-fra-struc-ture
  key-note
  long-est
  ma-gyar man-u-script man-u-scripts meta-table meta-tables
   mne-mon-ic mne-mon-ics mono-space mono-spaced
  name-space name-spaces
  off-line over-view
  pal-ettes par-a-digm par-a-dig-mat-ic par-a-digms
   pipe-line pipe-lines
   plug-in plug-ins pres-ent-ly pro-gram-mable
  re-allo-cate re-allo-cates re-allo-cated re-printed
  set-ups se-vere-ly spell-ing spell-ings stand-alone strong-est
   sub-ex-pres-sion sub-tables sur-gery syn-chro-ni-city syn-chro-nous
  text-height text-length text-width
   time-stamp time-stamped time-stamps
  vis-ual vis-ual-ly
  which-ever white-space white-spaces wide-spread wrap-around
}
\fi
%<!latex>\restorecat\@
%</common>
%<*classtail>
\PrelimDrafttrue
%    \end{macrocode}
% \subsection{Page dimensions, glue, penalties, etc.}
%    \begin{macrocode}
\textheight 54pc
\textwidth 39pc
\columnsep 1.5pc
\columnwidth 18.75pc
\hfuzz 1pt
\parindent \normalparindent
\parskip \z@ % \@plus\p@
\leftmargini 2em
\leftmarginv .5em
\leftmarginvi .5em
\oddsidemargin \z@
\evensidemargin \z@
\topmargin -2.5pc
\headheight 12\p@
\headsep 20\p@
\marginparwidth 48\p@
\marginparsep 10\p@
\partopsep=\z@
\topsep=3\p@\@plus\p@\@minus\p@
\parsep=3\p@\@plus\p@\@minus\p@
\itemsep=\parsep
%
% Ordinarily we typeset in two columns, but the onecolumn option
% goes to one.  In which case we want to center the text block on an
% 8.5in width, given the default 72.27pt offset with margins of zero.
% We are always in LaTeX's twoside mode because of how we load article,
% and this is a good thing, since we want different headings.
\if@tubtwocolumn \twocolumn \else
  \onecolumn
  \textwidth=34pc 
  \oddsidemargin=30.8775pt
  \evensidemargin=\oddsidemargin
\fi
%
\newdimen\pagewd        \pagewd=\textwidth
\newdimen\trimwd        \trimwd=\pagewd
\newdimen\trimlgt       \trimlgt=11in
\newdimen\headmargin    \headmargin=3.5pc
%    \end{macrocode}
%
% In \LaTeXe, |twoside| option is forced on when
% |article.cls| is loaded.
%
% \subsection{Messing about with the \LaTeX{} logo}
% \label{sec:latex-logo}
%
% Barbara Beeton's pleas for \LaTeX{} logos that look right in any
% font shape provoked me to generate the following stuff that is
% configurable.
%
% Here's the command for the user to define a new version.  The
% arguments are font family, series and shape, and then the two kern
% values used in placing the raised `A' of \LaTeX.
%
%    \begin{macrocode}
\newcommand{\DeclareLaTeXLogo}[5]{\expandafter\def
  \csname @LaTeX@#1/#2/#3\endcsname{{#4}{#5}}}
%    \end{macrocode}
%
% The default values are as used in the source of \LaTeX{} itself:
%
%    \begin{macrocode}
\def\@LaTeX@default{{.36}{.15}}
%    \end{macrocode}
%
% More are defined in the initial version, for bold CM sans (which is
% used as \cs{SecTitleFont}), and CM italic medium and bold, and
% Bitstream Charter (which Nelson Beebe likes to use).  Duplicate for
% Latin Modern.
%
%    \begin{macrocode}
\DeclareLaTeXLogo{cmss}{bx}{n}{.3}{.15}
\DeclareLaTeXLogo{lmss}{bx}{n}{.3}{.15}
%
\DeclareLaTeXLogo{cmr}{m}{it}{.29}{.2}
\DeclareLaTeXLogo{lmr}{m}{it}{.29}{.2}
%
\DeclareLaTeXLogo{cmr}{m}{sl}{.29}{.15}
\DeclareLaTeXLogo{lmr}{m}{sl}{.29}{.15}
%
\DeclareLaTeXLogo{cmr}{bx}{it}{.29}{.2}
\DeclareLaTeXLogo{lmr}{bx}{it}{.29}{.2}
%
\DeclareLaTeXLogo{cmr}{bx}{sl}{.29}{.2}
\DeclareLaTeXLogo{lmr}{bx}{sl}{.29}{.2}
%
\DeclareLaTeXLogo{bch}{m}{n}{.2}{.08}
\DeclareLaTeXLogo{bch}{m}{it}{.2}{.08}
%    \end{macrocode}
%
% Redefine \cs{LaTeX} to choose the parameters for the current font,
% or to use the default value otherwise:
%
%    \begin{macrocode}
\DeclareRobustCommand{\LaTeX}{\expandafter\let\expandafter\reserved@a
  \csname @LaTeX@\f@family/\f@series/\f@shape\endcsname
  \ifx\reserved@a\relax\let\reserved@a\@LaTeX@default\fi
  \expandafter\@LaTeX\reserved@a}
%    \end{macrocode}
%
% Here's the body of what was originally \cs{LaTeX}, pulled out with its
% roots dripping onto the smoking ruin of original \LaTeX, and then
% bits stuck in on the side.
%
% \cs{@LaTeX@default} provides parameters as one finds in the
% original; other versions are added as needed.
%
%    \begin{macrocode}
\newcommand{\@LaTeX}[2]{%
  %\wlog{latex logo family=\f@family/\f@series/\f@shape -> #1, #2.}%
  L\kern-#1em
  {\sbox\z@ T%
   \vbox to\ht0{\hbox{$\m@th$%
                      \csname S@\f@size\endcsname
                      \fontsize\sf@size\z@
                      \math@fontsfalse\selectfont
                      A}%
                \vss}%
  }%
  \kern-#2em%
  \TeX}
%    \end{macrocode}
%
% \subsection{Authors, contributors, addresses, signatures}
%
% An article may have several authors (of course), so we permit an
% \cs{author} command for each of them.  The names are then stored in
% a set of \cs{csname}s called \cs{author1}, \cs{author2}, \dots
% Similarly, there are several \cs{address<n>} and \cs{netaddress<n>}
% and \cs{PersonalURL<n>} and \cs{ORCID<n>} commands set up for each article.
%
% \begin{description}
% \item[\emph{Comment:}] I would like to make provision for several
%   authors at the same address, but (short of preempting the |*|
%   marker, which it would be nice to retain so as to preserve
%   compatibility with the |plain| style) I'm not sure how one would
%   signal it.
% \end{description}
%    \begin{macrocode}
\def\theauthor#1{\csname theauthor#1\endcsname}
\def\theaddress#1{\csname theaddress#1\endcsname}
\def\thenetaddress#1{\csname thenetaddress#1\endcsname}
\def\thePersonalURL#1{\csname thePersonalURL#1\endcsname}
\def\theORCID#1{\csname theORCID#1\endcsname}
%    \end{macrocode}
%
% The standard way of listing authors is to iterate from 1 to
% \cs{count@} and to pick the author names as we go.
%
%    \begin{macrocode}
%<!latex>\newcount\@tempcnta
\def\@defaultauthorlist{%
  \@getauthorlist\@firstofone
}
%    \end{macrocode}
%
% \cs{@getauthorlist} processes the author list, passing every bit of
% stuff that needs to be typeset to the macro specified as its argument.
%    \begin{macrocode}
\def\@getauthorlist#1{%
  \count@\authornumber
  \advance\count@ by -2
  \@tempcnta0
%    \end{macrocode}
%
% Loop to output the first \ensuremath{n-2} of the \ensuremath{n}
% authors (the loop does nothing if there are two or fewer authors)
%
%    \begin{macrocode}
  \loop
    \ifnum\count@>0
      \advance\@tempcnta by \@ne
      #1{\ignorespaces\theauthor{\number\@tempcnta}\unskip, }%
      \advance\count@ by \m@ne
  \repeat
  \count@\authornumber
  \advance\count@ by -\@tempcnta
  \ifnum\authornumber>0
%    \end{macrocode}
%
% If there are two or more authors, we output the penultimate author's
% name here, followed by `and'
%
%    \begin{macrocode}
    \ifnum\count@>1
      \count@\authornumber
      \advance\count@ by \m@ne
      #1{\ignorespaces\theauthor{\number\count@}\unskip\@tubauthorlastsep}%
    \fi
%    \end{macrocode}
%
% Finally (if there were any authors at all) output the last author's
% name:
%
%    \begin{macrocode}
    #1{\ignorespaces\theauthor{\number\authornumber}\unskip}
  \fi
}
%
\def\@tubauthorlastsep{, }% until 2018, was: "\ and "
%    \end{macrocode}
%
% Signature blocks.  The author can (in principle) define a different
% sort of signature block using \cs{signature}, though this could well
% cause the editorial group to have collective kittens (unless it had
% been discussed in advance\dots)
%
%    \begin{macrocode}
\def\signature#1{\def\@signature{#1}}
\def\@signature{\@defaultsignature}
%    \end{macrocode}
%
% \cs{@defaultsignature} loops through all the authors, outputting the
% details we have about that author, or (if we're in a sub-article)
% outputs the contributor's name and closes the group opened by
% \cs{contributor}.  It is (as its name implies) the default body for
% \cs{makesignature}
%
%    \begin{macrocode}
\def\@defaultsignature{{%
    \let\thanks\@gobble
    \frenchspacing
    %
    \ifnum\authornumber<0
%    \end{macrocode}
% if \cs{authornumber}$<0$, we are in a contributor's section
%    \begin{macrocode}
      \medskip
      \signaturemark
      \theauthor{\number\authornumber}\\
      \theaddress{\number\authornumber}\\
      \allowhyphens
      \thenetaddress{\number\authornumber}\\
      \thePersonalURL{\number\authornumber}\\
      \theORCID{\number\authornumber}\\
    \else
%    \end{macrocode}
% \cs{authornumber}$\ge0$, so we are in the body of an ordinary
% article
%    \begin{macrocode}
      \count@=0
      \loop
        \ifnum\count@<\authornumber
          \medskip
          \advance\count@ by \@ne
          \signaturemark
          \theauthor{\number\count@}\\
          \theaddress{\number\count@}\\
          {%
            \allowhyphens
            \thenetaddress{\number\count@}\\
            \thePersonalURL{\number\count@}\\
            \theORCID{\number\count@}\\
          }%
      \repeat
    \fi
  }%
}
\newdimen\signaturewidth   \signaturewidth=12pc
%    \end{macrocode}
% The optional argument to \cs{makesignature} is useful in some
% circumstances (e.g., multi-contributor articles)
%    \begin{macrocode}
\newcommand{\makesignature}[1][\medskipamount]{%
%    \end{macrocode}
%
% check the value the user has put in \cs{signaturewidth}: it may be
% at most \verb|1.5pc| short of \cs{columnwidth}
%    \begin{macrocode}
  \@tempdima\signaturewidth
  \advance\@tempdima 1.5pc
  \ifdim \@tempdima>\columnwidth
    \signaturewidth \columnwidth
    \advance\signaturewidth -1.5pc
  \fi
  \par
  \penalty9000
  \vspace{#1}%
  \rightline{%
    \vbox{\hsize\signaturewidth \ninepoint \raggedright
      \parindent \z@ \everypar={\hangindent 1pc }%
      \parskip \z@skip
      \def\|{\unskip\hfil\break}%
      \def\\{\endgraf}%
      \def\phone{\rm Phone: }%
      \def\tubmultipleaffilauthor{\\\hspace*{1em}}%
      \rm\@signature}%
  }%
  \ifnum\authornumber<0 \endgroup\fi
}
\def\signaturemark{\leavevmode\llap{$\diamond$\enspace}}
%    \end{macrocode}
%
% The idea here is that if multiple authors share affiliation
% information, we need only typeset the affiliation once. We separate by
% commas for the \cs{maketitle}, and put on separate lines in the
% \cs{makesignature}. Similarly, within \cs{netaddress},
% |!tubmultipleaffilnet| separates with a space before and after the
% comma, while . (All this per bb.) See |tb122childs-trotter.ltx| for an
% example.
% 
%    \begin{macrocode}
\def\tubmultipleaffilauthor{\unskip, \ignorespaces}%
\def\tubmultipleaffilnet{\unskip\textrm{\,,\ \ignorespaces}}
%    \end{macrocode}
%
% Now all the awful machinery of author definitions.
% \cs{authornumber} records the number of authors we have recorded to
% date.
%
%    \begin{macrocode}
\newcount\authornumber
\authornumber=0
%    \end{macrocode}
%
% \cs{author} `allocates' another author name (by bumping
% \cs{authornumber}) and also sets up the address and netaddress for
% this author to produce a warning and to prevent oddities if they're
% invoked.  This last assumes that invocation will be in the context
% of \cs{signature} (|ltugboat.cls|) or \cs{maketitle}
% (|ltugproc.cls|); in both cases, invocation is followed by a line
% break (tabular line break |\\| in |ltugproc|, \cs{endgraf} in
% \cs{makesignature} in |ltugboat|).
%
%    \begin{macrocode}
\def\author{%
  \global\advance\authornumber\@ne
  \TB@author
}
%    \end{macrocode}
% \cs{contributor} is for a small part of a multiple-part article; it
% begins a group that will be ended in \cs{makesignature}.
%    \begin{macrocode}
\def\contributor{%
  \begingroup
  \authornumber\m@ne
  \TB@author
}
%    \end{macrocode}
%
% Both `types' of author fall through here to set up the author name
% and to initialise author-related things.  \cs{EDITORno*} commands
% allow the editor to record that there's good reason for an
% \emph{address} or \emph{netaddress} not to be there (the
% \emph{personalURL} and \emph{ORCID} are optional anyway).
%    \begin{macrocode}
\def\TB@author#1{%
  \expandafter\def\csname theauthor\number\authornumber\endcsname
      {\ignorespaces#1\unskip}%
  \expandafter\def\csname theaddress\number\authornumber\endcsname
    {\TBWarningNL{Address for #1\space missing}\@gobble}%
  \expandafter\def\csname thenetaddress\number\authornumber\endcsname
    {\TBWarningNL{Net address for #1\space missing}\@gobble}%
  \expandafter\let\csname thePersonalURL\number\authornumber\endcsname
    \@gobble
  \expandafter\let\csname theORCID\number\authornumber\endcsname
    \@gobble
  }
\def\EDITORnoaddress{%
  \expandafter\let\csname theaddress\number\authornumber\endcsname
    \@gobble
}
\def\EDITORnonetaddress{%
  \expandafter\let\csname thenetaddress\number\authornumber\endcsname
    \@gobble
}
%    \end{macrocode}
%
% \cs{address} copies its argument into the \cs{theaddress<n>}
% for this author.
%
%    \begin{macrocode}
\def\address#1{%
  \expandafter\def\csname theaddress\number\authornumber\endcsname
      {\leavevmode\ignorespaces#1\unskip}}
%    \end{macrocode}
%
% \cs{network} is for use within the optional argument of
% \cs{netaddress}; it defines the \emph{name} of the network the user
% is on.
%
% \begin{description}
% \item[\emph{Comment:}] I think this is a fantasy, since everyone (in
%   practice, nowadays) quotes an internet address.  In principle, there
%   are people who will quote |X.400| addresses (but they're few and far
%   between) and I have (during 1995!)\ seen an address with an |UUCP|
%   bang-path component on |comp.text.tex|, but \emph{really}!
% \end{description}
%
%    \begin{macrocode}
\def\network#1{\def\@network{#1: }}
%    \end{macrocode}
%
% \cs{netaddress} begins a group, executes an optional argument (which
% should not, presumably, contain global commands) and then relays to
% \cs{@relay@netaddress} with both |@| and |%| made active (so that
% they can be discretionary points in the address).  If we're using
% \LaTeXe, we use the default-argument form of \cs{newcommand};
% otherwise we write it out in all its horribleness.
%
%    \begin{macrocode}
\newcommand{\netaddress}[1][\relax]{%
  \begingroup
  \def\@network{}%
%    \end{macrocode}
%
% Unfortunately, because of the catcode hackery, we have still to do
% one stage of relaying within our own code, even if we're using
% \LaTeXe.
%
%    \begin{macrocode}
  #1\@sanitize\makespace\ \makeactive\@%
  \makeescape! \makebgroup[ \makeegroup]% seems more useful than literals
  \makeactive\.\makeactive\%\@relay@netaddress}%
%    \end{macrocode}
%
% \cs{@relay@netaddress} finishes the job. It sets \cs{thenetaddress}
% for this author to contain the network name followed by the address.
% As a result of our kerfuffle above, |@| and |%| are active at the
% point we're entered.  We ensure they're active when
% \cs{thenetaddress} gets expanded, too. (\textbf{\emph{WOT}?!})
%
%    \begin{macrocode}
\def\@relay@netaddress#1{%
  \ProtectNetChars
  \expandafter\protected@xdef
      \csname thenetaddress\number\authornumber\endcsname
    {\protect\leavevmode\textrm{\@network}%
     {\protect\NetAddrChars\net
      \ignorespaces#1\unskip}}%
  \endgroup
  }
%    \end{macrocode}
%
% \cs{personalURL} is in essence the same as \cs{netaddress}, apart
% from (1) the lack of the eccentric optional argument, and (2) the
% activation of `|/|'.
%
% For general URLs, \texttt{url.sty} (with or without hyperref) suffices
% and is recommended.
%
%    \begin{macrocode}
\def\personalURL{\begingroup
  \@sanitize\makespace\ \makeactive\@
  \makeactive\.\makeactive\%\makeactive\/\@personalURL}%
\def\@personalURL#1{%
  \ProtectNetChars
  \expandafter\protected@xdef
    \csname thePersonalURL\number\authornumber\endcsname{%
      \protect\leavevmode
      {%
        \protect\URLchars\net
        \ignorespaces#1\unskip
      }%
    }%
  \endgroup
  }
%    \end{macrocode}
%
% Define the activation mechanism for `|@|', `|%|', `|.|'  and `|/|', for use
% in the above.  Note that, since the code has `|%|' active, we have
% `|*|' as a comment character, which has a tendency to make things
% look peculiar\dots
%
%    \begin{macrocode}
{%
  \makecomment\*
  \makeactive\@
  \gdef\netaddrat{\makeactive\@*
    \def@{\discretionary{\char"40}{}{\char"40}}}
  \makeactive\%
  \gdef\netaddrpercent{\makeactive\%*
    \def%{\discretionary{\char"25}{}{\char"25}}}
  \makeactive\.
  \gdef\netaddrdot{\makeactive\.*
    \def.{\discretionary{\char"2E}{}{\char"2E}}}
%    \end{macrocode}
%
% \cs{NetAddrChars} is what \emph{we} use (we're constrained to retain
% the old interface to this stuff, but it \emph{is} clunky\dots).
% Since {\small URL}s are a new idea, we are at liberty not to define
% a separate \cs{netaddrslash} command, and we only have
% \cs{URLchars}.
%
%    \begin{macrocode}
  \gdef\NetAddrChars{\netaddrat \netaddrpercent \netaddrdot}
  \makeactive\/
  \gdef\URLchars{*
    \NetAddrChars
    \makeactive\/*
    \def/{\discretionary{\char"2F}{}{\char"2F}}}
%    \end{macrocode}
%
% \cs{ProtectNetChars} includes protecting `|/|', since this does no
% harm in the case of net addresses (where it's not going to be
% active) and we thereby gain by not having yet another csname.
%
%    \begin{macrocode}
  \gdef\ProtectNetChars{*
    \def@{\protect@}*
    \def%{\protect%}*
    \def.{\protect.}*
    \def/{\protect/}*
    }
}
%    \end{macrocode}
%
%  \LaTeXe{} (in its wisdom) suppresses
%  \cs{DeclareOldFontCommand} when in compatibility mode, so that in
%  that circumstance we need to use a declaration copied from
%  |latex209.def| rather than the way we would normally do the thing
%  (using the command \LaTeXe{} defines for the job).
%
%    \begin{macrocode}
\if@compatibility
  \DeclareRobustCommand{\net}{\normalfont\ttfamily\mathgroup\symtypewriter}
\else
  \DeclareOldFontCommand{\net}{\ttfamily\upshape\mdseries}{\mathtt}
\fi
\def\authorlist#1{\def\@author{#1}}
\def\@author{\@defaultauthorlist}
%    \end{macrocode}
%
% \cs{ORCID} inserts `ORCID' and then argument into the \cs{theORCID<n>}
% for this author. Also, we want \cs{small} for this.
%
%    \begin{macrocode}
\def\ORCID#1{%
  \expandafter\def\csname theORCID\number\authornumber\endcsname
      {\leavevmode \ignorespaces {\SMC ORCID} #1\unskip}}
%    \end{macrocode}
%
% For the online re-publication (as of 2009) by Mathematical Sciences
% Publishers |http://mathscipub.org|, lots and lots of metadata is
% needed, much of it redundant with things we already do.  They are
% flexible enough to allow us to specify it in any reasonable way, so
% let's make one command \cs{mspmetavar} which takes two arguments.
% Example: |\mspmetavar{volumenumber}{30}|.  For our purposes, it is
% just a no-op.  And this initiative never came to anything, so it is
% not used at all.
%
% \begin{macro}{\mspmetavar}
%    \begin{macrocode}
\def\mspmetavar#1#2{}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Article title}
%
% \begin{macro}{\if@articletitle}
% \begin{macro}{\maketitle}
% \begin{macro}{\@r@maketitle}
% \cs{maketitle} takes an optional ``*''; if present, the operation is
% not defining the title of a paper, merely that of a ``business''
% section (such as the participants at a meeting) that has no credited
% author or other title.  In this case, the command flushes out the
% latest \cs{sectitle} (or whatever) but does nothing else.
%
% Provide machinery to skip extra space, even one or more full columns,
% above the top of an article to leave space to paste up a previous
% article that has finished on the same page.  This is a fall back to
% accommodate the fact that multiple articles cannot yet be run together
% easily with \LaTeXe.
%    \begin{macrocode}
\newif\if@articletitle
\def\maketitle{\@ifstar
  {\@articletitlefalse\@r@maketitle}%
  {\@articletitletrue\@r@maketitle}%
}
\def\@r@maketitle{\par
 \ifdim\PreTitleDrop > \z@
   \loop
   \ifdim \PreTitleDrop > \textheight
     \vbox{}\vfil\eject
     \advance\PreTitleDrop by -\textheight
   \repeat
   \vbox to \PreTitleDrop{}
   \global\PreTitleDrop=\z@
 \fi
 \begingroup
 \setcounter{footnote}{0}
 \global\@topnum\z@ % disallow floats above the title
 \def\thefootnote{\fnsymbol{footnote}}
 \@maketitle
 \@thanks
 \endgroup
 \setcounter{footnote}{0}
 \gdef\@thanks{}
 }
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\title}
% \begin{macro}{\TB@title}
% We redefine the \cs{title} command, so as to set the \cs{rhTitle}
% command at the same time.  While we're at it, we redefine it to have
% optional arguments for use as `short' versions, thus obviating the
% need for users to use the \cs{shortTitle} command.
%    \begin{macrocode}
\def\rhTitle{}% avoid error if no author or title
\renewcommand{\title}{\@dblarg\TB@title}
\def\TB@title[#1]#2{\gdef\@title{#2}%
  \bgroup
    \let\thanks\@gobble
    \def\\{\unskip\space\ignorespaces}%
    \protected@xdef\rhTitle{#1}%
  \egroup
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\shortTitle}
% \begin{macro}{\ifshortAuthor}
% \begin{macro}{\shortAuthor}
% The \cs{rh*} commands are versions to be used in the running head of
% the article.  Normally, they are the same things as the author and
% title of the article, but in the case that there are confusions
% therein, the text should provide substitutes, using the \cs{short*}
% commands.
%    \begin{macrocode}
\def\shortTitle #1{\def\rhTitle{#1}}
\newif\ifshortAuthor
\def\shortAuthor #1{\def\rhAuthor{#1}\shortAuthortrue}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Section titles}
%
%  The following macros are used to set the large \TUB{} section heads
%  (e.g.\ ``General Delivery'', ``Fonts'', etc.)
%
%  Define the distance between articles which are run together:
%
%    \begin{macrocode}
\def\secsep{\vskip 5\baselineskip}
%    \end{macrocode}
%
% Note that \cs{stbaselineskip} is used in the definition of
% \cs{sectitlefont}, in \LaTeXe, so that it has (at least) to be
% defined before \cs{sectitlefont} is used (we do the whole job).
%
%    \begin{macrocode}
\newdimen\stbaselineskip        \stbaselineskip=18\p@
\newdimen\stfontheight
\settoheight{\stfontheight}{\sectitlefont O}
%    \end{macrocode}
%
% Declaring section titles; the conditional \cs{ifSecTitle} records
% the occurence of a \cs{sectitle} command.  If (when) a subsequent
% \cs{maketitle} occurs, the section title box will get flushed out;
% as a result of this, one could in principle have a set of
% \cs{sectitle} commands in a semi-fixed steering file, and inclusions
% of files inserted only as and when papers have appeared.  Only the
% last \cs{sectitle} will actually be executed.
%
%    \begin{macrocode}
\newif\ifWideSecTitle
\newif\iftubtitlerulefullwidth
\newif\ifSecTitle \SecTitlefalse
\newcommand{\sectitle}{%
  \SecTitletrue
  \@ifstar
    {\WideSecTitletrue\def\s@ctitle}%
    {\WideSecTitlefalse\def\s@ctitle}%
}
%    \end{macrocode}
%
% \cs{PreTitleDrop} records the amount of column-space we need to
% eject before we start any given paper.  It gets zeroed after that
% ejection has happened.
%
%    \begin{macrocode}
\newdimen\PreTitleDrop   \PreTitleDrop=\z@
%    \end{macrocode}
%
% The other parameters used in \cs{@sectitle}; I don't think there's
% the slightest requirement for them to be registers (since they're
% constant values, AFAIK), but converting them to macros would remove
% the essentially useless functionality of being able to change them
% using assignment, which I'm not about to struggle with just now...
%
% \cs{AboveTitleSkip} and \cs{BelowTitleSkip} are what you'd expect;
% \cs{strulethickness} is the value to use for \cs{fboxrule} when
% setting the title, and for the rule above titles when there is no box.
%
%    \begin{macrocode}
\newskip\AboveTitleSkip  \AboveTitleSkip=12\p@
\newskip\BelowTitleSkip  \BelowTitleSkip=8\p@
\newdimen\strulethickness       \strulethickness=.6\p@
%    \end{macrocode}
%
% \cs{@sectitle} actually generates the section title (in a rather
% generous box).  It gets called from \cs{maketitle} under conditional
% \cs{ifSecTitle}; by the time \cs{@sectitle} takes control, we
% already have \cs{SecTitlefalse}.  This implementation uses \LaTeX's
% \cs{framebox} command, on the grounds that one doesn't keep a dog
% and bark for oneself\dots
%
%    \begin{macrocode}
\def\@sectitle #1{%
  \par
  \penalty-1000
%    \end{macrocode}
%
% If we're setting a wide title, the stuff will be at the top of a
% page (let alone a column) but inside a box, so that the separator
% won't be discardable: so don't create the separator in this case.
%
%    \begin{macrocode}
  \ifWideSecTitle\else\secsep\fi
  {%
    \fboxrule\strulethickness
    \fboxsep\z@
    \noindent\framebox[\hsize]{%
      \vbox{%
        \raggedcenter
        \let\\\@sectitle@newline
        \sectitlefont
        \makestrut[2\stfontheight;\z@]%
        #1%
        \makestrut[\z@;\stfontheight]\endgraf
      }%
    }%
  }%
  \nobreak
  \vskip\baselineskip
}
%    \end{macrocode}
%
% \begin{macro}{\@sectitle@newline}
% For use inside \cs{sectitle} as |\\|.  Works similarly to |\\| in
% the ``real world''---uses an optional argument
%    \begin{macrocode}
\newcommand{\@sectitle@newline}[1][\z@]{%
  \ifdim#1>\z@
    \makestrut[\z@;#1]%
  \fi
  \unskip\break
}
%    \end{macrocode}
% \end{macro}
%
% We need to trigger the making of a section title in some cases where
% we don't have a section title proper (for example, in material taken
% over from
%^^A \acro
% {TTN}).
%    \begin{macrocode}
\def\@makesectitle{\ifSecTitle
    \global\SecTitlefalse
    \ifWideSecTitle
      \twocolumn[\@sectitle{\s@ctitle}]%
      \global\WideSecTitlefalse
    \else
      \@sectitle{\s@ctitle}%
    \fi
  \else
    \vskip\AboveTitleSkip
    \kern\topskip
    \hrule \@height\z@ \@depth\z@ \@width 10\p@
    \kern-\topskip
    \kern-\strulethickness
    \iftubtitlerulefullwidth
      \hrule \@height\strulethickness \@depth\z@ width\textwidth
    \else
      \hrule \@height\strulethickness \@depth\z@
    \fi
    \kern\medskipamount
    \nobreak
  \fi
}
%    \end{macrocode}
%
% \begin{macro}{\@maketitle}
% Finally, the body of \cs{maketitle} itself.
%    \begin{macrocode}
\def\@maketitle{%
  \@makesectitle
  \if@articletitle{%
    \nohyphens \interlinepenalty\@M
    \setbox0=\hbox{%
      \let\thanks\@gobble
      \let\\=\quad
      \let\and=\quad
      \ignorespaces\@author}%
    {%
      \noindent\bf\raggedright\ignorespaces\frenchspacing
      \let\BibTeX=\bfBibTeX % else LaTeX Font Warning: 
                            %      Font shape `OT1/cmr/bx/sc' undefined
      \@title\endgraf
    }%
    \ifdim \wd0 < 5\p@               % omit if author is null
    \else
%    \end{macrocode}
% Since we have \(\mathtt{\cs{BelowTitleSkip}} + \mathtt{4pt} =
% \mathtt{\cs{baselineskip}}\), we say:
%    \begin{macrocode}
      \nobreak \vskip 4\p@
      {%
        \leftskip=\normalparindent
        \raggedright
        \def\and{\unskip\\}%
        \noindent\@author\endgraf
      }%
    \fi
    \nobreak
    \vskip\BelowTitleSkip
  }\fi%
  \global\@afterindentfalse
  \aftergroup\@afterheading
}
%    \end{macrocode}
% \end{macro}
%
% Dedications are ragged right, in italics.
%
%    \begin{macrocode}
\newenvironment{dedication}%
  {\raggedright\noindent\itshape\ignorespaces}%
  {\endgraf\medskip}
%    \end{macrocode}
%
% The |abstract| and |longabstract| environments both use \cs{section*}.
% For one-column articles (or in |ltugproc| class), indent the
% abstract.  This is done in the usual bizarre \LaTeX\ way, by treating
% it as a one-item list with an empty item marker.
%
%    \begin{macrocode}
\def\@tubonecolumnabstractstart{%
      \list{}{\listparindent\normalparindent
         \itemindent\z@ \leftmargin\@tubfullpageindent
         \rightmargin\leftmargin \parsep \z@}\item[]\ignorespaces
}
\def\@tubonecolumnabstractfinish{%
      \endlist
}
\renewenvironment{abstract}%
  {\begin{SafeSection}%
    \section*{%
        \if@tubtwocolumn\else \hspace*{\@tubfullpageindent}\fi
        Abstract}%
    \if@tubtwocolumn\else \@tubonecolumnabstractstart \fi
  }%
  {\if@tubtwocolumn\else \@tubonecolumnabstractfinish \fi
   \end{SafeSection}}
\newenvironment{longabstract}%
  {\begin{SafeSection}%
    \section*{Abstract}%
    \bgroup\small
  }%
  {\endgraf\egroup
    \end{SafeSection}%
  \vspace{.25\baselineskip}
  \begin{center}
    {$--*--$}
  \end{center}
  \vspace{.5\baselineskip}}
%    \end{macrocode}
%
% \subsection{Section headings}
%
%  Redefine style of section headings to match plain \TUB.
%  Negative beforeskip suppresses following parindent.  (So
%  negate the stretch and shrink too).
%
%  These macros are called \cs{*head} in the plain styles.
%
%  Relaying via \cs{TB@startsection} detects inappropriate use of
%  \cs{section*}.  Of course, if (when) \emph{we} use it, we need to
%  avoid that relaying; this can be done by \cs{let}ting
%  \cs{TB@startsection} to \cs{TB@safe@startsection}, within a group.
%
% First the version for use in the default case, when class option
% \textsc{numbersec} is in effect.
%
%    \begin{macrocode}
\if@numbersec
  \def\section{\TB@startsection{{section}%
                                1%
                                \z@
                                {-8\p@ \@plus-2\p@ \@minus-2\p@}%
                                {4\p@}%
          {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
  \def\subsection{\TB@startsection{{subsection}%
                                   2%
                                   \z@
                                   {-8\p@ \@plus-2\p@ \@minus-2\p@}%
                                   {4\p@}%
          {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
  \def\subsubsection{\TB@startsection{{subsubsection}%
                                      3%
                                      \z@
                                      {-8\p@ \@plus-2\p@ \@minus-2\p@}%
                                      {4\p@}%
          {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
  \def\paragraph{\TB@startsection{{paragraph}%
                                  4%
                                  \z@
                                  {4\p@ \@plus1\p@ \@minus1\p@}%
                                  {-1em}%
                                  {\normalsize\bf}}}
%    \end{macrocode}
%
% Now the version if class option \textsc{nonumber} is in effect,
% i.e., if \cs{if@numbersec} is false.
%
%    \begin{macrocode}
\else
  \setcounter{secnumdepth}{0}
  \def\section{\TB@nolimelabel
               \TB@startsection{{section}%
                                1%
                                \z@
                                {-8\p@ \@plus-2\p@ \@minus-2\p@}%
                                {4\p@}%
          {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
  \def\subsection{\TB@nolimelabel
                  \TB@startsection{{subsection}%
                                   2%
                                   \z@
                                   {-8\p@ \@plus-2\p@ \@minus-2\p@}%
                                   {-0.5em\@plus-\fontdimen3\font}%
          {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
  \def\subsubsection{\TB@nolimelabel
                     \TB@startsection{{subsubsection}%
                                      3%
                                      \parindent
                                      {-8\p@ \@plus-2\p@ \@minus-2\p@}%
                                      {-0.5em\@plus-\fontdimen3\font}%
          {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
\fi
%    \end{macrocode}
%
% \cs{TB@startsection} used to warn about \verb"*" versions of sectioning
% commands when numbering wasn't in effect.  But that eventually seemed
% a useless complaint, since it can be usefule to switch back and forth between
% numbered and unnumbered can be useful during article development.
% So now \cs{TB@startsection} is just a synonym for \cs{@startsection}.
%
%    \begin{macrocode}
\def\TB@startsection#1{\@startsection#1}%
%    \end{macrocode}
%
% \cs{TB@safe@startsection} is to be used where \cs{section*} (etc.)\
% appear in places where the request is OK (because it's built in to
% some macro we don't fiddle with).
%
%    \begin{macrocode}
\def\TB@safe@startsection#1{\@startsection#1}
%    \end{macrocode}
%
% The \texttt{SafeSection} environment allows use of \texttt{*}-forms
% of sectioning environments.  It's not documented for the general
% public: it's intended as an editor's facility.
%
%    \begin{macrocode}
\newenvironment{SafeSection}%
  {\let\TB@startsection\TB@safe@startsection}%
  {}
%    \end{macrocode}
%
% And now for the exciting sectioning commands that \LaTeX{} defines
% but we don't have a definition for (whatever else, we don't want
% Lamport's originals, which come out `like the blare of a bugle in a
% lullaby'\footnote{Thurber, \emph{The Wonderful O}}).
%
% The three inappropriate ones are subparagraph (indistinguishable
% from paragraph), and chapter and part.  The last seemed almost to be
% defined in an early version of these macros, since there was a
% definition of \cs{l@part}.  I've not got down to where that came
% from (or why).  If class option \textsc{nonumber} is in effect, we
% also suppress \cs{paragraph}, since it has no parallel in the plain
% style.
%
%    \begin{macrocode}
\if@numbersec
  \def\subparagraph{\TB@nosection\subparagraph\paragraph}
\else
  \def\paragraph{\TB@nosection\paragraph\subsubsection}
  \def\subparagraph{\TB@nosection\subparagraph\subsubsection}
\fi
\def\chapter{\TB@nosection\chapter\section}
\def\part{\TB@nosection\part\section}
\def\TB@nosection#1#2{\TBWarning{class does not support \string#1,
    \string#2\space used instead}#2}
%    \end{macrocode}
%
% \cs{l@<sectioning-name>} is for table of contents (of an article).
% We define new macros to allow easily changing the font used for toc
% entries (for \TUB, we usually want roman, not bold), and the space
% between entries.  Nelson Beebe and Frank Mittelbach's articles 
% often have toc's (and few others).  Also turn off microtype
% protrusion after \tableofcontents or leaders get messed up.
%
%    \begin{macrocode}
\def\TBtocsectionfont{\normalfont}
\newskip\TBtocsectionspace  \TBtocsectionspace=1.0ex\@plus\p@
%    \end{macrocode}
%
%    \begin{macrocode}
\def\l@section#1#2{\addpenalty{\@secpenalty}%
  \addvspace{\TBtocsectionspace}%
  \@tempdima 1.5em
  \begingroup
    \parindent\z@ \rightskip\z@  % article style makes \rightskip > 0
    \parfillskip\z@
    \TBtocsectionfont
    \leavevmode\advance\leftskip\@tempdima\hskip-\leftskip#1\nobreak\hfil
    \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
  \endgroup}
%    \end{macrocode}
%
% \subsection{Appendices}
%
% Appendices (which are really just another sort of section heading)
% raise a problem: if the sections are unnumbered, we plainly need to
% restore the section numbering, which in turn allows labelling of
% section numbers again (\cs{TBnolimelabel} happens before the
% \cs{refstepcounter}, so its effects get lost \dots~what a clever
% piece of design that was).  So here we go:
%
%    \begin{macrocode}
\renewcommand{\appendix}{\par
  \renewcommand{\thesection}{\@Alph\c@section}%
  \setcounter{section}{0}%
  \if@numbersec
  \else
    \setcounter{secnumdepth}{1}%
  \fi
%    \end{macrocode}
%
% Now: is this the start of an appendix environment?  This can be
% detected by looking at \cs{@currenvir}; if we are, we need to relay
% to \cs{@appendix@env} to pick up the optional argument.
%
%    \begin{macrocode}
  \def\@tempa{appendix}
  \ifx\@tempa\@currenvir
    \expandafter\@appendix@env
  \fi
}
%    \end{macrocode}
%
% Here we deal with \cs{begin}|{appendix}|\oarg{app-name}
%
%    \begin{macrocode}
\newcommand{\app@prefix@section}{}
\newcommand{\@appendix@env}[1][Appendix]{%
  \renewcommand{\@seccntformat}[1]{\csname app@prefix@##1\endcsname
    \csname the##1\endcsname\quad}%
  \renewcommand{\app@prefix@section}{#1 }%
}
%    \end{macrocode}
%
% Ending an appendix environment is pretty trivial\dots
%
%    \begin{macrocode}
\let\endappendix\relax
%    \end{macrocode}
%
%
% \subsection{References}
%
% If the sections aren't numbered, the natural tendency of the
% author to cross-reference (which, after all, is one of the things
% \LaTeX{} is for ever being advertised as being good at) can cause
% headaches.
%
% The following command is used by each of the sectioning commands to
% make a following \cs{ref} command bloop at the author.  Even if the
% author then ignores the complaint, the poor old editor may find the
% offending \cs{label} rather more easily.
%
% (Note that macro name is to be read as ``\emph{noli me} label'' (I
% don't know the medi\ae val Latin for `label').
%
% \begin{description}
% \item[\emph{Comment}] To come (perhaps): detection of the act of
%   labelling, and an analogue of \cs{ifG@refundefined} for this sort of
%   label
% \end{description}
%
%    \begin{macrocode}
\def\TB@nolimelabel{%
  \def\@currentlabel{%
    \protect\TBWarning{%
      Invalid reference to numbered label on page \thepage
      \MessageBreak made%
    }%
    \textbf{?!?}%
  }%
}
%    \end{macrocode}
%
% \subsection{Title references}
%
% This is a first cut at a mechanism for referencing by the title of a
% section; it employs the delightfully simple idea Sebastian Rahtz has
% in the \texttt{nameref} package (which is part of
% \texttt{hyperref}).  As it stands, it lacks some of the bells and
% whistles of the original, but they could be added; this is merely
% proof-of-concept.
%
% The name label comes from the moveable bit of the section argument;
% we subvert the \cs{@sect} and \cs{@ssect} commands (the latter
% deals with starred section commands) to grab the relevant argument.
%    \begin{macrocode}
\let\TB@@sect\@sect
\let\TB@@ssect\@ssect
\def\@sect#1#2#3#4#5#6[#7]#8{%
  \def\@currentlabelname{#7}%
  \TB@@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}%
}
\def\@ssect#1#2#3#4#5{%
 \def\@currentlabelname{#5}%
 \TB@@ssect{#1}{#2}{#3}{#4}{#5}%
}
%    \end{macrocode}
%
% We output the name label as a second \cs{newlabel} command 
% in the \texttt{.aux} file.  That way, packages such as |varioref|
% which also read the \texttt{.aux} information can still work.
% So we redefine \cs{label} to first call the standard \LaTeX\
% \cs{label} and then write our named label as |nr<label>|.
% 
%    \begin{macrocode}
\let\@savelatexlabel=\label  % so save original LaTeX command
%
\def\label#1{% de
  \@savelatexlabel{#1}%
  \@bsphack
  \if@filesw
    \protected@write\@auxout{}%
      {\string\newlabel{nr@#1}{{\@currentlabel}{\@currentlabelname}}}%
  \fi
  \@esphack
}
%    \end{macrocode}
%
% Of course, in the case of a sufficiently mad author, there will be
% no sectioning commands, so we need to
%    \begin{macrocode}
\let\@currentlabelname\@empty
%    \end{macrocode}
%
% Getting named references is then just like getting page references in
% the \LaTeX\ kernel (see |ltxref.dtx|).
%
%    \begin{macrocode}
\DeclareRobustCommand{\nameref}[1]{\expandafter\@setref
  \csname r@nr@#1\endcsname\@secondoftwo{#1}}
%    \end{macrocode}
%
% \subsection{Float captions}
%
% By analogy with what we've just done to section titles and the like,
% we now do our best to discourage hyphenation within captions.  We also
% typeset them in \cs{small} (actually \cs{tubcaptionfonts}).
%
% First, let's define a dimension by which we will indent full-page
% captions.  We'll also use this to indent abstracts in proceedings style.
% \begin{macro}{\@tubfullpageindent}
%    \begin{macrocode}
\newdimen\@tubfullpageindent
\@tubfullpageindent = \if@tubtwocolumn 4.875pc \else 3.875pc \fi
\let\tubcaptionleftglue=\hfil
%    \end{macrocode}
% \end{macro}
%
% One-line captions are normally centered, but sometimes we want to set
% them flush-left for consistency with other nearby figures.
% \begin{macro}{\tubcaptionleftglue}
%    \begin{macrocode}
\let\tubcaptionleftglue=\hfil
%    \end{macrocode}
% \end{macro}
%
% Ok, here is \cs{@makecaption}.
%    \begin{macrocode}
\def\tubcaptionfonts{\small}%
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{\tubcaptionfonts \frenchspacing \tubmakecaptionbox{#1}{#2}}% try in an hbox
  \ifdim \wd\@tempboxa > \hsize
    {% caption doesn't fit on one line; set as a paragraph.
     \tubcaptionfonts \raggedright \hyphenpenalty=\@M \parindent=1em
     % indent full-width captions {figure*}, but not single-column {figure}.
     \ifdim\hsize = \textwidth
       \leftskip=\@tubfullpageindent \rightskip=\leftskip
       \advance\rightskip by 0pt plus2em  % increase acceptable raggedness
     \fi
     \noindent \tubmakecaptionbox{#1}{#2}\par}%
  \else
    % fits on one line; use the hbox, centered.  Do not reset its glue.
    \global\@minipagefalse
    \hb@xt@\hsize{\tubcaptionleftglue\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}
% 
\def\tubmakecaptionbox#1#2{#1:\ #2}% allow overriding for a paper
%    \end{macrocode}
%
% Also use \cs{tubcaptionfonts} for the caption
% labels, and put the label itself (e.g., ``Figure 1'') in bold.
%
%    \begin{macrocode}
\def\fnum@figure{{\tubcaptionfonts \bf \figurename\nobreakspace\thefigure}}
\def\fnum@table{{\tubcaptionfonts \bf \tablename\nobreakspace\thetable}}
%    \end{macrocode}
%
% Let's reduce the default space above captions a bit, and give it some
% flexibility.  The default is |10pt|, which seems too much.
%    \begin{macrocode}
\setlength\abovecaptionskip{6pt plus1pt minus1pt}
%    \end{macrocode}
%
% \subsection{Size changing commands}
%
% Apart from their `normal' effects, these commands change the glue
% around displays.
%    \begin{macrocode}
\renewcommand{\normalsize}{%
   \@setfontsize\normalsize\@xpt\@xiipt
   \abovedisplayskip=3\p@\@plus 3\p@\@minus\p@
   \belowdisplayskip=\abovedisplayskip
   \abovedisplayshortskip=\z@\@plus 3\p@
   \belowdisplayshortskip=\p@\@plus 3\p@\@minus\p@
}

\renewcommand{\small}{%
   \@setfontsize\small\@ixpt{11}%
   \abovedisplayskip=2.5\p@\@plus 2.5\p@\@minus\p@
   \belowdisplayskip=\abovedisplayskip
   \abovedisplayshortskip=\z@\@plus 2\p@
   \belowdisplayshortskip=\p@\@plus 2\p@\@minus\p@
}

\renewcommand{\footnotesize}{%
    \@setfontsize\footnotesize\@viiipt{9.5}%
    \abovedisplayskip=3\p@\@plus 3\p@\@minus\p@
    \belowdisplayskip=\abovedisplayskip
    \abovedisplayshortskip=\z@\@plus 3\p@
    \belowdisplayshortskip=\p@\@plus 3\p@\@minus\p@
}
%    \end{macrocode}
%
% \subsection{Lists and other text inclusions}
%
%    \begin{macrocode}
\def\@listi{%
  \leftmargin\leftmargini\parsep=\p@\@plus\p@\@minus\p@
  \itemsep=\parsep
  \listparindent=1em
  }

\def\@listii{%
  \leftmargin\leftmarginii
  \labelwidth=\leftmarginii \advance\labelwidth-\labelsep
  \topsep=2\p@\@plus\p@\@minus\p@
  \parsep=\p@\@plus\p@\@minus\p@
  \itemsep=\parsep
  \listparindent=1em
  }

\def\@listiii{%
  \leftmargin=\leftmarginiii
  \labelwidth=\leftmarginiii \advance\labelwidth-\labelsep
  \topsep=\p@\@plus\p@\@minus\p@
  \parsep=\z@
  \itemsep=\topsep
  \listparindent=1em
  }
\def\quote{\list{}{\rightmargin.5\leftmargin}\item[]}
%    \end{macrocode}
%
% From Dominik Wujastyk's font article.  First paragraph of a quotation
% will not be indented, and right margin is decreased for narrow columns.
%    \begin{macrocode}
\renewcommand{\quotation}{\list{}{\listparindent 1.5em
     \rightmargin.5\leftmargin\parsep \z@\@plus\p@}\item[]}
%    \end{macrocode}
%
% The |compactitemize|, |compactenumerate|, and |compactdescription|
% environments, without space between the items.
%
%    \begin{macrocode}
\newenvironment{compactitemize}%
   {\begin{itemize}%
     \setlength{\itemsep}{0pt}%
     \setlength{\parskip}{0pt}%
     \setlength{\parsep} {0pt}%
   }%
   {\end{itemize}}
%
\newenvironment{compactenumerate}%
   {\begin{enumerate}%
     \setlength{\itemsep}{0pt}%
     \setlength{\parskip}{0pt}%
     \setlength{\parsep} {0pt}%
   }%
   {\end{enumerate}}
%
\newenvironment{compactdescription}%
   {\begin{description}%
     \setlength{\itemsep}{0pt}%
     \setlength{\parskip}{0pt}%
     \setlength{\parsep} {0pt}%
   }%
   {\end{description}}
%
%    \end{macrocode}
%
% \subsection{Some fun with \texttt{verbatim}}
%
% The |plain| \TUB{} style allows \verb|[optional]| arguments to its
% \cs{verbatim} command.  This will allow the author (or editor) to
% specify a range of exciting features; we would definitely like the
% numbered verbatim style for code (that facility is reserved for a
% future version of this package), and the present little bit of code
% imposes the \cs{ruled} option on the built-in \textsf{verbatim}
% environment.  (Note that we don't yet deal with
% \textsf{verbatim}$*$, which is in itself an option to the |plain|
% original.)
%
% We start by saving various bits and bobs whose operation we're going
% to subvert.
%
%    \begin{macrocode}
%\let\@TB@verbatim\@verbatim
\let\@TBverbatim\verbatim
\let\@TBendverbatim\endverbatim
%    \end{macrocode}
%
% Impose an optional argument on the environment.
%
% We start the macro with \cs{par} to avoid a common error: if the
% optional argument is \cs{small}, and the document has no blank line
% before the verbatim block, we don't want that preceding paragraph to
% be set with \cs{small}'s line spacing.
%
% (\cs{obeylines} added to prevent the \cs{futurelet} from propagating
% into the body of the verbatim, thus causing lines that start with
% odd characters (like |#| or even |\|) to behave peculiarly.)
%    \begin{macrocode}
\def\verbatim{\par\obeylines
  \futurelet\reserved@a\@switch@sqbverbatim}
%
\def\@switch@sqbverbatim{\ifx\reserved@a[%]
  \expandafter\@sqbverbatim\else
  \def\reserved@b{\@sqbverbatim[]}\expandafter\reserved@b\fi}
%
\def\@sqbverbatim[#1]{%
%    \end{macrocode}
%
% The optional argument consists entirely of functions that modify the
% appearance of the environment.  Following the |plain| style, we
% define the functions we can execute in the optional argument here.
%
% The command \cs{ruled} tells us that there should be rules above and
% below the verbatim block.
%
%    \begin{macrocode}
  \def\ruled{\let\if@ruled\iftrue}%
%    \end{macrocode}
%
% The command \cs{makevmeta} says to make !<...> do \meta{...}.
%
%    \begin{macrocode}
  \def\makevmeta{\makeescape\! \let\<\tubverb@meta \tubverb@clearliglist}
  \def\tubverb@meta##1>{\meta{##1}}
%    \end{macrocode}
%
% The default verbatim defines `'<>,- as active characters to do
% stop ligatures; remove <> from the list so we get normal characters.
% Just hope that the CM <> ligatures aren't used.
%    \begin{macrocode}
  \def\tubverb@clearliglist{%
    \def\verbatim@nolig@list{\do\`\do\,\do\'\do\-}%
  }
%    \end{macrocode}
%
% Then we execute the arguments we've got, and relay to a (hacked)
% copy of the \LaTeX\ verbatim environment.
%
%    \begin{macrocode}
  #1\@TBverbatim}
%    \end{macrocode}
%
% The built-in environment itself relays to \cs{@verbatim}, which
% we've subverted to impose our views on appearance.
%
%    \begin{macrocode}
\def\@verbatim{%
%    \end{macrocode}
%
% First, we deal with \cs{ruled}:
%
%    \begin{macrocode}
    \if@ruled\trivlist\item\hrule\kern5\p@\nobreak\fi
%    \end{macrocode}
%
% Now, the code out of the original \textsf{verbatim} environment:
%
%    \begin{macrocode}
  \trivlist \item\relax
  \if@minipage\else\vskip\parskip\fi
  \leftskip\@totalleftmargin\rightskip\z@skip
  \parindent\z@\parfillskip\@flushglue\parskip\z@skip
  \@@par
  \@tempswafalse
  \def\par{%
    \if@tempswa
      \leavevmode \null \@@par\penalty\interlinepenalty
    \else
      \@tempswatrue
      \ifhmode\@@par\penalty\interlinepenalty\fi
    \fi}%
  \obeylines \verbatim@font \@noligs
  \let\do\@makeother \dospecials
  \everypar \expandafter{\the\everypar \unpenalty}%
}% end |\@sqbverbatim|
%    \end{macrocode}
%
% To end the environment, we do everything in reverse order: relay via
% the copy we made of \cs{endverbatim}, and then finish off the option
% changes (again \cs{ruled} only, so far).
%
%    \begin{macrocode}
\def\endverbatim{\@TBendverbatim
  \if@ruled\kern5\p@\hrule\endtrivlist\fi}
%    \end{macrocode}
%
% Define the \cs{if} used by the \cs{ruled} option:
%
%    \begin{macrocode}
\let\if@ruled\iffalse
%    \end{macrocode}
%
% Finally, if |microtype| is loaded, we want it to be deactivated in
% verbatim blocks.  It often manipulates a leading |\| rather too much,
% and messes with the visible fixed-width alignment.
%    \begin{macrocode}
\AtBeginDocument{%
   \@ifpackageloaded{microtype}
     {\g@addto@macro\@verbatim{\microtypesetup{activate=false}}}{}
}
%    \end{macrocode}
%
% \subsection{Bibliography}
% \label{sec:citations}
% This is more or less copied verbatim from Glenn Paulley's
% \emph{chicago.sty} (\texttt{gnpaulle@\penalty0 bluebox.\penalty0
% uwaterloo.\penalty0 ca}).
% It produces an author-year citation style bibliography, using
% output from the \BibTeX\ style file based on that by
% Patrick Daly. It needs extra macros beyond those in standard
% \LaTeX\ to function properly.
% The form of the bibitem entries is:
% \begin{verbatim}
%   \bibitem[\protect\citeauthoryear{Jones, Baker, and Smith}
%        {Jones et al.}{1990}{key}...
% \end{verbatim}
% The available citation commands are:
%
% \begin{tabular}{ll}
%    \verb|\cite{key}| & $\rightarrow$     (Jones, Baker, and Smith 1990)\\
%    \verb|\citeA{key}| & $\rightarrow$    (Jones, Baker, and Smith)\\
%    \verb|\citeNP{key}| & $\rightarrow$   Jones, Baker, and Smith 1990\\
%    \verb|\citeANP{key}| & $\rightarrow$  Jones, Baker, and Smith\\
%    \verb|\citeN{key}| & $\rightarrow$    Jones, Baker, and Smith (1990)\\
%    \verb|\shortcite| & $\rightarrow$    (Jones et al.~1990)\\
%    \verb|\citeyear| & $\rightarrow$      (1990)\\
%    \verb|\citeyearNP| & $\rightarrow$    1990\\
% \end{tabular}
%
% First of all (after checking that we're to use Harvard citation at
% all), make a copy of \LaTeX's default citation mechanism.
%
%    \begin{macrocode}
\if@Harvardcite
\let\@internalcite\cite
%    \end{macrocode}
% Normal forms.
%    \begin{macrocode}
\def\cite{\def\@citeseppen{-1000}%
    \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
    \def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
\def\citeNP{\def\@citeseppen{-1000}%
    \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
    \def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
\def\citeN{\def\@citeseppen{-1000}%
    \def\@cite##1##2{##1\if@tempswa , ##2)\else{)}\fi}%
    \def\citeauthoryear##1##2##3{##1 (##3}\@citedata}
\def\citeA{\def\@citeseppen{-1000}%
    \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
    \def\citeauthoryear##1##2##3{##1}\@internalcite}
\def\citeANP{\def\@citeseppen{-1000}%
    \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
    \def\citeauthoryear##1##2##3{##1}\@internalcite}
%    \end{macrocode}
% Abbreviated forms (using \emph{et al.})
%    \begin{macrocode}
\def\shortcite{\def\@citeseppen{-1000}%
    \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
    \def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
\def\shortciteNP{\def\@citeseppen{-1000}%
    \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
    \def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
\def\shortciteN{\def\@citeseppen{-1000}%
    \def\@cite##1##2{##1\if@tempswa , ##2)\else{)}\fi}%
    \def\citeauthoryear##1##2##3{##2 (##3}\@citedata}
\def\shortciteA{\def\@citeseppen{-1000}%
    \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
    \def\citeauthoryear##1##2##3{##2}\@internalcite}
\def\shortciteANP{\def\@citeseppen{-1000}%
    \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
    \def\citeauthoryear##1##2##3{##2}\@internalcite}
%    \end{macrocode}
% When just the  year is needed:
%    \begin{macrocode}
\def\citeyear{\def\@citeseppen{-1000}%
    \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
    \def\citeauthoryear##1##2##3{##3}\@citedata}
\def\citeyearNP{\def\@citeseppen{-1000}%
    \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
    \def\citeauthoryear##1##2##3{##3}\@citedata}
%    \end{macrocode}
% Place commas in-between citations in the same |\citeyear|, |\citeyearNP|,
% |\citeN|, or |\shortciteN| command.
% Use something like |\citeN{ref1,ref2,ref3}| and |\citeN{ref4}| for a list.
%
%    \begin{macrocode}
\def\@citedata{%
        \@ifnextchar [{\@tempswatrue\@citedatax}%
                                  {\@tempswafalse\@citedatax[]}%
}

\def\@citedatax[#1]#2{%
\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
  \def\@citea{}\@cite{\@for\@citeb:=#2\do%
    {\@citea\def\@citea{, }\@ifundefined% by Young
       {b@\@citeb}{{\bf ?}%
       \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
{\csname b@\@citeb\endcsname}}}{#1}}%
%    \end{macrocode}
% Don't box citations, separate with ; and a space;
% Make the penalty between citations negative: a good place to break.
%    \begin{macrocode}
\def\@citex[#1]#2{%
\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
  \def\@citea{}\@cite{\@for\@citeb:=#2\do%
    {\@citea\def\@citea{; }\@ifundefined% by Young
       {b@\@citeb}{{\bf ?}%
       \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
{\csname b@\@citeb\endcsname}}}{#1}}%
%    \end{macrocode}
% No labels in the bibliography.
%    \begin{macrocode}
\def\@biblabel#1{}
%    \end{macrocode}
% Set length of hanging indentation for bibliography entries.
%    \begin{macrocode}
\newlength{\bibhang}
\setlength{\bibhang}{2em}
%    \end{macrocode}
% Indent second and subsequent lines of bibliographic entries. Stolen
% from openbib.sty: |\newblock| is set to |{}|.
%    \begin{macrocode}
\newdimen\bibindent
\bibindent=1.5em
\@ifundefined{refname}%
   {\newcommand{\refname}{References}}%
   {}%
%    \end{macrocode}
%
% For safety's sake, suppress the \cs{TB@startsection} warnings
% here\dots
%
%    \begin{macrocode}
\def\thebibliography#1{% for harvardcite
  \let\TB@startsection\TB@safe@startsection
  \section*{\refname
    \@mkboth{\uppercase{\refname}}{\uppercase{\refname}}}%
  \list{[\arabic{enumi}]}{%
    \labelwidth\z@ \labelsep\z@
    \leftmargin\bibindent
    \itemindent -\bibindent
    \listparindent \itemindent
    \parsep \z@
    \usecounter{enumi}}%
  \def\newblock{}%
  \BibJustification
  \frenchspacing % more than just period, see comments below
}
%    \end{macrocode}
%
% \begin{macro}{etal}
% \begin{macro}{\bibentry}
% Other bibliography odds and ends.
%    \begin{macrocode}
\def\etal{et\,al.\@}
\def\bibentry{%
  \smallskip
  \hangindent=\parindent
  \hangafter=1
  \noindent
  \sloppy
  \clubpenalty500 \widowpenalty500
  \frenchspacing
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\bibliography}
% \begin{macro}{\bibliographystyle}
% Changes made to accommodate TUB file naming conventions
%    \begin{macrocode}
\def\bibliography#1{%
  \if@filesw
    \immediate\write\@auxout{\string\bibdata{\@tubfilename{#1}}}%
  \fi
  \@input{\jobname.bbl}%
}
\def\bibliographystyle#1{%
  \if@filesw
    \immediate\write\@auxout{\string\bibstyle{\@tubfilename{#1}}}%
  \fi
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\thebibliography}
% \begin{macro}{\TB@@thebibliography}
% If the user's asked to use \LaTeX's default citation mechanism
% (using the |rawcite| option), we still need to 
% patch \cs{sloppy} to support justification of the body of the
% bibliography.  We kludge in a call to \cs{frenchspacing} too,
% since there is no reason to change only period's \cs{sfcode}, as
% \LaTeX's original |thebibliography| (in |classes.dtx|) does.
% 
% By the way, |amsgen.sty| changes \cs{frenchspacing} to set the
% \cs{sfcode} of punctuation character to successively decreasing
% integers ending at 1001 for comma.  Thus its 1006 for period is
% overwritten to 1000 for |thebibliography|, making |amsgen|'s
% \cs{@addpunct} ineffective.  Don't know what that means in practice,
% if anything.
% 
% Back here, we also play with \TB@startsection since we always have,
% though that is no longer needed.
%    \begin{macrocode}
\else % not harvardcite
\let\TB@origthebibliography\thebibliography
\def\thebibliography{%
  \let\TB@startsection\TB@safe@startsection
  \def\sloppy{\frenchspacing\BibJustification}%
  \TB@origthebibliography} % latex's thebibliography now reads args.
\fi  % not harvardcite
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\BibJustification}
% \begin{macro}{\SetBibJustification}
% \begin{macro}{\TB@@sloppy}
% \cs{BibJustification} defines how the bibliography is to be
% justified.  The Lamport default is simply ``\cs{sloppy}'', but we
% regularly find some sort of ragged right setting is appropriate.
% (\cs{BibJustification} is nevertheless reset to its default value at
% the start of a paper.)
%    \begin{macrocode}
\let\TB@@sloppy\sloppy
\let\BibJustification\TB@@sloppy
\newcommand{\SetBibJustification}[1]{%
  \renewcommand{\BibJustification}{#1}%
}
\ResetCommands\expandafter{\the\ResetCommands
  \let\BibJustification\TB@@sloppy
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Registration marks}
%
% We no longer use these since Cadmus does not want them.
%    \begin{macrocode}
\def\HorzR@gisterRule{\vrule \@height 0.2\p@ \@depth\z@ \@width 0.5in }
\def\DownShortR@gisterRule{\vrule \@height 0.2\p@ \@depth 1pc \@width 0.2\p@ }
\def\UpShortR@gisterRule{\vrule \@height 1pc \@depth\z@ \@width 0.2\p@ }
%    \end{macrocode}
%
% ``T'' marks centered on top and bottom edges of paper
%
%    \begin{macrocode}
\def\ttopregister{\dlap{%
        \hb@xt@\trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
                        \HorzR@gisterRule \hfil \HorzR@gisterRule}%
        \hb@xt@\trimwd{\hfil \DownShortR@gisterRule \hfil}}}
\def\tbotregister{\ulap{%
        \hb@xt@\trimwd{\hfil \UpShortR@gisterRule \hfil}%
        \hb@xt@\trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
                        \HorzR@gisterRule \hfil \HorzR@gisterRule}}}
\def\topregister{\ttopregister}
\def\botregister{\tbotregister}
%    \end{macrocode}
%
% \subsection{Running heads}
%
%    \begin{macrocode}
\def\rtitlex{\def\texttub##1{{\normalsize\textrm{##1}}}\TUB, \volx}
%    \end{macrocode}
% registration marks; these are temporarily inserted in the running head
%    \begin{macrocode}
\def\MakeRegistrationMarks{}
\def\UseTrimMarks{%
  \def\MakeRegistrationMarks{%
    \ulap{\rlap{%
       \vbox{\dlap{\vbox to\trimlgt{\vfil\botregister}}%
             \topregister\vskip \headmargin \vskip 10\p@}}}}%
  }
% put issue identification and page number in header.
\def\@oddhead{\MakeRegistrationMarks
  \frenchspacing
  \normalsize\csname normalshape\endcsname\rm \tubheadhook
  \rtitlex\qquad \midrtitle\hfil \rtitlenexttopage\quad \thepage}
\def\@evenhead{\MakeRegistrationMarks
  \frenchspacing
  \normalsize\csname normalshape\endcsname\rm \tubheadhook
  \thepage \quad\rtitlenexttopage \hfil\midrtitle \qquad\rtitlex}

% can be used to reset the font, e.g., tb98kuester.
\def\tubheadhook{}

% in case the official \author is too verbose for the footline.
% (the \shortauthor / \rhAuthor stuff is only enabled for proceedings, fix!)
\def\tubrunningauthor{\@author}

% put title and author in footer.
\def\@tubrunningfull{%
  \def\@oddfoot{% make line break commands produce a normal space
    \def\\{\unskip\ \ignorespaces}%
    \let\newline=\\%
    \frenchspacing
    \hfil\rhTitle}
  \def\@evenfoot{\frenchspacing \let\thanks\@gobble \tubrunningauthor\hfil}
}

% empty footer.
\def\@tubrunningminimal{%
  \def\@oddfoot{\hfil}%
  \def\@evenfoot{\hfil}%
}

% empty footer and header.
\def\@tubrunningoff{%
  \def\@oddfoot{\hfil}%
  \def\@evenfoot{\hfil}%
  \def\@oddhead{\hfil}%
  \def\@evenhead{\hfil}%
}

\def\ps@headings{}
\pagestyle{headings}
%    \end{macrocode}
%
% \subsection{Output routine}
% Modified to alter |\brokenpenalty| across columns
%
% \begin{description}
% \item[\emph{Comment}] We're playing with fire here: for example,
%   \cs{@outputdblcol} has changed in \LaTeXe{} for 1995/06/01 (with the
%   use of \cs{hb@xt@}).  \emph{This} time there's no semantic change,
%   but\dots
% \end{description}
%    \begin{macrocode}
\def\@outputdblcol{\if@firstcolumn \global\@firstcolumnfalse
    \global\setbox\@leftcolumn\box\@outputbox
    \global\brokenpenalty10000
  \else \global\@firstcolumntrue
    \global\brokenpenalty100
    \setbox\@outputbox\vbox{\hb@xt@\textwidth{\hb@xt@\columnwidth
      {\box\@leftcolumn \hss}\hfil \vrule \@width\columnseprule\hfil
       \hb@xt@\columnwidth{\box\@outputbox \hss}}}\@combinedblfloats
       \@outputpage \begingroup \@dblfloatplacement \@startdblcolumn
       \@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}\endgroup
    \fi}
%    \end{macrocode}
%
% \subsection{Font-related definitions and machinery}
% These are mostly for compatibility with plain |tugboat.sty|
%    \begin{macrocode}
\newif\ifFirstPar       \FirstParfalse
\def\smc{\sc}
\def\ninepoint{\small}
%</classtail>
%    \end{macrocode}
%
% \cs{SMC} \emph{isn't} small caps---Barbara Beeton says she thinks
% of it as ``big small caps''.  She says (modulo capitalisation of
% things\dots):
% \begin{quote}
%   For the things it's used for, regular small caps are not
%   appropriate---they're too small.  Real small caps are
%   appropriate for author names (and are so used in continental
%   bibliographies), section headings, running heads, and, on
%   occasion, words to which some emphasis is to be given.  \cs{SMC}
%   was designed to be used for acronyms and all-caps abbreviations,
%   which look terrible in small caps, but nearly as bad in all caps
%   in the regular text size.  The principle of using ``one size
%   smaller'' than the text size is similar to the design of caps in
%   German---where they are smaller relative to lowercase than are
%   caps in fonts intended for English, to improve the appearance of
%   regular text in which caps are used at the heads of all nouns, not
%   just at the beginnings of sentences.
% \end{quote}
%
% We define this in terms of the memory of the size currently selected
% that's maintained in \cs{@currsize}: if the user does something
% silly re.~selecting fonts, we'll get the wrong results.  The
% following code is adapted from an old version of |relsize.sty| by
% Donald Arseneau and Matt Swift.  (The order of examination of
% \cs{@currsize} is to get the commonest cases out of the way first.)
%    \begin{macrocode}
%<*common>
\DeclareRobustCommand{\SMC}{%
  \ifx\@currsize\normalsize\small\else
   \ifx\@currsize\small\footnotesize\else
    \ifx\@currsize\footnotesize\scriptsize\else
     \ifx\@currsize\large\normalsize\else
      \ifx\@currsize\Large\large\else
       \ifx\@currsize\LARGE\Large\else
        \ifx\@currsize\scriptsize\tiny\else
         \ifx\@currsize\tiny\tiny\else
          \ifx\@currsize\huge\LARGE\else
           \ifx\@currsize\Huge\huge\else
            \small\SMC@unknown@warning
 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
}
\newcommand{\SMC@unknown@warning}{\TBWarning{\string\SMC: nonstandard
    text font size command -- using \string\small}}
\newcommand{\textSMC}[1]{{\SMC #1}}
%    \end{macrocode}
%
% The \cs{acro} command uses \cs{SMC} as it was originally intended.
% Since these things are uppercase-only, it fiddles with the
% spacefactor after inserting its text.
%
%    \begin{macrocode}
\newcommand{\acro}[1]{\textSMC{#1}\@}
%</common>
%    \end{macrocode}
%
% \subsection{Miscellaneous definitions}
%
% \cs{EdNote} allows the editor to enter notes in the text of a paper.
% If the command is given something that appears like an optional
% argument, the entire text of the note is placed in square brackets.
% (Yes, it really is!)
%
%    \begin{macrocode}
%<*classtail>
\def\xEdNote{{\EdNoteFont Editor's note:\enspace }}
\def\EdNote{\@ifnextchar[%]
  {%
    \ifvmode
      \smallskip\noindent\let\@EdNote@\@EdNote@v
    \else
      \unskip\quad\def\@EdNote@{\unskip\quad}%
    \fi
    \@EdNote
  }%
  \xEdNote
}
\long\def\@EdNote[#1]{%
  [\thinspace\xEdNote\ignorespaces
   #1%
   \unskip\thinspace]%
  \@EdNote@
}
\def\@EdNote@v{\par\smallskip}
%    \end{macrocode}
%  Macros for Mittelbach's self-documenting style
%    \begin{macrocode}
\def\SelfDocumenting{%
  \setlength\textwidth{31pc}
  \onecolumn
  \parindent \z@
  \parskip 2\p@\@plus\p@\@minus\p@
  \oddsidemargin 8pc
  \evensidemargin 8pc
  \marginparwidth 8pc
  \toks@\expandafter{\@oddhead}%
  \xdef\@oddhead{\hss\hb@xt@\pagewd{\the\toks@}}%
  \toks@\expandafter{\@evenhead}%
  \xdef\@evenhead{\hss\hb@xt@\pagewd{\the\toks@}}%
  \def\ps@titlepage{}%
}
\def\ps@titlepage{}

\long\def\@makefntext#1{\parindent 1em\noindent\hb@xt@2em{}%
  \llap{\@makefnmark}\null$\mskip5mu$#1}

%% \long\def\@makefntext#1{\parindent 1em
%%   \noindent
%%   \hb@xt@2em{\hss\@makefnmark}%
%%   \hskip0.27778\fontdimen6\textfont\z@\relax
%%   #1%
%% }
%    \end{macrocode}
%
% \begin{macro}{\tubraggedfoot}
% To get a ragged-right footnote.
%    \begin{macrocode}
\newcommand{\tubraggedfoot}{\rightskip=\raggedskip plus\raggedstretch\relax}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\creditfootnote}
% \begin{macro}{\supportfootnote}
% Sometimes we want the label ``Editor's Note:'', sometimes not.
%
%    \begin{macrocode}
\def\creditfootnote{\nomarkfootnote\xEdNote}
\def\supportfootnote{\nomarkfootnote\relax}
%    \end{macrocode}
%
% General macro \cs{nomarkfootnote} to make a footnote without a
% reference mark, etc.  |#1| is an extra command to insert, |#2| the
% user's text.
%    \begin{macrocode}
\gdef\nomarkfootnote#1#2{\begingroup
  \def\thefootnote{}%
  % no period, please, also no fnmark.
  \def\@makefntext##1{##1}%
  \footnotetext{\noindent #1#2}%
  \endgroup
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
% \subsection{Initialization}
%
% If we're going to use Harvard-style bibliographies, we set up the
% bibliography style: the user doesn't get any choice.
%
%    \begin{macrocode}
\if@Harvardcite
  \AtBeginDocument{%
    \bibliographystyle{ltugbib}%
  }
\fi
\authornumber\z@
\let\@signature\@defaultsignature
\InputIfFileExists{ltugboat.cfg}{\TBInfo{Loading ltugboat
                                           configuration information}}{}
%</classtail>
%    \end{macrocode}
%
% \section{\protect\LaTeXe\ Proceedings class}
%
% \begin{macro}{\@tugclass}
% Make the code of |ltugboat.cls| (when we load it) say it's really
% us:
%
%    \begin{macrocode}
%<*ltugproccls>
\def\@tugclass{ltugproc}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@proc@sober}
% \begin{macro}{\if@proc@numerable}
% ^^A\acro
% {TUG}'96 proceedings switched to more sober headings still; so
% the \textsf{tug95} option establishes the original state.  In the
% absence of any other guidance, we use the '96 for
% ^^A\acro
% {TUG}'97 proceedings, but also allow numbering of sections.
%
%    \begin{macrocode}
\newif\if@proc@sober
\newif\if@proc@numerable
\DeclareOption{tug95}{%
  \@proc@soberfalse
  \@proc@numerablefalse
}
\DeclareOption{tug96}{%
  \@proc@sobertrue
  \@proc@numerablefalse
}
\DeclareOption{tug97}{%
  \@proc@sobertrue
  \@proc@numerabletrue
}
\DeclareOption{tug2002}{%
  \@proc@sobertrue
  \@proc@numerabletrue
  \let\if@proc@numbersec\iftrue
  \PassOptionsToClass{numbersec}{ltugboat}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\if@proc@numbersec}
% If we're in a class that allows section numbering (the actual check
% occurs after \cs{ProcessOptions}, we can have the
% following:
%    \begin{macrocode}
\DeclareOption{numbersec}{\let\if@proc@numbersec\iftrue
  \PassOptionsToClass{numbersec}{ltugboat}%
}
\DeclareOption{nonumber}{\let\if@proc@numbersec\iffalse
  \PassOptionsToClass{nonumber}{ltugboat}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ifTB@title}
% If we have a paper for which we want to create a detached title,
% with an editor's note, and then set the paper separately, we use
% option notitle.
%    \begin{macrocode}
\newif\ifTB@title
\DeclareOption{title}{\TB@titletrue}
\DeclareOption{notitle}{\TB@titlefalse
  \AtBeginDocument{\stepcounter{page}}}
%    \end{macrocode}
% \end{macro}
%
% There are these people who seem to think |tugproc| is an option as
% well as a class\dots
%
%    \begin{macrocode}
\DeclareOption{tugproc}{%
  \ClassWarning{\@tugclass}{Option \CurrentOption\space ignored}%
}
%    \end{macrocode}
%
% All other options are simply passed to |ltugboat|\dots
%
%    \begin{macrocode}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ltugboat}}
%    \end{macrocode}
%
% If there's a \textsf{tugproc} defaults file, input it now: it may
% tell us which year we're to perform for\dots  (Note: this code
% \emph{is} millenium-proof.  It's not terribly classy for years
% beyond 2069, but then I'm not going to be around then---this will be
% an interesting task for a future \TeX{}ie\dots)
%
%    \begin{macrocode}
\InputIfFileExists{\@tugclass.cfg}{\ClassInfo{ltugproc}%
           {Loading ltugproc configuration information}}{}
\@ifundefined{TUGprocExtraOptions}%
   {\let\TUGprocExtraOptions\@empty}%
   {\edef\TUGprocExtraOptions{,\TUGprocExtraOptions}}
%    \end{macrocode}
%
% \begin{macro}{\tugProcYear}
% Now work out what year it is
%    \begin{macrocode}
\@tempcnta\year
\ifnum\@tempcnta<2000
  \divide\@tempcnta by100
  \multiply\@tempcnta by100
  \advance\@tempcnta-\year
  \@tempcnta-\@tempcnta
\fi
%    \end{macrocode}
%
% And use that for calculating a year for us to use.
%
%    \begin{macrocode}
\edef\@tempa{\noexpand\providecommand\noexpand\tugProcYear
                {\ifnum10>\@tempcnta0\fi\the\@tempcnta}}
\@tempa
\ClassInfo{ltugproc}{Class believes year is
  \expandafter\ifnum\tugProcYear<2000 19\fi\tugProcYear
    \@gobble}
%    \end{macrocode}
%
% Check that this is a ``sensible year'' (one for which we have a
% class option defined).  If not, make it a `suitable' year, in
% particular, one that allows numbering sections.
%    \begin{macrocode}
\expandafter\ifx\csname ds@tug\tugProcYear\endcsname\relax
  \def\tugProcYear{2002}\fi
%    \end{macrocode}
% \end{macro}
%
% Now execute the default `year' option and get on with processing.
% Note that this command gets ignored if the configuration file
% specifies a silly year.
%
%    \begin{macrocode}
\ExecuteOptions{tug\tugProcYear,title\TUGprocExtraOptions}
\ProcessOptions
\if@proc@numbersec
  \if@proc@numerable
  \else
    \ClassWarning{\@tugclass}{This year's proceedings may not have
      numbered sections}%
  \fi
\fi
%    \end{macrocode}
%
% Call \textsf{ltugboat}, adding whichever section numbering option is
% appropriate
%    \begin{macrocode}
\LoadClass[\if@proc@numbersec numbersec\else nonumber\fi]{ltugboat}
%    \end{macrocode}
%
% \subsection{Proceedings titles}
%
% \begin{macro}{\maketitle}
% \begin{macro}{\ifTB@madetitle}
% There's no provision for `section titles' in proceedings issues, as
% there are in \TUB{} proper.  Note the tedious \LaTeX{} bug-avoidance
% in the \cs{@TB@test@document} macro.
%
%    \begin{macrocode}
\def\maketitle{%
  \begingroup
%    \end{macrocode}
%
% first, a bit of flim-flam to generate an initial value for
% \cs{rhAuthor} (unless the user's already given one with a
% \cs{shortAuthor} comand).
%    \begin{macrocode}
    \ifshortAuthor\else
      \global\let\rhAuthor\@empty
      \def\g@addto@rhAuthor##1{%
        \begingroup
          \toks@\expandafter{\rhAuthor}%
          \let\thanks\@gobble
          \protected@xdef\rhAuthor{\the\toks@##1}%
        \endgroup
      }%
      \@getauthorlist\g@addto@rhAuthor
    \fi
%    \end{macrocode}
%
% now, the real business of setting the title
%    \begin{macrocode}
    \ifTB@title
      \setcounter{footnote}{0}%
      \renewcommand{\thefootnote}{\@fnsymbol\c@footnote}%
      \if@tubtwocolumn
        \twocolumn[\@maketitle]%
      \else
        \onecolumn
        \global\@topnum\z@
        \@maketitle
      \fi
      \@thanks
      \thispagestyle{TBproctitle}
    \fi
  \endgroup
  \TB@madetitletrue
}
\newif\ifTB@madetitle  \TB@madetitlefalse
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@TB@test@document}
% \cs{@TB@test@document} checks to see, at entry to \cs{maketitle}, if
% we've had \verb:\begin{document}:.  See \LaTeX{} bug report latex/2212,
% submitted by Robin Fairbairns, for details.
%    \begin{macrocode}
\def\@TB@test@document{%
  \edef\@tempa{\the\everypar}
  \def \@tempb{\@nodocument}
  \ifx \@tempa\@tempb
    \@nodocument
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AUTHORfont}
% \begin{macro}{\TITLEfont}
% \begin{macro}{\addressfont}
% \begin{macro}{\netaddrfont}
% Define the fonts for titles and things
%    \begin{macrocode}
\def\AUTHORfont {\large\rmfamily\mdseries\upshape}
\def\TITLEfont  {\Large\rmfamily\mdseries\upshape}
\def\addressfont{\small\rmfamily\mdseries\upshape}
\def\netaddrfont{\small\ttfamily\mdseries\upshape}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\aboveauthorskip}
% \begin{macro}{\belowauthorskip}
% \begin{macro}{\belowabstractskip}
% Some changeable skips to permit variability in page layout depending
% on the particular paper's page breaks.
%    \begin{macrocode}
\newskip\aboveauthorskip   \aboveauthorskip=18\p@ \@plus4\p@
\newskip\belowauthorskip   \belowauthorskip=\aboveauthorskip
\newskip\belowabstractskip \belowabstractskip=14\p@ \@plus3\p@ \@minus2\p@
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@maketitle}
% The body of \cs{maketitle}
%    \begin{macrocode}
\def\@maketitle{%
   {\parskip\z@
    \frenchspacing
    \TITLEfont\raggedright\noindent\@title\par
      \count@=0
      \loop
      \ifnum\count@<\authornumber
        \vskip\aboveauthorskip
        \advance\count@\@ne
        {\AUTHORfont\theauthor{\number\count@}\endgraf}%
        \addressfont\theaddress{\number\count@}\endgraf
        {%
          \allowhyphens
          \hangindent1.5pc
          \netaddrfont\thenetaddress{\number\count@}\endgraf
          \hangindent1.5pc
          \thePersonalURL{\number\count@}\endgraf
        }%
      \repeat
   \vskip\belowauthorskip}%
   \if@abstract
      \centerline{\bfseries Abstract}%
      \vskip.5\baselineskip\rmfamily
      \@tubonecolumnabstractstart
            \the\abstract@toks
      \@tubonecolumnabstractfinish
      \global\@ignoretrue
   \fi
   \vskip\belowabstractskip
   \global\@afterindentfalse\aftergroup\@afterheading
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{environment}{abstract}
% \begin{macro}{\if@abstract}
% \begin{macro}{\abstract@toks}
% Save the contents of the abstract environment in the token register
% \cs{abstract@toks}.  We need to do this, as otherwise it may get
% `typeset' (previously, it got put in a box) before
% |\begin{document}|, and experiments prove that this means our shiny
% new \cs{SMC} doesn't work in this situation.
%
% If you need to understand the ins and outs of this code, look at the
% place I lifted it from: |tabularx.dtx| (in the tools
% bundle).  The whole thing pivots on having stored the name of the
% `abstract' environment in \cs{@abstract@}
%
%    \begin{macrocode}
\newtoks\abstract@toks  \abstract@toks{}
\let\if@abstract\iffalse
\def\abstract{%
%    \end{macrocode}
%
% we now warn unsuspecting users who provide an \texttt{abstract}
% environment \emph{after} the \cs{maketitle} that would typeset it\dots
%    \begin{macrocode}
  \ifTB@madetitle
    \TBWarning{abstract environment after \string\maketitle}
  \fi
  \def\@abstract@{abstract}%
  \ifx\@currenvir\@abstract@
  \else
    \TBError{\string\abstract\space is illegal:%
      \MessageBreak
      use \string\begin{\@abstract@} instead}%
      {\@abstract@\space may only be used as an environment}
  \fi
  \global\let\if@abstract\iftrue
  {\ifnum0=`}\fi
  \@abstract@getbody}
\let\endabstract\relax
%    \end{macrocode}
%
% \cs{@abstract@getbody} gets chunks of the body (up to the next
% occurrence of \cs{end}) and appends them to \cs{abstract@toks}.  It
% then uses \cs{@abstract@findend} to detect whether this \cs{end} is
% followed by \verb|{abstract}|
%
%    \begin{macrocode}
\long\def\@abstract@getbody#1\end{%
  \global\abstract@toks\expandafter{\the\abstract@toks#1}%
  \@abstract@findend}
%    \end{macrocode}
%
% Here we've got to \cs{end} in the body of the abstract.
% \cs{@abstract@findend} takes the `argument' of the \cs{end} do its
% argument.
%
%    \begin{macrocode}
\def\@abstract@findend#1{%
  \def\@tempa{#1}%
%    \end{macrocode}
%
% If we've found an `end' to match the `begin' that we started with,
% we're done with gathering the abstract up; otherwise we stuff the
% end itself into the token register and carry on.
%
%    \begin{macrocode}
  \ifx\@tempa\@abstract@
    \expandafter\@abstract@end
  \else
%    \end{macrocode}
%
% It's not \cs{end}|{abstract}|---check that it's not
% \cs{end}|{document}| either (which signifies that the author's
% forgotten about ending the abstract)
%    \begin{macrocode}
    \def\@tempb{document}%
    \ifx\@tempa\@tempb
      \TBError{\string\begin{\@abstract@}
          ended by \string\end{\@tempb}}%
        {You've forgotten \string\end{\@abstract@}}
    \else
       \global\abstract@toks\expandafter{\the\abstract@toks\end{#1}}%
       \expandafter\expandafter\expandafter\@abstract@getbody
    \fi
  \fi}
%    \end{macrocode}
%
% In our case, the action at the `proper' \cs{end} is a lot simpler
% than what appears in |tabularx.dtx| \dots{} don't be surprised!
%
%    \begin{macrocode}
\def\@abstract@end{\ifnum0=`{\fi}%
  \expandafter\end\expandafter{\@abstract@}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{environment}
%
% \begin{macro}{\makesignature}
% \cs{makesignature} is improper in proceedings, so we replace it with a
% warning (and a no-op otherwise)
%    \begin{macrocode}
\renewcommand{\makesignature}{\TBWarning
         {\string\makesignature\space is invalid in proceedings issues}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ps@TBproctitle}
% \begin{macro}{\ps@TBproc}
% \begin{macro}{\dopagecommands}
% \begin{macro}{\setpagecommands}
% \begin{macro}{\TB@definefeet}
% \begin{macro}{\pfoottext}
% \begin{macro}{\rfoottext}
% Now we define the running heads in terms of the \cs{rh*} commands.
%    \begin{macrocode}
\def\ps@TBproctitle{\let\@oddhead\MakeRegistrationMarks
  \let\@evenhead\MakeRegistrationMarks
  \TB@definefeet
}
\def\ps@TBproc{%
  \def\@oddhead{\MakeRegistrationMarks
    {%
      \hfil
      \def\\{\unskip\ \ignorespaces}%
      \rmfamily\rhTitle
    }%
  }%
  \def\@evenhead{\MakeRegistrationMarks
    {%
      \def\\{\unskip\ \ignorespaces}%
      \rmfamily\rhAuthor
      \hfil
    }%
  }%
  \TB@definefeet
}

\advance\footskip8\p@    % for deeper running feet

\def\dopagecommands{\csname @@pagecommands\number\c@page\endcsname}
\def\setpagecommands#1#2{\expandafter\def\csname @@pagecommands#1\endcsname
  {#2}}
\def\TB@definefeet{%
  \def\@oddfoot{\ifpreprint\pfoottext\hfil\Now\hfil\thepage
    \else\rfoottext\hfil\thepage\fi\dopagecommands}%
  \def\@evenfoot{\ifpreprint\thepage\hfil\Now\hfil\pfoottext
    \else\thepage\hfil\rfoottext\fi\dopagecommands}%
}

\def\pfoottext{{\smc Preprint}:
   Proceedings of the \volyr{} Annual Meeting}
\def\rfoottext{\normalfont\TUB, \volx\Dash
   {Proceedings of the \volyr{} Annual Meeting}}

\pagestyle{TBproc}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Section divisions}
%
% Neither sections nor subsections are numbered by default in the
% proceedings style: note that this puts a degree of stress on authors'
% natural tendency to reference sections, which is a matter that needs
% attention.  The class option \textsc{numbersec} once again numbers the
% sections (and noticeably changes the layout).
%
%    \begin{macrocode}
\if@proc@numbersec
\else
  \setcounter{secnumdepth}{0}
\fi
%    \end{macrocode}
%
% Otherwise, the \cs{section} command is pretty straightforward.
% However, the \cs{subsection} and \cs{subsubsection} are run-in, and
% we have to remember to have negative stretch (and shrink if we
% should in future choose to have one) on the \meta{afterskip}
% parameter of \cs{@startsection}, since the whole skip is going to
% end up getting negated.  We use \cs{TB@startsection} to detect
% inappropriate forms.
%
%    \begin{macrocode}
\if@proc@numbersec
\else
  \if@proc@sober
    \def\section
           {\TB@nolimelabel
            \TB@startsection{{section}%
                             1%
                             \z@%
                             {-8\p@\@plus-2\p@\@minus-2\p@}%
                             {6\p@}%
                             {\normalsize\bfseries\raggedright}}}
  \else
    \def\section
           {\TB@nolimelabel
            \TB@startsection{{section}%
                             1%
                             \z@%
                             {-8\p@\@plus-2\p@\@minus-2\p@}%
                             {6\p@}%
                             {\large\bfseries\raggedright}}}
  \fi
  \def\subsection
           {\TB@nolimelabel
            \TB@startsection{{subsection}%
                             2%
                             \z@%
                             {6\p@\@plus 2\p@\@minus2\p@}%
                             {-5\p@\@plus -\fontdimen3\the\font}%
                             {\normalsize\bfseries}}}
  \def\subsubsection
           {\TB@nolimelabel
            \TB@startsection{{subsubsection}%
                             3%
                             \parindent%
                             \z@%
                             {-5\p@\@plus -\fontdimen3\the\font}%
                             {\normalsize\bfseries}}}
\fi
%</ltugproccls>
%    \end{macrocode}
%
% \section{Plain \TeX\ styles}
%    \begin{macrocode}
%<*tugboatsty>
% err...
%</tugboatsty>
%<*tugprocsty>
% err...
%</tugprocsty>
%    \end{macrocode}
% \section{The \LaTeXe\ compatibility-mode style files}
%    \begin{macrocode}
%<*ltugboatsty>
\@obsoletefile{ltugboat.cls}{ltugboat.sty}
\LoadClass{ltugboat}
%</ltugboatsty>
%<*ltugprocsty>
\@obsoletefile{ltugproc.cls}{ltugproc.sty}
\LoadClass{ltugproc}
%</ltugprocsty>
%    \end{macrocode}
%
% ^^A \addtolength{\premulticols}{5\baselineskip}
% \clearpage
%
% \Finale
%
\endinput
%
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}