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
|
% $Id: live-2004.tex 1513 2006-02-13 00:22:35Z karl $
% TeX Live documentation. Originally written by Sebastian Rahtz and
% Michel Goossens, now maintained by Karl Berry and others.
% Public domain.
%
\documentclass{article}
\let\tldocenglish=1 % for live4ht.cfg
\usepackage{tex-live}
\begin{document}
\title{%
{\huge \textit{The \protect\TL{} Guide}\\\strut}
{\LARGE \textsf{\TK{} 2004}}
}
\author{Sebastian Rahtz \& Karl Berry, editors \\[3mm]
\url{http://tug.org/texlive/}
}
\date{November 2004}
\maketitle
\begin{multicols}{2}
\tableofcontents
\listoftables
\end{multicols}
\section{Introduction}
\label{sec:intro}
This document describes the main features of the \TL{} software
distribution\Dash a \TeX{} and \LaTeX{} distribution for Linux and other
Unix flavors, \MacOSX, and (32-bit) Windows systems. (Warning: it is
not especially useful for older Mac or \acro{MS-DOS} systems.)
\TL{} includes precompiled binaries for \TeX{}, \LaTeXe{}, \MF, \MP,
\BibTeX{} and many other programs; an extensive collection of macros,
fonts and documentation; and support for typesetting in many different
scripts from around the world. It is part of the even larger \TK{}
(briefly described below in section~\ref{sec:struct-tl},
\p.\pageref{sec:struct-tl}), a cooperative effort by the \TeX\ user
groups.
For newer versions of the packages included here, please check
\acro{CTAN}: \url{http://www.ctan.org}
For a brief summary of the major changes in this edition of \TL{},
see section~\ref{sec:history} (\p.\pageref{sec:history}).
\subsection{Basic usage of \protect\TL{}}
\label{sec:basic}
You can use \TL{} in three principal ways:
\begin{enumerate}
\item You can run \TL{} directly from the \DVD
(see section~\ref{sec:multiple-dist}, \p.\pageref{sec:multiple-dist}).
This takes almost no disk space, as you might expect, and gives you
immediate access to everything in \TL{}. Of course performance
will be worse than running on local disk, but you may well find it
acceptable.
\item You can install all or part of \TL{} to a local disk. This
is the most common use of \TL. You will need (approximately) a
minimum of 100 megabytes, 310 megabytes for a recommended system, and
730 megabytes for a full system.
\item You can integrate a particular package or collection into your
existing \TeX{} system, either a \TL{} system you installed
earlier, or a different system.
\end{enumerate}
\noindent All of these are described in detail in the \acro{OS}-specific
installation sections following, but here is a quick start:
\begin{itemize*}
\item The main installation script for Unix and \MacOSX{} is
\texttt{install-tl.sh};
\item The single package installation script is \texttt{install-pkg.sh}.
\item Unfortunately, this version of \TL{} has no Windows installer, due
to technical difficulties. See section~\ref{sec:win-install} below
for more information.
\end{itemize*}
\subsection{Getting help}
\label{sec:help}
The \TeX{} community is both active and friendly, and virtually all
serious questions end up getting answered. However, the support is
informal, done by volunteers and casual readers, so it's especially
important that you do your homework before asking. (If you prefer
guaranteed commercial support, you can forego \TL{} completely and
purchase a vendor's system; \url{http://tug.org/interest.html#vendors}
has a list.)
Here is a list of resources, approximately in the order we recommend
using them:
\begin{description}
\item [Getting Started] If you are new to \TeX, the web page
\url{http://tug.org/begin.html} gives a brief introduction to the system.
\item [\TeX{} \acro{FAQ}] The \TeX{} \acro{FAQ} is a huge compendium of
answers to all sorts of questions, from the most basic to the most
arcane. It is included on \TL{} in \OnCD{texmf-doc/doc/english/FAQ-en}, and is
available on the Internet through \url{http://www.tex.ac.uk/faq}.
Please check here first.
\item [\TeX{} Catalogue] If you are looking for a specific package,
font, program, etc., the \TeX{} Catalogue is the place to look. It is a
huge list of all \TeX{}-related items. See
\OnCD{texmf-doc/doc/english/catalogue}, or
\url{http://www.ctan.org/tex-archive/help/Catalogue}.
\item [\TeX{} Web Resources] The web page
\url{http://tug.org/interest.html} has many \TeX{}-related links, in
particular for numerous books, manuals, and articles on all aspects of
the system.
\item [support archives] The two principal support forums are the
Usenet newsgroup \url{news:comp.text.tex} and the mailing list
\email{texhax@tug.org}. Their archives have years of past
questions and answers for your searching pleasure, via
\url{http://groups.google.com/groups?group=comp.text.tex} and
\url{http://tug.org/mail-archives/texhax}, respectively. And a general web
search, for example on \url{http://google.com}, never hurts.
\item [asking questions] If you cannot find an answer, you can post to
\dirname{comp.text.tex} through Google or your newsreader, or to
\email{texhax@tug.org} through email. But before you post,
\emph{please} read this \acro{FAQ} entry for advice on asking questions
in such a way that you're most likely to get an answer:
\url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=askquestion}.
\item [\TL{} support] If you want to report a bug or have
suggestions or comments on the \TL{} distribution, installation, or
documentation, the mailing list is \email{tex-live@tug.org}. However,
if your question is about how to use a particular program included in
\TL{}, you are better off writing to that program's maintainer or
mailing list.
\end{description}
The other side of the coin is helping others who have questions. Both
\dirname{comp.text.tex} and \code{texhax} are open to anyone, so feel
free to join, start reading, and help out where you can. Welcome to
\TeX{}!
% don't use \TL so the \uppercase in the headline works. Also so
% tex4ht ends up with the right TeX. Likewise the \protect's.
\section{Structure of \protect\TeX\protect\ Live}
\label{sec:struct-tl}
This section describes the structure and contents of \TL{} and the
\TK{} of which it is a part.
\subsection{Multiple distributions: \protect\pkgname{live},
\protect\pkgname{inst},
\protect\pkgname{protext}}
\label{sec:multiple-dist}
Space limitations of \acro{CD-ROM} format have forced us to divide
\TK{} into several distributions, as follows.
\begin{description}
\item [live] A complete system on \acro{DVD}; it is too large
for \acro{CD}. It can be run live or installed to disk. It also
includes a snapshot of the \CTAN{} repository, entirely independent of
\TL{}, as well as assorted other packages in a
\texttt{texmf-extra} directory.
Unfortunately, this release of \TL{} does not include a Windows
installer, due to technical difficulties. (We hope there will be an
installer again in a few months.) Therefore, when the \DVD{} is mounted
on Windows, the setup program offers to start the \pkgname{protext}
installation (see below), and also mentions \CTAN{} and \TL{}, which are
in subdirectories of the top level of the \DVD{}.
\CTAN{} and \texttt{texmf-extra} do not follow the same copying
conditions as \TL{}, so be careful when redistributing or
modifying.
\item [inst(allable)] A complete system on \CD; in order to make this fit,
the packages and programs are compressed. Therefore, it is not possible
to run \TeX\ directly from the installable \CD, you have to install it
to disk (hence its name). Furthermore, it can only be installed on Unix
(including Linux, \MacOSX, etc.)\ systems, not Windows, although a set
of experimental Windows binaries is included (for sharing across
platforms). Installation is described in subsequent sections.
\item [protext] An enhancement of the \MIKTEX\ system, for Windows.
\ProTeXt\ adds a few extra tools to \MIKTEX, and simplifies
installation. It is entirely independent of \TL{}, and has its own
installation instructions. It can be run live, or installed to disk.
The \ProTeXt\ home page is \url{http://tug.org/protext}.
\ProTeXt\ is provided as both the top level of the \pkgname{live} \DVD\
and on its own \CD\ (for those who cannot use the \DVD).
\end{description}
\noindent You can tell which type of distribution you're in by looking
for a \texttt{00\var{type}.TL} file at the top of the \TL{} directory.
This file also contains the \TL{} release date.
Naturally, each user group chooses what to distribute, at its own
discretion. (\acro{TUG} is sending all three discs above to all of its
members.)
\subsection{Top level directories}
\label{sec:tld}
Here is a brief listing and description of the top level directories in
the \TL{} distribution. This has changed considerably in 2004: the
single \texttt{texmf} tree has been split into several smaller trees.
Also, on the \pkgname{live} \DVD, the entire \TL{} hierarchy is in a
subdirectory \dirname{texlive2004}, not at the top level of the disc.
\smallskip
\begingroup
\renewcommand{\arraystretch}{1.3} % open up interrow spacing
\begin{tabular}{>{\ttfamily}lp{.78\hsize}}
bin & The \TeX{} system programs, arranged by platform. \\
MacOSX & Supporting software for \MacOSX (see
section~\ref{sec:mac-install}, \p.\pageref{sec:mac-install}). \\
source & The source of all programs, including the main \Webc{}
\TeX{} and \MF{} distributions. These are stored in a
\cmdname{bzip2}-compressed tar archive. \\
support & Assorted auxiliary packages and programs. These are
\emph{not} installed automatically. This includes
assorted editors and \TeX\ shells. \\
texmf & Tree for the programs, along with their support files and
documentation. Does not include \TeX\ formats and packages. \\
texmf-dist & The main tree of formats and packages. \\
texmf-doc & Tree for self-contained pure documentation, with no other
installed files.\hfil\break Arranged by language. \\
texmf-var & Tree for files automatically generated and stored. \\
xemtex & The \cmdname{XEmacs} editor and other support programs for
Windows.
These programs generally come pre-installed on Unix systems, or are
at least easy to compile. \\
\end{tabular}
\endgroup
\smallskip
In addition to the directories above, the installation scripts and
\filename{README} files (in various languages) are at the top level of
the distribution.
The (new) \dirname{texmf-doc} directory contains only documentation, but
it does not contain all the documentation. The documentation for the
programs (manuals, man pages, Info files) is in \dirname{texmf/doc},
since the programs are in \dirname{texmf}. Similarly, the documentation
for \TeX\ packages and formats is in \dirname{texmf-dist/doc}. You can
use the \cmdname{texdoc} or \cmdname{texdoctk} programs to find any
documentation wherever it's located. The comprehensive links in the
top-level file \OnCD{doc.html} may also be helpful.
\subsection{Extensions to \protect\TeX}
\label{sec:tex-extensions}
\TL{} contains several extended versions of \TeX:
\begin{description}
\item [\eTeX] adds a small but powerful set of new primitives
\label{text:etex} (related to macro expansion, character scanning,
classes of marks, additional debugging features, and more) and the
\TeXXeT{} extensions for bidirectional typesetting. In default mode,
\eTeX{} is 100\% compatible with ordinary \TeX. See
\OnCD{texmf-dist/doc/etex/base/etex_man.pdf}.
\item [pdf\TeX] writes Acrobat \acro{PDF} format as well as \dvi{}. The
\LaTeX{} \pkgname{hyperref} package has an option `\optname{pdftex}'
which turns on all the program features. See
\OnCD{texmf/doc/pdftex/manual/pdftex-a.pdf} (A4 paper) or
\OnCD{texmf/doc/pdftex/manual/pdftex-l.pdf} (letter paper), and
\OnCD{texmf/doc/pdftex/examples/example.tex}.
\item [pdfe\TeX] combines the pdf\TeX\ and \eTeX\ extensions. This is
the default program for all formats except plain \TeX.
See above for documentation.
\item [\OMEGA\ (Omega)] is based on Unicode (16-bit characters), thus
supports working with almost all the world's scripts simultaneously. It
also supports so-called `\OMEGA{} Translation Processes' (\acro{OTP}s),
for performing complex transformations on arbitrary input. See
\OnCD{texmf-dist/doc/omega/base/doc-1.8.tex} (not completely up-to-date).
\item [Aleph] combines the \OMEGA\ and \eTeX\ extensions.
See \OnCD{texmf-dist/doc/aleph/base} for some minimal documentation.
\end{description}
\subsection{Other notable programs in \protect\TL}
Here are a few other commonly-used programs included in \TL{}:
\begin{cmddescription}
\item [bibtex] bibliography support.
\item [makeindex] index support.
\item [dvips] convert \dvi{} to \PS{}.
\item [xdvi] \dvi{} previewer for the X Window System.
\item [dvilj] \dvi{} drive for the HP LaserJet family.
\item [dv2dt, dt2dv] convert \dvi{} to/from plain text.
\item [dviconcat, dviselect] cut and paste pages
from \dvi{} files.
\item [dvipdfm] convert \dvi{} to \acro{PDF}, an alternative approach
to pdf\TeX\ (mentioned above). See the \pkgname{ps4pdf} and
\pkgname{pdftricks} packages for still more alternatives.
\item [psselect, psnup, \ldots] \PS{}
utilities.
\item [lacheck] \LaTeX{} syntax checker.
\item [texexec] Con\TeX{}t and \acro{PDF} processor.
\item [tex4ht] \TeX{} to \acro{HTML} converter.
\end{cmddescription}
\section{Unix installation}
\label{sec:unix-install}
As introduced in section~\ref{sec:basic} (\p.\pageref{sec:basic}),
\TL{} has three principal uses:
\begin{enumerate}
\item Run directly from media.
\item Install to disk.
\item Integrate a particular package or collection into your existing
\TeX{} installation.
\end{enumerate}
\noindent The following sections describes the Unix-specific procedures
for each of these.
\ifSingleColumn \begin{figure}[ht]\noindent \fi
\begin{warningbox}
\textbf{Warning: } The \TK{} \CD{}s and \DVD{} are in ISO 9660 (High Sierra)
format, \emph{with} Rock Ridge (and Joliet, for Windows)
extensions. Therefore, in order to take full advantage of the \TK{}
under Unix, your system needs to be able to use the Rock Ridge
extensions. Please consult the documentation for your \cmdname{mount}
command to see how to do this. If you have several different machines
on a local network, you may be able to mount the \CD{}s on one which
does support Rock Ridge, and use this with the others.
\leavevmode\quad Linux, \acro{BSD}, Sun, and \acro{SGI}
systems should be able to use the \CD{}s without problems. We
would appreciate receiving detailed advice from users on other systems
who succeed, for future versions of this documentation.
\leavevmode\quad
The discussion below assumes you have been able to mount
the \CD{}s with full Rock Ridge compatibility.
\end{warningbox}
\ifSingleColumn\end{figure}\fi
%
\subsection{Running \protect\TL{} directly from media (Unix)}
\def\runlive{% text repeated in windows section
It is possible to use the \TeX{} system directly from the \pkgname{live}
\DVD{}, without installing the distribution to disk. (Thus the name
\TeX\ `Live', in fact.) It is \emph{not} possible to run \TeX{}
directly from the other \CD s (see section~\ref{sec:multiple-dist},
\p.\pageref{sec:multiple-dist}).
}
\def\startinst{% repeated in other subsections
To start, you mount the \CD{} or \DVD{}, with Rock Ridge extensions
enabled. The exact command to do this varies from system to system; the
following works under Linux, except the name of the device
(\filename{/dev/cdrom}, here) may vary. (All our examples will use
\texttt{>} as the shell prompt; user input is
\Ucom{\texttt{underlined}}.)
\begin{alltt}
> \Ucom{mount -t iso9660 /dev/cdrom /mnt/cdrom}
\end{alltt}
\noindent Change the current directory to the mount point:
\begin{alltt}
> \Ucom{cd /mnt/cdrom}
\end{alltt}
\noindent Under \MacOSX, the directory is typically under
\dirname{/Volumes}, and the media will be mounted automatically.
Run the installation script \filename{install-tl.sh}:
\begin{alltt}
> \Ucom{sh install-tl.sh}\\
Welcome to TeX Live...
\end{alltt}
\noindent After various greeting messages and a list of the main menu
options, the installation will ask you to enter a command. Do this by
typing the desired character and hitting return; don't type the angle
brackets. Either uppercase or lowercase is ok; we'll use lowercase in
our examples.
}
\runlive
\startinst
For running live, our first command will be \Ucom{d} and then the
subcommand \Ucom{1} to set directories. Even in this case, we must
choose a directory on the local disk to place files that the \TeX{}
system itself generates, such as fonts and formats, and also to provide
a place for updated configuration files, if need be. We'll use
\dirname{/usr/local/texmf-local} in this example. (If the default value
of \dirname{/usr/TeX} works for you, then you can skip this step.)
\begin{alltt}
Enter command: \Ucom{d}
Current directories setup:
<1> TEXDIR: /usr/TeX
...
Enter command: \Ucom{1}
New value for TEXDIR [/usr/TeX]: \Ucom{/usr/local/texmf-local}
...
Enter command: \Ucom{r}
\end{alltt}
\noindent Back at the main menu, our second and last command is
\Ucom{r}, to set up for running live off the media without installing
to disk:
\begin{alltt}
Enter command: \Ucom{r}
Preparing destination directories...
...
Welcome to TeX Live!
>
\end{alltt}
\noindent And we are back at the system prompt, as shown.
Next, it is necessary to alter two environment variables:
\envname{PATH}, to an architecture-dependent value (so that we can run
the programs), and \envname{VARTEXMF}, to the value specified above. See
table~\ref{tab:archlist} for a list of the architecture names for the
different systems.
\def\textruntexconfig{%
After the main installation has completed, and environment variables
have been set, the last step is to run \cmdname{texconfig} to customize
your installation for your needs. This is explained in
section~\ref{sec:texconfig}, \p.\pageref{sec:texconfig}.
}
\textruntexconfig
\begin{table*}[ht]
\caption[Supported system architectures.]{Supported system
architectures. In addition to the version-specific names listed here,
there are generic names without the version numbers. For instance,
\texttt{sparc-solaris} links to \texttt{sparc-solaris2.7}. The generic
names can be used to protect against the version numbers changing in the
future, if you wish.}
\label{tab:archlist}
\begin{tabular}{>{\ttfamily}ll}
alpha-linux & HP Alpha GNU/Linux \\
%alphaev5-osf4.0d & HP Alphaev5 OSF \\
%hppa2.0-hpux10.20 & HP9000 HPUX 10.20 \\
i386-freebsd4.10 & Intel x86 FreeBSD \\
i386-linux & Intel x86 GNU/Linux \\
%i386-openbsd3.3 & Intel x86 OpenBSD \\
%i386-solaris2.8 & Intel x86 Solaris \\
mips-irix6.5 & SGI IRIX \\
powerpc-aix4.3.3.0 & IBM RS/6000 AIX \\
powerpc-darwin6.8 & \MacOSX \\
sparc-solaris2.7 & Sun Sparc Solaris \\
sparc64-linux & Sun Sparc GNU/Linux \\
win32 & Windows (32-bit) \\
x86\_64-linux & Intel/AMD 64-bit GNU/Linux \\
\hline
\end{tabular}
\end{table*}
\label{text:path}
The syntax for setting the environment variables, and the initialization
file to put them in, depends on the shell you use. If you use a
Bourne-compatible shell (\cmdname{sh}, \cmdname{bash}, \cmdname{ksh}, et
al.), put the following into your \filename{$HOME/.profile} file:
\begin{alltt}
PATH=/mnt/cdrom/bin/\var{archname}:$PATH; export PATH
VARTEXMF=/usr/local/texmf-local/texmf-var; export VARTEXMF
\end{alltt}
\noindent For C shell-compatible shells (\cmdname{csh}, \cmdname{tcsh}),
put the following into your \filename{$HOME/.cshrc} file:
\begin{alltt}
setenv PATH /mnt/cdrom/bin/\var{archname}:$PATH
setenv VARTEXMF /usr/local/texmf-local/texmf-var
\end{alltt}
\noindent Then log out, log back in, and test your installation
(see section~\ref{sec:test-install}, \p.\pageref{sec:test-install}).
\def\textifindoubt{%
If in doubt, please ask any local system gurus to help you with
problems; for example, the way to mount the \TL{} media, which
directory or directories to use, and precise details of the changes to
your personal initialization files can and do vary from site to site.
}
\textifindoubt
%
\subsection{Installing \protect\TeX\protect\ Live to disk}
\label{sec:unix-install-disk}
It is possible, indeed typical, to install the \TeX{} system from the
\TL{} to disk. This can be done either from any of the \TK{} discs.
(See section~\ref{sec:multiple-dist}, \p.\pageref{sec:multiple-dist},
for an explanation of the different distributions.)
\startinst
Table~\ref{tab:main-menu-options} briefly lists the options in the main
menu. The order in which you select the options makes little
difference, except that \Ucom{i} must be last. It's reasonable to go
through them in the order presented here.
% apparently here.sty [H] doesn't support table*.
\begin{table}[H]
\caption{Main menu options for the installation.}
\label{tab:main-menu-options}
\begin{tabular}{>{\ttfamily}ll}
p & The platform you are running on.\\
b & The architectures for which to install binaries.\\
s & The base installation scheme to use (minimal, recommended,
full, etc.)\\
c & Override the base scheme for individual collections.\\
l & Override for language collections.\\
d & Directories in which to install.\\
o & Other options.\\
i & Perform the installation.\\
\end{tabular}
\end{table}
Here are further details on each option.
\textbf{\optname{p} -- Current platform.} Since the installation script
automatically guesses which platform you're running on, it is generally
unnecessary to use this option. It's there in case you need to override
the automatic detection.
\textbf{\optname{b} -- Binary architectures.} By default, only the
binaries for your current platform will be installed. From this menu,
you can select installation of binaries for other architectures as well
(or not install the current platforms). This can be useful if you are
sharing a \TeX\ tree across a network of heterogenous machines. For a
list of the supported architectures, see table~\ref{tab:archlist},
\p.\pageref{tab:archlist}.
\textbf{\optname{s} -- Base installation scheme.} From this menu, you
can choose an overall common set of packages, called a ``scheme''. The
default \optname{recommended} scheme suffices for typical needs, but you
can also choose the \optname{basic} scheme if you are low on disk space,
or \optname{full} to get absolutely everything. There are also specific
sets for Omega and \acro{XML}.
\textbf{\optname{c} -- Individual collections.} From this menu, you can
override the base scheme's set of collections to install. Collections
are one level lower than schemes\Dash collections consist of
one or more packages, where packages (the lowest level grouping in \TL)
contain the actual \TeX\ macro files, font families, and so on.
In this menu, selection letters are case-sensitive.
\textbf{\optname{l} -- Language collections}. This menu has the same
basic purpose as \Ucom{c}, to override the base scheme. In this case,
the collections are specifically for different languages. Selection
letters are case-sensitive here. Here is a list of the language
collections in \TL:
% xx really should generate list from texmf/tpm/collection/tex-lang*
% a la install-tl.sh.
\begin{tabbing}
\hspace{.25\linewidth} \=
\hspace{.25\linewidth} \=
\hspace{.25\linewidth} \=
\hspace{.25\linewidth} \kill
(some) African scripts \>
Arabic \>
Armenian \>
Chinese\,Japanese\,Korean \\
Croatian \>
Cyrillic \>
Czech/Slovak \>
Danish \\
Dutch \>
Finnish \>
French \>
German \\
Greek \>
Hungarian \>
Indic \>
Italian \\
Latin \>
Manju \>
Mongolian \>
Norwegian \\
Polish \>
Portuguese \>
Spanish \>
Swedish \\
Tibetan \>
\acro{UK} English \>
Vietnamese \\
\end{tabbing}
\noindent Language collections typically include fonts, macros,
hyphenation patterns, and other support files. (For instance,
\pkgname{frenchle.sty} is installed if you select the \optname{French}
collection.) In addition, installing a language collection will alter
the \filename{language.dat} configuration file controlling which
hyphenation patterns are loaded.
\textbf{\optname{d} -- Installation directories}. Three directories can
be changed here:
\label{text:instdir}
\begin{ttdescription}
\item [TEXDIR] The top-level directory under which
everything else will be installed. The default value is
\dirname{/usr/TeX}, and is often changed. For example, changing to a
value such as \dirname{/usr/local/texlive2003} would make it possible to
keep different releases of \TL{} separate. (You may then wish to make
\dirname{/usr/local/texlive} a symbolic link, after testing the new
release.)
Under \MacOSX, the usual frontends look for \TeX{} in
\dirname{/usr/local/teTeX}, so you may wish to install \TL{} there.
\item [TEXMFLOCAL] This tree is where the \TeX{} system (not as part of
installation, but rather over time) puts non-version-specific files,
primarily fonts. The default value is \dirname{TEXDIR/texmf-local}.
However, it's also the recommended location to put any local packages or
configuration settings. Therefore, it's desirable to change it to a
location independent of the current \TL{} release; for example,
\dirname{/usr/local/texmf-local}.
\item [VARTEXMF] This tree is where the system puts files that
\emph{are} version-specific, primarily format files and the
configuration files which are modified by \cmdname{texconfig} (see
section~\ref{sec:texconfig}, \p.\pageref{sec:texconfig}). The default
value is \dirname{TEXDIR/texmf-var}, and there's generally no reason to
change it.
\end{ttdescription}
\textbf{\optname{o} -- Other options.} From this menu, you can select
the following general options:
\begin{ttdescription}
\item [a] Specify an alternate directory for generated fonts.
The default is to use the \envname{VARTEXMF} tree, as explained above.
Setting this is useful if you plan to mount the main tree read-only, and
therefore you need another location (perhaps host-specific) for
dynamically created fonts.
\item [l] Create symbolic links for the binaries, man pages,
and\slash or \acro{GNU} Info files in other locations. For example, you may
wish to make the man pages available under \dirname{/usr/local/man} and
the Info files available under \dirname{/usr/local/info}. (Of course
you need appropriate privileges to write in the specified directories.)
It is not advisable to overwrite a \TeX\ system that came with your
system with this option. It's intended more for having the links in
standard directories known to users, such as \dirname{/usr/local/bin},
which don't already contain any \TeX\ files.
\item [d] Skip installation of the font/macro documentation tree.
This is useful if you need to save space, or if you've previously
installed the documentation elsewhere.
\item [s] Skip installation of the main font/macro source
tree. This is useful if you are arranging to share that tree between
machines and\slash or architectures in some other way, such as \acro{NFS}.
\end{ttdescription}
\textbf{i -- Perform installation.} When you're satisfied with your
configuration options, enter \Ucom{i} to actually do the installation
from the media to your chosen locations.
% text is similar to above, but no VARTEXMF, so we have to write out.
After the installation completes, your next step is to include the
architecture-specific subdirectory of \dirname{TEXDIR/bin} in your
\envname{PATH}, so the newly-installed programs can be found. The
architecture names are listed in table~\ref{tab:archlist},
\p.\pageref{tab:archlist}, or you can simply list the directory
\dirname{TEXDIR/bin}.
The syntax for doing this, and the initialization file to use, depends
on your shell. If you use a Bourne-compatible shell (\cmdname{sh},
\cmdname{bash}, \cmdname{ksh}, et al.), put the following into your
\filename{$HOME/.profile} file:
\begin{alltt}
PATH=/mnt/cdrom/bin/\var{archname}:$PATH; export PATH
\end{alltt}
\noindent For C shell-compatible shells (\cmdname{csh}, \cmdname{tcsh}),
put the following into your \filename{$HOME/.cshrc} file:
\begin{alltt}
setenv PATH /mnt/cdrom/bin/\var{archname}:$PATH
\end{alltt}
\textruntexconfig
Here is a brief annotated example which selects a full installation,
with binaries for the current system only, with directory changes as
recommended above. The prompts and \acro{RETURN}s are omitted for
brevity.
\begin{alltt}
> \Ucom{sh install-tl.sh}
\Ucom{s} \Ucom{b} \Ucom{r} # scheme, full, return to main
\Ucom{d} # change directories
\Ucom{1} \Ucom{/usr/local/texlive2003} # top-level dir
\Ucom{2} \Ucom{/usr/local/texmf-local} # TEXMFLOCAL outside TEXDIR
\Ucom{r} # return to main
\Ucom{i} # perform installation
> \Ucom{texconfig} ...
# New PATH, with Linux as the example:
> \Ucom{PATH=/usr/local/texlive2003/bin/i386-linux:$PATH; export PATH}
\end{alltt}
\textifindoubt
%
\subsection{Installing individual packages to disk}
You can add individual packages or collections from the current
distribution to an existing non-\TL{} setup, or an earlier
\TL{} installation.
\startinst
Run the installation script \filename{install-pkg.sh} (not
\filename{install-tl.sh}, which is intended for complete installations
only):
\begin{alltt}
> \Ucom{sh install-pkg.sh \var{options}}
\end{alltt}
The first set of options controls what gets read:
\begin{ttdescription}
\item [-{}-package=\var{pkgname}] The individual package to work on.
\item [-{}-collection=\var{colname}] The individual collection to work on.
\item [-{}-nodoc] Exclude documentation files from the operation.
\item [-{}-nosrc] Exclude source files from the operation.
\item [-{}-cddir=\var{dir}] Source directory to read from; defaults
to the current directory. If you followed the instructions above, that
will be the distribution directory, and won't need to be changed.
\item [-{}-listdir=\var{dir}] The so-called `lists' directory within
\var{cddir} from which to read the package information. The only
reason to change the default is if you're making changes to \TL{}
yourself.
\end{ttdescription}
What actually happens is controlled by the following options. If
neither of these are specified, the default action is to install the
selected files. The main destination tree is found by expanding
\envname{\$TEXMFMAIN} with \cmdname{kpsewhich}. You can override it by
setting either the environment variable \envname{TEXMFMAIN} or
\envname{TEXMF}.
\begin{ttdescription}
\item [-{}-listonly] List the files that would be installed, but don't
actually install anything.
\item [-{}-archive=\var{tarfile}] Instead of installing the files into
the \TeX{} system, make a \cmdname{tar} archive.
\end{ttdescription}
Additional options:
\begin{ttdescription}
\item [-{}-config] After installation, run \code{texconfig init}.
\item [-{}-nohash] After installation, don't run \cmdname{mktexlsr} to
rebuild the filename database.
\item [-{}-verbose] Give more information as the script runs.
\end{ttdescription}
Here are some usage examples:
\begin{enumerate}
\item To see the files in the package \pkgname{fancyhdr} without
installing it:
\begin{alltt}
\ifSingleColumn> \Ucom{sh install-pkg.sh --package=fancyhdr --listonly}
\else> \Ucom{sh install-pkg.sh --package=fancyhdr \bs}
> \Ucom{--listonly}
\fi{}
texmf/doc/latex/fancyhdr/README
texmf/doc/latex/fancyhdr/fancyhdr.dvi
texmf/doc/latex/fancyhdr/fancyhdr.pdf
...
\end{alltt}
\item Install the \LaTeX{} package \pkgname{natbib}:
\begin{alltt}
> \Ucom{sh install-pkg.sh --package=natbib}
\end{alltt}
\item Install the \LaTeX{} package \pkgname{alg} without source files or
documentation:
\begin{alltt}
\ifSingleColumn> \Ucom{sh install-pkg.sh --package=alg --nosrc --nodoc}
\else> \Ucom{sh install-pkg.sh -{}-package=alg \bs}
> \Ucom{-{}-nosrc -{}-nodoc}
\fi\end{alltt}
\item Install all the packages in the collection of additional
plain \TeX\ macros:
\begin{alltt}
> \Ucom{sh install-pkg.sh --collection=tex-plainextra}
\end{alltt}
\item Write all files in the \pkgname{pstricks} package to a
\cmdname{tar} file in \path|/tmp|:
\begin{alltt}
\ifSingleColumn> \Ucom{sh install-pkg.sh --package=pstricks --archive=/tmp/pstricks.tar}
\else
> \Ucom{sh install-pkg.sh -{}-package=pstricks \bs}
> \Ucom{-{}-archive=/tmp/pstricks.tar}
\fi\end{alltt}
\end{enumerate}
\textifindoubt
%
\section{Post-installation}
\label{sec:postinstall}
After the main installation is done, for any operating system, the
remaining steps are to configure the system for your local needs, and
perform some basic tests.
Another sort of post-installation is to acquire packages, fonts, or
programs that were not included in \TL{}. The basic idea is to
install such additions in the \envname{TEXMFLOCAL} tree (if you
installed to disk), or \envname{VARTEXMF} (if you are running live).
See the ``Installation directories'' option on \p.\pageref{text:instdir}.
Unfortunately, the details can and do vary widely, and so we do not attempt to
address them here. Here are some external links to descriptions:
\begin{itemize*}
\item
\url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages}
\item
\url{http://www.ctan.org/installationadvice}
\item
\url{http://www.ctan.org/tex-archive/info/beginlatex/html/chapter5.html#pkginst}
\item
\url{http://www.ctan.org/tex-archive/info/Type1fonts} for font creation
and installation information in particular.
\end{itemize*}
\subsection{The \protect\cmdname{texconfig} program}
\label{sec:texconfig}
At any time after installation, you can and should use the program
\cmdname{texconfig} to configure the system to fit your local needs. It
is installed in the architecture-specific subdirectory
\texttt{TEXDIR/bin/\var{arch}} along with everything else.
If you run it without arguments, it will enter full-screen mode and
allow you to view and change options interactively.
You can also run it with various command-line options. Here are some of
the most common (a \TL{} installation is configured for the A4 paper
size by default):
\begin{ttdescription}
\item [texconfig paper letter] Set default paper size for
various programs and drivers (\cmdname{pdftex}, \cmdname{dvips},
\cmdname{dvipdfm}, \cmdname{xdvi}) to be \acro{US} letter. The other
allowable size is \optname{a4}, which is the default.
\item [texconfig localsetup] Verify that paths are set ok.
\item [texconfig rehash] Update all the \TeX{} system filename databases.
\item [texconfig faq] Show the \teTeX{} \acro{FAQ}.
(See also the main \TeX{} \acro{FAQ} in \OnCD{texmf-doc/doc/english/FAQ-en}.)
\item [texconfig help] Output help information for \cmdname{texconfig}.
\end{ttdescription}
Of course, \cmdname{texconfig} can only support changing a few of the
many options and configuration parameters in a \TeX{} system. The main
configuration file for the base \Webc{} programs is named
\filename{texmf.cnf}. You can find its location by running
\samp{kpsewhich texmf.cnf}; it contains many comments explaining the
default settings and useful alternatives.
\subsection{Testing the installation}
\label{sec:test-install}
After installing \TL{} as best you can, you naturally want to test
it out, so you can start creating beautiful documents and\slash or fonts.
This section gives some basic procedures for testing that the new system
is functional. We give Unix commands; under \MacOSX{} and Windows,
you're more likely to run the tests through a graphical interface, but
the principles are the same.
\begin{enumerate}
\item Make sure that you can run the \cmdname{tex} program in the first
place:
\begin{alltt}
> \Ucom{tex -{}-version}
TeX 3.141592 (Web2C 7.5.3)
kpathsea version 3.5.3
Copyright (C) 1997-2004 D.E. Knuth.
...
\end{alltt}
If this comes back with `command not found' instead of version and
copyright information, most likely you don't have the correct
\dirname{bin} subdirectory in your \envname{PATH}. See
the environment-setting information on \p.\pageref{text:path}.
\item Process a basic \LaTeX{} file:
\begin{alltt}
> \Ucom{latex sample2e.tex}
This is pdfeTeXk, Version 3.141592...
...
Output written on sample2e.dvi (3 pages, 7496 bytes).
Transcript written on sample2e.log.
\end{alltt}
If this fails to find \filename{sample2e.tex} or other files, perhaps
you have interference from old environment variables or configuration
files. For a deep analysis, you can always ask \TeX{} to report on
exactly what it is searching for, and finding; see ``Debugging actions''
on page~\pageref{Debugging}.
\item Preview the result online:
\begin{alltt}
> \Ucom{xdvi sample2e.dvi}
\end{alltt}
(Under Windows, the analogous command is \cmdname{windvi}.) You should
see a new window with a nice document explaining some of the basics of
\LaTeX{}. (Well worth reading, by the way if you're new to the system.)
You do have to be running under X for \cmdname{xdvi} to work; if you're
not, or your \envname{DISPLAY} environment variable is set incorrectly,
you'll get an error \samp{Can't open display}.
\item Create a \PS{} file for printing or display:
\begin{alltt}
> \Ucom{dvips sample2e.dvi -o sample2e.ps}
\end{alltt}
\item Create a \acro{PDF} file instead of \dvi{}; this processes the
\filename{.tex} file and writes \acro{PDF} directly:
\begin{alltt}
> \Ucom{pdflatex sample2e.tex}
\end{alltt}
\item Preview the \acro{PDF} file:
\begin{alltt}
> \Ucom{gv sample2e.pdf}
\textrm{or:}
> \Ucom{xpdf sample2e.pdf}
\end{alltt}
Unfortunately neither \cmdname{gv} nor \cmdname{xpdf} are currently
included in \TL{}, so you must install them separately. See
\url{http://wwwthep.physik.uni-mainz.de/~plass/gv} and
\url{http://www.foolabs.com/xpdf}, respectively.
\item Other standard test files you may find useful:
\begin{ttdescription}
\item [small2e.tex] A simpler document than \filename{sample2e}, to
reduce the input size if you're having troubles.
\item [testpage.tex] Test if your printer introduces any offsets.
\item [nfssfont.tex] For printing font tables and tests.
\item [testfont.tex] Also for font tables, but using plain \TeX{}.
\item [story.tex] The most canonical (plain) \TeX{} test file of all.
You must type \samp{\bs bye} to the \code{*} prompt after \samp{tex
story.tex}.
\end{ttdescription}
You can process these in the same way as we did with
\filename{sample2e.tex}.
\end{enumerate}
If you are new to \TeX{}, or otherwise need help with actually
constructing \TeX{} or \LaTeX{} documents, please visit
\url{http://tug.org/begin.html}. We especially recommend the
\textsl{Formatting Information} manual by Peter Flynn, available at
\url{http://www.ctan.org/tex-archive/documentation/beginlatex}.
\section{\MacOSX{} installation}
\label{sec:mac-install}
\TL{} supports \MacOSX, but no prior Macintosh versions. (If you
are running an older Mac version, you can view the files by installing
the Joliet system extension available from
\url{http://www.tempel.org/joliet}; however, the \TL{} binaries
will not run.)
Installation of \TeX{} under \MacOSX{} can be done in two ways:
\begin{enumerate}
\item With the \filename{install*} scripts, as with Unix.
\item With the \cmdname{i-Installer} included in
\filename{MacOSX/II2.dmg}.
\end{enumerate}
\noindent Each of these is described in a following section.
In addition, \TeX{} under \MacOSX\ typically uses a ``frontend''. This
is also described below.
\subsection{\protect\cmdname{i-Installer}: Internet installation}
\label{sec:i-Installer}
The \cmdname{i-Installer} is included in the \TL{} distribution as
an alternative to normal installation. It does not use the contents of
the \TL{} distribution at all; instead, the system (approximately
70 megabytes) is downloaded over the Internet.
One advantage of \cmdname{i-Installer} is that it makes updates
relatively painless. If you are interested, please see the
\cmdname{i-Installer} \TeX{} home page at \url{http://www.rna.nl/tex.html}.
To use it, mount \filename{./MacOSX/II2.dmg}. Read the documentation,
launch it, and install at least \texttt{TeX Foundation} and \texttt{TeX
Programs}. The first will finish without configuration, as soon as the
second is installed you will be presented with a graphical interface to
setting up your \TeX{} system.
The \cmdname{i-Installer} distribution uses the \teTeX{} \dirname{texmf}
tree with some additions. Due to differences between \TL{} and
\teTeX{} you cannot update a \TL{} installation with an
\cmdname{i-Installer} \texttt{TeX Programs} i-Package.
\subsection{\protect\cmdname{install*.sh}: \protect\TL{} installation}
In order to run the installation scripts under \MacOSX, you need to have
the \cmdname{bash} shell installed. If you are running \MacOSX~10.2
or later, you have \cmdname{bash}, and can proceed. If you're running
an earlier \MacOSX{} version, however, the default shell is
\cmdname{zsh}, which won't work; you'll need to get \cmdname{bash} from
the Internet, or more likely upgrade your system.
Once you have \cmdname{bash}, the Unix installation documentation in the
previous section can be followed. See section~\ref{sec:unix-install} on
\p.\pageref{sec:unix-install}; \MacOSX-specific notes are included there
where needed.
\subsection{\MacOSX{} frontends}
Using \TeX{} on a Macintosh typically goes through a front end program,
comprising an execution shell, editor, previewer, and other facilities,
with a graphical interface. Here are the principal frontends:
\begin{cmddescription}
\item [TeXShop] Included in \TL{} as \filename{./MacOSX/texshop.dmg}.
\\See \url{http://www.uoregon.edu/~koch/texshop/texshop.html}.
\item [ITeXMac] Included in \TL{} as \filename{./MacOSX/iTM-*.dmg}.
\\See \url{http://itexmac.sourceforge.net}.
\item [Mac-emacs] A port of Emacs to \MacOSX{}, integrating \pkgname{AucTeX}.
\\See \url{http://www.cs.man.ac.uk/~franconi/mac-emacs}.
\end{cmddescription}
The frontends use \dirname{/usr/local/teTeX} as the default location;
therefore, you must either install \TL{} there, or change the
configuration of the frontend.
\section{Windows installation}
\label{sec:win-install}
Unfortunately, this release of \TL{} does not include a Windows
installer, due to technical difficulties. We hope that an installer
will be available again in a few months. (It is being completely
rewritten to use standard Microsoft libraries, instead of the homegrown
\filename{TeXSetup.exe}.)
A set of experimental Windows binaries is included, nevertheless. You
can install them with the Unix \filename{install-tl.sh} script: select
the \optname{win32} system from the \optname{S} option of the top-level
menu. The \pkgname{XEmacs} package is not included, however, due to
space.
(Meanwhile, if you are an experienced Windows programmer and would like
to help with the project, email us!)
\begin{comment}
\TL{} can be installed on systems running Windows 9x, \acro{ME},
\acro{NT}, \acro{2K} or \acro{XP}. Older versions of Windows (3.1x)
and \acro{MS-DOS} are not supported.
It is necessary to have your Windows set up so that it uses the
Microsoft Joliet extensions for reading \CD{}s; simply look at the \CD{}
in Explorer and see whether it shows long, mixed-case, file names. If it
does not, you must install the Joliet extensions.
The Windows \TeX{} system included in \TL{} is no more and no less
than the \fpTeX{} distribution. It includes a \texttt{dvi} previewer,
\textsf{Windvi}, which is similar in usage to the established Unix
\textsf{xdvi}. The documentation can be found in
\OnCD{texmf/doc/html/windvi/windvi.html}.
\subsection{The \texttt{TeXLive.exe} program}
\begin{figure*}
\begin{center}
\ifnum \Status=1
\includegraphics[width=.7\textwidth]{pictures/Welcome-to-TeXLive}
\else
\ifnum \Status=2
\includegraphics[bb=0 0 551 534]{pictures/Welcome-to-TeXLive.jpg}
\else
\includegraphics[width=.7\textwidth]{pictures/Welcome-to-TeXLive}
\fi
\fi
\end{center}
\caption{``Welcome to \TL'' window}\label{graph:welcome}
\end{figure*}
If your computer is configured to let the \CD{} autostart, then a dialog
box with a menu bar will popup on the screen, and you will have several
choices from there:
\begin{itemize*}
\item Install \TeX{} on your hard disk
\item Do maintenance on your \TeX{} system.
\item Remove the \TeX{} system.
\item Use \TeX{} off the \TL{} \CD{} or \DVD{}.
\item Browse documentation: \TL{} documentation, TUG web
pages, \fpTeX web pages.
\item Run the \cmdname{TeXdocTK} application to find specific documentation.
\end{itemize*}
If your \CD{} does not autostart, you can explicitly run the program
by double clicking on \path|bin/win32/TeXLive.exe| on the \CD{} from
the explorer window.
\subsection{Running \protect\TL{} directly from media (Windows)}
\runlive
To run live under Windows, from the menu, chose \verb|Explore CD-Rom|, then
\verb|Run TeX off CD-Rom|. This will launch the \cmdname{XEmacs} editor.
XEmacs startup file will set the environment variables needed. XEmacs will also
setup a temporary \acro{TDS} compliant texmf tree in the temporary area of your
computer. It is needed to store files that may be built on the fly, such as
\path|pk| bitmap fonts, or format files. Configuration files are copied from
the \CD{} to this texmf tree, so that you can edit them if needed. The
\path|ls-R| database is computed for this texmf tree. The AUC-\TeX{} mode will
be entered Whenever you will visit or create a \TeX{} file, providing all the
bells and whistles for \TeX{} support XEmacs is capable of.
If you run 'M-x shell' within XEmacs, then you will have access to all the TeXLive
tools from the command line provided by XEmacs.
\smallskip {\small\noindent \textbf{[For advanced users:]} You can also
use the small batch file \path|mkloctex.bat| to be called in a
directory \path|bin\win32| of the \CD. From the Start menu select
`Run', then browse the \acro{CD} drive and select
\path|mkloctex.bat|. Before starting it, you should add two parameters
separated by a space: the letter of your \acro{CD} drive and the
letter of the drive where you want to install the \TeX\ directory.
The whole line should read, e.g., \verb+d:\bin\win32\mkloctex.bat d c+.
When installation is complete, please read carefully the information
on screen. If you are running Windows 9x/\acro{ME}, then you will have to
restart Windows.}
\subsection{Support packages for Windows}
\label{sec:win-xemtex}
To be complete, a \TL installation needs support packages that are not
commonly found on a Windows machine.
Many scripts are written using the Perl language. Some important tools require
the Ghostscript \PS{} interpreter to render or to convert files. A graphic
file toolbox is also needed in some cases. Last but not least, a \TeX-oriented
editor makes it easy to type in your \TeX{} files.
All these tools are quite easy to find for Windows, but in order to try to make
your life even easier, we have put such a set of tools on \TL:
\begin{itemize*}
\item \cmdname{Ghostscript} 7.07
\item a minimal \cmdname{Perl} 5.8, sufficient to run all the \TL{}
Perl scripts
\item a subset of \cmdname{ImageMagick} 5.5.6
\item the \cmdname{ISpell} checker
\item \cmdname{XEmacs} 21.5.14 with a selection of packages to support
\TeX{} typesetting.
\end{itemize*}
These packages should be installed only all at once. The bundle is
known as the \XEmTeX{} bundle.
If you didn't install \XEmTeX{}, \cmdname{Perl} and \cmdname{Ghostscript} are
installed anyway if they are not detected on your machine. This is because they are
required by many important tools. The \envname{PERL5LIB} and \verb|GS_LIB|
environment variables will be set too.
When you are under
\cmdname{XEmacs}, the tools provided shadow any other version you might
have installed previously. The point here is that \path|TeXSetup.exe|
will not install anything outside of the \TL location, neither will
it run foreign installers, nor will it try to autodetect installed
products using unreliable rules of thumb. The \XEmTeX{} bundle is
standalone and is meant to evolve in the future. The reference site is
\url{http://www.fptex.org/xemtex/}.
If you don't want to install this bundle, then you are on your own to
install the required tools to complete your \TL{} system. Here is a
list of places to get those tools:
\begin{description}
\item[Ghostscript] \url{http://www.cs.wisc.edu/~ghost/}
\item[Perl] \url{http://www.activestate.com/} (but you might need some
supplementary packages from CPAN: \url{http://www.cpan.org/})
\item[ImageMagick] \url{http://www.imagemagick.com}
\item[NetPBM] alternatively, you could use NetPBM instead of ImageMagick to
process or convert your graphic files. NetPBM home page is
\url{http://netpbm.sourceforge.net/}
\item[\TeX-oriented editors] There is a wide choice, and it is a matter of the
user's taste. Here is a selection:
\begin{itemize*}
\item \cmdname{GNU Emacs} is available natively under Windows, the
reference url is
\url{http://www.gnu.org/software/emacs/windows/ntemacs.html}
\item \cmdname{XEmacs} is available natively under Windows, the
reference url is \url{http://www.xemacs.org/}
\item \cmdname{WinShell} is available on \TL in the \path|support|
directory, the reference url is \url{http://www.winshell.de}
\item \cmdname{WinEdt} is shareware available from \url{http://www.winedt.com}
\item TeXnicCenter is available from\\
\url{http://www.toolscenter.org}
\item \cmdname{Vim} is available on \TL{} in the
\path|support\vim| directory and the
reference site is \url{http://www.vim.org}
\item \cmdname{SciTE} is available from \url{http://www.scintilla.org/SciTE.html}
\end{itemize*}
\end{description}
You might want to install other tools that are not free\footnote{Not
free, that is, in the sense of freedom to modify and redistribute,
following free software guidelines. This does not mean you can't acquire
them for no money.} and therefore not included on \TL{}, such as
\cmdname{GSView}, the \cmdname{Ghostscript} companion to more
conveniently view PS/PDF files. \cmdname{GSView} is available from
\url{http://www.cs.wisc.edu/~ghost/gsview/} or any \acro{CTAN} site.
\subsection{Installing \protect\TeX\protect\ Live to disk}
\textbf{Warning: Win9x users must ensure they have enough environment
space before undertaking installation. The \cmdname{TeXSetup.exe}
program won't change the environment size for them. A few environment
variables will be created and it is possible you run out of
environment space. Add \texttt{SHELL=<path>COMMAND.COM /E:4096 /P} in the
config.sys file in order to increase your environment size.}
Installation is started by letting the media autostart. The program run
is \path|TeXSetup.exe| if you are using the inst disk. If you are using
the live or the demo disk, you will have to select the item
\path|TeXLive Software| from the menu, then the subitem \path|Install on
Hard Disk|. This will invoke \path|TeXSetup.exe|. You can also find it
in the \path|bin/win32| directory and run it, if the autostart fails for
any reason. \path|TeXSetup.exe| is a Windows wizard and it will display
several pages while running.
\begin{description}
\item[Welcome Page]
You can choose a \emph{quick} installation from
here. In this case, the installation will run without any human
assistance from beginning to end, with all the default settings
(Figure~\ref{graph:setup-src},
\ifnum \Status = 1
on the left%
\else\ifnum \Status=2
at the top%
\else
on the left%
\fi\fi
). If you have enough privileges (administrator or power user
rights) under a Windows version where this is applicable, then you can
decide to install the \TL{} for all users or for yourself only by
checking the appropriate box.
For installing the whole \XEmTeX{} bundle (XEmacs, Ghost\-script,
Perl, ImageMagick and Ispell) you can check \emph{Install XEmTeX
Support} box.
\begin{figure*}[!htb]
The \cmdname{TeXSetup} Wizard\hfill
Source directories for the \TL{} files
\begin{center}
\ifnum \Status=1
\includegraphics[width=.48\textwidth]{pictures/setup-wizard.jpg}\hfill%
\includegraphics[width=.48\textwidth]{pictures/source-for-texlive.jpg}
\else
\ifnum \Status=2
\includegraphics[bb=0 0 506 403]{pictures/setup-wizard.jpg}
\includegraphics[bb=0 0 506 403]{pictures/source-for-texlive.jpg}
\else
\includegraphics[width=.48\textwidth]{pictures/setup-wizard}%
\hfill%
\includegraphics[width=.48\textwidth]{pictures/source-for-texlive}
\fi
\fi
\caption{The \TL{} setup wizard}\label{graph:setup-src}
\end{center}
\end{figure*}
\item[Source Page]
This page is a bit complex. It will allow you to select two source
directories for your \TL{} system
(Figure~\ref{graph:setup-src},
\ifnum \Status = 1
on the right%
\else\ifnum \Status=2
at the bottom%
\else
on the right%
\fi\fi
). You will need a \emph{local
source directory} and possibly a \emph{remote source directory}.
Why do we need both these directories? The files consisting of the
\TL{} system are on the \CD{}, of course, but some other useful
packages are not, either because of space lacking or because their
license was not compatible with \TL{}. You need to enable Internet
downloading if you want to install these packages that are marked with a
specific ``remote'' icon.
However, don't panic: the default parameters of the setup will allow
you to install a full system using the \CD{} only. Simply, you won't
have \file{WinEdt} (for example), but you will be able to install it
later.
So you can take your files from:
\begin{itemize}
\item the \CD{} or any similar flat tree of files, available through
some standard directory (this means the \CD{} can be mounted on
some remote machine and be made available through network
sharing),
\item a set of \file{.zip} files (this is the case when you are
installing from the demo \CD{} or the \fpTeX{} distribution),
\item the Internet; in this case, the program takes care of
downloading the \file{.zip} files it needs for you.
\end{itemize}
This option is available only if you enable Internet file
downloading in the right part of the page. You also need to
configure this Internet access by selecting to connect either using
Internet Explorer~5 \file{wininet.dll}, or using a direct connection (\texttt{ftp},
\texttt{http}).
% or using a proxy server.
% Last, you can be assisted in defining the \emph{local source
% directory} and \emph{remote source directory} which will be used
% to copy the files onto your hard disk. The \texttt{browse} buttons
% allow to select a directory for the former, and an url among a list
% of mirrors for the latter.
\item[Root Page]
On this page, you will tell where you want the files to be
installed (Figure~\ref{graph:root-schm},
\ifnum \Status = 1
on the left%
\else\ifnum \Status=2
at the top%
\else
on the left%
\fi\fi
). Only the root directory really matters, the other ones
are set according to the root one. You may want to make
\path|$TEXMFEXTRA| point to some TDS compliant directory with other
\TeX{} files or assign a different value to
\path|$HOMETEXMF|, which is set by default to whatever Windows think
is your `HOME' location.
\begin{figure*}[!htb]
Root and directories\hfill%
Scheme selection
\begin{center}
\ifnum \Status=1
\includegraphics[width=.46\textwidth]{pictures/root-of-installation.jpg}\hfill%
\includegraphics[width=.46\textwidth]{pictures/scheme-selection.jpg}
\else
\ifnum \Status=2
\includegraphics[bb=0 0 506 403]{pictures/root-of-installation.jpg}
\includegraphics[bb=0 0 506 403]{pictures/scheme-selection.jpg}
\else
\includegraphics[width=.46\textwidth]{pictures/root-of-installation}%
\hfill%
\includegraphics[width=.46\textwidth]{pictures/scheme-selection}
\fi
\fi
\caption{\TL-Setup: Root and directories / Schemes}\label{graph:root-schm}
\end{center}
\end{figure*}
\item[Get TPM Page]
This page does not require any manual intervention. The \file{.tpm}
files which describe collections and packages are retrieved
(possibly from the Internet), unzipped if needed and parsed.
\item[Schemes Page]
On this page, you will select the global scheme of your
installation (Figure~\ref{graph:root-schm},
\ifnum \Status = 1
on the right%
\else\ifnum \Status=2
at the bottom%
\else
on the right%
\fi\fi
). A scheme is a large set of files targeted at some kind
of usage. There are 3 generic schemes for basic, recommended and
full installation. The other ones are devoted to LUGs (what GUST or
GUTenberg propose for their members) or applications (XML and
\TeX{}).
When a scheme is selected, it is still possible to refine the
selection by checking the appropriate box. If doing so, you will be
presented the packages page to change your selection, else you will
jump to the review page.
\item[Packages Page]
Collections and packages are presented in a tree form
(Figure~\ref{graph:win32-support},
\ifnum \Status = 1
on the left%
\else\ifnum \Status=2
at the top%
\else
on the left%
\fi\fi
). The links
in the tree are dependency links. Collections \emph{depend on}
packages and maybe other collections, and it is the same for each
package. You can select any package or collection individually, but
your request will be granted only if the object is not requested by
another one which is selected. For example, you can't deselect
\texttt{tex-basic} without deselecting all the collections that
request it.
The \texttt{tex-xemtex} collection displayed on the picture is Win32 specific. It
holds a number of bonus packages (Figure~\ref{graph:win32-support},
\ifnum \Status = 1
on the right%
\else\ifnum \Status=2
at the bottom%
\else
on the right%
\fi\fi
) which can be installed
automatically and individually: Ghostscript (the \PS{}
interpreter), XEmacs editor preconfigured for \TeX{}, tools like Perl,
ImageMagick, Ispell. \emph{None of these packages are selected by
default}.
On this page, you also have the information about disk space
needed, for each object, and for the set of those who are selected,
and also the disk space available on the partition selected for the
installation. Last, you can choose to install or not the
documentation files and source files associated with each package.
\item[Review Page]
You will find there a summary of your choices
(Figure~\ref{graph:review},
\ifnum \Status = 1
on the left%
\else\ifnum \Status=2
at the top%
\else
on the left%
\fi\fi
). It is still possible to
go back to change them.
\begin{figure*}[!htb]
Packages Page\hfill%
Win32 Support
\begin{center}
\ifnum \Status=1
\includegraphics[width=.48\textwidth]{pictures/package-selection}\hfill%
\includegraphics[width=.48\textwidth]{pictures/win32-support}
\else
\ifnum \Status=2
\includegraphics[bb=0 0 506 403]{pictures/package-selection.jpg}\hfill%
\includegraphics[bb=0 0 506 403]{pictures/win32-support.jpg}
\else
\includegraphics[width=.48\textwidth]{pictures/package-selection}%
\hfill%
\includegraphics[width=.48\textwidth]{pictures/win32-support}
\fi
\fi
\end{center}
\caption{Packages Page / Win32 goodies}
\label{graph:win32-support}
\end{figure*}
\item[Files Copy Page]
The selected files are copied on your hard disk (Figure~\ref{graph:file-copy},
\ifnum \Status = 1
on the right%
\else\ifnum \Status=2
at the bottom%
\else
on the right%
\fi\fi
). All the files not
yet available on your local disk are first downloaded from the
remote source directory on the Internet. Then every package is
unpacked (if \path|.zip| files), or copied from the \CD{}.
\item[Configuration Page] Several packages need some configuration
step to make them usable (Figure~\ref{graph:configuration},
\ifnum \Status = 1
on the left%
\else\ifnum \Status=2
at the top%
\else
on the left%
\fi\fi
). Also the \TL{} system needs some post-processing step
(format files generation, ls-R databases generation, environment
variables, etc.). All these operations are done there, some of them
can be lengthy.
\begin{figure*}[!htb]
\textbf{Review Page}\hfill%
\textbf{File Copy Page}
\begin{center}
\ifnum \Status=1
\includegraphics[width=.48\textwidth]{pictures/review-settings}\hfill%
\includegraphics[width=.48\textwidth]{pictures/file-copy}
\else
\ifnum \Status=2
\includegraphics[bb=0 0 506 403]{pictures/review-settings.jpg}\hfill%
\includegraphics[bb=0 0 506 403]{pictures/file-copy.jpg}
\else
\includegraphics[width=.48\textwidth]{pictures/review-settings}\hfill%
\includegraphics[width=.48\textwidth]{pictures/file-copy}%
\fi
\fi
\end{center}
\caption{Review Page / File Copy Page}
\label{graph:review}\label{graph:file-copy}
\end{figure*}
\item[Final Page] The installation being over, you may want to display
the Windows specific documentation (HTML format) and / or the log
file of the setup process (Figure~\ref{graph:final}
\ifnum \Status = 1
on the right%
\else\ifnum \Status=2
at the bottom%
\else
on the right%
\fi\fi
). If it is needed (Win9x/WinME), you will
be asked to reboot your computer.
\end{description}
\begin{figure*}[!htb]
\textbf{Configuration Page}\hfill%
\textbf{Final Page}
\begin{center}
\ifnum \Status=1
\includegraphics[width=.48\textwidth]{pictures/configuration}\hfill%
\includegraphics[width=.48\textwidth]{pictures/congratulations}
\else
\ifnum \Status=2
\includegraphics[bb=0 0 506 403]{pictures/configuration.jpg}\hfill%
\includegraphics[bb=0 0 506 403]{pictures/congratulations.jpg}
\else
\includegraphics[width=.48\textwidth]{pictures/configuration}\hfill%
\includegraphics[width=.48\textwidth]{pictures/congratulations}%
\fi
\fi
\end{center}
\caption{Configuration Page / Final page}
\label{graph:configuration}\label{graph:final}
\end{figure*}
Please be aware that the choice of cluster size on DOS disk
partitions can radically affect the size of your \TeX\
installation. The support tree has hundreds of small files, and it is
not unusual for a complete installation to take up to four times the
amount of space used on the \CD.
\end{comment}
\section{Windows maintenance and post-installation}
Although this version of \TL{} cannot be installed on Windows, enough of
this section is relevant to existing installations or cross-mounted
installations that it seemed worth leaving in.
It will be thoroughly updated when a complete \TL{} Windows distribution
is released. For now, please ignore references to
\filename{TeXSetup.exe}, etc.
\subsection{What's different in Windows?}
The Windows version of \Webc{} has some specific features that should be
pointed out.
\begin{description}
\item[\KPS{}] The hash-tables that \KPS{} builds are quite large for
the \TL{}. In order to cut down the starting time of any
\KPS{}-enabled program, these hash-tables have been put in shared
memory. This way, when you chain the execution of several such
programs, like \path|tex| calling \path|mpost| calling \path|tex|,
the overhead when starting each of the subprograms is
reduced. This change is hidden to the user, except if you set the
debug flag of kpathsea to the \path|-1| value: you will then trace
access to the shared memory, which is not what you want (it is
accessed very often!). What is useful in a log trace of the shared
memory access is still to be defined, so the situation might evolve
in the future.
\item[\cmdname{kpsecheck}] This command provides some options that did
not fit well into \cmdname{kpsewhich}. It will allow you to list all
the files that occur multiple times across your texmf trees. This
could be handy, but most of the time you will also get unwanted
output (like dozens of \path|README| files)\footnote{It is noticeable
that all these files result in clashes inside the \KPS{}-hashing
mechanism; fortunately, \KPS{} never looks for these files.}. For
this reason, you can combine the \path|-multiple-occurrences| with 2
other options for including or excluding any filename that match
some pattern (you can request for several patterns).
The \cmdname{kpsecheck} command will also report the status of shared
memory: in use or not used. That might be useful to know because if
the status reported is \samp{in use}, that means one or several
processes are working, and the effect of any \cmdname{mktexlsr}
command will be delayed until the next time where no \KPS{} linked
process will be running.
Last, this same command will report about the location it thinks
Ghostscript can be found. Under Win32, for many programs, it is
easier to use the Ghostscript dll, and find it by using the
Ghostscript registry key than to change the \path|PATH|, which has a
limited length anyway.
\item[\Webc{}] The engines have a few more options than in Unix
\Webc{}, and one option with a different behavior:
\begin{itemize}
\item \path|-halt-on-error| stop the compilation at the first error.
\item \path|-job-time| set the job time to the same timestamp as the
file given in argument.
\item \path|-oem| use the DOS codepage for console output.
\item \path|-output-directory| allow to write all the output files in the
specified directory.
\item \path|-time-statistics| print statistics about the job run
time. It is to be noted that Win9x not being a true multitasking
operating system, it has no reliable timer for short periods, so
the value printed is an approximation. Under NT/2K/XP, the result
is quite accurate with user time and system time values allocated
for this run. For Unix
users: the \path|time| command is not usually available to Windows
users.
\end{itemize}
\end{description}
\subsection{Adding packages to your installation}
You will find an option in the \guiseq{TeXLive} menu (or go to
\guiseq{Start\arw Programs \arw TeXLive \arw Add TeX package} menu) to
run \file{TeXSetup.exe} in maintenance mode. The steps are almost the
same as in the initial installation.
We'll discuss differences below, but first, whatever changes you make,
\textbf{do not forget to rebuild the ls-R database files}. Otherwise,
your new files will not be found. You can do this either via the
\acro{GUI} (\guiseq{Start \arw Programs \arw TeXLive \arw Maintenance
\arw Rebuild ls-R}), or manually running the \file{mktexlsr} command.
The main difference is in the packages selection page. In maintenance
mode, the list of installed packages is compared to the list of packages
available from your source directories. Packages that are not installed
will be displayed in green, out of date packages will be displayed in
red and up-to-date, installed packages are displayed in black.
This way, you can choose to add or upgrade components, either from
\TL{} or from the Internet, where you are likely to find some more
recent version of your packages.
It is up to you to select which packages you want to install. The rest
of the process is similar to the first installation.
If you want to add files that are not provided by the \TL{} (or
\fpTeX{}) distribution, it is recommended to put them in the
\path|$TEXMFLOCAL| directory. This way, you will be safe against
upgrades of the \TL{} software.
The directory pointed to by \path|$TEXMFLOCAL| is initially empty. If,
for example, you want to add the support file for the Maple symbolic
computation program, you will have to put the style files in:\\
\path|c:\Program Files\TeXLive\texmf-local\tex\latex\maple\|\\ and the
documentation files in:\\ \path|c:\Program
Files\TeXLive\texmf-local\doc\latex\maple\|
\subsection{Uninstalling \protect\TL{}}
The uninstall procedure is available either from the \file{TeXLive.exe}
program, from the \path|TeXLive| menu or from the control panel
(\guiseq{Start \arw Control Panel, Add/Remove Programs}). This procedure
will cleanup your hard disk of most of the \TL{} files. However,
\TeX{} is a system that is creating files and there is no mechanism to
keep track of all of them. Moreover, Win32 support packages have their
own uninstall procedure, which you will have to run separately (provided
you want to get rid of them). Last, the files you may have stored in
\path|$TEXMFLOCAL| won't be removed. So, even if the vast majority of
files are automatically removed by the uninstall procedure, you will
have to do some manual cleanup to actually remove all of them.
\subsection{Running \texttt{TeXSetup.exe} from the command line}
The \path|TeXSetup.exe| program has a number of other useful
options. You can get the list by running:
\begin{verbatim}
c:\>TeXSetup --help
\end{verbatim}
Here is the description:
\begin{description}
\item[\path|--automatic-reboot|] reboot without waiting user
confirmation once installation is over;
\item[\path|--dry-run|] do nothing, just log everything that will be
done without this option;
\item[\path|--quick|] use the recommended installation and default
directories, ask nothing up to rebooting;
\item[\path|--with-xemtex|] selects the \XEmTeX{} bundle;
\item[\path|--net-method (=ie5/direct)|] enable to download components with
restricted licenses from the Internet (either using direct
connection of Internet Explorer 5 DLLs): you need to have an available
network connection and some of the packages are huge;
\item[\path|--remote-source-directory <url>|] this is the base url for the remote packages;
\item[\path|--local-source-directory <dir>|] by default, \path|TeXSetup.exe|
will guess the root directory of the set of files you want it to act on, if you ever
upgrade \path|TeXSetup.exe|, you won't be able to copy the new version
onto your \CD{}, so you will need to use this option to specify the
root of the \CD{};
\item[\path|--installation-directory <dir>|] this is the root of your
installation, all files will be copied under this location. The
default value is \verb+c:\Program Files\TL+;
\item[\path|--texmfmain-directory <dir>|]
\item[\path|--texmflocal-directory <dir>|]
\item[\path|--texmfextra-directory <dir>|]
\item[\path|--texmfhome-directory <dir>|]
\item[\path|--vartexmf-directory <dir>|]
\item[\path|--vartexfonts-directory <dir>|] these are the directories
used to configure the location of your files. They map directly to
the \path|texmf.cnf| variables.
\item[\path|--with-source-files(=yes/no)|] copy the source files
for \TeX{} packages, default value is no;
\item[\path|--with-documentation-files(=yes/no)|] copy documentation files for \TeX{}
packages. Default value is yes. Beware: this is only documentation about specific
packages, general documentation will be installed anyway;
\item[\path|--program-folder <folder>|] the name of the folder under
which you will find the menus;
\item[\path|--add-package <pkg>|] this is used to add or update a specific
package after a first regular installation;
\item[\path|--scheme <pkg>|] install the named scheme instead of the
default \path|texlive-recommended| scheme;
\item[\path|--maintenance|] mostly the same as \path|--add-package|
without specifying a package to add;
\item[\path|--uninstall|] this option will remove anything \TeX{} related coming from
the \CD{}, which means there can be files left if you added style
files or format files, and also that supplementary tools will not be
removed. This option is still a bit crude in this release;
\item[\path|--help|] this option opens up a box with the list of options.
\end{description}
\subsection{Network installation}
\KPS{} knows about UNC names, so you can use them to get your TEXMF
tree from the network. But there is better than this.
All the support files and configuration files, everything except the files in the
\path|bin/win32| are shareable with a \teTeX{} or Unix \TL{} installation. That means
you can use Samba either to mount from an NT server to a Unix
workstation or the converse. Several strategies are possible:
\begin{itemize}
\item Put everything on the server. Just add each set of files for the os and
architecture you want to use in the \path|bin| directory. That means
for example \path|bin/win32| and \path|bin/i386-linux|. Next configure
your main variables. You can use UNC names to
point to the right directories under Win32.
\item Install a local copy for the binaries and format files. In this
case, assign \path|$TEXMFMAIN| to the main \path|texmf| tree that
will be accessed remotely. Set \path|$VARTEXMF| to be a local
directory which will hold local configuration files and on-the-fly
generated files.
\end{itemize}
\subsection{Personal configurations}
\subsubsection{Dvips}
The configuration file for dvips can be found in\\
\verb+C:\Program Files\TeXLive\texmf-var\dvips\config\config.ps+\\
You may open it with any editor
%(\cmdname{WinShell} will do fine)
and change some parameters:
\begin{description}
\item [fonts] you can change the default printer \MF{} mode or printer
resolution in case \cmdname{dvips} needs to generate PK fonts. By default it
is configured to use Type~1 versions of the CM fonts, so it should
not call \cmdname{mktexpk} too often;
\item[printer] you can tell dvips where you want to print by default. If
the \optname{o} option is not followed by a printer name, then a
\file{.ps} \PS{} file is written. You can give dvips a printer
name such as:
\begin{verbatim}
o lpt1:
% o | lpr -S server -P myprinter
% o \\server\myprinter
\end{verbatim}
\item[paper] Next, you might want
to change the paper size from European (A4) to US letter
by making the US letter the first paper size mentioned in the file.
Scroll to the group of lines beginning with \code{@}. Move
the appropriate lines so that this section begins with the lines:\\
\hspace*{1em} @ letterSize 8.5in 11in\\
\hspace*{1em} @ letter 8.5in 11in\\
\hspace*{1em} @+ \%\%BeginPaperSize: Letter\\
\hspace*{1em} @+ letter\\
\hspace*{1em} @+ \%\%EndPaperSize
\end{description}
The current \TL{} distribution implements the procedure of making
always up-to-date fontmaps files for Dvips and Pdftex. This is done by
the \cmdname{updmap} program during installation, as well as during any
font package addition. If you add new packages by hand, edit the file
\verb+updmap.cfg+ in \path|$VARTEXMF/web2c|.
\subsubsection{Pdftex}
If you use the program pdf{}latex to write \acro{PDF} format directly,
and you are using \acro{US} letter-size paper, edit the file
\verb+C:\Program Files\TeXLive\texmf-var\tex\generic\config\pdftexconfig.tex+ and
change \samp{\bs pdfpagewidth} and \samp{\bs pdfpageheight}. These entries should read:
\begin{alltt}
\bs{}pdfpagewidth=8.5 true in
\bs{}pdfpageheight=11 true in
\end{alltt}
Save the file and exit the editor.
\subsubsection{GSView}
GSView is now distributed under the Aladdin License, and therefore is no longer included in
\TL{}.
If you may want to change the page size to US letter size. If so, open
GSView from the \guiseq{Start} menu, and select \guiseq{Media\arw Letter}.
Also, there are menu settings that are supposed to give you the most
readable screen image. On \guiseq{Media \arw Display Settings}, set both
\optname{Text Alpha} and \optname{Graphics Alpha} to 4~bits.
Note that the installation process has set all \code{.ps} and
\code{.eps} files to automatically open with \cmdname{GSView}.
For printing instructions, see section~\ref{printing} below.
\subsubsection{WinDvi}
\label{sub:windvi}
The \file{TeXSetup.exe} program takes care of associating the files
with the \file{.dvi} extension with \file{Windvi}.
Open it with \guiseq{Start\arw Programs\arw TeXLive\arw DVI Viewer}.
You can set it for US letter-size paper by going to \guiseq{View\arw
Options\arw Papertype} and selecting US (8.5\verb+"+ x 11\verb+"+) (and
then \optname{OK}. Exit \cmdname{windvi}.
You can change other parameters from there as well, such as the ability
to execute system commands specified by the document (disabled by
default for security reasons). Also, the first time you view any .dvi
file, you may find the magnification too large. Zoom out until you get
an appropriate size.
%There are two important parameters related to printing that can't yet
%be set from the dialog boxes, namely the resolution and the \MF{} mode
%for the printer. You can set them once for all by specifying them on
%the command line:
%\begin{verbatim}
%c:\>windvi -p 360 -mfmode canonbjc foo.dvi
%\end{verbatim}
%When you will exit Windvi, these parameters will be stored in the
%configuration file. The available modes are found in this file:\\
%\path|c:\Program Files\TeXLive\texmf\metafont\misc\modes.mf|
All configuration settings for \cmdname{Windvi} are stored in a file
named \path|windvi.cnf| file. You can find it by running this command at
the prompt:
\begin{verbatim}
c:\>kpsewhich --expand-var $HOME/windvi.cnf
\end{verbatim}
Should you have problems with \cmdname{Windvi}, please remove the configuration
file and test your problem against a vanilla configuration.
\subsection{Testing}
For generic verification procedures, see section~\ref{sec:test-install}
(\p.\pageref{sec:test-install}). This section describes
Windows-specific tests.
Open the file \verb+sample2e.tex+ in your editor (Xemacs, WinShell),
found in \path|C:\Local\TeX\texmf\tex\latex\base|. The \LaTeX\ source
should appear on the screen. Process it by clicking on the
\guiseq{Command\arw LaTeX} menu (XEmacs) or \LaTeX\ icon on the toolbar
(WinShell), then view it by clicking on the \guiseq{Command\arw View DVI}
menu (XEmacs) or Preview (Windvi) icon (WinShell).
At first, when you preview files with Windvi, it will create fonts because
screen fonts were not installed. After a while, you will have created most
of the fonts you use, and you will rarely see the font-creation window.
\textbf{Hint for the future:} If a \LaTeX\ run stops because \LaTeX\
cannot find a file, you can press Ctrl-z to quit.
\subsection{Printing}
\label{printing}
It is possible to print from Windvi. In this case, printing will be done
using the Windows unified printer driver. By definition, it is
compatible with all printers. However, there is some drawback: it can
generate some huge spool files, and some (older) versions of Windows
just don't like them. The advantage is that you can use features like
embedding BMP or WMF images. You also need to make sure that the printer
parameters are correctly set (subsection~\ref{sub:windvi}), else you
will get scaled printing (printing at 600\dpi{} on a 300\dpi{} printer
will give you only one quadrant of your page).
Printing is faster and more reliable if you run \cmdname{dvips} to make
a \filename{.ps} file and then print from \cmdname{GSView}. In
\cmdname{GSview}, select \guiseq{File\arw Print\ldots}. A \guiseq{Print}
window will appear.
If you are using a \PS{} printer, \textit{be sure to select
\guiseq{\PS{} Printer}}. This is done in the \guiseq{Print Method} box
at the bottom left of the \guiseq{Print} window. You can then select any
of the printers that you have previously installed. If you fail to
check the box for \optname{\PS{} Printer}, printing will not work.
If you will be using your own non-\PS{} printer, select
\guiseq{Ghostscript device} in the \guiseq{Print Method} box, then click
on the button to the right labelled \guiseq{djet500} and select your
printer type from the list that pops up. (In the older version of
\cmdname{GSView}, make sure \optname{\PS{} Printer} is \textit{not}
selected, then select your printer type from the \guiseq{Device} list.)
\subsection{Tips and tricks for Win32}
\subsubsection{Different flavors of Win32}
What we call Win32 is not an operating system by itself. It is a large
set of functions (around 12,000 in the header files of the Microsoft
\acro{SDK}) that you can use to write programs for different operating
systems of the Windows family.
Windows comes in different flavors:
\begin{itemize}
\item Win95, Win98 and Win\acro{ME}, which \emph{are not true multitasking,
multithreading} environments. They are the latest\Dash and hopefully
last\Dash metamorphosis of \acro{DOS}. This can be more or less proven
by the fact that when booting, the PC will load the \path|command.com|
interpreter, and if you stop the boot process at this point, you can
ask for the current (\acro{DOS}) version and it will answer something
like \samp{MS-DOS 7.0} (at least for the old versions of Win9x).
\item Windows \acro{NT}, which is a new operating system written from
scratch, capable of true multitasking behavior, and including many
high level features.
\item Windows 2000, based on \acro{NT}, with all the bells and
whistles of Win98.
\item Windows \acro{XP}, which comes with Personal and Pro flavors. This is
the last step in merging both lines of products (Win9x based and
\acro{NT} based). \acro{XP} is based on \acro{NT}.
\end{itemize}
Win9x are able to run 32~bits programs and 16~bits programs
concurrently. But the operating system by itself is not entirely
written in 32~bits mode, and does not support memory protection: 16bits
applications can overwrite parts of the operating system memory! Some
parts of the system like the \acro{GDI} (Graphical Device Interface)
manage limited resources like bitmaps, fonts, pens and so on for the set
of all programs that run concurrently. All the bitmaps headers available
at the same time can't amount for more than 64kB. This explains the
performance tool and the fact that you can put your system on his knees
by making intensive use of graphic objects for example.
NT, 2K and XP do not suffer from these limitations, and neither from
other Win9x limitations. They are true multitasking environments, with
protected memory. They are much more responsive than Win9x because
of better memory management, better file system and so on.
\subsubsection{Command line prompt}
You may wonder, ``Why would I need to use a command line prompt when
I have Windows?''
Good question. The problem is of very general nature. Not all operations
can be done easily using only a \acro{GUI}. Command line gives you
programming power\Dash assuming a clever command interpreter.
But the problem here is more fundamental: \TeX{} is \emph{a batch}
tool. Not an interactive one. \TeX{} needs to compute the best
layout for each page, resolve cross-references and so on. This can be
done only by a global processing of the document. It is not (yet) a
task that can be done interactively.
This means that you should use \TeX{} from a command line. In fact the
situation is not so bad. There is an advantage to write command line
tools for complex processing: they are better debugged, because they are
independent of any \acro{GUI} problems, and \acro{GUI} tools can be
designed to interface to the command line tools. This is the case for
\TeX{}, where you will mostly interact with it through a \acro{GUI} text
editor.
However, you may need to use the command line prompt in a number of
situations. One is when you are having difficulties and want to debug
your setup.
\begin{description}
\item[Win9x] You can open a command line prompt by looking either for
the \acro{MS-DOS} icon in the \guiseq{Start\arw Programs} menu,
or by choosing \guiseq{Start\arw Run} menu typing in
\path|command.com| as the progrm name.
\item[NT, 2K, XP] You can open a command line prompt by looking for
\guiseq{Command Prompt} in the \guiseq{Start\arw Accessories} menu.
You can also choose \guiseq{Start\arw Run} and type in
\path|cmd.exe|, which is the name of the brand new command
interpreter for \acro{NT} (thus, it is untrue to call this a
\emph{DOS} box!).
\end{description}
These locations may change across different Windows versions.
\subsubsection{Path separators}
The Win32 API understands both \path|/| and \path|\| characters as PATH
separators. But the command interpreters do not! So whenever a path name
is used programmatically, you can use both separators, and even mix them
up in the same path name. But on the command line, you must type
\path|\| as path separator. The reason is compatibility: the command
processor used \samp{/} to introduce arguments to commands.
All this to say: do not be surprised to read path names written using
the Unix convention; \fpTeX{} is a port of \Webc, and aims to be compatible
across platforms. For this reason, all the configuration files that
need to specify path names use the Unix convention.
\subsubsection{File systems}
\label{sec:clusters}
The worst feature of Win9x with regard to \TeX{} is probably the
so-called FAT file system. \TeX{} uses very many small files, with size
around 1--3kB. The \acro{FAT} file system is old, and predates by
decades the multi-gigabytes hard disks we have today. As a result, it
cannot manage efficiently the tens of thousands of \TeX{} files found in
\TL{}. The \acro{FAT} file system allocates a minimum of 32kB for
\emph{any} file on a huge partition. It means that \TeX{} will use much
more disk space than it actually needs.
The other, more modern, file systems available, \acro{FAT32} and
\acro{NTFS}, do not have this drawback. They manage clusters of 4kB
only. (You can lower the limit to 512 bytes on \acro{NTFS}.)
\subsubsection{How to add some directory to your PATH}
There are pairs of variables and values which behave much like global
variables inside your programs. The set of those variables is called the
environment. Each program is initialized with a copy of the
environment when it is run. It can request and change the
value of any variable. The changes happen in the copy of the
environment, and is not at all propagated to the other running
programs.
Your PATH is a special environment variable used to search for
programs you want to run.
There is a different procedure to change it for Win9x, WinME and NT/2K/XP:
\begin{description}
\item[Windows 95/98] Edit your \path|autoexec.bat|. In this file should be a line
starting with \texttt{PATH=} and followed by a list of directories separated
by \path|;|. Please add the directory with the executables in this line.
After this, this line could look as follows:
\begin{verbatim}
PATH=c:\windows;c:\windows\system;c:\"Program Files"\TL\bin\win32
\end{verbatim}
\item[Windows ME] You need to run the special program
\path|c:\windows\system\msconfig.exe| to be able to change any
environment variable. From this program, select the `Environment'
tab, and then add or modify the variable you want. You will be asked to reboot the
machine upon any change.
\item[Windows NT/2K/XP]
Click left on \guiseq{Start \arw Settings \arw Control Panel}. Now the
window with the control panel icons opens. Double click on System. The
System Properties window opens. Click on the tab \textsf{Environment}
or look for a button named \guiseq{Environment Variables} among the
dialog boxes. Now you can change the environment variables for your
user account. Note: There are also displayed the environment settings
for the system. Normally, you can't change the system variables
unless you have administrator rights on your machine. If you want to
change the \texttt{PATH} for all users, you will have to contact your
system administrator or be the system administrator yourself\Dash in
the latter case you should know what you are doing.
If there is already a \texttt{PATH} setting for your user account,
left click on \texttt{PATH}. In the field \textsf{Variable} appears
\texttt{PATH} while the field Value shows the current setting of
\texttt{PATH} as a list of directories separated by \path|;|. Add
the directory where the executables are located (e.g.
\path|c:\Program Files\TeXLive\bin\win32|). If there isn't a \texttt{PATH} variable
for your user account, simply click in the field Variable and type
in \texttt{PATH}, click in the field \textsf{Value}
and type in the directory with the executables. Important: Click on
the \textsf{Apply} button before clicking \textsf{Ok}, otherwise the
changes to \texttt{PATH} won't apply to your system. Be careful when
changing the environment settings.
\end{description}
The best way to be sure that a variable has been properly set is to
open a console and type:
\begin{verbatim}
set VARIABLE
\end{verbatim}
which should return the corresponding value.
\subsubsection{\TeX{} engines}
If you have a look at the \Webc{} documentation, you will read that all
the various \TeX{} derived programs use the same base engine. For
example, \path|tex.exe| and \path|latex.exe| are exact copies of the
same program, but each one will use a different format file, based on
its calling name.
Under Unix, this feature is implemented through \emph{symbolic
links}. It saves up a bit of disk space, because some engines are
used with many different format files.
The Win32 API does not know about file links. So to save up almost
the same amount of memory, all the \TeX{} base engines have been put
in DLLs (\emph{Dynamic Linked Library}). This means that you will have
the following layout:
\begin{alltt}
13/05/2002 17:06 3 584 latex.exe
13/05/2002 17:06 266 240 tex.dll
13/05/2002 17:06 3 584 tex.exe
\end{alltt}
and the \path|latex.exe| file is nothing but a rough copy of
\path|tex.exe| using the same core \path|tex.dll|.
The same trick has been used for the \path|mktex*.exe| family of programs which are
linked to the \path|mktex.dll| library.
In fact, a generic tool called \path|lnexe.exe| is provided to build the
equivalent of Unix hard links for executable files only under Win32.
\subsection{In case of problems}
\label{sec:troubleshooting}
\subsubsection{What to do if \texttt{latex} does not find your files?}
\begin{itemize}
\item \cmdname{kpsewhich} is the tool of choice to debug any
problem. Unfortunately, \cmdname{kpsewhich} outputs debug information
to stderr, and the Windows console does not know how to redirect stderr
to a file\footnote{Well, NT and Win2k consoles know how to do that. But
the trick will work for any console.}. For diagnostic purposes you can
temporarily set an environment variable (in a \acro{DOS} box):
\begin{verbatim}
SET KPATHSEA_DEBUG_OUTPUT=err.log
\end{verbatim}
You can also set the debug level:
\begin{verbatim}
SET KPATHSEA_DEBUG=-1
\end{verbatim}
If you want to redirect stderr to stdout, which is not possible
Windows, then do:
\begin{verbatim}
SET KPATHSEA_DEBUG_OUTPUT=con:
\end{verbatim}
This way you can capture both stdout and stderr in the same file.
\item Assuming the installation has been done in \path|c:/Program Files/TeXLive|, check
the following values: \\
{\small
\begin{tabular}{ll}
\path|kpsewhich -expand-path $SELFAUTOPARENT| & \path|c:/Program Files/TeXLive| \\
\path|kpsewhich -expand-path $TEXMF| & \path|c:/Program Files/TeXLive/texmf| \\
\path|kpsewhich -expand-path $TEXMFCNF| &
\path|.;c:/Program Files/TeXLive/texmf/web2c;| \\
& \path|c:/Program Files/TeXLive/bin/win32;| \\
& \path|c:/Program Files/TeXLive/bin;| \\
& \path|c:/Program Files/TeXLive| \\
\path|kpsewhich -expand-var $TEXINPUTS| & \path|.;c:/Program Files/TeXLive/texmf/tex//|
\end{tabular}
}
\item If you have other \TeX{}-related values already set in your
environment, please, remove them. They are overriding the ones in
texmf.cnf.
\item Check the values from:\\
{\small
\begin{tabular}{ll}
\texttt{kpsewhich cmr10.tfm} & \path|c:/Program Files/TeXLive/texmf/fonts/tfm/public/cm/cmr10.tfm|\\
\texttt{kpsewhich latex.fmt}& \path|c:/Program Files/TeXLive/texmf/web2c/latex.fmt|
\end{tabular}
}
\item At this point, if everything is correct, \TeX{} and friends
should work. If it is not the case, you will need to play with
the \path|-debug=n| option from \path|kpsewhich|, and check back all
the values. Try to identify and report the problem.
\end{itemize}
\subsubsection{What to do if your setup still does not work as expected?}
Here are several questions to investigate:
\begin{enumerate}
\item Is \file{tex.exe} in my \path|PATH|?
\item Is the \path|TEXMFCNF| variable correctly set to
\path|c:/Program Files/TeXLive/texmf-var/web2c| (default value)?
\item Are there any errors in the log file generated by the
\file{TeXSetup.exe} program? You can find this by searching for the
string \samp{Error}.
\item Are there any relevant bug fixes at \url{http://tug.org/texlive/}?
(Unlikely, but it doesn't hurt to check.)
\item Check the web pages at
\url{http://www.fptex.org/}, or consider subscribing to the \fpTeX{}
mailing list, via \url{http://tug.org/mailman/listinfo/fptex}.
\end{enumerate}
The \TL{} software consists of hundreds of programs and tens of
thousands of files, all from varying sources. So it is quite difficult to
predict all possible causes for problems. Nevertheless, we will do our
best to help you. (See section~\ref{sec:help}, \p.\pageref{sec:help}.)
\subsection{Compiling the source files}
The whole set of source files is available in the distribution as the
\path|source/source.tar.bz2| archive, together with a separate source
archive for Windows. To be able to compile the whole distribution for
Windows, you will need:
\begin{itemize*}
\item Windows 2K/XP
\item Microsoft Visual Studio .Net 2003
\item a set of Unix tools (\texttt{sed},
\texttt{grep}, \texttt{gawk}, etc.) and also Perl, Flex and Bison,
\item to adjust the paths in the
\path|win32/make/common.mak| file according to your installation
\item to adjust the paths in the Perl script file
\path|win32/perl/build.pl|,
\item run the compilation from the \path|mswin32/| directory using this
command:
\begin{verbatim}
c:\texlive\source\mswin32>perl ./perl/build.pl --install --log=install.log
\end{verbatim}
\end{itemize*}
There is a lot of work to do to make this process easier and cleaner.
\subsection{Where to get more information}
The Windows \TeX{} system included on \TL{} is also known as
\fpTeX. The packaging differs, but \fpTeX{} is no more no less than the
current \TL\ release for Windows.
The \fpTeX{} home page is \url{http://www.fptex.org}.
The current \fpTeX release is available from any \CTAN site in
\url{htp://www.ctan.org/tex-archive/systems/win32/fptex}.
The main ftp site for \fpTeX\ is \url{ftp://ftp.dante.de/pub/fptex/}
from where beta versions of \fpTeX\ and additionnal tools are available.
This main site is (partially) mirrored daily by all \CTAN{} sites at
\path|systems/win32/fptex|.
The \TeX{} Users Group is kindly hosting a mailing list dedicated to
\fpTeX. It is used for announcements, bug reports, enhancement requests,
and general discussion about \fpTeX. To subscribe, visit
\url{http://tug.org/mailman/listinfo/fptex}. The mailing list
address is \email{fptex@tug.org}.
% don't use \Webc so the \uppercase in the headline works.
\section{A user's guide to Web2C}
\Webc{} is an integrated collection of \TeX-related programs: \TeX{}
itself, \MF{}, \MP, \BibTeX{}, etc. It is the heart of \TL{}.
A bit of history: The original implementation was by Tomas Rokicki who,
in 1987, developed a first \TeX{}-to-C system based on change files
under Unix, which were primarily the original work of Howard Trickey and
Pavel Curtis. Tim Morgan became the maintainer of the system, and
during this period the name changed to Web-to-C\@. In 1990, Karl Berry
took over the work, assisted by dozens of additional contributors, and
in 1997 he handed the baton to Olaf Weber.
The \Webc{} system runs on Unix, 32-bit Windows systems, \MacOSX{}, and
other operating systems. It uses Knuth's original sources for \TeX{} and
other basic programs written in \web{} and translates them into C source
code. The core \TeX{} programs are:
\begin{cmddescription}
\item[bibtex] Maintaining bibliographies.
\item[dmp] \cmdname{troff} to MPX (\MP{} pictures).
\item[dvicopy] Expands virtual font references in \dvi{} files.
\item[dvitomp] \dvi{} to MPX (MetaPost pictures).
\item[dvitype] \dvi{} to human-readable text.
\item[gftodvi] Generic font proofsheets.
\item[gftopk] Generic to packed fonts.
\item[gftype] GF to human-readable text.
\item[makempx] \MP{} label typesetting.
\item[mf] Creating typeface families.
\item[mft] Prettyprinting \MF{} source.
\item[mpost] Creating technical diagrams.
\item[mpto] MetaPost label extraction.
\item[newer] Compare modification times.
\item[patgen] Creating hyphenation patterns.
\item[pktogf] Packed to generic fonts.
\item[pktype] PK to human-readable text.
\item[pltotf] Plain text property list to TFM.
\item[pooltype] Display \web{} pool files.
\item[tangle] \web{} to Pascal.
\item[tex] Typesetting.
\item[tftopl] TFM to plain text property list.
\item[vftovp] Virtual font to virtual property list.
\item[vptovf] Virtual property list to virtual font.
\item[weave] \web{} to \TeX.
\end{cmddescription}
\noindent The precise functions and syntax of these programs are
described in the documentation of the individual packages and of \Webc{}
itself. However, knowing a few principles governing the whole family of
programs will help you take advantage of your \Webc{} installation.
All programs honor these standard \acro{GNU} options:
\begin{ttdescription}
\item[-{}-help] print basic usage summary.
\item[-{}-verbose] print detailed progress report.
\item[-{}-version] print version information, then exit.
\end{ttdescription}
For locating files the \Webc{} programs use the path searching library
\KPS{}. This library uses a combination of environment variables and a
configuration files to optimize searching the (huge) collection of
\TeX{} files. \Webc{} can look at more than one directory tree
simultaneously, which is useful in maintaining \TeX's standard
distribution and local extensions in two distinct trees. To speed up
file searches the root of each tree has a file \file{ls-R}, containing
an entry showing the name and relative pathname for all files under that
root.
\subsection{Kpathsea path searching}
Let us first describe the generic path searching mechanism of the \KPS{}
library.
We call a \emph{search path} a colon- or semicolon\hyph sepa\-rated list
of \emph{path elements}, which are basically directory names. A
search path can come from (a combination of) many sources. To look up
a file \samp{my-file} along a path \samp{.:/dir}, \KPS{} checks each
element of the path in turn: first \file{./my-file}, then
\file{/dir/my-file}, returning the first match (or possibly all
matches).
In order to adapt optimally to all operating systems' conventions, on
non-Unix systems \KPS{} can use filename separators different from
colon (\samp{:}) and slash (\samp{/}).
To check a particular path element \var{p}, \KPS{} first checks if a
prebuilt database (see ``Filename data\-base'' on
page~\pageref{Filename-database}) applies to \var{p}, i.e., if the database
is in a directory that is a prefix of \var{p}. If so, the path
specification is matched against the contents of the database.
If the database does not exist, or does not apply to this path
element, or contains no matches, the filesystem is searched (if this
was not forbidden by a specification starting with \samp{!!}\ and if
the file being searched for must exist). \KPS{} constructs the list
of directories that correspond to this path element, and then checks
in each for the file being sought.
The ``file must exist'' condition comes into play with \samp{.vf} files and
input files read by \TeX's \cs{openin} command. Such files may not
exist (e.g., \file{cmr10.vf}), and so it would be wrong to search the
disk for them. Therefore, if you fail to update \file{ls-R} when you
install a new \samp{.vf} file, it will never be found.
Each path element is checked in turn: first the database, then the
disk. If a match is found, the search stops and the result is
returned.
Although the simplest and most common path element is a directory
name, \KPS{} supports additional features in search paths: layered
default values, environment variable names, config file values, users'
home directories, and recursive subdirectory searching. Thus, we say
that \KPS{} \emph{expands} a path element, meaning it transforms all
the specifications into basic directory name or names. This is
described in the following sections in the same order as it takes
place.
Note that if the filename being searched for is absolute or explicitly
relative, i.e., starts with \samp{/} or \samp{./} or \samp{../},
\KPS{} simply checks if that file exists.
\ifSingleColumn
\else
\begin{figure*}
\verbatiminput{examples/ex5.tex}
\setlength{\abovecaptionskip}{0pt}
\caption{An illustrative configuration file sample}
\label{fig:config-sample}
\end{figure*}
\fi
\subsubsection{Path sources}
\label{Path-sources}
A search path can come from many sources. In the order in which
\KPS{} uses them:
\begin{enumerate}
\item
A user-set environment variable, for instance, \envname{TEXINPUTS}\@.
Environment variables with a period and a program name appended
override; e.g., if \samp{latex} is the name of the program being run,
then \envname{TEXINPUTS.latex} will override \envname{TEXINPUTS}.
\item
A program-specific configuration file, for exam\-ple, a line
\samp{S /a:/b} in \cmdname{dvips}'s \file{config.ps}.
\item A \KPS{} configuration file \file{texmf.cnf}, containing a line like
\samp{TEXINPUTS=/c:/d} (see below).
\item The compile-time default.
\end{enumerate}
\noindent You can see each of these values for a given
search path by using the debugging options (see ``Debugging actions''
on page~\pageref{Debugging}).
\subsubsection{Config files}
\begingroup\tolerance=3500
\KPS{} reads \emph{runtime configuration files} named \file{texmf.cnf}
for search path and other definitions. The search path used to look
for these files is named \envname{TEXMFCNF} (by default such a file lives
in the \file{texmf/web2c} subdirectory). \emph{All}
\file{texmf.cnf} files in the search path will be read and definitions
in earlier files override those in later files. Thus, with a search
path of \verb|.:$TEXMF|, values from \file{./texmf.cnf} override those
from \verb|$TEXMF/texmf.cnf|.
\endgroup
\begin{itemize}
\item
Comments start with \code{\%} and continue to the end of the line.
\item
Blank lines are ignored.
\item
A \bs{} at the end of a line acts as a continuation character,
i.e., the next line is appended. Whitespace at the beginning of
continuation lines is not ignored.
\item
Each remaining line has the form:
\begin{alltt}
\var{variable}[.\var{progname}] [=] \var{value}
\end{alltt}%
where the \samp{=} and surrounding whitespace are optional.
\item
The \ttvar{variable} name may contain any character other
than whitespace, \samp{=}, or \samp{.}, but sticking to
\samp{A-Za-z\_} is safest.
\item
If \samp{.\var{progname}} is present, the definition only
applies if the program that is running is named
\texttt{\var{progname}} or \texttt{\var{progname}.exe}. This allows
different flavors of \TeX{} to have different search paths, for
example.
\item \var{value} may contain any characters except
\code{\%} and \samp{@}. The
\code{\$\var{var}.\var{prog}} feature is not available on the
right-hand side; instead, you must use an additional variable. A
\samp{;}\ in \var{value} is translated to \samp{:}\ if
running under Unix; this is useful to be able to have a single
\file{texmf.cnf} for Unix, \acro{MS-DOS} and Windows systems.
\item
All definitions are read before anything is expanded, so
variables can be referenced before they are defined.
\end{itemize}
A configuration file fragment illustrating most of these points is
\ifSingleColumn
shown below:
\verbatiminput{examples/ex5.tex}
\else
shown in Figure~\ref{fig:config-sample}.
\fi
\subsubsection{Path expansion}
\label{Path-expansion}
\KPS{} recognizes certain special characters and constructions in
search paths, similar to those available in Unix shells. As a
general example, the complex path,
\verb+~$USER/{foo,bar}//baz+, expands to all subdirectories under
directories \file{foo} and \file{bar} in \texttt{\$USER}'s home
directory that contain a directory or file \file{baz}. These
expansions are explained in the sections below.
%$
\subsubsection{Default expansion}
\label{Default-expansion}
\tolerance=2500
If the highest-priority search path (see ``Path sources'' on
page~\pageref{Path-sources}) contains an \emph{extra colon} (i.e.,
leading, trailing, or doubled), \KPS{} inserts at that point the
next-highest-prio\-rity search path that is defined. If that inserted
path has an extra colon, the same happens with the next highest. For
example, given an environment variable setting
\tolerance=1500
\begin{alltt}
> \Ucom{setenv TEXINPUTS /home/karl:}
\end{alltt}
and a \code{TEXINPUTS} value from \file{texmf.cnf} of
\begin{alltt}
.:\$TEXMF//tex
\end{alltt}
then the final value used for searching will be:
\begin{alltt}
/home/karl:.:\$TEXMF//tex
\end{alltt}
Since it would be useless to insert the default value in more than one
place, \KPS{} changes only one extra \samp{:}\ and leaves any others in
place. It checks first for a leading \samp{:}, then a trailing
\samp{:}, then a doubled \samp{:}.
\subsubsection{Brace expansion}
A useful feature is brace expansion, which means that, for instance,
\verb+v{a,b}w+ expands to \verb+vaw:vbw+. Nesting is allowed.
This can be used to implement multiple \TeX{} hierarchies, by
assigning a brace list to \code{\$TEXMF}.
For example, in \file{texmf.cnf}, you find
the following definition:
\begin{verbatim}
TEXMF = {$HOMETEXMF,$TEXMFLOCAL,!!$VARTEXMF,!!$TEXMFMAIN}
\end{verbatim}
Using this you can then write something like
\begin{verbatim}
TEXINPUTS = .;$TEXMF/tex//
\end{verbatim}
%$
which means that, after looking in the current directory, the
\code{\$HOMETEXMF/tex}, \code{\$TEXMFLOCAL/tex}, \code{\$VARTEXMF/tex}
and \code{\$TEXMFMAIN/tex} trees \emph{only}) will be searched (the
last two use using \file{ls-R} data base files). It is a convenient
way for running two parallel \TeX{} structures, one ``frozen'' (on a
\CD, for instance) and the other being continuously updated with new
versions as they become available. By using the \code{\$TEXMF}
variable in all definitions, one is sure to always search the
up-to-date tree first.
\subsubsection{Subdirectory expansion}
\label{Subdirectory-expansion}
Two or more consecutive slashes in a path element following a directory
\var{d} is replaced by all subdirectories of \var{d}: first those
subdirectories directly under \var{d}, then the subsubdirectories under
those, and so on. At each level, the order in which the directories are
searched is \emph{unspecified}.
If you specify any filename components after the \samp{//}, only
subdirectories with matching components are included. For example,
\samp{/a//b} expands into directories \file{/a/1/b}, \file{/a/2/b},
\file{/a/1/1/b}, and so on, but not \file{/a/b/c} or \file{/a/1}.
Multiple \samp{//} constructs in a path are possible, but
\samp{//} at the beginning of a path is ignored.
\subsubsection{List of special characters and their meaning: a summary}
The following list summarizes the special characters in \KPS{}
configuration files.
% need a wider space for the item labels here.
\newcommand{\CODE}[1]{\makebox[3em][l]{\code{#1}}}
\begin{ttdescription}
\item[\CODE{:}] Separator in path specification; at the beginning or
the end of a path it substitutes the default path expansion.\par
\item[\CODE{;}] Separator on non-Unix systems (acts like \code{:}).
\item[\CODE{\$}] Variable expansion.
\item[\CODE{\string~}] Represents the user's home directory.
\item[\CODE{\char`\{...\char`\}}] Brace expansion.
\item[\CODE{//}] Subdirectory expansion (can occur anywhere in
a path, except at its beginning).
\item[\CODE{\%}] Start of comment.
\item[\CODE{\bs}] Continuation character (allows multi-line entries).
\item[\CODE{!!}] Search \emph{only} database to locate file, \emph{do
not} search the disk.
\end{ttdescription}
\subsection{Filename databases}
\label{Filename-database}
\KPS{} goes to some lengths to minimize disk accesses for searches.
Nevertheless, at installations with enough directories, searching each
possible directory for a given file can take an excessively long time
(this is especially true if many hundreds of font directories have to
be traversed.) Therefore, \KPS{} can use an externally-built plain text
``database'' file named \file{ls-R} that maps files to directories,
thus avoiding the need to exhaustively search the disk.
A second database file \file{aliases} allows you to give additional
names to the files listed in \file{ls-R}. This can be helpful to
confirm to \acro{DOS} 8.3 filename conventions in source files.
\subsubsection{The filename database}
\label{ls-R}
As explained above, the name of the main filename database must be
\file{ls-R}. You can put one at the root of each \TeX{} hierarchy in
your installation that you wish to be searched (\code{\$TEXMF} by
default); most sites have only one hierarchy. \KPS{} looks for
\file{ls-R} files along the \code{TEXMFDBS} path.
The recommended way to create and maintain \samp{ls-R} is to run the
\code{mktexlsr} script included with the distribution. It is invoked
by the various \samp{mktex}\dots\ scripts. In principle, this script
just runs the command
\begin{alltt}
cd \var{/your/texmf/root} && \path|\|ls -1LAR ./ >ls-R
\end{alltt}
presuming your system's \code{ls} produces the right output format
(\acro{GNU} \code{ls} is all right). To ensure that the database is
always up-to-date, it is easiest to rebuild it regularly via
\code{cron}, so that it is automatically updated when the installed
files change, such as after installing or updating a \LaTeX{} package.
If a file is not found in the database, by default \KPS{} goes ahead
and searches the disk. If a particular path element begins with
\samp{!!}, however, \emph{only} the database will be searched for that
element, never the disk.
\subsubsection{kpsewhich: Standalone path searching}
\label{Invoking-kpsewhich}
The \texttt{kpsewhich} program exercises path searching independent of any
particular application. This can be useful as a sort of \code{find}
program to locate files in \TeX{} hierarchies (this is used heavily in
the distributed \samp{mktex}\dots\ scripts).
\begin{alltt}
> \Ucom{kpsewhich \var{option}\dots{} \var{filename}\dots{}}
\end{alltt}
The options specified in \ttvar{option} start with either \samp{-}
or \samp{-{}-}, and any unambiguous abbreviation is accepted.
\KPS{} looks up each non-option argument on the command line as a
filename, and returns the first file found. There is no option to
return all the files with a particular name (you can run the Unix
\samp{find} utility for that).
The more important options are described next.
\begin{ttdescription}
\item[\texttt{-{}-dpi=\var{num}}]\mbox{}
Set the resolution to \ttvar{num}; this only affects \samp{gf}
and \samp{pk} lookups. \samp{-D} is a synonym, for compatibility
with \cmdname{dvips}. Default is 600.
\item[\texttt{-{}-format=\var{name}}]\mbox{}\\
Set the format for lookup to \ttvar{name}. By default, the
format is guessed from the filename. For formats which do not have
an associated unambiguous suffix, such as \MP{} support files and
\cmdname{dvips} configuration files, you have to specify the name as
found in the first column of table~\ref{tab:kpathsea}, which lists
currently recognized names, a description, possible file extensions,
and associated environment variables.
\end{ttdescription}
\def\KpathKey#1#2#3#4#5{% name, number, description, variables,
% suffixes
\SetRowColor#1 & #3 & #4 & #5\\}
\def\HEAD#1{\multicolumn{1}{l}{\emph{#1}}}
%
\begin{small}
% a footnoterule immediately under a bottom-of-page rule looks dead
% silly, so we suppress it
\renewcommand\footnoterule{\relax}
%
\begin{longtable}{@{}%
>{\ttfamily}P{.16\textwidth}% Col.1
P{.3\textwidth}% Col 2
>{\ttfamily\footnotesize}P{.29\textwidth}% Col 3
>{\ttfamily}P{.14\textwidth}% Col 4
@{}}
\caption{Kpathsea file types.}\label{tab:kpathsea}\\
\emph{Name} & \HEAD{Description} & \HEAD{Variables}
& \HEAD{Suffixes}\\
\hline
\endfirsthead
\multicolumn{3}{l}{Kpathsea file types \emph{continued}}\\
\emph{Name} & \HEAD{Description} & \HEAD{Variables}
& \HEAD{Suffixes}\\
\hline
\noalign{\vspace{2pt}}
\endhead
\mbox{}\\
\hline
\endfoot
\KpathKey
{afm}
{4}
{Adobe font metrics}
{AFMFONTS}
{.afm}
\KpathKey
{base}
{5}
{Metafont memory dump}
{MFBASES, TEXMFINI}
{.base}
\KpathKey
{bib}
{6}
{\BibTeX{} bibliography source}
{BIBINPUTS, TEXBIB}
{.bib}
\KpathKey
{}
{2}
{bitmap fonts}
{GLYPHFONTS, TEXFONTS}
{}
\KpathKey
{bst}
{7}
{\BibTeX{} style files}
{BSTINPUTS}
{.bst}
\KpathKey
{cnf}
{8}
{Runtime configuration files}
{TEXMFCNF}
{.cnf}
\KpathKey
{dvips config}
{34}
{\textsf{dvips} configuration files, e.g., \file{config.ps}}
{TEXCONFIG}
{}
\KpathKey
{enc}
{34}
{Font encoding files}
{ENCFONTS}
{.enc}
\KpathKey
{fmt}
{10}
{\TeX{} memory dump}
{TEXFORMATS, TEXMFINI}
{.fmt, .efmt, .efm}
\KpathKey
{gf}
{0}
{generic font bitmap}
{GFFONTS}
{.gf}
\KpathKey
{graphic/figure}
{25}
{Encapsulated \PS{} figures}
{TEXPICTS, TEXINPUTS}
{.eps, .epsi}
\KpathKey
{ist}
{35}
{\textsf{makeindex} style files}
{TEXINDEXSTYLE, INDEXSTYLE}
{.ist}
\KpathKey
{ls-R}
{9}
{Filename databases}
{TEXMFDBS}
{}
\KpathKey
{map}
{11}
{Fontmaps}
{TEXFONTMAPS}
{.map}
\KpathKey
{mem}
{12}
{MetaPost memory dump}
{MPMEMS, TEXMFINI}
{.mem}
\KpathKey
{mf}
{13}
{Metafont source}
{MFINPUTS}
{.mf}
\KpathKey
{mfpool}
{14}
{Metafont program strings}
{MFPOOL, TEXMFINI}
{.pool}
\KpathKey
{mft}
{15}
{MFT style file}
{MFTINPUTS}
{.mft}
\KpathKey
{}
{41}
{miscellaneous fonts}
{MISCFONTS}
{}
\KpathKey
{mp}
{16}
{MetaPost source}
{MPINPUTS}
{.mp}
\KpathKey
{mppool}
{17}
{MetaPost program strings}
{MPPOOL, TEXMFINI}
{.pool}
\KpathKey
{MetaPost support}
{18}
{MetaPost support files, used by DMP}
{MPSUPPORT}
{}
\KpathKey
{ocp}
{19}
{\OMEGA{} compiled process files}
{OCPINPUTS}
{.ocp}
\KpathKey
{ofm}
{20}
{\OMEGA{} font metrics}
{OFMFONTS, TEXFONTS}
{.ofm, .tfm}
\KpathKey
{opl}
{21}
{\OMEGA{} property lists}
{OPLFONTS, TEXFONTS}
{.opl}
\KpathKey
{otp}
{22}
{\OMEGA{} translation process files}
{OTPINPUTS}
{.otp}
\KpathKey
{ovf}
{23}
{\OMEGA{} virtual fonts}
{OVFFONTS, TEXFONTS}
{.ovf}
\KpathKey
{ovp}
{24}
{\OMEGA{} virtual property lists}
{OVPFONTS, TEXFONTS}
{.ovp}
\KpathKey
{pdftex config}
{18}
{\textsf{pdftex} configuration files}
{PDFTEXCONFIG}
{}
\KpathKey
{pk}
{1}
{packed bitmap fonts}
{\var{program}FONTS \textrm{(\texttt{\var{program}} being
\textsmaller{\cmdname{XDVI}},
etc.)}, PKFONTS, TEXPKS, GLYPHFONTS, TEXFONTS}
{.pk}
\KpathKey
{\PS{} header}
{30}
{downloadable \PS{}}
{TEXPSHEADERS, PSHEADERS}
{.pro, .enc}
\KpathKey
{tex}
{26}
{\TeX{} source}
{TEXINPUTS}
{.tex, .cls, .sty, .clo, .def}
\KpathKey
{texmfscripts}
{20}
{Scripts distributed in the \file{texmf} tree}
{TEXMFSCRIPTS}
{}
\KpathKey
{TeX system documentation}
{27}
{Documentation files for the \TeX{} system}
{TEXDOCS}
{}
\KpathKey
{TeX system sources}
{29}
{Source files for the \TeX{} system}
{TEXSOURCES}
{}
\KpathKey
{texpool}
{28}
{\TeX{} program strings}
{TEXPOOL, TEXMFINI}
{.pool}
\KpathKey
{tfm}
{3}
{\TeX{} font metrics}
{TFMFONTS, TEXFONTS}
{.tfm}
\KpathKey
{Troff fonts}
{31}
{Troff fonts, used by DMP}
{TRFONTS}
{}
\KpathKey
{truetype fonts}
{36}
{TrueType outline fonts}
{TTFONTS}
{.ttf, .ttc}
\KpathKey
{Type~1 fonts}
{32}
{Type 1 \PS{} outline fonts}
{T1FONTS, T1INPUTS, TEXPSHEADERS, DVIPSHEADERS}
{.pfa, .pfb}
\KpathKey
{type42 fonts}
{37}
{Type 42 \PS{} outline fonts}
{T42FONTS}
{}
\KpathKey
{vf}
{33}
{virtual fonts}
{VFFONTS, TEXFONTS}
{.vf}
\KpathKey
{web2c files}
{38}
{\Webc{} support files}
{WEB2C}
{}
\KpathKey
{other text files}
{39}
{text files used by `\textsf{foo}'}
{FOOINPUTS}
{}
\KpathKey
{other binary files}
{40}
{binary files used by `\textsf{foo}'}
{FOOINPUTS}
{}
\end{longtable}
\end{small}
\begin{multicols}{2}
The last two entries in table~\ref{tab:kpathsea} are special
cases, where the paths and environment variables depend on the name
of the program: the variable name is constructed by converting the
program name to upper case, and then appending \texttt{INPUTS}.
The environment variables are set by default in the configuration
file \file{texmf.cnf}. It is only when you want to override one or
more of the values specified in that file that you might want to set
them explicitly in your execution environment.
The \samp{-{}-format} and \samp{-{}-path} options are mutually
exclusive.
\begin{ttdescription}
\item[\texttt{-{}-mode=\var{string}}]\mbox{}\\
Set the mode name to \ttvar{string}; this only affects \samp{gf}
and \samp{pk} lookups. No default: any mode will be found.
\item[\texttt{-{}-must-exist}]\mbox{}\\
Do everything possible to find the files, notably including
searching the disk. By default, only the \file{ls-R} database is
checked, in the interest of efficiency.
\item[\texttt{-{}-path=\var{string}}]\mbox{}\\
Search along the path \ttvar{string} (colon-separated as usual),
instead of guessing the search path from the filename. \samp{//} and
all the usual expansions are supported. The options \samp{-{}-path}
and \samp{-{}-format} are mutually exclusive.
\item[\texttt{-{}-progname=\var{name}}]\mbox{}\\
Set the program name to \texttt{\var{name}}.
This can affect the search paths via the \texttt{.\var{progname}}
feature.
The default is \cmdname{kpsewhich}.
\item[\texttt{-{}-show-path=\var{name}}]\mbox{}\\
shows the path used for file lookups of file type \texttt{\var{name}}.
Either a filename extension (\code{.pk}, \code{.vf}, etc.) or a
name can be used, just as with \samp{-{}-format} option.
\item[\texttt{-{}-debug=\var{num}}]\mbox{}\\
sets the debugging options to \texttt{\var{num}}.
\end{ttdescription}
\subsubsection{Examples of use}
\label{SExamplesofuse}
Let us now have a look at \KPS{} in action. Here's a straightforward search:
\begin{alltt}
> \Ucom{kpsewhich article.cls}
/usr/local/texmf-dist/tex/latex/base/article.cls
\end{alltt}
We are looking for the file \file{article.cls}. Since the \samp{.cls}
suffix is unambiguous we do not need to specify that we want to look for a
file of type \optname{tex} (\TeX{} source file directories). We find it in
the subdirectory \file{tex/latex/base} below the \samp{texmf-dist} \TL\
directory. Similarly, all of the following are found without problems
thanks to their unambiguous suffix.
\begin{alltt}
> \Ucom{kpsewhich array.sty}
/usr/local/texmf-dist/tex/latex/tools/array.sty
> \Ucom{kpsewhich latin1.def}
/usr/local/texmf-dist/tex/latex/base/latin1.def
> \Ucom{kpsewhich size10.clo}
/usr/local/texmf-dist/tex/latex/base/size10.clo
> \Ucom{kpsewhich small2e.tex}
/usr/local/texmf-dist/tex/latex/base/small2e.tex
> \Ucom{kpsewhich tugboat.bib}
/usr/local/texmf-dist/bibtex/bib/beebe/tugboat.bib
\end{alltt}
That last is a \BibTeX{} bibliography database for \textsl{TUGBoat} articles.
\begin{alltt}
> \Ucom{kpsewhich cmr10.pk}
\end{alltt}
Font bitmap glyph files of type \file{.pk} are used by display
programs like \cmdname{dvips} and \cmdname{xdvi}. Nothing is returned in
this case since there are no pre-generated Computer Modern \samp{.pk}
files in \TL{}\Dash the Type~1 variants are used by default.
\begin{alltt}
> \Ucom{kpsewhich wsuipa10.pk}
\ifSingleColumn /usr/local/texmf-var/fonts/pk/ljfour/public/wsuipa/wsuipa10.600pk
\else /usr/local/texmf-var/fonts/pk/ljfour/public/
... wsuipa/wsuipa10.600pk
\fi\end{alltt}
For these fonts (a phonetic alphabet from the University of Washington)
we had to generate \samp{.pk} files, and since the default \MF{} mode on
our installation is \texttt{ljfour} with a base resolution of 600\dpi{}
(dots per inch), this instantiation is returned.
\begin{alltt}
> \Ucom{kpsewhich -dpi=300 wsuipa10.pk}
\end{alltt}
In this case, when specifying that we are interested in a resolution
of 300\dpi{} (\texttt{-dpi=300}) we see that no such font is available on
the system. A program like \cmdname{dvips} or \cmdname{xdvi} would
go off and actually build the required \texttt{.pk} files
using the script \cmdname{mktexpk}.
Next we turn our attention to \cmdname{dvips}'s header and configuration
files. We first look at one of the commonly used files, the general
prolog \file{tex.pro} for \TeX{} support, before turning our attention
to the generic configuration file (\file{config.ps}) and the \PS{} font
map \file{psfonts.map}\Dash as of 2004, map and encoding files have
their own search paths and new location in \dirname{texmf} trees. As
the \samp{.ps} suffix is ambiguous we have to specify explicitly which
type we are considering (\optname{dvips config}) for the file
\texttt{config.ps}.
\begin{alltt}
> \Ucom{kpsewhich tex.pro}
/usr/local/texmf/dvips/base/tex.pro
> \Ucom{kpsewhich --format="dvips config" config.ps}
/usr/local/texmf/dvips/config/config.ps
> \Ucom{kpsewhich psfonts.map}
/usr/local/texmf/fonts/map/dvips/updmap/psfonts.map
\end{alltt}
We now take a closer look at the \acro{URW} Times \PS{} support
files. The prefix for these in the standard font naming scheme is
\samp{utm}. The first file we look at is the configuration file,
which contains the name of the map file:
\begin{alltt}
> \Ucom{kpsewhich --format="dvips config" config.utm}
/usr/local/texmf-dist/dvips/psnfss/config.utm
\end{alltt}
The contents of that file is
\begin{alltt}
p +utm.map
\end{alltt}
which points to the file \file{utm.map}, which we want to
locate next.
\begin{alltt}
> \Ucom{kpsewhich utm.map}
/usr/local/texmf-dist/fonts/map/dvips/times/utm.map
\end{alltt}
This map file defines the file names of the Type~1 \PS{} fonts in
the URW collection. Its contents look like (we only show part of the
lines):
\begin{alltt}
utmb8r NimbusRomNo9L-Medi ... <utmb8a.pfb
utmbi8r NimbusRomNo9L-MediItal... <utmbi8a.pfb
utmr8r NimbusRomNo9L-Regu ... <utmr8a.pfb
utmri8r NimbusRomNo9L-ReguItal... <utmri8a.pfb
utmbo8r NimbusRomNo9L-Medi ... <utmb8a.pfb
utmro8r NimbusRomNo9L-Regu ... <utmr8a.pfb
\end{alltt}
Let us, for instance, take the Times Roman instance
\file{utmr8a.pfb} and find its position in the \file{texmf} directory
tree with a search for Type~1 font files:
\begin{alltt}
> \Ucom{kpsewhich utmr8a.pfb}
\ifSingleColumn /usr/local/texmf-dist/fonts/type1/urw/times/utmr8a.pfb
\else /usr/local/texmf-dist/fonts/type1/
... urw/utm/utmr8a.pfb
\fi\end{alltt}
It should be evident from these examples how you can easily locate the
whereabouts of a given file. This is especially important if you suspect
that the wrong version of a file is picked up somehow, since
\cmdname{kpsewhich} will show you the first file encountered.
\subsubsection{Debugging actions}
\label{Debugging}
Sometimes it is necessary to investigate how a program resolves file
references. To make this practical, \KPS{} offers various levels of
debugging output:
\begin{ttdescription}
\item[\texttt{\ 1}] \texttt{stat} calls (disk lookups). When running
with an up-to-date \file{ls-R} database this should almost give no
output.
\item[\texttt{\ 2}] References to hash tables (such as \file{ls-R}
databases, map files, configuration files).
\item[\texttt{\ 4}] File open and close operations.
\item[\texttt{\ 8}] General path information for file types
searched by \KPS. This is useful to find out where a particular
path for the file was defined.
\item[\texttt{16}] Directory list for each path element (only relevant
for searches on disk).
\item[\texttt{32}] File searches.
\end{ttdescription}
A value of \texttt{-1} will set all the above options; in practice,
this is usually the most convenient.
Similarly, with the \cmdname{dvips} program, by setting a combination of
debug switches, one can follow in detail where files are being picked up
from. Alternatively, when a file is not found, the debug trace shows in
which directories the program looks for the given file, so that one can
get an indication what the problem~is.
Generally speaking, as most programs call the \KPS{} library
internally, one can select a debug option by using the
\envname{KPATHSEA\_DEBUG} environment variable, and setting it to (a
combination of) values as described in the above list.
(Note for Windows users: it is not easy to redirect
all messages to a file in this system. For diagnostic purposes
you can temporarily \texttt{SET KPATHSEA\_DEBUG\_OUTPUT=err.log}).
Let us consider, as an example, a small \LaTeX{} source file,
\file{hello-world.tex}, which contains the following input.
\begin{verbatim}
\documentclass{article}
\begin{document}
Hello World!
\end{document}
\end{verbatim}
This little file only uses the font \file{cmr10}, so let us look
how \cmdname{dvips} prepares the \PS{} file (we want to use the Type~1
version of the Computer Modern fonts, hence the option \texttt{-Pcms}).
\begin{alltt}
> \Ucom{dvips -d4100 hello-world -Pcms -o}
\end{alltt}
In this case we have combined \cmdname{dvips}'s debug class 4 (font
paths) with \KPS's path element expansion (see \cmdname{dvips} Reference
Manual, \OnCD{texmf/doc/html/dvips/dvips_toc.html}).
The output (slightly rearranged) appears in
Figure~\ref{fig:dvipsdbga}.
\begin{figure*}[tp]
\centering
\input{examples/ex6a.tex}
\caption{Finding configuration files}\label{fig:dvipsdbga}
\bigskip
\input{examples/ex6b.tex}
\caption{Finding the prolog file}\label{fig:dvipsdbgb}
\bigskip
\input{examples/ex6c.tex}
\caption{Finding the font file}\label{fig:dvipsdbgc}
\end{figure*}
\cmdname{dvips} starts by locating its working files. First,
\file{texmf.cnf} is found, which gives the definitions of the search
paths for the other files, then the file database \file{ls-R} (to
optimize file searching) and the file \file{aliases}, which makes it
possible to declare several names (e.g., a short \acro{DOS}-like 8.3 and
a more natural longer version) for the same file. Then \cmdname{dvips}
goes on to find the generic configuration file \file{config.ps}
before looking for the customization file \file{.dvipsrc} (which, in
this case is \emph{not found}). Finally, \cmdname{dvips} locates the
config file for the Computer Modern \PS{} fonts \file{config.cms}
(this was initiated with the \texttt{-Pcms} option on the \cmdname{dvips}
command). This file contains the list of the map files which
define the relation between the \TeX{}, \PS{} and file system
names of the fonts.
\begin{alltt}
> \Ucom{more /usr/local/texmf/dvips/cms/config.cms}
p +ams.map
p +cms.map
p +cmbkm.map
p +amsbkm.map
\end{alltt}
\cmdname{dvips} thus goes on to find all these files, plus the generic
map file \file{psfonts.map}, which is always loaded (it contains
declarations for commonly used \PS{} fonts; see the last part of
Section \ref{SExamplesofuse} for more details about \PS{} map
file handling).
At this point \cmdname{dvips} identifies itself to the user:
\begin{alltt}
This is dvips(k) 5.92b Copyright 2002 Radical Eye Software (www.radicaleye.com)
\end{alltt}
\ifSingleColumn
Then it goes on to look for the prolog file \file{texc.pro}:
\begin{alltt}\small
kdebug:start search(file=texc.pro, must\_exist=0, find\_all=0,
path=.:~/tex/dvips//:!!/usr/local/texmf/dvips//:
~/tex/fonts/type1//:!!/usr/local/texmf/fonts/type1//).
kdebug:search(texc.pro) => /usr/local/texmf/dvips/base/texc.pro
\end{alltt}
\else
Then it goes on to look for the prolog file \file{texc.pro} (see
Figure~\ref{fig:dvipsdbgb}).
\fi
After having found the file in question, \cmdname{dvips} outputs
date and time, and informs us that it will generate the
file \file{hello-world.ps}, then that it needs the font file
\file{cmr10}, and that the latter is declared as ``resident'' (no
bitmaps needed):
\begin{alltt}\small
TeX output 1998.02.26:1204' -> hello-world.ps
Defining font () cmr10 at 10.0pt
Font cmr10 <CMR10> is resident.
\end{alltt}
Now the search is on for the file \file{cmr10.tfm}, which is found,
then a few more prolog files (not shown) are referenced, and finally
the Type~1 instance \file{cmr10.pfb} of the font is located and
included in the output file (see last line).
\begin{alltt}\small
kdebug:start search(file=cmr10.tfm, must\_exist=1, find\_all=0,
path=.:~/tex/fonts/tfm//:!!/usr/local/texmf/fonts/tfm//:
/var/tex/fonts/tfm//).
kdebug:search(cmr10.tfm) => /usr/local/texmf/fonts/tfm/public/cm/cmr10.tfm
kdebug:start search(file=texps.pro, must\_exist=0, find\_all=0,
...
<texps.pro>
kdebug:start search(file=cmr10.pfb, must\_exist=0, find\_all=0,
path=.:~/tex/dvips//:!!/usr/local/texmf/dvips//:
~/tex/fonts/type1//:!!/usr/local/texmf/fonts/type1//).
kdebug:search(cmr10.pfb) => /usr/local/texmf/fonts/type1/public/cm/cmr10.pfb
<cmr10.pfb>[1]
\end{alltt}
\subsection{Runtime options}
Another useful feature of \Webc{} is its possibility to control a number
of memory parameters (in particular, array sizes) via the runtime file
\file{texmf.cnf} read by \KPS{}. The memory settings can be found in
Part 3 of that file in the \TL{} distribution. The more important
are:
\begin{ttdescription}
\item[\texttt{main\_memory}]
Total words of memory available, for
\TeX{}, \MF{} and \MP. You must make a new format file for each
different setting. For instance, you could generate a ``huge''
version of \TeX{}, and call the format file \texttt{hugetex.fmt}.
Using the standard way of specifying the program name used by \KPS{},
the particular value of the \texttt{main\_memory} variable will then
be read from \file{texmf.cnf}.
etc.).
\item[\texttt{extra\_mem\_bot}]
Extra space for ``large'' \TeX{} data structures:
boxes, glue, breakpoints, etc. Especially useful if you use
\PiCTeX{}.
\item[\texttt{font\_mem\_size}]
Number of words for font information available for \TeX. This
is more or less the total size of all TFM files read.
\item[\texttt{hash\_extra}]
Additional space for the hash table of control sequence names.
Approximately 10,000 control sequences can be stored in the main
hash table; if you have a large book with numerous cross-references,
this might not be enough. The default value of
\texttt{hash\_extra} is \texttt{50000}.
\end{ttdescription}
\noindent Of course, this facility is no substitute for truly dynamic
arrays and memory allocation, but since these are extremely difficult to
implement in the present \TeX{} source, these runtime parameters provide
a practical compromise allowing some flexibility.
\section{Building on a new Unix platform}
If you have a platform for which executables are not included, you will
need to compile \TeX{} and friends. This is not as hard as it
sounds. What you need is all in the directory \texttt{source} in the
distribution.
\subsection{Prerequisites}
You will need at least 100 megabytes of disk space to compile all of
\TeX{} and its support programs. You'll also need an \acro{ANSI} C
compiler, a \cmdname{make} utility, a lexical scanner, and a parser
generator. We recommend the \acro{GNU} version of these programs
(\cmdname{gcc}, \acro{GNU} \cmdname{make}, \cmdname{m4}, \cmdname{flex},
\cmdname{bison}). You may be able to work with other C compilers and
\cmdname{make} programs, but you will need a good understanding of
building Unix programs to sort out problems.
Also, the command \texttt{uname} must return a sensible value.
\subsection{Configuration}
To begin, perform a normal installation of \TL{} to your disk (see
section~\ref{sec:unix-install-disk} on
\p.\pageref{sec:unix-install-disk}). You may wish to skip installing
all of the prebuilt binaries.
Then, unpack the source from the compressed \texttt{tar} file in the
directory \dirname{source} to your disk and change directory to where
you placed it.
Next, run \cmdname{configure} with a command line like this:
\begin{alltt}
> \Ucom{sh configure -prefix=/usr/local/TeX}
\end{alltt}
The \optname{-prefix} directory is the one where you installed the
support tree; the directory layout will be as follows (where \$TEXDIR
stands for the directory you chose):
\noindent
\begin{tabular}{>{\ttfamily}ll@{}}
\dirname{$TEXDIR/share/texmf} & main tree with fonts,\\
& \qquad macros, etc\\
\dirname{$TEXDIR/man} & Unix manual pages\\
\dirname{$TEXDIR/info} & \acro{GNU} style Info manuals\\
\dirname{$TEXDIR/bin/$PLATFORM} & binaries\\
\end{tabular}
%$
If you want to leave out the \dirname{$PLATFORM} directory level,
i.e., put the binaries directly into \dirname{$TEXDIR/bin}, specify
the \verb|--disable-multiplatform| option to \cmdname{configure}.
Have a look at the output of \verb|./configure --help| for more
options you can use. For example, you can skip building of \OMEGA{} and
\eTeX{}.
\subsection{Running \cmdname{make}}
Make sure the shell variable or option \texttt{noclobber} is not set.
Then, run the main \cmdname{make} like this:
\begin{alltt}
> \Ucom{make world}
\end{alltt}
and relax\ldots
Alternatively, you want to log all the output, as in:
\begin{alltt}
> \Ucom{sh -c "make world >world.log 2>\&1" \&}
\end{alltt}
Before you believe that everything went ok, please check the log file
for errors: \acro{GNU} \cmdname{make} always uses the string \samp{***}
whenever a command fails. Also, check if all the programs were built:
\begin{alltt}
> \Ucom{cd \var{TEXDIR}/bin/\var{archname}}
> \Ucom{ls | wc}
\end{alltt}
The result should be over 200 (you can check the exact number with the
\dirname{bin} directory contents in the distribution).
If you need special privileges for \texttt{make install}, you can
separate the \samp{make world} into two different runs, like this:
\begin{alltt}
> \Ucom{make all}
> \Ucom{su}
> \Ucom{make install strip}
\end{alltt}
After you've installed your new binaries, you should follow the normal
post-installation procedures, given in section~\ref{sec:postinstall}
(\p.\pageref{sec:postinstall}).
Also, if you'd like to make your binaries available to others, please
contact us. We'll be happy to put them on the \TL\ web pages.
\section{Acknowledgements}
\TL{} is a joint effort by virtually all of the \TeX{} user groups.
This edition of \TL{} was overseen by Sebastian Rahtz and Karl Berry.
The other principal contributors are listed below.
\begin{itemize*}
\item The German-speaking \TeX{} Users (\acro{DANTE} e.V.), who provide
the hardware for the \TL{} source repository; and Rainer Sch\"opf and
Reinhard Zierke who look after it. \acro{DANTE} officers Volker Schaa
and Klaus Hoeppner coordinated production with the Lehmann's Bookstore
(\url{http://www.lob.de}).
\item The Perforce corporation (\url{http://www.perforce.com}), for providing
a free copy of their excellent change management system, which we used
to manage the \TL{} sources.
\item Peter Breitenlohner and the \eTeX\ team for the stable foundation
of future \TeX's.
\item Thomas Esser, without whose marvelous \teTeX{} package \TL{}
would certainly not exist, and whose continual help makes it a better
product.
\item Michel Goossens, who co-authored the original documentation.
\item Eitan Gurari, whose \TeX4ht was used to create the \HTML{}
version of this documentation, and who worked tirelessly to improve
it at short notice.
\item Hans Hagen, for major testing and making the \ConTeXt\ format
conform to \TL's needs.
\item \Thanh, Martin Schr\"oder, and the pdf\TeX\ team for continuing
enhancements of \TeX's abilities.
\item Petr Olsak, who coordinated and checked all the Czech and Slovak
material very carefully.
\item Fabrice Popineau, for the Windows side of \TL{} and devising the
new directory layout.
\item Staszek Wawrykiewicz, the principal tester for all of \TL{}, and
coordinator of the Polish contributions.
\item Olaf Weber, for his patient assembly and maintenance of Web2C,
upon which all else depends.
\item Gerben Wierda, for creating and maintaining the \MacOSX\ support,
and much integration and testing.
\item Graham Williams, on whose work the catalogue of packages depends.
\end{itemize*}
Builders of the binaries:
Tigran Aivazian (\pkgname{x86\_64-linux}),
Manfred Lotz (\pkgname{i386-freebsd}),
Maksym Polyakov (\pkgname{sparc-solaris}),
Fabrice Popineau (\pkgname{win32}),
Norbert Preining (\pkgname{alpha-linux}),
Vladimir Volovich (\pkgname{powerpc-aix} and \pkgname{sparc64-linux}),
Staszek Wawrykiewicz (\pkgname{i386-linux}),
Olaf Weber (\pkgname{mips-irix}),
Gerben Wierda (\pkgname{powerpc-darwin}).
Documentation and translation updates:
Karl Berry (English),
Daniel Flipo \& Fabrice Popineau (French),
G\"unter Partosch \& Hartmut Henkel (German),
Petr Sojka \& Jan Busa (Czech\slash Slovak),
Boris Veytsman (Russian),
Staszek Wawrykiewicz (Polish).
Of course the most important acknowledgement must go to Donald Knuth, first
for inventing \TeX, and then for giving it to the world.
\section{Release history}
\label{sec:history}
\subsection{Past}
Discussion began in late 1993 when the Dutch \TeX{} Users Group was
starting work on its 4All\TeX{} \CD{} for \acro{MS-DOS} users, and it
was hoped at that time to issue a single, rational, \CD{} for all
systems. This was too ambitious a target for the time, but it did spawn
not only the very successful 4All\TeX{} \CD{}, but also the \acro{TUG}
Technical Council working group on a \emph{\TeX{} Directory Structure}
(\url{http://tug.org/tds}), which specified how to create consistent and
manageable collections of \TeX{} support files. A complete draft of the
\TDS{} was published in the December 1995 issue of \textsl{TUGboat}, and
it was clear from an early stage that one desirable product would be a
model structure on \CD{}. The distribution you now have is a very direct
result of the working group's deliberations. It was also clear that the
success of the 4All\TeX{} \CD{} showed that Unix users would benefit
from a similarly easy system, and this is the other main strand of
\TL.
We first undertook to make a new Unix-based \TDS{} \CD{} in the autumn
of 1995, and quickly identified Thomas Esser's \teTeX{} as the ideal
setup, as it already had multi-platform support and was built with
portability across file systems in mind. Thomas agreed to help, and work
began seriously at the start of 1996. The first edition was released in
May 1996. At the start of 1997, Karl Berry completed a major new release
of Web2c, which included nearly all the features which Thomas Esser had
added in \teTeX, and we decided to base the 2nd edition of the \CD{} on
the standard \Webc, with the addition of \teTeX's \texttt{texconfig}
script. The 3rd edition of the \CD{} was based on a major revision of
\Webc, 7.2, by Olaf Weber; at the same time, a new revision of \teTeX
was being made, and \TL{} included almost all of its features. The
4th edition followed the same pattern, using a new version of \teTeX,
and a new release of \Webc{} (7.3). The system now included a complete
Windows setup.
For the 5th edition (March 2000) many parts of the \CD{} were revised
and checked, updating hundreds of packages. Package details were stored
in XML files. But the major change for \TeX\ Live 5 was that all
non-free software was removed. Everything in \TL{} is now intended
to be compatible with the Debian Free Software Guidelines
(\url{http://www.debian.org/intro/free}); we have done our best to check
the license conditions of all packages, but we would very much
appreciate hearing of any mistakes.
The 6th edition (July 2001) had much more material updated. The major
change was a new install concept: the user could select a more exact set
of needed collections. Language-related collections were completely
reorganized, so selecting any of them installs not only macros, fonts,
etc., but also prepares an appropriate \texttt{language.dat}.
The 7th edition of 2002 had the notable addition of \MacOSX{} support,
and the usual myriad of updates to all sorts of packages and
programs. An important goal was integration of the source back with
\teTeX, to correct the drift apart in versions~5 and~6.
In 2003, with the continuing flood of updates and additions, we found
that \TL{} had grown so large it could no longer be contained on a
single \CD, so we split it into three different distributions (see
section~\ref{sec:multiple-dist}, \p.\pageref{sec:multiple-dist}). In
addition:
\begin{itemize*}
\item At the request of the \LaTeX{} team, we changed the standard
\cmdname{latex} and \cmdname{pdflatex} commands to now use \eTeX{} (see
\p.\pageref{text:etex}).
\item The new Latin Modern fonts were included (and are recommended).
\item Support for Alpha \acro{OSF} was removed
(\acro{HPUX} support was removed previously), since no one had (or
volunteered) hardware available on which to compile new binaries.
\item Windows setup was substantially changed; for the first time
an integrated environment based on XEmacs was introduced.
\item Important supplementary programs for Windows
(Perl, Ghost\-script, Image\-Magick, Ispell) are now installed
in the \TL{} installation directory.
\item Font map files used by \cmdname{dvips}, \cmdname{dvipdfm}
and \cmdname{pdftex} are now generated by the new program
\cmdname{updmap} and installed into \dirname{texmf/fonts/map}.
\item \TeX{}, \MF{}, and \MP{} now, by default, output most input
characters (32 and above) as themselves in output (e.g.,
\verb|\write|) files,
log files, and the terminal, i.e., \emph{not} translated using the
\verb|^^| notation. In \TL{}~7, this translation was
dependent on the system locale settings; now, locale settings do
not influence the \TeX{} programs' behavior. If for some reason
you need the \verb|^^| output, rename the file
\verb|texmf/web2c/cp8bit.tcx|. (Future releases will have cleaner
ways to control this.)
\item This documentation was substantially revised.
\item Finally, since the edition numbers had grown unwieldy,
the version is now simply identified by the year: \TL{} 2003.
\end{itemize*}
\subsection{Present}
\label{tlcurrent}
2004 saw the usual huge number of updates to packages and programs.
Here are the most notable changes, including one important backward
incompatibility:
\begin{itemize}
\item If you have locally-installed fonts which use their own
\filename{.map} or (much less likely) \filename{.enc} support files, you
may need to move those support files.
\filename{.map} files are now searched for in subdirectories of
\dirname{fonts/map} only (in each \filename{texmf} tree), along the
\envname{TEXFONTMAPS} path. Similarly, \filename{.enc} files are now
searched for in subdirectories of \dirname{fonts/enc} only, along the
\envname{ENCFONTS} path. \cmdname{updmap} will attempt to warn about
problematic files.
For methods of handling this and other information, please see
\url{http://tug.org/texlive/mapenc.html}.
\item The \TK\ has been expanded with the addition of a \MIKTEX-based
installable \CD, for those who prefer that implementation to Web2C.
See section~\ref{sec:struct-tl} (\p.\pageref{sec:struct-tl}).
\item Within \TL, the single large \dirname{texmf} tree of previous
releases has been replaced by three: \dirname{texmf},
\dirname{texmf-dist}, and \dirname{texmf-doc}. See
section~\ref{sec:tld} (\p.\pageref{sec:tld}), and the \filename{README}
files for each.
\item All \TeX-related input files are now collected in
the \dirname{tex} subdirectory of \dirname{texmf*} trees, rather than
having separate sibling directories \dirname{tex}, \dirname{etex},
\dirname{pdftex}, \dirname{pdfetex}, etc. See
\CDref{texmf-doc/doc/english/tds/tds.html\#Extensions}
{\texttt{texmf-doc/doc/english/tds/tds.html\#Extensions}}.
\item Helper scripts (not meant to be invoked by users) are now located
in a new \dirname{scripts} directory of \dirname{texmf*} trees, and
searched for via \verb|kpsewhich -format=texmfscripts|. So if you have
programs which call such scripts, they'll need to be adjusted. See
\CDref{texmf-doc/doc/english/tds/tds.html\#Scripts}
{\texttt{texmf-doc/doc/english/tds/tds.html\#Scripts}}.
\item Almost all formats leave most characters printable as
themselves via the ``translation file'' \filename{cp227.tcx}, instead of
translating them with the \verb|^^| notation. Specifically, characters
at positions 32--256, plus tab, vertical tab, and form feed are
considered printable and not translated. The exceptions are plain \TeX\
(only 32--126 printable), \ConTeXt\ (0--255 printable), and the
\OMEGA-related formats. This default behavior is almost the same as in
\TL\,2003, but it's implemented more cleanly, with more possibilities
for customization. See \CDref{texmf/doc/web2c/web2c.html\#TCX-files}
{\texttt{texmf/doc/web2c/web2c.html\#TCX-files}}.
(By the way, with Unicode input, \TeX\ may output partial character
sequences when showing error contexts, since it is byte-oriented.)
\item \textsf{pdfetex} is now the default engine for all formats
except (plain) \textsf{tex} itself. (Of course it generates \acro{DVI}
when run as \textsf{latex}, etc.) This means, among other things, that
the microtypographic features of \textsf{pdftex} are available in
\LaTeX, \ConTeXt, etc., as well as the \eTeX\ features
(\OnCD{texmf-dist/doc/etex/base/}).
It also means it's \emph{more important than ever} to use the
\pkgname{ifpdf} package (works with both plain and \LaTeX) or equivalent
code, because simply testing whether \cs{pdfoutput} or some other
primitive is defined is not a reliable way to determine if \acro{PDF}
output is being generated. We made this backward compatible as best we
could this year, but next year, \cs{pdfoutput} may be defined even when
\acro{DVI} is being written.
\item pdf\TeX\ (\url{http://pdftex.org}) has many new features:
\begin{itemize*}
\item \cs{pdfmapfile} and \cs{pdfmapline} provide font map support
from within a document.
\item Microtypographic font expansion can be used more easily.\\
\url{http://www.ntg.nl/pipermail/ntg-pdftex/2004-May/000504.html}
\item All parameters previously set through the special configuration
file \filename{pdftex.cfg} must now be set through primitives,
typically in \filename{pdftexconfig.tex}; \filename{pdftex.cfg} is no
longer supported. Any extant \filename{.fmt} files must be redumped
when \filename{pdftexconfig.tex} is changed.
\item See the pdf\TeX\ manual for more: \OnCD{texmf/doc/pdftex/manual}.
\end{itemize*}
\item The \cs{input} primitive in \cmdname{tex} (and \cmdname{mf} and
\cmdname{mpost}) now accepts double quotes containing spaces and other
special characters. Typical examples:
\begin{verbatim}
\input "filename with spaces" % plain
\input{"filename with spaces"} % latex
\end{verbatim}
See the Web2C manual for more: \OnCD{texmf/doc/web2c}.
\item enc\TeX\ support is now included within Web2C and consequently all
\TeX\ programs, via the \optname{-enc} option\Dash \emph{only when
formats are built}. enc\TeX\ supports general re-encoding of input and
output, enabling full support of Unicode (in \acro{UTF}-8). See
\OnCD{texmf-dist/doc/generic/enctex/} and
\url{http://www.olsak.net/enctex.html}.
\item Aleph, a new engine combining \eTeX\ and \OMEGA, is available.
A little information is available in \OnCD{texmf-dist/doc/aleph/base}
and \url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=aleph}. The
\LaTeX-based format for Aleph is named \textsf{lamed}.
\item The latest \LaTeX\ release has a new version of the
\acro{LPPL}\Dash now officially a Debian-approved license. Assorted
other updates, see the \filename{ltnews} files in
\OnCD{texmf-dist/doc/latex/base}.
\item \cmdname{dvipng}, a new program for converting \acro{DVI} to
\acro{PNG} image files, is included. See \OnCD{texmf/doc/man/man1/dvipng.1}.
\item We reduced the \pkgname{cbgreek} package to a ``medium'' sized set
of fonts, with the assent and advice of the author (Claudio Beccari).
The excised fonts are the invisible, outline, and transparency ones,
which are relatively rarely used, and we needed the space. The full set
is of course available from \acro{CTAN}
(\url{http://www.ctan.org/tex-archive/fonts/greek/cb}).
\item \cmdname{oxdvi} has been removed; just use \cmdname{xdvi}.
\item The \cmdname{ini} and \cmdname{vir} commands (links) for
\cmdname{tex}, \cmdname{mf}, and \cmdname{mpost} are no longer created,
such as \cmdname{initex}. The \cmdname{ini} functionality has been
available through the command-line option \optname{-ini} for years now.
\item \textsf{i386-openbsd} platform support was removed. Since the
\pkgname{tetex} package in the \acro{BSD} Ports system is available, and
\acro{GNU/}Linux and Free\acro{BSD} binaries were available, it seemed
volunteer time could be better spent elsewhere.
\item On \textsf{sparc-solaris} (at least), you may have to set the
\envname{LD\_LIBRARY\_PATH} environment variable to run the
\pkgname{t1utils} programs. This is because they are compiled with C++,
and there is no standard location for the runtime libraries. (This is
not new in 2004, but wasn't previously documented.) Similarly, on
\textsf{mips-irix}, the \acro{MIPS}pro 7.4 runtimes are required.
\end{itemize}
\subsection{Future}
\emph{\TL{} is not perfect!} (And never will be.) We intend to
continue to release new versions yearly, and would like to provide more
help material, more utilities, more installation programs, and (of
course) an ever-improved and checked tree of macros and fonts. This work
is all done by hard-pressed volunteers in their limited spare time, and
a great deal remains to be done. If you can help, don't hesitate to put
your name forward!
Please send corrections, suggestions, and offers of help to:\hfill\null
\begin{quote}
Sebastian Rahtz \ / \ 7 Stratfield Road \ / \ Oxford OX2 7BG \ / \ UK \\
\email{tex-live@tug.org} \\
\url{http://tug.org/texlive}
\end{quote}
\medskip
\noindent \textsl{Happy \TeX ing!}
\end{multicols}
\end{document}
|