|
|
( for mimeTeX version 1.64 ) Click for: LaTeX tutorial mimeTeX QuickStart download mimeTeX |
more_examples... |
| - - - T u t o r i a l - - - | - - - - - - - - - - - - - - R e f e r e n c e - - - - - - - - - - - - - - | ||
|
(I) Introduction a. Quick Start b. Examples c. GPL License |
(II) Building mimeTeX a. Compile b. Install c. Compile Options d. Command Line |
(III) Syntax Reference a. Math & White Space b. Symbols, Sizes, Modes c. Delimiters d. Accents, Arrows, etc. e. \begin{array} f. \picture( ){ } g. Other Commands h. Other Exceptions |
(IV) Appendices a. Fonts b. make_raster() c. gifsave.c Remarks |
| - - - - - - 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 - - - - - - | ||||||
|
||||||
MimeTeX, licensed under the gpl, lets you easily embed LaTeX math in your html pages. 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 install. And it's equally easy to use. Just place an html <img> tag in your document wherever you want to see the corresponding LaTeX expression. For example,
<img src="../cgi-bin/mimetex.cgi?f(x)=\int_{-\infty}^xe^{-t^2}dt"
alt="" border=0 align=middle> immediately
generates the corresponding gif image on-the-fly, displaying
wherever you put that <img> tag.
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
-DCACHEPATH=\"path/\"
compile option.)
There's no inherent need to repeatedly write the cumbersome <img> tag illustrated above. You can write your own custom tags, or write a wrapper script around mimeTeX to simplify the notation.
For example, if you're using phpBB2, then Jameson contributed the following typical one-line mod that lets you just write [tex] f(x)=\int_{-\infty}^xe^{-t^2}dt [/tex] to obtain the same image illustrated above:
#--------[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);
If you're using phpBB3, then no mod is even needed. Just click Postings from the Administrator Control Panel, and add the custom BBCode [tex]{TEXT}[/tex] with the HTML replacement <img src="/cgi-bin/mimetex.cgi?{TEXT}" align=middle>
Similarly, PmWiki also has a mimeTeX plugin that lets you just write {$ f(x)=\int_{-\infty}^xe^{-t^2}dt $} to obtain that same image. Several other packages also have similar mimeTeX plugins:
| Package | Plugin | |
| PmWiki | mimeTeX plugin | |
| Wikimedia | "mimeTeX alternative" | |
| MathWiki | "mimeTeX Parser" | |
| PunBB | mimeTeX plugin | |
| Movable Type | mimeTeX plugin | |
| WordPress | mimeTeX plugin |
Please note: If you're writing your own plugin for mimeTeX, please don't write php code using system( ), or any other shell escape mechanism, just to cache images. Use mimeTeX's -DCACHEPATH=\"path/\" compile option instead. system( ) 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 system( ) 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.
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
ImageMagick,
then you may prefer to look at a math rendering script like
latexrender
which uses LaTeX to create higher quality images than mimeTeX
produces. For comparison,
, with arbitrary mean
and standard deviation
, and at mimeTeX's next larger font size, looks like
| mimeTeX | |
latexrender |
|
|
|
Similar LaTeX-based solutions that you may want to look at are textogif and gladTeX. Additional discussion and several more links are at www.tug.org/interest.html and in the tex-faq.
You may now want to browse the additional Examples below before proceeding, to make sure mimeTeX suits your needs before you spend more time learning to use it.
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 turorials are readily available. You may also want to browse Andrew Roberts' Latex Math I and Latex Math II, or my own LaTeX math tutorial. Then, instead of continuing to read this page, you can 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 you can Click any of the Examples below to place that corresponding expression in the Query Box.
Meanwhile, here are just a few quickstart tips for Submitting your own mimeTeX expressions in the Query Box below:
Now enter your own LaTeX expression, use the sample provided, or Click any of the Examples. Then press the Submit button, and mimeTeX's rendering should be displayed in the little window immediately below it.
|
Now click Submit to see it rendered below... |
You should see
if you submit the sample expression
already in the box.
And the <img> tag to embed this same integral anywhere in your own document is
<img src="../cgi-bin/mimetex.cgi?\large f(x)=\int_{-\infty}^xe^{-t^2}dt"
alt="" border=0 align=middle>
The typical mimeTeX <img> tag has the form
<img src="../cgi-bin/mimetex.cgi?any valid LaTeX/mimeTeX expression" alt="" border=0 align=middle>
where ../cgi-bin/mimetex.cgi is the relative path from your html page containing these tags to your compiled mimetex.cgi program, and where any valid LaTeX/mimeTeX expression is pretty much any valid LaTeX math expression:
Here are various additional random examples further demonstrating mimeTeX's features and usage. To see how they're done, Click any one of them to place its corresponding expression in the Query Box above. Then press Submit to re-render it, or you can edit the expression first to suit your own purposes.
| (1) |
|
||||||||
| (2) |
|
||||||||
| (3) |
|
||||||||
| (4) |
|
||||||||
| (5) |
|
illustrating \frac{}{} for continued fraction | |||||||
| (6) |
|
illustrating \left\{...\right.
and note the accents |
|||||||
| (7) |
|
\overbrace{}^{} and \underbrace{}_{} (TeXbook page 181, Exercise 18.41) |
|||||||
| (8) |
|
||||||||
| (9) |
|
Block diagonal form using nested \begin{array}'s. Also, note rows aligned across all three arrays. |
|||||||
| (10) |
|
using \begin{eqnarray} to align equations | |||||||
| (11) |
|
commutative diagram using \begin{array} | |||||||
| (12) |
|
mimeTeX \picture(size){pic_elems} "environment", illustrating the image charge - q for a grounded conducting sphere of radius a with a charge q at distance r > a outside it. | |||||||
| (13) |
|
\picture "environment"
illustrating the surface polarization charge induced by a uniform
electric field. Inside the slab of material, the volume polarization
charge clearly vanishes. The little |
|||||||
Finally, illustrated below are some examples of fonts and symbols available with mimeTeX. All symbols and sizes from cmr, cmmi, cmmib (use \mathbf{ }), cmsy, cmex, bbold (use \mathbb{ }), rsfs (use \mathscr{ }), stmary and cyrillic wncyr (use {\cyr } or \cyr{ }) 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).
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 GPL. 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.
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.
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.
To protect your own intellectual property, I recommend Copyright Basics from The Library of Congress, in particular Circular 61, Copyright Registration for Computer Programs. Very briefly, download Form TX 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.
Very quickly --- download mimetex.zip and then type
Read the rest of this section for more detailed information. |
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).
The steps needed to download and compile mimeTeX are
| README | mimeTeX release notes |
| LICENSE | GPL license, under which you may use mimeTeX |
| mimetex.c | mimeTeX source program and all required functions |
| mimetex.h | header file for mimetex.c (and for gfuntype.c) |
| gfuntype.c | parses output from gftype -i and writes bitmap data |
| texfonts.h | output from several gfuntype runs, needed by mimetex.c |
| gifsave.c | gif library by Sverre H. Huseby http://shh.thathost.com |
| mimetex.html | this file, the mimeTeX user's manual |
That's all there is to compiling mimeTeX. Several other optional compile-line options available for mimetex.c are discussed below.
Immediately after compiling mimeTeX, test your new executable by typing ./mimetex.cgi "x^2+y^2" from the Unix shell (or mimetex "x^2+y^2" from the Windows Command Prompt), which should emit two "ascii rasters" something like the following
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
(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.) Just typing ./mimetex.cgi without an argument should produce ascii rasters for the default expression f(x)=x^2. If you see these two ascii rasters then your binary's good. Otherwise, you must find and fix the problem before proceeding.
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
Immediately after installing mimeTeX, test your new mimetex.cgi
by typing a url into your browser's locator window something like
http://www.yourdomain.com/cgi-bin/mimetex.cgi?x^2+y^2
which should display
in the upper-left corner of your window,
just like clicking this link does, which tests my mimetex.cgi,
http://www.forkosh.com/cgi-bin/mimetex.cgi?x^2+y^2
If you see the same image
from the yourdomain link, then you've completed
a successful mimeTeX installation.
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 cgi-bin/ directory, set the correct chmod 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.
After you've successfully installed mimeTeX, and both preceeding tests have succeeded, you can optionally "regression test" all mimeTeX features as follows:
That's all there is to installing mimeTeX.
.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.
---------------------------------------------------------------------
2004-08-07:09:00:53am f8ccc8dd93c8eeb1d9c40b353ef781e0.gif
\LARGE x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
---------------------------------------------------------------------{ "\\iint", NULL, "{\\int\\int}" },
{ "\\rightleftharpoons",NULL,"{\\rightharpoonup\\atop\\leftharpoondown}" },
{ "\\ldots", NULL, "{\\Large.\\hspace1.\\hspace1.}" },
{ "\\cr", NULL, "\\\\" },
{ "\\neq", NULL, "{\\not=}" },
For newcommands _without_ arguments, as illustrated above,
the general form of each line in your file should be
{ "\\command", NULL, "{replacement}" },
Don't forget a comma at the end of every line,
and write a double backslash \\
between quotes "...\\..." wherever you actually
want a single backslash \. The only effect
of the above examples (without arguments) is simple string
substitution, i.e., every occurrence of \command
is replaced by {replacement}. Note that the
{ }'s surrounding replacement
aren't required, but are usually a good idea (the case
of \cr illustrated above is one exception, where
{ }'s would defeat the purpose).
{ "\\lvec", "2n", "#2_1,\\cdots,#2_{#1}" },
In this case the NULL has been replaced by "2n"
(note the mandatory surrounding quotes "..."). This
example corresponds to the similar one discussed in TLC2 on
page 845. The first character inside the "..."s is
2 indicating the number of arguments,
which may be 1 thru 9. If there are no
subsequent characters followng this one, then all arguments are
mandatory, enclosed in { }'s as usual. Otherwise,
any subsequent characters signal that the first argument
is optional, enclosed in [ ]'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
n as shown. In this case that's just a single
character, but you can write any length default you like.
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.
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 + are never translated to blank spaces, nor is any other %xx url decoding performed on command-line arguments.)
The complete command-line syntax for mimeTeX is
./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.
Since mimeTeX's syntax is as TeX-like as possible, we'll mostly discuss the occasional differences. This section contains short paragraphs that each discuss some aspect of mimeTeX where your LaTeX experience might not be precisely duplicated.
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 Submitting a query to quickly see whether or not it works. And you might want to occasionally re-browse the Examples above, which may better illustrate implemented features.
Lengths in mimeTeX are all ultimately expressed in number of pixels. Various commands discussed below require length arguments, including
(the \longxxxarrow [ ]-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 \unitlength.
MimeTeX's \unitlength{ } command lets you specify the number of pixels per "length unit", e.g., \unitlength{10} \hspace{2.5} renders a 25-pixel space. Both \unitlength{ } and \hspace{ }'s length arguments may be integers or may contain decimal points. Ditto for all other mimeTeX commands that take length arguments. The default \unitlength is, you guessed it, 1.
A specified \unitlength applies to all subsequent terms, i.e., everything to its right. And several \unitlength's may be specified in the same expression, each one overriding those to its left. But if one or more \unitlength's appear within a { }-enclosed subexpression, then terms following its closing right } revert to the \unitlength in effect before its opening left {. For example,
which has a 10-pixel space between A and B, then 25 pixels between B and C, and finally another 10 pixels between C and D.
Except inside text boxes, unescaped blanks, tildes (a ~), and all other usual whitespace 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.
MimeTeX recognizes math spaces \/ \, \: \;
as well as \quad and \qquad ,
and also a backslashed blank
(i.e., a \ followed by a blank).
For example,
(a\/b\,c\:d\;e\ f\quad g\qquad h)
  renders
.
In mimeTeX, you may also write \hspace{10}
to insert a 10-pixel (or any other number) space, scaled by any
preceding \unitlength, as illustrated
just above.
For negative spaces, \! produces a small (two
pixel) negative space, e.g., a=b renders
whereas a\!=b renders
and a\!\!=b renders
.
For large negative space, \hspace{-10} 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
\hspace*{-10} instead. For example,
ABC\hspace*{-20}-DEF renders
, erasing all of the C
and the right half of the B.
MimeTeX also supports \hfill{textwidth}, where textwidth is roughly equivalent to LaTeX's \textwidth, i.e., it's the total number of pixels, scaled by \unitlength, that your entire rendered expression will span. However, if \hfill{ } appears within a { }-enclosed subexpression, then it applies only to that subexpression. For example,
The first/inner \hfill{75} inserts exactly enough whitespace so that subexpression "abc def" spans 75 pixels. Then the second/outer \hfill{150} inserts exactly enough whitespace so that the entire expression spans 150 pixels. Without explicit { }-nesting, mimeTeX evaluates expressions left-to-right (sinistrally), e.g., ...\hfill{150}...\hfill{75}... is exactly equivalent to ...\hfill{150}{...\hfill{75}...}. Notice that, this time, the second/right textwidth argument is necessarily smaller than the first/left.
Finally, mimeTeX begins a new line whenever you write \\ . And you may optionally write \\[10] to put a 10-pixel (or any other number) vertical space, scaled by \unitlength, between lines. \begin{eqnarray} also splits long equations over several lines, as illustrated by Example 10 above. But when that's not the best solution, you can also write, for example,
However, mimeTeX can't correctly handle automatically-sized delimiters across linebreaks, e.g.,
which I produced using \big{...\\...\big} instead of \left\{...\\...\right\}. Expressions of the form \left...\right \\ \left...\right should all be rendered properly. It's only \left...\\...\right that will look odd.
Some browsers occasionally misinterpret typed blank spaces inside html query_string's. In that case, you can write tildes (a ~) wherever blanks are required or desired, e.g., \alpha~w instead of \alpha w, or \frac~xy or \sqrt~z, etc. MimeTeX correctly interprets both blanks and ~'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.
Similarly, some browsers occasionally misinterpret linebreaks/newlines inside the middle of long html query_string's. For example,
<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> 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.
If you can break long query_string's over several lines, then you may find mimeTeX's %%comments%% feature useful, too. Note that comments must be preceded and followed by two %'s rather than LaTeX's usual one. The above example could be written
<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>
Besides whitespace, browsers may misinterpret embedded apostrophes, and especially quotes, within query strings. The a's and b's in Example 7 above actually use superscripted commas for apostrophes, i.e., a^,s and b^,s, and you can also use LaTeX \prime's, as in a^\prime s. For quotes, you can use ^{,,} since " almost certainly won't work. To help make things easier, in addition to the usual LaTeX \prime, mimeTeX also recognizes \apostrophe and \quote and \percent, all with the obvious meanings.
For complete information about the characters and math symbols
available in mimeTeX, you'll need to browse through the bottom
500-or-so lines of mimetex.h. And several additional
symbols like \ldots and \AA and \hbar are
defined by the mimeTeX preprocessor, function mimeprep( )
in mimetex.c Generally speaking, I've tried to
encode the cmr10, cmmi10, cmmib10, cmsy10, cmex10, bbold10, rsfs10,
stmary10 and wncyr10 families with "names", e.g., \alpha \beta
\forall \sqcup, etc, identical to your LaTeX expectations.
For example, the calligraphic symbols in cmsy10 are accessed by
writing \mathcal{A} \mathcal{B} \mathcal{XYZ}. Similarly,
write \mathbf{A} for the cmmib fonts, write \mathscr{A}
for rsfs10, write \mathbb{R} for bbold10, and write
{\cyr Khrushchev} or \cyr{Khrushchev} to see
.
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.
I haven't exhaustively checked all the name-number matchings for the hundreds of symbols in mimetex.h. You can eaily correct any minor mistake you find in what I hope is an obvious manner. The fonts Appendix IVa below provides additional information.
In addition to extra LaTeX symbols like \ldots, \AA and \hbar, mentioned above, the mimeTeX preprocessor mimeprep( ) also recognizes various html special characters like <, >, , ", &, etc. Some web tools apparently translate characters like, e.g., > to >, even inside quoted query_string's, so mimeTeX's preprocessor translates them back to LaTeX symbols for you. Moreover, html misinterprets quotes " inside a quoted query string as the end of the query string. So, for example, the cyrillic ligature \"E has to be written in the even more cumbersome form \"E inside a query string.
MimeTeX currently has eight font sizes, numbered 0-7, with default 3. This font size numbering corresponds to the usual LaTeX directives \tiny, \small, \normalsize, \large (default), \Large, \LARGE, \huge and \Huge. 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 { }-subexpression remains in effect only within that subexpression.
In mimeTeX you may also write \fontsize{0}...\fontsize{7} or the shorter \fs{0},...,\fs{7} for \tiny,...,\Huge. And since these arguments are all single digits, the even shorter form \fs0,...,\fs7 works equally well. For example,
rendering f(x)=x^2 in mimeTeX font sizes 0 (\tiny or \fs0), 1 (\small or \fs1), 2 (\normalsize or \fs2), 3 (default \large), 4 (\Large or \fs4), 5 (\LARGE or \fs5), 6 (\huge or \fs6) and 7 (\Huge or \fs7).
You'll soon notice that exponents and \frac's and \atop's are automatically rendered one size smaller than their base expressions. For example,
rendering the "y=e" in font size 4 (\Large), the "x" in font size 3 (\large), and the "2" in font size 2 (\normalsize). If you get below font size 0, the font size remains 0.
Explicit size declarations override mimeTeX's default sizing behavior. You can rewrite the preceding example as, say,
rendering the "y=e" in font size 4 (\Large unchanged), the "x" in font size 2 (\normalsize), and the "2" in font size 0 (\tiny).
Preceding an \fs{ } size argument with + or
- specifies "relative" sizing. For example,
\large\text{abc{\fs{-2}def}ghi} produces
, rendering the "def"
in font size 1 (two sizes smaller than \large). Note that
\fs{-2} affects only the subexpression in which it appears,
and that its braces are no longer optional since -2 contains
two characters. For exponents (or any other size-changing commands
like \frac),
rendering the "y=e" in font size 4 (\Large), as usual. The "x" would usually be rendered one size smaller, in font size 3, and your \fs{-1} is applied to that, resulting in font size 2. And the final "2" is rendered, by the usual rules, one size smaller than the "x", in font size 1.
MimeTeX is always in a math-like mode, so you needn't surround
expressions with $...$'s for \textstyle,
or $$...$$'s for \displaystyle.
By default, operator limits like \int_a^b are rendered
\textstyle
at font sizes \normalsize
and smaller, and rendered \displaystyle
at font sizes \large and
larger (see the -DDISPLAYSIZE
compile option to change this default).
And when \displaystyle is invoked (either implicitly at font size
\large or larger, or if you explicitly write \displaystyle
at any font size), then operators \int, \sum,
\prod, etc, are automatically promoted to larger sizes.
For example,
and
As usual, \nolimits turns displaystyle off (or textstyle on) for the operator immediately preceding it. For example,
and likewise, \limits turns displaystyle on for the operator immediately preceding it. For example,
By the way, \limits affects _any_ character or subexpression immediately preceding it. For example,
Likewise, for subexpressions,
This side effect may occasionally be useful. For example,
(mimeTeX automatically centers super/subscripts above/below the long and Long arrow forms)
The \displaystyle command turns on displaystyle math mode for the entire expression (or { }-enclosed subexpression), affecting _all_ super/subscripts to the right of the \displaystyle, except for character classes Ordinary and Variable (TeXbook page 154). Similarly, \textstyle turns off displaystyle math mode. For example,
Note that \sum's within the subexpression are all affected by the beginning \displaystyle, but not the Variable x_i^j. An explicit x\limits_i^j always affects any preceding term.
Finally, mimeTeX also has a text-like/roman mode entered by writing either \text{anything at all} or the equivalent LaTeX-2.09-like command {\rm anything at all}, both of which render anything at all in roman (font family cmr10). \mbox{ } and several similar LaTeX commands are recognized by mimeTeX as synonyms for \text{ }. For italic, write \textit{anything at all} or {\it anything at all}, both of which render anything at all in italic (font family cmmi10). All four forms respect spaces between words, except that the first/required space after {\rm etc} and {\it etc} is still ignored. For example,
You don't usually surround mimeTeX expressions with $'s, but that works in the usual way for \text{ } and \mbox{ }, rendering the $...$-enclosed subexpression in mathmode. For example,
LaTeX's \left( ... \right) and the other 21 standard LaTeX delimiters are also recognized by mimeTeX. And mimeTeX also recognizes an etex-like \middle. Several of the most common automatically sized delimiters are illustrated below...
Notes...
Besides the \left...\right delimiters discussed above,
mimeTeX also supports constructions like
\left\int_a^b...\right. , which automatically
sizes the \left\int to accommodate everything between it
and its matching \right. delimiter.
The \right delimiter needn't necessarily be
the \right. illustrated, e.g.,
\left\int_a^b x^2dx =\frac{x^3}3\right|_a^b
produces
.
You can also write \left\sum, \left\prod,
\left\cup, etc, for many of the symbols in CMEX10 and STMARY10.
And any symbol that works with \left will also work
with \right .
Unescaped ( )'s and [ ]'s and | |'s and < >'s don't need to be balanced since mimeTeX just displays them like ordinary characters without any special significance. Ditto for the usual four \big( and \Big( and \bigg( and \Bigg(, and for their four right ) counterparts, which just display (...)'s at fixed larger sizes, and also have no special significance. All four big [ ]'s and < >'s and { }'s are also available as ordinary characters.
As usual, unescaped {...}'s aren't displayed at all, must be balanced, and have the usual special LaTeX significance. MimeTeX interprets escaped \{...\}'s as abbreviations for \left\{...\right\} and therefore always sizes them to fit. If you need displayed but unsized {...}'s, write \lbrace...\rbrace or any of the four \big{...\big}'s.
\vec{ } \hat{ } \bar{ } \tilde{ } \dot{ } \ddot{ } and \acute{ } \grave{ } \breve{ } \check{ } are the only accents currently supported. The first four are all "wide". For example, you can write \widehat{ } if you like, but there's absolutely no difference either way (and \bar{ } and \overline{ } are identical). The last four accents only take a single character argument.
Other accent-like directives available in mimeTeX are \underline{ } \cancel{ } \sout{ }, as well as \overset{ }{ } \underset{ }{ } and the more ususal \overbrace{ }^{ } \underbrace{ }_{ }. And \not also works on the single character immediately following it. Some of these directives are discussed in more detail below.
All 32 usual LaTeX function names \arccos,...,\tanh are recognized by mimeTeX and treated in the usual way. MimeTeX also recognizes \tr for the trace, and also \bmod and \pmod. And those functions that normally take "limits" also behave as expected, e.g.,
All mimeTeX \long and \Long arrows take an optional [width] argument
that explicitly sets the arrow's width in pixels, scaled by
\unitlength. For example,
\longrightarrow[50] draws a 50-pixel wide arrow
, whereas just \longrightarrow calculates
a default width