m i m e T e X   m a n u a l
( for mimeTeX version )
Click for:  LaTeX tutorial
mimeTeX QuickStart
mimeTeX Source Listing
download mimeTeX

more_examples...
This page discusses mimeTeX, a program that displays math on the web.
(See Writing Math on the Web for a more general discussion.)

Copyright © 2002-2012, John Forkosh Associates, Inc.
email: john@forkosh.com



        C o n t e n t s        
- - - 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. Scripts&Plugins
d. 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
i. Errors and Messages
    (IV) Appendices    
a. Fonts
b. make_raster()
c. gifsave.c
  Remarks  

This page contains more information than you'll probably need to read. If you follow the Installation and Usage Summary below, try installing mimeTeX immediately. Or continue reading until you feel comfortable trying to install mimeTeX. Prerequisites are: some knowledge of your OS's shell, of installing cgi's, of LaTeX.
        "Computers are like Old Testament gods: lots of rules and no mercy."
        –– Joseph Campbell, The Power of Myth   (Doubleday 1988, page 18)

- - - - - - 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 - - - - - -
      Installation:     Download mimetex.zip and then type
    unzip mimetex.zip
    cc -DAA mimetex.c gifsave.c -lm -o mimetex.cgi
Now just mv mimetex.cgi to your cgi-bin/ directory,
set permissions as necessary, and you're all done.
 
Usage:     To see the image
   
just write the tag
    <img src="/cgi-bin/mimetex.cgi?
    x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}">

(I) Introduction  

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.
        Just download mimetex.zip and then type
            unzip mimetex.zip
            cc –DAA mimetex.c gifsave.c –lm –o mimetex.cgi
        Now just mv mimetex.cgi to your cgi-bin/ directory,
        set permissions as necessary, and you're all done.

And mimeTeX is equally easy to use:   just place an html <img> tag in your document wherever you want to see the corresponding LaTeX expression.
        For example, the <img> tag
            <img  src="../cgi-bin/mimetex.cgi?f(x)=\int_{-\infty}^xe^{-t^2}dt" >
        immediately generates the corresponding gif image on-the-fly,
            displaying     wherever you put that 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.)   And there's no inherent need to repeatedly write the cumbersome <img> tag illustrated above. You can write your own wrapper scripts, discussed below, around mimeTeX to simplify the notation.

Alternative solutions...

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

latexrender mimeTeX
 

Similar LaTeX-based solutions that you may want to look at are mathtran, textogif and gladTeX. Additional discussion and several more links are at www.tug.org/interest.html and in the tex-faq.

For example, mathtran is a public LaTeX web service that's particularly easy to use by following these simple instructions. In the <head> of your html page, place the tag
    <script type="text/javascript"
        src="http://www.mathtran.org/js/mathtran_img.js"></script>
and in the <body>, wherever you want to see latex images, place tags like
    <img alt="tex:any latex math expression">
For comparison,
    <img alt="tex: f(x) = \frac1{\sigma\sqrt{2\pi}}
    \int_{-\infty}^x e^{-\frac{(t-\mu)^2}{2\sigma^2}}dt">
looks like

mathtran mimeTeX
unavailable
 

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.

(Ia) Quick Start  

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: