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
|
\def\lang{jp} % -*- texinfo -*-
\input texinfo.tex
@setfilename yatexe.info
@settitle Yet Another tex-mode for Emacs
@dircategory GNU Emacs Lisp
@direntry
* YaTeX-e: (yatexe). Yet Another tex-mode for Emacs (English).
@end direntry
@iftex
@c @syncodeindex fn cp
@c Last modified Sat Jan 6 23:42:24 2018 on firestorm
@syncodeindex vr cp
@end iftex
@titlepage
@sp 10
@center
@subtitle Yet Another tex-mode for emacs
@title Wild Bird
@subtitle // YaTeX //
@author @copyright{} 1991-2017 by HIROSE, Yuuji [yuuji@@yatex.org]
@end titlepage
@node Top, What is YaTeX?, (dir), (dir)
@comment node-name, next, previous, up
@cindex Demacs
@cindex Mule
@cindex LaTeX
@cindex YaTeX
@menu
* What is YaTeX?::
* Main features:: What YaTeX can do
* Installation:: Guide to install
* Typesetting:: Call typesetting processes
* %#notation:: Meta-keyword `%#'
* Completion:: Input LaTeX commands with completion
* Local dictionaries:: Directory dependent completion
* Commenting out:: Commenting/uncommenting text
* Cursor jump:: Jumping to related position
* Changing and Deleting:: Changing/deleting certain unit of text
* Filling:: Filling an item or paragraph
* Updation of includeonly:: Free from maintaining includeonly
* What column:: Check what table-column the cursor belong
* Intelligent newline:: Guess requisites of new line
* Usepackage checker:: Selecting correct \usepackage is YaTeX's job
* Online help:: On-line documentation of LaTeX
* Browsing file hierarchy:: Walking through file hierarchy
* Cooperation with other packages:: Work well with gmhist, min-out
* Customizations:: How to breed `Wild Bird'
* Etcetera:: YaTeX is acquisitive.
* Copying:: Redistribution
@end menu
@node What is YaTeX?, Main features, Top, Top
@comment node-name, next, previous, up
@chapter What is YaTeX?
YaTeX automates typesetting and previewing of LaTeX and enables
completing input of LaTeX mark-up command such as
@code{\begin@{@}}..@code{\end@{@}}.
YaTeX also supports Demacs which runs on MS-DOS(386), Mule (Multi
Language Enhancement to GNU Emacs), and latex on DOS.
@node Main features, Installation, What is YaTeX?, Top
@comment node-name, next, previous, up
@chapter Main features
@itemize
@item Invocation of typesetter, previewer and related programs(@kbd{C-c t})
@item Typesetting on static region which is independent from point
@item Semiautomatic replacing of @code{\includeonly}
@item Jumping to error line(@kbd{C-c '})
@item Completing-read of La@TeX{} commands such as @code{\begin@{@}},
@code{\section} etc.
(@kbd{C-c b}, @kbd{C-c s}, @kbd{C-c l}, @kbd{C-c m})
@item Enclosing text into La@TeX{} environments or commands
(@var{AboveKeyStrokes} after region setting)
@item Displaying the structure of text at entering sectioning commands
@item Lump shifting of sectioning commands (@ref{view-sectioning})
@item Learning unknown/new La@TeX{} commands for the next completion
@item Argument reading with a guide for complicated La@TeX{} commands
@item Generating argument-readers for new/unsupported commands(@file{yatexgen})
@item Quick changing or deleting of La@TeX{} commands(@kbd{C-c c}, @kbd{C-c k})
@item Jumping from and to inter-file, begin<->end, ref<->label(@kbd{C-c g})
@item Blanket commenting out or uncommenting
(@kbd{C-c >}, @kbd{C-c <}, @kbd{C-c ,}, @kbd{C-c .})
@item Easy input of accent mark, math-mode's commands and Greek letters
(@kbd{C-c a}, @kbd{;}, @kbd{:})
@item Online help for the popular La@TeX{} commands
(@kbd{C-c ?}, @kbd{C-c /})
@item Document files hierarchy browser (@kbd{C-c d})
@item Adding automatically \usepackage corresponding to inputting LaTeX
macro with completion
@item Allow you to forget creating \label@{@}s, \ref@{@} or \cite@{@}
completion automatically generate labels.
@item \includegraphics by Drag&Drop of image file
@end itemize
@node Installation, Typesetting, Main features, Top
@comment node-name, next, previous, up
@chapter Installation
@cindex installation
@cindex .emacs
@cindex auto-mode-alist
@cindex autoload
Put next two expressions into your @file{~/.emacs}.
@lisp
(setq auto-mode-alist
(cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
(autoload 'yatex-mode "yatex" "Yet Another La@TeX{} mode" t)
@end lisp
Next, add certain path name where you put files of YaTeX to your
load-path. If you want to put them in @file{~/src/emacs}, write
@lisp
(setq load-path
(cons (expand-file-name "~/src/emacs") load-path))
@end lisp
@noindent
in your @file{~/.emacs}
Then, yatex-mode will be automatically loaded when you visit a
file which has extension @file{.tex}. If yatex-mode is successfully
loaded, mode string on mode line will be turned to "YaTeX".
@node Typesetting, %#notation, Installation, Top
@comment node-name, next, previous, up
@chapter Typesetting
@cindex typesetting
@cindex previewer
@cindex typesetter
@cindex latex
@cindex printing out
The prefix key stroke of yatex-mode is @kbd{C-c} (Press 'C' with Control
key) by default. If you don't intend to change the prefix key stroke,
assume all @kbd{[prefix]} as @kbd{C-c} in this document. These key
strokes execute typeset or preview command.
@table @kbd
@item [prefix] t j
@dots{} invoke typesetter
@item [prefix] t r
@dots{} invoke typesetter on region
@item [prefix] t e
@dots{} `on-the-fly preview' on current environment or whole
portion of current formulas in math-mode
@item [prefix] t d
@dots{} invoke dvipdfmx after successful typesetting
@item [prefix] t k
@dots{} kill current typesetting process
@item [prefix] t b
@dots{} invoke bibtex
@item [prefix] t i
@dots{} invoke makeindex
@item [prefix] t d
@dots{} invoke latex && dvipdfmx
@item [prefix] t p
@dots{} preview
@item [prefix] t l
@dots{} lpr dvi-file
@item [prefix] t s
@dots{} search current string on xdvi-remote
@end table
@menu
* Calling typesetter::
* Calling previewer::
* Printing out::
@end menu
@node Calling typesetter, Calling previewer, Typesetting, Typesetting
@comment node-name, next, previous, up
@section Calling typesetter
Typing @kbd{[prefix] t j}, the current editing window will be divided
horizontally when you invoke latex command, and log message of La@TeX{}
typesetting will be displayed in the other window; called typesetting
buffer. The typesetting buffer automatically scrolls up and traces
La@TeX{} warnings and error messages. If you see latex stopping by an
error, you can send string to latex in the typesetting buffer.
If an error stops the La@TeX{} typesetting, this key stroke will
move the cursor to the line where La@TeX{} error is detected.
@table @kbd
@item [prefix] '
@itemx ([prefix]+single quotation)
@dots{} jump to the previous error or warning
@end table
If you find a noticeable error, move to the typesetting buffer and move
the cursor on the line of error message and type @kbd{SPACE} key. This
makes the cursor move to corresponding source line.
YaTeX-typeset-region invoked by @kbd{[prefix] tr} call typesetter
for region. The region is specified by standard point and mark, or
by @code{%#BEGIN} and @code{%#END} marks. Selected region will be
copied to the temporary file @file{texput.tex} with the same preamble
as the main file of current editing sources. Be sure to put
all local macro settings in preamble, not after @code{\begin@{document@}}.
The method of specification of the region is shown in the
section @xref{%#notation}.
The documentclass for typeset-region is the same as that of editing
file if you edit one file, and is the same as main file's if you
edit splitting files.
The @kbd{[prefix] te} key automatically marks current inner environment
or inner math mode or paragraph, and then call typeset-region with marked
region. This
is convenient to quick view of current tabular environment or current
editing formulas. If running Emacs has the ability of displaying images,
typeset image will be shown in the next window. Further more,
if you modify the content within that environment, YaTeX performs
`on-the-fly' preview that automatically update preview image as you typed.
If your Emacs does not supply on-the-fly preview,
keeping previewer window for @file{texput.dvi} is handy
for debugging. Since @kbd{[prefix] te} selects the inner-most environment
as region, it is not suitable for partial typesetting of doubly or more
composed environment. If you want to do partial typesetting for a nested
environment, use @kbd{[prefix] tr} for static-region, which is described
in the section @xref{%#notation}.
@node Calling previewer, Printing out, Calling typesetter, Typesetting
@comment node-name, next, previous, up
@section Calling previewer
@kbd{[prefix] t p} invokes the TeX previewer. And if you are using
xdvi-remote, which can be controled from other terminals, @kbd{[prefix] t
s} enables you to search current string at the cursor on the running xdvi
window.
@node Printing out, , Calling previewer, Typesetting
@comment node-name, next, previous, up
@section Printing out
When you type @code{[preifx] t l}, YaTeX asks you the range of
dvi-printing by default. You can skip this by invoking it with
universal-argument as follows:
@example
C-u [prefix] tl
@end example
@node %#notation, Completion, Typesetting, Top
@comment node-name, next, previous, up
@chapter %# notation
@cindex %# notation
You can control the typesetting process by describing @code{%#}
notations in the source text.
@menu
* Changing typesetter::
* Splitting input files::
* Static region for typesetting::
* Special Filtering Region::
* Lpr format::
* Controlling which command to invoke::
* Editing %# notation::
@end menu
@node Changing typesetter, Splitting input files, %#notation, %#notation
@comment node-name, next, previous, up
@section To change the `latex' command or to split a source text.
@cindex typesetter
To change the typesetting command, write
@example
%#!latex-big
@end example
@noindent
anywhere in the source text. This is useful for changing
typesetter.
@node Splitting input files, Static region for typesetting, Changing typesetter, %#notation
@comment node-name, next, previous, up
@section Splitting input files
And if you split the source text and
edit subfile that should be included from main text.
@example
%#!latex main.tex
@end example
@noindent
will be helpful to execute latex on main file from sub text buffer. Since
this command line after @kbd{%#!} will be sent to shell literally, next
description makes it convenient to use ghostview as dvi-previewer.
@example
%#!latex main && dvi2ps main.dvi > main
@end example
@noindent
Note that YaTeX assumes the component before the last period of
the last word in this line as base name of the main La@TeX{} source.
The @code{%f} notation in this line is replaced by main file name, and
@code{%r} replaced by root name of main file name. If you specify
@code{%f} or @code{%r}, YaTeX always ask you the name of main file at the
first typesetting.
To make best use of the feature of inter-file jumping by
@kbd{[prefix] g} (see @ref{Cursor jump}), take described below into
consideration.
@itemize
@item You can put split texts in sub directory, but not in
sub directory of sub directory.
@item In the main text, specify the child file name with relative path name
such as \include@{chap1/sub@}, when you include the file in
a sub-directory.
@item In a sub-text, write @code{%#!latex main.tex} even if @file{main.tex}
is in the parent directory(not %#!latex ../main.tex).
@end itemize
@node Static region for typesetting, Lpr format, Splitting input files, %#notation
@comment node-name, next, previous, up
@section Static region
@cindex static region
@cindex Fixed region
Typeset-region by @kbd{[prefix] tr} passes the region between point and
mark to typesetting command by default. But when you want to typeset
static region, enclose the region by @code{%#BEGIN} and @code{%#END} as
follows.
@example
%#BEGIN
TheRegionYouWantToTypesetManyTimes
%#END
@end example
This is the rule of deciding the region.
@enumerate
@item
If there exists %#BEGIN before point,
@enumerate
@item
If there exists %#END after %#BEGIN,
@itemize
@item From %#BEGIN to %#END.
@end itemize
@item
If %#END does not exist after %#BEGIN,
@itemize
@item From %#BEGIN to the end of buffer.
@end itemize
@end enumerate
@item
If there does not exist %#BEGIN before point,
@itemize
@item Between point and mark(standard method of Emacs).
@end itemize
@end enumerate
It is useful to write @code{%#BEGIN} in the previous line of \begin and
@code{%#END} in the next line of \@code{end} when you try complex
environment such as `tabular' many times. It is also useful to put only
@code{%#BEGIN} alone at the middle of very long text. Do not forget to
erase @code{%#BEGIN} @code{%#END} pair.
@node Special Filtering Region, Lpr format, Static region for typesetting, %#notation
@section Special Filtering Region
A region like below will be passed to external filter command.
@example
%#BEGIN FILTER{foo.pdf}{dot -T %t -o %o}
\if0
....blah blah blah...
....blah blah blah...
....blah blah blah...
\fi
%#END
@end example
In this case, typing @kbd{[prefix] t e} send three `blah' lines
to "dot -T pdf -o foo.pdf" as standard-input. It is useful to
have source of text-origin graphic generated by such tools as
graphviz or blockdiag, in La@TeX{} source. This special form of region
can be inserted via feeding @code{.dot} into environment completion by
@kbd{[prefix] t b}.
@node Lpr format, Controlling which command to invoke, Static region for typesetting, %#notation
@comment node-name, next, previous, up
@section Lpr format
@cindex lpr format
Lpr format is specified by three Lisp variables. Here are the
default values of them.
@table @code
@item (1)dviprint-command-format
@code{"dvi2ps %f %t %s | lpr"}
@item (2)dviprint-from-format
@code{"-f %b"}
@item (3)dviprint-to-format
@code{"-t %e"}
@end table
On YaTeX-lpr, @code{%s} in (1) is replaced by the file name of main
text, @code{%f} by contents of (2), %t by contents of (3). At these
replacements, @code{%b} in (2) is also replaced by the number of beginning
page, @code{%e} in (3) is replaced by the number of ending page. But
@code{%f} and @code{%t} are ignored when you omit the range of print-out
by @kbd{C-u [prefix] tl}.
If you want to change this lpr format temporarily, put a command
such as follows somewhere in the text:
@example
%#LPR dvi2ps %f %t %s | 4up -page 4 | texfix | lpr -Plp2
@end example
And if you want YaTeX not to ask you the range of printing
out, the next example may be helpful.
@example
%#LPR dvi2ps %s | lpr
@end example
@node Controlling which command to invoke, Editing %# notation, Lpr format, %#notation
@comment node-name, next, previous, up
@section Controlling which command to invoke
These %# notation below can control which command to invoke for
La@TeX{} related process.
@table @code
@item %#PREVIEW
@dots{} Command line for DVI viewing ([prefix] t p)
@item %#MAKEINDEX
@dots{} Command line for makeindex ([prefix] t i)
@item %#BIBTEX
@dots{} Command line for bibtex ([prefix] t b)
@item %#DVIPDF
@dots{} Command line for dvipdf(mx) ([prefix] t b)
@item %#LPR
@dots{} Command line for printing out([prefix] t l)
@item %#PDFVIEW
@dots{} Command line for PDF viewing
@item %#IMAGEDPI
@dots{} DPI value for converting to on-the-fly prewview image
@end table
If you want to invoke ``makeidx hogehoge'' to update index,
put the next line some upper place in the source, for example.
@example
%#MAKEINDEX makeidx hogehoge
@end example
@node Editing %# notation, , Controlling which command to invoke, %#notation
@comment node-name, next, previous, up
@section Editing %# notation
To edit @code{%#} notation described above, type
@table @kbd
@item [prefix] %
@dots{} editing %# notation menu
@end table
@noindent
and select one of the entry of the menu as follows.
@example
!)Edit-%#! B)EGIN-END-region L)Edit-%#LPR
@end example
@noindent
Type @kbd{!} to edit @code{%#!} entry, @code{b} to enclose the region with
@code{%#BEGIN} and @code{%#END}, and @code{l} to edit @code{%#LPR} entry.
When you type @kbd{b}, all @code{%#BEGIN} and @code{%#END} are
automatically erased.
@node Completion, Local dictionaries, %#notation, Top
@comment node-name, next, previous, up
@chapter Completion
@cindex completion
YaTeX makes it easy to input the La@TeX{} commands. There are several
kinds of completion type, begin-type, section-type, large-type, etc...
@menu
* Begin-type completion::
* Section-type completion::
* Label Generation::
* Large-type completion::
* Maketitle-type completion::
* Arbitrary completion::
* End completion::
* Accent completion::
* Image completion::
* Greek letters completion::
* Inserting parentheses::
@end menu
@node Begin-type completion, Section-type completion, Completion, Completion
@comment node-name, next, previous, up
@section Begin-type completion
@cindex begin-type completion
@cindex environment
@cindex prefix b
"Begin-type completion" completes commands of @code{\begin@{env@}} ...
@code{\end@{env@}}. All of the begin-type completions begin with this key
sequence.
@table @kbd
@item [prefix] b
@dots{} start begin-type completion
@end table
@noindent
An additional key stroke immediately completes a frequently used
La@TeX{} @code{\begin@{@}}...@code{\@code{end}@{@}} environment.
@table @kbd
@item [prefix] b c
@dots{} @code{\begin@{center@}...\end@{center@}}
@item [prefix] b d
@dots{} @code{\begin@{document@}...\end@{document@}}
@item [prefix] b D
@dots{} @code{\begin@{description@}...\end@{description@}}
@item [prefix] b e
@dots{} @code{\begin@{enumerate@}...\end@{enumerate@}}
@item [prefix] b E
@dots{} @code{\begin@{equation@}...\end@{equation@}}
@item [prefix] b i
@dots{} @code{\begin@{itemize@}...\end@{itemize@}}
@item [prefix] b l
@dots{} @code{\begin@{flushleft@}...\end@{flushleft@}}
@item [prefix] b m
@dots{} @code{\begin@{minipage@}...\end@{minipage@}}
@item [prefix] b t
@dots{} @code{\begin@{tabbing@}...\end@{tabbing@}}
@item [prefix] b T
@dots{} @code{\begin@{tabular@}...\end@{tabular@}}
@item [prefix] b^T
@dots{} @code{\begin@{table@}...\end@{table@}}
@item [prefix] b p
@dots{} @code{\begin@{picture@}...\end@{picture@}}
@item [prefix] b q
@dots{} @code{\begin@{quote@}...\end@{quote@}}
@item [prefix] b Q
@dots{} @code{\begin@{quotation@}...\end@{quotation@}}
@item [prefix] b r
@dots{} @code{\begin@{flushright@}...\end@{flushright@}}
@item [prefix] b v
@dots{} @code{\begin@{verbatim@}...\end@{verbatim@}}
@item [prefix] b V
@dots{} @code{\begin@{verse@}...\end@{verse@}}
@end table
Any other La@TeX{} environments are made by completing-read of the
Emacs function.
@table @kbd
@item [prefix] b SPACE
@dots{} begin-type completion
@end table
@noindent
The next message will show up in the minibuffer
@example
Begin environment(default document):
@end example
@noindent
by typing @kbd{[prefix] b}. Put the wishing environment with completion
in the minibuffer, and @code{\begin@{env@}}...\@code{\end@{env@}} will be
inserted in the La@TeX{} source text. If the environment you want to put
does not exist in the YaTeX completion table, it will be registered in the
user completion table. YaTeX automatically saves the user completion
table in the user dictionary file at exiting of emacs.
At the completion of certain environments, the expected initial entry will
automatically inserted such as @code{\item} for @code{itemize}
environment. If you don't want the entry, it can be removed by undoing.
If you want to enclose some paragraphs which have already been written
into environment, invoke the begin-type completion right after region marking.
@cindex enclose region into environment
If you set @code{transient-mark-mode} to @code{nil} in your
@file{~/.emacs}, typing @kbd{C-space} (@code{set-mark-command}) twice
turns @code{transient-mark-mode} on temporarily. Then, type call
begin-type completion to enclose text into a environment.
@node Section-type completion, Label Generation, Begin-type completion, Completion
@comment node-name, next, previous, up
@section Section-type completion
@cindex section-type completion
@cindex prefix s
"Section-type completion" completes section-type commands which take an
argument or more such as @code{\section@{foo@}}. To invoke section-type
completion, type
@table @kbd
@item [prefix] s
@dots{} section-type completion
@end table
@noindent
then the prompt
@example
(C-v for view) \???@{@} (default documentclass):
@end example
@noindent
will show up in the minibuffer. Section-type La@TeX{} commands are
completed by space key, and the default value is selected when you
type nothing in the minibuffer.
Next,
@example
\section@{???@}:
@end example
@noindent
prompts you the argument of section-type La@TeX{} command. For
example, the following inputs
@example
\???@{@} (default documentclass): section
\section@{???@}: Hello world.
@end example
@noindent
will insert the string
@example
\section@{Hello world.@}
@end example
in your La@TeX{} source. When you neglect argument such as
@example
(C-v for view) \???@{@} (default section): vspace*
\vspace*@{???@}:
@end example
YaTeX puts
@example
\vspace*@{@}
@end example
@noindent
and move the cursor in the braces.
In La@TeX{} command, there are commands which take more than one
arguments such as @code{\addtolength@{\topmargin@}@{8mm@}}. To complete these
commands, invoke section-type completion with universal argument as,
@cindex number of argument
@example
C-u 2 [prefix] s (or ESC 2 [prefix] s)
@end example
@noindent
and make answers in minibuffer like this.
@example
(C-v for view) \???@{@} (default vspace*): addtolength
\addtolength@{???@}: \topmargin
Argument 2: 8mm
@end example
@code{\addtolength} and the first argument @code{\topmargin} can be typed
easily by completing read. Since YaTeX also learns the number of
arguments of section-type command and will ask that many arguments in
future completion, you had better tell the number of arguments to YaTeX at
the first completion of the new word. But you can change the number of
arguments by calling the completion with different universal argument
again.
Invoking section-type completion with @code{[Prefix] S} (Capital `S')
includes the region as the first argument of section-type command.
The section/large/maketitle type completion can work at the
prompt for the argument of other section-type completion.
Nested La@TeX{} commands are efficiently read with the recursive
completion by typing YaTeX's completion key sequence in the
minibuffer.
@menu
* view-sectioning::
@end menu
@node view-sectioning, , Section-type completion, Section-type completion
@comment node-name, next, previous, up
@subsection view-sectioning
@cindex view sectioning
@cindex outline
In the minibuffer at the prompt of section-type command completion,
typing @kbd{C-v} shows a list of sectioning commands in source text(The
line with @code{<<--} mark is the nearest sectioning command). Then,
default sectioning command appears in the minibuffer. You can go up/down
sectioning command by typing @kbd{C-p}/@kbd{C-n}, can scrolls up/down the
listing buffer by @kbd{C-v}/@kbd{M-v}, and can hide sectioning commands
under certain level by 0 through 6. Type @kbd{?} in the minibuffer of
sectioning prompt for more information.
You can generate this listing buffer (@code{*Sectioning Lines*} buffer)
by typing
@table @kbd
@item M-x YaTeX-section-overview
@dots{} Generate *Sectioning Lines* buffer
@end table
@cindex{Generate the listing of sectioning units}
from the LaTeX source buffer. In this listing buffer, typing @kbd{u} on
the sectioning command shifts up the corresponding sectioning command in
source text and @kbd{d} shifts down. After marking lines in the listing
buffer, typing @kbd{U} shifts up all sectioning commands in the region,
and @kbd{U} shifts down. Here are all the key bindings of
@code{*Sectioning Lines*} buffer.
@table @kbd
@item SPC
@dots{} Jump to corresponding source line
@item .
@dots{} Display corresponding source line
@item u
@dots{} Shift up a sectioning line
@item d
@dots{} Shift down a sectioning line
@item U
@dots{} Shift up sectioning lines in region
@item D
@dots{} Shift down sectioning lines in region
@item 0@dots{}6
@dots{} Hide sectioning commands whose level is lower than n
@end table
@node Label Generation, Large-type completion, Section-type completion, Completion
@section Label Generation
@comment label generation
@cindex label generation
@cindex ref label cite
When you want to type-in references of @code{\ref} or @code{\cite},
all you have to do is type @kbd{[prefix] s ref} without adding labels
beforehand. You will see possible La@TeX{}-counters in the next window
even if some counter does not have @code{\label}. Selecting the counter
will automatically set the label to that counter.
All possible counter list in the buffer tends to be large.
You can reduce the number of list by filtering type of counters by
key-commands as follows.
@table @kbd
@item M-a
@dots{} Show all(disable filtering)
@item M-c
@dots{} Captions only
@item M-e
@dots{} equations (with counters) only
@item M-i
@dots{} numbers items only
@item M-s
@dots{} sections only
@item M-m
@dots{} other counters only
@end table
@node Large-type completion, Maketitle-type completion, Label Generation, Completion
@comment node-name, next, previous, up
@section Large-type completion
"Large-type completion" inputs the font or size changing
descriptions such as @code{@{\large @}}. When you type
@table @kbd
@item [prefix] l
@dots{} large-type completion
@end table
@noindent
the message in the minibuffer
@example
@{\??? @} (default large):
@end example
prompts prompts you large-type command with completing-read. There are
TeX commands to change fonts or sizes, @code{it}, @code{huge} and so on,
in the completion table.
Region-based completion is also invoked by calling completion
after region activated.
@node Maketitle-type completion, Arbitrary completion, Large-type completion, Completion
@comment node-name, next, previous, up
@section Maketitle-type completion
@cindex maketitle-type completion
We call it "maketitle-type completion" which completes commands such as
@code{\maketitle}. Take notice that maketitle-type commands take no
arguments. Then, typing
@table @kbd
@item [prefix] m
@dots{} maketitle-type completion
@end table
@noindent
begins maketitle-completion. Above mentioned method is true for
maketitle-completion, and there are La@TeX{} commands with no
arguments in completion table.
@node Arbitrary completion, End completion, Maketitle-type completion, Completion
@comment node-name, next, previous, up
@section Arbitrary completion
@cindex arbitrary completion
@noindent
You can complete certain La@TeX{} command anywhere without typical
completing method as described, by typing
@table @kbd
@item [prefix] SPC
@dots{} arbitrary completion
@end table
@noindent
after the initial string of La@TeX{} command that is preceded by @code{\}.
@node End completion, Accent completion, Arbitrary completion, Completion
@comment node-name, next, previous, up
@section End completion
@cindex end completion
@noindent
YaTeX automatically detects the opened environment and close it with
\@code{\end@{environment@}}. Though proficient YaTeX users never fail to
make environment with begin-type completion, some may begin an environment
manually. In that case, type
@table @kbd
@item [prefix] e
@dots{} @code{end} completion
@end table
@noindent
at the end of the opened environment.
@node Accent completion, Image completion, End completion, Completion
@comment node-name, next, previous, up
@section Accent completion
@cindex accent completion
When you want to write the European accent marks(like @code{\`@{o@}}),
@table @kbd
@item [prefix] a
@dots{} accent completion
@end table
@noindent
shows the menu
@example
1:` 2:' 3:^ 4:" 5:~ 6:= 7:. u v H t c d b
@end example
@noindent
in the minibuffer. Chose one character or corresponding numeric,
and you will see
@example
\`@{@}
@end example
@noindent
in the editing buffer with the cursor positioned in braces. Type
one more character `o' for example, then
@example
\`@{o@}
@end example
@noindent
will be completed, and the cursor gets out from braces.
@node Image completion, Greek letters completion, Accent completion, Completion
@comment node-name, next, previous, up
@section Image completion of mathematical sign
@cindex image completion
@cindex math-mode
@cindex sigma
@cindex leftarrow
@cindex ;
Arrow marks, sigma mark and those signs mainly used in the
TeX's math environment are completed by key sequences which
imitate the corresponding symbols graphically. This completion
only works in the math environment. YaTeX automatically detects
whether the cursor located in math environment or not, and
change the behavior of key strokes @kbd{;} and @kbd{:}.
By the way, we often express the leftarrow mark by `<-' for example.
Considering such image, you can write @code{\leftarrow} by typing @kbd{<-}
after @kbd{;} (semicolon) as a prefix. In the same way,
@code{\longleftarrow} (@code{<--}) is completed by typing @kbd{;<--},
infinity mark which is imitated by @code{oo} is completed by typing
@kbd{;oo}.
Here are the sample operations in YaTeX math-mode.
@example
INPUT Completed La@TeX{} commands
; < - @code{\leftarrow}
; < - - @code{\longleftarrow}
; < - - > @code{\longleftrightarrow}
; o @code{\circ}
; o o @code{\infty}
@end example
In any case, you can quit from image completion and can move
to the next editing operation if the La@TeX{} command you want is
shown in the buffer.
@code{;} itself in math-environment is inserted by @kbd{;;}. Typing
@kbd{TAB} in the midst of image completion shows all of the La@TeX{}
commands that start with the same name as string you previously typed in.
In this menu buffer, press @kbd{RET} after moving the cursor (by @kbd{n},
@kbd{p}, @kbd{b}, @kbd{f}) to insert the La@TeX{} command.
To know all of the completion table, type @kbd{TAB} just after @kbd{;}.
And here is the sample menu by @kbd{TAB} after @kbd{;<}.
@example
KEY LaTeX sequence sign
< \leq <
~
<< \ll <<
<- \leftarrow <-
<= \Leftarrow <=
@end example
You can define your favorite key-vs-sequence completion table in the
Emacs-Lisp variable @code{YaTeX-math-sign-alist-private}. See also
@file{yatexmth.el} for the information of the structure of this variable.
@node Greek letters completion, Inserting parentheses, Image completion, Completion
@comment node-name, next, previous, up
@section Greek letters completion
@cindex Greek letters completion
@cindex :
Math-mode of YaTeX provides another image completion, Greek letters
completion in the same method. After prefix @kbd{:}, typing @kbd{a} makes
@code{\alpha}, @kbd{b} makes @code{\beta} and @kbd{g} makes @code{\gamma}
and so on. First, type @kbd{:TAB} to know all the correspondence of
alphabets vs. Greek letters.
If you will find @kbd{;} or @kbd{:} doesn't work in correct position of
math environment, it may be a bug of YaTeX. Please send me a bug report
with the configuration of your text, and avoid it temporarily by typing
@kbd{;} or @kbd{:} after universal-argument(@kbd{C-u}) which forces
@kbd{;} and @kbd{:} to work as math-prefix.
@node Inserting parentheses, , Greek letters completion, Completion
@section Inserting parentheses
Typing opening parenthesis, one of @code{(}, @code{@{ and @code{[}},
automatically inserts the closing one. If a opening bracket is typed
after @code{\}, @code{\]} is automatically inserted with computed
indentation. If you stop automatic insertion, type @kbd{C-q} before
opening parenthesis.
@node Local dictionaries, Commenting out, Completion, Top
@comment node-name, next, previous, up
@chapter Local dictionaries
@cindex local dictionaries
@cindex nervous users
Tables for completion consist of three dictionaries; `standard
dictionary' built in @file{yatex.el}, `user dictionary' for your common
private commands, and `local dictionary' that is effective in a certain
directory.
When you input the command unknown to YaTeX at a completion in the
minibuffer, YaTeX asks you with the following prompt;
@example
`foo' is not in table. Register into: U)serDic L)ocalDic N)one D)iscard
@end example
@noindent
In this menu, typing @kbd{u} updates your `user dictionary', @kbd{l}
updates your local dictionary, @kbd{n} updates only on-memory dictionary
which go through only current Emacs session, and @kbd{d} updates no
dictionary and throws the new word away.
If you find this switching feature meaningless and bothersome, put the
next expression into your @file{~/.emacs}
@lisp
(setq YaTeX-nervous nil)
@end lisp
@node Commenting out, Cursor jump, Local dictionaries, Top
@comment node-name, next, previous, up
@chapter Commenting out
@cindex commenting out
@cindex prefix >
@cindex prefix <
@cindex prefix ,
@cindex prefix .
You may want to comment out some region.
@table @kbd
@item [prefix] >
@dots{} comment out region by %
@item [prefix] <
@dots{} uncomment region
@end table
@noindent
cause an operation to the region between point and mark.
@table @kbd
@item [prefix] .
@dots{} comment out current paragraph
@item [prefix] ,
@dots{} uncomment current paragraph
@end table
@noindent
comments or uncomments the paragraph where the cursor belongs.
This `paragraph' means the region marked by the function
mark-paragraph, bound to @kbd{ESC h} by default. It is NOT
predictable what will happen when you continuously comment out
some paragraph many times.
You can also comment out an environment between @code{\begin} and
@code{\end}, or a @code{\begin}-\@code{\end} pair themselves, by making the
following key strokes on the line where @code{\begin@{@}} or
@code{\end@{@}} exists.
@table @kbd
@item [prefix] >
@dots{} comment out from \begin to \@code{end}
@item [prefix] <
@dots{} uncomment from \begin to \@code{end}
@end table
@noindent
comment whole the contents of environment. Moreover,
@table @kbd
@item [prefix] .
@dots{} comment out \begin and \@code{end}
@item [prefix] ,
@dots{} uncomment \begin and \@code{end}
@end table
@noindent
(un)comments out only environment declaration: @code{\begin@{@}} and
@code{\end@{@}}. NOTE that even if you intend to comment out some region,
invoking @kbd{[prefix] >} on the @code{\begin},@code{\end} line decides to
work in `commenting out from @code{\begin} to @code{\end}' mode.
@node Cursor jump, Changing and Deleting, Commenting out, Top
@comment node-name, next, previous, up
@chapter Cursor jump
@cindex cursor jump
@cindex prefix g
@menu
* Jump to corresponding object::
* Invoking image processor::
* Jump to main file::
* Jumping around the environment::
* Jumping to last completion position::
@end menu
@node Jump to corresponding object, Invoking image processor, Cursor jump, Cursor jump
@comment node-name, next, previous, up
@section Jump to corresponding object
Typing
@table @kbd
@item [prefix] g
@dots{} go to corresponding object
@end table
@noindent
in a certain place move the cursor to the place corresponding to the
La@TeX{} command of last place. YaTeX recognize the followings as pairs
that have relation each other.
@itemize @bullet
@item @code{\begin@{@}} <-> @code{\end@{@}}
@item @code{%#BEGIN} <-> @code{%#END}
@item On the image-including line -> corresponding viewer or drawing tool
@item @code{\label@{@}} <-> @code{\ref@{@}}
@item @code{\include(\input)} -> included file
@item @code{\bibitem@{@}} <-> @code{\cite@{@}}
@end itemize
On a @code{\begin},@code{\end} line, typing @kbd{[prefix] g} moves the
cursor to the corresponding @code{\end},@code{\begin} line, if its partner
really exists. The behavior on the line @code{%#BEGIN} and @code{%#END}
are the same. Note that if the correspondent of @code{label/ref} or
@code{cite/bibitem} exists in another file, that file have to be opened to
make a round trip between references by @kbd{[prefix] g}.
If you type @code{[prefix] g} on the line of @code{\include@{chap1@}},
typically in the main text, YaTeX switches buffer to @file{chap1.tex}.
@table @kbd
@item [prefix] 4 g
@dots{} go to corresponding object in other window
@end table
@noindent
do the same job as @kbd{[prefix] g} except it's done in other window.
Note that this function doesn't work on @code{begin/end},
@code{%#BEGIN/%#END} pairs because it is meaningless.
@node Invoking image processor, Jump to main file, Jump to corresponding object, Cursor jump
@comment node-name, next, previous, up
@section Invoking image processor
@cindex{Drawing tool invocation}
`image-including line' described above means such lines as
@code{\epsfile@{file=foo.ps@}}. If you type @kbd{[prefix] g} on that
line, YaTeX automatically searches source of `foo.ps' and invokes image
viewer or drawing tool correspoinding to it. For example; if you draw
an image foo.obj with Tgif and enclose its product named foo.eps by
@code{\epsfile} command. Typing @kbd{[prefix] g} on @code{\epsfile} line
make YaTeX invoke @code{tgif foo.obj}. How a processor is choosen is as
follows.
@enumerate
@item
If there is an expression matching with one of the pattern
defined in @code{YaTeX-processed-file-regexp-alist}, extract file name
from regexp group surrounded by \\(\\). (Which group corresponds is
written in the cdr part of each list.) If no matches were found, do
nothing.
@item
If there is a pattern as `%PROCESSOR' which is defined in the variable
@code{YaTeX-file-processor-alist}, call that processor giving the
file name with corresponding extension.
@item
If not, check the existence of each file which is supplied the
extension in the cdr part of each list of
@code{YaTeX-file-processor-alist}. If any, call the corresponding
image viewer or drawing tool.
@end enumerate
@node Jump to main file, Jumping around the environment, Invoking image processor, Cursor jump
@comment node-name, next, previous, up
@section Jump to main file
Typing
@table @kbd
@item [prefix] ^
@dots{} visit main file
@item [prefix] 4^
@dots{} visit main file in other buffer
@end table
@cindex prefix ^
@cindex prefix 4 ^
in a sub text switch the buffer to the main text specified by
@code{%#!} notation.
@node Jumping around the environment, Jumping to last completion position, Jump to main file, Cursor jump
@comment node-name, next, previous, up
@section Jumping around the environment
And these are the functions which work on the current La@TeX{}
environment:
@table @kbd
@item M-C-a
@dots{} beginning of environment
@item M-C-e
@dots{} @code{end} of environment
@item M-C-@@
@dots{} mark environment
@end table
@cindex M-C-a
@cindex M-C-e
@cindex M-C-@@
@node Jumping to last completion position, , Jumping around the environment, Cursor jump
@comment node-name, next, previous, up
@section Jumping to last completion position
YaTeX always memorize the position of completion into register @code{3}.
So every time you make a trip to any other part of text other than you are
writing, you can return to the editing paragraph by calling
register-to-point with argument YaTeX-current-position-register, which is
achieved by typing @kbd{C-x j 3}(by default).
@node Changing and Deleting, Filling, Cursor jump, Top
@comment node-name, next, previous, up
@chapter Changing and Deleting
These functions are for change or deletion of La@TeX{} commands
already entered.
@table @kbd
@item [prefix] c
@dots{} change La@TeX{} command
@item [prefix] k
@dots{} kill La@TeX{} command
@end table
@cindex prefix c
@cindex prefix k
@menu
* Changing LaTeX commands::
* Killing LaTeX commands::
@end menu
@node Changing LaTeX commands, Killing LaTeX commands, Changing and Deleting, Changing and Deleting
@comment node-name, next, previous, up
@section Changing La@TeX{} commands
@kbd{[prefix] c} can change the various (La)@TeX{} commands. This can
change the followings.
@itemize @bullet
@item Environment names
@item Section-type commands
@item Argument of section-type commands
@item Optional parameters (enclosed by []) of section-type commands
@item Font/size designators
@item Math-mode's maketitle-type commands that can be inputted with
image completion
@end itemize
Typing @kbd{[prefix] c} on one of above objects you want to change
brings a suitable reading function sometimes with completion.
Note: If you want to change the argument of section-type command that
contains other La@TeX{} commands, type @kbd{[prefix] c} either of
surrounding braces of the argument in order to make YaTeX ignore the
internal La@TeX{} sequences as an object of changing. Anyway, it is
very difficult to know which argument position the cursor belongs because
the La@TeX{} commands can be nested and braces can freely emerge. So keep
it mind to put the cursor on a brace when you are thinking of changing a
complicated argument.
@node Killing LaTeX commands, , Changing LaTeX commands, Changing and Deleting
@comment node-name, next, previous, up
@section Killing La@TeX{} commands
@cindex Killing La@TeX{} commands
@kbd{[prefix] k} kills the La@TeX{} commands sometimes with their
arguments. Following table illustrates the correspondence of the invoking
position and what is killed.
@example
[Invoking position] [action]
\begin, \end line kill \begin,\end pairs
%#BEGIN, %#END line kill %#BEGIN,%#END pairs
on a Section-type command kill section-type command
on a parenthesis kill parentheses
@end example
Note that when killing @code{\begin, \end} or @code{%#BEGIN, %#END} pair,
the lines @code{\begin, \end} or @code{%#BEGIN, %#END} exist will be
killed entirely. So take care not to create any line that contains more
than one @code{\begin} or so.
While all operations above are to kill `containers' which surround some
text, universal argument (@kbd{C-u}) for these commands kills not only
`containers' but also `contents' of them. See below as a sample.
@example
Original text: [prefix] k C-u [prefix] k
Main \footnote@{note@} here. Main note here. Main here.
~(cursor)
@end example
@node Filling, Updation of includeonly, Changing and Deleting, Top
@comment node-name, next, previous, up
@chapter Filling
@cindex filling
@section Filling an item
@cindex filling an item
@cindex prefix i
To fill a term (descriptive sentences) of @code{\item}, type
@c @table @kbd
@c @item [prefix] i
@c @dots{} fill item
@c @end table
@table @kbd
@item M-q
@dots{} fill item
@end table
@noindent
on that item.
YaTeX uses the value of the variable @code{YaTeX-item-regexp} as the
regular expression to search item header in itemize environment.
If you make a newcommand to itemize terms(e.g. @code{\underlineitem}), put
@lisp
(setq YaTeX-item-regexp
"\\(\\\\\\(sub\\)*item\\)\\|\\(\\\\underlineitem\\)")
@end lisp
@cindex YaTeX-item-regexp
in your @file{~/.emacs}. If you are not familiar with regular expression
for Emacs-Lisp, name a newcommand for `itemize' beginning with
@code{\item} such as @code{\itembf}, not @code{\bfitem}.
This function reformats the @code{\item} into `hang-indented' style.
For example:
@example
itemize, enumerate environment:
>
>\item[foo] `foo' is the typical word for describing an
> arbitrarily written....
description environment:
> \item[bar] When the word `for' is used as an arbitrarily
> word, `bar' is bound to follow it.
@end example
Note that the indent depth of an @code{\item} word and its descriptive
paragraph are the same in latter case. If you want to use different
depth, invoke fill-paragraph at the beginning of non-whitespace
character(see below).
@section Filling paragraph
@cindex Filling paragraph
@cindex M-q
Fill-paragraph is little bit adapted for La@TeX{} sources. It retains from
filling in certain environments where formatting leads to a disaster such
as verbatim, tabular, or so. And it protects @code{\verb} expressions
from being folded (The variable @code{YaTeX-verb-regexp} controls this).
Besides, putting cursor on the first occurrence of non-whitespace
character on a line changes the fill-prefix temporarily to the depth of
the line.
@node Updation of includeonly, What column, Filling, Top
@comment node-name, next, previous, up
@chapter Updation of @code{\includeonly}
@cindex includeonly
When you edit splitting source texts, the notation
@example
\includeonly@{CurrentEditingFileName@}
@end example
@noindent
in the main file reduces the time of typesetting. If you want
to hack other file a little however, you have to rewrite it to
@example
\includeonly@{OtherFileNameYouWantToFix@}
@end example
@noindent
in the main file. YaTeX automatically detects that the current
edited text is not in includeonly list and prompts you
@example
A)dd R)eplace %)comment?
@end example
in the minibuffer. Type @kbd{a} if you want to add the current file name
to @code{\includeonly} list, @kbd{r} to replace \@code{includeonly} list
with the current file, and type @kbd{%} to comment out the
@code{\includeonly} line.
@node What column, Intelligent newline, Updation of includeonly, Top
@comment node-name, next, previous, up
@chapter What column?
@cindex what column
@cindex complex tabular
@cindex prefix &
We are often get tired of finding the corresponding column in
large tabulars. For example,
@example
\begin@{tabular@}@{|c|c|c|c|c|c|c|c|@}\hline
Name&Position&Post No.&Addr.&Phone No.&FAX No.&
Home Addr.&Home Phone\\ \hline
Thunder Bird & 6 & 223 & LA & xxx-yyy &
zzz-www & Japan & 9876-54321 \\
& 2 & \multicolumn@{2@}@{c|@}@{Unknown@}
&&&(???)
\\ \hline
\end@{tabular@}
@end example
Suppose you have the cursor located at @code{(???)} mark, can you tell
which column it is belonging at once? Maybe no. In such case,
type
@table @kbd
@item [prefix] &
@dots{} What column
@end table
@noindent
in that position. YaTeX tells you the column header of the
current field. Since YaTeX assumes the first line of tabular
environment as a row of column headers, you can create a row of
virtual column headers by putting them in the first line and
commenting that line with @code{%}.
@node Intelligent newline, Usepackage checker, What column, Top
@comment node-name, next, previous, up
@chapter Intelligent newline
@cindex Intelligent newline
@cindex ESC RET
@cindex M-C-m
At the end of begin-type completion of tabular[*], array, itemize,
enumerate or tabbing environment, or typing
@table @kbd
@item ESC RET
@dots{} Intelligent newline
@end table
@noindent
in these environments inserts the contents corresponding to the current
environment in the next line. (At the begin-type completion, this
contents can be removed by `undo'.) In @code{tabular} environment, for
example, @kbd{ESC RET} inserts the certain number of @code{&} and trailing
@code{\\}, and @code{\hline} if other @code{\hline} is found in backward.
Here are the list of contents vs. environments.
@itemize
@item @code{tabular}, @code{tabular*}, @code{array}
Corresponding number of @code{&} and @code{\\}.
And @code{\hline} if needed.
@item @code{tabbing}
The same number of @code{\>} as @code{\=} in the first line.
@item @code{itemize}, @code{enumerate}, @code{description}, @code{list}
@code{\item} or @code{item[]}.
@end itemize
Note that since this function works seeing the contents of the first
line, please call this after the second line if possible.
If you want to apply these trick to other environments, @code{foo}
environment for example, define the function named
@code{YaTeX-intelligent-newline-foo} to insert corresponding contents.
That function will be called at the beginning of the next line after the
newline is inserted to the current line. Since the function
@code{YaTeX-indent-line} is designed to indent the current line properly,
calling this function before your code to insert certain contents must be
useful. See the definition of the function
@code{YaTeX-intelligent-newline-itemize} as an example.
@node Usepackage checker, Online help, Intelligent newline, Top
@comment node-name, next, previous, up
@chapter Usepackage checker
@cindex usepackage
When you input begint-type, section-type, maketitle-type macros with
completion, and it requires some LaTeX2e package, YaTeX examines
the existence of correct @code{\usepackage}. If not, YaTeX inserts
the @code{\usepackage@{@}} declaration corresponding to input macro.
To activate the package completion for your favarite package,
set the variable @code{YaTeX-package-alist-private} correctly.
Please refere the value of @code{YaTeX-package-alist-default} as an
example.
@node Online help, Browsing file hierarchy, Usepackage checker, Top
@comment node-name, next, previous, up
@chapter Online help
@cindex online help
@cindex prefix ?
@cindex prefix /
@cindex apropos
@cindex keyword search
YaTeX provides you the online help with popular La@TeX{} commands.
Here are the key strokes for the online help.
@table @kbd
@item [prefix] ?
@dots{} Online help
@item [prefix] /
@dots{} Online apropos
@end table
@section Online help
`Online help' shows the documentation for the popular La@TeX{}
commands(defaults to the commands on the cursor) in the next buffer.
There are two help file, `global help' and `private help'. The former
file contains the descriptions on the standard La@TeX{} command and is
specified its name by variable @code{YaTeX-help-file}. Usually, the
global help file should be located in public space (@code{$EMACSEXECPATH}
by default) and should be world writable so that anyone can update it to
enrich its contents. The latter file contains descriptions on
non-standard or personal command definitions and is specified by
@code{YaTeX-help-file-private}. This file should be put into private
directory.
@section Online apropos
`Online apropos' is an equivalent of GNU Emacs's apropos. It
shows all the documentations that contains the keyword entered by
the user.
@section When no descriptions are found...
If there is no description on a command in help files, YaTeX
requires you to write a description on that command. If you are
willing to do, determine which help file to add and write the
description on it referring your manual of (La)TeX. Please send
me your additional descriptions if you describe the help on some
standard commands. I might want to include it in the next
distribution.
@node Browsing file hierarchy, Cooperation with other packages, Online help, Top
@comment node-name, next, previous, up
@chapter Browsing file hierarchy
@cindex hierarchy
@cindex browsing
When you are editing multi-file source, typing
@table @kbd
@item [prefix] d
@dots{} browse file hierarchy
@end table
@noindent
asks you the parent-most file (which may be defaulted) and displays the
documentation hierarchy in the next window. In this buffer, the following
commands are available.
@table @kbd
@item n
@dots{} move to the next line and show its contents
@item p
@dots{} move to the previous line and show its contents
@item N
@dots{} move to the next file in the same inclusion level
@item P
@dots{} move to the previous file in the same inclusion level
@item j
@dots{} move to the next line
@item k
@dots{} move to the previous line
@item u
@dots{} move to the parent file
@item .
@dots{} show the current files contents in the next window
@item SPC
@dots{} scroll up the current file window
@item DEL, b
@dots{} scroll down the current file window
@item <
@dots{} show the beginning of the current file
@item >
@dots{} show the end of the current file
@item >
@dots{} return to the previous postion after @kbd{<} or @kbd{>}
@item RET, g
@dots{} open the current file in the next window
@item mouse-2
@dots{} same as RET(available only with window system)
@item o
@dots{} other window
@item 1
@dots{} delete other windows
@item -
@dots{} shrink hierarchy buffer window
@item +
@dots{} enlarge hierarchy buffer window
@item ?
@dots{} describe mode
@item q
@dots{} quit
@end table
Note that operations on the file contents in the next window do not work
correctly when you close the corresponding file.
@node Cooperation with other packages, Customizations, Browsing file hierarchy, Top
@comment node-name, next, previous, up
@chapter Cooperation with other packages
YaTeX works better with other brilliant packages.
@section gmhist
@cindex gmhist
@cindex command history
@cindex minibuffer history
When you are loading @file{gmhist.el} and @file{gmhist-mh.el}, you can
use independent command history list at the prompt of preview command
(@kbd{[prefix] tp}) and print command (@kbd{[prefix] tl}). On each
prompt, you can enter the previous command line string repeatedly by
typing @kbd{M-p}.
@section min-out
@cindex min-out
@file{min-out}, the outline minor mode, can be used in yatex-mode
buffers. If you want to use it with YaTeX, please refer the
file @file{yatexm-o.el} as an example.
@node Customizations, Etcetera, Cooperation with other packages, Top
@comment node-name, next, previous, up
@chapter Customizations
@cindex customizations
You can customize YaTeX by setting Emacs-Lisp variables and by making
add-in functions.
@menu
* Lisp variables::
* Add-in functions::
* Add-in generator::
@end menu
@node Lisp variables, Add-in functions, Customizations, Customizations
@comment node-name, next, previous, up
@section Lisp variables
@cindex customizable variables
You can change the key assignments or make completion more comfortable
by setting the values of various variables which control the movement of
yatex-mode.
For example, if you want to change the prefix key stroke from @kbd{C-c}
to any other sequence, set YaTeX-prefix to whatever you want to use. If
you don't want to use the key sequence @kbd{C-c letter} which is assumed
to be the user reserved sequence in Emacs world, set
@code{YaTeX-inhibit-prefix-letter} to @code{t}, and all of the default key
bind of @kbd{C-c letter} will turn to the corresponding @kbd{C-c C-letter}
(but the region based completions that is invoked with @kbd{C-c
Capital-letter} remain valid, if you want to disable those bindings, set
that variable to 1 instead of @code{t}).
@menu
* All customizable variables::
* Sample definitions::
* Hook variables::
* Hook file::
@end menu
@node All customizable variables, Sample definitions, Lisp variables, Lisp variables
@comment node-name, next, previous, up
@subsection All customizable variables
@cindex all customizable variables
Here are the customizable variables of yatex-mode. Each value setq-ed
in @file{~/.emacs} is preferred and that of defined in @file{yatex.el} is
neglected. Parenthesized contents stands for the default value. When you
are to change some of these variables, see more detailed documentation of
the variable by @kbd{M-x describe-variable}.
@defvar YaTeX-japan
Set this nil to produce all messages in English
(@code{Depends on Japanese feature of Emacs})
@end defvar
@defvar YaTeX-kanji-code
Default buffer-file-coding-system for YaTeX modes' buffer.
Set this 0 to no language conversion. Nil to preserve original
coding-system. 1=Shift JIS, 2=JIS, 3=EUC, 4=UTF-8 (@code{1 or 2})
@end defvar
@defvar YaTeX-prefix
Prefix key stroke (@kbd{C-c})
@end defvar
@defvar YaTeX-inhibit-prefix-letter
Change key stroke from @kbd{C-c letter} to @kbd{C-c C-letter} (@code{nil})
@end defvar
@defvar YaTeX-fill-prefix
Fill-prefix used in yatex-mode (@code{nil})
@end defvar
@defvar YaTeX-user-completion-table
Name of user dictionary where learned completion table will be stored.
(@code{"~/.yatexrc"})
@end defvar
@defvar tex-command
La@TeX{} typesetter command (@code{"latex"})
@end defvar
@defvar dvi2-command
Preview command (@code{"xdvi -geo +0+0 -s 4"})
@end defvar
@defvar dviprint-command-format
Command format to print dvi file (@code{"dvi2ps %f %t %s | lpr"})
@end defvar
@defvar dviprint-from-format
Start page format of above %f. %b will turn to start page (@code{"-f %b"})
@end defvar
@defvar dviprint-to-format
End page format of above %t. %e will turn to @code{end} page (@code{"-t %e"})
@end defvar
@defvar makeindex-command
Default makeindex command (@code{"makeindex"} (@code{"makeind"} on MS-DOS))
@end defvar
@defvar YaTeX-dvipdf-command
Default command name to convert .dvi to PDF (@code{"dvipdfmx"})
@end defvar
@defvar YaTeX-on-the-fly-preview-interval
Interval time in seconds of idle to trigger on-the-fly preview of
environment by @kbd{[prefix] t e}(0.9).
@code{Nil} disables on-the-fly preview.
@end defvar
@defvar YaTeX-on-the-fly-math-preview-engine
Function symbol to use on-the-fly preview of MATH environment
started by @kbd{[prefix] t e} (@code{'YaTeX-typeset-environment-by-lmp}
which calls latex-math-preview-expression function if latex-math-preview
is available, otherwise @code{'YaTeX-typeset-environment-by-builtin} which
alls built-in function).
@code{Nil} disables on-the-fly preview.
@end defvar
@defvar YaTeX-cmd-gimp
Command name of GIMP (code{"gimp"})
@end defvar
@defvar YaTeX-cmd-tgif
Command name of tgif (code{"tgif"})
@end defvar
@defvar YaTeX-cmd-inkscape
Command name of Inkscape (code{"inkscape"})
@end defvar
@defvar YaTeX-cmd-dia
Command name of Dia (code{"dia"})
@end defvar
@defvar YaTeX-cmd-ooo
Command name of OpenOffice.org/LibreOffice (code{"soffice"})
@end defvar
@defvar YaTeX-cmd-gs
Command name of Ghostscript (code{"gs"})
@end defvar
@defvar YaTeX-cmd-dvips
Command name of dvips (code{"dvips"})
@end defvar
@defvar YaTeX-cmd-displayline
Command name of displayline
(code{"/Applications/Skim.app/Contents/SharedSupport/displayline"})
@end defvar
@defvar YaTeX-cmd-edit-ps
Command name for editing PostScript files(Value of code{"YaTeX-cmd-gimp"})
@end defvar
@defvar YaTeX-cmd-edit-pdf
Command name for editing PDF files(Value of code{"YaTeX-cmd-ooo"})
@end defvar
@defvar YaTeX-cmd-edit-ai
Command name for editing `.ai' files(Value of code{"YaTeX-cmd-inkscape"})
@end defvar
@defvar YaTeX-cmd-edit-svg
Command name for editing SVG files(Value of code{"YaTeX-cmd-inkscape"})
@end defvar
@defvar YaTeX-cmd-edit-images
Command name for editing image files(Value of code{"YaTeX-cmd-gimp"})
@end defvar
@defvar YaTeX-need-nonstop
Put @code{\nonstopmode@{@}} or not (@code{nil})
@end defvar
@defvar latex-warning-regexp
Regular expression of warning message latex command puts out
(@code{"line.* [0-9]*"})
@end defvar
@defvar latex-error-regexp
Regular expression of error message (@code{"l\\.[1-9][0-9]*"})
@end defvar
@defvar latex-dos-emergency-message
Message latex command running on DOS puts at abort (@code{"Emergency stop"})
@end defvar
@defvar YaTeX-item-regexp
Regular expression of item command (@code{"\\\\item"})
@end defvar
@defvar YaTeX-verb-regexp
Regexp of verb family. Omit \\\\. (@code{"verb\\*?\\|path"})
@end defvar
@defvar YaTeX-nervous
T for using local dictionary (@code{t})
@end defvar
@defvar YaTeX-sectioning-regexp
Regexp of La@TeX{} sectioning command
(@code{"\\(part\\|chapter\\*?\\|\\(sub\\)*\\(section\\|paragraph\\)\\*?\\)\\b"})
@end defvar
@defvar YaTeX-fill-inhibit-environments
Inhibit fill in these environments
(@code{'("tabular" "tabular*" "array" "picture" "eqnarray" "eqnarray*" "equation" "math" "displaymath" "verbatim" "verbatim*")})
@end defvar
@defvar YaTeX-uncomment-once
T for deleting all preceding @code{%} (@code{nil})
@end defvar
@defvar YaTeX-close-paren-always
T for always close all parenthesis automatically, @code{nil} for only eol
(@code{t})
@end defvar
@defvar YaTeX-auto-math-mode
Switch math-mode automatically (@code{t})
@end defvar
@defvar YaTeX-math-key-list-private
User defined alist, math-mode-prefix vs completion alist
used in image completion (@code{nil}). See @file{yatexmth.el}
for the information about how to define a completion alist.
@end defvar
@defvar YaTeX-default-pop-window-height
Initial height of typesetting buffer when one-window.
Number for the lines of the buffer, numerical string for
the percentage of the screen-height. @code{nil} for half height (10)
@end defvar
@defvar YaTeX-help-file
Global online help file name (@file{$doc-directory/../../site-lisp/YATEXHLP.eng})
@end defvar
@defvar YaTeX-help-file-private
Private online help file name (@file{"~/YATEXHLP.eng"})
@end defvar
@defvar YaTeX-no-begend-shortcut
Disable [prefix] b ?? shortcut (@code{nil)}
@end defvar
@defvar YaTeX-hilit-pattern-adjustment-private
List of the list that contain the regular expression and the symbol of
logical meaning of the string that matches the pattern. See also the
value from @code{(assq 'yatex-mode hilit-patterns-alist)} and the value of
@code{YaTeX-hilit-pattern-adjustment-default} (and even the document of
hilit19.el).
@end defvar
@defvar YaTeX-sectioning-level
Alist of LaTeX's sectioning command vs its height.
@end defvar
@defvar YaTeX-hierarchy-ignore-heading-regexp
@code{YaTeX-display-hierarchy} searches for sectioning command first, and
comment line secondary as a file headings. In latter case, ignore lines
that match with regular expression of this variable. Default value of
this variable is RCS header expressions and mode specifying line `-*- xxxx
-*'.
@end defvar
@defvar YaTeX-skip-default-reader
Non-nil for this variable skips the default argument reader of
section-type command when add-in function for it is not defined
(@code{nil})
@end defvar
@defvar YaTeX-create-file-prefix-g
When typing @kbd{prefix g} on the @code{\include} line,
open the target file even if the file doesn't exist (@code{nil})
@end defvar
@defvar YaTeX-simple-messages
Simplyfy messages of various completions (@code{nil})
@end defvar
@defvar YaTeX-hilit-sectioning-face
When hilit19 and yatex19 is active, YaTeX colors the sectioning commands.
This variable specifies the foreground and background color of
@code{\part} macro. The default value is @code{'(yellow/dodgerblue
yellow/slateblue)}. The first element of this list is for the screen when
@code{hilit-background-mode} is @code{'light}, and the second element is
for @code{'dark}. You should specify both color as `forecolor/backcolor'.
@end defvar
@defvar YaTeX-hilit-sectioning-attenuation-rate
When color mode, this variable specifies how much attenuate the color
density of @code{\subparagraph} compared with that of @code{\chapter}
(@code{'(15 40)}) See also @code{YaTeX-hilit-sectioning-face}.
@end defvar
@defvar YaTeX-use-AMS-LaTeX
If you use AMS-LaTeX, set to @code{t} (@code{nil})
@end defvar
@defvar YaTeX-use-LaTeX2e
If you use LaTeX2e, set to @code{t} (@code{t})
@end defvar
@defvar YaTeX-template-file
File name which is automatically inserted at creation
(@code{~/work/template.tex})
@end defvar
@defvar YaTeX-search-file-from-top-directory
Non-nil means to search input-files from the directory where main file exists
(@code{t})
@end defvar
@defvar YaTeX-use-font-lock
Use font-lock to fontify buffer or not (@code{(featurep 'font-lock)}
@end defvar
@defvar YaTeX-use-hilit19
Use hilit19 to highlight buffer or not (@code{(featurep 'hilit19)}
@end defvar
@defvar YaTeX-use-italic-bold
YaTeX tries to search italic, bold fontsets or not
(@code{t} if Emacs-20 or later). This variable is effective only when
font-lock is used.
(@code{(featurep 'hilit19)}
@end defvar
@defvar YaTeX-singlecmd-suffix
Suffix which is always inserted after maketitle-type macros.
@code{"@{@}"} is recommended.
@end defvar
@defvar YaTeX-package-alist-private
Alist of LaTeX2e-package name vs. lists of macros in it.
Set this alist properly and YaTeX automatically check the declaratiion of
`usepackage' for corresponding macro, when you input that macro with
completion. If required `usepackage' is not found, YaTeX also
automatically inserts `\usepackage'. Alist is as follows;
@lisp
'((PackageName1
(completionType ListOfMacro)
(completionType ListOfMacro))
(PackageName2
(completionType ListOfMacro)
(completionType ListOfMacro...))....)
@end lisp
completionType is one of @code{env, section, maketitle}.
Consult the value of @code{YaTeX-package-alist-default} as an example.
@end defvar
@defvar YaTeX-tabular-indentation
At indentation by @kbd{C-i} in tabular or array environment,
YaTeX put the additional spaces to the normail indentation depth.
The number of additional spaces is the product of YaTeX-tabular-indentation
and the number of column position in tabular.
@end defvar
@defvar YaTeX-noindent-env-regexp
Regexp of environment names that should begin with no indentation.
All verbatime-like environment name should match with.
@end defvar
@defvar YaTeX-electric-indent-mode
Emacs 24.4 introduces automatic indentation of current and new lines.
This might be annoying for some people. Pass this value to the function
'electric-indent-local-mode. If you prefer to stop electric-indent-mode
in yatex-mode, set `-1' to this variable.
@end defvar
@defvar YaTeX-ref-default-label-string
Default \\ref time string format.
This format is like strftime(3) but allowed conversion char are as follows;
%y -> Last 2 digit of year, %b -> Month name, %m -> Monthe number(1-12),
%d -> Day, %H -> Hour, %M -> Minute, %S -> Second,
%qx -> alphabetical-decimal conversion of yymmdd.
%qX -> alphabetical-decimal conversion of HHMMSS.
Beware defualt label-string should be always unique. So this format string
should have both time part (%H+%M+%S or %qX) and date
part (%y+(%b|%m)+%d or %qx).
@end defvar
@defvar YaTeX-ref-generate-label-function
Function to generate default label string for unnamed \\label@{@}s.
The function pointed to this value should take two arguments.
First argument is LaTeX macro's name, second is macro's argument.
Here is an example for using this value.
@lisp
(setq YaTeX-ref-generate-label-function 'my-yatex-generate-label)
(defun my-yatex-generate-label (command value)
(and (string= command "caption")
(re-search-backward "\\\\begin@{\\(figure\\|table\\)@}" nil t)
(setq command (match-string 1)))
(let ((alist '(("chapter" . "chap")
("section" . "sec")
("subsection" . "subsec")
("figure" . "fig")
("table" . "tbl"))))
(if (setq command (cdr (assoc command alist)))
(concat command ":" value)
(YaTeX::ref-generate-label nil nil))))
@end lisp
@end defvar
@node Sample definitions, Hook variables, All customizable variables, Lisp variables
@comment node-name, next, previous, up
@subsection Sample definitions
@cindex prefix key stroke
@cindex fill-prefix
For instance, to change the prefix key stroke to @kbd{ESC}, and name of
the user dictionary @file{~/src/emacs/yatexrc}, and set @code{fill-prefix}
to single TAB character, add the following @code{setq} to @file{~/.emacs}.
@lisp
(setq YaTeX-prefix "\e"
YaTeX-user-completion-table "~/src/emacs/yatexrc"
YaTeX-fill-prefix " ")
@end lisp
@node Hook variables, Hook file, Sample definitions, Lisp variables
@comment node-name, next, previous, up
@subsection Hook variables
@cindex hook variables
More customizations will be done by the hook-function defined in
hook-variable @code{yatex-mode-hook}. This is useful to define a shortcut
key sequence to enter some environments other than @code{document} and
@code{enumerate} etc. The following statement defines @code{[prefix] ba}
to enter @code{\begin@{abstract@}} ... @code{=end@{abstract@}}
immediately.
@lisp
(setq yatex-mode-hook
'(lambda() (YaTeX-define-begend-key "ba" "abstract")))
@end lisp
You should use functions @code{YaTeX-define-key}, or
@code{YaTeX-define-begend-key} to define all the key sequences of
yatex-mode.
@node Hook file, , Hook variables, Lisp variables
@comment node-name, next, previous, up
@subsection Hook file
@cindex hook file
You can stuff all of YaTeX related expressions into a file named
@file{yatexhks.el} if you have a lot of codes. YaTeX automatically load
this file at the initialization of itself. Using @file{yatexhks.el}
makes @code{yatex-mode-load-hook} unnecessary.
@node Add-in functions, Add-in generator, Lisp variables, Customizations
@comment node-name, next, previous, up
@section Add-in functions
@cindex add-in functions
@cindex yatexadd.el
You can easily define a function to input detailed arguments
with completion according to La@TeX{} environments or commands.
@c @node What is add-in functions?, , Add-in functions, Add-in functions
@comment node-name, next, previous, up
@subsection What is add-in functions?
@cindex tabular
When you input @code{tabular} environment, don't you think ``I want
YaTeX to complete its argument toward my favorite one such as
@code{@{|c|c|c|@}}...''? Yes, you can define the function to complete
arguments for any environment and any La@TeX{} commands.
@subsection Procedure
Here is the procedure to define add-in functions.
@enumerate
@item
Define the function
@item
Put the function into @file{yatexhks.el}
@end enumerate
@menu
* How the add-in function works::
* How the function is called::
* Useful functions for creating add-in::
* Contribution::
@end menu
@node How the add-in function works, How the function is called, Add-in functions, Add-in functions
@comment node-name, next, previous, up
@subsection How the add-in function works
There are three types of add-in.
@enumerate
@item
Option add-in
@item
argument add-in
@item
enclosing add-in
@end enumerate
@dfn{Option add-in} returns the
La@TeX{}'s optional parameters such as optional strings after
@code{\begin@{ENV@}}, optional strings between a section-type command
and its first argument, and optional strings just after type
maketitle-type command. The following illustrates the name of add-in
functions, where underlined strings are generated by add-in functions.
@display
\begin@{table@}[ht] (Function name: YaTeX:table)
~~~~
\put(100,200)@{@} (Function name: YaTeX:put)
~~~~~~~~~
\sum_@{i=0@}^@{n@} (Function name: YaTeX:sum)
~~~~~~~~~~
@end display
Obviously, the function name is decided by concatenating the prefix
`YaTeX:' and La@TeX{} command's name.
Another add-in type is @dfn{argument add-in}, which completes arguments
for section-type commands.
@display
\newcommand@{\foo@}@{bar@} (Function name: YaTeX::newcommand)
~~~~ ~~~
@end display
When the section-type command is inputted, the function named by
concatenating `YaTeX::' and section-type command, is called automatically
with an integer argument which indicates which argument of section-type
command is being read. Thus the add-in should determine the
job referring the value of its argument.
@dfn{enclosing add-in} is for modifying and/or checking the region that
will be enclosed by section-type commands via @kbd{[prefix] S}. An
enclosing add-in function will be called with two arguments, beginning of
the enclosed region and end of the region. Suppose you want to enclose
the existing text @code{(a+b)/c} by @code{\frac@{@}}.
@display
a/c
| |
A B
@end display
You do set-mark-command at point A and then move to point B. Typing
@kbd{[prefix] S} and input @code{frac} enclose the region like this;
@display
\frac@{a/c@}
@end display
Normally, the expression @code{a/c} is translated to
@code{\frac@{a@}@{c@}}. An enclosing add-in is useful for modifying
@code{/} to @code{@}@{}.
@menu
* Defining option-add-in::
* Defining argument-add-in::
* Defining enclosing-add-in::
@end menu
@node Defining option-add-in, Defining argument-add-in, How the add-in function works, How the add-in function works
@comment node-name, next, previous, up
@subsubsection Defining `option add-in'
If you want @code{@{|c|c|c|@}} for all @code{tabular} environment,
@lisp
(defun YaTeX:tabular ()
"@{|c|c|c|@}")
@end lisp
@noindent
is enough. If you want more complicated format, define as below.
@lisp
(defun YaTeX:tabular ()
"@{@@@{\\vrule width 1pt\\ @}|||@@@{\\ \\vrule width 1pt@}@}")
@end lisp
@noindent
Note that the character @code{\} must be described as @code{\\} in
Emacs-Lisp. The next example reads the tabular format from keyboard.
@lisp
(defun YaTeX:tabular ()
(concat "@{" (read-string "Rule: ") "@}"))
@end lisp
@node Defining argument-add-in, Defining enclosing-add-in, Defining option-add-in, How the add-in function works
@comment node-name, next, previous, up
@subsubsection Defining `argument add-in'
This section describes how to define the add-in function for
@code{\newcommand}.
The first argument of @code{\newcommand} begins always with @code{\}.
The second argument is usually so complex that we can not edit them in the
minibuffer. Here is the created function considering this.
@lisp
(defun YaTeX::newcommand (n) ;n is argument position
(cond
((= n 1) ;1st argument is macro name
(read-string "Command: " "\\")) ;initial input `\'
((= n 2) "") ;do nothing when reading arg#2
(t nil)))
@end lisp
Note that when the `argument add-in' function return `nil', normal
argument reader will be called.
@node Defining enclosing-add-in, , Defining argument-add-in, How the add-in function works
@comment node-name, next, previous, up
@subsubsection Defining `enclosing add-in'
This section describes how to define the add-in function for
text enclosed by @code{\frac@{@}}.
When enclosing the text @code{5/3} by @code{\frac@{@}}, you might want to
replace @code{/} with @code{@}@{}. Enclosing function
@code{YaTeX::frac-region} is called with two arguments, beginning of
enclosed text and end of enclosed text. The function is expected to
replace @code{/} with @code{@}@{}. Here is an example expression.
@lisp
(defun YaTeX::frac-region (beg end)
(catch 'done
(while (search-forward "/" end t)
(goto-char (match-beginning 0))
(if (y-or-n-p "Replace this slash(/) with `@}@{'")
(throw 'done (replace-match "@}@{")))
(goto-char (match-end 0)))))
@end lisp
@node How the function is called, Useful functions for creating add-in, How the add-in function works, Add-in functions
@comment node-name, next, previous, up
@subsection How the function is called
YaTeX calls the add-in functions for specified begin-type, section-type,
and maketitle-type command, if any. `Option add-in' functions for
begin-type are called when @code{\begin@{ENV@}} has been inserted,
functions for section-type are called just before input of the first
argument, and functions for maketitle-type is called after maketitle-type
command has been inserted. `Argument add-in' functions are called at each
entry of arguments for section-type commands.
@node Useful functions for creating add-in, Contribution, How the function is called, Add-in functions
@comment node-name, next, previous, up
@subsection Useful functions for creating add-in
Many add-in functions for typical La@TeX{} commands are defined in
@file{yatexadd.el}. Those are also useful as references. Here are the
short descriptions on useful functions, where [F] means function, [A]
means arguments, [D] means description.
@table @kbd
@item [F]
YaTeX:read-position
@itemx [A]
Character list which can show up in the brackets
@itemx [D]
Return the location specifier such as `[htb]'. When
nothing is entered, omit [] itself. If the possible characters
are "htbp", call this function as
@code{(YaTeX:read-position "htbp")}
@item [F]
YaTeX:read-coordinates
@itemx [A]
Base prompt, X-axis prompt, Y-axis prompt (each optional)
@itemx [D]
Read the coordinates with the prompt ``BasePrompt X-axisPrompt:'' for
X-axis, ``BasePrompt Y-axisPrompt:'' for Y-axis, and return it in the form
of ``(X,Y)''. The default prompts are @code{Dimension}, @code{X},
@code{Y} respectively.
@item [F]
YaTeX:check-completion-type
@itemx [A]
One of the symbols: 'begin, 'section, or 'maketitle
@itemx [D]
Check the current completion type is specified one and cause error if
not. The variable @code{YaTeX-current-completion-type} holds the symbol
according to the current completion type.
@end table
@node Contribution, , Useful functions for creating add-in, Add-in functions
@comment node-name, next, previous, up
@subsection Contribution
If you make your own pretty function and you let it be in public, please
send me the function. I'm going to include it in the next release.
@node Add-in generator, , Add-in functions, Customizations
@comment node-name, next, previous, up
@section Add-in generator
First, don't forget to read the section of add-in functions @ref{Add-in
functions}. If you easily understand how to define them, there's no need
to read this section. But being not familiar with Emacs-Lisp, when you
don't have clear idea what to do, this section describes how to get YaTeX
make add-in function.
There are two methods of generation. One is for fully interactive
generator for beginners and another requires little knowledge of
Emacs-Lisp.
@subsection Generator for beginners
The former generator is called by
@center @kbd{M-x YaTeX-generate}
@noindent
strokes. All you have to do is follow the guidances. Defying them may cases
the disaster (I wonder what is it???). So when you make some mistake, it
is recommendable to type @kbd{C-g} and start afresh.
@subsection Simple generator
The latter generator is invoked by the next sequence.
@center @kbd{M-x YaTeX-generate-simple}
This generator can make both ``option add-in'' and ``argument add-in''
(@emph{refer the section add-in functions}
@ref{How the add-in function works}), whereas @code{YaTeX-generate}
cannot make ``argument addin''.
For example, assume you have the LaTeX command as follows.
@example
\epsinput[t](250,50)@{hoge.eps@}@{plain@}@{Picture of foo@}
(A) (B) (1) (2) (3)
(A)Optional parameter to specify the position
One of t(top), b(bottom), l(left), r(right)
(B)Maximum size of frame
(1)1st argument is filename of EPS file
(2)2nd argument indicates
plain do nothing
frame make frame around image
dframe make double-frame around image
for included EPS file.
(3)Caption for the picture
@end example
Now get start with generation. Typing @kbd{M-x YaTeX-generate-simple}
brings the prompt:
@display
(O)ption? (A)rgument?
@end display
@subsubsection Generating ``option add-in''
@cindex option add-in
Since (A), (B) above are optional argument, all we have to do to
complete them is define the option add-in for them. Let's generate the
function to complete (A).
@display
M-x YaTeX-generate-simple RET
epsinput RET
o
@end display
@noindent
Typing as above leads the next prompt.
@display
Read type(1): (S)tring (C)omplete (F)ile ([)option (P)osition co(O)rd. (q)uit
@end display
@noindent
This asks that ``Which type is the completion style of 1st argument?''.
Here are the possible completion style.
@table @code
@item String
read plain string
@item Complete
read with completion
@item File
read file name
@item Option
read optional string (if string omitted, omit [] too)
@item Position
read positional option (like [htbp])
@item Coord.
read coordinates
@item Quit
quit from generating
@end table
Since (A) is the optional argument to specify the location of included
EPS file, the completion style is @code{Position}, and the possible
characters are t, b, l, and r. To tell these information to generator,
operate as follows.
@display
Read type(1).... p
Acceptable characters: tblr RET
@end display
(B) is coordinate. So its completion style is coOrd. We want a prompt
meaning ``Maximum size'' when completion.
@display
Read type(2).... o
Prompt for coordinates: Max size RET
@end display
That's all for optional argument. Select quit.
@display
Read type(3).... q
@end display
Then the generated option add-in function for \epsinput will be shown in
the next window.
@subsubsection Generating ``argument add-in''
@cindex argument add-in
Next, create the argument add-in. The arguments for \epsinput are EPS
file name, framing style, and caption string in sequence.
@display
M-x YaTeX-generate-simple RET
epsinput RET
a
@end display
Above key strokes bring the prompt that asks the number of argument.
Answer it with 3.
@display
How many arguments?: 3 RET
@end display
Then the generator asks the completion style and prompt for completion.
Answer them. @kbd{f} for FileName and prompt string.
@display
Read type(1).... f
Prompt for argument#1 EPS file name RET
@end display
The second argument is one of selected symbol. So the completion type
is @code{Completion}.
@display
Read type(2).... c
Prompt for argument#2 Include style RET
@end display
Then all the candidates ready to be read. Type single RET after
entering all.
@display
Item[1](RET to exit): plain RET
Item[2](RET to exit): frame RET
Item[3](RET to exit): dframe RET
Item[4](RET to exit): RET
@end display
The following prompt asks whether the entered string must belong to
candidates or not. In this case, since the argument must be one of
@code{plain}, @code{frame}, and @code{dframe}, type @code{y}.
@display
Require match? (y or n) y
@end display
The last argument is the caption string for which any completion is
needed.
@display
Read type(3).... s
Prompt for argument#3 Caption RET
default: Figure of RET
@end display
Finally we'll get the argument add-in in the next window.
@subsection Contribution
If you get your own pretty function and you let it be in public, please
steel yourself in the happy atmosphere and do not send me the function.
I do know it is not fine because it is generated by yatexgen:-p.
@node Etcetera, Copying, Customizations, Top
@comment node-name, next, previous, up
@chapter Etcetera
The standard completion tables provided in @file{yatex.el} contain a
few La@TeX{} commands I frequently use. This is to lessen the key
strokes to complete entire word, because too many candidates
rarely used often cause too many hits. Therefore always try to
use completion in order to enrich your dictionary, and you will
also find `Wild Bird' growing suitable for your La@TeX{} style.
The package name `Wild Bird' is the English translation of Japanese
title `Yachou', which is a trick on words of Japanese.
@node Copying, , Etcetera, Top
@comment node-name, next, previous, up
@chapter Copying
This program is distributed as a free software. You can
use/copy/modify/redistribute this software freely but with NO warranty to
anything as a result of using this software. Adopting code from this
program is also free. But I would not do contract act.
This software can be treated with: ``The 2-Clause BSD License''
(since 2017-09-09, yatex 1.80).
Any reports and suggestions are welcome as long as I feel interests in
this software. My possible e-mail address is `yuuji@@yatex.org'. (as of
Sep.2017) And there is mailing list for YaTeX. Although the common
language is Japanese, questions in English will be welcome. To join the
ML, send the mail whose subject is `append' to the address
`yatex@@yatex.org. If you have some question, please ask to
`yatex-admin@@yatex.org'.
The specification of this software will be surely modified
(depending on my feelings) without notice :-p.
@flushright
HIROSE Yuuji
@end flushright
@bye
Local variables:
mode: texinfo
fill-prefix: nil
fill-column: 74
End:
|