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
|
<!--
****************************************************************************
* Copyright(c) 2002-2012, John Forkosh Associates, Inc. All rights reserved.
* http://www.forkosh.com mailto: john@forkosh.com
* ==========================================================================
* This file is part of mimeTeX, which is free software. You may redistribute
* and/or modify it under the terms of the GNU General Public License,
* version 3 or later, as published by the Free Software Foundation.
* MimeTeX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY, not even the implied warranty of MERCHANTABILITY.
* See the GNU General Public License for specific details.
* By using mimeTeX, you warrant that you have read, understood and
* agreed to these terms and conditions, and that you possess the legal
* right and ability to enter into this agreement and to use mimeTeX
* in accordance with it.
* Your mimetex.zip distribution file should contain the file COPYING,
* an ascii text copy of the GNU General Public License, version 3.
* If not, point your browser to http://www.gnu.org/licenses/
* or write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
****************************************************************************
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!-- "http://www.forkosh.com/loose.dtd" -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Preamble
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<html>
<head>
<title> mimeTeX user's manual </title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<style type="text/css">
body { background-image: none; /* none; or url(); */
/*background-repeat: repeat-y;*/
/*background-attachment: fixed;*/ /* fixed; or scroll; */
background-color: #ffffff; color: #000000;
margin-left: 0.5em; margin-right: 0.1em;
font-size: large; /* or medium */
clear: both }
A:active { color: blue/*#0000FF*/; text-decoration: none }
A:link { color: blue/*#0000FF*/; text-decoration: none }
A:visited { color: blue/*#0000FF*/; text-decoration: none }
A:hover { color: red/*#FF0000*/; text-decoration: underline
/*font-style: italic; font-weight: bold;*/
/*font-size: normal; line-height: normal*/ }
h1 { color: maroon; text-decoration: underline;
font-style: normal; /* italic oblique */
font-size: xx-large;
padding-top: 2.0em;
letter-spacing: 0.25em }
h2 { color: maroon; text-decoration: underline;
font-style: normal; /* italic oblique */
font-size: x-large;
padding-top: 1.0em;
letter-spacing: 0.20em }
h3 { color: maroon; /*black; text-decoration: underline;*/
font-style: normal; /* italic oblique */
font-size: large;
margin-left: 1em;
padding-top: 0.5em;
letter-spacing: 0.15em }
center { padding-top: -0.1em; padding-bottom: -0.1em; }
table { font-size: large }
table.medium { font-size: medium }
dl { font-size: large;
margin-left: 3.0em; margin-right: 2.5em }
ol { margin-left: 3.0em; margin-right: 2.5em }
ul { margin-left: 3.0em; margin-right: 2.5em;
list-style-type: square }
ul ul { margin-left: -0.5em; margin-right: 3.5em;
list-style-type: disc }
pre { margin-left: 3.0em; font-size: medium; font-weight: bold }
pre.nobold { margin-left:3.0em; font-size:medium; font-weight:normal }
p { margin-left: 2.0em; margin-right: 1.5em }
p:first-letter
{ font-size: x-large; font-weight: bold;
color: maroon }
p.continue { margin-left: 2.0em; margin-right: 1.5em;
padding-top: -0.1em }
p.continue:first-letter
{ font-size: large; font-weight: normal;
color: black }
p.warning { color: red } /* defines p class=warning */
</style>
<style type="text/css">
a.info{
position:relative;
z-index:24;
/*background-color:#8692A5;*/
visibility: inherit;
text-decoration: none; }
a.info:hover{
z-index:25;
/*background-color:#999999;
color: #FFFF00;*/
text-decoration: none; }
a.info span{
display: none;
/*color: #FFFF00;*/ }
a.info:hover span{
display:block;
position:absolute;
top:2em;
left:2em;
/*width:15em;*/
border:1px solid #330066;
background-color:#FFFF99;
color:#660000;
text-align: left;
font-size: 13px;
font-weight: normal;
margin: 3px;
padding: 6px; }
a.info:link {
text-decoration: none;
/*color: #FFFF00;*/ /*themecolour1%0;*/ }
a.info:visited {
text-decoration: none;
/*color: #FFFF00;*/ /*themecolour1%0;*/ }
</style>
<script type="text/javascript">
<!--
// add/clear text to expression
function eqntext(eqn)
{ var eqnSrc = document.getElementById(eqn).src;
var texSrc = eqnSrc.substring(eqnSrc.indexOf('?')+1,eqnSrc.length);
addtext(texSrc); }
function addtext(text)
{ cleartext();
document.expression.formdata.value += unescape(text);
document.expression.formdata.focus(); }
function cleartext()
{ document.expression.formdata.value = "";
//document.inlineframe.value = "";
document.expression.formdata.focus(); }
-->
</script>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ php functions to use Vertical-Align: info from mimetex
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<?php
//$mimetexurl = "../cgi-bin/mimetex.cgi?";
$mimetexurl = "http://www.forkosh.com/mimetex.cgi?";
//$mimetexurl = "http://psi2star/cgi-bin/mimetex.cgi?";
function verticalalign( $expression ) {
global $mimetexurl;
// note: curl_init() stops at the first whitespace char in $url argument
$expression = ereg_replace(" ","~",$expression); // remove whitespace
$url = $mimetexurl . "\depth~" . $expression;
$valign = "0";
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => true); // return headers
$ch = curl_init( $url );
//curl_setopt_array( $ch, $options );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HEADER, true );
$gif = curl_exec( $ch );
$errno = curl_errno( $ch );
$error = curl_error( $ch );
//$info = curl_getinfo( $ch );
curl_close( $ch );
//echo '<br> url= ',$url,'<br>',"\n";
//echo '<br> gif=<br>',$gif,'<br>',"\n";
if ( $errno == 0 ) {
$fields = explode("Vertical-Align:",$gif);
$vfield = trim($fields[1]);
$fldlen = strspn($vfield,"+-0123456789");
$valign = substr($vfield,0,$fldlen); }
else {
echo 'verticalalign> errno ',$errno,' = ',$error,'<br><br>',"\n"; }
return $valign;
}
function mimetextag( $label, $expression ) {
global $mimetexurl;
$valign = verticalalign($expression);
$url = $mimetexurl . $expression;
//echo ' valign=',$valign,' ',"\n";
echo '<a href="#preview" class="info"><img id="',$label,'" ';
echo ' onclick="eqntext(',"'",$label,"'",')" ';
echo ' src="',$url,'" ';
echo ' style="Vertical-Align:',$valign,'px" ';
echo ' alt="" border=0>';
echo '<span>',$expression,'</span>';
echo '</a>', "\n";
}
?>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ javascript from mathtran.org to render <img alt="tex:math expression">
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- script type="text/javascript"
src="http://www.mathtran.org/js/mathtran_img.js"></script -->
</head>
<body>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Banner across top of page, containing title and two example mimeTeX images.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<br>
<hr size=4>
<center>
<table cellspacing=10>
<tr>
<td align="center">
<a href="#preview"><img id="imageBanr1" onclick="eqntext('imageBanr1')"
src="../cgi-bin/mimetex.cgi?\Large f=b_o+\frac{a_1}{b_1+\frac{a_2}
{b_2+\frac{a_3}{b_3+a_4}}}" alt="" border=0 align=middle></a> </td>
<td align="center" valign="middle">
<center> <font color="maroon" size=4>
<b><nobr>m i m e T e X m a n u a l</nobr></b> <br>
<font size=3>( for mimeTeX version
<a href="#preview"><img id="imageVer1" onclick="eqntext('imageVer1')"
src="../cgi-bin/mimetex.cgi?\small\versionnumber"
alt="" border=0 align=bottom></a> )</font> <br>
<font size=3> <b>Click for:</b>
<!-- <a href="http://www.forkosh.com" target="_top">homepage</a>,
<a href="http://www.forkosh.com/resume.html" target="_top">resume</a> -->
<a href="http://www.forkosh.com/mimetextutorial.html" target="_top">
LaTeX tutorial</a><br>
<a href="http://www.forkosh.com/mimetex.html" target="_top">
mimeTeX QuickStart</a><br>
<a href="http://www.forkosh.com/cgi-bin/weblist.cgi?-t=weblist
&-f=sources/weblistemplate.html&files=@sources/sourcecode/mimetex.lis
©right=2002-2011&counter=mimetex
&title=mimetex&description=m i m e T e X S o u r c e L i s t i n g"
target="_top">mimeTeX Source Listing</a><br>
<a href="http://www.forkosh.com/mimetex.zip">
<!-- jfa <a href="ftp://ftp.tex.ac.uk/tex-archive/support/mimetex/mimetex.zip"></a> -->
<font size=4>download mimeTeX</font></a></font>
</font> </center> </td>
<td align="center">
<a href="#preview"><img id="imageBanr2" onclick="eqntext('imageBanr2')"
src="../cgi-bin/mimetex.cgi?\Large\scr{J}^{ij}=\frac12\varepsilon_{ijk}
\left[\begin{array}{cc}\sigma_k&0\\0&\sigma_k\end{array}\right]"
alt="" border=0 align=middle></a> <br>
<a href="#examples">more_examples...</a> </td>
</tr>
<tr> <td align="center" colspan="3">
This page discusses mimeTeX, a program that displays math on the web.<br>
(<font size=3>See
<a href="http://www.americanscientist.org/issues/pub/2009/3/writing-math-on-the-web/1"
target="_top">Writing Math on the Web</a>
for a more general discussion.</font>)
</td> </tr>
</table>
</center>
<hr size=4>
<center><b><font color="maroon" size=3>
Copyright <font size=5>©</font> 2002-2012,
<a href="http://www.forkosh.com">John Forkosh Associates, Inc.</a> <br>
email: <a href="mailto:john@forkosh.com">john@forkosh.com</a>
</font></b> <br><br>
<a href="#preview"><img id="timestamp1" onclick="eqntext('timestamp1')"
src="../cgi-bin/mimetex.cgi?\normalsize\blue\begin{matrix}
\large\today\\\normalsize\today[3]\end{matrix}"
alt="" border=0 align=middle></a> </center>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Table of Contents
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<br> <center><b><font color="maroon" size=6>
<u> C o n t e n t s
</u></font></b> <br>
<table cellspacing=0 class="medium">
<tr>
<td valign="top" align="center" width=150>
<font size=3><b>- - - T u t o r i a l - - -</b></font> </td>
<td valign="top" align="center" colspan=3 width=450><font size=3><b>
- - - - - - - - - - - - - - R e f e r e n c e - - - - - - - - - - - - - -
</b></font></td>
</tr>
<tr>
<td valign="top" align="center" width=150> <font size=3>
<a href="#introduction"> (I) Introduction </a><br>
<a href="#quickstart"> a. Quick Start </a><br>
<a href="#examples"> b. Examples </a><br>
<a href="#scripts"> c. Scripts&Plugins </a><br>
<a href="#gpl"> d. GPL License </a> </font> </td>
<td valign="top" align="center" width=150> <font size=3>
<a href="#build"> (II) Building mimeTeX </a><br>
<a href="#compile"> a. Compile </a><br>
<a href="#install"> b. Install </a><br>
<a href="#options"> c. Compile Options </a><br>
<a href="#cmdline"> d. Command Line </a> </font> </td>
<td valign="top" align="center" width=150> <font size=3>
<a href="#reference"> (III) Syntax Reference </a><br>
<a href="#spaces"> a. Math & White Space </a><br>
<a href="#symbols"> b. Symbols, Sizes, Modes </a><br>
<a href="#delimiters"> c. Delimiters </a><br>
<a href="#accents"> d. Accents, Arrows, etc. </a><br>
<a href="#array"> e. \begin{array} </a><br>
<a href="#picture"> f. \picture( ){ } </a><br>
<a href="#commands"> g. Other Commands </a><br>
<a href="#exceptions"> h. Other Exceptions </a><br>
<a href="#messages"> i. Errors and Messages </a> </font> </td>
<td valign="top" align="center" width=150> <font size=3>
<a href="#appendices"> (IV) Appendices </a><br>
<a href="#fonts"> a. Fonts </a><br>
<a href="#makeraster"> b. make_raster() </a><br>
<a href="#gifsave"> c. gifsave.c </a>
<br><a href="#remarks"> Remarks </a> </font> </td>
</tr>
</table>
</center>
<!-- br -->
<p style="margin-left:3em;margin-right:3em;">
<font color="blue" size=3> This page contains more information
than you'll probably need to read. If you follow the
<font color="maroon">Installation and Usage Summary</font>
below, try installing mimeTeX immediately. <!-- If you need
more information, --> Or continue reading until you feel comfortable
trying to install mimeTeX. <!-- Return to this page as needed. -->
Prerequisites are: some knowledge of your OS's shell,
of installing cgi's, of LaTeX. </font>
<font color="maroon" size=3> <br>
<b>"</b><i>Computers are like Old Testament gods<b>:</b>
lots of rules and no mercy.</i><b>"</b><br>
<b>––</b> Joseph Campbell, The Power of Myth
(Doubleday 1988, page 18) </font> </p>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Installation and Usage Summary
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- br -->
<center>
<table border="0">
<tr> <!-- banner -->
<td align="left">
<!-- <b><font color="maroon" size=4>
<u> I n s t a l l a t i o n
a n d U s a g e S u m m a r y
</u></font></b> -->
<font size=4 color="maroon"><b>- - - - - - I n s t a l l a t i o n
a n d U s a g e S u m m a r y - - - - - -</b></font>
</td> </tr>
<tr>
<td valign="top"> <!-- summary -->
<table border="0" cellpadding="0" cellspacing="0" hspace="0" vspace="0">
<tr><td align="right" valign="top">
<a href="#build">Installation</a>: </td>
<td><font size=4> Download <a href="http://www.forkosh.com/mimetex.zip">
mimetex.zip</a> and then type <br>
<b> unzip mimetex.zip</b> <br>
<b> cc -DAA mimetex.c gifsave.c -lm -o mimetex.cgi</b>
<br>Now just <b>mv</b> mimetex.cgi to your <b>cgi-bin/</b>
directory, <br> set permissions as necessary, and you're all done.
</font></td></tr>
<tr><td colspan="2"> <font size="2"> </font> </td></tr>
<tr><td align="right" valign="top">
<a href="#introduction">Usage</a>: </td>
<td><font size=4> To see the image <br>
<a href="#preview"><img id="summary1" onclick="eqntext('summary1')"
src="../cgi-bin/mimetex.cgi?x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}"
alt="" border=0 align=middle></a> <br>
just write the tag <br>
<b> <img src="/cgi-bin/mimetex.cgi?<br>
x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}"></b>
</font></td></tr>
</table>
</td>
</tr>
</table>
</center>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SECTION I. INTRODUCTION
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h1> <a name="introduction">(I) Introduction</a> </h1>
<p> <font color="maroon">MimeTeX, licensed under the
<a href="http://www.gnu.org/licenses/gpl.html" target="_top">gpl</a>,
lets you easily embed LaTeX math in your html pages.</font>
It parses a LaTeX math expression and immediately emits the
corresponding gif image, rather than the usual TeX dvi.
And mimeTeX is an entirely separate little program that doesn't use
TeX or its fonts in any way. It's just one cgi that you put in your
site's cgi-bin/ directory, with no other dependencies. So mimeTeX
is very easy to <a href="#build">install</a>. <br>
<nobr>
Just download <a href="http://www.forkosh.com/mimetex.zip">
mimetex.zip</a> and then type </nobr> <br>
<nobr><b>
unzip mimetex.zip</b></nobr> <br>
<nobr><b>
cc –DAA mimetex.c gifsave.c
–lm –o mimetex.cgi</b></nobr> <br>
<nobr>
Now just <b>mv</b> mimetex.cgi to your <b>cgi-bin/</b>
directory, </nobr> <br>
<nobr>
set permissions as necessary, and you're all done. </nobr> <br>
<br>
And mimeTeX is equally easy to <a href="#quickstart">use</a><b>:</b>
just place an html <img> tag in your document
wherever you want to see the corresponding LaTeX expression. <br>
<nobr>
For example, the <img> tag </nobr> <br>
<nobr><b>
<img
src="../cgi-bin/mimetex.cgi?f(x)=\int_{-\infty}^xe^{-t^2}dt" ></b></nobr><br>
<nobr>
immediately generates the corresponding gif image on-the-fly,</nobr><br>
<nobr>
displaying
<?php mimetextag('imageI1',
'\normalsize f(x)=\int\limits_{-\infty}^xe^{-t^2}dt'); ?>
wherever you put that tag.</nobr><br>
<br>
MimeTeX doesn't need intermediate dvi-to-gif conversion, and it doesn't
create separate gif files for each converted expression.
(But you can enable image caching with mimeTeX's
<b>-DCACHEPATH=\"<i>path/</i>\"</b>
<a href="#options">compile option</a>.)
And there's no inherent need to repeatedly write the
cumbersome <img> tag illustrated above.
You can write your own
<a href="#scripts">wrapper scripts</a>,
discussed below, around mimeTeX to simplify the notation. </p>
<h3> <a name="alternatives">
Alternative solutions<font size=5>...</font></a> </h3>
<p> MimeTeX's benefit over similar math-on-the-web solutions is, as
mentioned above, its easy installation. But if that's not a
problem for you, and if your site's server already has a LaTeX
distribution installed, and suitable image conversion utilities like
<a href="http://www.imagemagick.org" target="_top">ImageMagick</a>,
then you may prefer to look at a math rendering script like
<a href="http://www.mayer.dial.pipex.com/tex.htm#latexrender"
target="_top">latexrender</a>
which uses LaTeX to create higher quality images than mimeTeX
produces. For comparison,
<?php mimetextag('imageI2',
'\small f(x)=\int\limits_{-\infty}^xe^{-t^2}dt'); ?>,
with arbitrary mean
<?php mimetextag('imageI3','\normalsize\mu'); ?> and standard deviation
<?php mimetextag('imageI4','\normalsize\sigma'); ?>,
and at mimeTeX's next larger font size, looks like </p>
<center>
<table>
<tr align="center">
<td> <font size="4">latexrender</font> </td>
<td> <img src="../cgi-bin/mimetex.cgi?\hspace{30}"
alt="" border=0> </td>
<td> <font size="4">mimeTeX</font> </td>
</tr>
<tr align="center">
<td> <img src="http://www.forkosh.com/lrender.gif"
alt="" border=0 align=middle> </td>
<td> </td>
<td>
<?php mimetextag('imageI5',
'\normalsize f(x)={\Large\frac1{\sigma\sqrt{2\pi}}}
\int_{\small-\infty}^xe^{-\small\frac{(t-\mu)^2}{2\sigma^2}}dt'); ?>
</td>
</tr>
</table>
</center>
<p> Similar LaTeX-based solutions that you may want to look at are
<a href="http://www.mathtran.org" target="_top">mathtran</a>,
<a href="http://www.fourmilab.ch/webtools/textogif/textogif.html"
target="_top">textogif</a> and
<a href="http://www.math.uio.no/~martingu/gladtex/"
target="_top">gladTeX</a>. Additional discussion and several more
links are at <a href="http://www.tug.org/interest.html#web"
target="_top">www.tug.org/interest.html</a> and in the
<a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=LaTeX2HTML"
target="_top">tex-faq</a>. </p>
<p> For example, <a href="http://www.mathtran.org" target="_top">mathtran</a>
is a public LaTeX web service that's
particularly easy to use by following these simple
<a href="http://www.mathtran.org/wiki/index.php/TeX_image"
target="_top">instructions</a>. In the <head> of your
html page, place the tag <br>
<script type="text/javascript" <br>
src="http://www.mathtran.org/js/mathtran_img.js"></script><br>
and in the <body>, wherever you want to see latex images,
place tags like <br>
<img alt=<b>"</b>tex:<i>any latex math expression</i><b>"</b>><br>
For comparison, <br>
<img alt="tex: f(x) = \frac1{\sigma\sqrt{2\pi}} <br>
\int_{-\infty}^x e^{-\frac{(t-\mu)^2}{2\sigma^2}}dt"> <br>
looks like </p>
<center>
<table>
<tr align="center">
<td> <font size="4">mathtran</font> </td>
<td> <img src="../cgi-bin/mimetex.cgi?\hspace{30}"
alt="" border=0> </td>
<td> <font size="4">mimeTeX</font> </td>
</tr>
<tr align="center">
<td> unavailable
<!-- img alt="tex:\displaystyle f(x) = \frac1{\sigma\sqrt{2\pi}}
\int_{-\infty}^x e^{-\frac{(t-\mu)^2}{2\sigma^2}}dt" --> <br> </td>
<td> </td>
<td>
<a href="#preview"><img id="imageP3" onclick="eqntext('imageP3')"
src="../cgi-bin/mimetex.cgi?\large
f(x)={\Large\frac1{\sigma\sqrt{2\pi}}}
\int_{\small-\infty}^xe^{-\small\frac{(t-\mu)^2}{2\sigma^2}}dt"
alt="" border=0 align=middle></a> </td>
</tr>
</table>
</center>
<!--
<p> The remainder of this introductory mimeTeX tutorial section contains </p>
<ul>
<li> First, a concise <a href="#quickstart">Quickstart</a> providing
just enough information for you to try rendering your own
expressions by <a href="#preview">Submitting Queries</a>
right from this page. </li>
<li> Then, a variety of additional <a href="#examples">Examples</a>
that more fully illustrate mimeTeX's capabilities
(later on, Section III comprises a more complete mimeTeX
<a href="#reference">Syntax Reference</a>). </li>
<li> Finally, the <a href="#gpl">gpl</a> license, whose terms
and conditions you must agree to before using mimeTeX.</li>
</ul>
-->
<p> You may now want to browse the additional <a href="#examples">Examples</a>
below before proceeding, to make sure mimeTeX suits your needs before you
spend more time learning to use it. </p>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
QUICKSTART
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h2> <a name="quickstart"> (Ia) Quick Start </a> </h2>
<p> <!-- Unlike MathML, --> MimeTeX is as TeX-like as possible (though
not 100% compliant), and you must already be familiar with LaTeX
math markup to use it. If you're not, many online LaTeX
<a href="http://www.tug.org/begin.html#doc" target="_top">turorials</a>
are readily available. You may also want to browse Andrew Roberts'
<a href="http://www.andy-roberts.net/misc/latex/latextutorial9.html"
target="_top">Latex Math I</a> and
<a href="http://www.andy-roberts.net/misc/latex/latextutorial10.html"
target="_top">Latex Math II</a>, or my own
<a href="http://www.forkosh.com/mimetextutorial.html" target="_top">
LaTeX math tutorial</a>.
Then, instead of continuing to read this page, you can <!-- may prefer
to play with mimeTeX yourself. In that case, --> just Submit any LaTeX
math expression you like in the Query Box below. I've started
you out with a little example already in the box, or <!-- , instead, -->
you can Click any of the <a href="#examples">Examples</a> below
to place that corresponding expression in the Query Box. </p>
<p> Meanwhile, here are just a few quickstart tips for Submitting
your own mimeTeX expressions in the Query Box below: </p>
<ul>
<li> MimeTeX currently has eight font sizes selected by
one of the usual directives <b>\tiny</b>
or <b>\small</b> or <b>\normalsize</b> ,
or <b>\large</b> (default) or <b>\Large</b>
or <b>\LARGE</b> , or <b>\huge</b> or <b>\Huge</b> .
Unlike standard LaTeX, font size directives may
appear within math mode expressions. They affect everything
to their right, except that their scope will be limited to any
<b>{ }</b>-enclosed subexpression in which they occur.
For example, "<b>a+\small b+c</b>"
renders
<a href="#preview"> <img id="imageBu" onclick="eqntext('imageBu')"
src="../cgi-bin/mimetex.cgi?\large a+\small b+c"
alt="" border=0 style="Vertical-Align:-2px"></a>,
whereas "<b>\small a+{\Large b+}c</b>"
renders
<a href="#preview"> <img id="imageBv" onclick="eqntext('imageBv')"
src="../cgi-bin/mimetex.cgi?\small a+{\Large b+}c"
alt="" border=0 style="Vertical-Align:-2px"></a>. </li>
<!-- <li> At smaller font sizes, try preceding your expression with
<b>\light</b> which adjusts mimeTeX's anti-aliasing
parameters to produce thinner lines that you may feel are
more legible, e.g.,<br>
<a href="#preview"><img id="imageIA1" onclick="eqntext('imageIA1')"
src="../cgi-bin/mimetex.cgi?\light\small\displaystyle
e^x=\sum_{n=0}^\infty\frac{x^n}{n!}" alt="" border=0
align=middle> </a>   versus
<a href="#preview"><img id="imageIA2" onclick="eqntext('imageIA2')"
src="../cgi-bin/mimetex.cgi?\small\displaystyle
e^x=\sum_{n=0}^\infty\frac{x^n}{n!}" alt="" border=0
align=middle> </a> </li> -->
<li> <!-- For displaystyle math mode limits illustrated above,
write either
<b>\displaystyle e^x=\sum_{n=0}^\infty\frac{x^n}{n!}</b>
or <b>e^x=\sum\limits_{n=0}^\infty\frac{x^n}{n!}</b>
in the usual way (ditto for <b>\int</b>, <b>\prod</b>,
<b>\cup</b>, <b>\cap</b>, etc). --> <!-- MimeTeX also recognizes
<b>\Bigint</b>, <b>\Bigsum</b>, <b>\Bigprod</b>, and several
similar extra symbols which are a little bigger, and which
automatically render displaystyle limits. -->
<!-- MimeTeX default-renders limits displaystyle at sizes
<b>\large</b> and larger (see the <b>-DDISPLAYSIZE=<i>n</i></b>
<a href="#options">compile option</a> below to change the
default). <b>\textstyle</b> overrides this default for
your entire expression, or <b>\nolimits</b> overrides it
for a single operator. -->
By default, mimeTeX renders limits textstyle
<a href="#preview"> <img id="imageB1" onclick="eqntext('imageB1')"
src="../cgi-bin/mimetex.cgi?\normalsize\textstyle
\sum_{n=0}^\infty\frac{x^n}{n!}" alt="" border=0
style="Vertical-Align:-5px"></a>
at sizes <b>\normalsize</b> and smaller,
and renders them displaystyle
<a href="#preview"> <img id="imageB2" onclick="eqntext('imageB2')"
src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
\sum_{n=0}^\infty\frac{x^n}{n!}" alt="" border=0
style="Vertical-Align:-15px"></a>
at sizes <b>\large</b> and larger.
The LaTeX directives <b>\displaystyle</b> or <b>\textstyle</b>,
and <b>\limits</b> or <b>\nolimits</b>, override mimeTeX's default
in the usual way. Or see the <b>-DDISPLAYSIZE=<i>n</i></b>
<a href="#options">compile option</a> below to change
the default. </li>
<!-- <li> As discussed in the <a href="#introduction">Introduction</a>,
you can replace cumbersome <img> tags with your own custom
tags or wrapper scripts. </li> -->
<li> <!-- And --> There are occasional exceptions where I couldn't
program mimeTeX to recognize valid LaTeX syntax.
One particular "gotcha" is that mimeTeX bindings
are pretty much left-to-right. Thus, for example, although
mimeTeX correctly interprets <b>\frac12</b> as well as
<b>\frac1{x^2}</b>, etc, the legal LaTeX expression
<b>x^\frac12</b> must be written <b>x^{\frac12}</b>.
Otherwise, mimeTeX interprets it as <b>{x^\frac}12</b>, i.e.,
the same way <b>x^\alpha12</b> would be interpreted, which is
nonsense for <b>\frac</b>. The same "gotcha" also applies to
other combinations of commands, e.g., you must write
<b>\sqrt{\frac\alpha\beta}</b>, or
<b>\frac\alpha{\sqrt\beta}</b>, etc.
The <a href="#reference">Syntax Reference</a> section
contains much additional information. <!-- Or you can just begin
playing with mimeTeX for yourself to see if it might have
any potential usefulness for you. --> </li>
<li> And there are various additional syntactic and cosmetic
differences between LaTeX and mimeTeX. For example,
bounding boxes for mimeTeX's character bitmaps don't
accommodate italic corrections. Therefore, an expression
like <b>\int\nolimits_a^b</b> renders
<a href="#preview"><img id="gotcha1" onclick="eqntext('gotcha1')"
src="../cgi-bin/mimetex.cgi?
\normalsize\displaystyle\int\nolimits_a^b"
alt="" border=0 align=middle></a> rather than
<a href="#preview"><img id="gotcha2" onclick="eqntext('gotcha2')"
src="../cgi-bin/mimetex.cgi?
\normalsize\displaystyle\smashmargin{2}{\int\nolimits_a}^b"
alt="" border=0 align=middle></a><b>.</b>
To render the latter image you have to write the somewhat
cumbersome expression <b>{\smashmargin2{\int\nolimits_a}^b}</b>
instead (see <a href="#smash">smash</a> below). </li>
<li> Besides such exceptions, mimeTeX
also provides various LaTeX extensions <!-- , i.e., LaTeX errors
permitted by mimetex. --> (such as font size
directives like <b>\Large</b> permitted within mimeTeX
math mode expressions, as discussed above).
<!-- , but flagged as errors by LaTeX. -->
<!-- But note well: if you take advantage of mimeTeX extensions,
your math mode expressions will no longer be accepted by
standard TeX engines. --> </li>
</ul>
<p> <a name="forminput"> </a> <a name="preview"> </a>
Now enter your own LaTeX expression, use the sample provided,
or Click any of the <a href="#examples">Examples</a>.
Then press the Submit button, and mimeTeX's rendering should be
displayed in the little window immediately below it. </p>
<center>
<table border="2" cellpadding="5" cellspacing="0">
<tr align="center"><td>
<form name="expression" action="../cgi-bin/mimetex.cgi"
method="get" target="inlineframe">
<table border="0" cellpadding="0" cellspacing="1">
<tr align="left"><td align="center">
<b>First enter your own LaTeX expression,
or Click any example...</b> <br>
<textarea name="formdata" rows="5" cols="72"
>\Large f(x)=\int_{-\infty}^x e^{-t^2}dt</textarea> <br>
</td></tr>
<tr align="center"><td>
<font size="-1"> <input type="button" onClick="cleartext()"
value="Clear Expression">
<input type="submit" value="Submit Expression"> </font>
</td></tr>
</table>
</form> </td></tr> <tr align="left"><td align="center">
<b>Now click Submit to see it rendered below...</b> <br>
<iframe name="inlineframe" align="middle" width="85%" height="110">
<p>iframe's not supported if you see this.</p>
</iframe>
</td></tr>
</table>
</center>
<p> You should see
<a href="#preview"><img id="imageIA3" onclick="eqntext('imageIA3')"
src="../cgi-bin/mimetex.cgi?\normalsize
f(x)=\int\limits_{-\infty}^x e^{-t^2}dt"
alt="" border=0 style="Vertical-Align:-11px"></a>
if you submit the sample expression already in the box.
Or see <a href="#messages">error messages</a> whenever an
unexpected image is displayed instead. And (as discussed
above) the <img> tag to embed this same integral anywhere
in your own document is <br>
<nobr><b>
<img
src="../cgi-bin/mimetex.cgi?f(x)=\int_{-\infty}^xe^{-t^2}dt" ></b></nobr><br>
</p>
<!-- p class="continue">
And recall that the typical mimeTeX <img> tag has the form </p>
<pre> <img src="../cgi-bin/mimetex.cgi?any valid LaTeX/mimeTeX expression"
alt="" border=0 align=middle></pre> <p class="continue">
where <b>../cgi-bin/mimetex.cgi</b> is the relative path from your html
page containing these tags to your compiled mimetex.cgi program, and
where <b>any valid LaTeX/mimeTeX expression</b>
is pretty much any valid LaTeX math expression: </p -->
<!-- ++++++++
<h3> <a name="errormessages">
Error messages<font size=5>...</font></a> </h3>
<p> Any (La)TeX error is typically also a mimeTeX error.
However, mimeTeX has no command line interface or
<b>.</b>log file for reporting errors. Its only
communication with you is through the mimeTeX image
rendered by your browser. So error messages are embedded
in that image whenever feasible. For example,
suppose you want to see
<a href="#preview"><img id="messages1" onclick="eqntext('messages1')"
src="../cgi-bin/mimetex.cgi?\normalsize\alpha\beta\gamma\delta"
alt="" border=0 align="bottom"></a>
but you mistakenly type <b>\alpha\bethe\gamma\delta</b>
instead. Then the image rendered is
<a href="#preview"><img id="messages2" onclick="eqntext('messages2')"
src="../cgi-bin/mimetex.cgi?\normalsize\alpha\bethe\gamma\delta"
alt="" border=0 align="bottom"></a>
indicating the unrecognized <b>[\bethe?]</b> where you wanted to type
<b>\beta</b> and had hoped to see
<a href="#preview"><img id="messages3" onclick="eqntext('messages3')"
src="../cgi-bin/mimetex.cgi?\normalsize\bf\beta"
alt="" border=0 align="bottom"></a><b>.</b>
If your expression contains some unprintable character
(meaning any character mimeTeX has no bitmap for),
then just
<a href="#preview"><img id="messages4" onclick="eqntext('messages4')"
src="../cgi-bin/mimetex.cgi?\small\bf[?]"
alt="" border=0 align="bottom"></a>
is displayed in the corresponding position. </p>
<p> The preceding example illustrates a pretty trivial error.
Any non-trivial errors in your expression are likely to
go unrecognized and unreported by mimeTeX, and to render
unexpected images. While checking your input expression
for syntax errors, keep in mind the following points
about mimeTeX's behavior: </p>
<ul>
<li> An unmatched left brace <b>{</b> is matched
by mimeTeX with a "phantom" right brace <b>}</b>
that's imagined to be at the end of your expression. </li>
<li> Likewise, an unmatched <b>\left(</b>,
or <b>\left\{</b> or <b>\left\</b><i>anything</i>,
is matched by mimeTeX with a "phantom" <b>\right.</b>
at the end of your expression. </li>
<li> On the other hand, an unmatched right brace <b>}</b>
is displayed in place, as if you had typed \rbrace. </li>
<li> But an unmatched <b>\right\</b><i>anything</i>
is interpreted as an
<a href="http://www.forkosh.com/mimetexmanual.html?abbreviations"
target="_top">abbreviation</a> for <b>\</b>rightarrow
followed by <b>\</b><i>anything</i>. For example,
<b>\leff( abc \right) def</b> renders
<a href="#preview"><img id="messages5"
onclick="eqntext('messages5')"
src="../cgi-bin/mimetex.cgi?\small\leff(abc\right)def"
alt="" border=0 align="bottom"></a>.
</li>
</ul>
++++++++ -->
<!-- ++++++++
<h3> <a name="infomessages">
Informational messages<font size=5>...</font></a> </h3>
<p> The latest release of mimeTeX is version
<a href="#preview"><img id="messages11" onclick="eqntext('messages11')"
src="../cgi-bin/mimetex.cgi?\small\versionnumber"
alt="" border=0 align="bottom"></a>
which was last revised
<a href="#preview"><img id="messages12" onclick="eqntext('messages12')"
src="../cgi-bin/mimetex.cgi?\small\revisiondate"
alt="" border=0 align="bottom"></a>.
The special mimeTeX directive <b>\version</b>
displays that same information, </p>
<center>
<a href="#preview"><img id="messages13" onclick="eqntext('messages13')"
src="../cgi-bin/mimetex.cgi?\version"
alt="" border=0 align=middle></a>
</center>
<p> To check that your own release of mimeTeX is current,
type a url into your browser's locator window something like <br>
<b>http://www.<i>yourdomain</i>.com/cgi-bin/mimetex.cgi?\version</b> <br>
which will display the version and revision date of
mimeTeX installed on your server. </p>
++++++++ -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
EXAMPLES
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h2> <a name="examples"> (Ib) Examples </a> </h2>
<p> Here are various additional random examples further illustrating
mimeTeX's features and usage. To see how they're done, Click any
one of them to place its corresponding expression in the
<a href="#preview">Query Box</a> above. Then press Submit
to re-render it, or you can edit the expression first to suit
your own purposes. </p>
<table cellspacing=15>
<!-- first example: taylor series for e^x at various font sizes and colors
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<tr>
<td>
<font size=5><a name="example1">(1)</a></font> </td>
<td align="left" colspan=4>
<a href="#preview">
<img id="example1a" onclick="eqntext('example1a')"
src="../cgi-bin/mimetex.cgi?\red\normalsize\displaystyle
e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
alt="" border=0 align=middle></a>    
<a href="#preview">
<img id="example1b" onclick="eqntext('example1b')"
src="../cgi-bin/mimetex.cgi?\green\large\displaystyle
e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
alt="" border=0 align=middle></a>    
<a href="#preview">
<img id="example1c" onclick="eqntext('example1c')"
src="../cgi-bin/mimetex.cgi?\blue\Large
e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
alt="" border=0 align=middle></a>    
<a href="#preview">
<img id="example1d" onclick="eqntext('example1d')"
src="../cgi-bin/mimetex.cgi?\reverse\opaque
\LARGE e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
alt="" border=0 align=middle></a>    
<a href="#preview">
<img id="example1e" onclick="eqntext('example1e')"
src="../cgi-bin/mimetex.cgi?\LARGE
e^x=\lim_{n\to\infty} \left(1+\frac xn\right)^n"
alt="" border=0 align=middle></a>
</td>
</tr>
<!-- second example
+++++++++++++++++++ -->
<tr>
<td>
<font size=5>(2)</font> </td>
<td align="left" colspan=4>
<a href="#preview">
<img id="example2" onclick="eqntext('example2')"
src="../cgi-bin/mimetex.cgi?\Large\frac{dv^m}{ds}=-\Gamma^m_{oo}v^{o^2}
=-g^{mn}\Gamma_{noo}v^{o^2}=\frac12g^{mn}g_{oo,n}v^{o^2}"
alt="" border=0 align=middle></a> </td>
</tr>
<!-- third example
++++++++++++++++++ -->
<tr>
<td>
<font size=5>(3)</font> </td>
<td align="left" colspan=4>
<a href="#preview">
<img id="example3" onclick="eqntext('example3')"
src="../cgi-bin/mimetex.cgi?\Large\varepsilon=\sum_{i=1}^{n-1}
\frac1{\Delta x}\int_{x_i}^{x_{i+1}}\left\{\frac1{\Delta x}\big[
(x_{i+1}-x)y_i^\ast+(x-x_i)y_{i+1}^\ast\big]-f(x)\right\}^2dx"
alt="" border=0 align=middle></a> </td>
</tr>
<!-- fourth example: solution to quadratic, definition of derivative
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<tr>
<td>
<font size=5>(4)</font> </td>
<td align="left" colspan=4>
<table>
<tr>
<td align="left">
<a href="#preview">
<img id="example4a" onclick="eqntext('example4a')"
src="../cgi-bin/mimetex.cgi?\LARGE x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}"
alt="" border=0 align=middle></a> </td>
<td>
solution for quadratic </td>
</tr>
<tr> <td> <br> </td> </tr>
<tr>
<td align="left">
<a href="#preview">
<img id="example4b" onclick="eqntext('example4b')"
src="../cgi-bin/mimetex.cgi?\large f^\prime(x)\ =
\lim_{\Delta x\to0}\frac{f(x+\Delta x)-f(x)}{\Delta x}"
alt="" border=0 align=middle></a> </td>
<td>
definition of derivative </td>
</tr>
</table> </td>
</tr>
<!-- fifth example: continued fraction
+++++++++++++++++++++++++++++++++++++++ -->
<tr>
<td>
<font size=5>(5)</font> </td>
<td align="left">
<a href="#preview">
<img id="example5" onclick="eqntext('example5')"
src="../cgi-bin/mimetex.cgi?\LARGE f=b_o+\frac{a_1}{b_1+
\frac{a_2}{b_2+\frac{a_3}{b_3+a_4}}}"
alt="" border=0 align=middle></a> </td>
<td>
illustrating <b>\frac{}{}</b> for continued fraction </td>
</tr>
<!-- sixth example: demonstrating \left\{ ... \right.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<tr>
<td>
<font size=5>(6)</font> </td>
<td align="left">
<a href="#preview">
<img id="example6" onclick="eqntext('example6')"
src="../cgi-bin/mimetex.cgi?\LARGE\tilde y=\left\{
{\ddot x\text{ if \vec x odd}\atop\hat{\,\bar x+1}\text{ if even}}\right."
alt="" border=0 align=middle></a> </td>
<td>
illustrating <b>\left\{...\right<font size=5>.</font></b>
<!-- we may write <b>\{...\.</b> --> <br>
and note the accents </td>
</tr>
<!-- seventh example: demonstrating \overbrace \underbrace
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<tr>
<td>
<font size=5>(7)</font> </td>
<td align="center">
<a href="#preview">
<img id="example7" onclick="eqntext('example7')"
src="../cgi-bin/mimetex.cgi?\large\overbrace{a,...,a}^{\text{k a^,s}},
\underbrace{b,...,b}_{\text{l b^,s}}\hspace{10}
\normalsize\underbrace{\overbrace{a...a}^{\text{k a^,s}},
\overbrace{b...b}^{\text{l b^,s}}}_{\text{k+l elements}}"
alt="" border=0 align=middle></a> </td>
<td>
<b>\overbrace{}^{}</b> and <b>\underbrace{}_{}</b> <br>
(TeXbook page 181, Exercise 18.41) </td>
</tr>
<!-- eighth example: demonstrating \begin{array}
+++++++++++++++++++++++++++++++++++++++++++++++++ -->
<tr>
<td>
<font size=5>(8)</font> </td>
<td align="left" colspan=3>
<table>
<tr>
<td align="left" colspan=2>
<a href="#preview">
<img id="example8a" onclick="eqntext('example8a')"
src="../cgi-bin/mimetex.cgi?\large\scr{J}^{i0}=+\frac i2
\left[\begin{array}{cc}\sigma_i&0\\0&-\sigma_i\end{array}\right]
\hspace{10}\scr{J}^{ij}=\frac12\varepsilon_{ijk}
\left[\begin{array}{cc}\sigma_k&0\\0&\sigma_k\end{array}\right]"
alt="" border=0 align=middle> </a> </td>
</tr>
<tr> <td> <br> </td> </tr>
<tr>
<td align="left">
<a href="#preview">
<img id="example8b" onclick="eqntext('example8b')"
src="../cgi-bin/mimetex.cgi?\large A\ =\ \normalsize\left(
\begin{array}{c.cccc}&1&2&\cdots&n\\
\hdash1&a_{11}&a_{12}&\cdots&a_{1n}\\
2&a_{21}&a_{22}&\cdots&a_{2n}\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
n&a_{n1}&a_{n2}&\cdots&a_{nn}\end{array}\right)"
alt="" border=0 align=middle></a> </td>
<td>
demonstrating <a href="#array">\begin{array}</a>'s dashed lines </td>
</tr>
</table> </td>
</tr>
<!-- ninth example: block diagonal form using nested arrays
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<tr>
<td>
<font size=5><a name="example9">(9)</a></font> </td>
<td align="left" colspan="2">
<a href="#preview">
<img id="example9c" onclick="eqntext('example9c')"
src="../cgi-bin/mimetex.cgi?\large
\left(\large\begin{array}{GC+45}
\varepsilon_x\\\varepsilon_y\\\varepsilon_z\\\gamma_{xy}\\
\gamma_{xz}\\\gamma_{yz}\end{array}\right)\ {\large=}
\ \left[\begin{array}{CC}
\begin{array}\frac1{E_{\fs{+1}x}}
&-\frac{\nu_{xy}}{E_{\fs{+1}x}}
&-\frac{\nu_{\fs{+1}xz}}{E_{\fs{+1}x}}\\
-\frac{\nu_{yx}}{E_y}&\frac1{E_{y}}&-\frac{\nu_{yz}}{E_y}\\
-\frac{\nu_{\fs{+1}zx}}{E_{\fs{+1}z}}&
-\frac{\nu_{zy}}{E_{\fs{+1}z}}
&\frac1{E_{\fs{+1}z}}\end{array} & {\LARGE 0} \\
{\LARGE 0} & \begin{array}\frac1{G_{xy}}&&\\
&\frac1{G_{\fs{+1}xz}}&\\&&\frac1{G_{yz}}\end{array}
\end{array}\right]
\ \left(\large\begin{array}
\sigma_x\\\sigma_y\\\sigma_z\\\tau_{xy}\\\tau_{xz}\\\tau_{yz}
\end{array}\right)"
alt="" border=0 align=middle></a> </td>
<td align="left">
Block diagonal form using nested <b>\begin{array}</b>'s.<br>
Also, note rows aligned across all three arrays.
</td>
</tr>
<!-- tenth example: demonstrating \begin{eqnarray} to align equations
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<tr>
<td>
<font size=5>(10)</font> </td>
<td align="center">
<a href="#preview">
<img id="example10" onclick="eqntext('example10')"
src="../cgi-bin/mimetex.cgi?\large\left.\begin{eqnarray}
x+y+z&=&3\\2y&=&x+z\\2x+y&=&z\end{eqnarray}\right\}"
alt="" border=0 align=middle></a> </td>
<td>
using <a href="#array">\begin{eqnarray}</a> to align equations </td>
</tr>
<!-- eleventh example: demonstrating commutative diagram
using \longxxxarrow[] and \begin{array}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<tr>
<td>
<font size=5>(11)</font> </td>
<td align="center">
<a href="#preview">
<img id="example11" onclick="eqntext('example11')"
src="../cgi-bin/mimetex.cgi?\Large\begin{array}{rccclBCB}
&f&\longrightarrow[75]^{\alpha:{\normalsize f\rightarrow g}}&g\\
\large\gamma&\longdownarrow[50]&&\longdownarrow[50]&\large\gamma\\
&u&\longrightarrow[75]_\beta&v\end{array}"
alt="" border=0 align=middle></a> </td>
<td>
commutative diagram using <a href="#array">\begin{array}</a> </td>
</tr>
<!-- twelfth example: demonstrating \picture
+++++++++++++++++++++++++++++++++++++++++++++ -->
<tr>
<td>
<font size=5>(12)</font> </td>
<td align="left">
<a href="#preview">
<img id="example12" onclick="eqntext('example12')"
src="../cgi-bin/mimetex.cgi?\large\hspace{5}\unitlength{1}
\picture(175,100){ (50,50){\circle(100)}
(1,50){\overbrace{\line(46)}^{3$\;\;a}}
(52,50){\line(125)} (50,52;115;2){\mid} (52,55){\longleftar[60]}
(130,56){\longrightar[35]} (116,58){\small r}
(c85,50;80;2){\small\bullet} (c85,36){\small -q} (c165,36){\small q}
(42,29){\underbrace{\line(32)}_{\scriptsize a^2/r\;\;\;}} }"
alt="" border=0 align=middle></a> </td>
<td valign="middle">
mimeTeX <a href="#picture">\picture(size){pic_elems}</a>
"environment", illustrating the image charge <b>- q</b>
for a grounded conducting sphere of radius <b>a</b> with
a charge <b>q</b> at distance <b>r > a</b> outside it. </td>
</tr>
<!-- thirteenth example: demonstrating \picture
+++++++++++++++++++++++++++++++++++++++++++++++++ -->
<tr>
<td>
<font size=5>(13)</font> </td>
<td align="left">
<a href="#preview">
<img id="example13" onclick="eqntext('example13')"
src="../cgi-bin/mimetex.cgi?\small\hspace{10}\unitlength{.75}
\picture(120,220){ (60,200){\circle(120,40)} (0,20){\line(0,180)}
(5,189;0,-30){\pict(110,20){(c20,10;70;2){
\pict(40,20){(20,10){\circle(40,20)}(c10,10)+(c30,10)-}} } }
(119,20){\line(0,180)} (60,20){\circle(120,40;34)}}"
alt="" border=0 align=middle></a> </td>
<td valign="middle"> <a href="#picture">\picture</a> "environment"
illustrating the surface polarization charge induced by a uniform
electric field. Inside the slab of material, the volume polarization
charge clearly vanishes. <br><br> The little
<img src="../cgi-bin/mimetex.cgi?\small\unitlength{.75} \pict(40,20){(20,10)
{\circle(40,20)}(c10,10)+(c30,10)-}" alt="" border=0 align=middle>
dipole image is drawn only once, then multiput across two columns, and
then that result is further multiput down the rows. MimeTeX \picture's
can be used as picture elements in other pictures, nested to any level.
The image at left is picture-in-picture-in-picture. </td>
</tr>
</table>
<!-- font examples
++++++++++++++++++ -->
<!-- font-size-examples-commented-out ---
<br><br>
<h3> Some font examples <font size=5>...</font></a> </h3>
<p> Finally, illustrated below are some examples of fonts and symbols
available with mimeTeX. All symbols and sizes from cmr, cmmi,
cmmib (use <b>\mathbf{ }</b>), cmsy, cmex, bbold (use
<b>\mathbb{ }</b>), rsfs (use <b>\mathscr{ }</b>),
stmary and cyrillic wncyr (use <b>{\cyr }</b> or
<b>\cyr{ }</b>) should be available, but they're not all shown.
And also not shown are various "constructed symbols" like \sqrt,
accents, etc. The illustrated font sizes are numbered 4=\Large,
3=\large and 2=\normalsize (not shown are 7=\Huge, 6=\huge,
5=\LARGE, 1=\small and 0=\tiny). </p>
<h3>cmmi latin uppercase, and lowercase</h3>
<p> <img src="../cgi-bin/mimetex.cgi?\array{r$
2$\rm~size~4:~&4$A&4$B&4$C&4$D,&4$a&4$b&4$c&4$d\\
2$\rm~3:~&3$E&3$F&3$G&3$H&3$I&3$J&3$K&3$L,&3$e&3$f&3$g&3$h&3$i&3$j&3$k&3$l\\
2$\rm~2:~&2$M&2$N&2$O&2$P&2$Q&2$R&2$S&2$T&2$U&2$V&2$W&2$X&2$Y&2$Z,&
2$m&2$n&2$o&2$p&2$q&2$r&2$s&2$t&2$u&2$v&2$w&2$x&2$y&2$z}"
alt="" border=0 align=middle> </p>
<h3>calligraphic, and rsfs (<b>\cal{A}, \scr{B}, etc</b>)</h3>
<p> <img src="../cgi-bin/mimetex.cgi?\array{r$
2$\rm~size~4:~&4$\calA&4$\calB&4$\calC&4$\calD&4$\calE&4$\calF&4$\calG,&
4$\scrA&4$\scrB&4$\scrC&4$\scrD&4$\scrE&4$\scrF&4$\scrG\\
2$\rm~3:~&3$\calH&3$\calI&3$\calJ&3$\calK&3$\calL&3$\calM&3$\calN&3$\calO&
3$\calP,&
3$\scrH&3$\scrI&3$\scrJ&3$\scrK&3$\scrL&3$\scrM&3$\scrN&3$\scrO&3$\scrP\\
2$\rm~2:~&2$\calQ&2$\calR&2$\calS&2$\calT&2$\calU&
2$\calV&2$\calW&2$\calX&2$\calY&2$\calZ,&
2$\scrQ&2$\scrR&2$\scrS&2$\scrT&2$\scrU&2$\scrV&2$\scrW&
2$\scrX&2$\scrY&2$\scrZ}"
alt="" border=0 align=middle> </p>
<h3>cmmi greek uppercase, and \var lowercase</h3>
<p> <img src="../cgi-bin/mimetex.cgi?\array{r$
2$\rm~size~4:~&4$\Gamma&4$\Delta&4$\Theta&4$\Lambda&4$\Xi&4$\Pi&4$\Sigma&
4$\Upsilon&4$\Phi&4$\Psi&4$\Omega,&4$\rm~~&4$\varepsilon&4$\vartheta&4$\varpi&
4$\varrho&4$\varsigma&4$\varphi\\
2$\rm~3:~&3$\Gamma&3$\Delta&3$\Theta&3$\Lambda&3$\Xi&3$\Pi&3$\Sigma&
3$\Upsilon&3$\Phi&3$\Psi&3$\Omega,&~&3$\varepsilon&3$\vartheta&3$\varpi&
3$\varrho&3$\varsigma&3$\varphi\\
2$\rm~2:~&2$\Gamma&2$\Delta&2$\Theta&2$\Lambda&2$\Xi&2$\Pi&2$\Sigma&
2$\Upsilon&2$\Phi&2$\Psi&2$\Omega,&~&2$\varepsilon&2$\vartheta&2$\varpi&
2$\varrho&2$\varsigma&2$\varphi}"
alt="" border=0 align=middle> </p>
<h3>cmmi greek lowercase</h3>
<p> <img src="../cgi-bin/mimetex.cgi?\array{r$
2$\rm~size~4:~&4$\alpha&4$\beta&4$\gamma&4$\delta&4$\epsilon&4$\zeta&
4$\eta&4$\theta&4$\iota&4$\kappa&4$\lambda&4$\mu&4$\nu&4$\xi&4$%%\omicron%%&
4$\pi&4$\rho&4$\sigma&4$\tau&4$\upsilon&4$\phi&4$\chi&4$\psi&4$\omega\\
2$\rm~3:~&3$\alpha&3$\beta&3$\gamma&3$\delta&3$\epsilon&3$\zeta&
3$\eta&3$\theta&3$\iota&3$\kappa&3$\lambda&3$\mu&3$\nu&3$\xi&3$%%\omicron%%&
3$\pi&3$\rho&3$\sigma&3$\tau&3$\upsilon&3$\phi&3$\chi&3$\psi&3$\omega\\
2$\rm~2:~&2$\alpha&2$\beta&2$\gamma&2$\delta&2$\epsilon&2$\zeta&
2$\eta&2$\theta&2$\iota&2$\kappa&2$\lambda&2$\mu&2$\nu&2$\xi&2$%%\omicron%%&
2$\pi&2$\rho&2$\sigma&2$\tau&2$\upsilon&2$\phi&2$\chi&2$\psi&2$\omega}"
alt="" border=0 align=middle> </p>
<h3>cmsy symbols at mimeTeX font size 3<br>
<font size="3">(operators shown large are automatically "promoted"<br>
to the larger size in \displaystyle mode)</font> </h3>
<p> <img src="../cgi-bin/mimetex.cgi?\array{3,r$1$\rm~chars~\\
1$\rm~0-15:~&-&\cdot&\times&\ast&\div&\diamond&\pm&\mp&
\oplus&\ominus&\otimes&\oslash&\odot&\bigcirc&\circ&\bullet\\
1$\rm~16-31:~&\asymp&\equiv&\subseteq&\supseteq&\leq&\geq&\preceq&\succeq&
\sim&\approx&\subset&\supset&\ll&\gg&\prec&\succ\\
1$\rm~32-47:~&\leftar&\rightar&\uparr&\downar&\leftrightar&\near&\sear&
\simeq&\Leftar&\Rightar&\Upar&\Downar&\Leftrightar&\nwar&\swar&\propto\\
1$\rm~48-63:~&\prime&\infty&\in&\ni&\triangle&\bigtriangledo&/&\'&
\forall&\exists&\neg&\emptyset&\Re&\Im&\top&\bot\\
1$\rm~64-100:~&\aleph&&\calA&4$.\,.\,.&\calZ&&\cup&\cap&
\uplus&\wedge&\vee&\vdash&\dashv&\lfloor&\rfloor&\lceil\\
1$\rm~101-116:~&\rceil&\lbrace&\rbrace&\langle&\rangle&\mid&\parallel&
\updownar&\Updownar&\setminus&\wr&\surd&\amalg&\nabla&\int&\sqcup\\
1$\rm~117-127:~&\sqcap&\sqsubseteq&\sqsupseteq&\S&\dag&\ddag&\P&\clubsuit&
\Diamond&\Heart&\spadesuit}" alt="" border=0 align=middle> </p>
<h3>a few other cmmi, cmr, stmary and wncyr symbols
at mimeTeX font size 4</h3>
<p> <img src="../cgi-bin/mimetex.cgi?\array{4,r$
1$\rm~cmmi:~&\leftharpoonup&\leftharpoondo&\rightharpoonup&\rightharpoondo&
\triangleright&\triangleleft&\star&\partial&
\flat&\natural&\sharp&\smile&\frown&\ell&\imath&\jmath&\wp&\vec\\
1$\rm~cmr:~&\ss&\ae&\oe&\AE&\OE \\
1$\rm~stmary:~&\moo&\Lbag&\Rbag&\lightning&\llbracket&\rrbracket&
\subsetpluseq&\supsetpluseq&\Yup&\Ydown\\
1$\rm~wncyr:~&\cyr A&\cyr a&\cyr B&\cyr b&\cyr V&\cyr v&\cyr G&\cyr g&
\cyr D&\cyr d&\cyr Dj&\cyr dj&\cyr\=E&\cyr\=e&\cyr Zh&\cyr zh}"
alt="" border=0 align=middle> </p>
--- end-of-font-size-examples-commented-out -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SCRIPTS & PLUGINS
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h2> <a name="scripts"> (Ic) Scripts & Plugins </a> </h2>
<p> Some useful scripts that automatically construct
mimeTeX <img> tags for you are illustrated below.
And you can also write your own scripts to simplify
the HTML notation required to incorporate mimeTeX
math images in your pages. </p>
<h3> <a name="plugins">
mimeTeX plugins<font size=5>...</font></a> </h3>
<!-- p> There's no inherent need to repeatedly write the cumbersome
<img> tag illustrated above. You can write your own <a href=
"http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro9.html#wp73314"
target="_top">custom tags</a>,
or write a wrapper script around mimeTeX to simplify the
notation. </p -->
<p style="margin-bottom:0"> <!-- For example, -->
The following javascript snippet (based on
<a href="http://www.mathtran.org" target="_top">mathtran</a>'s
<a href="http://www.mathtran.org/js/mathtran_img.js"
target="_top">mathtran_img.js</a>) lets you just write
<b><img alt="mimetex:c=\sqrt{a^2+b^2}"></b>
wherever you want to see <a href="#preview"><img id="imageJS1"
onclick="eqntext('imageJS1')" src="../cgi-bin/mimetex.cgi?
\normalsize c=\sqrt{a^2+b^2}" alt="" border=0
style="Vertical-Align:-1px"></a> </p>
<pre class="medium" style="margin-top:0;margin-bottom:0"
> <script type="text/javascript">
<!--
// Create a namespace to hold variables and functions
mimetex = new Object();
// Change this to use your server
mimetex.imgSrc = "http://www.<i>yourdomain</i>.com/cgi-bin/mimetex.cgi?";
// Transform the whole document: add src to each img with
// alt text starting with "mimetex:", unless img already has a src.
mimetex.init = function () {
if (! document.getElementsByTagName) return;
var objs = document.getElementsByTagName("img");
var len = objs.length;
for (i=0; i<len; i++) {
var img = objs[i];
if (img.alt.substring(0,8) == 'mimetex:')
if (!img.src) {
var tex_src = img.alt.substring(8);
img.src = mimetex.imgSrc + encodeURIComponent(tex_src);
// Append TEX to the class of the IMG.
img.className +=' tex'; }
}
mimetex.hideElementById("mimetex.error"); }
// Utility function
mimetex.hideElementById = function (id) {
var obj = document.getElementById(id);
if (obj) obj.style.display = 'none'; }
// resolve a cross-browser issue (see <a href="http://scottandrew.com/weblog/articles/cbs-events" target="_top">CBS events</a>)
mimetex.addEvent = function (obj, evType, fn, useCapture) {
if (obj.addEventListener) { //For Mozilla.
obj.addEventListener(evType, fn, useCapture);
return true; }
else if (obj.attachEvent) { //For Internet Explorer.
var r = obj.attachEvent("on"+evType, fn);
return r; }
}
// Initialize after entire document is loaded
mimetex.addEvent(window, 'load', mimetex.init, false);
-->
</script></pre>
<p style="margin-bottom:0">
Bulletin boards, wikis, etc, can also incorporate mimeTeX images
with short scripts. For example, if you're using
<a href="http://www.phpbb.com" target="_top">phpBB2</a>, then
<a href="http://www.themathforum.com/" target="_top">Jameson</a>
contributed the following typical one-line mod that lets you write
<b>[tex] c=\sqrt{a^2+b^2} [/tex]</b> to obtain the
same <a href="#preview"><img id="imageJS2"
onclick="eqntext('imageJS2')" src="../cgi-bin/mimetex.cgi?
\normalsize c=\sqrt{a^2+b^2}" alt="" border=0
style="Vertical-Align:-1px"></a> image illustrated above </p>
<pre class="medium" style="margin-top:0;margin-bottom:0"
> #--------[open]-----------------------------------------------------
/includes/bbcode.php
#--------[find]-----------------------------------------------------
// Remove our padding from the string..
#--------[before, add]----------------------------------------------
$text = preg_replace('/\[tex\](.*?)\[\/tex\]/ie',
"'<img src=\"/cgi-bin/mimetex.cgi?'.rawurlencode('$1').'\" align=\"middle\" />'",
$text);</pre>
<p class="continue" style="margin-top:0"> If you're using
<a href="http://www.phpbb.com" target="_top">phpBB3</a>,
then no mod is even needed.
Just click Postings from the Administrator Control Panel,
and add the custom BBCode <b>[tex]{TEXT}[/tex]</b>
with the HTML replacement
<b><img src="/cgi-bin/mimetex.cgi?{TEXT}" align=middle></b></p>
<p> Similarly, <a href="http://www.pmwiki.org/" target="_top">PmWiki</a>
also has a
<a href="http://www.pmwiki.org/wiki/Cookbook/MimeTeX" target="_top">
mimeTeX plugin</a> that lets you just write
<b>{$ f(x)=\int_{-\infty}^xe^{-t^2}dt $}</b>
to obtain that same image. Several other packages
also have similar mimeTeX plugins: </p>
<center><table>
<tr> <td align=center> <u> <b>Package</b> </u> </td>
<td> </td>
<td align=center> <u> <b>Plugin</b> </u> </td>
</tr>
<tr> <td align=center>
<a href="http://www.pmwiki.org" target="_top">
PmWiki</a> </td> <td> </td>
<td align=center>
<a href="http://www.pmwiki.org/wiki/Cookbook/MimeTeX"
target="_top">mimeTeX plugin</a> </td> </tr>
<tr> <td align=center>
<!-- a href="http://www.wikimedia.org/wiki/Main_Page" -->
<!-- a href="http://www.wikimediafoundation.org/wiki/Main_Page" -->
<a href="http://www.mediawiki.org/wiki/MediaWiki"
target="_top">MediaWiki</a> </td>
<td align=center> </td>
<td align=center>
<!-- a href="http://meta.wikimedia.org/wiki/Mimetex_alternative" -->
<a href="http://www.mediawiki.org/wiki/Mimetex_alternative"
target="_top">"mimeTeX alternative"</a> </td> </tr>
<!-- ***redirect loop***
<tr> <td align=center>
<a href="http://www.unitorganizer.com/mathwiki/index.php/Main_Page"
target="_top">MathWiki</a> </td> <td> </td>
<td align=center> <a href=
"http://www.unitorganizer.com/mathwiki/index.php/MimetexParser"
target="_top">"mimeTeX Parser"</a> </td> </tr>
-->
<tr> <td align=center>
<a href="http://forums.punbb.org/" target="_top">PunBB</a> </td>
<td> </td> <td align=center>
<a href="http://www.math-linux.com/spip.php?article44"
target="_top">mimeTeX plugin</a> </td> </tr>
<tr> <td align=center>
<!-- a href="http://www.sixapart.com/movabletype/" -->
<a href="http://www.movabletype.com/"
target="_top">Movable Type</a> </td> <td> </td>
<td align=center> <a href=
"http://www.unitorganizer.com/myblog/2006/08/creating_equations_in_movable.html"
target="_top">mimeTeX plugin</a> </td> </tr>
<tr> <td align=center>
<a href="http://wordpress.org/" target="_top">WordPress</a> </td>
<td> </td> <td align=center> <a href=
"http://www.anlak.com/?page_id=66" target="_top">
<!-- "http://sixthform.info/steve/wordpress/index.php?p=13&page=2" -->
mimeTeX plugin</a> <!-- (see item 9) --> </td> </tr>
<tr> <td align=center>
<a href="http://www.joomla.org/"
target="_top">Joomla</a> </td> <td> </td>
<td align=center> <a href=
"http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,5932/Itemid,35/"
target="_top">mimeTeX plugin</a> </td> </tr>
<tr> <td align=center>
<a href="http://mambo-foundation.org/"
target="_top">Mambo</a> </td> <td> </td>
<td align=center> <a href=
"http://webscripts.softpedia.com/script/Modules/Joomla-Mambo-Modules/MimeTeX-Bot-9250.html"
target="_top">"mimeTeX bot"</a> </td> </tr>
<!--- dead links --->
<!-- tr> <td align=center>
<a href="http://www.phpbb.com" target="_top">phpBB</a> </td>
<td> </td> <td align=center>
<a href=
"http://www.themathforum.com/math/showthread.php?p=621#post621"
target="_top">mimeTeX plugin</a> </td> </tr -->
<!-- tr> <td align=center>
<a href="http://www.mamboserver.com/" target="_top">Mambo</a> </td>
<td> </td> <td align=center>
<a href="http://mamboxchange.com/projects/mimetexbot/"
target="_top">"mimeTeX bot"</a> </td> </tr -->
</table></center>
<p> <b>Please note:</b> If you're writing your own plugin for mimeTeX,
please don't write php code using <b>system( )</b>, or any other
shell escape mechanism, just to cache images. Use mimeTeX's
<b>-DCACHEPATH=\"<i>path/</i>\"</b>
<a href="#options">compile option</a> instead.
<b>system( )</b> raises security
issues, either real ones if used carelessly, or just in the minds of
system administrators. Either way, I've received many emails from
people unable to use mimeTeX because of unnecessary <b>system( )</b>
calls prohibited by security-conscious sysadmins. MimeTeX itself poses
minimal risk when used as illustrated above, but you're responsible
for any plugin/wrapper script you write around it. </p>
<h3> <a name="valignment">
Vertical alignment<font size=5>...</font></a> </h3>
<p> An image like
<a href="#preview"><img id="imageAV1" onclick="eqntext('imageAV1')"
src="../cgi-bin/mimetex.cgi?
\normalsize f(x)=\int\limits_{-\infty}^xe^{-t^2}dt"
alt="" border=0 align=middle></a>
doesn't look as good as the same image
<a href="#preview"><img id="imageAV2" onclick="eqntext('imageAV2')"
src="../cgi-bin/mimetex.cgi?
\normalsize f(x)=\int\limits_{-\infty}^xe^{-t^2}dt"
alt="" border=0 style="Vertical-Align:-26px"></a>
that's vertically aligned with your surrounding text.
Along with several standard
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">
HTTP header fields</a>, mimeTeX also emits a special
<b>Vertical-Align: –<i>nn</i></b>
header, where <b>–<i>nn</i></b> is the number of pixels
(usually negative as illustrated) needed for a
<b>style="Vertical-Align: –<i>nn</i> px"</b>
attribute in the <b><img></b> tag used to
render your expression. This Vertical-Align: header
is obtained by placing the directive <b>\depth</b>
anywhere in your expression. </p>
<p> But mimeTeX's special Vertical-Align: header
is unrecognized and ignored by your browser. You have to get the
header, interpret it, and write the corresponding <img> tag.
The only feasible way to do all this is using a scripting language,
as illustrated by the following, rather naive, php code </p>
<pre class="medium" style="margin-top:.5em;margin-bottom:.5em"
> <?php
$mimetexurl = "http://www.<i>yourdomain</i>.com/cgi-bin/mimetex.cgi?";
function verticalalign( $expression ) {
global $mimetexurl;
// note: curl_init() stops at the first whitespace char in $url argument
$expression = ereg_replace(" ","~",$expression); // so remove whitespace
$url = $mimetexurl . "\depth~" . $expression;
$valign = "0";
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HEADER, true );
$gif = curl_exec( $ch );
$errno = curl_errno( $ch );
curl_close( $ch );
if ( $errno == 0 ) {
$fields = explode("Vertical-Align:",$gif);
$vfield = trim($fields[1]);
$fldlen = strspn($vfield,"+-0123456789");
$valign = substr($vfield,0,$fldlen); }
return $valign;
}
function mimetextag( $expression ) {
global $mimetexurl;
$valign = verticalalign($expression);
$url = $mimetexurl . "\depth~" . $expression;
echo ' <img src="',$url,'" ';
echo ' style="Vertical-Align:',$valign,'px" ';
echo ' alt="" border=0>', "\n";
}
?></pre>
<p> Now you can write
<?php mimetextag('\frac12\left(a^2+b^2\right)'); ?>
wherever you want to see
<a href="#preview"><img id="imageAV5" onclick="eqntext('imageAV5')"
src="../cgi-bin/mimetex.cgi?
\normalsize\frac12\left(a^2+b^2\right)"
alt="" border=0 style="Vertical-Align:-7px"></a>
correctly aligned. Note that the php code automatically
prepends <b>\depth</b> to your expression for you.
<!-- Besides making you escape backslashes
(each \ must be written \\), -->
(Also note that this code calls mimeTeX twice to render each
expression, once to get the Vertical-Align: header and build
an <img> tag, and then again to render that tag.
If you're a good php programmer and write better code,
please email me a copy.) </p>
<p> If you're using mimeTeX's
<b>-DCACHEPATH=\"<i>path</i>/\"</b>
<a href="#options">compile option</a>, you can request
that all images be cached with Vertical-Align: headers,
whether or not they contain the \depth directive. Prefix your
<b><i>path</i>/</b> with a leading <b>%</b> and write
<b>-DCACHEPATH=\"%<i>path</i>/\"</b> instead.
That leading <b>%</b> won't become part of your cache
directory's <b><i>path</i>/</b>, but it will signal mimeTeX
to cache headers along with each image. (In this case,
the directive <b>\nodepth</b> suppresses
mimeTeX's header caching for that image.)
<!-- Otherwise, the Vertical-Align: information is lost,
and attempts to align cached images will fail. --> </p>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GPL
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h2> <a name="gpl"> (Id) GPL License </a> </h2>
<font color="black">
<b>"</b><i>My grandfather once told me there are two kinds of people:<br>
    Those who do the work and those who take the credit.<br>
    He told me to try to be in the first group; there was much
less competition.</i><b>"</b><br>
Indira Gandhi, the late Prime Minister of India</font> <br>
<p> MimeTeX's copyright is registered by me with the US Copyright Office,
and I hereby license it to you under the terms and conditions of the
<a href="http://www.gnu.org/licenses/gpl.html" target="_top">GPL</a>.
There is no official support of any kind whatsoever,
and you use mimeTeX entirely at your own risk, with no guarantee
of any kind, in particular with no warranty of merchantability. </p>
<p> By using mimeTeX, you warrant that you have read, understood
and agreed to these terms and conditions, and that you <!-- are at least
18 years of age and --> possess the legal right and ability to enter
into this agreement and to use mimeTeX in accordance with it. </p>
<p> Hopefully, the law and ethics regarding computer programs will
evolve to make this kind of obnoxious banter unnecessary.
In the meantime, please forgive me my paranoia. </p>
<p> To protect your own intellectual property, I recommend (both are pdf)
<a href="http://www.copyright.gov/circs/circ01.pdf"
target="_top">Copyright Basics</a> from The Library of Congress,
in particular <a href="http://www.copyright.gov/circs/circ61.pdf"
target="_top">Circular 61</a>, Copyright Registration for
Computer Programs.
<!-- and similarly,
<a href="http://www.abanet.org/intelprop/comm106/106copy.html"
target="_top">Copyright Basics</a> from The American Bar Association. -->
Very briefly, download
<a href="http://www.copyright.gov/forms/formtxi.pdf">Form TX</a>
and follow the included instructions.
In principle, you automatically own the copyright
to anything you write the moment it's on paper. In practice,
if the matter comes under dispute, the courts look _very_ favorably
on you for demonstrating your intent by registering the copyright.
<!-- For example, courts will stop unauthorized use of unregistered
material, but monetary damages are awarded _only_ if you
register the copyright before infringement occurs. --> </p>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SECTION II. BUILDING MIMETEX
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h1> <a name="build"> (II) Building mimeTeX </a> </h1>
<!-- <center> -->
<table border="0" cellpadding="0" cellspacing="0">
<tr><td><center><hr size="2">Very quickly --- download
<a href="http://www.forkosh.com/mimetex.zip">
<!-- jfa <a href="ftp://ftp.tex.ac.uk/tex-archive/support/mimetex/mimetex.zip"></a> -->
mimetex.zip</a> and then type
<table border="0" cellpadding="0" cellspacing="0">
<tr align="left">
<td><img src="../cgi-bin/mimetex.cgi?\hspace{50}" alt="" border=0></td>
<td><b>unzip mimetex.zip</b> <br>
<b>cc -DAA mimetex.c gifsave.c -lm -o mimetex.cgi</b></td>
</tr></table>
Now <b>mv</b> mimetex.cgi to your <b>cgi-bin/</b>
directory, and you're all done. <br>
Read the rest of this section for more detailed
information.<hr size="2"></center></td>
<td><img src="../cgi-bin/mimetex.cgi?\hspace{150}" alt="" border=0></td>
</tr></table>
<!-- </center> -->
<p> I've built and run mimeTeX under Linux and NetBSD using gcc. The source
code is ansi-standard C, and should compile and run under all
environments without change. Instructions below
are for Unix. Modify them as necessary for your particular situation
(note the -DWINDOWS switch if applicable). </p>
<h2> <a name="compile"> (IIa) Download and Compile </a> </h2>
<p> The steps needed to download and compile mimeTeX are </p>
<ul>
<li> Download and unzip
<a href="http://www.forkosh.com/mimetex.zip">
<!-- jfa <a href="ftp://ftp.tex.ac.uk/tex-archive/support/mimetex/mimetex.zip"></a> -->
mimetex.zip</a> in any convenient working directory.
Your working directory should now contain <center>
<table cellpadding=0 cellspacing=0>
<tr><td width=100>README</td> <td>mimeTeX release notes</td></tr>
<tr><td>COPYING</td> <td>GPL license, under which you may use
mimeTeX</td></tr>
<tr><td>mimetex.c</td> <td>mimeTeX source program and all required
functions</td></tr>
<tr><td>mimetex.h</td> <td>header file for mimetex.c (and for
gfuntype.c)</td></tr>
<tr><td>gfuntype.c</td> <td>parses output from <b>gftype -i</b>
and writes bitmap data</td></tr>
<tr><td>texfonts.h</td> <td>output from several <b>gfuntype</b> runs,
needed by mimetex.c</td></tr>
<tr><td>gifsave.c</td> <td>gif library by Sverre H. Huseby
<a href="http://shh.thathost.com"
target="_top">http://shh.thathost.com</a>
</td></tr>
<tr><td>mimetex.html</td> <td>this file, the mimeTeX
user's manual</td></tr>
</table></center>
Note: all files use Unix line termination, i.e., linefeeds
(without carriage returns) signal line endings. Conversion for
Windows PC's, Macs, VMS, etc, can usually be accomplished by
unzip's -a option, i.e., unzip -a mimetex.zip
<br> <br> </li>
<li> To compile an executable that emits anti-aliased gif images
(which is recommended for most uses), just type the following
command from the Unix shell <br>
<b>cc -DAA mimetex.c gifsave.c -lm -o mimetex.cgi</b> </li>
<li> Or, to compile an executable that emit gif images
without anti-aliasing <br>
<b>cc -DGIF mimetex.c gifsave.c -lm -o mimetex.cgi</b> </li>
<li> Alternatively, to compile an executable that emits mime xbitmaps<br>
<b>cc -DXBITMAP mimetex.c -lm -o mimetex.cgi</b> </li>
<li> Compile Notes: <ul>
<li> If (and only if) you're compiling a Windows executable with
the <b>-DAA</b> or <b>-DGIF</b> option (but not -DXBITMAP), then
add <b>-DWINDOWS</b> . For example, <br>
<nobr> <b>gcc -DAA -DWINDOWS
mimetex.c gifsave.c -lm -o mimetex.exe</b> </nobr> <br>
The above Unix-like syntax works with
<a href="http://www.mingw.org" target="_top">MinGW</a> and
<a href="http://www.delorie.com/djgpp/" target="_top">djgpp</a>
Windows compilers, but probably not with most others,
where it's only intended as a "template". <br>
Explanation: mimeTeX writes gif bytes directly to stdout, as usual
for cgi's. But Windows treats stdout as a character stream,
interpreting any hex 0A byte as an <lf>, and automatically
preceding it with a spurious hex 0D <cr> byte. The
-DWINDOWS switch compiles in a non-portable, Windows-specific
_setmode() call that sets stdout to binary mode. </li>
<li> If you're compiling for Windows and would prefer
to install mimeTeX as a Win32 DLL, see the
<a href="http://www.codeproject.com/dotnet/Eq2Img.asp">
Code Project</a> developed by
<a href="http://www.shitalshah.com">Shital Shah</a>, and
download <a href="http://www.shitalshah.com/dev/eq2img_all.zip">
eq2img_all.zip</a> containing Shital's latest code. </li>
<li> If you install mimeTeX on one server and try to use it
from another, you may instead see messages like <br>
<img src="../cgi-bin/mimetex.cgi?\message{3}"
alt="" align="middle" border=0> <br>
In this case, compile mimetex.cgi with the -DNOREFCHECK switch,
<i>e.g.</i>,<br>
<nobr> <b>cc -DAA -DNOREFCHECK
mimetex.c gifsave.c -lm -o mimetex.cgi</b> </nobr> <br>
and read the -DREFLEVELS=<i>n</i> discussion under
<a href="#options">compile options</a> below. </li>
<!-- <li> If you're compiling on Sun or VMS, and see about a zillion
irritating warnings, try adding <b>-DSIGNEDCHAR</b>
(for VMS, that's cc/define=(AA,SIGNEDCHAR) mimetex.c) </li> -->
</ul> <br> </li>
<li> The gfuntype program is only needed if you plan to change the
font information in texfonts.h, as explained in
<a href="#fonts">Appendix IVa</a> below.
In that case, compile gfuntype with the command <br>
<b>cc gfuntype.c mimetex.c -lm -o gfuntype</b> </li>
</ul>
<p> That's all there is to compiling mimeTeX.
Several other optional compile-line <a href="#options">options</a>
available for mimetex.c are discussed below. </p>
<p> Immediately after compiling mimeTeX, test your new executable
by typing <b>./mimetex.cgi "x^2+y^2"</b>
from the Unix shell (or <b>mimetex "x^2+y^2"</b>
from the Windows Command Prompt), which should emit
two "ascii rasters" something like the following </p> <pre>
Ascii dump of bitmap image... Hex dump of colormap indexes...
...........**....................**... ..........1**1...................1**1..
..........*..*......*...........*..*.. ..........*23*......*............*23*..
.............*......*..............*.. .............*......*...............*..
....****.....*......*.....*..*.....*.. ...1****....2*......*.....2*..*....2*..
...*.*.*....*.......*....**..*....*... ...*.*.*...1*.......*.....**..*...1*...
.....*.....*.*..********..*..*...*.*.. ....1*1...2*.*..********..3*..*..2*.*..
.....*....****......*.....*..*..****.. ....2*2...****......*......*12*..****..
..*.*.*.............*.....*.*......... ..*.*.*.............*......*.*2........
...****.............*.....***......... ..1****.............*......***.........
....................*.......*......... ....................*........*.........
.........................*.*.......... ..........................*.*1.........
.........................**........... ..........................**1..........
The 5 colormap indexes denote rgb vals...
.-->255 1-->196 2-->186 3-->177 *-->0</pre>
<p class="continue"> <b>(</b>The right-hand illustration shows asterisks
in the same positions as the left-hand one, along with anti-aliased
grayscale colormap indexes assigned to neighboring pixels, and with
the rgb value for each index.<b>)</b> Just typing <b>./mimetex.cgi</b>
without an argument should produce ascii rasters for the default
expression <b>f(x)=x^2</b>. If you see these two ascii rasters then
your binary's good. Otherwise, you must find and fix the problem
before proceeding. </p>
<h2> <a name="install"> (IIb) Install </a> </h2>
<p> Once you've successfully tested mimetex.cgi from the Unix shell
(or mimetex.exe from the Windows Command Prompt),
the steps needed to install mimeTeX are </p>
<ul>
<li> <b>mv</b> mimetex.cgi (or <b>move</b> mimetex.exe)
to your server's <b>cgi-bin/</b> directory, wherever cgi
programs are expected. </li>
<li> Now you may need to <b>chmod 755 mimetex.cgi</b>
and/or <b>chown</b> it, too, depending on your server's
requirements. Contact your system administrator or ISP
if you're not already familiar with this information. </li>
<li> Once mimetex.cgi is moved to your server's <b>cgi-bin/</b>
directory, with permissions and owner set as necessary,
you're all done. </li>
</ul>
<p> Immediately after installing mimeTeX, test your new mimetex.cgi
by typing a url into your browser's locator window something like <br>
<b>http://www.<i>yourdomain</i>.com/cgi-bin/mimetex.cgi?x^2+y^2</b> <br>
which should display
<img src="../cgi-bin/mimetex.cgi?\normalsize x^2+y^2" alt="" border=0
style="Vertical-Align:-3px">
in the upper-left corner of your window,
just like clicking this link does, which tests my mimetex.cgi, <br>
<a href="http://www.forkosh.com/cgi-bin/mimetex.cgi?x^2+y^2"
target="_top">http://www.forkosh.com/cgi-bin/mimetex.cgi?x^2+y^2</a><br>
If you see the same <img src="../cgi-bin/mimetex.cgi?
\normalsize x^2+y^2" alt="" border=0 style="Vertical-Align:-3px">
image from the <b><i>yourdomain</i></b> link, then you've completed
a successful mimeTeX installation. </p>
<p> If you don't see the image, then your installation failed.
If your earlier post-compilation "ascii raster" test
succeeeded, then the problem is probably some server-specific
installation requirement. First make sure you installed mimetex.cgi
in the correct <b>cgi-bin/</b> directory, set the correct <b>chmod</b>
permissions, and typed the correct url into your browser's locator
window. Then contact your system administrator or ISP,
and ask how to install cgi programs on your server. </p>
<p> After you've successfully installed mimeTeX, and both preceeding tests
have succeeded, you can optionally "regression test"
all mimeTeX features as follows: </p>
<ul>
<li> <b>mv</b> mimetex.html (this file) to your server's
<b>htdocs/</b> directory </li>
<li> Paths to <b>cgi-bin/</b> and <b>htdocs/</b> directories
are typically <b><i>path</i>/www/cgi-bin/</b> and
<b><i>path</i>/www/htdocs/</b>, so I set up mimtex.html
to access mimetex.cgi from the relative path <b>../cgi-bin/</b>.
If your directories are non-conforming, you may have to edit
the few dozen occurrences of <b>../cgi-bin/mimetex.cgi</b>
in your mimetex.html page. Sometimes a suitable symlink works;
if not, you'll have to edit. Globally changing
<b>../cgi-bin/mimetex.cgi</b> usually works. </li>
<li> Now visit your page
<b>http://www.<i>yourdomain</i>.com/mimetex.html</b> </li>
<li> Once your mimetex.html displays properly, you can assume
everything is working, and can begin authoring html documents
using mimetex.cgi to render your own math. </li>
</ul>
<p> That's all there is to installing mimeTeX. </p>.
<h2> <a name="options"> (IIc) Additional Compile-Line Options </a></h2>
<p> In addition to -DAA or -DGIF or -DXBITMAP (along with -DWINDOWS
when necessary) on the mimetex.c compile line, as discussed above,
you may also optionally include the following -D switches,
whose functionality is discussed below. </p>
<dl>
<dt> <b>-DAA</b> </dt>
<dd> As already discussed, -DAA turns on anti-aliasing.
It also sets default values for individual anti-aliasing
parameters discussed below. If you specify -DAA
then you needn't specify the individual parameters unless
you want to override the defaults. <br>
Anti-aliasing can't be applied to mime
xbitmaps, so don't specify -DAA if you also specify -DXBITMAP. <br>
And mimeTeX's anti-aliasing only works
well on white (or light gray) backgrounds. Your html file
probably contains a <body> tag of the form
<body bgcolor="#ffffff" text="#000000">
which specifies black text on a pure white background.
The background can be grayed down to maybe bgcolor="#e7e7e7",
but much darker will begin to show white rings around
mimeTeX's anti-aliased characters. This page is displayed
using bgcolor="#ffffff". </dd>
<dt> <b>-DCENTERWT=<i>n</i> <br>
-DADJACENTWT=<i>j</i> <br>
-DCORNERWT=<i>k</i></b> </dt>
<dd> MimeTeX currently provides a lowpass filtering
algorithm for anti-aliasing, which is applied to the
existing set of bitmap fonts. This lowpass filter applies
weights <img src="../cgi-bin/mimetex.cgi?
\tiny\begin{pmatrix}1&2&1\\2&\,8\,&2\\1&2&1\end{pmatrix}"
alt="" border=0 align=middle> to neighboring pixels. The defaults
weights are CENTERWT=8, ADJACENTWT=2 and CORNERWT=1,
which you can adjust to control anti-aliasing. </dd>
<dt> <b>-DCACHEPATH=\"<i>path/</i>\"</b> </dt>
<dd> This option saves each rendered image to a file in directory
<b><i>path/</i></b>, which mimeTeX reads rather than
re-rendering the same image every time it's given
the same LaTeX expression. Sometimes mimeTeX disables caching,
e.g., expressions containing <b>\input{ }</b> are
re-rendered since the contents of the inputted file may have
changed. If compiled without <b>-DCACHEPATH=\"<i>path/</i>\"</b>
mimeTeX always re-renders expressions. This usually isn't too
cpu intensive, but if you have unusually high hit rates then
image caching may be helpful. The <b><i>path/</i></b>
is relative to mimetex.cgi, and must be writable by it.
Files created under <b><i>path/</i></b> are named
<b><i>filename</i>.gif</b>, where <b><i>filename</i></b>
is the 32-character MD5 hash of your LaTeX expression. <br>
If you're also using mimeTeX's
<a href="#valignment">Vertical-Align:</a> feature, prefix your
<b><i>path</i>/</b> with a leading <b>%</b> and write
<b>-DCACHEPATH=\"%<i>path</i>/\"</b>
instead. That leading <b>%</b> won't become part of
your cache directory's <b><i>path</i>/</b>, but it will signal
mimeTeX to cache headers along with each image.
Otherwise, the Vertical-Align: information is lost,
and attempts to align cached images will fail. <br>
When caching a new image, mimeTeX also
updates the file <b><i>path/</i>mimetex.log</b> containing
a timestamp, filename and LaTeX expression for each new file
created. A sample entry looks like
<pre>---------------------------------------------------------------------
2008-09-07:11:29:53am f8ccc8dd93c8eeb1d9c40b353ef781e0.gif
\LARGE x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
---------------------------------------------------------------------</pre></dd>
<dt><b>-DDEFAULTSIZE=<i>n</i></b> </dt>
<dd> MimeTeX currently has eight font sizes numbered 0-7,
and always starts out in DEFAULTSIZE, whose default value is 3.
Specify -DDEFAULTSIZE=2 on the compile line if you prefer
mimeTeX to start in default size 2, etc. </dd>
<dt><b>-DDISPLAYSIZE=<i>n</i></b> </dt>
<dd> By default, operator limits like <b>\int_a^b</b> are rendered
<b>\textstyle</b> <a href="#preview">
<img id="displaysize1" onclick="eqntext('displaysize1')"
src="../cgi-bin/mimetex.cgi?
\normalsize\displaystyle\smashmargin{2}{\int\nolimits_a}^b"
alt="" border=0 align=middle></a> at font sizes <b>\normalsize</b>
and smaller, and rendered <b>\displaystyle</b> <a href="#preview">
<img id="displaysize2" onclick="eqntext('displaysize2')"
src="../cgi-bin/mimetex.cgi?\large\int_a^b"
alt="" border=0 align=middle></a> at font sizes <b>\large</b> and
larger. This default corresponds to <b>-DDISPLAYSIZE=3</b>,
which you can adjust; e.g., <b>-DDISPLAYSIZE=0</b> always defaults
to <b>\displaystyle</b>, and <b>99</b> (or any large number)
always defaults to <b>\textstyle</b>. Note that explicit
<b>\textstyle</b>, <b>\displaystyle</b>, <b>\limits</b> or
<b>\nolimits</b> directives in an expression always override
the <b>DISPLAYSIZE</b> default. </dd>
<dt><b>-DGAMMA=<i>gammacorrection</i></b> </dt>
<dd> Applies <b><i>gammacorrection</i></b> to antialiased
gif images. Default is 1.25 (rather than the standard 2.2).
Specify 0.0 to turn off gamma correction (1.0 makes no
gamma correction but doesn't actually turn it off). </dd>
<dt><b>-DINPUTOK</b> </dt>
<dd> To enhance mimeTeX's security, the
<a href="#input">\input{ }</a> command is disabled
by default when you compile mimeTeX. Note that the
<a href="#counter">\counter</a> and
<a href="#environment">\environment</a> commands are
also disabled by default, and <b>-DINPUTOK</b> enables
all three commands simultaneously. (Compile mimeTeX with
<b>-DCOUNTEROK</b> to enable only \counter, or with
<b>-DENVIRONOK</b> to enable only \environment.) <br>
Compiling mimeTeX with the
<b>-DINPUTOK</b> switch enables \input{ } for all users,
subject only to your <b>-DPATHPREFIX</b> restrictions,
discussed below. And the following two switches give you
additional control over \input{ }'s usage... </dd>
<dt> <b>-DINPUTPATH=\"<i>path</i>\" <i>-or-</i><br>
-DINPUTPATH=\"<i>path1,path2,etc</i>\"</b> </dt>
<dd> Permits <b>\input{<i>filename</i>}</b> for specific
<i>filename</i>'s, even when the \input{ } command
is otherwise disabled (for security). <br>
If INPUTPATH is defined, mimeTeX
performs a case-insensitive test of \input{ }'s
<i>filename</i> argument, to verify that it contains
the authorized 'path' as a substring. <br>
If given several 'path's (second form)
then <i>filename</i> must contain either 'path1' or
'path2', or etc, as a (case-insensitive) substring. <br>
If <i>filename</i> doesn't contain
a substring matching any of these path(s), then mimeTeX emits
an error message image instead of reading <i>filename</i>. </dd>
<dt> <b>-DINPUTREFERER=\"<i>domain</i>\" <i>-or-</i><br>
-DINPUTREFERER=\"<i>domain1,domain2,etc</i>\"</b> </dt>
<dd> Permits <b>\input{ }</b> for users from specific
<i>domain</i>'s, even when the \input{ } command
is otherwise disabled (for security). <br>
If INPUTREFERER is defined
but INPUTOK is not defined, then mimeTeX
performs a case-insensitive test of the user's
HTTP_REFERER environment variable, to verify that it contains
the authorized 'domain' as a substring. <br>
If given several 'domain's (second form)
then HTTP_REFERER must contain either 'domain1' or
'domain2', or etc, as a (case-insensitive) substring. <br>
If HTTP_REFERER doesn't contain
a substring matching any of these domain(s), then mimeTeX renders
an error message image instead of reading <i>filename</i>. <br>
Finally, if HTTP_REFERER is not found as
an environment variable, then mimeTeX renders the
same error message image. </dd>
<dt><b><a id="newcommands">-DNEWCOMMANDS=\"<i>newcommands.h</i>\"</a>
</b> </dt>
<dd> LaTeX-like <b>\newcommand</b>'s are available in mimeTeX,
via the following facility to help you define your
own "new commands" during compilation. Edit a file named
newcommands.h (or any filename you specify between
<b>\"...\"</b>'s with the <b>-DNEWCOMMANDS=\"<i>filename</i>\"</b>
switch). For newcommands _without_
arguments, your file should contain one or more lines
like the following examples:
<pre>{ "\\iint", NULL, "{\\int\\int}" },
{ "\\rightleftharpoons",NULL,"{\\rightharpoonup\\atop\\leftharpoondown}" },
{ "\\ldots", NULL, "{\\Large.\\hspace1.\\hspace1.}" },
{ "\\cr", NULL, "\\\\" },
{ "\\neq", NULL, "{\\not=}" },</pre>
For newcommands _without_ arguments, as illustrated above,
the general form of each line in your file should be
<b>{ "\\<i>command</i>", NULL, "{<i>replacement</i>}" },</b>
Don't forget a comma at the end of every line,
and write a double backslash <b>\\</b>
between quotes <b>"...\\..."</b> wherever you actually
want a single backslash <b>\</b>. The only effect
of the above examples (without arguments) is simple string
substitution, i.e., every occurrence of <b>\<i>command</i></b>
is replaced by <b>{<i>replacement</i>}</b>. Note that the
<b>{ }</b>'s surrounding <b><i>replacement</i></b>
aren't required, but are usually a good idea (the case
of <b>\cr</b> illustrated above is one exception, where
<b>{ }</b>'s would defeat the purpose).
<br> To define newcommands _with_ arguments,
change the <b>NULL</b> after the <b>\\<i>command</i></b>
to define your command's arguments as illustrated by the
following example:
<pre>{ "\\lvec", "2n", "#2_1,\\cdots,#2_{#1}" },</pre>
In this case the <b>NULL</b> has been replaced by <b>"2n"</b>
(note the mandatory surrounding quotes <b>"..."</b>). This
example corresponds to the similar one discussed in TLC2 on
page 845. The first character inside the <b>"..."</b>s is
<b>2</b> indicating the number of arguments,
which may be <b>1</b> thru <b>9</b>. If there are no
subsequent characters followng this one, then all arguments are
mandatory, enclosed in <b>{ }</b>'s as usual. Otherwise,
any subsequent characters signal that the first argument
is optional, enclosed in <b>[ ]</b>'s if given. And
these subsequent characters comprise the first argument's
default value if it's not explicitly given. The illustrated
example's first argument is optional with default value
<b>n</b> as shown. In this case that's just a single
character, but you can write any length default you like.
<br> To see many additional examples, search for the
uppercase string NEWCOMMANDS in mimetex.c, and look below that.
All the above examples are already there. </dd>
<dt> <b>-DNOREFMAXLEN=<i>n</i></b> </dt>
<dd> The environment variable HTTP_REFERER identifies the
domain a request originates from. If HTTP_REFERER is not
defined, then NOREFMAXLEN is the maximum length query string
permitted from unidentified domains. It defaults to 9999,
i.e., any query string is permitted, since
mail and various other legitimate programs often don't
supply an HTTP_REFERER. See -DREFERER and -DREFLEVELS
below for further discussion, and also see -DNOREFSAFELEN
immediately below. </dd>
<dt> <b>-DNOREFSAFELEN=<i>n</i></b> </dt>
<dd> If you compile mimeTeX with either the -DREFERER or
-DREFLEVELS switch (discussed below), then the default
NOREFMAXLEN value 9999 is replaced by the (usually much
shorter) NOREFSAFELEN value whose default is 24. </dd>
<dt> <b>-DOPAQUE</b> </dt>
<dd> By default, mimeTeX renders gif images with black symbols
on a transparent white background. Defining OPAQUE renders
images on an opaque background instead. </dd>
<dt> <b>-DPATHPREFIX=\"<i>path/</i>\"</b> </dt>
<dd> The <a href="#input">\input{ }</a> and
<a href="#counter">\counter{ }</a> commands discussed below
require filename arguments which, by default, point to files
residing in the same cgi-bin/ directory as your mimetex.cgi.
Moreover, for security, absolute paths with leading <b>/</b>'s
or <b>\</b>'s, and paths with <b>../</b>'s or <b>..\</b>'s,
are not permitted. Instead, compile mimetex with PATHPREFIX
defined as <i>path</i><b>/</b> if you want input files in some
other directory. And make sure your <i>path</i><b>/</b> ends
with <b>/</b> (or with <b>\</b> for Windows). </dd>
<dt> <b>-DPLUSBLANK <i>-or-</i><br>
-DPLUSNOTBLANK</b> </dt>
<dd> mimeTeX receives your LaTeX math expression as a url
query string, in which blank spaces are often encoded
as <b>%20</b> or as plus signs <b>+</b>, and
where actual plus signs are often encoded as <b>%2B</b>.
But these conventions aren't always respected,
and even when they are blank spaces may be either
<b>%20</b> or <b>+</b>. The only ambiguity for
mimeTeX is whether or not to translate plus signs <b>+</b>
back to blank spaces. <br>
If you know how your applications behave,
then define PLUSBLANK to always translate plus signs <b>+</b>
to blank spaces, or define PLUSNOTBLANK to never translate. <br>
Otherwise, if you define neither,
mimeTeX applies some common-sense rules to decide whether or
not to translate. These usually work, but can't be guaranteed.
If your query string contains actual blank spaces or
blanks encoded as <b>%20</b>, then plus signs <b>+</b>
aren't translated. Otherwise, if your query string
contains <b>%2B</b>, then plus signs <b>+</b> are
translated. If neither <b>%20</b> nor <b>%2B</b>, or both
<b>%20</b> and <b>%2B</b>, occur in your query string,
then the situation is ambiguous. In this case, if mimeTeX
finds two or more plus signs <b>++</b> with no intervening
space, then they're translated; otherwise they're not. </dd>
<dt> <b>-DREFERER=\"<i>domain</i>\" <i>-or-</i><br>
-DREFERER=\"<i>domain1,domain2,etc</i>\"</b> </dt>
<dd> Blocks mimeTeX requests from unauthorized domains that
are using your mimetex.cgi (hence your server's resources)
without permission. <br>
If compiled with -DREFERER, then mimeTeX
performs a case-insensitive test of the environment variable
HTTP_REFERER to verify that it contains the authorized 'domain'
as a substring. For example, if -DREFERER=\"\",<br>
If given several 'domain's (second form)
then HTTP_REFERER must contain either 'domain1' or
'domain2', or etc, as a (case-insensitive) substring. <br>
If HTTP_REFERER doesn't contain a substring
matching any of these domain(s), then mimeTeX emits the error
message image<br>
<img src="../cgi-bin/mimetex.cgi?\message{0}"
alt="" align="middle" border=0> <br>
instead of the requested image. You can manually
modify this invalid_referer_msg, which is msgtable[0]
defined immediately above function main(),
to personalize the error message displayed for your own site. <br>
Finally, if you specify <b>-DREFERER</b>
(or -DREFLEVELS discussed immediately below) but HTTP_REFERER
is not found as an environment variable, then
mimeTeX correctly generates images whose QUERY_STRING's
contain 24 or fewer characters. For 25 or more
characters, mimeTeX generates an error.
See -DNOREFMAXLEN and -DNOREFSAFELEN above to change
the 24 limit. </dd>
<dt><b>-DREFLEVELS=<i>n</i></b> <i>-or-</i><br>
<b>-DNOREFCHECK</b> </dt>
<dd> Besides <b>-DREFERER</b> discussed immediately above,
mimeTeX can block requests from HTTP_REFERER's that
don't match your HTTP_HOST, <i>i.e.</i>, from pages on
different servers than your mimetex.cgi image. <br>
The default value of REFLEVELS is 3,
meaning the topmost three levels of HTTP_REFERER and
HTTP_HOST must match. For example, phy.cam.ac.uk matches
math.cam.ac.uk because they share the same topmost three
levels cam.ac.uk. So a page installed at the physics
department can use a mimetex.cgi installed at the math
department. If you always want a complete match, compile
mimeTeX with <b>-DREFLEVELS=99</b> or any large number.
If HTTP_REFERER is not found, then the same 24
character limit discussed immediately above remains in effect. <br>
To completely disable the REFLEVELS check,
compile mimeTeX with <b>-DNOREFCHECK</b> (or with
<b>-DREFLEVELS=0</b>). Or, if you supply a specific
<b>-DREFERER</b> list of authorized domains, as discussed
immediately above, then the REFLEVELS check is automatically
disabled. </dd>
<dt><b>-DSECURITY=<i>n</i></b> </dt>
<dd> This is essentially a "paranoid" setting that defaults
to a high value 999, which inhibits some optional logging
activity. <b>-DCACHEPATH=<i>path</i>/</b> isn't affected,
since you're explicitly supplying a <b><i>path</i>/</b>
you want files written to. But, for example, you must set
<b>-DSECURITY=5</b> (or less) to permit the <b>\counter</b>
command to create a new counter file. A malicious user
could conceivably flood your file system by submitting
zillions of <b>\counter{<i>filename</i>}</b> commands
to mimeTeX, each with a different <b><i>filename</i></b>. </dd>
<dt><b>-DSMASHMARGIN=<i>n</i> <i>-or-</i><br>
-DNOSMASH</b> </dt>
<dd> TeX typically renders an expression like
<b>\frac12\int_{a+b+c}^{d+e+f}g(x)dx</b> as <a href="#preview">
<img id="nosmash1" onclick="eqntext('nosmash1')"
src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
\nosmash\frac12\int_{a+b+c}^{d+e+f}g(x)dx"
alt="" border=0 align=middle></a>. MimeTeX tries to remove extra
whitespace, rendering the same expression as <a href="#preview">
<img id="nosmash2" onclick="eqntext('nosmash2')"
src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
\smash\frac12\int_{a+b+c}^{d+e+f}{g(x)}dx"
alt="" border=0 align=middle></a> instead.
Compile with <b>-DNOSMASH</b> if you prefer the typical TeX
behavior as mimeTeX's default. Or, to adjust the minimum
number of pixels between smashed symbols (default is 3),
compile with <b>-DSMASHMARGIN=<i>n</i></b>.
See <a href="#smash">Smash</a> for further discussion. </dd>
<dt> <b>-DWARNINGS=<i>n</i> <i>-or-</i> <br>
-DNOWARNINGS</b> </dt>
<dd> If an expression submitted to mimeTeX contains an
unrecognzied escape sequence, e.g., "y=x+\abc+1", then
mimeTeX generates a gif image containing an embedded
warning in the form "y=x+[\abc?]+1". Or, if an expression
contains an unrecognized character, i.e., one for which mimeTeX
has no corresponding bitmap, then the embedded warning is [?].
If you want these warnings suppressed, either <b>-DWARNINGS=0</b>
or <b>-DNOWARNINGS</b> on the compile line tells mimeTeX to treat
unrecognized/undisplayable input as white space. </dd>
<dt> <b>-DWHITE</b> </dt>
<dd> MimeTeX usually renders black symbols on a white
background. This option renders white symbols on
a transparent black background instead (or on an opaque
black background when combined with <b>-DOPAQUE</b> ). </dd>
<dt> <a name="adswitches"> </a> <font color="black" size="5">
<br> <b>Advertising switches</b><font size=5>...</font></font>
<br> </dt>
<dd style="margin-left:0em;"> The next three switches
set up a mimeTeX web service that embeds advertising messages
along with rendered images.
<!-- See <a href="#webservice">mimeTeX web service</a>
above for further discussion. --> <br> <br> </dd>
<dt> <a name="adfrequencyswitch"> </a>
<b>–DADFREQUENCY=0</b> </dt>
<dd> If ADFREQUENCY is defined as a positive number <b><i>n</i></b>,
then one request out of every <b><i>n</i></b> submitted to mimeTeX
is randomly selected to be displayed along with a pre-defined
"advertisement". For example, if your expression is
<b>\large\int_0^xe^{-x^2}dx</b>, then the default
advertisement displays <br>
<a href="#preview"><img id="adswitch1" onclick="eqntext('adswitch1')"
src="../cgi-bin/mimetex.cgi?\large\advertisement
\int_0^xe^{-x^2}dx" alt="" align="middle" border=0></a>
instead of just
<a href="#preview"><img id="adswitch2" onclick="eqntext('adswitch2')"
src="../cgi-bin/mimetex.cgi?\large
\int_0^xe^{-x^2}dx" alt="" align="middle" border=0></a> <br>
See the <b>–DADVERTISEMENT</b> switch <!-- immediately -->
below for instructions to define your own advertisement replacing
my default. </dd>
<dt> <a name="adhostswitch"> </a>
<b>–DHOST_SHOWAD=\"\\000\"</b> </dt>
<dd> Advertisement messages are usually displayed randomly,
in one request to mimeTeX out of every <b><i>n</i></b>,
as defined by the <b>–DADFREQUENCY</b> switch above.
But if a HOST_SHOWAD string is also defined,
then advertisements are only displayed when mimeTeX is running
on a host whose HTTP_HOST (or SERVER_NAME) environment variable
contains that string. For example,
<b>–DHOST_SHOWAD=\"mathsite\"</b> displays advertisements
on www.mathsite.com but never on www.mathhouse.com .
The default HOST_SHOWAD value is an empty string,
which displays advertisements on any host. </dd>
<dt> <a name="advertisementswitch"> </a>
<b>–DADVERTISEMENT=\"</b><i>filename</i><b>\"</b> </dt>
<dd> To define your own advertisement, replacing my default
illustrated immediately above, edit a file containing lines
of the form <br>
<nobr> <b>"\\</b>begin{gather}{\\small\\text<b>"</b></nobr><br>
<nobr> <b>"</b>{\\fbox{\\begin{gather}<b>"</b></nobr><br>
<nobr> <b>"</b>mime\\TeX rendering courtesy of\\\\<b>"</b></nobr><br>
<nobr> <b>"</b>http://www.forkosh.com/mimetex.html \\end{gather}}}\\\\<b>"</b></nobr><br>
<nobr> <b>"</b> %%expression%%<b>"</b></nobr><br>
<nobr> <b>"\\</b>end{gather}<b>"</b></nobr><br>
Every line in your file must be enclosed in <b>"</b>quotes<b>"</b>,
and all backslashes written as double-backslashes <b>\\</b>.
Note <b>\\\\</b> at the end of the third and fourth lines,
which LaTeX sees as <b>\\</b>. The entire example shows how my
default advertisement is defined. <br>
Your advertisement may consist of any valid
mimeTeX commands you like. But it must somewhere contain the line <br>
<nobr> <b>"</b> %%expression%% <b>"</b></nobr><br>
which is replaced by the user's expression. <br>
Once mimeTeX is compiled with your advertisement,
test it by submitting an expression like
<b>\advertisement x^2+y^2</b> containing the special
mimeTeX \advertisement directive, which forces that
expression to be rendered with your advertisement. In this case
(and with my default advertisement message) we see <br>
<a href="#preview"><img id="adswitch3" onclick="eqntext('adswitch3')"
src="../cgi-bin/mimetex.cgi?\advertisement x^2+y^2"
alt="" align="middle" border=0></a> instead of
just
<a href="#preview"><img id="adswitch4" onclick="eqntext('adswitch4')"
src="../cgi-bin/mimetex.cgi?x^2+y^2" alt="" border=0></a> <br>
regardless of your ADFREQUENCY value. </dd>
</dl>
<h2> <a name="cmdline"> (IId) Command Line Features </a> </h2>
<p> MimeTeX usually runs from a browser, obtaining its input expression
from a query_string. But you can also run mimeTeX from your Unix
shell, supplying all input from the command line. This was briefly
illustrated above, where you were advised to test your newly-compiled
mimeTeX executable from the command line before installing it. </p>
<p> In addition to such simple testing, mimeTeX also provides some
possibly useful functionality from the command line. In particular,
you can store a gif (or xbitmap) image of any expression to a file.
No syntax checking is applied to command-line arguments, so enter
them carefully. (Likewise, plus signs <b>+</b> are never
translated to blank spaces, nor is any other <b>%xx</b> url decoding
performed on command-line arguments.) </p>
<p> The complete command-line syntax for mimeTeX is </p>
<pre>
./mimetex [ -d ] dump gif image on stdout,
[ -e export_file ] or write gif image to export_file
[ expression expression, e.g., "x^2+y^2",
| -f input_file ] or read expression from input_file
[ -g1 -d ] dump .pbm-formatted image on stdout
[ -g1 -e export_file ] or write .pbm image to export_file
[ -g2 -d ] dump anti-aliased .pgm image on stdout
[ -g2 -e export_file ] or write .pgm image to export_file
[ -m msglevel ] verbosity of debugging output
[ -o ] render image with opaque background
[ -s fontsize ] default fontsize, 0-5
-d Rather than printing ascii debugging output, mimeTeX
dumps the actual gif (or xbitmap) to stdout, e.g.,
./mimetex -d "x^2+y^2" > expression.gif
creates expression.gif containing an image of x^2+y^2
-e export_file Like -d but writes the actual gif
(or xbitmap) directly to export_file, e.g.,
./mimetex -e expression.gif "x^2+y^2"
creates file expression.gif containing an image of x^2+y^2
expression Place LaTeX expression directly on command
line, with no -switch preceding it, as in the example
immediately above, or.....
-f input_file .....read expression from input_file
(and automatically assume -d switch). The input_file
may contain the expression on one line or spread out
over many lines. MimeTeX will concatanate all lines
from input_file to construct one long expression.
Blanks, tabs, and newlines are just ignored.
-g1 -d dumps a .pbm-formatted portable bitmap image to stdout.
Note that this is the bitmap image _before_ anti-aliasing.
-g1 -e export_file Like -g1 -d but writes the .pbm-formatted
portable bitmap directly to export_file, e.g.,
./mimetex -g1 -e expression.pbm "x^2+y^2"
creates file expression.pbm containing a bitmap image
of x^2+y^2 before anti-aliasing.
-g2 -d dumps a .pgm-formatted portable graphic image to stdout.
Note that this is the bytemap image _after_ anti-aliasing.
-g2 -e export_file Like -g2 -d but writes the .pgm-formatted
portable graphic image directly to export_file, e.g.,
./mimetex -g3 -e expression.pgm "x^2+y^2"
creates file expression.pgm containing a bytemap image
of x^2+y^2 after anti-aliasing.
-m msglevel 0-99, controls verbosity/message level for
debugging output (usually used only while testing code).
-o Rather than the default transparent gif background,
the rendered image will contain black symbols on an
opaque white background (or vice versa if compiled
with -DWHITE). For example, if you have ImageMagick's
display utility,
./mimetex -o -d "x^2+y^2" | display &
opens a small window containing the rendered expression.
(Note: if you already compiled mimeTeX with -DOPAQUE
then -o renders images on a transparent background.)
-s fontsize 0-7, font size. Font size can also be specified
within the expression by a directive, e.g., \Large f(x)=x^2
displays f(x)=x^2 at font size 4, overriding -s.
Default font size is 3.
</pre>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SECTION III. SYNTAX REFERENCE
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h1> <a name="reference"> (III) Syntax Reference </a> </h1>
<p> Since mimeTeX's syntax is as TeX-like as possible, we'll mostly discuss
the occasional differences.
<!-- (which exist only to simplify my programming
task, not to impose any syntactic aesthetics of mine on you). -->
This section contains short paragraphs that each discuss some aspect
of mimeTeX where your LaTeX experience might not be precisely
duplicated. </p>
<p> Anything not discussed here that still doesn't behave like you expect
is probably just not implemented. That includes (La)TeX packages
(though a few ams commands like \begin{gather} and \begin{pmatrix}
are recognized), non-standard fonts, etc. You can try out any
questionable syntax by <a href="#forminput">Submit</a>ting a query
to quickly see whether or not it works. And you might want to
occasionally re-browse the <a href="#examples">Examples</a> above,
which may better illustrate implemented features. </p>
<h2> <a name="spaces"> (IIIa) \unitlength{ }, Math Spaces and Whitespace
</a> </h2>
<h3> <a name="unitlength">\unitlength<font size=5>...</font></a> </h3>
<p> Lengths in mimeTeX are all ultimately expressed in number of pixels.
Various commands discussed below require length arguments, including </p>
<ul>
<li> <a href="#mathspace">\hspace{ }</a> </li>
<li> <a href="#mathspace">\hfill{ }</a> </li>
<li> <a href="#raiserotate">\raisebox{ }{ }</a> </li>
<li> <a href="#circleline">\line( , )</a> and
<a href="#circleline">\circle( , )</a> </li>
<li> <a href="#arrows">\longrightarrow[ ]</a> </li>
</ul> <p class="continue">
(the \long<i>xxx</i>arrow [ ]-arguments are optional mimeTeX
extensions to LaTeX) MimeTeX's length-type arguments never
take units, e.g., {10pt} and {1cm} are both invalid. Lengths always
refer to number of pixels, optionally scaled by a user-specified
<b>\unitlength</b>. </p>
<p> MimeTeX's <b>\unitlength{ }</b> command lets you specify
the number of pixels per "length unit", e.g.,
<b>\unitlength{10} \hspace{2.5}</b> renders a 25-pixel space.
Both <b>\unitlength{ }</b> and <b>\hspace{ }</b>'s
length arguments may be integers or may contain decimal points.
Ditto for all other mimeTeX commands that take length arguments.
The default <b>\unitlength</b> is, you guessed it, <b>1</b>. </p>
<p> A specified <b>\unitlength</b> applies to all subsequent terms,
i.e., everything to its right. And several <b>\unitlength</b>'s
may be specified in the same expression, each one overriding
those to its left. But if one or more <b>\unitlength</b>'s
appear within a <b>{ }</b>-enclosed subexpression, then terms
following its closing right <b>}</b> revert to the <b>\unitlength</b>
in effect before its opening left <b>{</b>. For example, </p> <center>
<b>A\hspace{10} {\unitlength{2.5}B\hspace{10}C} \hspace{10}D</b>
produces
<a href="#preview"><img id="unitlength1" onclick="eqntext('unitlength1')"
src="../cgi-bin/mimetex.cgi?\large A\hspace{10}
{\unitlength{2.5}B\hspace{10}C}\hspace{10}D"
alt="" border=0 align=middle></a> </center> <p class="continue">
which has a 10-pixel space between <b>A</b> and <b>B</b>, then
25 pixels between <b>B</b> and <b>C</b>, and finally
another 10 pixels between <b>C</b> and <b>D</b>. </p>
<h3> <a name="mathspace">Math Spaces<font size=5>...</font></a> </h3>
<p> Except inside <a href="#textboxes">text boxes</a>,
unescaped blanks, tildes (a <b>~</b>), and all other usual
<a href="#whitespace">whitespace</a> characters are completely
ignored by mimeTeX, just like they are in LaTeX math mode.
As usual, you must explicitly write one of the recognized math
spaces to put extra visible space in your rendered expressions. </p>
<p> MimeTeX recognizes math spaces <b>\/ \, \: \;</b>
as well as <b>\quad</b> and <b>\qquad</b> ,
and also a backslashed blank
<img src="../cgi-bin/mimetex.cgi?1$\backsl\raise{-5}{\rotate{-90}]}"
alt="" border=0 align=middle>
(i.e., a <b>\</b> followed by a blank).
For example,
<b>(a\/b\,c\:d\;e\ f\quad g\qquad h)</b>
  renders
<a href="#preview"><img id="spacing2" onclick="eqntext('spacing2')"
src="../cgi-bin/mimetex.cgi?(a\/b\,c\:d\;e\ f\quad g\qquad h)"
alt="" border=0 align="middle"></a>.
In mimeTeX, you may also write <b>\hspace{10}</b>
to insert a 10-pixel (or any other number) space, scaled by any
preceding <a href="#unitlength">\unitlength</a>, as illustrated
just above. </p>
<p> For negative spaces, <b>\!</b> produces a small (two
pixel) negative space, e.g., <b>a=b</b> renders
<img src="../cgi-bin/mimetex.cgi?a=b"alt="" border=0 align="bottom">
whereas <b>a\!=b</b> renders
<img src="../cgi-bin/mimetex.cgi?a\!=b"alt="" border=0 align="bottom">
and <b>a\!\!=b</b> renders
<img src="../cgi-bin/mimetex.cgi?a\!\!=b"alt="" border=0 align="bottom">.
For large negative space, <b>\hspace{-10}</b> permits
a negative argument. But it stops at the first pixel to its left
rather than "erasing" pixels. If you don't want to stop, use
<b>\hspace*{-10}</b> instead. For example,
<b>ABC\hspace*{-20}-DEF</b> renders
<img src="../cgi-bin/mimetex.cgi?ABC\hspace*{-20}-DEF"
alt="" border=0 align="bottom">, erasing all of the <b>C</b>
and the right half of the <b>B</b>. </p>
<!--
<p> Although some browsers occasionally misinterpret typed blank spaces
inside html query_string's, mimeTeX also recognizes escaped blanks
<img src="../cgi-bin/mimetex.cgi?\small\backsl\raise{-5}{\rotate{-90}]}"
alt="" border=0 align=middle> (a <b>\</b> followed by a blank) as math
spaces, just in case you can safely use them. </p>
-->
<p> MimeTeX also supports <b>\hfill{<i>textwidth</i>}</b>, where
<b><i>textwidth</i></b> is roughly equivalent to LaTeX's
<b>\textwidth</b>, i.e., it's the total number of pixels, scaled by
<a href="#unitlength">\unitlength</a>, that your entire rendered
expression will span. However, if <b>\hfill{ }</b> appears
within a <b>{ }</b>-enclosed subexpression, then it applies
only to that subexpression. For example, </p> <center>
<b>{abc \hfill{75} def} \hfill{150} ghi</b>
produces
<a href="#preview"><img id="mathspace1" onclick="eqntext('mathspace1')"
src="../cgi-bin/mimetex.cgi?\large{abc\hfill{75}def}\hfill{150}ghi"
alt="" border=0 align=middle></a> </center> <p class="continue">
The first/inner <b>\hfill{75}</b> inserts exactly enough whitespace so
that subexpression "<b><i>abc def</i></b>" spans 75 pixels.
Then the second/outer <b>\hfill{150}</b> inserts exactly enough
whitespace so that the entire expression spans 150 pixels.
Without explicit <b>{ }</b>-nesting, mimeTeX evaluates expressions
left-to-right (sinistrally), e.g., <b>...\hfill{150}...\hfill{75}...</b>
is exactly equivalent to <b>...\hfill{150}{...\hfill{75}...}</b>.
Notice that, this time, the second/right <b><i>textwidth</i></b>
argument is necessarily smaller than the first/left. </p>
<p> Finally, mimeTeX begins a new line whenever you write <b>\\</b> .
And you may optionally write <b>\\[10]</b> to put a 10-pixel (or any
other number) vertical space, scaled by
<a href="#unitlength">\unitlength</a>, between lines.
<a href="#array">\begin{eqnarray}</a> also splits long
equations over several lines, as illustrated by
<a href="#example10">Example 10</a> above.
But when that's not the best solution, you can also write,
for example, </p> <center>
<b>y=a+b+c+d\\\hspace{50}+e+f+g+h</b>
to produce
<a href="#preview"><img id="mathspace2" onclick="eqntext('mathspace2')"
src="../cgi-bin/mimetex.cgi?\large y=a+b+c+d\\\hspace{50}+e+f+g+h"
alt="" border=0 align=middle></a> </center>
<p> However, mimeTeX can't correctly handle automatically-sized delimiters
across linebreaks, e.g., </p> <center>
<b>y=\left\{a+b+c+d\\\hspace{50}+e+f+g+h\right\}</b>
produces
<a href="#preview"><img id="mathspace3" onclick="eqntext('mathspace3')"
src="../cgi-bin/mimetex.cgi?\large y=\{a+b+c+d\\
\hspace{50}+e+f+g+h\}" alt="" border=0 align=middle></a> <br>
whereas you probably wanted
<a href="#preview"><img id="mathspace4" onclick="eqntext('mathspace4')"
src="../cgi-bin/mimetex.cgi?\large y=\big{a+b+c+d\\
\hspace{50}+e+f+g+h\big}" alt="" border=0 align=middle></a>
</center> <p class="continue">
which I produced using <b>\big{...\\...\big}</b> instead
of <b>\left\{...\\...\right\}</b>. Expressions of the
form <b>\left...\right \\ \left...\right</b> should all be
rendered properly. It's only <b>\left...\\...\right</b> that will
look odd. </p>
<h3> <a name="whitespace">Whitespace, Comments,
and some other characters<font size=5>...</font></a> </h3>
<p> Some browsers occasionally misinterpret typed blank spaces
inside html query_string's. In that case, you can write
tildes (a <b>~</b>) wherever blanks are required or desired,
e.g., <b>\alpha~w</b> instead of <b>\alpha w</b>, or
<b>\frac~xy</b> or <b>\sqrt~z</b>, etc. MimeTeX correctly
interprets both blanks and <b>~</b>'s, and all
other usual whitespace characters. So use whatever's convenient
as long as it's correctly interpreted inside query_string's by your
browser. </p>
<p> Similarly, some browsers occasionally misinterpret linebreaks/newlines
inside the middle of long html query_string's.
For example, </p>
<pre><img src="../cgi-bin/mimetex.cgi?f(x)=\frac1{\sigma\sqrt{2\pi}}
\int\limits_{-\infty}^xe^{-\frac{(t-\mu)^2}{2\sig^2}}dt"
alt="" border=0 align=middle> </pre><p class="continue">
breaks a long query_string over two lines. If your browser interprets
this correctly, then mimeTeX will render it correctly, too. Otherwise,
you'll have to enter long expressions on one big long line. </p>
<p> If you can break long query_string's over several lines, then you may
find mimeTeX's <b>%%comments%%</b> feature useful, too. Note that
comments must be preceded <i>and followed</i> by two <b>%</b>'s
rather than LaTeX's usual one. The above example could be written </p>
<pre><img src="../cgi-bin/mimetex.cgi?f(x)=\frac1{\sigma\sqrt{2\pi}} %%normalization%%
\int\limits_{-\infty}^xe^{-\frac{(t-\mu)^2}{2\sig^2}}dt %%integral%%"
alt="" border=0 align=middle> </pre>
<p> Besides whitespace, browsers may misinterpret embedded apostrophes,
and especially quotes, within query strings. The <b>a's</b> and
<b>b's</b> in <a href="#example7">Example 7</a> above actually use
superscripted commas for apostrophes, i.e., <b>a^,s</b> and <b>b^,s</b>,
and you can also use LaTeX <b>\prime</b>'s, as in <b>a^\prime s</b>.
For quotes, you can use <b>^{,,}</b> since <b>"</b> almost certainly
won't work. To help make things easier, in addition to the usual
LaTeX <b>\prime</b>, mimeTeX also recognizes <b>\apostrophe</b> and
<b>\quote</b> and <b>\percent</b>, all with the obvious meanings. </p>
<h2> <a name="symbols"> (IIIb) Math Symbols, Sizes, and Modes </a></h2>
<h3> <a name="characters">Character Sets<font size=5>...</font></a> </h3>
<p> The <a href="http://www.ctan.org/tex-archive/info/symbols/comprehensive/"
target="_top"> Comprehensive LaTeX Symbol List </a>
illustrates some 6,000 symbols supported by LaTeX. For complete
information about the subset of these characters and math symbols
available in mimeTeX, you'll need to browse through the bottom
1500-or-so lines of <b>mimetex.h</b>. And several additional
symbols like <b>\ldots</b> and <b>\AA</b> and <b>\hbar</b> are
defined by the mimeTeX preprocessor, function <b>mimeprep( )</b>
in <b>mimetex.c</b> <br>
I haven't exhaustively checked all the name-number matchings for
the thousand-or-so symbols in mimetex.h. You can eaily correct
any minor mistake you find in what I hope is an obvious manner.
The fonts <a href="#fonts">Appendix IVa</a> below provides
additional information. </p>
<p> Generally speaking, I've tried to
encode the cmr10, cmmi10, cmmib10, cmsy10, cmex10, bbold10, rsfs10,
stmary10 and wncyr10 families with "names", e.g., <b>\alpha \beta
\forall \sqcup</b>, etc, identical to your LaTeX expectations.
For example, the calligraphic symbols in cmsy10 are accessed by
writing <b>\mathcal{A} \mathcal{B} \mathcal{XYZ}</b>. Similarly,
write <b>\mathbf{A}</b> for the cmmib fonts, write <b>\mathscr{A}</b>
for rsfs10, write <b>\mathbb{R}</b> for bbold10, and write
<b>{\cyr Khrushchev}</b> or <b>\cyr{Khrushchev}</b> to see
<a href="#preview"><img id="cyrillic1" onclick="eqntext('cyrillic1')"
src="../cgi-bin/mimetex.cgi?\large\cyr Khrushchev"
alt="" border=0 align="middle"></a>.
Most LaTeX distributions supply stmaryrd.dvi and stmaryrd.sty
that both document the names of the stmary10 symbols.
Similarly, amsfndoc.dvi documents the names of the wncyr10
cyrillic symbols and ligatures. </p>
<!-- But there are various additions and omissions and exceptions
vis-a-vis LaTeX. For example, </p>
<ul>
<li> "Large" operators like \int are often also available as
\Bigint, and similarly for \sum \prod \cup \cap, etc.
If you find a \Bigxxx in mimetex.h then you'll also find the
corresponding \xxx. \Bigxxx operators are somewhat larger
than their \xxx counterparts, and they automatically render
super/subscripts in <a href="#modes">displaystyle</a>. </li>
</ul> -->
<p> In addition to extra LaTeX symbols like <b>\ldots</b>, <b>\AA</b>
and <b>\hbar</b>, mentioned above, the mimeTeX preprocessor
<b>mimeprep( )</b> also recognizes various html special
characters like <b>&lt;</b>, <b>&gt;</b>, <b>&nbsp;</b>,
<b>&quot;</b>, <b>&amp;</b>, etc. Some web tools apparently
translate characters like, e.g., <b>></b> to <b>&gt;</b>,
even inside quoted query_string's, so mimeTeX's preprocessor
translates them back to LaTeX symbols for you. Moreover, html
misinterprets quotes <b>"</b> inside a quoted
query string as the end of the query string. So, for example,
the cyrillic ligature <b>\"E</b> has to be written in the
even more cumbersome form <b>\&quot;E</b> inside a query
string. </p>
<p> Illustrated below are some of the character sets and math symbols
supported by mimeTeX, starting with several roman character fonts.
The blackboard bold font contains many characters besides
<b>a-z,A-Z</b>. Calligraphic and script fonts contain
uppercase <b>A-Z</b> only. </p>
<center><a href="#preview"><img id="roman8" onclick="eqntext('roman8')"
src="../cgi-bin/mimetex.cgi?\large
\begin{array}{|c+57|c|c|c0|c|c|c|c|c| C25 C+15} \hline
\large \textrm{a-z} & \small \backslash\textrm{text} &
\small \backslash\textrm{mathbb} & &
\large \textrm{A-Z} & \small \backslash\textrm{text} &
\small \backslash\textrm{mathbb} & \small \backslash\textrm{mathcal} &
\small \backslash\textrm{mathscr} \\ \hline
a&\text{a}&\mathbb{a}& &A&\text{A}&\mathbb{A}&\mathcal{A}&\mathscr{A}\\
b&\text{b}&\mathbb{b}& &B&\text{B}&\mathbb{B}&\mathcal{B}&\mathscr{B}\\
c&\text{c}&\mathbb{c}& &C&\text{C}&\mathbb{C}&\mathcal{C}&\mathscr{C}\\
d&\text{d}&\mathbb{d}& &D&\text{D}&\mathbb{D}&\mathcal{D}&\mathscr{D}\\
e&\text{e}&\mathbb{e}& &E&\text{E}&\mathbb{E}&\mathcal{E}&\mathscr{E}\\
f&\text{f}&\mathbb{f}& &F&\text{F}&\mathbb{F}&\mathcal{F}&\mathscr{F}\\
g&\text{g}&\mathbb{g}& &G&\text{G}&\mathbb{G}&\mathcal{G}&\mathscr{G}\\
h&\text{h}&\mathbb{h}& &H&\text{H}&\mathbb{H}&\mathcal{H}&\mathscr{H}\\
i&\text{i}&\mathbb{i}& &I&\text{I}&\mathbb{I}&\mathcal{I}&\mathscr{I}\\
j&\text{j}&\mathbb{j}& &J&\text{J}&\mathbb{J}&\mathcal{J}&\mathscr{J}\\
k&\text{k}&\mathbb{k}& &K&\text{K}&\mathbb{K}&\mathcal{K}&\mathscr{K}\\
l&\text{l}&\mathbb{l}& &L&\text{L}&\mathbb{L}&\mathcal{L}&\mathscr{L}\\
m&\text{m}&\mathbb{m}& &M&\text{M}&\mathbb{M}&\mathcal{M}&\mathscr{M}\\
n&\text{n}&\mathbb{n}& &N&\text{N}&\mathbb{N}&\mathcal{N}&\mathscr{N}\\
o&\text{o}&\mathbb{o}& &O&\text{O}&\mathbb{O}&\mathcal{O}&\mathscr{O}\\
p&\text{p}&\mathbb{p}& &P&\text{P}&\mathbb{P}&\mathcal{P}&\mathscr{P}\\
q&\text{q}&\mathbb{q}& &Q&\text{Q}&\mathbb{Q}&\mathcal{Q}&\mathscr{Q}\\
r&\text{r}&\mathbb{r}& &R&\text{R}&\mathbb{R}&\mathcal{R}&\mathscr{R}\\
s&\text{s}&\mathbb{s}& &S&\text{S}&\mathbb{S}&\mathcal{S}&\mathscr{S}\\
t&\text{t}&\mathbb{t}& &T&\text{T}&\mathbb{T}&\mathcal{T}&\mathscr{T}\\
u&\text{u}&\mathbb{u}& &U&\text{U}&\mathbb{U}&\mathcal{U}&\mathscr{U}\\
v&\text{v}&\mathbb{v}& &V&\text{V}&\mathbb{V}&\mathcal{V}&\mathscr{V}\\
w&\text{w}&\mathbb{w}& &W&\text{W}&\mathbb{W}&\mathcal{W}&\mathscr{W}\\
x&\text{x}&\mathbb{x}& &X&\text{X}&\mathbb{X}&\mathcal{X}&\mathscr{X}\\
y&\text{y}&\mathbb{y}& &Y&\text{Y}&\mathbb{Y}&\mathcal{Y}&\mathscr{Y}\\
z&\text{z}&\mathbb{z}& &Z&\text{Z}&\mathbb{Z}&\mathcal{Z}&\mathscr{Z}\\
\hline \end{array}"
alt="" border=0 align="middle"></a></center>
<p> Characters from the Greek alphabet supported by mimeTeX,
along with <b>\mathbb{ }</b> versions, are
illustrated next. For example, <b>\mathbb{\lambda}</b>
renders
<a href="#preview"><img id="bblambda" onclick="eqntext('bblambda')"
src="../cgi-bin/mimetex.cgi?\large\mathbb{\lambda}"
alt="" border=0 align="bottom"></a>. </p>
<center><a href="#preview"><img id="greek2" onclick="eqntext('greek2')"
src="../cgi-bin/mimetex.cgi?\large
\begin{array}{|l98c28c28|l98c28c28|l98c28c28|}
\hline \; \\
\hspace{10}\backslash\textrm{Gamma} & \Gamma & \mathbb{\Gamma} &
\hspace{10}\backslash\textrm{Delta} & \Delta & \mathbb{\Delta} &
\hspace{10}\backslash\textrm{Theta} & \Theta & \mathbb{\Theta} \\
\hspace{10}\backslash\textrm{Lambda} & \Lambda & \mathbb{\Lambda} &
\hspace{10}\backslash\textrm{Xi} & \Xi & \mathbb{\Xi} &
\hspace{10}\backslash\textrm{Pi} & \Pi & \mathbb{\Pi} \\
\hspace{10}\backslash\textrm{Sigma} & \Sigma & \mathbb{\Sigma} &
\hspace{10}\backslash\textrm{Upsilon} & \Upsilon & \mathbb{\Upsilon}&
\hspace{10}\backslash\textrm{Phi} & \Phi & \mathbb{\Phi} \\
\hspace{10}\backslash\textrm{Psi} & \Psi & \mathbb{\Psi} &
\hspace{10}\backslash\textrm{Omega} & \Omega & \mathbb{\Omega} \\
\; \\ \hline \; \\
\hspace{10}\backslash\textrm{alpha} & \alpha & \mathbb{\alpha} &
\hspace{10}\backslash\textrm{beta} & \beta & \mathbb{\beta} &
\hspace{10}\backslash\textrm{gamma} & \gamma & \mathbb{\gamma} \\
\hspace{10}\backslash\textrm{delta} & \delta & \mathbb{\delta} &
\hspace{10}\backslash\textrm{epsilon} & \epsilon & \mathbb{\epsilon}&
\hspace{10}\backslash\textrm{zeta} & \zeta & \mathbb{\zeta} \\
\hspace{10}\backslash\textrm{eta} & \eta & \mathbb{\eta} &
\hspace{10}\backslash\textrm{theta} & \theta & \mathbb{\theta} &
\hspace{10}\backslash\textrm{iota} & \iota & \mathbb{\iota} \\
\hspace{10}\backslash\textrm{kappa} & \kappa & \mathbb{\kappa} &
\hspace{10}\backslash\textrm{lambda} & \lambda & \mathbb{\lambda} &
\hspace{10}\backslash\textrm{mu} & \mu & \mathbb{\mu} \\
\hspace{10}\backslash\textrm{nu} & \nu & \mathbb{\nu} &
\hspace{10}\backslash\textrm{xi} & \xi & \mathbb{\xi} &
\hspace{10}\backslash\textrm{pi} & \pi & \mathbb{\pi} \\
\hspace{10}\backslash\textrm{rho} & \rho & \mathbb{\rho} &
\hspace{10}\backslash\textrm{sigma} & \sigma & \mathbb{\sigma} &
\hspace{10}\backslash\textrm{tau} & \tau & \mathbb{\tau} \\
\hspace{10}\backslash\textrm{upsilon} & \upsilon & \mathbb{\upsilon}&
\hspace{10}\backslash\textrm{phi} & \phi & \mathbb{\phi} &
\hspace{10}\backslash\textrm{chi} & \chi & \mathbb{\chi} \\
\hspace{10}\backslash\textrm{psi} & \psi & \mathbb{\psi} &
\hspace{10}\backslash\textrm{omega} & \omega & \mathbb{\omega} \\
\; \\ \hline \; \\
\hspace{10}\backslash\textrm{varepsilon} & \varepsilon & &
\hspace{10}\backslash\textrm{vartheta} & \vartheta & &
\hspace{10}\backslash\textrm{varpi} & \varpi & \\
\hspace{10}\backslash\textrm{varrho} & \varrho & &
\hspace{10}\backslash\textrm{varsigma} & \varsigma & &
\hspace{10}\backslash\textrm{varphi} & \varphi & \\
\; \\ \hline
\end{array}"
alt="" border=0 align="middle"></a></center>
<p> Finally, some of the math symbols supported by mimeTeX are illustrated
below. Operators shown in two sizes are automatically
"promoted" to the larger size in   <b>\displaystyle</b>
mode. For example,
<b>f(x)=\int_{-\infty}^x e^{-t^2}dt</b> renders
<a href="#preview"><img id="mathsy1" onclick="eqntext('mathsy1')"
src="../cgi-bin/mimetex.cgi?\textstyle f(x)=\int_{-\infty}^x e^{-t^2}dt"
alt="" border=0 align="middle"></a>
whereas
<b>\displaystyle f(x)=\int_{-\infty}^x e^{-t^2}dt</b>
renders
<a href="#preview"><img id="mathsy2" onclick="eqntext('mathsy2')"
src="../cgi-bin/mimetex.cgi?\displaystyle
f(x)=\int_{-\infty}^x e^{-t^2}dt" alt="" border=0 align="middle"></a>
</p>
<center><a href="#preview"><img id="mthtbl1" onclick="eqntext('mthtbl1')"
src="../cgi-bin/mimetex.cgi?\large\textstyle
\begin{array}{|l98c28c28|l98c28c28|l98c28c28|}
\hline \; \\
\hspace{10}\backslash\textrm{cdot} & \cdot & &
\hspace{10}\backslash\textrm{times} & \times & &
\hspace{10}\backslash\textrm{ast} & \ast & \\
\hspace{10}\backslash\textrm{div} & \div & &
\hspace{10}\backslash\textrm{diamond} & \diamond & &
\hspace{10}\backslash\textrm{pm} & \pm & \\
\hspace{10}\backslash\textrm{mp} & \mp & &
\hspace{10}\backslash\textrm{oplus} & \oplus & \Bigoplus &
\hspace{10}\backslash\textrm{ominus} & \ominus & \\
\hspace{10}\backslash\textrm{otimes} & \otimes & \Bigotimes &
\hspace{10}\backslash\textrm{oslash} & \oslash & &
\hspace{10}\backslash\textrm{odot} & \odot & \Bigodot \\
\hspace{10}\backslash\textrm{bigcirc} & \bigcirc & &
\hspace{10}\backslash\textrm{circ} & \circ & &
\hspace{10}\backslash\textrm{bullet} & \bullet & \\
\hspace{10}\backslash\textrm{asymp} & \asymp & &
\hspace{10}\backslash\textrm{equiv} & \equiv & &
\hspace{10}\backslash\textrm{subseteq} & \subseteq & \\
\hspace{10}\backslash\textrm{supseteq} & \supseteq & &
\hspace{10}\backslash\textrm{leq} & \leq & &
\hspace{10}\backslash\textrm{geq} & \geq & \\
\hspace{10}\backslash\textrm{preceq} & \preceq & &
\hspace{10}\backslash\textrm{succeq} & \succeq & &
\hspace{10}\backslash\textrm{sim} & \sim & \\
\hspace{10}\backslash\textrm{approx} & \approx & &
\hspace{10}\backslash\textrm{subset} & \subset & &
\hspace{10}\backslash\textrm{supset} & \supset & \\
\hspace{10}\backslash\textrm{ll} & \ll & &
\hspace{10}\backslash\textrm{gg} & \gg & &
\hspace{10}\backslash\textrm{prec} & \prec & \\
\hspace{10}\backslash\textrm{succ} & \succ & &
\hspace{10}\normalsize\backslash\textrm{leftarrow} & \leftarrow & &
\hspace{10}\normalsize\backslash\textrm{rightarrow} & \rightarrow & \\
\hspace{10}\normalsize\backslash\textrm{uparrow} & \uparrow & &
\hspace{10}\normalsize\backslash\textrm{downarrow} & \downarrow & &
\hspace{10}\normalsize\backslash\textrm{leftrightarrow}&&\leftrightarrow\\
\hspace{10}\backslash\textrm{nearrow} & \nearrow & &
\hspace{10}\backslash\textrm{searrow} & \searrow & &
\hspace{10}\backslash\textrm{simeq} & \simeq & \\
\hspace{10}\normalsize\backslash\textrm{Leftarrow} & \Leftarrow & &
\hspace{10}\normalsize\backslash\textrm{Rightarrow} & \Rightarrow & &
\hspace{10}\normalsize\backslash\textrm{Uparrow} & \Uparrow & \\
\hspace{10}\normalsize\backslash\textrm{Downarrow} & \Downarrow & &
\hspace{10}\normalsize\backslash\textrm{Leftrightarrow}&&\Leftrightarrow&
\hspace{10}\backslash\textrm{nwarrow} & \nwarrow & \\
\hspace{10}\backslash\textrm{swarrow} & \swarrow & &
\hspace{10}\backslash\textrm{propto} & \propto & &
\hspace{10}\backslash\textrm{prime} & \prime & \\
\hspace{10}\backslash\textrm{infty} & \infty & &
\hspace{10}\backslash\textrm{in} & \in & &
\hspace{10}\backslash\textrm{ni} & \ni & \\
\hspace{10}\backslash\textrm{triangle} & \triangle & &
\hspace{10}\normalsize\backslash\textrm{bigtriangledown}&&\bigtriangledown&
\hspace{10}\backslash^\prime & \' & \\
\hspace{10}\textrm{/} & / & &
\hspace{10}\backslash\textrm{forall} & \forall & &
\hspace{10}\backslash\textrm{exists} & \exists & \\
\hspace{10}\backslash\textrm{neg} & \neg & &
\hspace{10}\backslash\textrm{emptyset} & \emptyset & &
\hspace{10}\backslash\textrm{Re} & \Re & \\
\hspace{10}\backslash\textrm{Im} & \Im & &
\hspace{10}\backslash\textrm{top} & \top & &
\hspace{10}\backslash\textrm{bot} & \bot & \\
\hspace{10}\backslash\textrm{aleph} & \aleph & &
\hspace{10}\normalsize\backslash\textrm{mathcal\lbrace A\rbrace}&\;\mathcal{A}&....&
.... \normalsize\backslash\textrm{mathcal\lbrace Z\rbrace}&\;\mathcal{Z}&\\
\; \\ \hline
\end{array}"
alt="" border=0 align="middle"></a><br>
<a href="#preview"><img id="mthtbl2" onclick="eqntext('mthtbl2')"
src="../cgi-bin/mimetex.cgi?\large\textstyle
\begin{array}{|l98c28c28|l98c28c28|l98c28c28|}
\hline \; \\
\hspace{10}\backslash\textrm{cup} & \cup & \Bigcup &
\hspace{10}\backslash\textrm{cap} & \cap & \Bigcap &
\hspace{10}\backslash\textrm{uplus} & \uplus & \Biguplus \\
\hspace{10}\backslash\textrm{wedge} & \wedge & \Bigwedge &
\hspace{10}\backslash\textrm{vee} & \vee & \Bigvee &
\hspace{10}\backslash\textrm{vdash} & \vdash & \\
\hspace{10}\backslash\textrm{dashv} & \dashv & &
\hspace{10}\backslash\textrm{lfloor} & \lfloor & &
\hspace{10}\backslash\textrm{rfloor} & \rfloor & \\
\hspace{10}\backslash\textrm{lceil} & \lceil & &
\hspace{10}\backslash\textrm{rceil} & \rceil & &
\hspace{10}\backslash\textrm{lbrace} & \lbrace & \\
\hspace{10}\backslash\textrm{rbrace} & \rbrace & &
\hspace{10}\backslash\textrm{langle} & \langle & &
\hspace{10}\backslash\textrm{rangle} & \rangle & \\
\hspace{10}\backslash\textrm{mid} & \mid & &
\hspace{10}\backslash\textrm{parallel} & \parallel & &
\hspace{10}\normalsize\backslash\textrm{updownarrow}& & \updownarrow \\
\hspace{10}\normalsize\backslash\textrm{Updownarrow}& & \Updownarrow &
\hspace{10}\backslash\textrm{setminus} & \setminus & &
\hspace{10}\backslash\textrm{wr} & \wr & \\
\hspace{10}\backslash\textrm{surd} & \raisebox{15}\surd & &
\hspace{10}\backslash\textrm{amalg} & \amalg & &
\hspace{10}\backslash\textrm{nabla} & \nabla & \\
\hspace{10}\backslash\textrm{int} & \int & \Bigint &
\hspace{10}\backslash\textrm{sqcup} & \sqcup & \Bigsqcup &
\hspace{10}\backslash\textrm{sqcap} & \sqcap & \\
\hspace{10}\normalsize\backslash\textrm{sqsubseteq} & \sqsubseteq & &
\hspace{10}\normalsize\backslash\textrm{sqsupseteq} & \sqsupseteq & &
\hspace{10}\backslash\textrm{S} & \S & \\
\hspace{10}\backslash\textrm{dag} & \dag & &
\hspace{10}\backslash\textrm{ddag} & \ddag & &
\hspace{10}\backslash\textrm{P} & \P & \\
\hspace{10}\backslash\textrm{clubsuit} & \clubsuit & &
\hspace{10}\backslash\textrm{Diamond} & \Diamond & &
\hspace{10}\backslash\textrm{Heart} & \Heart & \\
\hspace{10}\backslash\textrm{spadesuit} & \spadesuit & \\
\; \\ \hline
\end{array}"
alt="" border=0 align="middle"></a><br>
<a href="#preview"><img id="mthtbl3" onclick="eqntext('mthtbl3')"
src="../cgi-bin/mimetex.cgi?\large\textstyle
\begin{array}{|l98c28c28|l98c28c28|l98c28c28|}
\hline \; \\
\hspace{10}\backslash\textrm{oint} & \oint & \Bigoint &
\hspace{10}\backslash\textrm{sum} & \sum & \Bigsum &
\hspace{10}\backslash\textrm{prod} & \prod & \Bigprod \\
\hspace{10}\backslash\textrm{coprod} & \coprod & \Bigcoprod \\
\; \\ \hline \; \\
\hspace{10}\normalsize\backslash\textrm{leftharpoonup} &&\leftharpoonup&
\normalsize\backslash\textrm{leftharpoondown} &&\;\leftharpoondown&
\hspace{10}\normalsize\backslash\textrm{rightharpoonup}&&\rightharpoonup\\
\normalsize\backslash\textrm{rightharpoondown}&&\;\rightharpoondown&
\hspace{10}\normalsize\backslash\textrm{triangleright} &&\triangleright&
\hspace{10}\normalsize\backslash\textrm{triangleleft} &&\triangleleft\\
\normalsize\backslash\textrm{rightleftharpoons}&&\;\rightleftharpoons&
\hspace{10}\backslash\textrm{star} & \LARGE{\star} & &
\hspace{10}\backslash\textrm{partial} & \partial & \\
\hspace{10}\backslash\textrm{flat} & \flat & &
\hspace{10}\backslash\textrm{natural} & \natural & &
\hspace{10}\backslash\textrm{sharp} & \sharp & \\
\hspace{10}\backslash\textrm{smile} & \smile & &
\hspace{10}\backslash\textrm{frown} & \frown & &
\hspace{10}\backslash\textrm{ell} & \ell & \\
\hspace{10}\backslash\textrm{imath} & \imath & &
\hspace{10}\backslash\textrm{jmath} & \jmath & &
\hspace{10}\backslash\textrm{wp} & \wp & \\
\; \\ \hline \; \\
\hspace{10}\backslash\textrm{ss} & \ss & &
\hspace{10}\backslash\textrm{ae} & \ae & &
\hspace{10}\backslash\textrm{oe} & \oe & \\
\hspace{10}\backslash\textrm{AE} & \AE & &
\hspace{10}\backslash\textrm{OE} & \OE & \\
\; \\ \hline \; \\
\hspace{10}\backslash\textrm{AA} & \AA & &
\hspace{10}\backslash\textrm{aa} & \aa & &
\hspace{10}\backslash\textrm{hbar} & \hbar & \\
\hspace{10}\backslash\textrm{ldots} & \ldots & &
\hspace{10}\backslash\textrm{cdots} & \cdots & &
\hspace{10}\backslash\textrm{vdots} & \vdots & \\
\hspace{10}\backslash\textrm{ddots} & \ddots & &
\hspace{10}\backslash\textrm{angle} & \angle & &
\hspace{10}\backslash\textrm{iint} & \iint & \Bigiint \\
\; \\ \hline
\end{array}"
alt="" border=0 align="middle"></a></center>
<h3> <a name="sizes">Font Sizes<font size=5>...</font></a> </h3>
<p> MimeTeX currently has eight font sizes, numbered 0-7, with default 3.
This font size numbering corresponds to the usual LaTeX directives
<b>\tiny</b>, <b>\small</b>, <b>\normalsize</b>,
<b>\large</b> (default), <b>\Large</b>,
<b>\LARGE</b>, <b>\huge</b> and <b>\Huge</b>.
These directives can be placed anywhere in a mimeTeX expression,
and they change font size from that point forwards. However, as usual,
a font size change inside a <b>{ }</b>-subexpression remains
in effect only within that subexpression. </p>
<p> In mimeTeX you may also write <b>\fontsize{0}...\fontsize{7}</b> or
the shorter <b>\fs{0},...,\fs{7}</b> for <b>\tiny,...,\Huge</b>.
And since these arguments are all single digits, the even shorter
form <b>\fs0,...,\fs7</b> works equally well. For example, </p>
<center> <table cellpadding=0>
<tr align=center>
<td align="left"> <b>0</b>:
<img src="../cgi-bin/mimetex.cgi?<b>\tiny</b> f(x)=x^2">
produces... </td>
<td> <a href="#preview"><img id="sizes0" onclick="eqntext('sizes0')"
src="../cgi-bin/mimetex.cgi?\tiny f(x)=x^2"
alt="" border=0 align=middle></a> </td> </tr>
<tr align=center>
<td align="left"> <b>1</b>:
<img src="../cgi-bin/mimetex.cgi?<b>\fs1</b> f(x)=x^2"> </td>
<td> <a href="#preview"><img id="sizes1" onclick="eqntext('sizes1')"
src="../cgi-bin/mimetex.cgi?\fs1 f(x)=x^2"
alt="" border=0 align=middle></a> </td> </tr>
<tr align=center>
<td align="left"> <b>2</b>:
<img src="../cgi-bin/mimetex.cgi?<b>\normalsize</b> f(x)=x^2"> </td>
<td> <a href="#preview"><img id="sizes1" onclick="eqntext('sizes1')"
src="../cgi-bin/mimetex.cgi?\normalsize f(x)=x^2"
alt="" border=0 align=middle></a> </td> </tr>
<tr align=center>
<td align="left"> <b>3</b>:
<img src="../cgi-bin/mimetex.cgi?<b></b>f(x)=x^2"> </td>
<td> <a href="#preview"><img id="sizes3" onclick="eqntext('sizes3')"
src="../cgi-bin/mimetex.cgi?f(x)=x^2"
alt="" border=0 align=middle></a> </td> </tr>
<tr align=center>
<td align="left"> <b>4</b>:
<img src="../cgi-bin/mimetex.cgi?<b>\Large</b> f(x)=x^2"> </td>
<td> <a href="#preview"><img id="sizes4" onclick="eqntext('sizes4')"
src="../cgi-bin/mimetex.cgi?\Large f(x)=x^2"
alt="" border=0 align=middle></a> </td> </tr>
<tr align=center>
<td align="left"> <b>5</b>:
<img src="../cgi-bin/mimetex.cgi?<b>\fs5</b> f(x)=x^2"> </td>
<td> <a href="#preview"><img id="sizes5" onclick="eqntext('sizes5')"
src="../cgi-bin/mimetex.cgi?\fs5f(x)=x^2"
alt="" border=0 align=middle></a> </td> </tr>
<tr align=center>
<td align="left"> <b>6</b>:
<img src="../cgi-bin/mimetex.cgi?<b>\huge</b> f(x)=x^2"> </td>
<td> <a href="#preview"><img id="sizes6" onclick="eqntext('sizes6')"
src="../cgi-bin/mimetex.cgi?\huge f(x)=x^2"
alt="" border=0 align=middle></a> </td> </tr>
<tr align=center>
<td align="left"> <b>7</b>:
<img src="../cgi-bin/mimetex.cgi?<b>\fs7</b> f(x)=x^2"> </td>
<td> <a href="#preview"><img id="sizes7" onclick="eqntext('sizes7')"
src="../cgi-bin/mimetex.cgi?\fs7 f(x)=x^2"
alt="" border=0 align=middle></a> </td> </tr>
</table> </center> <p class="continue">
rendering <b>f(x)=x^2</b> in mimeTeX font sizes
<b>0</b> (\tiny or \fs0), <b>1</b> (\small or \fs1),
<b>2</b> (\normalsize or \fs2), <b>3</b> (default \large),
<b>4</b> (\Large or \fs4), <b>5</b> (\LARGE or \fs5),
<b>6</b> (\huge or \fs6) and <b>7</b> (\Huge or \fs7). </p>
<p> You'll soon notice that exponents and \frac's and \atop's
are automatically rendered one size smaller than their base
expressions. For example, </p> <center>
<b>\Large y=e^{x^2}</b> produces
<a href="#preview"><img id="sizes4" onclick="eqntext('sizes4')"
src="../cgi-bin/mimetex.cgi?\Large y=e^{x^2}"
alt="" border=0 align=middle></a> </center> <p class="continue">
rendering the <b>"y=e"</b> in font size 4 (\Large), the <b>"x"</b> in
font size 3 (\large), and the <b>"2"</b> in font size 2 (\normalsize).
If you get below font size 0, the font size remains 0. </p>
<p> Explicit size declarations override mimeTeX's default sizing behavior.
You can rewrite the preceding example as, say, </p> <center>
<b>\Large y=e^{\normalsize x^{\tiny2}}</b> which now produces
<a href="#preview"><img id="sizes5" onclick="eqntext('sizes5')"
src="../cgi-bin/mimetex.cgi?\Large y=e^{\normalsize x^{\tiny2}}"
alt="" border=0 align=middle></a> </center> <p class="continue">
rendering the <b>"y=e"</b> in font size 4 (\Large unchanged),
the <b>"x"</b> in font size 2 (\normalsize), and the <b>"2"</b>
in font size 0 (\tiny). </p>
<p> Preceding an <b>\fs{ }</b> size argument with <b>+</b> or
<b>-</b> specifies "relative" sizing. For example,
<b>\large\text{abc{\fs{-2}def}ghi}</b> produces
<a href="#preview"><img id="sizes6" onclick="eqntext('sizes6')"
src="../cgi-bin/mimetex.cgi?\large\text{abc{\fs{-2}def}ghi}"
alt="" border=0 align=middle></a>, rendering the <b>"def"</b>
in font size 1 (two sizes smaller than \large). Note that
<b>\fs{-2}</b> affects only the subexpression in which it appears,
and that its braces are no longer optional since <b>-2</b> contains
two characters. For exponents (or any other size-changing commands
like \frac), </p> <center>
<b>\Large y=e^{\fs{-1}x^2}</b> produces
<a href="#preview"><img id="sizes7" onclick="eqntext('sizes7')"
src="../cgi-bin/mimetex.cgi?\Large y=e^{\fs{-1}x^2}"
alt="" border=0 align=middle></a> </center> <p class="continue">
rendering the <b>"y=e"</b> in font size 4 (\Large), as usual.
The <b>"x"</b> would usually be rendered one size smaller,
in font size 3, and your <b>\fs{-1}</b> is applied to that,
resulting in font size 2. And the final <b>"2"</b> is rendered,
by the usual rules, one size smaller than the <b>"x"</b>,
in font size 1. </p>
<p> Finally, illustrated below are some examples of fonts and symbols
at several mimeTeX sizes. All symbols and sizes from cmr, cmmi,
cmmib (use <b>\mathbf{ }</b>), cmsy, cmex, bbold (use
<b>\mathbb{ }</b>), rsfs (use <b>\mathscr{ }</b>),
stmary and cyrillic wncyr (use <b>{\cyr }</b> or
<b>\cyr{ }</b>) should be available, but they're not all shown.
<!-- And also not shown are various "constructed symbols" like \sqrt,
accents, etc. --> The illustrated font sizes are numbered 4=\Large,
3=\large and 2=\normalsize (not shown are 7=\Huge, 6=\huge,
5=\LARGE, 1=\small and 0=\tiny). </p>
<center> <table cellspacing="7">
<tr> <td align="left">
<font size="4">cmmi latin uppercase, and lowercase</font>
<br><img src="../cgi-bin/mimetex.cgi?\array{r$
2$\rm~size~4:~&4$A&4$B&4$C&4$D,&4$a&4$b&4$c&4$d\\
2$\rm~3:~&3$E&3$F&3$G&3$H&3$I&3$J&3$K&3$L,&3$e&3$f&3$g&3$h&3$i&3$j&3$k&3$l\\
2$\rm~2:~&2$M&2$N&2$O&2$P&2$Q&2$R&2$S&2$T&2$U&2$V&2$W&2$X&2$Y&2$Z,&
2$m&2$n&2$o&2$p&2$q&2$r&2$s&2$t&2$u&2$v&2$w&2$x&2$y&2$z}"
alt="" border=0 align=middle>
</td> <tr>
<tr> <td align="left">
<font size="4">calligraphic, and rsfs (<b>\cal{A}, \scr{B}, etc</b>)</font>
<br><img src="../cgi-bin/mimetex.cgi?\array{r$
2$\rm~size~4:~&4$\calA&4$\calB&4$\calC&4$\calD&4$\calE&4$\calF&4$\calG,&
4$\scrA&4$\scrB&4$\scrC&4$\scrD&4$\scrE&4$\scrF&4$\scrG\\
2$\rm~3:~&3$\calH&3$\calI&3$\calJ&3$\calK&3$\calL&3$\calM&3$\calN&3$\calO&
3$\calP,&
3$\scrH&3$\scrI&3$\scrJ&3$\scrK&3$\scrL&3$\scrM&3$\scrN&3$\scrO&3$\scrP\\
2$\rm~2:~&2$\calQ&2$\calR&2$\calS&2$\calT&2$\calU&
2$\calV&2$\calW&2$\calX&2$\calY&2$\calZ,&
2$\scrQ&2$\scrR&2$\scrS&2$\scrT&2$\scrU&2$\scrV&2$\scrW&
2$\scrX&2$\scrY&2$\scrZ}"
alt="" border=0 align=middle>
</td> <tr>
<tr> <td align="left">
<font size="4">cmmi greek uppercase, and \var lowercase</font>
<br><img src="../cgi-bin/mimetex.cgi?\array{r$
2$\rm~size~4:~&4$\Gamma&4$\Delta&4$\Theta&4$\Lambda&4$\Xi&4$\Pi&4$\Sigma&
4$\Upsilon&4$\Phi&4$\Psi&4$\Omega,&4$\rm~~&4$\varepsilon&4$\vartheta&4$\varpi&
4$\varrho&4$\varsigma&4$\varphi\\
2$\rm~3:~&3$\Gamma&3$\Delta&3$\Theta&3$\Lambda&3$\Xi&3$\Pi&3$\Sigma&
3$\Upsilon&3$\Phi&3$\Psi&3$\Omega,&~&3$\varepsilon&3$\vartheta&3$\varpi&
3$\varrho&3$\varsigma&3$\varphi\\
2$\rm~2:~&2$\Gamma&2$\Delta&2$\Theta&2$\Lambda&2$\Xi&2$\Pi&2$\Sigma&
2$\Upsilon&2$\Phi&2$\Psi&2$\Omega,&~&2$\varepsilon&2$\vartheta&2$\varpi&
2$\varrho&2$\varsigma&2$\varphi}"
alt="" border=0 align=middle>
</td> <tr>
<tr> <td align="left">
<font size="4">cmmi greek lowercase</font>
<br><img src="../cgi-bin/mimetex.cgi?\array{r$
2$\rm~size~4:~&4$\alpha&4$\beta&4$\gamma&4$\delta&4$\epsilon&4$\zeta&
4$\eta&4$\theta&4$\iota&4$\kappa&4$\lambda&4$\mu&4$\nu&4$\xi&4$%%\omicron%%&
4$\pi&4$\rho&4$\sigma&4$\tau&4$\upsilon&4$\phi&4$\chi&4$\psi&4$\omega\\
2$\rm~3:~&3$\alpha&3$\beta&3$\gamma&3$\delta&3$\epsilon&3$\zeta&
3$\eta&3$\theta&3$\iota&3$\kappa&3$\lambda&3$\mu&3$\nu&3$\xi&3$%%\omicron%%&
3$\pi&3$\rho&3$\sigma&3$\tau&3$\upsilon&3$\phi&3$\chi&3$\psi&3$\omega\\
2$\rm~2:~&2$\alpha&2$\beta&2$\gamma&2$\delta&2$\epsilon&2$\zeta&
2$\eta&2$\theta&2$\iota&2$\kappa&2$\lambda&2$\mu&2$\nu&2$\xi&2$%%\omicron%%&
2$\pi&2$\rho&2$\sigma&2$\tau&2$\upsilon&2$\phi&2$\chi&2$\psi&2$\omega}"
alt="" border=0 align=middle>
</td> <tr>
<tr> <td align="left">
<font size="4">cmsy symbols at mimeTeX font size 3</font><br>
<font size="3">(operators shown large are automatically "promoted"<br>
to the larger size in \displaystyle mode)</font>
<br><img src="../cgi-bin/mimetex.cgi?\array{3,r$1$\rm~chars~\\
1$\rm~0-15:~&-&\cdot&\times&\ast&\div&\diamond&\pm&\mp&
\oplus&\ominus&\otimes&\oslash&\odot&\bigcirc&\circ&\bullet\\
1$\rm~16-31:~&\asymp&\equiv&\subseteq&\supseteq&\leq&\geq&\preceq&\succeq&
\sim&\approx&\subset&\supset&\ll&\gg&\prec&\succ\\
1$\rm~32-47:~&\leftar&\rightar&\uparr&\downar&\leftrightar&\near&\sear&
\simeq&\Leftar&\Rightar&\Upar&\Downar&\Leftrightar&\nwar&\swar&\propto\\
1$\rm~48-63:~&\prime&\infty&\in&\ni&\triangle&\bigtriangledo&/&\'&
\forall&\exists&\neg&\emptyset&\Re&\Im&\top&\bot\\
1$\rm~64-100:~&\aleph&&\calA&4$.\,.\,.&\calZ&&\cup&\cap&
\uplus&\wedge&\vee&\vdash&\dashv&\lfloor&\rfloor&\lceil\\
1$\rm~101-116:~&\rceil&\lbrace&\rbrace&\langle&\rangle&\mid&\parallel&
\updownar&\Updownar&\setminus&\wr&\surd&\amalg&\nabla&\int&\sqcup\\
1$\rm~117-127:~&\sqcap&\sqsubseteq&\sqsupseteq&\S&\dag&\ddag&\P&\clubsuit&
\Diamond&\Heart&\spadesuit}" alt="" border=0 align=middle>
</td> <tr>
<tr> <td align="left">
<font size="4">a few other cmmi, cmr, stmary and wncyr symbols
at mimeTeX font size 4</font>
<br><img src="../cgi-bin/mimetex.cgi?\array{4,r$
1$\rm~cmmi:~&\leftharpoonup&\leftharpoondo&\rightharpoonup&\rightharpoondo&
\triangleright&\triangleleft&\star&\partial&
\flat&\natural&\sharp&\smile&\frown&\ell&\imath&\jmath&\wp&\vec\\
1$\rm~cmr:~&\ss&\ae&\oe&\AE&\OE \\
1$\rm~stmary:~&\moo&\Lbag&\Rbag&\lightning&\llbracket&\rrbracket&
\subsetpluseq&\supsetpluseq&\Yup&\Ydown\\
1$\rm~wncyr:~&\cyr A&\cyr a&\cyr B&\cyr b&\cyr V&\cyr v&\cyr G&\cyr g&
\cyr D&\cyr d&\cyr Dj&\cyr dj&\cyr\=E&\cyr\=e&\cyr Zh&\cyr zh}"
alt="" border=0 align=middle>
</td> <tr>
</table> </center>
<h3> <a name="modes">Modes<font size=5>...</font></a> </h3>
<p> MimeTeX is always in a math-like mode, so you needn't surround
expressions with <b>$...$</b>'s for <b>\textstyle</b>,
or <b>$$...$$</b>'s for <b>\displaystyle</b>.
<!-- or <b>\[...\]</b>'s, etc. In fact, mimeTeX interprets <b>$</b>
as a "preamble" terminator (e.g., see <a href="#array">\array</a>
below), and interprets <b>\[...\]</b> as an abbreviation for
<b>\left[...\right]</b>. -->
By default, operator limits like <b>\int_a^b</b> are rendered
<b>\textstyle</b> <a href="#preview">
<img id="modes99a" onclick="eqntext('modes99a')"
src="../cgi-bin/mimetex.cgi?\normalsize\int_a^b"
alt="" border=0 align=middle></a> at font sizes <b>\normalsize</b>
and smaller, and rendered <b>\displaystyle</b> <a href="#preview">
<img id="modes99b" onclick="eqntext('modes99b')"
src="../cgi-bin/mimetex.cgi?\large\int_a^b"
alt="" border=0 align=middle></a> at font sizes <b>\large</b> and
larger (see the <b>-DDISPLAYSIZE</b>
<a href="#options">compile option</a> to change this default).
And when <b>\displaystyle</b> is invoked (either implicitly at font size
<b>\large</b> or larger, or if you explicitly write <b>\displaystyle</b>
at any font size), then operators <b>\int</b>, <b>\sum</b>,
<b>\prod</b>, etc, are automatically promoted to larger sizes.
<!-- their <a href="#characters">\Bigxxx</a> counterparts. -->
<!-- Conversely, <b>\displaystyle</b> is applied to all
<a href="#characters">\Bigxxx</a> operators regardless of font size. -->
<!-- i.e., super/subscripts are placed directly above/below
<b>\Bigsum</b>, but "alongside" <b>\sum</b>. -->
For example, </p> <center>
<!-- <b>\Bigsum_{i=1}^ni=\frac{n(n+1)}2</b> produces
<a href="#preview"><img id="modes1a" onclick="eqntext('modes1a')"
src="../cgi-bin/mimetex.cgi?
\normalsize\Bigsum_{i=1}^ni=\frac{n(n+1)}2"
alt="" border=0 align=middle></a>, <br> -->
<b>\normalsize \sum_{i=1}^ni=\frac{n(n+1)}2</b>
produces
<a href="#preview"><img id="modes2a" onclick="eqntext('modes2a')"
src="../cgi-bin/mimetex.cgi?\normalsize\sum_{i=1}^ni=\frac{n(n+1)}2"
alt="" border=0 align=middle></a>, whereas <br>
<b>\displaystyle \normalsize \sum_{i=1}^ni=\frac{n(n+1)}2</b>
produces
<a href="#preview"><img id="modes1b" onclick="eqntext('modes1b')"
src="../cgi-bin/mimetex.cgi?
\normalsize\displaystyle\sum_{i=1}^ni=\frac{n(n+1)}2"
alt="" border=0 align=middle></a>, </center>
<p class=continue> and <!-- replacing <b>\Bigsum</b> with the smaller
<b>\sum</b> symbol, --> </p> <center>
<b>\large \sum_{i=1}^ni=\frac{n(n+1)}2</b> produces
<a href="#preview"><img id="modes1b" onclick="eqntext('modes1b')"
src="../cgi-bin/mimetex.cgi?\large\sum_{i=1}^ni=\frac{n(n+1)}2"
alt="" border=0 align=middle></a>, whereas <br>
<b>\textstyle \large \sum_{i=1}^ni=\frac{n(n+1)}2</b>
produces
<a href="#preview"><img id="modes2b" onclick="eqntext('modes2b')"
src="../cgi-bin/mimetex.cgi?\textstyle\large
\sum_{i=1}^ni=\frac{n(n+1)}2" alt="" border=0 align=middle></a>.
<!-- instead. --> </center>
<p> As usual, <b>\nolimits</b> turns displaystyle off (or textstyle on)
for the operator immediately preceding it. For example, </p> <center>
<b>\large \sum\nolimits_{i=1}^ni=\frac{n(n+1)}2</b>
produces
<a href="#preview"><img id="modes3" onclick="eqntext('modes3')"
src="../cgi-bin/mimetex.cgi?
\large\sum\nolimits_{i=1}^ni=\frac{n(n+1)}2"
alt="" border=0 align=middle></a></center> <p class="continue">
and likewise, <b>\limits</b> turns displaystyle on for the operator
immediately preceding it. For example, </p> <center>
<b>\normalsize \sum\limits_{i=1}^ni=\frac{n(n+1)}2</b>
produces
<a href="#preview"><img id="modes4" onclick="eqntext('modes4')"
src="../cgi-bin/mimetex.cgi?
\normalsize\sum\limits_{i=1}^ni=\frac{n(n+1)}2"
alt="" border=0 align=middle></a> </center>
<p> By the way, <b>\limits</b> affects <i><b>_any_</b></i> character
or subexpression immediately preceding it. For example, </p> <center>
<b>A^i_j</b> produces
<a href="#preview"><img id="modes5" onclick="eqntext('modes5')"
src="../cgi-bin/mimetex.cgi?\large A^i_j"
alt="" border=0 align=middle></a> as usual, whereas <br>
<b>A\limits^i_j</b> produces
<a href="#preview"><img id="modes6" onclick="eqntext('modes6')"
src="../cgi-bin/mimetex.cgi?\large A\limits^i_j"
alt="" border=0 align=middle></a> instead. </center>
<p class="continue">Likewise, for subexpressions, </p> <center>
<b>\widehat{xyz}\limits^a</b> produces
<a href="#preview"><img id="modes7" onclick="eqntext('modes7')"
src="../cgi-bin/mimetex.cgi?\large\widehat{xyz}\limits^a"
alt="" border=0 align=middle></a> </center> <p class="continue">
This side effect may occasionally be useful. For example, </p> <center>
<b>x\rightarrow\limits^gy</b> produces
<a href="#preview"><img id="modes8" onclick="eqntext('modes8')"
src="../cgi-bin/mimetex.cgi?\large x\rightarrow\limits^gy"
alt="" border=0 align=middle></a> </center> <p class="continue">
(mimeTeX automatically centers super/subscripts above/below
the long and Long <a href="#arrows">arrow</a> forms) </p>
<p> The <b>\displaystyle</b> command turns on displaystyle math mode for
the entire expression (or <b>{ }</b>-enclosed subexpression),
affecting <b><i>_all_</i></b> super/subscripts to the right
of the \displaystyle, except for character classes Ordinary and
Variable (TeXbook page 154). Similarly, <b>\textstyle</b> turns
off displaystyle math mode. For example, </p> <center>
<b>\sum_1^n {\displaystyle\sum_1^k\sum_1^lx_i^j} \sum_1^m</b>
produces
<a href="#preview"><img id="modes9" onclick="eqntext('modes9')"
src="../cgi-bin/mimetex.cgi?\normalsize\sum_1^n
{\displaystyle\sum_1^k\sum_1^lx_i^j}\sum_1^m"
alt="" border=0 align=middle></a> </center> <p class="continue">
Note that <b>\sum</b>'s within the subexpression are all affected by
the beginning <b>\displaystyle</b>, but not the Variable <b>x_i^j</b>.
An explicit <b>x\limits_i^j</b> always affects any preceding term. </p>
<h3> <a name="textboxes">text boxes<font size=5>...</font></a> </h3>
<p> Finally, mimeTeX also has a text-like/roman mode
entered by writing either <b>\text{anything at all}</b>
or the equivalent LaTeX-2.09-like command
<b>{\rm anything at all}</b>, both of which render
<b>anything at all</b> in roman (font family cmr10).
<b>\mbox{ }</b> and several similar LaTeX commands are
recognized by mimeTeX as synonyms for <b>\text{ }</b>.
For italic, write <b>\textit{anything at all}</b> or
<b>{\it anything at all}</b>, both of which render
<b>anything at all</b> in italic (font family cmmi10).
All four forms respect spaces between words, except that the
first/required space after <b>{\rm etc}</b> and
<b>{\it etc}</b> is still ignored. <!-- Math <b>$...$</b>
subexpressions inside <b>\mbox{ }</b> or <b>\text{ }</b>
are treated in the usual way. --> For example, </p> <center>
<b>anything at all</b> just produces
<a href="#preview"><img id="textboxes1" onclick="eqntext('textboxes1')"
src="../cgi-bin/mimetex.cgi?\normalsize anything at all"
alt="" border=0 align=middle></a> whereas <br> <br>
<b>\text{anything at all}</b> produces
<a href="#preview"><img id="textboxes2" onclick="eqntext('textboxes2')"
src="../cgi-bin/mimetex.cgi?\normalsize\text{anything at all}"
alt="" border=0 align=middle></a> and <br> <br>
<b>\textit{anything at all}</b> produces
<a href="#preview"><img id="textboxes3" onclick="eqntext('textboxes3')"
src="../cgi-bin/mimetex.cgi?\normalsize\textit{anything at all}"
alt="" border=0 align=middle></a> instead. </center>
<p> You don't usually surround mimeTeX expressions with <b>$</b>'s,
but that works in the usual way for <b>\text{ }</b> and
<b>\mbox{ }</b>, rendering the <b>$...$</b>-enclosed
subexpression in mathmode. For example, </p> <center>
<b>n=\left\{m/2\text{ if $m$ even}
\\(m+1)/2\text{ if $m$ odd}\right.</b>
produces
<a href="#preview"><img id="textboxes9" onclick="eqntext('textboxes9')"
src="../cgi-bin/mimetex.cgi?
n=\left\{m/2\text{ if $m$ even}\\(m+1)/2\text{ if $m$ odd}\right."
alt="" border=0 align=middle></a> </center>
<h2> <a name="delimiters"> (IIIc) Delimiters </a> </h2>
<h3> <a name="parens">Parentheses and Braces
(delimiters)<font size=5>...</font></a> </h3>
<p> LaTeX's <b>\left( ... \right)</b> and the other 21
standard LaTeX delimiters are also recognized by mimeTeX.
And mimeTeX also recognizes an etex-like <b>\middle</b>.
<!-- may be written exactly
like that, or may be abbreviated <b>\(</b> and <b>\)</b> in mimeTeX.
Not all <b>\left</b> and <b>\right</b> LaTeX delimiters are currently
available in mimeTeX, but those that are can be written in the usual
way, or can be abbreviated as described above. One exception is
that <b>\left\|...\right\|</b> must instead be abbreviated
<b>\=...\=</b> or can be written in full <b>\left\|...\right\|</b>
as usual. Also, <b>\left\langle...\right\rangle</b> is abbreviated
<b>\<...\></b> . </p> -->
<!-- <p> Mixing abbreviated and unabbreviated delimiters within
a matching pair is not allowed, e.g., \left(...\) <b>_won't_</b> work.
But you can mix nested pairs, e.g., <b>\left(...\(...\)...\right)</b>
will work as long as the matching delimiters comprising each pair are
either both abbreviated or both unabbreviated. </p>
<p> --> Several of the most common automatically sized delimiters
are illustrated below... </p> <center>
<!-- <table cellpadding=3 cellspacing=0 border=1> -->
<table cellspacing=0 cellpadding=2 border=1>
<tr align=center>
<!-- <td> <b>LaTeX or <br> mimeTeX</b> </td> -->
<td> <b>Delimiter</b> </td>
<!-- <td> <b>or mimeTeX <br> abbreviation</b> </td> -->
<td> <b>example...</b> </td>
<td> <b>...renders</b> </td>
</tr>
<tr align=center>
<td> \left( ... \right) </td>
<!-- <td> \( ... \) </td> -->
<td> \left( \frac1{1-x^2} \right)^2 </td>
<td> <a href="#preview"><img id="parens1" onclick="eqntext('parens1')"
src="../cgi-bin/mimetex.cgi?\Large\left(\frac1{1-x^2}\right)^2"
alt="" border=0 align=middle></a> </td>
</tr>
<tr align=center>
<td> \left[ ... \right] </td>
<!-- <td> \[ ... \] </td> -->
<td> \left[ \frac1{\sqrt2}x - y \right]^n </td>
<td> <a href="#preview"><img id="parens2" onclick="eqntext('parens2')"
src="../cgi-bin/mimetex.cgi?\Large
\left[ \frac1{\sqrt2}x - y \right]^n"
alt="" border=0 align=middle></a> </td>
</tr>
<tr align=center>
<td> \left\{ ... \right\} </td>
<!-- <td> \{ ... \} </td> -->
<td> \left\{ 1^2,2^2,3^2,\ldots \right\} </td>
<td> <a href="#preview"><img id="parens3" onclick="eqntext('parens3')"
src="../cgi-bin/mimetex.cgi?
\large\left\{1^2,2^2,3^2,\ldots\right\}"
alt="" border=0 align=middle></a> </td>
</tr>
<tr align=center>
<td> \left\langle ...<br>
... \right\rangle </td>
<!-- <td> \< ... \> </td> -->
<td> \left\langle \varphi \middle| \hat H <br>
\middle| \phi \right\rangle </td>
<td> <a href="#preview"><img id="parens4" onclick="eqntext('parens4')"
src="../cgi-bin/mimetex.cgi?\Large
\left\langle\varphi\middle|\hat H\middle|\phi\right\rangle"
alt="" border=0 align=middle></a> </td>
</tr>
<tr align=center>
<td> \left| ... \right| </td>
<!-- <td> \| ... \| </td> -->
<td> \left| \begin{matrix} a_1 & a_2 \\<br>
a_3 & a_4 \end{matrix} \right|</td>
<td> <a href="#preview"><img id="parens5" onclick="eqntext('parens5')"
src="../cgi-bin/mimetex.cgi?\large
\left|\begin{matrix}a_1&a_2\\a_3&a_4\end{matrix}\right|"
alt="" border=0 align=middle></a> </td>
</tr>
<tr align=center>
<td> \left\| ... \right\| </td>
<!-- <td> \= ... \= </td> -->
<td> \left\|x^2-y^2\right\| </td>
<td> <a href="#preview"><img id="parens6" onclick="eqntext('parens6')"
src="../cgi-bin/mimetex.cgi?\large\left\|x^2-y^2\right\|"
alt="" border=0 align=middle></a> </td>
</tr>
<tr align=center>
<td> \left\{ ...
\right<font size="5"><b>.</b></font> </td>
<!-- <td> \{ ... \<b>.</b> </td> -->
<td> y=\left\{ \text{this\\that}
\right<font size="5"><b>.</b></font> </td>
<td> <a href="#preview"><img id="parens7" onclick="eqntext('parens7')"
src="../cgi-bin/mimetex.cgi?
\large y=\left\{\text{this\\that}\right."
alt="" border=0 align=middle></a> </td>
</tr>
<tr align=center>
<td> \left<font size="5"><b>.</b></font>
... \right\} </td>
<!-- <td> \<b>.</b> ... \} </td> -->
<td> \left<font size="5"><b>.</b></font>
\text{this\\that} \right\}=y </td>
<td> <a href="#preview"><img id="parens8" onclick="eqntext('parens8')"
src="../cgi-bin/mimetex.cgi?
\large\left.\text{this\\that}\right\}=y"
alt="" border=0 align=middle></a> </td>
</tr>
</table> </center>
<p> <b><u>Notes... </u></b> </p>
<ol compact type=1>
<!-- <li> The other LaTeX delimiters, i.e., floor's, ceil's,
arrows, etc, can't yet be sized to fit. </li> -->
<li> <a href="#sizes">Size declarations</a> inside any of the
above delimiter pairs affect only the enclosed subexpression,
e.g., <b>\Large w=\left(\small x+y\right)+z</b> produces
<a href="#preview"><img id="parens9" onclick="eqntext('parens9')"
src="../cgi-bin/mimetex.cgi?\Large w=\left(\small x+y\right)+z"
alt="" border=0 align=middle></a> </li>
<li> An expression may contain as many etex-like <b>\middle</b>'s as
you like, and in mimeTeX the surrounding <b>\left...\right</b>
isn't required. When omitted, the scope of <b>\middle</b> is
either the entire expression or the <b>{ }</b>-enclosed
subexpression in which the <b>\middle</b>'s occur. For example,
<b>\frac{a+1}b \middle/ \middle(\frac{c+1}d \middle/ \frac{e+1}f\middle)</b>
renders
<img src="../cgi-bin/mimetex.cgi?\large
\frac{a+1}b\middle/\middle(\frac{c+1}d\middle/\frac{e+1}f\middle)"
border=0 align=middle>. </li>
<li> In the last two examples, note that mimeTeX recognizes the
<b>\\</b> in <b>\text{this\\that}</b>
as a linebreak. For example, <b>x=1\\y=2\\z=3</b> renders
<a href="#preview"><img id="parens9b" onclick="eqntext('parens9b')"
src="../cgi-bin/mimetex.cgi?\small x=1\\y=2\\z=3"
alt="" border=0 align=middle></a> </li>
<!-- <li> An abbreviated left delimiter must be paired with the same
"type" of matching right delimiter, e.g., <b>\[...\]</b> works
whereas <b>\[...\)</b> doesn't work. To render an "unmatched"
pair of delimiters you must use the unabbreviated form, e.g.,
<b>\left[...\right)</b> works fine. </li> -->
<!-- <li> Similarly, "unusual" delimiter abbreviations like
<b>\)...\(</b> also don't work in mimeTeX. That is,
<b>(, [, <, {,</b> etc, must always be "left"
in mimeTeX, and <b>), ], >, },</b> etc,
must always be "right". To render "unusual" delimiter pairs you
must use the unabbreviated form, e.g., <b>\left)...\right[</b>
works fine. </li> -->
<!-- <li> <b>\right.</b> may be paired with any of the automatically
sized delimiters, and may optionally be abbreviated as <b>\.</b>
The same <b>\.</b> also serves as an abbreviation
for <b>\left.</b> MimeTeX correctly interprets your
intention if you correctly balance delimiters. For example,
either <b>y=\left\{{this\atop that}\right.</b> or
<b>y=\{{this\atop that}\.</b> renders the usual useful
construction
<a href="#preview"><img id="parens10" onclick="eqntext('parens10')"
src="../cgi-bin/mimetex.cgi?
\normalsize y=\{\text{this\atop that}\."
alt="" border=0 align=middle></a> illustrated above. </li> -->
<!-- <li> However, abbreviated <b>\.</b>'s cannot be nested in mimeTeX,
e.g., <b>\[\(...\.\.</b> doesn't work. Instead, unabbreviated
<b>\left.</b> and <b>\right.</b> may be nested, e.g.,
<b>\left[\left(...\right.\right.</b> works fine. </li> -->
<!-- <li> Simply nested abbreviations like <b>\[\(...\)\]</b> work
fine in mimeTeX. But abbreviated delimiters like <b>\|...\|</b>
and <b>\=...\=</b>, whose left and right forms are
identical, cannot be nested. To nest these delimiters you
must use the corresponding unabbreviated <b>\left|..\right|</b>
and <b>\left\|...\right\|</b>. </li> -->
<!-- <li> All <b>\left(...\right)</b>'s (and abbreviated
<b>\(...\)</b>'s), etc, must be correctly balanced,
which may include being matched with <b>\left.</b>
or <b>\right.</b> (or abbreviated <b>\.</b>).
And, to repeat, you may <b>_not_</b> mix
abbreviated and unabbreviated \(...\right), etc, within a
matching pair. </li> -->
</ol>
<p> Besides the <b>\left...\right</b> delimiters discussed above,
mimeTeX also supports constructions like
<b>\left\int_a^b...\right<b>.</b></b> , which automatically
sizes the <b>\left\int</b> to accommodate everything between it
and its matching <b>\right<b>.</b></b> delimiter.
The <b>\right</b> delimiter needn't necessarily be
the <b>\right<b>.</b></b> illustrated, e.g.,
<b>\left\int_a^b x^2dx =\frac{x^3}3\right|_a^b</b>
produces
<a href="#preview"><img id="parens11" onclick="eqntext('parens11')"
src="../cgi-bin/mimetex.cgi?\large
\left\int_a^bx^2dx=\frac{x^3}3\right|_a^b" border=0 alt=""
align=middle></a>. <!-- Except for Opening (TeX class 4) and
Closing (class 5) delimiter characters like <b>( )</b> and
<b>[ ]</b> and <b>\{ \}</b>, limits are default-rendered
\displaystyle, which is why <b>\right|\nolimits_a^b</b> was required. -->
You can also write <b>\left\sum</b>, <b>\left\prod</b>,
<b>\left\cup</b>, etc, for many of the symbols in CMEX10 and STMARY10.
And any symbol that works with <b>\left</b> will also work
with <b>\right</b> . <!-- But mimeTeX abbreviations like
<b>\(...\)</b> for <b>\left(...\right)</b>
won't work with any of these CMEX10 symbols. You'll have to write
the usual unabbreviated <b>\left...\right</b> form. --> </p>
<p> Unescaped <b>( )</b>'s and <b>[ ]</b>'s and <b>| |</b>'s
and <b>< ></b>'s don't need to be balanced since mimeTeX just
displays them like ordinary characters without any special significance.
Ditto for the usual four <b>\big(</b> and <b>\Big(</b> and <b>\bigg(</b>
and <b>\Bigg(</b>, and for their four right <b>)</b> counterparts, which
just display <b>(...)</b>'s at fixed larger sizes, and also have no
special significance. All four big <b>[ ]</b>'s and
<b>< ></b>'s and <b>{ }</b>'s are also available
as ordinary characters. </p>
<p> As usual, unescaped <b>{...}</b>'s aren't displayed at all,
must be balanced, and have the usual special LaTeX significance.
MimeTeX interprets escaped <b>\{...\}</b>'s as abbreviations
for <b>\left\{...\right\}</b> and therefore always sizes them to fit.
If you need displayed but unsized <b>{...}</b>'s, write
<b>\lbrace...\rbrace</b> or any of the four <b>\big{...\big}</b>'s. </p>
<h2> <a name="accents"> (IIId) Accents, Functions, Arrows,
Raise and rotate, Compose, Abbreviations, etc. </a> </h2>
<h3> Accents<font size=5>...</font> </h3>
<p class="continue">
<b>\vec{ } \hat{ } \bar{ } \tilde{ } \dot{ }
\ddot{ }</b> and <b>\acute{ } \grave{ }
\breve{ } \check{ }</b> are the only accents currently
supported. The first four are all "wide". For example, you can write
<b>\widehat{ }</b> if you like, but there's absolutely no
difference either way (and <b>\bar{ }</b> and
<b>\overline{ }</b> are identical). The last four accents
only take a single character argument. <p>
<p> Other accent-like directives available in mimeTeX are
<b>\underline{ } \cancel{ } \sout{ }</b>,
as well as
<b>\overset{ }{ } \underset{ }{ }</b>
and the more ususal
<b>\overbrace{ }^{ } \underbrace{ }_{ }</b>.
And <b>\not</b> also works on the single character immediately
following it. Some of these directives are discussed in more detail
below. </p>
<h3> <a name="functions">Function names<font size=5>...</font></a> </h3>
<p> All 32 usual LaTeX function names <b>\arccos</b>,...,<b>\tanh</b>
are recognized by mimeTeX and treated in the usual way. MimeTeX
also recognizes <b>\tr</b> for the trace, and also <b>\bmod</b>
and <b>\pmod</b>. And those functions that normally take "limits"
also behave as expected, e.g., </p> <center>
<b>\lim_{n\to\infty}S_n=S</b> produces
<a href="#preview"><img id="functions1" onclick="eqntext('functions1')"
src="../cgi-bin/mimetex.cgi?\large\lim_{n\to\infty}S_n=S"
alt="" border=0 align=middle></a> </center>
<h3> <a name="arrows">long Arrows<font size=5>...</font></a> </h3>
<p> All mimeTeX \long and \Long arrows take an optional [width] argument
that explicitly sets the arrow's width in pixels, scaled by
<a href="#unitlength">\unitlength</a>. For example,
<b>\longrightarrow[50]</b> draws a 50-pixel wide arrow
<a href="#preview"><img id="arrows1" onclick="eqntext('arrows1')"
src="../cgi-bin/mimetex.cgi?\longrightarrow[50]" alt="" border=0
align=middle></a>, whereas just <b>\longrightarrow</b> calculates
a default width
<a href="#preview"><img id="arrows2" onclick="eqntext('arrows2')"
src="../cgi-bin/mimetex.cgi?\longrightarrow" alt="" border=0
align=middle></a>, as usual. And, in addition to the usual
right, left and leftright arrows, there are also \long (and \Long) up,
down and updown arrows that take an optional [height] argument, also
scaled by any preceding <a href="#unitlength">\unitlength</a>. </p>
<p> In the event that you actually want to place an []-enclosed expression
immediately following an "unsized" long arrow, just place a <b>~</b> or
any white space after the arrow, e.g., <b>f:x\longrightarrow~[0,1]</b>
produces
<a href="#preview"><img id="arrows3" onclick="eqntext('arrows3')"
src="../cgi-bin/mimetex.cgi?\normalsize f:x\longrightarrow~[0,1]"
alt="" border=0 align=middle></a>. Without any intervening white space,
mimeTeX would have "eaten" the [0,1]. </p>
<p> Super/subscripts immediately following all long/Long left/right arrows
are displayed the same way <a href="#modes">\limits</a> displays them,
e.g., </p> <center>
<b>x\longrightarrow^gy</b> produces
<a href="#preview"><img id="arrows4" onclick="eqntext('arrows4')"
src="../cgi-bin/mimetex.cgi?\large x\longrightarrow^gy"
alt="" border=0 align=middle></a> <br>
<b>x\longrightarrow[50]^gy</b> produces
<a href="#preview"><img id="arrows5" onclick="eqntext('arrows5')"
src="../cgi-bin/mimetex.cgi?\large x\longrightarrow[50]^gy"
alt="" border=0 align=middle></a> </center> <p class="continue">
Subscripted long arrows can occasionally be useful, too, as in
<a href="#example11">Example 11</a> above, e.g., </p> <center>
<b>u\longrightarrow[50]_\beta v</b> produces
<a href="#preview"><img id="arrows6" onclick="eqntext('arrows6')"
src="../cgi-bin/mimetex.cgi?\large u\longrightarrow[50]_\beta^{\,}v"
alt="" border=0 align=middle></a> </center> <p class="continue">
To defeat this default behavior, e.g., <b>\longrightarrow\nolimits^g</b>
displays super/subscripts in the usual way. </p>
<p> Super/subscripts immediately following all long/Long up/down arrows
are treated correspondingly, i.e., superscripts are vertically
centered to the arrow's left, and subscripts to its right.
For example, </p> <center>
<b>\longuparrow[30]^\gamma</b> produces
<a href="#preview"><img id="arrows7" onclick="eqntext('arrows7')"
src="../cgi-bin/mimetex.cgi?\large\longuparrow[30]^\gamma"
alt="" border=0 align=middle></a> <br>
<b>\longdownarrow[30]_\gamma</b> produces
<a href="#preview"><img id="arrows8" onclick="eqntext('arrows8')"
src="../cgi-bin/mimetex.cgi?\large\longdownarrow[30]_\gamma"
alt="" border=0 align=middle></a> </center> <p class="continue">
whose occasional usefulness is also illustrated by
<a href="#example11">Example 11</a>. And as before, to defeat
this default behavior, e.g., <b>\longuparrow\nolimits^\gamma</b>
displays super/subscripts in the usual way. </p>
<h3> <a name="raiserotate">\raisebox{ }{ } and
\rotatebox{ }{ } and \reflectbox[ ]{ }
<font size=5>...</font></a> </h3>
<p> The <b>\raisebox{<i>height</i>}{<i>expression</i>}</b>
and <b>\rotatebox{<i>angle</i>}{<i>expression</i>}</b>
and <b>\reflectbox[<i>axis</i>]{<i>expression</i>}</b>
commands help you fine-tune and manipulate mimeTeX renderings: </p>
<ul>
<li> <b>\raisebox</b>'s <b><i>height</i></b> argument is number
of pixels, scaled by <a href="#unitlength">\unitlength</a>,
and can be positive or negative. </li>
<li> <b>\rotatebox</b>'s <b><i>angle</i></b> argument is number
of degrees, and can also be positive (for clockwise) or
negative, but must be a multiple of 90. </li>
<li> <b>\reflectbox</b>'s optional <b><i>axis</i></b> argument
defaults to 1 if not given, which reflects horizontally
(the usual LaTeX behavior), or reflects vertically if
specified as 2. </li>
<li> For all three commands, the <b><i>expression</i></b>
can be any valid LaTeX/mimeTeX expression. </li>
</ul>
<p> For example, mimeTeX's preprocessor
defines the LaTeX <b>?`</b> symbol, an upside-down question
mark, like </p> <center>
<b>abc\raisebox{-2}{\rotatebox{180}?}def</b> produces
<a href="#preview"><img id="raiserot1" onclick="eqntext('raiserot1')"
src="../cgi-bin/mimetex.cgi?
\large\rm abc\raiseb{-2}{\rotateb{180}{\LARGE?}}def"
alt="" border=0 align=middle></a> </center>
<p> Using <b>\reflectbox[2]{ }</b> instead of
<b>\rotatebox{180}{ }</b> would result in the slightly
different </p> <center>
<b>abc\raisebox{-2}{\reflectbox[2]?}def</b> produces
<a href="#preview"><img id="raiserot2" onclick="eqntext('raiserot2')"
src="../cgi-bin/mimetex.cgi?
\large\rm abc\raiseb{-2}{\reflectb[2]{\LARGE?}}def"
alt="" border=0 align="bottom"></a> </center>
<h3> <a name="compose">\compose{ }{ }<font size=5>...</font></a></h3>
<p class="continue">
<b>\compose[<i>offset</i>]{<i>base</i>}{<i>overlay</i>}</b>
superimposes the <b><i>overlay</i></b> expression on top of the
<b><i>base</i></b> expression, displaying the result.
The superimposed <b><i>overlay</i></b> is centered, both
horizontally and vertically, on the <b><i>base</i></b> image,
with the composite image baseline
<!-- the same as the <b><i>base</i></b>. -->
completely ignored.
That means the <b><i>base</i></b> remains positioned in your expression
just as if it had been rendered alone, while the <b><i>overlay</i></b>
is moved around, vertically as well as horizontally, to accommodate it.
For example, </p> <center>
<b>\compose{\LARGE O}{\normalsize c}</b> renders
<a href="#preview"><img id="compose1" onclick="eqntext('compose1')"
src="../cgi-bin/mimetex.cgi?\compose{\LARGE O}{\normalsize c}"
alt="" border=0 align="bottom"></a> </center>
<p> Optionally, the <b><i>overlay</i></b> is horizontally
<b><i>offset</i></b> by the specified number of pixels
(positive offsets to the right, negative to the left).
For example, </p> <center>
<b>\compose[-4]{\LARGE O}{\normalsize c}</b> renders
<a href="#preview"><img id="compose2" onclick="eqntext('compose2')"
src="../cgi-bin/mimetex.cgi?\compose[-4]{\LARGE O}{\normalsize c}"
alt="" border=0 align="bottom"></a> </center>
<p> Vertical offset can be obtained using a <b>\raisebox</b>
in either the <b><i>base</i></b> or <b><i>overlay</i></b>
expression, or in both. (Although, note that
<b>\compose{\raisebox{10}{<i>base</i>}}{<i>overlay</i>}</b>
renders identically to
<b>\raisebox{10}{\compose{<i>base</i>}{<i>overlay</i>}}</b>,
so applying <b>\raisebox</b> to the <b><i>base</i></b>
expression is typically unnecessary.)
Vertical <b><i>overlay</i></b> offset is relative to the
centered image, as discussed immediately above,
i.e., <b>\compose{<i>base</i>}{\raisebox{0}{<i>overlay</i>}}</b>
has no effect at all, and the <b><i>overlay</i></b> image
remains centered on the <b><i>base</i></b>.
For example, </p> <center>
<b>abc\compose{\LARGE O}{\raisebox{5}{\normalsize c}}def</b>
renders
<a href="#preview"><img id="compose3" onclick="eqntext('compose3')"
src="../cgi-bin/mimetex.cgi?
abc\compose{\LARGE O}{\raisebox{5}{\normalsize c}}def"
alt="" border=0 align="bottom"></a>, and <br>
<b>abc\compose{\raisebox{10}{\LARGE O}}{\raisebox{-20}{\normalsize c}}def</b>
renders
<a href="#preview"><img id="compose3" onclick="eqntext('compose3')"
src="../cgi-bin/mimetex.cgi?abc
\compose{\raisebox{10}{\LARGE O}}{\raisebox{-20}{\normalsize c}}def"
alt="" border=0 align="bottom"></a></center>
<p> Separately or in some judicious combination, <b>\compose</b> and
<b>\raisebox</b> and <b>\rotatebox</b> and <b>\reflectbox</b>,
discussed above, perhaps along with <b>\rule</b> and <b>\eval</b>
discussed immediately below, may help you construct special symbols
not "natively" available with mimeTeX's limited set of built-in font
families. This can be especially useful in conjunction with the
<a href="#newcommands">–DNEWCOMMANDS</a> compile-time
<a href="#options">option</a> discussed above. </p>
<h3> <a name="rule">\rule{ }{ }<font size=5>...</font></a></h3>
<p class="continue">
<b>\rule{<i>width</i>}{<i>height</i>}</b> behaves in the usual way,
rendering a black rectangle <b><i>width</i></b> pixels wide and
<b><i>height</i></b> pixels high, with its base on the established
baseline. For example, </p> <center>
<b>\frac12xyz\rule{10}{20}ghi</b> produces
<a href="#preview"><img id="rule1" onclick="eqntext('rule1')"
src="../cgi-bin/mimetex.cgi?\frac12xyz\rule{10}{20}ghi"
alt="" border=0 align=middle></a> </center>
<p> The mimeTeX version of <b>\rule</b> has an optional
<b>[<i>lift</i>]</b> argument, so that its full form is
<b>\rule[<i>lift</i>]{<i>width</i>}{<i>height</i>}</b>.
<b><i>lift</i></b> moves the rule's baseline by the specified
number of pixels, up if positive or down if negative.
For example, </p> <center>
<b>\frac12xyz\rule[5]{10}{20}ghi</b> produces
<a href="#preview"><img id="rule2" onclick="eqntext('rule2')"
src="../cgi-bin/mimetex.cgi?\frac12xyz\rule[5]{10}{20}ghi"
alt="" border=0 align=middle></a> and <br>
<b>\frac12xyz\rule[-15]{10}{20}ghi</b> produces
<a href="#preview"><img id="rule3" onclick="eqntext('rule3')"
src="../cgi-bin/mimetex.cgi?\frac12xyz\rule[-15]{10}{20}ghi"
alt="" border=0 align=middle></a> </center>
<h3> <a name="evaluate">\eval{ }<font size=5>...</font></a> </h3>
<p class="continue"> mimeTeX can evaluate arithmetic expressions,
which is a feature intended primarily for use in
<a href="#newcommands">\newcommand's</a> discussed above.
Expressions can be built up from the following elements </p>
<ul>
<li> digits <b>0</b>-<b>9</b>
and numbers composed of uninterrupted (no whitespace)
sequences of digits, </li>
<li> binary operators
<b>+</b>, <b>-</b>, <b>*</b>, <b>/</b>, <b>%</b>
(<b>+</b> and <b>-</b> can be unary, preceding
the first number in an expression, and <b>%</b> is
the modulo operator), </li>
<li> balanced <b>(</b> ... <b>)</b>
parentheses nested to any level (see below), </li>
<li> whitespace anywhere
(except between digits comprising a number), </li>
<li> One additional construction interpreted by <b>\eval{ }</b>
is similar to (but not identical to) the
<a href="http://wikipedia.org/wiki/Conditional_(programming)#As_a_ternary_operator"
target="_top">?: conditional</a>, as follows.
The expression <b>(i?v0:v1:v2:<i>etc</i>)</b>, usually
parenthesized as illustrated, evaluates to <b>v0</b>
if <b>i</b> evaluates to <b>0</b>, or evaluates to <b>v1</b>
if <b>i</b> evaluates to <b>1</b>, etc. If <b>i < 0</b>
then <b>v0</b> is used, and if <b>i</b> is too large, the last
<b>v</b> is used. All components, <b>i</b> and all <b>v</b>'s,
can themselves be expressions, even another
<b>(i?v0:v1:v2:<i>etc</i>)</b>, which in this case must be
parenthesized. The only situation where parentheses aren't
required is when <b>i?v0:v1:v2:<i>etc</i></b> comprises
your entire expression.
For example, <br> <nobr>
<b>\eval{1+2?10:11:12:13:14:15}</b> renders
<a href="#preview"><img id="eval1" onclick="eqntext('eval1')"
src="../cgi-bin/mimetex.cgi?\large\eval{1+2?10:11:12:13:14:15}"
alt="" border=0 align=bottom></a></nobr></li>
<li> and <u> most importantly, </u>
the built-in variables<br>
<b>fs</b> for current fontsize and<br>
<b>unitlength</b> for unitlength<br>
which provide the capability for useful constructions,
as follows... </li>
</ul>
<p> All optional <b>[</b> <b>]</b> and mandatory
<b>{</b> <b>}</b> numeric arguments for
<a href="#rule">\rule[lift]{width}{height}</a>,
<a href="#compose">\compose[offset]{ }{ }</a>,
<a href="#raiserotate">\raisebox{height}{ }</a>,
<a href="#raiserotate">\rotatebox{angle}{ }</a>, and
<a href="#arrows">\longarrow[width]</a>
can be expressions as described above, rather than just
numeric constants. By using the <b>fs</b> variable, you can
construct <a href="#newcommands">\newcommand</a>
expressions that properly scale with font size.
For example, the <b>\mapsto</b> symbol is not explicitly provided
in any mimeTeX font, but is instead constructed by the
embedded <a href="#newcommands">\newcommand</a><br>
<nobr> <b>
{ "\\mapsto", NULL, "{\\rule[fs/2]{1}{5+fs}\\hspace{-99}\\to}" },</b>
</nobr><br>
where \rule's [lift]=fs/2 and {height}=5+fs are scaled by
font size to render symbols<br>
<a href="#preview"><img id="eval2" onclick="eqntext('eval2')"
src="../cgi-bin/mimetex.cgi?\small\text\begin{array}{rrl}
\backslash tiny & fs=\tiny\eval{fs} & \tiny\mapsto \\
\backslash small & fs=\small\eval{fs} & \small\mapsto \\
\backslash normalsize & fs=\normal\eval{fs} & \normal\mapsto\\
\backslash large & fs=\large\eval{fs} & \large\mapsto \\
etc. & &
\end{array}" alt="" border=0 align=middle></a><br>
whose rendering automatically varies appropriately with font size.
This kind of <a href="#newcommands">\newcommand</a> construction
is the primary use intended for mimeTeX's expression evaluation feature.
</p>
<p> But mimeTeX also provides the <b>\eval{<i>expression</i>}</b>
command to make the expression evaluation feature render
"visible" results. It's not particularly useful,
but an expression like <b>1+2+3+4+5=\eval{1+2+3+4+5}</b>
renders
<a href="#preview"><img id="eval2" onclick="eqntext('eval2')"
src="../cgi-bin/mimetex.cgi?\small 1+2+3+4+5=\eval{1+2+3+4+5}"
alt="" border=0 align="bottom"></a>. </p>
<p> Finally, one little "gotcha" is mimeTeX's
order of evaluation when interpreting expressions.
Parentheses are respected as you'd expect. But within
<b>(</b>...<b>)</b> parentheses, or in an
unparenthesized expression, mimeTeX finds the first (reading
from the left) operator, then iteratively evaluates the
separate subexpressions to that operator's left and to its right,
and then finally combines those two separate results.
So an expression like <b>2*3+4</b> renders <b>14</b>,
and you need to write <b>(2*3)+4</b> to get <b>10</b>.
</p>
<h3> <a name="magstep"> \magstep{ } and
\magbox{ }{ }<font size=5>...</font></a> </h3>
<p class="continue">
<b>\magstep{<i>magnification</i>}</b>, placed anywhere
within an expression, magnifies the entire expression
by an integer factor <b>1<=<i>magnification</i><=10</b>
in both width and height.
Each single pixel thus becomes a square box, <i>e.g.</i>,
for <b><i>magnification</i>=2</b> each single pixel becomes
a four-pixel square box with dimensions <b>2</b>-by-<b>2</b>.
This compromises mimeTeX's anti-aliasing algorithm,
and the resulting image is both hazy/blurry and jagged/staircased
compared to an unmagnified image of the same expression.
For example, at <b>\LARGE</b> size,<br>
<nobr>  
<b>f(x)=x^2</b>
renders
<a href="#preview"><img id="magbox1" onclick="eqntext('magbox1')"
src="../cgi-bin/mimetex.cgi?\LARGE f(x)=x^2"
alt="" border=0 align="absmiddle"></a> and </nobr><br>
<nobr>  
<b>\magstep{2} f(x)=x^2</b>
renders
<a href="#preview"><img id="magbox2" onclick="eqntext('magbox2')"
src="../cgi-bin/mimetex.cgi?\LARGE\magstep{2} f(x)=x^2"
alt="" border=0 align="absmiddle"></a> , whereas </nobr><br>
at mimeTeX's largest "native" font size, <br>
<nobr>  
<b>\Huge f(x)=x^2</b>
renders
<a href="#preview"><img id="magbox3" onclick="eqntext('magbox3')"
src="../cgi-bin/mimetex.cgi?\HUGE f(x)=x^2"
alt="" border=0 align="absmiddle"></a> . </nobr><br>
Nevertheless, if you still want to render images larger than
mimeTeX's <b>\Huge</b> size, then <b>\magstep{<i>magnification</i>}</b>
may render almost-acceptable results. </p>
<p> To magnify just part of an expression,
you can use <b>\magbox{<i>magnification</i>}{<i>expression</i>}</b>,
which only magnifies each pixel within the enclosed
<b>{<i>expression</i>}</b>, again
by an integer factor <b>1<=<i>magnification</i><=10</b>
in both width and height, and also adjusts the baseline accordingly.
But <b>\magbox</b> is applied directly to mimeTeX's black-and-white
bitmap <u><b><i> before anti-aliasing </i></b></u>.
At the present time, this virtually completely defeats
mimeTeX's anti-aliasing algorithm, and the resulting image
exhibits even more pronounced jagged-line/staircase effects.
For example, <br>
<nobr>  
<b>\LARGE f(x)={\magbox{2}{x}}^2</b>
renders
<a href="#preview"><img id="magbox5" onclick="eqntext('magbox5')"
src="../cgi-bin/mimetex.cgi?\LARGE f(x)={\magbox{2}{x}}^2"
alt="" border=0 align="absmiddle"></a>.</nobr><br>
</p>
<h3> <a name="abbreviations">Abbreviations<font size=5>...</font></a> </h3>
<p class="continue">
<b>\ga</b> displays <b>\gamma</b>, but just <b>\g</b> displays
<b>\gg</b> (<b>>></b>). That is, mimeTeX selects the
shortest symbol or command which begins with whatever you type.
This feature can help shorten an otherwise very long line,
but it may be a bit dangerous. </p>
<p> The mimeTeX <a href="#symbols">preprocessor</a>, briefly mentioned
above, is responsible for recognizing several LaTeX symbols like
<b>\ldots</b> and several commands like <b>\atop</b> .
These symbols and commands cannot be abbreviated. The special
html characters like <b>&nbsp;</b> are also recognized by
the preprocessor and cannot be abbreviated. </p>
<h3> <a name="colors">Colors<font size=5>...</font></a> </h3>
<p> Rudimentary color commands are provided by mimeTeX. You can write
<b>\color{red}</b> or <b>\color{green}</b> or<b>\color{blue}</b>
(which may be abbreviated <b>\red</b> or <b>\green</b> or
<b>\blue</b>) anywhere in an expression to render the entire
expression in the specified color. That is,
<b>abc{\red def}ghi</b> renders the entire expression red,
not just the <b>def</b> part. Also, note that mimeTeX's "green"
is actually color <b>#00FF00</b>, which the html standard more
accurately calls "lime". For example, </p> <center>
<b>\blue e^x=\sum_{n=0}^\infty\frac{x^n}{n!}</b> produces
<a href="#preview"><img id="colors1" onclick="eqntext('colors1')"
src="../cgi-bin/mimetex.cgi?
\Large\color{blue} e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
alt="" border=0 align=middle></a> </center>
<h3> <a name="smash">"Smash"<font size=5>...</font></a> </h3>
<p> TeX represents characters by boxes, with no idea how ink will be
distributed inside. So an expression like
<b>\frac12\int_{a+b+c}^{d+e+f}g(x)dx</b> is typically rendered as
<a href="#preview"><img id="smash1" onclick="eqntext('smash1')"
src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
\nosmash\frac12\int_{a+b+c}^{d+e+f}{g(x)dx}"
alt="" border=0 align=middle></a>.
But mimeTeX knows the character shapes of its fonts, and therefore tries
to remove extra whitespace, rendering the same expression as
<a href="#preview"><img id="smash2" onclick="eqntext('smash2')"
src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
\smash\frac12\int_{a+b+c}^{d+e+f}{g(x)}dx"
alt="" border=0 align=middle></a> instead. </p>
<p> Precede any expression with the mimeTeX directive <b>\nosmash</b>
to render it without "smashing". Or compile mimetex.c with the
<b>-DNOSMASH</b> <a href="#options">option</a> if you prefer
the typical TeX behavior as mimeTeX's default. In this case,
precede any expression with <b>\smash</b> to render it "smashed".
And note that explicit space like <b>\hspace{10}</b>
or <b>\;</b> , etc, is never smashed. </p>
<p> The scope of <b>\smash</b> and <b>\nosmash</b> is the
<b>{ }</b>-enclosed subexpression in which the directive occurs.
For example, if you want the <b><i>g(x)</i></b> part of the
preceding example smashed, but not the <b>1/2</b> part,
then the expression
<b>\nosmash\frac12{\smash\int_{a+b+c}^{d+e+f}g(x)dx}</b>
renders as
<a href="#preview"><img id="smash3" onclick="eqntext('smash3')"
src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
\nosmash\frac12{\smash\int_{a+b+c}^{d+e+f}{g(x)dx}}"
alt="" border=0 align=middle></a>.
<!-- Moreover, explicit space like
<b>\hspace{10}</b> or <b>\;</b>, etc, is never smashed.
So <b>{\frac12\;\;}\int_{a+b+c}^{d+e+f}g(x)dx</b> renders as
<a href="#preview"><img id="smash4" onclick="eqntext('smash4')"
src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
{\frac12\;\;}\int_{a+b+c}^{d+e+f}{g(x)dx}"
alt="" border=0 align=middle></a>. --> </p>
<p> For finer-grained control, note that <b>\smash</b> is shorthand
for the default <b>\smashmargin{+3}</b> (and <b>\nosmash</b> is
shorthand for <b>\smashmargin{0}</b>). <b>\smashmargin</b>'s value
is the minimum number of pixels between smashed symbols. The leading
<b>+</b> is optional. If present, the font size (\tiny=0,...,\Huge=7)
is added to the specified minimum. Compile mimetex.c with the
<b>-DSMASHMARGIN=<i>n</i></b> <a href="#options">option</a> to change
the default from <b>3</b> to <b><i>n</i></b>. Compare the preceding
example with the over-smashed <b>\smashmargin{1}</b>
<a href="#preview"><img id="smash5" onclick="eqntext('smash5')"
src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
\smashmargin1\frac12\int_{a+b+c}^{d+e+f}{g(x)}dx"
alt="" border=0 align=middle></a> instead. </p>
<p> Smashing is in "beta testing" and some expressions still don't look
quite right when smashed, e.g., <b>1^2,2^2,3^2,\ldots</b> renders as
<a href="#preview"><img id="smash6" onclick="eqntext('smash6')"
src="../cgi-bin/mimetex.cgi?\Large1^2,2^2,3^2,\ldots"
alt="" border=0 align=middle></a>. Just compile with <b>-DNOSMASH</b>
if you come across numerous annoying situations. </p>
<h3> <a name="not">\not and \cancel and \sout<font size=5>...</font></a> </h3>
<p> The usual LaTeX <b>\not</b> "slashes" the single symbol
following it, e.g., <b>i\not\partial\equiv i\not\nabla</b>
produces <a href="#preview">
<img id="not1" onclick="eqntext('not1')"
src="../cgi-bin/mimetex.cgi?\normalsize i\not\partial\equiv i\not\nabla"
alt="" border=0 align=middle></a>. </p>
<p> For arbitrary expressions, mimeTeX provides <b>\cancel</b>
which draws a line from the upper-right to lower-left corner of its
argument, e.g., <b>a\cancel{x^2}=bx^{\not3}</b> produces
<a href="#preview"><img id="not2" onclick="eqntext('not2')"
src="../cgi-bin/mimetex.cgi?\large a\cancel{x^2}=bx^{\not3}"
alt="" border=0 align=bottom></a>. </p>
<p> Finally, similar to the <b>ulem.sty</b> package, <b>\sout</b>
draws a horizontal strikeout line through its argument,
e.g., <b>\sout{abcdefg}</b> produces <a href="#preview">
<img id="not3" onclick="eqntext('not3')"
src="../cgi-bin/mimetex.cgi?\normalsize\sout{abcdefg}"
alt="" border=0 align=middle></a>. MimeTeX's <b>\sout</b> also
takes an optional argument that adjusts the vertical position of its
strikeout line by the specified number of pixels, e.g.,
<b>\sout[+2]{abcdefg}</b> produces <a href="#preview">
<img id="not4" onclick="eqntext('not4')"
src="../cgi-bin/mimetex.cgi?\normalsize\sout[+2]{abcdefg}"
alt="" border=0 align=middle></a> and
<b>\sout[-2]{abcdefg}</b> produces
<a href="#preview"><img id="not5" onclick="eqntext('not5')"
src="../cgi-bin/mimetex.cgi?\normalsize\sout[-2]{abcdefg}"
alt="" border=0 align=middle></a>. </p>
<h2> <a name="array"> (IIIe) \begin{array}{lcr}...\end{array} Environment
</a> </h2>
<p> Rendering vectors and matrices, aligning equations, etc, is all done
using the customary LaTeX environment
<b>\begin{array}{lcr} a&b&c\\d&e&f\\etc \end{array}</b>
which you can write in exactly that form. MimeTeX also
recognizes the following array-like environments </p>
<center> <table cellpadding="1" cellspacing="1">
<tr> <td align="left"> <b>\begin{array}{lcr}</b> </td>
<td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
<td align="left"> <b>\end{array}</b> </td> </tr>
<tr> <td align="left"> <b>\begin{matrix}</b> </td>
<td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
<td align="left"> <b>\end{matrix}</b> </td> </tr>
<tr> <td align="left"> <b>\begin{tabular}</b> </td>
<td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
<td align="left"> <b>\end{tabular}</b> </td> </tr>
<tr> <td align="left"> <b>\begin{pmatrix}</b> </td>
<td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
<td align="left"> <b>\end{pmatrix}</b> </td> </tr>
<tr> <td align="left"> <b>\begin{bmatrix}</b> </td>
<td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
<td align="left"> <b>\end{bmatrix}</b> </td> </tr>
<tr> <td align="left"> <b>\begin{Bmatrix}</b> </td>
<td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
<td align="left"> <b>\end{Bmatrix}</b> </td> </tr>
<tr> <td align="left"> <b>\begin{vmatrix}</b> </td>
<td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
<td align="left"> <b>\end{vmatrix}</b> </td> </tr>
<tr> <td align="left"> <b>\begin{Vmatrix}</b> </td>
<td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
<td align="left"> <b>\end{Vmatrix}</b> </td> </tr>
<tr> <td align="left"> <b>\begin{eqnarray}</b> </td>
<td align="center"> <b>a&=&b \\ c&=&d \\ etc</b> </td>
<td align="left"> <b>\end{eqnarray}</b> </td> </tr>
<tr> <td align="left"> <b>\begin{align}</b> </td>
<td align="center"> <b>a&=b \\ c&=d \\ etc</b> </td>
<td align="left"> <b>\end{align}</b> </td> </tr>
<tr> <td align="left"> <b>\begin{cases}</b> </td>
<td align="center"> <b>a&b \\ c&d \\ etc</b> </td>
<td align="left"> <b>\end{cases}</b> </td> </tr>
<tr> <td align="left"> <b>\begin{gather}</b> </td>
<td align="center"> <b>a \\ b \\ etc</b> </td>
<td align="left"> <b>\end{gather}</b> </td> </tr>
</table> </center> <p class="continue">
There's a built-in maximum of 64 columns and 64 rows. Nested
array environments, e.g.,
<b>\begin{pmatrix}a&\begin{matrix}1&2\\3&4\end{matrix}\\c&d\end{pmatrix}</b>,
are permitted. </p>
<p> MimeTeX also provides the abbreviation
<b>\array{lcr$a&b&c\\d&e&f\\etc}</b>
which has exactly the same effect as
<b>\begin{array}{lcr} a&b&c\\d&e&f\\etc \end{array}</b>.
And the <b>lcr$</b> "preamble" in <b>\array{lcr$etc}</b> is optional.
In that case, <b>\array{a&b&c\\d&e&f\\etc}</b>
has exactly the same effect as
<b>\begin{matrix} a&b&c\\d&e&f\\etc \end{matrix}</b>.
You can also write <b>\(\array{etc}\)</b> to "manually abbreviate"
the pmatrix environment, or <b>\array{rcl$etc}</b> to abbreviate
eqnarray, but mimeTeX has no explicit abbreviations for these
other environments. For example, </p> <center>
<b>\begin{matrix}a_1&a_2&a_3\\b_1&b_2&b_3\\c_1&c_2&c_3\end{matrix}</b>
produces
<a href="#preview"><img id="array1" onclick="eqntext('array1')"
src="../cgi-bin/mimetex.cgi?\large\begin{matrix}a_1&a_2&a_3\\
b_1&b_2&b_3\\c_1&c_2&c_3\end{matrix}"
alt="" border=0 align=middle></a> </center>
<p> Solid <b>\hline</b>'s (but not \cline's) and vertical <b>l|c|r</b> bars
are available, as usual. For dashed lines and bars,
<b>\begin{array}</b> provides the additional features <b>\hdash</b>
and <b>l.c.r</b> . <b>\hline</b> and <b>\hdash</b> may not be
abbreviated. For example, </p> <center>
<b>\begin{array}{c.c|c} a_1&a_2&a_3 \\\hdash b_1&b_2&b_3 <br>
\\\hline c_1&c_2&c_3 \end{array}</b> produces <br>
<a href="#preview"> <img id="array22" onclick="eqntext('array22')"
src="../cgi-bin/mimetex.cgi?\large\begin{array}{c.c|c}
a_1&a_2&a_3\\\hdash b_1&b_2&b_3\\\hline c_1&c_2&c_3\end{array}"
alt="" border="0" align="middle"> </a> </center>
<p> The default font size is unchanged by <b>\array{ }</b>, but you
can explicitly control it in the usual way, e.g.,
<b>{\Large\begin{matrix}...\end{matrix}}</b> renders the entire array
in font size 4. In addition, any <b>&...&</b> cell may contain font
size declarations which are always local to that cell,
e.g., <b>&\fs{-1}...&</b> renders that one cell one font size smaller
than current. </p>
<p> The <b>{lcr}</b> in <b>\begin{array}{lcr}</b> sets left,center,right
<i>"horizontal justification"</i> down columns of an array,
as usual. And "vertical justification" across rows defaults
to what we'll call <b><i>baseline</i></b>, i.e., aligned equations,
as in <a href="#example10">Example 10</a> above, display properly.
But the down arrows (for
<a href="#preview"><img id="array3" onclick="eqntext('array3')"
src="../cgi-bin/mimetex.cgi?\small\array{C$\gamma&\Large\downarr}"
alt="" border=0 align=middle></a> and for
<a href="#preview"><img id="array4" onclick="eqntext('array4')"
src="../cgi-bin/mimetex.cgi?\small\array{C$\Large\downarr&\beta}"
alt="" border=0 align=middle></a>)
in <a href="#example11">Example 11</a> require
<i>"vertical centering"</i> across the middle row of that
array. So, in addition to lowercase <b>lcr</b>, mimeTeX's <b>{lcr}</b>
in <b>\begin{array}{lcr}</b> may also contain uppercase <b>BC</b> to
set "<b>B</b>"aseline or "<b>C</b>"enter vertical justification across
the corresponding rows. For example, <b>\begin{array}{rccclBCB}</b>
sets baseline justification for the first and third rows, and center
justification for the second row. Without any <b>BC</b>'s,
all rows default to the usual <b>B</b> baseline justification. </p>
<p> MimeTeX has no <b>\arraycolsep</b> or <b>\arraystretch</b> parameters.
Instead, <b>\begin{array}{lc25rB35C}</b> sets the absolute width
of the second column to 25 pixels, and the absolute height of the
first row to 35 pixels, as illustrated by
<a href="#example9">Example 9</a>. Any number following
an <b>lcrBC</b> specification sets the width of that one column
(for <b>lcr</b>), or the height of that one row (for <b>BC</b>). <br>
<img src="../cgi-bin/mimetex.cgi?\hspace{35}" alt="" border=0>
You can optionally precede the number with a <b>+</b> sign,
which "propagates" that value forward to all subsequent columns for
<b>lcr</b>, or all subsequent rows for <b>BC</b>. For example,
<b>\begin{array}{lc+25rB+35C}</b> sets the absolute width of
column 2 and all subsequent columns to 25 pixels,
and the absolute height of row 1 and all subsequent rows
to 35 pixels. After absolute sizing has been set, the special
value <b>0</b> reverts to automatic sizing for that one row or
column, and <b>+0</b> reverts to automatic sizing for all subsequent
rows or columns. For example, <b>\begin{array}{c+25ccc+35ccc+0}</b>
sets the absolute widths of columns 1-3 to 25 pixels,
columns 4-6 to 35 pixels, and then reverts to automatic
sizing for columns 7 and all subsequent columns. <br>
<img src="../cgi-bin/mimetex.cgi?\hspace{35}" alt="" border=0>
The "propagation" introduced by <b>+</b> is local to the
<b>\begin{array}</b> in which it occurs. So you have to repeat
the same specifications if you want rows aligned across several
arrays on the same line (or columns aligned on several lines
separated by <b>\\</b>). Instead, a lowercase <b>g</b> globally
copies your column specifications to all subsequent arrays,
and an uppercase <b>G</b> globally copies your row specifications.
And <b>gG</b> copies both column and row specifications. For example,
<b>\begin{array}{GC+25}</b> sets the height of all rows in this
array to 25 pixels, and ditto for all subsequent arrays to its right.
Explicit specifications in subsequent arrays override previous global
values. <br>
<img src="../cgi-bin/mimetex.cgi?\hspace{35}" alt="" border=0>
Click one of the following examples to see illustrations
of the above discussion: </p> <center>
<a href="#preview"> <img id="array31" onclick="eqntext('array31')"
src="../cgi-bin/mimetex.cgi?\large
\left( \begin{array}{GC+30}
\cos\frac\theta2 & i\,\sin\frac\theta2\\
i\,\sin\frac\theta2 & \cos\frac\theta2 \end{array} \right)
\left( \begin{array}
z & x_{\tiny-} \\ x_{\tiny+} & -z \end{array} \right)
\hfill{300}\text{\normalsize Example 1}"
alt="" border="0" align="middle"> </a> <br>
<a href="#preview"> <img id="array32" onclick="eqntext('array32')"
src="../cgi-bin/mimetex.cgi?\large
\left( \begin{array}{GC+30gc+40}
\cos\frac\theta2 & i\,\sin\frac\theta2 \\
i\,\sin\frac\theta2 & \cos\frac\theta2 \end{array} \right)
\left( \begin{array}
z & x_{\tiny-} \\ x_{\tiny+} & -z \end{array} \right)
\hfill{300}\text{\normalsize Example 2}"
alt="" border="0" align="middle"> </a> </center>
<p> See <a href="#example8">Examples 8-11</a> above for several
additional <b>\begin{array}{lcr}</b> applications. </p>
<h2> <a name="picture"> (IIIf) \picture( ){ } "Environment",
including \line( ){ } and \circle( ) </a> </h2>
<p> Besides <b>\begin{array}{lcr}</b>, mimeTeX also tries to emulate the
familiar LaTeX picture environment with the somewhat similar<br>
<b> \picture(width[,height])
{ (loc1){pic_elem1} (loc2){pic_elem2} ... }</b><br>
as illustrated by <a href="#example12">Examples 12-13</a> above.
Arguments surrounded by <b>[ ]</b>'s are optional.
If the optional <b>[,height]</b> is omitted, then <b>height=width</b>
is assumed. Locations <b>(loc1)</b> and <b>(loc2) ...</b> each
denote either a <b>\put(loc)</b> or a <b>\multiput(loc)</b>,
and each location is of the form <b>([c]x,y[;xinc,yinc[;num]])</b>. </p>
<p> A <b>\put(loc)</b> is denoted by a location of the form <b>([c]x,y)</b>
where <b>x,y</b> denotes the coordinate where the lower-left corner
of the subsequent picture_element will be placed, unless the letter
<b>c</b> precedes the <b>x</b>-number, in which case <b>cx,y</b>
denotes the center point instead. The very lower-left corner of the
entire picture is always <b>0,0</b>, and the upper-right corner is
<b>width-1,height-1</b>. Note, for example, that you'd never want
to specify location <b>c0,0</b> since the picture_element would be
mostly out-of-bounds (only its upper-right quadrant would be
in-bounds). </p>
<p> A <b>\multiput(loc)</b> starts like a <b>\put(loc)</b>, but location
<b>[c]x,y</b> is followed by <b>;xinc,yinc[;num]</b> indicating the
<b>x,y-inc</b>rements applied to each of <b>num</b> repetitions
of picture_element. If <b>;num</b> is omitted, repetitions continue
until the picture_element goes out-of-bounds of the specified
<b>width[,height]</b>. Note that <b>x,y</b> are always positive or
zero, but <b>xinc,yinc</b> may be postive, zero or negative. </p>
<p> The <b>\picture(,){...}</b> parameters <b>width, height, x, y, xinc,
yinc</b> may be either integer or may contain a decimal point,
and they're all scaled by <a href="#unitlength">\unitlength</a>.
The <b>num</b> parameter must be integer. </p>
<p> Picture_element's <b>{pic_elem1}</b> and <b>{pic_elem2} ...</b>
may be any expressions recognized by mimeTeX, even including other
<b>\picture</b>'s nested to any level. </p>
<h3> <a name="circleline">\line( ){ } and
\circle( )<font size=5>...</font></a> </h3>
<p> To help draw useful picture_element's, mimeTeX provides several
drawing commands, <b>\line(xinc,yinc)[{xlen}]</b> and
<b>\circle(xdiam[,ydiam][;arc])</b>. Although primarily intended
for use in <b>\picture</b>'s, you can use them in any mimeTeX
expression, e.g., <b>abc\circle(20)def</b> produces
<a href="#preview"><img id="circleline1" onclick="eqntext('circleline1')"
src="../cgi-bin/mimetex.cgi?\large abc\circle(20)def"
alt="" border="0" align="middle"></a>. </p>
<p> Without its optional <b>{xlen}</b> parameter, the expression
<b>(x,y){\line(xinc,yinc)}</b> draws a straight line from point
<b>x,y</b> to point <b>x+xinc,y+yinc</b>. The <b>inc</b>'s
can be positive, zero or negative. Don't prefix location <b>x,y</b>
with a leading <b>c</b> for <b>\line</b>'s; the intended "corner"
is determined by the signs of <b>xinc</b> and <b>yinc</b>.
If given, the optional <b>{xlen}</b> parameter rescales the length
of the line so its x-projection is <b>xlen</b> and its slope is
unchanged. </p>
<p> Without optional <b>,ydiam</b> and <b>;arc</b>, the expression
<b>(x,y){\circle(xdiam)}</b> draws a circle of diameter <b>xdiam</b>
centered at <b>x,y</b>. Don't prefix location <b>x,y</b> with a
leading <b>c</b> for <b>\circle</b>'s; centering is assumed.
If <b>,ydiam</b> is also given, then <b>(x,y){\circle(xdiam,ydiam)}</b>
draws the ellipse inscribed in a rectangle of width <b>xdiam</b>
and height <b>ydiam</b> centered at <b>x,y</b>. <br>
Finally, <b>;arc</b> specifies the arc to be
drawn, in one of two ways. An <b>;arc</b> argument given in the
form <b>;1234</b> interprets each digit as a quadrant to be drawn,
with <b>1</b> the upper-right quadrant and then proceeding
counterclockwise, e.g., <b>\circle(12;34)</b> specifies the
lower half of a circle whose diameter is twelve. <br>
Alternatively, an <b>;arc</b> argument given in
the form <b>45,180</b> or <b>-60,120</b> specifies the endpoints of
the desired arc in degrees, with <b>0</b> the positive x-axis and
then proceeding counterclockwise. The first number must always
be smaller than the second (negative numbers are allowed), and the
arc is drawn counterclockwise starting from the smaller number. </p>
<p> Besides <a href="#example12">Examples 12-13</a> above,
it's hard to resist illustrating<br>
<font size=4><b>
\unitlength{.6} \picture(100) {<br>
(50,50){\circle(99)} %%head%%<br>
(20,55;50,0;2){\fs{+1}\hat\bullet} %%eyes%%<br>
(50,40){\bullet} %%nose%%<br>
(50,35){\circle(50,25;34)} %%upper lip%%<br>
(50,35){\circle(50,45;34)} %%lower lip%% }</b></font></p>
<center>
<a href="#preview"><img id="circleline2" onclick="eqntext('circleline2')"
src="../cgi-bin/mimetex.cgi?\normalsize\unitlength{.6}\picture(100){
(50,50){\circle(99)} (20,55;50,0;2){\fs{+1}\hat\bullet} (50,40){\bullet}
(50,35){\circle(50,25;34)} (50,35){\circle(50,45;34)}}"
alt="" border=0 align=middle></a><br>Have a nice day!</center>
<h2> <a name="commands"> (IIIg) Other mimeTeX Commands </a> </h2>
<p> Various and sundry other LaTeX-like commands are also provided
by mimeTeX. In addition to features explicitly discussed below,
mimeTeX supports the usual sub<b>_</b>scripts and super<b>^</b>scripts,
and most of the typical LaTeX commands, many already discussed
above, including </p>
<ul>
<li> <b>\frac{ }{ }</b> and <b>{ \over }</b> </li>
<li> <b>{ \atop }</b> and <b>{ \choose }</b> </li>
<li> <b>\sqrt{ }</b> </li>
<li> <b>\lim_{ }</b> and all the usual LaTeX function names </li>
<li> <b>\hat{ }</b> and <b>\widehat{ }</b>
and many of the usual LaTeX accents </li>
<li> <b>\overbrace{ }^{ }</b> and
<b>\underbrace{ }_{ }</b> </li>
<li> <b>\overline{ }</b> and <b>\underline{ }</b> </li>
</ul> <p class="continue">
All these typical commands should behave as they usually do
in LaTeX, and won't be discussed further. Short discussions
of some other commands follow. </p>
<h3> <a name="stackrel">\overset{ }{ } or
\stackrel{ }{ } and
\underset{ }{ } or \relstack{ }{ }
<font size=5>...</font></a> </h3>
<p class="continue">
<b>\stackrel{ }{ }</b> behaves as usual in LaTeX,
rendering its first argument one font size smaller and centered above
its second. And the amsmath-style <b>\overset{ }{ }</b> is
identical. For example, </p> <center>
<b>"\vec x\overset{\rm def}=(x_1\ldots x_n)"</b>
produces
<a href="#preview"><img id="stackrel1" onclick="eqntext('stackrel1')"
src="../cgi-bin/mimetex.cgi?
\Large\vec x\,\overset{\small\rm def}=
\,(x_1\ldots x_n)" alt="" border=0 align=middle></a> </center>
<p> "Conversely" to <b>\stackrel{ }{ }</b>, mimeTeX provides
<b>\relstack{ }{ }</b>, which renders its second argument
one font size smaller and centered below its first.
And the amsmath-style <b>\underset{ }{ }</b> renders its
first argument one font size smaller and centered below its second.
For example, the <b>\log</b> function name doesn't treat
limits like <b>\lim_</b>, but you can write, for example, </p> <center>
<b>"\underset{\rm base 2}\log32=5"</b> to render
<a href="#preview"><img id="stackrel2" onclick="eqntext('stackrel2')"
src="../cgi-bin/mimetex.cgi?
\Large\underset{\small\rm base 2}\log32\,=\,5"
alt="" border=0 align=middle></a> </center>
<p> MimeTeX's <b>\limits</b> provides an easier but non-standard
alternative to achieve the same effect. For example, </p> <center>
<b>"\vec x =\limits^{\rm def} (x_1\ldots x_n)"</b>
produces
<a href="#preview"><img id="stackrel3" onclick="eqntext('stackrel3')"
src="../cgi-bin/mimetex.cgi?\Large\vec x\,=\limits^{\small\rm def}
\,(x_1\ldots x_n)" alt="" border=0 align=middle></a> <br><br>
and <b>"\log\limits_{\rm base 2}32=5"</b>
produces
<a href="#preview"><img id="stackrel4" onclick="eqntext('stackrel4')"
src="../cgi-bin/mimetex.cgi?
\Large\log\limits_{\small\rm base 2}32\,=\,5"
alt="" border=0 align=middle></a> </center>
<h3> <a name="fbox">\fbox{ }<font size=5>...</font></a> </h3>
<p> In case html border attributes aren't suitable, mimeTeX provides
the usual <b>\fbox{<i>expression</i>}</b> command, e.g., </p> <center>
<b>"\fbox{x=\frac12}"</b> produces
<a href="#preview"><img id="fbox1" onclick="eqntext('fbox1')"
src="../cgi-bin/mimetex.cgi?\Large\fbox{x=\frac12}"
alt="" border=0 align=middle></a> </center>
<p> You can also write <b>\fbox[<i>width</i>]{<i>expression</i>}</b>
to explicitly set the box's width, or you can write
<b>\fbox[<i>width</i>][<i>height</i>]{<i>expression</i>}</b>
to explicitly set both width and height. </p>
<h3> <a name="today">\today and \calendar<font size=5>...</font></a> </h3>
<p class="continue"> <b>\today</b> renders
<a href="#preview"><img id="today1" onclick="eqntext('today1')"
src="../cgi-bin/mimetex.cgi?\normalsize\today"
border=0 align=middle></a>
in the usual LaTeX text mode way.
That's <b>\today</b>'s default format#1. MimeTeX has
an optional format argument so that, for example,
<b>\blue\today[2]</b> renders
<a href="#preview"><img id="today2" onclick="eqntext('today2')"
src="../cgi-bin/mimetex.cgi?\normalsize\blue\today[2]"
border=0 align=middle></a>,
showing both date and time. And
<b>\red\today[3]</b> renders
<a href="#preview"><img id="today3" onclick="eqntext('today3')"
src="../cgi-bin/mimetex.cgi?\normalsize\red\today[3]"
border=0 align=bottom></a>,
showing time only. </p>
<p> To accommodate time zones, you may also write, for example,
<b>\small\blue\today[2,+3]</b>, which renders
<a href="#preview"><img id="today4" onclick="eqntext('today4')"
src="../cgi-bin/mimetex.cgi?\small\blue\today[2,+3]"
border=0 align=middle></a>,
adding three hours to format#2.
The arguments may be in either order. The time zone increment
must always be preceded by either <b>+</b> or <b>-</b>,
and must be in the range <b>-</b>23 to <b>+</b>23. </p>
<p class="continue"> <b>\calendar</b> renders a calendar for
the current month, as illustrated by the left-hand image below.
For a different month, the optional argument  
<b>\small\blue\calendar[2001,9]</b> renders the right-hand
image, for the requested year and month. Years must be
1973<b>...</b>2099 and months must be 1<b>...</b>12. </p>
<center>
<a href="#preview"><img id="today5" onclick="eqntext('today5')"
src="../cgi-bin/mimetex.cgi?\normalsize\calendar"
border=0 align=middle> </a>
<a href="#preview"><img id="today6" onclick="eqntext('today6')"
src="../cgi-bin/mimetex.cgi?\small\blue\calendar[2001,9]"
border=0 align=middle> </a> </center>
<p> The default calendar emphasizes the current day of the current month,
while any other month emphasizes no day. Day emphasis is controlled
by an optional third argument. <b>\calendar[0,0,1]</b>
emphasizes the first day of the current month, and
<b>\calendar[2001,9,11]</b> emphasizes the eleventh
day of that month. <b>\calendar[0,0,99]</b>
renders the current month with no day emphasized. </p>
<h3> <a name="input">\input{ }<font size=5>...</font></a> </h3>
<p class="continue">
<b>\input{<i>filename</i>}</b> behaves just like the corresponding
LaTeX command, reading the entire contents of <b><i>filename</i></b>
into your expression at the point where the <b>\input</b> command
occurs. By default, <b><i>filename</i></b> resides in the same
directory as mimetex.cgi. Moreover, for security, absolute paths
with leading <b>/</b>'s or <b>\</b>'s, and paths with <b>../</b>'s
or <b>..\</b>'s, are not permitted. See the <b>-DPATHPREFIX</b>
<a href="#options">compile option</a>, discussed above,
if you want <b>\input</b> files in some other directory.
In any case, if <b><i>filename</i></b> isn't found, then
<b>\input</b> tries to read <b><i>filename</i>.tex</b> instead.</p>
<p> And for further security, <b>\input{ }</b> is disabled by default
unless mimeTeX is compiled with either the <b>-DINPUTOK</b> or
<b>-DINPUTPATH</b> or <b>-DINPUTREFERER</b>
<a href="#options">compile option</a> discussed above.
When it's disabled, the command <b>\input{<i>filename</i>}</b>
renders the error message
<b>[\input{<i>filename</i>} not permitted]</b> . </p>
<p> MimeTeX also supports the optional form
<b>\input{<i>filename:tag</i>}</b>. In this case,
<b><i>filename</i></b> is read as before, but only those characters
between <b><<i>tag</i>>...</<i>tag</i>></b> are placed
into your expression. This permits you to have one file containing
many different <b><<i>tag</i>></b>'s, e.g., one file containing
all the questions and/or answers to a homework assignment or a quiz,
etc. </p>
<h3> <a name="counter">\counter[ ]{ }
<font size=5>...</font></a> </h3>
<p> The bottom-right corner of this page contains a page hit counter
that's maintained using mimeTeX's
<b>\counter[<i>logfile</i>]{<i>counterfile</i>:<i>tag</i>}</b>
command. As with <b>\input</b>, described immediately above,
both the required <b><i>counterfile</i></b> and the optional
<b><i>logfile</i></b> are the names of files that reside in the
same directory as your mimetex.cgi executable, unless you compiled
mimetex with the <b>-DPATHPREFIX</b>
<a href="#options">compile option</a>. Before using
the <b>\counter</b> command, Unix "touch" and "chmod" those files
so they're mimeTeX readable and writable. </p>
<p> Also as with <b>\input</b>, for security <b>\counter</b> is
disabled by default unless mimeTeX is compiled with either
the <b>-DINPUTOK</b> or the <b>-DCOUNTEROK</b>
<a href="#options">compile option</a>
(notice that <b>-DINPUTOK</b> also enables <b>\counter</b>).
If you've compiled mimeTeX with <b>\counter</b> enabled,
then it behaves as <nobr>follows...</nobr> </p>
<p> If <b><i>counterfile</i></b> isn't readable and writable,
then the <b>\counter</b> command always displays
<b>1<sup><u>st</u></sup></b>. Otherwise, it maintains a
line in <b><i>counterfile</i></b> of the form
<b><<i>tag</i>> <i>value</i> </<i>tag</i>></b>
where <b><i>value</i></b> is initialized as <b>1_</b> if the
specified <b><<i>tag</i>></b> line doesn't already exist,
and then incremented on each subsequent call. That trailing
underscore on the value in the file, e.g., <b>99_</b>, tells
mimeTeX to display <b>99<sup><u>th</u></sup></b> with an
ordinal suffix. Edit the value in the file and remove the
underscore if you don't want the ordinal suffix displayed.
Finally, mimeTeX makes no effort to lock files or
records (tags), so be careful using <b>\counter</b>
if your hit rates are high enough so that frequent collisions
are likely. </p>
<p> The same <b><i>counterfile</i></b> can contain as many different
<b><<i>tag</i>></b> lines as you like, so counters for
all the pages on your site can be maintained in one file.
MimeTeX also maintains a special <b><timestamp></b> tag
in <b><i>counterfile</i></b> that logs the the date/time and
name of the most recently updated tag. </p>
<p> Somewhat more detailed log information can be accumulated in
the optional <b><i>logfile</i></b>. If you provide that
filename, mimeTeX writes a line to it of the form
<b>2008-09-07:12:59:33pm <<i>tag</i>>=99 192.168.1.1 <i>http_referer</i></b>
containing a timestamp, the counter tag and its current value,
and the user's IP address and http_referer page if they're
available. </p>
<p> The page hit counter displayed at the bottom-right corner
of this page is maintained by the command
<b>\counter[counters.log]{counters.txt:mimetex.html}</b>.
After compiling and installing your
own mimetex.cgi and your own copy of this page, that counter will
continually show <b>1<sup><u>st</u></sup></b>'s
unless/until you "touch" and "chmod" counters.txt (and, optionally,
counters.log) in your mimetex.cgi directory. </p>
<h3> <a name="environment">\environment
<font size=5>...</font></a> </h3>
<p> Submitting the expression <b>\environment</b>
to mimeTeX renders </p> <center>
<img id="environ1"
src="../cgi-bin/mimetex.cgi?\nocaching\environment"
align="middle" border=0> </center>
<p class="continue"> displaying the http environment variables
known to mimeTeX. This is primarily a programming aid,
showing information available to mimeTeX that might facilitate
future enhancements. </p>
<p> As with <b>\input</b> and <b>\counter</b> above,
for security <b>\environment</b> is
disabled by default unless mimeTeX is compiled with either
the <b>-DINPUTOK</b> or the <b>-DENVIRONOK</b>
<a href="#options">compile option</a>
(notice that <b>-DINPUTOK</b> also enables <b>\environment</b>). </p>
<h2> <a name="exceptions"> (IIIh) Other Exceptions
to LaTeX Syntax </a> </h2>
<h3> Binding Exceptions<font size=5>...</font> </h3>
<p> MimeTeX's bindings are pretty much left-to-right. For example,
although mimeTeX correctly interprets <b>\frac12</b> as well as
<b>\frac{1}{2}</b>, etc, the legal LaTeX expression <b>x^\frac12</b>
must be written <b>x^{\frac12}</b>. Otherwise, mimeTeX interprets
it as <b>{x^\frac}12</b>, i.e., the same way <b>x^\alpha12</b>
would be interpreted, which is entirely wrong for <b>\frac</b>.
The same requirement also applies to other combinations of commands,
e.g., you must write <b>\sqrt{\frac\alpha\beta}</b>, etc. </p>
<h2> <a name="messages"> (IIIi) mimeTeX Errors
and Messages </a> </h2>
<h3> mimeTeX Errors<font size=5>...</font> </h3>
<p> Any (La)TeX error is typically also a mimeTeX error.
However, mimeTeX has no command line interface or
<b>.</b>log file for reporting errors. Its only
communication with you is through the mimeTeX image
rendered by your browser. So error messages are embedded
in that image whenever feasible. For example,
suppose you want to see
<a href="#preview"><img id="messages1" onclick="eqntext('messages1')"
src="../cgi-bin/mimetex.cgi?\normalsize\alpha\beta\gamma\delta"
border=0 align=bottom></a>, but you mistakenly type
<b>\alpha\bethe\gamma\delta</b> instead.
Then the image rendered is
<a href="#preview"><img id="messages2" onclick="eqntext('messages2')"
src="../cgi-bin/mimetex.cgi?\normalsize\alpha\bethe\gamma\delta"
border=0 align=bottom></a>, indicating the unrecognized
<b>[\bethe?]</b> where you wanted to type <b>\beta</b>
and hoped to see
<a href="#preview"><img id="messages3" onclick="eqntext('messages3')"
src="../cgi-bin/mimetex.cgi?\normalsize\bf\beta"
border=0 align=bottom></a>.
If your expression contains some unprintable character
(meaning any character mimeTeX has no bitmap for),
then just
<a href="#preview"><img id="messages4" onclick="eqntext('messages4')"
src="../cgi-bin/mimetex.cgi?\small\bf[?]"
border=0 align=bottom></a> is displayed in the
corresponding position. </p>
<p> The preceding example illustrates a pretty trivial error.
Any non-trivial errors in your expression are likely to
go unrecognized and unreported by mimeTeX, and to render
unexpected images. While checking your input expression
for syntax errors, keep in mind the following points
about mimeTeX's behavior: </p>
<ul>
<li> An unmatched left brace <b>{</b> is matched
by mimeTeX with a "phantom" right brace <b>}</b>
that's imagined to be at the end of your expression. </li>
<li> Likewise, an unmatched <b>\left(</b>,
or <b>\left\{</b> or <b>\left\</b><i>anything</i>,
is matched by mimeTeX with a "phantom" <b>\right.</b>
at the end of your expression. </li>
<li> On the other hand, an unmatched right brace <b>}</b>
is displayed in place, as if you had typed \rbrace. </li>
<li> But an unmatched <b>\right\</b><i>anything</i>
is interpreted as an abbreviation for <b>\</b>rightarrow
followed by <b>\</b><i>anything</i>. For example,
<b>\leff( abc \right) def</b> renders
<a href="#preview"><img id="messages5"
onclick="eqntext('messages5')"
src="../cgi-bin/mimetex.cgi?\small\leff(abc\right)def"
border=0 align=bottom></a>. </li>
</ul> <!-- p class="continue">
</p -->
<h3> mimeTeX Messages<font size=5>...</font> </h3>
<!--
<p> The special mimeTeX directive <b>\version</b>
displays the following information </p>
<center>
<a href="#preview"><img id="messages6" onclick="eqntext('messages6')"
src="../cgi-bin/mimetex.cgi?\version"
border=0 align=middle> </a> </center>
-->
<p> The latest release of mimeTeX is version
<a href="#preview"><img id="messages11" onclick="eqntext('messages11')"
src="../cgi-bin/mimetex.cgi?\small\versionnumber"
alt="" border=0 align="bottom"></a>
which was last revised
<a href="#preview"><img id="messages12" onclick="eqntext('messages12')"
src="../cgi-bin/mimetex.cgi?\small\revisiondate"
alt="" border=0 align="bottom"></a>.
The special mimeTeX directive <b>\version</b>
displays that same information, </p>
<center>
<a href="#preview"><img id="messages13" onclick="eqntext('messages13')"
src="../cgi-bin/mimetex.cgi?\version"
alt="" border=0 align=middle></a> </center>
<p> To check that your own release of mimeTeX is current,
type a url into your browser's locator window something like <br>
<b>http://www.<i>yourdomain</i>.com/cgi-bin/mimetex.cgi?\version</b> <br>
which will display the version and revision date of
mimeTeX installed on your server. </p>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SECTION IV. APPENDICES
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h1> <a name="appendices"> (IV) Appendices </a> </h1>
<p> Programming information to help you modify mimeTeX's behavior,
and to use its functionality in your own programs, is provided
by these appendices. The currently available appendices discuss
(a)how to modify or extend mimeTeX's fonts, (b)how to use
mimeTeX's principal function, make_raster(), and (c)how to use
<a href="http://shh.thathost.com" target="_top">Sverre Huseby's</a>
gifsave.c library. </p>
<h2> <a name="fonts"> (IVa) mimeTeX Fonts </a> </h2>
<p> The font information mimeTeX uses to render characters is
derived from .gf font files (usually generated by <b>metafont</b>
running against .mf files), which are then run through
<b>gftype -i</b> and finally through my <b>gfuntype</b> program
(supplied with your mimeTeX distribution). </p>
<p> The final output from each such sequence of three runs
(metafont > gftype -i > gfuntype) gives mimeTeX the
bitmap information it needs to render one particular font
family at one particular size. The file <b>texfonts.h</b>
supplied with your mimeTeX distribution collects the output
from 72 such (sequences of) runs, representing nine font
families at eight sizes each. </p>
<p> This collection of information in texfonts.h is
"wired" into mimeTeX through tables maintained in <b>mimetex.h</b>.
To change mimeTeX's fonts, you'll have to first modify (or totally
replace) texfonts.h using your own gfuntype output, and then
change mimetex.h to reflect your texfonts.h modifications. </p>
<p> This appendix provides a brief description of the above
process, though you'll probably need at least some previous
C programming experience to confidently accomplish it.
Your motivation might be to add more fonts to mimeTeX,
to change the font sizes I chose, or to add more
font sizes, etc. MimeTeX's design permits all this to be
easily done once you understand the process. </p>
<p> Running <b>metafont</b> to generate a <b>.gf</b> file from <b>.mf</b>
source will usually be your very first step. A typical such run
might be </p>
<!-- <b>mf '\mode=onetz; mag=magstep(.5); input cmmi10'</b> --> <center>
<b>mf '\mode=preview; mag=magstep(-16.393225); input cmmi10'</b></center>
<p class="continue"> which in this case generates output file
<b>cmmi10.131gf</b> (which is mimeTeX's font size 3 for the
cmmi family). </p>
<p> Given the cmmi10.131gf file from this metafont run
(or substitute any other .gf file you like), next run </p>
<center><b>gftype -i cmmi10.131gf > typeout</b></center>
<p class="continue"> where <b>typeout</b> can be any temporary
filename you like. </p>
<p> Finally, run <b>gfuntype</b> against the typeout file
you just generated with the command </p>
<center><b>gfuntype -n cmmi131 typeout cmmi131.h</b></center>
<p class="continue"> to generate the final output file <b>cmmi131.h</b>
(or any filename you supply as the last arg). This
contains the cmmi data in an array whose name is taken
from the <b>-n</b> arg you supplied to gfuntype. </p>
<p> The above sequence of three runs resulted in output file
<b>cmmi131.h</b>, containing the font information mimeTeX needs
for one font family (cmmi) at one font size (3). Repeat this
sequence of three runs for each font size and each font family.
Then pull all the output files into one big <b>texfonts.h</b> file
(or write a small texfonts.h which just #include's them all). </p>
<p> For your information, the 72 sequences of runs represented
in the texfonts.h file supplied with your mimeTeX distribution
correspond to the following eight inital metafont runs for cmr10 </p>
<!--
1 (.100gf) mf '\mode=nextscrn; input cmr10'
2 (.118gf) mf '\mode=lview; input cmr10'
3 (.131gf) mf '\mode=onetz; mag=magstep(.5); input cmr10'
4 (.160gf) mf '\mode=itoh; input cmr10'
5 (.180gf) mf '\mode=lqlores; input cmr10'
-->
<pre> size=0 (.83gf) mf '\mode=eighthre; input cmr10'
1 (.100gf) mf '\mode=preview; mag=magstep(-17.874274); input cmr10'
2 (.118gf) mf '\mode=preview; mag=magstep(-16.966458); input cmr10'
3 (.131gf) mf '\mode=preview; mag=magstep(-16.393225); input cmr10'
4 (.160gf) mf '\mode=preview; mag=magstep(-15.296391); input cmr10'
5 (.180gf) mf '\mode=preview; mag=magstep(-14.650373); input cmr10'
6 (.210gf) mf '\mode=preview; mag=magstep(-13.804885); input cmr10'
7 (.250gf) mf '\mode=preview; mag=magstep(-12.848589); input cmr10'</pre>
<p class="continue">
Then ditto for the eight other font families cmmi10, cmmib10, cmsy10,
cmex10, bbold10, rsfs10, stmary10 and wncyr10. And to generate other
<b>.</b><i>dpi</i><b>gf</b> font sizes, calculate magsteps
<img src="../cgi-bin/mimetex.cgi?\normalsize\frac{\log(dpi/2602)}{\log1.2}"
alt="" align=middle border=0>. All the subsequent gftype and
gfuntype runs just follow the standard format described above. </p>
<p> To incorporate all this font information you just generated into
mimeTeX, edit your <b>mimetex.h</b> file and find the table that looks
something like </p><pre>static fontfamily aafonttable[] = {
/* ----------------------------------------------------------------------------------------
family size=0, 1, 2, 3, 4, 5, 6, 7
----------------------------------------------------------------------------------------- */
{ CMR10,{ cmr83, cmr100, cmr118, cmr131, cmr160, cmr180, cmr210, cmr250}},
{ CMMI10,{ cmmi83, cmmi100, cmmi118, cmmi131, cmmi160, cmmi180, cmmi210, cmmi250}},
{ CMMIB10,{ cmmib83, cmmib100, cmmib118, cmmib131, cmmib160, cmmib180, cmmib210, cmmib250}},
{ CMSY10,{ cmsy83, cmsy100, cmsy118, cmsy131, cmsy160, cmsy180, cmsy210, cmsy250}},
{ CMEX10,{ cmex83, cmex100, cmex118, cmex131, cmex160, cmex180, cmex210, cmex250}},
{ RSFS10,{ rsfs83, rsfs100, rsfs118, rsfs131, rsfs160, rsfs180, rsfs210, rsfs250}},
{ BBOLD10,{ bbold83, bbold100, bbold118, bbold131, bbold160, bbold180, bbold210, bbold250}},
{STMARY10,{stmary83,stmary100,stmary118,stmary131,stmary160,stmary180,stmary210,stmary250}},
{ CYR10,{ wncyr83, wncyr100, wncyr118, wncyr131, wncyr160, wncyr180, wncyr210, wncyr250}},
{ -999,{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}}
} ; /* --- end-of-fonttable[] --- */</pre><p class="continue">
Note the 72 names <b>cmr83...wncyr250</b> in the table. These must
correspond to (or must be changed to) the names following the <b>-n</b>
switch you specified for your gfuntype runs. </p>
<p> If you want more than eight font sizes, first build up texfonts.h
with all the necessary information. Then change LARGESTSIZE (and
probably NORMALSIZE) in mimetex.h, and finally edit the above aafonttable[]
by extending the columns in each row up to your largest size. </p>
<p> You can also add new rows by #define'ing a new family,
and then adding a whole lot of character definitions at the bottom
of mimetex.h, all in the obvious way (i.e., it should become obvious
after reviewing mimetex.h). A new row would be required,
for example, to make another font available in mimeTeX. </p>
<p> One small problem with the above procedure is that the default
gftype program supplied with most TeX distributions
can't emit the long lines needed to display mimeTeX's larger font sizes.
<a href="http://www.forkosh.com/gftype.zip"
target="_top">gftype.zip</a> contains a statically linked linux
executable modified to emit the necessary long lines.
It may or may not run on your intel linux machine.
If not, you'll need to compile your own version from source.
The following instructions are for Unix/Linux: <br>
First, download both
<!-- http://www.ctan.org/tex-archive/systems/web2c/web-7.5.3.tar.gz -->
<a href="http://www.forkosh.com/web-7.5.3.tar.gz"
target="_top">web-7.5.3.tar.gz</a> and
<!-- http://www.ctan.org/tex-archive/systems/web2c/web2c-7.5.3.tar.gz -->
<a href="http://www.forkosh.com/web2c-7.5.3.tar.gz"
target="_top">web2c-7.5.3.tar.gz</a>
<!-- or more recent versions. --> (note: these files are no longer
explicitly archived by <a href="http://www.ctan.org/"
target="_top">ctan</a>, having been superceded
by <a href="http://www.ctan.org/tex-archive/systems/texlive"
target="_top">texlive</a> sources, so the preceding two links
point to copies kept on my site, www.forkosh.com).
Then untar both gzipped tar files,
cd web2c-7.5.3/ and run ./configure
and make in the usual way (make may fail before
completion if you don't have all needed fonts installed,
but it will create and compile gftype.c before failing). Now edit
texk/web2c/gftype.c and notice three lines very near the top
that #define maxrow (79)   and similarly for
maxcol and linelength. Change all three 79's to 1024, and
then re-run make. The new texk/web2c/gftype executable
image can emit the long lines needed for mimeTeX's larger font sizes. </p>
<p> Finally, the Unix/Linux bash shell script
<a href="http://www.forkosh.com/texfonts.sh"
target="_top">texfonts.sh</a> generates file texfonts.h
containing the information for all 72 mimeTeX fonts discussed above
(and, optionally, an extra 1200dpi cmr font used to test mimeTeX's
supersampling algorithm). You'll need to understand and edit this
script to use it meaningfully. But it helps automate mimeTeX's font
generation procedure in case you want to experiment with different
fonts. (Note that metafont emits a complaint while generating the
83dpi rsfs font. Just press <CR> and it completes
successfully.) </p>
<h2> <a name="makeraster"> (IVb) mimeTeX's make_raster()
function </a> </h2>
<p> MimeTeX converts an input LaTeX math expression to a corresponding GIF
image in two steps. First, it converts the input LaTeX expression to a
corresponding bitmap raster. Then <a href="http://shh.thathost.com"
target="_top">Sverre Huseby's</a> gifsave library, discussed
<a href="#gifsave">below</a>, converts that bitmap to the emitted gif.
Though you never explicitly see that bitmap, it's mimeTeX's principal
result. MimeTeX is written so any program can easily use its
expression-to-bitmap conversion capability with just a single line of code.
The following complete program demonstrates the simplest such use. </p>
<pre> #include <stdio.h>
#include "mimetex.h"
int main ( int argc, char *argv[] )
{
raster *rp = make_raster(argv[1],NORMALSIZE);
type_raster(rp,stdout); /* display ascii image of raster */
}</pre>
<p> Cut-and-paste the above sample code from this file to, say,
mimedemo.c (and fix the brackets around stdio.h). Then compile <br>
cc -DTEXFONTS mimedemo.c mimetex.c -lm -o mimedemo <br>
and run it from your unix shell command line like <br>
./mimedemo "x^2+y^2" </p>
<p> MimeTeX's expression-to-bitmap conversion is accomplished by the
make_raster() call, whose first argument is just a pointer to a
(null-terminated) string containing any mimeTeX-compliant LaTeX
expression, and whose second argument is the mimeTeX font size
to use (overridden if your expression contains a preamble).
The ascii display of the bitmap raster returned by make_raster()
results from the subsequent call to type_raster(). That's all
this program does, but you could use make_raster()'s returned bitmap
for any other purpose you have in mind. </p>
<p> MimeTeX's primary purpose is to emit either xbitmaps or gif images
rather than ascii displays. And mimeTeX has anti-aliasing and various
other options that further complicate its main() function compared to
the simple example above. The example below demonstrates mimeTeX
usage in the slightly more realistic situation where an input expression
is converted to a gif, without anti-aliasing, and emitted on stdout. </p>
<pre> #include <stdio.h>
#include <stdlib.h>
#include "mimetex.h"
/* --- global needed by callback function, below, for gifsave.c --- */
static raster *rp = NULL; /* 0/1 bitmap raster image */
/* --- callback function to return pixel value at col x, row y --- */
int GetPixel ( int x, int y ) /* pixel value will be 0 or 1 */
{ return (int)getpixel(rp,y,x); } /* just use getpixel() macro */
/* --- main() entry point --- */
int main ( int argc, char *argv[] )
{
/* --- get LaTeX expression from either browser query or command-line --- */
char *query = getenv("QUERY_STRING"), /* check for query string */
*expression = (query!=NULL? query : /* input either from query */
(argc>1? argv[1] : "f(x)=x^2")); /* or from command line */
/* ---- mimeTeX converts expression to bitmap raster ---- */
rp = make_raster(expression,NORMALSIZE); /* mimeTeX rasterizes expression */
/* ---- convert returned bitmap raster to gif, and emit it on stdout ---- */
if ( query != NULL ) /* Content-type line for browser */
fprintf( stdout, "Content-type: image/gif\n\n" );
/* --- initialize gifsave library and colors, and set transparent bg --- */
GIF_Create(NULL, rp->width, rp->height, 2, 8); /* init for black/white */
GIF_SetColor(0, 255, 255, 255); /* always set background white */
GIF_SetColor(1, 0, 0, 0); /* and foreground black */
GIF_SetTransparent(0); /* and set transparent background */
/* --- finally, emit compressed gif image (to stdout) --- */
GIF_CompressImage(0, 0, -1, -1, GetPixel);
GIF_Close();
}</pre>
<p> Cut-and-paste as before, compile like <br>
cc -DTEXFONTS mimedemo.c mimetex.c gifsave.c -lm -o mimedemo <br>
and run it like the first example, but this time you may want to redirect
stdout <br>
./mimedemo "x^2+y^2"
<b>></b> mimedemo.gif <br>
since output is now a gif image consisting of mostly unprintable bytes.
Input is typically from the command line as illustrated, but this example
checks for a browser query string too. That means you could actually
replace mimetex.cgi with this executable, though anti-aliasing wouldn't
be available. </p>
<p> Of course, this example's intent isn't to replace the mimetex.cgi
executable, but rather to illustrate GIFSAVE library usage, documented
in detail below. And this example also illustrates usage of several
mimeTeX raster structure elements, like rp->width and rp->height.
So you'll probably also want to refer to mimetex.h, which contains those
raster structures and other relevant definitions. For instance, the
example's GetPixel() callback function illustrates usage of the getpixel()
macro in mimetex.h, to retrieve individual pixels by their x,y-coordinates.
And there's a similar setpixel() macro in mimetex.h to store pixels.
After completing all this reading, you'll be prepared to begin using
mimeTeX functions in your own code. </p>
<h2> <a name="gifsave">
(IVc)</a> <a href="http://shh.thathost.com" target="_top">Sverre Huseby's</a>
gifsave.c library </h2>
<p> The information below is taken from the README file accompanying
<a href="http://shh.thathost.com" target="_top">Sverre Huseby's</a>
distribution of GIFSAVE. I've made a few small editorial modifications,
including descriptions of the several minor changes necessary
to support mimeTeX. And the mimeTeX example program immediately above
uses GIFSAVE in a very straightforward way that should help clarify
any questions which may remain after reading the documentation below. </p>
<pre>
INTRODUCTION
============
The GIFSAVE functions make it possible to save GIF images from
your own C programs.
GIFSAVE creates simple GIF files following the GIF87a standard.
Interlaced images cannot be created. There should only be
one image per file.
GIFSAVE consists of five functions, all returning type int,
and no separate header file is required.
The functions should be called in the order listed below
for each GIF-file. One file must be closed before a new one
can be created.
GIF_Create() creates new GIF-files. It takes parameters
specifying filename, screen size, number of colors,
and color resolution.
GIF_SetColor() sets up red, green, blue color components.
It should be called once for each possible color.
GIF_SetTransparent() is optional. If called, it sets the
color number of the color that should be transparent,
i.e., the background color shows through this one.
GIF_CompressImage() performs the compression of the image.
It accepts parameters describing the position and size
of the image on screen, and a user defined callback
function that is supposed to fetch the pixel values.
GIF_Close() terminates and closes the file.
To use these functions, you must also write a callback
function that returns the pixel values for each point
in the image.
THE FUNCTIONS
=============
GIF_Create()
------------
Function Creates a new GIF-file, and stores info on
the screen.
Syntax int GIF_Create(
char *filename,
int width, int height,
int numcolors, int colorres
);
Remarks Creates a new (or overwrites an existing)
GIF-file with the given filename. No
.GIF-extension is added.
If filename is passed as a NULL pointer,
output is directed to stdout.
The width- and height- parameters specify
the size of the image in pixels.
numcolors is the number of colors used in
the image.
colorres is number of bits used to encode a
primary color (red, green or blue).
In GIF-files, colors are built by combining
given amounts of each primary color.
On VGA-cards, each color is built by
combining red, green and blue values in
the range [0, 63]. Encoding the number 63
would require 6 bits, so colorres would be
set to 6.
Return value GIF_OK - OK
GIF_ERRCREATE - Error creating file
GIF_ERRWRITE - Error writing to file
GIF_OUTMEM - Out of memory
GIF_SetColor()
--------------
Function Specifies the primary color component of a
color used in the image.
Syntax void GIF_SetColor(
int colornum,
int red, int green, int blue
);
Remarks This function updates the colortable-values
for color number colornum in the image.
Should be called for each color in the range
[0, numcolors]
with red, green and blue components in the
range [0, (2^colorres)-1]
colorres and colornum are values previousely
given to the function GIF_Create().
Return value None
GIF_SetTransparent()
--------------------
Function Specifies the color number of the color
that should be considered transparent.
Syntax void GIF_SetTransparent(
int colornum
);
Remarks Need not be called at all. But if called,
should be called only once with colornum in
the range [0, numcolors] i.e., colornum
must be one of the values previously
given to GIF_SetColor().
Return value None
GIF_CompressImage()
-------------------
Function Compresses an image and stores it in the
current file.
Syntax int GIF_CompressImage(
int left, int top,
int width, int height,
int (*getpixel)(int x, int y)
);
Remarks The left- and top- parameters indicate the
image offset from the upper left corner of
the screen. They also give the start values
for calls to the userdefined callback
function.
width and height give the size of the image.
A value of -1 indicates the equivalent screen
size given in the call to GIF_Create().
If the image is supposed to cover the entire
screen, values 0, 0, -1, -1 should be given.
GIF_CompressImage() obtains the pixel values
by calling a user specified function. This
function is passed in the parameter getpixel.
See "callback()" further down for a
description of this function.
Return value GIF_OK - OK
GIF_ERRWRITE - Error writing to file
GIF_OUTMEM - Out of memory
GIF_Close()
-----------
Function Closes the GIF-file.
Syntax int GIF_Close(void);
Remarks This function writes a terminating descriptor
to the file, and then closes it. Also frees
memory used by the other functions of GIFSAVE.
Return value GIF_OK - OK
GIF_ERRWRITE - Error writing to file
THE CALLBACK FUNCTION
=====================
callback()
----------
Function Obtains pixel-values for the
GIF_CompressImage() -function.
Syntax int callback(int x, int y);
Remarks This function must be written by the
programmer. It should accept two integer
parameters specifying a point in the image,
and return the pixel value at this point.
The ranges for these parameters are as
follows
x : [img_left, img_left + img_width - 1]
y : [img_top, img_top + img_height - 1]
where img_left, img_top, img_width and
img_height are the values left, top, width
and height passed to GIF_CompressImage().
An example; if the screen has width 640 and
height 350, and the image covers the entire
screen, x will be in the range [0, 639]
and y in the range [0, 349].
callback() need not get its values from the
screen. The values can be fetched from a
memory array, they can be calculated for
each point requested, etc.
The function is passed as a parameter to
GIF_CompressImage(), and can thus have any
name, not only callback().
Return value Pixel value at the point requested. Should
be in the range [0, numcolors-1] where
numcolors is as specified to GIF_Create().
</pre>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CONCLUDING REMARKS
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h1 id="remarks"> Concluding Remarks </h1>
<p> I hope you find mimeTeX useful. If so, a contribution to your
country's <a href="http://www.tug.org" target="_top">TeX Users Group</a>,
or to the <a href="http://www.gnu.org" target="_top">GNU</a> project, is
suggested, especially if you're a company that's currently profitable. </p>
<!--
<p> If you also like mimeTeX's source, I'm an independent contractor
incorporated in the US as John Forkosh Associates, Inc.
A <a href="http://www.forkosh.com/resume.html" target="_top">resume</a>
is at <a href="http://www.forkosh.com" target="_top">www.forkosh.com</a>
or email
<a href="mailto:john@forkosh.com">john@forkosh.com</a> </p>
-->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Footer across bottom of page
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<hr size=4>
<table> <tr>
<td> <font size=3 color="maroon"> <b>
<nobr>Copyright <font size=5>©</font> 2002-2012,
<a href="http://www.forkosh.com">John Forkosh Associates, Inc.</a>
</nobr><br>
email: <a href="mailto:john@forkosh.com">john@forkosh.com</a>
</b> </font> </td>
<td> <img src="../cgi-bin/mimetex.cgi?\hspace{100}" alt="" border=0> </td>
<td> <img src="../cgi-bin/mimetex.cgi?\blue{\small\rm You're the }
\Large\counter[counters.log]{counters.txt:mimetex.html}\\[0]
{\small\rm visitor to this page." alt="" border=0 align=bottom> </td>
</tr> </table>
</body>
</html>
<!-- end-of-file mimetex.html -->
|