summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/rmpage/rmpage.sty
blob: 559735f71b388de1687796d25f01bee2ff8c0d7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
%% rmpage.sty 29/8/96
%% rmpagenew.sty 27/8/95
%% LaTeX2e package file to define printing area parameters
%%
%% Copyright 1995, 1996, 1997 R.J.M. McDonnell
%% email:  rebecca@astrid.u-net.com
% 
%     This work is free software; you can redistribute it and/or modify
%     it under the terms of the GNU General Public License as published by
%     the Free Software Foundation; either version 2 of the License, or
%     any later version.
% 
%     This work is distributed in the hope that it will be useful,
%     but WITHOUT ANY WARRANTY; without even the implied warranty of
%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%     GNU General Public License for more details.
% 
%     You should have received a copy of the GNU General Public License
%     along with this work; if not, write to the Free Software
%     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%
%
% This version of rmpage was developed from Rowland's original rmpage 
% (er, this makes sense if you know what's happened), which was his 
% first ever LaTeX2e package.  The original rmpage dealt with the 
% standard LaTeX classes' insistance on assuming that you had headers, 
% made the inside margin the large one, aand let you select different 
% text heights and widths, just like his old rma4 series of style 
% files.
%
% A fragment of code --- not more than a dozen lines --- from 
% classes.dtx was used in the original rmpage.  I assume it's still here 
% somewhere, so part of this file is probably:
%
% Copyright 1994 the LaTeX3 project and the individual authors. 
% All rights reserved. For further copyright information see the file 
% legal.txt, and any other copyright indicated in this file.
%
% Quite what I'm suppose to do about this I don't know: if anyone 
% thinks my use of LaTeX3 project code needs to be dealt with more 
% formally, please let me know.
%%
%%
%%    \section{Some notes to me}
%%
%  And replace 
% occurrences of pt with \p@, 0pt with \z@; define \mm@ to be 1mm, 
% \in@ to be 1in---use them likewise; and use \m@ne to replace 
% occurrences of -1 or -?
%          1         2         3         4         5         6         7         8
% 12345678901234567890123456789012345678901234567890123456789012345678901234567890
% Package rmpage Warning: 
% ! Package rmpage Error: 
%
% Error text starts at column 25; there's another 56 characters to go 
% to the end of the line.  First argument to each needs to full stop; 
% second argument to Error does, and starts at column 1.
%
% ABBREVIATIONS THAT MIGHT BE USED IN DEFINITIONS:
%
% clear = clearance
% ptr = printer
% sep = separation
% col = column
% par = paragraph
% opt = option
% land = landscape
% port = portrait
% min = minimum
% l = left
% r = right
% t = top
% b = bottom
%
%%
%%
%%    \section{File identification}
%%
\NeedsTeXFormat{LaTeX2e}[1996/09/29]
\ProvidesPackage{rmpage}
              [1997/09/29 v0.92veryx sets printing size and
               position etc. to suit me]
% 1997/09/29 v0.92 Added an error message; removed a redundant error 
%    message; added \RM@classtype 19 to use when the classtype is 
%    unrecognized - new class type `Unknown', more-or-less.  This 
%    appears to work.  The standard class width-setting stuff now 
%    produces an error message if \@ptsize is outside the standard 
%    range.  I've added some bits to trap illegal values of 
%    \RM@ptsizegroup.  It's probably a good idea to add some code to 
%    trap illegal values of other things as well.
% 1996/11/26 v0.91 Added \RMheadheight stuff so you can define custom 
%    multi-line headers with fancyhdr and have rmpage calculate 
%    vertical page paramters sensibly.  Don't know what to do about 
%    footers yet---a bit of a problem...
%    Goes with rmplocal-v0.36.cfg 
% 1996/11/09 v0.90 Added some notes about new typesetting parameters 
%    for fontinst founts.
%    Goes with rmplocal-v0.36.cfg 
% 1996/11/01 v0.89.2 Moved \baselineskip report
%    Goes with rmplocal-v0.35.cfg 
% 1996/10/31 v0.89.1 Changed a comment.
%    Goes with rmplocal-v0.34.cfg 
% 1996/10/31 v0.89 Added \baselineskip and \RM@ifbeton to reports at 
%     end.  Doesn't complain if you load beton with 
%     standard-baselineskips and tell rmpage about it.  And added a 
%     check on the beton command rmpage uses.  Moved re-setting of 
%     \baselineskip to after reporting so \baselineskip is reported 
%     correctly.
%    Goes with rmplocal-v0.33.cfg 
% 1996/10/28 v0.88 Binned a rubbish hook (grammar?  who he?); added 
%    \RM@executehook command.  Added 
%    \RM@AfterInitialTextwidthSetting hook.  Stopped 
%    \RM@textwidthgroup=4 producing an error message.
%    Goes with rmplocal-v0.32.cfg 
% 1996/10/28 v0.87 Changed a message; fixed slides ptperchar setting.  
%    Changed width-setting code quite a lot to support foils class: 
%    introduced \RM@textwidthgroup and \RM@ptsizegroup.  Need more 
%    hooks.  All a bit iffy so far---needs tidying.
%    Goes with rmplocal-v0.31.cfg 
% 1996/10/27 v0.86.1 No changes; this version created purely to check 
%    up on saveall.
%    Goes with rmplocal-v0.30.cfg 
% 1996/10/27 v0.86 Included rmpwnorm.pko in rmpage; retired 
%    rmpwnorm.  Corrected slides legibility check.  Rationalized 
%    comments a little.  Put rmpwnorm defs at the top of rmpage and 
%    \let\@undefs at end.  Saved about 0.5s out of 16s execution 
%    time. 
%    Goes with rmplocal-v0.30.cfg 
% 1996/10/25 v0.85 Changed some comments and added \RM@typeclasstype 
%    command, used in changed \RM@OnClassType.  Changed width setting 
%    code; now call rmpwnorm for all classes.  rmpwslid.pko hsa been 
%    retired, and the slides-specific stuff included in rmpwnorm.pko.
%    Goes with rmpwnorm-v0.60.pko and rmplocal-v0.30.cfg 
% 1996/10/25 v0.84.2 Minor reporting change.
%    Goes with rmpwnorm-v0.59.pko, rmpwslid-v0.7.pko, and 
%    rmplocal-v0.29.cfg
% 1996/10/25 v0.84.1 Minor reporting change.
%    Goes with rmpwnorm-v0.59.pko, rmpwslid-v0.7.pko, and 
%    rmplocal-v0.29.cfg
% 1996/10/21 v0.84 Started using rmpwslid again; changed some 
%    comments; added \RM@percent command; changed reporting a bit
%    Goes with rmpwnorm-v0.58.pko, rmpwslid-v0.6.pko, and 
%    rmplocal-v0.28.cfg
% 1996/10/19 v0.83 added \RM@SetLengthAtLeast and \RM@DefLengthAtLeast 
%    to set parameters to at least the required values.  This is for 
%    the ringbinding option (in the config file).
%    Goes with rmpwnorm-v0.57.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.26.cfg
% 1996/10/17 v0.82 added sixth looseness option; similar to sloppy so 
%    you get a sensible looseness if you've asked for twocolumn 
%    typesetting and a psfount.
%    Goes with rmpwnorm-v0.57.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.25.cfg
% 1996/10/15 v0.81.2 changed some comments
%    Goes with rmpwnorm-v0.57.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.24.cfg
% 1996/10/02 v0.81.1 Corrected a name (argh).
%    Goes with rmpwnorm-v0.57.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.20.cfg
% 1996/10/01 v0.81 Fiddled about so that loadconcrete loads the beton 
%    package and executes the beton option.  More CheckCommands and 
%    changed the \RM@OnPrinterType command so it won't let you 
%    configure printer types<10.
%    Goes with rmpwnorm-v0.56.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.20.cfg
% 1996/09/30 v0.80.2 Added ref to beton version supported.
% 1996/09/30 v0.80.1 Changed refs to c6/7 to c7/6; removed wandering 
%    \RM@tval.
%    Goes with rmpwnorm-v0.56.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.19.1.cfg
% 1996/09/29 v0.80 Changed initial definition of 
%    \RM@[min|max]text[width|height] and 
%    \RM@min[top|bottom|inside|outside]margins to \providecommand so 
%    they can be set in a document.  Added code to ensure than 
%    \RM@maxtextheight is set to no more than the space allowed for 
%    \textheight---doesn't make much practical difference at the 
%    moment, but it is more elegant.  Fixed a few messsages; is there 
%    no end to them?  Bunged in an \ExecuteOptions statement just 
%    after the letterpaper option to select US letter paper by 
%    default; doing it like that means you can over-ride it anywhere, 
%    but I'm not likely to delete it by mistake. normalbase stuff 
%    replaces smallbase stuff
%    Goes with rmpwnorm-v0.55.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.19.cfg
% 1996/09/28 v0.79 Changed defaults of \RM@headers and \RM@stdmargins 
%    to true
% 1996/09/27 v0.78 Changed wideish option to widish; changed ref to 
%    luccasua to lucasual.
%    Goes with rmpwnorm-v0.54.1.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.17.cfg
% 1996/09/26 v0.77 Changed \RM@ClassExecuteOptions to 
%    \RM@OnClassExecuteOptions
% 1996/09/26 v0.76 Changed lucida-casual stuff to use new packages.
%    Goes with rmpwnorm-v0.54.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.15.cfg
% 1996/09/25 v0.75 Changed some error messages so they'll fit on an 80 
%    column terminal
%    Goes with rmpwnorm-v0.52.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.15.cfg
% 1996/09/24 v0.74  Put some printer/paper settings in the 
%    \RM@PrinterPaperSettings hook in the config file.  Changed the 
%    initial value of \RM@nicedate to false.  And checked 
%    \@settopoint, which is used in rmpwnorm.pko
%    Goes with rmpwnorm-v0.50.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.15.cfg
% 1996/09/23 v0.73 Changed \textheight setting code to deal with 
%    \RM@[min|max]textheight differently; the new code should ensure 
%    that the [min|max]textheight limits can't cause printing outside 
%    the available printing area.  Fully testing the code is hurting 
%    my head.  Corrected final setting of \RM@totalheadclearance and 
%    changed the comments there so they're right.  Changed some 
%    messages to give less poor line breaks.
%    Goes with rmpwnorm-v0.49.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.14.cfg
% 1996/09/22 v0.72 Corrected \RM@scalebyoption; two of the factors 
%    had got themselves transposed by the intervention of a 
%    gremlin.  Oops.  Shifted some options about into more sensible 
%    groups.  Added the letter4paper option to the paper size 
%    documentation.
%    Goes with rmpwnorm-v0.49.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.13.cfg
% 1996/09/18 v0.71.2 Changed `can't find config file' warning to 
%    match new names; removed rmpall.cfg from list of config files 
%    looked for by default.  Somewhat untested; be wary of these 
%    changes!
%    Goes with rmpwnorm-v0.48.1.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.12.1.cfg
% 1996/09/16 v0.71.1 Saved because SaveAll appears to be behaving 
%    very weirdly.
%    Goes with rmpwnorm-v0.48.1.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.12.cfg
% 1996/09/16 v0.71 Put the fulllength and stdlength options into the 
%    config file because they need to be executed after the 
%    touchlength options. Changed some comments.
%    Goes with rmpwnorm-v0.48.1.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.12.cfg
% 1996/09/15 v0.70 (boo) changed end of package reporting so you can 
%    cut and paste parameters straight into a LaTeX doc.  Needed to 
%    change \RM@tval and \RM@ttval too.  Shuffled a few code blocks 
%    around at the end of the package.
% 1996/09/13 v0.69 Replaced \newcommands with \defs (expect where I 
%    need optional arguments).  Saved 3\% time; oh well.  Got rid of 
%    \tight...\loosest commands---I've never used them and they're 
%    redundant anyway.  Isn't this the best version number since 42?  
%    101's the next good one, I think.  Tried replacing pt with \p@ 
%    and saved < 0.1s (<0.5\%), so left pt as pt.
%    Goes with rmpwnorm-v0.48.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.11.cfg
% 1996/09/12 v0.68 Removed a redundant \let...\@undefined at end.
%    Changed parameter reporting code quite a lot.  Got rid of 
%    \RM@ocltype commands, probably.
%    Goes with rmpwnorm-v0.47.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.10.1.cfg
% 1996/09/11 v0.67 Much hacking out of \RM@ocl statements.  Added 
%    \RM@infotheval command.  Changed loosesetting commands, 
%    including \GenericError.
%    Goes with rmpwnorm-v0.46.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.10.1.cfg
% 1996/09/11 v0.66 I mourn the death of rat-setwidth-norm, 
%    rat-setwidth-slides, and rmpagelocal.cfg.  Bill Gates killed 
%    them, and I weep for their passing.  They've been replaced by 
%    rmpwnorm.pko, rmpwslid.pko, and rmplocal.cfg; horribly 
%    utilitarian names, but needs must when the devil Gates drives.  
%    Used the \RM@notinexecuteoptions command to prevent one executing 
%    an option that advances a counter (these should always be done in 
%    the right order, passed to the package normally).  Created some 
%    new printer types, and moved a lot of option declarations into 
%    the config file.  Added \RM@SetClassType command and 
%    \RM@ClassExecuteOptions commands.  Corrected a hook executor.  
%    \@undefined some more commands.  Author dies horribly and goes 
%    to bed.
%    Goes with rmpwnorm-v0.45.pko, rmpwslid-v0.5.pko, and 
%    rmplocal-v0.10.cfg
% 1996/09/10 v0.65 Changed comments somewhat; got rid of plenty of 
%    double %% lines.
%    Goes with rat-setwidth-norm-v0.43, rat-setwidth-slides-v0.4,
%    and rmpagelocal.cfg v0.9
% 1996/09/10 v0.64 Fiddled with a few bits; not much done.
%    Goes with rat-setwidth-norm-v0.43, rat-setwidth-slides-v0.4,
%    and rmpagelocal.cfg v0.8
% 1996/09/09 v0.63 Changed class detection code and class type 
%    numbers; scrapped earlyclassdetect error checking and stuff like 
%    that; rmpage.tex got some scribbles, and it really does make 
%    sense, honest.
%    Goes with rat-setwidth-norm-v0.43, rat-setwidth-slides-v0.4,
%    and rmpagelocal.cfg v0.7
% 1996/09/05 v0.62 dropped \RM@oncolumn flag; replaced with 
%    \RM@texcols counter; replaced old text column options with 
%    onecolumn(width), twocolumn(width), threecolumnwidth, and 
%    fourcolumnwidth.  Added a new command and options to select 
%    setting textwidth by:
%    (char+paper, char only, paper only) based width setting.
%    Added settings for DW520 printer to handle long A3 sizes printed 
%    on A4 paper.  Moved \if@compatibility check.  Much tidying.  
%    \RM@OnPaperSize commands now recognize [-1] as the long paper 
%    size, meaning `all long paper sizes and not long'.  Added small 
%    and large basemaxmparwidth options to go with small and large 
%    basemparclear which have been here a while.
%    Goes with rat-setwidth-norm-v0.42, rat-setwidth-slides-v0.4,
%    and rmpagelocal.cfg v0.6
% 1996/09/04 v0.61 changed marginal paragraph clearance setting; 
%    it's set by an initial option, then scaled by option.  A little 
%    checking of the initial value is done.  stdmargins and 
%    notstdmargins no longer do anything at all with the position of 
%    marginal notes; reversemargins/normalsmargins are up to you 
%    now.   Added concrete fount to recognized founts, and tidied 
%    that code up a bit, removing some redundant options.  Removed 
%    10, 11, and 12pt options because they do nought.  Removed call 
%    to 12pt option in ljmueepexam settings bit.  Added code to 
%    ensure that \textheight stays within the bounds set by min and 
%    max textheight.  And it works.  Changed printer options: 
%    dw520spec is now dw520; dw520 is now dw520-ours.
%    Goes with rat-setwidth-norm-v0.41, rat-setwidth-slides-v0.4,
%    and rmpagelocal.cfg v0.6
% 1996/09/03 v0.60 changed altitude options so it's now done as a 
%    fraction of 24, and touchaltitude increments interpolate 
%    between the main option heights (well, I know what I mean).  
%    Fixed ltxdoc stuff; fixed \RM@OnPaperType etc.  Came up with 
%    new way of handling jacking up; there's now a jackup flag to 
%    allow/disallow jacking up---it should be set on a 
%    printer/papersize/etc basis by printersettings code.  
%    Scrapped all the old jackup stuff.  Improved hook handling with 
%    \@ifundefined.  Major re-work of \textheight setting: touch 
%    options interpolate properly; added stdlength option.  Er, 
%    temporarily stopped using rat-setwidth-slides for slide width 
%    setting, and used rat-setwidth-norm instead.   Change this 
%    again when rsw-norm is stable and can be used as the basis for 
%    slides width setting.  Added some \CheckCommands to do some 
%    checking of the LaTeX commands I use.  Added US paper sizes to 
%    the option declarations.  And stuff; much fiddling.
%    Goes with rat-setwidth-norm-v0.40, rat-setwidth-slides-v0.4,
%    and rmpagelocal.cfg v0.5
% 1996/09/02 v0.59.1 corrected leastoffset (oops)
% 1996/09/02 v0.59 changed lots more stuff, mainly in the 
%    corresponding version of rat-setwidth-norm.  Removed touch 
%    counters for width and offset setting; put ltxdoc class setting 
%    code in the config file.  Added \RM@[min|max]textwidth 
%    parameters; set only for ltxdoc class for now; some checking 
%    done to ensure they're not set too daftly.  Hacked out some 
%    obsolete code.
%    Goes with rat-setwidth-norm-v0.40, rat-setwidth-slides-v0.4,
%    and rmpagelocal.cfg v0.4
% 1996/08/29 v0.58 changed name to rmpage.sty and added \RM@scalebyoption 
%    and \RM@sc@leby@ption. Replaced \PackageErrors with \RM@Error.  
%    Changed \headsep, \footskip, \mparsep, and \columnsep setting code to 
%    use \RM@scalebyoption.  Adaptivecolumnsep code (in 
%    rat-setwidth-norm) now gives a larger columnsep.  Replaced 
%    occurrrences of rmpagenew with rmpage.
%    Goes with rat-setwidth-norm-v0.38, rat-setwidth-slides-v0.4,
%    and rmpagelocal.cfg v0.3
% 1996/08/29 v0.57veryx; added five hooks: \RM@BeforeProcessOptions, 
%    \RM@AfterProcessOptions, \RM@PrinterPaperSettings, 
%    \RM@BeforeWidthSetting, and \RM@AfterWidthSetting.  Changed 
%    \ProcessOptions* back to \ProcessOptions.  Changed class 
%    identification code to use \RM@OnClassType; changed width-setting 
%    file choice to use \RM@OnClassType
%    Goes with rat-setwidth-norm-v0.37, rat-setwidth-slides-v0.4,
%    and rmpagelocal.cfg v0.3
% 1996/08/28 v0.56.1veryx; added no10envelopepaper.
%    Goes with rat-setwidth-norm-v0.37, rat-setwidth-slides-v0.4,
%    and rmpagelocal.cfg v0.3
% 1996/08/25 v0.56veryx; erm, got 7/8longpaper right; changed paper 
%    size codes and added more paper sizes.  Changed classtouch 
%    options into t@uch options; saved about 0.25s!  Changed options 
%    with marginpar in the name to options with mpar in the name; 
%    saved about 0.1s.  Changed options with columnsep in the name 
%    to options with colsep in the name; saved about 0.1s.  Saved 
%    0.45s this way.  rmpagenew seems to add about 13.1s to a LaTeX 
%    run.  Eek!
%    Goes with rat-setwidth-norm-v0.37, rat-setwidth-slides-v0.4,
%    and rmpagelocal.cfg v0.3
% 1996/08/24 v0.55veryx; added \RM@Warn and \RM@Error as synonyms 
%    for \PackageError{rmpagenew} etc., added longpaper support, and 
%    changed the code that specifies the printer printing area so 
%    you don't have to know about all paper sizes.  Removed `sensible 
%    paper' check, because a paper size can be specified in the .cfg 
%    file.  Changed the .cfg file searching code to support multiple 
%    .cfg files (not fully tested).
%    Goes with rat-setwidth-norm-v0.36, rat-setwidth-slides-v0.4,
%    and rmpagelocal.cfg v0.2
% 1996/08/23 v0.54veryx; added \RM@PrinterPaperSettings hook and 
%    started using the rmpagenew.cfg config file; eventually, I'll 
%    have sensible paper size and local printer support.  Added some
%    useful commands for setting printer and paper settings, and removed 
%    some of the options from the \ExecuteOptions list (which is now in 
%    the .cfg file).
%    Goes with rat-setwidth-norm-v0.35, rat-setwidth-slides-v0.4,
%    and rmpagenew.cfg v0.1
% 1996/08/21 v0.53.1veryx; changed some of the loose typesetting 
%    parameters because they weren't very nice; corrected B paper 
%    sizes, and confirmed A sizes against BS4000; checked some 
%    envelope sizes against BS4264.
% 1996/08/09 v0.53veryx; added dw600 printer option based on 
%    measuring Rebecca's printer's printing area.
% 1996/08/01 v0.52veryx; added beton option to change \baselineskip 
%    before beton does so that \textheight is set correctly.  Lots of 
%    jiggery-pokery so that \normalsize is selected while vertical 
%    stuff is being worked on (but only if beton's been loaded), and 
%    so that the size and baselineskip of the fount that was selected 
%    on entering the package is selected after vertical stuff has been 
%    worked on.  Goes with rat-setwidth-norm-v0.34.pko and 
%    rat-setwidth-slides-v0.4.pko 
% 1996/07/21 v0.51.4veryx; trivial comment changes etc.  Goes with
%    rat-setwidth-norm-v0.33.pko and rat-setwidth-slides-v0.4.pko.
% 1996/07/12 v0.51.3veryx; changed a \PackageWarning into an 
%    \oclwarninfo.  Goes with rat-setwidth-norm-v0.32.pko and 
%    rat-setwidth-slides-v0.4.pko
% 1996/07/10 v0.51.2veryx; some small documentation changes.  Goes 
%    with rat-setwidth-norm-v0.32.pko and 
%    rat-setwidth-slides-v0.4.pko
% 1996/06/30 v0.51.1 veryx; as below but this one works.  Goes with 
%    rat-setwidth-norm-v0.30.pko
% 1996/06/30 v0.51 veryx; changed email address and fixed 
%    touchmoremarginparsep (and tmfootskip and tmheadsep.  Foolish 
%    child.) bug.  And added notstdmargins option which also says 
%    \reversemarginpar (\reversemarginpar is executed anyway just 
%    after the \RM@stdmargins flag is defined); \normalmarginpar 
%    added to stdmargins option to balance things up.
% 1996/06/14 v0.50 veryx; changed \RM@onchatlevel to \RM@ocl; 
%    used some of the new \RM@ocl commands (added an ocl command or 
%    two); changed \ifs into \ifRM@s, and \let the \if, true, and 
%    false declarations to \@empty at end; added \ifRM@infowarned flag 
%    and message at end so user knows if a warning has been logged; 
%    adaptivecolumnsep flag is now RM@adaptivecolsep.  Goes with 
%    rat-setwidth-norm v0.30
% 1996/06/07 v0.49.2veryx; added a couple of \s where they will do 
%    most good.
% 1996/05/24 v0.49.1veryx; stuff done with \RM@ocl commands; not 
%    finished
% 1996/05/16 v0.49veryx; \@total[head|foot|headfoot]clearance 
%    lengths changed to \RM@... lengths; \@ifnotearlyerror command 
%    renamed \RM@ifnotearly error; goes with rsw.sty v0.29
% 1996/05/12 v0.48veryx; \RM@mparclearfrac used to retire 
%    \@minmparclearance; [least...most]mparclearfrac options added; 
%    \@maxmparwidth length replaced with \RM@maxmparwidth command 
%    both \@emptied at end; [least...most]maxmparwidth options 
%    added; goes with rat-setwidth-norm v0.28
% 1996/05/06 v0.47veryx; goes with rat-setwidth-norm v0.27.  Changed 
%    \@min[left|right|foot|head]clearance lengths to 
%    \RM@min[left|right|head|foot]clearance commands; changed a couple of 
%    ifnums to ifdims like they should be; minor message changes 
%    (probably); \@emptied the new commands at end; \@emptied 
%    \RM@oclwarninfo at end.
% 1996/05/05 v0.46veryx; added the \@RMoclwarninfo command; 
%    \def->\newcommand for a couple of commands; 
%    \@min[outside|inside|top|bottom]margin lengths changed to commands 
%    beginning with \RM@ and \@emptied at end; goes with rsw-norm v0.26
% 1996/04/29 v0.45.1 added \let\XXX\@empty stuff for jackup commands.
% 1996/04/24 v0.45 changed dw520printer minclearances so they match the 
%    printer, not the specs.  Added dw520printerspec option with 
%    minclearances according to spec; changed \@[p|l]jackuplong[er|est] 
%    to \RM@[ditto]; changed \@jackup to command and \let it to 
%    \RM@[p|l]jackuplong[er|est] at the appropriate points; goes with 
%    rsw-norm v0.25
% 1996/04/20 v0.44veryx; added fulllength and fullwidth options; 
%    replaced \@ptr[l|r|t|b][port|land]clear lengths with
%    \RM@ptr[l|r|t|b][port|land]clear commands; goes with 
%    rat-setwidth-norm-v0.25
% 1996/04/12 v0.43veryx; added support for rmsizeN packages; I'm not sure 
%    they are a good thing to let loose on the rest of the world.  
%    Changed \@minmparclearance to 8mm from 0.4in
% 1996/04/11 v0.42veryx; \@looseoption counter now \RM@looseoption 
%    command; \@classtype counter now \RM@classtype command; \@fountfamily 
%    counter now \RM@fountfamily command; \@chatlevel now \RM@chatlevel; 
%    \@lengthoption counter now \RM@lengthoption command; \@widthoption 
%    counter now \RM@widthoption command; \@offsetoption counter now 
%    \RM@offsetoption command; \@printerype counter now \RM@printertype 
%    command; \@papertype counter now \RM@papertype command; 
%    \@onchatlevel command now \RM@onchatlevel command.  All these 
%    commands \let to \@empty at the end.  \@headfootbalance renamed 
%    \RM@headfootbalance; \@touchlength renamed \RM@touchlength; 
%    \@touchaltitude renamed \RM@touchaltitude; \@touchoffset renamed 
%    \RM@touchoffset; \@touchwidth renamed \RM@touchwidth
% 1996/04/05 v0.41veryx; changed some \defs (ish).  \looseness changed to 
%    \sloppiness; it seems that \looseness is defined by the TeX kernel (oops).   
%    Some commands now defined by \newcommand ... \def.  Maybe do 
%    something about this later.  Started changing counts into defs 
%    (where possible) to free memory at the end with \let\XXX-\@empty.  
%    Find out where I got this idea from and see if it works.  Commented 
%    out quite a few paper sizes for speed's sake
% 1996/03/29 v0.40veryx; added ...columnsep, ...headsep, ...footskip, 
%    ...marginparsep options; fixed marginparwidth setting
% 1996/03/16 v0.39veryx; \normalmarginpar and \mparswitchtrue 
%    (\if@twoside) now set in conventional place if \@classtype=9 (ltxdoc).
% 1996/03/14 v0.38veryx; added adaptivecolumnsep option
% 1996/03/12 v0.37veryx; added touch... counters and classtouch options 
%    so you can always get a touch option to have an effect.  Removed the 
%    notouch options; they were horrid and now redundant.
% 1996/03/12 v0.36veryx; changed touch... switches so touchsmaller after 
%    touchlarger results in no change and vice-versa.  Handy if you have a 
%    class or something that uses a touch... option.
% 1996/03/12 v0.35veryx; recognises ljmueepexam class, and sets default 
%     options; \@earlyclassdetect flag checks that the 
%     \@ifclassloaded command is still working; added notouch... options 
%     to cancel any of the touchXXX option pairs
% 1996/03/11 v0.34veryx; changed longest setting parameters slightly so 
%     dw520 is happier
% 1996/03/10 v0.33veryx; removed the (unused!) oldlength option; changed 
%     some comments; now reports text/paper height.
% 1996/03/09 v0.32veryx; added the thisfountwidth and loadthisfount 
%     options; removed \let..\@empty; fiddled with some messages.
% 1996/03/08 v0.31veryx; midoffset->normaloffset; removed some redundant 
%     \relaxes; fixed calls to rat-setwidth-[norm/slides].pko; made failed 
%     loadfount more friendly; one \let...\@empty at end (add more to clear 
%     memory)
% 1996/03/07 v0.30veryx; added all A, B, and C series paper sizes.
% 1996/03/06 v0.29veryx; added ltxguide class; fixed textheight definition 
%     based on classtype and made it more robust.
% 1996/03/05 v0.28veryx; low options corrected
% 1996/03/04 v0.27veryx; added touchmoreoffset/touchlessoffset options and 
%     flags.  Added old British book sizes as paper sizes.  [more/less]offset 
%     and touch[more/less]offset options seem to work.
% 1996/03/03 v0.26veryx; removed \if@rmcv, @ltxdoc, and @rmletter flags.  Rely on 
%     references to \@classtype from now on.  Added halfinchmargins option.  
%     Added more papersizes.  Added touchhigher and touchlower options.  
%     Started to do things to support variable offsets; \@offsetoption counter 
%     defined, as well as more/less offset options.
% 1996/02/29 v0.25veryx; loadfount now sets \@looseoption=4 unless a looseness 
%     setting option has been specified
% 1996/02/28 v0.24veryx; corrected default value of \@lengthoption
% 1996/02/27 v0.23veryx; added portrait/landscape forcing---needed because of 
%     the paper size definitions
% 1996/02/25 v0.22veryx; added \@min[inside,outside,top,bottom]emargins; 
%     added maxmparwidth + minmparclearance; changed fountfamily 
%     options to fountwidth; changed class recognition code and add\@rd bithesis 
%     to recognition list; added c4 papertype; added altitude options
% 1996/02/20 v0.21veryx; added the load[fount] options
% 1996/02/18 v0.20veryx; ltxdoc switch added; nicedate fixed
% 1996/02/17 v0.19veryx; paper size flags no longer used (but \@sensiblepaper 
%     is still used).  More sensible code for setting and checking head and 
%     foot clearances. \@jackup[l][p]long[er][est] now used to set \@jackup; 
%     \@jackup can be set differently for every printer/size/orientation 
%     combination.
% 1996/02/16 v0.18veryx; more fount families declared; began to rationalize 
%     paper size handling.  Check length settings!
% 1996/02/15 v0.17veryx; minclearances now set by printer options
% 1996/02/14 V0.16veryx; minclearances now set better.
% 1996/02/13 v0.15veryx; multicolumn option added; setwidth-norm changed; 
%     fount family options declared (not that they're used yet.
% 1996/01/28 v0.14veryx; shorter and shortest options added
% 1996/01/17 v0.13veryx; shortish option added
% 1996/01/08 v0.12veryx; printer's happier still---minfootclearance->15mm
% 1995/12/18 v0.11veryx; dunno what I did; changed setwidth-norm at the same time
% 1995/12/10 v0.10veryx; printer's happier---minfootclearance->19mm
% 1995/12/03 v0.9veryx; argh!  changed minfootclearance->20mm;  Printer probs.
% 1995/11/05 v0.8veryx: notonecolumn option added; saves attempting to 
%     detect all the ways of asking for multicolumn printing.
% 1995/11/05 v0.7veryx: oneinchmargins added; \@toowide replaced by 
%     \@setbymargins; \@minleft/right clearances now exist and know about 
%     portrait/landscape printing (as do \@minfoot/head clearances).
% 1995/11/01 v0.6veryx: portrait/landscape recognised.
% 1995/10/22 v0.5veryx; nicedate now balanced by nastydate
% 1995/08/29 v0.4veryx; can't remember
%
%
%%
%%
%%    \subsection{Changes to rmpwnorm.pko, now included in rmpage.sty}
%%
% 1996/10/25 v0.60 Included the changes needed to set horizontal 
%    parameters for the slides class; this is to make rmpwslid.pko 
%    obsolete.  I wonder if it's worked yet?  Changed | to / as the 
%    OR delimiter in some typeouts because ltxguide re-defines | 
%    with shortvrb
%    Goes with rmpage-v0.85.sty
% 1996/10/25 v0.59.1 Changed name in \ProvidesFile (eek)
%    Goes with rmpage-v0.84.2.sty
% 1996/10/25 v0.59 Changed some logged info
%    Goes with rmpage-v0.84.1.sty
% 1996/10/21 v0.58 Changed the minimum textwidth warning limit.  
%    Changed stuff to use rmpwslid.pko again
%    Goes with rmpage-v0.84.sty
% 1996/10/02 v0.57 Fixed a couple of depressingly obvious width 
%    setting bugs.  How did they get this far?  Was I mad?  asleep?  
%    somewhere else? when I checked it the first time?
%    Goes with rmpage-v0.81.1.sty
% 1996/09/30 v0.56 Changed checking and handling of illegal 
%    RM@fountfamily setting.
%    Goes with rmpage-v0.80.1.sty
% 1996/09/29 v0.55 Added some checks to ensure that the various 
%    printing limits don't ask for something impossible.
%    Goes with rmpage-v0.80.sty
% 1996/09/27 v0.54.1 Changed comments so wideish appears as widish.
%    Goes with rmpage-v0.78.sty
% 1996/09/26 v0.54 Changed lucida casual width to match the new 
%    lucasual stuff.
%    Goes with rmpage-v0.76.sty
% 1996/09/25 v0.53 Changed character-based width multipliers; very 
%    strange, this is.
%    Goes with rmpage-v0.75.sty
% 1996/09/25 v0.52 Changed handling of multiple columns so you get 
%    stdwidth with stdwidth: removed columnsep from the reckoning for 
%    stdwidth setting, and warned if you've asked for more than two 
%    columns
%    Goes with rmpage-v0.75.sty
% 1996/09/24 v0.51 Added a report of which textwidth has been used.  
%    Removed some redundant comments, and added some new ones about 
%    what to do in with future versions.  Deleted some frighteningly 
%    pointless code.
%    Goes with rmpage-v0.74.sty
% 1996/09/23 v0.50 Did something else, but I can't remember what.  
%    Probably.  Never mind; save the version.
%    Goes with rmpage-v0.73.sty
% 1996/09/22 v0.49 Changed the textwidth setting code, so that if you 
%    ask for a paper-based textwidth (like oneinchmargins) and 
%    characterwidthset, you get oneinchmargins and a warning.
%    Goes with rmpage-v0.72.sty
% 1996/09/14 v0.48.1 minor doc change
%    Goes with rmpage-v0.71.2.sty
% 1996/09/13 v0.48 Got rid of the one \newcommand.  Saved a tiny bit 
%    of time.
%    Goes with rmpage-v0.69.sty
% 1996/09/12 v0.47 Played about with reporting a good deal.  Remove 
%    \RM@marginoffset length; it appears to be redundant.
%    Goes with rmpage-v0.68.sty
% 1996/09/11 v0.46 Much hacking out of \RM@ocl statements
%    Goes with rmpage-v0.67.sty
% 1996/09/11 v0.45 Urk.  Corrected \RM@setbywidth code and added more 
%    reporting; changed name to rmpnormw.pko from rat-setwidth-norm 
%    (as it would be in a world free from Bill Gates's malign 
%    influence).  Apologies to people who might use the abbreviation 
%    RMP in a different context.
%    Goes with rmpage-v0.66
% 1996/09/10 v0.44 Turned %% lines into % lines.
%    Goes with rmpage-v0.65
% 1996/09/09 v0.43 Added column width limit warning, and console 
%    message about textwidth in terms of characters.
%    Goes with rmpage-v0.63
% 1996/09/05 v0.42 Changed multiple-column handling, and added stuff 
%    to support setting width by paper only, or by character size 
%    only.  Scrapped shrunk[p|c]width flags and surrounding code.
%    Goes with rmpage-v0.62
% 1996/09/04 v0.41 marginal paragraph width setting changed: 
%    maxmparwidth and mparclearance are both now setbyoption, with 
%    initial values set as a fraction of paperwidth.  Oh dear: 
%    corrected columnsep error in width setting code (I must debug 
%    things properly, foolish boy).  Added Concrete founts to the 
%    list of known founts: concrete is number 11, thisfountwidth is 
%    done by number 12 now.  Much tidying done.
%    Goes with rmpage-v0.61.sty
% 1996/09/02 v0.40 Re-worked the initial \textwidth setting selection 
%    code and the offsetting code.  Added support for 
%    \RM@[min|max]textwidth.  Removed some obsolete code.
%    Goes with rmpage-v0.59.sty
% 1996/08/30 v0.39 re-measured the character widths of the various 
%    standard founts using larger sample and (mainly) the new 8r 
%    installation. (cmr and hlcn the exceptions to this 8r business, 
%    I think).
% 1996/08/30 v0.38 changed width setting code to take notice of 
%    \columnsep.  Changed mparsep and columnsep setting to use 
%    \RM@scalebyoption. Changed \PackageError{rmpagenew} into 
%    \RM@Error.  Changed occurrances of rmpagenew into rmpage.  
%    Changed columnsep given by adaptivecolsep (it's a bit larger 
%    now).
%   Goes with rmpage.sty v0.58
% 1996/08/25 v0.37 changed the name of marginparsepoption to 
%    mparsepoption, to go along with rmpagenew.
%    Goes with rmpagenew.sty v0.56
% 1996/08/24 v0.36; debugged some stuff (too tired to remember what 
%    was wrong); I think that's it.
%    Goes with rmpagenew.sty v0.55.
% 1996/08/23 v0.35 veryx; Changed the \textwidth settting code to 
%    preserve the \RM@offsetfrac relationship between right-hand and 
%    left-hand margins.  It appears to work, but I haven't tested it 
%    exhaustively yet.  Oh, and the \RM@offsetfrac relationship isn't 
%    maintained if you've asked for fullwidth.  I'm not sure that 
%    this is the right decision, but I suspect so.  Goes with 
%    rmpagenew v0.53.1
% 1996/07/28 v0.34 veryx; changed setwidth setting so that wider, 
%    widest, oneinchmargins, halfinchmargins, and full width all use 
%    the standard width setting code (eek).  Goes with rmpagenew v0.51.4.
% 1996/07/21 v0.33 veryx; corrected stdwidth setting (was ten times 
%    too small).  Goes with rmpagenew v0.51.4.
% 1996/07/08 v0.32 veryx; changed \@marginoffset length to 
%    \RM@marginoffset; goes with rmpagenew v0.51.1
% 1996/06/30 v0.31 veryx; fixed marginparwidth setting bug.  Goes 
%    with rmpagenew-v0.51.1.sty (v0.51 is faulty, as are all previous 
%    versions of rat-setwidth-norm.  And what makes you think I've 
%    found all the bugs *now*, eh?)
% 1996/06/16 v0.30.1 veryx; changed remaining \PackageWarnings into 
%    \RM@oclwarninfos.  Goes with rmpagenew v0.50.
% 1996/06/14 v0.30 veryx; removed oldwidth support; changed \ifs to 
%    \ifRM@s; \RM@ptperchar+\RM@offsetfrac both \let to \@empty at 
%    end; new \RM@ocl commands used to tidy up the code that reports 
%    stuff to the user; goes with rmpagenew v0.50
% 1996/05/24 v0.29.1veryx; changed \@ptperchar, \@offsetfrac, and 
%    \@setptperchar to \RM@ names and \let \RM@setptperchar\@empty at end.
% 1996/05/16 v0.29veryx; changed \@rmdaftmargins length to 
%    \RM@daftmargins length; goes with rmpagenew v0.49
% 1996/05/12 v0.28veryx; goes with rmpagenew v0.48; \@minmparclearance 
%    retired, and \RM@mparclearfrac used instead; \@maxmparwidth 
%    length replaced with \RM@maxmparwidth command.
% 1996/05/06 v0.27veryx; goes with rmpagenew v0.47; 
%    \@min[left|right]clearance lengths now \RM@min[left|right]clearance 
%    commands; minor message changes.
% 1996/05/05 v0.26veryx; goes with rmpagenew v0.46; \@min[in|out]sidemargin 
%    lengths changed to \RM@[...] commands.
% 1996/04/24 v0.25.1veryx; changed a messge so it fits on the line better
% 1996/04/20 v0.25veryx; added fullwidth option; changed increase esm 
%    code so the warning makes sense; goes with rmpagenew-v0.44
% 1996/04/12 v0.24veryx; added some more \typeouts.
% 1996/04/11 v0.23veryx; some counters are now commands with changed names
%    (\RM@XXX rather than \@XXX); see changes comments for rmpagenew-v0.42 
%    for full details.  Opposite \oddsidemargin now correctly calculated.
% 1996/04/10 v0.22veryx; now deals with wide asking for wider \textwidth 
%    than wider/est, and traps some possible bug conditions.
% 1996/03/29 v0.21veryx; added ...columnsepoption/...marginparsepoption 
%    support
% 1996/03/14 v0.20veryx; added adaptivecolumnsep
% 1996/03/12 v0.19veryx; \@touch[width/offset] counters supported (soon!)
% 1996/03/12 v0.18veryx; added \@onchatlevel to control \typeouts
% 1996/03/09 v0.17veryx; added code to support thisfountwidth; removed 
%    \let...\@empty; fiddled with some messages
% 1996/03/05 v0.16veryx; stdwidth now done properly
% 1996/03/04 v0.15veryx; variable l/r offsets probably supported
% 1996/03/03 v0.14veryx; replaced \if@ltxdoc with \ifnum\@classtype=9; 
%    halfinchmargins now supported.  Probably cleaned up something else.  
%    Started to do things to support variable l/r offsets; \@offsetfrac counter 
%    defined.
% 1996/02/25 v0.13veryx; completely re-wrote most of the margin setting code.
% 1996/02/25 v0.12veryx; added support for \@min[in,out]sidemargins; uses 
%    \@maxmparwidth and \@minmparclearance set by rmpagenew.
% 18/02/96 v0.11veryx; ltxdoc switch added; min \textwidth is 355pt if 
%    typesetting with ltxdoc. 0.4in is min gap twixt marginal notes and edge of 
%    paper.
% 17/2/96 v0.10.1veryx; \marginparsep=0pt for wider+widest
% 16/2/96 v0.10veryx; added courier and utopia fount family sizes
% 16/2/96 v0.9veryx; different founts now set different \textwidths.  stdwidth 
%                    option sets normalwidth \textwidth to standard values.
% 15/2/96 v0.8.1veryx; began to take notice of different founts (and other stuff)
% 14/2/96 v0.8veryx; wider and widest setting appears to work; stdmargins untested.
% 13/2/96 v0.7veryx: narrowest and narrower options added, widths now set 
%                    to less arbitrary values; touchnarrower/wider works even 
%                    more (idiot)                      
% 12/2/96 v0.6veryx: touchnarrower/wider now work again (fool)
% 18/12/95 v0.5veryx: stdmargins works (ish); marginpar sizes set better, but untested
% 5/11/95 v0.4veryx: maximum \textwidth based on papersize now sets 
% minimum margins as a fraction of \paperwidth; \RM@onecolumn flag recognized.
% 5/11/95 v0.3veryx; \@toowide flag replaced by \RM@setbymargins and 
% oneinchmargins option added, set by (almost) the same code that does for 
% wider and widest.  Fixed margin setting bug in my head.  Wider and 
% widest now set margins proportional to paperwidth.  Added *some* l/r margin 
% checking code.
% 3/11/95 v0.2veryx: added more width options; used \@widthoption counter 
% for the first time.
% 2/11/95 v0.1veryx rat-setwidth-norm.pko
% Extracted from rmpagenew v0.5veryx on 2/11/95.  See rmpagenew.sty for 
% copyright information.
%%
%%
%%    \subsection{End of rmpwnorm's changes history}
%%
%% \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         \~}
%%
%%
%%
%%    \section{Begin with definitions}
%%
%%
%%    \subsection{Miscellaneous definitions}
%%
% The golden ratio = (\sqrt{5} - 1) / 2 \approx 0.6180
% 210/297 \approx 1/\sqrt{2} \approx 0.7071
%
% Define a command so I can print 
\catcode`\%=11\relax
\def\RM@percentsign{%}
\catcode`\%=14\relax
%
% \RM@ocl.: level = 1, 2, or 3.  1 is printed only with 
% garrulous option, 2 with garrulous and chatty, 3 with garrulous, 
% chatty, and taciturn.  Nought is printed with t' yorkshire option
% \@onlevel{1}{\typeout{Done it}}{}
%
% \RM@ocl{1}{}{}: include reports of option setting etc.; garrulous
% \RM@ocl{2}{}{}: include most parameter values and report main 
%                       processing blocks; chatty
% \RM@ocl{3}{}{}: final parameter values etc. only; taciturn
% \RM@ocl{4}{}{}: always print even when yorkshire;
%
%
% \RM@oclwarninfo{num}{text}; like \RM@ocl, but text is used in a 
% PackageWarning if num > chatlevel, or in a PackageInfo otherwise.
\newif\ifRM@infowarned\RM@infowarnedfalse
%

\long\def\RM@ocl#1#2#3{\ifnum #1>\RM@chatlevel #2\else #3\fi}
%
\def\RM@ttval#1{\typeout{\space\space\space\protect#1\space= \the#1}}
\def\RM@tval#1{\typeout{\space\space\space\protect#1\space= #1}}
%
\long\def\RM@oclwarninfo#1#2{\RM@ocl{#1}
		{\PackageWarningNoLine{rmpage}{#2}}
		{\PackageInfo{rmpage}{#2}\RM@infowarnedtrue}}
%
\def\RM@infotheval#1{\PackageInfo{rmpage}{\the#1\space= \protect#1}}
%
\def\RM@Error#1#2{\PackageError{rmpage}{#1}{#2}}
\def\RM@Warn#1{\PackageWarning{rmpage}{#1}}
%
\if@compatibility
	\RM@Error{rmpage won't work right in LaTeX 2.09 compatibility 
		mode}
		{Either stop using the rmpage document style option, or 
		typeset your document\MessageBreak as a LaTeX2e document.  You 
		can do this by using \protect\documentclass\space\MessageBreak 
		instead of \protect\documentstyle; style files like rmpage are 
		loaded by saying:\MessageBreak \protect\usepackage{rmpage}}
	\fi% endif@compatibility
%
\CheckCommand{\@gobble}[1]{}
\CheckCommand{\@gobbletwo}[2]{}
\CheckCommand{\@gobblefour}[4]{}
\CheckCommand{\@firstofone}[1]{#1}
\CheckCommand{\@firstoftwo}[2]{#1}
\CheckCommand{\@secondoftwo}[2]{#2}
\CheckCommand*{\@settopoint}[1]{\divide#1\p@\multiply#1\p@}
%
\CheckCommand*{\@ifpackageloaded}{\@ifl@aded\@pkgextension}
\CheckCommand*{\@ifclassloaded}{\@ifl@aded\@clsextension}
%
\CheckCommand*{\@ifpackagewith}{\@if@ptions\@pkgextension}
%
\CheckCommand*{\@ifundefined}[1]{%
  \expandafter\ifx\csname#1\endcsname\relax
    \expandafter\@firstoftwo
  \else
    \expandafter\@secondoftwo
  \fi}

%%
%%
%%    \subsection{Initialize parameter variables}
%%
\def\RM@earlyclass{0}
% Set to the class number if \@ifclassloaded has said `yes' to 
% anything before \ProcessOptions; produce an error if it hasn't when
% it should've.
%
\newif\ifRM@loadfount\RM@loadfountfalse
\newif\ifRM@nicedate\RM@nicedatefalse
%
\newif\ifRM@adaptivecolsep\RM@adaptivecolsepfalse
%
%
% This flag is used to detect when the \DeclareOptions bit is over, 
% and is set true just before \ProcessOptions.  So options which 
% should not be used in an \ExecuteOptions statement can be trapped 
% and warned about, using the \RM@notinexecuteoptions command in the 
% \DeclareOption statement.
%
\newif\ifRM@donewithoptions\RM@donewithoptionsfalse
%
\def\RM@notinexecuteoptions
	{\ifRM@donewithoptions
	\else
		\RM@Error
			{You shouldn't be using the \CurrentOption\space option in
				\MessageBreak an \protect\ExecuteOptions\space statement} 
			{Try passing the \CurrentOption\space option to rmpage in 
				the conventional way}
	\fi}
%
%
% The following code is from article.cls
%
% % \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
% % \DeclareOption{twoside}{\@twosidetrue  \@mparswitchtrue}
% %
% % \DeclareOption{onecolumn}{\@twocolumnfalse}
% % \DeclareOption{twocolumn}{\@twocolumntrue}
% end article.cls extract
%
% Stuff to keep track of the things they're named after\ldots
%
% centred text or not, twoside or not (and damn the standard flag), 
% the number of text columns, and portrait/landscape orientation.
%
%
\newif\ifRM@centre \RM@centrefalse
\newif\ifRM@twoside \RM@twosidefalse
\def\RM@textcols{1}
\newif\ifRM@portrait\RM@portraittrue% no std flag
%
% need this switch to figure out what to do with minimum printing 
% clearances if you're using ISO long sizes
%
\newif\ifRM@portlandinvert\RM@portlandinvertfalse
%
\newif\ifRM@headers \RM@headerstrue
\newif\ifRM@footers \RM@footerstrue
%
\newif\ifRM@stdmargins\RM@stdmarginstrue
%
%
% The 6 parameters below need to be counts.
%
\newcount\RM@headfootbalance\RM@headfootbalance=12
%
%
% The four counters below are set by options; the allowed values mean:
% 3=least, 6=less, 9=lessish, 12=normal, 15=moreish, 18=more, 21=most.
% Values less than 12 shrink the corresponding length, greater than 12
% expands the length.
%
\newcount\RM@columnsepoption\RM@columnsepoption=12
\newcount\RM@headsepoption\RM@headsepoption=12
\newcount\RM@footskipoption\RM@footskipoption=12
\newcount\RM@mparsepoption\RM@mparsepoption=12
%
\newcount\RM@mparclearoption\RM@mparclearoption=12
\newcount\RM@maxmparwidthoption\RM@maxmparwidthoption=12
%
%
% This works as a flag:
% 0 = set width by character and paper-based widths (default)
% 1 = set width by character-based width only
% 2 = set width by paper-basd width only
% It's set by options here, and acted on in rsw-norm.
\def\RM@setwidthby{0}
%
%
% \RM@mparclearance is a new parameter: the gap between the outside edge 
% of a marginal paragraph and the edge of the paper.  It is scaled by 
% option later on, and is set to an initial value based on a fraction of 
% paperwidth later on.  The two base initial values work out to 0.4in or 
% 0.8in if US letter paper is specified.  So that you don't have to use 
% the normalbasemparclear or largebasemparclear options, or so you can 
% set your own base \RM@mparclearance, normalbasemparclear is set by 
% default after option processing if \RM@mparclearance=-666pt.
%
\newlength\RM@mparclearance
\setlength\RM@mparclearance{-666pt}
%
% \RM@maxmparwidth is dealt with similarly; if nothing else is done 
% to \RM@maxmparwidth 
%
\newlength\RM@maxmparwidth
\setlength\RM@maxmparwidth{-666pt}
%
\def\RM@chatlevel{2}
% 0 = All
% 1 = Most parameter values and reports of main processing blocks
% 2 = Some: main final values
% 3 = Nothing reported except essential warnings and errors
%
\def\RM@ifbeton{3}% 0=beton opt, beton loaded
%                             1=beton loaded, no opt
%                             2=beton opt, beton not loaded
%                             3=pristine
%                             4=nobeton opt
\def\RM@looseoption{205}
% 0=tight, 1=looseish, 2=loose, 3=looser, 4=loosest, 5=sloppier, 
% 205=undefined
%
% Needs to be a count.
\newcount\RM@lengthoption\RM@lengthoption=15
% 0=stdlength, 3=shortest, 6=shorter, 9=shortish, 12=short
% 15=normallength ... 27=longest, 30=fulllength
%
\def\RM@classtype{0}
% 0=undefined,
% 1=article, 2=report, 3=letter, 4=book, 5=slides,
% 10=ltxdoc, 11=ltxguide, 19=unknown
% 20=rmcv, 21=rmletter, 22=bithesis, 23=ljmueepexam
%
% Needs to be a count
\newcount\RM@widthoption\RM@widthoption=14
% 14=normal
%
% Needs to be a count
\newcount\RM@offsetoption\RM@offsetoption=11
% 2=leastoffset, 11=normaloffset, 20=mostoffset
%
\def\RM@fountfamily{0}
% 0=cmr, 1=avant, 2=bookman, 3=chancery, 4=helvet, 5=newcent, 
% 6=palatino, 7=times, 8=utopia, 9=lucasual 10=courier, 11= concrete, 
% 12=this fount, 13=lucida-casual
%
\def\RM@printertype{0}
%
\def\RM@papertype{0}                          
% 0=unknown, 1=usletter, 2=uslegal, 3=usexecutive,
% 4=a0, 15=b0, 26=c0, 36=foolscapfolio, ...
%
%
% 0 = not long
% 1 = 7/8  2 = 3/4  3 = 2/3  4 = 5/8  5 = 1/2 
% 6 = 3/8  7 = 1/3  8 = 1/4  9 = 1/8.
% 1/2 is non-canonical, but works anyway.
%
\def\RM@longpapertype{0}
%
% minmargins are the minimum gap between the main block of text and the 
% edge of the paper.  minclearances are the minimum gap between the 
% furthest extent of printing and the edge of the paper.  minmargins are 
% only taken notice of by classes like bithesis, where a minimum margin 
% is specified in the regulations.
%
% The following commands hold the minimum permitted margin around the 
% body of the text (different to printing area: you can have marginal 
% notes inside the margin, you can't have marginal notes outside the 
% permitted printing area.)  The foot and head are contained within the 
% \RM@min[top/bottom]margin space.  These parameters are only set where 
% regulations or something specify minimum margins.  For example: 
% camera-ready copy for journals, theses, and stuff like that.  They are 
% currently only set if you are using the bithesis class; it is sensible 
% to set them anywhere before LaTeX's \textheight/width/etc., parameters 
% are set.  You could add code to set them for the book class, add an 
% option which sets these parameters, or whatever.
%
\providecommand{\RM@minoutsidemargin}{0pt}
\providecommand{\RM@mininsidemargin}{0pt}
\providecommand{\RM@mintopmargin}{0pt}
\providecommand{\RM@minbottommargin}{0pt}
%
% The following commands hold the minimum margin around the printing 
% area for a particular printer/paper size/orientation combination.  
% They are set later, and are set to the values of 
% \@ptr[r/l][port/land]clear.  Precisely which minclearance is set to 
% which ptrclearance depends on the printer/papersize/orientation 
% combination.  The default setting is r->right, l->left, t->head, 
% b->foot.  The default setting of 1742pt is so that if they are *not* 
% set later, the ommission is apparent in the printed output.  (er, the 
% least random number concatenated with the philosophically most 
% significant number).
%
\def\RM@minrightclearance{1742pt}
\def\RM@minleftclearance{1742pt}
\def\RM@minfootclearance{1742pt}
\def\RM@minheadclearance{1742pt}
%
%
% \RM@[min|max]text[width|height] are yet more limits on text size.  
% Intended to be set on a class-by-class basis, applying limits where 
% necessary.
%
\providecommand{\RM@mintextwidth}{1pt}
\providecommand{\RM@maxtextwidth}{9999pt}
\providecommand{\RM@mintextheight}{1pt}
\providecommand{\RM@maxtextheight}{9999pt}
%
%
% The following three parameters need to be lengths
%
\newlength\RM@totalheadfootclearance
\newlength\RM@totalfootclearance
\newlength\RM@totalheadclearance
%
%
% The following lengths hold the minimum margin around the printing area 
% for a particular printer.  They are set later.  They are used to set 
% the minimum clearance parameters for each paper size.
%
\def\RM@ptrrportclear{0pt}% right-hand edge, portrait orientation
\def\RM@ptrlportclear{0pt}% left-hand edge, portrait orientation
\def\RM@ptrtportclear{0pt}% top edge, portrait orientation        
\def\RM@ptrbportclear{0pt}% bottom edge, portrait orientation     
\def\RM@ptrrlandclear{0pt}% right-hand edge, landscape orientation
\def\RM@ptrllandclear{0pt}% left-hand edge, landscape orientation 
\def\RM@ptrtlandclear{0pt}% top edge, landscape orientation       
\def\RM@ptrblandclear{0pt}% bottom edge, landscape orientation    
%
% Assumed minimum printer position tolereance; added to the 
% \RM@min...clearance parameters after they've been set by everything 
% else.  Intended to cope with the fact that the real world is 
% wobblier than you might think.
\def\RM@ptrpostol{0pt}
%
%
% If this switch is set to true, then the printing area can be raised 
% a bit without warning to clear an over-large non-printing margin at 
% the bottom.
\newif\ifRM@jackup\RM@jackupfalse
%
%
% 0 for all classes except slides.  1 for slides class.  Change by 
% class; use class detection section in the config file or the 
% \RM@BeforeTextheightSetting hook.
\def\RM@textheightgroup{0}
%
%
% 0 = article, report, letter, book, and derivatives
% 1 = slides
% 2 = foiltex
% 3 = classes using non-standard values for \@ptperchar
% 4 = undefined classes (produces error currently; don't use)
\def\RM@textwidthgroup{0}
%
%
% \RM@ptsizegroup is used by the width setting code; it's set to 0, 1, 
% or 2 as if it were \@ptsize.  But classes like foils which have four 
% different base sizes set \@ptsize to different values.  In these 
% cases, RM@ptsizegroup is set to 0, 1, 2, or 3; code which needs to 
% know which typesize you're using needs to be told about foils and 
% the like, so it behaves differently.  This probably makes life a 
% little easier.
%
% The initial value is set to be either 0pt, or whatever \@ptsize is, if 
% it exists.  This might not always be appropriate, but it's a good 
% starting point.
%
\@ifundefined{@ptsize}
	{\def\RM@ptsizegroup{0}}
	{\edef\RM@ptsizegroup{\@ptsize}}
%%
%%
%%    \subsection{Some useful commands}
%%
% The four commands below are intended to be used by a .cfg file 
% writer (and me, inside rmpage) to fiddle about with settings that 
% apply to different paper sizes/orientations on a printer-by-printer 
% basis.
%
% \RM@OnPortraitPaperSize[<long size code>]{<paper type code>}{<TeX 
% code>} Executes <TeX code> if paper size is as specified and in 
% portrait orientation.  The default <long size code> (the [optional 
% argument]) is 0, which is `not long'.  Passing -1 as the <long size 
% code> [optional argument] means `all sizes based on this <paper type 
% code>'; i.e., not long, 7/8long, 3/4long, \ldots, and 1/8long.
%
% The other \RM@On...PaperSize commands are similar.
%
\newcommand*{\RM@OnPaperSize}[3][0]{
	\ifnum#2=\RM@papertype \relax
		\ifnum#1=\RM@longpapertype \relax
			#3 \relax
		\else
			\ifnum#1=-1
				#3 \relax
			\fi
		\fi
	\fi
}
\newcommand*{\RM@OnPortraitPaperSize}[3][0]{
	\ifRM@portrait
		\ifnum#2=\RM@papertype \relax
			\ifnum#1=\RM@longpapertype \relax
				#3 \relax
			\else
				\ifnum#1=-1
					#3 \relax
				\fi
			\fi
		\fi
	\fi
}
\newcommand*{\RM@OnLandscapePaperSize}[3][0]{
	\ifRM@portrait
	\else
		\ifnum#2=\RM@papertype \relax
			\ifnum#1=\RM@longpapertype \relax
				#3 \relax
			\else
				\ifnum#1=-1
					#3 \relax
				\fi
			\fi
		\fi
	\fi
}

\def\RM@OnPrinterType#1#2{\ifnum#1<10\relax
	\RM@Error{You shouldn't be applying local code to this printer}
	{Printer types < 10 are supposed to be the same everywhere: stop it.}
	\else
		\ifnum#1=\RM@printertype\relax #2 \relax\fi
	\fi}

%
%
%
% \RM@OnClassType{<class type number>}{<true code>}{<false code>}
% Executes <true code> if \RM@classtype=<class type number>; 
% otherwise executes <false code>.  Reports the current class type if 
% you've asked for garrulous reporting.
%
\def\RM@OnClassType#1#2#3{\relax
	\RM@ocl{1}{\RM@typeclasstype{\RM@classtype}}{}
	\ifnum\RM@classtype=#1 \relax
		#2 \relax
	\else
		#3 \relax
	\fi
}
%% 0=unknown, 1=article, 2=report, 3=letter, 4=book, 5=slides,
%% 10=ltxdoc, 11=ltxguide, 20=rmcv, 21=rmletter, 22=bithesis,
%% 23=ljmueepexam
%
% Re-define the \RM@LocalClassReport command in the config file if you 
% add classes.  Use the \RM@OnClassType{<number>}{<true code>}{<false 
% code>} to report your new class.
%
\def\RM@LocalClassReport{\typeout{Undefined class detected}}
%
\def\RM@typeclasstype#1{
\ifcase#1
	\typeout{Unknown class type}% 0=Unknown
\or
	\typeout{article class detected}% 1=article
\or
	\typeout{report class detected}% 2=report
\or
	\typeout{letter class detected}% 3=letter
\or
	\typeout{book class detected}% 4=book
\or
	\typeout{slides class detected}% 5=slides
\or
	\typeout{Undefined class detected}% 6
\or
	\typeout{Undefined class detected}% 7
\or
	\typeout{Undefined class detected}% 8
\or
	\typeout{Undefined class detected}% 9
\or
	\typeout{ltxdoc class detected}% 10=ltxdoc
\or
	\typeout{ltxguide class detected}% 11=ltxguide
\or
	\typeout{Undefined class detected}% 12
\or
	\typeout{Undefined class detected}% 13
\or
	\typeout{Undefined class detected}% 14
\or
	\typeout{Undefined class detected}% 15
\or
	\typeout{Undefined class detected}% 16
\or
	\typeout{Undefined class detected}% 17
\or
	\typeout{Undefined class detected}% 18
\or
	\typeout{Unknown class detected}% 19
\or
	\typeout{rmcv class detected}% 20=rmcv
\or
	\typeout{rmletter class detected}% 21=rmletter
\or
	\typeout{bithesis class detected}% 22=bithesis
\or
	\typeout{ljmueepexam class detected}% 23=ljmueepexam
\else
	\ifnum\RM@classtype=50 \relax
			\typeout{foils class detected}% 50=foils
		\else
			\typeout{No standard class detected}
				\RM@LocalClassReport% Other
		\fi
\fi}
%
% \RM@SetClassType{<class name>}{<class type number>} If class <class 
% name> has been loaded, and current \RM@classtype is less than <class 
% type number>, sets \RM@classtype to be <class type number>.
%
\def\RM@SetClassType#1#2{
	\@ifclassloaded{#1}
		{\ifnum\RM@classtype<#2
			\def\RM@classtype{#2}
		\fi}
		{}
}
%
% \RM@OnClassExecuteOptions{<class name>}{<option list>}
% If the class <class name> has been loaded, 
% perform \ExecuteOptions{<option list>}.
%
\def\RM@OnClassExecuteOptions#1#2{\@ifclassloaded{#1}{\ExecuteOptions{#2}}{}}
%
% \RM@OnTextheightGroup{<textheight group number>}{<true code>}{<false code>}
% Executes <true code> if \RM@textheightgroup=<textheight group number>; 
% otherwise executes <false code>
%
\long\def\RM@OnTextheightGroup#1#2#3{
	\relax
	\ifnum\RM@textheightgroup=#1
		#2
	\else
		#3
	\fi
}
%
% Ditto for textwidth
%
\long\def\RM@OnTextwidthGroup#1{
	\relax
	\ifnum\RM@textwidthgroup=#1\relax
		\expandafter\@firstoftwo
	\else
		\expandafter\@secondoftwo
	\fi
}
%
% Use these commands to set parameters like \RM@mininsidemargin, which 
% often need to be set to at least a certain value.  One's for 
% lengths, the other's for commands.
%
\def\RM@SetLengthAtLeast#1#2{\ifdim#1<#2 \relax #1#2 \relax\fi}
\def\RM@DefLengthAtLeast#1#2{\ifdim#1<#2 \relax \def#1{#2}\relax\fi}
%
% \RM@scalebyoption{<thing to scale>}{<option number to scale by>}
% If I want to report values, do it outside this command; the bugs 
% seem to have gone now.
%
\def\RM@scalebyoption#1#2{
		\ifcase#2
			\RM@Error{What option do you 
			think that is, then?}
				{rmpage has a bug: \protect\RM@scalebyoption\space has 
				been passed 0 as an option number.\MessageBreak This 
				shouldn't happen}
		\or #1=0.3263#1% 1 = least - touchless - [class|@]touchless
		\or #1=0.3613#1% 2
		\or #1=0.4000#1% 3 = least
		\or #1=0.4429#1% 4
		\or #1=0.4903#1% 5
		\or #1=0.5429#1% 6 = less
		\or #1=0.6011#1% 7
		\or #1=0.6655#1% 8
		\or #1=0.7368#1% 9 = lessish
		\or #1=0.8158#1% 10
		\or #1=0.9032#1% 11
		\or \relax%      12 = norm
		\or #1=1.1072#1% 13
		\or #1=1.2258#1% 14
		\or #1=1.3572#1% 15 = moreish
		\or #1=1.5027#1% 16
		\or #1=1.6637#1% 17
		\or #1=1.8420#1% 18 = more
		\or #1=2.0394#1% 19
		\or #1=2.2580#1% 20
		\or #1=2.5000#1% 21 = most
		\or #1=2.7679#1% 22
		\or #1=3.0646#1% 23 = most + touchmore + [class|@]touchmore
	\else
			\RM@Error{This isn't right}
				{rmpage has a bug: \protect\RM@scalebyoption has been 
				passed a number greater than 23\MessageBreak as an 
				option number.}
	\fi% endifcase#2
}
%
% Only used by the fount loading code; just short-hand to save 
% re-typing this lot N times.
% 
\def\RM@noffilew#1#2{\RM@Error{You've asked me to load the\MessageBreak
		#1\space fount family,\MessageBreak but I can't find the file #2}
		{Get the file #2, and put it somewhere LaTeX can see it.}}
%
\def\RM@executehook#1{\@ifundefined{#1}{}{\csname#1\endcsname}}
%
% The name of the default configuration file (the .cfg extension is 
% optional; rmpage first searches for \RMconfigfile.cfg, then 
% \RMconfigfile).  Change this with \newcommand in your document 
% preamble, before loading rmpage.sty, if you want to.  Damn Bill 
% Gates to hell and back for the 8+3 filename; this would be called 
% rmpagelocal if it weren't for Microsoft and its attendant evils.  
% Go on, bring on your lawyers, see if I care.
% 
%
\providecommand{\RMconfigfile}{rmplocal}
%
%
%%
%%
%%    \section{Various definitions from rmpwnorm}
%%             =================================
%%
%%
% Needs to be a length
\newlength\RM@ptperchar
%
%
% Needs to be a count
\newcount\RM@offsetfrac\RM@offsetfrac=60
%
% \RM@OnWidthOption{<low width option number>}{<high width option number>}
%                  {<true code>}{<false code>}
% Executes <true code> if
%          <low width option number> < \RM@widthoption < <high width option number>; 
% otherwise executes <false code>
%
\def\RM@OnWidthOption#1#2#3#4
	{
	\ifnum#1<\RM@widthoption
		\ifnum\RM@widthoption<#2
			#3
		\else
			#4
		\fi
	\else
		#4
	\fi
}
%
% This is ignored if the slides class is being used; only one point 
% size is available
%
\def\RM@setptperchar#1#2#3#4{%        std / foils
	\ifcase\RM@ptsizegroup
		\setlength\RM@ptperchar{#1}% 10 pt/17pt
	\or
		\setlength\RM@ptperchar{#2}% 11 pt/20pt
	\or
		\setlength\RM@ptperchar{#3}% 12 pt/25pt
	\or
		\setlength\RM@ptperchar{#4}% 12 pt/30pt
	\else
		\RM@Error
			{I don't recognize the point size you've asked\MessageBreak
			for.  I have assumed you meant 10pt; you can\MessageBreak
			continue, but you will probably not like the\MessageBreak
			\protect\textwidth\space setting}
			{\protect\RM@ptsize\space has been set outside the range 0->3.
				I don't understand; I need fixing}
		\setlength\RM@ptperchar{#1}
	\fi% endifcase\@ptsize
}
%
% Executing this command sets \RM@ptperchar to a value based on the 
% current fount.  It's used a few times in the width setting code.  
% Note that you've got to have selected the fount you want (but note 
% that this code executes a \selectfont just in case you've forgotten).
%
\def\RM@setthisfountptperchar{
		\selectfont
		\settowidth{\RM@ptperchar}% 1067 characters in this para
			{Yet the more I thought about it, the more attractive it 
			became. Hitherto, my life has been ruled by the 
			principles of emotional candour, complex pharmaceuticals, 
			and financial chicanery, but look where it has got me: 
			holed up in this goat-stained room with a comprehensive 
			selection of liturgical sourcebooks, a duffel-bag stuffed 
			with lurid pornography and Barbie and Ken snarling on the 
			other side of the wall (their accents slip with rage or 
			lubricity). Down they quailed to the earth, those 
			Phaeacians of the long oars, those master mariners, 
			beneath the hurtling of the stone which soared so freely 
			from the hero's hand that it overpassed the marks of every 
			other. Athene, in her human shape, appeared suddenly and 
			marked the place where it touched earth. Loudly she cried 
			to Odysseus: `Stranger, even a blind man's dim groping 
			hand would pick out the dint of your stone: because it 
			does not lie confused among the crowd of marks, but is 
			alone, far in front of all. Be confident, for this event 
			at least. No Phaeacian will reach your throw, much less 
			exceed it.'}
		% 1067 total chars of English from Bargepole and T.E. Lawrence
		\divide\RM@ptperchar by1067
		\typeout{***************************************************************}
		\typeout{*\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space*}
		\typeout{* I am using the currently selected fount in my
			\space\space\space\space\space\space\space\space\space
			\space\space\space\space\space*}
		\typeout{* \protect\textwidth\space calculations.  This fount is
			\f@encoding\space encoded: \space\space\space\space
			\space\space\space\space*}
		\typeout{* \f@family\space family, \f@series\space series,
			\f@shape\space shape, \f@size pt size
			\space\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space\space
			\space*}
		\typeout{* I reckon it measures \the\RM@ptperchar\space
			points per character
			\space\space\space\space\space\space\space\space *}
		\typeout{*\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space\space
			\space\space\space\space\space\space\space\space*}
		\typeout{***************************************************************}
}
%%
%%    \section{Declare options}
%%             ===============
%%
\typeout{Starting option declaration}
%
% \RM@chatlevel	
% 0 = All
% 1 = Most parameter values and reports of main processing blocks
% 2 = Some: main final values
% 3 = Nothing reported except essential warnings and errors
\DeclareOption{garrulous}{\def\RM@chatlevel{0}}
\DeclareOption{chatty}{\def\RM@chatlevel{1}}
\DeclareOption{taciturn}{\def\RM@chatlevel{2}}
\DeclareOption{yorkshire}{\def\RM@chatlevel{3}}
%
%
% Data source for the old British book sizes: Pears Cyclopedia, 68th 
% edition, 1959-1960.  Pelham Books Ltd., 1959.  (General Compendium, 
% page N13).  A, B, and other untrimmed sizes taken from BS4000.  C0, 
% C1, C2, C7, and C7/6 taken from The Cambridge Factfinder, Cambridge 
% University Press, 1993.  C3, C4, C5, C6, DL, and non-ISO envelope 
% sizes taken from BS4264.
%
% According to BS4000,
% The ISO A series is based on A0, with a surface area of $1m^{2}$.  
% Each ISO B paper size is a geometric mean between adjacent A sizes, 
% with sides in the same proportions.
% 
% Each size shall be acheived by dividing the size immediately above it 
% into two equal parts, the division being parallel to the shorter 
% side.  Consequently, the areas of two successive sizes shall be in the 
% ratio 2:1.
% 
% All the size in each series shall be geometrically similar to one 
% another.
% 
% What this means is that the ratio of the sides must be $1:\sqrt{2}$, 
% so that A0 is $841mm \times 1189mm$.
% 
% Tolerances are specified thus:
% 
% \begin{tabular}{rl}
% Size & tolerance \\ \hline
% $\mathrm{sizes}\leq 150 \mathrm{mm}$&$\pm1.5 \mathrm{mm}$ \\
% $150\mathrm{mm}<\mathrm{sizes}\leq 600\mathrm{mm}$&$\pm2 \mathrm{mm}$\\
% $600\mathrm{mm}<\mathrm{sizes}\mathrm{mm}$&$\pm3 \mathrm{mm}$\\
% \end{tabular}
% 
% Long ISO sizes are created by dividing ordinary ISO sizes into slices, 
% cutting parallel to the short edge, e.g.,
% \begin{tabular}{ll}
% 1/3 A4 & $99 \times 210$ \\
% 1/4 A4 & $74 \times 210$ \\
% 1/8 A8 & $13 \times 74 $ \\
% \end{tabular}
% 
% 2/3 A4 is apparently a common size commercially, used for invoices 
% and the like.  It is defined as $198 \times 210 \mathrm{mm}$.  Note 
% that the standard defines sizes to the nearest millimetre, but 
% rmpage does not round the calculated long sizes, nor does it ensure 
% that only ISO sizes are processed by the `long' options.  This is 
% because you can chop up any bit of paper you like; if you are cutting 
% real-world paper, rounding errors on a 1/8 size could result in 4mm 
% error by the time you reached the strip furthest from the datum edge, 
% very different from the 0.5mm error (which is always within specified 
% tolerance and therefore irrelevant), which you get if you're talking 
% about single bits of paper.
%
%
%
% NEW
%
% papertypes: 0=undefined, 1=letter, 2=legal, 3=executive,
%             9 letter4paper
%             10=a0, ... , 20=a10 (a4=14, a5=15)
%             30=b0, ... , 40=b10
%             50=c0, ... , 57=c7, 58=dl, 59=c7/6,
%             60=bspopseedevelopepaper,     61=bspopnonisoenvelopepaper, 
%             62=bsbrochureenvelopepaper,   63=bslegalenvelopepaper,
%             64=bslargelegalenvelopepaper, 65=bscalendarenvelopepaper
%             66=no10envelopepaper
%             70=foolscap folio, 71=foolscap quarto, 72=foolscap octavo
%             73=crown folio, 74=crown quarto, 75=crown octavo
%             76=royal folio, 77=royal quarto, 78=royal octavo
%             79=imperial folio, 80=imperial quarto, 81=imperial octavo
%             82=large crown octavo
%             83=demy quarto, 84=demy octavo
%             85=medium quarto, 86=medium octavo
%             90=RA0, 91=RA1, 92=RA2, 93=SRA0, 94=SRA1, 95=SRA2
%             96=metricdoublecrownpaper, 97=metricquadcrownpaper
%             98=metriclargequadcrownpaper, 99=metricquaddemypaper
%             100=metricsmallquadroyalpaper
%
%  3 US sizes recognised by 3 options (1-3)
%  1 bodge size recognised by 1 option (9)
% 11 A sizes defined by 11 options: for writing paper, books, etc. (10-20)
% 11 B sizes defined by 11 options: for posters, etc. (30-40)
% 10 C sizes plus dlpaper defined by 10 options: for envelopes, etc. (50-59)
%  6 BS4264 envelope sizes defined by 6 options: (60-65)
%  1 US envelope size defined by 1 option: (66)
% 17 old British sizes defined by 18 options. (70-86)
% 11 BS4000 untrimmed sizes defined by 11 options (90-100)
% -----
% 71 different paper sizes defined by 72 options.
%
%
\DeclareOption{letterpaper}{\def\RM@papertype{1}
	\setlength\paperheight {11in}
    \setlength\paperwidth  {8.5in}
    }
%
% Ensure that the standard LaTeX default paper size is always 
% selected.  Doing this here ensures that it can be over-ridden 
% anywhere else, but it won't be removed.  Ugly, but reliable, and 
% therefore elegant?
%
\ExecuteOptions{letterpaper}
%
\DeclareOption{legalpaper}{\def\RM@papertype{2}
	\setlength\paperheight {14in}
    \setlength\paperwidth  {8.5in}
    }
\DeclareOption{executivepaper}{\def\RM@papertype{3}
	\setlength\paperheight {10.5in}
    \setlength\paperwidth  {7.25in}
    }
\DeclareOption{a4paper}{\def\RM@papertype{14}
	\setlength\paperheight{297mm}
	\setlength\paperwidth{210mm}
	}
\DeclareOption{a5paper}{\def\RM@papertype{15}
	\setlength\paperheight{210mm}
    \setlength\paperwidth{148mm}
    }
\DeclareOption{b5paper}{\def\RM@papertype{35}
	\setlength\paperheight{250mm}
    \setlength\paperwidth{176mm}
    }
\DeclareOption{c6paper}{\def\RM@papertype{56}
	\setlength\paperheight{162mm}
	\setlength\paperwidth{114mm}
	}
\DeclareOption{dlpaper}{\def\RM@papertype{58}% Ordinary envelopes
    \setlength\paperheight{220mm}
    \setlength\paperwidth{110mm}
    }
\DeclareOption{no10envelopepaper}{\def\RM@papertype{66}% Ordinary US envelopes
    \setlength\paperheight{9.5in}
    \setlength\paperwidth{4.12in}
    }
% long paper type numbers:
%
% 0 = not long (or 1)
% 1 = 7/8  2 = 3/4  3 = 2/3  4 = 5/8  5 = 1/2 
% 6 = 3/8  7 = 1/3  8 = 1/4  9 = 1/8
%
% long paper options in rmplocal.cfg
%
% These options can be executed before or after the load<fount> 
% options; they'll over-ride the `loose' request of the loadfount options 
% whichever way.
\DeclareOption{tight}{\def\RM@looseoption{0}}
\DeclareOption{looseish}{\def\RM@looseoption{1}}
\DeclareOption{loose}{\def\RM@looseoption{2}}
\DeclareOption{looser}{\def\RM@looseoption{3}}
\DeclareOption{loosest}{\def\RM@looseoption{4}}
\DeclareOption{sloppyish}{\def\RM@looseoption{5}}
%
\DeclareOption{shortest}{\RM@lengthoption=3}
\DeclareOption{shorter}{\RM@lengthoption=6}
\DeclareOption{short}{\RM@lengthoption=9}
\DeclareOption{shortish}{\RM@lengthoption=12}
\DeclareOption{normallength}{\RM@lengthoption=15}
\DeclareOption{longish}{\RM@lengthoption=18}
\DeclareOption{long}{\RM@lengthoption=21}
\DeclareOption{longer}{\RM@lengthoption=24}
\DeclareOption{longest}{\RM@lengthoption=27}
%
% Note that the touch length options need to be executed after the 
% main length options; one way of doing this is to ensure that the 
% touch options are declared after the main options, and that 
% \ProcessOptions is used rather than \ProcessOptions*
%
% The touchlength options are in rmplocal.cfg now.  The fulllength 
% and stdlength options must be executed after the touchlength options.
%
% And odd length options---fulllength and stdlength---need to be 
% executed after the touchlength options, so bung them in the 
% configuration file.  This isn't a nice way of doing it, but it'll 
% work. 
%
%
% Headsep is scaled by option
%
\DeclareOption{leastheadsep}{\RM@headsepoption=3}
\DeclareOption{lessheadsep}{\RM@headsepoption=6}
\DeclareOption{lessishheadsep}{\RM@headsepoption=9}
\DeclareOption{normalheadsep}{\RM@headsepoption=12}
\DeclareOption{moreishheadsep}{\RM@headsepoption=15}
\DeclareOption{moreheadsep}{\RM@headsepoption=18}
\DeclareOption{mostheadsep}{\RM@headsepoption=21}
%
% Footskip is scaled by option
%
\DeclareOption{leastfootskip}{\RM@footskipoption=3}
\DeclareOption{lessfootskip}{\RM@footskipoption=6}
\DeclareOption{lessishfootskip}{\RM@footskipoption=9}
\DeclareOption{normalfootskip}{\RM@footskipoption=12}
\DeclareOption{moreishfootskip}{\RM@footskipoption=15}
\DeclareOption{morefootskip}{\RM@footskipoption=18}
\DeclareOption{mostfootskip}{\RM@footskipoption=21}
%
% The marginpar setting options are now in rmplocal.cfg
%
% \columnsep is scaled by option.
% 
\DeclareOption{leastcolsep}{\RM@columnsepoption=3}
\DeclareOption{lesscolsep}{\RM@columnsepoption=6}
\DeclareOption{lessishcolsep}{\RM@columnsepoption=9}
\DeclareOption{normalcolsep}{\RM@columnsepoption=12}
\DeclareOption{moreishcolsep}{\RM@columnsepoption=15}
\DeclareOption{morecolsep}{\RM@columnsepoption=18}
\DeclareOption{mostcolsep}{\RM@columnsepoption=21}
%
% The touch options below need to be executed after their corresponding 
% main options (sort of thing).  Keeping these declarations after the 
% corresponding main declarations, and using \ProcessOptions rather than 
% \ProcessOptions* does this rather neatly.
% 
% The touch colsep, mparsep, footskip, and headsep options are now in 
% rmplocal.cfg
%
% If \RM@adaptivecolseptrue, then \columnsep is set to be a fraction 
% of the number of points per character.  This isn't always 
% appropriate, and the flag is set to false by default.
%
\DeclareOption{adaptivecolsep}{\RM@adaptivecolseptrue}
\DeclareOption{noadaptivecolsep}{\RM@adaptivecolsepfalse}
%
% Note that the width option setting options need to be executed in 
% the order they are declared here: so that you can increment or 
% decrement narrowest---widest; but stdwidth, half and one inchmargins, 
% and fullwidth are all fixed options.
%
% One easy way of ensuring this is to keep these options declared in 
% this order and use \ProcessOptions rather than \ProcessOptions*
%
\DeclareOption{widest}{\RM@widthoption=26}
\DeclareOption{wider}{\RM@widthoption=23}
\DeclareOption{wide}{\RM@widthoption=20}
\DeclareOption{widish}{\RM@widthoption=17}
\DeclareOption{normalwidth}{\RM@widthoption=14}
\DeclareOption{narrowish}{\RM@widthoption=11}
\DeclareOption{narrow}{\RM@widthoption=8}
\DeclareOption{narrower}{\RM@widthoption=5}
\DeclareOption{narrowest}{\RM@widthoption=2}
%
% The touchwidth options are in rmplocal.cfg now.
%
\DeclareOption{stdwidth}{\RM@widthoption=32}
\DeclareOption{halfinchmargins}{\RM@widthoption=31}
\DeclareOption{oneinchmargins}{\RM@widthoption=30}
\DeclareOption{fullwidth}{\RM@widthoption=29}
%
% Left/right positioning.
%
\DeclareOption{twoside}{\RM@twosidetrue\@mparswitchtrue}% Hmm.  Is this wise?
\DeclareOption{oneside}{\RM@twosidefalse}
\DeclareOption{centre}{\RM@centretrue}
\DeclareOption{notcentre}{\RM@centrefalse}
%
% stdmargins: large margin outside, small margin inside.
% notdstdmargins: large margin inside, small margin outside.
%
\DeclareOption{stdmargins}{\RM@stdmarginstrue}
\DeclareOption{notstdmargins}{\RM@stdmarginsfalse}
%
% The offset options don't do anything if the centre option has been 
% specified.
% 
\DeclareOption{leastoffset}{\RM@offsetoption=2}
\DeclareOption{lessoffset}{\RM@offsetoption=5}
\DeclareOption{lessishoffset}{\RM@offsetoption=8}
\DeclareOption{normaloffset}{\RM@offsetoption=11}
\DeclareOption{moreishoffset}{\RM@offsetoption=14}
\DeclareOption{moreoffset}{\RM@offsetoption=17}
\DeclareOption{mostoffset}{\RM@offsetoption=20}
%
% The touchoffset options must be executed after the offset options.  
% This is easy to arrange: just declare the options in this order, and 
% use \ProcessOptions rather than \ProcessOptions* (that is, these 
% options must be processed in the order of declaration, rather than 
% the order given in the calling commands).
%
% The touch offset options are in the config file now.
%
% Note that the standard classes set the \@twocolumn flag.  rmpage 
% doesn't, but it now needs to see it to decide which typesetting 
% looseness to set if you've asked for twocolumn and loaded a 
% psfount.  See the loadfount options in the config file.
%
% The config file has onecolumnwidth...tencolumnwidth options, which 
% change \textwidth but don't change the number of columns.  You can 
% use the multicols package to do that.
\DeclareOption{onecolumn}{\def\RM@textcols{1}}
\DeclareOption{twocolumn}{\def\RM@textcols{2}}
%
%
% 0 = set width by character and paper-based widths (default)
% 1 = set width by character-based width only
% 2 = set width by paper-based width only
%
% The bothwidth option is redundant, which is a good thing because I 
% really don't like the name
\DeclareOption{bothwidthset}{\def\RM@setwidthby{0}}
\DeclareOption{characterwidthset}{\def\RM@setwidthby{1}}
\DeclareOption{paperwidthset}{\def\RM@setwidthby{2}}
%
\DeclareOption{portrait}{\RM@portraittrue}
\DeclareOption{landscape}{\RM@portraitfalse}
%
\DeclareOption{noheaders}{\RM@headersfalse}
\DeclareOption{headers}{\RM@headerstrue}
\DeclareOption{nofooters}{\RM@footersfalse}
\DeclareOption{footers}{\RM@footerstrue}
%
\DeclareOption{highest}{\RM@headfootbalance=0}% 0/8
\DeclareOption{higher}{\RM@headfootbalance=3}% 1/8
\DeclareOption{high}{\RM@headfootbalance=6}% 2/8
\DeclareOption{highish}{\RM@headfootbalance=9}% 3/8
\DeclareOption{normalaltitude}{\RM@headfootbalance=12}% 4/8  
\DeclareOption{lowish}{\RM@headfootbalance=15}% 5/8
\DeclareOption{low}{\RM@headfootbalance=18}% 6/8
\DeclareOption{lower}{\RM@headfootbalance=21}% 7/8
\DeclareOption{lowest}{\RM@headfootbalance=24}% 8/8
%
% These touch options must be executed after the altitude options 
% above; one easy way is to declare the touch options after the 
% straight altitude options and use \ProcessOptions, not 
% \ProcessOptions*
%
% nice/othernicedate date are in rmplocal.cfg now.
%
\DeclareOption{usdate}{\RM@nicedatefalse}
\DeclareOption{ukdate}{\RM@nicedatetrue}
%
% The option to load founts and set textwidth by fount size are now 
% in rmplocal.cfg
%
% Printer types were:
% 0=fullbleed, 1=general, 2=dw520, 3=dw600, 4=pessimistic
%
% all printer options are now in rmplocal.cfg
%
% Printer types are:
% 0=fullbleed, 1=general, 2=pessimistic, 3=optimistic
% 10=dw300     11=dw500  12=dw600  (HP deskwriter inkjet series)
% 20=lj2       21=lj3    22=lj4    (HP laserjet laser printer series)
% 30=canonbjx bubblejet something  (Canon bubblejet inkjet series)
% 40+ whatever else comes up
%
% The figures for all these printers are guesses, except for the DW500 
% (from the manual) and the DW600 and lj4 (measured): I'd very much 
% appreciate it if you could send me any information on the non-printing 
% margins for any other printers.  I can use information on printing 
% limits at the top, bottom, left, and right for portrait and landscape 
% modes, and whether the data is what the book says or what you measured 
% (preferrably both, but anything'll help).  If anyone really uses LaTeX 
% with an A3 printer, do tell: it's something I've been wondering about.
% 
%
%
% \RM@ifbeton=3 is pristine value; 1=beton loaded, neither beton nor 
% nobeton specified.
%
\DeclareOption{beton}{
	\ifnum\RM@ifbeton=3
		\def\RM@ifbeton{2}
	\else
		\RM@Error{You've specified both the beton and nobeton 
			options;\MessageBreak make up your mind!}
			{Remove one or both of the beton and
				nobeton options to rmpage}
	\fi
}
%
\DeclareOption{nobeton}{
	\ifnum\RM@ifbeton=3
		\def\RM@ifbeton{4}
	\else
		\RM@Error{You've specified both the beton and nobeton 
			options;\MessageBreak make up your mind!}
			{Remove one or both of the beton and
				nobeton options to rmpage}
	\fi
}
%
%%
%%
%%    \subsection{Load config file}
%%
% Once upon a time, the config files had sensible names.  Then the 
% evil Bill Gates came along and chopped their legs off, leaving them 
% bleeding to death in the dust. Bill skipped off down the road, 
% cackling with delight at his own cruelty.  Alas, there was no saving 
% these poor mutilated wretches, but I created some new file names 
% that I dislike but work with the crippled `operating system' most 
% personal computers are equipped with.
%
% Load the config file here, because it can have option declarations.
%
% Configuration file handling: load one of the following files, searched 
% in this order: the file jobname.rmp, the file specified by 
% \RMconfigfile (rmplocal.cfg by default), or rmpgen.cfg.  rmplocal.cfg 
% is the local config file, based on my one.  rmpgen.cfg is a config 
% file with all options defined, based on my rmplocal.cfg.  If you want 
% to change the default first config file, you must 
% \newcommand{\RMconfigfile}{<filename>} in the preamble of your 
% document, \emph{before} loading rmpage.
%
% rmplocal.cfg is the one I'm working on, not for general release. 
% rmpgen.cfg and rmplocal.gfc are derived from it, the first with all 
% options enabled, the second with some commented out.  The idea is 
% that users modify rmplocal.gfc to produce their own rmplocal.cfg, 
% but keep rmpgen.cfg unmolested so any document using rmpage can 
% specify it by saying \newcommand{\RMconfigfile}{rmpgen.cfg} in the 
% preamble.
%
% The idea is that you can write a document using your local config 
% file, and if you want to send it to someone else, specify:
% \newcommand{\RMconfigfile}{rmpgen.cfg} in your preamble 
% before loading rmpage.sty.  If the document is okay after that, 
% no further changes are needed.  Or you could provide a config file 
% for one document: say you have a document called zarvox.tex; if you 
% provide a config file called zarvox.rmp, that will be loaded by 
% rmpage as the config file for zarvox.tex only.
%
% The multi-pronged approach might be over-the-top, but then again, it 
% might not.  I suspect just having rmplocal.cfg and rmpgen.cfg 
% might be sufficient.
%
%
\InputIfFileExists{\jobname.rmp}{}{
	\InputIfFileExists{\RMconfigfile.cfg}{}{
		\InputIfFileExists{\RMconfigfile}{}{
			\InputIfFileExists{rmpgen.cfg}{}{
				\RM@oclwarninfo{3}%
					{Can't find file \jobname.rmp, file \RMconfigfile.cfg,\MessageBreak
						file \RMconfigfile, or\MessageBreak
						file rmpgen.cfg.\MessageBreak
						Carrying on without	a configuration file;\MessageBreak
						some things might not work properly.
					}
				\ExecuteOptions{notstdmargins}% Is this still needed?
			}
		}
	}
}
%
% Only worry about unknown options after loading the config file
% Used to not complain about unused option if using rmcv.  Scrapped 
% this behaviour: it's a messy way of doing things.
%
% I could just drop this statement altogether, but it's been here a 
% while and I like it.
%
\DeclareOption*{
		\RM@Warn{I don't know about the `\CurrentOption' option.}
}
% Process options in the order of declaration, rather than the order of 
% calling.  That way, the various touch options don't need fiddling 
% with.
%
\RM@executehook{RM@BeforeProcessOptions}

\RM@donewithoptionstrue
\ProcessOptions
%
%%
%%
%%    \section{Deal with paper sizes}
%%             =====================
%%
% First, deal with long paper sizes.  Note that this code must come 
% \emph{before} the code to ensure landscape/portrait orientation.  
% And that code to ensure landscape/portrait orientation \emph{must} 
% come after this, because this code first ensures portrait 
% orientation, then divides down from that.  Well \emph{I} know what I 
% mean\ldots
%
\RM@ocl{1}
	{\typeout{Base paper dimensions:}
	\RM@ttval{\paperheight}
	\RM@ttval{\paperwidth}
	}{}
%
% ensure portrait orientation; this must be done so the 
% \RM@portlandinvert flag below can be set correctly.
\ifnum\paperheight<\paperwidth
	\@tempdima=\paperwidth
	\paperwidth=\paperheight
	\paperheight=\@tempdima
\fi
%
\ifcase\RM@longpapertype
	\relax%                           0 = do nothing
	\or\paperheight=0.8750\paperheight% 1 = 7/8
	\or\paperheight=0.7500\paperheight% 2 = 3/4
	\or\paperheight=0.6667\paperheight% 3 = 2/3
	\or\paperheight=0.6250\paperheight% 4 = 5/8
	\or\paperheight=0.5000\paperheight% 5 = 1/2
	\or\paperheight=0.3750\paperheight% 6 = 3/8
	\or\paperheight=0.3333\paperheight% 7 = 1/3
	\or\paperheight=0.2500\paperheight% 8 = 1/4
	\or\paperheight=0.1250\paperheight% 9 = 1/8
\else
	\RM@Error{rmpage has a bug}{A long paper option has been 
	specified\MessageBreak that I don't recognise.  Bad karma: get me fixed!}
\fi
%
% If \RM@portlandinverttrue, then the portrait/landscape orientation 
% of the paper has been switched (ish).  Like, if you've got A4 
% portrait, keep the paper that way up, and chop it into four bits to 
% get 1/4 A4, the 1/4 A4 sheets are looking at you landscape way 
% round, man.  What a rotten explanation.
%
% For this to work, portrait orientation must have been forced before 
% the long size \paperheight reduction code immediately above.  
% Portrait/landscape is set to the user's preference below.
%
\relax
\ifdim\paperheight<\paperwidth
	\RM@portlandinverttrue
\else
	\RM@portlandinvertfalse
\fi
%
%
% Ensure that portrait and landscape really mean portrait and 
% landscape...  This code was added because of the paper size 
% definitions above; the standard classes normally deal with this.
%
\ifRM@portrait
	\ifdim\paperwidth>\paperheight
		\@tempdima=\paperwidth
		\paperwidth=\paperheight
		\paperheight=\@tempdima
	\fi% endifdim
\else %if landscape
	\ifdim\paperheight>\paperwidth
		\@tempdima=\paperwidth
		\paperwidth=\paperheight
		\paperheight=\@tempdima
	\fi% endifdim
\fi% endifRM@portrait
%
% The final values of the paper dimensions are now set.  If user code 
% changes them, the initial values should be reported.  The final 
% values are reported at the end along with everything else.
%
%%
%%
%%    \section{Deal with RM type sizes and PS founts etc}
%%             =========================================
%%
% This code below requests tight as the default typesetting tightness.  
% Not having tight in the default options lists above means that the 
% loadfount options can be over-ridden by tight/loose/.../loosest 
% options.  If \RM@looseoption has not been set by anything, it is set 
% to tight.  The tight/loose/.../loosest options set \RM@looseoption to 
% the specified value; and loadpsfount sets \RM@looseoption=2 (loose) 
% only if \RM@looseoption=205 (the initial value).  So tight etc.  
% option can over-ride loadpsfount, but not vice-versa.  This works 
% whether tight/loosest comes before or after loadpsfount in the options 
% list.
%
% Note that loadpsfounts sets \RM@looseoption=5 (sloppy) if you've 
% asked for two column typesetting and no other looseness.  This is 
% *not* done if you've asked for a multiple column width.  The 
% multicol package makes its own arrangements; it might be best to 
% use the tight option if you're asking for a multiple column width.  
% This is because the \sloppiness command changes lots of typesetting 
% parameters, and it might be the case that the parameters the multicol 
% package changes are set on the assumption that all other typesetting 
% parameters have their standard values.  I don't know what the answer 
% is, I really don't.
%
% But according to Sebastian Rahtz's psnfss2e.tex, v 3.2, 1995/11/21, 
% the metrics produced by fontinst have changed since the original 
% advice was written (updated documentation would help, you 
% know---the documentation I got with fontinst in 1996 makes no 
% mention of this), so the suggestion that you should use looser 
% typesttting parameters no longer applies.  Keep the support for this 
% behaviour, but don't change the typesetting parameters?  Hmm.  But 
% my experience shows that the founts are still quite tight, and you 
% get lots more linebreak problems with the PSNFSS founts than cmr.  
% So I think the thing to do is keep some loosening of some sort.  
% Looseish appears loose enough.
%
%
\ifnum\RM@looseoption=205\def\RM@looseoption{0}\fi
%
%
% \RM@ptsize=666 if no attempt has been made to load an rmsizeN package 
% AND no call is requested in this package
%
\ifnum\RM@ptsize=666
	\else 
	\RequirePackage{rmsize\RM@ptsize}% only load if not already loaded
	\fi
%
% The various options have set their counters, which rmpage leaves 
% undisturbed until the end, where they are reported with everything 
% else.  So don't report them here.
%
%
% Load founts using standard packages if asked...
%
%
\ifRM@loadfount
	\ifcase\RM@fountfamily%
		% 0 cmr
		\RM@Warn{You don't need to loadcmr using the rmpage package}
	\or% 1 Avant Garde
		\IfFileExists{avant.sty}{\RequirePackage{avant}}{
			\RM@nofilew{Avant Garde}{avant.sty}}
	\or% 2 Bookman
		\IfFileExists{bookman.sty}{\RequirePackage{bookman}}{
			\RM@nofilew{Bookman}{bookman.sty}}
	\or% 3 Zapf Chancery
		\IfFileExists{chancery.sty}{\RequirePackage{chancery}}{
			\RM@nofilew{Zapf Chancery}{chancery.sty}}
	\or% 4 Helvetica
		\IfFileExists{helvet.sty}{\RequirePackage{helvet}}{
			\RM@nofilew{Helvetica}{helvet.sty}}
	\or% 5 New Century Schoolbook
		\IfFileExists{newcent.sty}{\RequirePackage{newcent}}{
			\RM@nofilew{New Century Schoolbook}{newcent.sty}}
	\or% 6 Palatino
		\IfFileExists{palatino.sty}{\RequirePackage{palatino}}{
			\RM@nofilew{Palatino}{palatino.sty}}
	\or% 7 Times
		\IfFileExists{times.sty}{\RequirePackage{times}}{
			\RM@nofilew{Times}{times.sty}}
	\or% 8 Utopia
		\IfFileExists{utopia.sty}{\RequirePackage{utopia}}{
			\RM@nofilew{Utopia}{utopia.sty}}
	\or% 9 Lucida casual
		\IfFileExists{lucasual.sty}{\RequirePackage{lucasual}}{
			\RM@nofilew{Lucida Casual}{lucasual.sty}}
	\or% 10 Courier
		\renewcommand{\rmdefault}{pcr}
		\RM@Warn{The loadcourier option makes the default roman 
		fount\MessageBreak Courier.  I think this is ugly and crude: 
		you might\MessageBreak be better off using the times package 
		and \protect\ttfamily}
	\or% 11 Concrete
		\IfFileExists{beton.sty}{\RequirePackage{beton}}{
			\RM@nofilew{Concrete}{beton.sty}}
	\or% 12 This fount width
		\RM@Warn{You can't load 'this fount'; stop it!}
	\or% 13 Lucida casual again
		\def\RM@fountfamily{9}% sets \RM@fountfamily to std lucasual value
		\IfFileExists{lucida-helvetica.sty}{\RequirePackage{lucida-helvetica}}{
			\RM@nofilew{Lucida Casual}{lucida-helvetica.sty}}
	\fi
\fi
%
% Code to deal with the beton package; I don't like this, but I'm not 
% TeXnical enough to write anything I feel happier with.
%
% Written to work with beton 1.3 1995/03/05
%
% See corresponding \let\@setfontsize=\RM@old@setfontsize etc just 
% before running setwidth code.
%
% beton messes about with \baselineskip, but changes it 
% \AtBeginDocument.  So a certain amount of jiggery-pokey is needed.
%
% The beton package must be loaded before rmpage.  rmpage then uses 
% the guts of beton to change baselineskip to the beton value so we 
% can set textheight properly (assuming the beton option has been 
% specified).
%
\@ifpackageloaded{beton}{
	\ifnum\RM@ifbeton=3\def\RM@ifbeton{1}\fi% beton loaded, no opt
	\ifnum\RM@ifbeton=2\def\RM@ifbeton{0}\fi% beton loaded, beton opt
	}{}
%
\ifnum\RM@ifbeton<3
	\@ifpackagewith{beton}{standard-baselineskips}
		{% if beton has been loaded with standard-baselineskips
			\RM@ocl{2}{\typeout{rmpage thinks the beton package
			has been loaded with standard-baselineskips}}{}
		}
		{% if beton has been loaded without standard-baselineskips
			\ifnum\RM@ifbeton<2
				\RM@ocl{2}{\typeout{rmpage thinks the beton package
				has been loaded without standard-baselineskips}}{}
				\ifnum\RM@ifbeton=1
					\RM@oclwarninfo{3}{You should send the beton
						 option to rmpage \MessageBreak
						if you're using the beton package. I'll
						 set \MessageBreak
						\protect\textheight\space using beton
						\protect\baselineskip\space anyway.}
				\fi%endifnum\RM@ifbeton=1
				% if beton has been loaded without standard-baselineskips
				% use beton internals to change \baselineskip,
				% after saving old size (restore after \textheight setting)
				%
				% Check this command from beton first\ldots
				\CheckCommand*{\beton@new@setfontsize}[3]
			   {\edef\@tempa{\def\noexpand\@tempb####1<#2}%
			    \@tempa>##2<##3\@nil{\def\beton@baselineskip@value{##2}}%
			    \edef\@tempa{\noexpand\@tempb\beton@baselineskip@table<#2}%
			    \@tempa><\@nil
			    \ifx\beton@baselineskip@value\@empty
			       \def\beton@baselineskip@value{#3}%
			    \fi
			    \beton@old@setfontsize{#1}{#2}\beton@baselineskip@value}
				% dun
				\let\RM@ldf@baselineskip=\f@baselineskip
				\let\RM@ldf@size=\f@size
				\let\beton@old@setfontsize=\@setfontsize% Don't bugger about
				\let\@setfontsize=\beton@new@setfontsize% unless necessary
				\normalsize
			\else
				% if beton has not been loaded, complain and do nought.
				\RM@Error{You must load beton before rmpage\MessageBreak
					if you want to use the beton option with rmpage.}
					{Either remove the beton option from
					rmpage, or\MessageBreak
					\protect\usepackage{beton} before  
					\protect\usepackage[beton]{rmpage}}
			\fi%endifnum\RM@ifbeton<2
		}
\fi% endifnum\RM@beton<3
%
% (almost) End code to deal with the beton package; see just 
% before calling width setting code
%%
%%
%%    \section{Identify class}
%%
% 0=unknown, 1=article, 2=report, 3=letter, 4=book, 5=slides, 10=ltxdoc, 
% 11=ltxguide, 19=default unknown, 20=rmcv, 21=rmletter, 22=bithesis, 
% 23=ljmueepexam, 50=foils
%
% Note that only class numbers 0-11 are defined in rmpage; 20-23 are 
% defined in the config file, using the \RM@DefineNewClasses hook.
% 
% For this code to work properly, the classes which are called loaded 
% by other classes need to be detected first, so that if you base (say) 
% bithesis on report, \RM@classtype ends up set to 22 (for bithesis), 
% rather than 2 (for report), which is what is needed.  Because 
% \RM@DefineNewClasses is executed after the standard list of classes
% below, this isn't something you normally need to think about.
%
% Of course, you can detect the loading of classes in the 
% \RMAfterProcessOptions hook if you like, or set \RM@classtype using 
% an option
%
% Execute the \RM@DefineNewClasses hook if it exists and if 
% \RM@classtype is less than 20 (that is, either a standard LaTeX 
% class or no class has been defined).  This way, you can define
% class types with options, and they won't be changed here.
%
\ifnum\RM@classtype<20
	\RM@executehook{RM@DefineNewClasses}
\fi
%
% If a class type hasn't been defined yet, try and detect one of the 
% standard classes.  \RM@SetClassType sets \RM@ClassType to the given 
% value, if \RM@classtype is below that value and the given class has 
% been loaded.
%
\ifnum\RM@classtype=0
	\RM@SetClassType{article}{1}
	\RM@SetClassType{report}{2}
	\RM@SetClassType{letter}{3}
	\RM@SetClassType{book}{4}
	\RM@SetClassType{slides}{5}
	\RM@SetClassType{ltxdoc}{10}
	\RM@SetClassType{ltxguide}{11}
	\RM@SetClassType{foils}{50}
	\RM@SetClassType{rmtest}{49}
\fi% endifnum\RM@classtype
%%
%%
%%   \subsection{Set things up for specific classes}
%%
%% Defaults:
%%
%% \def\RM@textheightgroup{0}
%% \def\RM@textwidthgroup{0}
%% \@ifundefined{@ptsize}{\def\RM@ptsizegroup{0pt}}{\edef\RM@ptsizegroup{\@ptsize}}
%%
% \RM@textheightgroup = 1 for slides class, 0 for everything else
% \RM@textwidthgroup = 0 for std classes except slides, 1 for slides, 
%                      2 for foils, and 3 for other.
% \RM@ptsizegroup = \@ptsize for std classes except slides, 
% 0=undefined
\RM@OnClassType{0}
	{\RM@Warn{I don't recognize this class;\MessageBreak
		I'll behave partly as if you asked for an article.\MessageBreak
		This behaviour is decidely iffy at the moment.}
	\def\RM@textwidthgroup{3}% value for classes using non-standard \@ptsize
	\def\RM@ptsizegroup{0}% Maybe not the right thing.
	\def\RM@classtype{19}}{}
% 1=article
% 2=report
% 3=letter
% 4=book
% 5=slides
\RM@OnClassType{5}
	{\def\RM@textheightgroup{1}% slides textheight setting
	\def\RM@textwidthgroup{1}% slides textwidth setting
	\RM@oclwarninfo{3}
		{I'm not very good with slides yet.  Good luck}}{}
%6=ltxdoc; see config file
%7=ltxguide
%20=rmcv
%21=rmletter
%22=bithesis
%23=ljmueepexam
\RM@OnClassType{49}
	{
	\def\RM@textwidthgroup{3}% rmtest textwidth setting
% 	\ifnum\@ptsize=17 \def\RM@ptsizegroup{0}\fi
% 	\ifnum\@ptsize=20 \def\RM@ptsizegroup{1}\fi
% 	\ifnum\@ptsize=25 \def\RM@ptsizegroup{2}\fi
% 	\ifnum\@ptsize=30 \def\RM@ptsizegroup{3}\fi
	\RM@oclwarninfo{3}
		{rmtest class detected, you poor fool you^^J
		Sit down and have a nice cup of tea.^^J
		There's that's better, isn't it?}
	}{}
%50=foils
\RM@OnClassType{50}
	{
	\def\RM@textwidthgroup{2}% foils textwidth setting
	\ifnum\@ptsize=17 \def\RM@ptsizegroup{0}\fi
	\ifnum\@ptsize=20 \def\RM@ptsizegroup{1}\fi
	\ifnum\@ptsize=25 \def\RM@ptsizegroup{2}\fi
	\ifnum\@ptsize=30 \def\RM@ptsizegroup{3}\fi
	\RM@oclwarninfo{3}
		{rmpage's foils class support is not well tested}
	}{}
%
% Execute \RM@AfterProcessOptions if it exists
%
\RM@executehook{RM@AfterProcessOptions}
%
% 
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%																				   %
% The following code was taken from ltoutput.dtx.  The assumption is 
% that odd pages are on the left and even pages on the right.  That way 
% you have odd and even margins arranged so the inside (or outside) 
% margins are largest.  But for some reason this assumption broke down 
% for the Excalibur manual (which ends up with odd page numbers on the 
% left).  I must investigate.
%																				   %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
% \ifRM@twoside
%        \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
%             \let\@themargin\oddsidemargin
%        \else \let\@thehead\@evenhead
%           \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
%        \fi
%      \fi 
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%
%%    \section{Deal with printer/paper specific settings}
%%
% The following code needs to be reviewed for each printer/paper size 
% combination.
%
% Begin by setting default minimum clearances; the long paper sizes 
% introduce a complication, because using ISO A or B series sizes, 
% a long size of 2/3 or less needs to be turned $90\deg$ to retain 
% its portrait/landscape sense relative to the original sheet (does 
% that make sense?).  The idea is this: if you want, say, 1/4 A4, 
% you can get it by cutting a sheet of A4 into little bits, 
% \emph{after} you've run it through the printer.  So the printer 
% printing area limits that apply to a bit of 1/4 A4 landscape are the 
% limits that apply to straight A4 portrait.
%
% So the default minimum clearances are set to be the printer's default 
% portrait clearances if you've asked for portrait printing in a 
% straight size, or landscape clearances if you've asked for landscape 
% printing in a long size.  If you've asked for a long size and 
% the \RM@portlandinvert switch has been set true, you'll get 
% portrait clearances if you've asked for landscape printing, and 
% landscape clearances if you've asked for portrait printing.
%
% Except that, in the case of long sizes above 1/2, you can only get 
% one long page on each full-size bit of paper, so the minimum 
% clearance on one side can be zero, because it's unlikely that 
% you'll be anywhere near the edge of the paper (this assumption 
% breaks down when you get to 7/8 A7, 3/4 A9, or 2/3 A10 on a DW520).
%
% I think it's right to maintain the appropriate clearance limit by 
% default if you ask for a long size which can be put many to a sheet 
% of paper, because you might want to do just that with dvidvi, and it'd 
% be a bit of a bugger if the last page in the sequence was missing a 
% bit.  If you don't agree with me, you can change this behaviour 
% using the \RM@PrinterPaperSettings hook in the config file.
% 
% Assuming that the leading edge of the paper travelling into the 
% printer is the top or left-hand edge of the typeset page, we have 
% this situation:
%
% If the paper size is 7/8, 3/4, or 2/3, and you've asked for 
% portrait printing, the minimum right clearance can be zero if 
% \RM@portlandinvert is true, and the minimum bottom clearance can be 
% zero if \RM@portlandinvert is false.
%
% If you've asked for landscape printing, the inverse situation 
% applies.
%
% But there is a certain amount of variation in paper size, and limit 
% to the accuracy with which you can cut, so I think it's appropriate 
% to set the minimum clearance to about 1 or 2mm, unless you've 
% specified fullbleedprinter.  Time for another bloody parameter, call 
% it \RM@ptrpostol (for printer position tolerance), and set it for each 
% printer.  This is added to the minclearance parameters after they 
% have been set (after the \RM@PrintPaperSettings hook's been 
% executed), so there's plenty of scope for setting it to whatever 
% you like.
%
% It's okay, I'm confused too.
%
% And if you don't like this behaviour, you can over-ride it for any 
% given paper size and printer combination in your config file.  Good, 
% innit?
%
\ifRM@portrait
	\ifRM@portlandinvert
		\@tempswafalse
	\else
		\@tempswatrue
	\fi
\else
	\ifRM@portlandinvert
		\@tempswatrue
	\else
		\@tempswafalse
	\fi
\fi
%
%
% Set portrait printer clearance settings (yech)
% if (\RM@portrait and not \RM@portlandinvert) 
% or (not \RM@portrait and \RM@portlandinvert).
%
% Set landscape printer clearance settings
% if (\RM@portrait and \RM@portlandinvert) 
% or (not \RM@portrait and not \RM@portlandinvert).
%
% Report which kind of setting's begin used, because everything here's 
% a bit confusing
%
\if@tempswa
	\RM@ocl{1}{\typeout{Portrait printing clearance settings}}{}
	\let\RM@minrightclearance\RM@ptrrportclear
	\let\RM@minleftclearance\RM@ptrlportclear     
	\let\RM@minfootclearance\RM@ptrbportclear
	\let\RM@minheadclearance\RM@ptrtportclear
\else
	\RM@ocl{1}{\typeout{Landscape printing clearance settings}}{}
	\let\RM@minrightclearance\RM@ptrrlandclear
	\let\RM@minleftclearance\RM@ptrllandclear    
	\let\RM@minfootclearance\RM@ptrblandclear
	\let\RM@minheadclearance\RM@ptrtlandclear
\fi
%
% Then set one clearance to 0pt if you've asked for 7/8, 3/4, 
% or 2/3 long paper; report again to explain what's happening.
%
\relax
\ifnum\RM@longpapertype>0
	\ifnum\RM@longpapertype<4
	\RM@ocl{1}{\typeout
			{Setting bottom page clearance to zero, because the requested 
			long\MessageBreak
			paper type fits one to a straight page}}{}
		\ifRM@portrait
			\ifRM@portlandinvert
				\def\RM@minrightclearance{0pt}
			\else
				\def\RM@minfootclearance{0pt}
			\fi% endifRM@portlandinvert
		\else
			\ifRM@portlandinvert
				\def\RM@minfootclearance{0pt}
			\else
				\def\RM@minrightclearance{0pt}
			\fi% endifRM@portlandinvert
		\fi% endifRM@portrait
	\fi% endifRM@longpapertype<4
\fi
%
%
% Note that the values of the various \RM@ptr...clear parameters that 
% are used are the ones reported at the end of the package.  
% \RM@min[head|foot]clearances are reported after inital setting and 
% at the end.  Aside from that, it's probably a good idea to report 
% the value of these various parameters before printer-specific code 
% gets the chance to screw things up: this is where debugging 
% information can be really useful.  \RM@papertype, 
% \RM@longpapertype, and \RM@portlandinvert all have their final 
% values.  If user code changes any of these, that should be reported, 
% along with the value before changing
\RM@ocl{1}
	{\typeout{Before printer specific settings}
	\RM@tval{\RM@minrightclearance}
	\RM@tval{\RM@minleftclearance}
	\RM@tval{\RM@minheadclearance}
	\RM@tval{\RM@minfootclearance}
	\RM@tval{\RM@ptrrlandclear}	
	\RM@tval{\RM@ptrrlandclear}
	\RM@tval{\RM@ptrblandclear}
	\RM@tval{\RM@ptrtlandclear}
	\RM@tval{\RM@ptrrportclear}
	\RM@tval{\RM@ptrlportclear}
	\RM@tval{\RM@ptrbportclear}
	\RM@tval{\RM@ptrtportclear}
	}{}
%
%
% It might be best to have this code in a config file?
%
%
% 
%
% Because all manner of strange things can happen to the clearances 
% above, it might be best to set the \RM@min...clearance parameters to 
% their corresponding \RM@ptr...clear values on a printer-by-printer 
% basis.
%
% But I reckon most printers are A4 printers, so I've set the 
% \RM@min..clearance parameters to their corresponding \RM@ptr...clear 
% values for any printer.  If you're printer needs something else, you 
% can set this by putting an \RM@OnPrinterType{} command in the 
% \RM@PrinterPaperSettings hook.
%
% It might also be a good idea to set \RM@jackuptrue for A3 portrait if 
% you've got an HP inkjet or similar printer with an over-large bottom 
% margin.  I've done this for DW520 printers, because I like it that 
% way.  You can of course over-ride this if you like.
%
%
% If you need to set minimum clearances for particular printer/paper 
% combinations, set them using this hook, defined in the configuration 
% file..
%
\RM@executehook{RM@PrinterPaperSettings}
%
% And finally add \RM@ptrpostol to the minclearances.  This is just a 
% fudge factor to cope with the fact that paper's not that accurately 
% cut, printers aren't perfectly accurate, and the real world wobbles 
% a bit.  The job is complicated by the fact that the 
% \RM@min...clearances are commands, not lengths.  I could define a 
% command to add to a command (ish), but that's a job for another day 
% and a major re-working of rmpage after it's settled down a bit.
%
\setlength\@tempdima{\RM@minfootclearance}
\addtolength\@tempdima{\RM@ptrpostol}
\edef\RM@minfootclearance{\the\@tempdima}
%
\setlength\@tempdima{\RM@minheadclearance}
\addtolength\@tempdima{\RM@ptrpostol}
\edef\RM@minheadclearance{\the\@tempdima}
%
\setlength\@tempdima{\RM@minrightclearance}
\addtolength\@tempdima{\RM@ptrpostol}
\edef\RM@minrightclearance{\the\@tempdima}
%
\setlength\@tempdima{\RM@minleftclearance}
\addtolength\@tempdima{\RM@ptrpostol}
\edef\RM@minleftclearance{\the\@tempdima}
%
%
% Deal with mparclearance initial value here; it's scaled later (in 
% the width setting file).  Should I report what's going on?  I 
% suspect not: see how it goes.  And \RM@ocltype won't exist soon; the 
% commented out stuff'll need changing if it's going to be kept.
%
\ifdim\RM@mparclearance=-666pt
	\setlength\RM@mparclearance{0.04706\paperwidth}
%\RM@ocltype{1}{Set short mparclearance}
\fi
\ifdim\RM@mparclearance=-667pt
	\setlength\RM@mparclearance{0.09412\paperwidth}
%\RM@ocltype{1}{Set long mparclearance}
\fi
%
\ifdim\RM@maxmparwidth=-666pt
	\setlength\RM@maxmparwidth{0.2353\paperwidth}
%\RM@ocltype{1}{Set short maxmparwidth}
\fi
\ifdim\RM@maxmparwidth=-667pt
	\setlength\RM@maxmparwidth{0.4706\paperwidth}
%\RM@ocltype{1}{Set long maxmparwidth}
\fi
%
% Check that \RM@mparclearance hasn't been set to something silly.
%
\@tempswafalse
\ifdim\RM@mparclearance<0pt
	\@tempswatrue
\fi
\ifdim\RM@mparclearance>\paperwidth
	\@tempswatrue
\fi
\if@tempswa
	\RM@Warn{\protect\RM@mparclearance has been set to a daft 
		value\MessageBreak
		\protect\RM@mparclearance\space= \the\RM@mparclearance
	}
\fi
%
% Check that \RM@maxmparwidth hasn't been set to anything daft
%
\@tempswafalse
\ifdim\RM@maxmparwidth<0pt
	\@tempswatrue
\fi
\ifdim\RM@maxmparwidth>\paperwidth
	\@tempswatrue
\fi
\if@tempswa
	\RM@Warn{\protect\RM@maxmparwidth has been set to a daft 
		value\MessageBreak
		\protect\RM@maxmparwidth\space= \the\RM@maxmparwidth
	}
\fi
%
% \RM@mparclearance and \RM@maxmparwidth now both have their initial 
% values.  Report them along with the vertical clearances just below.
%
%
% The easiest way of dealing with min[top,bot]margins is to ensure that 
% the min[head,foot]clearances are at least as big.  Final values of 
% these parameters are reported at the end, and 
% \RM@min[top|bottom]margin isn't changed by rmpage (user code should 
% report any changes), so only report \RM@min[head|foot]clearance 
% here.  But this might be confusing, so maybe report top and bottom
% margin limits one day.
%
\RM@ocl{2}
	{\typeout{Initial values:}
	\RM@tval{\RM@minheadclearance}
	\RM@tval{\RM@minfootclearance}
	\RM@ttval{\RM@maxmparwidth}
	\RM@ttval{\RM@mparclearance}
	}{}
%
\ifdim\RM@minfootclearance<\RM@minbottommargin
	\let\RM@minfootclearance\RM@minbottommargin
\fi
\ifdim\RM@minheadclearance<\RM@mintopmargin
	\let\RM@minheadclearance\RM@mintopmargin
\fi
%%
%%
%%    \section{Begin setting LaTeX's vertical layout parameters}
%%
% Set the head/foot clearance balance as a fraction of 24 (to bleh).   
% e.g., \@hfb= 18 gives: 0.75\@thfc=\thc, 0.25\@thfc=\tfc
%                        18/24           (24-18)/24
%\RM@headfootbalance=12
% This is now set by normalaltitude/high/low options.  Default is 
% normalaltitude => \headfootbalance=12
%
% \baselineskip get played around with rather a lot.  Might as well 
% report it here; who knows what might be going on?
%
\RM@ocl{1}{
	\typeout{At first use of \protect\baselineskip:}
	\RM@ttval{\baselineskip}}{}
%
% Re-define \headheight so you can fit a whole line in the headbox 
% (the standard classes leave the headbox too short!), or so that no 
% height at all is left for the header.
%
\@ifundefined{RMheadheight}{\let\RMheadheight\baselineskip}{}
\ifRM@headers
	\headheight=\RMheadheight
\else
	\headheight=0pt
	\headsep=0pt
\fi
%
% if you've asked for a page with no footers, allow no space for them.
%
\ifRM@footers
	\relax
\else
	\footskip=0pt
\fi
%    
% Multiply \headsep according to the option used...
%
%
\RM@scalebyoption{\headsep}{\RM@headsepoption}
%
% Multiply \footskip according to the option used...
% Note that \footskip is the distance to the bottom of the box containing 
% the foot, so assume that this box is one line deep, and act accordingly...
% Keep the explicit report of size before and after, because the 
% report typed by \RM@scalebyoption gives the value less \baselineskip
%
\RM@ocl{1}{
	\typeout{Initial value:}
	\RM@ttval{\footskip}
	}{}
%
\addtolength\footskip{-\baselineskip}% add this back on after the multiplication
\RM@scalebyoption{\footskip}{\RM@footskipoption}
\addtolength\footskip{\baselineskip}% added back --- see above
%
% Footskip now has its final value which isn't changed by rmpage 
% (user code from a config file might change it, and if so should 
% report before and after).  \footskip is reported at the end, so don't 
% report here.
%
%
%    Now check the limits on textheight
%    ----------------------------------
%
% \RM@[min|max]textheight...
% 
%
% Initial check for impossible values: set the two parameters to 
% values that allow rmpage to calculate a normal layout.
\RM@ocl{2}{
	\typeout{Initial values:}
	\RM@tval{\RM@maxtextheight}
	\RM@tval{\RM@mintextheight}
	}{}
%
\ifdim\RM@maxtextheight<\topskip
	\RM@Error{You've set \protect\RM@maxtextheight\space to a 
	value\MessageBreak that's too short for one line of text}
	{Try increasing it...}
\fi
%
\ifdim\RM@mintextheight>\RM@maxtextheight
	\RM@Error{You've asked for a \protect\RM@mintextheight that is 
		greater\MessageBreak than
		\protect\RM@maxtextheight}
		{You'll have to change at least one of the two before I can 
		work\MessageBreak out a layout properly.}
\fi

% The value of \RM@maxtextheight can be anything.  Before the code 
% below gets to work, it makes sense to ensure that \RM@maxtextheight 
% is no larger than what will fit on the paper, everything else 
% considered.  \RM@min[foot|head]clearances have been set to at least 
% \RM@min[top|bottom]margins
%
\setlength\@tempdima{\paperheight}
\addtolength\@tempdima{-\RM@minheadclearance}
\addtolength\@tempdima{-\RM@minfootclearance}
\addtolength\@tempdima{-\headheight}
\addtolength\@tempdima{-\headsep}
\addtolength\@tempdima{-\footskip}
%
% Initial check
\ifdim\@tempdima<0pt
	\RM@Error{The vertical printable region is too small---I 
		can't\MessageBreak calculate a valid layout}
		{Your layout parameters ask for a negative
		\protect\textheight. Major bummer.}  
\fi
%
% If \@tempdima<\topskip, there's no room for any text at all in the 
% text body.  This is not the kind of layout rmpage was meant to come 
% up with, so test for it.
%
\ifdim\@tempdima<\topskip
	\RM@Error{The vertical printable region is too small---I 
		can't\MessageBreak calculate a valid layout}
		{Your layout parameters are asking for a
		\protect\textheight\MessageBreak which is too short for
		one line of text.  Major bummer.}
\fi
%
% \@tempdima is now set to the space available for \textheight.
% Make sure that \RM@maxtextheight is no more than this:
\ifdim\RM@maxtextheight>\@tempdima
	\edef\RM@maxtextheight{\the\@tempdima}
	\RM@ocl{1}
	{\typeout{I've reduced \protect\RM@maxtextheight\space
		to fit the available space}}{}
\fi
%
% Likewise, \RM@mintextheight can be anything.  It should be greater 
% than zero, and less than \RM@maxtextheight.  Setting it to anything 
% else is daft.
\ifdim\RM@mintextheight<0pt
	\def\RM@mintextheight{0pt}
	\RM@Warn{You asked for a negative \RM@mintextheight;\MessageBreak
		I've increased it to 0pt.}
\fi
%
\ifdim\RM@mintextheight>\RM@maxtextheight
	\RM@Error{The vertical printable region is too short---I
		can't\MessageBreak make \protect\textheight\space as
		large as \protect\RM@mintextheight}
		{Either reduce \protect\RM@mintextheight, or change other 
		layout parameters to\MessageBreak increase the space available 
		for \protect\textheight.}
\fi
%%
%%
%%    \subsection{Textheight setting code begins here}
%%
% \headheight, \headsep, \footskip, \RM@mintextheight, and
% \RM@maxtextheight all have their final values by now.
%
% Define sum of clearance above and below foot and head.
%
% \textheight is set as a fraction of \paperheight so that if you are 
% typesetting in 10pt, normallength, with headers and footers, on A4 
% paper, the clearance above and below the foot and head is the same as 
% it'd be if you'd used the standard classes.  This applies to normal 
% and slides setting; the \textheights are different for each.
%
% Other length options scale this base fraction of \paperheight.
% 
% \RM@jackup should be = \RM@totalfootclearance-\RM@minfootclearance at 
% the place marked %jackup point%.  This is so the code below sets 
% vertical page parameters directly - rmpage won't let you print off 
% what it thinks the printing area is, but it's nice if you've set the 
% sizes yourself.
%
% The standard LaTeX article and report classes set \textheight like 
% this:
% (from size10.clo)
%   \setlength\@tempdima{\paperheight}
%   \addtolength\@tempdima{-2in}
%   \addtolength\@tempdima{-1.5in}
%   \divide\@tempdima\baselineskip
%   \@tempcnta=\@tempdima
%   \setlength\textheight{\@tempcnta\baselineskip}
%
%  (etc)
%
% In terms of the code below, the fixed length subtracted from 
% \paperheight, here 3.5in, is:
%
% 3.5in=\RM@totalheadfootclearance+\headheight+\headsep+\footskip+\topskip
%
% rmpage normallength setting gives the same \textheight as the standard 
% method if you're using headers and footers on A4 paper.  This isn't 
% guaranteed, because of rounding errors, but I'd be very surprised if 
% they ever really changed anything.
%
% Set \textheight in two different ways (so far): one way for slides; 
% the other for everything else.
%
% Note that \RM@textheightgroup is defined above; this code is here 
% just to show what's been done.
% 
% %Default textheight setting method is number 0
% \def\RM@textheightgroup{0}
% 
% % Slides class uses method 1 by default
% \RM@OnClassType{5}{\def\RM@textheightgroup{1}}{}
% % set things differently if you're using slides
%
% You can change the \RM@textheightgroup on a class-by-class basis 
% using \RM@OnClassType in the \RM@AfterProcessOptions hook, and you 
% can define a new textheight setting group by using 
% \RM@OnTextheightGroup{N}{<TeX code>} in the 
% \RM@BeforeTextheightSetting hook

\RM@executehook{RM@BeforeTextheightSetting}
%
% \RM@textheightgroup should now have it's final value, which it 
% retains until the end of the package.  So only report it at the end of 
% the package.
%
% The code block below has multipliers that increase \textheight by 
% about 1 line if you say touchlonger with normallength on A4; that's 
% about right, I reckon. (12.92pt to be precise).  Larger steps are 
% inappropriate, or so I think at the momemt.
%
% It's geometrical series: multiply by 1.0772 for each step---
% $\sqrt[12]{ 2.442660550}$ or thereabouts.
%
%%
%%
%%    Set base \thfc for all classes except slides
%%    ............................................
%%
\RM@OnTextheightGroup{0}{
		\ifcase\RM@lengthoption
			\setlength\RM@totalheadfootclearance{3.5in}%0=stdlength
			\ifRM@footers
				\addtolength\RM@totalheadfootclearance{-\footskip}
			\fi
			\ifRM@headers
				\addtolength\RM@totalheadfootclearance{-\headsep}
				\addtolength\RM@totalheadfootclearance{-\headheight}
				\fi
			\addtolength\RM@totalheadfootclearance{-\topskip}
		\or	\setlength\RM@totalheadfootclearance{0.6034\paperheight}%1
		\or \setlength\RM@totalheadfootclearance{0.5602\paperheight}%2
		\or \setlength\RM@totalheadfootclearance{0.5200\paperheight}%3  shortest
		\or \setlength\RM@totalheadfootclearance{0.4827\paperheight}%4
		\or \setlength\RM@totalheadfootclearance{0.4481\paperheight}%5
		\or \setlength\RM@totalheadfootclearance{0.4160\paperheight}%6  shorter
		\or \setlength\RM@totalheadfootclearance{0.3862\paperheight}%7
		\or \setlength\RM@totalheadfootclearance{0.3585\paperheight}%8
		\or \setlength\RM@totalheadfootclearance{0.3328\paperheight}%9  short
		\or \setlength\RM@totalheadfootclearance{0.3090\paperheight}%10
		\or \setlength\RM@totalheadfootclearance{0.2868\paperheight}%11
		\or \setlength\RM@totalheadfootclearance{0.2663\paperheight}%12 shortish
		\or \setlength\RM@totalheadfootclearance{0.2294\paperheight}%13
		\or \setlength\RM@totalheadfootclearance{0.2294\paperheight}%14
		\or \setlength\RM@totalheadfootclearance{0.2130\paperheight}%15 norm
		\or \setlength\RM@totalheadfootclearance{0.1977\paperheight}%16
		\or \setlength\RM@totalheadfootclearance{0.1836\paperheight}%17
		\or \setlength\RM@totalheadfootclearance{0.1704\paperheight}%18 longish
		\or \setlength\RM@totalheadfootclearance{0.1582\paperheight}%19
		\or \setlength\RM@totalheadfootclearance{0.1468\paperheight}%20
		\or \setlength\RM@totalheadfootclearance{0.1363\paperheight}%21 long
		\or \setlength\RM@totalheadfootclearance{0.1265\paperheight}%22
		\or \setlength\RM@totalheadfootclearance{0.1175\paperheight}%23
		\or \setlength\RM@totalheadfootclearance{0.1091\paperheight}%24 longer
		\or \setlength\RM@totalheadfootclearance{0.1012\paperheight}%25
		\or \setlength\RM@totalheadfootclearance{0.0940\paperheight}%26
		\or \setlength\RM@totalheadfootclearance{0.0872\paperheight}%27 longest
		\or \setlength\RM@totalheadfootclearance{0.0810\paperheight}%28
		\or \setlength\RM@totalheadfootclearance{0.0752\paperheight}%29
		\or \setlength\RM@totalheadfootclearance{0pt}%               30 fulllength
		\else
		\RM@Error{rmpage has a bug}{I don't  know what to do with
			a \protect\textheight\space setting option greater than 30}
		\fi% endifcase\RM@lengthoption
		}{}
%%
%%
%%    Set base \thfc for slides class only 
%%    ....................................
%%
\RM@OnTextheightGroup{1}{
		\ifcase\RM@lengthoption
			\setlength\RM@totalheadfootclearance{3in}%0=stdlength
			\ifRM@footers
				\addtolength\RM@totalheadfootclearance{-\footskip}
			\fi
			\ifRM@headers
				\addtolength\RM@totalheadfootclearance{-\headsep}
				\addtolength\RM@totalheadfootclearance{-\headheight}
				\fi
			\addtolength\RM@totalheadfootclearance{-\topskip}
		\or	\setlength\RM@totalheadfootclearance{0.3983\paperheight}%1
		\or \setlength\RM@totalheadfootclearance{0.3698\paperheight}%2
		\or \setlength\RM@totalheadfootclearance{0.3433\paperheight}%3  shortest
		\or \setlength\RM@totalheadfootclearance{0.3187\paperheight}%4
		\or \setlength\RM@totalheadfootclearance{0.2958\paperheight}%5
		\or \setlength\RM@totalheadfootclearance{0.2746\paperheight}%6  shorter
		\or \setlength\RM@totalheadfootclearance{0.2549\paperheight}%7
		\or \setlength\RM@totalheadfootclearance{0.2367\paperheight}%8
		\or \setlength\RM@totalheadfootclearance{0.2197\paperheight}%9  short
		\or \setlength\RM@totalheadfootclearance{0.2039\paperheight}%10
		\or \setlength\RM@totalheadfootclearance{0.1893\paperheight}%11
		\or \setlength\RM@totalheadfootclearance{0.1758\paperheight}%12 shortish
		\or \setlength\RM@totalheadfootclearance{0.1632\paperheight}%13
		\or \setlength\RM@totalheadfootclearance{0.1515\paperheight}%14
		\or \setlength\RM@totalheadfootclearance{0.1406\paperheight}%15 norm
		\or \setlength\RM@totalheadfootclearance{0.1305\paperheight}%16
		\or \setlength\RM@totalheadfootclearance{0.1212\paperheight}%17
		\or \setlength\RM@totalheadfootclearance{0.1125\paperheight}%18 longish
		\or \setlength\RM@totalheadfootclearance{0.1044\paperheight}%19
		\or \setlength\RM@totalheadfootclearance{0.0969\paperheight}%20
		\or \setlength\RM@totalheadfootclearance{0.0900\paperheight}%21 long
		\or \setlength\RM@totalheadfootclearance{0.0835\paperheight}%22
		\or \setlength\RM@totalheadfootclearance{0.0775\paperheight}%23
		\or \setlength\RM@totalheadfootclearance{0.0720\paperheight}%24 longer
		\or \setlength\RM@totalheadfootclearance{0.0668\paperheight}%25
		\or \setlength\RM@totalheadfootclearance{0.0620\paperheight}%26
		\or \setlength\RM@totalheadfootclearance{0.0576\paperheight}%27 longest
		\or \setlength\RM@totalheadfootclearance{0.0535\paperheight}%28
		\or \setlength\RM@totalheadfootclearance{0.0496\paperheight}%29
		\or \setlength\RM@totalheadfootclearance{0pt}%               30 fulllength
		\else
		\RM@Error{rmpage has a bug}{I don't  know what to do with
			a \protect\textheight\space setting option greater than 30}
		\fi% endifcase\RM@lengthoption
		}{}
%
%
% Dealing with \RM@mintextheight and \RM@maxtextheight: ensure that 
% the limits aren't exceeded here, so we can check that we're still 
% printing within the specified printing area.  Need to check that the 
% \RM@mintextheight and \RM@maxtextheight limits aren't exceeded 
% later, and check that the printing area is kept to after that.  What 
% a mess.
%
% Minimum practical \textheight >= (integer x \baselineskip) + \topskip
% Calculate this and bung it in \@tempdimb for now.
%
\setlength\@tempdimb{\RM@mintextheight}
\addtolength\@tempdimb{-\topskip}
\divide\@tempdimb by\baselineskip
\@tempcnta=\@tempdimb
\setlength\@tempdimb{\baselineskip}
\multiply\@tempdimb by\@tempcnta
\addtolength\@tempdimb{\topskip}
% \@tempdimb is now at most 1 \baselineskip less than 
% \RM@mintextheight, and is a valid value for \textheight.
% If \@tempdimb is too small, enlarge it by \baselineskip to ensure 
% that is big enough.
\ifdim\@tempdimb<\RM@mintextheight\relax
	\addtolength\@tempdimb{\baselineskip}
\fi
% Check that I've not made a mistake with the assumption above.
\ifdim\@tempdimb<\RM@mintextheight\relax
	\RM@Error{This isn't right}
		{Rowland's got it wrong again; there's a bug here}
\fi
%
% And now save this value; keep the original \RM@mintextheight 
% unchanged.
%
\edef\RM@minpractextheight{\the\@tempdimb}
%
% Now calculate the maximum \RM@totalheadfootclearance
%
\setlength\@tempdima{\paperheight}
\addtolength\@tempdima{-\headheight}
\addtolength\@tempdima{-\headsep}
\addtolength\@tempdima{-\footskip}
\addtolength\@tempdima{-\RM@minpractextheight}
%
\edef\RM@maxtotalheadfootclearance{\the\@tempdima}
%
% Now calculate \RM@maxpractextheight and 
% \RM@mintotalheadfootclearance.  Note that minthfc is the minimum 
% *practical* value, not just the minimum space left.
%
\setlength\@tempdima{\RM@maxtextheight}
\addtolength\@tempdima{-\topskip}
\divide\@tempdima by\baselineskip
\@tempcnta=\@tempdima
\setlength\@tempdima{\baselineskip}
\multiply\@tempdima by\@tempcnta
\addtolength\@tempdima{\topskip}
%
% \@tempdimb can be smaller than \RM@maxtextheight, but not larger.  
% So set \RM@maxpractextheight now
%
\edef\RM@maxpractextheight{\the\@tempdima}
%
\setlength\@tempdima{\paperheight}
\addtolength\@tempdima{-\headheight}
\addtolength\@tempdima{-\headsep}
\addtolength\@tempdima{-\footskip}
\addtolength\@tempdima{-\RM@maxpractextheight}
%
\edef\RM@mintotalheadfootclearance{\the\@tempdima}
%
% \RM@maxpractextheight,         \RM@minpractextheight         are set
% \RM@mintotalheadfootclearance, \RM@maxtotalheadfootclearance are set
%
%
% Check that the calculated values don't yield an impossible task.
%
\ifdim\RM@maxpractextheight<\RM@minpractextheight\relax
\RM@Error{I can't set \protect\textheight}
	{The \protect\textheight\space limits you've asked for make 
		me\MessageBreak
	calculate a maximum practical \protect\textheight\space that is 
		less\MessageBreak
	than the minimum practical \protect\textheight}
\fi
%
%
% Now check that \RM@totalheadfootclearance is within bounds:
%
\ifdim\RM@totalheadfootclearance<\RM@mintotalheadfootclearance\relax
	\RM@totalheadfootclearance=\RM@mintotalheadfootclearance
	\RM@oclwarninfo{3}
	{I had to increase the \protect\RM@totalheadfootclearance\space 
		to\MessageBreak 
	make \protect\textheight\space as small as
		\protect\RM@maxtextheight}
\fi
%
\ifdim\RM@totalheadfootclearance>\RM@maxtotalheadfootclearance\relax
	\RM@totalheadfootclearance=\RM@maxtotalheadfootclearance
	\RM@oclwarninfo{3}
	{I had to decrease the \protect\RM@totalheadfootclearance\space
		to\MessageBreak 
	make \protect\textheight\space as large as
		\protect\RM@mintextheight}
\fi
%
% \RM@totalheadfootclearance now has a value that should produce a 
% valid \textheight.  But we still need to check that the text will 
% appear inside the allowed printing region, so: be pure, be vigilant, 
% behave!
%
% The eventual value of \textheight cannot become larger from this 
% point onwards, so issue an error message if \textheight does 
% exceed \RM@maxtextheight at the end of things.
%
% Note that \RM@maxpractextheight and \RM@minpractextheight are legal 
% final values for \textheight; use them if need be.
%
%                
\setlength\RM@totalheadclearance{\RM@totalheadfootclearance}
\divide\RM@totalheadclearance 24\multiply\RM@totalheadclearance\RM@headfootbalance
\setlength\RM@totalfootclearance{\RM@totalheadfootclearance}
\addtolength\RM@totalfootclearance{-\RM@totalheadclearance}
%
% These clearances are reported here, again if jacked up, again if 
% reduced to fit inside limits, before \textheight is set, and after 
% \textheight is set.  I reckon that's enough.
%
\RM@ocl{2}
	{\typeout{Initially requested vertical clearances}
	\RM@ttval{\RM@totalheadclearance}
	\RM@ttval{\RM@totalfootclearance}
	\RM@ttval{\RM@totalheadfootclearance}
	}{}
%
% Jack up by \RM@minfootclearance-\RM@totalfootclearance if the flag 
% says so.  That is, keep \RM@totalheadfootclearance the same,
% but add
% \RM@minfootclearance-\RM@totalfootclearance to \RM@totalfootclearance,
% and subtract
% \RM@minfootclearance-\RM@totalfootclearance from \RM@totalheadclearance.
%
% It's more straightforward to set \RM@totalfootclearance to 
% \RM@minfootclearance, then recalculate \RM@totalheadclearance.
% Keep the calculation of the amount of lift, for information's sake.
\ifRM@jackup
	\ifdim\RM@totalfootclearance<\RM@minfootclearance \relax
		\setlength\@tempdima{\RM@minfootclearance}
		\addtolength\@tempdima{-\RM@totalfootclearance}
		\setlength\RM@totalfootclearance{\RM@minfootclearance}
		\setlength\RM@totalheadclearance{\RM@totalheadfootclearance}
		\addtolength\RM@totalheadclearance{-\RM@totalfootclearance}
		\RM@ocl{2}
			{\typeout{Raise the text area by \the\@tempdima}
			\RM@ttval{\RM@totalfootclearance}
			\RM@ttval{\RM@totalheadclearance}}
			{}
	\fi% endifdim
\fi% endifRM@jackup
%
% Once upon a time, there were weird and hideous calculations in this 
% part of the woods, but the fairy godmother waved her wand and replaced 
% them with nice friendly calculations that didn't have a tendency to 
% dress in leather trousers and consume interesting chemicals in the 
% dodgier parts of Amsterdam.  So, no more fudge, not even chocolate 
% fudge cake, no matter how bad the munchies.
% 
% Hweever, rounding errors were discovered then and might be a problem 
% even now.  The old code had typical deviations of 0.001pt.  I reckon 
% that small errors can be ignored, and I'll define small as less than 
% 1/3 of an output pixel.  This is 0.08pt at 300dpi, or 0.02pt at 
% 1200dpi.  So 0.01pt is negligible, and ten times larger than likely 
% rounding errors.  (0.01pt is about 3.5 microns, or less than ten 
% wavelengths of visible light).  This becomes relevant later on.
%%
%%
%%    Make sure the text will fit on the page
%%    .......................................
%%
\ifdim\RM@totalfootclearance<\RM@minfootclearance% was <\@tempdima
	\ifnum\RM@lengthoption=30
		\else% if \RM@lengthoption <> fulllength; don't warn if fulllength.
	    \RM@oclwarninfo{3}
		    {To keep inside the specified printing limits,\MessageBreak
	        I will have to increase the clearance between
		        the\MessageBreak
	        bottom of the last text and the bottom of the\MessageBreak
	        paper. If you are not using footers, you might\MessageBreak
	        try using the nofooter option\MessageBreak
	        \the\RM@totalfootclearance \space=
		        calculated clearance\MessageBreak
	        \RM@minfootclearance \space= allowed clearance}
	    \fi% endifnum\RM@lengthoption=30
    \setlength\@tempdima{\RM@minfootclearance}
    \addtolength\@tempdima{-\RM@totalfootclearance}
    \addtolength\RM@totalfootclearance{\@tempdima}
    \addtolength\RM@totalheadfootclearance{\@tempdima}
    \fi% end\ifdim\RM@totalfootclearance<\RM@minfootclearance
%
\ifdim\RM@totalheadclearance<\RM@minheadclearance% was <\@tempdima
	\ifnum\RM@lengthoption=30
		\else% if \RM@lengthoption <> fulllength; don't warn if fulllength.
	    \RM@oclwarninfo{3}{%
		    To keep inside the specified printing limits,\MessageBreak
	        I will have to increase the clearance between
		        the\MessageBreak
	        top of the first text and the top of the \MessageBreak
	        paper. If you are not using headers, you\MessageBreak
	        might try using the noheader option\MessageBreak
	        \the\RM@totalheadclearance\space=
		        calculated clearance\MessageBreak
	        \RM@minheadclearance\space= allowed clearance}
	    \fi
    \setlength\@tempdima{\RM@minheadclearance}
    \addtolength\@tempdima{-\RM@totalheadclearance}
    \addtolength\RM@totalheadclearance{\@tempdima}
    \addtolength\RM@totalheadfootclearance{\@tempdima}
    \fi
%
% Now then, \RM@totalheadfootclearance might have been enlarged by now, 
% to keep inside the specified printing limits.  If 
% \RM@totalheadfootclearance is larger than 
% \RM@maxtotalheadfootclearance, I can't set \textheight to a value 
% large enough for \RM@mintextheight.   But rounding errors are a 
% possibility...  Deal with them like this:
%
% If thfc is too large (ie textheight will be smaller than mintextheight),
% produce an error, unless the amount by which it is too large is 
% less than 0.01pt (assumed maximum rounding error), in which case thfc will 
% be set to minthfc.
%
\relax
\ifdim\RM@totalheadfootclearance>\RM@maxtotalheadfootclearance\relax
	\setlength\@tempdima{\RM@totalheadfootclearance}
	\addtolength\@tempdima{-\RM@maxtotalheadfootclearance}
	\addtolength\@tempdima{-0.01pt}
	\relax
	\ifdim\@tempdima>0pt
		\RM@Error{I can't set \protect\textheight\space large enough}
		{\protect\RM@mintextheight is too large for the printing 
			clearances\MessageBreak
		and vertical options you have requested on this paper.}
	\else
	\RM@ocl{1}
		{\tyopeout{Fudged thfc to maxthfc}
		\RM@ttval{\RM@totalheadfootclearance}
		\RM@ttval{\RM@maxtotalheadfootclearance}
		}{}
	\setlength\RM@totalheadfootclearance{\RM@maxtotalheadfootclearance}
	\fi
\fi
%
% If thfc is too small (ie textheight will be larger than maxtextheight),
% produce an error, unless the amount by which it is too small is 
% less than 0.01pt (assumed maximum rounding error), in which case thfc will 
% be set to maxthfc.
%
\relax
\ifdim\RM@totalheadfootclearance<\RM@mintotalheadfootclearance\relax
	\setlength\@tempdima{\RM@totalheadfootclearance}
	\addtolength\@tempdima{-\RM@mintotalheadfootclearance}
	\addtolength\@tempdima{+0.01pt}
	\relax
	\ifdim\@tempdima<0pt
		\RM@Error{I can't set \protect\textheight\space small
			enough\MessageBreak	This can't happen!}
		{\protect\RM@maxtextheight\space is too small for the printing 
			clearances\MessageBreak
		and vertical options you have requested on this paper.}
	\else
	\RM@ocl{1}
		{\typeout{Fudged thfc to minthfc}
		\RM@ttval{\RM@totalheadfootclearance}
		\RM@ttval{\RM@mintotalheadfootclearance}
		}{}
	\setlength\RM@totalheadfootclearance{\RM@mintotalheadfootclearance}
	\fi
\fi
%
% And now recalculate \RM@totalheadclearance, and check for 
% significant rounding errors...
%
\setlength\@tempdima{\RM@totalheadfootclearance}
\addtolength\@tempdima{-\RM@totalfootclearance}
\setlength\@tempdimb{\@tempdima}
\addtolength\@tempdimb{-\RM@totalheadclearance}
\ifdim\@tempdimb<0pt
	\setlength{\@tempdimb}{-\@tempdimb}
\fi
\ifdim\@tempdimb>0.02pt
	\RM@Error{Houston, we have a problem}
		{I've come across significant rounding errors in my 
		calculations.\MessageBreak
		I'm not sure \protect\textheight\space will be set well.}
\fi
\setlength\RM@totalheadclearance\@tempdima
%
% By now, the totalhead/foot/headfootclearances should be set 
% correctly.  \RM@totalheadclearance is allowed to be as much as 
% 0.02pt too large; \RM@totalheadfootclearance should be set to 
% a value that yields as valid \textheight directly, if it has been 
% limited by \RM@mintextheight or \RM@maxtextheight.
%

%
%%
%%
%%    Now calculate \textheight
%%    .........................
%%
%                                                                           
%  What this code does is set \textheight to 
% 
% the (nearest lower):                                                    
% (integer) x \baselineskip + \topskip, and then changes                  
% \RM@totalheadfootclearance so that:                                     
%                                                                           
% \paperheight=                                                           
%  \footskip+\textheight+\headsep+\headheight+\totalheadfootclearance
%
% is still true                                                                                                                                     
%
\RM@ocl{2}
	{\typeout{Before calculating \protect\textheight}
	\RM@ttval{\RM@totalfootclearance}
	\RM@ttval{\RM@totalheadclearance}
	\RM@ttval{\RM@totalheadfootclearance}}
	{}
%
% Note that the code from here onward does not affect:
% footskip, \headsep, \headheight, \topskip, \RM@mintextheight, 
% \RM@maxtextheight, or \paperheight.  If the beton option has been 
% specified, \baselineskip will be reset to the value it had on 
% entering rmpage.
%
\setlength\@tempdima{\paperheight}
\addtolength\@tempdima{-\RM@totalheadfootclearance}
\addtolength\@tempdima{-\footskip}
\addtolength\@tempdima{-\headsep}
\addtolength\@tempdima{-\headheight}
%
%  It should not be possible for \@tempdima to exceed the bounds 
% defined by \RM@maxtextheight and \RM@mintextheight.  Check, and 
% issue an error if this has happened.
%
\ifdim\@tempdima>\RM@maxtextheight
	\RM@Error{Something's wrong with \protect\textheight setting}
	{The initial \protect\textheight\space guess is larger than 
	\protect\RM@maxtextheight.  This shouldn't be possible.}
\fi
%
\ifdim\@tempdima<\RM@mintextheight
	\RM@Error{Something's wrong with \protect\textheight setting}
	{The initial \protect\textheight\space guess is smaller than 
	\protect\RM@mintextheight.  This shouldn't be possible.}
\fi
%
% I think this intermediate value might be interesting at times
%
\RM@ocl{1}{
	\typeout{First stab at \protect\textheight\space= \the\@tempdima}
	}{}
%
% \@tempdima is now set to what I'd like \textheight to be,
% but we need \textheight = (integer) x \baselineskip + \topskip
%
\addtolength\@tempdima{-\topskip}
%
% \@tempdima is now originally requested \textheight - \topskip
%
\setlength\@tempdimb{\@tempdima}
\divide\@tempdima\baselineskip
\@tempcnta=\@tempdima
\setlength\@tempdima{\@tempdimb}
%
% \@tempcnta is now the integer referred to above; and \@tempdima is 
% \textheight-\topskip.
%
\setlength\textheight{\@tempcnta\baselineskip}
\addtolength\textheight{\topskip}
%
% But check that \textheight isn't too small; it used to be the case 
% that \textheight might be one \baselineskip too small at this point.  
% This should never happen now, but check anyway and issue an error if 
% it has.
%
\ifdim\textheight<\RM@mintextheight\relax
	\RM@Error{\protect\textheight's got no business being this small}
		{Yet another bug needs fixing}
\fi
%
\RM@ocl{2}
	{\typeout{\protect\textheight\space is:}
	\typeout{\space\space\space\the\@tempcnta\space x
	\the\baselineskip\space+ \the\topskip\space= \the\textheight}
	}{}
%
% The number of text lines is (integer) + 1
%
% \textheight is now (integer) x \baselineskip + \topskip
%
% Now I need to re-calculate \RM@thfc; it needs to be increase by the 
% difference between the originally requested \textheight and the one 
% I'm really going to use...
%
% The easiest way to find out what the originally requested 
% \textheight was is to add \topskip to \@tempdima
%
\addtolength\@tempdima{\topskip}
%
% And to get the difference between the originally requested \textheight 
% and the `real' one, just subtract the real one from \@tempdima (the 
% original request).  This will give me a positive length (which is 
% tested for: if the length's not positive, something's wrong), which I 
% can add to \RM@thfc to increase the head and foot clearance to cope 
% with \textheight being smaller than it was, sort of thing.
%
\addtolength\@tempdima{-\textheight}
\ifdim\@tempdima<0pt
	\RM@Error{This can't happen; something's wrong}
	{Hah!  It has!  rmpage has a bug; get Rowland to fix it.}
\fi
% \@tempdima is the amount by which textheight has shrunk
\addtolength\RM@totalheadfootclearance{\@tempdima}
% Increase \thc and \tfh proportionally to match:
\setlength\@tempdimb{\@tempdima}
\divide\@tempdimb 24\multiply\@tempdimb\RM@headfootbalance
% \@tempdimb is the amount by which the top space should increase
\addtolength\RM@totalheadclearance{\@tempdimb}
\addtolength\@tempdima{\@tempdimb}
% \@tempdima:= \@tempdima - \@tempdimb;
% the amount by which the bottom space should increase
\addtolength\RM@totalfootclearance{\@tempdima}
%
% So \textheight and footer/header clearances are now set.
% All I need to do now is define \topmargin.
%
\setlength\topmargin{\RM@totalheadclearance}
\addtolength\topmargin{-1in}
%
%
%%
%%
%%     \section{Change horizontal page parameters}
%%
% The code to set horizontal layout parameters derives from 
% rmpwnorm.pko v0.60.
%
% 0=unknown, 1=art, 2=rep, 3=lett, 4=book, 5=slides, 10=ltxdoc, 
% 11=ltxguide, 20=rmcv, 21=rmletter, 22=bithesis, 23=ljmueepexam
% %
% % All classes so far except slides use rat-setwidth-norm.pko to set 
% % horizontal parameters.  At least that used to be the name; I've 
% % changed it to rmpwnorm.pko because of the malign influence of the 
% % evil Bill Gates and his pernicious Microsoft DOS.
% % (RMPageWidthNORMal.PacKageOption).
% %
% % Retired rmpwslid.pko; rmpwnorm.pko now deals with slides as well.  
% % Perhaps I should now include the width-setting code in rmpage 
% % itself?  Think on it.
% %
% \providecommand*{\RM@widthsetter}{rmpwnorm.pko}
% %
% % All sort of obsolete comments lurk below.
% % % The slides class uses rat-setwidth-slides.pko to set horizontal 
% % % parameters.  Almost: now using rmpwslid.pko because of That Man 
% % % Who's Name Shall Not Be Spoken Lest The Piles of a Thousand 
% % % Pensioners Afflict Thy Backside (TMWNSNBSLTPTPATB.  Good acronym, 
% % % eh?)
% % %
% % % % TEMPORARILY STOPPED USED RSW-SLIDES FOR SLIDE WIDTH SETTING.
% % % % USE IT AGAIN WHEN RSW-NORM IS STABLE AND CAN BE USED AS THE BASIS 
% % % % FOR A NEW VERSION OF RSW-SLIDES.
% % % %
% % % \RM@OnClassType{5}{\def\@ptsize{2}}{}% bodge to get rsw-norm to work 
% % %                                      with slides class
% % \RM@OnClassType{5}{\def\RM@widthsetter{rmpwslid.pko}}{}
% %
% % Execute hook if it exists; this one's so you can ask for any width 
% % setting file you like.
%
%%
%%
%%    \subsection{Pre width setting: hook and checks}
%%
\RM@executehook{RM@BeforeWidthSetting}
%
% Check that \RM@mintextwidth and \RM@maxtextwidth aren't stupid
% \@tempswatrue if they are daft.

\@tempswafalse

\relax
\ifdim\@tempdima<0pt\relax
	\setlength\@tempdima{-\@tempdima}
\fi

\relax
\ifdim\RM@mintextwidth>\RM@maxtextwidth\relax
	\@tempswatrue
\fi

\relax
\ifdim\RM@mintextwidth>\paperwidth\relax
	 \@tempswatrue
\fi

\relax
\if@tempswa
	\RM@Error{You've set \protect\RM@[min/max]textwidth
		to something daft}
		{
		\protect\RM@mintextwidth\space=\RM@mintextwidth\MessageBreak
		\protect\RM@maxtextwidth\space=\RM@maxtextwidth\MessageBreak
		\protect\paperwidth\space=\the\paperwidth\MessageBreak
		}
\fi
%%
%%
%%    \section{Width setting code proper}
%%
%% The code below (until `End of what was rmpwnorm') is rmpwnorm.pko, 
%% except a few bits which seem logically to belong 
%% elsewhere---command definintions etc.
%%
%% The code below is derived from: rat-setwidth-norm.pko; 
%% specifically, rmpwnorm.pko v0.60 1996/10/25.  The changes history 
%% is now at the top of this file, below rmpage.sty's changes history.
%
%
% Start out by setting \@tempdimb to preferred \textwidth depending on 
% \@ptsize and options.
%%
%%
%%    \subsection{Check for stuff that's not allowed in the slides class}
%%
% Are these checks really needed?  I might get rid of them.  But then 
% again\ldots 
\RM@OnClassType{5}
	{\RM@ocl{1}{\typeout{Detected slides class}}{}
	\ifnum\RM@textcols=1
	\else
		\RM@Error{Too many columns}
		{The slides class only allows one column of text}
	\fi
%
	\@ifundefined{@ptsize}{}
	{\RM@Error{What typesize is this?}
		{The slides class only allows one typesize}}
%
	\ifRM@adaptivecolsep
	\RM@Error{You can't have adaptivecolumsep with the slides class}
	{The slides class only allows one column of text}
	\fi}{}

%%
%%
%%    \subsection{Check the \comname{textwidth} limits}
%%
% Some preliminary checks to ensure that the various horizontal 
% printing limits aren't asking for something impossible, and 
% hopefully give some useful information if the impossible has
% been asked for.
%
% This code can reduce \RM@maxtextwidth to the maximum allowed 
% \textwidth; it can increase \RM@mintextwidth to 0pt is it's 
% negative to begin with.
%
%
\RM@ocl{2}
	{\typeout{Initial values:}
	\RM@tval{\RM@mintextwidth}
	\RM@tval{\RM@maxtextwidth}
	}{}
%
\setlength\@tempdima{\paperwidth}
\addtolength\@tempdima{-\RM@minrightclearance}
\addtolength\@tempdima{-\RM@minleftclearance}
\setlength\@tempdimb{\paperwidth}
\addtolength\@tempdimb{-\RM@mininsidemargin}
\addtolength\@tempdimb{-\RM@minoutsidemargin}
%

\@tempswafalse
\ifdim\@tempdima<0pt \@tempswatrue \fi
\ifdim\@tempdimb<0pt \@tempswatrue \fi
\if@tempswa
	\RM@Error{The horizontal printable region is too small;
		I can't\MessageBreak calculate a valid layout}
	{Your layout parameters ask for a negative 
		\protect\textwidth\MessageBreak Major bummer.}
\fi
%
\ifdim\RM@mintextwidth>\RM@maxtextwidth
	\RM@Error{I can't produce a layout with 
		\protect\RM@mintextwidth\space larger\MessageBreak than 
		\protect\RM@maxtextwidth}
	{Change one or both of these parameters and try again}
\fi
%
% Ensure that neither \RM@maxtextwidth nor \RM@mintextwidth are larger 
% than \@tempdim[a|b].  Note that the final values of 
% \RM@[min|max]textwidth are reported at the end; I only need to 
% report why the changes occurred here.
%
\ifdim\RM@maxtextwidth>\@tempdima
	\edef\RM@maxtextwidth{\the\@tempdima}
	\RM@ocl{1}
	{
	\typeout{I have reduced \protect\RM@maxtextwidth\space to fit 
		inside^^J\protect\RM@min[left/right]clearance\space limits}
	}{}
\fi
%
\ifdim\RM@maxtextwidth>\@tempdimb
	\edef\RM@maxtextwidth{\the\@tempdimb}
	\RM@ocl{1}
	{
	\typeout{I have reduced \protect\RM@maxtextwidth\space to fit 
		inside^^J\protect\RM@min[in/out]sidemarginclearance\space
		limits.}
	}{}
\fi
%
% Now \RM@mintextwidth
% 
\ifdim\RM@mintextwidth>\RM@maxtextwidth
	\RM@Error{After reducing it to fit the available 
	space,\MessageBreak \protect\RM@maxtextwidth\space is now smaller 
	than\MessageBreak \protect\RM@mintextwidth. I can't produce a 
	valid layout}
	{You need to change at least one of these parameters, or use 
	a\MessageBreak different size paper, or different horizontal 
	limits.}
\fi
%
\ifdim\RM@mintextwidth<0pt
	\def\RM@mintextwidth{0pt}
	\RM@Warn{You've asked for a negative 
	\protect\RM@mintextwidth;\MessageBreak I've made it 0pt.}
\fi
%%
%%
%%    \subsection{Set \comname{RM*ptperchar}}
%%
% \RM@fountfamily shouldn't be > 12.  If it is, the fountfamily's 
% unknown.  Issue a warning and set \RM@fountfamily to 12: 
% thisfountwidth.
%
\ifnum\RM@fountfamily>12
	\RM@Warn{I don't know what fount \protect\RM@fountfamily\space = 
		\RM@fountfamily\space is.\MessageBreak
		I'll pretend you meant 12: thisfountwidth\MessageBreak}
	\def\RM@fountfamily{12}
\fi
%
% Note that \RM@ptperchar is pre-calculated (with the text used for 
% \RM@fountfamily=12) so that it is not necessary to have the main body 
% fount selected before this code executes---this fount can in general 
% be selected anywhere: leave it up to the user.
%
% \RM@textwidthgroup should be set to one of the values below by now.  
% The \RM@BeforeSettingptperchar hook lets you change this if you want 
% to.
%
% Set \RM@ptperchar; N blocks of code:
% \RM@textwidthgroup 0 = article, report, letter, book, and derivatives
% \RM@textwidthgroup 1 = slides
% \RM@textwidthgroup 2 = foiltex
% \RM@textwidthgroup 3 = classes using non-standard values for \@ptperchar
% \RM@textwidthgroup 4 = undefined classes (produces error currently; don't use)
%
\ifcase\RM@textwidthgroup\relax
% 0=general
%%
%%
%%    Set \RM@ptperchar for std classes except slides
%%    ................................................
%%
    \@tempswafalse
    \ifnum\RM@ptsizegroup < 0 \@tempswatrue \fi
    \ifnum\RM@ptsizegroup > 3 \@tempswatrue \fi
    \if@tempswa
        \RM@Error{You can't have this point size.  Sorry}
 			{rmpage doesn't support
 			\RM@ptsizegroup\space=\protect\RM@ptsizegroup\space
 			with this class}
    \fi
	\ifcase\RM@fountfamily% 0=cmr
		\RM@setptperchar{4.39592pt}{4.81352pt}{5.16339pt}{0pt}
	\or% 1=Avant Garde (pag)
		\RM@setptperchar{4.8146pt}{5.27199pt}{5.77753pt}{0pt}
	\or% 2=Bookman (pbk)
		\RM@setptperchar{4.8823pt}{5.34612pt}{5.85876pt}{0pt}
	\or% 3=Zapf Chancery (pzc)
		\RM@setptperchar{3.46992pt}{3.79956pt}{4.16391pt}{0pt}
	\or% 4=Helvetica (phv)
		\RM@setptperchar{4.36852pt}{4.78352pt}{5.24222pt}{0pt}
	\or% 5=New Century Schoolbook (pnc)
		\RM@setptperchar{4.58647pt}{5.02219pt}{5.50377pt}{0pt}
	\or% 6=Palatino (ppl)
		\RM@setptperchar{4.38867pt}{4.80559pt}{5.2664pt}{0pt}
	\or% 7=Times (ptr)
		\RM@setptperchar{3.9714pt}{4.34868pt}{4.76569pt}{0pt}
	\or% 8=Utopia (put)
		\RM@setperchar{4.45232pt}{4.87529pt}{5.34279pt}{0pt}
	\or% 9=Lucida casual (hlcn)
		\RM@setptperchar{5.02287pt}{5.50003pt}{6.02745pt}{0pt}
	\or% 10=Courier (pcr)
		\RM@setptperchar{6.0506pt}{6.6254pt}{7.26073pt}{0pt}
	\or% 11=Concrete (ccr)
		\RM@setptperchar{4.40622pt}{4.82481pt}{5.28748pt}{0pt}
	\or% 12=AN Other fount; set the fount before loading rmpage
		\RM@setthisfountptperchar
	\else% 13 and above=other
		\RM@setptperchar{4.39592pt}{4.81352pt}{5.16339pt}{0pt}
		\RM@Error{Truth is a mirage and death's an oasis:\MessageBreak
			you've got cmr width.  Let's call it a bug.}
			{I don't recognize the fount family you requested; but
				this fount\MessageBreak
			family number should have been trapped by a check above.  
				This\MessageBreak 
			shouldn't have happened.  It's one of them bug things}
	\fi
% Done setting \RM@ptperchar for std classes except slides
%
\or% 1=slides
%%
%%
%%    Set \RM@ptperchar for the slides class only
%%    ...........................................
%%
    \@tempswafalse
    \ifnum\RM@ptsizegroup<0 \@tempswatrue \fi
    \ifnum\RM@ptsizegroup>0 \@tempswatrue \fi
    \if@tempswa
        \RM@Error{You can't have this point size.  Sorry}
 			{rmpage doesn't support
 			\RM@ptsizegroup\space=\protect\RM@ptsizegroup\space
 			with this class}
 		\fi
	\ifcase\RM@fountfamily% 0=lcmss
		\setlength\RM@ptperchar{10.2716pt} 
	\or% 1=Avant Garde (pag)
		\setlength\RM@ptperchar{9.58444pt} 
	\or% 2=Bookman (pbk)
		\setlength\RM@ptperchar{9.71921pt} 
	\or% 3=Zapf Chancery (pzc)
		\setlength\RM@ptperchar{6.90758pt} 
	\or% 4=Helvetica (phv)
		\setlength\RM@ptperchar{8.69641pt} 
	\or% 5=New Century Schoolbook (pnc)
		\setlength\RM@ptperchar{9.1303pt} 
	\or% 6=Palatino (ppl)
		\setlength\RM@ptperchar{8.73653pt} 
	\or% 7=Times (ptr)
		\setlength\RM@ptperchar{7.90588pt} 
	\or% 8=Utopia (put)
		\setlength\RM@ptperchar{8.86324pt} 
	\or% 9=Lucida casual (hlcn)
		\setlength\RM@ptperchar{10.00424pt} 
	\or% 10=Courier (pcr)
		\setlength\RM@ptperchar{12.04494pt} 
	\or% 11=Concrete (ccr)
		\setlength\RM@ptperchar{9.13852pt} 
	\or% 12=AN Other fount; set the fount before loading rmpage
		\RM@setthisfountptperchar
	\else% 13 and above=other
		\setlength\RM@ptperchar{10.2716pt}
		\RM@Error{Truth is a mirage and death's an oasis:\MessageBreak
			you've got lcmss width.  Let's call it a bug.}
			{I don't recognize the fount family you requested; but
				this fount\MessageBreak
			family number should have been trapped by a check above.  
				This\MessageBreak 
			shouldn't have happened.  It's one of them bug things}
	\fi%
%
%
% Done setting \RM@ptperchar for the slides class only
%
\or% 2=foils
%%
%%
%%    Set \RM@ptperchar for the foils class only
%%    ...........................................
%%
    \@tempswafalse
    \ifnum\RM@ptsizegroup<0 \@tempswatrue \fi
    \ifnum\RM@ptsizegroup>4 \@tempswatrue \fi
    \if@tempswa
        \RM@Error{You can't have this point size.  Sorry}
 			{rmpage doesn't support
 			\RM@ptsizegroup\space=\protect\RM@ptsizegroup\space
 			with this class}
 		\fi
	\ifcase\RM@fountfamily% 0=fcmss
		\RM@setptperchar{7.2472pt}{8.69832pt}{10.43463pt}{12.52324pt}
	\or% 1=Avant Garde (pag)
		\RM@setptperchar{8.31964pt}{9.9855pt}{11.97876pt}{14.37643pt}
	\or% 2=Bookman (pbk)
		\RM@setptperchar{8.43661pt}{10.1259pt}{12.14719pt}{14.57857pt}
	\or% 3=Zapf Chancery (pzc)
		\RM@setptperchar{5.99603pt}{7.19662pt}{8.63318pt}{10.3612pt}
	\or% 4=Helvetica (phv)
		\RM@setptperchar{7.5488pt}{9.06032pt}{10.86888pt}{13.0444pt}
	\or% 5=New Century Schoolbook (pnc)
		\RM@setptperchar{7.92543pt}{9.51236pt}{11.41116pt}{13.69524pt}
	\or% 6=Palatino (ppl)
		\RM@setptperchar{7.58362pt}{9.10211pt}{10.91902pt}{13.10458pt}
	\or% 7=Times (ptm)
		\RM@setptperchar{6.8626pt}{8.23671pt}{9.88087pt}{11.85864pt}
	\or% 8=Utopia (put)
		\RM@setperchar{7.69362pt}{9.23412pt}{11.0774pt}{13.29465pt}
	\or% 9=Lucida casual (hlcn)
		\RM@setptperchar{8.67952pt}{10.41745pt}{12.49692pt}{14.9983pt}
	\or% 10=Courier (pcr)
		\RM@setptperchar{10.45544pt}{12.54895pt}{15.05392pt}{18.06711pt}
	\or% 11=Concrete (ccr) no 30pt with std .fd; 30pt size scaled from 25pt.
		\RM@setptperchar{7.61395pt}{9.13852pt}{10.9627pt}{13.1552pt}
	\or% 12=AN Other fount; set the fount before loading rmpage
		\RM@setthisfountptperchar
	\else% 13 and above=other
		\RM@setptperchar{7.2472pt}{8.69832pt}{10.43463pt}
		\RM@Error{Truth is a mirage and death's an oasis:\MessageBreak
			you've got fcmss width.  Let's call it a bug.}
			{I don't recognize the fount family you requested; but
				this fount\MessageBreak
			family number should have been trapped by a check above.  
				This\MessageBreak 
			shouldn't have happened.  It's one of them bug things}
	\fi
	% Done setting ptperchar for foils
%
\or% 3=non-standard ptperchar
	\RM@setthisfountptperchar\relax
\or% 4=other
	\relax
\else% > 3
% error condition
	\RM@Error{This shouldn't happen}
		{An iffy \protect\RM@textwidthgroup\space
			when setting \protect\RM@ptperchar.  Call it a bug.}
\fi% end setting ptperchar
%
% Finished setting \RM@ptperchar for all classes
%
%%
%%
%%    \subsection{Set \comname{columnsep}}
%%
% Begin by setting \columnsep (and maybe \mparsep some time in the 
% future).  It might be useful one day for the \textwidth setting code 
% (below) to know what these are.
%
% \columnsep is set to 10pt by article.cls.  This is 2.3 10pt cmr chars, 
% 2.07 11pt, and 1.93 12pt.  I reckon 2.07 char widths is a good thing to 
% try as a first guess.  I suppose trying some \twocolumn stuff would be 
% the best way to if it's right...  But the KOMA-script code sets 
% \columnsep to 12pt; this goes with its default 11pt body text size.  
% I think this means that setting \columnsep to 2.3\RM@ptperchar is a 
% good thing for starters.
%
% Don't do \columnsep stuff for foils or slides classes, because they 
% don't support multiple columns.
% Do \columnsep stuff for std classes except slides...
\RM@OnTextwidthGroup{1}
	{\ifRM@adaptivecolsep
		\setlength\columnsep{2.3\RM@ptperchar}% other value
		\@tempswafalse
	    \ifnum\RM@ptsizegroup<0 \@tempswatrue \fi
	    \ifnum\RM@ptsizegroup>3 \@tempswatrue \fi
	    \if@tempswa
	        \RM@Warn{The adaptivecolsep option doesn't know about this
	 			text\MessageBreak
	 			point size option - this shouldn't matter\MessageBreak
	 			\RM@ptsizegroup\space=\protect\RM@ptsizegroup}
	 		\fi
		\ifcase\RM@ptsize% 10pt is std \columnsep
			\setlength\columnsep{2.3\RM@ptperchar}% 10pt value
		\or
			\setlength\columnsep{2.3\RM@ptperchar}% 11pt value
		\or
			\setlength\columnsep{2.3\RM@ptperchar}% 12pt value
		\fi%endif\@ptsize
	\fi% end\ifRM@adaptivecolsep
%
% Report `before' value only here; after value is reported at the end
% of rmpage.
	\RM@ocl{2}
		{\typeout{Before scaling:}
		\RM@ttval{\columnsep}}{}
%
% Multiply \columnsep according to the option used...
	\RM@scalebyoption{\columnsep}{\RM@columnsepoption}
	}{}
%
% End \columnsep stuff for std classes except slides
%
%
% \columnsep stuff for odd classes
%
\RM@OnTextwidthGroup{3}
	{\@ifundefined{columnsep}{}
		{\ifRM@adaptivecolsep
			\setlength\columnsep{2.3\RM@ptperchar}
		\fi
		\RM@ocl{2}
			{\typeout{Before scaling:}
			\RM@ttval{\columnsep}}{}
		\RM@scalebyoption{\columnsep}{\RM@columnsepoption}
		}
	}{}
%%
%%
%%    \subsection{Set initial \comname{textwidth} values}
%%
% \RM@widthoption: 2=narrowest, 5=narrower, 8=narrow, 11=narrowish,
%                 14=normalwidth, 
%                17=widish, 20=wide, 23=wider, 26=widest, 
%                29=halfinchmargins, 30=oneinchmargins, 31=fullwidth.
%                32=stdwidth               
%%
%%
%%    \subsubsection{Set character-based initial \comname{textwidth}}
%%                   ................................................
%%
% \@tempdimb is set to a requested textwidth - the preferred textwidth 
% calculated as the width of a certain number of characters.  \@tempdima 
% is set to the maximum allowed textwidth based on the smallest allowed 
% margins.  \textwidth is set to the smaller of these two dimensions.  
% Number of characters specified is (approximately) the number of 
% natural-width cmr characters corresponding to the set width.
%
% normalwidth is pretty much standard 2e; stdwidth is standard 2e.
%
% This part of the code ensures that \@tempdimb is greater than the 
% minimum allowed \textwidth (\RM@mintextwidth).  A check is made 
% again for this condition after all the margins have been set.
% 
% Different STDWIDTH SETTINGS for slides and everything else...
%
\RM@OnClassType{5}
	{\RM@OnWidthOption{31}{33}{% 32=stdwidth settings from slides.cls
	  \setbox\@tempboxa\hbox{\rmfamily im}
	  \setlength\@tempdimb{.5\wd\@tempboxa}
	  \setlength\@tempdimb{65\@tempdimb}
		}{}
	}
	{\RM@OnWidthOption{31}{33}{
		\ifcase\RM@ptsizegroup% 32=stdwidth settings
			\setlength\@tempdimb{345pt}%    From size10.clo; 78.4819 chars
			\or\setlength\@tempdimb{360pt}% From size11.clo; 74.7893 chars
			\or\setlength\@tempdimb{390pt}% From size12.clo; 75.5318 chars
        \else
            \RM@Error{Invalid point size}{You've asked for a point 
            size that isn't 10, 11, or 12pt and for standard 
            \protect\textwidth\space.  You can't have both.}
		\fi}{}
	}
%
% % Widths 29, 30, or 31: are the fixed-margin widths; the paper-based 
% % \textwidth guess is set to whatever the width needs to be, so set 
% % \@tempdimb to the largest practical value if one of these widths has 
% % been selected.  BUT!  you can ask for a fixed-margin width and then 
% % ask for characterwidthset...  I reckon the thing to do is set the 
% % character-based \textwidth guess to the same value as the 
% % paper-based \textwidth guess for these fixed-margin widths---this 
% % job can only be done after the paper-based \textwidth guess has been 
% % calculated below.  Oh, and issue a warning if the user's asked for a 
% % fixed-margin width and characterwidthset, 'cos that's silly.
% %
% \RM@OnWidthOption{28}{32}{
% 	\@tempdimb=\paperwidth
% 	}{}
%
% Widths 0--28 are scaled widths, so set base width.
%
% The base width is chosen to give, to $\pm 1\%$, the same number of 
% characters per line as the fixed lengths given in size[10|11|12].clo.  
% It doesn't give you identical line breaks with different founts, 
% because different founts are different (that's an important point, 
% that is), but you'll get a similar number of lines of text with 
% different founts.
%
% \RM@ttval{}
\RM@OnWidthOption{-1}{29}{
	\RM@OnTextwidthGroup{0}
		{\@tempswafalse
	    \ifnum\RM@ptsizegroup<0 \@tempswatrue \fi
	    \ifnum\RM@ptsizegroup>3 \@tempswatrue \fi
	    \if@tempswa
	        \RM@Error{You can't have this point size.  Sorry}
	 			{rmpage doesn't support
	 			\RM@ptsizegroup\space=\protect\RM@ptsizegroup\space
	 			with this class}
	 		\fi
		\ifcase\RM@ptsizegroup% normalwidth settings for other std classes
	        \setlength\@tempdimb{785\RM@ptperchar}
	        \or\setlength\@tempdimb{748\RM@ptperchar}
	        \or\setlength\@tempdimb{755\RM@ptperchar}
		\fi}{}
	\RM@OnTextwidthGroup{1}{\setlength\@tempdimb{700\RM@ptperchar}}{}% normalwidth for slides
	\RM@OnTextwidthGroup{2}
		{\@tempswafalse
	    \ifnum\RM@ptsizegroup<0 \@tempswatrue \fi
	    \ifnum\RM@ptsizegroup>4 \@tempswatrue \fi
	    \if@tempswa
	        \RM@Error
	 			{You can't have this point size.  Sorry}
	 			{rmpage doesn't support
	 			\RM@ptsizegroup\space=\protect\RM@ptsizegroup\space
	 			with this class}
	 		\fi
		\ifcase\RM@ptsizegroup% normalwidth settings for foils class
	           \setlength\@tempdimb{750\RM@ptperchar}
	        \or\setlength\@tempdimb{730\RM@ptperchar}
	        \or\setlength\@tempdimb{715\RM@ptperchar}
	        \or\setlength\@tempdimb{700\RM@ptperchar}
		\fi}{}
	\RM@OnTextwidthGroup{3}% normalwidth settings for odd classes
		{\setlength\@tempdimb{750\RM@ptperchar}}{}
	\divide\@tempdimb by10
	\ifcase\RM@widthoption
		   \@tempdimb=0.7077\@tempdimb%0
		\or\@tempdimb=0.7254\@tempdimb%1
		\or\@tempdimb=0.7436\@tempdimb%2 narrowest
		\or\@tempdimb=0.7621\@tempdimb%3
		\or\@tempdimb=0.7812\@tempdimb%4
		\or\@tempdimb=0.8007\@tempdimb%5 narrower
		\or\@tempdimb=0.8207\@tempdimb%6
		\or\@tempdimb=0.8413\@tempdimb%7
		\or\@tempdimb=0.8623\@tempdimb%8 narrow
		\or\@tempdimb=0.8839\@tempdimb%9
		\or\@tempdimb=0.9060\@tempdimb%10
		\or\@tempdimb=0.9286\@tempdimb%11 narrowish
		\or\@tempdimb=0.9518\@tempdimb%12
		\or\@tempdimb=0.9756\@tempdimb%13
		\or\@tempdimb=1.0000\@tempdimb%14 norm
		\or\@tempdimb=1.0250\@tempdimb%15
		\or\@tempdimb=1.0506\@tempdimb%16
		\or\@tempdimb=1.0769\@tempdimb%17 widish
		\or\@tempdimb=1.1038\@tempdimb%18
		\or\@tempdimb=1.1314\@tempdimb%19
		\or\@tempdimb=1.1597\@tempdimb%20 wide
		\or\@tempdimb=1.1887\@tempdimb%21
		\or\@tempdimb=1.2184\@tempdimb%22
		\or\@tempdimb=1.2489\@tempdimb%23 wider
		\or\@tempdimb=1.2801\@tempdimb%24
		\or\@tempdimb=1.3121\@tempdimb%25
		\or\@tempdimb=1.3449\@tempdimb%26 widest
		\or\@tempdimb=1.3785\@tempdimb%27
		\or\@tempdimb=1.4130\@tempdimb%27
	\else
		\RM@Error{This can't happen}
			{Urgh.  rmpage has a bug, or something}
	\fi
	}{}

%
% Note that \RM@scalewidth only scales options 0--28
%
%
%
% \@tempdimb is maximum allowed \textwidth (character based)
% \@tempdima will be maximum allowed \textwidth (paper based)
% Now set \textwidth as in size\@ptsize.clo (almost)
%
% \RM@ocl{1}
% 	{\typeout{Early Initial \protect\textwidth\space targets:^^J
% % 	\space\space paper-based: \the\@tempdima^^J
% 	\space\space char-based : \the\@tempdimb}
% 	}{}
%
%
%%
%%
%%    \subsubsection{Set paper-based initial \comname{textwidth}}
%%                   ............................................
%%
%
% std 2e min margins from size\@ptsize.clo are 2in when summed.
% margins used to be (and are now using A4 paper) (all measurements in inches):
%
%    narrowest        narrow         normal            wide            widest 
%            narrower        narrowish        widish          wider 
%  A4                                 5=2.8     
%  A5                                 5=2      
%
% \textwidth:
%  A4                                 137.9mm 
%                                     -------
%
% NOTE: lucida casual wants to be 457.46pt=161mm wide (\normalwidth).
% What to do?                              -----     
%
% This means dropping 23mm.  Hmm.
%
% Set \@tempdima to \paperwidth-based \textwidth:
%
\RM@OnWidthOption{31}{33}{%32 is stdwidth; do it the way size[n].clo does it
	\setlength\@tempdima{-2in}
	\addtolength\@tempdima{\paperwidth}
	\@settopoint\@tempdima% Added for better compatibility
	}{}
\RM@OnWidthOption{30}{32}{%31 halfinchmargins
	\setlength\@tempdima{-1in}
	\addtolength\@tempdima{\paperwidth}
	}{}
\RM@OnWidthOption{29}{31}{%30 oneinchmargins
	\setlength\@tempdima{-2in}
	\addtolength\@tempdima{\paperwidth}
	}{}
\RM@OnWidthOption{28}{30}{%29 fullwidth
	\setlength\@tempdima{0pt}
	\addtolength\@tempdima{\paperwidth}
	}{}
%
%
% Erm, A4 margin is geometric mean of 2 and 2\sqrt{2} inches.  This is 
% because the standard classes apply a minimum total margin of 2 inches; 
% this seems to be meant to apply to the smaller paper sizes, like A5.  
% I reckon it's too much of a gap for normalwidth.  If you scale 2 
% inches up from A5 to A4, you get a gap of 2\sqrt{2} inches.  That's 
% too big; so go for something in between.  A geometric mean is the 
% right sort for this kind of job, hence the numbers below.  My 
% reasoning doesn't convince me completely, but it's a ay of arriving at 
% a result I rather like.
%
% normalwidth A5 portrait: 1.6676in
% normalwidth A4 portrait: 2.3664in
%
% normalwidth is 0.7138 of \paperwidth.
%
% scaling is arranged so that the width option beyond widest would 
% give a paper-based \textwidth of \paperwidth.  The steps in between 
% are in a geomtric sequence, with an increment of \sqrt[15]{1/0.7138}
%
% Can anyone udnerstnad this gibbershni?
\RM@OnWidthOption{-1}{29}{% 0-28
	\setlength\@tempdima{0.7138\paperwidth}
	\ifcase\RM@widthoption
		   \@tempdima=0.7300\@tempdima%0
		\or\@tempdima=0.7466\@tempdima%1
		\or\@tempdima=0.7636\@tempdima%2 narrowest
		\or\@tempdima=0.7809\@tempdima%3
		\or\@tempdima=0.7987\@tempdima%4
		\or\@tempdima=0.8169\@tempdima%5 narrower
		\or\@tempdima=0.8354\@tempdima%6
		\or\@tempdima=0.8544\@tempdima%7
		\or\@tempdima=0.8738\@tempdima%8 narrow
		\or\@tempdima=0.8937\@tempdima%9
		\or\@tempdima=0.9140\@tempdima%10
		\or\@tempdima=0.9348\@tempdima%11 narrowish
		\or\@tempdima=0.9560\@tempdima%12
		\or\@tempdima=0.9778\@tempdima%13
		\or\@tempdima=1.0000\@tempdima%14 norm
		\or\@tempdima=1.0227\@tempdima%15
		\or\@tempdima=1.0460\@tempdima%16
		\or\@tempdima=1.0698\@tempdima%17 widish
		\or\@tempdima=1.0941\@tempdima%18
		\or\@tempdima=1.1189\@tempdima%19
		\or\@tempdima=1.1444\@tempdima%20 wide
		\or\@tempdima=1.1704\@tempdima%21
		\or\@tempdima=1.1970\@tempdima%22
		\or\@tempdima=1.2242\@tempdima%23 wider
		\or\@tempdima=1.2520\@tempdima%24
		\or\@tempdima=1.2805\@tempdima%25
		\or\@tempdima=1.3096\@tempdima%26 widest
		\or\@tempdima=1.3394\@tempdima%27
		\or\@tempdima=1.3698\@tempdima%28
	\else
		\RM@Error{This can't happen}
			{Urgh.  rmpage has a bug, or something}
	\fi
	}{}
%
% Widths 29, 30, or 31: are the fixed-margin widths; the paper-based 
% \textwidth guess is set to whatever the width needs to be, so I used 
% to set \@tempdimb to the largest practical value if one of these 
% widths has been selected.  BUT! you can ask for a fixed-margin width 
% and then ask for characterwidthset...  I reckon the thing to do is set 
% the character-based \textwidth guess to the same value as the 
% paper-based \textwidth guess for these fixed-margin widths---this job 
% can only be done after the paper-based \textwidth guess has been 
% calculated below.  Oh, and issue a warning if the user's asked for a 
% fixed-margin width and characterwidthset, 'cos that's silly.
%
\RM@OnWidthOption{28}{32}{
	\ifnum\RM@setwidthby=1
		\RM@Warn{You've asked for a fixed margin size
				\protect\textwidth\MessageBreak 
			(half inch or one inch margins, or fullwidth),
				as well\MessageBreak
			as setting \protect\textwidth\space by the
				character-based width\MessageBreak
			only.  This is silly: stop it.}
	\fi
% Set the character-based textwidth guess to the same value as the 
% paper-based textwidth guess.
	\@tempdimb=\@tempdima
	}{}
%
\RM@executehook{RM@AfterInitialTextwidthSetting}
% 
% \@tempdima = paper-based textwidth guess
% \@tempdimb = character-based textwidth guess
%
% Report these after allowing for multiple columns; you can work back 
% to what the values here should be, if you need to, or find out by 
% requesting onecolumn.  This doesn't feel quite right, but I'm 
% trying to minimise reporting.
%
% Enlarge \@temdimb to accomodate multiple columns.
% Make \@tempdimb =
%       \RM@textcols x \@tempdimb + (\RM@textcols-1) x \columnsep
%
% (but if stdwidth (widthoption = 32),
% \@tempdimb = \RM@textcols x \@tempdimb )
% Don't execute this code for the slides class, because slides can 
% only have one column.  It doesn't matter now if you do, but future 
% changes might screw things up.
\RM@OnClassType{5}{}
	{\ifnum\RM@textcols<1
		\RM@Error{This ain't right}
			{\protect\RM@textcols is too small.  This might be a bug.}
	\else
		\ifnum\RM@widthoption=32
			\setlength\@tempdimb{\RM@textcols \@tempdimb}
			\ifnum\RM@textcols>2
				\RM@Warn{You can only have stdwidth with one or two 
					columns;\MessageBreak
					You've asked for \RM@textcols\space columns\MessageBreak
					The result might not be what you want.}
			\fi
		\else% every width except stdwidth
			\setlength\@tempdimb{\RM@textcols \@tempdimb}
			\addtolength\@tempdimb{\RM@textcols \columnsep}
			\addtolength\@tempdimb{-\columnsep}
		\fi
	\fi}% endRM@OnClassType
%%
%%
%%    \subsection{Begin \comname{textwidth} checking and selection}
%%
% Now try to ensure that \textwidth will not exceed the 
% \RM@[min|max]textwidth limits.  This test needs to be done again, 
% after \textwidth has been set, because \textwidth can shrink.
%
\ifdim\@tempdima<\RM@mintextwidth\@tempdima=\RM@mintextwidth\fi
\ifdim\@tempdimb<\RM@mintextwidth\@tempdimb=\RM@mintextwidth\fi
\ifdim\@tempdima>\RM@maxtextwidth\@tempdima=\RM@maxtextwidth\fi
\ifdim\@tempdimb>\RM@maxtextwidth\@tempdimb=\RM@maxtextwidth\fi
%
% Reported here rather than elsewhere, because:
% you can work back to the onecolumn values if needed (or find out by 
%     asking for onecolumn)
% running into the [min|max]textwidth limits should be apparent --- 
%     you can find out by comparing values, or removing the limits if 
%     needed
% This doesn't feel quite right, but I'm trying to minimise reporting.
%
\RM@ocl{1}
	{\typeout{Initial \protect\textwidth\space targets:^^J
	\space\space paper-based: \the\@tempdima^^J
	\space\space char-based : \the\@tempdimb}
	}{}
%
%
% Major revision of the code below on 25/2/96.  This has been tidied, 
% and a properly thought-out algorithm implemented. Check the algorithm 
% and the code: I like it.
%
% I think it might be more elegant to force the initial value of 
% \textwidth to be small enough to fit in the available space, margin 
% offset considered.  I'm not sure how to go about that---perhaps:
% For the selected textwidth:
% calculate inside/outside clearances
% increase inside (say) clearance if needed
% re-calculate outside clearance
% increase outside clearance if needed
% re-calculate inside clearance
% re-calculate textwidth based on final clearances
%
% The idea above needs a fair bit of work---I think saving it for 
% version 2 is the thing.
% 
%
% But \textwidth must not get larger than 
% \paperwidth-\@minleftcl-\@minrightcl, or larger than 
% \paperwidth-\RM@mininsidemargin-\RM@minoutsidemargin (these are 
% normally zero length).
%
% The following code prevents that happening: both \@tempdima 
% (paper-basd textwidth guess) and \@tempdimb (character-based textwidth 
% guess) need to be checked, because they are not always both 
% considered.
%
% This code ensures that the requested \textwidth will fit on the 
% page if you're printing centred.
%
% Check min[left|right]margins:
%
\setlength\@tempdimc{\paperwidth}
\addtolength\@tempdimc{-\RM@minleftclearance}
\addtolength\@tempdimc{-\RM@minrightclearance}
%
\ifdim\@tempdimc<\@tempdima
	\RM@oclwarninfo{3}
		{Paper-based textwidth reduced from:\MessageBreak
		\the\@tempdima\space to \the\@tempdimc\MessageBreak
		because of min[left/right]clearance limits}
	\setlength\@tempdima{\@tempdimc}
	\fi
%
\ifdim\@tempdimc<\@tempdimb
	\RM@oclwarninfo{3}
		{Character-based textwidth reduced from:\MessageBreak
		\the\@tempdimb\space to \the\@tempdimc\MessageBreak
		because of min[left/right]clearance limits}
	\setlength\@tempdimb{\@tempdimc}
	\fi

%
% Check min[inside|outside]margins
%
\setlength\@tempdimc{\paperwidth}
\addtolength\@tempdimc{-\RM@mininsidemargin}
\addtolength\@tempdimc{-\RM@minoutsidemargin}
%
\ifdim\@tempdimc<\@tempdima
	\RM@oclwarninfo{3}
		{Paper-based textwidth reduced from:\MessageBreak
		\the\@tempdima\space to \the\@tempdimc\MessageBreak
		because of min[in/out]sidemargin encroachment\MessageBreak}
	\setlength\@tempdima{\@tempdimc}
	\fi
%
\ifdim\@tempdimc<\@tempdimb
	\RM@oclwarninfo{3}
		{Character-based textwidth reduced from:\MessageBreak
		\the\@tempdimb\space to \the\@tempdimc\MessageBreak
		because of min[in/out]sidemargin encroachment\MessageBreak}
	\setlength\@tempdimb{\@tempdimc}
	\fi

%%
%%
%%    Decide which \@tempdim to use for \textwidth
%%    ............................................
%%
% Before we get to here, I have ensured that if the user has asked 
% for a paper-based textwidth like oneinchmargins, the 
% character-based textwidth has been set to the same value.  So if 
% you ask for character-based textwidth setting and oneinchmargins, 
% you still get oneinchmargins, which is the best sense that can be 
% made of the request.
%
% Ensure that the paper-based width is larger if you've asked for 
% character-based only width setting; or that the character-based 
% width is larger if you've asked for paper-based only width setting.
%
\ifcase\RM@setwidthby
%0 = both
\or% 1 = character-based only; make paper width very large
	\setlength\@tempdima{16383pt}
\or% 2= paper-based only; make character width very large
	\setlength\@tempdimb{16383pt}
\else
	\RM@Error{Time for a cuppa}
		{\protect\RM@setwidthby\space is too large.\MessageBreak
		 This is a species of bug}
\fi

%
% Pick the narrower of the two widths (paper based or character 
% based) unless told otherwise
%

\ifdim\@tempdima>\@tempdimb
	\RM@ocl{2}{\typeout{Using character-based \protect\textwidth}}{}
	\setlength\textwidth{\@tempdimb}% Use character-based width if 
%                                     paper-based width is larger
\else
	\RM@ocl{2}{\typeout{Using paper-based \protect\textwidth}}{}
	\setlength\textwidth{\@tempdima}% Use paper-based width if 
%                                    character-based width is larger
\fi
%
% The paper-based \textwidth guess might have been shrunk to less 
% than \RM@mintextwidth by now, and been selected as the \textwidth to 
% choose.  Test and produce an error if this is the case.
%
\ifdim\textwidth>\RM@maxtextwidth
	\RM@Error
		{\protect\textwidth\space has ended up larger than\MessageBreak 
		\protect\RM@maxtextwidth.  This can't happen, can it?}
		{Something very strange has happened to my brain.}
\fi
\ifdim\textwidth<\RM@mintextwidth
	\RM@Error
		{I can't make \protect\textwidth\space as wide as\MessageBreak
		\protect\RM@mintextwidth.  Reducing the offset might help.
			\MessageBreak
		\protect\textwidth\space= \the\textwidth\MessageBreak
		\protect\paperwidth\space= \the\paperwidth\MessageBreak
		\protect\RM@mininsidemargin\space=
			\RM@mininsidemargin\MessageBreak
		\protect\RM@minoutsidemargin\space=
			\RM@minoutsidemargin\MessageBreak
		\protect\RM@minleftclearance\space=
			\RM@minleftclearance\MessageBreak
		\protect\RM@minrightclearance\space=
			\RM@minrightclearance\MessageBreak}
		{The horizontal limits are such that I can't cope.
			\MessageBreak
		I'm afraid 	you'll have to sort this one out yourself.
			\MessageBreak
		 Good luck.}
\fi
%%
%%
%%    \subsection{Calculate margins etc}
%%
% Start calculating margins.  Begin by calculating the value of 
% \evensidemargin; if \evensidemargin and \oddsidemargin are the same 
% (in the case of centred or onesided printing), \oddsidemargin is 
% eventually set to be the same as \evensidemargin.  If \evensidemargin 
% and \oddsidemargin are different (in the case of notcentred and 
% twosided printing only), \oddsidemargin is calculated from 
% \evensidemargin; it is set to: 
% [(\paperwidth-\textwidth-\evensidemargin) - 2in].  Physically, this is 
% the size of the right margin on even numbered pages.  The 2in is 
% subtracted because TeX measures from 1in into the page.
%
% \ifRM@centre                        \evensidemargin=0.5\@tempdima \fi
% \ifRM@stdmargins    and \ifRM@twoside \evensidemargin=0.6\@tempdima \fi
% \ifRM@stdmargins    and oneside     \evensidemargin=0.4\@tempdima \fi
% \ifnotRM@stdmargins and \ifRM@twoside \evensidemargin=0.4\@tempdima \fi
% \ifnotRM@stdmargins and oneside     \evensidemargin=0.6\@tempdima \fi
%
% Define a counter \RM@offsetfrac, set by midoffset option to 60 by default.
% \ifRM@centre \RM@offsetfrac=50 \fi
% \ifRM@stdmargins and oneside \RM@offsetfrac= 100-\RM@offsetfrac \fi
% \ifnotRM@stdmargins and \ifRM@twoside \RM@offsetfrac= 100-\RM@offsetfrac \fi
% then:
% \setlength\evensidemargin   {\paperwidth}
% \addtolength\evensidemargin {-\textwidth}
% \divide\evensidemargin      by 100
% \multiply\evensidemargin    by \RM@offsetfrac
% \addtolength\evensidemargin {-1in}
%

%%
%%
%%    Horizontal offset
%%    .................
%%
\ifnum\RM@offsetoption<2
	\RM@oclwarninfo{3}
		{Using a touchlessoffset option with leastoffset gives
			\MessageBreak
		you an offset the other way. (poorly expressed-sorry.)
			\MessageBreak
		This might not be what you want.}
\fi

%
% Note that the slides class produces centred pages by default; this 
% needs to be requested as the default option for the slides class by an 
% \ExecuteOptions in the config file.  \rmpage's default config file 
% does this.
%
\ifcase\RM@offsetoption
	\RM@offsetfrac=48%0
	\or\RM@offsetfrac=49%1
	\or\RM@offsetfrac=50%2 least
	\or\RM@offsetfrac=51%3
	\or\RM@offsetfrac=52%4
	\or\RM@offsetfrac=53%5 less
	\or\RM@offsetfrac=54%6
	\or\RM@offsetfrac=55%7
	\or\RM@offsetfrac=56%8 lessish
	\or\RM@offsetfrac=57%9
	\or\RM@offsetfrac=59%10
	\or\RM@offsetfrac=60%11 norm
	\or\RM@offsetfrac=63%12
	\or\RM@offsetfrac=65%13
	\or\RM@offsetfrac=68%14 moreish
	\or\RM@offsetfrac=71%15
	\or\RM@offsetfrac=74%16
	\or\RM@offsetfrac=77%17 more
	\or\RM@offsetfrac=80%18
	\or\RM@offsetfrac=83%19
	\or\RM@offsetfrac=87%20 most
	\or\RM@offsetfrac=91%21
	\or\RM@offsetfrac=94%22
\fi

% %
% % NB:
% %     50 -> 53 -> 56 -> 60; x [ (60/50) ^ (1/3) ] each step (1.0627)
% %     60 -> 68 -> 77 -> 87; x [ (87/60) ^ (1/3) ] each step (1.1319)
% %
% % So make touch[more/less]offset multipliers be ^ (1/3) these two values:
% % 1.0627 ^ (1/3) = 1.0205.  Reciprocal = 0.9799
% %          increase by 2%;  decrease by 2%
% % 1.1319 ^ (1/3) = 1.0421.  Reciprocal = 0.9596
% %          increase by 4%;  decrease by 4%
% %
\ifRM@centre
	\RM@offsetfrac=50
\else
	\ifRM@stdmargins
		\ifRM@twoside
			\relax
		\else% if notcentre and RM@stdmargins and oneside
			\RM@offsetfrac=-\RM@offsetfrac
			\advance\RM@offsetfrac by 100
		\fi% endiftwoside
	\else% if notRM@stdmargins
		\ifRM@twoside% if notcentre and notRM@stdmargins and twoside
			\RM@offsetfrac=-\RM@offsetfrac
			\advance\RM@offsetfrac by 100
		\fi% endiftwoside
	\fi% endifstdmargins
\fi% endifcentre
%%
%%
%%    Initial \evensidemargin setting
%%    ...............................
%%
\setlength\evensidemargin   {\paperwidth}
\addtolength\evensidemargin {-\textwidth}
\divide\evensidemargin      by 100
\multiply\evensidemargin    by \RM@offsetfrac
\addtolength\evensidemargin {-1in}
%
% Note that any changes to \evensidemargin are reported below.
%
\RM@ocl{1}{
	\typeout{Initial \protect\evensidemargin\space request: 
		\the\evensidemargin}}{}
%
% Note that \RM@offsetfrac being a percentage causes rather large 
% rounding errors when calculating touch[more/less]offset.  If this 
% matters, make \RM@offsetfrac a fraction of something larger and a 
% power of two (128?  256?  512?).
%%
%%
%%    Initial \evensidemargin checks
%%    ..............................
%%
% \evensidemargin is now set to the initial preferred value.
% Now check that it is > (minleftclearance,minoutsidemargin) if 2side
%                   or > (minleftclearance,mininsidemargin) if not2side
%
% Increase \evensidemargin if necessary; this code ensures that 
% \evensidemargin is larger than all restrictions placed on the gap 
% that is set by \evensidemargin (in twoside mode, this is 
% minoutsidemargin or minleftclearance; in oneside mode, this is 
% minleftclearance or mininsidemargin).  This might affect the 
% final left/right margin ratio.  Calculate marginparwidth later.
%
% Note that if \evensidemargin is increased, \textwidth must be 
% decreased by the same amount to keep the margin opposite \evenside 
% margin the same.  This doesn't maintain the required relationship; 
% that's done in the next step.
%
\ifRM@twoside
	\ifdim\RM@minleftclearance>\RM@minoutsidemargin
		\setlength\@tempdima{\RM@minleftclearance}
	\else
		\setlength\@tempdima{\RM@minoutsidemargin}
	\fi
\else
	\ifdim\RM@minleftclearance>\RM@mininsidemargin
		\setlength\@tempdima{\RM@minleftclearance}
	\else
		\setlength\@tempdima{\RM@mininsidemargin}
	\fi
\fi
\addtolength\@tempdima{-1in}
\setlength\@tempdimb{\evensidemargin}
\addtolength\@tempdimb{-\@tempdima}
\@tempdimb=-\@tempdimb% change sign to ease my brain
\ifdim\@tempdimb>0pt
	\addtolength\evensidemargin{\@tempdimb}
	\addtolength\textwidth{-\@tempdimb}
	\RM@oclwarninfo{3}
		{A: I had to increase \protect\evensidemargin\space by:
			\MessageBreak
		\the\@tempdimb\space to \the\evensidemargin\MessageBreak
		and decrease \protect\textwidth by:\MessageBreak
		\the\@tempdimb\space to \the\textwidth\MessageBreak}
\fi
%
% If \evensidemargin has been increased, the margin opposite 
% \evensidemargin must also be increased to maintain the 
% relationship:
% \evensidemargin/(sum of both margins) = \RM@offsetfrac
%
% The way to do this is to decrease \textwidth by b, where:
% b = a (1-f)/f
%
% a=change in \evensidemargin, f=\RM@offsetfrac/100
%
% Note that the code below depends on \@tempdimb = increase in 
% \evensidemargin on entry, and leaves \@tempdimb = a (1-f)/f on 
% exit. 
%
% And this jiggery-pokery is only needed if \@tempdimb>0.  
%
% First some paranoia:
\ifnum\RM@offsetfrac=0
	\RM@Error
		{\protect\RM@offsetfrac=0; it should never be this value}
		{rmpage has a bug that needs fixing} 
	\fi
% The job itself...  gets buggered up without that bloody \relax.  Why?
\relax
\ifdim\@tempdimb>0pt
	% First calculate 100x(1-f), leaving the result in \@tempcnta
	\@tempcnta=100
	\advance\@tempcnta by-\RM@offsetfrac
	% Now multiply a by 100 x (1-f)
	\multiply\@tempdimb by\@tempcnta
	% And finally divide by (f x 100)
	\divide\@tempdimb by\RM@offsetfrac
	% \@tempdimb is now a (1-f)/f, so subtract it from \textwidth:
	\addtolength\textwidth{-\@tempdimb}
	\RM@oclwarninfo{3}
		{B: I had to decrease \protect\textwidth\space by:\MessageBreak
		\the\@tempdimb\space to \the\textwidth}
\fi
%
% Finished calculating \evensidemargin.
%%
%%
%%    Re-check \textwidth and margins
%%    ...............................
%%
%  Now check \textwidth; check that:
% [\paperwidth-(1"+\evensidemargin+\textwidth)]  
%                         < (\RM@minrightclearance,\RM@mininsidemargin) if 2side
% or                      < (\RM@minrightclearance,\RM@minoutsidemargin) if not2side
%
% reduce \textwidth if necessary
%
%
\setlength\@tempdimb{\paperwidth}
\addtolength\@tempdimb{-1in}
\addtolength\@tempdimb{-\evensidemargin}
\addtolength\@tempdimb{-\textwidth}
%
\ifRM@twoside
	\ifdim\RM@minrightclearance>\RM@mininsidemargin
		\setlength\@tempdima{\RM@minrightclearance}
	\else
		\setlength\@tempdima{\RM@mininsidemargin}
	\fi
\else
	\ifdim\RM@minrightclearance>\RM@minoutsidemargin
		\setlength\@tempdima{\RM@minrightclearance}
	\else
		\setlength\@tempdima{\RM@minoutsidemargin}
	\fi
\fi%
%
\addtolength\@tempdimb{-\@tempdima}
\@tempdimb=-\@tempdimb% change sign to ease my brain
\ifdim\@tempdimb>0pt
	\addtolength\textwidth{-\@tempdimb}
	\RM@oclwarninfo{3}
		{C: I had to decrease \protect\textwidth\space by:\MessageBreak
		\the\@tempdimb\space to \the\textwidth}
\fi
%
% If \textwidth has been reduced, one could equally say that the 
% margin opposite \evensidemargin has been increased.  So 
% \evensidemargin must also be increased to maintain the 
% relationship:
% \evensidemargin/(sum of both margins) = \RM@offsetfrac
% but this must be done without increasing the margin opposite 
% \evensidemargin; an amount must be added to \evensidemargin, and 
% the same amount subtracted from \textwidth.  Good, isn't this?
%
% The thing to do is increase \evensidemargin and decrease \textwidth 
% by an amount a, where
%
% a = b f/(1-f)
%
% b = increase in margin opposite \evensidemargin
% f = \RM@offsetfrac
%
% Note that the code below needs the increase in the margin opposite 
% \evensidemargin to be in \@tempdimb on entry, and leaves b f/(1-f) 
% in \@tempdimb on exit.
%
% And this jiggery-pokery is only needed if \@tempdimb>0.
% First some paranoia:
\ifnum\RM@offsetfrac=0
	\RM@Error
		{\protect\RM@offsetfrac=0; it should never be this value}
		{rmpage has a bug that needs fixing} 
\fi
% The job itself...
\relax
\ifdim\@tempdimb>0pt\relax
	% First calculate b x 100 x f, leaving the result in \@tempdimb
	\@tempdimb=\RM@offsetfrac\@tempdimb
	% Then calculate 100x(1-f), leaving the result in \@tempcnta
	\@tempcnta=100
	\advance\@tempcnta by-\RM@offsetfrac
	% Now divide by 100 x (1-f)
	\divide\@tempdimb by\@tempcnta
	% \@tempdimb is now b f/(1-f), so subtract it from \textwidth and 
	% \evensidemargin:
	\addtolength\textwidth{-\@tempdimb}
	\addtolength\evensidemargin{\@tempdimb}
	\RM@oclwarninfo{3}
		{D: I had to decrease \protect\textwidth\space	by:\MessageBreak
		\the\@tempdimb\space to \the\textwidth\space\MessageBreak
		and increase \protect\evensidemargin\space by\MessageBreak
		\the\@tempdimb\space to \the\evensidemargin}
\fi
%
% There, now doesn't that feel better?
%%
%%
%%    Calculate \oddsidemargin
%%    ........................
%%
% Now calculate \oddsidemargin.  \osm must be set equal to \esm if printing 
% onesided or centred; if printing twosided, \osm must be set to the size of the 
% right margin on even pages.
%
% begin by assuming that we are printing (onesided or centred)
\setlength\oddsidemargin{\evensidemargin}
% Then change \osm if we are printing (twosided and notcentred)
\ifRM@twoside
	\ifRM@centre
		\relax
	\else% if (twoside and notcentre)
%		set osm to size of right margin on even pages
		\setlength\oddsidemargin{\paperwidth}
		\addtolength\oddsidemargin{-2in}
		\addtolength\oddsidemargin{-\evensidemargin}
		\addtolength\oddsidemargin{-\textwidth}
	\fi% endifRM@centre
\fi% endifRM@twoside
%%
%%
%%    Re-check \textwidth
%%    ...................
%%
% And finally, ensure that \textwidth is still big enough\ldots
%
\ifdim\textwidth<\RM@mintextwidth
	\RM@Error
		{I can't make \protect\textwidth as wide as 
			\protect\RM@mintextwidth.\MessageBreak
		See the log file for more details}
		{If I've only complained about this problem once on this run,
			\MessageBreak
		try centred printing, or just a reduced offset.}
\fi
%%
%%
%%    Calculate \marginparwidth and \marginparsep
%%    ...........................................
%%
% Begin by working out a new value of \marginparsep:
%
\RM@ocl{1}
	{\typeout{Initial value:}
	\RM@ttval{\marginparsep}}{}
%
\RM@scalebyoption{\marginparsep}{\RM@mparsepoption}
%
% Now that marginparsep has its final value, calculate marginparwidth...
% Keep the reports, because things get quite hairy here and I might 
% forget what's going on...
%
\ifRM@twoside
	\if@reversemargin
		\RM@ocl{1}
			{\typeout{marginparwidth setting: twoside, reversemarginpars}}{}
		\setlength\marginparwidth{\oddsidemargin}
		\addtolength\marginparwidth{1in}
	\else
		\RM@ocl{1}
			{\typeout{marginparwidth setting: twoside, normalmarginpars}}{}
		\setlength\marginparwidth{\evensidemargin}
		\addtolength\marginparwidth{1in}
	\fi% endif@reversemargin
\else
	\if@reversemargin
		\RM@ocl{1}
			{\typeout{marginparwidth setting: oneside, reversemarginpars}}{}
		\setlength\marginparwidth{\evensidemargin}
		\addtolength\marginparwidth{1in}
	\else
		\RM@ocl{1}
			{\typeout{marginparwidth setting: oneside, normalmarginpars}}{}
		\setlength\marginparwidth{\paperwidth}
		\addtolength\marginparwidth{-\textwidth}
		\addtolength\marginparwidth{-\evensidemargin}
		\addtolength\marginparwidth{-1in}
	\fi% endif@reversemargin
\fi% endifRM@twoside
%
% Minor bobble: if you're printing in more than one column, marginal 
% notes end up in the margin nearest the current column, so the smallest 
% margin provides the limit...  What with one thing and another, 
% the easiest way of finding out which one this is is by calculating the 
% size of the margins, to the left and right, and testing.
%
% Only do this check for classes other than slides, because slides can 
% only have one column.
\RM@OnClassType{5}{}
	{\ifnum\RM@textcols=1
	\else
		\RM@ocl{1}
			{\typeout{marginparwidth setting: multicolumn setttings}}{}
		\setlength{\marginparwidth}{\paperwidth}
		\addtolength{\marginparwidth}{-\textwidth}
		\addtolength{\marginparwidth}{-\evensidemargin}
		\addtolength{\marginparwidth}{-2in}
		\ifdim\marginparwidth>\evensidemargin
			\setlength{\marginparwidth}{\evensidemargin}
		\fi
		\addtolength{\marginparwidth}{1in}
	\fi}% endRM@OnClassType
%
% Use the one typeout for both reports; hopefully more efficient that 
% otherwise.  Certainly uglier.
%
\RM@ocl{1}
	{\typeout
		{Assumed size of marginal paragraph 
			margin = \the\marginparwidth^^JInitial value:}
	\RM@ttval{\RM@mparclearance}}{}
%
\RM@scalebyoption{\RM@mparclearance}{\RM@mparclearoption}
%
% \marginparwidth is now as big as the margin space the notes will 
% appear in, and \RM@mparclearance has its final value.
%
% Finish calculating \marginparwidth...
%
% The minimum space allowed between the edge of the paper and the mpar is 
% \RM@mparclearfrac * \paperwidth; this product is placed in 
% \@tempdimb.  If the specified min[left|right]clearance is greater 
% than this value, the min[l|r]clearance is used instead.
%
%
%
% Gap between note and text
\addtolength\marginparwidth{-\marginparsep}
%
% I wish I knew why some of these ifs don't work the way I expect.
%
\relax
\ifdim\RM@minrightclearance>\RM@minleftclearance\relax
	\@tempdima=\RM@minrightclearance
	\RM@ocl{1}{\typeout{\protect\RM@minrightclearance\space is greater than
		\protect\RM@minleftclearance}}{}
\else
	\@tempdima=\RM@minleftclearance
	\RM@ocl{1}{\typeout{\protect\RM@minleftclearance\space is greater than
		\protect\RM@minrightclearance}}{}
\fi% endifdim

\relax
\ifdim\@tempdima<\RM@mparclearance\relax
	\@tempdima=\RM@mparclearance
	\RM@ocl{1}{\typeout{\protect\RM@mparclearance\space is greater than
		\protect\RM@min[left/right]clearance}}{}
\fi% endifdim

% \@tempdima is now the larger of \RM@minlclearance, 
% \RM@minrclearance, and \RM@mparclearance.  Use this dimension 
% as the minimum marginal paragraph clearance.

\RM@ocl{1}
	{\typeout{\protect\marginparwidth\space reduced by 
		\the\@tempdima\space (space to the paper's edge)^^J
		\space\space\space to \the\marginparwidth}}{}

\addtolength\marginparwidth{-\@tempdima}

%
% Final value is reported at the end of rmpage
%
\RM@ocl{1}{
	\typeout{Initial value}
	\RM@ttval{\RM@maxmparwidth}
	}{}

\RM@scalebyoption{\RM@maxmparwidth}{\RM@maxmparwidthoption}

\ifdim\marginparwidth>\RM@maxmparwidth% 2in std 2e
	\setlength\marginparwidth{\RM@maxmparwidth}
	\RM@ocl{1}
		{\typeout
			{\protect\marginparwidth\space reduced to
				\the\marginparwidth\space
				(\protect\RM@maxmparwidth limit)}
		}{}
\fi
%
\ifdim\marginparwidth<0pt\marginparwidth=0pt\fi
\ifdim\marginparwidth<\RM@ptperchar% Too small to hold one average character
	\RM@oclwarninfo{3}
		{\protect\marginparwidth\space= 
		\the\marginparwidth; this is less than one\MessageBreak
		character wide.	If you intend to use marginal\MessageBreak
		notes, you probably need to enlarge the margin\MessageBreak 
		that marginal notes appear in} 
\fi%endifdim\marginparwidth<\RM@ptperchar
%
% END OF THE SECTION THAT WAS REVISED 25/2/96.
%%
%%
%%    \subsection{Check column width for legibility}
%%
\RM@ocl{2}{
	\typeout{Before calculating column width:}
	\RM@ttval{\textwidth}
	}{}
%
\setlength{\@tempdima}{\textwidth}
%
% Now calculate one column width.  \rmpage can handle any number of 
% columns; there's options up to 10 columns, which is the multicol 
% package limit.  You can create an option to set \RM@textcols to 
% anything you like.
%
% Only do this check for classes other than slides, because slides can 
% only have one column.
\RM@OnClassType{5}{}
	{\ifnum\RM@textcols=0
	% Avoid dividing by zero...
		\RM@Error{You can't have zero columns}
			{\protect\RM@textcols\protect is zero.
				This shouldn't happen.}
	\else
		\@tempcnta=\RM@textcols
		\advance\@tempcnta by-1
		\addtolength\@tempdima{-\@tempcnta\columnsep}
		\divide\@tempdima by\RM@textcols
	\fi}% endRM@OnClassType
%
%
\RM@ocl{2}{
	\typeout{\space\space\space
		the width of one column = \the\@tempdima}
	}{}
% Do odd things to measure character width of one column
% 
\addtolength\@tempdima{\@tempdima}% 2 x column width
\@tempcnta=\@tempdima
\setlength\@tempdimb{0.2\RM@ptperchar}% ptperchar / 5
\divide\@tempcnta by\@tempdimb% characters wide x 10
%
% It'd be tricky to get this information anywhere else in rmpage et al.
% Always at least log this information.
%
\RM@ocl{3}
	{\typeout
		{\space\space\space
		 the width of one column = \the\@tempcnta\space (characters x 10)
		}}
	{\PackageInfo{rmpage}
		{the width of one column = \the\@tempcnta\space characters x 10 wide}}
%
% Warn if there's too many or too few characters across one column.  
% Standard spread of columnwidth according to the textbooks is 1.5-2.5 x 
% the width of the alphabet.  I use a more sophisticated way of 
% measuring the width of a character than just banging down a complete 
% (lower-case) alphabet (not that it makes any difference to legibility, 
% I wouldn't have thought).  My way gives a points-per-character 
% measurement of about 12\% more than the simple way, so the textbook 
% textwidth spread is about 39 (43.7) to 65 (75) characters (my measured 
% characters in brackets.  Seen the 75 character upper limit before?).
%
% Rather than be overly proscriptive, merely warn if column width 
% exceeds normal width or is less than 41 characters (measured my way; 
% that's about 37 textbook characters).  I've entered the warning 
% separately for each point size in case I feel like changing my mind 
% later on, and varying things for each point size.
%
% I feel there should be a more elgant way of doing this, but I can't 
% figure one out yet.
%
\def\RM@toowideQ#1#2{\relax\ifnum #1>#2 \relax
	\protect\RM@oclwarninfo{3}
		{\protect\textwidth\space is too wide for comfy reading}\fi}
\def\RM@toonarrowQ#1#2{\relax\ifnum #1<#2 \relax
	\protect\RM@oclwarninfo{3}
		{\protect\textwidth\space is too narrow for comfy reading}\fi}

% Different code for slides, because slides can only have one typesize 
% and doesn't define \@ptsize
\RM@OnClassType{5}% slides code
{\RM@toowideQ{\@tempcnta}{700}
\RM@toonarrowQ{\@tempcnta}{410}}{}
%
% std classes except slides
\RM@OnTextwidthGroup{0}
{\ifcase\RM@ptsizegroup \relax
%    10pt
	\RM@toowideQ{\@tempcnta}{785}
	\RM@toonarrowQ{\@tempcnta}{410}	
\or% 11pt
	\RM@toowideQ{\@tempcnta}{748}
	\RM@toonarrowQ{\@tempcnta}{410}	
\or% 12pt
	\RM@toowideQ{\@tempcnta}{755}
	\RM@toonarrowQ{\@tempcnta}{410}	
\else% unknown
	\RM@Warn{I don't know what this point size is}
\fi
}{}% end std classes except slides
%%

% foils class
\RM@OnTextwidthGroup{2}{
\ifcase\RM@ptsizegroup \relax
%    17pt
	\RM@toowideQ{\@tempcnta}{750}
	\RM@toonarrowQ{\@tempcnta}{410}	
\or% 20pt
	\RM@toowideQ{\@tempcnta}{730}
	\RM@toonarrowQ{\@tempcnta}{410}	
\or% 25pt
	\RM@toowideQ{\@tempcnta}{715}
	\RM@toonarrowQ{\@tempcnta}{410}	
\or% 30pt
	\RM@toowideQ{\@tempcnta}{700}
	\RM@toonarrowQ{\@tempcnta}{410}	
\else% unknown
	\RM@Warn{I don't know what this point size is}
\fi}{}% end foils class settings
%
% odd classes
\RM@OnTextwidthGroup{3}{
	\RM@toowideQ{\@tempcnta}{785}
	\RM@toonarrowQ{\@tempcnta}{410}	
}{}% end odd class stuff
%
% local odd classes; these limits are extreme.
\RM@OnTextwidthGroup{4}{
	\RM@toowideQ{\@tempcnta}{785}
	\RM@toonarrowQ{\@tempcnta}{410}	
}{}% end local odd classes checking
%
\let\RM@toowideQ\@undefined
\let\RM@toonarrowQ\@undefined
%% 
%%    End of what was rmpwnorm
%%    ------------------------
%%
%%
%%    \subsection{Post width setting hook}
%%
\RM@executehook{RM@AfterWidthSetting}
%%
%%
%%    \section{End of page layout setting}
%%
%%
%%
%%    \section{Begin miscellaneous stuff}
%%
% Everything below here is extra bits and bobs: stuff to change 
% linebreaking (or paragraph forming?) parameters, and some code to 
% change the \today command.  And right at the end is the `tell the 
% user what I've done' code, and some \lets to free up memory (it 
% says here).
%%
%%
%%    \subsection{Change typesetting parameters}
%%
% Many of the values below were recommended by Alan Jeffries
%
% Code below from latex.ltx; consider using the sloppiness commands to 
% re-define \fussy and \sloppy?  --- \sloppy is used by default by 
% LaTeX's standard classes for \twocolumn setting.  See notes above: the 
% values suggested by Jeffries for fontinst founts shouldn't be used 
% anymore: Sebastian Rahtz says the metrics have been changed 
% (11/95).  But they're still tighter than cmr and give bad line 
% breaks too often for my liking, but looseish seems a better 
% looseness now.  Perhaps I might change the sloppiness command so 
% that the looseish settings are used for a loose, and everything is 
% changed around that?  I'd greatly appreciate anybody's opinion on 
% this one: my head's exploded.
%
% setting by default
% % \def\sloppy{%
% %   \tolerance 9999%
% %   \emergencystretch 3em%
% %   \hfuzz .5\p@
% %   \vfuzz\hfuzz}
% % \def\sloppypar{\par\sloppy}
% % \def\endsloppypar{\par}
% % \def\fussy{%
% %   \emergencystretch\z@
% %   \tolerance 200%
% %   \hfuzz .1\p@
% %   \vfuzz\hfuzz}
%
%
% sloppiness{0}=fussy LaTeX
% sloppiness{1}=fussier
% sloppiness{2}=close to Alan Jeffries's suggestion for fontinst founts
% sloppiness{3}=sloppier
% sloppiness{4}=sloppiest
% sloppiness{5}=sloppier than sloppy
%
\def\sloppiness#1{\@tempcnta=#1
	\ifnum\@tempcnta<0
		\GenericError{}
		{You've asked for a negative looseness}
		{See the rmpage package documentation for further information}
		{Change your document when you get the chance;
				I'll assume you meant 0 for now}
		\@tempcnta=0
	\fi
	\ifnum\@tempcnta>5
		\GenericError{}
		{You've asked for a looseness greater than 5}
		{See the rmpage package documentation for further information}
		{Change your document when you get the chance;
				I'll assume you meant 4 for now}
		\@tempcnta=5
	\fi
	\ifcase\@tempcnta
		% 0
		\relax
		\tolerance200
		\pretolerance100
		\emergencystretch0em
		\hfuzz0.1pt
		\leftskip0pt
		\rightskip0pt
		\hyphenpenalty50
		\exhyphenpenalty50
		\doublehyphendemerits10000
		%\interlinepenalty0  Don't affect pagebreaking (yet?)
		%\clubpenalty150
		%\widowpenalty150
	\or%1
		\tolerance400
		\pretolerance200
		\emergencystretch0.03\textwidth% default 0
		\hfuzz0.1pt
		\leftskip0pt
		\rightskip0pt minus 0.1pt
		\hyphenpenalty=25
		\exhyphenpenalty=35
		\doublehyphendemerits5000
	\or%2
		\tolerance800% default 200 
		\pretolerance400% default 100
		\emergencystretch0.06\textwidth% default 0; AJ says 2em
		\hfuzz0.1pt%default 0.1pt
		\leftskip0pt%default 0; AJ says 0pt-1pt;
		\rightskip0pt minus 0.15pt%default 0; AJ says 0pt-1pt;
		\hyphenpenalty0% AJ value; default 50
		\exhyphenpenalty25%  AJ value; default 50.
		\doublehyphendemerits2500%  AJ value; default 10000;
	\or%3
		\tolerance1200
		\pretolerance600
		\emergencystretch0.09\textwidth
		\hfuzz0.1pt
		\leftskip0pt
		\rightskip0pt minus 0.23pt
		\hyphenpenalty0
		\exhyphenpenalty12
		\doublehyphendemerits1000
	\or%4
		\tolerance1600
		\pretolerance800
		\emergencystretch0.12\textwidth% default 0; AJ says 2em for fontinst fonts
		\hfuzz0.1pt
		\leftskip0pt minus0.1pt
		\rightskip0pt minus0.34pt
		\hyphenpenalty=0
		\exhyphenpenalty=0
		\doublehyphendemerits100
	\or%5 --- sloppier than sloppy for psfounts in 2 cols
		\tolerance9999
		\pretolerance1600
		\emergencystretch0.21\textwidth% 
		\hfuzz0.1pt
		\vfuzz0.5pt
		\leftskip0pt minus0.15pt
		\rightskip0pt minus0.5pt
		\hyphenpenalty0
		\exhyphenpenalty0
		\doublehyphendemerits0
	\else
		\GenericError{}
		{This can't happen}
		{See the rmpage package documentation for further information}
		{Maybe it has; I think I have a bug}
	\fi
	\if@twocolumn
		\emergencystretch0.5\emergencystretch
	\fi
}
%
% Then set the level of typesetting tightness that has been set by the 
% code above.
%
\sloppiness{\RM@looseoption}
%%
%%
%%    \subsection{Change date format if asked}
%%
\ifRM@nicedate% From nicedate.sty; changed
	\def\today{%
		\ifcase\day\or 1st\or 2nd\or 3rd\or 4th\or 5th\or%
		6th\or 7th\or 8th\or 9th\or 10th\or 11th\or 12th\or 13th\or 14th\or%
		15th\or 16th\or 17th\or 18th\or 19th\or 20th\or 21st\or 22nd\or%
		23rd\or 24th\or 25th\or 26th\or 27th\or 28th\or 29th\or 30th\or%
		31st\else 666th\fi\space%
	\ifcase\month\or%
		January\or February\or March\or April\or May\or June\or %
		July\or August\or September\or October\or November\or %
		December\else yraunaJ\fi\space%
	\number\year}%
	\fi

%%
%%
%%    \subsection{Report final layout etc parameters}
%%
\RM@ocl{3}
	{
	\typeout{\RM@percentsign}
	\typeout{\RM@percentsign\space -----------------------}
	\typeout{\RM@percentsign\space LaTeX layout parameters}
	\typeout{\RM@percentsign\space -----------------------}
	\typeout{\RM@percentsign}
	\RM@ttval{\paperheight}
	\RM@ttval{\textheight}
	\RM@ttval{\paperwidth}
	\RM@ttval{\textwidth}
	}
	{
	\PackageInfo{rmpage}{LaTeX layout parameters}
	\RM@infotheval{\paperheight}
	\RM@infotheval{\textheight}
	\RM@infotheval{\paperwidth}
	\RM@infotheval{\textwidth}
	}% end \RM@ocl{3}: report main final values

\RM@ocl{2}{
	\RM@ttval{\topmargin}
	\RM@ttval{\headsep}
	\RM@ttval{\headheight}
	\RM@ttval{\footskip}
	\RM@ttval{\columnsep}
	\RM@ttval{\marginparsep}
	\RM@ttval{\marginparwidth}
	\RM@ttval{\evensidemargin}
	\RM@ttval{\oddsidemargin}
	\ifRM@nicedate
		\typeout{\RM@percentsign\space ! Redefined the
			\protect\today\space  command}
	\fi
	\ifnum\RM@looseoption=0
	\else
	\typeout{\RM@percentsign\space Changed LaTeX linebreaking parameters:}
		\RM@ttval{\tolerance}
		\RM@ttval{\pretolerance}
		\RM@ttval{\emergencystretch}
		\RM@ttval{\hfuzz}
		\RM@ttval{\leftskip}
		\RM@ttval{\rightskip}
		\RM@ttval{\hyphenpenalty}
		\RM@ttval{\exhyphenpenalty}
		\RM@ttval{\doublehyphendemerits}
	\typeout{\RM@percentsign\space End changed LaTeX linebreaking parameters}
	\fi
	\typeout{\RM@percentsign}
	\typeout{\RM@percentsign\space ---------------------------}
	\typeout{\RM@percentsign\space End LaTeX layout parameters}
	\typeout{\RM@percentsign\space ---------------------------}
	\typeout{\RM@percentsign}
	\setlength\@tempdima{\paperwidth}
	\addtolength\@tempdima{-\textwidth}
	\typeout{\space\space\space
		\paperwidth-\textwidth = \the\@tempdima}
	\setlength\@tempdimb{\oddsidemargin}
	\addtolength\@tempdimb{1in}
	\setlength\@tempdima{\evensidemargin}
	\addtolength\@tempdima{1in}
	\typeout{\space\space\space
		\evensidemargin + 1in = \the\@tempdima}
	\typeout{\space\space\space
		\oddsidemargin + 1in = \the\@tempdimb}
	\setlength\@tempdima{\evensidemargin}
	\addtolength\@tempdima{1in}
	\setlength\@tempdima{-\@tempdima}
	\addtolength\@tempdima{\paperwidth}
	\addtolength\@tempdima{-\textwidth}
	\typeout{\space\space\space
		opposite evensidemargin = \the\@tempdima}
	\setlength\@tempdima{\oddsidemargin}
	\addtolength\@tempdima{1in}
	\setlength\@tempdima{-\@tempdima}
	\addtolength\@tempdima{\paperwidth}
	\addtolength\@tempdima{-\textwidth}
	\typeout{\space\space\space
		opposite oddsidemargin = \the\@tempdima}
	\RM@ttval{\baselineskip}
	\typeout{\protect\rmpage\space package parameters}
	\RM@ttval{\RM@totalfootclearance}
	\RM@ttval{\RM@totalheadclearance}
	\RM@tval{\RM@minrightclearance}
	\RM@tval{\RM@minleftclearance}
	\RM@tval{\RM@minheadclearance}
	\RM@tval{\RM@minfootclearance}
	\RM@tval{\RM@mintextwidth}
	\RM@tval{\RM@maxtextwidth}
	\RM@tval{\RM@mintextheight}
	\RM@tval{\RM@maxtextheight}
	\RM@tval{\RM@minbottommargin}
	\RM@tval{\RM@mintopmargin}
	\RM@tval{\RM@mininsidemargin}
	\RM@tval{\RM@minoutsidemargin}
	\RM@ttval{\RM@ptperchar}
	\RM@ttval{\RM@offsetfrac}
	\RM@tval{\RM@textcols}
	\RM@ttval{\RM@mparclearance}
	\RM@ttval{\RM@maxmparwidth}
	\RM@tval{\RM@ifbeton}
	\ifcase\RM@looseoption
		\typeout{tight typesetting}
		\or\typeout{looseish typesetting}
		\or\typeout{loose typesetting}
		\or\typeout{looser typesetting}
		\or\typeout{loosest typesetting}
		\or\typeout{psuedo sloppy typesetting}
	\else
		\ifnum\RM@looseoption=205
			\RM@Error{Undefined typesetting tightness}
				{A bug has evolved: Rowland should fix this.}
		\else
			\RM@Error{Unknown typesetting tightness}
				{A silly bug has evolved: Rowland should
					 be hassled for inventing it}
		\fi% endifnum
	\fi% endifcase
}{}% end \RM@ocl{2}: report final values

\RM@ocl{1}{
	\RM@ttval{\RM@widthoption}
	\RM@ttval{\RM@lengthoption}
	\RM@ttval{\RM@headsepoption}
	\RM@ttval{\RM@footskipoption}
	\RM@ttval{\RM@columnsepoption}
	\RM@ttval{\RM@mparsepoption}
	\RM@ttval{\RM@mparclearoption}
	\RM@ttval{\RM@offsetoption}
	\RM@ttval{\RM@totalheadfootclearance}
	\RM@tval{\RM@mintotalheadfootclearance}
	\RM@tval{\RM@maxtotalheadfootclearance}
	\RM@tval{\RM@maxpractextheight}
	\RM@tval{\RM@minpractextheight}
	\RM@tval{\RM@classtype}
	\RM@tval{\RM@textheightgroup}
	\RM@tval{\RM@textwidthgroup}
	\RM@tval{\RM@printertype}
	\RM@tval{\RM@ptrrlandclear}
	\RM@tval{\RM@ptrllandclear}
	\RM@tval{\RM@ptrtlandclear}
	\RM@tval{\RM@ptrblandclear}
	\RM@tval{\RM@ptrrportclear}
	\RM@tval{\RM@ptrlportclear}
	\RM@tval{\RM@ptrtportclear}
	\RM@tval{\RM@ptrbportclear}
	\RM@tval{\RM@ptrpostol}
	\RM@tval{\RM@papertype}
	\RM@tval{\RM@longpapertype}
	\ifRM@portlandinvert
		\typeout{\space\space\space
			\protect\RM@portlandinvert\space is true}
	\else
		\typeout{\space\space\space
			\protect\RM@portlandinvert\space is false}
	\fi
	\ifRM@portrait
		\typeout{\space\space\space
			\protect\RM@portrait\space is true}
	\else
		\typeout{\space\space\space
			\protect\RM@portrait\space is false}
	\fi
	\RM@tval{\RM@ptsize}
	\RM@tval{\RM@ptsizegroup}
	\typeout{End \protect\rmpage\space package parameters}
	\RM@OnClassType{5}{}{% Not for slides class
	\typeout{\space\space\space
				Point size: 1\@ptsize pt}
	\RM@tval{\@ptsize}}
}{}% end \RM@ocl{1}: report final values
%%
%%
%%    \subsection{Re-set \comname{baselineskip} if needed after beton changes}
%%
% If beton settings have been made, it's probably best to re-set the 
% selected fount size to what it was before I selected \normalsize 
% with beton's \baselineskip.  But it's got to be done after all the 
% reporting, so the correct value of \comname{baselineskip} is reported.
%
% If a new size/baselineskip pair was selected because the beton 
% option had been specified, and the beton package loaded, un-do the 
% changes using the saved values.  This is probably unnecessary, but 
% you never know what might be making assumptions about things.
%
\@ifpackagewith{beton}{standard-baselineskips}{}% Do nought if ...
	{
% If beton was loaded without the standard-baselineskips option, 
% 	reset the fount size/baselineskip to whatever it was before rmpage 
% 	changed it to what rmpage thinks beton will change it to.  Can't say 
% 	I like this, but do you have a better idea?
	\ifnum\RM@ifbeton<2
	    \let\@setfontsize=\beton@old@setfontsize
		\fontsize{\RM@ldf@size}{\RM@ldf@baselineskip}
		\selectfont
	\fi% endifnum\RM@ifbeton<2
	}

%%
%%
%%    \subsection{Erm, a message about warnings in the log file}
%%
\ifRM@infowarned
	\RM@Warn{I have printed some warnings in the log file}
\fi% endifRM@infowarned
%
%
%%
%%
%%    \section{Free up some space}
%%
%%
%%    \subsection{Empty stuff from rmpage}
%%
% The following \let\XXX=\@empty construction allegedy clears memory.  I 
% don't know where I got the idea, but I'll try it and see if it works.
%
\let\RM@chatlevel\@undefined
\let\RM@ocl\@undefined
\let\RM@oclwarninfo\@undefined
\let\RM@ttval\@undefined
\let\RM@tval\@undefined
\let\RM@looseoption\@undefined
\let\RM@classtype\@undefined
\let\RM@fountfamily\@undefined
\let\RM@lengthoption\@undefined
\let\RM@widthoption\@undefined
\let\RM@offsetoption\@undefined
\let\RM@printertype\@undefined
\let\RM@papertype\@undefined
\let\RM@ptrrportclear\@undefined
\let\RM@ptrlportclear\@undefined
\let\RM@ptrtportclear\@undefined
\let\RM@ptrbportclear\@undefined
\let\RM@ptrrlandclear\@undefined
\let\RM@ptrllandclear\@undefined
\let\RM@ptrtlandclear\@undefined
\let\RM@ptrblandclear\@undefined
\let\RM@minoutsidemargin\@undefined
\let\RM@mininsidemargin\@undefined
\let\RM@mintopmargin\@undefined
\let\RM@minbottommargin\@undefined
\let\RM@minrightclearance\@undefined
\let\RM@minleftclearance\@undefined
\let\RM@minfootclearance\@undefined
\let\RM@minheadclearance\@undefined
\let\RM@maxmparwidth\@undefined
\let\RM@footersfalse\@undefined
\let\RM@footerstrue\@undefined
\let\ifRM@footers\@undefined
\let\RM@headersfalse\@undefined
\let\RM@headerstrue\@undefined
\let\ifRM@headers\@undefined
\let\ifRM@loadfount\@undefined
\let\RM@loadfounttrue\@undefined
\let\RM@loadfountfalse\@undefined
\let\ifRM@nicedate\@undefined
\let\RM@nicedatetrue\@undefined
\let\RM@nicedatefalse\@undefined
\let\ifRM@adaptivecolsep\@undefined
\let\RM@adaptivecolseptrue\@undefined
\let\RM@adaptivecolsepfalse\@undefined
\let\ifRM@centre\@undefined
\let\RM@centretrue\@undefined
\let\RM@centrefalse\@undefined
\let\ifRM@twoside\@undefined
\let\RM@twosidetrue\@undefined
\let\RM@twosidefalse\@undefined
\let\RM@textcols\@undefined
\let\ifRM@portrait\@undefined
\let\RM@portraittrue\@undefined
\let\RM@portraitfalse\@undefined
\let\ifRM@stdmargins\@undefined
\let\RM@stdmarginstrue\@undefined
\let\RM@stdmarginsfalse\@undefined
\let\ifRM@infowarned\@undefined
\let\RM@infowarnedtrue\@undefined
\let\RM@infowarnedfalse\@undefined
\let\RM@ifbeton\@undefined
\let\RM@ldf@baselineskip\@undefined
\let\RM@ldf@size\@undefined
\let\RM@OnPortraitPaperSize\@undefined
\let\RM@OnLandscapePaperSize\@undefined
\let\RM@OnPrinterType\@undefined
\let\RM@PrinterPaperSettings\@undefined
\let\RM@longpapertype\@undefined
\let\RM@Error\@undefined
\let\RM@Warn\@undefined
\let\RM@portlandinverttrue\@undefined
\let\RM@portlandinvertfalse\@undefined
\let\ifRM@portlandinvert\@undefined
\let\RM@ptrpostol\@undefined
\let\RM@widthsetter\@undefined
\let\RM@OnClassType\@undefined
\let\RM@textheightgroup\@undefined
\let\RM@BeforeProcessOptions\@undefined
\let\RM@AfterProcessOptions\@undefined
\let\RM@DefineNewClasses\@undefined
\let\RM@PrinterPaperSettings\@undefined
\let\RM@BeforeWidthSetting\@undefined
\let\RM@AfterWidthSetting\@undefined
\let\RM@scalebyoption\@undefined
\let\ifRM@jackup\@undefined
\let\RM@jackupfalse\@undefined
\let\RM@jackuptrue\@undefined
\let\RM@noffilew\@undefined
\let\RM@notinexecuteoptions\@undefined
\let\RM@SetClassType\@undefined
\let\RM@OnClassExecuteOptions\@undefined
\let\RM@OnTextheightGroup\@undefined
\let\RM@totalheadfootclearance\@undefined
\let\RM@totalfootclearance\@undefined
\let\RM@totalheadclearance\@undefined
\let\RM@OnPaperSize\@undefined
\let\RM@infotheval\@undefined
\let\RM@minpractextheight\@undefined
\let\RM@maxtotalheadfootclearance\@undefined
\let\RM@maxpractextheight\@undefined
\let\RM@mintotalheadfootclearance\@undefined
\let\RM@setpsloose\@undefined
\let\RM@SetLengthAtLeast\@undefined
\let\RM@DefLengthAtLeast\@undefined
\let\RM@textwidthgroup\@undefined
\let\RM@ptsizegroup\@undefined
\let\RM@AfterInitialTextwidthSetting\@undefined
%%
%%
%%    \subsection{Clear rmpwnorm stuff}
%%
\let\RM@setptperchar\@undefined
\let\RM@ptperchar\@undefined
\let\RM@offsetfrac\@undefined
\let\RM@OnWidthOption\@undefined
\let\RM@setthisfountptperchar\@undefined
% \let\@undefined
% \let\@undefined
% 
% 
% don't \let\RM@ptsize\@undefined; maybe want to see it in document
%
% Finis
\endinput