summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/info/web2c.info
blob: de5ce04906ebb9b46b8b949f7a86b05aa8e1b3ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
This is web2c.info, produced by makeinfo version 6.8 from web2c.texi.

This file documents the installation and use of the programs in Web2c,
an implementation of Donald Knuth's TeX system.

   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2007, 2008, 2009, 2010-2022 Karl Berry & Olaf Weber.

   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

   Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.

   Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation
INFO-DIR-SECTION TeX
START-INFO-DIR-ENTRY
* Web2c: (web2c).               TeX, Metafont, and companion programs.
END-INFO-DIR-ENTRY

INFO-DIR-SECTION Individual utilities
START-INFO-DIR-ENTRY
* bibtex: (web2c)bibtex invocation.             Maintaining bibliographies.
* dvicopy: (web2c)dvicopy invocation.           Virtual font expansion
* dvitomp: (web2c)dvitomp invocation.           DVI to MPX (MetaPost pictures).
* dvitype: (web2c)dvitype invocation.           DVI to human-readable text.
* gftodvi: (web2c)gftodvi invocation.           Generic font proofsheets.
* gftopk: (web2c)gftopk invocation.             Generic to packed fonts.
* gftype: (web2c)gftype invocation.             GF to human-readable text.
* mf: (web2c)mf invocation.                     Creating typeface families.
* mft: (web2c)mft invocation.                   Prettyprinting Metafont source.
* mltex: (web2c)MLTeX.                          Multi-lingual TeX.
* mpost: (web2c)mpost invocation.               Generating PostScript.
* patgen: (web2c)patgen invocation.             Creating hyphenation patterns.
* pktogf: (web2c)pktogf invocation.             Packed to generic fonts.
* pktype: (web2c)pktype invocation.             PK to human-readable text.
* pltotf: (web2c)pltotf invocation.             Property list to TFM.
* pooltype: (web2c)pooltype invocation.         Display WEB pool files.
* tangle: (web2c)tangle invocation.             WEB to Pascal.
* tex: (web2c)tex invocation.                   Typesetting.
* tftopl: (web2c)tftopl invocation.             TFM -> property list.
* vftovp: (web2c)vftovp invocation.             Virtual font -> virtual pl.
* vptovf: (web2c)vptovf invocation.             Virtual pl -> virtual font.
* weave: (web2c)weave invocation.               WEB to TeX.
END-INFO-DIR-ENTRY


File: web2c.info,  Node: Top,  Next: Introduction,  Up: (dir)

Web2c
*****

This document describes how to install and use the programs in the Web2c
implementation of the TeX system, especially for Unix systems.  It
corresponds to Web2c version 2022, released in January 2022.

* Menu:

* Introduction::                A brief introduction.
* Installation::                How to compile and install Web2c.
* Commonalities::               Option syntax, standard options, memory dumps.
* Three programs::              TeX, Metafont, MetaPost have much in common.
* TeX::                         Typesetting.
* Metafont::                    Typeface design.
* MetaPost::                    Technical illustrations.
* BibTeX::                      Reusable bibliographies.
* WEB::                         Literate programming.
* DVI utilities::               DVI expansion.
* Font utilities::              Font format conversion.
* Legalisms::                   Blah blah blah.
* References::                  Books and such.
* Index::                       General index.


File: web2c.info,  Node: Introduction,  Next: Installation,  Prev: Top,  Up: Top

1 Introduction
**************

This manual corresponds to version 2022 of Web2c, released in January
2022.

   "Web2c" (also spelled Web2C) is the name of a TeX implementation,
originally for Unix, but now also running under Windows and other
operating systems.  By "TeX implementation", we mean all of the standard
programs developed by the Stanford TeX project led by Donald E. Knuth:
Metafont, DVItype, GFtoDVI, BibTeX, Tangle, etc., as well as TeX itself.
Other programs are also included: DVIcopy, written by Peter
Breitenlohner, MetaPost and its utilities (derived from Metafont), by
John Hobby, and many more.

   General strategy: Web2c works, as its name implies, by translating
the WEB source in which TeX is written into C source code.  Its output
is not self-contained, however; it makes extensive use of many macros
and functions in a library (the 'web2c/lib' directory in the sources).
Therefore, it will not work without change on an arbitrary WEB program.

   Availability: All of Web2c is freely available--"free" both in the
sense of no cost (free ice cream) and of having the source code to
modify and/or redistribute (free speech).  *Note
(kpathsea)unixtex.ftp::, for the practical details of how to obtain
Web2c.

   Different parts of the Web2c distribution have different licensing
terms, however, reflecting the different circumstances of their
creation; consult each source file for exact details.  The main
practical implication for redistributors of Web2c is that most of the
executables are covered by the GNU General Public License or GNU Lesser
General Public License, and therefore anyone who gets a binary
distribution must also be able to get the sources, as explained by the
terms of the GPL (<https://gnu.org/licenses/>).  The GPL covers the
Web2c executables, including 'tex', because the Free Software Foundation
sponsored the initial development of the Kpathsea library that Web2c
uses.  The basic source files from Stanford, however, have their own
copyright terms or are in the public domain, and are not covered by the
GPL.

   History: Tomas Rokicki originated the TeX-to-C system in 1987,
working from the first change files for TeX under Unix, which were done
primarily by Howard Trickey and Pavel Curtis.  Tim Morgan then took over
development and maintenance for a number of years; the name changed to
Web-to-C somewhere in there.  In 1990, Karl Berry became the maintainer.
He made many changes to the original sources, and started using the
shorter name Web2c.  In 1997, Olaf Weber took over, and then in 2006,
Karl started taking care of it again.  No significant development or
changes have been needed for many years, though dozens of other people
have contributed in many ways; their names are listed in the 'ChangeLog'
files.

   Originally, Web2c was distributed as its own package, alongside the
original web programs from Stanford and other components.  It was also
the basis for the teTeX distribution (now discontinued).  Around 2004,
the packaging focus shifted entirely to the TeX Live distribution
(<https://tug.org/texlive/>), though the same Web2c is at the heart of
the release.

   Other acknowledgements by Karl: The University of Massachusetts at
Boston (particularly Rick Martin and Bob Morris) provided computers and
ftp access to me for many years.  Richard Stallman at the Free Software
Foundation employed me while I wrote the original path searching library
(for the GNU font utilities).  (rms also gave us Emacs, GDB, and GCC,
without which I cannot imagine developing Web2c.)  And, of course, TeX
would not exist in the first place without Donald E. Knuth.

   Further reading: *Note References::.


File: web2c.info,  Node: Installation,  Next: Commonalities,  Prev: Introduction,  Up: Top

2 Installation
**************

(A copy of this chapter is in the distribution file 'web2c/INSTALL'.)

   Installing Web2c is mostly the same as installing any other
Kpathsea-using program.  Therefore, for the basic steps involved, see
*note (kpathsea)Installation::.  (A copy is in the file
'kpathsea/INSTALL'.)

   One peculiarity to Web2c is that the source distribution comes in two
files: 'web.tar.gz' and 'web2c.tar.gz'.  You must retrieve and unpack
them both.  (We have two because the former archive contains the very
large and seldom-changing original WEB source files.)  *Note
(kpathsea)unixtex.ftp::.

   Another peculiarity is the MetaPost program.  Although it has been
installed previously as 'mp', as of Web2c 7.0 the installed name is now
'mpost', to avoid conflict with the 'mp' program that does
prettyprinting.  This approach was recommended by the MetaPost author,
John Hobby.  If you as the TeX administrator wish to make it available
under its shorter name as well, you will have to set up a link or some
such yourself.  And of course individual users can do the same.

   For solutions to common installation problems and information on how
to report a bug, see the file 'kpathsea/BUGS' (*note (kpathsea)Bugs::).
See also the Web2c home page, <http://www.tug.org/web2c>.

   Points worth repeating:

   * Before starting the standard compilation and installation you must
     install the basic fonts, macros, and other library files.  *Note
     (kpathsea)Installation::.

   * If you do not wish to use the standard file locations, see *note
     (kpathsea)Changing search paths::.

   * Some Web2c features are enabled or disabled at 'configure' time, as
     described in the first section below.

* Menu:

* configure options::           Especially -with and -enable.
* Compile-time options::        Unusual -D's.
* Additional targets::		Breaking down the task.
* Triptrap::                    Running the torture tests.


File: web2c.info,  Node: configure options,  Next: Compile-time options,  Up: Installation

2.1 'configure' options
=======================

This section gives pointers to descriptions of the '--with' and
'--enable' 'configure' arguments that Web2c accepts.  Some are specific
to Web2c, others are generic to all Kpathsea-using programs.

   For a list of all the options 'configure' accepts, run 'configure
--help'.  The generic options are listed first, and the package-specific
options come last.

   For a description of the generic options (which mainly allow you to
specify installation directories) and basic 'configure' usage, see *note
Running 'configure' scripts: (autoconf)Invoking configure, a copy is in
the file 'kpathsea/CONFIGURE'.

'--disable-dump-share'
     Do not make fmt/base/mem files sharable across different endian
     architectures.  *Note Hardware and memory dumps::.

'--without-maketexmf-default'
'--without-maketexpk-default'
'--without-maketextfm-default'
'--with-maketextex-default'
     Enable or disable the dynamic generation programs.  *Note
     (kpathsea)mktex configuration::.  The defaults are the inverse of
     the options, i.e., everything is enabled except 'mktextex'.

'--enable-shared'
     Build Kpathsea as a shared library.  *Note (kpathsea)Shared
     library::.

'--with-editor=CMD'
     Change the default editor invoked by the 'e' interactive command.
     *Note Editor invocation::.

'--with-epsfwin'
'--with-hp2627win'
'--with-mftalkwin'
'--with-nextwin'
'--with-regiswin'
'--with-suntoolswin'
'--with-tektronixwin'
'--with-unitermwin'
'--with-x'
'--with-x-toolkit=KIT'
'--with-x11win'
'--with-x11'
     Define Metafont graphics support; by default, no graphics support
     is enabled.  *Note Online Metafont graphics::.

'--x-includes=DIR'
'--x-libraries=DIR'
     Define the locations of the X11 include files and libraries; by
     default, 'configure' does its best to guess).  *Note
     (autoconf)Optional Features::.  A copy is in 'kpathsea/CONFIGURE'.


File: web2c.info,  Node: Compile-time options,  Next: Additional targets,  Prev: configure options,  Up: Installation

2.2 Compile-time options
========================

In addition to the 'configure' options listed in the previous section,
there are a few things that can be affected at compile-time with C
definitions, rather than with 'configure'.  Using any of these is
unusual.

   To specify extra compiler flags ('-DNAME' in this case), the simplest
thing to do is:
     make XCFLAGS="CCOPTIONS"
You can also set the 'CFLAGS' environment variable before running
'configure'.  *Note (kpathsea)configure environment::.

   Anyway, here are the possibilities:

'-DFIXPT'
'-DNO_MF_ASM'
     Use the original WEB fixed-point routines for Metafont and MetaPost
     arithmetic calculations regarding fractions.  By default,
     assembly-language routines are used on x86 hardware with GNU C
     (unless 'NO_MF_ASM' is defined), and floating-point routines are
     used otherwise.

'-DIPC_DEBUG'
     Report on various interprocess communication activities.  *Note IPC
     and TeX: IPC and TeX.


File: web2c.info,  Node: Additional targets,  Next: Triptrap,  Prev: Compile-time options,  Up: Installation

2.3 Additional targets
======================

Web2c has several Make targets besides the standard ones.  You can
invoke these either in the top level directory of the source
distribution (the one containing 'kpathsea/' and 'web2c/'), or in the
'web2c/' directory.

'c-sources'
     Make only the C files, translated from the Web sources, presumably
     because you want to take them to a non-Unix machine.

'formats'
'install-formats'
     Make or install all the memory dumps (*note Memory dumps::).  By
     default, the standard plain formats plus 'latex.fmt' are made.  You
     can add other formats by redefining the 'fmts', 'bases', and 'mems'
     variables.  See the top of 'web2c/Makefile' for the possibilities.

'fmts'
'install-fmts'
     Make or install the TeX '.fmt' files.  *Note Initial TeX::.

'bases'
'install-bases'

     Make or install the Metafont '.base' files.  *Note Initial
     Metafont::.

'mems'
'install-mems'
     Make or install the MetaPost '.mem' files.  *Note Initial
     MetaPost::.

'triptrap'
'trip'
'trap'
'mptrap'
     To run the torture tests for TeX, Metafont, and MetaPost
     (respectively).  See the next section.


File: web2c.info,  Node: Triptrap,  Prev: Additional targets,  Up: Installation

2.4 Trip, trap, and mptrap: Torture tests
=========================================

To validate your TeX, Metafont, and MetaPost executables, run 'make
triptrap'.  This runs the trip, trap, and mptrap "torture tests".  See
the files 'triptrap/tripman.tex', 'triptrap/trapman.tex', and
'triptrap/mptrap.readme' for detailed information and background on the
tests.

   The differences between your executables' behavior and the standard
values will show up on your terminal.  The usual differences (these are
all acceptable) are:

   * string usage and table sizes;
   * glue set ratios;
   * 'down4', 'right4', and 'y4' commands in DVItype output;
   * dates and times.

Any other differences are trouble.  The most common culprit in the past
has been compiler bugs, especially when optimizing.  *Note TeX or
Metafont failing: (kpathsea)TeX or Metafont failing.

   The files 'trip.diffs', 'mftrap.diffs', and 'mptrap.diffs' in the
'triptrap' directory show the standard diffs against the original
output.  If you diff your diffs against these files, you should come up
clean.  For example
     make trip >&mytrip.diffs
     diff triptrap/trip.diffs mytrip.diffs

   To run the tests separately, use the targets 'trip', 'trap', and
'mptrap'.

   To run simple tests for all the programs as well as the torture
tests, run 'make check'.  You can compare the output to the distributed
file 'tests/check.log' if you like.


File: web2c.info,  Node: Commonalities,  Next: Three programs,  Prev: Installation,  Up: Top

3 Commonalities
***************

Many aspects of the TeX system are the same among more than one program,
so we describe those pieces together, here.

   Another kind of commonality is the extensions to TeX that are
available across all the engines; *note TeX extensions::.

* Menu:

* Option conventions::   - or -, = or ' ' for values.
* Common options::       -help -version -verbose, and TeX/MF/MP options.
* Path searching::       Features of the common path searching library.
* Output file location:: TEXMFOUTPUT allows output in places other than '.'.


File: web2c.info,  Node: Option conventions,  Next: Common options,  Up: Commonalities

3.1 Option conventions
======================

To provide a clean and consistent behavior, we chose to have all these
programs use the GNU function 'getopt_long_only' to parse command lines.
However, we do use in a restricted mode, where all the options have to
come before the rest of the arguments.

   As a result, you can:
   * use '-' or '--' to start an option name;

   * use any unambiguous abbreviation for an option name;

   * separate option names and values with either '=' or one or more
     spaces;

   * use filenames that would otherwise look like options by putting
     them after an option '--'.

   By convention, non-option arguments, if specified, generally define
the name of an input file, as documented for each program.

   If a particular option with a value is given more than once, it is
the last value that counts.

   For example, the following command line specifies the options 'foo',
'bar', and 'verbose'; gives the value 'baz' to the 'abc' option, and the
value 'xyz' to the 'quux' option; and specifies the filename '-myfile-'.

     -foo --bar -verb -abc=baz -quux karl --quux xyz -- -myfile-


File: web2c.info,  Node: Common options,  Next: Path searching,  Prev: Option conventions,  Up: Commonalities

3.2 Common options
==================

All of these programs accept the standard GNU '--help' and '--version'
options, and several programs accept '--verbose'.  Rather than writing
identical descriptions for every program, they are described here.

'--help'
     Print a usage message listing basic usage and all available options
     to standard output, then exit successfully.

'--verbose'
     Print progress reports to standard output.

'--version'
     Print the version number to standard output, then exit
     successfully.

   TeX, Metafont, and MetaPost have a number of additional options in
common:

'-cnf-line=STR'
     Parse STR as if it were a line in the 'texmf.cnf' configuration
     file, overriding all other settings.  *Note (kpathsea)Path
     searching options::.

'-file-line-error'
'-no-file-line-error'
     Change (or do not change) the way error messages are printed.  The
     alternate style looks like error messages from many compilers and
     is easier to parse for some editors that invoke TeX.  This option
     used to be called '-file-line-error-style'.

'-fmt=DUMPNAME'
'-base=DUMPNAME'
'-mem=DUMPNAME'
     Use DUMPNAME instead of the program name or a '%&' line to
     determine the name of the memory dump file read ('fmt' for TeX,
     'base' for Metafont, 'mem' for MetaPost).  *Note Memory dumps::.
     Also sets the program name to DUMPNAME if no '-progname' option was
     given.

'-halt-on-error'
     Stop processing and exit when an error occurs, as opposed to the
     normal process of trying to recover and continue.

'-ini'
     Enable the "initial" form of the program (*note Initial and
     virgin::).  This is implicitly set if the program name is 'initex'
     resp. 'inimf'.

'-interaction=STRING'
     Set the interaction mode from the command line.  The STRING must be
     one of 'batchmode', 'nonstopmode', 'scrollmode', or
     'errorstopmode'.

'-jobname=STRING'
     Set the job name to STRING, instead of deriving it from the name of
     the input file.

'-kpathsea-debug=NUMBER'
     Set path searching debugging flags according to the bits of NUMBER
     (*note (kpathsea)Debugging::).  You can also specify this in
     'KPATHSEA_DEBUG' environment variable (for all Web2c programs).
     (The command line value overrides.)  The most useful value is '-1',
     to get all available output.

'-output-directory=DIRNAME'
     Specify the directory DIRNAME to which output files are written.
     Also look for input files in DIRNAME first, before looking along
     the normal search path.  *Note Output file location::.

'-parse-first-line'
'-no-parse-first-line'
     Check or disable checking whether the first line of the main input
     file starts with '%&', and parse it if it does.  This line can be
     used specify the format and/or a TCX file.

'-progname=STRING'
     Set program (and memory dump) name to STRING.  This may affect the
     search paths and other values used (*note (kpathsea)Config
     files::).  Using this option is equivalent to making a link named
     STRING to the binary and then invoking the binary under that name.
     *Note Memory dumps::.

'-recorder'
     Enable the filename recorder.  This makes the program save a list
     of the opened files into a file with (by default) extension '.fls'.
     For Aleph, this option is always on, and the file has extension
     '.ofl'.

     Ordinarily, the '.fls' file is written to the same location as the
     '.log' file, for example, respecting '-output-directory' if it is
     given (*note Output file location::).  However, if TeX processing
     is done on the command line (or in response to the '**' prompt),
     the '.fls' might be written to the current directory, or include an
     integer (the current pid), as in 'texput1234.fls'.  You can use
     '-jobname' to explicitly set the basename.

'-translate-file=TCXFILE'
     Use TCXFILE to define which characters are printable and
     translations between the internal and external character sets.
     Moreover, TCXFILE can be explicitly declared in the first line of
     the main input file '%& -translate-file=TCXFILE'.  This is the
     recommended method for portability reasons.  *Note TCX files::.

'-8bit'
     This option specifies that by default all characters should be
     considered printable.  If '-translate-file' was given as well, then
     the TCX file may mark characters as non-printable.  This is a no-op
     in engines natively supporting Unicode.


File: web2c.info,  Node: Path searching,  Next: Output file location,  Prev: Common options,  Up: Commonalities

3.3 Path searching
==================

All of the Web2c programs, including TeX, which do path searching use
the Kpathsea routines to do so.  The precise names of the environment
and configuration file variables which get searched for particular file
formatted are therefore documented in the Kpathsea manual (*note
(kpathsea)Supported file formats::).  Reading 'texmf.cnf' (*note
(kpathsea)Config files::), invoking 'mktex...' scripts (*note
(kpathsea)mktex scripts::), and so on are all handled by Kpathsea.

   The programs which read fonts make use of another Kpathsea feature:
'texfonts.map', which allows arbitrary aliases for the actual names of
font files; for example, 'Times-Roman' for 'ptmr8r.tfm'.  The
distributed (and installed by default) 'texfonts.map' includes aliases
for many widely available PostScript fonts by their PostScript names.


File: web2c.info,  Node: Output file location,  Prev: Path searching,  Up: Commonalities

3.4 Output file location
========================

All the programs generally follow the usual convention for output files.
Namely, they are placed in the directory current when the program is
run, regardless of any input file location; or, in a few cases, output
is to standard output.

   For example, if you run 'tex /tmp/foo', for example, the output will
be in './foo.dvi' and './foo.log', not '/tmp/foo.dvi' and
'/tmp/foo.log'.

   You can use the '-output-directory' option to cause all output files
that would normally be written in the current directory to be written in
the specified directory instead.  *Note Common options::.

   If the current directory is not writable, and '-output-directory' is
not specified, the main programs (TeX, Metafont, MetaPost, and BibTeX)
make an exception: if the config file or environment variable value
'TEXMFOUTPUT' is set (it is not by default), output files are written to
the directory specified.

   'TEXMFOUTPUT' is also checked for input files, as TeX often generates
files that need to be subsequently read; for input, no suffixes (such as
'.tex') are added by default and no exhaustive path searching is done,
the input name is simply checked as given.


File: web2c.info,  Node: Three programs,  Next: TeX,  Prev: Commonalities,  Up: Top

4 Three programs: Metafont, MetaPost, and TeX
*********************************************

TeX, Metafont, and MetaPost have a number of features in common.
Besides the ones here, command-line options and other commonalities are
described in the previous section.

* Menu:

* Runtime options::             The 'texmf.cnf' configuration file.
* Initial and virgin::          Making memory dumps vs. production runs.
* Memory dumps::                .fmt/.base files for fast startup.
* Editor invocation::           The 'e' response at errors.
* \input filenames::            Filename delimiters and Kpathsea expansion.


File: web2c.info,  Node: Runtime options,  Next: Initial and virgin,  Up: Three programs

4.1 Runtime options
===================

Besides the configure- and compile-time options described in the
installation section (*note Installation::), you can control a number of
parameters in the 'texmf.cnf' runtime file read by Kpathsea (*note
(kpathsea)Config files::).

   The main purpose of 'texmf.cnf' is to specify search paths, but array
sizes and other options are also set there.  Most are rather obscure.
Here are a few of the more interesting values:

'main_memory'
     Total words of memory available, for TeX, Metafont, and MetaPost.
     Must remake the format file after changing.

'extra_mem_bot'
     Extra space for "large" TeX data structures (default 0): boxes,
     glue, breakpoints, et al.  If you use PiCTeX, you may well want to
     set this.

'expand_depth'
     Limit on recursive expansion calls before TeX aborts (default
     10000).  If a TeX program does an unterminated recursive expansion,
     TeX will dutifully expand macros until the system's runtime stack
     overflows, typically with a segmentation fault (SIGSEGV). This
     parameter was introduced to minimize the chance of that unpleasant
     (though not dangerous) crash, instead allowing TeX to quit with a
     more informative message.

     The crash can still happen, though, if the system has an
     exceptionally small memory allocation for its stack.  There is no
     quantitative way to determine the limit, and it does not seem worth
     implementing system-dependent heuristics to guess at the number,
     since it's highly improbable that any real TeX code will ever need
     more than 10000 recursive expansions (it has never happened).  For
     the same reason, using the libsigsegv library
     (<https://gnu.org/s/libsigsegv>) does not seem worth the effort.

'texmf_casefold_search'
     *Note (kpathsea)Casefolding search::.

   Ideally all arrays would be dynamically expanded as necessary, so the
only limiting factor would be the amount of swap space available, or
some configurable limit much larger than can currently be supported.

   Unfortunately, implementing this is extremely difficult, as the fixed
size of arrays is assumed in many places throughout the source code.
These runtime limits are a practical compromise between the compile-time
limits in previous versions, and truly dynamic arrays.  (On the other
hand, the Web2c BibTeX implementation does do true dynamic reallocation
of some arrays.)

   Nowadays there is rarely a reason to modify the values.  But if you
do wish to modify 'texmf.cnf', in TeX Live the best approach is to put
your changes, and only your changes at the top of the TL installation
tree.  That is, if the system 'texmf.cnf' is installed in
'/some/path/to/texlive/YYYY/texmf-dist/web2c/texmf.cnf' is put your
custom settings in '/some/path/to/texlive/YYY/texmf.cnf', where YYYY is
the year of installation (if you use that subdirectory; it's the
default).  That way, unrelated changes to the system 'texmf.cnf' can
happen with normal updates, without affecting your local values.


File: web2c.info,  Node: Initial and virgin,  Next: Memory dumps,  Prev: Runtime options,  Up: Three programs

4.2 Initial and virgin
======================

The TeX and Metafont programs each have two main variants, called
"initial" and "virgin".  MetaPost no longer makes this distinction.

   The initial form is enabled if:
  1. the '-ini' option was specified; or
  2. the program name is 'initex' resp. 'inimf'; or
  3. the first line of the main input file is '%&ini';
otherwise, the virgin form is used.

   The "virgin" form is the one generally invoked for production use.
The first thing it does is read a memory dump (*note Determining the
memory dump to use::), and then proceeds on with the main job.

   The "initial" form is generally used only to create memory dumps (see
the next section).  It starts up more slowly than the virgin form,
because it must do lengthy initializations that are encapsulated in the
memory dump file.


File: web2c.info,  Node: Memory dumps,  Next: Editor invocation,  Prev: Initial and virgin,  Up: Three programs

4.3 Memory dumps
================

In typical use, TeX and Metafont require a large number of macros to be
predefined; therefore, they support "memory dump" files, which can be
read much more efficiently than ordinary source code.

* Menu:

* Creating memory dumps::
* Determining the memory dump to use::
* Hardware and memory dumps::


File: web2c.info,  Node: Creating memory dumps,  Next: Determining the memory dump to use,  Up: Memory dumps

4.3.1 Creating memory dumps
---------------------------

The programs all create memory dumps in slightly idiosyncratic (thought
substantially similar) way, so we describe the details in separate
sections (references below).  The basic idea is to run the initial
version of the program (*note Initial and virgin::), read the source
file to define the macros, and then execute the '\dump' primitive.

   Also, each program uses a different filename extension for its memory
dumps, since although they are completely analogous they are not
interchangeable (TeX cannot read a Metafont memory dump, for example).

   Here is a list of filename extensions with references to examples of
creating memory dumps:

TeX
     ('.fmt') *Note Initial TeX: Initial TeX.

Metafont
     ('.base') *Note Initial Metafont::.

   When making memory dumps, the programs read environment variables and
configuration files for path searching and other values as usual.  If
you are making a new installation and have environment variables
pointing to an old one, for example, you will probably run into
difficulties.


File: web2c.info,  Node: Determining the memory dump to use,  Next: Hardware and memory dumps,  Prev: Creating memory dumps,  Up: Memory dumps

4.3.2 Determining the memory dump to use
----------------------------------------

The virgin form (*note Initial and virgin::) of each program always
reads a memory dump before processing normal source input.  All three
programs determine the memory dump to use in the same way:

  1. If the first non-option command-line argument begins with '&', the
     program uses the remainder of that argument as the memory dump
     name.  For example, running 'tex \&super' reads 'super.fmt'.  (The
     backslash protects the '&' against interpretation by the shell.)

  2. If the '-fmt' resp. '-base' option is specified, its value is used.

  3. If the '-progname' option is specified, its value is used.

  4. If the first line of the main input file (which must be specified
     on the command line, not in response to '**') is '%&DUMP', and DUMP
     is an existing memory dump of the appropriate type, DUMP is used.

     The first line of the main input file can also specify which
     character translation file is to be used:
     '%&-translate-file=TCXFILE' (*note TCX files::).

     These two roles can be combined: '%&DUMP -translate-file=TCXFILE'.
     If this is done, the name of the dump must be given first.

  5. Otherwise, the program uses the program invocation name, most
     commonly 'tex' resp. 'mf'.  For example, if 'latex' is a link to
     'tex', and the user runs 'latex foo', 'latex.fmt' will be used.


File: web2c.info,  Node: Hardware and memory dumps,  Prev: Determining the memory dump to use,  Up: Memory dumps

4.3.3 Hardware and memory dumps
-------------------------------

By default, memory dump files are sharable between architectures of
different types; specifically, on machines of different endianness
(*note (libc)Byte order::) and with different word sizes (4-byte 'long'
vs. 8-byte 'long').  This is a feature of the Web2c implementation, and
is not true of all TeX implementations.

   The script 'tl-check-fmtshare' in the TeX Live source tree
('Master/tlpkg/bin') provides a relatively easy way to test that a
'.fmt' built on the local host can be loaded by a TeX engine built on
some remote host.

   If you specify '--disable-dump-share' to 'configure', however, memory
dumps will be endian-dependent.  The reason to do this is speed.  To
achieve endian-independence, the reading of memory dumps on LittleEndian
architectures, such as PC's and DEC architectures, is somewhat slowed
(all the multibyte values have to be swapped).  Usually, this is not
noticeable, and the advantage of being able to share memory dumps across
all platforms at a site far outweighs the speed loss.  But if you're
trying to squeeze out every possible bit of performance, you may wish to
do this.

   TeXnically, even without '--disable-dump-share', sharing of '.fmt'
files cannot be guaranteed to work.  Floating-point values are always
written in native format, and hence will generally not be readable
across platforms.  Fortunately, TeX uses floating point only to
represent glue ratios, and none of the common formats (plain, LaTeX,
AMSTeX, ...) do any glue setting at '.fmt'-creation time.  Metafont does
not use floating point in any dumped value at all.

   Incidentally, different memory dump files will never compare equal
byte-for-byte, because the programs dump the current date and time.  So
don't be alarmed by a few bytes difference.

   If you don't know what endianness your machine is, and you're
curious, here is a little C program to tell you.  (The 'configure'
script contains a similar program.)  This is from the book 'C: A
Reference Manual', by Samuel P. Harbison and Guy L. Steele Jr.  (*note
References::).

     main ()
     {
       /* Are we little or big endian?  From Harbison&Steele.  */
       union
       {
         long l;
         char c[sizeof (long)];
       } u;
       u.l = 1;
       if (u.c[0] == 1)
         printf ("LittleEndian\n");
       else if (u.c[sizeof (long) - 1] == 1)
         printf ("BigEndian\n");
       else
         printf ("unknownEndian");

       exit (u.c[sizeof (long) - 1] == 1);
     }

   You can add 'printf("long %d\n", sizeof(long));' to see the size of
the 'long' data type.


File: web2c.info,  Node: Editor invocation,  Next: \input filenames,  Prev: Memory dumps,  Up: Three programs

4.4 Editor invocation
=====================

TeX, Metafont, and MetaPost all (by default) stop and ask for user
intervention at an error.  If the input came from a file, and the user
responds with 'e' or 'E', the program invokes an editor.

   Specifying '--with-editor=CMD' to 'configure' sets the default editor
command string to CMD.  The environment variables/configuration values
'TEXEDIT', 'MFEDIT', and 'MPEDIT' (respectively) override this.  If
'--with-editor' is not specified, the default is 'vi +%d %s' on Unix,
and an invocation of the TeXworks editor on Windows.  (See 'texmf.cnf'
for the precise values.)

   In this string, '%d' is replaced by the line number of the error, and
'%s' is replaced by the name of the current input file.


File: web2c.info,  Node: \input filenames,  Prev: Editor invocation,  Up: Three programs

4.5 '\input' filenames
======================

TeX, Metafont, and MetaPost source programs can all read other source
files with the '\input' (TeX) and 'input' (MF and MP) primitives:
     \input NAME % in TeX

   The file NAME can always be terminated with whitespace; for Metafont
and MetaPost, the statement terminator ';' also works.  (LaTeX and other
macro packages provide other interfaces to '\input' that allow different
notation; here we are concerned only with the primitive operation.)

   As (allowed) extensions to standard TeX, Web2c also supports
specifying the filename in double quotes ('"some name"') and in braces
('{some name}'), which is convenient for filenames containing spaces or
other special characters, as described in the sections below.

   In all cases, space tokens are ignored after the filename is read.

   Also, double quote ('"') characters are ignored within the filename;
there is no way to read files whose names contain a '"'.

   However, for maximal portability of your document across systems, use
only the characters 'a'-'z', '0'-'9', and at most one '.'.  Do not use
anything but simple filenames, since directory separators vary among
systems; instead, add the necessary directories to the appropriate
search path.

* Menu:

* Quotes: \input quoted filename.   \input "some name"
* Braces: \input braced filename.   \input {some name}
* Caveats: \input filename caveats. Tokenization, nulls, Kpathsea expansion.


File: web2c.info,  Node: \input quoted filename,  Next: \input braced filename,  Up: \input filenames

4.5.1 '\input' quoted filename: '\input "some name"'
----------------------------------------------------

As of Web2c version 7.5.3 (2004), double-quote characters can be used to
include spaces or other special characters.  In typical use, the '"'
characters surround the entire filename:
     \input "filename with spaces"

   Technically, the quote characters can be used inside the name, and
can enclose any characters, as in:
     \input filename" "with" "spaces

   One more point.  In LaTeX, the quotes are needed inside the braces of
its '\input' macro, thus:
     \input{a b}    % fails
     \input{"a b"}  % ok

   There is no way to quote the quote character.


File: web2c.info,  Node: \input braced filename,  Next: \input filename caveats,  Prev: \input quoted filename,  Up: \input filenames

4.5.2 '\input' braced filename: '\input{some name}'
---------------------------------------------------

As of Web2c 2020, '\input' filenames in TeX engines (this does not apply
in Metafont and MetaPost) can also be specified within a TeX group,
typically curly braces.  For example:
     \input{filename with spaces}

   As always with TeX, the brace characters are not hardwired; what
counts is the category code: the first token after the '\input' must be
of catcode 1 (begin group), and it is matched with the next character of
catcode 2 (end group).

   Within the group-delimited filename, braces are treated as normal
characters.

   As with all forms of filenames, following spaces are ignored (after
the end group), and double quote ('"') characters are ignored within the
filename.


File: web2c.info,  Node: \input filename caveats,  Prev: \input braced filename,  Up: \input filenames

4.5.3 '\input' filename caveats
-------------------------------

The quoting mechanisms just described come into play _after_ TeX has
tokenized and expanded the input.  So, multiple spaces and tabs will
generally be seen as a single space, active characters such as '~' are
expanded first (generally causing an error), and so on.  More examples
below.

   On the other hand, various C library routines and Unix itself use the
null byte (character code zero, ASCII NUL) to terminate strings.  So
filenames in Web2c cannot contain nulls, even though TeX itself does not
treat NUL specially.

   Finally, the present Web2c implementation does '~' and '$' expansion
on NAME, unlike Knuth's original implementation.  Thus:
     \input ~jsmith/$foo.bar
   will dereference the environment variable or Kpathsea config file
value 'foo' and read that file, extended with '.bar', in user 'jsmith''s
home directory.  You can also use braces in the variable expansion, as
in '${foo}bar', if you want to follow the variable name with a letter,
numeral, or '_'.

   (So another way to get a program to read a filename containing
whitespace is to define an environment variable and dereference it.)

   In all the common TeX formats (plain TeX, LaTeX, ConTeXt, AMSTeX,
...), the characters '~' and '$' have special category codes, so to
actually use these in a document you have to change their catcodes or
use '\string'.


File: web2c.info,  Node: TeX,  Next: Metafont,  Prev: Three programs,  Up: Top

5 TeX: Typesetting
******************

TeX is a typesetting system: it was especially designed to handle
complex mathematics, as well as most ordinary text typesetting.

   TeX is a batch language, like C or Pascal, and not an interactive
"word processor": you compile a TeX input file into a corresponding
device-independent (DVI) file (and then translate the DVI file to the
commands for a particular output device).  This approach has both
considerable disadvantages and considerable advantages.  For a complete
description of the TeX language, see 'The TeXbook' (*note References::).
Many other books on TeX, introductory and otherwise, are available.

* Menu:

* tex invocation::              Invoking TeX.
* Initial TeX::                 Making format files.
* Formats::                     Major TeX macro packages.
* Languages and hyphenation::   TeX supports many human languages.
* Shell escapes::               Running subprograms from TeX.
* IPC and TeX::                 DVI output to a socket.
* TeX extensions::              Additional engines with additional features.


File: web2c.info,  Node: tex invocation,  Next: Initial TeX,  Up: TeX

5.1 'tex' invocation
====================

TeX (usually invoked as 'tex') formats the given text and commands, and
outputs a corresponding device-independent representation of the typeset
document.  This section merely describes the options available in the
Web2c implementation.  For a complete description of the TeX typesetting
language, see 'The TeXbook' (*note References::).

   TeX, Metafont, and MetaPost process the command line (described here)
and determine their memory dump (fmt) file in the same way (*note Memory
dumps::).  Synopses:

     tex [OPTION]... [TEXNAME[.tex]] [TEX-COMMANDS]
     tex [OPTION]... \FIRST-LINE
     tex [OPTION]... &FMT ARGS

   TeX searches the usual places for the main input file TEXNAME (*note
(kpathsea)Supported file formats::), extending TEXNAME with '.tex' if
necessary.  To see all the relevant paths, set the environment variable
'KPATHSEA_DEBUG' to '-1' before running the program.

   After TEXNAME is read, TeX processes any remaining TEX-COMMANDS on
the command line as regular TeX input.  Also, if the first non-option
argument begins with a TeX escape character (usually '\'), TeX processes
all non-option command-line arguments as a line of regular TeX input.

   If no arguments or options are specified, TeX prompts for an input
file name with '**'.

   TeX writes the main DVI output to the file 'BASETEXNAME.dvi', where
BASETEXNAME is the basename of TEXNAME, or 'texput' if no input file was
specified.  A DVI file is a device-independent binary representation of
your TeX document.  The idea is that after running TeX, you translate
the DVI file using a separate program to the commands for a particular
output device, such as a PostScript printer (*note Introduction:
(dvips)Top.) or an X Window System display (see xdvi(1)).

   TeX also reads TFM files for any fonts you load in your document with
the '\font' primitive.  By default, it runs an external program named
'mktextfm' to create any nonexistent TFM files.  You can disable this at
configure-time or runtime (*note (kpathsea)mktex configuration::).  This
is enabled mostly for the sake of the EC fonts, which can be generated
at any size.

   TeX can write output files, via the '\openout' primitive; this opens
a security hole vulnerable to Trojan horse attack: an unwitting user
could run a TeX program that overwrites, say, '~/.rhosts'.  (MetaPost
has a 'write' primitive with similar implications).  To alleviate this
and similar problems the functions 'kpathsea_out_name_ok' and
'kpathsea_in_name_ok' from the Kpathsea library (*note (kpathsea)Calling
sequence::) are used to determine if a given filename is acceptable to
be opened for output or input, depending on the setting of the
configuration variables 'openout_any' and 'openin_any': 'a' (for "any",
the default for 'openin_any'), 'r' (for "restricted"), or 'p' (for
"paranoid", the default for 'openout_any').

   In any case, all '\openout' filenames are recorded in the log file,
except those opened on the first line of input, which is processed when
the log file has not yet been opened.

   The program accepts the following options, as well as the standard
'-help' and '-version' (*note Common options::):
'-enc'
'-[no]-file-line-error'
'-fmt=FMTNAME'
'-halt-on-error'
'-ini'
'-interaction=STRING'
'-ipc'
'-ipc-start'
'-jobname=STRING'
'-kpathsea-debug=NUMBER'
'-[no]parse-first-line'
'-output-directory'
'-progname=STRING'
'-recorder'
'-translate-file=TCXFILE'
'-8bit'
     These options are common to TeX, Metafont, and MetaPost.  *Note
     Common options::.

'-enc'
     Enable encTeX extensions, such as '\mubyte'.  This can be used to
     support the Unicode UTF-8 input encoding, although using an engine
     with native Unicode support is more common nowadays.
     <http://www.olsak.net/enctex.html>.

'-ipc'
'-ipc-start'
     With either option, TeX writes its DVI output to a socket as well
     as to the usual '.dvi' file.  With '-ipc-start', TeX also opens a
     server program at the other end to read the output.  *Note IPC and
     TeX: IPC and TeX.

     These options are available only if the '--enable-ipc' option was
     specified to 'configure' during installation of Web2c.

'-mktex=FILETYPE'
'-no-mktex=FILETYPE'
     Turn on or off the 'mktex' script associated with FILETYPE.  For
     TeX proper, FILETYPE can only be 'tex' and 'tfm', but for pdfTeX
     and luaTeX, it can also be 'pk'.

'-mltex'
     If we are 'INITEX' (*note Initial and virgin::), enable MLTeX
     extensions such as '\charsubdef'.  Implicitly set if the program
     name is 'mltex'.  *Note MLTeX: MLTeX.

'-output-comment=STRING'
     Use STRING as the DVI file comment.  Ordinarily, this comment
     records the date and time of the TeX run, but if you are doing
     regression testing, you may not want the DVI file to have this
     spurious difference.  This is also taken from the environment
     variable and config file value 'output_comment'.

'-shell-escape'
'-no-shell-escape'
'-shell-restricted'
     Enable, or disable, or enable with restrictions the
     '\write18{SHELL-COMMAND}' feature for external executing shell
     commands.  *Note Shell escapes::.

'-enable-write18'
'-disable-write18'
     Synonyms for '-shell-escape' and '-no-shell-escape', for
     compatibility with MiKTeX.  (MiKTeX also accepts both pairs of
     options.)  *Note Shell escapes::.

'-src-specials'
'-src-specials=STRING'
     This option makes TeX output specific source information using
     '\special' commands in the DVI file.  These '\special' track the
     current file name and line number.

     Using the first form of this option, the '\special' commands are
     inserted automatically.

     In the second form of the option, STRING is a comma separated list
     of the following values: 'cr', 'display', 'hbox', 'math', 'par',
     'parend', 'vbox'.  You can use this list to specify where you want
     TeX to output such commands.  For example, '-src-specials=cr,math'
     will output source information every line and every math formula.

     These commands can be used with the appropriate DVI viewer and text
     editor to switch from the current position in the editor to the
     same position in the viewer and back from the viewer to the editor.

     This option works by inserting '\special' commands into the token
     stream, and thus in principle these additional tokens can be
     recovered or seen by the tricky-enough macros.  If you run across a
     case, let us know, because this counts as a bug.  However, such
     bugs are very hard to fix, requiring significant changes to TeX, so
     please don't count on it.

     Redefining '\special' will not affect the functioning of this
     option.  The commands inserted into the token stream are hard-coded
     to always use the '\special' primitive.

     TeX does not pass the trip test when this option is enabled.


File: web2c.info,  Node: Initial TeX,  Next: Formats,  Prev: tex invocation,  Up: TeX

5.2 Initial TeX
===============

The "initial" form of TeX is invoked by 'tex -ini'.  It does lengthy
initializations avoided by the "virgin" ('vir') form, so as to be
capable of dumping '.fmt' files (*note Memory dumps::).  For a detailed
comparison of virgin and initial forms, *note Initial and virgin::.

   For a list of options and other information, *note tex invocation::.

   Unlike Metafont and MetaPost, many format files are commonly used
with TeX.  The standard one implementing the features described in the
'TeXbook' is 'plain.fmt', also known as 'tex.fmt' (again, *note Memory
dumps::).  It is created by default during installation, but you can
also do so by hand if necessary (e.g., if an update to 'plain.tex' is
issued):
     tex -ini '\input plain \dump'
(The quotes prevent interpretation of the backslashes from the shell.)
Then install the resulting 'plain.fmt' in '$(fmtdir)'
('/usr/local/share/texmf/web2c' by default), and link 'tex.fmt' to it.

   The necessary invocation for generating a format file differs for
each format, so instructions that come with the format should explain.
The top-level 'web2c' Makefile has targets for making most common
formats: plain latex amstex texinfo eplain.  *Note Formats::, for more
details on TeX formats.


File: web2c.info,  Node: Formats,  Next: Languages and hyphenation,  Prev: Initial TeX,  Up: TeX

5.3 Formats
===========

TeX "formats" are large collections of macros, often dumped into a
'.fmt' file (*note Memory dumps::) by 'tex -ini' (*note Initial TeX::).
A number of formats are in reasonably widespread use, and the Web2c
Makefile has targets to make the versions current at the time of
release.  You can change which formats are automatically built by
setting the 'fmts' Make variable; by default, only the 'plain' and
'latex' formats are made.

   Nowadays, the formats are generally installed and updated as part of
a larger TeX distribution, such as TeX Live (<https://tug.org/texlive>).

latex
     The most widely used format.  The current release is named
     'LaTeX2e'; new versions are released approximately every six
     months, with patches issued as needed.  The old release was called
     'LaTeX 2.09', and is no longer maintained or supported.  LaTeX
     attempts to provide generic markup instructions, such as
     "emphasize", instead of specific typesetting instructions, such as
     "use the 10pt Computer Modern italic font".  The LaTeX home page:
     <https://www.latex-project.org>.

context
     ConTeXt is an independent macro package which has a basic document
     structuring approach similar to LaTeX.  It also supports creating
     interactive PDF files and has integrated MetaPost support, among
     many other interesting features.  The ConTeXt home page:
     <http://www.pragma-ade.com>.

amstex
     The official typesetting system of the American Mathematical
     Society.  Like LaTeX, it encourages generic markup commands.  The
     AMS also provides many LaTeX packages for authors who prefer LaTeX.
     Taken together, they are used to produce nearly all AMS
     publications, e.g., 'Mathematical Reviews'.  The AMSTeX home page:
     <https://www.ams.org/tex>.

texinfo
     The documentation system developed and maintained by the Free
     Software Foundation for their software manuals.  It can be
     automatically converted into plain text, a machine-readable on-line
     format called 'info', HTML, etc.  The Texinfo home page:
     <https://www.gnu.org/software/texinfo>.

eplain
     The "expanded plain" format provides various common features (e.g.,
     symbolic cross-referencing, tables of contents, indexing, citations
     using BibTeX), for those authors who prefer to handle their own
     high-level formatting.  The Eplain home page:
     <https://tug.org/eplain>.

slitex
     An obsolete LaTeX 2.09 format for making slides.  It is replaced by
     the 'slides' document class, although the 'beamer' package is the
     most commonly method for making slides nowadays.  The Beamer page
     on CTAN: <https://ctan.org/pkg/beamer>.


File: web2c.info,  Node: Languages and hyphenation,  Next: Shell escapes,  Prev: Formats,  Up: TeX

5.4 Languages and hyphenation
=============================

TeX supports most natural languages.  See also *note TeX extensions: TeX
extensions.

* Menu:

* MLTeX::                Multi-lingual TeX.
* TCX files::            Support for different character sets & fonts.
* patgen invocation::    Creating hyphenation patterns.


File: web2c.info,  Node: MLTeX,  Next: TCX files,  Up: Languages and hyphenation

5.4.1 MLTeX: Multi-lingual TeX
------------------------------

Multi-lingual TeX ('mltex') is an extension of TeX originally written by
Michael Ferguson and now updated and maintained by Bernd Raichle.  With
the advent of Unicode, it has become obsolete, though it is still
supported in Web2c in the event of bugs or compilation bugs.

   MLTeX allows the use of non-existing glyphs in a font by declaring
glyph substitutions.  These are restricted to substitutions of an
accented character glyph, which need not be defined in the current font,
by its appropriate '\accent' construction using a base and accent
character glyph, which do have to exist in the current font.  This
substitution is automatically done behind the scenes, if necessary, and
thus MLTeX additionally supports hyphenation of words containing an
accented character glyph for fonts missing this glyph (e.g., Computer
Modern).  Standard TeX suppresses hyphenation in this case.

   MLTeX works at '.fmt'-creation time: the basic idea is to specify the
'-mltex' option to TeX when you '\dump' a format.  Then, when you
subsequently invoke TeX and read that '.fmt' file, the MLTeX features
described below will be enabled.

   Generally, you use special macro files to create an MLTeX '.fmt'
file.

   The sections below describe the two new primitives that MLTeX
defines.  Aside from these, MLTeX is completely compatible with standard
TeX.

* Menu:

* \charsubdef::                 Character substitution definitions.
* \tracingcharsubdef::          Tracing substitutions.


File: web2c.info,  Node: \charsubdef,  Next: \tracingcharsubdef,  Up: MLTeX

5.4.1.1 '\charsubdef': Character substitutions
..............................................

The most important primitive MLTeX adds is '\charsubdef', used in a way
reminiscent of '\chardef':
     \charsubdef COMPOSITE [=] ACCENT BASE

   Each of COMPOSITE, ACCENT, and BASE are font glyph numbers, expressed
in the usual TeX syntax: `\e symbolically, '145 for octal, "65 for hex,
101 for decimal.

   MLTeX's '\charsubdef' declares how to construct an accented character
glyph (not necessarily existing in the current font) using two character
glyphs (that do exist).  Thus it defines whether a character glyph code,
either typed as a single character or using the '\char' primitive, will
be mapped to a font glyph or to an '\accent' glyph construction.

   For example, if you assume glyph code 138 (decimal) for an
e-circumflex and you are using the Computer Modern fonts, which have the
circumflex accent in position 18 and lowercase 'e' in the usual ASCII
position 101 decimal, you would use '\charsubdef' as follows:

     \charsubdef 138 = 18 101

   For the plain TeX format to make use of this substitution, you have
to redefine the circumflex accent macro '\^' in such a way that if its
argument is character 'e' the expansion '\char138 ' is used instead of
'\accent18 e'.  Similar '\charsubdef' declaration and macro
redefinitions have to be done for all other accented characters.

   To disable a previous '\charsubdef C', redefine C as a pair of zeros.
For example:
     \charsubdef '321 = 0 0  % disable N tilde
(Octal '321 is the ISO Latin-1 value for the Spanish N tilde.)

   '\charsubdef' commands should only be given once.  Although in
principle you can use '\charsubdef' at any time, the result is
unspecified.  If '\charsubdef' declarations are changed, usually either
incorrect character dimensions will be used or MLTeX will output missing
character warnings.  (The substitution of a '\charsubdef' is used by TeX
when appending the character node to the current horizontal list, to
compute the width of a horizontal box when the box gets packed, and when
building the '\accent' construction at '\shipout'-time.  In summary, the
substitution is accessed often, so changing it is not desirable, nor
generally useful.)


File: web2c.info,  Node: \tracingcharsubdef,  Prev: \charsubdef,  Up: MLTeX

5.4.1.2 '\tracingcharsubdef': Substitution diagnostics
......................................................

To help diagnose problems with '\charsubdef', MLTeX provides a new
primitive parameter, '\tracingcharsubdef'.  If positive, every use of
'\charsubdef' will be reported.  This can help track down when a
character is redefined.

   In addition, if the TeX parameter '\tracinglostchars' is 100 or more,
the character substitutions actually performed at '\shipout'-time will
be recorded.


File: web2c.info,  Node: TCX files,  Next: patgen invocation,  Prev: MLTeX,  Up: Languages and hyphenation

5.4.2 TCX files: Character translations
---------------------------------------

TCX (TeX character translation) files help TeX support direct input of
8-bit international characters if fonts containing those characters are
being used.  Specifically, they map an input (keyboard) character code
to the internal TeX character code (a superset of ASCII).

   Of the various proposals for handling more than one input encoding,
TCX files were chosen because they follow Knuth's original ideas for the
use of the 'xchr' and 'xord' tables.  He ventured that these would be
changed in the WEB source in order to adjust the actual version to a
given environment.  It turns out, however, that recompiling the WEB
sources is not as simple a task as Knuth may have imagined; therefore,
TCX files, providing the possibility of changing of the conversion
tables on on-the-fly, have been implemented instead.

   This approach limits the portability of TeX documents, as some
implementations do not support it (or use a different method for
input-internal reencoding).  It may also be problematic to determine the
encoding to use for a TeX document of unknown provenance; in the worst
case, failure to do so correctly may result in subtle errors in the
typeset output.  But we feel the benefits outweigh these disadvantages.

   This is entirely independent of the MLTeX extension (*note MLTeX::):
whereas a TCX file defines how an input keyboard character is mapped to
TeX's internal code, MLTeX defines substitutions for a non-existing
character glyph in a font with a '\accent' construction made out of two
separate character glyphs.  TCX files involve no new primitives; it is
not possible to specify that an input (keyboard) character maps to more
than one character.

   Information on specifying TCX files:

   * The best way to specify a TCX file is to list it explicitly in the
     first line of the main document:
          %& -translate-file=TCXFILE

   * You can also specify a TCX file to be used on a particular TeX run
     with the command-line option '-translate-file=TCXFILE'.

   * TCX files are searched for along the 'WEB2C' path.

   * Initial TeX (*note Initial TeX: Initial TeX.) ignores TCX files.

   The Web2c distribution comes with a number of TCX files.  Two
important ones are 'il1-t1.tcx' and 'il2-t1.tcx', which support ISO
Latin 1 and ISO Latin 2, respectively, with Cork-encoded fonts
(a.k.a. the LaTeX T1 encoding).  TCX files for Czech, Polish, and Slovak
are also provided.

   One other notable TCX file is 'empty.tcx', which is, well, empty.
Its purpose is to reset Web2C's behavior to the default (only visible
ASCII being printable, as described below) when a format was dumped with
another TCX being active--which is in fact the case for everything but
plain TeX in the TeX Live and other distributions.  Thus:

     latex somefile8.tex
     => terminal etc. output with 8-bit chars
     latex --translate-file=empty.tcx somefile8.tex
     => terminal etc. output with ^^ notation

   Syntax of TCX files:
  1. Line-oriented.  Blank lines are ignored.

  2. Whitespace is ignored except as a separator.

  3. Comments start with '%' and continue to the end of the line.

  4. Otherwise, a line consists of one or two character codes,
     optionally followed by 0 or 1.  The last number indicates whether
     DEST is considered printable.
          SRC [DEST [PRNT]]

  5. Each character code may be specified in octal with a leading '0',
     hexadecimal with a leading '0x', or decimal otherwise.  Values must
     be between 0 and 255, inclusive (decimal).

  6. If the DEST code is not specified, it is taken to be the same as
     SRC.

  7. If the same SRC code is specified more than once, it is the last
     definition that counts.

   Finally, here's what happens: when TeX sees an input character with
code SRC, it 1) changes SRC to DEST; and 2) makes the DEST code
"printable", i.e., printed as-is in diagnostics and the log file rather
than in '^^' notation.

   By default, no characters are translated, and character codes between
32 and 126 inclusive (decimal) are printable.

   Specifying translations for the printable ASCII characters (codes
32-127) will yield unpredictable results.  Additionally you shouldn't
make the following characters printable: '^^I' (TAB), '^^J' (line feed),
'^^M' (carriage return), and '^^?' (delete), since TeX uses them in
various ways.

   Thus, the idea is to specify the input (keyboard) character code for
SRC, and the output (font) character code for DEST.

   By default, only the printable ASCII characters are considered
printable by TeX.  If you specify the '-8bit' option, all characters are
considered printable by default.  If you specify both the '-8bit' option
and a TCX file, then the TCX can set specific characters to be
non-printable.

   Both the specified TCX encoding and whether characters are printable
are saved in the dump files (like 'tex.fmt').  So by giving these
options in combination with '-ini', you control the defaults seen by
anyone who uses the resulting dump file.

   When loading a dump, if the '-8bit' option was given, then all
characters become printable by default.

   When loading a dump, if a TCX file was specified, then the TCX data
from the dump is ignored and the data from the file used instead.


File: web2c.info,  Node: patgen invocation,  Prev: TCX files,  Up: Languages and hyphenation

5.4.3 Patgen: Creating hyphenation patterns
-------------------------------------------

Patgen creates hyphenation patterns from dictionary files for use with
TeX.  Synopsis:

     patgen DICTIONARY PATTERNS OUTPUT TRANSLATE

   Each argument is a filename.  No path searching is done.  The output
is written to the file OUTPUT.

   In addition, Patgen prompts interactively for other values.

   For more information, see 'Word hy-phen-a-tion by com-put-er' by
Frank Liang (*note References::), and also the 'patgen.web' source file.

   The only options are '-help' and '-version' (*note Common options::).


File: web2c.info,  Node: Shell escapes,  Next: IPC and TeX,  Prev: Languages and hyphenation,  Up: TeX

5.5 Shell escapes
=================

TeX can execute "shell escapes", that is, arbitrary shell commands.
Although tremendously useful, this also has obvious security
implications.  Therefore, as of TeX Live 2009, a "restricted" mode for
shell escapes is the default mode of operation, which allows executing
only certain commands, as specified in the 'texmf.cnf' configuration
file.

   * Unrestricted shell escapes are allowed if the option
     '--shell-escape' is specified, or if the environment variable or
     config file value 'shell_escape' is set to 't' or 'y' and '1'.

   * Restricted shell escapes are allowed if 'shell_escape' is set to
     'p'.  This is the default.

   * Shell escapes are completely disabled if '--no-shell-escape' is
     specified, or if 'shell_escape' is set to anything else.

   When enabled, the TeX construct to execute a system command is
'\write18{SHELL-COMMAND}'; for example:

     \write18{echo "hello, world"}

   From TeX's point of view, this is a normal '\write' command, and is
therefore subject to the usual TeX expansions.  Also, the system call
either happens during the '\output' routine or right away, according to
the absence or presence of the '\immediate' prefix, as usual for
'\write'.

   The SHELL-COMMAND string is passed to the command shell (via the C
library function 'system').  The output of SHELL-COMMAND is not diverted
anywhere, so it will not appear in the log file, or anywhere but the
terminal output.  The exit status of the system call is also not
available to TeX.

   In unrestricted mode, the argument is simply passed straight to
'system' unaltered.

   In restricted mode, ASCII double quote characters (") should always
be used in the argument to '\write18' where quoting of arguments is
needed, as in the example above.  This is to achieve some measure of
system independence.  On Unix systems, these are replaced with single
quote (') characters to avoid insecure further expansion.  Care is also
taken on Windows to avoid additional expansions (from, e.g., `...`).
Mismatched quotation marks in the command string result in a diagnostic
message in the log file; no execution is performed.

   After quotation processing, if the first word (delimited by a space
or tab) of the command is in the list specified by the
'shell_escape_commands' configuration value, the command is executed.
Otherwise it is not.  In any case, a message is written to the log file.

   The 'shell_escape_commands' value is a comma-separated list of words.
Whitespace is significant, and typically should not be present.  The
default definition in 'texmf.cnf' looks like this, but with more
commands included:

     shell_escape_commands = bibtex,kpsewhich,repstopdf,...

   pdfTeX and luaTeX support reading (via '\input' and '\openin') and
writing (via '\openout') from pipes if the first character is '|'.  The
following command is then treated exactly the same as the argument to
'\write18'.  In these engines, the primitive variable '\pdfshellescape'
is set to 0 if shell escapes are disabled, 1 if they are enabled, and 2
if they are enabled with restrictions.

   The purpose of this feature is to make it possible for TeX documents
to perform useful external actions in the common case of an individual
user running a known document on his or her own machine.  In such
environments as CGI scripts or wikis where the input has to be
considered untrustworthy, shell escapes should be completely disabled.


File: web2c.info,  Node: IPC and TeX,  Next: TeX extensions,  Prev: Shell escapes,  Up: TeX

5.6 IPC and TeX
===============

(If anyone uses this feature and needs documentation, write
<tex-k@tug.org>.)

   This functionality is available only if the '--enable-ipc' option was
specified to 'configure' during installation of Web2c (*note
Installation::).

   If you define 'IPC_DEBUG' before compilation (e.g., with 'make
XCFLAGS=-DIPC_DEBUG'), TeX will print messages to standard error about
its socket operations.  This may be helpful if you are, well, debugging.


File: web2c.info,  Node: TeX extensions,  Prev: IPC and TeX,  Up: TeX

5.7 Extended TeX engines
========================

The base TeX program has been extended in many ways.

   There has been a substantial effort to make a set of extended
functionality available across all actively-updated engines, so that
formats, notably LaTeX, can rely on it.  A list of this common extended
functionality is in a 'LaTeX News' article,
<https://www.latex-project.org/news/latex2e-news/ltnews31.pdf>.  For
engines in TeX Live, the detailed documentation for these primitives is
mostly in the pdfTeX manual (<http://pdftex.org>).

   In addition, each engine (naturally) has its own particular features,
described in its own manual.  Here's a partial list of the engines.

e-TeX
     Adds many new primitives, including right-to-left typesetting and
     more registers.  Now frozen.  More info:
     <https://ctan.org/pkg/etex>.

Aleph
     This adds Unicode support, right-to-left typesetting, and more,
     based on the Omega engine, with the e-TeX and other extensions.
     Aleph is maintained only for serious bug fixes and does not include
     the common functionality mentioned above.  More info:
     <https://ctan.org/pkg/aleph>, <https://ctan.org/pkg/omega>.

pdfTeX
     Can produce PDF as well as DVI files.  It also incorporates the
     e-TeX extensions, new primitives for hypertext and
     micro-typography, reading/writing from pipes, and much more.  In
     TeX Live, the command 'etex' invokes pdfTeX to make all these
     additions available with DVI output.  Home page:
     <http://pdftex.org>.

LuaTeX
     Embeds the Lua programming language (<http://lua.org>) and opens up
     the TeX typesetting engine to control from Lua, starting from the
     pdfTeX capabilities as a base.  Also natively supports UTF-8 input,
     the OpenType and TrueType font formats, and use of system fonts.
     Home page: <http://luatex.org>.

XeTeX
     Combines support for Unicode input, the OpenType and TrueType font
     formats, and use of system fonts with the capabilities of pdfTeX,
     with the exception of the font expansion part of micro-typography.
     Home page: <https://tug.org/xetex>.

hiTeX
     Outputs its own HINT format, which is designed for reading
     technical documents on mobile devices.  More info:
     <https://ctan.org/pkg/hitex>.

pTeX
upTeX
     With additional support for Japanese; pTeX was the original engine,
     and upTeX has native Unicode support and thus is more useful for
     Chinese and Korean.  More info: <https://ctan.org/pkg/ptex>,
     <https://ctan.org/pkg/uptex>.

epTeX
eupTeX
     Further extends pTeX and upTeX with the e-TeX extensions.  More
     info: <https://ctan.org/pkg/eptex>, <https://ctan.org/pkg/euptex>.


File: web2c.info,  Node: Metafont,  Next: MetaPost,  Prev: TeX,  Up: Top

6 Metafont: Creating typeface families
**************************************

Metafont is a system for producing shapes; it was designed for producing
complete typeface families, but it can also produce geometric designs,
dingbats, etc.  And it has considerable mathematical and
equation-solving capabilities which can be useful entirely on their own.

   Metafont is a batch language, like C or Pascal: you compile a
Metafont program into a corresponding font, rather than interactively
drawing lines or curves.  This approach has both considerable
disadvantages (people unfamiliar with conventional programming languages
will be unlikely to find it usable) and considerable advantages (you can
make your design intentions specific and parameterizable).  For a
complete description of the Metafont language, see 'The METAFONTbook'
(*note References::).

* Menu:

* mf invocation::               Invoking Metafont.
* Initial Metafont::            Making bases.
* Modes::                       Device definitions for Metafont.
* Online Metafont graphics::    Seeing MF output online.
* gftodvi invocation::          Making proofsheets for fonts.
* mft invocation::              Prettyprinting Metafont sources.


File: web2c.info,  Node: mf invocation,  Next: Initial Metafont,  Up: Metafont

6.1 'mf' invocation
===================

Metafont (usually invoked as 'mf') reads character definitions specified
in the Metafont programming language, and outputs the corresponding
font.  This section merely describes the options available in the Web2c
implementation.  For a complete description of the Metafont language,
see 'The Metafontbook' (*note References::).

   Metafont processes its command line and determines its memory dump
(base) file in a way exactly analogous to MetaPost and TeX (*note tex
invocation::, and *note Memory dumps::).  Synopses:

     mf [OPTION]... [MFNAME[.mf]] [MF-COMMANDS]
     mf [OPTION]... \FIRST-LINE
     mf [OPTION]... &BASE ARGS

   Most commonly, a Metafont invocation looks like this:
     mf '\mode:=MODE; mag:=MAGNIFICATION; input MFNAME'
(The single quotes avoid unwanted interpretation by the shell.)

   Metafont searches the usual places for the main input file MFNAME
(*note (kpathsea)Supported file formats::), extending MFNAME with '.mf'
if necessary.  To see all the relevant paths, set the environment
variable 'KPATHSEA_DEBUG' to '-1' before running the program.  By
default, Metafont runs an external program named 'mktexmf' to create any
nonexistent Metafont source files you input.  You can disable this at
configure-time or runtime (*note (kpathsea)mktex configuration::).  This
is mostly for the sake of the EC fonts, which can be generated at any
size.

   Metafont writes the main GF output to the file 'BASEMFNAME.NNNgf',
where NNN is the font resolution in pixels per inch, and BASEMFNAME is
the basename of MFNAME, or 'mfput' if no input file was specified.  A GF
file contains bitmaps of the actual character shapes.  Usually GF files
are converted immediately to PK files with GFtoPK (*note gftopk
invocation::), since PK files contain equivalent information, but are
more compact.  (Metafont output in GF format rather than PK for only
historical reasons.)

   Metafont also usually writes a metric file in TFM format to
'BASEMFNAME.tfm'.  A TFM file contains character dimensions, kerns, and
ligatures, and spacing parameters.  TeX reads only this .tfm file, not
the GF file.

   The MODE in the example command above is a name referring to a device
definition (*note Modes::); for example, 'localfont' or 'ljfour'.  These
device definitions must generally be precompiled into the base file.  If
you leave this out, the default is 'proof' mode, as stated in 'The
Metafontbook', in which Metafont outputs at a resolution of 2602dpi;
this is usually not what you want.  The remedy is simply to assign a
different mode--'localfont', for example.

   The MAGNIFICATION assignment in the example command above is a
magnification factor; for example, if the device is 600dpi and you
specify 'mag:=2', Metafont will produce output at 1200dpi.  Very often,
the MAGNIFICATION is an expression such as 'magstep(.5)', corresponding
to a TeX "magstep", which are factors of 1.2 * sqrt(2).

   After running Metafont, you can use the font in a TeX document as
usual.  For example:
     \font\myfont = newfont
     \myfont Now I am typesetting in my new font (minimum hamburgers).

   The program accepts the following options, as well as the standard
'-help' and '-version' (*note Common options::):
'-[no]-file-line-error'
'-fmt=FMTNAME'
'-halt-on-error'
'-ini'
'-interaction=STRING'
'-jobname=STRING'
'-kpathsea-debug=NUMBER'
'-[no]parse-first-line'
'-output-directory'
'-progname=STRING'
'-recorder'
'-translate-file=TCXFILE'
'-8bit'
     These options are common to TeX, Metafont, and MetaPost.  *Note
     Common options::.

'-mktex=FILETYPE'
'-no-mktex=FILETYPE'
     Turn on or off the 'mktex' script associated with FILETYPE.  The
     only value that makes sense for FILETYPE is 'mf'.


File: web2c.info,  Node: Initial Metafont,  Next: Modes,  Prev: mf invocation,  Up: Metafont

6.2 Initial Metafont
====================

'inimf' is the "initial" form of Metafont, which does lengthy
initializations avoided by the "virgin" ('vir') form, so as to be
capable of dumping '.base' files (*note Memory dumps::).  For a detailed
comparison of virgin and initial forms, see *note Initial and virgin::.

   For a list of options and other information, see *note mf
invocation::.

   The only memory dump file commonly used with Metafont is the default
'plain.base', also known as 'mf.base' (again, *note Memory dumps::).  It
is created by default during installation, but you can also do so by
hand if necessary (e.g., if a Metafont update is issued):
     mf -ini '\input plain; input modes; dump'
(The quotes prevent interpretation of the backslashes from the shell.)
Then install the resulting 'plain.base' in '$(basedir)'
('/usr/local/share/texmf/web2c' by default), and link 'mf.base' to it.

   For an explanation of the additional 'modes.mf' file, see *note
Modes::.  This file has no counterpart in TeX or MetaPost.

   In the past, it was sometimes useful to create a base file
'cmmf.base' (a.k.a. 'cm.base'), with the Computer Modern macros also
included in the base file.  Nowadays, however, the additional time
required to read 'cmbase.mf' is exceedingly small, usually not enough to
be worth the administrative hassle of updating the 'cmmf.base' file when
you install a new version of 'modes.mf'.  People actually working on a
typeface may still find it worthwhile to create their own base file, of
course.


File: web2c.info,  Node: Modes,  Next: Online Metafont graphics,  Prev: Initial Metafont,  Up: Metafont

6.3 Modes: Device definitions for Metafont
==========================================

Running Metafont and creating Metafont base files requires information
that TeX and MetaPost do not: "mode" definitions which specify device
characteristics, so Metafont can properly rasterize the shapes.

   When making a base file, a file containing modes for
locally-available devices should be input after 'plain.mf'.  One
commonly used file is <ftp://ftp.tug.org/tex/modes.mf>; it includes all
known definitions.

   If, however, for some reason you have decreased the memory available
in your Metafont, you may need to copy 'modes.mf' and remove the
definitions irrelevant to you (probably most of them) instead of using
it directly.  (Or, if you're a Metafont hacker, maybe you can suggest a
way to redefine 'mode_def' and/or 'mode_setup'; right now, the amount of
memory used is approximately four times the total length of the
'mode_def' names, and that's a lot.)

   If you have a device not included in 'modes.mf', please see comments
in that file for how to create the new definition, and please send the
definition to <tex-fonts@math.utah.edu> to get it included in the next
release of 'modes.mf'.

   Usually, when you run Metafont you must supply the name of a mode
that was dumped in the base file.  But you can also define the mode
characteristics dynamically, by invoking Metafont with an assignment to
'smode' instead of 'mode', like this:
     mf '\smode:="newmode.mf"; mag:=MAGNIFICATION; input MFNAME'
This is most useful when you are working on the definition of a new
mode.

   The MAGNIFICATION and MFNAME arguments are explained in *note mf
invocation::.  In the file 'newmode.mf', you should have the following
(with no 'mode_def' or 'enddef'), if you are using 'modes.mf'
conventions:
     mode_param (pixels_per_inch, DPI);
     mode_param (blacker, B);
     mode_param (fillin, F);
     mode_param (o_correction, O);
     mode_common_setup_;
(Of course, you should use real numbers for DPI, B, F, and O.)

   For more information on the use of 'smode', or if you are not using
'modes.mf', see page 269 of 'The Metafontbook'.


File: web2c.info,  Node: Online Metafont graphics,  Next: gftodvi invocation,  Prev: Modes,  Up: Metafont

6.4 Online Metafont graphics
============================

The Web2c implementation of Metafont can do online graphics with a
number of devices.  (See the Metafont manual for more information about
how to draw on your screen.)  By default, no graphics support is
enabled.

   Metafont examines the 'MFTERM' environment variable or config file
value at runtime, or the 'TERM' environment variable if 'MFTERM' is not
set, to determine the device support to use.  Naturally, only the
devices for which support has been compiled in can be selected.

   Here is a table of the possibilities, showing the 'MFTERM' value and
the corresponding 'configure' option(s) in parentheses.

'epsf'
     ('--enable-epsfwin') Pseudo-window server for Encapsulated
     PostScript (see 'web2c/window/epsf.c').  This device produces an
     EPS file containing the graphics which would be displayed online on
     other devices.  The name of the EPS file defaults to metafont.eps
     but can be changed by setting the MFEPSF environment variable to
     the new filename.  Contributed by Mathias Herberts.

'hp2627'
     ('--enable-hp2627win') HP2627a color graphics terminals.

'mftalk'
     ('--enable-mftalkwin') Generic window server (see
     'web2c/window/mftalk.c').

'next'
     ('--enable-next') NeXT window system.  This requires a separate
     program, called 'DrawingServant', available separately.  See the
     'web2c/window/next.c'.

'regis'
     ('--enable-regiswin') Regis terminals.

'sun'
     ('--enable-suntoolswin') The old Suntools (not any flavor of X)
     window system.  (You can get the even older SunWindows 'gfx' system
     by using 'sun-gfx.c'.)

'tek'
     ('--enable-tektronixwin') Tektronix terminals.

'uniterm'
     ('--enable-unitermwin') Uniterm, Simon Poole's emulator of a smart
     Tektronix 4014 terminal.  This may work with regular Tektronix
     terminals as well; it's faster than the driver
     '--enable-tektronixwin' selects.

'xterm'
     '--with-x' The X window system (version 11).

     There are two variants of the X11 support, one that works with the
     Xt toolkit, and another that works directly with Xlib.  The Xt
     support is more efficient and has more functionality, so it is the
     default.  If you must use the Xlib support, use 'configure --with-x
     --with-kf-x-toolkit=no'.

     Specify '--disable-mf-nowin' in order not to build a separate
     non-windows-capable Metafont executable 'mf-nowin' (or
     'mf-nowin.exe').

     You cannot specify any of the usual X options (e.g., '-geometry')
     on the Metafont command line, but you can specify X resources in
     your '~/.Xdefaults' or '~/.Xresources' file.  The class name is
     'Metafont'.  If you're using the Xt support, all the usual X
     toolkit resources are supported.  If you're using the Xlib support,
     only the 'geometry' resource is supported.

     You specify the X display to which Metafont connects in the
     'DISPLAY' environment variable, as usual.

   Writing support for a new device is straightforward.  Aside from
defining the basic drawing routines that Metafont uses (see 'mf.web'),
you only have to add another entry to the tables on the last page of
'web2c/lib/texmfmp.c'.  Or you can write an independent program and use
MFtalk (see 'web2c/window/mftalk.c').


File: web2c.info,  Node: gftodvi invocation,  Next: mft invocation,  Prev: Online Metafont graphics,  Up: Metafont

6.5 GFtoDVI: Character proofs of fonts
======================================

GFtoDVI makes "proof sheets" from a GF bitmap file as output by, for
example, Metafont (*note Metafont::).  This is an indispensable aid for
font designers or Metafont hackers.  Synopsis:

     gftodvi [OPTION]... GFNAME[gf]

   The font GFNAME is searched for in the usual places (*note
(kpathsea)Glyph lookup::).  To see all the relevant paths, set the
environment variable 'KPATHSEA_DEBUG' to '-1' before running the
program.

   The suffix 'gf' is supplied if not already present.  This suffix is
not an extension, no '.' precedes it; for instance, 'cmr10.600gf'.

   The output filename is the basename of GFNAME extended with '.dvi',
e.g., 'gftodvi /wherever/foo.600gf' creates './foo.dvi'.

   The characters from GFNAME appear one per page in the DVI output,
with labels, titles, and annotations, as specified in Appendix H
(Hardcopy Proofs) of 'The Metafontbook'.

   GFtoDVI uses several fonts besides GFNAME itself:

   * "gray font" (default 'gray'): for the pixels that actually make up
     the character.  Simply using black is not right, since then labels,
     key points, and other information could not be shown.

   * "title font" (default 'cmr8'): for the header information at the
     top of each output page.

   * "label font" (default 'cmtt10'): for the labels on key points of
     the figure.

   * "slant font" (no default): for diagonal lines, which are otherwise
     simulated using horizontal and vertical rules.

   To change the default fonts, you must use 'special' commands in your
Metafont source file, typically via commands like 'slantfont slantlj4'.
There is no default slant font since no one printer is suitable as a
default.  You can make your own by copying one of the existing files,
such as '.../fonts/source/public/misc/slantlj4.mf' and then running 'mf'
on it.

   For testing purposes, you may it useful to run 'mf-nowin rtest' (hit
RETURN when it stops) to get a 'gf' file of a thorn glyph.  Or use 'mf'
instead of 'mf-nowin' to have the glyph(s) displayed on the screen.
After that, 'gftodvi rtest.2602gf' should produce 'rtest.dvi', which you
process as usual.

   The program accepts the following option, as well as the standard
'-verbose', '-help', and '-version' (*note Common options::):

'-overflow-label-offset=POINTS'
     Typeset the so-called overflow labels, if any, POINTS TeX points
     from the right edge of the character bounding box.  The default is
     a little over two inches (ten million scaled points, to be
     precise).  Overflow equations are used to locate coordinates when
     their actual position is too crowded with other information.


File: web2c.info,  Node: mft invocation,  Prev: gftodvi invocation,  Up: Metafont

6.6 MFT: Prettyprinting Metafont source
=======================================

MFT translates a Metafont program into a TeX document suitable for
typesetting, with the aid of TeX macros defined in the file
'mftmac.tex'.  Synopsis:

     mft [OPTION]... MFNAME[.mf]

   MFT searches the usual places for MFNAME (*note (kpathsea)Supported
file formats::).  To see all the relevant paths, set the environment
variable 'KPATHSEA_DEBUG' to '-1' before running the program.  The
output goes to the basename of MFNAME extended with '.tex', e.g., 'mft
/wherever/foo.mf' creates './foo.tex'.

   Line breaks in the input are carried over into the output; moreover,
blank spaces at the beginning of a line are converted to quads of
indentation in the output.  Thus, you have full control over the
indentation and line breaks.  Each line of input is translated
independently of the others.

   Further control is allowed via Metafont comments:
   * Metafont comments following a single '%' should be valid TeX input.
     But Metafont material can be included within vertical bars in a
     comment; this will be translated by MFT as if it were regular
     Metafont code.  For example, a comment like '% |x2r| is the tip of
     the bowl' will be translated into the TeX '% $x_{2r}$ is the ...',
     i.e., the 'x2r' is treated as an identifier.

   * '%%' indicates that the remainder of an input line should be copied
     verbatim to the output.  This is typically used to introduce
     additional TeX material at the beginning or an MFT job, e.g.  code
     to modify the standard layout or the formatting macros defined in
     'mftmac.tex', or to add a line saying '%%\bye' at the end of the
     job.  (MFT doesn't add this automatically in order to allow
     processing several files produces by MFT in the same TeX job.)

   * '%%% TOKEN1 OTHER-TOKENS' introduces a change in MFT's formatting
     rules; all the OTHER-TOKENS will henceforth be translated according
     to the current conventions for TOKEN1.  The tokens must be symbolic
     (i.e., not numeric or string tokens).  For example, the input line
          %%% addto fill draw filldraw
     says to format the 'fill', 'draw', and 'filldraw' operations of
     plain Metafont just like the primitive token 'addto', i.e., in
     boldface type.  Without such reformatting commands, MFT would treat
     'fill' like an ordinary tag or variable name.  In fact, you need a
     '%%%' command even to get parentheses to act like delimiters.

   * '%%%%' introduces an MFT comment, i.e., MFT ignores the remainder
     of such a line.

   * Five or more '%' signs should not be used.

   (The above description was edited from 'mft.web', written by
D.E. Knuth.)

   The program accepts the following options, as well as the standard
'-help' and '-version' (*note Common options::):
'-change=CHFILE[.ch]'
     Apply the change file CHFILE as with Tangle and Weave (*note
     WEB::).

'-style=MFTFILE[.mft]'
     Read MFTFILE before anything else; a MFT style file typically
     contains only MFT directives as described above.  The default style
     file is named 'plain.mft', which defines this properly for programs
     using plain Metafont.  The MFT files is searched along the
     'MFTINPUTS' path; see *note (kpathsea)Supported file formats::.

     Other examples of MFT style files are 'cmbase.mft', which defines
     formatting rules for the macros defined in 'cm.base', and 'e.mft',
     which was used in the production of Knuth's Volume E, 'Computer
     Modern Typefaces'.

     Using an appropriate MFT style file, it is also possible to
     configure MFT for typesetting MetaPost sources.  However, MFT does
     not search the usual places for MetaPost input files.

   If you use eight-bit characters in the input file, they are passed on
verbatim to the TeX output file; it is up to you to configure TeX to
print these properly.


File: web2c.info,  Node: MetaPost,  Next: BibTeX,  Prev: Metafont,  Up: Top

7 MetaPost: Generating PostScript
*********************************

MetaPost is a picture-drawing language similar to Metafont (*note
Metafont::), but instead of outputting bitmaps in a "font", it outputs
PostScript commands.  It's primarily intended for creating technical
illustrations, but can also be used to create PostScript or OpenType
fonts (<https://ctan.org/pkg/metatype1>).

   MetaPost also provides for arbitrary integration of text and graphics
in a natural way, using any typesetter (TeX and Troff are both
supported) and a number of other subsidiary programs, described below.

* Menu:

* mpost invocation::            Invoking MetaPost.
* Initial MetaPost::            Making mems.
* dvitomp invocation::          DVI-to-MPX translation.


File: web2c.info,  Node: mpost invocation,  Next: Initial MetaPost,  Up: MetaPost

7.1 'mpost' invocation
======================

MetaPost (installed as 'mpost') reads a series of pictures specified in
the MetaPost programming language, and outputs corresponding PostScript
code.  This section merely describes the options available in the Web2c
implementation.  For a complete description of the MetaPost language,
see AT&T technical report CSTR-162, generally available in
'TEXMF/doc/metapost/', where TEXMF is the root of TeX directory
structure.  The MetaPost home page: <https://tug.org/metapost>.

   Also, a standard MetaPost package for drawing graphs is documented in
AT&T technical report CSTR-164, available as the file 'mpgraph.ps',
generally stored alongside 'mpman.ps'.

   MetaPost processes its command line and determines its memory dump
(mem) file in a way analogous to Metafont and TeX (*note 'tex'
invocation: tex invocation, and *note Memory dumps::).  Synopses:

     mpost [OPTION]... [MPNAME[.mp]] [MP-COMMANDS]
     mpost [OPTION]... \FIRST-LINE
     mpost [OPTION]... &MEM ARGS

   MetaPost searches the usual places for the main input file MPNAME
(*note (kpathsea)Supported file formats::), extending MPNAME with '.mp'
if necessary.  To see all the relevant paths, set the environment
variable 'KPATHSEA_DEBUG' to '-1' before running the program.

   MetaPost writes its PostScript output to a series of files
'BASEMPNAME.NNN' (or perhaps 'BASEMPNAME.ps', very occasionally
'BASEMPNAME.tfm'), where NNN are the figure numbers specified in the
input, typically to the 'beginfig' macro, and BASEMPNAME is the basename
of MPNAME, or 'mpout' if no input file was specified.  MetaPost uses the
'.ps' extension when the figure number is out of range, e.g., if you say
'beginfig(-1)'.

   You can use the output files as figures in a TeX document just as
with any other PostScript figures.  For example, with this TeX command:
     \special{psfile="FILENAME"}
or by using 'epsf.tex' (*note (dvips)EPSF macros::).

   The MetaPost construct
     btex ... TEX-INPUT ... etex
generates a MetaPost picture expression corresponding to TEX-INPUT.

   The construct
     verbatimtex ... TEX-INPUT ... etex
simply passes the TEX-INPUT through to TeX.  For example, if you are
using LaTeX, your MetaPost input file must start with a 'verbatimtex'
block that gives the necessary '\documentclass' (or '\documentstyle')
'\begin{document}' command.  You will also need to set the environment
variable 'TEX' to 'latex'.

   TEX-INPUT need not be specifically TeX input; it could also be Troff.
In that case, you will need the '-m pictures' Troff macro package
(unfortunately absent from many Troff implementations), or an equivalent
such as the '-m pspic' macros from GNU groff described in grops(1).

   Naturally, you must use fonts that are supported by the typesetter;
specifically, you'll probably want to use standard PostScript fonts with
Troff.  And only the TeX system understands Computer Modern or other
Metafont fonts; you can also use PostScript fonts with TeX, of course.

   MetaPost-generated PostScript figures which do use Computer Modern
fonts for labels cannot be directly previewed or printed.  Instead, you
must include them in a TeX document and run the resulting DVI file
through Dvips to arrange for the downloading of the required fonts
(*note (dvips)Fonts in figures::).  To help with this, the MetaPost
distribution provides a small TeX file 'mproof.tex' which is typically
called as:
     tex mproof MP-OUTPUT-FILES... ; dvips mproof -o
The resulting file 'mproof.ps' can then be printed or previewed.

   To generate EPSF files, set the internal MetaPost variable
'prologues' positive.  To make the output files self-contained, use only
standard PostScript fonts.  MetaPost reads the same 'psfonts.map' file
as Dvips, to determine PostScript fonts that need to be downloaded
(*note (dvips)psfonts.map::).

   It is possible for pdfTeX to read MetaPost output directly; this is
in contrast to general EPSF files, which have to be converted for use
with PDF output.  The easiest way is to name the MetaPost output files
with the '.mps' extension.  Then the LaTeX '\includegraphics' command,
for example, will be able to read them, even when outputting PDF.

   MetaPost can write output files, via the 'write' primitive; this
opens a security hole.  *Note tex invocation::.

   The program accepts the following options, as well as the standard
'-help' and '-version' (*note Common options::):
'-[no]-file-line-error'
'-fmt=FMTNAME'
'-halt-on-error'
'-ini'
'-interaction=STRING'
'-jobname=STRING'
'-kpathsea-debug=NUMBER'
'-[no]parse-first-line'
'-output-directory'
'-progname=STRING'
'-recorder'
'-translate-file=TCXFILE'
'-8bit'
     These options are common to TeX, Metafont, and MetaPost.  *Note
     Common options::.

'-T'
'-troff'
     Set the 'prologues' internal variable to '1'.

'-tex=TEXPROGRAM'
     When this option is given, the program TEXPROGRAM is used to
     typeset the labels.


File: web2c.info,  Node: Initial MetaPost,  Next: dvitomp invocation,  Prev: mpost invocation,  Up: MetaPost

7.2 Initial MetaPost
====================

As of MetaPost 1.504 (TeX Live 2011), MetaPost no longer dumps '.mem'
files (*note Memory dumps::) and does not distinguish virgin and initial
forms (*note Initial and virgin::).  Instead, the "initial" file name is
read in its source form--that is, 'mpost.mp' when the program is invoked
as 'mpost'.

   For a list of options and other information, see *note mpost
invocation::.

   MetaPost provides a format with all the features of plain Metafont,
called 'mfplain'.  You can use that in the same way; just run 'mfplain'
instead of 'mpost'.  This lets you directly process Metafont source
files with MetaPost, producing character proofs (one file for each
character) similar to those produced with Metafont in proof mode and
GFtoDVI (*note gftodvi invocation::).


File: web2c.info,  Node: dvitomp invocation,  Prev: Initial MetaPost,  Up: MetaPost

7.3 DVItoMP: DVI to MPX conversion
==================================

DVItoMP converts DVI files into low-level MetaPost commands in a
so-called MPX file.  Synopsis:

     dvitomp DVIFILE[.dvi] [MPXFILE[.mpx]]

If MPXFILE is not specified, the output goes to the basename of DVIFILE
extended with '.mpx', e.g., 'dvitomp /wherever/foo.dvi' creates
'./foo.mpx'.

   DVItoMP supports Dvips-style color specials, such as 'color push
NAME' and 'color pop', outputting them as 'withcolor' MetaPost commands.

   The only options are '-help' and '-version' (*note Common options::).


File: web2c.info,  Node: BibTeX,  Next: WEB,  Prev: MetaPost,  Up: Top

8 BibTeX: Bibliographies
************************

BibTeX automates much of the job of typesetting bibliographies, and
makes bibliography entries reusable in many different contexts.

* Menu:

* bibtex invocation::
* Basic BibTeX style files::    The standard and semi-standard styles.


File: web2c.info,  Node: bibtex invocation,  Next: Basic BibTeX style files,  Up: BibTeX

8.1 BibTeX invocation
=====================

BibTeX creates a printable bibliography ('.bbl') file from references in
a '.aux' file, generally written by TeX or LaTeX.  The '.bbl' file is
then incorporated on a subsequent run.  The basic bibliographic
information comes from '.bib' files, and a BibTeX style ('.bst') file
controls the precise contents of the '.bbl' file.  Synopsis:

     bibtex [OPTION]... AUXFILE[.aux]

The output goes to the basename of AUXFILE extended with '.bbl'; for
example, 'bibtex /wherever/foo.aux' creates './foo.bbl'.  BibTeX also
writes a log file to the basename of AUXFILE extended with '.blg'.

   The names of the '.bib' and '.bst' files are specified in the '.aux'
file as well, via the '\bibliography' and '\bibliographystyle' (La)TeX
macros.  BibTeX searches for '.bib' files using the 'BIBINPUTS' and
'TEXBIB' paths, and for '.bst' files using 'BSTINPUTS' (*note
(kpathsea)Supported file formats::).  It does no path searching for
'.aux' files.

   The program accepts the following options, as well as the standard
'-help' and '-version' (*note Common options::):
'-terse'
     Suppress the program banner and progress reports normally output.

'-min-crossrefs=N'
     If at least N (2 by default) bibliography entries refer to another
     entry E via their 'crossref' field, include E in the .bbl file,
     even if it was not explicitly referenced in the .aux file.  For
     example, E might be a conference proceedings as a whole, with the
     cross-referencing entries being individual articles published in
     the proceedings.

     If you want to avoid these automatic inclusions altogether, make N
     a sufficiently large number, and be sure to remove any previous
     .aux and .bbl files.  Otherwise the option may appear to have no
     effect, since BibTeX will have added the citation for E to the
     .aux, and nothing will remove it.

   See also:
'btxdoc.tex'
     Basic LaTeXable documentation for general BibTeX users.

'btxhak.tex'
     LaTeXable documentation for style designers.

'btxdoc.bib'
     BibTeX database file for the two above documents.

'xampl.bib'
     Example database file with all the standard entry types.

'<ftp://ftp.math.utah.edu/pub/tex/bib/>'
     A very large '.bib' and '.bst' collection, including references for
     all the standard TeX books and a complete bibliography for TUGboat.


File: web2c.info,  Node: Basic BibTeX style files,  Prev: bibtex invocation,  Up: BibTeX

8.2 Basic BibTeX style files
============================

Here are descriptions of the four standard and four semi-standard basic
BibTeX styles.  'CTAN:/biblio/bibtex' contains these and many more (for
CTAN info, *note (kpathsea)unixtex.ftp::).

'plain'
     Sorts entries alphabetically, with numeric labels.  Generally
     formatted according to van Leunen's 'A Handbook for Scholars'.  The
     other style files listed here are based on 'plain'.

'abbrv'
     First names, month names, and journal names are abbreviated.

'acm'
     Names are printed in small caps.

'alpha'
     Alphanumeric labels, e.g., 'Knu66'.

'apalike'
     No labels at all; instead, the year appears in parentheses after
     the author.  Use this in conjunction with 'apalike.tex' (plain TeX)
     or 'apalike.sty' (LaTeX), which also changes the citations in the
     text to be '(AUTHOR, YEAR)'.

'ieeetr'
     Numeric labels, entries in citation order, IEEE abbreviations,
     article titles in quotes.

'siam'
     Numeric labels, alphabetic order, 'Math. Reviews' abbreviations,
     names in small caps.

'unsrt'
     Lists entries in citation order, i.e., unsorted.

'btxbst.doc'
     The template file and documentation for the standard styles.


File: web2c.info,  Node: WEB,  Next: DVI utilities,  Prev: BibTeX,  Up: Top

9 WEB: Literate programming
***************************

"WEB" languages allow you to write a single source file that can produce
both a compilable program and a well-formatted document describing the
program in as much detail as you wish to prepare.  Writing in this kind
of dual-purpose language is called "literate programming".  (The Usenet
newsgroup 'comp.programming.literate' is devoted to this subject.)

   WEB-like languages have been implemented with many pairs of base
languages: Cweb provides C and Troff (*note References::); CWEB provides
C and TeX ('CTAN:/web/c_cpp/cweb'); Spiderweb provides C, C++, Awk, Ada,
many others, and TeX ('CTAN:/web/spiderweb'); and, of course, the
original WEB provides Pascal and TeX, the implementation languages for
the original TeX, Metafont, MetaPost, and related programs to come from
the TeX project at Stanford.

   The original WEB language is documented in the file 'webman.tex',
which is included in the <ftp://ftp.tug.org/tex/lib.tar.gz> archive (and
available in many other places, of course).

* Menu:

* tangle invocation::
* weave invocation::
* pooltype invocation::


File: web2c.info,  Node: tangle invocation,  Next: weave invocation,  Up: WEB

9.1 Tangle: Translate WEB to Pascal
===================================

Tangle creates a compilable Pascal program from a WEB source file (*note
WEB::).  Synopsis:

     tangle [OPTION]... WEBFILE[.web] [CHANGEFILE[.ch]]

The Pascal output is written to the basename of WEBFILE extended with
'.p'; for example, 'tangle /wherever/foo.web' creates './foo.p'.  Tangle
applies CHANGEFILE to WEBFILE before writing the output; by default,
there is no change file.

   If the program makes use of the WEB string facility, Tangle writes
the string pool to the basename of WEBFILE extended with '.pool'.

   The Pascal output is packed into lines of 72 characters or less, with
the only concession to readability being the termination of lines at
semicolons when this can be done conveniently.

   The program accepts the following options, as well as the standard
'--help' and '--version' (*note Common options::):

'-length=NUMBER'
     The number of characters that are considered significant in an
     identifier.  Whether underline characters are counted depends on
     the '-underline' option.  The default value is 32, the original
     tangle used 7, but this proved too restrictive for use by Web2c.

'-lowercase'
'-mixedcase'
'-uppercase'
     These options specify the case of identifiers in the output of
     tangle.  If '-uppercase' ('-lowercase') is specified, tangle will
     convert all identifiers to uppercase (lowercase).  The default is
     '-mixedcase', which specifies that the case will not be changed.

'-underline'
     When this option is given, tangle does not strip underline
     characters from identifiers.

'-loose'
'-strict'
     These options specify how strict tangle must be when checking
     identifiers for equality.  The default is '-loose', which means
     that tangle will follow the rules set by the case-smashing and
     underline options above.  If '-strict' is set, then identifiers
     will always be stripped of underlines and converted to uppercase
     before checking whether they collide.


File: web2c.info,  Node: weave invocation,  Next: pooltype invocation,  Prev: tangle invocation,  Up: WEB

9.2 Weave: Translate WEB to TeX
===============================

Weave creates a TeX document from a WEB source file (*note WEB::),
assuming various macros defined in 'webmac.tex'.  It takes care of
typographic details such as page layout, indentation, and italicizing
identifiers.  It also automatically gathers and outputs extensive
cross-reference information.  Synopsis:

     weave [OPTION]... WEBFILE[.web] [CHANGEFILE[.ch]]

The output is to the basename of WEBFILE extended with '.tex'; for
example, 'weave /wherever/foo.web' creates './foo.tex'.  Weave applies
CHANGEFILE to WEBFILE before writing the output; by default, there is no
change file.

   The program accepts the following option, as well as the standard
'-verbose', '-help' and '-version' (*note Common options::):
'-x'
     Omit the cross-reference information: the index, the list of WEB
     module names, and the table of contents (an empty 'CONTENTS.tex'
     file will still be written when the Weave output file is processed
     by TeX using the default 'webmac.tex', though).

   Conventionally, WEB programmers should define the TeX '\title' macro
at the beginning of the source file.  Also, to get output of only
changed modules, one can say '\let\maybe=\iffalse' (usually as the first
change in the change file).


File: web2c.info,  Node: pooltype invocation,  Prev: weave invocation,  Up: WEB

9.3 Pooltype: Display WEB pool files
====================================

Pooltype shows the so-called "string number" of each string in a WEB
pool file (*note WEB::), as output by Tangle (*note tangle
invocation::), including the first 256 strings corresponding to the
possible input characters.  Pooltype primarily serves as an example of
WEB conventions to implementors of the TeX system.  Synopsis:

     pooltype [OPTION]... POOLFILE[.pool]

No path searching is done for POOLFILE.  Output is to standard output.

   The only options are '--help' and '--version' (*note Common
options::).

   As an example of the output, here is the (edited) output for
'tex.pool':
     0: "^^@"
     1: "^^A"
     ...
     255: "^^ff"
     256: "pool size"
     ...
     1314: "Using character substitution: "
     (23617 characters in all.)

   In Metafont and MetaPost, the first 256 characters are actually
represented as single bytes (i.e., themselves), not in the '^^'
notation.  Consider Pooltype as showing the results after conversion for
output.


File: web2c.info,  Node: DVI utilities,  Next: Font utilities,  Prev: WEB,  Up: Top

10 DVI utilities
****************

TeX outputs a file in "DVI" (DeVice Independent) format as a compact
representation of the original document.  DVI files can be translated to
meet the requirements of a real physical device, such as PostScript
printers (*note Introduction: (dvips)Top.), PCL printers (see dvilj(1)),
and X displays (see xdvi(1)).  In fact, DVI translators are available
for virtually all common devices: see 'CTAN:/dviware' (for CTAN info,
*note (kpathsea)unixtex.ftp::).

   For the precise definition of the DVI file format, see (for example)
the source file 'web2c/dvitype.web'.

   The DVI-processing programs in the Web2c distribution are not device
drivers; they perform generic utility functions.

* Menu:

* dvicopy invocation::          Expand virtual fonts.
* dvitype invocation::          DVI to human-readable text.


File: web2c.info,  Node: dvicopy invocation,  Next: dvitype invocation,  Up: DVI utilities

10.1 DVIcopy: Canonicalize virtual font references
==================================================

DVIcopy reads a DVI file, expands any references to virtual fonts (*note
(dvips)Virtual fonts::) to base fonts, and writes the resulting DVI
file.  Thus you can use virtual fonts even if your DVI processor does
not support them, by passing the documents through DVIcopy first.
Synopsis:

     dvicopy [OPTION]... [INDVI[.dvi] [OUTDVI[.dvi]]]

   DVIcopy reads standard input if INDVI is not specified, and writes
standard output if OUTDVI is not specified.

   The program accepts the following options, as well as the standard
'-help' and '-version' (*note Common options::):
'-magnification=INTEGER'
     Override existing magnification in INDVI with INTEGER; 1000
     specifies no magnification.  This is equivalent to setting TeX's
     '\mag' parameter.

'-max-pages=N'
     Process N pages; default is one million.

'-page-start=PAGE-SPEC'
     Start at the first page matching PAGE-SPEC, which is one or more
     (signed) integers separated by periods, corresponding to TeX's
     '\count0...9' parameters at '\shipout' time; '*' matches anything.
     Examples: '3', '1.*.-4'.


File: web2c.info,  Node: dvitype invocation,  Prev: dvicopy invocation,  Up: DVI utilities

10.2 DVItype: Plain text transliteration of DVI files
=====================================================

DVItype translates a DeVice Independent (DVI) file (as output by TeX,
for example) to a plain text file that humans can read.  It also serves
as a DVI-validating program, i.e., if DVItype can read a file, it's
correct.  Synopsis:

     dvitype [OPTION]... DVIFILE[.dvi]

DVItype does not read any bitmap files, but it does read TFM files for
fonts referenced in DVIFILE.  The usual places are searched (*note
(kpathsea)Supported file formats::).  To see all the relevant paths, set
the environment variable 'KPATHSEA_DEBUG' to '-1' before running the
program.

   Output goes to standard output.

   The program accepts the following options, as well as the standard
'-help' and '-version' (*note Common options::):
'-dpi=REAL'
     Do pixel movement calculations at REAL pixels per inch; default
     300.0.

'-magnification=INTEGER'
     Override existing magnification in INDVI with INTEGER; 1000
     specifies no magnification.  This is equivalent to setting TeX's
     '\mag' parameter.

'-max-pages=N'
     Process N pages; default is one million.

'-output-level=N'
     Verbosity level of output, from 0 to 4 (default 4):
        * 0: Global document information only.
        * 1: Most DVI commands included, and typeset characters
          summarized.
        * 2: Character and movement commands explicitly included.
        * 3: DVI stack and current position calculations included.
        * 4: Same information as level 3, but DVItype does random
          positioning in the file, reading the DVI postamble first.

'-page-start=PAGE-SPEC'
     Start at the first page matching PAGE-SPEC, which is one or more
     (signed) integers separated by periods, corresponding to TeX's
     '\count0...9' parameters at '\shipout' time; '*' matches anything.
     Examples: '1', '5.*.-9'.

'-show-opcodes'
     Show numeric opcode values (in decimal) for DVI commands, in braces
     after the command name.  This can help in debugging DVI utilities.
     We use decimal because in the DVI format documentation (in
     'dvitype.web', among others) the opcodes are shown in decimal.

* Menu:

* dvitype output example::


File: web2c.info,  Node: dvitype output example,  Up: dvitype invocation

10.2.1 DVItype output example
-----------------------------

As an example of the output from DVItype (see section above), here is
its (abridged) translation of the 'story.dvi' resulting from running the
example in 'The TeXbook', with '-output-level=4' and '-show-opcodes' on.

     ...
     Options selected:
       Starting page = *
       Maximum number of pages = 1000000
       Output level = 4 (the works)
       Resolution = 300.00000000 pixels per inch
     numerator/denominator=25400000/473628672
     magnification=1000;       0.00006334 pixels per DVI unit
     ' TeX output 1992.05.17:0844'
     Postamble starts at byte 564.
     maxv=43725786, maxh=30785863, maxstackdepth=3, totalpages=1
     Font 33: cmsl10---loaded at size 655360 DVI units
     Font 23: cmbx10---loaded at size 655360 DVI units
     Font 0: cmr10---loaded at size 655360 DVI units

     42: beginning of page 1
     87: push {141}
     level 0:(h=0,v=0,w=0,x=0,y=0,z=0,hh=0,vv=0)
     88: down3 -917504 {159} v:=0-917504=-917504, vv:=-58
     92: pop {142}
     ...
     104: putrule {137} height 26214, width 30785863 (2x1950 pixels)
     113: down3 5185936 {159} v:=655360+5185936=5841296, vv:=370
     117: push {141}
     level 1:(h=0,v=5841296,w=0,x=0,y=0,z=0,hh=0,vv=370)
     118: right4 12265425 {146} h:=0+12265425=12265425, hh:=777
     [ ]
     123: fntdef1 23 {243}: cmbx10
     145: fntnum23 {194} current font is cmbx10
     146: setchar65 h:=12265425+569796=12835221, hh:=813
     147: w3 251220 {150} h:=12835221+251220=13086441, hh:=829
     151: setchar83 h:=13086441+418700=13505141, hh:=856
     ...
     164: setchar82 h:=17448202+565245=18013447, hh:=1142
     165: x0 -62805 {152} h:=18013447-62805=17950642, hh:=1138
     166: setchar89 h:=17950642+569796=18520438, hh:=1174
     [A SHORT STORY]
     167: pop {142}
     level 1:(h=0,v=5841296,w=0,x=0,y=0,z=0,hh=0,vv=370)
     ...
     550: pop {142}
     level 0:(h=0,v=42152922,w=0,x=0,y=0,z=0,hh=0,vv=2670)
     551: down3 1572864 {159} v:=42152922+1572864=43725786, vv:=2770
     555: push {141}
     level 0:(h=0,v=43725786,w=0,x=0,y=0,z=0,hh=0,vv=2770)
     556: right4 15229091 {146} h:=0+15229091=15229091, hh:=965
     561: setchar49 h:=15229091+327681=15556772, hh:=986
     [ 1]
     562: pop {142}
     level 0:(h=0,v=43725786,w=0,x=0,y=0,z=0,hh=0,vv=2770)
     563: eop {140}

   Explanation:

   * The DVItype options are recorded at the beginning, followed by
     global information about the document, including fonts used.

   * Each DVI command is preceded by its byte position in the file
     ('42:', '87:', ...), and (because of the '-show-opcodes') followed
     by its decimal opcode value in braces ('{141}', '{142}', ...).

   * The 'level' lines record information about the DVI stack; 'h' and
     'v' define the current position in DVI units, while 'hh' and 'vv'
     are the same in pixels.

   * Text sequences are summarized in brackets, as in '[A SHORT STORY]'
     and the '[ 1]'.


File: web2c.info,  Node: Font utilities,  Next: Legalisms,  Prev: DVI utilities,  Up: Top

11 Font utilities
*****************

The Web2c programs described here convert between various TeX-related
font formats; the first section below briefly describes the formats.
GFtoPK is the only one that is routinely used, as Metafont outputs GF
format, but it's most efficient for device drivers to use PK.

   The precise definitions of the PK, GF, TFM, PL, VF, and VPL formats
mentioned below are in the source files that read them; 'pktype.web',
'gftype.web', 'tftopl.web', etc.

* Menu:

* Font file formats::       Explanations of GF, PK, TFM, VF, ...
* gftopk invocation::       GF -> PK (compact)
* pktogf invocation::       PK -> GF (expand).
* pktype invocation::       PK -> human-readable text.
* gftype invocation::       GF -> human-readable text.
* tftopl invocation::       TFM -> PL (for editing TFM).
* pltotf invocation::       PL -> TFM (make editing results usable).
* vftovp invocation::       VF -> VPL (tftopl for virtual fonts).
* vptovf invocation::       VPL -> VF (pltotf for virtual fonts).
* Font utilities available elsewhere:: Type 1, BDF, editors, etc.


File: web2c.info,  Node: Font file formats,  Next: gftopk invocation,  Up: Font utilities

11.1 Font file formats
======================

For another perspective on this, *note (dvips)Font concepts::.

   Font files come in several varieties, with suffixes like:
     .tfm  .*pk  .*gf  .*pxl (obsolete)  .pl  .mf  .vf  .vpl
Each represents a file format.

   A TFM (TeX font metric) file is a compact binary file that contains
information about each character in a font, about combinations of
characters within that font, and about the font as a whole.  The font
metric information contained in TFM files is device-independent units is
used by TeX to do typesetting.  Unlike the bitmap (raster) fonts
described below, TFM font files contain no information about the shapes
of characters.  They describe rectangular areas and combinations
thereof, but not what will eventually be printed in those areas.

   Since TeX does scaling calculations, one TFM file serves for all
magnifications of a given typeface.  On the other hand, the best printed
results are obtained when magnified (or reduced fonts) are not produced
geometrically (as done by PostScript, for example) but rather optically,
with each size a separate design (as done with Computer Modern and the
EC fonts, for example); then a separate TFM file is needed for each
size.

   At any rate, TeX produces a DVI (DeVice Independent) file from your
source document.  In order to print DVI files on real devices, you need
font files defining digitized character shapes and other data.  Then
previewers and printer-driver programs can translate your DVI files into
something usable by your monitor or printer.  Bitmap fonts come with
suffixes such as '.600pk' or '.600gf' or '.3000pxl', where the '600' is
the horizontal dots-per-inch resolution at which the font was produced,
and the 'pk' or 'gf' or 'pxl' indicates the font format.  Outline fonts
in PostScript Type 1 format have suffixes such as '.pfa' or '.pfb'.

   Fonts in pk (packed) format are in the tightly packed raster format
that is pretty much the standard today.  They take up less space than
fonts in the gf (generic font) format that Metafont generates, and far
less space than fonts in pxl format.  Fonts in pxl format take up gross
amounts of disk space and permit only 128 characters.  They are
obsolete.

   Font files with the '.pl' (property list) suffix are the plain text
(human-readable) analog of the binary '.tfm' files.  The TFtoPL and
PLtoTF programs convert between the two formats (*note tftopl
invocation:: and *note pltotf invocation::).

   Font files with the '.mf' suffix are in Metafont source format.
These are the files used by Metafont to generate rastered fonts for
specific typefaces at specific magnifications for the specific
resolution and type of mapping used by your device.

   The suffix '.vf' identifies "virtual font" files, for which '.vpl' is
the human-readable analog.  See *Note vftovp invocation::, and *note
vptovf invocation::.  For further discussion of virtual fonts, see
'CTAN:/doc/virtual-fonts.knuth', 'CTAN:/help/virtualfonts.txt', and
*note (dvips)Virtual fonts::.

   (This section is based on documentation in the original Unix TeX
distribution by Pierre MacKay and Elizabeth Tachikawa.)


File: web2c.info,  Node: gftopk invocation,  Next: pktogf invocation,  Prev: Font file formats,  Up: Font utilities

11.2 GFtoPK: Generic to packed font conversion
==============================================

GFtoPK converts a generic font (GF) file output by, for example,
Metafont (*note mf invocation::) to a packed font (PK) file.  PK files
are considerably smaller than the corresponding gf files, so they are
generally the bitmap font format of choice.  Some DVI-processing
programs, notably Dvips, only support PK files and not GF files.
Synopsis:

     gftopk [OPTION]... GFNAME.DPI[gf] [PKFILE]

The font GFNAME is searched for in the usual places (*note
(kpathsea)Glyph lookup::).  To see all the relevant paths, set the
environment variable 'KPATHSEA_DEBUG' to '-1' before running the
program.

   The suffix 'gf' is supplied if not already present.  This suffix is
not an extension; no '.' precedes it: for instance, 'cmr10.600gf'.

   If PKFILE is not specified, the output is written to the basename of
'GFNAME.DPIpk', e.g., 'gftopk /wherever/cmr10.600gf' creates
'./cmr10.600pk'.

   The only options are '--verbose', '--help', and '--version' (*note
Common options::).


File: web2c.info,  Node: pktogf invocation,  Next: pktype invocation,  Prev: gftopk invocation,  Up: Font utilities

11.3 PKtoGF: Packed to generic font conversion
==============================================

PKtoGF converts a packed font (PK) file to a generic font (GF) file.
Since PK format is much more compact than GF format, the most likely
reason to do this is to run GFtype (*note gftype invocation::) on the
result, so you can see the bitmap images.  Also, a few old utility
programs do not support PK format.  Synopsis:

     pktogf [OPTION]... PKNAME.DPI[pk] [GFFILE]

The font PKNAME is searched for in the usual places (*note
(kpathsea)Glyph lookup::).  To see all the relevant paths, set the
environment variable 'KPATHSEA_DEBUG' to '-1' before running the
program.

   The suffix 'pk' is supplied if not already present.  This suffix is
not an extension; no '.' precedes it: for instance, 'cmr10.600pk'.

   If GFFILE is not specified, the output is written to the basename of
'PKNAME.DPIgf', e.g., 'pktogf /wherever/cmr10.600pk' creates
'./cmr10.600gf'.

   The only options are '--verbose', '--help', and '--version' (*note
Common options::).


File: web2c.info,  Node: pktype invocation,  Next: gftype invocation,  Prev: pktogf invocation,  Up: Font utilities

11.4 PKtype: Plain text transliteration of packed fonts
=======================================================

PKtype translates a packed font (PK) bitmap file (as output by GFtoPK,
for example) to a plain text file that humans can read.  It also serves
as a PK-validating program, i.e., if PKtype can read a file, it's
correct.  Synopsis:

     pktype PKNAME.DPI[pk]

   The font PKNAME is searched for in the usual places (*note
(kpathsea)Glyph lookup::).  To see all the relevant paths, set the
environment variable 'KPATHSEA_DEBUG' to '-1' before running the
program.

   The suffix 'pk' is supplied if not already present.  This suffix is
not an extension; no '.' precedes it: for instance, 'cmr10.600pk'.

   The translation is written to standard output.

   The only options are '-help' and '-version' (*note Common options::).

   As an example of the output, here is the (abridged) translation of
the letter 'K' in 'cmr10', as rendered at 600dpi with the mode 'ljfour'
from <modes.mf> (available from 'ftp://ftp.tug.org/tex/modes.mf').

     955:  Flag byte = 184  Character = 75  Packet length = 174
       Dynamic packing variable = 11
       TFM width = 815562  dx = 4259840
       Height = 57  Width = 57  X-offset = -3  Y-offset = 56
       [2]23(16)17(8)9(25)11(13)7(27)7(16)7(28)4(18)7(28)2(20)7(27)...
       ...
       (14)9(24)12(5)[2]23(13)21

Explanation:

'955'
     The byte position in the file where this character starts.

'Flag byte'
'Dynamic packing variable'
     Related to the packing for this character; see the source code.

'Character'
     The character code, in decimal.

'Packet length'
     The total length of this character definition, in bytes.

'TFM width'
     The device-independent (TFM) width of this character.  It is 2^24
     times the ratio of the true width to the font's design size.

'dx'
     The device-dependent width, in "scaled pixels", i.e., units of
     horizontal pixels times 2^16.

'Height'
'Width'
     The bitmap height and width, in pixels.

'X-offset'
'Y-offset'
     Horizontal and vertical offset from the upper left pixel to the
     reference (origin) pixel for this character, in pixels (right and
     down are positive).  The "reference pixel" is the pixel that
     occupies the unit square in Metafont; the Metafont reference point
     is the lower left hand corner of this pixel.  Put another way, the
     x-offset is the negative of the left side bearing; the right side
     bearing is the horizontal escapement minus the bitmap width plus
     the x-offset.

'[2]23(16)...'
     Finally, run lengths of black pixels alternate with parenthesized
     run lengths of white pixels, and brackets indicate a repeated row.


File: web2c.info,  Node: gftype invocation,  Next: tftopl invocation,  Prev: pktype invocation,  Up: Font utilities

11.5 GFtype: Plain text transliteration of generic fonts
========================================================

GFtype translates a generic font (GF) bitmap file (as output by
Metafont, for example) to a plain text file that humans can read.  It
also serves as a GF-validating program, i.e., if GFtype can read a file,
it's correct.  Synopsis:

     gftype [OPTION]... GFNAME.DPI[gf]

   The font GFNAME is searched for in the usual places (*note
(kpathsea)Glyph lookup::).  To see all the relevant paths, set the
environment variable 'KPATHSEA_DEBUG' to '-1' before running the
program.

   The suffix 'gf' is supplied if not already present.  This suffix is
not an extension; no '.' precedes it: for instance, 'cmr10.600gf'.

   The translation is written to standard output.

   The program accepts the following options, as well as the standard
'-help' and '-version' (*note Common options::):
'-images'
     Show the characters' bitmaps using asterisks and spaces.

'-mnemonics'
     Translate all commands in the GF file.

   As an example of the output, here is the (abridged) translation of
the letter 'K' in 'cmr10', as rendered at 600dpi with the mode 'ljfour'
from 'modes.mf' (available from <ftp://ftp.tug.org/tex/modes.mf>), with
both '-mnemonics' and '-images' enabled.

   GFtype outputs the information about a character in two places: a
main definition and a one-line summary at the end.  We show both.  Here
is the main definition:

     2033: beginning of char 75: 3<=m<=60 0<=n<=56
     (initially n=56) paint (0)24(12)20
     2043: newrow 0 (n=55) paint 24(12)20
     2047: newrow 0 (n=54) paint 24(12)20
     2051: newrow 0 (n=53) paint 24(12)20
     2055: newrow 7 (n=52) paint 10(21)13
     2059: newrow 8 (n=51) paint 8(23)9
     ...
     2249: newrow 8 (n=5) paint 8(23)11
     2253: newrow 7 (n=4) paint 10(22)12
     2257: newrow 0 (n=3) paint 24(11)22
     2261: newrow 0 (n=2) paint 24(11)22
     2265: newrow 0 (n=1) paint 24(11)22
     2269: newrow 0 (n=0) paint 24(11)22
     2273: eoc
     .<--This pixel's lower left corner is at (3,57) in METAFONT coordinates
     ************************            ********************
     ************************            ********************
     ************************            ********************
     ************************            ********************
            **********                     *************
             ********                       *********
     ...
             ********                       ***********
            **********                      ************
     ************************           **********************
     ************************           **********************
     ************************           **********************
     ************************           **********************
     .<--This pixel's upper left corner is at (3,0) in METAFONT coordinates

Explanation:

'2033'
'2043'
'...'
     The byte position in the file where each GF command starts.

'beginning of char 75'
     The character code, in decimal.

'3<=m<=60 0<=n<=56'
     The character's bitmap lies between 3 and 60 (inclusive)
     horizontally, and between 0 and 56 (inclusive) vertically.  (m is a
     column position and n is a row position.)  Thus, 3 is the left side
     bearing.  The right side bearing is the horizontal escapement
     (given below) minus the maximum m.

'(initially n=56) paint (0)24(12)20'
     The first row of pixels: 0 white pixels, 24 black pixels, 12 white
     pixels, etc.

'newrow 0 (n=55) paint 24(12)20'
     The second row of pixels, with zero leading white pixels on the
     row.

'eoc'
     The end of the main character definition.

   Here is the GF postamble information that GFtype outputs at the end:

     Character 75: dx 4259840 (65), width 815562 (64.57289), loc 2033

   Explanation:

'dx'
     The device-dependent width, in "scaled pixels", i.e., units of
     horizontal pixels times 2^16.  The '(65)' is simply the same number
     rounded.  If the vertical escapement is nonzero, it would appear
     here as a 'dy' value.

'width'
     The device-independent (TFM) width of this character.  It is 2^24
     times the ratio of the true width to the font's design size.  The
     '64.57289' is the same number converted to pixels.

'loc'
     The byte position in the file where this character starts.


File: web2c.info,  Node: tftopl invocation,  Next: pltotf invocation,  Prev: gftype invocation,  Up: Font utilities

11.6 TFtoPL: TeX font metric to property list conversion
========================================================

TFtoPL translates a TeX font metric (TFM, *note (dvips)Metric files::)
file (as output by Metafont, for example) to "property list format" (a
list of parenthesized items describing the font) that humans can edit or
read.  This program is mostly used by people debugging TeX
implementations, writing font utilities, etc.  Synopsis:

     tftopl [OPTION]... TFMNAME[.tfm] [PLFILE[.pl]]

   The font TFMNAME (extended with '.tfm' if necessary) is searched for
in the usual places (*note (kpathsea)Supported file formats::).  To see
all the relevant paths, set the environment variable 'KPATHSEA_DEBUG' to
'-1' before running the program.

   If PLFILE (which is extended with '.pl' if necessary) is not
specified, the property list file is written to standard output.  The
property list file can be converted back to TFM format by the companion
program TFtoPL (see the next section).

   The program accepts the following option, as well as the standard
'-verbose', '-help' and '-version' (*note Common options::):
'-charcode-format=TYPE'
     Output character codes in the PL file according to TYPE: either
     'octal' or 'ascii'.  Default is 'ascii' for letters and digits,
     octal for all other characters.  Exception: if the font's coding
     scheme starts with 'TeX math sy' or 'TeX math ex', all character
     codes are output in octal.

     In 'ascii' format, character codes that correspond to graphic
     characters, except for left and right parentheses, are output as a
     'C' followed by the single character: 'C K', for example.  In octal
     format, character codes are output as the letter 'O' followed by
     octal digits, as in 'O 113' for 'K'.

     'octal' format is useful for symbol and other non-alphabetic fonts,
     where using ASCII characters for the character codes is merely
     confusing.

   As an example of the output, here is the (abridged) property list
translation of 'cmr10.tfm':

     (FAMILY CMR)
     (FACE O 352)
     (CODINGSCHEME TEX TEXT)
     (DESIGNSIZE R 10.0)
     (COMMENT DESIGNSIZE IS IN POINTS)
     (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
     (CHECKSUM O 11374260171)
     (FONTDIMEN
        (SLANT R 0.0)
        (SPACE R 0.333334)
        (STRETCH R 0.166667)
        (SHRINK R 0.111112)
        (XHEIGHT R 0.430555)
        (QUAD R 1.000003)
        (EXTRASPACE R 0.111112)
        )
     (LIGTABLE
        ...
        (LABEL C f)
        (LIG C i O 14)
        (LIG C f O 13)
        (LIG C l O 15)
        (KRN O 47 R 0.077779)
        (KRN O 77 R 0.077779)
        (KRN O 41 R 0.077779)
        (KRN O 51 R 0.077779)
        (KRN O 135 R 0.077779)
        (STOP)
        ...
        )
     ...
     (CHARACTER C f
        (CHARWD R 0.305557)
        (CHARHT R 0.694445)
        (CHARIC R 0.077779)
        (COMMENT
           (LIG C i O 14)
           (LIG C f O 13)
           (LIG C l O 15)
           (KRN O 47 R 0.077779)
           (KRN O 77 R 0.077779)
           ...
           )
        )
     ...

   As you can see, the general format is a list of parenthesized
"properties", nested where necessary.

   * The first few items ('FAMILY', 'FACE', and so on) are the so-called
     "headerbyte" information from Metafont, giving general information
     about the font.

   * The 'FONTDIMEN' property defines the TeX '\fontdimen' values.

   * The 'LIGTABLE' property defines the ligature and kerning table.
     'LIG' properties define ligatures: in the example above, an 'f' (in
     the 'LABEL') followed by an 'i' is a ligature, i.e., a typesetting
     program like TeX replaces those two consecutive characters by the
     character at position octal '014 in the current font--presumably
     the 'fi' ligature.  'KRN' properties define kerns: if an 'f' is
     followed by character octal '047 (an apostrophe), TeX inserts a
     small amount of space between them: 0.077779 times the design size
     the font was loaded at (about three-quarters of a printer's point
     by default in this case, or .001 inches).

   * The 'CHARACTER' property defines the dimensions of a character: its
     width, height, depth, and italic correction, also in design-size
     units, as explained in the previous item.  For our example 'f', the
     depth is zero, so that property is omitted.  TFtoPL also inserts
     any kerns and ligatures for this character as a comment.


File: web2c.info,  Node: pltotf invocation,  Next: vftovp invocation,  Prev: tftopl invocation,  Up: Font utilities

11.7 PLtoTF: Property list to TeX font metric conversion
========================================================

PLtoTF translates a property list file (as output by TFtoPL, for
example) to TeX font metric (TFM, *note (dvips)Metric files::) format.
It's much easier for both programs and humans to create the (plain text)
property list files and let PLtoTF take care of creating the binary TFM
equivalent than to output TFM files directly.  Synopsis:

     pltotf [OPTION]... PLFILE[.pl] [TFMFILE[.tfm]]

   If TFMFILE (extended with '.tfm' if necessary) is not specified, the
TFM file is written to the basename of 'PLFILE.tfm', e.g., 'pltotf
/wherever/cmr10.pl' creates './cmr10.tfm'.  (Since TFM files are binary,
writing to standard output by default is undesirable.)

   The only options are '-verbose', '-help', and '-version' (*note
Common options::).

   For an example of property list format, see the previous section.


File: web2c.info,  Node: vftovp invocation,  Next: vptovf invocation,  Prev: pltotf invocation,  Up: Font utilities

11.8 VFtoVP: Virtual font to virtual property lists
===================================================

VFtoVP translates a virtual font metric (VF, *note (dvips)Virtual
fonts::) file and its accompanying TeX font metric (TFM, *note
(dvips)Metric files::) file (as output by VPtoVF, for example) to
"virtual property list format" (a list of parenthesized items describing
the virtual font) that humans can edit or read.  This program is mostly
used by people debugging virtual font utilities.  Synopsis:

     vftovp [OPTION]... VFNAME[.vf] [TFMNAME[.tfm] [VPLFILE[.vpl]]]

   The fonts VFNAME and TFMNAME (extended with '.vf' and '.tfm' if
necessary) are searched for in the usual places (*note
(kpathsea)Supported file formats::).  To see all the relevant paths, set
the environment variable 'KPATHSEA_DEBUG' to '-1' before running the
program.  If TFMNAME is not specified, VFNAME (without a trailing '.vf')
is used.

   If VPLFILE (extended with '.vpl' if necessary) is not specified, the
property list file is written to standard output.  The property list
file can be converted back to VF and TFM format by the companion program
VFtoVP (see the next section).

   The program accepts the following option, as well as the standard
'-verbose', '-help' and '-version' (*note Common options::):
'-charcode-format=TYPE'
     Output character codes in the PL file according to TYPE: either
     'octal' or 'ascii'.  Default is 'ascii' for letters and digits,
     octal for all other characters.  Exception: if the font's coding
     scheme starts with 'TeX math sy' or 'TeX math ex', all character
     codes are output in octal.

     In 'ascii' format, character codes that correspond to graphic
     characters, except for left and right parentheses, are output as a
     'C' followed by the single character: 'C K', for example.  In octal
     format, character codes are output as the letter 'O' followed by
     octal digits, as in 'O 113' for 'K'.

     'octal' format is useful for symbol and other non-alphabetic fonts,
     where using ASCII characters for the character codes is merely
     confusing.


File: web2c.info,  Node: vptovf invocation,  Next: Font utilities available elsewhere,  Prev: vftovp invocation,  Up: Font utilities

11.9 VPtoVF: Virtual property lists to virtual font
===================================================

VPtoVF translates a virtual property list file (as output by VFtoVP, for
example) to virtual font (VF, *note (dvips)Virtual fonts::) and TeX font
metric (TFM, *note (dvips)Metric files::) files.  It's much easier for
both programs and humans to create the (plain text) property list files
and let VPtoVF take care of creating the binary VF and TFM equivalents
than to output them directly.  Synopsis:

     vptovf [OPTION]... VPLFILE[.vpl] [VFFILE[.vf] [TFMFILE[.tfm]]]

   If VFFILE (extended with '.vf' if necessary) is not specified, the VF
output is written to the basename of 'VPLFILE.vf'; similarly for
TFMFILE.  For example, 'vptovf /wherever/ptmr.vpl' creates './ptmr.vf'
and './ptmr.tfm'.

   The only options are '-verbose', '-help', and '-version' (*note
Common options::).


File: web2c.info,  Node: Font utilities available elsewhere,  Prev: vptovf invocation,  Up: Font utilities

11.10 Font utilities available elsewhere
========================================

The Web2c complement of font utilities merely implements a few basic
conversions.  Many other more sophisticated font utilities exist; most
are in 'CTAN:/fonts/utilities' (for CTAN info, *note
(kpathsea)unixtex.ftp::).  Here are some of the most commonly-requested
items:

   * AFM (Adobe font metric) to TFM conversion: *note (dvips)Invoking
     afm2tfm::, and 'CTAN:/fonts/utilities/afmtopl'.

   * BDF (the X bitmap format) conversion:
     <ftp://ftp.tug.org/tex/bdf.tar.gz>.

   * Creating fonts using MetaPost: MetaType1.
     <ftp://bop.eps.gda.pl/pub/metatype1>.  This is used to create the
     excellent Latin Modern font family ('CTAN:/fonts/lm'), which
     extends Computer Modern to a vast repertoire of scripts.

   * Editing of bitmap fonts: Xbfe from the GNU font utilities mentioned
     below; the X BDF-editing programs available from
     <ftp://ftp.x.org/R5contrib/xfed.tar.Z> and
     <ftp://ftp.x.org/R5contrib/xfedor.tar.Z>; and finally, if your
     fonts have only 128 characters, you can use the old 'gftopxl',
     'pxtoch', and 'chtopx' programs from <ftp://ftp.tug.org/tex/web>.

   * Editing of outline fonts: FontForge, <fontforge.sourceforge.net>.
     This is a very elaborate program with support for many outline
     formats (Type 1, OpenType, TrueType, ...), and many advanced font
     editing features.

   * PK bitmaps from PostScript outline fonts: gsftopk from the 'xdvi'
     distribution.  Alternatively, 'ps2pk', from
     'CTAN:/fonts/utilities/ps2pk'.

   * PostScript Type 1 font format conversion (i.e., between PFA and PFB
     formats): <https://www.lcdf.org/type>.

   * Tracing bitmaps to fitted outlines: Autotrace
     (<http://autotrace.sourceforge.net>), Potrace
     (<http://potrace.sourceforge.net>).  For Metafont fonts, either of
     the two programs 'mftrace' (<http://www.xs4all.nl/~hanwen/mftrace>)
     or 'textrace' (<http://textrace.sourceforge.net>) make the job
     easier.

   * Virtual font creation: <https://ctan.org/pkg/fontinst>.


File: web2c.info,  Node: Legalisms,  Next: References,  Prev: Font utilities,  Up: Top

Appendix A Legalisms
********************

In general, each file has its own copyright notice stating the copying
permissions for that file.  Following is a summary.

   The Stanford TeX programs and Web2c system itself are in the public
domain (<https://tug.org/texlive/copying.html>).  The sources may be
copied verbatim, or used as the starting point of new software under
different names; however, per the wishes of the authors, they should be
modified only through a '.ch' file, but this is in the nature of a
development request rather than a legal requirement.

   MLTeX, pdfTeX, LuaTeX, XeTeX, and all the other derived engines have
used various license terms for their additions to the base code, often
the GPL (see <https://www.gnu.org/licenses/#GPL>) or (for example) the
file 'web2c/pdftexdir/COPYINGv2'.  They also mostly make use of
additional libraries with their own (compatible) terms.  Please see each
program's sources.

   The Kpathsea library is covered by the GNU Lesser General Public
License (*note (kpathsea)Introduction::).  Therefore, the _binaries_
resulting from a standard Web2c compilation are also covered by the
LGPL; so if you (re)distribute the binaries, you must also (offer to)
distribute the complete source that went into those binaries.  See
<https://gnu.org/licenses/#LGPL> or the file
'kpathsea/COPYING.LESSERv2'.


File: web2c.info,  Node: References,  Next: Index,  Prev: Legalisms,  Up: Top

Appendix B References
*********************

  1. Kpathsea: *Note Introduction: (kpathsea)Top.

  2. Dvips and Afm2tfm: *Note Introduction: (dvips)Top.

  3. The TeX Users Group: <https://tug.org>.  For an introduction to the
     TeX system, see <https://tug.org/begin.html>.

  4. TUGboat, the principal journal for the TeX world:
     <https://tug.org/TUGboat>.

  5. TeX and computer typesetting in general:
     <ftp://ftp.math.utah.edu/pub/tex/bib/texbook1.bib>.

  6. For a bibliography of formal articles and technical reports on the
     TeX project, see the books 'TeX: The Program' or 'Metafont: The
     Program' cited below.

  7. [Bil87] Neenie Billawala.  Write-white printing engines and tuning
     fonts with Metafont.  'TUGboat', 8(1):29-32, April 1987.
     <https://tug.org/TUGboat/tb08-1/tb17billawala.pdf>.

  8. [Hob89] John D. Hobby.  A Metafont-like system with PS output.
     'TUGboat', 10(4):505-512, December 1989.
     <https://tug.org/metapost>.

  9. [Hob92] John D. Hobby.  A User's Manual for MetaPost.  Technical
     Report CSTR-162, AT&T Bell Laboratories, 1992.

  10. [Hob93] John D. Hobby.  Drawing Graphs with MetaPost.  Technical
     Report CSTR-164, AT&T Bell Laboratories, 1993.

  11. [HS91] Samuel P. Harbison and Guy L. Steele Jr.  'C--A Reference
     Manual'.  Prentice-Hall, Upper Saddle River, NJ 07458, USA, third
     edition, 1991.  An authoritative reference to the C programming
     language, and a good companion to Kernighan and Ritchie.

  12. [KL93] Donald E. Knuth and Silvio Levy.  'The CWEB System of
     Structured Documentation, Version 3.0'.  Addison-Wesley, Reading,
     MA, USA, 1993.  <https://ctan.org/pkg/cweb>.

  13. [Knu84] Donald E. Knuth.  A torture test for TeX.  Report No.
     STAN-CS-84-1027, Stanford University, Department of Computer
     Science, 1984.

  14. [Knu86a] Donald E. Knuth.  A Torture Test for METAFONT. Report No.
     STAN-CS-86-1095, Stanford University, Department of Computer
     Science, 1986.

  15. [Knu86b] Donald E. Knuth.  'The TeXbook', volume A of 'Computers
     and Typesetting'.  Addison-Wesley, Reading, MA, USA, 1986.

  16. [Knu86c] Donald E. Knuth.  'TeX: The Program', volume B of
     'Computers and Typesetting'.  Addison-Wesley, Reading, MA, USA,
     1986.

  17. [Knu86d] Donald E. Knuth.  'The METAFONTbook', volume C of
     'Computers and Typesetting'.  Addison-Wesley, Reading, MA, USA,
     1986.

  18. [Knu86e] Donald E. Knuth.  'METAFONT: The Program', volume D of
     'Computers and Typesetting'.  Addison-Wesley, Reading, MA, USA,
     1986.

  19. [Knu86f] Donald E. Knuth.  'Computer Modern Typefaces', volume E
     of 'Computers and Typesetting'.  Addison-Wesley, Reading, MA, USA,
     1986.

  20. [Knu89] Donald E. Knuth.  The errors of TeX.  'Software--Practice
     and Experience', 19(7):607-681, July 1989.  This is an updated
     version of Knuth:1988:ET.

  21. [Knu90] Donald Knuth.  Virtual Fonts: More Fun for Grand Wizards.
     'TUGboat', 11(1):13-23, April 1990.
     <https://tug.org/TUGboat/tb11-1/tb27knut.pdf>.

  22. [Knu92] Donald E. Knuth.  'Literate Programming'.  CSLI Lecture
     Notes Number 27.  Stanford University Center for the Study of
     Language and Information, Stanford, CA, USA, 1992.

  23. [Lam94] Leslie Lamport.  'LaTeX: A Document Preparation System:
     User's Guide and Reference Manual'.  Addison-Wesley, Reading, MA,
     USA, second edition, 1994.  Reprinted with corrections, 1996.

  24. [Lia83] Franklin Mark Liang.  Word hy-phen-a-tion by com-put-er.
     Technical Report STAN-CS-83-977, Stanford University, August 1983.
     <https://tug.org/docs/liang/liang-thesis.pdf>.

  25. [Mac91] Pierre A. MacKay.  Looking at the pixels: Quality control
     for 300 dpi laser printer fonts, especially Metafonts.  In Robert
     A. Morris and Jacques Andre, editors, 'Raster Imaging and Digital
     Typography II--Papers from the second RIDT meeting, held in Boston,
     Oct. 14-16, 1991', pages 205-215, New York, 1991.  Cambridge
     University Press.


File: web2c.info,  Node: Index,  Prev: References,  Up: Top

Index
*****