File:  [LON-CAPA] / loncom / cgi / mimeTeX / mimetex.html
Revision 1.1: download - view: text, annotated - select for diffs
Mon Feb 28 19:08:11 2005 UTC (19 years, 2 months ago) by albertel
Branches: MAIN
CVS tags: version_2_1_X, version_2_1_3, version_2_1_2, version_2_1_1, version_2_1_0, version_2_0_X, version_2_0_99_1, version_2_0_2, version_2_0_1, version_2_0_0, version_1_99_3, version_1_99_2, version_1_99_1_tmcc, version_1_99_1, version_1_99_0_tmcc, version_1_99_0, HEAD
- adding tex->image convertor (mimeTeX)

<!--
 ****************************************************************************
 * Copyright(c) 2002-2005, John Forkosh Associates, Inc. All rights reserved.
 * ==========================================================================
 * 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 2 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 distribution should contain a copy of the GNU General
 * Public License.  If not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA,
 * or point your browser to  http://www.gnu.org/licenses/gpl.html
 ****************************************************************************
 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <!-- "http://www.forkosh.dreamhost.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 }
      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>
  <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>
  </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 &nbsp; m a n u a l</nobr></b> <br>
    <font size=3>( for mimeTeX version 1.60 )</font> <br>
    <font size=3> <b>Click for:</b>&nbsp;
     <!-- <a href="http://www.forkosh.com" target="_top">homepage</a>, &nbsp;
     <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>
     <!-- jfa <a href="http://www.forkosh.com/mimetex.zip"> -->
     <a href="ftp://ftp.tex.ac.uk/tex-archive/support/mimetex/mimetex.zip">
     <font size=4>download&nbsp;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>
 </table>
</center>
<hr size=4>
<center><b><font color="maroon" size=3>
Copyright <font size=5>&copy;</font> 2002-2005,
<a href="http://www.forkosh.com">John Forkosh Associates, Inc.</a> <br>
email: <a href="mailto:john&#64;forkosh&#46;com">john&#64;forkosh&#46;com</a>
</font></b></center>


<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Table of Contents
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<br><br>
<center><b><font color="maroon" size=5>
 <u> &nbsp; &nbsp; &nbsp; C o n t e n t s &nbsp; &nbsp; &nbsp; </u></font></b>
<br>
<table cellspacing=0 class="medium">
 <tr>
  <td valign="top" align="center" width=150>
   <b>- - - T u t o r i a l - - -</b> </td>
  <td valign="top" align="center" colspan=3 width=450>
- - - - - - - - - - - - - - R e f e r e n c e - - - - - - - - - - - - - -</td>
 </tr>
 <tr>
  <td valign="top" align="center" width=150> <font size=3>
   <a href="#introduction">&nbsp; (I) Introduction &nbsp;</a><br>
    <a href="#quickstart"> a. Quick Start </a><br>
    <a href="#examples">   b. Examples </a><br>
    <a href="#gpl">        c. GPL License </a> </font> </td>
  <td valign="top" align="center" width=150> <font size=3>
   <a href="#build">&nbsp; (II) Building mimeTeX &nbsp;</a><br>
    <a href="#download">   a. Download </a><br>
    <a href="#compile">    b. Compile </a><br>
    <a href="#install">    c. Install </a><br>
    <a href="#options">    d. Compile Options </a><br>
    <a href="#cmdline">    e. Command Line </a> </font> </td>
  <td valign="top" align="center" width=150> <font size=3>
   <a href="#reference">&nbsp; (III) Syntax Reference &nbsp;</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(&nbsp;){&nbsp;} </a><br>
    <a href="#commands">   g. Other Commands </a><br>
    <a href="#exceptions"> h. Other Exceptions </a> </font> </td>
  <td valign="top" align="center" width=150> <font size=3>
   <a href="#appendices">&nbsp; &nbsp; (IV) Appendices &nbsp; &nbsp;</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"> &nbsp; Remarks &nbsp; </a> </font> </td>
 </tr>
</table></center>


<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SECTION I.  INTRODUCTION
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h1> <a name="introduction">(I) Introduction</a> &nbsp; </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="#quickbuild">install</a>.  And it's equally
    easy to use.  Just place an html &lt;img&gt; tag in your document
    wherever you want to see the corresponding LaTeX expression.
    For example, </p>
<pre>  &lt;img&nbsp;src="../cgi-bin/mimetex.cgi?f(x)=\int_{-\infty}^xe^{-t^2}dt"
   alt="" border=0 align=middle&gt;</pre> <p class="continue">immediately
    generates the corresponding gif image on-the-fly, displaying
    <a href="#preview"><img id="imageI1" onclick="eqntext('imageI1')"
    src="../cgi-bin/mimetex.cgi?f(x)=\int\limits_{-\infty}^xe^{-t^2}dt"
    alt="" border=0 align=middle></a> wherever you put that &lt;img&gt tag.
    MimeTeX doesn't need intermediate dvi-to-gif conversion, and it doesn't
    store separate gif files for each converted expression.
    There's also no inherent need to repeatedly write the cumbersome
    &lt;img&gt; tag illustrated above.  You can write your own custom
    tags, or write a wrapper script around mimeTeX to simplify the
    notation. For example,
    <a href="http://www.pmichaud.com/wiki/PmWiki/PmWiki" target="_top">
    PmWiki</a> already has a
    <a href="http://www.pmichaud.com/wiki/Cookbook/MimeTeX" target="_top">
    mimeTeX&nbsp;plugin</a> that let's you just write
    <b>{$&nbsp;f(x)=\int_{-\infty}^xe^{-t^2}dt&nbsp;$}</b>
    to obtain the same image. </p>

<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,
    <a href="#preview"><img id="imageI2" onclick="eqntext('imageI2')"
    src="../cgi-bin/mimetex.cgi?f(x)=\int\limits_{-\infty}^xe^{-t^2}dt"
    alt="" border=0 align=middle></a>, with arbitrary mean
    <a href="#preview"><img id="imageI3" onclick="eqntext('imageI3')"
    src="../cgi-bin/mimetex.cgi?\large\mu" alt="" border=0 align=middle></a>
    and standard deviation
    <a href="#preview"><img id="imageI4" onclick="eqntext('imageI4')"
    src="../cgi-bin/mimetex.cgi?\large\sigma" alt="" border=0
    align=middle></a>, and at mimeTeX's next larger font size, looks like </p>
     <center>
      <table>
       <tr align="center">
	<td> <font size="4">mimeTeX</font> </td>
	<td> <img src="../cgi-bin/mimetex.cgi?\hspace{30}"
              alt="" border=0> </td>
	<td> <font size="4">latexrender</font> </td>
       </tr>
       <tr align="center">
 	<td>
	 <a href="#preview"><img id="imageI5" onclick="eqntext('imageI5')"
	 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>
        <td> &nbsp; </td>
	<td> <img src="http://www.forkosh.com/lrender.gif"
	 alt="" border=0 align=middle> </td>
       </tr>
      </table>
     </center>
<p> Similar LaTeX-based solutions that you may want to look at are
    <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> 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&nbsp;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&nbsp;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
    invest more time learning to use it. </p>


<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
QUICKSTART
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h2> <a name="quickstart"> (Ia) Quick Start &nbsp; </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.comp.leeds.ac.uk/andyr/misc/latex/latextutorial9.html"
     target="_top">Latex&nbsp;Math&nbsp;I</a> and
     <a href="http://www.comp.leeds.ac.uk/andyr/misc/latex/latextutorial10.html"
     target="_top">Latex&nbsp;Math&nbsp;II</a>, or my own
     <a href="http://www.forkosh.com/mimetextutorial.html" target="_top">
     LaTeX&nbsp;math&nbsp;tutorial</a>.
     Then, instead of continuing to read this page, you 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 six font sizes selected by
           one of the usual declarations
           <b>\tiny</b> or <b>\small</b> or <b>\normalsize</b> (default),
           or <b>\large</b> or <b>\Large</b> or <b>\LARGE</b>&nbsp;.
           For example, &nbsp; <b>\Large&nbsp;\sqrt{x^2+y^2}</b> &nbsp;
           renders &nbsp; <b>\sqrt{x^2+y^2}</b> &nbsp; two sizes above
           <b>\normalsize</b>. </li>
<!--  <li> At smaller font sizes, try preceding your expression with &nbsp;
           <b>\light</b> &nbsp; which adjusts mimeTeX's anti-aliasing
           parameters to produce thinner lines that you may feel are
           more legible, e.g.,<br> &nbsp; &nbsp;
           <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>  &nbsp versus &nbsp;
           <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 &nbsp;
           <b>\displaystyle&nbsp;e^x=\sum_{n=0}^\infty\frac{x^n}{n!}</b>
           &nbsp; or &nbsp; <b>e^x=\sum\limits_{n=0}^\infty\frac{x^n}{n!}</b>
           &nbsp; 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&nbsp;option</a> below to change the
           default). &nbsp; <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 &nbsp;
           <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 align=middle></a>
           &nbsp; at sizes <b>\normalsize</b> and smaller,
           and renders them displaystyle &nbsp;
           <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 align=middle></a>
           &nbsp; 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&nbsp;option</a> below to change
           the default. </li>
     </ul>
 <p> <a name="forminput"> </a> <a name="preview"> </a>
     Now enter your own 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>
               <!-- <font color="#000000" size="+1"><u><b>Enter your
                Expression in Box below, or Click any Example ...
                </b></u></font> <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"> &nbsp; &nbsp;
               &nbsp; <input type="submit" value="Submit Expression"> </font>
             </td></tr>
           </table>
         </form>
         <iframe name="inlineframe" align="middle" width="85%" height="110">
         &lt;p&gt;iframe's not supported if you see this.&lt;/p&gt; 
         </iframe>
       </td></tr>
      </table>
     </center>
 <p> You should see &nbsp;
     <a href="#preview"><img id="imageIA3" onclick="eqntext('imageIA3')"
     src="../cgi-bin/mimetex.cgi?f(x)=\int\limits_{-\infty}^x e^{-t^2}dt"
     alt="" border=0 align=middle></a> if you submit the sample expression
     already in the box. </p>

 <p> And the &lt;img&gt; tag to embed this same integral anywhere
     in your own document is </p>
<pre> &lt;img&nbsp;src="../cgi-bin/mimetex.cgi?\large f(x)=\int_{-\infty}^xe^{-t^2}dt"
  alt="" border=0 align=middle&gt;</pre>

 <p> You can see numerous additional examples illustrating html
     &lt;img&gt; tags using mimeTeX by viewing this page's source.
     The typical mimeTeX &lt;img&gt; tag has the form </p>
<pre> &lt;img&nbsp;src="../cgi-bin/mimetex.cgi?any valid LaTeX/mimeTeX expression"
  alt="" border=0 align=middle&gt;</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&nbsp;valid&nbsp;LaTeX/mimeTeX&nbsp;expression</b>
     is pretty much any valid LaTeX math expression: </p> <ul>
       <li> As discussed in the <a href="#introduction">Introduction</a>,
            you can replace cumbersome &lt;img&gt; tags with your own custom
            tags or wrapper scripts. </li>
       <li> And there are occasional exceptions where I couldn't program
            mimeTeX to precisely mimic all valid LaTeX syntax.
            One particular "gotcha" to be aware of 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>, etc.
            The <a href="#reference">Syntax&nbsp;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> Besides the occasional exceptions discussed above, mimeTeX
            also provides various LaTeX extensions, i.e., LaTeX errors
            permitted by mimetex.  For example, font size changing
            directives like <b>\Large</b> are permitted within mimeTeX
            math&nbsp;mode expressions.  But note well: if you take
            advantage of mimeTeX extensions, your math&nbsp;mode expressions
            will no longer be accepted by standard TeX engines. </li> </ul>


<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
EXAMPLES
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h2> <a name="examples"> (Ib) Examples &nbsp; </a> </h2>

 <p> 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
     <a href="#preview">Query&nbsp;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> &nbsp;&nbsp;&nbsp; </td>
  <td align="left" colspan=4>
    <a href="#preview">
      <img id="example1a" onclick="eqntext('example1a')"
      src="../cgi-bin/mimetex.cgi?\red\small\displaystyle
      e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
      alt="" border=0 align=middle></a> &nbsp &nbsp
    <a href="#preview">
      <img id="example1b" onclick="eqntext('example1b')"
      src="../cgi-bin/mimetex.cgi?\green\normalsize\displaystyle
      e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
      alt="" border=0 align=middle></a> &nbsp &nbsp
    <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> &nbsp &nbsp
    <a href="#preview">
      <img id="example1d" onclick="eqntext('example1d')"
      src="../cgi-bin/mimetex.cgi?\reverse\opaque\light
      \Large e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
      alt="" border=0 align=middle></a> &nbsp &nbsp
    <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 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=4>
    <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\ =\ \large\left(
         \begin{array}{c.ccc}&1&2&3\\\hdash1&a_{11}&a_{12}&a_{13}\\
         2&a_{21}&a_{22}&a_{23}\\3&a_{31}&a_{32}&a_{33}\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?\normalsize
         \left(\large\begin{array}{GC+23}
         \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)}^{4$\;\;a}}
    (52,50){\line(125)} (50,52;115;2){\mid} (52,55){\longleftar[60]}
    (130,56){\longrightar[35]} (116,58){r} (c85,50;80;2){\bullet}
    (c85,36){\large-q} (c165,36){\large q}
    (42,30){\underbrace{\line(32)}_{\small 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 &gt; 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>
<br><br>

<!-- font examples
++++++++++++++++++ -->
 <p> Finally, illustrated below are some examples of fonts and symbols
     available with mimeTeX.  All symbols and sizes from cmr, cmmi. cmsy,
     cmex and rsfs should be available, but they're not all shown.
     Mathbb symbols are also available but not 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 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</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 and cmr 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}" alt="" border=0 align=middle> </p>


<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GPL
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h2> <a name="gpl"> (Ic) GPL License &nbsp; </a> </h2>

<font color="black">
<b>&quot</b><i>My grandfather once told me there are two kinds of people:<br>
&nbsp &nbsp Those who do the work and those who take the credit.<br>
&nbsp &nbsp He told me to try to be in the first group; there was much
less competition.</i><b>&quot</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
     <a href="http://lcweb.loc.gov/copyright/circs/circ1.html"
     target="_top">Copyright Basics</a> from The Library of Congress, 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&nbsp;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. </p>



<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SECTION II.  BUILDING MIMETEX
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h1> <a name="build"> (II) Building mimeTeX &nbsp; </a> </h1>

<!-- <center> -->
    <table border="0" cellpadding="0" cellspacing="0">
      <tr><td><center><hr size="2">Very quickly &nbsp; --- &nbsp; download
        <!-- jfa <a href="http://www.forkosh.com/mimetex.zip"> -->
        <a href="ftp://ftp.tex.ac.uk/tex-archive/support/mimetex/mimetex.zip">
        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>
        &nbsp; &nbsp; &nbsp; Now <b>mv</b> mimetex.cgi to your <b>cgi-bin/</b>
        directory, and you're all done. &nbsp; &nbsp; &nbsp; <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 execute under all
    environments without any change whatsoever. Build instructions below
    are for Unix.  Modify them as necessary for your particular situation
    (note the -DWINDOWS switch if applicable). </p>

<p> A summary of the steps needed to build mimeTeX is </p>
  <ul>
   <li> Download and unzip 
        <!-- jfa <a href="http://www.forkosh.com/mimetex.zip"> -->
        <a href="ftp://ftp.tex.ac.uk/tex-archive/support/mimetex/mimetex.zip">
        mimetex.zip</a> in any convenient working directory. </li>
   <li> To compile an executable that emits anti-aliased gif images
        (which is how the page you're viewing is displayed)<br>
        &nbsp; <b>cc -DAA mimetex.c gifsave.c -lm -o mimetex.cgi</b> </li>
   <li> or, to emit gif images without anti-aliasing<br>
        &nbsp; <b>cc -DGIF mimetex.c gifsave.c -lm -o mimetex.cgi</b> </li>
   <li> Alternatively, to compile an executable that emits mime xbitmaps<br>
        &nbsp; <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>&nbsp;.  For example, <br>
             &nbsp; &nbsp; &nbsp; &nbsp; <b>cc -DAA -DWINDOWS
             mimetex.c gifsave.c -lm -o mimetex.cgi</b> <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". </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)&nbsp;mimetex.c) </li> -->
        </ul> </li>
  </ul>
<p> And a summary of the steps needed to install mimeTeX is </p>
  <ul>
   <li> Just &nbsp; mv mimetex.cgi &nbsp; to your server's <b>cgi-bin/</b>
        directory, set permissions as necessary, and you're all done. </li>
   <li> Now, to quickly test your mimetex.cgi, try typing a url into
        your browser's locator window something like &nbsp;
        <b>http://www.<i>yourdomain</i>.com/cgi-bin/mimetex.cgi?x^2+y^2</b>
        &nbsp; which should display &nbsp;
        <img src="../cgi-bin/mimetex.cgi?x^2+y^2" alt="" border=0
        align=middle> &nbsp; in the upper-left corner of your window. </li>
   <li> After the preceding test succeeds, you can optionally
        &quot;regression&nbsp;test&quot; all mimeTeX features as follows:<ul>
        <li> mv mimetex.html (this file) to your server's <b>htdocs/</b>
        directory </li>
        <li> If the relative path from htdocs to cgi-bin isn't
        <b>../cgi-bin</b> then edit mimetex.html and change the
        few dozen occurrences as necessary (globally changing
        <b>../cgi-bin/mimetex.cgi</b> should work). </li>
        <li> Now visit your page &nbsp;
        <b>http://www.<i>yourdomain</i>.com/mimetex.html</b> </li>
        <li> Once 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>
  </ul>
  <p> Any problems with the above?
  Read the more detailed instructions below. </p>


<h2> <a name="download"> (IIa) Download &nbsp; </a> </h2>

 <p> Download
     <!-- jfa <a href="http://www.forkosh.com/mimetex.zip"> -->
     <a href="ftp://ftp.tex.ac.uk/tex-archive/support/mimetex/mimetex.zip">
     mimetex.zip</a> and unzip it in any convenient working directory.
     Your working directory should now contain </p> <center>
       <table cellpadding=0 cellspacing=0>
         <tr><td width=100>README</td> <td>mimeTeX release notes</td></tr>
         <tr><td>LICENSE</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">
                                     http://shh.thathost.com</a></td></tr>
         <tr><td>mimetex.html</td> <td>this file, mimeTeX tutorial and
                                     user's manual</td></tr>
       </table></center>
 <p> 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&nbsp;-a option, i.e.,  unzip&nbsp;-a&nbsp;mimetex.zip </p>


<h2> <a name="compile"> (IIb) Compile &nbsp; </a> </h2>

 <p> To compile a mimeTeX executable that emits anti-aliased gif images
     (which is recommended for most uses) issue the command </p>
     <center><b>cc -DAA mimetex.c gifsave.c -lm -o mimetex.cgi</b>
     </center>

 <p> Or, for an executable that emits gif images without anti-aliasing,
     issue the command </p>
     <center><b>cc -DGIF mimetex.c gifsave.c -lm -o mimetex.cgi</b>
     </center>

 <p> Alternatively, to compile a mimeTeX executable that emits
     mime xbitmaps, just issue the command </p>
     <center><b>cc -DXBITMAP mimetex.c -lm -o mimetex.cgi</b>
     </center>

 <p> Compile Notes: </p> <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>&nbsp;.  For example, <br>
             &nbsp; &nbsp; &nbsp; &nbsp; <b>cc -DAA -DWINDOWS
             mimetex.c gifsave.c -lm -o mimetex.cgi</b> <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>
          &nbsp; &nbsp; 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 &lt;lf&gt;, and automatically preceding it with
          a spurious hex 0D &nbsp; &lt;cr&gt; byte.  The -DWINDOWS switch
          compiles in a non-portable, Windows-specific _setmode()
          call that sets stdout to binary mode. </li>
     </ul>

 <p> Several other optional compile-line <a href="#options">options</a>
     available for mimetex.c are discussed below. </p>

 <p> 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 </p>
     <center><b>cc gfuntype.c mimetex.c -lm -o gfuntype</b></center>

 <p> That's all there is to building mimeTeX.  You can now test your
     mimetex.cgi executable from the Unix command line by typing, e.g.,
     <b>./mimetex.cgi&nbsp;"x^2+y^2"</b> 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 the two ascii rasters then your
    binary's good, so mv it to your server's <b>cgi-bin/</b> directory and
    set permissions as necessary. </p>

<h2> <a name="install"> (IIc) Install &nbsp; </a> </h2>

 <p> Once mimetex.cgi is working, mv it to your server's <b>cgi-bin/</b>
     directory (wherever cgi programs are expected), and chmod/chown it
     if necessary.  Then mv mimetex.html to your server's <b>htdocs/</b>
     directory.  Now point your browser to www.yourdomain.com/mimetex.html ,
     and you should see a page identical to this one. </p>

 <p> Note: the two directories are typically of the form
     somewhere/www/cgi-bin/ and somewhere/www/htdocs/ ,  so I set up
     mimtex.html to get 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 mimetex.html .
     Sometimes a suitable symlink works; if not, you'll have to edit.
     Globally changing <b>../cgi-bin/mimetex.cgi</b> often works. </p>

 <p> Either way, once mimetex.html displays properly, you can assume
     everything is working, and can begin authoring html documents using
     mimetex.cgi to render your own math. </p>


<h2> <a name="options"> (IId) Additional Compile-Line Options &nbsp; </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>
           &nbsp; &nbsp; &nbsp; Anti-aliasing can't be applied to mime
           xbitmaps, so don't specify -DAA if you also specify -DXBITMAP. <br>
           &nbsp; &nbsp; &nbsp; And mimeTeX's anti-aliasing only works
           well on white (or light gray) backgrounds.  Your html file
           probably contains a &lt;body&gt; tag of the form
           &lt;body&nbsp;bgcolor="#ffffff"&nbsp;text="#000000"&gt;
           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&3&1\\3&\,32\,&3\\1&3&1\end{pmatrix}"
           alt="" border=0 align=middle> to neighboring pixels. The defaults
           weights are CENTERWT=32, ADJACENTWT=3 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{&nbsp;}</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 the LaTeX expression. <br>
           &nbsp; &nbsp; &nbsp; 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>---------------------------------------------------------------------
2004-08-07:09:00:53am            f8ccc8dd93c8eeb1d9c40b353ef781e0.gif
\LARGE x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
---------------------------------------------------------------------</pre></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\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="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>-DNEWCOMMANDS=<i>newcommands.h</i></b> </dt>
       <dd> LaTeX-like <b>\newcommand</b>'s are available in mimeTeX,
           via the following facility to help you define your
           own "new&nbsp;commands" during compilation.  Edit a file named
           newcommands.h (or any filename you specify with the
           <b>-DNEWCOMMANDS</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 &nbsp;
<b>{&nbsp;"\\<i>command</i>",&nbsp;NULL,&nbsp;"{<i>replacement</i>}"&nbsp;},</b>
           &nbsp; &nbsp; Don't forget a comma at the end of every line,
           and write a double&nbsp;backslash&nbsp;<b>\\</b>
           between quotes&nbsp;<b>"...\\..."</b> wherever you actually
           want a single&nbsp;backslash&nbsp;<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>{&nbsp;}</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>{&nbsp;}</b>'s would defeat the purpose).
           <br> &nbsp; &nbsp; 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
           &nbsp; <b>2</b> &nbsp; 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>{&nbsp;}</b>'s as usual.  Otherwise,
           any subsequent characters signal that the first argument
           is optional, enclosed in <b>[&nbsp;]</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 &nbsp;
           <b>n</b> &nbsp; as shown.  In this case that's just a single
           character, but you can write any length default you like.
           <br> &nbsp; &nbsp; 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>-DNORMALSIZE=<i>n</i></b> </dt>
       <dd> MimeTeX currently has six font sizes numbered 0-5,
           and always starts out in NORMALSIZE, whose default value is 2.
           Specify -DNORMALSIZE=3 on the compile line if you prefer
           mimeTeX to start in default size 3, etc. </dd>
      <dt> <b>-DPATHPREFIX=\"<i>path/</i>\"</b> </dt>
       <dd> The <a href="#input">\input{&nbsp;}</a> and
           <a href="#counter">\counter{&nbsp;}</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>-DREFERER=\"<i>domain</i>\"  or <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>
           &nbsp; &nbsp; &nbsp; If REFERER is defined, mimeTeX
           performs a case-insensitive test of the environment variable
           HTTP_REFERER to verify that it contains the authorized 'domain'
           as a substring. <br>
           &nbsp; &nbsp; &nbsp; If given several 'domain's (second form)
           then HTTP_REFERER must contain either 'domain1' or
           'domain2', or etc, as a (case-insensitive) substring. <br>
           &nbsp; &nbsp; &nbsp; If HTTP_REFERER doesn't contain a substring
           matching any of these domain(s), then mimeTeX emits an error
           message image instead of the requested image.  You can manually
           modify invalid_referer_msg, defined in function main(),
           to personalize the error message for your own site. <br>
           &nbsp; &nbsp; &nbsp; Finally, if HTTP_REFERER is not found as
           an environment variable, then mimeTeX correctly generates the
           requested image instead of generating an error. </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>-DSQUASHMARGIN=<i>n</i> or <br>
          -DNOSQUASH</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="nosquash1" onclick="eqntext('nosquash1')"
           src="../cgi-bin/mimetex.cgi?\displaystyle
           \nosquash\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="nosquash2" onclick="eqntext('nosquash2')"
           src="../cgi-bin/mimetex.cgi?\displaystyle
           \squash\frac12\int_{a+b+c}^{d+e+f}{g(x)}dx"
           alt="" border=0 align=middle></a> instead.
           Compile with <b>-DNOSQUASH</b> if you prefer the typical TeX
           behavior as mimeTeX's default.  Or, to adjust the minimum
           number of pixels between squashed symbols (default is 3),
           compile with <b>-DSQUASHMARGIN=<i>n</i></b>.
           See <a href="#squash">Squash</a> for further discussion. </dd>
      <dt> <b>-DWARNINGS=<i>n</i>  or <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 black background instead. </dd>
     </dl>


<h2> <a name="cmdline"> (IIe) Command Line Features &nbsp; </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. </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
               [ -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   Like -d but writes the actual gif (or xbitmap) directly
          to export_file, e.g.,
               ./mimetex  -e expression.gif  "x^2+y^2"
          also creates 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   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.

     -m   0-99, controls verbosity 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.

     -s   0-5, font size.  As usual, the 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 3,
          overriding -s.  Default font size is 2.
     </pre>



<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SECTION III.  SYNTAX REFERENCE
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h1> <a name="reference"> (III) Syntax Reference &nbsp; </a> </h1>

<p> Since mimeTeX's syntax is as TeX-like as possible, we'll mostly discuss
    the occasional exceptions (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 relevant. </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{&nbsp;}, Math Spaces and Whitespace
&nbsp; </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{&nbsp;}</a> </li>
       <li> <a href="#mathspace">\hfill{&nbsp;}</a> </li>
       <li> <a href="#raiserotate">\raisebox{&nbsp;}{&nbsp;}</a> </li>
       <li> <a href="#circleline">\line(&nbsp;,&nbsp;)</a> and
            <a href="#circleline">\circle(&nbsp;,&nbsp;)</a> </li>
       <li> <a href="#arrows">\longrightarrow[&nbsp;]</a> </li>
     </ul> <p class="continue">
     (the \long<i>xxx</i>arrow [&nbsp;]-arguments are optional mimeTeX
     extensions to LaTeX) &nbsp; 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{&nbsp;}</b> command lets you specify
     the number of pixels per "length&nbsp;unit", e.g.,
     <b>\unitlength{10}&nbsp;\hspace{2.5}</b> renders a 25-pixel space.
     Both <b>\unitlength{&nbsp;}</b> and <b>\hspace{&nbsp;}</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>{&nbsp;}</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}&nbsp;{\unitlength{2.5}B\hspace{10}C}&nbsp;\hspace{10}D</b>
   &nbsp; produces &nbsp;
   <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>&nbsp;and&nbsp;<b>B</b>, then
     25&nbsp;pixels between <b>B</b>&nbsp;and&nbsp;<b>C</b>, and finally
     another 10&nbsp;pixels between <b>C</b>&nbsp;and&nbsp;<b>D</b>. </p>

<h3> <a name="mathspace">Math Spaces<font size=5>...</font></a> </h3>

 <p> Except inside <a href="#textboxes">text&nbsp;boxes</a>,
     unescaped blanks, tildes (a&nbsp;<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>\,&nbsp;\:&nbsp;\;</b> as well as
     <b>\/</b> and <b>\quad</b> and <b>\qquad</b>&nbsp;.  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.  There are no negative spaces. </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?1$\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{&nbsp;}</b> appears
     within a <b>{&nbsp;}</b>-enclosed subexpression, then it applies
     only to that subexpression.  For example, </p> <center>
        <b>{abc \hfill{50} def} \hfill{100} ghi</b>
        &nbsp; &nbsp; produces &nbsp; &nbsp;
        <a href="#preview"><img id="mathspace1" onclick="eqntext('mathspace1')"
        src="../cgi-bin/mimetex.cgi?3${abc\hfill{50}def}\hfill{100}ghi"
        alt="" border=0 align=middle></a> </center> <p class="continue">
     The first/inner <b>\hfill{50}</b> inserts exactly enough whitespace so
     that subexpression "<b><i>abc&nbsp;&nbsp;def</i></b>" spans 50 pixels.
     Then the second/outer <b>\hfill{100}</b> inserts exactly  enough
     whitespace so that the entire expression spans 100 pixels.
     Without explicit <b>{&nbsp;}</b>-nesting, mimeTeX evaluates expressions
     left-to-right (sinistrally), e.g., <b>...\hfill{100}...\hfill{50}...</b>
     is exactly equivalent to <b>...\hfill{100}{...\hfill{50}...}</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>&nbsp;.
     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&nbsp;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>
        &nbsp; &nbsp; to produce &nbsp; &nbsp;
        <a href="#preview"><img id="mathspace2" onclick="eqntext('mathspace2')"
        src="../cgi-bin/mimetex.cgi?3$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>
        &nbsp; &nbsp; produces &nbsp; &nbsp;
        <a href="#preview"><img id="mathspace3" onclick="eqntext('mathspace3')"
        src="../cgi-bin/mimetex.cgi?3$y=\{a+b+c+d\\\hspace{50}+e+f+g+h\}"
        alt="" border=0 align=middle></a> <br>
	whereas you probably wanted &nbsp; &nbsp; &nbsp; &nbsp;
        <a href="#preview"><img id="mathspace4" onclick="eqntext('mathspace4')"
        src="../cgi-bin/mimetex.cgi?3$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&nbsp;\\&nbsp;\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&nbsp;<b>~</b>) wherever blanks are required or desired,
     e.g., <b>\alpha~w</b> instead of <b>\alpha&nbsp;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>&lt;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&gt; </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&nbsp;followed</i> by two <b>%</b>'s
     rather than LaTeX's usual one.  The above example could be written </p>
<pre>&lt;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&gt; </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&nbsp;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&nbsp;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 &nbsp; </a></h2>

<h3> <a name="characters">Character Sets<font size=5>...</font></a> </h3>

 <p> 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 <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(&nbsp;)</b>
     in <b>mimetex.c</b> &nbsp; &nbsp; Generally speaking, I've tried
     to encode the cmmi10, cmsy10, cmr10, cmex10, rsfs10 and bbold10
     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>\mathscr{A}</b> for the rsfs10 fonts, and write <b>\mathbb{R}</b>
     for bbold10. </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> 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 <a href="#fonts">Appendix&nbsp;IVa</a> below provides
     additional information. </p>

 <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(&nbsp;)</b> also recognizes various html special
     characters like <b>&amp;lt;</b>, <b>&amp;gt;</b>, <b>&amp;nbsp;</b>,
     <b>&amp;quot;</b>, <b>&amp;amp;</b>, etc.  Some web tools apparently
     translate characters like, e.g., <b>&gt;</b> to <b>&amp;gt;</b>,
     even inside quoted query_string's, so mimeTeX's preprocessor
     translates them back to LaTeX symbols for you. </p>

<h3> <a name="sizes">Font Sizes<font size=5>...</font></a> </h3>

 <p> MimeTeX currently has six font sizes, numbered 0-5, with default 2.
     This font size numbering corresponds to the usual LaTeX declarations
     &nbsp; <b>\tiny</b>, &nbsp; <b>\small</b>, &nbsp; <b>\normalsize</b>
     (default), &nbsp; <b>\large</b>, &nbsp; <b>\Large</b> and <b>\LARGE</b>.
     These declarations 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>{&nbsp;}</b>-subexpression remains
     in effect only within that subexpression. </p>

 <p> In mimeTeX you may also write <b>\fontsize{0}...\fontsize{5}</b> or
     the shorter <b>\fs{0},...,\fs{5}</b> for <b>\tiny,...,\LARGE</b>.
     And since these arguments are all single digits, the even shorter
     form <b>\fs0,...,\fs5</b> works equally well.  For example, </p>
     <center> <table cellpadding=0>
      <tr align=center>
        <td> &lt;img src="../cgi-bin/mimetex.cgi?<b></b>f(x)=x^2"&gt; </td>
        <td> produces </td>
        <td> <a href="#preview"><img id="sizes1" onclick="eqntext('sizes1')"
             src="../cgi-bin/mimetex.cgi?f(x)=x^2"
             alt="" border=0 align=middle></a> </td>
      </tr>
      <tr align=center>
        <td> &lt;img src="../cgi-bin/mimetex.cgi?<b>\large</b> f(x)=x^2"&gt; </td>
        <td> &nbsp; </td>
        <td> <a href="#preview"><img id="sizes2" onclick="eqntext('sizes2')"
             src="../cgi-bin/mimetex.cgi?\large f(x)=x^2"
             alt="" border=0 align=middle></a> </td>
      </tr>
      <tr align=center>
        <td> &lt;img src="../cgi-bin/mimetex.cgi?<b>\fs4</b>f(x)=x^2"&gt; </td>
        <td> &nbsp; </td>
        <td> <a href="#preview"><img id="sizes3" onclick="eqntext('sizes3')"
             src="../cgi-bin/mimetex.cgi?\fs4f(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 &nbsp; <b>2</b>
     (default \normalsize), &nbsp; <b>3</b> (\large or \fs3), and
     &nbsp; <b>4</b> (\fs4 or \Large). </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> &nbsp; produces &nbsp;
        <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&nbsp;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> &nbsp; which now produces
        &nbsp; <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&nbsp;0 (\tiny). </p>

 <p> Preceding an <b>\fs{&nbsp;}</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> &nbsp; produces &nbsp;
        <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&nbsp;1. </p>

<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&nbsp;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> &nbsp; produces &nbsp;
        <a href="#preview"><img id="modes1a" onclick="eqntext('modes1a')"
        src="../cgi-bin/mimetex.cgi?\Bigsum_{i=1}^ni=\frac{n(n+1)}2"
        alt="" border=0 align=middle></a>, <br> -->
        <b>\sum_{i=1}^ni=\frac{n(n+1)}2</b>
        &nbsp; &nbsp; produces &nbsp; &nbsp;
        <a href="#preview"><img id="modes2a" onclick="eqntext('modes2a')"
        src="../cgi-bin/mimetex.cgi?\sum_{i=1}^ni=\frac{n(n+1)}2"
        alt="" border=0 align=middle></a>, &nbsp; whereas <br>
        <b>\displaystyle \sum_{i=1}^ni=\frac{n(n+1)}2</b> &nbsp;produces&nbsp;
        <a href="#preview"><img id="modes1b" onclick="eqntext('modes1b')"
        src="../cgi-bin/mimetex.cgi?\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> &nbsp; produces &nbsp;
        <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>, &nbsp; whereas <br>
        <b>\textstyle \large \sum_{i=1}^ni=\frac{n(n+1)}2</b>
        &nbsp; &nbsp; produces &nbsp; &nbsp;
        <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>.
        <!-- &nbsp; 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>
        &nbsp; produces &nbsp;
        <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>\sum\limits_{i=1}^ni=\frac{n(n+1)}2</b> &nbsp; produces &nbsp;
        <a href="#preview"><img id="modes4" onclick="eqntext('modes4')"
        src="../cgi-bin/mimetex.cgi?\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> &nbsp; produces &nbsp;
        <a href="#preview"><img id="modes5" onclick="eqntext('modes5')"
        src="../cgi-bin/mimetex.cgi?3$A^i_j"
        alt="" border=0 align=middle></a> &nbsp; &nbsp; as usual, whereas <br>
        <b>A\limits^i_j</b> &nbsp; produces &nbsp;
        <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> &nbsp; instead. </center>
     <p class="continue">Likewise, for subexpressions, </p> <center>
        <b>\widehat{xyz}\limits^a</b> &nbsp; produces &nbsp;
        <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> &nbsp; produces &nbsp;
        <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>{&nbsp;}</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>
        &nbsp; produces &nbsp;
        <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&nbsp;at&nbsp;all}</b>
     or the equivalent LaTeX-2.09-like command
     <b>{\rm&nbsp;anything&nbsp;at&nbsp;all}</b>, both of which render
     <b>anything&nbsp;at&nbsp;all</b> in roman (font family cmr10).
     <b>\mbox{&nbsp;}</b> and several similar LaTeX commands are
     recognized by mimeTeX as synonyms for <b>\text{&nbsp;}</b>.
     For italic, write <b>\textit{anything&nbsp;at&nbsp;all}</b> or
     <b>{\it&nbsp;anything&nbsp;at&nbsp;all}</b>, both of which render
     <b>anything&nbsp;at&nbsp;all</b> in italic (font family cmmi10).
     All four forms respect spaces between words, except that the
     first/required  space after <b>{\rm&nbsp;etc}</b> and
     <b>{\it&nbsp;etc}</b> is still ignored.  For example, </p> <center>
        <b>anything&nbsp;at&nbsp;all</b> &nbsp; just produces &nbsp;
        <a href="#preview"><img id="textboxes1" onclick="eqntext('textboxes1')"
        src="../cgi-bin/mimetex.cgi?anything at all"
        alt="" border=0 align=middle></a> &nbsp; &nbsp; whereas <br> <br>
        <b>\text{anything&nbsp;at&nbsp;all}</b> &nbsp; produces &nbsp;
        <a href="#preview"><img id="textboxes2" onclick="eqntext('textboxes2')"
        src="../cgi-bin/mimetex.cgi?\text{anything at all}"
        alt="" border=0 align=middle></a> &nbsp; &nbsp; and <br> <br>
        <b>\textit{anything&nbsp;at&nbsp;all}</b> &nbsp; produces &nbsp;
        <a href="#preview"><img id="textboxes3" onclick="eqntext('textboxes3')"
        src="../cgi-bin/mimetex.cgi?\textit{anything at all}" alt=""
        border=0 align=middle></a> &nbsp; &nbsp; instead. </center>


<h2> <a name="delimiters"> (IIIc) Delimiters &nbsp; </a> </h2>

<h3> <a name="parens">Parentheses and Braces
(delimiters)<font size=5>...</font></a> </h3>

 <p> LaTeX's <b>\left(</b> and <b>\right)</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>\&lt;...\&gt;</b>&nbsp;. </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> The complete list of automatically sized delimiters
     available in mimeTeX is </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>or mimeTeX <br> abbreviation</b> </td>
           <td> <b>example...</b> </td>
           <td> <b>...renders</b> </td>
        </tr>
        <tr align=center>
           <td> \left(&nbsp;...&nbsp;\right) </td>
           <td> \(&nbsp;...&nbsp;\) </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[&nbsp;...&nbsp;\right] </td>
           <td> \[&nbsp;...&nbsp;\] </td>
           <td> \left[ 1+\frac xn \right]^n </td>
           <td> <a href="#preview"><img id="parens2" onclick="eqntext('parens2')"
                 src="../cgi-bin/mimetex.cgi?\Large\left[1+\frac xn\right]^n"
                 alt="" border=0 align=middle></a> </td>
        </tr>
        <tr align=center>
           <td> \left\{&nbsp;...&nbsp;\right\} </td>
           <td> \{&nbsp;...&nbsp;\} </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 &nbsp; ...<br>
                &nbsp; &nbsp; &nbsp; &nbsp; ... &nbsp;\right\rangle </td>
           <td> \<&nbsp;...&nbsp;\> </td>
           <td> \left\langle \varphi |\hat H|<br>
                &nbsp; &nbsp; &nbsp; &nbsp; \phi \right\rangle </td>
           <td> <a href="#preview"><img id="parens4" onclick="eqntext('parens4')"
                 src="../cgi-bin/mimetex.cgi?
                 \Large\left\langle\varphi|\hat H|\phi\right\rangle"
                 alt="" border=0 align=middle></a> </td>
        </tr>
        <tr align=center>
           <td> \left|&nbsp;...&nbsp;\right| </td>
           <td> \|&nbsp;...&nbsp;\| </td>
           <td> \det \left| \begin{array}{cc} 1&2\\<br>
                &nbsp; &nbsp; &nbsp; &nbsp; 3&4 \end{array} \right|</td>
           <td> <a href="#preview"><img id="parens5" onclick="eqntext('parens5')"
                 src="../cgi-bin/mimetex.cgi?
                 \large\det\left|\begin{array}{cc}1&2\\3&4\end{array}\right|"
                 alt="" border=0 align=middle></a> </td>
        </tr>
        <tr align=center>
           <td> \left\|&nbsp;...&nbsp;\right\| </td>
           <td> \=&nbsp;...&nbsp;\= </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\{&nbsp;...&nbsp;\right<b>.</b> </td>
           <td> \{&nbsp;...&nbsp;\<b>.</b> </td>
           <td> y=\left\{ \text{this\atop that} \right<b>.</b> </td>
           <td> <a href="#preview"><img id="parens7" onclick="eqntext('parens7')"
                 src="../cgi-bin/mimetex.cgi?
                 \large y=\left\{\text{this\atop that}\right."
                 alt="" border=0 align=middle></a> </td>
        </tr>
        <tr align=center>
           <td> \left<b>.</b>&nbsp;...&nbsp;\right\} </td>
           <td> \<b>.</b>&nbsp;...&nbsp;\} </td>
           <td> \left<b>.</b> \text{this\atop that} \right\}=y </td>
           <td> <a href="#preview"><img id="parens8" onclick="eqntext('parens8')"
                 src="../cgi-bin/mimetex.cgi?
                 \large\left.\text{this\atop that}\right\}=y"
                 alt="" border=0 align=middle></a> </td>
        </tr>
       </table> </center>
 <p> <b><u>Notes...&nbsp;</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&nbsp;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 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, &nbsp;
            <b>(,&nbsp;[,&nbsp;&lt;,&nbsp;{,</b> etc, must always be "left"
            in mimeTeX, and &nbsp; <b>),&nbsp;],&nbsp;&gt;,&nbsp;},</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>
            &nbsp;&nbsp; The same <b>\.</b> also serves as an abbreviation
            for <b>\left.</b> &nbsp;&nbsp; MimeTeX correctly interprets your
            intention if you correctly  balance delimiters.  For example,
            either <b>y=\left\{{this\atop&nbsp;that}\right.</b> or
            <b>y=\{{this\atop&nbsp;that}\.</b> renders the usual useful
            construction
            <a href="#preview"><img id="parens10" onclick="eqntext('parens10')"
            src="../cgi-bin/mimetex.cgi?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>).
            &nbsp;&nbsp; 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>&nbsp;, which automatically
     sizes the <b>\left\int</b> to accommodate everything between it
     and its matching <b>\right<b>.</b></b> &nbsp; delimiter.
     The <b>\right</b> delimiter needn't necessarily be
     the <b>\right<b>.</b></b> &nbsp; illustrated, e.g.,
     <b>\left\int_a^b&nbsp;x^2dx&nbsp;=\frac{x^3}3\right|\nolimits_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|\nolimits_a^b" border=0 alt=""
     align=middle></a>.  Except for Opening (TeX class 4) and
     Closing (class 5) delimiter characters like <b>(&nbsp;)</b> and
     <b>[&nbsp;]</b> and <b>\{&nbsp;\}</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 any symbol that works with <b>\left</b> will also work
     with <b>\right</b>&nbsp;.  But mimeTeX abbreviations like &nbsp;
     <b>\(...\)</b> &nbsp; for &nbsp; <b>\left(...\right)</b> &nbsp;
     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>(&nbsp;)</b>'s and <b>[&nbsp;]</b>'s and <b>|&nbsp;|</b>'s
     and <b>&lt;&nbsp;&gt;</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>[&nbsp;]</b>'s and
     <b>&lt;&nbsp;&gt;</b>'s and <b>{&nbsp;}</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&nbsp;and&nbsp;rotate, Compose, Abbreviations, etc. &nbsp; </a> </h2>

<h3> Accents<font size=5>...</font> </h3>
  
 <p class="continue"> 
     <b>\vec{&nbsp;} \hat{&nbsp;} \bar{&nbsp;} \tilde{&nbsp;} \dot{&nbsp;}</b>
     and <b>\ddot{&nbsp;}</b> are the only accents currently supported,
     and they're all "wide".  You can write <b>\widehat{&nbsp;}</b> if you
     like, but there's absolutely no difference either way.
     <b>\bar{&nbsp;}</b> and <b>\overline{&nbsp;}</b> are identical. <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> &nbsp; produces &nbsp;
        <a href="#preview"><img id="functions1" onclick="eqntext('functions1')"
        src="../cgi-bin/mimetex.cgi?3$\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?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> &nbsp; produces &nbsp;
        <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> &nbsp; produces &nbsp;
        <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&nbsp;11</a> above, e.g., </p> <center>
        <b>u\longrightarrow[50]_\beta v</b> &nbsp; produces &nbsp;
        <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> &nbsp; produces &nbsp;
        <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> &nbsp; produces &nbsp; &nbsp; &nbsp;
        <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&nbsp;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{&nbsp;}{&nbsp;} and
\rotatebox{&nbsp;}{&nbsp;}<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>
     commands help you fine-tune and manipulate mimeTeX renderings.
     The <b><i>height</i></b> argument is number of pixels, scaled by
     <a href="#unitlength">\unitlength</a>, and can be positive
     or negative.  The <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.  Finally, the <b><i>expression</i></b> can be any
     valid LaTeX/mimeTeX expression.  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> &nbsp; produces &nbsp;
        <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>

<h3> <a name="compose">\compose{&nbsp;}{&nbsp;}<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.
     Optionally, the overlay 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{\LARGE O}{\normalsize c}</b> &nbsp; produces &nbsp;
        <a href="#preview"><img id="compose1" onclick="eqntext('compose1')"
        src="../cgi-bin/mimetex.cgi?\compose{\LARGE O}{\normalsize c}"
        alt="" border=0 align=middle></a> </center>

 <p> Separately or in some judicious combination, <b>\compose</b> and
     <b>\raisebox</b> and <b>\rotatebox</b> should 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 <b>-DNEWCOMMANDS</b> compile-time
     <a href="#options">option</a> discussed above. </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>&gt;&gt;</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>&nbsp;.
     These symbols and commands cannot be abbreviated.  The special
     html characters like <b>&amp;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&nbsp;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> &nbsp; produces &nbsp;
      <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="squash">&quot;Squash&quot;<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 &nbsp;
     <a href="#preview"><img id="squash1" onclick="eqntext('squash1')"
     src="../cgi-bin/mimetex.cgi?\displaystyle
     \nosquash\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 &nbsp;
     <a href="#preview"><img id="squash2" onclick="eqntext('squash2')"
     src="../cgi-bin/mimetex.cgi?\displaystyle
     \squash\frac12\int_{a+b+c}^{d+e+f}{g(x)}dx"
     alt="" border=0 align=middle></a> &nbsp; instead. </p>

 <p> Precede any expression with the mimeTeX directive <b>\nosquash</b>
     to render it without "squashing".  Or compile mimetex.c with the
     <b>-DNOSQUASH</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>\squash</b> to render it "squashed".
     And note that explicit space like <b>\hspace{10}</b>
     or <b>\;</b>&nbsp;, etc, is never squashed. </p>

 <p> The scope of <b>\squash</b> and <b>\nosquash</b> is the
     <b>{&nbsp;}</b>-enclosed subexpression in which the directive occurs.
     For example, if you want the <b><i>g(x)</i></b>&nbsp;part of the
     preceding example squashed, but not the <b>1/2</b>&nbsp;part,
     then the expression
     <b>\nosquash\frac12{\squash\int_{a+b+c}^{d+e+f}g(x)dx}</b>
     renders as &nbsp;
     <a href="#preview"><img id="squash3" onclick="eqntext('squash3')"
     src="../cgi-bin/mimetex.cgi?\displaystyle
     \nosquash\frac12{\squash\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 squashed.
     So <b>{\frac12\;\;}\int_{a+b+c}^{d+e+f}g(x)dx</b> renders as &nbsp;
     <a href="#preview"><img id="squash4" onclick="eqntext('squash4')"
     src="../cgi-bin/mimetex.cgi?\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>\squash</b> is shorthand
     for the default <b>\squashmargin{+3}</b> (and <b>\nosquash</b> is
     shorthand for <b>\squashmargin{0}</b>).  <b>\squashmargin</b>'s value
     is the minimum number of pixels between squashed symbols.  The leading
     <b>+</b> is optional.  If present, the font size (\tiny=0,...,\LARGE=5)
     is added to the specified minimum.  Compile mimetex.c with the
     <b>-DSQUASHMARGIN=<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-squashed <b>\squashmargin{1}</b> &nbsp;
     <a href="#preview"><img id="squash5" onclick="eqntext('squash5')"
     src="../cgi-bin/mimetex.cgi?\displaystyle
     \squashmargin1\frac12\int_{a+b+c}^{d+e+f}{g(x)}dx"
     alt="" border=0 align=middle></a> &nbsp; instead. </p>

 <p> Squashing is in "alpha testing" and some expressions still don't look
     quite right when squashed, e.g., <b>1^2,2^2,3^2,\ldots</b> renders as
     <a href="#preview"><img id="squash6" onclick="eqntext('squash6')"
     src="../cgi-bin/mimetex.cgi?\Large1^2,2^2,3^2,\ldots"
     alt="" border=0 align=middle></a>.  Just compile with <b>-DNOSQUASH</b>
     if you come across numerous annoying situations. </p>

<h3> <a name="not">\not and \Not and \sout<font size=5>...</font></a> </h3>

 <p> The usual LaTeX &nbsp; <b>\not</b> &nbsp; "slashes" the single symbol
     following it, e.g., &nbsp; <b>i\not\partial\equiv&nbsp;i\not\nabla</b>
     &nbsp; produces <a href="#preview">
     <img id="not1" onclick="eqntext('not1')"
     src="../cgi-bin/mimetex.cgi?i\not\partial\equiv i\not\nabla"
     alt="" border=0 align=middle></a>. </p>

 <p> For arbitrary expressions, mimeTeX provides &nbsp; <b>\Not</b> &nbsp;
     which draws a line from the upper-right to lower-left corner of its
     argument, e.g., &nbsp; <b>a\Not{x^2}=bx^{\not3}</b> &nbsp; produces
     &nbsp; <a href="#preview"><img id="not2" onclick="eqntext('not2')"
     src="../cgi-bin/mimetex.cgi?\large a\Not{x^2}=bx^{\not3}"
     alt="" border=0 align=bottom></a>. </p>

 <p> Finally, similar to the <b>ulem.sty</b> package, &nbsp; <b>\sout</b>
     &nbsp; draws a horizontal strikeout line through its argument,
     e.g., &nbsp; <b>\sout{abcdefg}</b> &nbsp; produces <a href="#preview">
     <img id="not3" onclick="eqntext('not3')"
     src="../cgi-bin/mimetex.cgi?\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., &nbsp;
     <b>\sout[+2]{abcdefg}</b> produces <a href="#preview">
     <img id="not4" onclick="eqntext('not4')"
     src="../cgi-bin/mimetex.cgi?\sout[+2]{abcdefg}"
     alt="" border=0 align=middle></a> &nbsp; and &nbsp;
     <b>\sout[-2]{abcdefg}</b> produces
     <a href="#preview"><img id="not5" onclick="eqntext('not5')"
     src="../cgi-bin/mimetex.cgi?\sout[-2]{abcdefg}"
     alt="" border=0 align=middle></a>. </p>


<h2> <a name="array"> (IIIe) \begin{array}{lcr}...\end{array} Environment
&nbsp; </a> </h2>

 <p> Rendering vectors and matrices, aligning equations, etc, is all done
     using the customary LaTeX environment &nbsp;
     <b>\begin{array}{lcr}&nbsp;a&b&c\\d&e&f\\etc&nbsp;\end{array}</b>
     &nbsp; 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{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{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 &nbsp;
     <b>\array{lcr$a&b&c\\d&e&f\\etc}</b> &nbsp;
     which has exactly the same effect as &nbsp;
     <b>\begin{array}{lcr}&nbsp;a&b&c\\d&e&f\\etc&nbsp;\end{array}</b>.
     And the <b>lcr$</b> "preamble" in <b>\array{lcr$etc}</b> is optional.
     In that case, &nbsp; <b>\array{a&b&c\\d&e&f\\etc}</b> &nbsp;
     has exactly the same effect as &nbsp;
     <b>\begin{matrix}&nbsp;a&b&c\\d&e&f\\etc&nbsp;\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>
      &nbsp; produces &nbsp;
      <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>&nbsp;. <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> &nbsp; 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{&nbsp;}</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 3.  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&nbsp;justification"</i> down columns of an array,
     as usual.  And "vertical&nbsp;justification" across rows defaults
     to what we'll call <b><i>baseline</i></b>, i.e., aligned equations,
     as in <a href="#example10">Example&nbsp;10</a> above, display properly.
     But the down arrows (for &nbsp;
       <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> &nbsp; and for &nbsp;
       <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&nbsp;11</a> require
     <i>"vertical&nbsp;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&nbsp;pixels, and the absolute height of the
     first row to 35&nbsp;pixels, as illustrated by
     <a href="#example9">Example&nbsp;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&nbsp;2 and all subsequent columns to 25&nbsp;pixels,
     and the absolute height of row&nbsp;1 and all subsequent rows
     to 35&nbsp;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&nbsp;1-3 to 25&nbsp;pixels,
     columns&nbsp;4-6 to 35&nbsp;pixels, and then reverts to automatic
     sizing for columns&nbsp;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&nbsp;8-11</a> above for several
     additional <b>\begin{array}{lcr}</b> applications. </p>


<h2> <a name="picture"> (IIIf) \picture(&nbsp;){&nbsp;} "Environment",
     including \line(&nbsp;){&nbsp;} and \circle(&nbsp;) &nbsp; </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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \picture(width[,height])&nbsp;
      {&nbsp;(loc1){pic_elem1}&nbsp;(loc2){pic_elem2}&nbsp;...&nbsp;}</b><br>
     as illustrated by <a href="#example12">Examples&nbsp;12-13</a> above.
     Arguments surrounded by <b>[&nbsp;]</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)&nbsp;...</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(&nbsp;){&nbsp;} and
\circle(&nbsp;)<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., &nbsp; <b>abc\circle(20)def</b> &nbsp; produces &nbsp;
      <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>
     &nbsp; &nbsp; &nbsp; 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>
     &nbsp; &nbsp; &nbsp;  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>&nbsp; &nbsp; &nbsp;
     \unitlength{.6} &nbsp; \picture(100) {<br>
     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            (50,50){\circle(99)} %%head%%<br>
     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            (20,55;50,0;2){\fs{+1}\hat\bullet} %%eyes%%<br>
     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            (50,40){\bullet} %%nose%%<br>
     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            (50,35){\circle(50,25;34)} %%upper lip%%<br>
     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            (50,35){\circle(50,45;34)} %%lower lip%% &nbsp; }</b></font></p>
  <center>
   <a href="#preview"><img id="circleline2" onclick="eqntext('circleline2')"
   src="../cgi-bin/mimetex.cgi?\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 &nbsp; </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{&nbsp;}{&nbsp;}</b> and <b>{&nbsp;\over&nbsp;}</b> </li>
       <li> <b>{&nbsp;\atop&nbsp;}</b> and <b>{&nbsp;\choose&nbsp;}</b> </li>
       <li> <b>\sqrt{&nbsp;}</b> </li>
       <li> <b>\lim_{&nbsp;}</b> and all the usual LaTeX function names </li>
       <li> <b>\hat{&nbsp;}</b> and <b>\widehat{&nbsp;}</b>
            and many of the usual LaTeX accents </li>
       <li> <b>\overbrace{&nbsp;}^{&nbsp;}</b> and
            <b>\underbrace{&nbsp;}_{&nbsp;}</b> </li>
       <li> <b>\overline{&nbsp;}</b> and <b>\underline{&nbsp;}</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">\stackrel{&nbsp;}{&nbsp;} and
\relstack{&nbsp;}{&nbsp;}<font size=5>...</font></a> </h3>

 <p class="continue">
     <b>\stackrel{&nbsp;}{&nbsp;}</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{&nbsp;}{&nbsp;}</b> is
     identical.  For example, </p> <center>
     <b>"\vec x\stackrel{\rm def}=(x_1\ldots x_n)"</b>
     &nbsp; produces &nbsp;
        <a href="#preview"><img id="stackrel1" onclick="eqntext('stackrel1')"
        src="../cgi-bin/mimetex.cgi?
        \Large\vec x\,\stackrel{\small\rm def}=
        \,(x_1\ldots x_n)" alt="" border=0 align=middle></a> </center>

 <p> "Conversely" to <b>\stackrel{&nbsp;}{&nbsp;}</b>, mimeTeX provides
     <b>\relstack{&nbsp;}{&nbsp;}</b>, which renders its second argument
     one font size smaller and centered below its first.
     And the amsmath-style <b>\underset{&nbsp;}{&nbsp;}</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>"\relstack{\log}{\rm base 2}32=5"</b> &nbsp; to render &nbsp;
        <a href="#preview"><img id="stackrel2" onclick="eqntext('stackrel2')"
        src="../cgi-bin/mimetex.cgi?
        \Large\relstack\log{\small\rm base 2}32\,=\,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>
     &nbsp; produces &nbsp;
        <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 &nbsp; <b>"\log\limits_{\rm base 2}32=5"</b> &nbsp;
        produces &nbsp;
        <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{&nbsp;}<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> &nbsp; produces &nbsp;
        <a href="#preview"><img id="fbox1" onclick="eqntext('fbox1')"
        src="../cgi-bin/mimetex.cgi?4$\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="input">\input{&nbsp;}<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&nbsp;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> 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>&lt;<i>tag</i>&gt;...&lt;/<i>tag</i>&gt;</b> are placed
     into your expression.  This permits you to have one file containing
     many different <b>&lt;<i>tag</i>&gt;</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[&nbsp;]{&nbsp;}
<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&nbsp;option</a>.  Before using
     the <b>\counter</b> command, Unix "touch" and "chmod" those files
     so they're mimeTeX readable and writable. </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>&lt;<i>tag</i>&gt;&nbsp;<i>value</i>&nbsp;&lt;/<i>tag</i>&gt;</b>
     where <b><i>value</i></b> is initialized as <b>1_</b> if the
     specified <b>&lt;<i>tag</i>&gt;</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&nbsp;(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>&lt;<i>tag</i>&gt;</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>&lt;timestamp&gt;</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>2004-09-20:12:59:33pm&nbsp;&lt;<i>tag</i>&gt;=99&nbsp;192.168.1.1&nbsp;<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>


<h2> <a name="exceptions"> (IIIh) Other Exceptions
to LaTeX Syntax &nbsp; </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>


<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SECTION IV.  APPENDICES
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h1> <a name="appendices"> (IV) Appendices &nbsp; </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) &nbsp; mimeTeX Fonts &nbsp; </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 &gt; gftype -i &gt; gfuntype) gives mimeTeX the 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 36 such (sequences of)
  runs, representing six font families at six 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>
 <center><b>mf '\mode=onetz; mag=magstep(.5); 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 &gt; 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 36 sequences of runs represented
  in the texfonts.h file supplied with your mimeTeX distribution
  correspond to the following six inital metafont runs for cmr10 </p>
  <pre>   size=0 (.83gf)   mf '\mode=eighthre; input cmr10'
        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>
  <p class="continue">
  Then ditto for the five other font families cmmi10, cmsy10, cmex10,
  rsfs10, bbold10.  All the subsequent gftype and gfuntype runs just
  follow the usual 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
       ------------------------------------------------------------- */
       {  CMR10, {  cmr83,  cmr100,  cmr118,  cmr131,  cmr160,  cmr180 } },
       { CMMI10, { cmmi83, cmmi100, cmmi118, cmmi131, cmmi160, cmmi180 } },
       { CMSY10, { cmsy83, cmsy100, cmsy118, cmsy131, cmsy160, cmsy180 } },
       { CMEX10, { cmex83, cmex100, cmex118, cmex131, cmex160, cmex180 } },
       { RSFS10, { rsfs83, rsfs100, rsfs118, rsfs131, rsfs160, rsfs180 } },
       {BBOLD10, {bbold83,bbold100,bbold118,bbold131,bbold160,bbold180 } },
       {   -999, {   NULL,    NULL,    NULL,    NULL,    NULL,    NULL } }
     } ; /* --- end-of-fonttable[] --- */</pre><p class="continue">
  Note the 36 names <b>cmr83...bbold180</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 six 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>


<h2> <a name="makeraster"> (IVb) mimeTeX's make_raster()
function &nbsp; </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 &lt;stdio.h&gt;
 #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>
   &nbsp; &nbsp; &nbsp; &nbsp; cc mimedemo.c mimetex.c -lm -o mimedemo <br>
 and run it from your unix shell command line like <br>
   &nbsp; &nbsp; &nbsp; &nbsp; ./mimedemo &nbsp; &quot;x^2+y^2&quot; </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 &lt;stdio.h&gt;
 #include &lt;stdlib.h&gt;
 #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>
   &nbsp; &nbsp; &nbsp; &nbsp; cc 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>
   &nbsp; &nbsp; &nbsp; &nbsp; ./mimedemo &nbsp; &quot;x^2+y^2&quot;
   &nbsp; <b>&gt;</b> &nbsp; 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-&gt;width and rp-&gt;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 &nbsp; </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 &nbsp; </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&#64;forkosh&#46;com">john&#64;forkosh&#46;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>&copy;</font> 2002-2005,
  <a href="http://www.forkosh.com">John Forkosh Associates, Inc.</a>
  </nobr><br>
  email: <a href="mailto:john&#64;forkosh&#46;com">john&#64;forkosh&#46;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 -->

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>