1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749
|
<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"docbook-xml/docbookx.dtd"
[<!ENTITY dummy "dummy">
<!ENTITY date "$Date$">
<!ENTITY ls "Latex-Suite">
<!ENTITY latex "LaTeX">
<!ENTITY vim "Vim">
<!ENTITY ph "<++>">
]>
<article lang="en">
<articleinfo id="articleinfo">
<title id="articleinfo-title">&ls; Reference</title>
<author>
<firstname>Srinath</firstname>
<surname>Avadhanula</surname>
<affiliation>
<address><email>srinath AT fastmail DOT fm</email></address>
</affiliation>
</author>
<author>
<firstname>Mikolaj</firstname>
<surname>Machowski</surname>
<affiliation>
<address><email>mikmach AT wp DOT pl</email></address>
</affiliation>
</author>
<date>&date;</date>
<abstract>
<para>
&ls; attempts to provide a comprehensive set of tools to
view, edit and compile LaTeX documents in Vim. Together, they
provide tools starting from macros to speed up editing LaTeX
documents to functions for forward searching .dvi documents.
&ls; has been possible because of the contributions of many
people. Please see <link
linkend="latex-suite-credits">latex-suite-credits</link> for a list of
people who have helped.
</para>
<para>
&ls; is released under the Vim charityware license. For
license and conditions of use look at |copyright|. Replace all
occurrences of ``Vim'' with ``Latex-Suite''. The current copyright
holders of &ls; are Srinath Avadhanula and Mikolaj Machowski.
</para>
<para>
Homepage: <ulink url="http://vim-latex.sourceforge.net">http://vim-latex.sourceforge.net</ulink>
</para>
</abstract>
</articleinfo>
<section id="recommended-settings">
<title>Installation and recommended Settings</title>
<para>
If you are reading this, it most probably means that you have already
installed &ls; and the help files. If this is not the case, follow the
detailed instructions on <ulink
url="http://vim-latex.sourceforge.net/index.php?subject=download">&ls;'s
download page</ulink>.
</para>
<para>
Make sure that you create a few necessary settings in your
<literal>~/.vimrc.</literal>
<programlisting>
" REQUIRED. This makes vim invoke &ls; when you open a tex file.
filetype plugin on
" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
" can be called correctly.
set shellslash
" OPTIONAL: This enables automatic indentation as you type.
filetype indent on
" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'
</programlisting>
</para>
<para>
In addition, the following settings could go in your ~/.vim/ftplugin/tex.vim
file:
<programlisting>" this is mostly a matter of taste. but LaTeX looks good with just a bit
" of indentation.
set sw=2
" TIP: if you write your \label's as \label{fig:something}, then if you
" type in \ref{fig: and press <C-n> you will automatically cycle through
" all the figure labels. Very useful!
set iskeyword+=:
</programlisting>
</para>
<para>
In the unlikely case that &ls; is installed, but you do not want to use it
(e.g., if it is installed system-wide and you use some other package to deal
with tex files),
you can suppress the loading of &ls; by setting
<programlisting>let b:suppress_latex_suite = 1</programlisting>
in your ~/.vim/ftplugin/tex.vim.
</para>
</section>
<section id="latex-suite-templates">
<title>Inserting Templates</title>
<para>
This functionality is available via the <literal>TeX-Suite >
Templates</literal> menu.
This module provides a way to insert custom templates at the beginning of the
current file.
</para>
<para>
When &ls; first starts up, it scans the
<link linkend="Tex_CustomTemplateDirectory">template directory</link>
and creates menu items based on the files found there. When
you select a template from this menu, the file will be read in above
the first line of the current file.
</para>
<para>
A template file can utilize placeholders for initializing the cursor
position when the template is read in and subsequent movement. In
addition, template files can contain dynamic elements such as the
time of creation of a file etc, by using vim expressions.
</para>
<para>
You can place your own templates in the
<link linkend="Tex_CustomTemplateDirectory">template directory</link>
in
order for them to be available via the menu.
</para>
<note>
<para>
Templates are also accessible for non-gui users with the command
|<literal>:TTemplate</literal>|. The argument should be name of
the corresponding template file. If the command is called
without arguments (preferred usage), then a list of available
templates is displayed and the user is asked to choose one of
them.
</para>
</note>
</section>
<section id="latex-macros">
<title>&ls; Macros</title>
<para>
&ls; ships with a very comprehensive set of insert mode and
|visual-mode| mappings and menu items to typeset most of the LaTeX
elements.
</para>
<note>
<para>
These mappings are are not standard mappings in the sense that
only the last character is mapped. See plugin/imaps.vim for
further documentation. For example, in the case of the mapping
<literal>EFI</literal> provided by &ls; you can press the characters
'<literal>E</literal>', '<literal>F</literal>' and '<literal>I</literal>'
as slowly as you wish (unlike the normal <literal>imap</literal> command
where <literal>timeout</literal> issues are involved). The characters are
visible as you type them (unlike normal <literal>imap</literal>s) and you
can use the movement or backspace key to correct yourself unlike normal
mappings.
</para>
</note>
<anchor id="place-holder" />
<note id="place-holders">
<title>Place Holders</title>
<para>
Almost all macros provided in &ls; implement Stephen Riem's bracketing
system and Gergely Kontra's <literal>JumpFunc()</literal> for handling
place-holders. This consists of using "place-holders" to mark off
locations where the next relevant editing has to be done. As an example,
when you type <literal>EFI</literal> in |insert-mode|, you will get the
following:
<programlisting>\begin{figure}[<+htpb+>]
\centering
\includegraphics{<+file+>}
\caption{<+caption text+>}
\label{fig:<+label+>}
\end{figure}<++></programlisting>
The text <literal><+htpb+></literal> will be selected and
you will be left in |select-mode| so that you can continue typing
straight away. After having typed in the placement specifier, you can press
<literal><Ctrl-J></literal> (while still in insert-mode). This will
take you directly to the next "place-holder". i.e, <literal><+file+></literal>
will be visually selected with Vim in select mode
again for typing in the file name. This saves on a lot of key presses.
</para>
</note>
<note id="overriding-macros">
<title>Over-riding &ls; Macros</title>
<para>
If you wish to change these macros from their default values, for
example, if you wish to change <literal>`w</literal> to expand to
<literal>\wedge</literal> instead of its default expansion to
<literal>\omega</literal>, you should use the <literal>IMAP</literal>
function as described in the <link linkend="ls-new-macros">Using
IMAP()</link> section.
</para>
<para>
An important thing to note is that if you wish to over-ride macros
created by &ls; rather than merely create new macros, you should place
the <literal>IMAP()</literal> calls in a script which gets sourced
after the files in &ls;. A good place typically is as a file-type
plugin file in the
<literal>~/.vim/after/ftplugin/</literal> directory. (Use
<literal>~/vimfiles</literal> if you are using
<literal>WINDOWS</literal>). For example to over-ride
<literal>`w</literal> to <literal>\wedge</literal> instead of
<literal>\omega</literal>, place the following line in (say)
<literal>~/.vim/after/ftplugin/tex_macros.vim</literal>:
<programlisting>call IMAP('`w', '\wedge', 'tex')</programlisting>
To delete a mapping, you can use
<programlisting>call IUNMAP('FEM', 'tex')</programlisting>
in <literal>~/.vim/after/ftplugin/tex_macros.vim</literal>.
</para>
<note>
<para>
It is important to use a file-name which will get sourced on a
<literal>FileType</literal> event. Therefore you must use a file-name
which conforms to the standards as described in
<literal>|ftplugin-name|</literal>.
</para>
</note>
</note>
<note id="pausing-imaps">
<title>Pausing Macro expansion</title>
<para>
If you wish to temporarily suspend the imaps functionality, then you
can set the <literal>Imap_FreezeImap</literal> to 1. If you set
<literal>g:Imap_FreezeImap</literal> to 1, then it will be a
system-wide setting. Setting <literal>b:Imap_FreezeImap</literal> will
affect only the current buffer.
</para>
</note>
<para>
The following sections describe the various editing macros provided
by &ls;.
</para>
<section id="environment-mappings">
<title>Environment Mappings</title>
&ls; provides a rich set of mappings to insert, enclose and modify
&latex; environments, i.e, <literal>\begin{...} ... \end{...}</literal>
pairs.
There are several possibilities for the customization of the inserted environments, see <link linkend="customizing-macros-environments">the section about customizations</link>.
<section id="inserting-environments">
<title>Inserting Environments</title>
<para>
&ls; provides the following ways to insert environments
</para>
<section id="inserting-env-f5">
<title>Method 1: Pressing <literal><F5></literal></title>
<para>
If you press <literal><F5></literal> in the insert or normal
mode while on an empty line, &ls; prompts you with a list of
environments you might want to insert. You can either choose one
from the list or type in a new environment name. If you press
<literal><F5></literal> on a line which already has a word,
then that word is used instead of prompting.
</para>
<para>
See <link linkend="Tex_Env_name">Tex_Env_name</link> for a
description of how &ls; uses the word to form the expansion and how
to modify &ls;'s behavior.
</para>
<para>
The list of environments which &ls; prompts you with (when
<literal><F5></literal> is pressed on an empty line) is formed
from the <link
linkend="Tex_PromptedEnvironments">Tex_PromptedEnvironments</link>
setting.
</para>
<para>
In addition to this setting, &ls; also lists environments found in
custom packages as described in the section <link
linkend="package-actions">Package actions.</link>
</para>
</section>
<section id="inserting-env-shift-f1">
<title>Method 2: Using <literal><S-F1></literal>-<literal><S-F4></literal></title>
<para>
The shifted function keys, <literal><S-F1></literal> to
<literal><S-F4></literal> can be mapped to insert very commonly
used environments. The environments mapped to each key can be
customized via the <link
linkend="Tex_HotKeyMappings">g:Tex_HotKeyMappings</link> setting.
</para>
</section>
<section id="inserting-env-threeletter">
<title>Method 3: Using three letter sequences</title>
<para>
Environments can also be inserted by pressing a 3 capital letter
sequence starting with an <literal>E</literal>. The sequence of 3
letters generally tries to follow the following rules:
</para>
<orderedlist>
<listitem>
All environment mappings begin with <literal>E</literal>
</listitem>
<listitem>
If the environment can be broken up into 2 distinct words,
such as flushright (flush + right), then the next 2 letters
are the first letters of the 2 words. Example:
<programlisting>flushleft (_f_lush + _l_eft) ---> EFL
flushright (_f_lush + _r_ight) ---> EFR
minipage (_m_ini + _p_age) ---> EMP</programlisting>
If on the other hand, the environment name cannot be broken
up into 2 distinct words, then the next 2 letters are the
first 2 letters of the name of the environment.
Example:
<programlisting>equation (_eq_uation) ---> EEQ</programlisting>
</listitem>
</orderedlist>
<para>
Unfortunately there are some environments that cannot be
split in two words and first two letters in name are
identical. In this case shortcut is created from E, first and
last letter. Example:
<programlisting>quote (_q_uot_e_) ---> EQE
quotation (_q_uotatio_n_) ---> EQN</programlisting>
Of course, not every last one of the environments can follow
this rule because of ambiguities. In case of doubt, pull down
the Tex-Environments menu. The menu item should give the hint
for the map.
</para>
</section>
</section>
<section id="enclosing-environments">
<title>Enclosing in Environments</title>
<para>
&ls; provides visual-mode mappings which enclose visually
selected portions of text in environments. There are two ways provided
to do this.
</para>
<section id="enclosing-env-f5">
<title>Method 1: Pressing <literal><F5></literal></title>
<para>
You can also select a portion of text visually and press
<literal><F5></literal> while still in visual mode. This will
prompt you with a list of environments. (This list can be customized
via the <link
linkend="Tex_PromptedEnvironments">g:Tex_PromptedEnvironments</link>
setting). You can either choose from this list or type in a new
environment name. Once the selection is done, &ls; encloses the
visually selected portion in the chosen environment.
</para>
</section>
<section id="enclosing-env-threeletter">
<title>Method 2: Using three letter mappings</title>
<para>
You can also select text visually and press a sequence of three
characters beginning with <literal>,</literal> (the single comma
character) and the selected text will be enclosed in the chosen
environment. The three letter sequence follows directly from the
three letter sequence used to insert environments as described <link
linkend="inserting-env-threeletter">here</link>. The following
example describes the rule used:
</para>
<para>
If <literal>ECE</literal> inserts a
<literal>\begin{center}...\end{center}</literal> environment, then to
enclose a block of selected text in
<literal>\begin{center}...\end{center}</literal>, simply select the
text and press <literal>,ce</literal>. The rule simply says that the
leading <literal>E</literal> is converted to <literal>,</literal> and
the next 2 letters are small case.
</para>
</section>
<para>
Some of the visual mode mappings are sensitive to whether you
choose line-wise or character-wise. For example, if you choose a
word and press <literal>,ce</literal>, then you get
<literal>{\centering word}</literal>, whereas if you press
<literal>,ce</literal> on a line-wise selection, you get:
<programlisting>\begin{center}
line
\end{center}</programlisting>
</para>
</section>
<section id="changing-environments">
<title>Changing Environments</title>
<para>
Pressing <literal><S-F5></literal> in normal mode detects which
environment the cursor is presently located in and prompts you to
replace it with a new one. The innermost environment is detected. For
example, in the following source:
<programlisting>\begin{equation}
\begin{array}{ccc}
2 & 3 & 4
\end{array}
\end{equation}</programlisting>
if you are located in the middle "2 & 3 & 4" line, then pressing
<literal><S-F5></literal> will prompt you to change the array
environment, not the equation environment. In addition, &ls; will also
try to change lines within the environment to be consistent with the
new environment. For example, if the original environment was an
<literal>equation</literal> environment with a
<literal>\label</literal> command, then changing it to an
<literal>equation*</literal> environment will delete the
<literal>\label</literal>.
</para>
<para>
Pressing <literal><F5></literal> in normal mode has the same
effect as pressing <literal><F5></literal> in insert-mode,
namely you will be prompted to choose an environment to insert.
</para>
</section>
</section>
<section id="latex-command-maps">
<title>Command Mappings</title>
&ls; provides a rich set of mappings to insert, enclose and modify
&latex; commands.
<section id="inserting-commands">
<title>Inserting &latex; commands</title>
<anchor id="ls-imap-f7" />
<anchor id="ls-imap-s-f7" />
<para>
Pressing <literal><F7></literal> in insert or normal mode while
the cursor is touching a word will insert a command formed from the
word touching the cursor.
</para>
<para>
For certain common commands, &ls; will expand them to include
additional arguments as needed. For example, <literal>frac</literal>
becomes <literal>\frac{&ph;}{&ph;}&ph;</literal>. Otherwise, it will
simply change the word under the cursor as follows
<programlisting>word --> \word{&ph;}&ph;</programlisting>
You can define custom expansions
of commands using the <literal>Tex_Com_{name}</literal> setting as
described in <link linkend="Tex_Com_name">here</link>.
</para>
<para>
If <literal><F7></literal> is pressed when the cursor is on
white-space, then &ls; will prompt you to choose a command and insert
that instead.The list of commands is constructed from the <link
linkend="Tex_PromptedCommands"><literal>g:Tex_PromptedCommands</literal></link>
setting and also from commands which &ls; finds while scanning custom
packages which &ls; finds. See the <link
linkend="package-actions">Package actions</link> section for details
on which files are scanned etc.
</para>
</section>
<section id="enclosing-commands">
<title>Enclosing in a command</title>
<para>
You can select a portion of text visually and press
<literal><F7></literal> while still in visual mode. This will
prompt you with a list of commands. (This list can be customized
via the <link
linkend="Tex_PromptedCommands">g:Tex_PromptedCommands</link>
setting). You can either choose from this list or type in a new
command name. Once the selection is done, &ls; encloses the
visually selected portion in the chosen command.
</para>
</section>
<section id="changing-commands">
<title>Changing commands</title>
<anchor id="ls-vmap-f7" />
<para>
In both insert and normal mode <literal><S-F7></literal> will
find out if you are presently within an environment and then prompt you
with a list of commands to change it to.
</para>
</section>
</section>
<section id="font-maps">
<title>Font Mappings</title>
<para>
These mappings insert font descriptions such as:
<literal>\textsf{&ph;}&ph;</literal>
with the cursor left in place of the first <link
linkend="place-holders">placeholder</link> (the &ph; characters).
</para>
<para>
Mnemonic:
<orderedlist>
<listitem>first letter is always F (F for font)</listitem>
<listitem>next 2 letters are the 2 letters describing the font.</listitem>
</orderedlist>
</para>
<para>
Example: Typing <literal>FEM</literal> in insert-mode expands to
<literal>\emph{&ph;}&ph;</literal>.
</para>
<para>
Just like environment mappings, you can visually select an area and press
<literal>`sf</literal> to have it enclosed in:
<literal>\textsf{word}</literal>
or
<programlisting>{\sffamily
line
}</programlisting>
depending on character-wise or line-wise selection.
</para>
</section>
<section id="section-mappings">
<title>Section Mappings</title>
<para>
These maps insert &latex; sections such as:
<programlisting>\section{&ph;}&ph;</programlisting>
etc. Just as in the case of environments and fonts, can be enclosed with a
visual selection. The enclosing is not sensitive to character or line-wise
selection.
</para>
<para>
Mnemonic: (make your own!)
<programlisting>SPA for part
SCH for chapter
SSE for section
SSS for subsection
SS2 for subsubsection
SPG for paragraph
SSP for subparagraph</programlisting>
</para>
<para>
Example:
SSE in insert mode inserts
<programlisting>\section{<++>}<++></programlisting>
If you select a word or line and press <literal>,se</literal>, then you
get
<programlisting>\section{section name}</programlisting>
The menu item in Tex-Environments.Sections have a sub-menu called
'Advanced'. Choosing an item from this sub-menu asks a couple of questions
(whether you want to include the section in the table of contents, whether
there is a shorter name for the table of contents) and then creates a more
intelligent template.
</para>
</section>
<section id="greek-letter-mappings">
<title>Greek Letter Mappings</title>
<para>
Lower case
</para>
<para>
<literal>`a</literal> through <literal>`z</literal> expand to
<literal>\alpha</literal> through <literal>\zeta</literal>.
</para>
<note>
<para>
In the LaTex list of lowercase letters there is no
<literal>\omicron</literal> because it
would be identical in appearance to Latin <literal>o</literal>.
So inserting <literal>\omicron</literal> in default LaTex would result an
error. But we still expand <literal>`o</literal> to
<literal>\omicron</literal> to make the plugin behave consistently.
And for those who really need to distinguish between Latin
<literal>o</literal> and <literal>\omicron</literal>, you may enable the
command by including package <literal>unicode-math</literal> or simply
setting <literal>\newcommand\omicron{o}</literal> in your document.
</para>
</note>
<para>
Upper case:
</para>
<para>
<literal>`A</literal> through <literal>`Z</literal> expand to
<literal>\Alpha</literal> through <literal>\Zeta</literal>.
</para>
<note>
<para>
Same as what happens to the Lower case, LaTeX does not support upper
case for all greek alphabets. And only the following expansions are valid
in default. In order to use the rest of expansions, you may want to
manually configure them by either including packages or defining
corresponding commands.
</para>
</note>
<para>Valid Upper case Greek Letters in default:</para>
<programlisting>
`D = \Delta
`F = \Phi
`G = \Gamma
`Q = \Theta
`L = \Lambda
`X = \Xi
`Y = \Psi
`S = \Sigma
`U = \Upsilon
`W = \Omega</programlisting>
<para>
Just like other &ls; mappings, these mappings are not created using
the standard <literal>imap</literal> command. Thus you can type slowly,
correct using <literal><BS></literal> etc.
</para>
</section>
<section id="auc-tex-mappings">
<title>Auc-Tex Key Bindings</title>
<para>
These are simple 2 key expansions for some very commonly used LaTeX
elements:
</para>
<programlisting>`^ Expands To \Hat{&ph;}&ph;
`_ expands to \bar{&ph;}&ph;
`6 expands to \partial
`8 expands to \infty
`/ expands to \frac{&ph;}{&ph;}&ph;
`% expands to \frac{&ph;}{&ph;}&ph;
`@ expands to \circ
`0 expands to ^\circ
`= expands to \equiv
`\ expands to \setminus
`. expands to \cdot
`* expands to \times
`& expands to \wedge
`- expands to \bigcap
`+ expands to \bigcup
`( expands to \subset
`) expands to \supset
`< expands to \le
`> expands to \ge
`, expands to \nonumber
`~ expands to \tilde{&ph;}&ph;
`; expands to \dot{&ph;}&ph;
`: expands to \ddot{&ph;}&ph;
`2 expands to \sqrt{&ph;}&ph;
`| expands to \Big|
`I expands to \int_{&ph;}^{&ph;}&ph;</programlisting>
<para>
(again, notice the convenient place-holders)
</para>
<para>
In addition the visual mode macros are provided:
</para>
<programlisting>`( encloses selection in \left( and \right)
`[ encloses selection in \left[ and \right]
`{ encloses selection in \left\{ and \right\}
`$ encloses selection in $$ or \[ \] depending on characterwise or
linewise selection</programlisting>
</section>
<section id="diacritic-mappings">
<title>Diacritics</title>
<para>
These mappings speed up typing European languages which contain diacritic
characters such as a-umlaut etc.
<programlisting>+<l> expands to \v{<l>}
=<l> expands to \'{<l>}</programlisting>
where <literal><l></literal> is an alphabet.
</para>
<programlisting>+} expands to \"{a}
+: expands to \^{o}</programlisting>
<para>
&ls; also ships with <link linkend="smart-backspace">smart
backspacing</link> functionality which provides another convenience while
editing languages with diacritics.
</para>
<note>
<para>Diacritics are disabled by default in &ls; because they can
sometimes be a little too intrusive. Moreover, most European users can
nowadays use font encodings which display diacritic characters directly
instead of having to rely on &ls;'s method of displaying diacritics.</para>
<para>Set the <link linkend="Tex_Diacritics">g:Tex_Diacritics</link>
variable to enable diacritics.</para>
</note>
</section>
<section id="bibtex-bindings">
<title>BibTeX Shortcuts</title>
<para>
&ls; provides an easy way of entering bibliographic entries. Four
insert-mode mappings: <literal>BBB</literal>, <literal>BBL</literal>,
<literal>BBH</literal> and <literal>BBX</literal> are provided, all of
which essentially act in the same manner. When you type any of these in
insert-mode, you will get a prompt asking you to choose a entry type
for the bibliographic entry.
</para>
<para>
When you choose an entry type, a bibliographic entry template will be
inserted. For example, if you choose the option
<literal>'book'</literal> via the map <literal>BBB</literal>, then
the following template will be inserted:
<programlisting>@BOOK{<+key+>,
author = {&ph;},
editor = {&ph;},
title = {&ph;},
publisher = {&ph;},
year = {&ph;},
otherinfo = {&ph;}
}&ph;</programlisting>
</para>
<para>
<literal><+key+></literal> will be highlighted in select-mode and
you can type in the bib-key. After that you can use
<literal><Ctrl-J></literal> to navigate to successive locations
in the template and enter new values.
</para>
<para>
<literal>BBB</literal> inserts a template with only the fields
mandatorily required for a given entry type. <literal>BBL</literal>
inserts a template with commonly used extra options.
<literal>BBH</literal> inserts a template with more options which are
not as commonly used. <literal>BBX</literal> inserts a template with
all the fields which the entry type supports.
</para>
<note>
<title>Mnemonic</title>
<para>
<literal>B</literal> for Bibliographic entry, <literal>L</literal>
for Large entry, <literal>H</literal> for Huge entry, and
<literal>X</literal> stands for all eXtras.
</para>
</note>
<section id="adding-bib-options">
<title>Customizing Bib-TeX fields</title>
<para>
If you wish the <literal>BBB</literal> command to insert a few
additional fields in addition to the fields it creates, then you will
need to define global variables of the form
<programlisting>g:Bib_{type}_options</programlisting>
in you <literal>$VIM/ftplugin/bib.vim</literal> file, where
<literal>{type}</literal> is a string like
<literal>'article'</literal>, <literal>'book'</literal> etc. This
variable should contain one of the letters defined in the following
table
</para>
<informaltable frame="all">
<tgroup cols="2">
<thead>
<row>
<entry>Character</entry>
<entry>Field Type</entry>
</row>
</thead>
<tbody>
<row><entry>w</entry><entry>address</entry></row>
<row><entry>a</entry><entry>author</entry></row>
<row><entry>b</entry><entry>booktitle</entry></row>
<row><entry>c</entry><entry>chapter</entry></row>
<row><entry>d</entry><entry>edition</entry></row>
<row><entry>e</entry><entry>editor</entry></row>
<row><entry>h</entry><entry>howpublished</entry></row>
<row><entry>i</entry><entry>institution</entry></row>
<row><entry>k</entry><entry>isbn</entry></row>
<row><entry>j</entry><entry>journal</entry></row>
<row><entry>m</entry><entry>month</entry></row>
<row><entry>z</entry><entry>note</entry></row>
<row><entry>n</entry><entry>number</entry></row>
<row><entry>o</entry><entry>organization</entry></row>
<row><entry>p</entry><entry>pages</entry></row>
<row><entry>q</entry><entry>publisher</entry></row>
<row><entry>r</entry><entry>school</entry></row>
<row><entry>s</entry><entry>series</entry></row>
<row><entry>t</entry><entry>title</entry></row>
<row><entry>u</entry><entry>type</entry></row>
<row><entry>v</entry><entry>volume</entry></row>
<row><entry>y</entry><entry>year</entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
For example, by default, choosing <literal>'article'</literal> via
<literal>BBB</literal> inserts the following template by default
<programlisting>@ARTICLE{<+key+>,
author = {&ph;},
title = {&ph;},
journal = {&ph;},
year = {&ph;},
otherinfo = {&ph;}
}&ph;</programlisting>
However, if <literal>g:Bib_article_options</literal> is defined as
<literal>'mnp'</literal>, then <literal>'article'</literal> will
insert the following template
<programlisting>@ARTICLE{<+key+>,
author = {&ph;},
title = {&ph;},
journal = {&ph;},
year = {&ph;},
month = {&ph;},
number = {&ph;},
pages = {&ph;},
otherinfo = {&ph;}
}&ph;</programlisting>
</para>
<para>
If you have some other fields you wish to associate with an article
which are not listed above, then you will have to use the
<literal>Bib_{type}_extrafields</literal> option. This is a newline
separated string of complete field names which will be included in the
template. For example, if you define
<programlisting>let g:Bib_article_extrafields = "crossref\nabstract"</programlisting>
then the article template will include the lines
<programlisting>crossref = {&ph;},
abstract = {&ph;},</programlisting>
</para>
<note>
<para>
You will need to define <literal>Bib_*</literal> settings in your
<literal>$VIMRUNTIME/ftplugin/bib.vim</literal> file.
</para>
</note>
</section>
</section>
<section id="smart-keys">
<title>Smart Key Mappings</title>
<para>
&ls; ships with the following smart keys:
</para>
<formalpara>
<anchor id="smart-backspace" />
<title>Smart Backspace</title>
Pressing <literal><BS></literal> in insert mode checks to see
whether we are just after something like <literal>\'{a}</literal> and
if so, deletes all of it. i.e, diacritics are treated as single
characters for backspacing.
You might want to disable this feature, if you are editing
Chinese, Japanese or Korean text.
</formalpara>
<formalpara>
<title>Smart Quotes</title>
Pressing <literal>"</literal> (English double quote) will insert
<literal>``</literal> or <literal>''</literal> by making an
intelligent guess about whether we intended to open or close a quote.
</formalpara>
<formalpara>
<title>Smart Space</title>
&ls; maps the <literal><space></literal> key in such a
way that $ characters are not broken across lines. It does this by
first setting <literal>tw=0</literal> so that Vim will not
automatically break lines and then maps the
<literal><space></literal> key to insert newlines keeping
<literal>$$</literal>'s on the same line.
</formalpara>
<formalpara>
<title>Smart Dots</title>
Pressing <literal>...</literal> (3 dots) results in
<literal>\ldots</literal> outside math mode and
<literal>\cdots</literal> in math mode.
</formalpara>
</section>
<section id="altkey-mappings">
<title>Alt Key Macros</title>
<para>
&ls; utilizes a set of macros originally created by Carl Mueller in
auctex.vim to make inserting all the <literal>\left ... \right</literal>
stuff very easy and to also make some use of the heavily under-utilized
<literal><Alt></literal> key.
</para>
<note>
<para>
By default, the mappings involving the <literal><Alt></literal> key
are turned off for compatibility with inserting non-ASCII characters. It
can be enabled by setting
<programlisting>let g:Tex_AdvancedMath = 1</programlisting>
in your <literal>$VIM/ftplugin/tex.vim</literal>.
</para>
</note>
<note>
<para>
By default, typing <literal>Alt-<key></literal> in &vim; takes
focus to the menu bar if a menu with the hotkey
<literal><key></literal> exists. If in your case, there are
conflicts due to this behavior, you will need to set
<programlisting>set winaltkeys=no</programlisting>
in your <literal>$VIM/ftplugin/tex.vim</literal> in order to use these
maps.
</para>
</note>
<note>
<title>Customizing the maps</title>
<para>
If for some reason, you wish to not map the
<literal><Alt></literal> keys, (some European users need to use
the <literal><Alt></literal> key to enter diacritics), you can
change these maps to other keys as described in the section <link
linkend="customize-alt-key-maps">Customizing Alt-key maps</link>.
</para>
</note>
<section id="Alt-L">
<title><literal><Alt-L></literal></title>
<para>
This is a polymorphic insert-mode mapping which expands to one of the
following depending on the character just before the cursor location.
</para>
<informaltable frame="all">
<tgroup cols="2">
<colspec colwidth="0.5in" align="cener" />
<colspec colwidth="0.5in" />
<thead>
<row>
<entry>Character before cursor</entry>
<entry>Expansion</entry>
</row>
</thead>
<tbody>
<row><entry>(</entry> <entry><literal>\left( &ph; \right)</literal></entry></row>
<row><entry>[</entry> <entry><literal>\left[ &ph; \right]</literal></entry></row>
<row><entry>|</entry> <entry><literal>\left| &ph; \right|</literal></entry></row>
<row><entry>{</entry> <entry><literal>\left\{ &ph; \right\}</literal></entry></row>
<row><entry><</entry> <entry><literal>\langle &ph; \rangle</literal></entry></row>
<row><entry>q</entry> <entry><literal>\lefteqn{&ph;}&ph;</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
If the character before the cursor is none of the above, then it will
simply insert a <literal>\label{&ph;}&ph;</literal>.
</para>
</section>
<section id="Alt-B">
<title><literal><Alt-B></literal></title>
<para>
This insert-mode mapping encloses the previous character in
<literal>\mathbf{}</literal>.
</para>
</section>
<section id="Alt-C">
<title><literal><Alt-C></literal></title>
<para>
In insert mode, this key is polymorphic as follows:
</para>
<orderedlist>
<listitem>
If the previous character is a letter or number, then capitalize it and
enclose it in <literal>\mathcal{}</literal>.
</listitem>
<listitem>
otherwise insert <literal>\cite{}</literal>.
</listitem>
</orderedlist>
<para>
In visual mode, it will simply enclose the selection in
<literal>\mathcal{}</literal>
</para>
</section>
<section id="Alt-I">
<title><literal><Alt-I></literal></title>
<para>
This mapping inserts an <literal>\item</literal> command at the
current cursor location depending on which environment the cursor is
enclosed in. The style of the <literal>\item</literal> command is
dependent on the enclosing environment. By default,
<literal><Alt-I></literal> has styles defined forthe following
environments:
</para>
<informaltable frame="all">
<tgroup cols="2">
<thead>
<row>
<entry>Environment</entry>
<entry>Style</entry>
</row>
</thead>
<tbody>
<row><entry>itemize</entry><entry>\item </entry></row>
<row><entry>enumerate</entry><entry>\item </entry></row>
<row><entry>theindex</entry><entry>\item </entry></row>
<row><entry>thebibliography</entry><entry>\item[<+biblabel+>]{<+bibkey+>} <++></entry></row>
<row><entry>description</entry><entry>\item[<+label+>] <++></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
<literal><Alt-I></literal> is intelligent enough to
account for nested environments. For example,
<programlisting>\begin{itemize}
\item first item
\item second item
\begin{description}
\item[label1] first desc
\item[label2] second
% <Alt-I> will insert "\item[<+label+>] <++>" if
% used here
\end{description}
\item third item
% <Alt-I> will insert "\item " when if used here.
\end{itemize}
% <Alt-I> will insert nothing ("") if used here</programlisting>
</para>
<para>
The style used by <literal><Alt-I></literal> can be customized
using the <link
linkend="Tex_ItemStyle_environment"><literal>g:Tex_ItemStyle_environment</literal></link>
variable.
</para>
</section>
</section>
<section id="custom-macros-menu">
<title>Custom Macros</title>
<para>
This functionality available via the TeX-Suite.Macros menu, provides
a way of inserting customized macros into the current file via the
menu.
</para>
<para>
When &ls; starts up, it scans the
<literal>$VIM/ftplugin/latex-suite/macros/</literal> directory and
creates a menu from the files found there. Each file is considered as
a single macro. You can place your own macros in this directory,
using <link linkend="place-holders">placeholders</link> if wanted.
</para>
<para>
When you choose a macro from the menu, the corresponding file is read
into the current buffer after the current cursor position. In non-gui
mode, you can use the |TMacro| command instead of choosing from the
menu. This command takes the macro file name as an argument. When
called without arguments (preferred usage), then a list of available
macro files is displayed and the user is prompted to choose one of
them).
</para>
<para>
There are some other tools provided in this menu, namely:
</para>
<informaltable frame="none">
<tgroup cols="2">
<colspec colwidth="0.5in" />
<colspec colwidth="0.5in" />
<tbody>
<row><entry>{New}</entry>
<entry>
Creates a new (unnamed) buffer in the
latex-suite/macros/ directory. Use the command
:TexMacroNew in non-gui mode.
</entry>
</row>
<row>
<entry>{Edit}</entry>
<entry>
Opens up the corresponding macro file for editing. Use
|:TexMacroEdit| in non-gui mode. When you try to edit {macro}
not from local directory &ls; will copy it to your local
directory with suffix "-local". If local copy already exists
&ls; prompt for overwriting it.
</entry>
</row>
<row>
<entry>{Delete}</entry>
<entry>
Deletes the corresponding macro. Use the prefixed numbers for
fast navigation of menus. Use |:TexMacroDelete| in non-gui mode.
When you choose to delete {macro} which is not in your local
directory &ls; will refuse to delete it.
</entry>
</row>
<row>
<entry>{Redraw}</entry>
<entry>
Rescans the macros/ directories and refreshes the macros list.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section id="ls-new-macros">
<title>Making your own Macros via <literal>IMAP()</literal></title>
<para>
If you find the need to create your own macros, then you can use the
<literal>IMAP()</literal> function provided with &ls;. See <link
linkend="why-IMAP" endterm="why-IMAP.title"></link> for a short
explanation of why you might prefer <literal>IMAP()</literal> over
&vim;'s standard <literal>:imap</literal> command. An example best
explains the usage:
<programlisting>:call IMAP('NOM', '\nomenclature{&ph;}&ph;', 'tex')</programlisting>
This will create a &ls;-style mapping, where if you type
<literal>NOM</literal> in insert mode, you will get
<literal>\nomenclature{&ph;}&ph;</literal> with the cursor left in
place of the first <literal>&ph;</literal> characters. See <link
linkend="ls-imaps-syntax" endterm="ls-imaps-syntax.title"></link> for
a detailed explanation of the <literal>IMAP()</literal> command.
</para>
<para>
For maps which are triggered for a given filetype, the
<literal>IMAP()</literal> command above should be put in the filetype
plugin script for that file. For example, for tex-specific mappings,
the <literal>IMAP()</literal> calls should go in
<literal>$VIM/ftplugin/tex.vim</literal>. For globally visible maps,
you will need to use the following in either your
<literal>~/.vimrc</literal> or a file in your
<literal>$VIM/plugin</literal> directory.
<programlisting>augroup MyIMAPs
au!
au VimEnter * call IMAP('Foo', 'foo', '')
augroup END</programlisting>
</para>
<para>
<literal>IMAP</literal> mappings can be removed by
<literal>IUNMAP</literal>, e.g.,
<programlisting>call IUNMAP('FEM','tex')</programlisting>
</para>
<section id="why-IMAP">
<title id="why-IMAP.title">Why use <literal>IMAP()</literal></title>
<para>
Using <literal>IMAP</literal> instead of &vim;'s built-in
<literal>:imap</literal> command has a couple of advantages:
<orderedlist>
<listitem>
The 'ttimeout' option will generally limit how easily you can type
the left hand side for a normal <literal>:imap</literal>. if you type
the left hand side too slowly, then the mapping will not be
activated.
</listitem>
<listitem>
If you mistype one of the letters of the lhs, then the mapping is
deactivated as soon as you backspace to correct the mistake.
</listitem>
<listitem>
The characters in lhs are shown on top of each other. This is fairly
distracting. This becomes a real annoyance when a lot of characters
initiate mappings.
</listitem>
</orderedlist>
</para>
</section>
<section id="ls-imaps-syntax">
<title id="ls-imaps-syntax.title">IMAP() syntax</title>
<para>
Formally, the syntax which is used for the <literal>IMAP</literal>
function is:
<programlisting>call IMAP (lhs, rhs, ft [, phs, phe])</programlisting>
</para>
<para>
<informaltable frame="all">
<tgroup cols="2">
<thead>
<row>
<entry>Argument</entry>
<entry>Explanation</entry>
</row>
</thead>
<tbody>
<row>
<entry>lhs</entry>
<entry>
<para>
This is the "left-hand-side" of the mapping. When you use
<literal>IMAP</literal>, only the last character of this word is
actually mapped, although the effect is that the whole word is
mapped.
</para>
<para>
If you have two mappings which end in a common
<literal>lhs</literal>, then the mapping with the longer
<literal>lhs</literal> is used. For example, if you do
<programlisting>call IMAP('BarFoo', 'something', 'tex')
call IMAP('Foo', 'something else', 'tex')</programlisting>
Then typing <literal>BarFoo</literal> inserts
<literal>"something"</literal>, whereas <literal>Foo</literal> by
itself inserts <literal>"something else"</literal>.
</para>
<para>
Also, the nature of <literal>IMAP()</literal> makes creating
certain combination of mappings impossible. For example if you
have
<programlisting>call IMAP('foo', 'something', 'tex')
call IMAP('foobar', 'something else', 'tex')</programlisting>
Then you will never be able to trigger <literal>"foobar"</literal>
because typing <literal>"foo"</literal> will immediately insert
<literal>"something"</literal>. This is the "cost" which you incur
over the normal <literal>:imap</literal> command for the
convenience of no 'timeout' problems, the ability to correct
<literal>lhs</literal> etc.
</para>
</entry>
</row>
<row>
<entry>rhs</entry>
<entry>
<para>
The "right-hand-side" of the mapping. This is the expansion you
will get when you type <literal>lhs</literal>.
</para>
<para>
This string can also contain special characters such as
<literal><enter></literal> etc. To do this, you will need
to specify the second argument in double-quotes as follows:
<programlisting>:call IMAP('EFE', "\\begin{figure}\<CR>&ph;\\end{figure}&ph;", 'tex')</programlisting>
With this, typing <literal>EFE</literal> is equivalent to typing
in the right-hand side with all the special characters in
insert-mode. This has the advantage that if you have filetype
indentation set up, then the right hand side will also be
indented just as if you had typed it in normally.
</para>
<anchor id="IMAP_PutTextWithMovement" />
<para>
You can also set up a &ls; style mapping which calls a custom function
as follows:
<programlisting>:call IMAP('FOO', "\<C-r>=MyFoonction()\<CR>", 'tex')</programlisting>
where <literal>MyFoonction</literal> is a custom function you have
written. If <literal>MyFoonction</literal> also has to return a string
containing <literal>&ph;</literal> characters, then you will need to
use the function <literal>IMAP_PutTextWithMovement()</literal>. An
example best explains the usage:
</para>
<programlisting>call IMAP('FOO', "\<C-r>=AskVimFunc()\<CR>", 'vim')
" Askvimfunc: Asks For Function Name And Sets Up Template
" Description:
function! AskVimFunc()
let name = input('Name of the function : ')
if name == ''
let name = "<+Function Name+>"
end
let islocal = input('Is this function scriptlocal ? [y]/n : ', 'y')
if islocal == 'y'
let sidstr = '<SID>'
else
let sidstr = ''
endif
return IMAP_PutTextWithMovement(
\ "\" ".name.": <+short description+> \<cr>" .
\ "Description: <+long description+>\<cr>" .
\ "\<C-u>function! ".name."(<+arguments+>)&ph;\<cr>" .
\ "<+function body+>\<cr>" .
\ "endfunction \" "
\ )
endfunction</programlisting>
<para>
</para>
</entry>
</row>
<row>
<entry>ft</entry>
<entry>
<para>
The file type for which this mapping is active. When this string
is left empty, the mapping applies for all file-types. A filetype
specific mapping will always take precedence.
</para>
</entry>
</row>
<row>
<entry>phs, phe</entry>
<entry>
<para>
If you prefer to write the <literal>rhs</literal> with characters
other than <literal><+</literal> and <literal>+></literal>
to denote place-holders, you can use the last 2 arguments to
specify which characters in the <literal>rhs</literal> specify
place-holders. By default, these are <literal><+</literal> and
<literal>+></literal> respectively.
</para>
<para>
Note that the <literal>phs</literal> and <literal>phe</literal>
arguments do not control what characters will be displayed for
the placeholders when the mapping is actually triggered. What
characters are used to display place-holders when you trigger an
<literal>IMAP</literal> are controlled by the <link
linkend="Imap_PlaceHolderStart"><literal>Imap_PlaceHolderStart</literal></link>
and <link
linkend="Imap_PlaceHolderEnd"><literal>Imap_PlaceHolderEnd</literal></link>
settings.
</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</section>
</section>
</section>
<section id="latex-packages">
<title>Package Handling</title>
<para>
&ls; has a lot of functionality written to ease working with packages.
Packages here refers to files which you include into the &latex;
document using the <literal>\usepackage</literal> command.
</para>
<section id="inserting-packages">
<title>Inserting package commands</title>
<para>
When you first invoke &ls;, it scans the
<literal>$VIM/ftplugin/latex-suite/packages</literal> directory for
package script files and creates a menu from all the files found there.
This menu is created under <literal>TeX-Suite > Packages >
Supported</literal>. This menu contains a list of packages "supported"
by &ls;. When you choose one of the packages from this menu (for example
the <literal>amsmath</literal> package), then a line of
the form
<programlisting>\usepackage[&ph;]{amsmath}&ph;</programlisting>
will be inserted into the current file.
</para>
<para>
The <literal>\usepackage</literal> line can also be inserted in an easy
manner in the current file by pressing <literal><F5></literal>
while in the preamble of the current document. This will set up a prompt
from the supported packages and ask you to choose from one of them. If
you do not find the package you want to insert in the list, you can type
in a package-name and it will use that. Pressing
<literal><F5></literal> in the preamble on a line containing a
single word will construct a <literal>\usepackage</literal> line from
that word.
</para>
<para>
You can also use the <link
linkend="TPackage"><literal>TPackage</literal></link> to insert the
<literal>\usepackage</literal> line.
</para>
<para>
Once you have inserted a <literal>\usepackage</literal> line, for
supported packages, you can use the Options and Commands menus
described in the <link linkend="package-actions">next section</link>.
</para>
</section>
<section id="package-actions">
<title>Actions taken for supported packages</title>
<para>
&ls; takes the following actions for packages detected when a file is
loaded, or a new <literal>\usepackage</literal> line is inserted using
one of the methods described in the <link
linkend="inserting-packages">previous section</link>.
</para>
<para>
If you are using the GUI and you have <link
linkend="Tex_Menus">g:Tex_Menus</link> set to 1, &ls; will create the
following sub-menus
<simplelist>
<member><literal>TeX-Suite > Packages > <package> Options</literal></member>
<member><literal>TeX-Suite > Packages > <package> Commands</literal></member>
</simplelist>
</para>
<para>
where <literal><package></literal> is the package you just
inserted (or was detected). You can use these menus to insert commands,
environments and options which &ls; recognizes as belonging to this
package.
</para>
<note>
<para>
While inserting an option, you need to position yourself in the
appropriate place in the document, most commonly inside the square
braces in the <literal>\usepackage[]{packname}</literal> command. &ls;
will not navigate to that location.
</para>
</note>
<para>
In addition to creating these sub-menus, &ls; will also scan the
<literal>$VIM/ftplugin/latex-suite/dictionaries</literal> directory and
if a dictionary file corresponding to the package file is found, then
it will add the file to the <literal>'dict'</literal> setting in &vim;
so you can use the <literal><C-X><C-K></literal> command to
complete words from that file.
</para>
<para>
For example, the <literal>SIUnits</literal> package has a custom
dictionary.
</para>
<anchor id="latex-package-scanning" />
<para>
If a package detected at startup is found by &ls; in the current
directory or in a location specified by the <link
linkend="Tex_TEXINPUTS">g:Tex_TEXINPUTS</link> variable, &ls; will
scan the package for <literal>\newenvironment</literal> and
<literal>newcommand</literal> lines and also append any commands and
environments found to the list of commands and environments which you
are prompted with when you press <link
linkend="inserting-env-f5"><literal><F5></literal></link> or <link
linkend="ls-imap-f7"><literal><F7></literal></link> in insert
mode.
</para>
</section>
<para>
In addition, the <literal>TeX-Suite > Packages</literal> menu also
contains the following submenus
</para>
<formalpara>
<title>Update</title>
This command is to be invoked with the cursor placed on the package
name. If the corresponding package is found, then a sub-menu with the
supported commands and options is created.
</formalpara>
<formalpara>
<title>Update All</title>
This function reads the preamble of the document for
<literal>\usepackage</literal> lines and if &ls; supports the detected
packages, then sub-menus containing the package options and commands
are created.
</formalpara>
<section id="automatic-package-detection">
<title>Automatic Package detection</title>
<para>
Whenever &ls; begins editing a new &latex; file, it scans it for
<literal>\usepackage{name}</literal> lines, and if a supported package
is found, then it will create sub-menus and add to the
<literal>'dict'</literal> setting as described above.
</para>
<para>
If a <link linkend="latex-master-file">master-file</link> has been specified,
then it will scan that file instead of the current file. See the section
<link linkend="custom-packages">Custom Packages</link>
to see which files &ls; will scan in more detail.
</para>
<para>
For all the packages detected in this manner, &ls; will take certain
actions as described in the section <link
linkend="package-actions">package support.</link>.
</para>
<section id="custom-packages">
<title>Custom Packages</title>
<para>
Often times, the preamble can become too long, and some people prefer
to put most of their personalization in a custom package and include
that using a <literal>\usepackage</literal> line. &ls; tries to search
such customs package for other <literal>\usepackage</literal> lines, so
that supported packages included in this indirect manner can also be
used to create sub-menus, extend the <literal>'dict'</literal> setting
etc. The most obvious place to place such custom packages is in the
same directory as the edited file. In addition, &latex; also supports
placing custom packages in places pointed to by the
<literal>$TEXINPUTS</literal> environment variable.
</para>
<para>
If you use the <literal>$TEXINPUTS</literal> variable in &latex;, and
you wish &ls; to search these custom packages for
<literal>\usepackage</literal> lines, then you need to initialize the
<link linkend="Tex_TEXINPUTS"><literal>g:Tex_TEXINPUTS</literal></link>
variable.
</para>
<para>
The <literal>g:Tex_TEXINPUTS</literal> variable needs to be set in the
same format which &vim; uses for the <literal>'path'</literal> setting.
This format is explained in detail if you do
<programlisting>:help file-searching</programlisting>
from within &vim;.
</para>
<para>
Therefore the value of <literal>g:Tex_TEXINPUTS</literal> will most
probably be different from <literal>$TEXINPUTS</literal> which your
native &latex; distribution uses.
</para>
<para>
Example:
<programlisting>let g:Tex_TEXINPUTS = '~/texmf/mypackages/**,./**'</programlisting>
The <literal>**</literal> indicates that all directories below the
directory <literal>~/texmf/mypackages</literal> and
<literal>./</literal> are to be scanned for custom packages.
</para>
<note>
<para>
The present directory <literal>'.'</literal> is always searched. You
need not include that in <literal>g:Tex_TEXINPUTS</literal>.
</para>
</note>
</section>
</section>
<section id="supporting-packages">
<title>Writing supporting for a package</title>
<para>
Supporting a package is easy and consists of writing a vim script with
the same name as the package and placing it in the
<literal>$VIM/ftplugin/latex-suite/packages</literal> directory. A
package script should define two variables as described in the next two
sections. In addition to these two variables, you can also define any
functions, environment definitions etc. in this file.
</para>
<section>
<title><literal>g:Tex_package_option_<package></literal></title>
<para>
This setting is a string containing a comma separated list of options
supported by this package.
</para>
<para>
Example:
<programlisting>g:Tex_package_option_mypack = 'opt1,opt2=,sbr:group1,opt3,opt4'</programlisting>
The <literal>=</literal> suffix means that the option takes a value.
Use <literal>sbr:group name</literal> to separate options into
sub-menus. All successive options will be clubbed into the
<literal>group1</literal> sub-menu till the next
<literal>sbr:</literal> option is encountered.
</para>
</section>
<section>
<title><literal>g:Tex_package_<package></literal></title>
<programlisting>
g:TeX_package_<package> = "pre:Command,pre:Command1"
More detailed example is in latex-suite/packages/exmpl file (slightly
outdated).
Here is short summary of prefixes which can be used in package files:
(x - place with cursor, &ph; - |placeholder|)
{env:command} Environment: creates simple environment template
\begin{command}
x
\end{command}&ph;
{eno:command} Environment with option:
\begin[x]{command}
&ph;
\end{command}&ph;
{ens:command[<<option>>]...} Environment special:
\begin[<<option>>]...{command}
&ph;
\end{command}&ph;
{bra:command} Brackets:
\command{x}&ph;
{brd:command} Brackets double:
\command{x}{&ph;}&ph;
{brs:command[<<option>>]...} Brackets special (as environment special:
\command[<+x+>]{&ph;}{&ph;}&ph;
{nor:command} Normal:
\command<Space
{noo:command} Normal with option:
\command[x]&ph;
{nob:command} Normal with option and brackets:
\command[x]{&ph;}&ph;
{pla:command} Plain:
command<Space
{spe:command} Special:
command <-literal insertion of command
{sep:command} creates separator. Good for aesthetics and usability :)
{sbr:command} Breaks menu into submenus. <command> will be title of submenu.
Can be used also in package variable.
Command can be also given without prefix:. The result is
\command
</programlisting>
</section>
</section>
</section>
<section id="latex-completion">
<title>Latex Completion</title>
<para>
&ls; provides an easy way to insert references to labels and
bibliographic entries and also provide filename arguments to commands
such as <literal>\includegraphics</literal>. Although the completion
capabilities are very diverse, &ls; only uses a single key
(<literal><F9></literal> by default) to do all of it. Pressing the
<literal><F9></literal> key does different things based on where
you are located. &ls; tries to guess what you might be trying to
complete at the location where you pressed
<literal><F9></literal>. For example, pressing
<literal><F9></literal> when you are within a
<literal>\ref</literal> command will try to list the
<literal>\label</literal>'s in the present directory. Pressing it when
you are in a <literal>\cite</literal> command will list bibliography
keys. &ls; also recognizes commands which need a file name argument and
will put up an explorer window for you to choose a filename.
</para>
<note id="ls-set-grepprg">
<title>Before you start with &ls;'s completion function...</title>
<para>
Most of &ls;'s completion capabilities depend on the
python interface of vim.
Both python2 and python3 are supported.
Hence,
<programlisting>python print "Hello."</programlisting>
or
<programlisting>python3 print("Hello.")</programlisting>
should work.
</para>
</note>
<section id="ls-completion-ref">
<title>&ls; <literal>\ref</literal> completion</title>
<para>
Pressing <literal><F9></literal> when you are within a partially
completed <literal>\ref</literal> command will split open a window
(named <literal>__OUTLINE__</literal>) which contains a nicely
formatted list of all the <literal>\label</literal>s found in the
present project. The <literal>\label</literal>s are heirarchically
arranged according to which <literal>\section</literal>,
<literal>\subsection</literal> etc of the overall document structure
they are present in. For example, when you first press
<literal><F9></literal> after typing <literal>\ref{</literal>,
you should see something like:
<programlisting>
+-- 54 lines: 2. Kinematics--------------------------------
+-- 98 lines: 3. Aerodynamics of the MFI thorax------------
+-- 40 lines: 4. Jump Resonance in Fourbar Mechanisms------
+-- 28 lines: 5. Design and Fabrication Issues-------------
</programlisting>
Each chapter is |fold|ed away so that you can quickly jump to the
correct section/subsection in which the relevant equation is defined.
This makes inserting references significantly faster for large projects
with hundreds of equations. You can then open some of the folds to see
for example:
<programlisting>
+-- 54 lines: 2. Kinematics--------------------------------
3. Aerodynamics of the MFI thorax
3.1. Aerodynamic modeling of the MFI wing forces
3.1.1. Geometric Specification
eqn:wingnormal-pos
\nhat = T_z(\theta_2) T_y(\theta_y)T_x(\theta_x)\nhat_0,
eqn:T-1
T_1(\theta_2) &= T_z(\theta_2)
</programlisting>
The <literal><Tab></literal> key is mapped in this window to
toggle folds so that you can quickly open/close folds in order to
navigate the heirarchy faster. Once you are positioned on a
label, press <literal><Enter></literal>. This closes the
<literal>__OUTLINE__</literal> window, returns to the window in which
you pressed <literal><F9></literal> and inserts the reference
at the current cursor position.
</para>
<note>
<title>Filtering labels by prefix</title>
<para>
You can press <literal><F9></literal> after typing part of the
<literal>\label</literal>. In this case, &ls; only presents
<literal>\label</literal>s which begin with the already filled
characters. You can use this to choose between equations, figures,
tables etc. if you consistently label equations to begin with
<literal>eqn:</literal>, figures to begin with <literal>fig:</literal>
etc. For example, with this scheme, pressing
<literal><F9></literal> after typing
<literal>\ref{eqn:</literal> will only list equations.
</para>
</note>
<note>
<para>
&ls; works the same way if you press <literal><F9></literal>
after any command which contains the letters <literal>ref</literal>.
Thus you can complete <literal>\eqref</literal> in exactly the same
manner.
</para>
</note>
<note>
<title>Requirements</title>
<para>
This method of preseting the <literal>\label</literal>s depends on Vim
being compiled with python[3] support. To check if you have this, see the
output of the <literal>:ver</literal> command. If you see something
like <literal>+python</literal> or <literal>+python3</literal>, you are all set. Failing this, you
will need to have <literal>python</literal> somewhere in your
<literal>$PATH</literal>.
</para>
</note>
</section>
<section id="latex-completion-cite">
<title>&ls; <literal>\cite</literal> completion</title>
<para>
&ls; provides an easy way to insert references to bibliographic
entries. Pressing <literal><F9></literal> when the cursor is
placed inside a partially completed <literal>\cite</literal> command
will split open a new window (named <literal>__OUTLINE__</literal>)
which contains a formatted and syntax highlighted list of all bibtex
entries found. For example, pressing <literal><F9></literal>
after typing <literal>\ref{</literal> should present you with a window
which looks something like this:
<programlisting>
Article [dickinson:science:99]
"Wing rotation and aerodynamic basis of insect flight"
M. H. Dickinson and F-O. Lehman and S. P. Sane
In Science, 1999
Article [ellington:84:part1]
"The Aerodynamics of Hovering Insect Flight. I. The Quasi-Steady Analysis"
Ellington, C P
In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984
Article [ellington:84:part2]
"The Aerodynamics of Hovering Insect Flight. II. Morphological Parameters"
Ellington, C P
In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984
</programlisting>
</para>
<para>
You can easily jump from one entry to another using the
<literal>'n'</literal> and <literal>'p'</literal> keys (to go to the
next / previous entry respectively).
</para>
<para>
You can also filter out a subset of the bibtex entries by pressing
<literal>'f'</literal> while in this window. Doing this presents the
following prompt:
<programlisting>
Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message)
[t] title [a] author [b] booktitle
[j] journal [y] year [p] bibtype
(you can also enter the complete field name)
Enter filter criterion [field<space>value]:
</programlisting>
At the prompt, type
<programlisting>a ellington</programlisting>
Notice that the letter a is an acronym for <literal>author</literal>
according to the prompt above. Therefore this filter only shows those
bibtex entries whose author field contains the text
<literal>ellington</literal>. You can keep narrowing your selection by
repeatedly filtering the results. If you would like to remove all the
filters and see all entries again, press 'a', which removes
all the filters.
</para>
<para>
You can also sort the bibtex entries based on a field. To do this,
press 's'. This will present you with a prompt like in the case of the
filter and you are asked to choose a field. In this case, you would
type in a single character. This sorts the entries according to that
field.
</para>
<note>
<para>
<literal><F9></literal> will also work in a similar way after any
command which contains the word <literal>cite</literal> in it. For
example, pressing <literal><F9></literal> will also work with
<literal>\citenum</literal> etc.
</para>
</note>
<para>
The following logic is applied to find out which bibliographic entries
are included in the completion.
</para>
<para>
<orderedlist>
<listitem>
<para>
Firstly, if the present file has a <link
linkend="latex-master-file">master-file</link> defined for it, then &ls;
will perform the following steps on that file instead of on the
current file.
</para>
</listitem>
<listitem>
<para>
The file is scanned for a <literal>\bibliography</literal>
command or a <literal>\addbibresource</literal> command.
For each bibliography file, &ls; tries to see if a
<literal>.bib</literal> file can be
found. If so, it will scan it for bib-keys of the form
<literal>@BOOK{</literal> etc., and add these searches to the
completion list.
</para>
<para>
Afterwards, &ls; scans recursively in <literal>\include</literal>d
and <literal>\input</literal>ed files.
</para>
<para>
You can set the location where &ls; will search for
<literal>.bib</literal> files using the
<link
linkend="Tex_BIBINPUTS"><literal>|Tex_BIBINPUTS|</literal></link>
variable.
</para>
</listitem>
</orderedlist>
</para>
<note>
<para>
By disabling the setting
<link linkend="Tex_UseCiteCompletionVer2">
<literal>Tex_UseCiteCompletionVer2</literal>
</link>,
&ls; will also look for <literal>.bbl</literal> files
(if no <literal>.bib</literal> file is found)
or a <literal>\begin{thebibliography}</literal>
environment.
However, a filtering of the results (as described above)
will not be available.
</para>
</note>
</section>
<section id="ls-filename-completion">
<title>&ls; filename completion</title>
<para>
When you press <literal><F9></literal> at a location where &ls;
guesses a filename needs to be typed, then a new explorer window will
open up with the list of files. You can use this window to change
directories etc. Pressing <literal><enter></literal> on a filename
in the explorer window will automatically close the explorer window,
return to the location where you pressed <literal><F9></literal>
from and insert the filename into that position.
</para>
<para>
&ls; also tries to guess what kinds of files you might not want to
insert and hides those accordingly. For example, if you press
<literal><F9></literal> when you are located at
<literal>\includegraphics{</literal>, then &ls; knows that you will not
want to insert <literal>.tex</literal> files. Therefore, the explorer
window will automatically hide these files.
</para>
<para>
As of now, &ls; recognizes the following commands for filename
completion. Along with the commands, this table also lists the
files which &ls; will not show for completing each command.
</para>
<informaltable frame="all">
<tgroup cols="2">
<thead>
<row>
<entry>command</entry>
<entry>hide pattern</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>\bibliography</literal></entry>
<entry><literal>'^\.,\.[^b]..$'</literal></entry>
</row>
<row>
<entry><literal>\include</literal> <literal>\includeonly</literal></entry>
<entry><literal>'^\.,\.[^t]..$'</literal></entry>
</row>
<row>
<entry><literal>\includegraphics</literal></entry>
<entry><literal>'^\.,\.tex$,\.bib$,\.bbl$,\.zip$,\.gz$'</literal></entry>
</row>
<row>
<entry><literal>\input</literal></entry>
<entry><literal>''</literal></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section id="ls-completion-custom">
<title>Custom command completion</title>
<para>
&ls; also recognizes certain commonly used &latex; commands for the
<literal><F9></literal> key. At the moment, the
<literal>\bibliographystyle</literal>, <literal>\addtocontents</literal>
and the <literal>\addcontentsline</literal> commands are recognized,
although more will be added in the future. When you press the
<literal><F9></literal> after such a command, &ls; will prompt
you with a list of arguments which make sense for the command.
</para>
<para>
This functionality is available for commands for which a global
variable of the form
<literal>g:Tex_completion_{<command>}</literal> is defined where
<literal><command></literal> is the command name. This variable
is a comma separated list of values which this command takes. For
example, the argument to the <literal>\bibliographystyle</literal>
command is commonly one of <literal>abbr,alpha,plain,unsrt</literal>.
Therefore, &ls; defines
<programlisting>let g:Tex_completion_bibliographystyle = 'abbr,alpha,plain,unsrt'</programlisting>
You can define your own completion variables in a similar manner for
commands which you might use.
</para>
</section>
</section>
<section id="latex-compiling">
<title>&latex; Compiling</title>
<para>
This functionality, available via the TeX-Suite menu, provides various tools
to compile and debug &latex; files from within &vim;.
</para>
<para>
If you are using commonly used LaTeX tools, then you should be all set
as soon as you download and install &ls;. In order to compile a
LaTeX file, simply press <literal>\ll</literal> while editing the file.
This runs latex on the current file and displays the errors in a
|quickfix-window| below the file being edited. You can then scroll
through the errors and press <literal><enter></literal> to be
taken to the location of the corresponding error. Along with the errors
being listed in the quickfix window, the corresponding log file is also
opened in |preview| mode beneath the quickfix window. It is scrolled
automatically to keep in sync with the error being viewed in the
quickfix window. You will be automatically taken to the location of the
first error/warning unless you set the <link
linkend="Tex_GotoError">g:Tex_GotoError</link> variable to 0.
</para>
<para>
&ls; also supports compiling &latex; into formats other than DVI. By
default, &ls; supports PDF and PS formats. In order to choose a format
other than DVI, use the <literal>TTarget</literal> command or the
<literal>TeX-Suite > Target Format</literal> menu item. This will ask you
to type in the name of the target format you want to compile to. If a rule
has been defined for the format (as described in the next
<link linkend="compiler-rules">section</link>), then &ls; will switch to
that format.
</para>
<para>Trying to choose a format for which no rule has been defined will
result in &ls; displaying a warning message without taking any action.
</para>
<para>
If you are using a multiple file project and need to compile a master
file while editing other files, then &ls; provides a way to specify the
file to be compiled as described in <link
linkend="latex-master-file">latex-master-file</link>.
</para>
<section id="compiler-rules">
<title>Setting Compilation rules</title>
<para>
In order to compile &latex; files into various formats, &ls; needs to know
which external programs to call and in which way they need to be called.
This information is provided to &ls; via a number of "rules". For each
format you want to compile to, you need to specify a rule. A rule is
specified by defining a variable of the form:
<programlisting>g:Tex_CompileRule_<format></programlisting>
where <literal><format></literal> is a string like
<literal>"pdf"</literal>, <literal>"dvi"</literal> etc.
</para>
<para>
Example: By default, &ls; uses the following rule for compiling &latex;
documents into DVI.
<programlisting>g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'</programlisting>
</para>
<para>
Default values are also provided for ps and pdf formats. You might want to
change these rules in texrc according to your local tex environment.
</para>
<note>
<para>
For win32 users user MikTeX, sometimes the latex compiler's output has a
bug where a single number is split across different lines. In this case,
put the included <literal>vim-latex</literal> file distributed with &ls;.
</para>
</note>
</section>
<section id="compiler-dependency">
<title>Handling dependencies in compilation</title>
<para>
&ls; also handles compiling dependencies automatically via certain
rules which specify the "dependency chain" for each target format.
For example, if in your case, you use
<programlisting>.tex -> .dvi -> .ps -> .pdf</programlisting>
to generate <literal>pdf</literal> files from <literal>dvi</literal>
files, then you will need to specify the following setting in your
&ls; configuration (see <link
linkend="customizing-latex-suite">customizing &ls;</link> for where
these settings should go):
<programlisting>
let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf'
</programlisting>
This is a comma separated string of formats specifying the order in
which the formats to be compiled into should be chosen. With this
setting, if you set the target format to <literal>pdf</literal>, then
the next time you compile via the <literal>\ll</literal> shortcut, &ls;
will first generate a <literal>dvi</literal> file, then use that to
generate the <literal>ps</literal> file and finally create the
<literal>pdf</literal> file from that.
</para>
<note>
<para>
If any of the intermediate formats is listed in the
<literal>g:Tex_MultipleCompileFormats</literal> setting as described
in the section <link linkend="compiling-multiple">Compiling multiple
times</link>, then &ls; might make multiple calls to the compiler to
generate the output file of that format.
</para>
</note>
<para>
Along with the <literal>g:Tex_FormatDependency_{format}</literal>
setting, you should ofcourse specify the rule for compiling to each of
the formats as described in the <link linkend="compiler-rules">previous
section</link>. For example, with the setting above, you could use:
<programlisting>
let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'
let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi'
let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps'</programlisting>
</para>
<note>
<para>
By default, &ls; does not specify any compiler dependencies. Each
target format for which a rule has been derived will be compiled
independently.
</para>
</note>
</section>
<section id="compiling-multiple">
<title>Compiling multiple times</title>
<para>
Most &latex; compilers need to be re-run several times in several
commonly occurring situations in order to get a final camera ready copy.
For example, when <literal>\label</literal>'s change, when new
<literal>\cite</literal> commands are added etc. If the target format
you are compiling to requires multiple compilations, then you will
need to include the format in the
<literal>g:Tex_MultipleCompileFormats</literal> setting. This is a
comma separated string of formats which need multiple compilations to
be generated correctly.
</para>
<para>
By default, this setting contains just the <literal>dvi</literal>
format. If you use the <literal>pdflatex</literal> compiler to generate
<literal>pdf</literal> files, then you might want to also include
<literal>pdf</literal> into the above setting.
</para>
<para>
For every format included in the
<literal>g:Tex_MultipleCompileFormats</literal> setting described
above, &ls; will use the following logic to generate the file. Note
that although the following description uses <literal>latex</literal>
to refer to the compiler, it could be some other compiler such as
<literal>pdflatex</literal> for generating <literal>pdf</literal>
output.
</para>
<para>
<orderedlist>
<listitem>If there was a <literal>.idx</literal> file, then remember
its contents.</listitem>
<listitem>Run <literal>latex</literal>.</listitem>
<listitem>If the <literal>.idx</literal> file changed due to the latex
compiler, then run <literal>makeindex</literal> to redo the
<literal>.ind</literal> file and then remember to rerun latex.
</listitem>
<listitem>
<para>
If the <literal>.aux</literal> file generated by the latex
compiler contains a <literal>\bibdata</literal> line, then it
means that we are using a <literal>.bib</literal> file. Therefore,
run <literal>bibtex</literal>.
</para>
<note>
<para>
This means that we will always run <literal>bibtex</literal>
whenever we use the <literal>\bibliography</literal> command
whether or not we actually need to. At this time, &ls; does not
parse the <literal>.aux</literal> file before and after the latex
compiler to see if we are required to rerun
<literal>bibtex</literal>.
</para>
</note>
</listitem>
<listitem>
If the <literal>.bbl</literal> file changes because of this, then
remember to rerun latex again.
</listitem>
<listitem>Also, we check to see if the &latex; compiler gives certain
standard warnings which notify that we need to compile once again. In
this case also, remember to rerun &latex;.</listitem>
<listitem>If we found we had to rerun latex, then we repeat
the steps above but not running <literal>makeindex</literal> or
<literal>bibtex</literal> again.</listitem>
</orderedlist>
</para>
<para>
The &latex; file is compiled atmost 5 times using this logic. These
steps will ensure that on most platforms/environments, you will get a
clean output with all the cross-references, citations etc correctly
labelled and ordered.
</para>
</section>
<section id="compiler-output-customization">
<title>Customizing the compiler output</title>
<para>
Most &latex; compilers produce a very large amount of output during
compilation, most of which is not relevant to debugging type-setting
errors. The compiler plugin provided with &ls; (which is an enhanced
version of the standard compiler plugin maintained by Artem Chuprina),
provides a way to filter the compiler output so that the actual
errors/warnings can be presented much more concisely.
</para>
<para>
The compiler plugin is set up by default to function in a "non-verbose",
"ignore-common-warnings" mode, which means that irrelevant lines from the
compiler output will be ignored and some very common warnings are also
ignored.
&ls; does this via the global variable <link
linkend="Tex_IgnoredWarnings"><literal>g:Tex_IgnoredWarnings</literal></link>.
This is a list of patterns, which can be used to filter out (or ignore)
some or the warnings and errors reported by the compiler. See the link
above for its default value.
</para>
<para>
&ls; uses the <link
linkend="Tex_IgnoreLevel"><literal>g:Tex_IgnoreLevel</literal></link>
setting to set a default ignore level. For example, for the default
value of 4, &ls; ignores warnings and errors matching the first 4
patterns in <literal>g:Tex_IgnoredWarnings</literal>.
</para>
<para>
In addition to setting a default value of the ignore level, &ls;
provides the ability to set the level dynamically, using the
<literal>TCLevel</literal> command. For example, if you issue the
command:
<programlisting>TCLevel 3</programlisting>
from within &vim;, then the next time you compile the document, &ls; will
ignore warnings and errors which match the first three patterns in
<literal>g:Tex_IgnoredWarnings</literal>.
</para>
<para>
When TCLevel is called with the unquoted string strict as follows:
<programlisting>TClevel strict</programlisting>
then &ls; switches to a "verbose", "no-lines-ignored" mode which is useful
when you want to make final checks of your document and want to be careful
not to let things slip by.
</para>
<para>
See the explanation of the settings <link
linkend="Tex_IgnoredWarnings">g:Tex_IgnoredWarnings</link> and <link
linkend="Tex_IgnoreLevel">g:Tex_IgnoreLevel</link> to find out how to
customize the filtering done by &ls;
</para>
</section>
<section id="part-compiling">
<title>Compiling parts of a file</title>
<para>
&ls; also provides a way to compile a fragment of a document. This can be
very useful while debugging a complex equation or one chapter in a book,
etc.
</para>
<para>
To do this, visually select a portion of the text and press
<literal>\ll</literal> while in visual mode. The visually selected portion
will be saved to a temporary file with the preamble from the current
document prepended. &ls; will then switch focus to this temporary file and
compile it. Continue to debug this file as required and then replace the
portion of the original file with this one.
</para>
<para>
Pressing <literal>\lv</literal> while viewing the temporary file will
view the output file generated from the temporary file, not the original
file
</para>
<para>
Two commands |TPartComp| and |TPartView| are provided to be able to get
this functionality via the command line.
</para>
<para>
From release 1.6 onwards of &ls;, the temporary file created
for part compilation will reside in the same directory as the file from
which the fragment is being created. This ensures that any relative
path-names defined in the fragment will still work. &ls; will
attempt to clean the temporary file(s) created when Vim exits.
</para>
</section>
<section id="external-compiling">
<title>Load log file after external compilation</title>
<para>
If you do not use &ls;, but an external program or script to compile
your tex documents, you can use
<programlisting>:cg | copen</programlisting>
to load (and parse) the <literal>.log</literal> file.
</para>
<para>
If you use vim to compile your documents, you might want to use
<programlisting>:let $max_print_line=1024</programlisting>
such that latex will not wrap the filenames. Otherwise, you could use it
as an environment variable or simply use
<programlisting>max_print_line=1024 pdflatex ...</programlisting>
in your terminal. If you are using latexmk, you should set
<programlisting>$ENV{'max_print_line'} = '1024';
$log_wrap = $ENV{'max_print_line'};</programlisting>
in your <literal>~/.latexmkrc</literal>.
</para>
</section>
</section>
<section id="latex-viewing">
<title>Latex Viewing and Searching</title>
<section id="latex-viewing-rules">
<title>Setting Viewing rules</title>
<para>
In order to view the output files created by compiling the source
files, you need to specify which external program &ls; should call. You
can specify the external program using one of two settings
<link linkend="Tex_ViewRule_format">Tex_ViewRule_format</link> or <link
linkend="Tex_ViewRuleComplete_format">Tex_ViewRuleComplete_format</link>.
By default, &ls; has default settings for viewing various common output
formats via the <literal>Tex_ViewRule_format</literal> settings, so
that if you are using commonly used programs, you should be all set to
view compiled files from within &vim; by simply pressing
<literal>\lv</literal>.
</para>
<note>
<para>
The viewing function also takes the <link
linkend="latex-master-file"><literal>*.latexmain</literal></link> file
into account to decide which file to show.
</para>
</note>
<para>
If pressing <literal>\lv</literal> does not work, then it most probably
has to do with incorrect settings of the <link
linkend="Tex_ViewRule_format"><literal>g:Tex_ViewRule_<format></literal></link>
where <literal><format></literal> is the format you are
attempting to view. See the link above for how to set this according to
your system.
</para>
<note>
<para>
On Windows and OS/X, you can leave the view rule empty to open the document
with the default viewer on your system. On Linux/UNIX systems, you can use
the <literal>xdg-open</literal> command to open the document with the default
viewer.
</para>
</note>
<para>
In addition to viewing the files, &ls; also supports forward and inverse
searching for certain common tools for viewing documents.
See the next few sections for details on forward and inverse searching,
including an overview of viewers.
</para>
</section>
<section id="forward-searching">
<title>Forward Searching documents</title>
<para>
Forward searching refers to making a viewer display a given document at
a given location from within &vim;. At present, these viewers are known to support
forward searching, but viewers that are not listed here may work, too:
<informaltable frame="all">
<tgroup cols="3">
<thead>
<row>
<entry>Viewer</entry>
<entry>OS</entry>
<entry>Supported documents</entry>
<entry>Comment</entry>
</row>
</thead>
<tbody>
<row>
<entry><ulink url="http://skim-app.sourceforge.net/">Skim</ulink></entry>
<entry>Apple / OS X Tiger</entry>
<entry>PDF</entry>
<entry>Supports also inverse searching</entry>
</row>
<row>
<entry><ulink url="http://pdfview.sourceforge.net/">PDFView</ulink></entry>
<entry>Apple / OS X</entry>
<entry>PDF</entry>
<entry>No longer in development, supports also inverse searching</entry>
</row>
<row>
<entry><ulink url="http://www2.ing.unipi.it/~d9615/homepage/texniscope.html">TeXniscope</ulink></entry>
<entry>Apple</entry>
<entry>PDF, DVI</entry>
<entry></entry>
</row>
<row>
<entry><ulink url="http://www.miktex.org/">YAP</ulink></entry>
<entry>Windows</entry>
<entry>DVI, PS</entry>
<entry>ships with MikTex</entry>
</row>
<row>
<entry><ulink url="http://blog.kowalczyk.info/software/sumatrapdf/">Sumatra PDF</ulink></entry>
<entry>Windows</entry>
<entry>PDF</entry>
<entry></entry>
</row>
<row>
<entry><ulink url="http://developer.kde.org/~kdvi/">kdvi</ulink></entry>
<entry>Linux/UNIX</entry>
<entry>DVI</entry>
<entry></entry>
</row>
<row>
<entry><ulink url="http://okular.kde.org/">okular</ulink></entry>
<entry>Linux/UNIX</entry>
<entry>DVI, PDF, PS and many more</entry>
<entry>Included in KDE 4</entry>
</row>
<row>
<entry><ulink url="http://math.berkeley.edu/~vojta/xdvi.html">xdvi</ulink></entry>
<entry>Linux/UNIX</entry>
<entry>DVI</entry>
<entry></entry>
</row>
<row>
<entry><ulink url="http://xdvi.sourceforge.net/">xdvik</ulink></entry>
<entry>Linux/UNIX</entry>
<entry>DVI</entry>
<entry></entry>
</row>
</tbody>
</tgroup>
</informaltable>
Pressing <literal>\ls</literal> from within &vim;
should make the viewer display the portion of the document where your
cursor is placed.
<note>
<para>
OS/X users need to set the <literal>g:Tex_TreatMacViewerAsUNIX</literal> flag
to <literal>1</literal> and provide a UNIX-like viewrule, that expects as
arguments the document, the linenumber and the sourcefile in this order.
</para>
</note>
</para>
<anchor id="enabling-searching" />
<note>
<title>Enabling Forward and Inverse Searching</title>
<para>
Most DVI viewers need "source-special" information in order to do
forward (and inverse) searching. This information is embedded in the
<literal>dvi</literal> file if the &latex; source is compiled with the
<literal>--src-specials</literal> option. By default, &ls; does not
supply this argument to the compiler. See the section on
<literal><link
linkend="Tex_CompileRule_format">g:Tex_CompileRule_dvi</link></literal>
to find out how this option can be set.
</para>
<para>
Pdf viewers usually use a synctex(.gz) file. This can be enabled with the compiler flag
<programlisting>-synctex=1</programlisting> for pdflatex.
Within this suite it is however enabled by default, unless you change
<literal><link linkend="Tex_CompileRule_format">g:Tex_CompileRule_pdf</link></literal>.
</para>
</note>
</section>
<section id="inverse-searching">
<title>Inverse Searching</title>
<para>
Inverse searching refers to a viewer (either <literal>pdf</literal> or <literal>dvi</literal>)
telling &vim; to display the &latex; source file at a given location.
Usually this happens with double-clicking or clicking while pressing the shift/control button
in the viewer window. The actual method depends on the viewer application.
</para>
<para>
You will need to <link linkend="enabling-searching">enable
searching</link> in order to use this functionality.
</para>
<para>
You will also need to specify certain settings to the viewer
conveying the syntax which it needs to use to tell &vim; how to display
the source file.
</para>
<para>
In windows you need to supply the following command in the apporpriate setting of your viewer:
<programlisting>"C:\Program Files\vim\vim74\gvim" -c ":RemoteOpen +%l %f"</programlisting>
Or if you have (g)&vim; added to your <literal>$PATH</literal> simply:
<programlisting>gvim -c ":RemoteOpen +%l %f"</programlisting>
The command <literal>:RemoteOpen</literal> is supplied when you install
&ls;. In <literal>YAP</literal>, you can set this option under
<literal>View > Options > Inverse Search</literal> in the Command Line field.
And in <literal>SumatraPdf</literal> you can set this option under
<literal>Settings > Options > Set inverse search command-line</literal>.
</para>
<para>
On *nix machines, &ls; attempts to call the DVI viewer in such a way
that it already knows how to communicate with &vim;. If this does not
seem to be working, you can use the <literal>RemoteOpen</literal>
command described above.
</para>
</section>
</section>
<section id="latex-folding">
<title>Latex Folding</title>
<para>
&ls; ships with the plugin SyntaxFolds.vim which is a plugin for
creating "fake" syntax folds on the fly. The fold method is actually manual
but the folding is based on &latex; syntax. This offers a speed increase over
regular syntax folding. Ofcourse it has the disadvantage that the folds are
not dynamic, i.e newly created syntax items are not automatically folded up.
(This is a compromise between speed and convenience).
</para>
<para>
When you open up a LaTeX file, all the portions will be automatically folded
up. However, no new folds will be created until you press
<literal>\rf</literal>. (rf
stands for "refresh folds").
</para>
<para>
The fold-text is set to the first line of the folded text unless the fold is a
table, figure etc. (an environment). In this case, if a \caption and/or a
label is found in the folded region, then those are used to make a more
meaningful fold-text, otherwise the second line of the environment is displayed
along with the name of the environment. In other words, the following
<programlisting>\begin{figure}[h]
\centering
\includegraphics[height=6cm]{slidercrank.pdf}
\caption{The Slider Crank Mechanism.}
\label{fig:slidercrank}
\end{figure}
% a LaTeX comment.
\begin{equation}
\sin(\pi) = 0
\end{equation}</programlisting>
</para>
<para>
will be shown as:
<programlisting>+--- 5 lines: figure (fig:slidercrank) : The Slider Crank Mechanism. -----
% a LaTeX comment.
+--- 3 lines: equation () : \sin(\pi) = 0 --------------------------------</programlisting>
</para>
<section id="default-folding">
<title>Default Folding Scheme in &ls;</title>
<para>
By default, &ls; creates folds in the following manner:
</para>
<programlisting>
\part
%%fakepart
\chapter
%%fakechapter
\section
%%fakesection
\subsection
%%fakesubsection
\subsubsection
%%fakesubsubsection
\paragraph
%%fakeparagraph
\item
\equation
\align
\figure
\table
\footnote</programlisting>
<para>
The indentation shows the "nestedness" of the folding scheme.
See the <link linkend="customizing-what-to-fold">next section</link> to
see how you can change this scheme.
</para>
</section>
<section id="customizing-what-to-fold">
<title>Customizing what to fold</title>
<para>
From version 1.6 onwards, the folding in &ls; can be controlled
to a large extent via a number of global variables.
</para>
<section id="Tex_FoldedSections">
<title>Tex_FoldedSections</title>
<para>
This entry defines which sections will be folded. This
setting is a comma separated list of section names.
The default value is:
<programlisting>part,chapter,section,subsection,subsubsection,paragraph</programlisting>
Each of the entries in the list will fold up a section of the
corresponding name and the corresponding <literal>%%fakesection</literal>.
The <literal>%%fakesection</literal> section is
provided as a means for the user to group lines into "fake" sections.
In particular, it is useful to fold the introduction of a <literal>section</literal>
that is not part of a <literal>subsection</literal>:
<programlisting>
\section{Latex-Suite}
%%fakesubsection Introduction
A short introduction of the features of Latex-Suite.
\subsection{Installation}
Installation instructions.</programlisting>
Without the <literal>%%fakesubsection</literal> the introduction would not be folded separately from the section.
</para>
<para>
It is also possible, to add section names at the same
level of hierarchy. These have to be separated by "|".
This is, e.g., useful for the KOMA classes, which add
"\addcap":
<programlisting>" let g:Tex_FoldedSections = 'part|addpart,chapter|addchap,section|addsec,subsection,subsubsection,paragraph,subparagraph'</programlisting>
</para>
<para>
See also <link linkend="fold-setting-advanced">advanced fold
settings</link>.
</para>
</section>
<section id="Tex_FoldedEnvironments">
<title>Tex_FoldedEnvironments</title>
<para>
This entry defines which environments will be folded. It is a
comma separated string of words each of which defines a single
environment. The default setting is
<programlisting>verbatim,comment,eq,gather,
align,figure,table,thebibliography,
keywords,abstract,titlepage</programlisting>
The words need not be standard Latex environments. You can
add any word you like. Also, each word will fold up all
environments whose name begins with that word. For example, in
the setting above, the word <literal>"align"</literal> folds up the
<literal>\begin{align}</literal>,
<literal>\begin{align*}</literal>,
<literal>\begin{aligned}</literal> environments. To avoid
this, you can replace the word <literal>"align"</literal> with
<literal>"align}"</literal>.
</para>
<para>
See also <link linkend="fold-setting-advanced">advanced fold
settings</link>.
</para>
</section>
<section id="Tex_FoldedCommands">
<title>Tex_FoldedCommands</title>
<para>
This entry defines which commands will be folded. It is a comma
separated string of words each of which defines a single command.
The default setting is empty, i.e no commands are folded.
The words need not be standard Latex commands. You can use whatever
words you like. Each word will fold all commands whose name begins
with that word as in the case of the <link
linkend="Tex_FoldedEnvironments">Tex_FoldedEnvironments</link>
variable.
</para>
<note>
<para>
It is very difficult to fold commands reliably because it is very
difficult to create a regexp which will match a line containing
unmatched parentheses (or curly brackets), but will not match a line
containing matched parentheses.
</para>
<para>
Just to make things safer, only lines which start a command but do
not contain additional curly braces after the command has started are
folded. In other words, if you wanted to fold the the command
<literal>"mycommand"</literal>, then the lines
<programlisting>\mycommand{This is a line
and some more text on the next line
}</programlisting>
will be folded, but the lines
<programlisting>\mycommand{This is a \textbf{line}
and some more text
}</programlisting>
will not be folded. This is a bug which is very difficult to fix.
</para>
<para>
Similarly, a command fold will stop at the first line containing a '}',
even if this brace does not correspond to the opening brace of the command.
</para>
</note>
<para>
See also <link linkend="fold-setting-advanced">advanced fold
settings</link>.
</para>
</section>
<section id="Tex_FoldedMisc">
<title>Tex_FoldedMisc</title>
<para>
This entry defines fold syntax for certain items which do not
naturally fit into the section, environment of command lists. It is a
comma separated list of words. The default value is:
<programlisting>item,preamble,<<<</programlisting>
<note>
<para>
Unlike the other Tex_FoldedXXXX variables, the words in this setting
are limited to take values from the following list:
</para>
<para>
<informaltable frame="all">
<tgroup cols="2">
<thead>
<row>
<entry>Value</entry>
<entry>Meaning</entry>
</row>
</thead>
<tbody>
<row>
<entry>comments</entry>
<entry>Folds up contiguous blocks of comments</entry>
</row>
<row>
<entry>item</entry>
<entry>Folds up the <literal>\item</literal>s within list
environments</entry>
</row>
<row>
<entry>preamble</entry>
<entry>Folds up the preamble of a document. (The part between
the <literal>\documentclass</literal> command and the
<literal>\begin{document}</literal> environment)</entry>
</row>
<row>
<entry><literal><<<</literal></entry>
<entry>Folds defined manually by the user using the
<literal><<<</literal> and
<literal>>>></literal> strings as fold-markers.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
Any other words in the <literal>Tex_FoldedMisc</literal> setting
are silently ignored.
</para>
</note>
</para>
<para>
See also <link linkend="fold-setting-advanced">advanced fold
settings</link>.
</para>
</section>
<section id="fold-setting-advanced">
<title>Advanced Fold setting details</title>
<para>
The order of the words in the <literal>Tex_FoldedXXXX</literal>
variables is <emphasis>important</emphasis>. The order defines the
order in which the folds are nested. For example, the value
<literal>"subsection,section"</literal> for the
<literal>Tex_FoldedSections</literal> variable will not fold any
subsections at all. This is because the folds are created in the
<emphasis>reverse</emphasis> order in which they occur in the
<literal>Tex_FoldedSections</literal> setting and also, once a fold is
created, the interior of the fold is not examined for creating
additional folds. In the above case, this means that a
<literal>\section</literal> is folded first and then its interior is
not examined further. The correct value should have been
<literal>"section,subsection"</literal>
</para>
<anchor id="fold-setting-adding" />
<para>
Each of the fold setting variables
<literal>Tex_FoldedSections</literal>,
<literal>Tex_FoldedEnvironments</literal> etc., as explained previously
is a comma separated string of variables. However, to make it easier
to <emphasis>add</emphasis> to the default settings without having to
repeat the whole default setting again, &ls; uses the following logic
in forming the complete setting string from the
<literal>Tex_FoldedXXXX</literal> variables. If the variable starts with
a comma, then <literal>Tex_FoldedXXXX</literal> is added to the end of
the default string rather than replacing it. Similarly, if it ends
with a comma, then it will be prepended to the beginning of the
default setting rather than replacing it.
</para>
<para>
For example, if <literal>Tex_FoldedEnvironments</literal> is set to the
string <literal>"myenv"</literal>, then only an environment of the
form <literal>\begin{myenv}</literal> will be folded. However, if the
<literal>Tex_FoldedEnvironments</literal> setting is
<literal>",myenv"</literal>, then the <literal>\begin{myenv}</literal>
environment will be folded after all other environments in the default
setting have been folded. On the other hand if
<literal>Tex_FoldedEnvironments</literal> is of the form
<literal>"myenv,"</literal>, the <literal>\begin{myenv}</literal>
environment will be folded before the rest of the environments in the
default setting.
</para>
</section>
</section>
</section>
<section id="latex-project">
<title>Multiple file &latex; projects</title>
<anchor id="latex-project-example" />
<para>
Many &latex; projects contain multiple source files which are
<literal>\include</literal>d from a master file. A typical example of
this situation is a directory layout such as the following
</para>
<para>
<programlisting>thesis/
main.tex
abstract.tex
intro/
intro.tex
figures/
fig1.eps
fig2.eps
chapter1/
chap1.tex
figures/
fig1.eps
conclusion/
conclusion.tex
figures/</programlisting>
</para>
<para>
In the above case, <literal>main.tex</literal> will typically look like
</para>
<para>
<programlisting>% file: main.tex
\documentclass{report}
\begin{document}
\input{abstract.tex}
\input{intro/intro.tex}
\input{chapter1/chap1.tex}
\input{conclusion/conclusion.tex}
\end{document}</programlisting>
</para>
<para>
<anchor id="latex-master-file-specification" /> In such situations, you will
need to convey to &ls; that <literal>main.tex</literal> is the main file
which <literal>\input</literal>s the other files. This is done by creating
an empty file called <literal>main.tex.latexmain</literal> in the same
directory in which <literal>main.tex</literal> resides. This file is called
the <emphasis>master file</emphasis> in this manual. See <link
linkend="Tex_MainFileExpression">Tex_MainFileExpression</link> for an
alternative way of specifying the master file.
</para>
<note>
<para>
Here <literal>main.tex.latexmain</literal> is (obviously) a different
file from <literal>main.tex</literal> itself.
<literal>main.tex</literal> need not be renamed. This ofcourse
restricts each directory to have a single master file.
</para>
</note>
<para>
Each time &ls; opens a new &latex; file, it will try to see if it is
part of a multiple file project by searching upwards (to the root of
the file-system) from the current file's directory to see if it finds a
file of the form <literal>*.latexmain</literal>. If such a file is
found, then it is considered that the current file is part of a larger
project. The name of the &latex; master file is inferred directly from
the first part of the <literal>*.latexmain</literal> file as described
in the example above.
</para>
<section id="latex-project-settings">
<title>&ls; project settings</title>
<para>
If a <link linkend="latex-master-file">master file</link> is found,
then &ls; <literal>:source</literal>s the file. Thus this file needs to
contain valid &vim; commands. This file is typically used to store
project specific settings.
</para>
<para>
Some typical per-project settings which are best put in the master file
are
<simplelist>
<member><link
linkend="Tex_ProjectSourceFiles">Tex_ProjectSourceFiles</link></member>
</simplelist>
</para>
</section>
<section id="latex-master-file">
<title>Specifying which file to compile</title>
<para>
In the example described <link
linkend="latex-project-example">previously</link>, if you are editing
<literal>intro/intro.tex</literal> and press <literal>\ll</literal>,
then you still want &ls; to compile <literal>main.tex</literal>,
because <literal>intro/intro.tex</literal> is merely a fragment which
is <literal>\input</literal>'ed into <literal>main.tex</literal>. If
the master file is already specified using the
<literal>*.latexmain</literal> convention described <link
linkend="latex-project-example">previously</link>, then &ls; will automatically
compile the master file when you are editing any of its
<literal>\input</literal>'ed fragments. Thus pressing
<literal>\ll</literal> while editing <literal>intro/intro.tex</literal>
will compile <literal>main.tex</literal>.
</para>
<anchor id="Tex_MainFileExpression" />
<para>
If you wish to use some different logic to specify the main file name,
you can specify a custom expression via the
<literal>Tex_MainFileExpression</literal> variable. This is a string
containing a valid vim expression. In addition, you can use a variable
<literal>modifier</literal> which is in the format used for
<literal>|filename-modifiers|</literal>, for example,
<literal>':p:h'</literal>. You should utilize this variable to modify
the filename of the main file.
<programlisting>let g:Tex_MainFileExpression = 'MainFile(modifier)'
function! MainFile(fmod)
if glob('*.latexmain') != ''
return fnamemodify(glob('*.latexmain'), a:fmod)
else
return ''
endif
endif</programlisting>
</para>
</section>
</section>
<section id="latex-suite-commands-maps">
<title>&ls; Commands and Maps</title>
<para>
This section describes the maps and commands used in &ls;. It also
describes a way to change the map sequences according to your
preference.
</para>
<section id="latex-suite-maps">
<title>&ls; Maps</title>
<anchor id="remapping-latex-suite-keys" />
<para>
Most of the mappings used in &ls; can be mapped to a different key
combination to suit your particular needs. An example best explains the
procedure for doing this. Suppose you want to remap the
<literal><C-j></literal> key which &ls; (actually imaps.vim) uses
to jump to the next placeholder. To do this, you first need to find out
which <literal><Plug></literal> mapping
<literal><C-j></literal> is derived from. You will need to look
at the relevant section of this manual to do this. For example, the
section <link linkend="customize-imap-maps">IMAP mappings</link> has
the information that the <literal><C-j></literal> key is derived
from <literal><Plug>IMAP_JumpForward</literal>. Therefore to
remap the <literal><C-j></literal> key to say
<literal><C-space></literal>, you will need to put a
statement like the following in your <literal>~/.vimrc</literal>.
<programlisting>imap <C-space> <Plug>IMAP_JumpForward</programlisting>
</para>
<note>
<para>
To change the <literal>IMAP</literal> mappings which affect jumping
between placeholders, the <literal>map</literal> statement above has
to be placed in your <literal>~/.vimrc</literal>. For other mappings
you can place the <literal>map</literal> statement in your
<literal>$VIM/ftplugin/tex.vim</literal> file. The reason for this is
that the <literal><C-j></literal> maps are created in
<literal>plugin/imaps.vim</literal>, which is sourced as soon as &vim;
starts before sourcing any ftplugin files.
</para>
</note>
<section id="customize-imap-maps">
<title>IMAP mappings</title>
<para>
These mappings are utilized for jumping between placeholders as
described <link linkend="place-holders">here</link>. See the <link
linkend="latex-suite-maps">parent section</link> to find out how to
use this information to change the default maps.
</para>
<anchor id="Plug_IMAP_JumpForward" />
<anchor id="Plug_IMAP_JumpBack" />
<anchor id="Plug_IMAP_DeleteAndJumpForward" />
<anchor id="Plug_IMAP_DeleteAndJumBack" />
<informaltable frame="all">
<tgroup cols="2">
<thead>
<row>
<entry>Plug map</entry>
<entry>Default Key</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal><Plug>IMAP_JumpForward</literal></entry>
<entry><literal><C-j></literal></entry>
</row>
<row>
<entry><literal><Plug>IMAP_JumpBack</literal></entry>
<entry>(none)</entry>
</row>
<row>
<entry><literal><Plug>IMAP_DeleteAndJumpForward</literal></entry>
<entry>(none)</entry>
</row>
<row>
<entry><literal><Plug>IMAP_DeleteAndJumpBack</literal></entry>
<entry>(none)</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
<literal><Plug>IMAP_JumpForward</literal> takes you to the
location of the next <link
linkend="place-holders">place-holder</link>.
</para>
<para>
<literal><Plug>IMAP_JumpBack</literal> takes you to the previous
<link linkend="place-holders">place-holder</link>.
</para>
<para>
<literal><Plug>IMAP_DeleteAndJumpForward</literal> deletes the
presently selected place-holder and jumps to the next place-holder
irrespective of whether the present placeholder is empty or not and
ignoring the value of place-holder settings like <link
linkend="Imap_DeleteEmptyPlaceHolders"><literal>g:Imap_DeleteEmptyPlaceHolders</literal></link>
and <link
linkend="Imap_StickyPlaceHolders"><literal>g:Imap_StickyPlaceHolders</literal></link>
</para>
<para>
<literal><Plug>IMAP_DeleteAndJumpBack</literal> deletes the
presently selected place-holder and jumps to the previous place-holder
irrespective of whether the present placeholder is empty or not and
ignoring the value of place-holder settings like <link
linkend="Imap_DeleteEmptyPlaceHolders"><literal>g:Imap_DeleteEmptyPlaceHolders</literal></link>
and <link
linkend="Imap_StickyPlaceHolders"><literal>g:Imap_StickyPlaceHolders</literal></link>
</para>
</section>
<section id="customize-alt-key-maps">
<title>Alt-Key mappings</title>
<para>
These mappings are are described in the section <link
linkend="altkey-mappings">Alt key macros</link>. See <link
linkend="remapping-latex-suite-keys">the parent section</link> to see
how to use the following information to remap keys.
</para>
<anchor id="Plug_Tex_MathBF" />
<anchor id="Plug_Tex_MathCal" />
<anchor id="Plug_Tex_LeftRight" />
<anchor id="Plug_Tex_InsertItemOnThisLine" />
<informaltable frame="all">
<tgroup cols="2">
<thead>
<row>
<entry>Plug Mapping</entry>
<entry>Default Key</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal><Plug>Tex_MathBF</literal></entry>
<entry><literal><Alt-B></literal></entry>
</row>
<row>
<entry><literal><Plug>Tex_MathCal</literal></entry>
<entry><literal><Alt-C></literal></entry>
</row>
<row>
<entry><literal><Plug>Tex_LeftRight</literal></entry>
<entry><literal><Alt-L></literal></entry>
</row>
<row>
<entry><literal><Plug>Tex_InsertItemOnThisLine</literal></entry>
<entry><literal><Alt-I></literal></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>
<section id="latex-suite-commands">
<title>Latex Suite Commands</title>
<section id="TMacro">
<title>:TMacro [{macro}]</title>
<para>
When used without any arguments lists all available macros defined
in runtime ftplugin/latex-suite/macros/ directories and prompts you
to choose one of them. With one argument |:read| this macro under
cursor position. With more than one argument it will not work :) In
Vim >= 6.2 works completion of names of macros (see 'wildmenu',
'wildmode' for more about command-line completion).
</para>
</section>
<section id="TMacroEdit">
<title>:TMacroEdit [{macro}]</title>
<para>
Splits window for editing {macro}. When used without any arguments
lists all available macros defined in runtime
ftplugin/latex-suite/macros/ directories and prompt you to choose
one of them. When you try to edit {macro} not from local directory
&ls; will copy it to your local directory with suffix
"-local". If local copy already exists &ls; prompt for
overwriting it. In Vim >= 6.2 works completion of names of macros
(see 'wildmenu', 'wildmode' for more about command-line completion).
</para>
</section>
<section id="TMacroNew">
<title>:TMacroNew</title>
<para>
Splits window to write new macro. Directory in new buffer is
locally changed to &ls;/macros/.
</para>
</section>
<section id="TMacroDelete">
<title>:TMacroDelete [{macro}]</title>
<para>
Delets {macro} from your local ftplugin/latex-suite/macros/
directory. When used without any arguments lists all available
macros defined in &ls;/macros/ directory and prompt you to
choose one of them. When you choose to delete {macro} which is not
in your local directory &ls; will refuse to delete it. In
Vim >= 6.2 works completion of names of macros (see 'wildmenu',
'wildmode' for more about command-line completion)
</para>
</section>
<section id="TPackage">
<title>:TPackage [{package, ...}]</title>
<para>
When used without any arguments lists name of the packages for
which support is available. If you are using &vim; GUI and have
<literal>Tex_Menus</literal> set to 1, then it will list all files
found in the <literal>$VIM/ftplugin/latex-suite/packages</literal>
directory. Otherwise, &ls; will list files found in the
<literal>$VIM/ftplugin/latex-suite/dictionaries</literal> directory.
Choosing a file from the list will insert a
<programlisting>\usepackage[&ph;]{<packname>}</programlisting> line into the
buffer at the current cursor location. For &vim; 6.2 and above, you
can use command-line completion to choose a package file. You can also
call <literal>TPackage</literal> with one or more package names
separated with spaces in which case, &ls; will insert
<literal>\usepackage</literal> lines for each of them in turn.
</para>
<para>
After inserting the <literal>\usepackage</literal> line(s), &ls; will
support it (them) in various ways as described in the section <link
linkend="package-actions">Actions taken for supported
packages</link>.
</para>
</section>
<section id="TPackageUpdate">
<title>:TPackageUpdate</title>
<para>
This command `reads' name of package under cursor and turns on
possible support.
</para>
</section>
<section id="TPackageUpdateAll">
<title>:TPackageUpdateAll</title>
<para>
After issuing this command latexSuite scans the file in
looking for not declared packages, removing not needed entries
from Packages menu and turning off not necessary packages'
dictionaries.
</para>
</section>
<section id="TTemplate">
<title>:TTemplate [{template}]</title>
<para>
When used without any arguments lists all available templates
from latex-suite/templates/ directory and prompts to choose
one of them.
With one argument :0|read| {template} file.
With more than one argument it will not work :)
In Vim >= 6.2 works completion of names of macros (see 'wildmenu',
'wildmode' for more about command-line completion)
</para>
</section>
<section id="TSection">
<title>:TSection [{argument}]</title>
<para>
Used without any arguments inserts last section type
(|latex-sectioning|).
Accepts arguments:
n> inserts section name in <n> logical level.
Levels are:
<informaltable>
<tgroup cols="2">
<tbody>
<row><entry>0</entry><entry>part</entry></row>
<row><entry>1</entry><entry>chapter</entry></row>
<row><entry>2</entry><entry>section</entry></row>
<row><entry>3</entry><entry>subsection</entry></row>
<row><entry>4</entry><entry>subsubsection</entry></row>
<row><entry>5</entry><entry>paragraph</entry></row>
<row><entry>6</entry><entry>subparagraph</entry></row>
</tbody>
</tgroup>
</informaltable>
<informaltable>
<tgroup cols="2">
<tbody>
<row>
<entry>
+<n>
</entry>
<entry>
inserts section name <n> logical levels above the last
used comand
</entry>
</row><row>
<entry>
-<n>
</entry>
<entry>
inserts section name <n> logical levels below the last
used comand
</entry>
</row><row>
<entry>
+
</entry>
<entry>
inserts section name one logical level below the last
used command (equal to +1).
</entry>
</row><row>
<entry>
++
</entry>
<entry>
inserts section name two logical levels below the last
used command (equal to +2).
</entry>
</row><row>
<entry>
-
</entry>
<entry>
inserts section name one logical level over the last
used command (equal to -1).
</entry>
</row><row>
<entry>
--
</entry>
<entry>
inserts section name two logical levels over the last
used command (equal to -2).
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
Command accepts also latexSuite mappings (|latex-macros|)
without preceding S and in lowercase:
<programlisting>:TSection pa</programlisting>
will result in <literal>\part{}</literal>. It is possible to use full names of
sections: <literal>:TSection part</literal>
</para>
</section>
<section id="TSectionAdvanced">
<title>:TSectionAdvanced</title>
<para>
Accepts the same arguments as |TSection| but leads to a couple
of questions (whether you want to include the section in the
table of contents, whether there is a shorter name for the
table of contents) and then creates a more intelligent
template.
</para>
</section>
<section id="TLook">
<title>:TLook</title>
<para>
Accepts one argument. Will look through .tex files in
directory of edited file for argument. It can be regexp. You
don't have to enclose argument in "". <cr> takes you to
location. Other keys work as described in |latex-viewer|.
Note: TLook uses :grep command and is using 'grepprg'. Its
regular expressions can be different from those of Vim.
</para>
</section>
<section id="TLookBib">
<title>:TLookBib</title>
<para>
Accepts one argument. Will look through .bib files in
directory of edited file for argument. It can be regexp. You
don't have to enclose argument in "". <cr> takes you to
location. Other keys work as described in |latex-viewer|.
</para>
<note>
<para>
TLookBib uses :grep command and is using 'grepprg'. Its
regular expressions can be different from those of Vim.
</para>
</note>
</section>
<section id="TLookAll">
<title>:TLookAll</title>
<para>
Accepts one argument. Will look through all files in directory
of edited file for argument. It can be regexp. You don't have
to enclose argument in "". <cr> takes you to location. Other
keys work as described in |latex-viewer|.
Note: TLook uses :grep command and is using 'grepprg'. Its
regular expressions can be different from those of Vim.
</para>
</section>
<section id="TPartComp">
<title>:TPartComp</title>
<para>
No argument allowed but accepts range in all formats. Define
fragment of interest with :'a,'b, :/a/,/b/, :'<,'> or :20,30.
All other rules of compilation apply.
</para>
</section>
<section id="TPartView">
<title>:TPartView</title>
<para>
Show last compiled fragment. All rules of viewing apply but
|latex-searching|.
</para>
</section>
<section id="Tshortcuts">
<title>:Tshortcuts [{arg}]</title>
<para>
Show shortcuts in terminal (not using menu). Without {arg}
you will see simple menu prompting for one of them. Possible
arguments:
<informaltable frame="none">
<tgroup cols="2">
<tbody>
<row><entry>g</entry><entry>General shortcuts</entry></row>
<row><entry>e</entry><entry>Environment shortcuts</entry></row>
<row><entry>f</entry><entry>Font shortcuts</entry></row>
<row><entry>s</entry><entry>Section shortcuts</entry></row>
<row><entry>m</entry><entry>Math shortcuts</entry></row>
<row><entry>a</entry><entry>All shortcuts</entry></row>
</tbody>
</tgroup>
</informaltable>
</para>
</section>
</section>
</section>
<section id="customizing-latex-suite">
<title>Customizing &ls;</title>
<para>
Customizing &ls; is done by defining certain global variables in
<literal>$VIM/ftplugin/tex.vim</literal>, where
<literal>$VIM</literal> corresponds to <literal>~/.vim</literal> for *nix
machines and <literal>~/vimfiles</literal> for windows machines. This file
is not part of the &ls; distribution. You will need to create this file
yourself (or modify it if it exists) if
you need to change any default settings. Since this file is not
included as part of the &ls; distribution, it will not be over-written in
subsequent updates.
</para>
<para>
The default settings in &ls; are defined in
<literal>$VIM/ftplugin/latex-suite/texrc</literal>. Please take a look at
this file if you find this documentation incomplete or confusing. That file
is also well documented.
</para>
<para>
This chapter describes the various settings which effect &ls; and their
default values. The settings are broken up into sections according to the
behavior which they influence.
</para>
<section id="ls-general-purpose-settings">
<title>General Settings</title>
<section id="Tex_Debug">
<title>Tex_Debug</title>
<para>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>0</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
If set to 1, then &ls; will create certain global debug
statements which can be printed by doing
<programlisting>:call Tex_PrintDebug()</programlisting>
</para>
</para>
</section>
<section id="Tex_UsePython">
<title>Tex_UsePython</title>
<para>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
If &ls; detects that your vim is python enabled (using
<literal>has('python')</literal> and <literal>has('python3')</literal>), then it tries to use python in
certain places to speed things up. If this misbehaves, you can set
this to zero, in which case, &ls; will use vimscript to accomplish
the same.
</para>
</para>
</section>
</section>
<section id="customizing-place-holders">
<title>Place-Holder Customization</title>
<para>
&ls; uses <link linkend="place-holders">place-holders</link> to minimize
using the movement keys while typing. The following settings affect how
place-holders are used.
</para>
<note>
<para>
These setting need to be set in your <literal>~/.vimrc</literal>, not
<literal>$VIM/ftplugin/tex.vim</literal> because these settings affect
the behavior of <literal>imaps.vim</literal>, which is a global plugin,
not a file-type plugin.
</para>
</note>
<section id="Imap_UsePlaceHolders">
<title>g:Imap_UsePlaceHolders</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
Setting this to zero completely disables using place-holders.
</para>
</section>
<section id="Imap_PlaceHolderStart">
<anchor id="Imap_PlaceHolderEnd"></anchor>
<title>g:Imap_PlaceHolderStart & g:Imap_PlaceHolderEnd</title>
<informaltable frame="all">
<tgroup cols="3">
<thead>
<row>
<entry>Setting</entry>
<entry>Type</entry>
<entry>Value</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>Imap_PlaceHolderStart</literal></entry>
<entry>String</entry>
<entry><literal>'<+'</literal></entry>
</row>
<row>
<entry><literal>Imap_PlaceHolderEnd</literal></entry>
<entry>String</entry>
<entry><literal>'+>'</literal></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
These settings affect the strings displayed at the beginning and end of
the place-holder string. Set these strings to a value different than a
commonly occurring sequence of characters.
</para>
<note>
<title>TIP</title>
<para>
If you use the <literal>latin1</literal> encoding and do not type in
french, then you can set these strings to the <literal>\xab</literal>
and <literal>\xbb</literal> characters (the french quotation marks).
</para>
</note>
</section>
<section id="Imap_DeleteEmptyPlaceHolders">
<title>g:Imap_DeleteEmptyPlaceHolders</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
When set to one, non-descriptive or empty place-holders are deleted on
pressing <literal><Ctrl-J></literal>.
</para>
</section>
<section id="Imap_StickyPlaceHolders">
<title>g:Imap_StickyPlaceHolders</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
When set to 1, in visual mode, <literal><Ctrl-J></literal> takes
you to the next placeholder without deleting the current placeholder.
</para>
</section>
<section id="Imap_GoToSelectMode">
<title>g:Imap_GoToSelectMode</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
When set to 1, <literal><Ctrl-J></literal> will switch
to select mode after selecting the placeholder. Otherwise,
it will switch to visual mode.
</para>
</section>
</section>
<section id="customizing-macros">
<title>Macro Customization</title>
<section id="customizing-macros-environments">
<title>Customizing the macros concerning environments</title>
<section id="Tex_Env_name">
<title>Tex_Env_name</title>
<para>
If you wish to wish to expand certain environments differently from
the way &ls; does it, you can define custom expansions using global
variables of the form <literal>Tex_Env_{name}</literal> where
<literal>name</literal> corresponds to the environment.
</para>
<para>
For example, if you press <literal><F5></literal> after typing
<literal>theorem</literal>, &ls; will by default expand it to
<programlisting>\begin{theorem}
\label{&ph;}&ph;
\end{theorem}&ph;</programlisting>
However, if you wish change this to
<programlisting>\begin{theorem}
&ph;
\end{theorem}&ph;</programlisting>
then define the following variable
<programlisting>let g:Tex_Env_theorem = "\\begin{theorem}\<CR>&ph;\<CR>\\end{theorem}"</programlisting>
</para>
<para>
If the expansion uses special keys such as carriage return etc, then
use double-quotes and use the <literal>"\<key>"</literal>
notation for special keys. Backslashes have to be doubled.
</para>
<para>
You could even use strings returned by functions as the expansion by
using the <link
linkend="IMAP_PutTextWithMovement">IMAP_PutTextWithMovement()</link>
function.
</para>
<para>
If the name of the environment contains special characters (for
example, the <literal>align*</literal> environment), then use the
following form:
<programlisting>let g:Tex_Env_{'align*'} =
\ "\\begin{align*}\<CR>&ph; &= &ph;\<CR>\\end{align*}&ph;"</programlisting>
This will make pressing <literal><F5></literal> after
<literal>align*</literal> expand to
<programlisting>\begin{align*}
&ph; &= &ph;
\end{align*}&ph;</programlisting>
</para>
</section>
<section id="Tex_Env_name_aliasto">
<title>Tex_Env_name_aliasto</title>
<para>
You may use this variable to set an alias to another environment.
</para>
<para>
For example, if you use the above mentioned <literal>theorem</literal>
environment a lot and want to save yourself from typing in the whole
word everytime you use the environment, you may set
<programlisting>
let g:Tex_Env_tr_aliasto = "theorem"</programlisting>
And next time you type <literal>tr</literal> and then press
<literal><F5></literal>, &ls; will expand it to either the default
<literal>theorem</literal> environment or the <literal>theorem</literal>
defined by you, based on whether <literal>g:Tex_Env_theorem</literal>
has been set.
</para>
<para>
If you try to expand to an environment that is neither built-in, nor defined
by you, &ls; would simply wrap it up with a barebone environment like:
<programlisting>
\begin{expanded_name}
<++>
\end{expanded_name}<++></programlisting>
</para>
<para>
And if an alias happen to have the same name with another environment, the
alias precedes the environment.
</para>
</section>
<section id="Tex_EnvLabelprefix_name">
<title>Tex_EnvLabelprefix_name</title>
<para>
By default, &ls; inserts labels without prefixes.
The setting <literal>Tex_EnvLabelprefix_{name}</literal>, where <literal>name</literal>
corresponds to the environment, is used to create labels with prefixes automatically.
For instance, if you use
<programlisting>
let g:Tex_EnvLabelprefix_equation = "eq:"</programlisting>
the prefix <literal>eq:</literal> is inserted in all labels in generated equations:
<programlisting>
\begin{equation}
&ph;
\label{eq:&ph;}
\end{equation}&ph;</programlisting>
This setting works for the environments
<literal>figure</literal>,
<literal>table</literal>,
<literal>theorem</literal>,
<literal>definition</literal>,
<literal>lemma</literal>,
<literal>proposition</literal>,
<literal>corollary</literal>,
<literal>assumption</literal>,
<literal>remark</literal>,
<literal>equation</literal>,
<literal>align</literal> and
<literal>multline</literal>.
</para>
</section>
<section id="Tex_EnvEndWithCR">
<title>Tex_EnvEndWithCR</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>0</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
If <literal>Tex_EnvEndWithCR</literal> is set to <literal>1</literal>, a carriage return (i.e., line break)
is inserted between <literal>\end{environment}</literal> and the last placeholder:
<programlisting>
\begin{equation}
&ph;
\label{&ph;}
\end{equation}
&ph;</programlisting>
</para>
</section>
<section id="Tex_ItemsWithCR">
<title>Tex_ItemsWithCR</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>0</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
If <literal>Tex_ItemsWithCR</literal> is set to <literal>1</literal>, a carriage return (i.e., line break)
is inserted after <literal>\item</literal> and the placeholder, e.g., <literal>itemize<F5></literal>
is expanded to
<programlisting>
\begin{itemize}
\item
&ph;
\end{itemize}
</programlisting>
</para>
</section>
<section id="Tex_LabelAfterContent">
<title>Tex_LabelAfterContent</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
If <literal>Tex_LabelAfterContent</literal> is set to <literal>0</literal>, the label is placed before the content of the environment:
<programlisting>
\begin{equation}
\label{&ph;}
&ph;
\end{equation}&ph;</programlisting>
</para>
</section>
<section id="Tex_UseMenuWizard">
<title>g:Tex_UseMenuWizard</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>0</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
If this variable is set to 1, then when an environment is chosen from the
menu then for selected environments, &ls; asks a series of
questions on the command line and inserts a template with the
corresponding fields already filled in. Setting this to zero will insert
a template with <link linkend="place-holders">place-holders</link>
marking off the places where fields need to be filled.
</para>
</section>
<section id="Tex_PromptedEnvironments">
<title>g:Tex_PromptedEnvironments</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>String</entry></row>
<row><entry>Default Value</entry> <entry><literal>'equation,equation*,align,align*,enumerate,itemize,figure,table'</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
This string represents a comma separated list of fields corresponding to
environments. Pressing <literal><F5></literal> in insert-mode in
the body of the document asks you to choose from one of these
environments to insert.
</para>
<para>
Leaving this string empty will leave the <literal><F5></literal>
key unmapped
</para>
</section>
<section id="Tex_HotKeyMappings">
<title>g:Tex_HotKeyMappings</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>String</entry></row>
<row><entry>Default Value</entry>
<entry><literal>'equation*,equation,bmatrix'</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
This string represents a comma separated list of environments which are
mapped to <literal><Shift-F-1></literal> through
<literal><Shift-F-4></literal>. For example, pressing
<literal><Shift-F-2></literal> with this setting inserts the
<literal>equation</literal> environment.
</para>
<para>
Leaving this string empty will leave <literal><Shift-F-1></literal> through
<literal><Shift-F-4></literal> unmapped.
</para>
<note>
<para>
Only the first four fields of this list are used. The rest are silently
ignored.
</para>
</note>
</section>
</section>
<section id="customizing-macros-commands">
<title>Customizing the macros concerning commands</title>
<section id="Tex_Com_name">
<title>Tex_Com_name</title>
<para>
If you wish to define new expansions for fast command insertion as
described <link linkend="latex-command-maps">here</link>, or redefine
expansions from the default values in &ls;, you will need to define
variables of the form <literal>g:Tex_Com_{name}</literal> where
<literal>name</literal> is a command name. For example, with the
setting
<programlisting>let g:Tex_Com_frac = "\\frac{&ph;}{&ph;}&ph;"</programlisting>
pressing <literal><F7></literal> after typing
<literal>frac</literal> will change it to <literal>\frac{&ph;}{&ph;}&ph;</literal>
</para>
<para>
See <link linkend="Tex_Env_name">Tex_Env_name</link> for additional
details on how to create this setting in various special
circumstances.
</para>
</section>
<section id="Tex_Com_name_aliasto">
<title>Tex_Com_name_aliasto</title>
<para>
Similar to <link linkend="Tex_Env_name_aliasto">Tex_Env_name_aliasto</link>,
this variable lets you set an alias to another command.
</para>
<para>
For example, if you use the above mentioned <literal>frac</literal>
a lot and want to save yourself some key strokes, you may set:
<programlisting>
let g:Tex_Com_fr_aliasto = "frac" </programlisting>
And next time you type <literal>fr</literal> and then press
<literal><F7></literal>, &ls; will expand it to
<literal>\frac{&ph;}{&ph;}&ph;</literal>.
</para>
<para>
If you try to expand to an command that is neither built-in, nor defined
by you, &ls; would simply wrap it up with a barebone command like:
<programlisting>
\expanded_name{<++>}<++></programlisting>
</para>
<para>
And if an alias happen to have the same name with another command, the
alias precedes the command.
</para>
</section>
<section id="Tex_PromptedCommands">
<title>g:Tex_PromptedCommands</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>String</entry></row>
<row><entry>Default Value</entry>
<entry>
<literal>'footnote,cite,pageref,label'</literal>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
This string represents a comma separated list of &latex; commands
which &ls; uses for the <literal><F7></literal> and
<literal><S-F7></literal> maps as described <link
linkend="latex-command-maps">here</link>.
</para>
<para>
Leaving this string empty will leave the <literal><F7></literal>
key unmapped.
</para>
</section>
<section id="Tex_ItemStyle_environment">
<title>Tex_ItemStyle_environment</title>
<para>
This setting affects the style which &ls; uses to insert an
<literal>\item</literal> when <literal><Alt-I></literal> is
pressed as described <link linkend="Alt-I">here</link>. By default
&ls; defines styles for the following environments:
</para>
<informaltable frame="all">
<tgroup cols="2">
<thead>
<row>
<entry>Environment</entry>
<entry>Style</entry>
</row>
</thead>
<tbody>
<row><entry>itemize</entry><entry>\item </entry></row>
<row><entry>enumerate</entry><entry>\item </entry></row>
<row><entry>theindex</entry><entry>\item </entry></row>
<row><entry>thebibliography</entry><entry>\item[<+biblabel+>]{<+bibkey+>} <++></entry></row>
<row><entry>description</entry><entry>\item[<+label+>] <++></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
Each style is defined by a variable of the form
<literal>g:Tex_ItemStyle_{envname}</literal> where
<literal>envname</literal> is the name of the environment for which
the style is defined. For example, by default
<programlisting>g:Tex_ItemStyle_description = '\item[<+label+>] <++>'</programlisting>
Redefining the style for a particular environment or defining a style
for an entirely new environment is simply a matter of setting the
value of a variable of the corresponding name.
</para>
</section>
</section>
<section id="macro-enabling">
<title>Enabling / disabling macros</title>
<para>
The following variables disable various parts of the macro functionality
of &ls;. See the links to the relevant sections to see what functionality
setting each of the variables to zero will take away.
</para>
<anchor id="Tex_EnvironmentMaps" />
<anchor id="Tex_EnvironmentMenus" />
<anchor id="Tex_FontMaps" />
<anchor id="Tex_FontMenus" />
<anchor id="Tex_SectionMaps" />
<anchor id="Tex_SectionMenus" />
<informaltable frame="all">
<tgroup cols="3">
<thead>
<row><entry>Setting</entry><entry>Link to relevant section</entry><entry>Default Value</entry></row>
</thead>
<tbody>
<row><entry><literal>g:Tex_EnvironmentMaps
</literal></entry><entry><link linkend="environment-mappings">Environment Mappings</link></entry><entry>1</entry></row>
<row><entry><literal>g:Tex_EnvironmentMenus</literal></entry><entry></entry><entry>1</entry></row>
<row><entry><literal>g:Tex_FontMaps </literal></entry><entry><link linkend="font-maps">Font Mappings</link></entry><entry>1</entry></row>
<row><entry><literal>g:Tex_FontMenus </literal></entry><entry></entry><entry>1</entry></row>
<row><entry><literal>g:Tex_SectionMaps </literal></entry><entry><link linkend="section-mappings">Section Mappings</link></entry><entry>1</entry></row>
<row><entry><literal>g:Tex_SectionMenus </literal></entry><entry></entry><entry>1</entry></row>
</tbody>
</tgroup>
</informaltable>
</section>
<section id="Imap_FreezeImap">
<title>g:Imap_FreezeImap</title>
<para>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>0</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
This option when set to 1, temporarily freezes &ls;'s macro
expansion. It might be useful when you are using some other keymap
which is causing excessive macro expansion. Use a buffer-local
variable of the same name if you wish to affect just the present
buffer.
</para>
</para>
</section>
<section id="Tex_CatchVisMapErrors">
<title>g:Tex_CatchVisMapErrors</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
With so many visual maps, its helpful to have a way of catching typing
errors made in visual mode. What this does is to prompt you to correct
your visual mode mapping if you start out with <literal><link
linkend="Tex_Leader">g:Tex_Leader</link></literal> and then type some
illegal keys. It basically maps just the <literal>g:Tex_Leader</literal>
character to a function.
</para>
</section>
<section id="Tex_Diacritics">
<title>g:Tex_Diacritics</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry> <entry><literal>0</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
Whether or not you want to use <link
linkend="diacritic-mappings">diacritics</link>.
</para>
</section>
<section id="Tex_Leader">
<title>g:Tex_Leader</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>String</entry></row>
<row><entry>Default Value</entry>
<entry><literal>'`'</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
The mappings in &ls; are by default prefixed with the back-tick
character. For example, <literal>`/</literal> inserts
<literal>\frac{&ph;}{&ph;}&ph;</literal> etc. You can change the
prefix with the following setting.
<literal>','</literal>, <literal>'/'</literal>,
<literal>'`'</literal> are preferred values. <literal>''</literal> or
<literal>'\'</literal> will lead to a <emphasis>lot</emphasis> of
trouble.
</para>
<para>
g:Tex_Leader is also used for visual mode mappings for fonts.
</para>
</section>
<section id="Tex_Leader2">
<title>g:Tex_Leader2</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>String</entry></row>
<row><entry>Default Value</entry>
<entry><literal>','</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
In order to avoid clashes between the large number of visual mode macros
provided, the <link linkend="enclosing-env-threeletter">visual mode
macros for environments</link> and sections start with a character
different from <literal>g:Tex_Leader</literal>.
</para>
</section>
</section>
<section id="customizing-smart-keys">
<title>Smart Key Customization</title>
<para>
These settings affect the smart key functionality as described <link
linkend="smart-keys">here</link>.
</para>
<section id="Tex_SmartKeyBS">
<title>g:Tex_SmartKeyBS</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
Whether or not <literal><Backspace></literal> deletes diacritics.
</para>
</section>
<section id="Tex_SmartKeyQuote">
<title>g:Tex_SmartKeyQuote</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
Whether or not the <link linkend="smart-keys">smart quotes</link>
functionality is available.
</para>
<para>
If enabled, the quote characters can be customized by setting the
following variables:
</para>
<informaltable frame="all">
<tgroup cols="2">
<thead>
<row>
<entry>Setting</entry>
<entry>Value</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>g:Tex_SmartQuoteOpen</literal></entry>
<entry><literal>"``"</literal></entry>
</row>
<row>
<entry><literal>g:Tex_SmartQuoteClose</literal></entry>
<entry><literal>"''"</literal></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
Non-English users will want to change these settings to their locale.
These global variables will be ignored if there are buffer-local
variables (with the same name), which may be set in the language specific
package files, such as
<literal>$VIM/ftplugin/latex-suite/packages/german</literal>.
</para>
</section>
</section>
<section id="customizing-latex-completion">
<title>Latex Completion Customization</title>
<para>
The following settings affect the <link linkend="latex-completion">
completion</link> functionality in &ls;.
</para>
<section id="completion-window-preferences">
<title>Window size settings</title>
<para>
These three settings affect the aesthetics of the completion
functionality.
</para>
<anchor id="Tex_ViewerCwindowHeight" />
<anchor id="Tex_ViewerPreviewHeight" />
<anchor id="Tex_ExplorerHeight" />
<anchor id="Tex_ImageDir" />
<informaltable frame="all">
<tgroup cols="3">
<thead>
<row>
<entry>Setting</entry>
<entry>Explanation</entry>
<entry>Default Value</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>g:Tex_ViewerCwindowHeight</literal></entry>
<entry>The height of the <literal>cwindow</literal> which displays the
list of <literal>\label</literal>s etc.</entry>
<entry>5</entry>
</row>
<row>
<entry><literal>g:Tex_ViewerPreviewHeight</literal></entry>
<entry>The height of the preview window which shows the context of a
<literal>\label</literal> etc.</entry>
<entry>10 </entry>
</row>
<row>
<entry><literal>g:Tex_ExplorerHeight</literal></entry>
<entry>The height of the explorer window which lists the files from
which to choose an image file.</entry>
<entry>10</entry>
</row>
<row>
<entry><literal>g:Tex_ImageDir</literal></entry>
<entry>The directory to scan for images</entry>
<entry>''</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section id="Tex_BIBINPUTS">
<title>g:Tex_BIBINPUTS</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>string</entry></row>
<row><entry>Default Value</entry>
<entry><literal>''</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
This string describes the directories which are scanned while trying
to search for <literal>.bib</literal> and <literal>.bbl</literal>
files. See the <link linkend="latex-completion-cite">cite completion
section</link> for more details.
</para>
<para>
This string should be set in the syntax accepted by &vim;'s native
<literal>'path'</literal> setting. Do not include the present
directory <literal>'.'</literal>. While searching for
<literal>bibliography</literal> files, the present directory will be
prepended to this variable.
</para>
</section>
<section id="Tex_UseOutlineCompletion">
<title>Tex_UseOutlineCompletion</title>
<para>
When set to 1 (default),
&ls; searches for <literal>\label</literal>s in all
<literal>.tex</literal> files of your project,
starting with the
<link linkend="latex-master-file">main file</link>
when <F9> is pressed. See <link
linkend="ls-completion-ref">\ref completion</link> for details.
</para>
</section>
<section id="Tex_UseSimpleLabelSearch">
<title>Tex_UseSimpleLabelSearch</title>
<para>
When set to 1 and if <literal>Tex_UseOutlineCompletion</literal> is 0,
&ls; searches for <literal>\label</literal>s in all
<literal>.tex</literal> files in the directory containing the file
being edited when <F9> is pressed. See <link
linkend="ls-completion-ref">\ref completion</link> for details.
</para>
</section>
<section id="Tex_ProjectSourceFiles">
<title>g:Tex_ProjectSourceFiles</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>String</entry></row>
<row><entry>Default Value</entry>
<entry><literal>''</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
This setting is meant to be initialized on a per-project basis using
the <link linkend="latex-master-file">&ls; master file</link> as
described in <link linkend="latex-project">&ls; Project</link>
section. It is a list of source files which are used in the project.
If defined, then instead of using the logic described in
<link
linkend="Tex_UseSimpleLabelSearch">Tex_UseSimpleLabelSearch</link> to
search for files in which to search for <literal>\label</literal>s, we
simply search for <literal>\label</literal>s in this list. This
significantly reduces the time it takes to generate the list of
possible completions for large projects.
</para>
<para>
The list is specified as a whitespace separated list of filenames
relative to the location of the main file.
</para>
</section>
<section id="Tex_UseCiteCompletionVer2">
<title>Tex_UseCiteCompletionVer2</title>
<para>
When set to 1 (default),
&ls; uses python to parse your bib-file.
See <link
linkend="latex-completion-cite">\cite completion</link> for details.
</para>
</section>
<section id="Tex_RememberCiteSearch">
<title>g:Tex_RememberCiteSearch</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>0</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
When this variable is non-zero, then &ls; will try to remember results
from the <literal>\cite</literal> completion.
This is only used if <literal>Tex_UseCiteCompletionVer2</literal>
is set to 0.
</para>
</section>
</section>
<section id="customizing-compiling">
<title>Compiler Customization</title>
<para>
The following settings affect &ls;'s compilation functionality
</para>
<section id="Tex_DefaultTargetFormat">
<title>g:Tex_DefaultTargetFormat</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>String</entry></row>
<row><entry>Default Value</entry>
<entry><literal>dvi</literal> for windows/*nix and
<literal>pdf</literal> for mac</entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
Use this setting to choose the default target format. For example,
setting this to <literal>pdf</literal> makes &ls; compile a pdf file
when you press <literal>\ll</literal> and fire up the
<literal>pdf</literal> viewer on pressing <literal>\lv</literal>. Make
sure that a rules for compiling and viewing have been defined for this
target format as described <link
linkend="Tex_CompileRule_format">here</link> and <link
linkend="Tex_ViewRule_format">here</link>.
</para>
</section>
<section id="Tex_CompileRule_format">
<title>g:Tex_CompileRule_<format></title>
<para>
Here <literal><format></literal> refers to the target format for
which this rule is defined. &ls; supports compiling into
<literal>dvi</literal>, <literal>ps</literal> and <literal>pdf</literal>
by default. All these rules are strings defined by default as follows:
</para>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row>
<entry><literal>g:Tex_CompileRule_dvi</literal></entry>
<entry><literal>'latex -interaction=nonstopmode $*'</literal></entry>
</row>
<row>
<entry><literal>g:Tex_CompileRule_ps</literal></entry>
<entry><literal>'ps2pdf $*'</literal></entry>
</row>
<row>
<entry><literal>g:Tex_CompileRule_pdf</literal></entry>
<entry><literal>'pdflatex -interaction=nonstopmode $*'</literal></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
If you desire forward and inverse searching via &ls;, you will need to
change <literal>g:Tex_CompileRule_dvi</literal> to include
<literal>-src-specials</literal>. However, this has been known to cause
problems with the output file. Therefore, use this with care.
</para>
</section>
<section fd="Tex_FormatDependency_format">
<title>g:Tex_FormatDependency_<format></title>
<para>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>string</entry></row>
<row><entry>Default Value</entry>
<entry><literal>''</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
By default, there are no format dependencies defined. Each definition
is of the form above where <literal><format></literal> is a
string such as <literal>'dvi'</literal> etc.
</para>
<para>
The value of each string is a comma separated string such as 'dvi,ps'.
See the <link linkend="compiler-dependency">Compiler dependency</link>
section to see how to use/specify this setting
</para>
</section>
<section id="Tex_MultipleCompileFormats">
<title>g:Tex_MultipleCompileFormats</title>
<para>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>string</entry></row>
<row><entry>Default Value</entry>
<entry><literal>'dvi'</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
</para>
<para>
This is a comma separated string of formats for which the compiler
needs to be called multiple times in order to get cross-references,
citations etc right. See the <link
linkend="compiling-multiple">Compiling multiple times</link> section
for details.
</para>
</section>
<section id="Tex_IgnoredWarnings">
<title>g:Tex_IgnoredWarnings</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>String</entry></row>
<row><entry>Default Value</entry>
<entry><literal>a new-line separated list of patterns as described
below</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
The default value of this setting is
<programlisting>\"Underfull\n".
\"Overfull\n".
\"specifier changed to\n".
\"You have requested\n".
\"Missing number, treated as zero.\n".
\"There were undefined references\n"
\"Citation %.%# undefined"</programlisting>
This setting defines a set of patterns which will be filtered out when
displaying the output from the latex compiler. This is to aid in
filtering out very common warnings/errors.
</para>
<note>
<para>
Remember to check the value of <link
linkend="Tex_IgnoreLevel"><literal>g:Tex_IgnoreLevel</literal></link>
when you change this setting. For example, if you append a new pattern
which you would like to ignore by default, increase the value of
<literal>g:Tex_IgnoreLevel</literal>.
</para>
</note>
</section>
<section id="Tex_IgnoreLevel">
<title>g:Tex_IgnoreLevel</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Integer</entry></row>
<row><entry>Default Value</entry>
<entry><literal>7</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
This setting defines a "filter level" or an "ignore level". A value of 7
for instance means that any warning/error matching with any of the first
7 fields of <link
linkend="Tex_IgnoredWarnings"><literal>g:Tex_IgnoredWarnings</literal></link>
will be ignored. Setting this value to zero will mean that no
error/warning is ignored. However, even with a value of zero, &ls; will
filter out most of the text which a &latex; compiler typically produces.
Use
<programlisting>TCLevel strict</programlisting>
from within &vim; in order to see all the lines from the compiler's
output.
</para>
</section>
<section id="Tex_UseMakefile">
<title>g:Tex_UseMakefile</title>
<para>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
When set to 1, then if a <literal>makefile</literal> or
<literal>Makefile</literal> is present in the current directory, then
&ls; sets the <literal>makeprg</literal> option to just
<literal>"make <target>"</literal>, where
<literal><target></literal> is the target format chosen using
the <literal>TCTarget</literal> or <literal>TTarget</literal>
commands.
</para>
<para>
When set to 0, then &ls; will set the <literal>makeprg</literal>
setting to whatever is defined by the <link
linkend="Tex_CompileRule_format">g:Tex_CompileRule_target</link>
setting.
</para>
</para>
</section>
<section id="Tex_GotoError">
<title>g:Tex_GotoError</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
If set to 1, then pressing <literal>\ll</literal> will take you to
the location of the first warning/error, otherwise you will remain in
the original location but the errors/warnings will be listed in the
preview window.
</para>
</section>
</section>
<section id="customizing-viewing">
<title>Viewer Customization</title>
<para>
The following settings affect how &ls; will display compiled files.
</para>
<section id="Tex_ViewRule_format">
<title>g:Tex_ViewRule_<format></title>
<para>
Here <literal><format></literal> refers to a format such as
<literal>dvi</literal>, <literal>ps</literal>, etc. This variable defines
the program which will be called to display a file of that format.
</para>
<para>
By default, &ls; defines viewer programs for viewing DVI, PS and PDF
formats as follows:
</para>
<informaltable frame="all">
<tgroup cols="3">
<thead>
<row>
<entry></entry>
<entry>Windows</entry>
<entry>Unix</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>g:Tex_ViewRule_dvi</literal></entry>
<entry><literal>'yap -1'</literal></entry>
<entry><literal>'xdvi'</literal></entry>
</row>
<row>
<entry><literal>g:Tex_ViewRule_ps</literal></entry>
<entry><literal>'gsview32'</literal></entry>
<entry><literal>'ghostview'</literal></entry>
</row>
<row>
<entry><literal>g:Tex_ViewRule_pdf</literal></entry>
<entry><literal>'AcroRd32'</literal></entry>
<entry><literal>'xpdf'</literal></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
For Macintosh systems, these strings are left empty by default. This lets
the system pick the program for each format. If you define these variables
for Mac, the system choice will be over-ridden.
</para>
<para>
&ls; appends <literal>file.format</literal> to the above settings
while calling the external programs. For example, with
<programlisting>let g:Tex_ViewRule_dvi = 'yap -1'</programlisting>
<literal>yap</literal> is called as
<programlisting>!start yap -1 file.dvi</programlisting> from within
&vim;. (The initial <literal>start</literal> is used on
<literal>Windows</literal> platforms is to make <literal>yap</literal>
start as a separate process.) If you find the way &ls; constructs the
command line too restrictive, you can use the <link
linkend="Tex_ViewRuleComplete_format"><literal>Tex_ViewRuleComplete_format</literal></link>
setting for more complete control on how the command line is
constructed while calling the external program for viewing.
</para>
<note>
<para>
For windows, you will need to set the <literal>$PATH</literal> variable
to include the paths to <literal>yap</literal>,
<literal>AcroRd32</literal>, <literal>gsview32</literal> and any other
programs. See your system documentation for how to do this.
</para>
</note>
<note>
<title>Default Viewing Format</title>
<para>
To change the default format for viewing files, set the <link
linkend="Tex_DefaultTargetFormat">g:Tex_DefaultTargetFormat</link>
variable.
</para>
</note>
</section>
<section id="Tex_ViewRuleComplete_format">
<title>Tex_ViewRuleComplete_<format></title>
<para>
Here <literal><format></literal> refers to the extension of a
output format such as <literal>dvi</literal>, <literal>html</literal>
etc.
</para>
<para>
<literal>Tex_ViewRuleComplete_format</literal> takes precedence over
<literal>Tex_ViewRule_format</literal> if both are specified. By
default, &ls; does not define values for
<literal>Tex_ViewRuleComplete_format</literal> for any
<literal>format</literal>. Unlike in the case of
<literal>Tex_ViewRule_format</literal>, &ls; does not modify
<literal>Tex_ViewRuleComplete_format</literal> at all in constructing
the command line. The only modification is to substitute
<literal>'$*'</literal> everywhere in the string with the name of the
file being viewed (without the extension).
</para>
<note>
<title>IMPORTANT</title>
<para>
Make sure you make the process go into the background otherwise vim
will wait for the viewer to terminate before letting you edit the file
again.
</para>
<para>
To make a process go into the background on a <literal>*nix</literal>
platform, use a trailing <literal>&</literal> in the setting. On
<literal>Windows</literal>, use <literal>start</literal> at the
beginning of the setting. Example: Suppose you have a latex->html
converter which converts a file say foo.tex to a file foo/index.html.
Then you would use:
<programlisting>" On *nix platform
let g:Tex_ViewRuleComplete_html = 'MozillaFirebird $*/index.html &'
" On windows platform
let g:Tex_ViewRuleComplete_html = 'start MozillaFirebird $*/index.html'</programlisting>
</para>
</note>
</section>
</section>
<section id="customizing-menus">
<title>Menu Customization</title>
<para>
In addition to using the variables defined in this section to affect
the menu-layout permanently (i.e, the layout &ls; will start with), you
can also use the <literal>TeX-Suite > Configure Menu</literal> menu to
dynamically configure the menu layout after &ls; has started.
</para>
<section id="Tex_Menus">
<title>g:Tex_Menus</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
If set to 0, &ls; will suppress showing all menus. Useful if you mostly
work in terminals.
</para>
</section>
<section id="Tex_MainMenuLocation">
<title><literal>g:Tex_MainMenuLocation</literal></title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>number</entry></row>
<row><entry>Default Value</entry>
<entry><literal>80</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
This setting decides the location of the first top-level &ls;
menu. You can for example shift all the menus created by &ls;
to the very end by setting this value to a large number like 990.
</para>
</section>
<section id="Tex_MathMenus">
<title>g:Tex_MathMenus</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
The <literal>Tex-Math</literal> menu consists of hundreds of mathematical
symbols used in &latex;. This menu comprises about 75% of the menus.
</para>
</section>
<section id="Tex_NestElementMenus">
<title>g:Tex_NestElementMenus</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
This setting controls the "compactness" of the menus. If set to 1, then the
Font, Counter and Dimensioning menus are collected together in a single
menu called <literal>Tex-Elements</literal>, otherwise, they will each get
a separate menu.
</para>
</section>
<section id="Tex_PackagesMenu">
<title>g:Tex_PackagesMenu</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
Setting this to zero will stop &ls; from automatically creating the
<literal>TeX-Suite > Packages > Supported</literal> menu at startup. You
can still create the menu after startup by going to
<literal>TeX-Suite > Configure Menu</literal>.
</para>
</section>
<section id="Tex_NestPackagesMenu">
<title>g:Tex_NestPackagesMenu</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
If this option is set, &ls; creates the packages option within the TeX-Suite menu.
Otherwise, it is a top-level menu entry.
</para>
</section>
<section id="Tex_MenuPrefix">
<title>g:Tex_MenuPrefix</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>String</entry></row>
<row><entry>Default Value</entry>
<entry><literal>'TeX-'</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
This string is the prefix added to all the menus created by &ls;. If you
define this variable with a dot (<literal>'.'</literal>) as the last
character, then all the menus created by &ls; will be nested under a
single master menu. For example, set this to
<literal>'&LaTeX-Suite.'</literal> to nest all menus under a menu
called <literal>&LaTeX-Suite</literal>.
</para>
</section>
<section id="Tex_UseUtfMenus">
<title>g:Tex_UseUtfMenus</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>0</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
This setting controls whether &ls; uses utf-8 symbols to display some of
the mathematical symbols in the <literal>TeX-Math</literal> menu. It is
necessary for your system/GUI to support utf-8. Setting this to 1 has the
side-effect of setting the <literal>'encoding'</literal> option of &vim;
to 'utf-8'.
</para>
</section>
</section>
<section id="customizing-folding">
<title>Folding Customization</title>
<para>
The following settings control the <link
linkend="latex-folding">folding</link> functionality of &ls;,
see also <link linkend="customizing-what-to-fold">Customizing what to fold</link>.
</para>
<section id="Tex_Folding">
<title>g:Tex_Folding</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
Setting this to zero completely disables &ls;'s folding functionality.
However, the <literal>TexFoldTextFunction()</literal> is still available
in case you want to use another folding scheme but still want to continue
using the fold text function.
</para>
</section>
<section id="Tex_AutoFolding">
<title>g:Tex_AutoFolding</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>Boolean</entry></row>
<row><entry>Default Value</entry>
<entry><literal>1</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
This setting controls whether &ls; automatically creates manual folds for
a file when it is opened. You can still use the <literal>\rf</literal>
mapping to refresh/create folds even when this variable is set to zero.
</para>
</section>
</section>
<section id="customizing-packages">
<title>Package Handling Customization</title>
<para>
These settings affect the <link linkend="custom-packages">custom
packages</link> functionality in &ls;
</para>
<section id="Tex_TEXINPUTS">
<title>g:Tex_TEXINPUTS</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>string</entry></row>
<row><entry>Default Value</entry>
<entry><literal>''</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
This setting describes the directories scanned by &ls; while searching
for custom user packages as described in the <link
linkend="custom-packages">custom packages</link> section. Do not
include the present directory in this setting. The present directory
is always scanned for custom packages.
</para>
<para>
This string should be set in the syntax accepted by &vim;'s native
<literal>'path'</literal> setting.
</para>
</section>
</section>
<section id="customizing-directories">
<title>Template Directory Customization</title>
<para>
This setting describes the directories scanned by &ls; to search for
templates.
</para>
<section id="Tex_CustomTemplateDirectory">
<title>g:Tex_CustomTemplateDirectory</title>
<informaltable frame="all">
<tgroup cols="2">
<tbody>
<row><entry>Type</entry><entry>string</entry></row>
<row><entry>Default Value</entry>
<entry><literal>''</literal></entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
A comma separated list of directories.
If left empty, &ls; searches in
<literal>$VIM/ftplugin/latex-suite/templates/</literal>.
</para>
</section>
</section>
</section>
<section id="latex-suite-credits">
<title>Credits</title>
<para>
And finally, the credits:
</para>
<informaltable frame="none">
<tgroup cols="2">
<tbody>
<row>
<entry>Artur R. Czechowski</entry>
<entry>maintains the BSD package of &ls;. Lots of valuable
feedback.</entry>
</row>
<row>
<entry>
Lubomir Host
</entry>
<entry>
provided the diacritics and also helped in development.
</entry>
</row>
<row>
<entry>
Alexander Wagner
</entry>
<entry>
valuable suggestions during development.
</entry>
</row>
<row>
<entry>
Luc Hermitte
</entry>
<entry>
his variation of Stephen Riehm's bracketing system is used
in &ls;.
</entry>
</row>
<row>
<entry>
Gergely Kontra
</entry>
<entry>
the clever little JumpFunc() in imaps.vim is due to him.
The implementation of the templates also borrows from
mu-template.vim by him.
</entry>
</row>
<row>
<entry>
Dimitri Antoniou
</entry>
<entry>
author of ltags and also provided the nice tip about
forward / reverse search on DVI documents.
</entry>
</row>
<row>
<entry>
Stephen Riehm
</entry>
<entry>
the extremely helpful bracketing system is from him.
</entry>
</row>
<row>
<entry>
Alan Schmitt
</entry>
<entry>
provided macros/folding elements. Continued feedback,
bug-reports/fixes.
</entry>
</row>
<row>
<entry>
Hari Krishna Dara
</entry>
<entry>
for ExecMap(), the clever little function which makes
typing visual mode mappings so much easier and error-free.
</entry>
</row>
<row>
<entry>
Alan G Isac
</entry>
<entry>
for the comprehensive BibT() function for entering bibtex
entries.
</entry>
</row>
<row>
<entry>
Gontran Baerts
</entry>
<entry>
for libList.vim
</entry>
</row>
<row>
<entry>
Peter Heslin
</entry>
<entry>
useful discussion and also a lot of bug fixes.
the %%fakesection in folding.vim.
</entry>
</row>
<row>
<entry>
Zhang Lin-bo
</entry>
<entry>
lots of very useful additions to folding. The code for customizing
the folding scheme is due to him.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
A large number of functions in &ls; come from various other people.
Some of those people might have been missed here. Each function should however
have the author's name/e-mail above it. Thats the more authoritative place to
check out who has done what.
</para>
<anchor id="latex-suite-maintainer"></anchor>
<para>
The current maintainer(s) of &ls; is(are)
</para>
<simplelist>
<member>Srinath Avadhanula <srinath@fastmail.fm></member>
<member>Mikolaj Machowski <mikmach@wp.pl></member>
<member>Benji Fisher <benji@member.AMS.org></member>
</simplelist>
</section>
</article>
<!--
vim: et:sw=1:sts=4
-->
|