1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973
|
#LyX 1.1 created this file. For more info see http://www.lyx.org/
\lyxformat 218
\textclass book
\language english
\inputencoding latin1
\fontscheme default
\graphics none
\paperfontsize default
\spacing single
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 2
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 2
\paperpagestyle headings
\layout Title
The LyX Tutorial
\layout Author
by Amir Karger and the LyX Team
\layout Standard
\begin_inset LatexCommand \tableofcontents{}
\end_inset
\layout Chapter
Introduction
\layout Section
Welcome to LyX!
\layout Standard
This file is designed for all of you who have never heard of LaTeX, or don't
know it very well.
Now, don't panic - you won't need to learn LaTeX to use LyX.
That is, after all, the whole point of LyX: to provide an almost-WYSIWYG
interface to LaTeX.
There are some things you will need to learn, however, in order to use
LyX effectively.
\layout Standard
Some of you probably found your way to this document because you tried to
put two spaces after a
\begin_inset Quotes eld
\end_inset
.
\begin_inset Quotes erd
\end_inset
or tried to put 3 blank lines between paragraphs.
After much frustration, you found you couldn't.
In fact, you'll find that most of the little tricks you're accustomed to
using in other word processors just won't work in LyX.
That's because most word processors you've used before require you to manually
put in all spacings, font changes, and so on.
So you end up not only writing a document but typesetting it, too.
LyX does the typesetting for you, in a consistent fashion, letting you
focus on the important things, like the content of your writing.
\layout Standard
So, bear with us and read on.
Reading this tutorial is definitely worth the time.
\layout Section
What the Tutorial
\emph on
is
\emph default
and What it
\emph on
isn't
\layout Standard
Before we get started with this section, we want to make a quick note of
something.
The
\emph on
Tutorial
\emph default
uses the notation outlined in the
\emph on
Introduction
\emph default
\SpecialChar \@.
If you came to this manual first, go read the
\emph on
Introduction
\emph default
\SpecialChar \@.
Yes, we mean now.
\layout Standard
Now that you know which fonts mean what, we want to talk a bit about what
this
\emph on
Tutorial
\emph default
is for.
\layout Subsection
Getting the Most out of the Tutorial
\layout Standard
This tutorial consists of examples and exercises.
To get the most out of this document, you should read through the document,
typing all the silly little things we're telling you to type and trying
out all of the exercises to see if you get them right.
For convenience, you might want to print out the PostScript version of
this document.
\layout Standard
If you are familiar with LaTeX, you'll probably be able to read the
\emph on
Tutorial
\emph default
somewhat faster, since many LyX ideas are just LaTeX ideas in disguise.
However, LyX does have idiosyncrasies
\begin_float footnote
\layout Standard
or, more optimistically,
\begin_inset Quotes eld
\end_inset
features
\begin_inset Quotes erd
\end_inset
\end_float
you'll want to learn about.
Even if you don't feel like reading the rest of the
\emph on
Tutorial
\emph default
, you should definitely check out Section\SpecialChar ~
\begin_inset LatexCommand \ref{sec:latexusers}
\end_inset
, which is specifically written for experienced LaTeX users.
\layout Standard
Section\SpecialChar ~
\begin_inset LatexCommand \ref{sec:what-is-lyx}
\end_inset
is a holdover from an earlier version of the Tutorial, and is a bit pithy.
Still it's a nice
\begin_inset Quotes eld
\end_inset
at-a-distance
\begin_inset Quotes erd
\end_inset
introduction to LyX, so you might want to glance over it to get a feel
for what LyX is all about.
\layout Subsection
What You
\emph on
won't
\emph default
Find:
\layout Itemize
Spoon-feeding or other dumbing-down.
\begin_deeper
\layout Standard
The trend in computer self-help literature these days
\begin_float footnote
\end_deeper
\layout Standard
Note from
\noun on
John
\noun default
Weiss: \SpecialChar \ldots{}
well, at least in America, where we dumb everything down to the lowest
common denominator\SpecialChar \ldots{}
\end_float
seems to be:
\begin_inset Quotes eld
\end_inset
Assume the user has the I.
Q.
of a potato.
\begin_inset Quotes erd
\end_inset
We don't do that.
\begin_deeper
\layout Standard
On the other hand, we do realize that most users go to a manual, especially
a tutorial, when they're lost.
So, while we'll assume that you, the user, are
\emph on
not
\emph default
stupid, we do understand that you might be a tad clueless or confused.
\end_deeper
\layout Itemize
Instructions how to use a mouse or a keyboard.
\begin_deeper
\layout Standard
If you haven't figured out by now how to use your computer, we can't help
you, as such things are beyond the scope of the LyX manuals.
\begin_float footnote
\end_deeper
\layout Standard
Besides which, if you're using LyX to begin with, you'll probably have more
than half a brain in your head.
\end_float
\layout Itemize
Detailed explanations of all of LyX's features.
\begin_deeper
\layout Standard
What, you want the
\emph on
User's Guide
\emph default
twice?
\layout Standard
Seriously, though, we're here to get you up and running so that all you
need is the
\emph on
User's Guide
\emph default
.
If we tried to duplicate all of the information about all of LyX's features
in here, the
\emph on
Tutorial
\emph default
would be redundant, too long, and forever out of date.
All we do here is introduce things; imagine there is a
\begin_inset Quotes eld
\end_inset
see the
\emph on
User's Guide
\emph default
\begin_inset Quotes erd
\end_inset
at the end of every section.
\end_deeper
\layout Itemize
Detailed explanations of LaTeX.
\begin_deeper
\layout Standard
Unnecessary.
If you're really curious about learning some of the neat tricks you can
do with LaTeX, you can always go get a LaTeX book.
There are several good ones on the market.
No need to reinvent the wheel, after all\SpecialChar \ldots{}
\end_deeper
\layout Standard
So, brave soul, it's time to move onward.
You can take a brief excursion through the next section, or you can go
on to Section\SpecialChar ~
\begin_inset LatexCommand \ref{sec:first-doc-ex}
\end_inset
.
\layout Section
What is LyX?
\begin_inset LatexCommand \label{sec:what-is-lyx}
\end_inset
\layout Subsection
Overview
\layout Standard
Part of the initial challenge of using LyX comes from the change in thinking
that you, the user, must make.
At one time, all we had for creating documents were typewriters, so we
all learned certain tricks to get around their limitations.
Underlining, which is little more than overstriking with the
\begin_inset Quotes eld
\end_inset
_
\begin_inset Quotes erd
\end_inset
character, became a way to emphasize text.
To create a table, you figured out beforehand how big each column was to
be and set the appropriate tab stops.
The same applied for letters and other right justified text.
Hyphenation at the end of a line required a careful eye and a lot of foresight.
\layout Standard
In other words, we've all been trained to worry about the little details
of which character goes where.
\layout Standard
Consequently, almost all word processors have this mentality.
They still use tab stops for adding whitespace.
You still need to worry about exactly where on the page something will
appear.
Emphasizing text means changing a font, similar to changing the typewriter
wheel.
You get the idea.
\layout Standard
This is where LyX differs from an ordinary word processor.
You don't concern yourself with what character goes where.
You tell LyX
\emph on
what you're doing
\emph default
and LyX takes care of the rest, following a set of rules called a
\emph on
style
\emph default
.
Let's look at a little example:
\layout Standard
Suppose you're writing a report.
To begin your report, you want a section called
\begin_inset Quotes eld
\end_inset
Introduction\SpecialChar \@.
\begin_inset Quotes erd
\end_inset
So, you go into whatever menu it is in your word processor that changes
font sizes and decide on a new font size.
Then you turn on bold face.
Then you type,
\begin_inset Quotes eld
\end_inset
1.\SpecialChar ~
\SpecialChar ~
Introduction
\begin_inset Quotes erd
\end_inset
.
Of course, if you later decide that this section belongs someplace else
in the document, or if you insert a new section before it, you need to
change the numbering for this and all following sections, as well as any
entry in the table of contents.
\layout Standard
In LyX, you go to the pull-down on the far left of the button bar and select
\family sans
Section
\family default
, and type
\begin_inset Quotes eld
\end_inset
Introduction\SpecialChar \@.
\begin_inset Quotes erd
\end_inset
\layout Standard
Yes, that's all.
If you cut and paste the section, it will automatically be renumbered ---
everywhere.
There's even a way to make LyX automatically update any references to the
section inside the file.
\layout Standard
Now let's look at the problem of consistency.
Five days later, you reopen your report and start Section\SpecialChar ~
4.
However, you forget that you were using 18pt bold instead of 16pt, so you
type in the heading for Section\SpecialChar ~
4 in a different font that what you used
for Section\SpecialChar ~
1.
That problem doesn't even exist in LyX.
The computer takes care of all that silly bookkeeping about which thing
has what size font, not you.
After all, that's what a computer is good at.
\layout Standard
Here's another example.
Suppose you're making a list.
In other word processors, a list is just a bunch of tab stops and newlines.
You need to figure out where to put the label for each list item, what
that label should be, how many blank lines to put between each item, and
so on.
Under LyX, you have only two concerns: what kind of list is this, and what
do I want to put in it.
That's it.
\layout Standard
So, the basic idea behind LyX is: specify what you're doing, not how to
do it.
Instead of
\begin_inset Quotes eld
\end_inset
what you see is what you get,
\begin_inset Quotes erd
\end_inset
the LyX model is
\begin_inset Quotes eld
\end_inset
what you see is what you
\emph on
mean
\emph default
\begin_inset Quotes erd
\end_inset
or
\begin_inset Quotes eld
\end_inset
WYSIWYM.
\begin_inset Quotes erd
\end_inset
\layout Subsection
Differences between LyX and Word Processors
\begin_float footnote
\layout Standard
No, we're not trying to start (or win) a word processor holy war here.
But we do think it's important to describe LyX's features.
And one of LyX's main features, WYSIWYM, is a fundamentally different concept
than the one that 99% of people have about word processing.
\end_float
\layout Standard
Here's a list of things you won't find in LyX:
\layout Itemize
The document ruler
\layout Itemize
Tab stops
\layout Itemize
Extra whitespace [i.e.
hitting
\family sans
Enter
\family default
or
\family sans
Space
\family default
two or more times]
\layout Standard
Tab stops, along with a ruler showing you the position of things on the
page, are useless in LyX.
The program worries about where things go on the page, not you.
Extra whitespace is similar; LyX adds them where necessary, depending on
context.
Not being able to type two blank lines in a row will be annoying at first,
but it makes more sense once you're thinking in WYSIWYM terms.
\layout Standard
Here are some things that exist in LyX, but aren't used as you might think:
\layout Itemize
Indenting controls
\layout Itemize
Page breaks
\layout Itemize
Line spacing [i.e.
single spaced, double spaced, etc.]
\layout Itemize
Whitespace, horizontal and vertical
\layout Itemize
Fonts and font sizes
\layout Itemize
Typefaces [bold, italic, underline, etc.]
\layout Standard
Although they exist in LyX, you generally don't need them.
LyX will take care of these things for you, depending on what you're doing.
Different parts of the document are automatically set in a different typeface
and font size.
Paragraph indenting is context dependent; different types of paragraphs
get indented differently.
Page breaks get handled automatically, as well.
In general, the space between lines, between words, and between paragraphs
is variable, set by LyX.
\begin_float footnote
\layout Standard
There are ways to adjust all of these [only some of which require knowledge
of LaTeX], either for a whole document or for a specific location in a
document.
See the
\emph on
User's Guide
\emph default
for details.
\end_float
\layout Standard
Lastly, there are a few areas where LyX [and LaTeX] surpasses many word
processors:
\layout Itemize
Hyphenation
\layout Itemize
Lists of any type
\layout Itemize
Mathematics
\layout Itemize
Tables
\layout Itemize
Cross-referencing
\layout Standard
Granted, many modern word processors can handle mathematical symbols, tables,
and hyphenation, and some are even moving towards style definitions and
the WYSIWYM concept.
However, they've only recently been able to do so, whereas LyX is built
upon the LaTeX document preparation system.
LaTeX has been around for over 10 years, and
\emph on
works
\emph default
.
All of the bugs have been long since ironed out.
\begin_float footnote
\layout Standard
Okay, we know nothing is perfect, but LaTeX is as close to bug-free as any
computer program can get.
\end_float
\layout Standard
A final, and most important, difference between LyX and other word processors
is stability.
Unlike certain commercial word processors, LyX does
\emph on
not
\emph default
claim to be stable only to crash every 30 minutes when given a large document.
The LyX Team knows we won't catch every single bug, nor do we try to pass
off bugs as features.
When those bugs [oh, sorry\SpecialChar \ldots{}
\begin_inset Quotes eld
\end_inset
features
\begin_inset Quotes erd
\end_inset
\SpecialChar \ldots{}
] rear their ugly head, you might think LyX will drag your last 3 pages
of creative endeavor into oblivion with it.
\layout Standard
Nope.
\layout Standard
Whenever LyX crashes, it dumps any document in memory to an emergency save
file before dying.
Upon restart, LyX will notice these emergency saves, specifically when
you try and reload the affected file[s].
LyX then prompts you, asking whether to load the emergency save file, or
the original file, depending on which is newer.
Many users have written their doctoral dissertations using LyX.
They seldom, if ever, lost a page, despite an occasional crash.
\layout Subsection
What the heck
\emph on
is
\emph default
LaTeX?
\layout Standard
LaTeX is a document preparation system designed by Leslie Lamport in 1985.
\begin_float footnote
\layout Standard
The source for the info in this section is
\begin_inset Quotes eld
\end_inset
\emph on
A Guide to LaTeX2e
\emph default
,
\begin_inset Quotes erd
\end_inset
by Helmut Kopka and Patrick Daly, which has an entry in the bibliography
of the
\emph on
User's Guide
\emph default
\SpecialChar \@.
\end_float
It, in turn, was built up from a typesetting language called TeX, created
by Donald Knuth in 1984.
\begin_inset Quotes eld
\end_inset
TeX
\begin_inset Quotes erd
\end_inset
is pronounced like
\begin_inset Quotes eld
\end_inset
blech!
\begin_inset Quotes erd
\end_inset
which is how many people feel about it.
However, most folks don't understand just what TeX is.
TeX takes a sequence of typesetting commands, written in a script in an
ASCII file, and executes them.
It's a bit more complicated than a typewriter, but not nearly as involved
as an actual printing press.
In any case, what comes out of TeX is the so-called
\begin_inset Quotes eld
\end_inset
device independent
\begin_inset Quotes erd
\end_inset
format file, or
\family typewriter
dvi
\family default
for short.
You can then feed the
\family typewriter
dvi
\family default
file to anything that understands
\family typewriter
dvi
\family default
, or converts
\family typewriter
dvi
\family default
to other formats like PostScript.
\layout Standard
If it weren't for one other feature, all TeX would be is a typesetting engine.
However, TeX also allows you to define macros.
This is where the action begins.
\layout Standard
Most people who use TeX are actually using a macro package which Knuth created
to hide a lot of the typesetting details.
This is what most people think of when they think of TeX\SpecialChar \@.
Ordinary users
don't work with raw TeX, which are the bare-bones typesetting commands.
People creating new macro-packages do that.
This is where Leslie Lamport enters our story.
He wanted a macro package that was more user-oriented and less typesetter-orien
ted, a set of commands that consistently typeset things like sections or
tables or math formulae in a uniform, consistent fashion with as little
fuss as possible.
This is how LaTeX was born.
\layout Standard
Now, in parallel with the development and growth of LaTeX, other folks were
creating their own custom macro packages for TeX, ones to make slides or
articles for math journals and so on.
Some used the raw TeX to do this, others began modifying LaTeX.
To try and unify this mess, a team of LaTeX-nicians, [including Lamport,
of course] began to work on LaTeX2e, the current version of LaTeX, during
the late 1980's.
This new version of LaTeX has commands which provide an easier-to-use interface
to TeX's macro-creating commands [remember TeX?], aid in the use of new
fonts, and so on.
In fact, LaTeX is quite an extensive language in its own right! Users around
the world have been creating their own add-ons for LaTeX beyond the standard
ones.
\layout Standard
There are two ways to extend LaTeX: classes and styles.
A
\emph on
class
\emph default
is a set of LaTeX [and TeX] macros describing a new type of document, like
a book, or an article.
There are classes for slides, for physics and math journals\SpecialChar \ldots{}
some universities
even have a class for their thesis format! A
\emph on
style
\emph default
differs from a class in that it doesn't define a new type of document,
but a different type of
\emph on
behavior
\emph default
that any document can use.
For example, LyX controls page margins and line spacing using two different
LaTeX style-files designed for these purposes.
There are style-files for a whole slew of things: printing labels or envelopes,
changing indentation behavior, adding new fonts, manipulating graphics,
designing fancy page headings, customizing bibliographies, altering the
location and appearance of footnotes, tables, and figures, customizing
lists, et cetera, et cetera, et cetera.
\layout Standard
Here's a summary:
\layout List
\labelwidthstring 00.00.0000
TeX: Typesetting language with macro capability.
\layout List
\labelwidthstring 00.00.0000
LaTeX: Macro package built upon TeX\SpecialChar \@.
\layout List
\labelwidthstring 00.00.0000
classes: Descriptions of a type of document, using LaTeX\SpecialChar \@.
\layout List
\labelwidthstring 00.00.0000
styles: Alters the default behavior of LaTeX in some way.
\layout List
\labelwidthstring 00.00.0000
LyX: Visual, WYSIWYM word-processor that uses LaTeX in all its glory to
do its printing.
\layout Standard
The idea of this section was to try and explain
\emph on
why
\emph default
LyX works somewhat differently from other word processors.
The reason is simple: LyX uses LaTeX as its printing backend.
Just like LaTeX, LyX focuses on the context of your writing ---
\emph on
what
\emph default
you are typing.
The computer then handles how it should look.
\layout Standard
Oh --- one last thing.
LaTeX is pronounced like TeX is.
It rhymes with
\begin_inset Quotes eld
\end_inset
hey blech.
\begin_inset Quotes erd
\end_inset
\begin_float footnote
\layout Standard
or
\begin_inset Quotes eld
\end_inset
ha blech
\begin_inset Quotes erd
\end_inset
, depending on how you pronounce your
\begin_inset Quotes eld
\end_inset
a
\begin_inset Quotes erd
\end_inset
s\SpecialChar \ldots{}
\end_float
Usually.
Lamport says in his book, though, that
\begin_inset Quotes eld
\end_inset
\emph on
lay
\emph default
-tecks is also possible
\begin_inset Quotes erd
\end_inset
.
\begin_inset Quotes eld
\end_inset
LyX,
\begin_inset Quotes erd
\end_inset
on the other hand, is pronounced
\begin_inset Quotes eld
\end_inset
licks.
\begin_inset Quotes erd
\end_inset
Or
\begin_inset Quotes eld
\end_inset
lucks,
\begin_inset Quotes erd
\end_inset
or
\begin_inset Quotes eld
\end_inset
looks,
\begin_inset Quotes erd
\end_inset
depending on what country you're from\SpecialChar \ldots{}
\layout Chapter
Getting Started with LyX
\layout Section
Your First LyX Document
\layout Standard
\begin_inset LatexCommand \label{sec:first-doc-ex}
\end_inset
OK\SpecialChar \@.
You're ready to start writing.
Before you do, though, there are a few things we need to mention, which
will hopefully make the
\emph on
Tutorial
\emph default
more instructive, useful, and fun.
\layout Standard
Because there's lots of information that we won't be giving you, the
\emph on
first
\series medium
\emph default
thing that you need to do is find the
\series default
other
\series medium
help files.
Luckily, this is very simple.
\series default
Start up LyX.
Choose the
\emph on
User's Guide
\emph default
from the
\family sans
\bar under
H
\bar default
elp
\family default
menu.
You may want to load the
\emph on
Tutorial
\emph default
as well (if you're not reading it on screen already).
This way, you can read them while you're writing your own file
\begin_float footnote
\layout Standard
They can also serve as good examples of how to use the many features of
LyX.
\end_float
.
Note that once you've got more than one document open, you can use the
\family sans
\bar under
D
\bar default
ocuments
\family default
menu to switch between them.
The
\emph on
Tutorial
\emph default
will not cover in detail subjects which are described in the other LyX
manuals.
This may make life a bit harder for you at the beginning, but it will keep
the
\emph on
Tutorial
\emph default
short.
It will also get you in the habit of using the other manuals, which ---
in the long run --- will save you a lot of time.
\layout Standard
In this
\emph on
Tutorial
\emph default
, we're going to assume that you have a fully working version of LyX, as
well as LaTeX,
\family typewriter
xdvi
\family default
or some other dvi viewer,
\family typewriter
dvips
\family default
or some other way of converting
\family typewriter
dvi
\family default
documents to PostScript documents, and a working printer.
This is a lot to assume.
If any of this is not true, you (or a friendly system administrator) will
need to set up your system.
You can find information on setup in other manuals.
\layout Standard
Finally, we've written a file to let you practice your LyX skills on.
It's called
\family typewriter
example_raw.lyx
\family default
.
Imagine that it was typed by someone who didn't know about any of LyX's
great features.
As you learn new LyX functions, we'll suggest that you fix those parts
of
\family typewriter
example_raw.lyx
\family default
.
It also contains
\begin_inset Quotes eld
\end_inset
subtle
\begin_inset Quotes erd
\end_inset
hints about how to fix things
\begin_float footnote
\layout Standard
The hints are located in yellow
\begin_inset Quotes eld
\end_inset
Notes
\begin_inset Quotes erd
\end_inset
.
Access the text in a note by clicking on it.
\end_float
.
If you want to cheat (or check what you've done), there's also a file called
\family typewriter
example_lyxified.lyx
\family default
which contains the same text as written and typeset by a LyX master.
\layout Standard
The example files can be found in the
\family typewriter
examples/
\family default
directory, which you can get to by selecting
\family sans
\bar under
F
\bar default
ile\SpecialChar \menuseparator
\bar under
O
\bar default
pen
\family default
and then clicking on the
\family sans
Examples
\family default
button.
Open the raw document, and use
\family sans
\bar under
F
\bar default
ile\SpecialChar \menuseparator
Save
\bar under
A
\bar default
s
\family default
to save a copy in your own directory for you to work on.
As you fix parts of the raw document, check to see how those changes affect
the dvi output.
\layout Standard
By the way, the
\family typewriter
examples/
\family default
directory contains lots of other examples files.
They will show you how to do various fancy things with LyX.
They are especially useful to display things that (due to length or other
reasons) won't fit in the documentation.
After you read the
\emph on
Tutorial
\emph default
, or when you're confused about how to do something fancy in LyX, take a
look at these files.
\layout Subsection
Typing, Viewing, and Printing
\layout Itemize
Open a new file with
\family sans
\bar under
F
\bar default
ile\SpecialChar \menuseparator
\bar under
N
\bar default
ew
\layout Itemize
Type a sentence like:
\family typewriter
This is my first LyX document!
\begin_float footnote
\layout Standard
All right.
You could actually type anything you want.
It really doesn't matter.
We'll apologize here for the inanity of this sentence, as well as anything
we ask you to type in the future.
\end_float
\layout Itemize
Save your document with
\family sans
\bar under
F
\bar default
ile\SpecialChar \menuseparator
Save\SpecialChar ~
\bar under
A
\bar default
s\SpecialChar \@.
\layout Itemize
Run LaTeX to create a
\family typewriter
dvi
\family default
file, with
\family sans
\bar under
V
\bar default
iew\SpecialChar \menuseparator
\bar under
D
\bar default
VI
\family default
\SpecialChar \@.
You may see things being printed in the window you ran the
\family typewriter
lyx
\family default
command from.
These are messages from LaTeX, which you can ignore for now.
LyX will run
\family typewriter
xdvi
\family default
(or some other
\family typewriter
dvi
\family default
viewer), which will pop up a new window displaying what your document will
look like when printed.
\begin_float footnote
\layout Standard
You can save time by leaving
\family typewriter
xdvi
\family default
running in the background.
Then, you can use
\family sans
\bar under
V
\bar default
iew\SpecialChar \menuseparator
\bar under
U
\bar default
pdate\SpecialChar \menuseparator
\bar under
D
\bar default
VI
\family default
and just click on the
\family typewriter
xdvi
\family default
window (or unminimize it) after LaTeX finishes running.
\end_float
\layout Itemize
Print by using
\family sans
\bar under
F
\bar default
ile\SpecialChar \menuseparator
\bar under
P
\bar default
rint
\family default
and hitting
\family sans
OK\SpecialChar \@.
\layout Standard
Congratulations! You've written and printed your first LyX document.
All of the rest is just details, which is covered in the rest of the
\emph on
Tutorial
\emph default
, the
\emph on
User's Guide
\emph default
, and the
\emph on
Reference Manual
\emph default
.
\layout Subsection
Simple Operations
\layout Standard
LyX can of course do most of the things you're used to doing with a word
processor.
It will word-wrap and indent paragraphs automatically.
Pull down a couple menus now
\begin_float footnote
\layout Standard
If you're like many
\noun on
unix
\noun default
users, you did so long before starting to read the
\emph on
Tutorial
\emph default
.
\end_float
and you'll see that most of the simple commands (e.g.,
\family sans
\bar under
F
\bar default
ile\SpecialChar \menuseparator
E
\bar under
x
\bar default
it,
\bar under
E
\bar default
dit\SpecialChar \menuseparator
\bar under
P
\bar default
aste,
\bar under
F
\bar default
ile\SpecialChar \menuseparator
\bar under
P
\bar default
rint)
\family default
have the name you expect them to have, are in the menu you'd expect them
to be in, and work as you expect them to work.
Here's a quick description of how to do some other simple actions.
\layout Description
Undo LyX has
\emph on
capacity
\emph default
for
\begin_inset Quotes eld
\end_inset
infinite undo
\begin_inset Quotes erd
\end_inset
, which means you can undo everything you've done since your current editing
session started, by selecting
\family sans
\bar under
E
\bar default
dit\SpecialChar \menuseparator
\bar under
U
\bar default
ndo
\family default
over and over again.
If you undo too much, just select
\family sans
\bar under
E
\bar default
dit\SpecialChar \menuseparator
\bar under
R
\bar default
edo
\family default
to get it back.
\begin_deeper
\layout Standard
[Currently, undo is limited to 100 steps.
Undo also doesn't work for
\emph on
everything
\emph default
, not for changes to the document layout for instance.]
\end_deeper
\layout Description
Cut/Paste/Copy Use
\family sans
\bar under
E
\bar default
dit\SpecialChar \menuseparator
\bar under
C
\bar default
ut
\family default
,
\family sans
\bar under
E
\bar default
dit\SpecialChar \menuseparator
\bar under
P
\bar default
aste
\family default
, and
\family sans
\bar under
E
\bar default
dit\SpecialChar \menuseparator
C
\bar under
o
\bar default
py
\family default
to cut, paste, and copy.
Or automatically paste selected text with the
\emph on
middle button
\emph default
.
\layout Description
Find/Replace Use
\family sans
\bar under
E
\bar default
dit\SpecialChar \menuseparator
\bar under
F
\bar default
ind\SpecialChar ~
&\SpecialChar ~
Replace
\family default
for a search.
In the resulting popup, search with the forward and backward arrows, and
use the
\family sans
\bar under
R
\bar default
eplace
\family default
button to replace a word you've found.
\begin_float footnote
\layout Standard
Close the window when you're done.
Or leave it open if you find it more convenient.
Most popups in LyX --- including the
\family sans
\bar under
F
\bar default
ind\SpecialChar ~
&\SpecialChar ~
Replace
\family default
,
\family sans
Table\SpecialChar ~
of\SpecialChar ~
Contents
\family default
, and
\family sans
Layout
\family default
popups, as well as the various math popups --- are windows that may be
lowered, rather than closed.
A few popups, like
\family sans
\bar under
F
\bar default
ile\SpecialChar \menuseparator
\bar under
O
\bar default
pen
\family default
, won't let you type anything in the main LyX window until you actually
close the popup.
Just be sure you have the right window focus when you're trying to type
in the main LyX window or give a command in some other LyX popup.
\end_float
If you like, you can specify whether to make the search case-sensitive,
or to search for only complete words.
\layout Description
Character\SpecialChar ~
Formatting You can
\emph on
emphasize
\emph default
text (which will generally put characters in italics), put it in
\series bold
bold face
\series default
, or in
\noun on
Noun Style
\noun default
(usually small caps, used for people's names) from the toggle buttons in
the
\family sans
\bar under
L
\bar default
ayout\SpecialChar \menuseparator
\bar under
C
\bar default
haracter
\family default
menu.
\layout Description
Toolbar There are buttons on the toolbar (just below the menus) which allow
you to do some of the more popular functions, such as
\family sans
Paste
\family default
and
\family sans
Print
\family default
.
If you hold the mouse above one of the buttons on the toolbar, a little
yellow note will tell you that button's function.
\layout Description
Minibuffer The gray line at the very bottom of the LyX window is called
the minibuffer.
This line will show all sorts of useful information.
For example, when you save, it will tell you the name of the file you just
saved.
Some error messages may show up here, too.
Note that you can
\emph on
type
\emph default
in the minibuffer too.
This gives you access to all sorts of interesting functionality, including
functionality which could break your document.
In other words, don't type in the minibuffer unless you know what you're
doing.
\layout Standard
Of course, you haven't yet written enough to make most of these functions
useful.
As you write more, though, try undoing, pasting, etc.
\layout Subsection
WYSIWYM: Whitespace in LyX
\layout Standard
\begin_inset LatexCommand \label{sec:whitespace}
\end_inset
One of the hardest things for new users to get used to is the way that LyX
handles whitespace.
As many times as you hit
\family sans
Return
\family default
, you'll only get one blank line.
As many times as you hit
\family sans
Space
\family default
, you'll only get one space.
On a blank line, LyX won't let you type even one space.
The
\family sans
Tab
\family default
key won't move you forward one tab stop; in fact there
\emph on
are
\emph default
no tab stops! There's no ruler at the top of the page to let you set tabs
or margins, either.
\layout Standard
Many commercial word processors are based on the WYSIWYG principle:
\begin_inset Quotes eld
\end_inset
What You See Is What You Get.
\begin_inset Quotes erd
\end_inset
LyX, on the other hand, is based on the principle that
\begin_inset Quotes eld
\end_inset
What You See Is What You
\emph on
Mean
\emph default
.
\begin_inset Quotes erd
\end_inset
You type what you mean, and LyX will take care of typesetting it for you,
so that the output looks nice.
A
\family sans
Return
\family default
grammatically separates paragraphs, and a
\family sans
Space
\family default
grammatically separates words, so there is no reason to have several of
them in a row; a
\family sans
Tab
\family default
has no grammatical function at all, so LyX does not support it.
Using LyX, you'll spend more of your time worrying about the
\emph on
content
\emph default
of your document, and less time worrying about the
\emph on
format.
\emph default
See Section\SpecialChar ~
\begin_inset LatexCommand \ref{sec:what-is-lyx}
\end_inset
for more information on the WYSIWYM concept.
\layout Standard
LyX does have (many) ways to fine-tune the formatting of your document.
After all, LyX might not typeset
\emph on
exactly
\emph default
what you mean.
The
\emph on
User's Guide
\emph default
has information about all that.
It includes
\family sans
HFill
\family default
s and vertical space --- which are more powerful and versatile than multiple
spaces or blank lines --- and ways to change font sizes, character styles,
and paragraph alignments by hand.
The idea, though, is that you can write your whole document, focusing on
content, and just worry about that fine-tuning at the end.
With standard word processors, you'll be distracted by document formatting
throughout the writing process.
\layout Standard
Another special kind of whitespace is the
\family sans
Protected\SpecialChar ~
Blank
\family default
, which is made by typing
\family sans
C-Space
\family default
(or
\family sans
\bar under
I
\bar default
nsert\SpecialChar \menuseparator
\bar under
S
\bar default
pecial\SpecialChar ~
Character\SpecialChar \menuseparator
Protected\SpecialChar ~
\bar under
B
\bar default
lank
\family default
) and shows up as a small blue
\begin_inset Quotes eld
\end_inset
u
\begin_inset Quotes erd
\end_inset
on the screen
\begin_float footnote
\layout Standard
If you've been reading this online, you probably noticed and wondered about
these.
\end_float
.
If you put a
\family sans
Protected\SpecialChar ~
Blank
\family default
between two words, it prints out just like a regular space on paper.
However, a
\family sans
Protected\SpecialChar ~
Blank
\family default
tells LaTeX not to put a linebreak in between those two words.
A popular usage is when writing something like,
\begin_inset Quotes eld
\end_inset
see Section\SpecialChar ~
1,
\begin_inset Quotes erd
\end_inset
where you want to make sure that
\begin_inset Quotes eld
\end_inset
Section
\begin_inset Quotes erd
\end_inset
and
\begin_inset Quotes eld
\end_inset
1
\begin_inset Quotes erd
\end_inset
are on the same line
\begin_float footnote
\layout Standard
In the
\emph on
Tutorial
\emph default
, we also use them when describing menu names, or special characters like\SpecialChar \ldots{}
\family sans
Protected\SpecialChar ~
Blank
\family default
s!
\end_float
.
\layout Section
Environments
\layout Standard
Different parts of a document have different purposes; we call these parts
\emph on
environments
\emph default
.
Most of a document is made up of regular text.
Section (chapter, subsection, etc.) titles let the reader know that a new
topic or subtopic will be discussed.
Certain types of documents have special environments.
A journal article will have an abstract, and a title.
A letter will have neither of these, but will probably have an environment
that gives the writer's address.
\layout Standard
Environments are a major part of the
\begin_inset Quotes eld
\end_inset
What You See Is What You Mean
\begin_inset Quotes erd
\end_inset
philosophy of LyX.
A given environment may require a certain font style, font size, indenting,
line spacing, and more.
This problem is aggravated, because the exact formatting for a given environmen
t may change: one journal may use boldface, 18 point, centered type for
section titles while another uses italicized, 15 point, left justified
type; different languages may have different standards for indenting; and
bibliography formats can vary widely.
LyX lets you avoid learning all the different formatting styles.
\layout Standard
The
\family sans
Environment
\family default
box is located on the left end of the toolbar (just under the
\family sans
\bar under
F
\bar default
ile
\family default
menu).
It indicates which environment you're currently writing in.
While you were writing your first document, it said
\begin_inset Quotes eld
\end_inset
Standard,
\begin_inset Quotes erd
\end_inset
which is the default environment for text.
Now you will put a number of environments in your new document so that
you can see how they work.
You'll do so with the
\family sans
Environment
\family default
menu, which you open by clicking on the
\begin_inset Quotes eld
\end_inset
down arrow
\begin_inset Quotes erd
\end_inset
icon just to the right of the
\family sans
Environment
\family default
box.
\layout Subsection
Sections and Subsections
\layout Standard
Type the word
\family typewriter
Introduction
\family default
on the first line of your LyX file, and select
\family sans
Section
\family default
from the
\family sans
Environment
\family default
menu
\begin_float footnote
\layout Standard
You don't have to
\emph on
select
\emph default
the line.
If nothing is selected, LyX changes the paragraph you are currently in
to the selected environment.
Alternatively, you can change several paragraphs to a different environment
by selecting them before picking an environment.
\end_float
.
LyX numbers the section
\begin_inset Quotes eld
\end_inset
1
\begin_inset Quotes erd
\end_inset
and typesets the section heading (title) in a larger font.
(Of course, the section heading will also be typeset correctly in the
\family typewriter
dvi
\family default
or printed document.) Now hit
\family sans
Return
\family default
\SpecialChar \@.
Note that the
\family sans
Environment
\family default
box changes from
\begin_inset Quotes eld
\end_inset
Section
\begin_inset Quotes erd
\end_inset
back to
\begin_inset Quotes eld
\end_inset
Standard
\begin_inset Quotes erd
\end_inset
.
Section headings, like most environments, are assumed to end when you type
\family sans
Return
\family default
\SpecialChar \@.
\begin_float footnote
\layout Standard
See the
\emph on
User's Guide
\emph default
for ways to write titles with two or more lines.
The
\family sans
Standard
\family default
environment can of course continue for several paragraphs.
The various list environments (see below) also don't end when you hit
\family sans
Return
\family default
.
You can always tell what environment you're currently in by looking at
the
\family sans
Environment
\family default
box.
\end_float
Type the document introduction:
\layout LyX-Code
This is an introduction to my first LyX document.
\layout Standard
Hit
\family sans
Return
\family default
again, and select
\family sans
Section
\family default
from the
\family sans
Environment
\family default
menu again.
LyX writes a
\begin_inset Quotes eld
\end_inset
2
\begin_inset Quotes erd
\end_inset
and waits for you to type a title.
Type
\family typewriter
More Stuff
\family default
, and you'll see that LyX again sets it as a section title.
\layout Standard
It gets better.
Go to the end of Section\SpecialChar ~
1 again (after
\begin_inset Quotes eld
\end_inset
my first LyX document
\begin_inset Quotes erd
\end_inset
) and hit
\family sans
Return
\family default
again, and select
\family sans
Section
\family default
from the
\family sans
Environment
\family default
menu again.
Again, LyX writes
\begin_inset Quotes eld
\end_inset
2
\begin_inset Quotes erd
\end_inset
and waits for you to type a title.
Type
\family typewriter
About This Document
\family default
.
Section\SpecialChar ~
\begin_inset Quotes eld
\end_inset
More Stuff
\begin_inset Quotes erd
\end_inset
, which used to be Section\SpecialChar ~
2, has been automatically renumbered to Section\SpecialChar ~
3!
In true WYSIWYM fashion, you just need to identify the text that makes
up the section titles, and LyX takes care of numbering the sections and
typesetting them.
\layout Standard
Hit
\family sans
Return
\family default
to get back to the
\family sans
Standard
\family default
environment, and type the following five lines:
\layout LyX-Code
Sections and subsections are described below.
\layout LyX-Code
Section Description
\layout LyX-Code
Sections are bigger than subsections.
\layout LyX-Code
Subsection description
\layout LyX-Code
Subsections are smaller than sections.
\layout Standard
Click on the second line and select
\family sans
Subsection
\family default
from the
\family sans
Environment
\family default
menu.
LyX numbers the subsection
\begin_inset Quotes eld
\end_inset
2.1
\begin_inset Quotes erd
\end_inset
, and typesets it in a font which is bigger than regular text but smaller
than the section title.
Change the fourth line
\family sans
Subsection
\family default
environment as well.
As you probably expected, LyX automatically numbered the section
\begin_inset Quotes eld
\end_inset
2.2
\begin_inset Quotes erd
\end_inset
.
If you put yet another section before Section\SpecialChar ~
2, Section\SpecialChar ~
2 will be renumbered
as Section 3, and the subsections will be renumbered to
\begin_inset Quotes eld
\end_inset
3.1
\begin_inset Quotes erd
\end_inset
and
\begin_inset Quotes eld
\end_inset
3.2
\begin_inset Quotes erd
\end_inset
.
\layout Standard
Further levels of sectioning include
\family sans
Subsubsection
\family default
,
\family sans
Paragraph
\family default
, and
\family sans
Subparagraph
\family default
.
We'll let you play with these on your own.
You may notice that paragraph and subparagraph headings are not numbered
by default, and that subparagraphs are indented; see the
\emph on
User's Guide
\emph default
to change this.
\family sans
Chapter
\family default
headings are actually the highest level of sectioning, above
\family sans
Section
\family default
s, but you're only allowed to use them in certain types (textclasses) of
LyX documents (see Section\SpecialChar ~
\begin_inset LatexCommand \ref{sec:textclasses}
\end_inset
).
\layout Standard
Finally, you may want to have sections or subsections that are not numbered.
There are environments for this as well.
If you change one of your section headings to the
\family sans
Section*
\family default
environment (you may have to scroll down in the
\family sans
Environment
\family default
menu to find it), LyX will use the same font size for the heading as it
uses for a regular section, but it won't number that section.
There are corresponding
\begin_inset Quotes eld
\end_inset
starred
\begin_inset Quotes erd
\end_inset
heading environments for
\family sans
Subsection
\family default
and
\family sans
Subsubsection
\family default
.
Try changing some of your sections or subsections to the starred environments,
and note how the other sections' numbers are updated.
\layout Standard
\series bold
Exercise
\series default
: Fix the section and subsection headings in
\family typewriter
example_raw.lyx
\family default
.
\layout Subsection
Lists and sublists
\layout Standard
LyX has several different environments for typesetting lists.
The various list environments free you from hitting
\family sans
Tab
\family default
a million times when writing an outline, or from renumbering a whole list
when you want to add a point in the middle of the list, and lets you concentrat
e on the list content.
\begin_float footnote
\layout Standard
Yes, we're overemphasizing this point throughout the
\emph on
Tutorial
\emph default
.
But it
\emph on
is
\emph default
the main philosophy of LyX, so please forgive us.
\end_float
Different types of documents logically require different list environments:
\layout Itemize
A slide presentation might use the
\family sans
Itemize
\family default
environment's bulleted lists to describe different points.
\layout Itemize
An outline would use the
\family sans
Enumerate
\family default
environment's numbered lists (and lettered sublists).
\layout Itemize
A document describing several software packages could use the
\family sans
Description
\family default
environment, where each item in the list begins with a boldfaced word.
\layout Itemize
The
\family sans
List
\family default
environment --- not found in LaTeX --- is a slightly different form of
\family sans
Description
\family default
.
\layout Standard
Let's write a list of reasons why LyX is better than other word processors.
Somewhere in your document, type:
\layout Standard
\family typewriter
Lyx is better than other word processors because:
\layout Standard
and hit
\family sans
Return
\family default
.
Now select
\family sans
Itemize
\family default
from the
\family sans
Environment
\family default
menu.
LyX writes a
\begin_inset Quotes eld
\end_inset
bullet
\begin_inset Quotes erd
\end_inset
(actually, an asterisk, which will be converted to a round circle on output)
on the line.
Type in your reasons:
\layout LyX-Code
Typesetting is done for you.
\layout LyX-Code
Math is WYSIWYG
\layout LyX-Code
Lists are very easy to create!
\layout Standard
List environments, unlike headings, do not end when you type
\family sans
Return
\family default
.
Instead, LyX assumes you're going on to the next item in the list.
The above will therefore result in a three-item list.
If you want more than one paragraph within one list
\emph on
item
\emph default
, one way is to use the
\family sans
Protected\SpecialChar ~
Return
\family default
, which you get by typing
\family sans
C-Return
\family default
.
In order to get out of the list, you need to reselect the
\family sans
Standard
\family default
environment (or just use the keybinding,
\family sans
M-p\SpecialChar ~
s
\family default
).
\layout Standard
You've got a beautiful itemized list.
You might want to run LaTeX to see how the list looks when printed out.
But what if you wanted to number the reasons? Well, just select the whole
list
\begin_float footnote
\layout Standard
LyX won't let you select the first bullet unless you also select the paragraph
\emph on
before
\emph default
the list, which you probably don't want to do.
Similarly, you can't select the actual number in a numbered section title.
Don't worry about it.
\end_float
and choose
\family sans
Enumerate
\family default
from the
\family sans
Environment
\family default
menu.
Pow! As we mentioned, if you add or delete a list item, LyX will fix the
numbering.
\layout Standard
While the list is still selected, you can change to the other two list environme
nts,
\family sans
Description
\family default
and
\family sans
List
\family default
, in order to see what they look like.
For those two environments, each list item is made up of a term, which
is the item's first word, followed by a definition, which is the rest of
the paragraph (until you hit
\family sans
Return
\family default
.) The term is either typeset in boldface (
\family sans
Description
\family default
) or separated by a
\begin_inset Quotes eld
\end_inset
Tab
\begin_inset Quotes erd
\end_inset
\begin_float footnote
\layout Standard
But a typesetter's tab, which will change to fit the size of the largest
term, not a pathetic, rigid, unchangeable typewriter
\family sans
Tab
\family default
.
\end_float
(
\family sans
List
\family default
) from the rest of the paragraph.
If you want to have more than one word in the definition, then separate
the words with
\family sans
Protected\SpecialChar ~
Blank
\family default
s.
\layout Standard
\series bold
Exercise
\series default
: Typeset the list in
\family typewriter
example_raw.lyx
\layout Standard
You can nest lists within each other in all sorts of interesting ways.
An obvious example would be writing outlines.
Numbered and bulleted lists will have different numbering and bulleting
schemes for sublists.
See the
\emph on
User's Guide
\emph default
for details on the different sorts of lists, as well as examples which
use
\emph on
a lot
\emph default
of nesting.
\layout Subsection
Other Environments: Verses, Quotations, and More
\layout Standard
There are two environments for setting quotations apart from surrounding
text:
\family sans
Quote
\family default
for short quotes and
\family sans
Quotation
\family default
for longer ones.
Computer code (the
\family sans
LyX-Code
\family default
environment, also used in the
\emph on
Tutorial
\emph default
for the long typing examples) is written in a
\family typewriter
typewriter
\family default
font; this environment is the only place in LyX where you're allowed to
use multiple spaces to allow code indenting.
You can even write poetry
\begin_float footnote
\layout Standard
\SpecialChar \ldots{}
assuming you're creative enough to come up with poetry in the first place.
\end_float
using the
\family sans
Verse
\family default
style, using
\family sans
Return
\family default
to separate stanzas, and
\family sans
C-Return
\family default
to separate lines within a stanza.
See the
\emph on
User's Guide
\emph default
for more complete descriptions of all of the available LyX environments.
\layout Standard
\series bold
Exercise
\series default
: Correctly typeset the
\family sans
Quote, LyX-Code,
\family default
and
\family sans
Verse
\family default
in
\latex latex
\backslash
linebreak
\latex default
\family typewriter
example_raw.lyx
\layout Chapter
Writing Documents
\layout Standard
The previous chapter hopefully allowed you to get used to writing in LyX.
It introduced you to the basic editing operations in LyX, as well as the
powerful method of writing with environments.
Most people who use LyX, though, will want to write documents: papers,
articles, books, manuals, or letters.
This chapter is meant to take you from simply writing text with LyX to
writing a complete document.
It will introduce you to textclasses, which allow you to write different
sorts of documents.
It will then describe many of the additions that turn text into a document,
such as titles, footnotes, cross references, bibliographies, and tables
of contents.
\layout Section
Textclasses and Templates: Writing Letters
\layout Standard
\begin_inset LatexCommand \label{sec:textclasses}
\end_inset
Different sorts of documents should be typeset differently.
For example, books are generally printed double-sided, while articles are
single-sided.
In addition, many documents contain special environments: letters contain
some environments --- such as the sender's address and the signature ---
which do not make sense in a book or article.
The LyX
\emph on
textclass
\begin_float footnote
\layout Standard
LaTeX users: this is equivalent to the LaTeX documentclass
\end_float
takes care of these large scale differences between different sorts of
documents.
This
\emph on
Tutorial
\emph default
, for example, was written in the
\family sans
Book
\family default
textclass.
Textclasses are another major part of the WYSIWYM philosophy; they tell
LyX how to typeset the document, so you don't need to know how.
\layout Standard
Your document is probably being written in the
\family sans
Article
\family default
textclass
\begin_float footnote
\layout Standard
That's usually the default textclass, although you can set it in your
\family typewriter
lyxrc
\family default
file.
\end_float
.
Try changing to other textclasses (using the
\family sans
\bar under
C
\bar default
lass
\family default
menu in the
\family sans
\bar under
L
\bar default
ayout\SpecialChar \menuseparator
\bar under
D
\bar default
ocument
\family default
popup) to see how they are typeset differently.
If you change your document to the
\family sans
Book
\family default
textclass and look at the
\family sans
Environment
\family default
menu, you'll see that most of the allowed environments are the same.
However, you can now use the
\family sans
Chapter
\family default
environment.
If you're ever unsure about which environments you can use in a given textclass
, just consult the
\family sans
Environment
\family default
menu.
\layout Standard
Font sizes, one- or two-column printing, and page headings are just some
of the ways journals' typesettings differ from one another.
As the Computer Age continues to mature, journals have begun accepting
electronic submissions, creating LaTeX
\begin_inset Quotes eld
\end_inset
style files
\begin_inset Quotes erd
\end_inset
so that authors can submit correctly typeset articles.
LyX is set up to support this as well.
For example, LyX supports typesetting (and extra environments) for the
American Mathematics Society journals using the
\family sans
Article\SpecialChar ~
(AMS)
\family default
textclass.
\layout Standard
Here's a very quick reference to some of the textclasses.
As usual, see the
\emph on
User's Guide
\emph default
for details.
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center
\begin_inset Tabular
<lyxtabular version="2" rows="7" columns="2">
<features rotate="false" islongtable="false" endhead="0" endfirsthead="0" endfoot="0" endlastfoot="0">
<column alignment="center" valignment="top" leftline="true" rightline="false" width="" special="">
<column alignment="center" valignment="top" leftline="true" rightline="true" width="" special="">
<row topline="true" bottomline="true" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
Name
\end_inset
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
Notes
\end_inset
</cell>
</row>
<row topline="true" bottomline="false" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
article
\end_inset
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
one-sided, no chapters
\end_inset
</cell>
</row>
<row topline="true" bottomline="false" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
article (AMS)
\end_inset
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
layout & environments for American Math Society
\end_inset
</cell>
</row>
<row topline="true" bottomline="false" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
report
\end_inset
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
longer than article, two-sided
\end_inset
</cell>
</row>
<row topline="true" bottomline="true" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
book
\end_inset
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
report + front and back matter
\end_inset
</cell>
</row>
<row topline="false" bottomline="true" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
slides
\end_inset
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
transparencies (also including FoilTeX)
\end_inset
</cell>
</row>
<row topline="false" bottomline="true" newpage="false">
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="false" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
letter
\end_inset
</cell>
<cell multicolumn="0" alignment="center" valignment="top" topline="true" bottomline="false" leftline="true" rightline="true" rotate="false" usebox="none" width="" special="">
\begin_inset Text
\layout Standard
lots of extra environments for address, signature\SpecialChar \ldots{}
\end_inset
</cell>
</row>
</lyxtabular>
\end_inset
\layout Section
Templates: Writing a Letter
\layout Standard
One of the most popular textclasses is
\family sans
Letter
\family default
\SpecialChar \@.
One way to write a letter would be to open a
\family sans
\bar under
N
\bar default
ew
\family default
file, and choose
\family sans
Letter
\family default
from the
\family sans
\bar under
C
\bar default
lass
\family default
menu in the
\family sans
\bar under
L
\bar default
ayout\SpecialChar \menuseparator
\bar under
D
\bar default
ocument
\family default
popup.
While this is the most obvious way to write a letter, it seems like extra
work.
Every time you write a business letter, you want to have your address,
the address you're sending to, a body, a signature, etc.
LyX therefore has a
\emph on
template
\emph default
for letters, which contains a sample letter; once you have a template,
you can just replace a couple parts of the letter with your text each time
you write a letter.
\layout Standard
Open a new file with
\family sans
\bar under
F
\bar default
ile\SpecialChar \menuseparator
New\SpecialChar ~
from\SpecialChar ~
\bar under
t
\bar default
emplate
\family default
.
After choosing a new filename, select
\family typewriter
letter.lyx
\family default
from the
\family sans
Choose\SpecialChar ~
Template
\family default
popup.
Save and print the file to see how the various environments are typeset.
\layout Standard
When you look at the
\family sans
Environment
\family default
menu, you'll see several environments, like the
\family sans
My\SpecialChar ~
Address
\family default
environment, which don't even exist in most other textclasses.
Others, like
\family sans
Quote
\family default
and
\family sans
Description
\family default
, are familiar.
You can play around for a while to figure out how the various environments
work.
You'll notice for example that the
\family sans
Signature
\family default
environment has the word
\begin_inset Quotes eld
\end_inset
Signature:
\begin_inset Quotes eld
\end_inset
in red before the actual text of the signature.
This word doesn't show up in the actual letter, as you'll see if you try
printing the file.
It's just there to let you know where the signature goes.
Also, note that it doesn't matter where in the file the
\family sans
Signature
\family default
line is placed.
Remember, LyX is WYSIWYM; you can put the
\family sans
Signature
\family default
environment anywhere you want, but LyX knows that in the printout, the
signature should be at the end.
\layout Standard
A template is just a regular LyX file.
This means you can fill in your address and signature and save the file
as a new template.
From now on, any time you want to write a letter, you can use the new template
to save time.
We probably don't have to suggest an actual
\begin_inset Quotes eld
\end_inset
exercise
\begin_inset Quotes erd
\end_inset
here; just write a letter to someone
\begin_float footnote
\layout Standard
One warning, if you're writing from a template.
If you erase all of the text in an environment --- for example, if you
erase the whole
\family sans
My\SpecialChar ~
Address
\family default
field so that you can replace it with your own --- and then you move the
cursor without writing any text, the environment may disappear.
This is because most environments cannot exist without any text in them.
Just reselect the environment from the
\family sans
Environment
\family default
menu to get it back.
\end_float
!
\layout Standard
Templates can be a huge time-saver, and we urge you to use them whenever
possible.
In addition, they can help a person learn how to use some of the fancier
textclasses.
Finally, they may be useful for a person who is configuring LyX for a bunch
of less computer-aware users.
When they're first learning LyX, it will be much less intimidating if they
have a letter template customized for their company, for example.
\layout Section
Document Titles
\layout Standard
LyX (like LaTeX) considers the title --- which may contain the actual title,
the author, the date, and even an abstract of a paper --- to be a separate
part of the document.
\layout Standard
Go back to your
\family typewriter
newfile.lyx
\family default
document and make sure it's using the
\family sans
Article
\family default
textclass.
\begin_float footnote
\layout Standard
You should not be using the letter any more, since the
\family sans
Letter
\family default
textclass doesn't allow titles.
\end_float
Type a title on the first line, and change the line to the
\family sans
Title
\family default
environment.
On the next line, type your name and change it to the
\family sans
Author
\family default
environment.
On the next line, write the date in the
\family sans
Date
\family default
environment.
Type a paragraph or two summarizing your document using the
\family sans
Abstract
\family default
environment.
Now see how it looks when printed.
\layout Standard
\series bold
Exercise
\series default
: Fix the title, date, and author in
\family typewriter
example_raw.lyx
\layout Section
Labels and Cross-References
\layout Standard
\begin_inset LatexCommand \label{sec:labels}
\end_inset
You can label a section (or subsubsection, or, more rarely, just a random
piece of text) in your document.
Once you do so, you can refer to this section in other parts of the document,
using cross-references.
You can refer either to the section's number, or to the page that the section
appears on.
As with sections and footnotes, LyX worries about the cross-references
for you.
Automatic labels and cross-references are one of the best advantages of
LyX (and LaTeX) over conventional word processors.
\layout Subsection*
Your first label
\layout Standard
Let's mark our second section, whose title is
\begin_inset Quotes eld
\end_inset
About This Document
\begin_inset Quotes erd
\end_inset
.
Click at the end of the section title line, and select
\family sans
\bar under
I
\bar default
nsert\SpecialChar \menuseparator
\bar under
L
\bar default
abel
\family default
.
A popup asks you for a section name.
Type
\family typewriter
sec:aboutdocument
\family default
, which seems like a good descriptive label that won't get confused with
other labels we might add.
\begin_float footnote
\layout Standard
We write
\begin_inset Quotes eld
\end_inset
sec:
\begin_inset Quotes eld
\end_inset
because you can also label equations, tables, figures, and lists items.
\end_float
When you click on
\family sans
OK
\family default
, the label name will be placed in a box next to the section title.
\layout Standard
By the way, you could have put the label right anywhere within the section
as well; section references will refer to the last section or subsection
whose heading comes before the label.
However, putting it on the same line as the section title (or, perhaps,
on the first line of the section's text) ensures that page references will
reference the beginning of the section.
\layout Standard
So far you haven't done anything --- the
\family typewriter
dvi
\family default
file will look exactly the same, since labels don't show up in the printed
document.
However, now that you've added a label, you can refer to that label with
cross-references.
We'll do that next.
\layout Subsection*
Your first cross-references
\layout Standard
Place the cursor somewhere in Section\SpecialChar ~
2 of your document.
Type
\layout LyX-Code
If you want to know more about this document, then see
\newline
Section , which can be found on page .
\layout Standard
Now --- with the cursor after the word
\begin_inset Quotes eld
\end_inset
section
\begin_inset Quotes erd
\end_inset
\family typewriter
\family default
--- choose
\family sans
\bar under
I
\bar default
nsert\SpecialChar \menuseparator
\bar under
C
\bar default
ross-Reference
\family default
.
The
\family sans
Insert\SpecialChar ~
Reference
\family default
popup pops up.
It shows a list of the possible labels you can reference.
At the moment, there should be only one,
\begin_inset Quotes eld
\end_inset
sec:aboutdocument
\begin_inset Quotes erd
\end_inset
.
Select it (it may be selected by default), then set the
\family sans
Reference type
\family default
to
\family typewriter
Ref
\family default
(the default), and click
\family sans
Apply
\family default
.
Now put the cursor after the word
\begin_inset Quotes eld
\end_inset
page
\begin_inset Quotes erd
\end_inset
, and change the
\family sans
Reference type
\family default
to
\family typewriter
Page
\family default
, then click
\family sans
Apply
\family default
.
(To be really correct, you should put a
\family sans
Protected\SpecialChar ~
Blank
\family default
in between the word
\begin_inset Quotes eld
\end_inset
Section
\begin_inset Quotes erd
\end_inset
and the reference.
Same for the page reference.)
\layout Standard
LyX puts the references in a box right where the cursor was.
In the printed document, this reference marker will be replaced with either
the page or section number (depending on what you selected in the
\family sans
Insert\SpecialChar ~
Reference
\family default
popup).
Conveniently, a cross-reference acts a hyperlink when you're editing a
document in LyX; clicking on it will pop up the
\family sans
Reference
\family default
dialog, clicking
\family sans
Goto reference
\family default
will move the cursor to the referenced label, and
\family sans
C-<
\family default
will then move the cursor back to the reference.
Use
\family sans
\bar under
V
\bar default
iew\SpecialChar \menuseparator
\bar under
U
\bar default
pdate\SpecialChar \menuseparator
\bar under
D
\bar default
VI
\family default
, and you'll see that on the last page we refer to
\begin_inset Quotes eld
\end_inset
Section\SpecialChar ~
2
\begin_inset Quotes erd
\end_inset
and
\begin_inset Quotes eld
\end_inset
Page\SpecialChar ~
1
\begin_inset Quotes erd
\end_inset
(or whatever page Section\SpecialChar ~
2's title is on).
\layout Subsection*
More fun with labels
\layout Standard
We told you that LyX worries about numbering cross-references; now you can
test that.
Add a new section before Section\SpecialChar ~
2.
Now rerun LaTeX, and --- voil! --- the section cross reference changed
to
\begin_inset Quotes eld
\end_inset
3
\begin_inset Quotes erd
\end_inset
! Change
\begin_inset Quotes eld
\end_inset
About this Document
\begin_inset Quotes erd
\end_inset
to a subsection, and the cross-reference will reference Subsection\SpecialChar ~
2.1 instead
of Section\SpecialChar ~
3.
The page reference won't change unless you add a whole page of text before
the label, of course.
\layout Standard
\latex latex
\backslash
begin{sloppypar}
\layout Standard
If you want some more practice with labels, then try putting a label,
\begin_inset Quotes eld
\end_inset
sec:myfirstlabel
\begin_inset Quotes erd
\end_inset
, where your first cross-reference was, and refer to that label from elsewhere
in the document.
If you'll be inserting cross-references often (if, for example, you're
writing a journal article), it may be convenient to leave the
\family sans
Insert\SpecialChar ~
Reference
\family default
window open.
\layout Standard
\latex latex
\backslash
end{sloppypar}
\layout Standard
If you want to make sure that the cross-referencing gets the pages right
even for larger documents,
\family sans
\bar under
C
\bar default
opy
\family default
a couple pages of text from the
\emph on
User's Guide
\emph default
to the clipboard, and
\family sans
\bar under
P
\bar default
aste
\family default
the stolen text into your document
\begin_float footnote
\layout Standard
By the way, copying a chapter title may cause a LyX error, because chapters
aren't allowed in the article class.
If this happens, just delete the chapter title.
If you want to know why this happens, see Section\SpecialChar ~
\begin_inset LatexCommand \ref{sec:textclasses}
\end_inset
.
\end_float
.
\layout Standard
\series bold
Exercise
\series default
: Fix the references in
\family typewriter
example_raw.lyx
\layout Section
Footnotes and Margin Notes
\layout Standard
Footnotes can be added using the
\family sans
Insert\SpecialChar ~
Footnote
\family default
button in the toolbar
\begin_float footnote
\layout Standard
The button shows an arrow pointing to red text, which is just below some
black text.
\end_float
or
\family sans
\bar under
I
\bar default
nsert\SpecialChar \menuseparator
\bar under
F
\bar default
ootnote
\family default
\SpecialChar \@.
Click at the end of the word
\begin_inset Quotes eld
\end_inset
LyX
\begin_inset Quotes erd
\end_inset
somewhere in your document and hit the
\family sans
Insert\SpecialChar ~
Footnote
\family default
button.
A footnote line opens underneath the line you are currently typing on.
At the left end of the line, you'll see the word
\begin_inset Quotes eld
\end_inset
foot
\begin_inset Quotes erd
\end_inset
written in red on a gray background.
The rest of the line is outlined in red; that's where you write your footnote.
LyX should place the cursor at the beginning of the line.
Type
\layout LyX-Code
LyX is a typesetting word processor.
\layout Standard
Now click on the word
\begin_inset Quotes eld
\end_inset
foot.
\begin_inset Quotes erd
\end_inset
The footnote line disappears, leaving the word
\begin_inset Quotes eld
\end_inset
foot
\begin_inset Quotes erd
\end_inset
, superscripted in red, showing where the footnote marker will be in the
printed text; this is called
\begin_inset Quotes eld
\end_inset
folding
\begin_inset Quotes erd
\end_inset
the footnote.
You can unfold the footnote at any time --- and re-edit its text, if you
want --- by clicking on the red
\begin_inset Quotes eld
\end_inset
foot
\begin_inset Quotes erd
\end_inset
marker.
\layout Standard
You may wonder why the footnote marker is a word instead of a number.
The answer is that LyX worries about the footnote numbering for you in
the printed text.
You can see this yourself by looking at the
\family typewriter
dvi
\family default
file (or printout).
If you add other footnotes, LyX will renumber the footnotes.
Since LyX (well, LaTeX, actually) takes care of the footnote numbering,
there's really no need to put the numbers in the LyX file.
\layout Standard
A footnote can be cut and pasted like normal text.
Go ahead; try it! All you need to do is select the footnote marker
\begin_float footnote
\layout Standard
It may be easier to select it using the keyboard.
You might accidentally open the footnote if you're trying to select the
marker itself with the mouse.
\end_float
and
\family sans
\bar under
C
\bar default
ut
\family default
and
\family sans
\bar under
P
\bar default
aste
\family default
it.
In addition, you can change regular text to a footnote, by selecting it
and hitting the
\family sans
Insert\SpecialChar ~
Footnote
\family default
button; change a footnote to regular text by clicking the
\family sans
Insert\SpecialChar ~
Footnote
\family default
button when the cursor is in a footnote.
\layout Standard
Margin notes can be added using the
\family sans
Insert\SpecialChar ~
Marginal\SpecialChar ~
Note
\family default
button
\begin_float footnote
\layout Standard
The button shows an arrow pointing to red text next to (i.e., in the margin
of) black text, and should be next to the
\family sans
Insert\SpecialChar ~
Footnote
\family default
button in the toolbar.
\end_float
or
\family sans
\bar under
I
\bar default
nsert\SpecialChar \menuseparator
\bar under
M
\bar default
arginal\SpecialChar ~
Note
\family default
\SpecialChar \@.
Margin notes are like footnotes, except that:
\layout Itemize
the on-screen markers say
\begin_inset Quotes eld
\end_inset
margin
\begin_inset Quotes erd
\end_inset
instead of
\begin_inset Quotes eld
\end_inset
foot
\begin_inset Quotes erd
\end_inset
\layout Itemize
the notes will be placed in the margin, instead of below the text
\layout Itemize
margin notes are not numbered
\layout Itemize
when a note is folded, an exclamation point will be placed in the margin.
This exclamation point will not show up in the printed text.
\layout Standard
Change your LyX footnote back to text, then select and change it to a margin
note.
Run LaTeX again to see what the margin note looks like.
\layout Standard
\series bold
Exercise
\series default
: Fix the footnote in
\family typewriter
example_raw.lyx
\layout Section
Bibliographies
\layout Standard
\begin_inset LatexCommand \label{sec:bibliographies}
\end_inset
Bibliographies are similar to cross references.
The bibliography contains a list of references at the end of the document,
and they can be referenced from within the document.
Like section titles, LyX and LaTeX make your job easier by automatically
numbering the bibliography items and changing citations when the items'
numbers change.
\layout Standard
Go to the end of the document and switch to the
\family sans
Bibliography
\family default
environment.
Now, each paragraph you type will be a reference.
Type
\family typewriter
The Lyx Tutorial, by the LyX DocTeam
\family default
as your first reference.
Note that LyX automatically puts a number in a box before each reference.
Click on the boxed reference number, and a
\family sans
Bibliography\SpecialChar ~
item
\family default
popup appears.
You use the first field, the
\family sans
Key
\family default
, to refer to this reference within the LyX document.
By default, it is a number.
Change the
\family sans
Key
\family default
field to
\begin_inset Quotes eld
\end_inset
lyxtutorial
\begin_inset Quotes erd
\end_inset
to make it easy to remember.
\layout Standard
Now pick somewhere in your document that you would like to insert a reference.
Do so with
\family sans
\bar under
I
\bar default
nsert\SpecialChar \menuseparator
\bar under
C
\bar default
itation\SpecialChar ~
Reference\SpecialChar \@.
\family default
A
\family sans
Citation
\family default
popup appears.
The right panel in this popup lists all the bibliography entries, and this
field allows you to choose which bibliography item you want to cite
\begin_float footnote
\layout Standard
This is why it's a good idea to give the keys unique and logical names,
instead of leaving the default numbers in the
\family sans
Key
\family default
field.
\end_float
.
Select
\begin_inset Quotes eld
\end_inset
lyxtutorial
\begin_inset Quotes erd
\end_inset
(right now, that's the only item in the bibliography), then use the left
arrow in the center to insert it in the
\family sans
keys
\family default
box.
(You can have multiple citations in the same place by transferring a number
of keys this way.) Now run LaTeX, and you'll see that the citation appears
in brackets in the text, referring to the bibliography at the end of the
document.
\layout Standard
How are the other fields used? The
\family sans
T
\bar under
e
\bar default
xt after
\family default
field in the
\family sans
Citation
\family default
popup will put a remark (such as a reference to a page or chapter within
the referenced book or article) in the brackets after the reference.
If you want the references to have labels instead of numbers in the printed
output (for example, some journals would use
\begin_inset Quotes eld
\end_inset
[Smi95]
\begin_inset Quotes erd
\end_inset
to refer to a paper written by Smith in 1995), use the
\family sans
Label
\family default
field in the
\family sans
Bibliography\SpecialChar ~
item
\family default
popup.
As usual, you can see the
\emph on
User's Guide
\emph default
for details.
\layout Standard
\series bold
Exercise:
\series default
Fix the bibliography and citation in
\family typewriter
example_raw.lyx
\layout Section
Table of Contents
\layout Standard
You may want to put a table of contents at the beginning of your document.
LyX makes this very easy to do.
Just hit
\family sans
Return
\family default
after your document title and before your first section title
\begin_float footnote
\layout Standard
Don't frustrate yourself trying to click or backspace before the section
number.
It won't work.
You're not allowed to edit the section number anyway, since LyX takes care
of section numbering.
\end_float
and choose
\family sans
\bar under
I
\bar default
nsert\SpecialChar \menuseparator
Lists\SpecialChar ~
&\SpecialChar ~
\bar under
T
\bar default
OC\SpecialChar \menuseparator
Table\SpecialChar ~
of\SpecialChar ~
\bar under
C
\bar default
ontents
\family default
.
The words
\begin_inset Quotes eld
\end_inset
Table of Contents
\begin_inset Quotes erd
\end_inset
will appear in a box (otherwise known as an inset) on the first line of
the document.
\layout Standard
This may not appear to be very useful.
However, if you look at your
\family typewriter
dvi
\family default
file, you will see that a table of contents has been generated, listing
the various sections and subsections in your document.
As usual, if you reorder sections or create new ones, you will see those
changes in the
\family typewriter
dvi
\family default
file when you update it.
\layout Standard
The table of contents is not printed in the on-screen version of the document,
because you can't edit it anyway.
However, you can display the table of contents in a separate window by
clicking on the table of contents inset, or by using
\family sans
\bar under
V
\bar default
iew\SpecialChar \menuseparator
\bar under
T
\bar default
able\SpecialChar ~
of\SpecialChar ~
Contents
\begin_float footnote
\layout Standard
The menu command will work even if you don't have a table of contents inset
in your document.
\end_float
.
This is a very useful tool.
You can use the
\family sans
Table\SpecialChar ~
of\SpecialChar ~
Contents
\family default
window to move around your document.
Clicking on a (sub)section title in the
\family sans
Table\SpecialChar ~
of\SpecialChar ~
Contents
\family default
window will highlight that line and move the cursor (in the LyX editing
window) to that place in the document.
You can also use the arrow keys to move up and down in the table of contents.
You may therefore find it convenient to leave this window open throughout
editing sessions.
\layout Standard
To get rid of the Table of Contents, you can delete the table of contents
marker just like any other character.
\layout Standard
\series bold
Exercise
\series default
: Fix the table of contents in
\family typewriter
example_raw.lyx
\layout Chapter
Using Math
\layout Standard
LaTeX is used by many scientists because it outputs great looking equations,
avoiding the control characters used by word processors and their equation
editors.
Many of these scientists are frustrated, however, because writing equations
in LaTeX is more like programming than writing.
Happily, LyX has WYSIWYM support for equations.
If you are used to LaTeX, you'll find that all of the usual LaTeX math
commands can be typed in normally, but they will show up in a WYSIWYM fashion.
If, on the other hand, you've never written in LaTeX, then the
\family sans
Math\SpecialChar ~
Panel
\family default
will allow you to write professional-looking math quickly and easily
\begin_float footnote
\layout Standard
LyX can't check if the math you're writing is actually
\emph on
correct
\emph default
.
Sorry.
\end_float
.
\layout Section
Math Mode
\layout Standard
Somewhere in your LyX document, type:
\layout LyX-Code
I like what Einstein said, E=mc^2, because it's so simple.
\layout Standard
Now, that equation doesn't look very good, even in the
\family typewriter
dvi
\family default
file; there's no space between the letters and the equals sign, and you'd
like to write an actual superscript for the
\begin_inset Quotes eld
\end_inset
2
\begin_inset Quotes erd
\end_inset
.
That bad typesetting happened because we didn't tell LyX that we were writing
a mathematical expression, so it typeset the equation like regular old
text.
\layout Standard
Math is written in Mathed, otherwise known as math mode.
In order to enter math mode, just click the toolbar button with
\begin_inset Formula \( \frac{a+b}{c} \)
\end_inset
written on it in blue.
LyX will open a little blue square, with a purple rectangle around it.
The blue square is an
\emph on
insertion point
\emph default
, telling you that Mathed is waiting for you to insert something, and the
rectangle indicates that you are in Mathed.
LyX has placed the cursor in the blue square, so just type
\family typewriter
E=mc^2
\family default
again.
The expression is typed in blue, and the blue square disappears as soon
as the insertion point is not empty.
Now type
\family sans
Esc
\family default
to leave Mathed (Note: clicking on the
\family sans
math
\family default
button again will
\emph on
not
\emph default
get you out of Mathed).
The purple rectangle disappears, leaving the cursor to the right of the
expression, and now if you type something, it will be regular text.
\layout Standard
Run LaTeX and look at the
\family typewriter
dvi
\family default
file.
Notice that the expression was typeset nicely, with spaces between the
letters and the equals sign, and a superscript
\begin_inset Quotes eld
\end_inset
2
\begin_inset Quotes erd
\end_inset
.
Letters in math mode are assumed to be variables, and come out in italics.
Numbers are just numbers.
\layout Standard
Mathed is another example of the WYSIWYM philosophy.
In LaTeX, you write a mathematical expression using text and commands like
\family typewriter
\backslash
sqrt
\family default
; this can be frustrating, because you can't see what an expression looks
like until you LaTeX the file, and may have to spend time to find missing
brackets or other
\begin_inset Quotes eld
\end_inset
bugs
\begin_inset Quotes erd
\end_inset
.
On the other hand, LyX doesn't attempt to get the expression to look perfect
(WYSIWYG), but it gives you an extremely good idea of what the expression
will look like.
LaTeX then takes care of the professional typesetting.
99% of the time, you won't have to make any changes to the font sizes or
spacing that LaTeX outputs.
This way (sorry to be so repetitive) you can focus on the
\emph on
content
\emph default
of your mathematical expressions, not their format.
\layout Section
Navigating an Equation
\layout Standard
Now let's change
\begin_inset Formula \( E=mc^{2} \)
\end_inset
to
\begin_inset Formula \( E=1+mc^{2} \)
\end_inset
.
Use the arrow keys to move the cursor into the expression.
Note that when you enter the expression, the purple rectangle appears to
let you know you're back in Mathed.
Now you can use
\family sans
Left
\family default
and
\family sans
Right
\family default
to move the cursor past the equals sign, and just type
\begin_inset Quotes eld
\end_inset
1+
\begin_inset Quotes erd
\end_inset
.
Again, you can use the arrow keys or
\family sans
Esc
\family default
to exit the expression, at which point the purple rectangle will disappear
again.
Many people find the arrows convenient, but you can also just click somewhere
on the expression to put the cursor there and start Mathed.
\layout Standard
Other than the special keys described below, typing in math mode is like
editing regular text.
Use
\family sans
Delete
\family default
(or
\family sans
Backspace
\family default
) to delete things.
Select text either with the arrow keys or with the mouse.
\family sans
\bar under
E
\bar default
dit\SpecialChar \menuseparator
\bar under
U
\bar default
ndo
\family default
works in math mode, as does cutting and pasting.
One thing to be careful of: if you're right outside a Mathed expression
and you type
\family sans
Delete
\family default
(or
\family sans
Backspace
\family default
), it will delete the whole expression.
Luckily, you can just use
\family sans
Undo
\family default
to get it back.
\layout Standard
What if you want to change
\begin_inset Formula \( E=mc^{2} \)
\end_inset
to
\begin_inset Formula \( E=mc^{2.5}+1 \)
\end_inset
? Again, you can use the mouse to click in the right place.
However, you can also use the arrow keys.
If the cursor is just after the
\begin_inset Quotes eld
\end_inset
c
\begin_inset Quotes erd
\end_inset
but before the
\begin_inset Quotes eld
\end_inset
2
\begin_inset Quotes erd
\end_inset
, then typing
\family sans
Up
\family default
will move the cursor to the level of the superscript, just before the
\begin_inset Quotes eld
\end_inset
2
\begin_inset Quotes erd
\end_inset
.
Add the
\begin_inset Quotes eld
\end_inset
.5
\begin_inset Quotes erd
\end_inset
.
Now, hitting
\family sans
Down
\family default
will move the cursor back to the regular level.
In fact, if you hit
\family sans
Down
\family default
from anywhere within the superscript, the cursor will be placed just
\emph on
after
\emph default
the superscript (so that you can then type the
\begin_inset Quotes eld
\end_inset
+1
\begin_inset Quotes erd
\end_inset
).
\layout Standard
You can also use
\family sans
Space
\family default
in navigating an expression.
If you are currently within a Mathed structure (a subscript, superscript,
fraction, square root, delimiters, or matrix, all of which are described
in following sections), pressing
\family sans
Space
\family default
will move the cursor past that structure, but will stay within Mathed.
So, if the cursor is anywhere in the superscript, typing
\family sans
Space
\family default
will move the cursor down to the regular level and just after the superscript.
This means you can type
\begin_inset Formula \( E=mc^{1+x}-2 \)
\end_inset
without using the mouse
\emph on
or
\emph default
the arrow keys, a method you'll probably prefer once you're more experienced.
Just be careful not to type
\family sans
Space
\family default
between the one and the plus sign, or you will exit the superscript.
In places where these actions don't make sense (say, between the
\begin_inset Quotes eld
\end_inset
m
\begin_inset Quotes erd
\end_inset
and the
\begin_inset Quotes eld
\end_inset
c
\begin_inset Quotes erd
\end_inset
),
\family sans
Space
\family default
will do nothing
\begin_float footnote
\layout Standard
\family sans
Space
\family default
and
\family sans
Tab
\family default
are
\series bold
not
\series default
used for making extra space between parts of an equation.
That spacing is a typesetting issue, which means that you should let LyX
(LaTeX) take care of it (see Sec.
\begin_inset LatexCommand \ref{sec:whitespace}
\end_inset
).
If you're not entirely satisfied, there are ways to fine-tune spacing,
for which you can see the
\emph on
User's Guide
\emph default
--- but don't bother with fine-tuning until you're done putting all the
content into your document.
\end_float
.
\layout Standard
Note that if you type your expression and exit with
\family sans
Esc
\family default
, there will be no space after the expression.
This is fine if you're typing a period or comma, but if you want to type
a word after the formula, you need to explicitly type
\family sans
Space
\family default
after you exit Mathed.
As a shortcut, though, if you are at the very end of a Mathed expression,
then pressing
\family sans
Space
\family default
will exit Mathed
\emph on
and
\emph default
print a space after the expression.
That way you can write
\begin_inset Quotes eld
\end_inset
\begin_inset Formula \( f=ma \)
\end_inset
is my favorite equation
\begin_inset Quotes erd
\end_inset
instead of
\begin_inset Quotes eld
\end_inset
\begin_inset Formula \( f=ma \)
\end_inset
is my favorite equation.
\begin_inset Quotes erd
\end_inset
\layout Section
Exponents and Indices
\layout Standard
An exponent can be entered from the
\family sans
\bar under
M
\bar default
ath
\family default
menu, but it's actually simpler just to type the caret key,
\begin_inset Quotes eld
\end_inset
^
\begin_inset Quotes erd
\end_inset
.
LyX will place an insertion point (the blue square, remember?) in the superscri
pt, so that whatever you write next will be superscripted, and in a smaller
font size.
Everything you type until you hit a
\family sans
Space
\family default
(or
\family sans
Esc
\family default
to exit Mathed entirely) will be in the superscript.
\layout Standard
Writing a subscript (index) is just as easy --- start one by typing the
underscore key,
\begin_inset Quotes eld
\end_inset
_
\begin_inset Quotes eld
\end_inset
.
You can subscript and superscript both subscripts and superscripts like
this:
\begin_inset Formula \( A_{a_{0}+b^{2}}+C^{a_{0}+b^{2}} \)
\end_inset
.
\layout Standard
\series bold
Exercise
\series default
: Put equation 1 of
\family typewriter
example_raw.lyx
\family default
into math mode.
\layout Section
The
\family sans
Math Panel
\layout Standard
The
\family sans
Math\SpecialChar ~
Panel
\family default
is a convenient way to enter symbols or to perform many complicated Mathed
functions.
Many of these functions can be accomplished from the keyboard or the
\family sans
\bar under
M
\bar default
ath
\family default
menu.
However, we're going to concentrate on using the
\family sans
Math\SpecialChar ~
Panel
\family default
, just to let you know what's out there; you can learn keyboard shortcuts
later, from other manuals (hint, hint).
So open up the
\family sans
Math\SpecialChar ~
Panel
\family default
now and leave it open while reading this section.
\layout Subsection
Greek and symbols
\layout Standard
If you click on the button marked
\begin_inset Quotes eld
\end_inset
\begin_inset Formula \( \Gamma \rho \epsilon \epsilon \kappa \)
\end_inset
\begin_inset Quotes erd
\end_inset
, you'll get a menu from which you can choose a Greek letter, which will
show up at the cursor.
Note that there are a couple variants of epsilon, pi, phi, theta, and sigma.
As a shortcut, if you are typing text, you can choose something from the
\family sans
Math\SpecialChar ~
Panel
\family default
, and Mathed will automatically be opened.
\layout Standard
Four other buttons at the bottom of the
\family sans
Math\SpecialChar ~
Panel
\family default
allow you to choose from a large array of symbols used in math: various
arrows, relations, operators, and sums and integrals.
Note that subscripting and superscripting allow you to put lower and upper
limits on sums and integrals.
The last button is the dreaded miscellaneous.
\begin_inset Quotes eld
\end_inset
Nothing you can do that can't be done\SpecialChar \ldots{}
All you need is
\begin_inset Formula \( \heartsuit \)
\end_inset
.
\begin_inset Quotes erd
\end_inset
\layout Subsection
Square roots, accents, and delimiters
\layout Standard
To type a square root, just click on the button with a square root sign
on it.
The square root appears, and the cursor is in a new insertion point inside
the square root.
You can type variables, numbers, other square roots, fractions, whatever
you want.
LyX will automatically resize the square root to fit what's inside.
\layout Standard
Accenting a character (
\begin_inset Formula \( \overrightarrow{v} \)
\end_inset
) or group of characters (
\begin_inset Formula \( \overrightarrow{a+b} \)
\end_inset
) is done the same way.
Hit the
\family sans
Decoration
\family default
button , which has a blue square with a black tilde\SpecialChar ~
(~) over it, to open
the
\family sans
Decoration
\family default
window.
Click on a decoration, and LyX will print that decoration with an insertion
point under (or over) it.
Just type what you want in the insertion point, and type
\family sans
Space
\family default
to
\begin_inset Quotes eld
\end_inset
exit
\begin_inset Quotes erd
\end_inset
the decoration.
\layout Standard
Delimiters such as parentheses, brackets, and braces work similarly, but
are a bit more complicated.
Hit the
\family sans
Delimiter
\family default
button, which features a blue square surrounded by brackets, to pop up
the
\family sans
Delimiter
\family default
window.
Click on a left delimiter with the
\emph on
left mouse button
\emph default
and a right delimiter with the
\emph on
right mouse button
\emph default
.
(Alternatively, use the radio buttons labeled
\begin_inset Quotes eld
\end_inset
\bar under
L
\bar default
eft
\begin_inset Quotes erd
\end_inset
and
\begin_inset Quotes eld
\end_inset
\bar under
R
\bar default
ight
\begin_inset Quotes erd
\end_inset
and then click on delimiters with the
\emph on
left mouse button
\emph default
.) Your current selection of delimiters is displayed in a box at the top
of the window.
It's a pair of parentheses by default, but with this general selection
method you can choose a pair of braces, a brace and a parenthesis, or even
choose the empty square to have something like
\begin_inset Quotes eld
\end_inset
\begin_inset Formula \( a=\left\langle 7\right. \)
\end_inset
\begin_inset Quotes erd
\end_inset
(the empty delimiter is displayed as a broken black line in LyX, but won't
show up in the output).
\layout Standard
Once you've chosen your delimiters, click on
\family sans
OK
\family default
to put them into your expression (or hit
\family sans
Apply
\family default
if you want to leave the window open for next time).
If you're lazy, you can type actual parentheses in math mode, rather than
using the
\family sans
Delimiter
\family default
window.
However, those parentheses will be the same size as regular text, which
will look bad if you have a big fraction or matrix inside the parentheses.
Using the
\family sans
Delimiter
\family default
window will guarantee that the delimiters are sized based on what's inside
them.
\layout Standard
You can also put delimiters or a square root sign or a decoration on already
existing text.
Select the portion of the formula that you want to adjust, and then click
on the button you want from the
\family sans
Math\SpecialChar ~
Panel
\family default
.
Try using this to change Newton's second law from scalar to vector form
(
\begin_inset Formula \( f=ma \)
\end_inset
to
\begin_inset Formula \( \overrightarrow{f}=m\overrightarrow{a} \)
\end_inset
).
Once you've learned about matrices, this is how you'll put parentheses
or brackets around them.
\layout Subsection
Fractions
\layout Standard
Fractions are simple in Mathed.
Just click on the
\family sans
fraction
\family default
button in the
\family sans
Math\SpecialChar ~
Panel
\family default
, which shows a fraction with blue squares in the numerator and the denominator.
LyX writes two insertion points in a fraction.
As you would expect, you can use arrow keys or the mouse to move around
a fraction.
Click on the top square and type
\begin_inset Quotes eld
\end_inset
1
\begin_inset Quotes erd
\end_inset
.
Now hit
\family sans
Down
\family default
and type
\begin_inset Quotes eld
\end_inset
2
\begin_inset Quotes erd
\end_inset
.
You've made a fraction! Of course you can type anything within each of
the two boxes: variables with exponents, square roots, other fractions,
whatever.
\layout Standard
\series bold
Exercise
\series default
: Put equation 2 of
\family typewriter
example_raw.lyx
\family default
into math mode.
\layout Subsection
TeX mode: Limits, log, sin and others
\layout Standard
Because letters in math mode are considered to be variables, if you type
\begin_inset Quotes eld
\end_inset
sin
\begin_inset Quotes erd
\end_inset
in math mode, LyX thinks you're typing the product of the three variables
\begin_inset Formula \( s \)
\end_inset
,
\begin_inset Formula \( i \)
\end_inset
, and
\begin_inset Formula \( n \)
\end_inset
.
The three letters will be typeset in italics, when what you really wanted
was the word
\begin_inset Quotes eld
\end_inset
sin
\begin_inset Quotes erd
\end_inset
typeset in Roman.
In addition, LyX won't put a space between the word
\begin_inset Quotes eld
\end_inset
sin
\begin_inset Quotes erd
\end_inset
and the
\begin_inset Quotes eld
\end_inset
x
\begin_inset Quotes erd
\end_inset
(typing
\family sans
Space
\family default
will just exit math mode).
So how do you get
\begin_inset Quotes eld
\end_inset
\begin_inset Formula \( \sin x \)
\end_inset
\begin_inset Quotes erd
\end_inset
instead of
\begin_inset Quotes eld
\end_inset
\begin_inset Formula \( sinx \)
\end_inset
\begin_inset Quotes erd
\end_inset
?
\layout Standard
Click on
\begin_inset Quotes eld
\end_inset
sin
\begin_inset Quotes erd
\end_inset
in the
\family sans
Functions
\family default
listbox in the
\family sans
Math\SpecialChar ~
Panel
\family default
.
The word
\begin_inset Quotes eld
\end_inset
sin
\begin_inset Quotes erd
\end_inset
is written in red, in Roman type, otherwise known as TeX mode.
The whole word is treated as one symbol, so if you type
\family sans
Backspace
\family default
, it will delete the whole word.
Now type
\begin_inset Quotes eld
\end_inset
x
\begin_inset Quotes erd
\end_inset
, which will be written in blue italics, like you expect in Mathed.
In the
\family typewriter
dvi
\family default
file, the expression will be correctly typeset.
Try it.
\layout Standard
Other commands you need to type in TeX mode using the
\family sans
Functions
\family default
listbox include other trigonometric functions and their inverses, hyperbolic
functions, logarithms, limits, and quite a few others.
These functions can take subscripts and superscripts, important for typing
\begin_inset Quotes eld
\end_inset
\begin_inset Formula \( \cos ^{2}\theta \)
\end_inset
\begin_inset Quotes erd
\end_inset
or
\begin_inset Quotes eld
\end_inset
\begin_inset Formula \( \lim _{n\rightarrow \infty } \)
\end_inset
\begin_inset Quotes erd
\end_inset
.
\layout Standard
\series bold
Exercise
\series default
: Put equation 3 of
\family typewriter
example_raw.lyx
\family default
into math mode.
\layout Subsection
Matrices
\layout Standard
\begin_inset LatexCommand \label{sec:matrices}
\end_inset
Click on the
\family sans
matrix
\family default
button in the
\family sans
Math\SpecialChar ~
Panel
\family default
.
The Matrix popup has two sliding bars which allow you to choose how many
rows and columns you want in your matrix.
Choose 2 rows and 3 columns and hit
\family sans
Apply
\family default
or
\family sans
OK
\family default
.
LyX prints 6 insertion points in a
\begin_inset Formula \( 2\times 3 \)
\end_inset
matrix.
As usual, you can put any sort of Mathed expression (a square root, another
matrix, etc.) in each insertion point.
You can also leave some of the insertion points empty if you want.
\layout Standard
\family sans
Tab
\family default
can be used to move horizontally between the columns of a matrix.
Alternatively, you can use the arrow keys to move around - hitting
\family sans
Right
\family default
at the end of one box will move to the next box,
\family sans
Down
\family default
will move to the next row, etc.
\layout Standard
See the
\emph on
User's Guide
\emph default
for information on how to change the horizontal alignment of each column,
and how to change the vertical position of the whole matrix.
Note that if you want to write a table containing text, you should use
LyX' wonderful table support, rather than trying to write text in a matrix.
\layout Subsection
Display mode
\layout Standard
All of the expressions we have written so far have been on the same line
as the text that came before and after them, otherwise known as inline
expressions.
This is fine for short, simple expressions, but if you want to write larger
ones, or if you want your expressions to stand out from the text, you need
to write them in display mode.
In addition, only displayed expressions can be labeled and numbered (see
the
\emph on
User's Guide
\emph default
), and multi-line equations (see Sec.
\begin_inset LatexCommand \ref{sec:multiline}
\end_inset
) must be in display mode.
\layout Standard
Click on the
\family sans
display
\family default
button in the
\family sans
Math\SpecialChar ~
Panel
\family default
, which represents a couple lines of text before and after a centered blue
box.
LyX opens up an insertion point, but the insertion point is on a new line,
and it's centered within that line.
Now type an expression and run LaTeX to see how it looks.
The
\family sans
display
\family default
button is actually a toggle; use it now to change a couple of your expressions
to display mode and back.
\layout Standard
Display mode has a couple differences from regular Mathed:
\layout Itemize
The default font is smaller for a few symbols, like
\begin_inset Formula \( \sum \)
\end_inset
and
\begin_inset Formula \( \int \)
\end_inset
\layout Itemize
Subscripts and superscripts for limits and sums (but not integrals) are
written under rather than next to the symbols
\layout Itemize
Text is centered
\layout Standard
Other than these differences, though, displayed expressions and inline expressio
ns are very similar.
\layout Standard
One final note about the way displayed equations are typeset: be careful
about whether you're putting your equation into a new paragraph or not.
If your equation is in the middle of a sentence or paragraph, then don't
press
\family sans
Return
\family default
.
Doing so will cause the text
\emph on
after
\emph default
the equation to start a new paragraph.
That text will therefore be indented, which is probably not what you want.
\layout Standard
\series bold
Exercise
\series default
: Put the various equations in
\family typewriter
example_raw.lyx
\family default
into display mode, and see how they're typeset differently.
\layout Standard
\series bold
Exercise
\series default
: Using various tools you've learned in this section, you should be able
to write an equation like:
\begin_inset Formula \[
f(x)=\left\{ \begin{array}{cc}
\log _{8}x & x>0\\
0 & x=0\\
\sum ^{5}_{i=1}\alpha _{i}+\sqrt{-\frac{1}{x}} & x<0
\end{array}\right. \]
\end_inset
\layout Section
Multi-Line Equations
\layout Standard
\begin_inset LatexCommand \label{sec:multiline}
\end_inset
Try writing the following equations and looking at the resulting
\family typewriter
dvi
\family default
file.
You will need to enter two separate equations in display mode.
\layout Standard
\begin_inset Formula \[
x=y+y+y+y+y\]
\end_inset
\layout Standard
\begin_inset Formula \[
=5y\]
\end_inset
\layout Standard
This doesn't look good at all! If you write two or more equations in succession,
they look much better if their equals signs are aligned; this is especially
true if the second equation has no left side.
LyX allows you to write multi-line equations with some control over the
alignment.
\begin_inset Formula \begin{eqnarray*}
x & = & y+y+y+y+y\\
& = & 5y
\end{eqnarray*}
\end_inset
\layout Standard
This looks
\emph on
much
\emph default
better! The equals signs are aligned, and there is less vertical space
between the equations.
\layout Standard
In order to start a multi-line equation, open a displayed Mathed expression
and type
\family sans
C-Return
\family default
.
LyX will print two lines, each with three empty insertion points.
Like with matrices, you can use the mouse, arrow keys, or
\family sans
Tab
\family default
to move between insertion points.
Try to reproduce the above multi-line equation.
Note that it's legal to leave one or more insertion points empty in a multi-lin
e equation.
This can be useful either for examples like the one above, or for splitting
very long equations, like:
\begin_inset Formula \begin{eqnarray*}
x & = & a+b+c+d\\
& & +e+f+g
\end{eqnarray*}
\end_inset
\layout Standard
LyX will line up the second (central) field of each line, so usually you'll
put equals signs or other relational operators in that field; in fact,
though, you can put whatever you want in there.
But don't use a multi-line equation to print an array; use a matrix for
that (see Sec.
\begin_inset LatexCommand \ref{sec:matrices}
\end_inset
).
\layout Standard
If you want an even longer set of equations, use
\family sans
C-Return
\family default
to get a new line with three empty insertion points.
If you aren't at the end of the line when you do it, the remaining stuff
on the current line will be carried to the new line.
If you hit
\family sans
C-Return
\family default
when you've already written a (one-line) equation, the whole equation will
be in the first field.
Place the cursor before the equals sign and hit
\family sans
C-Tab
\family default
to move it to the second field.
Then move past the equals sign, and
\family sans
C-Tab
\family default
again to move the right side of the equation to the third field.
Try changing your
\begin_inset Formula \( E=mc^{2} \)
\end_inset
equation to
\begin_inset Formula \begin{eqnarray*}
E & = & mc^{2}\\
& = & mc\times c
\end{eqnarray*}
\end_inset
\layout Standard
If you've written too many lines, put the cursor at the end of a line and
use
\family sans
M-e\SpecialChar ~
k
\family default
to delete the following line.
It will delete the linefeed and concatenate (all three insertion points
of) the next line onto the end of the current one.
If the following line is empty, it will effectively just delete it.
Warning: using
\family sans
M-e\SpecialChar ~
k
\family default
when you're not at the end of the line can lead to strange behavior.
\layout Section
More Math Stuff
\layout Standard
Mathed can do plenty more.
By now, you're familiar with the basics, so we'll just refer to the
\emph on
User's Guide
\emph default
for tips on how to:
\layout Itemize
Labeling and numbering expressions
\layout Itemize
Change typefaces, e.g., to write boldface text in an expression.
We'll note here that clicking on the
\family sans
math
\family default
button in the toolbar while you're already in Mathed will write Roman text
until you type a (non-protected) space.
\layout Itemize
Fine-tune font sizes and spacing within an expression.
(Don't worry about this until your final draft!)
\layout Itemize
Write macros.
These are very powerful, because you just define them once at the top of
the document, and then you can use them throughout the document.
If you change the macro definition, the references to the macro will be
changed throughout the document.
Macros can even take arguments.
\layout Itemize
Do lots of other things we didn't have time to mention in this
\emph on
Tutorial
\emph default
.
\layout Chapter
Miscellaneous
\layout Section
Other Major LyX Features
\layout Standard
We haven't gone through all the possible commands in LyX, and we aren't
planning on it.
As usual, see the
\emph on
User's Guide
\emph default
for more information.
The exact function of every menu command is described in the
\emph on
Reference Manual
\emph default
.
We'll just mention a couple more major things LyX can do\SpecialChar \ldots{}
\layout Itemize
LyX has WYSIWYG support for tables.
Use the
\family sans
\bar under
I
\bar default
nsert\SpecialChar \menuseparator
Ta
\bar under
b
\bar default
ular
\family default
to get a table.
(We chose to use the LaTeX naming convention---tabular vs table---to distinguis
h between the tabular material itself from a floating table, which include
the tabular material, a caption, etc.) Click on the table with the
\emph on
right button
\emph default
to get a
\family sans
Table\SpecialChar ~
Layout
\family default
popup which allows extensive table editing.
\layout Itemize
LyX also supports including PostScript (or raw LaTeX) pictures within documents.
(You guessed it:
\family sans
\bar under
I
\bar default
nsert\SpecialChar \menuseparator
Fi
\bar under
g
\bar default
ure
\family default
\SpecialChar \@.
Then click on the figure to choose the file to include, rotate or scale
it, etc.
) Tables and figures can have captions, and LyX will automatically generate
lists of figures and/or tables.
\layout Itemize
Version control is supported, using RCS (
\family typewriter
man rcsintro
\family default
for more info).
\layout Itemize
LyX is heavily configurable.
Everything from how the LyX window looks to how the output comes out can
be configured in a number of ways.
Much configuration is done through
\family sans
\bar under
E
\bar default
dit\SpecialChar \menuseparator
\bar under
P
\bar default
references
\family default
.
For more information on this, check out
\family sans
\bar under
H
\bar default
elp\SpecialChar \menuseparator
\bar under
C
\bar default
ustomization\SpecialChar \@.
\layout Itemize
LyX is being developed by a team of programmers on five continents.
Therefore, LyX has better support for non-English languages (such as Dutch,
German, Greek, Czech, Turkish, \SpecialChar \ldots{}
) than many word processors.
You can write documents in other languages, but you can also configure
LyX to show its menus and error messages in other languages.
\layout Itemize
The LyX menus feature keybindings.
This means that you can do
\family sans
\bar under
F
\bar default
ile\SpecialChar \menuseparator
\bar under
O
\bar default
pen
\family default
by typing
\family sans
M-F
\family default
followed by
\family sans
O
\family default
.
Keybindings are also configurable (and keybindings even exist for some
of the menus which have been translated from English).
For information on this, check out
\family sans
\bar under
H
\bar default
elp\SpecialChar \menuseparator
\bar under
C
\bar default
ustomization\SpecialChar \@.
\layout Itemize
LyX can read in LaTeX documents.
See Section\SpecialChar ~
\begin_inset LatexCommand \ref{sec:relyx}
\end_inset
.
\layout Itemize
Spellcheck your document with
\family sans
\bar under
E
\bar default
dit\SpecialChar \menuseparator
\bar under
S
\bar default
pellchecker
\family default
\SpecialChar \@.
\begin_float footnote
\layout Standard
Note that the spellchecker only checks from the cursor to the end of the
document.
\end_float
\layout Section
LyX for LaTeX Users
\layout Standard
\begin_inset LatexCommand \label{sec:latexusers}
\end_inset
If you don't know anything about LaTeX, you don't have to read this section.
Actually, you might want to
\emph on
learn
\emph default
about LaTeX, and then read this chapter.
However, many people who begin to use LyX will be familiar with LaTeX.
If you are such a person, you may be wondering if LyX can really do everything
LaTeX can do.
The short answer is that LyX can do pretty much everything LaTeX can do
in one form or another, and it definitely simplifies most parts of writing
a LaTeX document.
Currently, there may be some annoyance in converting old LaTeX documents
and in a couple other areas, but later releases of LyX will get rid of
these problems.
\layout Standard
Because this is just a tutorial, we are only going to mention things that
new LyX users will most likely be interested in.
In the interests of keeping the
\emph on
Tutorial
\emph default
short, we will give only minimal information here.
The
\emph on
User's Guide
\emph default
has a great deal of information on differences between LyX and LaTeX, and
how to do various LaTeX tricks in LyX.
\layout Subsection
TeX Mode
\layout Standard
Anything that you enter in Tex mode will be passed straight to LaTeX, and
will be displayed in red on the screen.
Enter TeX mode with
\family sans
\bar under
L
\bar default
ayout\SpecialChar \menuseparator
\bar under
T
\bar default
ex\SpecialChar ~
Style
\family default
or by clicking on the red TeX toggle button in the toolbar.
\layout Standard
In Mathed, TeX mode is handled a bit differently.
Enter TeX mode by typing a backslash.
The backslash is not written out, but anything you type afterwards will
be in red.
You exit TeX mode by typing
\family sans
Space
\family default
or some other non-alphabetic character, like a number, underscore, caret,
or parenthesis.
Once you exit TeX mode, if LyX knows the TeX command you've typed in, it
will convert it to WYSIWYM\SpecialChar \@.
So if, in Mathed, you type
\family typewriter
\backslash
gamma
\family default
, then when you type
\family sans
Space
\family default
, LyX will change the red
\begin_inset Quotes eld
\end_inset
gamma
\begin_inset Quotes erd
\end_inset
to a blue
\begin_inset Quotes eld
\end_inset
\begin_inset Formula \( \gamma \)
\end_inset
\begin_inset Quotes erd
\end_inset
.
This will work for almost all, non-complicated math macros (although note
that functions like
\family typewriter
\backslash
sin
\family default
will remain in red, since that is already WYSIWYM).
This may be faster than using the
\family sans
Math\SpecialChar ~
Panel
\family default
, and will be especially convenient for experienced LaTeX users.
\layout Standard
As a special case, if you type a brace in Mathed's TeX mode, then Mathed
will type the beginning
\emph on
and
\emph default
ending braces in red, then take you
\emph on
out
\emph default
of TeX mode and place the cursor between the braces.
This makes it more convenient to type commands that Mathed doesn't know
which take an argument.
\layout Standard
LyX can't do absolutely everything that LaTeX can do (yet?).
Some fancy functions are not supported at all, while some work but aren't
WYSIWYG.
TeX mode allows users to get the full flexibility of LaTeX, while having
all the convenient features of LyX, like WYSIWYG math, tables, and editing.
LyX could never support every LaTeX package.
However, by typing
\family typewriter
\backslash
usepackage{foo}
\family default
in the preamble (see Section\SpecialChar ~
\begin_inset LatexCommand \ref{sec:preamble}
\end_inset
), you can use any package you want --- although you won't have WYSIWYG
support for that package's features.
\layout Subsection
Importing LaTeX Documents---
\family typewriter
reLyX
\layout Standard
\begin_inset LatexCommand \label{sec:relyx}
\end_inset
You can import a LaTeX file into LyX by using the
\family sans
\bar under
F
\bar default
ile\SpecialChar \menuseparator
\bar under
I
\bar default
mport\SpecialChar \menuseparator
LaTeX
\family default
command in LyX.
This will call a Perl script called
\family typewriter
reLyX
\family default
---which will create a file
\family typewriter
foo.lyx
\family default
from the file
\family typewriter
foo.tex
\family default
---and then open that file.
If the translation doesn't work, you can try calling
\family typewriter
reLyX
\family default
from the command line
\begin_float footnote
\layout Standard
When LyX is installed, a separate executable called
\family typewriter
reLyX
\family default
will be placed in the same folder as the
\family typewriter
lyx
\family default
executable (e.g.,
\family typewriter
/usr/local/bin/reLyX
\family default
).
\family typewriter
reLyX
\family default
requires Perl (version 5.002 as of this writing).
\end_float
, possibly using fancier options.
\layout Standard
\family typewriter
reLyX
\family default
will translate most legal LaTeX, but not everything.
It will leave things it doesn't understand in TeX mode, so after translating
a file with
\family typewriter
reLyX
\family default
, you can look for red text and hand-edit it to look right.
\layout Standard
\family typewriter
reLyX
\family default
has its own manpage.
Read it to find out about which LaTeX commands and environments aren't
supported, bugs (and how to get around them), and how to use the various
options.
\layout Subsection
Converting LyX Documents to LaTeX
\layout Standard
You might wish to convert a LyX Document to a LaTeX file.
For example, a co-worker or co-author who doesn't have LyX might want to
read it.
This is very easy to do with LyX.
Select
\family sans
\bar under
F
\bar default
ile\SpecialChar \menuseparator
\bar under
E
\bar default
xport\SpecialChar \menuseparator
LaTeX
\family default
.
This will create a file
\family typewriter
whatever.tex
\family default
from the
\family typewriter
whatever.lyx
\family default
file you are editing.
LyX always creates temporary LaTeX files when viewing or printing files,
so it is very good at generating LaTeX.
\layout Subsection
LaTeX Preamble
\layout Subsubsection
Document Class
\layout Standard
The
\family sans
\bar under
L
\bar default
ayout\SpecialChar \menuseparator
\bar under
D
\bar default
ocument
\family default
popup takes care of many of the options that you would input in a
\family typewriter
\backslash
documentclass
\family default
command.
Change the class, default font size and paper size here.
Put any extra options to the
\family typewriter
\backslash
documentclass
\family default
command in the
\family sans
E
\bar under
x
\bar default
tra\SpecialChar ~
Options
\family default
area.
\layout Subsubsection
Other Preamble Matter
\layout Standard
\begin_inset LatexCommand \label{sec:preamble}
\end_inset
If you have special commands to put in the preamble of a LaTeX file, you
can use them in a LyX document as well.
Select
\family sans
\bar under
L
\bar default
ayout\SpecialChar \menuseparator
\bar under
L
\bar default
atex\SpecialChar ~
Preamble
\family default
and type in the popup window.
Anything you type will (like TeX mode) be sent directly to LaTeX.
\layout Subsection
BibTeX
\layout Standard
LyX has support for BibTeX, which allows you to build databases of bibliographic
al references to be used in multiple documents.
Select
\family sans
\bar under
I
\bar default
nsert\SpecialChar \menuseparator
Lists\SpecialChar ~
&\SpecialChar ~
\bar under
T
\bar default
OC\SpecialChar \menuseparator
\bar under
B
\bar default
ibTeX\SpecialChar ~
Reference
\family default
to include a
\family typewriter
bib
\family default
file.
Click on the resulting
\begin_inset Quotes eld
\end_inset
BibTeX\SpecialChar ~
Generated\SpecialChar ~
References
\begin_inset Quotes erd
\end_inset
inset, and you will get a
\family sans
BibTeX
\family default
popup.
In the
\family sans
Database
\family default
field, type what you would type inside the braces of a
\family typewriter
\backslash
bibliography{}
\family default
command
\begin_float footnote
\layout Standard
Like in regular LaTeX, multiple bibliographies should be separated by commas,
with no whitespace.
\end_float
.
Similarly, in the
\family sans
Style
\family default
field, type what you would type inside the braces of a
\family typewriter
\backslash
bibliographystyle{}
\family default
command.
\layout Standard
After you've done this, you can use citations from any bibliographies you're
including with
\family sans
\bar under
I
\bar default
nsert\SpecialChar \menuseparator
\bar under
C
\bar default
itation\SpecialChar ~
Reference
\family default
(see Section\SpecialChar ~
\begin_inset LatexCommand \ref{sec:bibliographies}
\end_inset
).
LyX will take care of running BibTeX.
The combobox in the
\family sans
Citation
\family default
popup will show a list of all the references in your
\family typewriter
bib
\family default
file.
\layout Subsection
Miscellaneous
\layout Standard
See the
\family sans
\bar under
I
\bar default
nsert\SpecialChar \menuseparator
\bar under
S
\bar default
pecial\SpecialChar ~
Character
\family default
menu for other special characters, including ellipsis, forced linebreak,
and hyphenation point.
\layout Section
Errors!
\layout Standard
Sometimes when you LaTeX a document, there will be errors, things that LyX
or LaTeX can't understand.
When this happens, LyX will create an error box (a box with the word
\begin_inset Quotes eld
\end_inset
error
\begin_inset Quotes erd
\end_inset
in it).
Clicking on this box will pop up a window showing what the error was.
If it was something you did wrong with LyX, it will be a LyX error.
These should be very rare.
If LaTeX had a problem (most often, this happens with things you typed
in TeX mode) then LyX will just quote LaTeX's error message.
\the_end
|