summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/coordsys/coordsys.dtx
blob: 1221d4950f1d9ccf6744c7d06c63479966ed9607 (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
% \iffalse
% This is the coordsys package, coordsys.dtx
% Copyright 2000--06 by Mogens Lemvig Hansen.
%
% Run first coordsys.ins then this file, coordsys.dtx,
% through LaTeX and read the documentation in coordsys.dvi
%
% This program may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.2 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% This program consists of the files coordsys.dtx and coordsys.ins
%
%<*docdriver>
\documentclass{ltxdoc}[1996/01/11]
\usepackage{url,varioref,color,coordsys,logsys}
\IfFileExists{eepic.sty}{\usepackage{epic,eepic}}{\relax}
\CodelineIndex%\EnableCrossrefs
%\OnlyDescription
\MakeShortVerb{\"}
\makeatletter
\DoNotIndex{\@circlefnt, \@empty, \@ifpackageloaded, \@ifstar,
\@tempcnta, \@tempcntb, \@tempdima, \@tempdimb, \@tempdimc,
\@wholewidth, \\, \addtocounter, \addtolength, \advance,
\afterassignment, \arabic, \baselineskip, \char,
\color@begingroup, \color@endgroup, \colorbox, \count@,
\DeclareOption, \def, \divide, \edef, \ensuremath,
\ExecuteOptions, \fontdimen, \frac, \hbox, \hfill, \hrule, \hskip,
\hspace, \hss,
\if, \else, \fi, \ifdim, \fi, \ifnum, \fi, \ifx, \repeat,
\ignorespaces, \leaders, \leavevmode, \let, \line, \lineskip,
\loop, \makebox, \mbox, \MessageBreak, \multiply, \multiput, \n,
\NeedsTeXFormat, \newcommand, \newif, \next, \offinterlineskip,
\p@, \PackageError, \PackageWarning, \PassOptionsToPackage,
\phantom, \ProcessOptions, \providecommand, \ProvidesPackage,
\put, \raisebox, \relax, \renewcommand, \RequirePackage, \rule,
\scriptsize, \setcounter, \setlength, \settodepth, \settoheight,
\settowidth, \space, \stepcounter, \string, \t, \textfont, \the,
\thicklines, \thinlines, \unitlength, \value, \vbox, \vector,
\vee, \vfill, \vrule, \vskip, \vss, \wedge, \width, \z@}

\newcommand{\nextlinelabel}[2][1]{\@bsphack
   \@tempcnta\c@CodelineNo
   \advance\@tempcnta#1\relax
   \def\@currentlabel{\the\@tempcnta}\label{#2}%
   \@esphack}
\makeatother
\begin{filecontents*}{parabola.put}
-10             10
-9.5640569167   9.1471184705
-9.1847451708   8.4359543853
-8.7581694417   7.6705531969
-8.3287660917   6.936834461
-7.9014036208   6.2432179179
-7.5051839042   5.6327785435
-7.0949213375   5.0337908785
-6.6706272042   4.4497267297
-6.2476937875   3.9033677662
-5.8126547833   3.378695563
-5.4294721917   2.947916828
-4.99809935     2.4980997112
-4.56495525     2.0838816435
-4.14754065     1.7202093443
-3.7684882042   1.4201503345
-3.3177581833   1.1007519363
-2.9359307333   .8619689271
-2.4917746375   .6208940844
-2.0986212333   .4404211081
-1.6672696375   .2779788044
-1.2565209125   .1578844804
-.8279477083    .0685497408
-.4343837208    .0188689217
0               0
.4310767958     .0185827204
.8149238375     .0664100861
1.2294891583    .151164359
1.6577757       .2748220272
2.076770525     .4312975814
2.4821695625    .6161165737
2.932296075     .8598360271
3.3367547667    1.1133932373
3.76860075      1.4202351613
4.1599173958    1.730491274
4.58772985      2.1047265177
4.9902680292    2.4902775003
5.4110364125    2.9279315057
5.8224144167    3.3900509639
6.2530890625    3.9101122824
6.6678799333    4.4460622805
7.0920635083    5.0297364806
7.5127346292    5.6441181608
7.8992877       6.2398746167
8.3423211417    6.9594322031
8.7385755333    7.6362702352
9.1610653625    8.3925118576
9.5654420375    9.1497681373
10              10
\end{filecontents*}
\begin{filecontents*}{cubic.put}
-30.000000  -20.000000
-28.474199  -15.804432
-27.146608  -12.516116
-25.653593  -9.202436
-24.150681  -6.258297
-22.654913  -3.698008
-21.268144  -1.636385
-19.832225  .199365
-18.347195  1.796657
-16.866928  3.103311
-15.344292  4.170472
-14.003153  4.894524
-12.493348  5.486493
-10.977343  5.863124
-9.516392   6.039119
-8.189709   6.055876
-6.612154   5.918569
-5.275758   5.685123
-3.721211   5.298481
-2.345174   4.870173
-.835444    4.326615
.602177     3.755721
2.102183    3.124225
3.479657    2.529189
4.965449    1.889690
6.508769    1.248590
7.852233    .726681
9.303212    .218408
10.802215   -.227277
12.268697   -.565992
13.687593   -.784166
15.263036   -.879136
16.678642   -.813612
18.190103   -.566101
19.559711   -.166508
21.057054   .479871
22.465938   1.305413
23.938627   2.412189
25.378450   3.753353
26.885812   5.451531
28.337580   7.390383
29.822222   9.700301
31.294571   12.337014
32.647507   15.080062
34.198124   18.620739
35.585014   22.164125
37.063729   26.352494
38.479047   30.775514
40.000000   36.000000
\end{filecontents*}
\begin{filecontents*}{cardioid.put}
100.000000  0.000000
112.588564  15.516766
121.244557  31.750443
124.934677  41.835945
127.659260  52.494751
129.345482  63.695172
129.903543  75.248573
129.285785  86.969731
127.460693  98.778657
124.672157  109.684223
120.825477  120.432570
115.738369  131.275035
109.553790  141.702160
102.046822  151.919323
93.471064   161.432430
83.935655   170.093229
73.505467   177.822188
61.952700   184.694870
49.689167   190.381106
38.407582   194.343741
26.780487   197.281781
13.407329   199.324137
-.119421    199.999947
-13.700122  199.294213
-27.122592  197.211115
-39.763584  193.927228
-51.980365  189.433046
-62.599453  184.351359
-72.673348  178.372314
-83.827620  170.181864
-93.966999  160.931907
-101.680605     152.366833
-108.531015     143.226867
-115.353429     131.996377
-120.892496     120.269314
-124.697389     109.601644
-127.460410     98.780030
-129.296948     86.861074
-129.903806     75.032811
-129.373414     63.979985
-127.809263     53.247345
-121.489566     32.332819
-112.548072     15.455006
-100.309649     .311093
-85.706682  -11.678463
-72.243183  -18.910373
-57.735843  -23.480262
-43.580925  -24.999414
-31.218159  -23.852436
-21.108797  -20.873626
-12.318983  -16.218684
-6.659458   -11.563205
-2.788086   -6.843880
-.903254    -3.342623
-.108179    -.830565
-.000001    -.000467
.107213     -.825650
.848070     -3.209033
2.934090    -7.064121
6.712690    -11.616493
12.726954   -16.492235
20.994604   -20.827287
30.567066   -23.721204
43.583975   -24.999401
56.641796   -23.700328
71.394649   -19.264856
85.586513   -11.757441
100.000000  .000000
\end{filecontents*}
\begin{filecontents*}{csc1.put}
5.769525    100.000000
7.337294    78.302278
11.176475   51.591183
15.041105   38.533870
18.887368   30.891960
22.453345   26.182739
26.145708   22.693468
29.964355   20.021578
33.770756   17.989772
37.686107   16.357639
41.134750   15.201446
45.017106   14.137915
48.915403   13.267173
52.672134   12.575790
56.083606   12.050332
60.140176   11.530753
63.576624   11.166568
67.574028   10.818141
71.112409   10.569087
74.994573   10.353025
78.691312   10.197995
82.548471   10.085170
86.090547   10.023324
89.911154   10.000012
93.879691   10.022969
97.334315   10.082493
101.065402  10.189434
104.919981  10.348899
108.690935  10.556753
112.339526  10.811422
116.390665  11.163403
120.030793  11.550591
123.917407  12.050475
127.439256  12.594486
131.289569  13.308769
134.912412  14.120566
138.699328  15.151274
142.401730  16.390185
146.277801  18.012607
150.010919  20.006604
153.828571  22.672736
157.614611  26.258119
161.093589  30.861980
165.080890  38.841725
168.647180  50.800081
172.449588  76.104387
174.258156  100.000000
\end{filecontents*}
\begin{filecontents*}{csc2.put}
185.769525  -100.000000
187.337294  -78.302274
191.176476  -51.591181
195.041106  -38.533869
198.887368  -30.891960
202.453345  -26.182739
206.145708  -22.693468
209.964356  -20.021578
213.770756  -17.989772
217.686107  -16.357639
221.134751  -15.201446
225.017106  -14.137915
228.915403  -13.267173
232.672134  -12.575790
236.083606  -12.050332
240.140177  -11.530753
243.576624  -11.166568
247.574028  -10.818141
251.112409  -10.569087
254.994573  -10.353025
258.691312  -10.197995
262.548471  -10.085170
266.090547  -10.023324
269.911154  -10.000012
273.879691  -10.022969
277.334314  -10.082493
281.065402  -10.189434
284.919981  -10.348899
288.690935  -10.556753
292.339526  -10.811422
296.390664  -11.163403
300.030793  -11.550591
303.917407  -12.050475
307.439256  -12.594486
311.289568  -13.308769
314.912412  -14.120566
318.699327  -15.151274
322.401729  -16.390185
326.277801  -18.012607
330.010919  -20.006604
333.828571  -22.672736
337.614611  -26.258119
341.093589  -30.861980
345.080890  -38.841724
348.647179  -50.800079
352.449588  -76.104383
354.258156  -100.000000
\end{filecontents*}
\begin{filecontents*}{logistic.put}
-10.000000  -17.371858
-9.564057   -16.614591
-9.184745   -15.955715
-8.758169   -15.214772
-8.328766   -14.468968
-7.901404   -13.726787
-7.505184   -13.038795
-7.094921   -12.326581
-6.670627   -11.590267
-6.247694   -10.856714
-5.812655   -10.102801
-5.429472   -9.439561
-4.998099   -8.694276
-4.564955   -7.948131
-4.147541   -7.232254
-3.768488   -6.586185
-3.317758   -5.825368
-2.935931   -5.190082
-2.491775   -4.466789
-2.098621   -3.846618
-1.667270   -3.196723
-1.256521   -2.617930
-.827948    -2.068053
-.631166    -1.837450
-.434384    -1.622076
-.222128    -1.407750
-.009872    -1.212716
.210603     -1.030806
.431077     -.869735
.623000     -.745941
.814924     -.636672
1.229489    -.445644
1.657776    -.303009
2.076771    -.205126
2.482170    -.139415
2.932296    -.090166
3.336755    -.060688
3.768601    -.039646
4.159917    -.026906
4.587730    -.017588
4.990268    -.011779
5.411036    -.007743
5.822414    -.005135
6.253089    -.003340
6.667880    -.002207
7.092064    -.001444
7.512735    -.000948
7.899288    -.000644
8.342321    -.000414
8.738576    -.000278
9.161065    -.000182
9.565442    -.000122
10.000000   -.000079
\end{filecontents*}

\begin{document} \DocInput{coordsys.dtx} \end{document}
%</docdriver>
% \fi
% \CheckSum{2292}
% \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         \~}
%
% \def\fileversion{1.4} \def\filedate{2006/02/03} \def\docdate{\filedate}
% \title{The \textsf{coordsys} and \textsf{logsys} Packages\thanks{This
% file describes version \fileversion, \filedate.}}
% \author{\copyright\ Mogens Lemvig Hansen\thanks{%
%    The \textsf{coordsys} and \textsf{logsys} packages are distributed under
%    the \LaTeX\ Project
%    Public License; please see Section~\ref{sec:license}.}\\
% mlhansen@uniserve.com}
% \date{\docdate}
% \maketitle
% \begin{abstract}
%    The \textsf{coordsys} package provides commands for typesetting
%    number lines (coordinate axes), coordinate systems, and grids
%    in the \textsf{picture} environment.
%    The \textsf{logsys} package extends the \textsf{coordsys} package by
%    providing logarithmic, semi-logarithmic, and double-logarithmic
%    coordinate systems and grids.
% \end{abstract}
%
% \tableofcontents
%
% \section{Regular Coordinate Systems}
% Load the \textsf{coordsys} package with the "\usepackage" command.
% \begin{quote}
% "\usepackage"\oarg{options}"{coordsys}"
% \end{quote}
% The \textsf{coordsys} package has three \meta{options},
% \textsf{centred} (the default), \textsf{outside}, and \textsf{inside}, that
% control the
% appearance of tick marks; see Section~\ref{sec:tickstyle} on
% page~\pageref{sec:tickstyle}.
%
% \subsection{One Dimension}
% \DescribeMacro{\numbline}
% The "\numbline" command typesets a number line.\index{number line|(usage}
% For example,
% \begin{quote}
%   \begin{verbatim}
%     \begin{picture}(200,20)(-75,-15)
%       \numbline{-75}{125}
%     \end{picture}
%   \end{verbatim}
%     \begin{picture}(200,20)(-75,-15)
%       \numbline{-75}{125}
%     \end{picture}
% \end{quote}
% You should always use the "\numbline" command inside a
% \textsf{picture} environment.
% Do not forget to leave room for the labels on the number line.
% In the following examples I omit the "\begin{picture}"
% and "\end{picture}" commands to reduce clutter.
%
% The tick marks are by default separated by 10 units;
% give "\numbline" an optional first argument to change that.
% For example
% \begin{quote}
%   \begin{verbatim}
%       \numbline[7]{-75}{125}
%   \end{verbatim}
%     \begin{picture}(200,20)(-75,-15)
%       \numbline[7]{-75}{125}
%     \end{picture}
% \end{quote}
%
% \DescribeMacro{\numbline*}
% The starred version of "\numbline" omits the labels.
% \begin{quote}
%   \begin{verbatim}
%       \numbline*[7]{-75}{125}
%   \end{verbatim}
%     \begin{picture}(200,6)(-75,-3)
%       \numbline*[7]{-75}{125}
%     \end{picture}
% \end{quote}
%
% Thus,
% \begin{quote}
% "\numbline"\oarg{spacing}\marg{from}\marg{to}\\
% "\numbline*"\oarg{spacing}\marg{from}\marg{to}
% \end{quote}
% typeset\label{numblinesyntax} (horizontal) number lines
% from \meta{from} to \meta{to} with
% \meta{spacing}
% units between the tick marks (the default is 10);
% use the starred command to suppresses the labels.
% All the arguments must be integers.
%
% \DescribeMacro{\vnumbline}\DescribeMacro{\vnumbline*}
% The "\vnumbline" and "\vnumbline*" commands similarly
% typeset vertical number lines.
% \begin{quote}
% "\vnumbline"\oarg{spacing}\marg{from}\marg{to}\\
% "\vnumbline*"\oarg{spacing}\marg{from}\marg{to}
% \end{quote}
% The syntax is similar to that of the "\numbline" command
% \vpageref[above]{numblinesyntax}.\index{number line|)usage}
% \begin{quote}
%    \begin{minipage}{.2\linewidth}
%    \begin{picture}(20,100)(-17,20)
%       \vnumbline{20}{120}
%    \end{picture}
%    \end{minipage}
%    \qquad
%    \begin{minipage}{.6\linewidth}
%    \begin{verbatim}
%       \vnumbline{20}{120}
%    \end{verbatim}
%    \end{minipage}
% \end{quote}
%
% \subsection{Two Dimensions}
% \DescribeMacro{\coordsys}
% Use the "\coordsys"\index{coordinate system>with intersecting axes|usage}
% command to typeset coordinate systems.
% \begin{quote}
%    \begin{picture}(200,110)(-50,-50)
%       \coordsys(-50,-50)(150,60)
%       \put(75,25){\texttt{\textbackslash coordsys(-50,-50)(150,60)}}
%    \end{picture}
% \end{quote}
% \DescribeMacro{\coordsys*}
% Thus,
% \begin{quote}
% "\coordsys"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\coordsys*"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}
% \end{quote}
% typeset\label{coordsyssyntax} coordinate systems where
% \parg{ll} is the lower-left corner
% and \parg{ur} is the upper-right corner.
% The optional argument \meta{h-spacing} gives the spacing between the
% tick marks on the horizontal axis;  the default is 10 units.
% The optional argument \meta{v-spacing} gives the spacing between the
% tick marks on the vertical axis;  the default is to use the same
% spacing as on the horizontal axis.
% The starred version omits the labels.
% All the arguments must be integers.
%
% Regular coordinate systems with intersecting axes are not always
% appropriate, for example when the point $(0,0)$ is not in the range
% of the coordinate system.
% The \textsf{coordsys} package therefore provides some alternative
% styles.  All the coordinate-system-drawing commands have similar syntax.
%
% \DescribeMacro{\fcoordsys}\DescribeMacro{\fcoordsys*}
% The "\fcoordsys"\index{coordinate system>framed|usage}
%  command typesets framed coordinate systems; that is, the
% axes are at the left and bottom edges of the system.
% \begin{quote}
% "\fcoordsys"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\fcoordsys*"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}
% \end{quote}
% The syntax is similar to that of the "\coordsys" command
% \vpageref[above]{coordsyssyntax}.
% \begin{quote}
%    \begin{picture}(220,125)(30,35)
%       \fcoordsys[5](50,50)(250,160)
%       \put(155,125){\texttt{\textbackslash fcoordsys[5](-50,-50)(150,60)}}
%    \end{picture}
% \end{quote}
%
% \DescribeMacro{\bcoordsys}\DescribeMacro{\bcoordsys*}
% The "\bcoordsys"\index{coordinate system>boxed|usage}
% command typesets boxed coordinate systems.
% \begin{quote}
% "\bcoordsys"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\bcoordsys*"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}
% \end{quote}
% The syntax is similar to that of the "\coordsys" command
% \vpageref[above]{coordsyssyntax}.
% \begin{quote}
% \begin{picture}(265,125)(-70,-65)
%    \bcoordsys[15][5](-50,-50)(195,60)
%    \put(-30,25){\texttt{\textbackslash bcoordsys[15][5](-50,-50)(195,60)}}
% \end{picture}
% \end{quote}
%
% \DescribeMacro{\window}\DescribeMacro{\window*}
% The "\window" command typesets a plotting window as on a graphing
% calculator.
% \begin{quote}
% "\window"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\window*"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}
% \end{quote}
% The syntax is similar to that of the "\coordsys" command
% \vpageref[above]{coordsyssyntax}.
% \begin{quote}
% \begin{picture}(302,127)(-107,-67)
%    \window(-50,-50)(195,60)
%    \put(15,25){\texttt{\textbackslash window(-50,-50)(195,60)}}
% \end{picture}
% \end{quote}
% The labels will look nicer if you use the \textsf{amstext} package (which is
% part of the \textsf{amsmath} package).
%
% \DescribeMacro{\coordgrid}
% The "\coordgrid"\index{grid|(usage}\index{grid>dotted|usage}
% command typesets a coordinate grid.
% \begin{quote}
% \begin{picture}(300, 125)
%    \coordgrid(0,0)(300,125)
%    \put(15,25){\texttt{\textbackslash coordgrid(0,0)(300,125)}}
% \end{picture}
% \end{quote}
% The "\coordgrid" command does not print any labels
% but you can superimpose a coordinate system.
% \begin{quote}
% \begin{verbatim}
%    \coordgrid[15][5](-50,-50)(195,60)
%    \coordsys[15][5](-50,-50)(195,60)
% \end{verbatim}
% \begin{picture}(245,110)(-50,-50)
%    \coordgrid[15][5](-50,-50)(195,60)
%    \coordsys[15][5](-50,-50)(195,60)
% \end{picture}
% \end{quote}
% If you load the \textsf{color} package before the \textsf{coordsys}
% package, the labels will be printed on a
% white background.\index{labels>background of|usage}
%
% Typesetting pretty grids with dotted lines is not easy.
% If a grid does come out ugly,\index{grid>ugly|usage}
% try to increase "\unitlength"
% to allow for more dots between the lines.
% You may also reduce the size of the dots;
% see the "\gridstyle" command \vpageref[below]{gridstyle}.
% \DescribeMacro{\coordgrid*}
% Alternatively you can use the "\coordgrid*" command which
% typesets a coordinate grid with solid lines.\index{grid>solid|usage}
% You could then use the
% \textsf{color} package to colour the grid, say, gray; again, see
% the "\gridstyle" command \vpageref[below]{gridstyle}.
%
% Thus,
% \begin{quote}
% "\coordgrid"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\coordgrid*"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}
% \end{quote}
% typeset coordinate grids with a syntax similar to that of
% the "\coordsys" command \vpageref[above]{coordsyssyntax}.
% The starred version uses solid lines;
% the un-starred version uses dotted lines.\index{grid|)usage}
%
% \DescribeMacro{\gridstyle}\label{gridstyle}
% The default size of the dots is the with of "\thinlines"
% and "\thicklines".\index{grid>size of dots|usage}\index{grid>style|(usage}
% If you intend to print your grids at a
% sufficiently high resolution, you should reduce the size of the
% dots by issuing a "\gridstyle" command.  On my 600\,dpi printer,
% these sizes look nice for points:
% \begin{quote}
% \begin{verbatim}
% \gridstyle{\linethickness{0.24pt}}{\linethickness{0.48pt}}
% \end{verbatim}
% \gridstyle{\linethickness{0.24pt}}{\linethickness{0.48pt}}
% \begin{picture}(245,110)(-50,-50)
%    \coordgrid[15][5](-50,-50)(195,60)
%    \coordsys[15][5](-50,-50)(195,60)
% \end{picture}
% \end{quote}
% When I use solid lines, I can get away with half that,
% \begin{quote}
% \begin{verbatim}
% \gridstyle{\linethickness{0.12pt}}{\linethickness{0.24pt}}
% \end{verbatim}
% \gridstyle{\linethickness{0.12pt}}{\linethickness{0.24pt}}
% \begin{picture}(245,110)(-50,-50)
%    \coordgrid*[15][5](-50,-50)(195,60)
%    \coordsys[15][5](-50,-50)(195,60)
% \end{picture}
% \end{quote}
%
% If you make grids for the screen, I recommend using
% colour.\index{grid>coloured|usage}  For example,
% \begin{quote}
% \begin{verbatim}
% \definecolor{gray}{gray}{0.5}
% \definecolor{lightgray}{gray}{0.75}
% \gridstyle{\thinlines\color{lightgray}}{\thinlines\color{gray}}
% \coordgrid*(-109,-65)(200,100)
% \coordsys(-109,-65)(200,100)
% \end{verbatim}
% \begin{picture}(245,110)(-50,-50)
% \definecolor{gray}{gray}{0.5}
% \definecolor{lightgray}{gray}{0.75}
% \gridstyle{\thinlines\color{lightgray}}{\thinlines\color{gray}}
%    \coordgrid*[15][5](-50,-50)(195,60)
%    \coordsys[15][5](-50,-50)(195,60)
% \end{picture}
% \end{quote}
%
% In general,
% \begin{quote}
% "\gridstyle"\marg{thin declaration}\marg{thick declaration}
% \end{quote}
% Note that these are \emph{declarations}: the \meta{thin declarations}
% apply also to the thick grid lines unless explicitly overruled by the
% \meta{thick declaration}.
% The current "\gridstyle" applies to all types of grids:
% dotted, solid, regular, or logarithmic.
% The default style is
% "\gridstyle{\thinlines}{\thicklines}".\label{defaultgridstyle}\index{grid>style|)usage}
%
%
% \subsection{Bells and Whistles}
% \subsubsection{Manual Labels}
% \DescribeMacro{\sethlabel}\DescribeMacro{\setvlabel}
% All the number-line and coordinate-system commands format the
% labels\index{labels>manual|usage}\index{manual labels|usage} using
% the commands "\sethlabel" (for labels on horizontal axes) and
% "\setvlabel" (for labels on vertical axes).  If you set labels manually,
% you should use the same commands for a uniform appearance.
% \begin{quote}
% \begin{verbatim}
%    \numbline{-75}{125}
%    \put(125,0){\sethlabel{x}}
% \end{verbatim}
% \begin{picture}(200,20)(-75,-15)
%    \numbline{-75}{125}
%    \put(125,0){\sethlabel{x}}
% \end{picture}
% \end{quote}
% The syntax is
% \begin{quote}
% "\sethlabel"\oarg{alignment}\marg{label}\\
% "\setvlabel"\oarg{alignment}\marg{label}
% \end{quote}
% The \meta{label} is set in math mode.
% The default \meta{alignment} is "[t]" for "\sethlabel" and
% "[r]" for "\setvlabel". You may want to add to these defaults
% (as in "\sethlabel[tl]"); you probably do not want to replace the
% defaults.
%
% If you want your labels set in some other style, you must re-define
% "\sethlabel" and "\setvlabel".
%
% \subsubsection{Thick Tick Density}
% \DescribeMacro{\hthickratio}
% \DescribeMacro{\vthickratio}
% By default every fifth tick mark is
% thick.\index{thick ticks|usage}\index{ticks>ratio of thick|usage}
% You can change that by redefining
% the commands "\hthickratio" and "\vthickratio".
% \begin{quote}
% \begin{verbatim}
% \renewcommand{\hthickratio}{4}
% \numbline[25]{0}{350}
% \end{verbatim}
% \setlength{\unitlength}{.3pt}
% \begin{picture}(350,80)(0,-50)
% \renewcommand{\hthickratio}{4}
% \numbline[25]{0}{350}
% \end{picture}
% \end{quote}
%
% \subsubsection{Different Scales on the Two Axes}
% \DescribeMacro{\rescaleby}
% LaTeX\ (the \textsf{picture} environment) does not support different
% scales\index{labels>re-scaled|usage}\index{scaling labels|usage}
% on the two axes; "\unitlength" is used for both the
% horizontal and the vertical direction.
% However, you may create the \emph{appearance} of different scales by
% scaling the labels on the axes.
% Here is a coordinate system that has been rigged to contain the graph of
% $y=x^2$ for $x$ between $-10$ and $10$.
% \begin{quote}
% \setlength{\unitlength}{5pt}
% \rescaleby{10}{1}{\vlabel}
% \begin{picture}(22,15)(-10,-3)
% \coordsys[1](-10,0)(12,12)
% \end{picture}
% \begin{minipage}[b]{.5\linewidth}
% \begin{verbatim}
% \rescaleby{10}{1}{\vlabel}
% \coordsys[1](-10,0)(12,12)
% \end{verbatim}
% \end{minipage}
% \end{quote}
% That is,
% \begin{quote}
% "\rescaleby"\oarg{symb}\marg{num}\marg{den}\marg{cmd}
% \end{quote}
% multiplies the labels by $\frac{\meta{num}}{\meta{den}}\meta{symb}$;
% both \meta{num} and \meta{den} must be integers;
% and \meta{den} must be positive.\footnote{Multiplying the labels by
% a negative number does not reverse the arrows, so I suggest using
% boxed coordinate systems in that case.}
% The optional argument, if present, represents a symbolic
% (non-numeric) scale factor; see the example below.
% The last argument, \meta{cmd}, must be one of "\hlabel"
% or "\vlabel".
%
% The following coordinate system has been rigged for graphing $\sin$ or
% $\cos$.  Note that only that labels have been scaled;
% the real coordinates of the small circle are still $(90,50)$.
% \begin{quote}
% \begin{verbatim}
% \renewcommand{\hthickratio}{6}
% \rescaleby[\pi]{1}{180}{\hlabel}
% \rescaleby{1}{100}{\vlabel}
% \coordsys[15][10](0,-100)(400,115)
% \put(90,50){\circle{6}}
% \end{verbatim}
% \setlength{\unitlength}{.5pt}
% \begin{picture}(435,215)(-35,-100)
% \renewcommand{\hthickratio}{6}
% \rescaleby[\pi]{1}{180}{\hlabel}
% \rescaleby{1}{100}{\vlabel}
% \coordsys[15][10](0,-100)(400,115)
% \put(90,50){\circle{6}}
% \end{picture}
% \end{quote}
%
% \subsubsection{Different Styles of Tick Marks}
% \label{sec:tickstyle}
% \DescribeMacro{\tickstyle}
% As you can affect the width of the dots or lines of a
% "\coordgrid" with a "\gridstyle" command,
% so you can affect the width of the tick marks with a
% "\tickstyle"\index{ticks>style of|usage} command:
% \begin{quote}
% "\tickstyle"\marg{thin declaration}\marg{thick declaration}
% \end{quote}
% Note that these are \emph{declarations}: the \meta{thin declarations}
% apply also to the thick tick marks unless explicitly overruled by the
% \meta{thick declaration}.\footnote{And the declarations that apply
% to the thick tick marks spill over to the labels which maybe they
% shouldn't, so let's not talk about that.}
% The default style is
% "\tickstyle{\thinlines}{\thicklines}".\footnote{When
% I wrote \vpageref[above]{defaultgridstyle} that the default grid style is
% \texttt{\textbackslash gridstyle\{\textbackslash thinlines\}\{\textbackslash
% thicklines\}} I lied.  The default grid style is the follow the current
% \texttt{\textbackslash tickstyle}.}
%
% \DescribeMacro{\ticklength}
% The "\ticklength" command controls the length of the
% tick marks.\index{ticks>length of|usage}
% \begin{quote}
% \begin{verbatim}
% \tickstyle{\thinlines\renewcommand{\ticklength}{4pt}}
%           {\thinlines\renewcommand{\ticklength}{8pt}}
% \end{verbatim}
% \tickstyle{\thinlines\renewcommand{\ticklength}{4pt}}
%           {\thinlines\renewcommand{\ticklength}{8pt}}
% \begin{picture}(200,20)(-75,-15)
% \numbline{-75}{125}
% \end{picture}
% \end{quote}
% Note that the \emph{command} "\ticklength" must be changed with
% "\renewcommand".
%
% If you prefer tick marks\index{ticks>style of|usage}
% just on the outside of the coordinate axes, load
% \textsf{coordsys} with the \textsf{outside} option.
% \begin{quote}
% \begin{verbatim}
% \usepackage[outside]{coordsys}
% \end{verbatim}
% \makeatletter
% \renewcommand{\vtickmark}{\makebox(0,0)[t]{\rule{\@wholewidth}{3pt}}}
% \renewcommand{\htickmark}{\makebox(0,0)[r]{\rule{3pt}{\@wholewidth}}}
% \makeatother
% \begin{picture}(200,110)(-50,-50)
%    \coordsys(-50,-50)(150,60)
% \end{picture}
% \end{quote}
%
% Similarly, the \textsf{inside} option puts the tick marks on the inside of
% the axes.  The default option is \textsf{centred}.
%
%
%
% \section{Logarithmic Coordinate Systems}
% Load the \textsf{logsys} package with the "\usepackage" command.
% \begin{quote}
% "\usepackage"\oarg{options}"{coordsys,logsys}"
% \end{quote}
% The \textsf{logsys} package supports the same options, \textsf{centred},
% \textsf{outside}, and \textsf{inside}, as the \textsf{coordsys} package.
%
% \subsection{One Dimension}
% \DescribeMacro{\logline}
% The "\logline" command typesets a horizontal, logarithmic number
% line.\index{number line>logarithmic|(usage}
% \begin{quote}
% \begin{verbatim}
% \logline{-60}{210}
% \end{verbatim}
% \begin{picture}(270,20)(-60,-15)
% \logline{-60}{210}
% \end{picture}
% \end{quote}
% The "\logline" command typesets only whole blocks of tick marks
% (whole powers of $10$).
% Making the axis long enough that the tick marks do not
% collide with the arrow and yet not so long that it looks ridiculous is the
% users responsibility.
% The default distance between the thick tick marks (the powers of $10$) is
% 50~units.
% Therefore I made the axis above extend from $-60$ (a bit below $-50$ which
% appears as $10^{-1} = \frac1{10}$) to $210$ (a bit above $200$ which appears
% as $10^4$).
%
% \DescribeMacro{\logline*}
% Thus,\label{loglinesyntax}
% \begin{quote}
% "\logline"\oarg{spacing}\marg{from}\marg{to}\\
% "\logline*"\oarg{spacing}\marg{from}\marg{to}
% \end{quote}
% typeset horizontal, logarithmic number lines from \meta{from} to
% \meta{to} with \meta{spacing} units between the powers of $10$; the default
% is 50.
% The starred version omits the labels.
% All the arguments must be integers.
%
% The "\logline" command only typesets an axis; it does not change the
% way \LaTeX\ and the \textsf{picture} environment interprets coordinates.
% The equation below gives the relationship between the coordinate to
% "\put", $x_p$, and the apparent coordinate,
% $x_a$.\index{labels>logarithmic|usage}
% \[
% x_p = \meta{spacing} \log_{10} x_a.
% \]
% For example:
% \begin{quote}
% \begin{verbatim}
% \logline[40]{-50}{210}
% \put(87.04,10){\makebox(0,0)[b]{150}} % 40*log(150) = 87.04
% \put(87.04,10){\vector(0,-1){10}}
% \end{verbatim}
% \begin{picture}(260, 40)(-50,-15)
% \logline[40]{-50}{210}
% \put(87.04,10){\makebox(0,0)[b]{150}} ^^A% 40*log(150) = 87.04
% \put(87.04,10){\vector(0,-1){10}}
% \end{picture}
% \end{quote}
%
% \DescribeMacro{\vlogline}
% \DescribeMacro{\vlogline*}
% The vertical equivalent is "\vlogline":
% \begin{quote}
% "\vlogline"\oarg{spacing}\marg{from}\marg{to}\\
% "\vlogline*"\oarg{spacing}\marg{from}\marg{to}
% \end{quote}
% The syntax is similar to that of the "\logline" command
% \vpageref[above]{loglinesyntax}.\index{number line>logarithmic|)usage}
%
%
% \subsection{Two Dimensions}
% \DescribeMacro{\logsys}
% Use the "\logsys"\index{coordinate system>logarithmic|(usage}
% command to typeset logarithmic coordinate systems.
% \begin{quote}
%    \begin{picture}(220,125)(-70,-65)
%       \logsys[5](-50,-50)(150,60)
%       \put(55,25){\texttt{\textbackslash logsys[5](-50,-50)(150,60)}}
%    \end{picture}
% \end{quote}
% \DescribeMacro{\logsys*}
% Thus,
% \begin{quote}
% "\logsys"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\logsys*"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}
% \end{quote}
% typeset coordinate systems with logarithmic vertical axis,
% where \parg{ll} is the lower-left corner
% and \parg{ur} is the upper-right corner.
% The optional argument \meta{h-spacing} gives the spacing between the
% tick marks on the horizontal axis;  the default is 10 units.
% The optional argument \meta{v-spacing} gives the spacing between the
% thick tick marks (powers of $10$) on the vertical axis;
% the default is 50 units.
% The starred version omits the labels.
% All the arguments must be integers.
%
% \DescribeMacro{\semilogsys}
% Use the "\semilogsys" command to typeset semi-logarithmic
% coordinate systems.
% \begin{quote}
%    \begin{picture}(230,125)(-70,-65)
%       \semilogsys[25](-50,-50)(160,60)
%       \put(55,25){\texttt{\textbackslash semilogsys[25](-50,-50)(160,60)}}
%    \end{picture}
% \end{quote}
% \DescribeMacro{\semilogsys*}
% Thus,
% \begin{quote}
% "\semilogsys"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\semilogsys*"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}
% \end{quote}
% typeset coordinate systems with logarithmic horizontal axis,
% where \parg{ll} is the lower-left corner
% and \parg{ur} is the upper-right corner.
% The optional argument \meta{h-spacing} gives the spacing between the
% thick tick marks (powers of $10$) on the horizontal axis;
% the default is 50 units.
% The optional argument \meta{v-spacing} gives the spacing between the
% tick marks on the vertical axis;
% the default is 10 units.
% The starred version omits the labels.
% All the arguments must be integers.
%
% \DescribeMacro{\loglogsys}
% Use the "\loglogsys" command to typeset double-logarithmic
% coordinate systems.
% \begin{quote}
%    \begin{picture}(230,125)(-70,-65)
%       \loglogsys(-50,-50)(160,60)
%       \put(55,25){\texttt{\textbackslash loglogsys(-50,-50)(150,60)}}
%    \end{picture}
% \end{quote}
% \DescribeMacro{\loglogsys*}
% Thus,
% \begin{quote}
% "\loglogsys"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\loglogsys*"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}
% \end{quote}
% typeset coordinate systems with two logarithmic axes,
% where \parg{ll} is the lower-left corner
% and \parg{ur} is the upper-right corner.
% The optional argument \meta{h-spacing} gives the spacing between the
% thick tick marks (powers of $10$) on the horizontal axis;
% the default is 50 units.
% The optional argument \meta{v-spacing} gives the spacing between the
% thick tick marks (powers of $10$) on the vertical axis;
% the default is 50 units.
% The starred version omits the labels.
% All the arguments must be
% integers.\index{coordinate system>logarithmic|)usage}
%
% \DescribeMacro{\loggrid}
% \DescribeMacro{\loggrid*}
% \DescribeMacro{\semiloggrid}
% \DescribeMacro{\semiloggrid*}
% \DescribeMacro{\logloggrid}
% \DescribeMacro{\logloggrid*}
% The "\loggrid",\index{grid>logarithmic|(usage}
% "\loggrid*", "\semiloggrid",
% "\semiloggrid*", "\logloggrid", and "\logloggrid*" commands
% typeset logarithmic grids.
% \begin{quote}
% \begin{verbatim}
% \logloggrid*(0,0)(300,100)
% \end{verbatim}
% \begin{picture}(300, 100)
%    \logloggrid*(0,0)(300,100)
% \end{picture}
% \end{quote}
% Thus,
% \begin{quote}
% "\loggrid"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\loggrid*"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\semiloggrid"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\semiloggrid*"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\logloggrid"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}\\
% "\logloggrid*"\oarg{h-spacing}\oarg{v-spacing}\parg{ll}\parg{ur}
% \end{quote}
% typeset logarithmic, semi-logarithmic, and double-logarithmic
% coordinate grids where \parg{ll} is the lower-left corner
% and \parg{ur} is the upper-right corner.
% The optional argument \meta{h-spacing} gives the spacing between the
% vertical grid lines and
% the optional argument \meta{v-spacing} gives the spacing between the
% horizontal grid lines;
% The default spacing is 10 units on linear axes and 50 units between the
% thick tick marks (the powers of $10$) on logarithmic axes.
% The starred versions use solid lines;
% the un-starred versions use dotted lines.
% All the arguments must be integers.\index{grid>logarithmic|)usage}
%
%
% \section{Filling the Coordinate Systems}
% The purpose of the \textsf{coordsys} and \textsf{logsys} packages
% is to typeset coordinate systems, so maybe the package should end here.
% However, I have had to write a bit of code to help me fill my
% coordinate systems, so I'll share that.
%
% \subsection{Intervals}
% \DescribeMacro{\interval}
% The "\interval" command takes as argument an interval in standard notation
% and draws it on the horizontal coordinate axis or number line.
% \begin{quote}
% \begin{verbatim}
% \numbline{-15}{65}
% \interval[-7.5,30)
% \end{verbatim}
% \begin{picture}(80,15)(-15,-12)
% \numbline{-15}{65}
% \interval[-7.5,30)
% \end{picture}
% \end{quote}
% The interval can be open, half-open, or closed as in
% $(a,b)$, $(a,b]$, $[a,b)$, and $[a,b]$\footnote{The notation
% $\left]a,b\right[$ for open (or half-open) intervals is also
% supported.}  You can specify infinite intervals with "<" or ">".
% \begin{quote}
% \begin{verbatim}
% \numbline{-15}{65}
% \interval<-14,30[
% \end{verbatim}
% \begin{picture}(80,15)(-15,-12)
% \numbline{-15}{65}
% \interval<-14,30[
% \end{picture}
% \end{quote}
% \DescribeMacro{\intervalthickness}
% The "\intervalthickness" command sets the thickness of the fat line
% that marks the interval.
% An optional argument allows you to draw the fat line off centre.
% \begin{quote}
% \begin{verbatim}
% \numbline{-15}{65}
% \intervalthickness[0.5pt]{1pt}
% \interval[-7.5,30]
% \color{red}
% \intervalthickness[-0.5pt]{1pt}
% \interval(10,55>
% \end{verbatim}
% \begin{picture}(80,15)(-15,-12)
% \numbline{-15}{65}
% \intervalthickness[0.5pt]{1pt}
% \interval[-7.5,30]
% \color{red}
% \intervalthickness[-0.5pt]{1pt}
% \interval(10,55>
% \end{picture}
% \end{quote}
% \DescribeMacro{\vinterval}
% The "\vinterval" command similarly draws intervals on the vertical axis.
% \begin{quote}
% \begin{verbatim}
% \fcoordsys[5](150,50)(350,160)
% \interval[200,300]
% \vinterval(75,150>
% \end{verbatim}
% \begin{picture}(220,125)(130,35)
%    \fcoordsys[5](150,50)(350,160)
%    \interval[200,300]
%    \vinterval(75,150>
% \end{picture}
% \end{quote}
%
% To sum up:
% \begin{quote}
% "\interval"\meta{L-delim}\meta{from}","\meta{to}\meta{R-delim}\\
% "\vinterval"\meta{L-delim}\meta{from}","\meta{to}\meta{R-delim}\\
% "\intervalthickness"\oarg{offset}\marg{width}
% \end{quote}
% Here \meta{L-delim} must be one of "[", "(", "<", or "]", and
% \meta{R-delim} must be one of "]", ")", ">", or "[".
% Both \meta{from} and \meta{to} are numbers, integers or
% decimals\footnote{Due to implementation details, a decimal
% must have at least one digit on either side of the decimal point.
% Thus \texttt{0.5} is ok but \texttt{.5} is not.}
% Both \meta{offset} and \meta{width} must be lengths.
% The centre of the fat interval line will drawn \meta{offset} above the
% horizontal axis or \meta{offset} to the right of the vertical axis.
%
%
% \subsection{Curves}
% For plotting curves\index{curves|(usage}
% I recommend the \textsf{epic} and
% \textsf{eepic} packages.\footnote{Both are old \LaTeX209 packages that work
% fine in \LaTeXe.  The \textsf{eepic} package re-implements the \textsf{epic}
% package making use of \textsc{PostScript}.  The \textsf{eepic} package
% works well with dvips and dvipdfm but not with pdf\LaTeX.}
% I especially like \textsf{(e)epic}'s "\putfile" command which allows
% you to calculate your plot with some external program, export the points to
% plot to a text file, and import that file to have \LaTeX\  draw the plot.
% For external program I use Maple.\index{curves>with Maple|usage}
% The \textsf{coordsys} package includes a piece of
% Maple code that exports a Maple plot in the form "\putfile" expects.
% You can therefore take advantage of Maple adaptive plotting
% algorithm\footnote{Maple cleverly calculates more points where the curve
% wiggles.} in your \LaTeX\ plots.
%
% Here is how it works:\index{putfile|usage}
% In Maple, read in the file \url{putfile} which is part of the
% \textsf{coordsys} package.
% \begin{verbatim}
% > read "/where/you/placed/putfile";
% \end{verbatim}
% Make your plot, here $y=\frac{x^2}{10}$.
% \begin{verbatim}
% > plot( x^2/10, x=-10..10, title="x^2/10");
% \end{verbatim}
% When you are happy with your plot, assign it to a variable.
% \begin{verbatim}
% > P := %:
% \end{verbatim}
% Then use the "putfile" command to export the curve to the file
% \url{parabola.put}.
% \begin{verbatim}
% > putfile( "parabola.put", P );
% \end{verbatim}
%
% In \LaTeX, use the "\putfile" command to put "\picsquare"s at each
% point listed in \url{parabola.put}.
% \begin{quote}
% \begin{verbatim}
% \coordsys[1](-10,0)(11,11)
% \putfile{parabola.put}{\picsquare}
% \end{verbatim}
% \ifx\putfile\undefined
%    You do not have the \textsf{epic} and \textsf{eepic} packages,
%    so \LaTeX\ cannot generate the result of the above commands.
% \else
% \setlength{\unitlength}{7pt}
% \begin{picture}(21,13)(-10,-2)
% \coordsys[1](-10,0)(11,11)
% \putfile{parabola.put}{\picsquare}
% \end{picture}
% \fi
% \end{quote}
%
% The \textsf{(e)epic} package provides an environment,
% \textsf{drawjoin}, that joins all points set with the
% special "\put" command "\jput".
% Thus, to draw a curve with the "\putfile" command you enter a
% \textsf{drawjoin} environment, let "\put" be a synonym for
% "\jput", and call "\putfile".
% \begin{quote}
% \begin{verbatim}
% \coordsys[1](-10,0)(11,11)
% \begin{drawjoin}
%    \let\put=\jput
%    \putfile{parabola.put}{\picsquare}
% \end{drawjoin}
% \end{verbatim}
% \ifx\putfile\undefined
%    You do not have the \textsf{epic} and \textsf{eepic} packages,
%    so \LaTeX\ cannot generate the result of the above commands.
% \else
% \setlength{\unitlength}{7pt}
% \begin{picture}(21,13)(-10,-2)
% \coordsys[1](-10,0)(11,11)
% \begin{drawjoin}
%    \let\put=\jput
%    \putfile{parabola.put}{\picsquare}
% \end{drawjoin}
% \end{picture}
% \fi
% \end{quote}
%
% To draw a curve that requires (or looks best with) different scales on
% the two axes, you can use the "scale" option to
% "putfile"\index{curves>scaled|(usage}\index{putfile>scale|(usage}
% in Maple:
% \begin{verbatim}
% > plot( (x+2)*(x-1)*(x-2), x=-3..4 );
% > putfile( "cubic.put", %, scale=[10, 1] );
% \end{verbatim}
% Now all the $x$-coordinates in "cubic.put" are $10$ times larger
% than they should be.  Thus re-scale the horizontal labels
% by~$\frac{1}{10}$.\index{labels>re-scaled|(usage}\index{scaling labels|(usage}
% \begin{quote}
% \begin{verbatim}
% \rescaleby{1}{10}{\hlabel}
% \coordsys[2](-30,-20)(40,36)
% \begin{drawjoin}
%    \let\put=\jput
%    \putfile{cubic.put}{\picsquare}
% \end{drawjoin}
% \end{verbatim}
% \ifx\putfile\undefined
%    You do not have the \textsf{epic} and \textsf{eepic} packages,
%    so \LaTeX\ cannot generate the result of the above commands.
% \else
% \setlength{\unitlength}{2.3pt}
% \begin{picture}(70,56)(-30,-20)
% \rescaleby{1}{10}{\hlabel}
% \coordsys[2](-30,-20)(40,36)
% \begin{drawjoin}
%    \let\put=\jput
%    \putfile{cubic.put}{\picsquare}
% \end{drawjoin}
% \end{picture}
% \fi
% \end{quote}
%
% Scaling can be necessary even when the two axes do use the same
% scale.  Consider the graph of $r=1+\sin\theta$ in polar coordinates.  The
% graph is $2.6$ units wide and $2.25$ units tall.  All the arguments to the
% "\coordsys" command must be integers, so the smallest distance between
% tick marks is $1$ unit; the coordinate system will have very few tick marks.
% Instead scale up by, say, a factor $100$.
% In Maple:
% \begin{verbatim}
% > polarplot( 1+sin(theta), theta=0..2*Pi );
% > putfile( "cardioid.put", %, scale=[100,100] );
% \end{verbatim}
% In \LaTeX:
% \begin{quote}
% \begin{verbatim}
% \rescaleby{1}{100}{\hlabel}
% \rescaleby{1}{100}{\vlabel}
% \coordsys(-130,-25)(130,215)
% \begin{drawjoin}
%    \let\put=\jput
%    \putfile{cardioid.put}{\picsquare}
% \end{drawjoin}
% \end{verbatim}
% \ifx\putfile\undefined
%    You do not have the \textsf{epic} and \textsf{eepic} packages,
%    so \LaTeX\ cannot generate the result of the above commands.
% \else
% \setlength{\unitlength}{0.5pt}
% \begin{picture}(260,240)(-130,-25)
% \rescaleby{1}{100}{\hlabel}
% \rescaleby{1}{100}{\vlabel}
% \coordsys(-130,-25)(130,215)
% \begin{drawjoin}
%    \let\put=\jput
%    \putfile{cardioid.put}{\picsquare}
% \end{drawjoin}
% \end{picture}
% \fi
% \end{quote}
%
% If the plot contains more than one curve,
% "putfile"\index{putfile>multiple curves|usage} generates
% one file for each.  You can of course specify multiple curves
% directly, but they can also be the result of the "discont"
% option to "plot".
% \begin{verbatim}
% > plot( csc(x), x=0..2*Pi, y=-10..10, discont=true );
% > putfile( "csc.put", %, scale=[180/Pi, 10] );
% \end{verbatim}
% Here "putfile" wrote two files calling them "csc1.put"
% and "csc2.put".  These two curves must be drawn by different
% \textsf{drawjoin} environments.
% \begin{quote}
% \begin{verbatim}
% \renewcommand{\hthickratio}{3}
% \rescaleby[\pi]{1}{180}{\hlabel}
% \rescaleby{1}{10}{\vlabel}
% \coordsys(0,-100)(360,115)
% \begin{drawjoin}
%    \let\put=\jput
%    \putfile{csc1.put}{\picsquare}
% \end{drawjoin}
% \begin{drawjoin}
%    \let\put=\jput
%    \putfile{csc2.put}{\picsquare}
% \end{drawjoin}
% \end{verbatim}
% \ifx\putfile\undefined
%    You do not have the \textsf{epic} and \textsf{eepic} packages,
%    so \LaTeX\ cannot generate the result of the above commands.
% \else
% \setlength{\unitlength}{0.5pt}
% \begin{picture}(400,215)(-40,-100)
% \renewcommand{\hthickratio}{3}
% \rescaleby[\pi]{1}{180}{\hlabel}
% \rescaleby{1}{10}{\vlabel}
% \coordsys(0,-100)(360,115)
% \begin{drawjoin}
%    \let\put=\jput
%    \putfile{csc1.put}{\picsquare}
% \end{drawjoin}
% \begin{drawjoin}
%    \let\put=\jput
%    \putfile{csc2.put}{\picsquare}
% \end{drawjoin}
% \end{picture}
% \fi
% \end{quote}
%
% For logarithmic plots
% scaling\index{curves>logarithmic|usage}\index{scaling labels>logarithmic|usage}
% is almost always necessary.
% Consider the
% graph of $y=\frac{1}{1+e^{-x}}$ for $x$ running from $-10$ to $10$.
% The $y$-coordinates extend over five powers of $10$, so scale by $4$
% to make it comparable to the range of $x$-coordinates.
% \begin{verbatim}
% > logplot(1/(1+exp(-x)), x=-10..10);
% > putfile("logistic.put", %, scale=[1,4]);
% \end{verbatim}
% The "\rescaleby" command is not suitable for logarithmic axes.
% Instead set the optional \meta{spacing} argument to the correct
% distance between the powers of~$10$, in this case~$4$.
% \begin{quote}
% \begin{verbatim}
% \logsys[1][4](-10,-20)(11,1)
% \begin{drawjoin}
%    \let\put=\jput
%    \putfile{logistic.put}{\picsquare}
% \end{drawjoin}
% \end{verbatim}
% \ifx\putfile\undefined
%    You do not have the \textsf{epic} and \textsf{eepic} packages,
%    so \LaTeX\ cannot generate the result of the above commands.
% \else
% \setlength{\unitlength}{7pt}
% \begin{picture}(25,23)(-14,-22)
% \definecolor{gray}{gray}{0.5}
% \definecolor{lightgray}{gray}{0.75}
% \gridstyle{\linethickness{0.12pt}\color{lightgray}}%
%           {\linethickness{0.12pt}\color{gray}}
% \loggrid*[1][4](-10,-20)(11,1)
% \logsys[1][4](-10,-20)(11,1)
% \color{red}
% \begin{drawjoin}
%    \let\put=\jput
%    \putfile{logistic.put}{\picsquare}
% \end{drawjoin}
% \end{picture}
% \fi
% \end{quote}
% \index{curves>scaled|)usage}\index{putfile>scale|)usage}%
% \index{labels>re-scaled|)usage}\index{scaling labels|)usage}
%
% Use the "putfile" command as follows:\index{putfile>syntax|usage}
% \begin{quote}
% "putfile(" \meta{filename}"," \meta{PLOT structure} [","
% \meta{options} ] ");"
% \end{quote}
% If \meta{filename} is a string and the \meta{PLOT structure} contains
% more than one curve, "putfile" will append $1, 2, 3, \dots$ as needed;
% "putfile" also appends an extension of ".tex" if the \meta{filename}
% has no extension.
% If the \meta{filename} is a list or set of filenames, they are used
% as is. (So if you do not want "putfile" to meddle with your filename,
% give it in a set.)
%
% The only possible option is\index{putfile>scale|(usage}
% \begin{quote}
% "scale" "=" "[" \meta{number}"," \meta{number} "]"
% \end{quote}
% The "putfile" command will multiply all $x$-coordinates by the first
% number and all $y$-coordinates by the second number.
% Both numbers must be "evalf"able.
%
% If you scale the coordinates of a curve, you must
% of course compensate for that to get an honest
% representation of your data in \LaTeX.
% \begin{itemize}
% \item If you scale a regular (linear) axis by, say,
% "scale=[3/5,1]", you should use "\rescaleby{5}{3}{\hlabels}"
% to re-scale the labels.
%
% \item If you scale a logarithmic axis by, say, "scale=[1,30]"
% you should use the optional \meta{spacing} argument to
% the command that draws the coordinate system, say
% "\logsys[30]("\dots
% \end{itemize}\index{putfile>scale|)usage}\index{curves|)usage}
%
%
% \section{Installation}
% Extract\index{installation|usage} the \url{.sty} files from
% the \url{.dtx} file by running \url:coordsys.ins: through \LaTeX.
% Then generate the documentation for the \textsf{coordsys} and
% \textsf{logsys} packages
% by running the file \url:coordsys.dtx: through
% \LaTeX---thrice to resolve cross references.\footnote{If you want an index,
% you must run MakeIndex
% (\texttt{makeindex -s gind.ist coordsys}) between the second and third
% \LaTeX{} run.}
%
% You now have to decide what to do with several files.
% \begin{itemize}
% \item Move the files \url:coordsys.sty: and \url:logsys.sty: to some
% directory where \LaTeX\ can find it;
% \url:(local)texmf/tex/latex/misc: would be
% the natural choice.
% \item Move the documentation, \url:coordsys.dvi: or \url:coordsys.pdf:, to
% \url:(local)texmf/doc/latex/misc:.
% \item You may discard the source files, \url:coordsys.dtx: and
% \url:coordsys.ins:, or store them in
% \url:(local)texmf/source/latex/misc:.
% \item If you ran \url{coordsys.dtx} through \LaTeX, several \url{.put}
% were created.  You can discard those.
% \end{itemize}
%
%
%
% \section{License}\label{sec:license}
% This program may be distributed and/or modified under the
% conditions of the \LaTeX\ Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   \url;http://www.latex-project.org/lppl.txt;
% and version 1.2 or later is part of all distributions of \LaTeX \
% version 2003/12/01 or later.
%
% This program consists of the files \url:coordsys.dtx: and
% \url:coordsys.ins:.
%
%
% \section{Acknowledgements}
% Thank you to Scott Pakin
% for his input on the implementation of Euclid's
% algorithm.
%
% Thank you to Svend Daugaard Pedersen
% for catching an error in the logarithmic systems
% and for suggestions that led to "\gridstyle".
%
% Thank you to Staffan Lundberg
% who found an error in my understanding
% of Maple's structured types and thus prompted me to polish the
% Maple code for "putfile".
%
% Thank you to Jan Hegewald
% whose questions led to an improved description and implementation
% of "\rescaleby".
%
%
% \StopEventually{
%    \PrintIndex
% }
%
% \section{Implementation}
%
% \subsection{The \textsf{coordsys} Package}
% \subsubsection{Identification}
% First we must declare ourselves.
%    \begin{macrocode}
%<*coordsys>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{coordsys}[2006/02/03 version 1.4]
%    \end{macrocode}
%
% \subsubsection{Declaration of Options}
% \begin{macro}{\ticklength}
% \begin{macro}{\vtickmark}
% \begin{macro}{\htickmark}
% The options define "\ticklength", "vtickmark", and
% "\htickmark".  First check that these three commands are not defined
% elsewhere.
%    \begin{macrocode}
\newcommand{\ticklength}{\relax}
\newcommand{\vtickmark}{\relax}
\newcommand{\htickmark}{\relax}
%    \end{macrocode}
% The "\vtickmark" and "\htickmark" commands set the individual
% ticks; "\vtickmark" sets vertical ticks on a horizontal axis,
% and "\htickmark" sets horizontal ticks on a vertical axis.
% "\@wholewidth" is the current line width,
% that is, the width of "\thinlines" or "\thicklines".
%    \begin{macrocode}
\DeclareOption{centred}{%
   \def\vtickmark{\makebox(0,0){\rule{\@wholewidth}{\ticklength}}}%
   \def\htickmark{\makebox(0,0){\rule{\ticklength}{\@wholewidth}}}%
   \def\ticklength{6\p@}%
}
\DeclareOption{outside}{%
   \def\vtickmark{\makebox(0,0)[t]{\rule{\@wholewidth}{\ticklength}}}%
   \def\htickmark{\makebox(0,0)[r]{\rule{\ticklength}{\@wholewidth}}}%
   \def\ticklength{3\p@}%
}
\DeclareOption{inside}{%
   \def\vtickmark{\makebox(0,0)[b]{\rule{\@wholewidth}{\ticklength}}}%
   \def\htickmark{\makebox(0,0)[l]{\rule{\ticklength}{\@wholewidth}}}%
   \def\ticklength{3\p@}%
}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \subsubsection{Execution of Options}
% The default option is \textsf{centred}.
%    \begin{macrocode}
\ExecuteOptions{centred}
\ProcessOptions
%    \end{macrocode}
%
% \subsubsection{Main Code}
% \begin{macro}{\vgridfromto}
% \begin{macro}{\hgridfromto}
% The "\vgridfromto" and "\hgridfromto" commands typeset vertical
% and horizontal dotted lines for the dotted coordinate grids.
% \begin{quote}
% "\vgridfromto"\marg{from}\marg{to}\\
% "\hgridfromto"\marg{from}\marg{to}
% \end{quote}
% The dotted line is to run from ($y$- or $x$-coordinate) \meta{from} to ($y$-
% or $x$-coordinate) \meta{to}.  The two commands set the lines by means of
% leaders in a box.  The box is set at $y$- or $x$-coordinate zero and the
% leaders extend to the right length by skipping back and forth.  This way the
% dots line up nicely in a predictable manner.  When "\vgridfromto" or
% "\hgridfromto" is called, "\coordsys@w" should contain the size
% (height or width) of the box containing each dot.
%    \begin{macrocode}
\newcommand{\vgridfromto}[2]{%
   \vbox to \z@{\vskip -#2\unitlength
               \leaders\vbox to \coordsys@w{\vss\hbox{\picsquare}\vss}
                  \vfill
               \vskip #1\unitlength}}
\newcommand{\hgridfromto}[2]{%
   \hbox to \z@{\hskip #1\unitlength
            \leaders\hbox to \coordsys@w{\hss\picsquare\hss}\hfill
            \hskip-#2\unitlength}}
%    \end{macrocode}
% \end{macro}\end{macro}
% \begin{macro}{\vgridlength}
% \begin{macro}{\hgridlength}
% The "\vgriglength" and "\hgridlength" command typesets
% solid vertical and horizontal lines.
% \begin{quote}
% "\vgridlength"\marg{length}\\
% "\hgridlength"\marg{length}
% \end{quote}
% The line is to have length \meta{length} and is set at the left-hand or
% bottom edge of the coordinate system.
%    \begin{macrocode}
\newcommand{\vgridlength}[1]{\line(0,1){#1}}
\newcommand{\hgridlength}[1]{\line(1,0){#1}}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\setvlabel}
% \begin{macro}{\sethlabel}
% The "\setvlabel" and "\sethlabel" commands typeset the labels on
% the vertical and horizontal axes, respectively.
% The "\setvlabel" command sets 5\,pt of space between the label and the
% axis, which is about right, considering that the tick marks extend 3\,pt on
% either side of the axis.
% The "\sethlabel" command places the labels on a baseline 3\,pt plus
% the current "\baselineskip" below the axis by means of a strut (a
% zero-width rule).\nextlinelabel{cl:setlabels}
%    \begin{macrocode}
\@ifpackageloaded{color}{%
   \newcommand{\setvlabel}[2][r]{%
      \makebox(0,0)[#1]{\colorbox{white}{$#2$}\hspace{5pt}}}
   \newcommand{\sethlabel}[2][t]{%
      \makebox(0,0)[#1]{%
         \setlength{\@tempdimc}{3pt}%
         \addtolength{\@tempdimc}{\baselineskip}%
         \rule{0pt}{\@tempdimc}\colorbox{white}{$#2$}}}%
}{% no colour
   \newcommand{\setvlabel}[2][r]{%
      \makebox(0,0)[#1]{$#2$\hspace{5\p@}}}
   \newcommand{\sethlabel}[2][t]{%
      \makebox(0,0)[#1]{%
         \setlength{\@tempdimc}{3\p@}%
         \addtolength{\@tempdimc}{\baselineskip}%
         \rule{\z@}{\@tempdimc}$#2$}}%
}% end if color package
%    \end{macrocode}
% You may want to redefine "\setvlabel" and "\sethlabel" to present
% the labels in a different way---use a smaller font, increase the distance to
% the axes,\dots.  Your redefined commands must take one optional and one
% mandatory argument---the "\window" command uses the optional argument.
% Do not assume that the mandatory argument is always a number---the
% "\window" command uses "\setvlabel" and "\sethlabel" to
% typeset the min\slash max labels.
% \end{macro}\end{macro}
%
% \begin{macro}{\hlabel}
% \begin{macro}{\vlabel}
% The "\hlabel" and "\vlabel" commands calculate the labels that
% "\setvlabel" and "\sethlabel" typeset.  The default definitions
% of "\hlabel" and "\vlabel" do nothing, but you can redefine them
% with the "\rescaleby" command.
%    \begin{macrocode}
\newcommand{\hlabel}[1]{#1}%
\newcommand{\vlabel}[1]{#1}%
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\rescaleby}
% The "\rescaleby" command redefines it's fourth argument
% (the third mandatory argument)
% which should be either "\hlabel" or "\vlabel".
% After
% \begin{quote}
% "\rescaleby"\oarg{symb}\marg{num}\marg{den}"{\hlabel}"
% \end{quote}
% the result of "\hlabel"\marg{x} should be
% $\frac{\meta{num}\times \meta{x}}{\meta{den}} \meta{symb}$.
%    \begin{macrocode}
\newcommand{\rescaleby}[4][]{\renewcommand{#4}[1]{{%
   \count@=##1\relax
   \ifnum\count@=0\relax
      \@tempcntb=1\relax
   \else
      \multiply\count@ #2\relax
      \ifnum\count@<0\count@=-\count@\fi
      \@EuclidGCD{\count@}{#3}%
      \count@=##1\relax
      \multiply\count@ #2\relax
      \divide\count@\@tempcnta
      \@tempcntb=#3\relax
      \divide\@tempcntb\@tempcnta
   \fi
%    \end{macrocode}
% We have reduced the fraction.  Now print it nicely.
%    \begin{macrocode}
   \ifnum\count@<0\relax
      -%
      \count@=-\count@
   \fi
   \def\coordsys@a{#1}%
   \ifx\coordsys@a\@empty\relax
      \ifnum\@tempcntb=1\relax
         \the\count@
      \else
         \frac{\the\count@}{\the\@tempcntb}%
      \fi
   \else
      \ifnum\@tempcntb=1\relax
         \ifnum\count@=1\relax
            \coordsys@a
         \else
            \the\count@\coordsys@a
         \fi
      \else
         \ifnum\count@=1\relax
            \frac{\coordsys@a}{\the\@tempcntb}%
         \else
            \frac{\the\count@}{\the\@tempcntb}\coordsys@a
         \fi
      \fi
   \fi
}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hthickratio}
% \begin{macro}{\vthickratio}
% By default every fifth tick mark is thick.
%    \begin{macrocode}
\newcommand{\hthickratio}{5}
\newcommand{\vthickratio}{5}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\text}
% Hopefully the \textsf{amstext} package will override this very simple
% "\text" command intended for subscripts only.
%    \begin{macrocode}
\providecommand{\text}[1]{\mbox{\scriptsize #1}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\picsquare}
% The "\picsquare" command typesets a square of size the current line
% width---as in the \textsf{epic} package.
%    \begin{macrocode}
\providecommand{\picsquare}{%
   \makebox(0,0){\rule{\@wholewidth}{\@wholewidth}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\count@}
% \begin{macro}{\c@@coord}
% \begin{macro}{\@tenpcnta}
% \begin{macro}{\@tenpcntb}
% \begin{macro}{\if@numbline}
% We need three counters.  \LaTeX\ inherits one, "\count@", from plain
% \TeX\ and defines two more, "\@tempcnta" and "\@tempcntb".
% We create a \LaTeX\ counter, "@coord",\nextlinelabel{cl:@coord} without
% allocating a new counter
% by making "\c@@coord" a synonym for "\count@"\footnote{I don't
% quite understand why I bother do that; I copied the idea from Lamport's
% \textsf{graphpap} package, which is where the \textsf{coordsys} package
% began.}
% The "\if" controls whether to set labels.
%    \begin{macrocode}
\let\c@@coord\count@
\newif\if@numbline
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\tickstyle}
% \begin{macro}{\thin@ticks}
% \begin{macro}{\thick@ticks}
% The commands "\thin@ticks" and "\thick@ticks" store the style of
% the tick marks.  The "\tickstyle" command defines those two.  The
% default is "\thinlines" for the thin tick marks and "\thicklines"
% for the thick tick marks.
%    \begin{macrocode}
\newcommand{\tickstyle}[2]{%
   \def\thin@ticks{#1}%
   \def\thick@ticks{#2}}
\tickstyle{\thinlines}{\thicklines}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\@set@ticks}
% The "\@set@ticks" command calculates the positions of the
% tick marks.
% \begin{quote}
% "\@set@ticks"\marg{thickratio}\marg{spacing}^^A
%    \marg{from}\marg{to}\marg{tickfree}\marg{cmd}
% \end{quote}
% \begin{macro}{\coordsys@a}
% \begin{macro}{\coordsys@b}
% \begin{macro}{\coordsys@c}
% The "\@set@ticks" command calculates three parameters:
% "\coordsys@a" is the position of the first tick;
% "\coordsys@b" is the number of ticks to set; and
% "\coordsys@c" is the spacing between the ticks (that is,
% \meta{spacing} for the thin ticks and $\meta{thickratio}\meta{spacing}$
% for the thick ticks).
% \end{macro}\end{macro}\end{macro}
% Then "\@set@ticks" calls \meta{cmd} to actually set the ticks using
% these parameters.\nextlinelabel{cl:BeginTickCalc}
%    \begin{macrocode}
\newcommand{\@set@ticks}[6]{%
   \thin@ticks
   \edef\coordsys@c{#2}%
%    \end{macrocode}
% First we must round \meta{from} up to a multiple of \meta{spacing}.
% Knuth's implementation of integer division
% always rounds toward zero,
% so for negative \meta{from} we can simply divide and multiply
% by \meta{spacing}.  If \meta{from} is positive, we must play around a
% little to round up instead of down.
%    \begin{macrocode}
   \@tempcnta=#3\relax
   \ifnum\@tempcnta>0\advance\@tempcnta -1\relax\fi
   \divide\@tempcnta \coordsys@c\relax
   \ifnum #3>0\advance\@tempcnta 1\relax\fi
   \multiply\@tempcnta \coordsys@c\relax
   \edef\coordsys@a{\the\@tempcnta}%
%    \end{macrocode}
% Then we must calculate how many ticks to set.
% To avoid collision between ticks and arrowheads,
% there is to be no ticks in the last \meta{tickfree} length.
%    \begin{macrocode}
   \@tempcntb=#4\relax
   \advance\@tempcntb -\@tempcnta\relax
   \setlength{\@tempdima}{\@tempcntb\unitlength}%
   \addtolength{\@tempdima}{-#5}%
   \ifdim\@tempdima<\z@\relax
      \def\coordsys@b{0}%
   \else
      \divide\@tempdima\unitlength\relax
      \divide\@tempdima\coordsys@c\relax
      \@tempcntb=\@tempdima%
      \advance\@tempcntb 1\relax%
      \edef\coordsys@b{\the\@tempcntb}%
   \fi
   #6%
%    \end{macrocode}
% \nextlinelabel[0]{cl:EndTickCalc}
% Then the thick ticks.
% This time the spacing is $\meta{thickratio}\meta{spacing}$, so calculate
% that number
% and store it in "\coordsys@c".
%    \begin{macrocode}
   \thick@ticks
   \@tempcntb=#1\relax
   \multiply\@tempcntb \coordsys@c\relax
   \edef\coordsys@c{\the\@tempcntb}%
%    \end{macrocode}
% Calculate the position of the first (thick) tick as above.
%    \begin{macrocode}
   \@tempcnta=#3\relax
   \ifnum\@tempcnta>0\advance\@tempcnta -1\relax\fi
   \divide\@tempcnta \coordsys@c\relax
   \ifnum #3>0\advance\@tempcnta 1\relax\fi
   \multiply\@tempcnta \coordsys@c\relax
   \edef\coordsys@a{\the\@tempcnta}%
%    \end{macrocode}
% Then calculate the number of \emph{thin} ticks
% between the first thick tick ("\@tempcnta") and
% \meta{to} less \meta{tickfree}, namely
% $\left\lfloor\frac{\meta{to}-\meta{first}-\meta{tickless}}{\meta{spacing}}\right\rfloor+1$.
%    \begin{macrocode}
   \@tempcntb=#4\relax
   \advance\@tempcntb -\@tempcnta\relax
   \setlength{\@tempdima}{\@tempcntb\unitlength}%
   \addtolength{\@tempdima}{-#5}%
   \ifdim\@tempdima<\z@\relax
      \def\coordsys@b{0}%
   \else
      \divide\@tempdima\unitlength\relax
      \divide\@tempdima#2\relax
      \@tempcntb=\@tempdima%
%     \advance\@tempcntb 1\relax
%    \end{macrocode}
% The number of thick ticks is then
% $\left\lceil\frac{\meta{number of thin ticks}}{\meta{thickratio}}\right\rceil$.
%    \begin{macrocode}
%     \advance\@tempcntb -1\relax
      \divide\@tempcntb #1\relax
      \advance\@tempcntb 1\relax
      \edef\coordsys@b{\the\@tempcntb}%
   \fi
   #6%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\numbline}
% The "\numbline" command checks for a star,
%    \begin{macrocode}
\newcommand{\numbline}{%
   \@ifstar{\@numblinefalse\hnumbline@i}
           {\@numblinetrue \hnumbline@i}}
%    \end{macrocode}
% \begin{macro}{\hnumbline@i}
% then "\hnumbline@i" picks up the optional argument,
%    \begin{macrocode}
\newcommand{\hnumbline@i}[1][10]{\leavevmode\hnumbline@ii{#1}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\hnumbline@ii}
% and "\hnumbline@ii" does the work:
% Calculate the length of the arrow and set it, then call "\@set@ticks"
% to set the tick marks.  The extra set of braces localizes the
% "\tickstyle" declarations.
%    \begin{macrocode}
\newcommand{\hnumbline@ii}[3]{{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#2,0){\vector(1,0){\coordsys@w}}%
   \@set@ticks{\hthickratio}{#1}{#2}{#3}{6\p@}{
      \multiput(\coordsys@a,0)(\coordsys@c,0)\coordsys@b\vtickmark}%
%    \end{macrocode}
% Set the labels if we have to.
% The parameters "\coordsys@a", "\coordsys@b", and
% "\coordsys@c" that "\@set@ticks" calculated for the thick tick
% marks are still available.  In particular, "\coordsys@a" is the
% position and, hence, the value of the first label.
%    \begin{macrocode}
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(\coordsys@a,0)(\coordsys@c,0)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \sethlabel{\hlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}
   \fi
   \color@endgroup}%
%    \end{macrocode}
% Finally store the vertical coordinate of the number line in
% "\coordsys@w" for the sake of the "\interval" command.
%    \begin{macrocode}
   \def\coordsys@w{0}%
}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\vnumbline}
% \begin{macro}{\vnumbline@i}
% \begin{macro}{\vnumbline@ii}
% The "\vnumbline" command and friends work in much the same way.
%    \begin{macrocode}
\newcommand{\vnumbline}{%
   \@ifstar{\@numblinefalse\vnumbline@i}
           {\@numblinetrue \vnumbline@i}}
\newcommand{\vnumbline@i}[1][10]{\leavevmode\vnumbline@ii{#1}}
\newcommand{\vnumbline@ii}[3]{{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(0,#2){\vector(0,1){\coordsys@h}}%
   \@set@ticks{\vthickratio}{#1}{#2}{#3}{6\p@}{%
      \multiput(0,\coordsys@a)(0,\coordsys@c)\coordsys@b\htickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(0,\coordsys@a)(0,\coordsys@c)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \setvlabel{\vlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}
   \fi
   \color@endgroup}%
   \def\coordsys@h{0}%
}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\coordsys}
% All the coordinate-system drawing command use similar syntax, so we use a
% unified approach for picking up the arguments.
% The "\coordsys" command defines the temporary variable
% "\coordsys@c" to be the name of the command that does the real work.
% Then "\coordsys" checks for the presence of a star.
%    \begin{macrocode}
\newcommand{\coordsys}{%
   \def\coordsys@c{\coordsys@i}%
   \@ifstar{\@numblinefalse\coordsys@args@i}
           {\@numblinetrue \coordsys@args@i}}
%    \end{macrocode}
% \begin{macro}{\coordsys@args@i}
% \begin{macro}{\@hticksep}
% The "\coordsys@args@i" command picks up the first optional argument
% storing it
% in "\@hticksep" so that we can use that variable as the default for the
% second optional argument.
%    \begin{macrocode}
\newcommand{\coordsys@args@i}[1][10]{\leavevmode
   \def\@hticksep{#1}%
   \coordsys@args@ii}
%    \end{macrocode}
% \end{macro}\end{macro}
% \begin{macro}{\coordsys@args@ii}
% \begin{macro}{\@vticksep}
% Then "\coordsys@args@ii" picks up the second optional argument,
%    \begin{macrocode}
\newcommand{\coordsys@args@ii}[1][\@hticksep]{%
   \def\@vticksep{#1}%
   \coordsys@args@iii}
%    \end{macrocode}
% \end{macro}\end{macro}
% \begin{macro}{\coordsys@args@iii}
% and the "\coordsys@args@iii" command picks up the first point and
% brutally
% replaces whatever the following may be with a "(".  Since \TeX\ ignores
% spaces when looking for an argument, this allows the user to leave a space
% between the first and the second point.
%    \begin{macrocode}
\def\coordsys@args@iii(#1,#2)#3{\coordsys@c{#1}{#2}(}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\coordsys@i}
% Finally the real command, "\coordsys@c", that is "\coordsys@i",
% picks up the second point (as well as the first), and gets to work:
% First calculate the length of each axis and set it.
%    \begin{macrocode}
\def\coordsys@i#1#2(#3,#4){{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#1,0){\vector(1,0){\coordsys@w}}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(0,#2){\vector(0,1){\coordsys@h}}%
%    \end{macrocode}
% Then set the tick marks on the horizontal axis.
%    \begin{macrocode}
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{6\p@}{%
      \multiput(\coordsys@a,0)(\coordsys@c,0)\coordsys@b\vtickmark}%
%    \end{macrocode}
% This style of coordinate system has intersecting axes, so we must suppress
% the label ``0''.
%    \begin{macrocode}
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(\coordsys@a,0)(\coordsys@c,0)\coordsys@b{%
         \ifnum\value{@coord}=0\relax\else
            \edef\coordsys@a{\arabic{@coord}}%
            \sethlabel{\hlabel{\coordsys@a}}%
         \fi
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
%    \end{macrocode}
% Then do the tick marks and labels on the vertical axis.
%    \begin{macrocode}
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{6\p@}{%
      \multiput(0,\coordsys@a)(0,\coordsys@c)\coordsys@b\htickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(0,\coordsys@a)(0,\coordsys@c)\coordsys@b{%
         \ifnum\value{@coord}=0\relax\else
            \edef\coordsys@a{\arabic{@coord}}%
            \setvlabel{\vlabel{\coordsys@a}}%
         \fi
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \color@endgroup}%
%    \end{macrocode}
% Finally store the location of the axis in "\coordsys@w" and "\coordsys@h"
% for the sake of the "\interval" command.
%    \begin{macrocode}
   \def\coordsys@w{0}%
   \def\coordsys@h{0}%
}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\fcoordsys}
% \begin{macro}{\fcoordsys@i}
% The "\fcoordsys" and "\fcoordsys@i" commands work much like
% "\coordsys" and "\coordsys@i" above.
%    \begin{macrocode}
\newcommand{\fcoordsys}{%
   \def\coordsys@c{\fcoordsys@i}%
   \@ifstar{\@numblinefalse\coordsys@args@i}
           {\@numblinetrue \coordsys@args@i}}
\def\fcoordsys@i#1#2(#3,#4){{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#1,#2){\vector(1,0){\coordsys@w}}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(#1,#2){\vector(0,1){\coordsys@h}}%
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{6\p@}{%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b\vtickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \sethlabel{\hlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{6\p@}{%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b\htickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \setvlabel{\vlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \color@endgroup}%
   \def\coordsys@h{#1}%
   \def\coordsys@w{#2}%
}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\bcoordsys}
% \begin{macro}{\bcoordsys@i}
% The "\bcoordsys" and "\bcoordsys@i" commands work much like
% "\coordsys" and "\coordsys@i" above.
%    \begin{macrocode}
\newcommand{\bcoordsys}{%
   \def\coordsys@c{\bcoordsys@i}%
   \@ifstar{\@numblinefalse\coordsys@args@i}
           {\@numblinetrue \coordsys@args@i}}
\def\bcoordsys@i#1#2(#3,#4){{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#1,#2){\line(1,0){\coordsys@w}}%
   \put(#1,#4){\line(1,0){\coordsys@w}}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(#1,#2){\line(0,1){\coordsys@h}}%
   \put(#3,#2){\line(0,1){\coordsys@h}}%
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{\z@}{%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b\vtickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \sethlabel{\hlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{\z@}{%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b\htickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \setvlabel{\vlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \color@endgroup}%
   \def\coordsys@h{#1}%
   \def\coordsys@w{#2}%
}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\window}
% \begin{macro}{\window@i}
% And yet another modification of the same old thing.
%    \begin{macrocode}
\newcommand{\window}{%
   \def\coordsys@c{\window@i}%
   \@ifstar{\let\coordsys@a\phantom\coordsys@args@i}
           {\let\coordsys@a\relax  \coordsys@args@i}}
\def\window@i#1#2(#3,#4){{%
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta-#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \@tempcnta=#4\relax
   \advance\@tempcnta-#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(#1,#2){\line(1,0){\coordsys@w}}%
   \put(#1,#2){\line(0,1){\coordsys@h}}%
   \put(#3,#4){\line(-1,0){\coordsys@w}}%
   \put(#3,#4){\line(0,-1){\coordsys@h}}%
%    \end{macrocode}
% Set the labels; "\ensuremath" for the sake of the
% subscripts.
%    \begin{macrocode}
   \put(#1,#2){\sethlabel[tl]%
      {\ensuremath{x_{\text{min}}=\coordsys@a{#1}}}}%
   \put(#3,#2){\sethlabel[tr]%
      {\ensuremath{x_{\text{max}}=\coordsys@a{#3}}}}%
   \put(#1,#2){\setvlabel[rb]%
      {\ensuremath{y_{\text{min}}=\coordsys@a{#2}}}}%
   \put(#1,#4){\setvlabel[rt]%
      {\ensuremath{y_{\text{max}}=\coordsys@a{#4}}}}%
%    \end{macrocode}
% If the axes are in the window, typeset them (without labels).
%    \begin{macrocode}
   \ifnum #1<0\relax\ifnum #3>0\relax
      \vnumbline*[\@vticksep]{#2}{#4}%
   \fi\fi
   \ifnum #2<0\relax\ifnum #4>0\relax
      \numbline*[\@hticksep]{#1}{#3}%
   \fi\fi
   }%
   \def\coordsys@h{#1}%
   \def\coordsys@w{#2}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\gridstyle}
% \begin{macro}{\grid@style}
% The "\gridstyle" command defines "\grid@style" to issue a suitable
% "\tickstyle" command at the proper time.  The default
% "\grid@style" is to do nothing---that is, use the current
% "\tickstyle" unchanged.
%    \begin{macrocode}
\newcommand{\gridstyle}[2]{\def\grid@style{\tickstyle{#1}{#2}}}
\newcommand{\grid@style}{\relax}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\coordgrid}
% The "\coordgrid" command chooses between the starred version,
% "\coordgrid@ii", with solid lines and the un-starred version,
% "\coordgrid@i", with dotted lines.
%    \begin{macrocode}
\newcommand{\coordgrid}{%
   \@ifstar{\def\coordsys@c{\coordgrid@ii}\coordsys@args@i}
           {\def\coordsys@c{\coordgrid@i}\coordsys@args@i}}
%    \end{macrocode}
% \begin{macro}{\coordgrid@i}
% The "\coordgrid@i" command calls "\coordgrid@calc" to calculate
% the size, "\coordsys@w", of the box containing each dot of the dotted
% lines based on the values of "\@hticksep" and "\@vticksep".  Then
% set the dotted lines with "\@set@ticks".
%    \begin{macrocode}
\def\coordgrid@i#1#2(#3,#4){{\color@begingroup
   \coordgrid@calc
   \grid@style
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{\z@}{%
      \multiput(\coordsys@a,0)(\coordsys@c,0)\coordsys@b
         {\vgridfromto{#2}{#4}}}%
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{\z@}{%
      \multiput(0,\coordsys@a)(0,\coordsys@c)\coordsys@b
         {\hgridfromto{#1}{#3}}}%
   \color@endgroup}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\coordgrid@ii}
% The "\coordgrid@ii" command is similar to "\fcoordsys@i" above.
%    \begin{macrocode}
\def\coordgrid@ii#1#2(#3,#4){{\color@begingroup
   \grid@style
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{\z@}{%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b
         {\vgridlength{\coordsys@h}}}%
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{\z@}{%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b
         {\hgridlength{\coordsys@w}}}%
   \color@endgroup}}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\coordgrid@calc}
% To typeset pretty grids of dots the number of dots between lines must be an
% integer.  Thus, the number of dots must be a factor of the greatest common
% divisor of "\@vticksep" and "\@hticksep". The "\@EuclidGCD"
% command returns the $\gcd$ in the counter "\@tempcnta"
%    \begin{macrocode}
\newcommand{\coordgrid@calc}{%
   \@EuclidGCD{\@vticksep}{\@hticksep}%
   \@tempdima=\unitlength
   \multiply\@tempdima\@tempcnta
%    \end{macrocode}
% Now "\@tempdima" is the longest length that fits an integer number of
% times between lines.  The dots should not be closer than 2\,pt.
%    \begin{macrocode}
   \@tempdimb=2\p@\relax
   \ifdim\@tempdima<\@tempdimb
      \PackageWarning{coordsys}{The tick marks are too
         close\MessageBreak for a pretty grid}%
   \else
%    \end{macrocode}
% However, "\@tempdima" may be able to contain multiple dots.
%    \begin{macrocode}
      \divide\@tempdima \@tempdimb\relax
      \@tempdimb=\unitlength
      \multiply\@tempdimb\@tempcnta
      \divide\@tempdimb\@tempdima
   \fi
%    \end{macrocode}
% In either case store the box size in "\coordsys@w".
%    \begin{macrocode}
   \edef\coordsys@w{\the\@tempdimb}%
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\interval}
% We use "\newcommand" to check that "\interval" is not already defined;
% then we need plain \TeX's "\def" because "\interval" picks up its
% arguments in a non-standard way.
%    \begin{macrocode}
\newcommand{\interval}{}
\def\interval#1#2,{%
   \def\coordsys@a{#1}%
   \def\coordsys@b{#2}%
   \def\coordsys@c{}%
%    \end{macrocode}
% Now "\coordsys@a" is the \meta{L-delim} and "\coordsys@b" is whatever follows
% up to the first comma, that is \meta{from}.
% Then define "\coordsys@a" to be the correct symbol suitably aligned
% in a box.  Note that the characters in \LaTeX's circle font are placed
% rather peculiarly inside their bounding box.
%    \begin{macrocode}
   \if\coordsys@a]\def\coordsys@a{(}\fi
   \if\coordsys@a[%
      \def\coordsys@a{%
         \makebox[0.5\width][l]{\@circlefnt\char'163}}%
   \else\if\coordsys@a(%
      \def\coordsys@a{%
         \makebox[0.5\width][l]{\@circlefnt\char'143}}%
   \else\if\coordsys@a<%
      \def\coordsys@a{%
         \raisebox{-\fontdimen22\textfont2}{%
            \makebox[\z@]{$<$}}}%
   \else
      \PackageError{coordsys}
         {Bad delimiter}
         {\string\interval\space expects [, (, <, or ] %
          but got \coordsys@a}%
      \def\coordsys@a{}%
   \fi\fi\fi
%    \end{macrocode}
% Picking up the \meta{from} was easy because we know the
% number ends at the comma.  But we do not know where the \meta{to} number ends.
% \TeX\ knows how to read an integer, so do that and proceed with "\interv@l"
% which picks up either the right-hand delimiter or a decimal point as its
% first argument.
%    \begin{macrocode}
   \afterassignment\interv@l\count@=}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\interv@l}
% If we got a decimal point, store the integer part of the number in
% "\coordsys@c" and try again.
%    \begin{macrocode}
\newcommand{\interv@l}[1]{%
   \if#1.%
      \edef\coordsys@c{\the\count@.}%
      \def\next{\afterassignment\interv@l\count@=}%
%    \end{macrocode}
% Otherwise, append the number we just read to "\coordsys@c".
% Now "\coordsys@c" contains \meta{to}.  So calculate the
% length (in~pt) of the interval.
%    \begin{macrocode}
   \else
      \edef\coordsys@c{\coordsys@c\the\count@}%
      \setlength{\@tempdima}{\coordsys@b\unitlength}%
      \setlength{\@tempdima}{-\@tempdima}%
      \addtolength{\@tempdima}{\coordsys@c\unitlength}%
%    \end{macrocode}
% Define "\coordsys@c" to be the correct symbol for the \meta{R-delim}.
%    \begin{macrocode}
      \def\coordsys@c{#1}%
      \if\coordsys@c[\def\coordsys@c{)}\fi
      \if\coordsys@c]%
         \def\coordsys@c{\mbox{%
            \@circlefnt
            \settowidth{\@tempdima}{\char'163}%
            \hskip 0.5\@tempdima
            \char'163%
            \hskip -\@tempdima}%
         }%
      \else\if\coordsys@c)%
         \def\coordsys@c{\mbox{%
            \@circlefnt
            \settowidth{\@tempdima}{\char'143}%
            \hskip 0.5\@tempdima
            \char'143%
            \hskip -\@tempdima}%
         }%
      \else\if\coordsys@c>%
         \def\coordsys@c{%
            \raisebox{-\fontdimen22\textfont2}{%
               \makebox[\z@]{$>$}}}%
      \else
         \PackageError{coordsys}
            {Bad delimiter}
            {\string\interval\space expects ], ), <, or [ %
             but got \coordsys@c}%
         \def\coordsys@c{}%
      \fi\fi\fi
%    \end{macrocode}
% \begin{macro}{\coordsys@w}\begin{macro}{\coordsys@h}
% Finally, "\put" the pieces down.  Here "\coordsys@w" is the vertical
% coordinate of the last typeset horizontal axis (usually~$0$),
% and "\interval@line" is defined by "\intervalthickness" below.
%    \begin{macrocode}
      \put(\coordsys@b,\coordsys@w){\makebox[\@tempdima][s]{%
         \coordsys@a
         \interval@line
         \coordsys@c
      }}%
      \let\next=\ignorespaces
   \fi
   \next}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\vinterval}
% \begin{macro}{\vinterv@l}
% The "\vinterval" and "\vinterv@l" commands work as their horizontal cousins.
%    \begin{macrocode}
\newcommand{\vinterval}{}
\def\vinterval#1#2,{%
   \def\coordsys@a{#1}%
   \def\coordsys@b{#2}%
   \def\coordsys@c{}%
   \if\coordsys@a]\def\coordsys@a{(}\fi
   \if\coordsys@a[%
      \def\coordsys@a{\hbox to\z@{%
         \@circlefnt
         \settowidth{\@tempdima}{\char'163}%
         \hskip 0.5\@tempdima minus 1fil
         \char'163%
         \hskip -0.5\@tempdima minus 1fil
         \vrule width \z@ depth \z@ height 0.5\@tempdima
      }}%
   \else\if\coordsys@a(%
      \def\coordsys@a{\hbox to\z@{%
         \@circlefnt
         \settowidth{\@tempdima}{\char'143}%
         \hskip 0.5\@tempdima minus 1fil
         \char'143%
         \hskip -0.5\@tempdima minus 1fil
         \vrule width \z@ depth \z@ height 0.5\@tempdima
      }}%
   \else\if\coordsys@a<%
      \def\coordsys@a{\hbox to\z@{\hss
         \raisebox{-\fontdimen22\textfont2}[\z@][\z@]{%
            $\vee$}\hss}}%
   \else
      \PackageError{coordsys}
         {Bad delimiter}
         {\string\vinterval\space expects [, (, <, or ] %
          but got \coordsys@a}%
      \def\coordsys@a{}%
   \fi\fi\fi
   \afterassignment\vinterv@l\count@=}
\newcommand{\vinterv@l}[1]{%
   \if#1.%
      \edef\coordsys@c{\the\count@.}%
      \def\next{\afterassignment\interv@l\count@=}%
   \else
      \edef\coordsys@c{\coordsys@c\the\count@}%
      \setlength{\@tempdima}{\coordsys@b\unitlength}%
      \setlength{\@tempdima}{-\@tempdima}%
      \addtolength{\@tempdima}{\coordsys@c\unitlength}%
      \def\coordsys@c{#1}%
      \if\coordsys@c[\def\coordsys@c{)}\fi
      \if\coordsys@c]%
         \def\coordsys@c{\hbox to\z@{%
            \@circlefnt
            \settowidth{\@tempdima}{\char'163}%
            \hskip 0.5\@tempdima minus 1fil
            \char'163%
            \hskip -0.5\@tempdima minus 1fil
            \vrule width \z@ depth 0.5\@tempdima height \z@
         }}%
      \else\if\coordsys@c)%
         \def\coordsys@c{\hbox to\z@{%
            \@circlefnt
            \settowidth{\@tempdima}{\char'143}%
            \hskip 0.5\@tempdima minus 1fil
            \char'143%
            \hskip -0.5\@tempdima minus 1fil
            \vrule width \z@ depth 0.5\@tempdima height \z@
         }}%
      \else\if\coordsys@c>%
         \def\coordsys@c{\hbox to\z@{\hss%
            \raisebox{-\fontdimen22\textfont2}[\z@][\z@]{%
               $\wedge$}\hss}}%
      \else
         \PackageError{coordsys}
            {Bad delimiter}
            {\string\vinterval\space expects ], ), <, or [ %
             but got \coordsys@c}%
         \def\coordsys@c{}%
      \fi\fi\fi
      \put(\coordsys@h,\coordsys@b){\vbox{%
         \setlength{\baselineskip}{\z@}%
         \setlength{\lineskip}{\z@}%
         \settoheight{\@tempdimb}{\coordsys@a}%
         \addtolength{\@tempdima}{-\@tempdimb}%
         \settodepth {\@tempdimb}{\coordsys@c}%
         \addtolength{\@tempdima}{-\@tempdimb}%
         \coordsys@c
         \vinterval@line
         \coordsys@a
      }}%
      \let\next=\ignorespaces
   \fi
   \next}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\intervalthickness}
% \begin{macro}{interval@line}\begin{macro}{\vinterval@line}
% The "\intervalthickness" command defines the two commands "\interval@line"
% and "\vinterval@line" that draw the thick line indicating the interval.
%    \begin{macrocode}
\newcommand{\intervalthickness}[2][\z@]{%
   \setlength{\@tempdima}{#2}%
   \setlength{\@tempdima}{0.5\@tempdima}%
   \setlength{\@tempdimb}{-\@tempdima}%
   \addtolength{\@tempdima}{#1}%
   \addtolength{\@tempdimb}{#1}%
   \edef\coordsys@a{\the\@tempdima}%
   \edef\coordsys@b{-\the\@tempdimb}%
   \edef\interval@line{%
      \leaders\hrule depth \coordsys@b height \coordsys@a\hss}%
   \setlength{\@tempdima}{#2}%
   \setlength{\@tempdima}{-0.5\@tempdima}%
   \addtolength{\@tempdima}{#1}%
   \edef\coordsys@a{\the\@tempdima}%
   \edef\vinterval@line{%
      \hbox to\z@{%
         \hskip \coordsys@a
         \vrule height\@tempdima width #2%
         \hss
      }%
   }%
}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% Then a few defaults for "\interval" and "\vinterval".
%    \begin{macrocode}
\intervalthickness{1.6\p@}
\def\coordsys@w{0}
\def\coordsys@h{0}
%</coordsys>
%    \end{macrocode}
%
% \iffalse Don't document this fragment of code.
%    \begin{macrocode}
%<*euclid>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{euclidgcd}[2006/02/03 version 1.4]
\newcommand{\EuclidGCD}[2]{%
   \@EuclidGCD{#1}{#2}%
   \the\@tempcnta}
%</euclid>
%    \end{macrocode}
% \fi
%
% \begin{macro}{\@EuclidGCD}
% The "\@EuclidGCD" command calculates the greatest common divisor
% of two positive integers using Euclid's algorithm.\footnote{Euclid's
% algorithm uses the fact that $\gcd(n, d) = \gcd(d, r)$, where $r$ is
% the remainder after dividing $n$ by $d$.  Since $r<d$, the second
% $\gcd$ is easier to find. Repeat.}
% After calling "\@EuclidGCD", the counter "\@tempcnta" contains the
% $\gcd$.
%    \begin{macrocode}
%<*coordsys|euclid>
\newcommand{\@EuclidGCD}[2]{%
   \@tempcnta=#1\relax
   \@tempcntb=#2\relax
   \loop
      \count@=\@tempcntb
      \divide\count@\@tempcnta
      \multiply\count@\@tempcnta
      \advance\count@ -\@tempcntb
%    \end{macrocode}
% Now "\count@" is $-r$, where $r$ is the remainder after dividing
% "\@tempcntb" by "\@tempcnta".
%    \begin{macrocode}
      \ifnum\count@<0\relax
         \@tempcntb=\@tempcnta
         \@tempcnta=-\count@
         \repeat
}
%</coordsys|euclid>
%    \end{macrocode}
% \end{macro}
%
%
% \subsection{The \textsf{logsys} Package}
% \subsubsection{Identification}
% First we must declare ourselves.
%    \begin{macrocode}
%<*logsys>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{logsys}[2006/02/03 version 1.4]
%    \end{macrocode}
%
% \subsubsection{Options}
% Pass all options to \textsf{coordsys}.
%    \begin{macrocode}
\DeclareOption{centred}{\PassOptionsToPackage{centred}{coordsys}}
\DeclareOption{outside}{\PassOptionsToPackage{outside}{coordsys}}
\DeclareOption{inside}{\PassOptionsToPackage{inside}{coordsys}}
\ProcessOptions
%    \end{macrocode}
%
% \subsubsection{Package Loading}
% The \textsf{logsys} package extends the \textsf{coordsys} package.
%    \begin{macrocode}
\RequirePackage{coordsys}[2006/02/03]
%    \end{macrocode}
%
% \subsubsection{Main Code}
% \begin{macro}{\loglabel}
% The "\loglabel" command typesets logarithmic labels.
%    \begin{macrocode}
\newcommand{\loglabel}[1]{%
   \ifnum      #1=-2\relax \frac{1}{100}%
   \else\ifnum #1=-1\relax \frac{1}{10}%
   \else\ifnum #1= 0\relax 1%
   \else\ifnum #1= 1\relax 10%
   \else\ifnum #1= 2\relax 100%
   \else                   10^{#1}%
   \fi\fi\fi\fi\fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\v@logbox}
% \begin{macro}{\h@logbox}
% The "\v@logbox" and "\h@logbox" commands each  typeset one block
% of logarithmic tick marks.  Each take two arguments: the size of a block and
% the tick mark to typeset.
% The glue in the boxes is (10000 times) $\log10-\log9$, $\log9-\log8$,
% $\log8-\log7$, \dots, and $\log2-\log1$.
%    \begin{macrocode}
\newcommand{\v@logbox}[2]{%
   \vbox to #1\unitlength{%
      \offinterlineskip
      \vskip \z@ plus  458fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  9
      \vskip \z@ plus  512fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  8
      \vskip \z@ plus  580fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  7
      \vskip \z@ plus  669fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  6
      \vskip \z@ plus  792fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  5
      \vskip \z@ plus  969fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  4
      \vskip \z@ plus 1249fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  3
      \vskip \z@ plus 1761fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  2
      \vskip \z@ plus 3010fil\relax
   }}
\newcommand{\h@logbox}[2]{%
   \hbox to #1\unitlength{%
      \hskip \z@ plus 3010fill\relax
      \hbox to \z@{\hss #2\hss}%  2
      \hskip \z@ plus 1761fill\relax
      \hbox to \z@{\hss #2\hss}%  3
      \hskip \z@ plus 1249fill\relax
      \hbox to \z@{\hss #2\hss}%  4
      \hskip \z@ plus  969fill\relax
      \hbox to \z@{\hss #2\hss}%  5
      \hskip \z@ plus  792fill\relax
      \hbox to \z@{\hss #2\hss}%  6
      \hskip \z@ plus  669fill\relax
      \hbox to \z@{\hss #2\hss}%  7
      \hskip \z@ plus  580fill\relax
      \hbox to \z@{\hss #2\hss}%  8
      \hskip \z@ plus  512fill\relax
      \hbox to \z@{\hss #2\hss}%  9
      \hskip \z@ plus  458fill\relax
   }}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\@sethlogticks}
% In the linear case we got away with using one command, "\@set@ticks",
% to calculate the positions of the tick marks on both horizontal and vertical
% axes.  The logarithmic case is more complicated, so we create separate
% command for the horizontal and vertical case.  This split then allows the
% logarithmic commands to do more than just calculate the positions of the
% ticks:
% \begin{quote}
% "\@sethlogticks"\marg{spacing}\marg{from}\marg{to}^^A
% \marg{y0}\marg{tick}
% \end{quote}
% \emph{typesets} the logarithmic tick marks on a horizontal axis at
% $y$-coordinate \meta{y0}.   Moreover, it typesets the labels.
%
% The calculation is much like the calculation for thin tick marks in the
% linear case; compare with code
% lines~\ref{cl:BeginTickCalc}--\ref{cl:EndTickCalc}.
%    \begin{macrocode}
\newcommand{\@sethlogticks}[5]{%
   \thin@ticks
   \@tempcnta=#2\relax
   \ifnum\@tempcnta>0\advance\@tempcnta -1\relax\fi
   \divide\@tempcnta #1\relax
   \ifnum #2>0\advance\@tempcnta 1\relax\fi
   \multiply\@tempcnta #1\relax
   \edef\coordsys@a{\the\@tempcnta}%
   \@tempcntb=#3\relax
   \ifnum\@tempcnta<\@tempcntb\relax
      \advance\@tempcntb -\@tempcnta\relax
      \divide\@tempcntb #1\relax
      \edef\coordsys@b{\the\@tempcntb}%
      \multiput(\coordsys@a,#4)(#1,0)\coordsys@b
         {\h@logbox{#1}{#5}}%
%    \end{macrocode}
% In the linear case we took some measure against colliding tick marks and
% arrow heads; in
% the logarithmic case we leave that worry to the user\footnote{Because
% calculating the position of individual logarithmic tick mark is difficult;
% this code works by setting blocks of tick marks.}.  Therefore we can (and
% should) set one more thick tick mark than we have blocks.
%    \begin{macrocode}
      \thick@ticks
      \@tempcntb=\coordsys@b\relax
      \advance\@tempcntb 1\relax
      \edef\coordsys@b{\the\@tempcntb}%
      \multiput(\coordsys@a,#4)(#1,0)\coordsys@b
         {#5}%
%    \end{macrocode}
% Then set the labels: First set the counter "@coord" to\footnote{The
% calculation uses a horrible mixture of \LaTeX\ syntax and plain \TeX\ since
% \LaTeX\ does not provide a division command.  Maybe I should avoid the
% \LaTeX\ style counter and just use plain \TeX.  See the note to code
% line~\ref{cl:@coord}.}
% $\frac{\meta{from}}{\meta{spacing}}$, then step that counter by one.
%    \begin{macrocode}
      \if@numbline
         \setcounter{@coord}{\coordsys@a}%
         \divide\c@@coord #1\relax
         \multiput(\coordsys@a,#4)(#1,0)\coordsys@b{%
            \sethlabel{\loglabel{\arabic{@coord}}}%
            \stepcounter{@coord}}%
      \fi
   \fi
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@setvlogticks}
% The vertical version works in much the same way.
%    \begin{macrocode}
\newcommand{\@setvlogticks}[5]{%
   \thin@ticks
   \@tempcnta=#2\relax
   \ifnum\@tempcnta>0\advance\@tempcnta -1\relax\fi
   \divide\@tempcnta #1\relax
   \ifnum #2>0\advance\@tempcnta 1\relax\fi
   \multiply\@tempcnta #1\relax
   \edef\coordsys@a{\the\@tempcnta}%
   \@tempcntb=#3\relax
   \ifnum\@tempcnta<\@tempcntb\relax
      \advance\@tempcntb -\@tempcnta\relax
      \divide\@tempcntb #1\relax
      \edef\coordsys@b{\the\@tempcntb}%
      \multiput(#4,\coordsys@a)(0,#1)\coordsys@b
         {\v@logbox{#1}{#5}}%
      \thick@ticks
      \@tempcntb=\coordsys@b\relax
      \advance\@tempcntb 1\relax
      \edef\coordsys@b{\the\@tempcntb}%
      \multiput(#4,\coordsys@a)(0,#1)\coordsys@b
         {#5}%
      \if@numbline
         \setcounter{@coord}{\coordsys@a}%
         \divide\c@@coord #1\relax
         \multiput(#4,\coordsys@a)(0,#1)\coordsys@b{%
            \setvlabel{\loglabel{\arabic{@coord}}}%
            \stepcounter{@coord}}%
      \fi
   \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\logline}
% The "\logline" command checks for a star,
%    \begin{macrocode}
\newcommand{\logline}{%
   \@ifstar{\@numblinefalse\hlogline@i}
           {\@numblinetrue \hlogline@i}}
%    \end{macrocode}
% \begin{macro}{\hlogline@i}
% then "\hlogline@i" picks up the optional argument,
%    \begin{macrocode}
\newcommand{\hlogline@i}[1][50]{\leavevmode\hlogline@ii{#1}}
%    \end{macrocode}
% \begin{macro}{\hlogline@ii}
% and "\hlogline@ii" does the work---which isn't much since
% "\@sethlogticks" does almost everything.
%    \begin{macrocode}
\newcommand{\hlogline@ii}[3]{{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#2,0){\vector(1,0){\coordsys@w}}%
   \@sethlogticks{#1}{#2}{#3}{0}{\vtickmark}
   \color@endgroup}%
   \def\coordsys@w{0}%
}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\vlogline}
% \begin{macro}{\vlogline@i}
% \begin{macro}{\vlogline@ii}
% The "\vlogline" command and friends work in much the same way.
%    \begin{macrocode}
\newcommand{\vlogline}{%
   \@ifstar{\@numblinefalse\vlogline@i}
           {\@numblinetrue \vlogline@i}}
\newcommand{\vlogline@i}[1][50]{\leavevmode\vlogline@ii{#1}}
\newcommand{\vlogline@ii}[3]{{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(0,#2){\vector(0,1){\coordsys@h}}%
   \@setvlogticks{#1}{#2}{#3}{0}{\htickmark}
   \color@endgroup}%
   \def\coordsys@h{0}%
}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\logsys}
% The logarithmic coordinate system commands have different default values for
% the optional arguments than their linear cousins.  We therefore need a new
% approach for picking up optional arguments.
%
% The "\logsys" command defines "\coordsys@c" to be the command that
% eventually sets the coordinate system.  Then "\logsys" define
% "\@hticksep" and "\@vticksep" to be the default values for the
% optional arguments.  (Each logarithmic coordinate system type has a different
% set of default values.) Then "\logsys" checks for a star and calls
% "\logsys@args@i".
%    \begin{macrocode}
\newcommand{\logsys}{%
   \def\coordsys@c{\logsys@i}%
   \def\@hticksep{10}%
   \def\@vticksep{50}%
   \@ifstar{\@numblinefalse\logsys@args@i}
           {\@numblinetrue \logsys@args@i}}
%    \end{macrocode}
% \begin{macro}{\logsys@args@i}
% The "\logsys@args@i" command picks up the first optional argument
% storing it in "\@hticksep" for later processing.
%    \begin{macrocode}
\newcommand{\logsys@args@i}[1][\@hticksep]{\leavevmode
   \edef\@hticksep{#1}%
   \logsys@args@ii}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\logsys@args@ii}
% Then "\logsys@args@ii" picks up the second optional argument and calls
% the good old "\coordsys@args@iii" command to pick up (some of) the
% remaining arguments.
%    \begin{macrocode}
\newcommand{\logsys@args@ii}[1][\@vticksep]{%
   \edef\@vticksep{#1}%
   \coordsys@args@iii}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\logsys@i}
% Finally "\logsys@i" sets the coordinate system:
% First calculate the width and height of the system, then set the axes
% and the tick marks and labels on the linear (horizontal) axis---all of it
% much like "\fcoordsys@i" above.
%    \begin{macrocode}
\def\logsys@i#1#2(#3,#4){{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#1,#2){\vector(1,0){\coordsys@w}}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(#1,#2){\vector(0,1){\coordsys@h}}%
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{6\p@}{%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b\vtickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \sethlabel{\hlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
%    \end{macrocode}
% Finally call "\@setvlogticks" to set the tick marks and labels on the
% logarithmic (vertical) axis.
%    \begin{macrocode}
   \@setvlogticks{\@vticksep}{#2}{#4}{#1}{\htickmark}%
   \color@endgroup}%
   \def\coordsys@h{#1}%
   \def\coordsys@w{#2}%
}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\semilogsys}
% \begin{macro}{\semilogsys@i}
% The "\semilogsys" and "\semilogsys@i" commands work in much the
% same manner.
%    \begin{macrocode}
\newcommand{\semilogsys}{%
   \def\coordsys@c{\semilogsys@i}%
   \def\@hticksep{50}%
   \def\@vticksep{10}%
   \@ifstar{\@numblinefalse\logsys@args@i}
           {\@numblinetrue \logsys@args@i}}
\def\semilogsys@i#1#2(#3,#4){{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#1,#2){\vector(1,0){\coordsys@w}}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(#1,#2){\vector(0,1){\coordsys@h}}%
   \@sethlogticks{\@hticksep}{#1}{#3}{#2}{\vtickmark}%
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{6\p@}{%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b\htickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \setvlabel{\vlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \color@endgroup}%
   \def\coordsys@h{#1}%
   \def\coordsys@w{#2}%
}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\loglogsys}
% \begin{macro}{\loglogsys@i}
% The "\loglogsys" and "\loglogsys@i" commands work in much the
% same manner.
%    \begin{macrocode}
\newcommand{\loglogsys}{%
   \def\coordsys@c{\loglogsys@i}%
   \def\@hticksep{50}%
   \def\@vticksep{50}%
   \@ifstar{\@numblinefalse\logsys@args@i}
           {\@numblinetrue \logsys@args@i}}
\def\loglogsys@i#1#2(#3,#4){{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#1,#2){\vector(1,0){\coordsys@w}}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(#1,#2){\vector(0,1){\coordsys@h}}%
   \@sethlogticks{\@hticksep}{#1}{#3}{#2}{\vtickmark}%
   \@setvlogticks{\@vticksep}{#2}{#4}{#1}{\htickmark}%
   \color@endgroup}%
   \def\coordsys@h{#1}%
   \def\coordsys@w{#2}%
}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\loggrid}
% The "\loggrid" command is the obvious cross between "\logsys" and
% "\coordgrid".
%    \begin{macrocode}
\newcommand{\loggrid}{%
   \def\@hticksep{10}%
   \def\@vticksep{50}%
   \@numblinefalse
   \@ifstar{\def\coordsys@c{\loggrid@ii}\logsys@args@i}
           {\def\coordsys@c{\loggrid@i}\logsys@args@i}}
%    \end{macrocode}
% \begin{macro}{\loggrid@i}
% Similarly, "\loggrid@i" is a cross between "\logsys@i" and
% "\coordgrid@i",
%    \begin{macrocode}
\def\loggrid@i#1#2(#3,#4){{\color@begingroup
   \coordgrid@calc
   \grid@style
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{\z@}{%
      \multiput(\coordsys@a,0)(\coordsys@c,0)\coordsys@b
         {\vgridfromto{#2}{#4}}}%
   \@setvlogticks{\@vticksep}{#2}{#4}{0}{\hgridfromto{#1}{#3}}%
   \color@endgroup}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\loggrid@ii}
% and "\loggrid@ii" is a cross between "\logsys@i" and
% "\coordgrid@ii".
%    \begin{macrocode}
\def\loggrid@ii#1#2(#3,#4){{\color@begingroup
   \grid@style
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{\z@}{%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b
         {\vgridlength{\coordsys@h}}}%
   \@setvlogticks{\@vticksep}{#2}{#4}{#1}{\hgridlength{\coordsys@w}}%
   \color@endgroup}}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\semiloggrid}
% \begin{macro}{\semiloggrid@i}
% \begin{macro}{\semiloggrid@ii}
% Semi-logarithmic grids provide no surprises,
%    \begin{macrocode}
\newcommand{\semiloggrid}{%
   \def\@hticksep{50}%
   \def\@vticksep{10}%
   \@numblinefalse
   \@ifstar{\def\coordsys@c{\semiloggrid@ii}\logsys@args@i}
           {\def\coordsys@c{\semiloggrid@i}\logsys@args@i}}
\def\semiloggrid@i#1#2(#3,#4){{\color@begingroup
   \coordgrid@calc
   \grid@style
   \@sethlogticks{\@hticksep}{#1}{#3}{0}{\vgridfromto{#2}{#4}}%
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{\z@}{%
      \multiput(0,\coordsys@a)(0,\coordsys@c)\coordsys@b
         {\hgridfromto{#1}{#3}}}%
   \color@endgroup}}
\def\semiloggrid@ii#1#2(#3,#4){{\color@begingroup
   \grid@style
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \@sethlogticks{\@hticksep}{#1}{#3}{#2}{\vgridlength{\coordsys@h}}%
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{\z@}{%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b
         {\hgridlength{\coordsys@w}}}%
   \color@endgroup}}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
% \begin{macro}{\logloggrid}
% \begin{macro}{\logloggrid@i}
% \begin{macro}{\logloggrid@ii}
% and nor do double-logarithmic grids.
%    \begin{macrocode}
\newcommand{\logloggrid}{%
   \def\@hticksep{50}%
   \def\@vticksep{50}%
   \@numblinefalse
   \@ifstar{\def\coordsys@c{\logloggrid@ii}\logsys@args@i}
           {\def\coordsys@c{\logloggrid@i}\logsys@args@i}}
\def\logloggrid@i#1#2(#3,#4){{\color@begingroup
   \coordgrid@calc
   \grid@style
   \@sethlogticks{\@hticksep}{#1}{#3}{0}{\vgridfromto{#2}{#4}}%
   \@setvlogticks{\@vticksep}{#2}{#4}{0}{\hgridfromto{#1}{#3}}%
   \color@endgroup}}
\def\logloggrid@ii#1#2(#3,#4){{\color@begingroup
   \grid@style
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \@sethlogticks{\@hticksep}{#1}{#3}{#2}{\vgridlength{\coordsys@h}}%
   \@setvlogticks{\@vticksep}{#2}{#4}{#1}{\hgridlength{\coordsys@w}}%
   \color@endgroup}}
%</logsys>
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
%
% \subsection{The \texttt{putfile} Maple Code}
%    \begin{macrocode}
%<*putfile>
putfile := proc(fn::{string, list(string), set(string)},
                 P::specfunc(anything, PLOT) )
   option `Copyright 2000-06 by Mogens Lemvig Hansen`;
   description "version 1.1";
   local L, fns, i, V, scl, FH, ttl, pt, path, ext;
   global StringTools;
%    \end{macrocode}
% Process the options.
%    \begin{macrocode}
   L := [args[3..-1]];
   if hasoption(L, 'scale', scl, 'L') then
      scl := evalf(scl);
      if not type(scl, ['numeric', 'numeric']) then
         error "the scale option must be [numeric, numeric] but got %1",
               scl;
      fi;
   else
      scl := [1,1];
   fi;
   if L <> [] then
      error "unknown options: %1", L;
   fi;
%    \end{macrocode}
% Pull the "CURVES" from the "PLOT" structure.
%    \begin{macrocode}
   L := map( `putfile/grabcurves`, [op(P)] );
%    \end{macrocode}
% If a single filename is given, we can construct a suitable list of filenames:
% The path ends with the last backslash, slash, or colon in "fn";
% the extension begins with the last period after that.
%    \begin{macrocode}
   if type(fn, 'string') then
      path := map(StringTools:-FirstFromRight, ["\\", "/", ":"], fn);
      path := max(op(path));
      ext := StringTools:-FirstFromRight(".", fn[path+1..-1]);
%    \end{macrocode}
% If there is not extension, prepare to append
% ".tex";\footnote{The extension \texttt{.tex} for these data files
% may not be logical, but it is what \TeX\ assumes in the
% \texttt{\bslash putfile} command, so at least we have consistent
% assumptions.}
% otherwise save and strip the extension.
%    \begin{macrocode}
      if ext = 0 then
         ext := ".tex";
         fns := fn;
      else
         ext := fn[path+ext..-1];
         fns := fn[1..-length(ext)-1]
      fi;
%    \end{macrocode}
% Multiply the filename if necessary, and append the extension.
%    \begin{macrocode}
      if nops(L) = 1 then
         fns := [fns];
      else
         fns := [ seq(cat(fns, i), i=1..nops(L)) ];
      fi;
      fns := map(cat, fns, ext);
%    \end{macrocode}
% If we have a set or list or filenames, their number must match the number of
% "CURVES".
%    \begin{macrocode}
   else
      fns := fn;
      if nops(fns) <> nops(L) then
         error "the number of filenames must match "
               "the number of curves, "
               "received %1 names but %2 curves.",
               nops(fns), nops(L);
      fi;
   fi;
%    \end{macrocode}
% Extract the view-port from the "PLOT" structure.
%    \begin{macrocode}
   V := select(type, [op(P)], 'specfunc'('anything', 'VIEW'));
   if nops(V) <> 1 then
      V := ['DEFAULT', 'DEFAULT'];
   else
      V := [ op([1,1], V), op([1,2], V) ];
   fi;
   V := subs('DEFAULT'=Float(-infinity)..Float(infinity), V);
%    \end{macrocode}
% Finally, extract the title, if any.
% The title will be included as a comment.
% Since the title could be a multi-line string, we must insert "%" characters
% after any new-lines.
%    \begin{macrocode}
   ttl := select(type, [op(P)], 'specfunc'('anything', 'TITLE'));
   if nops(ttl) = 1 then
      ttl := op([1,1], ttl);
      ttl := StringTools:-SubstituteAll(ttl, "\n", "\n%%  ");
   fi;
%    \end{macrocode}
% Fit the curves to the view-port, and scale as requested.
%    \begin{macrocode}
   L := map( `putfile/cleancurve`, L, V);
   L := map2( map, u->[scl[1]*u[1], scl[2]*u[2]], L );
%    \end{macrocode}
% For each curve, write the title (if any), the view-port, and all the points to
% the file.
%    \begin{macrocode}
   for i from 1 to nops(L) do try
      FH := fopen(fns[i], 'WRITE', 'TEXT');
      if type(ttl, 'string') then fprintf(FH, "%%%%  %s\n", ttl) fi;
      if scl <> [1,1] then fprintf(FH, "%% scaled %a\n", scl) fi;
      V := [ map2(op, 1, L[i]), map2(op, 2, L[i]) ];
      V := map( u-> min(op(u))..max(op(u)), V );
      fprintf(FH, "%% horizontal range: %f .. %f\n", op(V[1]));
      fprintf(FH, "%% vertical range:   %f .. %f\n", op(V[2]));
      for pt in L[i] do
         fprintf(FH, "%f \t%f\n", op(pt));
      od;
      finally fclose(FH);
   end try end do;
end;
%    \end{macrocode}
%
% The sub-routines that follow use Maple's naming convention for such.
%
% We are interested in "CURVES" objects in a "PLOT" structure.
% A "CURVES" object contains options (which we ignore) and lists of
% \meta{curve}s, where a \meta{curve} is a list of \meta{point}s and a
% \meta{point} is a list of length two usually containing two numeric values.
% If "x" is not a "CURVES", return nothing.  If "x" is a
% "CURVES", extract the list of \meta{curve}s and return the
% corresponding sequence of \meta{curve}s.  If the "PLOT" structure
% contains more than one "CURVES" object, the sequences returned by
% "putfile/grabcurves" will flatten to one sequence of \meta{curve}s
%    \begin{macrocode}
`putfile/grabcurves` := proc(x)
   option `Copyright 2000-06 by Mogens Lemvig Hansen`;
   description "version 1.1";
   local L;
   if op(0, x) = 'CURVES' then
      L := [ op(x) ];
      L := select(type, L, 'list');
      RETURN(op(L));
   else
      RETURN(NULL);
   fi;
end;
%    \end{macrocode}
% Each curve has to be fitted inside the view-port.
% The curve, "CC", is a list of points.
% The view-port, "V", is a list of the form
% \texttt{[numeric..numeric, numeric..numeric]}.
%    \begin{macrocode}
`putfile/cleancurve` := proc(CC::list, V::list)
   local C, B, pts, pt, m, i;
   option `Copyright 2004-06 by Mogens Lemvig Hansen`;
   description "version 1.1";
%    \end{macrocode}
% Remove any non-numeric points.
%    \begin{macrocode}
   C := select(type, CC, ['numeric', 'numeric']);
   if nops(C) < 1 then error "no numeric points in %1", C fi;
%    \end{macrocode}
% Then build a new list of point: each time a consecutive pair of points in
% "C" straddles a boundary of the view-port, add the point of intersection
% between the line through the two points and the view-port.
%    \begin{macrocode}
   B := C[1];
   for i from 2 to nops(C) do
      if C[i] = C[i-1] then next fi;
      pts := NULL;
      if ( C[i-1][1] < lhs(V[1]) and C[i][1] > lhs(V[1]) )
      or ( C[i-1][1] > lhs(V[1]) and C[i][1] < lhs(V[1]) ) then
         m := ( C[i-1][2] - C[i][2] ) / ( C[i-1][1] - C[i][1] );
         pt := lhs(V[1]);
         pt := [ pt, m*(pt-C[i][1]) + C[i][2] ];
         pts := pts, pt;
      fi;
      if ( C[i-1][1] < rhs(V[1]) and C[i][1] > rhs(V[1]) )
      or ( C[i-1][1] > rhs(V[1]) and C[i][1] < rhs(V[1]) ) then
         m := ( C[i-1][2] - C[i][2] ) / ( C[i-1][1] - C[i][1] );
         pt := rhs(V[1]);
         pt := [ pt, m*(pt-C[i][1]) + C[i][2] ];
         pts := pts, pt;
      fi;
      if ( C[i-1][2] < lhs(V[2]) and C[i][2] > lhs(V[2]) )
      or ( C[i-1][2] > lhs(V[2]) and C[i][2] < lhs(V[2]) ) then
         m := ( C[i-1][1] - C[i][1] ) / ( C[i-1][2] - C[i][2] );
         pt := lhs(V[2]);
         pt := [ m*(pt-C[i][2]) + C[i][1], pt ];
         pts := pts, pt;
      fi;
      if ( C[i-1][2] < rhs(V[2]) and C[i][2] > rhs(V[2]) )
      or ( C[i-1][2] > rhs(V[2]) and C[i][2] < rhs(V[2]) ) then
         m := ( C[i-1][1] - C[i][1] ) / ( C[i-1][2] - C[i][2] );
         pt := rhs(V[2]);
         pt := [ m*(pt-C[i][2]) + C[i][1], pt ];
         pts := pts, pt;
      fi;
%    \end{macrocode}
% If the two points straddle more than one view-port boundary, we add one point
% for each boundary.  The order of the added points must be in the direction
% of the curve.
%    \begin{macrocode}
      pts := [pts];
      if C[i-1][1] < C[i][1] then
         pts := sort(pts, (u,v)->evalb(u[1]<v[1]));
      elif C[i-1][1] > C[i][1] then
         pts := sort(pts, (u,v)->evalb(u[1]>v[1]));
      elif C[i-1][2] < C[i][2] then
         pts := sort(pts, (u,v)->evalb(u[2]<v[2]));
      elif C[i-1][2] > C[i][2] then
         pts := sort(pts, (u,v)->evalb(u[2]>v[2]));
      else
         error "cannot happen";
      fi;
      B := B, op(pts), C[i];
   od;
   C := [B];
%    \end{macrocode}
% Finally remove the point outside the view-port.
%    \begin{macrocode}
   C := select( u->evalb(lhs(V[1])<=u[1] and u[1] <= rhs(V[1])), C);
   C := select( u->evalb(lhs(V[2])<=u[2] and u[2] <= rhs(V[2])), C);
   C;
end;
%</putfile>
%    \end{macrocode}
%
% \Finale
%