File:  [LON-CAPA] / loncom / cgi / mimeTeX / mimetex.html
Revision 1.4: download - view: text, annotated - select for diffs
Thu Dec 4 12:17:13 2008 UTC (15 years, 5 months ago) by riegler
Branches: MAIN
CVS tags: version_2_9_X, version_2_9_99_0, version_2_9_1, version_2_9_0, version_2_8_X, version_2_8_99_1, version_2_8_99_0, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_99_1, version_2_7_99_0, version_2_10_X, version_2_10_1, version_2_10_0_RC2, version_2_10_0_RC1, version_2_10_0, loncapaMITrelate_1, language_hyphenation_merge, language_hyphenation, bz6209-base, bz6209, bz5969, bz2851, PRINT_INCOMPLETE_base, PRINT_INCOMPLETE, HEAD, GCI_3, GCI_2, GCI_1, BZ5971-printing-apage, BZ5434-fox, BZ4492-merge, BZ4492-feature_horizontal_radioresponse, BZ4492-feature_Support_horizontal_radioresponse, BZ4492-Support_horizontal_radioresponse
upgrade to mimetex version 1.7
This version will be needed in order to align formulas neatly.
noticable change is the % in the path specified in "commands".

    1: <!--
    2:  ****************************************************************************
    3:  * Copyright(c) 2002-2008, John Forkosh Associates, Inc. All rights reserved.
    4:  *           http://www.forkosh.com   mailto: john@forkosh.com
    5:  * ==========================================================================
    6:  * This file is part of mimeTeX, which is free software. You may redistribute
    7:  * and/or modify it under the terms of the GNU General Public License,
    8:  * version 3 or later, as published by the Free Software Foundation.
    9:  *      MimeTeX is distributed in the hope that it will be useful, but
   10:  * WITHOUT ANY WARRANTY, not even the implied warranty of MERCHANTABILITY.
   11:  * See the GNU General Public License for specific details.
   12:  *      By using mimeTeX, you warrant that you have read, understood and
   13:  * agreed to these terms and conditions, and that you possess the legal
   14:  * right and ability to enter into this agreement and to use mimeTeX
   15:  * in accordance with it.
   16:  *      Your mimetex.zip distribution file should contain the file COPYING,
   17:  * an ascii text copy of the GNU General Public License, version 3.
   18:  * If not, point your browser to  http://www.gnu.org/licenses/
   19:  * or write to the Free Software Foundation, Inc.,
   20:  * 59 Temple Place, Suite 330,  Boston, MA 02111-1307 USA.
   21:  ****************************************************************************
   22:  -->
   23: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   24:  "http://www.w3.org/TR/html4/loose.dtd">
   25:  <!-- "http://www.forkosh.dreamhost.com/loose.dtd" -->
   26: 
   27: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   28: Preamble
   29: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
   30: <html>
   31:   <head>
   32:     <title> mimeTeX user's manual </title>
   33:     <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   34:     <style type="text/css">
   35:       body      { background-image:  none; /* none; or url(); */
   36:                   /*background-repeat: repeat-y;*/
   37:                   /*background-attachment: fixed;*/ /* fixed; or scroll; */
   38:                   background-color:  #ffffff;   color: #000000;
   39:                   margin-left: 0.5em;  margin-right: 0.1em;
   40:                   font-size: large; /* or medium */
   41:                   clear: both }
   42:       A:active  { color: blue/*#0000FF*/; text-decoration: none }
   43:       A:link    { color: blue/*#0000FF*/; text-decoration: none }
   44:       A:visited { color: blue/*#0000FF*/; text-decoration: none }
   45:       A:hover   { color: red/*#FF0000*/;  text-decoration: underline
   46:                   /*font-style: italic; font-weight: bold;*/
   47:                   /*font-size: normal;  line-height: normal*/ }
   48:       h1        { color: maroon;  text-decoration: underline;
   49:                   font-style: normal;  /* italic oblique */
   50:                   font-size: xx-large;
   51:                   padding-top: 2.0em;
   52:                   letter-spacing: 0.25em }
   53:       h2        { color: maroon;  text-decoration: underline;
   54:                   font-style: normal;  /* italic oblique */
   55:                   font-size: x-large;
   56:                   padding-top: 1.0em;
   57:                   letter-spacing: 0.20em }
   58:       h3        { color: maroon; /*black;   text-decoration: underline;*/
   59:                   font-style: normal;  /* italic oblique */
   60:                   font-size: large;
   61:                   margin-left: 1em;
   62:                   padding-top: 0.5em;
   63:                   letter-spacing: 0.15em }
   64:       center    { padding-top: -0.1em; padding-bottom: -0.1em; }
   65:       table     { font-size: large }
   66:       table.medium { font-size: medium }
   67:       dl        { font-size: large;
   68:                   margin-left: 3.0em;   margin-right: 2.5em }
   69:       ol        { margin-left: 3.0em;   margin-right: 2.5em }
   70:       ul        { margin-left: 3.0em;   margin-right: 2.5em;
   71:                   list-style-type: square }
   72:       ul ul     { margin-left: -0.5em;  margin-right: 3.5em;
   73:                   list-style-type: disc }
   74:       pre       { margin-left: 3.0em; font-size: medium; font-weight: bold }
   75:       pre.nobold { margin-left:3.0em; font-size:medium; font-weight:normal }
   76:       p         { margin-left: 2.0em;   margin-right: 1.5em }
   77:       p:first-letter
   78:                 { font-size: x-large;   font-weight: bold;
   79:                   color: maroon }
   80:       p.continue { margin-left: 2.0em;   margin-right: 1.5em;
   81:                    padding-top: -0.1em }
   82:       p.continue:first-letter
   83:                 { font-size: large;   font-weight: normal;
   84:                   color: black }
   85:       p.warning  { color: red } /* defines  p class=warning */
   86:     </style>
   87:   <script type="text/javascript">
   88:     <!--
   89:     // add/clear text to expression
   90:     function eqntext(eqn)
   91:       { var eqnSrc = document.getElementById(eqn).src;
   92:         var texSrc = eqnSrc.substring(eqnSrc.indexOf('?')+1,eqnSrc.length);
   93:         addtext(texSrc); }
   94:     function addtext(text)
   95:       { cleartext();
   96:         document.expression.formdata.value += unescape(text);
   97:         document.expression.formdata.focus(); }
   98:     function cleartext()
   99:       { document.expression.formdata.value = "";
  100:         //document.inlineframe.value = "";
  101:         document.expression.formdata.focus(); }
  102:     -->
  103:   </script>
  104: 
  105: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  106: + javascript from mathtran.org to render <img alt="tex:math expression">
  107: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
  108: <script type="text/javascript"
  109:     src="http://www.mathtran.org/js/mathtran_img.js"></script>
  110:   </head>
  111: <body>
  112: 
  113: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  114: Banner across top of page, containing title and two example mimeTeX images.
  115: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
  116: <br>
  117: <hr size=4>
  118: <center>
  119:  <table cellspacing=10>
  120:   <tr>
  121:    <td align="center">
  122:     <a href="#preview"><img id="imageBanr1" onclick="eqntext('imageBanr1')"
  123:     src="../cgi-bin/mimetex.cgi?\Large f=b_o+\frac{a_1}{b_1+\frac{a_2}
  124:     {b_2+\frac{a_3}{b_3+a_4}}}" alt="" border=0 align=middle></a> </td>
  125:    <td align="center" valign="middle">
  126:     <center> <font color="maroon" size=4>
  127:     <b><nobr>m i m e T e X &nbsp; m a n u a l</nobr></b> <br>
  128:     <font size=3>( for mimeTeX version 1.70 )</font> <br>
  129:     <font size=3> <b>Click for:</b>&nbsp;
  130:      <!-- <a href="http://www.forkosh.com" target="_top">homepage</a>, &nbsp;
  131:      <a href="http://www.forkosh.com/resume.html" target="_top">resume</a> -->
  132:      <a href="http://www.forkosh.com/mimetextutorial.html" target="_top">
  133:      LaTeX tutorial</a><br>
  134:      <a href="http://www.forkosh.com/mimetex.html" target="_top">
  135:      mimeTeX QuickStart</a><br>
  136:      <a href="http://www.forkosh.com/mimetex.zip">
  137:      <!-- jfa <a href="ftp://ftp.tex.ac.uk/tex-archive/support/mimetex/mimetex.zip"></a> -->
  138:      <font size=4>download&nbsp;mimeTeX</font></a></font>
  139:     </font> </center> </td>
  140:    <td align="center">
  141:     <a href="#preview"><img id="imageBanr2" onclick="eqntext('imageBanr2')"
  142:     src="../cgi-bin/mimetex.cgi?\Large\scr{J}^{ij}=\frac12\varepsilon_{ijk}
  143:     \left[\begin{array}{cc}\sigma_k&0\\0&\sigma_k\end{array}\right]"
  144:     alt="" border=0 align=middle></a> <br>
  145:     <a href="#examples">more_examples...</a> </td>
  146:   </tr>
  147:  </table>
  148: </center>
  149: <hr size=4>
  150: <center><b><font color="maroon" size=3>
  151: Copyright <font size=5>&copy;</font> 2002-2008,
  152: <a href="http://www.forkosh.com">John Forkosh Associates, Inc.</a> <br>
  153: email: <a href="mailto:john&#64;forkosh&#46;com">john&#64;forkosh&#46;com</a>
  154: </font></b> <br><br>
  155: <a href="#preview"><img id="timestamp1" onclick="eqntext('timestamp1')"
  156: src="../cgi-bin/mimetex.cgi?\normalsize\blue\begin{matrix}
  157: \large\today\\\normalsize\today[3]\end{matrix}"
  158: alt="" border=0 align=middle></a> </center>
  159: 
  160: 
  161: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  162: Table of Contents
  163: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
  164: <br> <center><b><font color="maroon" size=6>
  165:  <u> &nbsp; &nbsp; &nbsp; &nbsp; C o n t e n t s &nbsp; &nbsp; &nbsp; &nbsp;
  166:  </u></font></b> <br>
  167: <table cellspacing=0 class="medium">
  168:  <tr>
  169:   <td valign="top" align="center" width=150>
  170:    <font size=3><b>- - - T u t o r i a l - - -</b></font> </td>
  171:   <td valign="top" align="center" colspan=3 width=450><font size=3><b>
  172:   - - - - - - - - - - - - - - R e f e r e n c e - - - - - - - - - - - - - -
  173:  </b></font></td>
  174:  </tr>
  175:  <tr>
  176:   <td valign="top" align="center" width=150> <font size=3>
  177:    <a href="#introduction">&nbsp; (I) Introduction &nbsp;</a><br>
  178:     <a href="#quickstart"> a. Quick Start </a><br>
  179:     <a href="#examples">   b. Examples </a><br>
  180:     <a href="#gpl">        c. GPL License </a> </font> </td>
  181:   <td valign="top" align="center" width=150> <font size=3>
  182:    <a href="#build">&nbsp; (II) Building mimeTeX &nbsp;</a><br>
  183:     <a href="#compile">    a. Compile </a><br>
  184:     <a href="#install">    b. Install </a><br>
  185:     <a href="#options">    c. Compile Options </a><br>
  186:     <a href="#cmdline">    d. Command Line </a> </font> </td>
  187:   <td valign="top" align="center" width=150> <font size=3>
  188:    <a href="#reference">&nbsp; (III) Syntax Reference &nbsp;</a><br>
  189:     <a href="#spaces">     a. Math & White Space </a><br>
  190:     <a href="#symbols">    b. Symbols, Sizes, Modes </a><br>
  191:     <a href="#delimiters"> c. Delimiters </a><br>
  192:     <a href="#accents">    d. Accents, Arrows, etc. </a><br>
  193:     <a href="#array">      e. \begin{array} </a><br>
  194:     <a href="#picture">    f. \picture(&nbsp;){&nbsp;} </a><br>
  195:     <a href="#commands">   g. Other Commands </a><br>
  196:     <a href="#exceptions"> h. Other Exceptions </a> </font> </td>
  197:   <td valign="top" align="center" width=150> <font size=3>
  198:    <a href="#appendices">&nbsp; &nbsp; (IV) Appendices &nbsp; &nbsp;</a><br>
  199:     <a href="#fonts">      a. Fonts </a><br>
  200:     <a href="#makeraster"> b. make_raster() </a><br>
  201:     <a href="#gifsave">    c. gifsave.c </a>
  202:     <br><a href="#remarks"> &nbsp; Remarks &nbsp; </a> </font> </td>
  203:  </tr>
  204: </table>
  205: 
  206: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  207: + Installation and Usage Summary
  208: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
  209: <br>
  210: <table border="0">
  211: <tr> <!-- banner -->
  212:  <td align="left">
  213:    <!-- <b><font color="maroon" size=4>
  214:    <u> &nbsp; &nbsp; &nbsp; &nbsp; I n s t a l l a t i o n &nbsp;
  215:    a n d &nbsp; U s a g e &nbsp; S u m m a r y &nbsp; &nbsp; &nbsp; &nbsp;
  216:    </u></font></b> -->
  217:    <font size=4 color="maroon"><b>- - - - - - I n s t a l l a t i o n &nbsp;
  218:    a n d &nbsp; U s a g e &nbsp; S u m m a r y - - - - - -</b></font>
  219:  </td> </tr>
  220: <tr>
  221:  <td valign="top"> <!-- summary -->
  222:   <table border="0" cellpadding="0" cellspacing="0" hspace="0" vspace="0">
  223:     <tr><td align="right" valign="top"> &nbsp; &nbsp; &nbsp;
  224:       <a href="#build">Installation</a>: &nbsp; &nbsp; </td>
  225:       <td><font size=4> Download <a href="http://www.forkosh.com/mimetex.zip">
  226:        mimetex.zip</a> and then type <br>
  227:        <b> &nbsp; &nbsp; unzip mimetex.zip</b> <br>
  228:        <b> &nbsp; &nbsp; cc -DAA mimetex.c gifsave.c -lm -o mimetex.cgi</b>
  229:        <br>Now just <b>mv</b> mimetex.cgi to your <b>cgi-bin/</b>
  230:        directory, <br> set permissions as necessary, and you're all done.
  231:        </font></td></tr>
  232:     <tr><td colspan="2"> <font size="2">&nbsp;</font> </td></tr>
  233:     <tr><td align="right" valign="top">
  234:       <a href="#introduction">Usage</a>: &nbsp; &nbsp; </td>
  235:       <td><font size=4> To see the image <br> &nbsp; &nbsp;
  236:        <a href="#preview"><img id="summary1" onclick="eqntext('summary1')"
  237:        src="../cgi-bin/mimetex.cgi?x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}"
  238:        alt="" border=0 align=middle></a> <br>
  239:        just write the tag <br>
  240:        <b> &nbsp; &nbsp; &lt;img&nbsp;src="/cgi-bin/mimetex.cgi?<br>
  241:        &nbsp; &nbsp; x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}"&gt;</b>
  242:        </font></td></tr>
  243:   </table>
  244:  </td>
  245: </tr>
  246: </table>
  247: </center>
  248: 
  249: 
  250: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  251: SECTION I.  INTRODUCTION
  252: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
  253: <h1> <a name="introduction">(I) Introduction</a> &nbsp; </h1>
  254: 
  255: <p> <font color="maroon">MimeTeX, licensed under the
  256:     <a href="http://www.gnu.org/licenses/gpl.html" target="_top">gpl</a>,
  257:     lets you easily embed LaTeX math in your html pages.</font>
  258:     It parses a LaTeX math expression and immediately emits the
  259:     corresponding gif image, rather than the usual TeX dvi.
  260:     And mimeTeX is an entirely separate little program that doesn't use
  261:     TeX or its fonts in any way.  It's just one cgi that you put in your
  262:     site's cgi-bin/ directory, with no other dependencies.  So mimeTeX
  263:     is very easy to <a href="#quickbuild">install</a>.  And it's equally
  264:     easy to use.  Just place an html &lt;img&gt; tag in your document
  265:     wherever you want to see the corresponding LaTeX expression.
  266:     For example, </p>
  267: <pre>  &lt;img&nbsp;src="../cgi-bin/mimetex.cgi?f(x)=\int_{-\infty}^xe^{-t^2}dt"
  268:    alt="" border=0 align=middle&gt;</pre> <p class="continue">immediately
  269:     generates the corresponding gif image on-the-fly, displaying
  270:     <a href="#preview"><img id="imageI1" onclick="eqntext('imageI1')"
  271:     src="../cgi-bin/mimetex.cgi?\normalsize
  272:     f(x)=\int\limits_{-\infty}^xe^{-t^2}dt"
  273:     alt="" border=0 style="Vertical-Align:-11px"></a>
  274:     wherever you put that &lt;img&gt tag.
  275:     MimeTeX doesn't need intermediate dvi-to-gif conversion, and it doesn't
  276:     create separate gif files for each converted expression.
  277:     (But you can enable image caching with mimeTeX's
  278:     &nbsp; <b>-DCACHEPATH=\&quot;<i>path/</i>\&quot;</b> &nbsp;
  279:     <a href="#options">compile&nbsp;option</a>.) </p>
  280: 
  281: <h3> <a name="plugins">
  282: mimeTeX plugins<font size=5>...</font></a> </h3>
  283: <p> There's no inherent need to repeatedly write the cumbersome
  284:     &lt;img&gt; tag illustrated above.  You can write your own <a href=
  285:     "http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro9.html#wp73314"
  286:     target="_top">custom&nbsp;tags</a>,
  287:     or write a wrapper&nbsp;script around mimeTeX to simplify the
  288:     notation. </p>
  289: 
  290: <p style="margin-bottom:0">  For example,
  291:     the following javascript snippet (based on
  292:     <a href="http://www.mathtran.org" target="_top">mathtran</a>'s
  293:     <a href="http://www.mathtran.org/js/mathtran_img.js"
  294:     target="_top">mathtran_img.js</a>) lets you just write &nbsp;
  295:     <b>&lt;img&nbsp;alt="mimetex:c=\sqrt{a^2+b^2}"&gt;</b> &nbsp;
  296:     wherever you want to see&nbsp;<a href="#preview"><img id="imageJS1"
  297:     onclick="eqntext('imageJS1')" src="../cgi-bin/mimetex.cgi?
  298:     \normalsize c=\sqrt{a^2+b^2}" alt="" border=0
  299:     style="Vertical-Align:-1px"></a>&nbsp; </p>
  300:     <pre class="medium" style="margin-top:0;margin-bottom:0"
  301: >   &lt;script type="text/javascript"&gt;
  302:    &lt;!--
  303:    // Create a namespace to hold variables and functions
  304:    mimetex = new Object();
  305:    // Change this to use your server
  306:    mimetex.imgSrc = "http://www.<i>yourdomain</i>.com/cgi-bin/mimetex.cgi?";
  307:    // Transform the whole document: add src to each img with
  308:    // alt text starting with "mimetex:", unless img already has a src.
  309:    mimetex.init = function () {
  310:        if (! document.getElementsByTagName) return;
  311:        var objs = document.getElementsByTagName("img");
  312:        var len  = objs.length;
  313:        for (i=0; i&lt;len; i++) {
  314:           var img = objs[i];
  315:           if (img.alt.substring(0,8) == 'mimetex:')
  316:              if (!img.src) {
  317:                 var tex_src = img.alt.substring(8);
  318:                 img.src = mimetex.imgSrc + encodeURIComponent(tex_src);
  319:                 // Append TEX to the class of the IMG.
  320:                 img.className +=' tex'; }
  321:           }
  322:        mimetex.hideElementById("mimetex.error"); }
  323:    // Utility function
  324:    mimetex.hideElementById = function (id) {
  325:        var obj = document.getElementById(id);
  326:        if (obj) obj.style.display = 'none'; }
  327:    // resolve a cross-browser issue (see <a href="http://scottandrew.com/weblog/articles/cbs-events" target="_top">CBS&nbsp;events</a>)
  328:    mimetex.addEvent = function (obj, evType, fn, useCapture) {
  329:        if (obj.addEventListener) { //For Mozilla.
  330:            obj.addEventListener(evType, fn, useCapture);
  331:            return true; }
  332:        else if (obj.attachEvent) { //For Internet Explorer.
  333:            var r = obj.attachEvent("on"+evType, fn);
  334:            return r; }
  335:        }
  336:    // Initialize after entire document is loaded
  337:    mimetex.addEvent(window, 'load', mimetex.init, false);
  338:    --&gt;
  339:    &lt;/script&gt;</pre>
  340: 
  341: <p style="margin-bottom:0">
  342:     Bulletin boards, wikis, etc, can also incorporate mimeTeX images
  343:     with short scripts.  For example, if you're using
  344:     <a href="http://www.phpbb.com" target="_top">phpBB2</a>, then
  345:     <a href="http://www.themathforum.com/" target="_top">Jameson</a>
  346:     contributed the following typical one-line mod that lets you write
  347:     <b>[tex]&nbsp;c=\sqrt{a^2+b^2}&nbsp;[/tex]</b> to obtain the
  348:     same&nbsp;<a href="#preview"><img id="imageJS2"
  349:     onclick="eqntext('imageJS2')" src="../cgi-bin/mimetex.cgi?
  350:     \normalsize c=\sqrt{a^2+b^2}" alt="" border=0
  351:     style="Vertical-Align:-1px"></a> image illustrated above&nbsp; </p>
  352:     <pre class="medium" style="margin-top:0;margin-bottom:0"
  353: >   #--------[open]-----------------------------------------------------
  354:      /includes/bbcode.php
  355:    #--------[find]-----------------------------------------------------
  356:      // Remove our padding from the string..
  357:    #--------[before, add]----------------------------------------------
  358:      $text = preg_replace('/\[tex\](.*?)\[\/tex\]/ie',
  359:      "'&lt;img src=\"/cgi-bin/mimetex.cgi?'.rawurlencode('$1').'\" align=\"middle\" /&gt;'",
  360:      $text);</pre>
  361: <p class="continue" style="margin-top:0"> If you're using
  362:      <a href="http://www.phpbb.com" target="_top">phpBB3</a>,
  363:      then no mod is even needed.
  364:      Just click Postings from the Administrator Control Panel,
  365:      and add the custom BBCode&nbsp;<b>[tex]{TEXT}[/tex]</b> &nbsp;
  366:      with the HTML replacement
  367:      <b>&lt;img&nbsp;src="/cgi-bin/mimetex.cgi?{TEXT}"&nbsp;align=middle&gt;</b></p>
  368: 
  369: <p> Similarly, <a href="http://www.pmichaud.com/wiki/PmWiki/PmWiki"
  370:     target="_top">PmWiki</a> also has a
  371:     <a href="http://www.pmichaud.com/wiki/Cookbook/MimeTeX" target="_top">
  372:     mimeTeX&nbsp;plugin</a> that lets you just write
  373:     <b>{$&nbsp;f(x)=\int_{-\infty}^xe^{-t^2}dt&nbsp;$}</b>
  374:     to obtain that same image. &nbsp; Several other packages
  375:     also have similar mimeTeX plugins: </p>
  376:     <center><table>
  377:      <tr> <td align=center> <u>&nbsp;<b>Package</b>&nbsp;</u> </td>
  378:       <td> &nbsp; </td>
  379:       <td align=center> <u>&nbsp;&nbsp;<b>Plugin</b>&nbsp;&nbsp;</u> </td>
  380:       </tr>
  381:      <tr> <td align=center>
  382: 	  <a href="http://www.pmichaud.com/wiki/PmWiki/PmWiki" target="_top">
  383: 	  PmWiki</a> </td> <td> &nbsp; </td>
  384: 	  <td align=center>
  385: 	  <a href="http://www.pmichaud.com/wiki/Cookbook/MimeTeX"
  386: 	  target="_top">mimeTeX&nbsp;plugin</a> </td> </tr>
  387:      <tr> <td align=center>
  388: 	  <!-- a href="http://www.wikimedia.org/wiki/Main_Page" -->
  389: 	  <a href="http://www.wikimediafoundation.org/wiki/Main_Page"
  390:           target="_top">Wikimedia</a> </td>
  391: 	  <td align=center> &nbsp; </td>
  392: 	  <td align=center>
  393: 	  <!-- a href="http://meta.wikimedia.org/wiki/Mimetex_alternative" -->
  394: 	  <a href="http://www.mediawiki.org/wiki/Mimetex_alternative"
  395: 	  target="_top">&quot;mimeTeX&nbsp;alternative&quot;</a> </td> </tr>
  396: <!-- ***redirect loop***
  397:      <tr> <td align=center>
  398: 	  <a href="http://www.unitorganizer.com/mathwiki/index.php/Main_Page"
  399: 	  target="_top">MathWiki</a> </td> <td> &nbsp; </td>
  400: 	  <td align=center> <a href=
  401: 	  "http://www.unitorganizer.com/mathwiki/index.php/MimetexParser"
  402: 	  target="_top">&quot;mimeTeX&nbsp;Parser&quot;</a> </td> </tr>
  403: -->
  404:      <tr> <td align=center>
  405: 	  <a href="http://forums.punbb.org/" target="_top">PunBB</a> </td>
  406: 	  <td> &nbsp; </td> <td align=center>
  407: 	  <a href="http://www.math-linux.com/spip.php?article44"
  408: 	  target="_top">mimeTeX&nbsp;plugin</a> </td> </tr>
  409:      <tr> <td align=center>
  410: 	  <!-- a href="http://www.sixapart.com/movabletype/" -->
  411: 	  <a href="http://www.movabletype.com/"
  412: 	  target="_top">Movable&nbsp;Type</a> </td> <td> &nbsp; </td>
  413: 	  <td align=center> <a href=
  414: 	  "http://www.unitorganizer.com/myblog/2006/08/creating_equations_in_movable.html"
  415:           target="_top">mimeTeX&nbsp;plugin</a> </td> </tr>
  416:      <tr> <td align=center>
  417: 	  <a href="http://wordpress.org/" target="_top">WordPress</a> </td>
  418: 	  <td> &nbsp; </td> <td align=center> <a href=
  419: 	  "http://www.anlak.com/?page_id=66" target="_top">
  420:      <!-- "http://sixthform.info/steve/wordpress/index.php?p=13&page=2" -->
  421: 	  mimeTeX&nbsp;plugin</a> <!-- &nbsp; (see item 9) --> </td> </tr>
  422:      <!--- dead links --->
  423:      <!-- tr> <td align=center>
  424: 	  <a href="http://www.phpbb.com" target="_top">phpBB</a> </td>
  425: 	  <td> &nbsp; </td> <td align=center>
  426: 	  <a href=
  427: 	  "http://www.themathforum.com/math/showthread.php?p=621#post621"
  428: 	  target="_top">mimeTeX&nbsp;plugin</a> </td> </tr -->
  429:      <!-- tr> <td align=center>
  430: 	  <a href="http://www.mamboserver.com/" target="_top">Mambo</a> </td>
  431: 	  <td> &nbsp; </td> <td align=center>
  432: 	  <a href="http://mamboxchange.com/projects/mimetexbot/"
  433: 	  target="_top">&quot;mimeTeX&nbsp;bot&quot;</a> </td> </tr -->
  434:     </table></center>
  435: 
  436: <p> <b>Please note:</b> If you're writing your own plugin for mimeTeX,
  437:     please don't write php code using <b>system(&nbsp;)</b>, or any other
  438:     shell escape mechanism, just to cache images.  Use mimeTeX's
  439:     &nbsp; <b>-DCACHEPATH=\&quot;<i>path/</i>\&quot;</b> &nbsp;
  440:     <a href="#options">compile&nbsp;option</a> instead.
  441:     <b>system(&nbsp;)</b> raises security
  442:     issues, either real ones if used carelessly, or just in the minds of
  443:     system administrators.  Either way, I've received many emails from
  444:     people unable to use mimeTeX because of unnecessary <b>system(&nbsp;)</b>
  445:     calls prohibited by security-conscious sysadmins.  MimeTeX itself poses
  446:     minimal risk when used as illustrated above, but you're responsible
  447:     for any plugin/wrapper script you write around it. </p>
  448: 
  449: <h3> <a name="valignment">
  450: Vertical alignment<font size=5>...</font></a> </h3>
  451: <p> An image like
  452:     <a href="#preview"><img id="imageAV1" onclick="eqntext('imageAV1')"
  453:     src="../cgi-bin/mimetex.cgi?
  454:     \normalsize f(x)=\int\limits_{-\infty}^xe^{-t^2}dt"
  455:     alt="" border=0 align=middle></a>
  456:     doesn't look as good as the same image
  457:     <a href="#preview"><img id="imageAV2" onclick="eqntext('imageAV2')"
  458:     src="../cgi-bin/mimetex.cgi?
  459:     \normalsize f(x)=\int\limits_{-\infty}^xe^{-t^2}dt"
  460:     alt="" border=0 style="Vertical-Align:-11px"></a>
  461:     that's vertically aligned with your surrounding text.
  462:     Along with several standard 
  463:     <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">
  464:     HTTP&nbsp;header&nbsp;fields</a>, mimeTeX also emits a special
  465:     &nbsp; <b>Vertical-Align:&nbsp;&#150;<i>nn</i></b> &nbsp;
  466:     header, where <b>&#150;<i>nn</i></b> is the number of pixels
  467:     (usually negative as illustrated) needed for a
  468:     &nbsp; <b>style="Vertical-Align:&nbsp;&#150;<i>nn</i>&nbsp;px"</b>
  469:     &nbsp; attribute in the <b>&lt;img&gt;</b>&nbsp;tag used to
  470:     render your expression. </p>
  471: 
  472: <p> But mimeTeX's special Vertical-Align: header
  473:     is unrecognized and ignored by your browser.  You have to get the
  474:     header, interpret it, and write the corresponding &lt;img&gt; tag.
  475:     The only feasible way to do all this is using a scripting language,
  476:     as illustrated by the following, rather naive, php code </p>
  477:     <pre class="medium" style="margin-top:.5em;margin-bottom:.5em"
  478: >   &lt;?php
  479:    $mimetexurl = "http://www.<i>yourdomain</i>.com/cgi-bin/mimetex.cgi?";
  480:    function verticalalign( $expression ) {
  481:       global $mimetexurl;
  482:       // note: curl_init() stops at the first whitespace char in $url argument
  483:       $expression = ereg_replace(" ","~",$expression); // so remove whitespace
  484:       $url     = $mimetexurl . $expression;
  485:       $valign  = "0";
  486:       $ch      = curl_init( $url );
  487:       curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
  488:       curl_setopt( $ch, CURLOPT_HEADER, true );
  489:       $gif     = curl_exec( $ch );
  490:       $errno   = curl_errno( $ch );
  491:       curl_close( $ch );
  492:       if ( $errno == 0 ) {
  493:         $fields = explode("Vertical-Align:",$gif);
  494:         $vfield = trim($fields[1]);
  495:         $fldlen = strspn($vfield,"+-0123456789");
  496:         $valign = substr($vfield,0,$fldlen); }
  497:       return $valign;
  498:       }
  499:    function mimetextag( $expression ) {
  500:       global $mimetexurl;
  501:       $valign = verticalalign($expression);
  502:       $url    = $mimetexurl . $expression;
  503:       echo ' &lt;img src="',$url,'" ';
  504:       echo ' style="Vertical-Align:',$valign,'px" ';
  505:       echo ' alt="" border=0&gt;', "\n";
  506:       }
  507:    ?&gt;</pre>
  508: 
  509: <p> Now you can write &nbsp;
  510:     &lt;?php&nbsp;mimetextag('\frac12\left(a^2+b^2\right)');&nbsp;?&gt;
  511:     wherever you want to see
  512:     <a href="#preview"><img id="imageAV5" onclick="eqntext('imageAV5')"
  513:     src="../cgi-bin/mimetex.cgi?
  514:     \normalsize\frac12\left(a^2+b^2\right)"
  515:     alt="" border=0 style="Vertical-Align:-5px"></a>
  516:     correctly aligned.  <!-- Besides making you escape backslashes
  517:     (each&nbsp;&#092;&nbsp;must be written&nbsp;&#092;&#092;), -->
  518:     This code calls mimeTeX twice to render each expression,
  519:     once to get the Vertical-Align: header and build an
  520:     &lt;img&gt; tag, and then again to render that tag.
  521:     If you're a good php programmer and write better code,
  522:     please email me a copy. </p>
  523: 
  524: <p> If you're using mimeTeX's
  525:     &nbsp; <b>-DCACHEPATH=\&quot;<i>path</i>/\&quot;</b> &nbsp;
  526:     <a href="#options">compile&nbsp;option</a>, prefix your
  527:     <b><i>path</i>/</b> with a leading&nbsp;<b>&#037;</b> and write &nbsp;
  528:     <b>-DCACHEPATH=\&quot;&#037;<i>path</i>/\&quot;</b> &nbsp; instead.
  529:     That leading&nbsp;<b>&#037;</b> won't become part of your cache
  530:     directory's <b><i>path</i>/</b>, but it will signal mimeTeX
  531:     to cache headers along with each image.
  532:     Otherwise, the Vertical-Align: information is lost,
  533:     and attempts to align cached images will fail. </p>
  534: 
  535: <h3> <a name="alternatives">
  536: Alternative solutions<font size=5>...</font></a> </h3>
  537: <p> MimeTeX's benefit over similar math-on-the-web solutions is, as
  538:     mentioned above, its easy installation.  But if that's not a
  539:     problem for you, and if your site's server already has a LaTeX
  540:     distribution installed, and suitable image conversion utilities like
  541:     <a href="http://www.imagemagick.org" target="_top">ImageMagick</a>,
  542:     then you may prefer to look at a math rendering script like
  543:     <a href="http://www.mayer.dial.pipex.com/tex.htm#latexrender"
  544:     target="_top">latexrender</a>
  545:     which uses LaTeX to create higher quality images than mimeTeX
  546:     produces.  For comparison,
  547:     <a href="#preview"><img id="imageI2" onclick="eqntext('imageI2')"
  548:     src="../cgi-bin/mimetex.cgi?\normalsize
  549:     f(x)=\int\limits_{-\infty}^xe^{-t^2}dt"
  550:     alt="" border=0 style="Vertical-Align:-11px"></a>,
  551:     with arbitrary mean
  552:     <a href="#preview"><img id="imageI3" onclick="eqntext('imageI3')"
  553:     src="../cgi-bin/mimetex.cgi?\large\mu" alt="" border=0
  554:     style="Vertical-Align:-5px"></a> and standard deviation
  555:     <a href="#preview"><img id="imageI4" onclick="eqntext('imageI4')"
  556:     src="../cgi-bin/mimetex.cgi?\large\sigma" alt="" border=0
  557:     style="Vertical-Align:0px"></a>,
  558:     and at mimeTeX's next larger font size, looks like </p>
  559:      <center>
  560:       <table>
  561:        <tr align="center">
  562: 	<td> <font size="4">latexrender</font> </td>
  563: 	<td> <img src="../cgi-bin/mimetex.cgi?\hspace{30}"
  564:               alt="" border=0> </td>
  565: 	<td> <font size="4">mimeTeX</font> </td>
  566:        </tr>
  567:        <tr align="center">
  568: 	<td> <img src="http://www.forkosh.com/lrender.gif"
  569: 	 alt="" border=0 align=middle> </td>
  570:         <td> &nbsp; </td>
  571:  	<td>
  572: 	 <a href="#preview"><img id="imageI5" onclick="eqntext('imageI5')"
  573: 	 src="../cgi-bin/mimetex.cgi?\large
  574:          f(x)={\Large\frac1{\sigma\sqrt{2\pi}}}
  575: 	 \int_{\small-\infty}^xe^{-\small\frac{(t-\mu)^2}{2\sigma^2}}dt"
  576: 	 alt="" border=0 align=middle></a> </td>
  577:        </tr>
  578:       </table>
  579:      </center>
  580: <p> Similar LaTeX-based solutions that you may want to look at are
  581:     <a href="http://www.mathtran.org" target="_top">mathtran</a>,
  582:     <a href="http://www.fourmilab.ch/webtools/textogif/textogif.html"
  583:     target="_top">textogif</a> and
  584:     <a href="http://www.math.uio.no/~martingu/gladtex/"
  585:     target="_top">gladTeX</a>.  Additional discussion and several more
  586:     links are at <a href="http://www.tug.org/interest.html#web"
  587:     target="_top">www.tug.org/interest.html</a> and in the
  588:     <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=LaTeX2HTML"
  589:     target="_top">tex-faq</a>. </p>
  590: 
  591: <p> For example, <a href="http://www.mathtran.org" target="_top">mathtran</a>
  592:     is a public LaTeX web service that's
  593:     particularly easy to use by following these simple
  594:     <a href="http://www.mathtran.org/wiki/index.php/TeX_image"
  595:     target="_top">instructions</a>.  In the &lt;head&gt; of your
  596:     html page, place the tag <br>
  597:     &nbsp; &nbsp;
  598:       &lt;script type="text/javascript" <br>
  599:     &nbsp; &nbsp; &nbsp; &nbsp;
  600:       src="http://www.mathtran.org/js/mathtran_img.js"&gt;&lt;/script&gt;<br>
  601:     and in the &lt;body&gt;, wherever you want to see latex images,
  602:     place tags like <br>
  603:     &nbsp; &nbsp;
  604:       &lt;img alt=<b>"</b>tex:<i>any latex math expression</i><b>"</b>&gt;<br>
  605:     For comparison, <br>
  606:     &nbsp; &nbsp;
  607:       &lt;img alt="tex: f(x) = \frac1{\sigma\sqrt{2\pi}} <br>
  608:     &nbsp; &nbsp;
  609:       \int_{-\infty}^x e^{-\frac{(t-\mu)^2}{2\sigma^2}}dt"&gt; <br>
  610:     looks like </p>
  611:      <center>
  612:       <table>
  613:        <tr align="center">
  614: 	<td> <font size="4">mathtran</font> </td>
  615: 	<td> <img src="../cgi-bin/mimetex.cgi?\hspace{30}"
  616:               alt="" border=0> </td>
  617: 	<td> <font size="4">mimeTeX</font> </td>
  618:        </tr>
  619:        <tr align="center">
  620: 	<td> <img alt="tex:\displaystyle f(x) = \frac1{\sigma\sqrt{2\pi}}
  621:          \int_{-\infty}^x e^{-\frac{(t-\mu)^2}{2\sigma^2}}dt"> <br> </td>
  622:         <td> &nbsp; </td>
  623:  	<td>
  624: 	 <a href="#preview"><img id="imageP3" onclick="eqntext('imageP3')"
  625: 	 src="../cgi-bin/mimetex.cgi?\large
  626:          f(x)={\Large\frac1{\sigma\sqrt{2\pi}}}
  627: 	 \int_{\small-\infty}^xe^{-\small\frac{(t-\mu)^2}{2\sigma^2}}dt"
  628: 	 alt="" border=0 align=middle></a> </td>
  629:        </tr>
  630:       </table>
  631:      </center>
  632: 
  633: <!--
  634: <p> The remainder of this introductory mimeTeX tutorial section contains </p>
  635:      <ul>
  636:        <li> First, a concise <a href="#quickstart">Quickstart</a> providing
  637:             just enough information for you to try rendering your own
  638:             expressions by <a href="#preview">Submitting&nbsp;Queries</a>
  639:             right from this page. </li>
  640:        <li> Then, a variety of additional <a href="#examples">Examples</a>
  641:             that more fully illustrate mimeTeX's capabilities
  642:             (later on, Section III comprises a more complete mimeTeX
  643:             <a href="#reference">Syntax&nbsp;Reference</a>). </li>
  644:        <li> Finally, the <a href="#gpl">gpl</a> license, whose terms
  645:             and conditions you must agree to before using mimeTeX.</li>
  646:      </ul>
  647: -->
  648: <p> You may now want to browse the additional <a href="#examples">Examples</a>
  649:     below before proceeding, to make sure mimeTeX suits your needs before you
  650:     spend more time learning to use it. </p>
  651: 
  652: 
  653: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  654: QUICKSTART
  655: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
  656: <h2> <a name="quickstart"> (Ia) Quick Start &nbsp; </a> </h2>
  657: 
  658:  <p> <!-- Unlike MathML, --> MimeTeX is as TeX-like as possible (though
  659:      not 100% compliant), and you must already be familiar with LaTeX
  660:      math markup to use it.  If you're not, many online LaTeX
  661:      <a href="http://www.tug.org/begin.html#doc" target="_top">turorials</a>
  662:      are readily available.  You may also want to browse Andrew Roberts'
  663:      <a href="http://www.andy-roberts.net/misc/latex/latextutorial9.html"
  664:      target="_top">Latex&nbsp;Math&nbsp;I</a> and
  665:      <a href="http://www.andy-roberts.net/misc/latex/latextutorial10.html"
  666:      target="_top">Latex&nbsp;Math&nbsp;II</a>, or my own
  667:      <a href="http://www.forkosh.com/mimetextutorial.html" target="_top">
  668:      LaTeX&nbsp;math&nbsp;tutorial</a>.
  669:      Then, instead of continuing to read this page, you can <!-- may prefer
  670:      to play with mimeTeX yourself.  In that case, --> just Submit any LaTeX
  671:      math expression you like in the Query Box below.  I've started
  672:      you out with a little example already in the box, or <!-- , instead, -->
  673:      you can Click any of the <a href="#examples">Examples</a> below
  674:      to place that corresponding expression in the Query Box. </p>
  675: 
  676:  <p> Meanwhile, here are just a few quickstart tips for Submitting
  677:      your own mimeTeX expressions in the Query Box below: </p>
  678:      <ul>
  679:       <li> MimeTeX currently has eight font sizes selected by
  680:            one of the usual directives &nbsp; <b>\tiny</b>
  681:            or <b>\small</b> or <b>\normalsize</b>&nbsp;,
  682:            or <b>\large</b>&nbsp;(default) or <b>\Large</b>
  683:            or <b>\LARGE</b>&nbsp;, or <b>\huge</b> or <b>\Huge</b>&nbsp;.
  684:            &nbsp; &nbsp;  Unlike standard LaTeX, font size directives may
  685:            appear within math&nbsp;mode expressions.  They affect everything
  686:            to their right, except that their scope will be limited to any
  687:            <b>{&nbsp;}</b>-enclosed subexpression in which they occur.
  688:            For example, &nbsp; "<b>a+\small&nbsp;b+c</b>"
  689:            &nbsp; renders &nbsp;
  690:            <a href="#preview"> <img id="imageBu" onclick="eqntext('imageBu')"
  691:            src="../cgi-bin/mimetex.cgi?\large a+\small b+c"
  692:            alt="" border=0 style="Vertical-Align:-2px"></a>, &nbsp;
  693:            whereas &nbsp; "<b>\small&nbsp;a+{\Large&nbsp;b+}c</b>" &nbsp;
  694:            renders &nbsp;
  695:            <a href="#preview"> <img id="imageBv" onclick="eqntext('imageBv')"
  696:            src="../cgi-bin/mimetex.cgi?\small a+{\Large b+}c"
  697:            alt="" border=0 style="Vertical-Align:-2px"></a>. </li>
  698: <!--  <li> At smaller font sizes, try preceding your expression with &nbsp;
  699:            <b>\light</b> &nbsp; which adjusts mimeTeX's anti-aliasing
  700:            parameters to produce thinner lines that you may feel are
  701:            more legible, e.g.,<br> &nbsp; &nbsp;
  702:            <a href="#preview"><img id="imageIA1" onclick="eqntext('imageIA1')"
  703:            src="../cgi-bin/mimetex.cgi?\light\small\displaystyle
  704:            e^x=\sum_{n=0}^\infty\frac{x^n}{n!}" alt="" border=0
  705:            align=middle> </a>  &nbsp versus &nbsp;
  706:            <a href="#preview"><img id="imageIA2" onclick="eqntext('imageIA2')"
  707:            src="../cgi-bin/mimetex.cgi?\small\displaystyle
  708:            e^x=\sum_{n=0}^\infty\frac{x^n}{n!}" alt="" border=0
  709:            align=middle> </a> </li> -->
  710:       <li> <!-- For displaystyle math mode limits illustrated above,
  711:            write either &nbsp;
  712:            <b>\displaystyle&nbsp;e^x=\sum_{n=0}^\infty\frac{x^n}{n!}</b>
  713:            &nbsp; or &nbsp; <b>e^x=\sum\limits_{n=0}^\infty\frac{x^n}{n!}</b>
  714:            &nbsp; in the usual way (ditto for <b>\int</b>, <b>\prod</b>,
  715:            <b>\cup</b>, <b>\cap</b>, etc). -->  <!-- MimeTeX also recognizes
  716:            <b>\Bigint</b>, <b>\Bigsum</b>, <b>\Bigprod</b>, and several
  717:            similar extra symbols which are a little bigger, and which
  718:            automatically render displaystyle limits. -->
  719:            <!-- MimeTeX default-renders limits displaystyle at sizes
  720:            <b>\large</b> and larger (see the <b>-DDISPLAYSIZE=<i>n</i></b>
  721:            <a href="#options">compile&nbsp;option</a> below to change the
  722:            default). &nbsp; <b>\textstyle</b> overrides this default for
  723:            your entire expression, or <b>\nolimits</b> overrides it
  724:            for a single operator. -->
  725:            By default, mimeTeX renders limits textstyle &nbsp;
  726:            <a href="#preview"> <img id="imageB1" onclick="eqntext('imageB1')"
  727:            src="../cgi-bin/mimetex.cgi?\normalsize\textstyle
  728:            \sum_{n=0}^\infty\frac{x^n}{n!}" alt="" border=0
  729:            style="Vertical-Align:-5px"></a> &nbsp;
  730:            at sizes <b>\normalsize</b> and smaller,
  731:            and renders them displaystyle &nbsp;
  732:            <a href="#preview"> <img id="imageB2" onclick="eqntext('imageB2')"
  733:            src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
  734:            \sum_{n=0}^\infty\frac{x^n}{n!}" alt="" border=0
  735:            style="Vertical-Align:-15px"></a> &nbsp;
  736:            at sizes <b>\large</b> and larger.
  737:            The LaTeX directives <b>\displaystyle</b> or <b>\textstyle</b>,
  738:            and <b>\limits</b> or <b>\nolimits</b>, override mimeTeX's default
  739:            in the usual way.  Or see the <b>-DDISPLAYSIZE=<i>n</i></b>
  740:            <a href="#options">compile&nbsp;option</a> below to change
  741:            the default. </li>
  742:      </ul>
  743:  <p> <a name="forminput"> </a> <a name="preview"> </a>
  744:      Now enter your own LaTeX expression, use the sample provided,
  745:      or Click any of the <a href="#examples">Examples</a>.
  746:      Then press the Submit button, and mimeTeX's rendering should be
  747:      displayed in the little window immediately below it. </p>
  748:      <center>
  749:       <table border="2" cellpadding="5" cellspacing="0">
  750:        <tr align="center"><td>
  751:          <form name="expression" action="../cgi-bin/mimetex.cgi"
  752:          method="get" target="inlineframe">
  753:            <table border="0" cellpadding="0" cellspacing="1">
  754:              <tr align="left"><td align="center">
  755:                 <b>First enter your own LaTeX expression,
  756:                  or Click any example...</b> <br>
  757:                <textarea name="formdata" rows="5" cols="72"
  758:                 >\Large f(x)=\int_{-\infty}^x e^{-t^2}dt</textarea> <br>
  759:              </td></tr>
  760:              <tr align="center"><td>
  761:                <font size="-1"> <input type="button" onClick="cleartext()"
  762:                value="Clear Expression"> &nbsp; &nbsp;
  763:                &nbsp; <input type="submit" value="Submit Expression"> </font>
  764:              </td></tr>
  765:            </table>
  766:          </form> </td></tr>  <tr align="left"><td align="center">
  767:          <b>Now click Submit to see it rendered below...</b> <br>
  768:          <iframe name="inlineframe" align="middle" width="85%" height="110">
  769:          &lt;p&gt;iframe's not supported if you see this.&lt;/p&gt; 
  770:          </iframe>
  771:        </td></tr>
  772:       </table>
  773:      </center>
  774:  <p> You should see &nbsp;
  775:      <a href="#preview"><img id="imageIA3" onclick="eqntext('imageIA3')"
  776:      src="../cgi-bin/mimetex.cgi?\normalsize
  777:      f(x)=\int\limits_{-\infty}^x e^{-t^2}dt"
  778:      alt="" border=0 style="Vertical-Align:-11px"></a> &nbsp;
  779:      if you submit the sample expression already in the box. </p>
  780: 
  781:  <p> And the &lt;img&gt; tag to embed this same integral anywhere
  782:      in your own document is </p>
  783: <pre> &lt;img&nbsp;src="../cgi-bin/mimetex.cgi?\large f(x)=\int_{-\infty}^xe^{-t^2}dt"
  784:   alt="" border=0 align=middle&gt;</pre>
  785: 
  786:  <p> <!-- You can see numerous additional examples illustrating html
  787:      &lt;img&gt; tags using mimeTeX by viewing this page's source. -->
  788:      The typical mimeTeX &lt;img&gt; tag has the form </p>
  789: <pre> &lt;img&nbsp;src="../cgi-bin/mimetex.cgi?any valid LaTeX/mimeTeX expression"
  790:   alt="" border=0 align=middle&gt;</pre> <p class="continue">
  791:      where <b>../cgi-bin/mimetex.cgi</b> is the relative path from your html
  792:      page containing these tags to your compiled mimetex.cgi program, and
  793:      where <b>any&nbsp;valid&nbsp;LaTeX/mimeTeX&nbsp;expression</b>
  794:      is pretty much any valid LaTeX math expression: </p> <ul>
  795:      <!-- <li> As discussed in the <a href="#introduction">Introduction</a>,
  796:             you can replace cumbersome &lt;img&gt; tags with your own custom
  797:             tags or wrapper scripts. </li> -->
  798:        <li> <!-- And --> There are occasional exceptions where I couldn't
  799:             program mimeTeX to recognize valid LaTeX syntax.
  800:             One particular "gotcha" is that mimeTeX bindings
  801:             are pretty much left-to-right.  Thus, for example, although
  802:             mimeTeX correctly interprets <b>\frac12</b> as well as
  803:             <b>\frac1{x^2}</b>, etc, the legal LaTeX expression
  804:             <b>x^\frac12</b> must be written <b>x^{\frac12}</b>.
  805:             Otherwise, mimeTeX interprets it as <b>{x^\frac}12</b>, i.e.,
  806:             the same way <b>x^\alpha12</b> would be interpreted, which is
  807:             nonsense for <b>\frac</b>.  The same "gotcha" also applies to
  808:             other combinations of commands, e.g., you must write
  809:             <b>\sqrt{\frac\alpha\beta}</b>, or
  810:             <b>\frac\alpha{\sqrt\beta}</b>, etc.
  811:             The <a href="#reference">Syntax&nbsp;Reference</a> section
  812:             contains much additional information.  <!-- Or you can just begin
  813:             playing with mimeTeX for yourself to see if it might have
  814:             any potential usefulness for you. --> </li>
  815:        <li> Besides such exceptions, mimeTeX
  816:             also provides various LaTeX extensions. <!-- , i.e., LaTeX errors
  817:             permitted by mimetex. -->  For example, font size
  818:             directives like <b>\Large</b> are permitted within mimeTeX
  819:             math&nbsp;mode expressions, but flagged as errors by LaTeX.
  820:             <!-- But note well: if you take advantage of mimeTeX extensions,
  821:             your math&nbsp;mode expressions will no longer be accepted by
  822:             standard TeX engines. --> </li> </ul>
  823: 
  824: 
  825: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  826: EXAMPLES
  827: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
  828: <h2> <a name="examples"> (Ib) Examples &nbsp; </a> </h2>
  829: 
  830:  <p> Here are various additional random examples further demonstrating
  831:      mimeTeX's features and usage.  To see how they're done, Click any
  832:      one of them to place its corresponding expression in the
  833:      <a href="#preview">Query&nbsp;Box</a> above.  Then press Submit
  834:      to re-render it, or you can edit the expression first to suit
  835:      your own purposes. </p>
  836: 
  837: <table cellspacing=15>
  838: <!-- first example: taylor series for e^x at various font sizes and colors
  839: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
  840:  <tr>
  841:   <td>
  842:     <font size=5><a name="example1">(1)</a></font> &nbsp;&nbsp;&nbsp; </td>
  843:   <td align="left" colspan=4>
  844:     <a href="#preview">
  845:       <img id="example1a" onclick="eqntext('example1a')"
  846:       src="../cgi-bin/mimetex.cgi?\red\normalsize\displaystyle
  847:       e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
  848:       alt="" border=0 align=middle></a> &nbsp &nbsp
  849:     <a href="#preview">
  850:       <img id="example1b" onclick="eqntext('example1b')"
  851:       src="../cgi-bin/mimetex.cgi?\green\large\displaystyle
  852:       e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
  853:       alt="" border=0 align=middle></a> &nbsp &nbsp
  854:     <a href="#preview">
  855:       <img id="example1c" onclick="eqntext('example1c')"
  856:       src="../cgi-bin/mimetex.cgi?\blue\Large
  857:       e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
  858:       alt="" border=0 align=middle></a> &nbsp &nbsp
  859:     <a href="#preview">
  860:       <img id="example1d" onclick="eqntext('example1d')"
  861:       src="../cgi-bin/mimetex.cgi?\reverse\opaque
  862:       \LARGE e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
  863:       alt="" border=0 align=middle></a> &nbsp &nbsp
  864:     <a href="#preview">
  865:       <img id="example1e" onclick="eqntext('example1e')"
  866:       src="../cgi-bin/mimetex.cgi?\LARGE
  867:       e^x=\lim_{n\to\infty} \left(1+\frac xn\right)^n"
  868:       alt="" border=0 align=middle></a>
  869:   </td>
  870:  </tr>
  871: 
  872: <!-- second example
  873: +++++++++++++++++++ -->
  874:  <tr>
  875:   <td>
  876:     <font size=5>(2)</font> </td>
  877:   <td align="left" colspan=4>
  878:     <a href="#preview">
  879:     <img id="example2" onclick="eqntext('example2')"
  880:     src="../cgi-bin/mimetex.cgi?\Large\frac{dv^m}{ds}=-\Gamma^m_{oo}v^{o^2}
  881:     =-g^{mn}\Gamma_{noo}v^{o^2}=\frac12g^{mn}g_{oo,n}v^{o^2}"
  882:     alt="" border=0 align=middle></a> </td>
  883:  </tr>
  884: 
  885: <!-- third example
  886: ++++++++++++++++++ -->
  887:  <tr>
  888:   <td>
  889:     <font size=5>(3)</font> </td>
  890:   <td align="left" colspan=4>
  891:     <a href="#preview">
  892:     <img id="example3" onclick="eqntext('example3')"
  893:     src="../cgi-bin/mimetex.cgi?\Large\varepsilon=\sum_{i=1}^{n-1}
  894:     \frac1{\Delta x}\int_{x_i}^{x_{i+1}}\left\{\frac1{\Delta x}\big[
  895:     (x_{i+1}-x)y_i^\ast+(x-x_i)y_{i+1}^\ast\big]-f(x)\right\}^2dx"
  896:     alt="" border=0 align=middle></a> </td>
  897:  </tr>
  898: 
  899: <!-- fourth example: solution to quadratic, definition of derivative
  900: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
  901:  <tr>
  902:   <td>
  903:     <font size=5>(4)</font> </td>
  904:   <td align="left" colspan=4>
  905:     <table>
  906:       <tr>
  907:        <td align="left">
  908:          <a href="#preview">
  909:          <img id="example4a" onclick="eqntext('example4a')"
  910:          src="../cgi-bin/mimetex.cgi?\LARGE x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}"
  911:          alt="" border=0 align=middle></a> </td>
  912:        <td>
  913:          solution for quadratic </td>
  914:       </tr>
  915:       <tr> <td> <br> </td> </tr>
  916:       <tr>
  917:        <td align="left">
  918:          <a href="#preview">
  919:          <img id="example4b" onclick="eqntext('example4b')"
  920:          src="../cgi-bin/mimetex.cgi?\large f^\prime(x)\ =
  921:          \lim_{\Delta x\to0}\frac{f(x+\Delta x)-f(x)}{\Delta x}"
  922:          alt="" border=0 align=middle></a> </td>
  923:        <td>
  924:          definition of derivative </td>
  925:       </tr>
  926:     </table> </td>
  927:  </tr>
  928: 
  929: <!-- fifth example:  continued fraction
  930: +++++++++++++++++++++++++++++++++++++++ -->
  931:  <tr>
  932:   <td>
  933:     <font size=5>(5)</font> </td>
  934:   <td align="left">
  935:     <a href="#preview">
  936:     <img id="example5" onclick="eqntext('example5')"
  937:     src="../cgi-bin/mimetex.cgi?\LARGE f=b_o+\frac{a_1}{b_1+
  938:     \frac{a_2}{b_2+\frac{a_3}{b_3+a_4}}}"
  939:     alt="" border=0 align=middle></a> </td>
  940:   <td>
  941:     illustrating <b>\frac{}{}</b> for continued fraction </td>
  942:  </tr>
  943: 
  944: <!-- sixth example:  demonstrating  \left\{ ... \right.
  945: +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
  946:  <tr>
  947:   <td>
  948:     <font size=5>(6)</font> </td>
  949:   <td align="left">
  950:     <a href="#preview">
  951:     <img id="example6" onclick="eqntext('example6')"
  952:     src="../cgi-bin/mimetex.cgi?\LARGE\tilde y=\left\{
  953:     {\ddot x\text{ if \vec x odd}\atop\hat{\,\bar x+1}\text{ if even}}\right."
  954:     alt="" border=0 align=middle></a> </td>
  955:   <td>
  956:     illustrating <b>\left\{...\right<font size=5>.</font></b>
  957:     <!-- we may write <b>\{...\.</b> --> <br>
  958:     and note the accents </td>
  959:  </tr>
  960: 
  961: <!-- seventh example:  demonstrating \overbrace \underbrace
  962: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
  963:  <tr>
  964:   <td>
  965:     <font size=5>(7)</font> </td>
  966:   <td align="center">
  967:     <a href="#preview">
  968:     <img id="example7" onclick="eqntext('example7')"
  969:     src="../cgi-bin/mimetex.cgi?\Large\overbrace{a,...,a}^{\text{k a^,s}},
  970:     \underbrace{b,...,b}_{\text{l b^,s}}\hspace{10}
  971:     \large\underbrace{\overbrace{a...a}^{\text{k a^,s}},
  972:     \overbrace{b...b}^{\text{l b^,s}}}_{\text{k+l elements}}"
  973:     alt="" border=0 align=middle></a> </td>
  974:   <td>
  975:     <b>\overbrace{}^{}</b> and <b>\underbrace{}_{}</b> <br>
  976:     (TeXbook page 181, Exercise 18.41) </td>
  977:  </tr>
  978: 
  979: <!-- eighth example:  demonstrating \begin{array}
  980: +++++++++++++++++++++++++++++++++++++++++++++++++ -->
  981:  <tr>
  982:   <td>
  983:     <font size=5>(8)</font> </td>
  984:   <td align="left" colspan=3>
  985:     <table>
  986:       <tr>
  987:         <td align="left" colspan=2>
  988:          <a href="#preview">
  989:          <img id="example8a" onclick="eqntext('example8a')"
  990:          src="../cgi-bin/mimetex.cgi?\Large\scr{J}^{i0}=+\frac i2
  991:          \left[\begin{array}{cc}\sigma_i&0\\0&-\sigma_i\end{array}\right]
  992:          \hspace{10}\scr{J}^{ij}=\frac12\varepsilon_{ijk}
  993:          \left[\begin{array}{cc}\sigma_k&0\\0&\sigma_k\end{array}\right]"
  994:          alt="" border=0 align=middle> </a> </td>
  995:       </tr>
  996:       <tr> <td> <br> </td> </tr>
  997:       <tr>
  998:         <td align="left">
  999:          <a href="#preview">
 1000:          <img id="example8b" onclick="eqntext('example8b')"
 1001:          src="../cgi-bin/mimetex.cgi?\Large A\ =\ \large\left(
 1002:          \begin{array}{c.cccc}&1&2&\cdots&n\\
 1003:          \hdash1&a_{11}&a_{12}&\cdots&a_{1n}\\
 1004:          2&a_{21}&a_{22}&\cdots&a_{2n}\\
 1005:          \vdots&\vdots&\vdots&\ddots&\vdots\\
 1006:          n&a_{n1}&a_{n2}&\cdots&a_{nn}\end{array}\right)"
 1007:          alt="" border=0 align=middle></a> </td>
 1008:         <td>
 1009:          demonstrating <a href="#array">\begin{array}</a>'s dashed lines </td>
 1010:       </tr>
 1011:     </table> </td>
 1012:  </tr>
 1013: 
 1014: <!-- ninth example: block diagonal form using nested arrays
 1015: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
 1016:  <tr>
 1017:   <td>
 1018:     <font size=5><a name="example9">(9)</a></font> </td>
 1019:         <td align="left" colspan="2">
 1020:          <a href="#preview">
 1021:          <img id="example9c" onclick="eqntext('example9c')"
 1022:          src="../cgi-bin/mimetex.cgi?\normalsize
 1023:          \left(\large\begin{array}{GC+23}
 1024:          \varepsilon_x\\\varepsilon_y\\\varepsilon_z\\\gamma_{xy}\\
 1025:          \gamma_{xz}\\\gamma_{yz}\end{array}\right)\ {\Large=}
 1026:          \ \left[\begin{array}{CC}
 1027:          \begin{array}\frac1{E_{\fs{+1}x}}
 1028:          &-\frac{\nu_{xy}}{E_{\fs{+1}x}}
 1029:          &-\frac{\nu_{\fs{+1}xz}}{E_{\fs{+1}x}}\\
 1030:          -\frac{\nu_{yx}}{E_y}&\frac1{E_{y}}&-\frac{\nu_{yz}}{E_y}\\
 1031:          -\frac{\nu_{\fs{+1}zx}}{E_{\fs{+1}z}}&
 1032:          -\frac{\nu_{zy}}{E_{\fs{+1}z}}
 1033:          &\frac1{E_{\fs{+1}z}}\end{array} & {\LARGE 0} \\
 1034:          {\LARGE 0} & \begin{array}\frac1{G_{xy}}&&\\
 1035:          &\frac1{G_{\fs{+1}xz}}&\\&&\frac1{G_{yz}}\end{array}
 1036:          \end{array}\right]
 1037:          \ \left(\large\begin{array}
 1038:          \sigma_x\\\sigma_y\\\sigma_z\\\tau_{xy}\\\tau_{xz}\\\tau_{yz}
 1039:          \end{array}\right)"
 1040:          alt="" border=0 align=middle></a> </td>
 1041:         <td align="left">
 1042:          Block diagonal form using nested <b>\begin{array}</b>'s.<br>
 1043:          Also, note rows aligned across all three arrays.
 1044:         </td>
 1045:  </tr>
 1046: 
 1047: <!-- tenth example:  demonstrating \begin{eqnarray} to align equations
 1048: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
 1049:  <tr>
 1050:   <td>
 1051:     <font size=5>(10)</font> </td>
 1052:   <td align="center">
 1053:     <a href="#preview">
 1054:     <img id="example10" onclick="eqntext('example10')"
 1055:     src="../cgi-bin/mimetex.cgi?\Large\left.\begin{eqnarray}
 1056:     x+y+z&=&3\\2y&=&x+z\\2x+y&=&z\end{eqnarray}\right\}"
 1057:     alt="" border=0 align=middle></a> </td>
 1058:   <td>
 1059:     using <a href="#array">\begin{eqnarray}</a> to align equations </td>
 1060:  </tr>
 1061: 
 1062: <!-- eleventh example:  demonstrating commutative diagram
 1063: using \longxxxarrow[] and \begin{array}
 1064: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
 1065:  <tr>
 1066:   <td>
 1067:     <font size=5>(11)</font> </td>
 1068:   <td align="center">
 1069:     <a href="#preview">
 1070:     <img id="example11" onclick="eqntext('example11')"
 1071:     src="../cgi-bin/mimetex.cgi?\Large\begin{array}{rccclBCB}
 1072:     &f&\longrightarrow[75]^{\alpha:{\normalsize f\rightarrow g}}&g\\
 1073:     \large\gamma&\longdownarrow[50]&&\longdownarrow[50]&\large\gamma\\
 1074:     &u&\longrightarrow[75]_\beta&v\end{array}"
 1075:     alt="" border=0 align=middle></a> </td>
 1076:   <td>
 1077:     commutative diagram using <a href="#array">\begin{array}</a> </td>
 1078:  </tr>
 1079: 
 1080: <!-- twelfth example:  demonstrating \picture
 1081: +++++++++++++++++++++++++++++++++++++++++++++ -->
 1082:  <tr>
 1083:   <td>
 1084:     <font size=5>(12)</font> </td>
 1085:   <td align="left">
 1086:     <a href="#preview">
 1087:     <img id="example12" onclick="eqntext('example12')"
 1088:     src="../cgi-bin/mimetex.cgi?\Large\hspace{5}\unitlength{1}
 1089:     \picture(175,100){ (50,50){\circle(100)}
 1090:     (1,50){\overbrace{\line(46)}^{4$\;\;a}}
 1091:     (52,50){\line(125)} (50,52;115;2){\mid} (52,55){\longleftar[60]}
 1092:     (130,56){\longrightar[35]} (116,58){r} (c85,50;80;2){\bullet}
 1093:     (c85,36){\large-q} (c165,36){\large q}
 1094:     (42,29){\underbrace{\line(32)}_{\small a^2/r\;\;\;}} }"
 1095:     alt="" border=0 align=middle></a> </td>
 1096:   <td valign="middle">
 1097:     mimeTeX <a href="#picture">\picture(size){pic_elems}</a>
 1098:     "environment", illustrating the image charge <b>- q</b>
 1099:     for a grounded conducting sphere of radius <b>a</b> with
 1100:     a charge <b>q</b> at distance <b>r &gt; a</b> outside it. </td>
 1101:  </tr>
 1102: 
 1103: <!-- thirteenth example:  demonstrating \picture
 1104: +++++++++++++++++++++++++++++++++++++++++++++++++ -->
 1105:  <tr>
 1106:   <td>
 1107:     <font size=5>(13)</font> </td>
 1108:   <td align="left">
 1109:     <a href="#preview">
 1110:     <img id="example13" onclick="eqntext('example13')"
 1111:     src="../cgi-bin/mimetex.cgi?\small\hspace{10}\unitlength{.75}
 1112:     \picture(120,220){ (60,200){\circle(120,40)} (0,20){\line(0,180)}
 1113:     (5,189;0,-30){\pict(110,20){(c20,10;70;2){
 1114:     \pict(40,20){(20,10){\circle(40,20)}(c10,10)+(c30,10)-}} } }
 1115:     (119,20){\line(0,180)} (60,20){\circle(120,40;34)}}"
 1116:     alt="" border=0 align=middle></a> </td>
 1117:   <td valign="middle"> <a href="#picture">\picture</a> "environment"
 1118:     illustrating the surface polarization charge induced by a uniform
 1119:     electric field. Inside the slab of material, the volume polarization
 1120:     charge clearly vanishes. <br><br>  The little
 1121:     <img src="../cgi-bin/mimetex.cgi?\small\unitlength{.75} \pict(40,20){(20,10)
 1122:     {\circle(40,20)}(c10,10)+(c30,10)-}" alt="" border=0 align=middle>
 1123:     dipole image is drawn only once, then multiput across two columns, and
 1124:     then that result is further multiput down the rows. MimeTeX \picture's
 1125:     can be used as picture elements in other pictures, nested to any level.
 1126:     The image at left is picture-in-picture-in-picture. </td>
 1127:   </tr>
 1128: </table>
 1129: <br><br>
 1130: 
 1131: <!-- font examples
 1132: ++++++++++++++++++ -->
 1133: <h3> Some font examples <font size=5>...</font></a> </h3>
 1134:  <p> Finally, illustrated below are some examples of fonts and symbols
 1135:      available with mimeTeX.  All symbols and sizes from cmr, cmmi,
 1136:      cmmib (use <b>\mathbf{&nbsp;}</b>), cmsy, cmex, bbold (use
 1137:      <b>\mathbb{&nbsp;}</b>), rsfs (use <b>\mathscr{&nbsp;}</b>),
 1138:      stmary and cyrillic wncyr (use <b>{\cyr&nbsp;&nbsp;}</b> or
 1139:      <b>\cyr{&nbsp;}</b>) should be available, but they're not all shown.
 1140:      And also not shown are various "constructed symbols" like \sqrt,
 1141:      accents, etc.  The illustrated font sizes are numbered 4=\Large,
 1142:      3=\large and 2=\normalsize (not shown are 7=\Huge, 6=\huge,
 1143:      5=\LARGE, 1=\small and 0=\tiny). </p>
 1144: 
 1145: <h3>cmmi latin uppercase, and lowercase</h3>
 1146: <p> <img src="../cgi-bin/mimetex.cgi?\array{r$
 1147: 2$\rm~size~4:~&4$A&4$B&4$C&4$D,&4$a&4$b&4$c&4$d\\
 1148: 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\\
 1149: 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,&
 1150: 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}"
 1151: alt="" border=0 align=middle> </p>
 1152: 
 1153: <h3>calligraphic, and rsfs (<b>\cal{A}, \scr{B}, etc</b>)</h3>
 1154: <p> <img src="../cgi-bin/mimetex.cgi?\array{r$
 1155: 2$\rm~size~4:~&4$\calA&4$\calB&4$\calC&4$\calD&4$\calE&4$\calF&4$\calG,&
 1156: 4$\scrA&4$\scrB&4$\scrC&4$\scrD&4$\scrE&4$\scrF&4$\scrG\\
 1157: 2$\rm~3:~&3$\calH&3$\calI&3$\calJ&3$\calK&3$\calL&3$\calM&3$\calN&3$\calO&
 1158: 3$\calP,&
 1159: 3$\scrH&3$\scrI&3$\scrJ&3$\scrK&3$\scrL&3$\scrM&3$\scrN&3$\scrO&3$\scrP\\
 1160: 2$\rm~2:~&2$\calQ&2$\calR&2$\calS&2$\calT&2$\calU&
 1161: 2$\calV&2$\calW&2$\calX&2$\calY&2$\calZ,&
 1162: 2$\scrQ&2$\scrR&2$\scrS&2$\scrT&2$\scrU&2$\scrV&2$\scrW&
 1163: 2$\scrX&2$\scrY&2$\scrZ}"
 1164: alt="" border=0 align=middle> </p>
 1165: 
 1166: <h3>cmmi greek uppercase, and \var lowercase</h3>
 1167: <p> <img src="../cgi-bin/mimetex.cgi?\array{r$
 1168: 2$\rm~size~4:~&4$\Gamma&4$\Delta&4$\Theta&4$\Lambda&4$\Xi&4$\Pi&4$\Sigma&
 1169: 4$\Upsilon&4$\Phi&4$\Psi&4$\Omega,&4$\rm~~&4$\varepsilon&4$\vartheta&4$\varpi&
 1170: 4$\varrho&4$\varsigma&4$\varphi\\
 1171: 2$\rm~3:~&3$\Gamma&3$\Delta&3$\Theta&3$\Lambda&3$\Xi&3$\Pi&3$\Sigma&
 1172: 3$\Upsilon&3$\Phi&3$\Psi&3$\Omega,&~&3$\varepsilon&3$\vartheta&3$\varpi&
 1173: 3$\varrho&3$\varsigma&3$\varphi\\
 1174: 2$\rm~2:~&2$\Gamma&2$\Delta&2$\Theta&2$\Lambda&2$\Xi&2$\Pi&2$\Sigma&
 1175: 2$\Upsilon&2$\Phi&2$\Psi&2$\Omega,&~&2$\varepsilon&2$\vartheta&2$\varpi&
 1176: 2$\varrho&2$\varsigma&2$\varphi}"
 1177: alt="" border=0 align=middle> </p>
 1178: 
 1179: <h3>cmmi greek lowercase</h3>
 1180: <p> <img src="../cgi-bin/mimetex.cgi?\array{r$
 1181: 2$\rm~size~4:~&4$\alpha&4$\beta&4$\gamma&4$\delta&4$\epsilon&4$\zeta&
 1182: 4$\eta&4$\theta&4$\iota&4$\kappa&4$\lambda&4$\mu&4$\nu&4$\xi&4$%%\omicron%%&
 1183: 4$\pi&4$\rho&4$\sigma&4$\tau&4$\upsilon&4$\phi&4$\chi&4$\psi&4$\omega\\
 1184: 2$\rm~3:~&3$\alpha&3$\beta&3$\gamma&3$\delta&3$\epsilon&3$\zeta&
 1185: 3$\eta&3$\theta&3$\iota&3$\kappa&3$\lambda&3$\mu&3$\nu&3$\xi&3$%%\omicron%%&
 1186: 3$\pi&3$\rho&3$\sigma&3$\tau&3$\upsilon&3$\phi&3$\chi&3$\psi&3$\omega\\
 1187: 2$\rm~2:~&2$\alpha&2$\beta&2$\gamma&2$\delta&2$\epsilon&2$\zeta&
 1188: 2$\eta&2$\theta&2$\iota&2$\kappa&2$\lambda&2$\mu&2$\nu&2$\xi&2$%%\omicron%%&
 1189: 2$\pi&2$\rho&2$\sigma&2$\tau&2$\upsilon&2$\phi&2$\chi&2$\psi&2$\omega}"
 1190: alt="" border=0 align=middle> </p>
 1191: 
 1192: <h3>cmsy symbols at mimeTeX font size 3<br>
 1193: <font size="3">(operators shown large are automatically "promoted"<br>
 1194: to the larger size in \displaystyle mode)</font> </h3>
 1195: <p> <img src="../cgi-bin/mimetex.cgi?\array{3,r$1$\rm~chars~\\
 1196: 1$\rm~0-15:~&-&\cdot&\times&\ast&\div&\diamond&\pm&\mp&
 1197: \oplus&\ominus&\otimes&\oslash&\odot&\bigcirc&\circ&\bullet\\
 1198: 1$\rm~16-31:~&\asymp&\equiv&\subseteq&\supseteq&\leq&\geq&\preceq&\succeq&
 1199: \sim&\approx&\subset&\supset&\ll&\gg&\prec&\succ\\
 1200: 1$\rm~32-47:~&\leftar&\rightar&\uparr&\downar&\leftrightar&\near&\sear&
 1201: \simeq&\Leftar&\Rightar&\Upar&\Downar&\Leftrightar&\nwar&\swar&\propto\\
 1202: 1$\rm~48-63:~&\prime&\infty&\in&\ni&\triangle&\bigtriangledo&/&\'&
 1203: \forall&\exists&\neg&\emptyset&\Re&\Im&\top&\bot\\
 1204: 1$\rm~64-100:~&\aleph&&\calA&4$.\,.\,.&\calZ&&\cup&\cap&
 1205: \uplus&\wedge&\vee&\vdash&\dashv&\lfloor&\rfloor&\lceil\\
 1206: 1$\rm~101-116:~&\rceil&\lbrace&\rbrace&\langle&\rangle&\mid&\parallel&
 1207: \updownar&\Updownar&\setminus&\wr&\surd&\amalg&\nabla&\int&\sqcup\\
 1208: 1$\rm~117-127:~&\sqcap&\sqsubseteq&\sqsupseteq&\S&\dag&\ddag&\P&\clubsuit&
 1209: \Diamond&\Heart&\spadesuit}" alt="" border=0 align=middle> </p>
 1210: 
 1211: <h3>a few other cmmi, cmr, stmary and wncyr symbols
 1212: at mimeTeX font size 4</h3>
 1213: <p> <img src="../cgi-bin/mimetex.cgi?\array{4,r$
 1214: 1$\rm~cmmi:~&\leftharpoonup&\leftharpoondo&\rightharpoonup&\rightharpoondo&
 1215: \triangleright&\triangleleft&\star&\partial&
 1216: \flat&\natural&\sharp&\smile&\frown&\ell&\imath&\jmath&\wp&\vec\\
 1217: 1$\rm~cmr:~&\ss&\ae&\oe&\AE&\OE \\
 1218: 1$\rm~stmary:~&\moo&\Lbag&\Rbag&\lightning&\llbracket&\rrbracket&
 1219: \subsetpluseq&\supsetpluseq&\Yup&\Ydown\\
 1220: 1$\rm~wncyr:~&\cyr A&\cyr a&\cyr B&\cyr b&\cyr V&\cyr v&\cyr G&\cyr g&
 1221: \cyr D&\cyr d&\cyr Dj&\cyr dj&\cyr\=E&\cyr\=e&\cyr Zh&\cyr zh}"
 1222: alt="" border=0 align=middle> </p>
 1223: 
 1224: 
 1225: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1226: GPL
 1227: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
 1228: <h2> <a name="gpl"> (Ic) GPL License &nbsp; </a> </h2>
 1229: 
 1230: <font color="black">
 1231: <b>&quot</b><i>My grandfather once told me there are two kinds of people:<br>
 1232: &nbsp &nbsp Those who do the work and those who take the credit.<br>
 1233: &nbsp &nbsp He told me to try to be in the first group; there was much
 1234: less competition.</i><b>&quot</b><br>
 1235: Indira Gandhi, the late Prime Minister of India</font> <br>
 1236: 
 1237:  <p> MimeTeX's copyright is registered by me with the US Copyright Office,
 1238:      and I hereby license it to you under the terms and conditions of the
 1239:      <a href="http://www.gnu.org/licenses/gpl.html" target="_top">GPL</a>.
 1240:      There is no official support of any kind whatsoever,
 1241:      and you use mimeTeX entirely at your own risk, with no guarantee
 1242:      of any kind, in particular with no warranty of merchantability. </p>
 1243: 
 1244:  <p> By using mimeTeX, you warrant that you have read, understood
 1245:      and agreed to these terms and conditions, and that you <!-- are at least
 1246:      18 years of age and --> possess the legal right and ability to enter
 1247:      into this agreement and to use mimeTeX in accordance with it. </p>
 1248: 
 1249:  <p> Hopefully, the law and ethics regarding computer programs will
 1250:      evolve to make this kind of obnoxious banter unnecessary.
 1251:      In the meantime, please forgive me my paranoia. </p>
 1252: 
 1253:  <p> To protect your own intellectual property, I recommend
 1254:      <a href="http://lcweb.loc.gov/copyright/circs/circ1.html"
 1255:      target="_top">Copyright&nbsp;Basics</a> from The Library of Congress,
 1256:      in particular <a href="http://www.copyright.gov/circs/circ61.html"
 1257:      target="_top">Circular&nbsp;61</a>, Copyright Registration for
 1258:      Computer Programs.
 1259:      <!-- and similarly,
 1260:      <a href="http://www.abanet.org/intelprop/comm106/106copy.html"
 1261:      target="_top">Copyright Basics</a> from The American Bar Association. -->
 1262:      Very briefly, download
 1263:      <a href="http://www.copyright.gov/forms/formtxi.pdf">Form&nbsp;TX</a>
 1264:      and follow the included instructions.
 1265:      In principle, you automatically own the copyright
 1266:      to anything you write the moment it's on paper.  In practice,
 1267:      if the matter comes under dispute, the courts look _very_ favorably
 1268:      on you for demonstrating your intent by registering the copyright.
 1269:      For example, courts will stop unauthorized use of unregistered
 1270:      material, but monetary damages are awarded _only_ if you
 1271:      register the copyright before infringement occurs. </p>
 1272: 
 1273: 
 1274: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1275: SECTION II.  BUILDING MIMETEX
 1276: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
 1277: <h1> <a name="build"> (II) Building mimeTeX &nbsp; </a> </h1>
 1278: 
 1279: <!-- <center> -->
 1280:     <table border="0" cellpadding="0" cellspacing="0">
 1281:       <tr><td><center><hr size="2">Very quickly &nbsp; --- &nbsp; download
 1282:         <a href="http://www.forkosh.com/mimetex.zip">
 1283:         <!-- jfa <a href="ftp://ftp.tex.ac.uk/tex-archive/support/mimetex/mimetex.zip"></a> -->
 1284:         mimetex.zip</a> and then type
 1285:           <table border="0" cellpadding="0" cellspacing="0">
 1286:            <tr align="left">
 1287:             <td><img src="../cgi-bin/mimetex.cgi?\hspace{50}" alt="" border=0></td>
 1288:             <td><b>unzip mimetex.zip</b> <br>
 1289:                 <b>cc -DAA mimetex.c gifsave.c -lm -o mimetex.cgi</b></td>
 1290:           </tr></table>
 1291:         &nbsp; &nbsp; &nbsp; Now <b>mv</b> mimetex.cgi to your <b>cgi-bin/</b>
 1292:         directory, and you're all done. &nbsp; &nbsp; &nbsp; <br>
 1293:         Read the rest of this section for more detailed
 1294:         information.<hr size="2"></center></td>
 1295:       <td><img src="../cgi-bin/mimetex.cgi?\hspace{150}" alt="" border=0></td>
 1296:      </tr></table>
 1297: <!-- </center> -->
 1298: 
 1299: <p> I've built and run mimeTeX under Linux and NetBSD using gcc. The source
 1300:     code is ansi-standard C, and should compile and run under all
 1301:     environments without change.  Instructions below
 1302:     are for Unix.  Modify them as necessary for your particular situation
 1303:     (note the -DWINDOWS switch if applicable). </p>
 1304: 
 1305: <h2> <a name="compile"> (IIa) Download and Compile &nbsp; </a> </h2>
 1306: 
 1307:  <p> The steps needed to download and compile mimeTeX are </p>
 1308:   <ul>
 1309:    <li> Download and unzip 
 1310:         <a href="http://www.forkosh.com/mimetex.zip">
 1311:         <!-- jfa <a href="ftp://ftp.tex.ac.uk/tex-archive/support/mimetex/mimetex.zip"></a> -->
 1312:         mimetex.zip</a> in any convenient working directory.
 1313:         Your working directory should now contain <center>
 1314:         <table cellpadding=0 cellspacing=0>
 1315:          <tr><td width=100>README</td> <td>mimeTeX release notes</td></tr>
 1316:          <tr><td>COPYING</td>    <td>GPL license, under which you may use
 1317:                                      mimeTeX</td></tr>
 1318:          <tr><td>mimetex.c</td>  <td>mimeTeX source program and all required
 1319:                                      functions</td></tr>
 1320:          <tr><td>mimetex.h</td>  <td>header file for mimetex.c (and for
 1321:                                      gfuntype.c)</td></tr>
 1322:          <tr><td>gfuntype.c</td> <td>parses output from <b>gftype -i</b>
 1323:                                      and writes bitmap data</td></tr>
 1324:          <tr><td>texfonts.h</td> <td>output from several <b>gfuntype</b> runs,
 1325:                                      needed by mimetex.c</td></tr>
 1326:          <tr><td>gifsave.c</td>  <td>gif library by Sverre H. Huseby
 1327:                                      <a href="http://shh.thathost.com"
 1328:                                      target="_top">http://shh.thathost.com</a>
 1329:                                      </td></tr>
 1330:          <tr><td>mimetex.html</td> <td>this file, the mimeTeX
 1331:                                      user's manual</td></tr>
 1332:         </table></center>
 1333:         &nbsp; &nbsp; &nbsp; &nbsp;
 1334:           Note: all files use Unix line termination, i.e., linefeeds
 1335:         (without carriage returns) signal line endings. Conversion for
 1336:         Windows PC's, Macs, VMS, etc, can usually be accomplished by
 1337:         unzip's&nbsp;-a option, i.e.,  unzip&nbsp;-a&nbsp;mimetex.zip
 1338:         <br> <br> </li>
 1339:    <li> To compile an executable that emits anti-aliased gif images
 1340:         (which is recommended for most uses), just type the following
 1341:         command from the Unix shell <br>
 1342:         &nbsp; &nbsp; &nbsp; &nbsp;
 1343:           <b>cc -DAA mimetex.c gifsave.c -lm -o mimetex.cgi</b> </li>
 1344:    <li> Or, to compile an executable that emit gif images
 1345:         without anti-aliasing <br>
 1346:         &nbsp; &nbsp; &nbsp; &nbsp;
 1347:           <b>cc -DGIF mimetex.c gifsave.c -lm -o mimetex.cgi</b> </li>
 1348:    <li> Alternatively, to compile an executable that emits mime xbitmaps<br>
 1349:         &nbsp; &nbsp; &nbsp; &nbsp;
 1350:           <b>cc -DXBITMAP mimetex.c -lm -o mimetex.cgi</b> </li>
 1351:    <li> Compile Notes: <ul>
 1352:         <li> If (and only if) you're compiling a Windows executable with
 1353:         the <b>-DAA</b> or <b>-DGIF</b> option (but not -DXBITMAP), then
 1354:         add <b>-DWINDOWS</b>&nbsp;.  For example, <br>
 1355:              <nobr> &nbsp; &nbsp; &nbsp; &nbsp; <b>gcc -DAA -DWINDOWS
 1356:              mimetex.c gifsave.c -lm -o mimetex.exe</b> </nobr> <br>
 1357:         The above Unix-like syntax works with
 1358:         <a href="http://www.mingw.org" target="_top">MinGW</a> and
 1359:         <a href="http://www.delorie.com/djgpp/" target="_top">djgpp</a>
 1360:         Windows compilers, but probably not with most others,
 1361:         where it's only intended as a "template". <br>
 1362:         &nbsp; &nbsp; &nbsp; &nbsp;
 1363:           Explanation: mimeTeX writes gif bytes directly to stdout, as usual
 1364:         for cgi's.  But Windows treats stdout as a character stream,
 1365:         interpreting any hex 0A byte as an &lt;lf&gt;, and automatically
 1366:         preceding it with a spurious hex 0D &nbsp; &lt;cr&gt;  byte.  The
 1367:         -DWINDOWS switch compiles in a non-portable, Windows-specific
 1368:         _setmode() call that sets stdout to binary mode. </li>
 1369:         <li> If you're compiling for Windows and would prefer
 1370:         to install mimeTeX as a Win32 DLL, see the
 1371:         <a href="http://www.codeproject.com/dotnet/Eq2Img.asp">
 1372:         Code&nbsp;Project</a> developed by
 1373:         <a href="http://www.shitalshah.com">Shital&nbsp;Shah</a>, and
 1374:         download <a href="http://www.shitalshah.com/dev/eq2img_all.zip">
 1375:         eq2img_all.zip</a> containing Shital's latest code. </li>
 1376:         <!-- <li> If you're compiling on Sun or VMS, and see about a zillion
 1377:         irritating warnings, try adding <b>-DSIGNEDCHAR</b>
 1378:         (for VMS, that's cc/define=(AA,SIGNEDCHAR)&nbsp;mimetex.c) </li> -->
 1379:         </ul> <br> </li>
 1380:    <li> The gfuntype program is only needed if you plan to change the
 1381:         font information in texfonts.h, as explained in
 1382:         <a href="#fonts">Appendix IVa</a> below.
 1383:         In that case, compile gfuntype with the command <br>
 1384:         &nbsp; &nbsp; &nbsp; &nbsp;
 1385:           <b>cc gfuntype.c mimetex.c -lm -o gfuntype</b> </li>
 1386:   </ul>
 1387:  <p> That's all there is to compiling mimeTeX.
 1388:      Several other optional compile-line <a href="#options">options</a>
 1389:      available for mimetex.c are discussed below. </p>
 1390: 
 1391:  <p> Immediately after compiling mimeTeX, test your new executable
 1392:      by typing &nbsp; <b>./mimetex.cgi&nbsp;"x^2+y^2"</b> &nbsp;
 1393:      from the Unix shell (or &nbsp; <b>mimetex&nbsp;"x^2+y^2"</b>
 1394:      &nbsp; from the Windows Command Prompt), which should emit
 1395:      two "ascii&nbsp;rasters" something like the following </p> <pre>
 1396: Ascii dump of bitmap image...           Hex dump of colormap indexes...
 1397: ...........**....................**...  ..........1**1...................1**1..
 1398: ..........*..*......*...........*..*..  ..........*23*......*............*23*..
 1399: .............*......*..............*..  .............*......*...............*..
 1400: ....****.....*......*.....*..*.....*..  ...1****....2*......*.....2*..*....2*..
 1401: ...*.*.*....*.......*....**..*....*...  ...*.*.*...1*.......*.....**..*...1*...
 1402: .....*.....*.*..********..*..*...*.*..  ....1*1...2*.*..********..3*..*..2*.*..
 1403: .....*....****......*.....*..*..****..  ....2*2...****......*......*12*..****..
 1404: ..*.*.*.............*.....*.*.........  ..*.*.*.............*......*.*2........
 1405: ...****.............*.....***.........  ..1****.............*......***.........
 1406: ....................*.......*.........  ....................*........*.........
 1407: .........................*.*..........  ..........................*.*1.........
 1408: .........................**...........  ..........................**1..........
 1409:                                         The 5 colormap indexes denote rgb vals...
 1410:                                         .-->255  1-->196  2-->186  3-->177  *-->0</pre>
 1411:     <p class="continue"> <b>(</b>The right-hand illustration shows asterisks
 1412:     in the same positions as the left-hand one, along with anti-aliased
 1413:     grayscale colormap indexes assigned to neighboring pixels, and with
 1414:     the rgb value for each index.<b>)</b>  Just typing <b>./mimetex.cgi</b>
 1415:     without an argument should produce ascii rasters for the default
 1416:     expression <b>f(x)=x^2</b>.  If you see these two ascii rasters then
 1417:     your binary's good.  Otherwise, you must find and fix the problem
 1418:     before proceeding. </p>
 1419: 
 1420: 
 1421: <h2> <a name="install"> (IIb) Install &nbsp; </a> </h2>
 1422: 
 1423:  <p> Once you've successfully tested mimetex.cgi from the Unix shell
 1424:      (or mimetex.exe from the Windows Command Prompt),
 1425:      the steps needed to install mimeTeX are </p>
 1426:   <ul>
 1427:    <li> <b>mv</b> mimetex.cgi &nbsp; (or <b>move</b> mimetex.exe) &nbsp;
 1428:         to your server's <b>cgi-bin/</b> directory, wherever cgi
 1429:         programs are expected. </li>
 1430:    <li> Now you may need to <b>chmod&nbsp;755&nbsp;mimetex.cgi</b> &nbsp;
 1431:         and/or <b>chown</b> it, too, depending on your server's
 1432:         requirements.  Contact your system administrator or ISP
 1433:         if you're not already familiar with this information. </li>
 1434:    <li> Once mimetex.cgi is moved to your server's <b>cgi-bin/</b>
 1435:         directory, with permissions and owner set as necessary,
 1436:         you're all done. </li>
 1437:   </ul>
 1438: 
 1439:  <p> Immediately after installing mimeTeX, test your new mimetex.cgi
 1440:      by typing a url into your browser's locator window something like <br>
 1441:      &nbsp; &nbsp; &nbsp; &nbsp;
 1442:       <b>http://www.<i>yourdomain</i>.com/cgi-bin/mimetex.cgi?x^2+y^2</b> <br>
 1443:      which should display &nbsp;
 1444:      <img src="../cgi-bin/mimetex.cgi?\normalsize x^2+y^2" alt="" border=0
 1445:      style="Vertical-Align:-3px"> &nbsp;
 1446:      in the upper-left corner of your window,
 1447:      just like clicking this link does, which tests my mimetex.cgi, <br>
 1448:      &nbsp; &nbsp; &nbsp; &nbsp;
 1449:       <a href="http://www.forkosh.com/cgi-bin/mimetex.cgi?x^2+y^2"
 1450:       target="_top">http://www.forkosh.com/cgi-bin/mimetex.cgi?x^2+y^2</a><br>
 1451:      If you see the same &nbsp; <img src="../cgi-bin/mimetex.cgi?
 1452:      \normalsize x^2+y^2" alt="" border=0 style="Vertical-Align:-3px"> &nbsp;
 1453:      image from the <b><i>yourdomain</i></b> link, then you've completed
 1454:      a successful mimeTeX installation. </p>
 1455: 
 1456:  <p> If you don't see the image, then your installation failed.
 1457:      If your earlier post-compilation "ascii&nbsp;raster" test
 1458:      succeeeded, then the problem is probably some server-specific
 1459:      installation requirement.  First make sure you installed mimetex.cgi
 1460:      in the correct <b>cgi-bin/</b> directory, set the correct <b>chmod</b>
 1461:      permissions, and typed the correct url into your browser's locator
 1462:      window.  Then contact your system administrator or ISP,
 1463:      and ask how to install cgi programs on your server. </p>
 1464: 
 1465:  <p> After you've successfully installed mimeTeX, and both preceeding tests
 1466:      have succeeded, you can optionally &quot;regression&nbsp;test&quot;
 1467:      all mimeTeX features as follows: </p>
 1468:       <ul>
 1469:         <li> <b>mv</b> mimetex.html (this file) to your server's
 1470:              <b>htdocs/</b> directory </li>
 1471:         <li> Paths to <b>cgi-bin/</b> and <b>htdocs/</b> directories
 1472:              are typically <b><i>path</i>/www/cgi-bin/</b> and
 1473:              <b><i>path</i>/www/htdocs/</b>,  so I set up mimtex.html
 1474:              to access mimetex.cgi from the relative path <b>../cgi-bin/</b>.
 1475:              If your directories are non-conforming, you may have to edit
 1476:              the few dozen occurrences of <b>../cgi-bin/mimetex.cgi</b>
 1477:              in your mimetex.html page.  Sometimes a suitable symlink works;
 1478:              if not, you'll have to edit.  Globally changing
 1479:              <b>../cgi-bin/mimetex.cgi</b> usually works. </li>
 1480:         <li> Now visit your page &nbsp;
 1481:              <b>http://www.<i>yourdomain</i>.com/mimetex.html</b> </li>
 1482:         <li> Once your mimetex.html displays properly, you can assume
 1483:              everything is working, and can begin authoring html documents
 1484:              using mimetex.cgi to render your own math. </li>
 1485:      </ul>
 1486: 
 1487:   <p> That's all there is to installing mimeTeX. </p>.
 1488: 
 1489: 
 1490: <h2> <a name="options"> (IIc) Additional Compile-Line Options &nbsp; </a></h2>
 1491: 
 1492:  <p> In addition to -DAA or -DGIF or -DXBITMAP (along with -DWINDOWS
 1493:      when necessary) on the mimetex.c compile line, as discussed above,
 1494:      you may also optionally include the following -D switches,
 1495:      whose functionality is discussed below. </p>
 1496:      <dl>
 1497:       <dt> <b>-DAA</b> </dt>
 1498:        <dd> As already discussed, -DAA turns on anti-aliasing.
 1499:            It also sets default values for individual anti-aliasing
 1500:            parameters discussed below.  If you specify -DAA
 1501:            then you needn't specify the individual parameters unless
 1502:            you want to override the defaults. <br>
 1503:            &nbsp; &nbsp; &nbsp; Anti-aliasing can't be applied to mime
 1504:            xbitmaps, so don't specify -DAA if you also specify -DXBITMAP. <br>
 1505:            &nbsp; &nbsp; &nbsp; And mimeTeX's anti-aliasing only works
 1506:            well on white (or light gray) backgrounds.  Your html file
 1507:            probably contains a &lt;body&gt; tag of the form
 1508:            &lt;body&nbsp;bgcolor="#ffffff"&nbsp;text="#000000"&gt;
 1509:            which specifies black text on a pure white background.
 1510:            The background can be grayed down to maybe bgcolor="#e7e7e7",
 1511:            but much darker will begin to show white rings around
 1512:            mimeTeX's anti-aliased characters.  This page is displayed
 1513:            using bgcolor="#ffffff". </dd>
 1514:       <dt> <b>-DCENTERWT=<i>n</i> <br>
 1515:            -DADJACENTWT=<i>j</i>  <br>
 1516:            -DCORNERWT=<i>k</i></b> </dt>
 1517:        <dd> MimeTeX currently provides a lowpass filtering
 1518:            algorithm for anti-aliasing, which is applied to the
 1519:            existing set of bitmap fonts.  This lowpass filter applies
 1520:            weights <img src="../cgi-bin/mimetex.cgi?
 1521:            \tiny\begin{pmatrix}1&2&1\\2&\,8\,&2\\1&2&1\end{pmatrix}"
 1522:            alt="" border=0 align=middle> to neighboring pixels. The defaults
 1523:            weights are CENTERWT=8, ADJACENTWT=2 and CORNERWT=1,
 1524:            which you can adjust to control anti-aliasing. </dd>
 1525:       <dt> <b>-DCACHEPATH=\"<i>path/</i>\"</b> </dt>
 1526:        <dd> This option saves each rendered image to a file in directory
 1527:            <b><i>path/</i></b>, which mimeTeX reads rather than
 1528:            re-rendering the same image every time it's given
 1529:            the same LaTeX expression.  Sometimes mimeTeX disables caching,
 1530:            e.g., expressions containing <b>\input{&nbsp;}</b> are
 1531:            re-rendered since the contents of the inputted file may have
 1532:            changed.  If compiled without <b>-DCACHEPATH=\"<i>path/</i>\"</b>
 1533:            mimeTeX always re-renders expressions.  This usually isn't too
 1534:            cpu intensive, but if you have unusually high hit rates then
 1535:            image caching may be helpful.  The <b><i>path/</i></b>
 1536:            is relative to mimetex.cgi, and must be writable by it.
 1537:            Files created under <b><i>path/</i></b> are named
 1538:            <b><i>filename</i>.gif</b>, where <b><i>filename</i></b>
 1539:            is the 32-character MD5 hash of your LaTeX expression. <br>
 1540:               &nbsp; &nbsp; &nbsp; If you're also using mimeTeX's
 1541:            <a href="#valignment">Vertical-Align:</a> feature, prefix your
 1542:            <b><i>path</i>/</b> with a leading&nbsp;<b>&#037;</b> and write
 1543:            &nbsp; <b>-DCACHEPATH=\&quot;&#037;<i>path</i>/\&quot;</b> &nbsp;
 1544:            instead.  That leading&nbsp;<b>&#037;</b> won't become part of
 1545:            your cache directory's <b><i>path</i>/</b>, but it will signal
 1546:            mimeTeX to cache headers along with each image.
 1547:            Otherwise, the Vertical-Align: information is lost,
 1548:            and attempts to align cached images will fail. <br>
 1549:               &nbsp; &nbsp; &nbsp; When caching a new image, mimeTeX also
 1550:            updates the file <b><i>path/</i>mimetex.log</b> containing
 1551:            a timestamp, filename and LaTeX expression for each new file
 1552:            created.  A sample entry looks like
 1553: <pre>---------------------------------------------------------------------
 1554: 2008-09-07:11:29:53am            f8ccc8dd93c8eeb1d9c40b353ef781e0.gif
 1555: \LARGE x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
 1556: ---------------------------------------------------------------------</pre></dd>
 1557:       <dt><b>-DDEFAULTSIZE=<i>n</i></b> </dt>
 1558:        <dd> MimeTeX currently has eight font sizes numbered 0-7,
 1559:            and always starts out in DEFAULTSIZE, whose default value is 3.
 1560:            Specify -DDEFAULTSIZE=2 on the compile line if you prefer
 1561:            mimeTeX to start in default size 2, etc. </dd>
 1562:       <dt><b>-DDISPLAYSIZE=<i>n</i></b> </dt>
 1563:        <dd> By default, operator limits like <b>\int_a^b</b> are rendered
 1564:            <b>\textstyle</b> <a href="#preview">
 1565:            <img id="displaysize1" onclick="eqntext('displaysize1')"
 1566:            src="../cgi-bin/mimetex.cgi?
 1567:            \normalsize\displaystyle\int\nolimits_a^b"
 1568:            alt="" border=0 align=middle></a> at font sizes <b>\normalsize</b>
 1569:            and smaller, and rendered <b>\displaystyle</b> <a href="#preview">
 1570:            <img id="displaysize2" onclick="eqntext('displaysize2')"
 1571:            src="../cgi-bin/mimetex.cgi?\large\int_a^b"
 1572:            alt="" border=0 align=middle></a> at font sizes <b>\large</b> and
 1573:            larger.  This default corresponds to <b>-DDISPLAYSIZE=3</b>,
 1574:            which you can adjust; e.g., <b>-DDISPLAYSIZE=0</b> always defaults
 1575:            to <b>\displaystyle</b>, and <b>99</b> (or any large number)
 1576:            always defaults to <b>\textstyle</b>.  Note that explicit
 1577:            <b>\textstyle</b>, <b>\displaystyle</b>, <b>\limits</b> or
 1578:            <b>\nolimits</b> directives in an expression always override
 1579:            the <b>DISPLAYSIZE</b> default. </dd>
 1580:       <dt><b>-DGAMMA=<i>gammacorrection</i></b> </dt>
 1581:        <dd> Applies <b><i>gammacorrection</i></b> to antialiased
 1582:            gif images.  Default is 1.25 (rather than the standard 2.2).
 1583:            Specify 0.0 to turn off gamma correction (1.0 makes no
 1584:            gamma correction but doesn't actually turn it off). </dd>
 1585:       <dt><b>-DNEWCOMMANDS=\"<i>newcommands.h</i>\"</b> </dt>
 1586:        <dd> LaTeX-like <b>\newcommand</b>'s are available in mimeTeX,
 1587:            via the following facility to help you define your
 1588:            own "new&nbsp;commands" during compilation.  Edit a file named
 1589:            newcommands.h (or any filename you specify between 
 1590:            <b>\"...\"</b>'s with the <b>-DNEWCOMMANDS=\"<i>filename</i>\"</b>
 1591:            switch).  For newcommands _without_
 1592:            arguments, your file should contain one or more lines
 1593:            like the following examples:
 1594: <pre>{ "\\iint",  NULL, "{\\int\\int}" },
 1595: { "\\rightleftharpoons",NULL,"{\\rightharpoonup\\atop\\leftharpoondown}" },
 1596: { "\\ldots", NULL, "{\\Large.\\hspace1.\\hspace1.}" },
 1597: { "\\cr",    NULL, "\\\\" },
 1598: { "\\neq",   NULL, "{\\not=}" },</pre>
 1599:            For newcommands _without_ arguments, as illustrated above,
 1600:            the general form of each line in your file should be &nbsp;
 1601: <b>{&nbsp;"\\<i>command</i>",&nbsp;NULL,&nbsp;"{<i>replacement</i>}"&nbsp;},</b>
 1602:            &nbsp; &nbsp; Don't forget a comma at the end of every line,
 1603:            and write a double&nbsp;backslash&nbsp;<b>\\</b>
 1604:            between quotes&nbsp;<b>"...\\..."</b> wherever you actually
 1605:            want a single&nbsp;backslash&nbsp;<b>\</b>.  The only effect
 1606:            of the above examples (without arguments) is simple string
 1607:            substitution, i.e.,  every occurrence of <b>\<i>command</i></b>
 1608:            is replaced by <b>{<i>replacement</i>}</b>.  Note that the
 1609:            <b>{&nbsp;}</b>'s surrounding <b><i>replacement</i></b>
 1610:            aren't required, but are usually a good idea (the case
 1611:            of <b>\cr</b> illustrated above is one exception, where
 1612:            <b>{&nbsp;}</b>'s would defeat the purpose).
 1613:            <br> &nbsp; &nbsp; To define newcommands _with_ arguments,
 1614:            change the <b>NULL</b> after the <b>\\<i>command</i></b>
 1615:            to define your command's arguments as illustrated by the
 1616:            following example:
 1617: <pre>{ "\\lvec", "2n", "#2_1,\\cdots,#2_{#1}" },</pre>
 1618:            In this case the <b>NULL</b> has been replaced by <b>"2n"</b>
 1619:            (note the mandatory surrounding quotes <b>"..."</b>).  This
 1620:            example corresponds to the similar one discussed in TLC2 on
 1621:            page 845.  The first character inside the <b>"..."</b>s is
 1622:            &nbsp; <b>2</b> &nbsp; indicating the number of arguments,
 1623:            which may be <b>1</b> thru <b>9</b>.  If there are no
 1624:            subsequent characters followng this one, then all arguments are
 1625:            mandatory, enclosed in <b>{&nbsp;}</b>'s as usual.  Otherwise,
 1626:            any subsequent characters signal that the first argument
 1627:            is optional, enclosed in <b>[&nbsp;]</b>'s if given.  And
 1628:            these subsequent characters comprise the first argument's
 1629:            default value if it's not explicitly given.  The illustrated
 1630:            example's first argument is optional with default value &nbsp;
 1631:            <b>n</b> &nbsp; as shown.  In this case that's just a single
 1632:            character, but you can write any length default you like.
 1633:            <br> &nbsp; &nbsp; To see many additional examples, search for the
 1634:            uppercase string NEWCOMMANDS in mimetex.c, and look below that.
 1635:            All the above examples are already there. </dd>
 1636:       <dt> <b>-DOPAQUE</b> </dt>
 1637:        <dd> By default, mimeTeX renders gif images with black symbols
 1638:            on a transparent white background.  Defining OPAQUE renders
 1639:            images on an opaque background instead. </dd>
 1640:       <dt> <b>-DPATHPREFIX=\"<i>path/</i>\"</b> </dt>
 1641:        <dd> The <a href="#input">\input{&nbsp;}</a> and
 1642:            <a href="#counter">\counter{&nbsp;}</a> commands discussed below
 1643:            require filename arguments which, by default, point to files
 1644:            residing in the same cgi-bin/ directory as your mimetex.cgi.
 1645:            Moreover, for security, absolute paths with leading <b>/</b>'s
 1646:            or <b>\</b>'s, and paths with <b>../</b>'s or <b>..\</b>'s,
 1647:            are not permitted.  Instead, compile mimetex with PATHPREFIX
 1648:            defined as <i>path</i><b>/</b> if you want input files in some
 1649:            other directory.  And make sure your <i>path</i><b>/</b> ends
 1650:            with <b>/</b> (or with <b>\</b> for Windows). </dd>
 1651:       <dt> <b>-DPLUSBLANK &nbsp; &nbsp; &nbsp; <i>-or-</i><br>
 1652:            -DPLUSNOTBLANK</b> </dt>
 1653:        <dd> mimeTeX receives your LaTeX math expression as a url
 1654:            query&nbsp;string, in which blank spaces are often encoded
 1655:            as&nbsp;<b>%20</b> or as plus signs&nbsp;<b>+</b>, and
 1656:            where actual plus signs are often encoded as&nbsp;<b>%2B</b>.
 1657:            But these conventions aren't always respected,
 1658:            and even when they are blank spaces may be either
 1659:            <b>%20</b>&nbsp;or&nbsp;<b>+</b>.  The only ambiguity for
 1660:            mimeTeX is whether or not to translate plus signs&nbsp;<b>+</b>
 1661:            back to blank spaces. <br>
 1662:            &nbsp; &nbsp; &nbsp; If you know how your applications behave,
 1663:            then define PLUSBLANK to always translate plus signs&nbsp;<b>+</b>
 1664:            to blank spaces, or define PLUSNOTBLANK to never translate. <br>
 1665:            &nbsp; &nbsp; &nbsp; Otherwise, if you define neither,
 1666:            mimeTeX applies some common-sense rules to decide whether or
 1667:            not to translate.  These usually work, but can't be guaranteed.
 1668:            If your query&nbsp;string contains actual blank spaces or
 1669:            blanks encoded as <b>%20</b>, then plus signs&nbsp;<b>+</b>
 1670:            aren't translated.  Otherwise, if your query&nbsp;string
 1671:            contains <b>%2B</b>, then plus signs&nbsp;<b>+</b> are
 1672:            translated.  If neither <b>%20</b> nor <b>%2B</b>, or both
 1673:            <b>%20</b> and <b>%2B</b>, occur in your query&nbsp;string,
 1674:            then the situation is ambiguous.  In this case, if mimeTeX
 1675:            finds two or more plus signs&nbsp;<b>++</b> with no intervening
 1676:            space, then they're translated; otherwise they're not. </dd>
 1677:       <dt> <b>-DREFERER=\"<i>domain</i>\" &nbsp; &nbsp; &nbsp; <i>-or-</i><br>
 1678:            -DREFERER=\"<i>domain1,domain2,etc</i>\"</b> </dt>
 1679:        <dd> Blocks mimeTeX requests from unauthorized domains that
 1680:            are using your mimetex.cgi (hence your server's resources)
 1681:            without permission. <br>
 1682:            &nbsp; &nbsp; &nbsp; If REFERER is defined, mimeTeX
 1683:            performs a case-insensitive test of the environment variable
 1684:            HTTP_REFERER to verify that it contains the authorized 'domain'
 1685:            as a substring. <br>
 1686:            &nbsp; &nbsp; &nbsp; If given several 'domain's (second form)
 1687:            then HTTP_REFERER must contain either 'domain1' or
 1688:            'domain2', or etc, as a (case-insensitive) substring. <br>
 1689:            &nbsp; &nbsp; &nbsp; If HTTP_REFERER doesn't contain a substring
 1690:            matching any of these domain(s), then mimeTeX emits an error
 1691:            message image instead of the requested image.  You can manually
 1692:            modify invalid_referer_msg, defined in function main(),
 1693:            to personalize the error message for your own site. <br>
 1694:            &nbsp; &nbsp; &nbsp; Finally, if HTTP_REFERER is not found as
 1695:            an environment variable, then mimeTeX correctly generates the
 1696:            requested image instead of generating an error. </dd>
 1697:       <dt><b>-DSECURITY=<i>n</i></b> </dt>
 1698:        <dd> This is essentially a "paranoid" setting that defaults
 1699:            to a high value 999, which inhibits some optional logging
 1700:            activity.  <b>-DCACHEPATH=<i>path</i>/</b> isn't affected,
 1701:            since you're explicitly supplying a <b><i>path</i>/</b>
 1702:            you want files written to.  But, for example, you must set
 1703:            <b>-DSECURITY=5</b> (or less) to permit the <b>\counter</b>
 1704:            command to create a new counter file.  A malicious user
 1705:            could conceivably flood your file system by submitting
 1706:            zillions of <b>\counter{<i>filename</i>}</b> commands
 1707:            to mimeTeX, each with a different <b><i>filename</i></b>. </dd>
 1708:       <dt><b>-DSMASHMARGIN=<i>n</i> &nbsp; &nbsp; &nbsp; <i>-or-</i><br>
 1709:           -DNOSMASH</b> </dt>
 1710:        <dd> TeX typically renders an expression like
 1711:            <b>\frac12\int_{a+b+c}^{d+e+f}g(x)dx</b> as <a href="#preview">
 1712:            <img id="nosmash1" onclick="eqntext('nosmash1')"
 1713:            src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
 1714:            \nosmash\frac12\int_{a+b+c}^{d+e+f}g(x)dx"
 1715:            alt="" border=0 align=middle></a>.  MimeTeX tries to remove extra
 1716:            whitespace, rendering the same expression as <a href="#preview">
 1717:            <img id="nosmash2" onclick="eqntext('nosmash2')"
 1718:            src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
 1719:            \smash\frac12\int_{a+b+c}^{d+e+f}{g(x)}dx"
 1720:            alt="" border=0 align=middle></a> instead.
 1721:            Compile with <b>-DNOSMASH</b> if you prefer the typical TeX
 1722:            behavior as mimeTeX's default.  Or, to adjust the minimum
 1723:            number of pixels between smashed symbols (default is 3),
 1724:            compile with <b>-DSMASHMARGIN=<i>n</i></b>.
 1725:            See <a href="#smash">Smash</a> for further discussion. </dd>
 1726:       <dt> <b>-DWARNINGS=<i>n</i> &nbsp; &nbsp; &nbsp; <i>-or-</i> <br>
 1727:            -DNOWARNINGS</b> </dt>
 1728:        <dd> If an expression submitted to mimeTeX contains an
 1729:            unrecognzied escape sequence, e.g., "y=x+\abc+1", then
 1730:            mimeTeX generates a gif image containing an embedded
 1731:            warning in the form "y=x+[\abc?]+1".  Or, if an expression
 1732:            contains an unrecognized character, i.e., one for which mimeTeX
 1733:            has no corresponding bitmap, then the embedded warning is [?].
 1734:            If you want these warnings suppressed, either <b>-DWARNINGS=0</b>
 1735:            or <b>-DNOWARNINGS</b> on the compile line tells mimeTeX to treat
 1736:            unrecognized/undisplayable input as white space. </dd>
 1737:       <dt> <b>-DWHITE</b> </dt>
 1738:        <dd>  MimeTeX usually renders black symbols on a white
 1739:            background.  This option renders white symbols on
 1740:            a transparent black background instead (or on an opaque
 1741:            black background when combined with <b>-DOPAQUE</b>&nbsp;). </dd>
 1742:      </dl>
 1743: 
 1744: 
 1745: <h2> <a name="cmdline"> (IId) Command Line Features &nbsp; </a> </h2>
 1746: 
 1747:  <p> MimeTeX usually runs from a browser, obtaining its input expression
 1748:      from a query_string.  But you can also run mimeTeX from your Unix
 1749:      shell, supplying all input from the command line.  This was briefly
 1750:      illustrated above, where you were advised to test your newly-compiled
 1751:      mimeTeX executable from the command line before installing it. </p>
 1752: 
 1753:  <p> In addition to such simple testing, mimeTeX also provides some
 1754:      possibly useful functionality from the command line.  In particular,
 1755:      you can store a gif (or xbitmap) image of any expression to a file.
 1756:      No syntax checking is applied to command-line arguments, so enter
 1757:      them carefully.  (Likewise, plus signs&nbsp;<b>+</b> are never
 1758:      translated to blank spaces, nor is any other <b>%xx</b> url decoding
 1759:      performed on command-line arguments.) </p>
 1760:      
 1761:  <p> The complete command-line syntax for mimeTeX is </p>
 1762:      <pre>
 1763:      ./mimetex [ -d ]            dump gif image on stdout,
 1764:                [ -e export_file ]  or write gif image to export_file
 1765:                [ expression      expression, e.g., "x^2+y^2",
 1766:                | -f input_file ]   or read expression from input_file
 1767:                [ -g1 -d ]        dump .pbm-formatted image on stdout
 1768:                [ -g1 -e export_file ]  or write .pbm image to export_file
 1769:                [ -g2 -d ]        dump anti-aliased .pgm image on stdout
 1770:                [ -g2 -e export_file ]  or write .pgm image to export_file
 1771:                [ -m msglevel ]   verbosity of debugging output
 1772:                [ -o ]            render image with opaque background
 1773:                [ -s fontsize ]   default fontsize, 0-5
 1774: 
 1775:      -d   Rather than printing ascii debugging output, mimeTeX
 1776:           dumps the actual gif (or xbitmap) to stdout, e.g.,
 1777:                ./mimetex  -d  "x^2+y^2"  >  expression.gif
 1778:           creates expression.gif containing an image of x^2+y^2
 1779: 
 1780:      -e export_file   Like -d but writes the actual gif
 1781:           (or xbitmap) directly to export_file, e.g.,
 1782:                ./mimetex  -e expression.gif  "x^2+y^2"
 1783:           creates file expression.gif containing an image of x^2+y^2
 1784: 
 1785:      expression   Place LaTeX expression directly on command
 1786:           line, with no -switch preceding it, as in the example
 1787:           immediately above, or.....
 1788: 
 1789:      -f input_file   .....read expression from input_file
 1790:           (and automatically assume -d switch).  The input_file
 1791:           may contain the expression on one line or spread out
 1792:           over many lines.  MimeTeX will concatanate all lines
 1793:           from input_file to construct one long expression.
 1794:           Blanks, tabs, and newlines are just ignored.
 1795: 
 1796:      -g1 -d   dumps a .pbm-formatted portable bitmap image to stdout.
 1797:           Note that this is the bitmap image _before_ anti-aliasing.
 1798: 
 1799:      -g1 -e export_file   Like -g1 -d but writes the .pbm-formatted
 1800:           portable bitmap directly to export_file, e.g.,
 1801:                ./mimetex  -g1 -e expression.pbm  "x^2+y^2"
 1802:           creates file expression.pbm containing a bitmap image
 1803:           of x^2+y^2 before anti-aliasing.
 1804: 
 1805:      -g2 -d   dumps a .pgm-formatted portable graphic image to stdout.
 1806:           Note that this is the bytemap image _after_ anti-aliasing.
 1807: 
 1808:      -g2 -e export_file   Like -g2 -d but writes the .pgm-formatted
 1809:           portable graphic image directly to export_file, e.g.,
 1810:                ./mimetex  -g3 -e expression.pgm  "x^2+y^2"
 1811:           creates file expression.pgm containing a bytemap image
 1812:           of x^2+y^2 after anti-aliasing.
 1813: 
 1814:      -m msglevel   0-99, controls verbosity/message level for
 1815:           debugging output (usually used only while testing code).
 1816: 
 1817:      -o   Rather than the default transparent gif background,
 1818:           the rendered image will contain black symbols on an
 1819:           opaque white background (or vice versa if compiled
 1820:           with -DWHITE).  For example, if you have ImageMagick's
 1821:           display utility,
 1822:                ./mimetex  -o -d  "x^2+y^2" | display &
 1823:           opens a small window containing the rendered expression.
 1824:           (Note: if you already compiled mimeTeX with -DOPAQUE
 1825:           then  -o  renders images on a transparent background.)
 1826: 
 1827:      -s fontsize   0-7, font size.  Font size can also be specified
 1828:           within the expression by a directive, e.g., \Large f(x)=x^2
 1829:           displays f(x)=x^2 at font size 4, overriding -s.
 1830:           Default font size is 3.
 1831:      </pre>
 1832: 
 1833: 
 1834: 
 1835: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1836: SECTION III.  SYNTAX REFERENCE
 1837: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
 1838: <h1> <a name="reference"> (III) Syntax Reference &nbsp; </a> </h1>
 1839: 
 1840: <p> Since mimeTeX's syntax is as TeX-like as possible, we'll mostly discuss
 1841:     the occasional differences.
 1842:     <!-- (which exist only to simplify my programming
 1843:     task, not to impose any syntactic aesthetics of mine on you). -->
 1844:     This section contains short paragraphs that each discuss some aspect
 1845:     of mimeTeX where your LaTeX experience might not be precisely
 1846:     duplicated. </p>
 1847: 
 1848: <p> Anything not discussed here that still doesn't behave like you expect
 1849:     is probably just not implemented.  That includes (La)TeX packages
 1850:     (though a few ams commands like \begin{gather} and \begin{pmatrix}
 1851:     are recognized), non-standard fonts, etc.  You can try out any
 1852:     questionable syntax by <a href="#forminput">Submit</a>ting a query
 1853:     to quickly see whether or not it works.  And you might want to
 1854:     occasionally re-browse the <a href="#examples">Examples</a> above,
 1855:     which may better illustrate implemented features. </p>
 1856: 
 1857: 
 1858: <h2> <a name="spaces"> (IIIa) \unitlength{&nbsp;}, Math Spaces and Whitespace
 1859: &nbsp; </a> </h2>
 1860: 
 1861: <h3> <a name="unitlength">\unitlength<font size=5>...</font></a> </h3>
 1862: 
 1863:  <p> Lengths in mimeTeX are all ultimately expressed in number of pixels.
 1864:      Various commands discussed below require length arguments, including </p>
 1865:      <ul>
 1866:        <li> <a href="#mathspace">\hspace{&nbsp;}</a> </li>
 1867:        <li> <a href="#mathspace">\hfill{&nbsp;}</a> </li>
 1868:        <li> <a href="#raiserotate">\raisebox{&nbsp;}{&nbsp;}</a> </li>
 1869:        <li> <a href="#circleline">\line(&nbsp;,&nbsp;)</a> and
 1870:             <a href="#circleline">\circle(&nbsp;,&nbsp;)</a> </li>
 1871:        <li> <a href="#arrows">\longrightarrow[&nbsp;]</a> </li>
 1872:      </ul> <p class="continue">
 1873:      (the \long<i>xxx</i>arrow [&nbsp;]-arguments are optional mimeTeX
 1874:      extensions to LaTeX) &nbsp; MimeTeX's length-type arguments never
 1875:      take units, e.g., {10pt} and {1cm} are both invalid.  Lengths always
 1876:      refer to number of pixels, optionally scaled by a user-specified
 1877:      <b>\unitlength</b>. </p>
 1878: 
 1879:  <p> MimeTeX's <b>\unitlength{&nbsp;}</b> command lets you specify
 1880:      the number of pixels per "length&nbsp;unit", e.g.,
 1881:      <b>\unitlength{10}&nbsp;\hspace{2.5}</b> renders a 25-pixel space.
 1882:      Both <b>\unitlength{&nbsp;}</b> and <b>\hspace{&nbsp;}</b>'s
 1883:      length arguments may be integers or may contain decimal points.
 1884:      Ditto for all other mimeTeX commands that take length arguments.
 1885:      The default <b>\unitlength</b> is, you guessed it, <b>1</b>. </p>
 1886: 
 1887:  <p> A specified <b>\unitlength</b> applies to all subsequent terms,
 1888:      i.e., everything to its right.  And several <b>\unitlength</b>'s
 1889:      may be specified in the same expression, each one overriding
 1890:      those to its left.  But if one or more <b>\unitlength</b>'s
 1891:      appear within a <b>{&nbsp;}</b>-enclosed subexpression, then terms
 1892:      following its closing right <b>}</b> revert to the <b>\unitlength</b>
 1893:      in effect before its opening left <b>{</b>.  For example, </p> <center>
 1894:    <b>A\hspace{10}&nbsp;{\unitlength{2.5}B\hspace{10}C}&nbsp;\hspace{10}D</b>
 1895:    &nbsp; produces &nbsp;
 1896:    <a href="#preview"><img id="unitlength1" onclick="eqntext('unitlength1')"
 1897:    src="../cgi-bin/mimetex.cgi?\large A\hspace{10}
 1898:    {\unitlength{2.5}B\hspace{10}C}\hspace{10}D"
 1899:    alt="" border=0 align=middle></a> </center> <p class="continue">
 1900:      which has a 10-pixel space between <b>A</b>&nbsp;and&nbsp;<b>B</b>, then
 1901:      25&nbsp;pixels between <b>B</b>&nbsp;and&nbsp;<b>C</b>, and finally
 1902:      another 10&nbsp;pixels between <b>C</b>&nbsp;and&nbsp;<b>D</b>. </p>
 1903: 
 1904: <h3> <a name="mathspace">Math Spaces<font size=5>...</font></a> </h3>
 1905: 
 1906:  <p> Except inside <a href="#textboxes">text&nbsp;boxes</a>,
 1907:      unescaped blanks, tildes (a&nbsp;<b>~</b>), and all other usual
 1908:      <a href="#whitespace">whitespace</a> characters are completely
 1909:      ignored by mimeTeX, just like they are in LaTeX math mode.
 1910:      As usual, you must explicitly write one of the recognized math
 1911:      spaces to put extra visible space in your rendered expressions. </p>
 1912: 
 1913:  <p> MimeTeX recognizes math spaces <b>\/&nbsp;\,&nbsp;\:&nbsp;\;</b>
 1914:      as well as <b>\quad</b> and <b>\qquad</b>&nbsp;,
 1915:      and also a backslashed blank &nbsp;
 1916:      <img src="../cgi-bin/mimetex.cgi?1$\backsl\raise{-5}{\rotate{-90}]}"
 1917:      alt="" border=0 align=middle> &nbsp;
 1918:      (i.e.,&nbsp;a&nbsp;<b>\</b>&nbsp;followed by a blank).
 1919:      For example, &nbsp;
 1920:      <b>(a\/b\,c\:d\;e\&nbsp;&nbsp;f\quad&nbsp;&nbsp;g\qquad&nbsp;&nbsp;h)</b>
 1921:      &nbsp renders &nbsp;
 1922:         <a href="#preview"><img id="spacing2" onclick="eqntext('spacing2')"
 1923:         src="../cgi-bin/mimetex.cgi?(a\/b\,c\:d\;e\ f\quad g\qquad h)"
 1924:         alt="" border=0 align="middle"></a>.
 1925:      In mimeTeX, you may also write &nbsp; <b>\hspace{10}</b> &nbsp;
 1926:      to insert a 10-pixel (or any other number) space, scaled by any
 1927:      preceding <a href="#unitlength">\unitlength</a>, as illustrated
 1928:      just above. </p>
 1929: 
 1930:  <p> For negative spaces, &nbsp; <b>\!</b> &nbsp; produces a small (two
 1931:      pixel) negative space, e.g., &nbsp; <b>a=b</b> &nbsp; renders &nbsp;
 1932:      <img src="../cgi-bin/mimetex.cgi?a=b"alt="" border=0 align="bottom">
 1933:      &nbsp; whereas &nbsp; <b>a\!=b</b> &nbsp; renders &nbsp;
 1934:      <img src="../cgi-bin/mimetex.cgi?a\!=b"alt="" border=0 align="bottom">
 1935:      &nbsp; and &nbsp; <b>a\!\!=b</b> &nbsp; renders &nbsp;
 1936:      <img src="../cgi-bin/mimetex.cgi?a\!\!=b"alt="" border=0 align="bottom">.
 1937:      For large negative space, &nbsp; <b>\hspace{-10}</b> &nbsp; permits
 1938:      a negative argument.  But it stops at the first pixel to its left
 1939:      rather than "erasing" pixels.  If you don't want to stop, use
 1940:      &nbsp; <b>\hspace*{-10}</b> &nbsp; instead. For example,
 1941:      &nbsp; <b>ABC\hspace*{-20}-DEF</b> &nbsp; renders &nbsp;
 1942:      <img src="../cgi-bin/mimetex.cgi?ABC\hspace*{-20}-DEF"
 1943:      alt="" border=0 align="bottom">, &nbsp; erasing all of the <b>C</b>
 1944:      and the right half of the <b>B</b>. </p>
 1945: 
 1946: <!--
 1947:  <p> Although some browsers occasionally misinterpret typed blank spaces
 1948:      inside html query_string's, mimeTeX also recognizes escaped blanks
 1949:      <img src="../cgi-bin/mimetex.cgi?\small\backsl\raise{-5}{\rotate{-90}]}"
 1950:      alt="" border=0 align=middle> (a <b>\</b> followed by a blank) as math
 1951:      spaces, just in case you can safely use them. </p>
 1952: -->
 1953: 
 1954:  <p> MimeTeX also supports <b>\hfill{<i>textwidth</i>}</b>, where
 1955:      <b><i>textwidth</i></b> is roughly equivalent to LaTeX's
 1956:      <b>\textwidth</b>, i.e., it's the total number of pixels, scaled by
 1957:      <a href="#unitlength">\unitlength</a>, that your entire rendered
 1958:      expression will span.  However, if <b>\hfill{&nbsp;}</b> appears
 1959:      within a <b>{&nbsp;}</b>-enclosed subexpression, then it applies
 1960:      only to that subexpression.  For example, </p> <center>
 1961:         <b>{abc \hfill{75} def} \hfill{150} ghi</b>
 1962:         &nbsp; &nbsp; produces &nbsp; &nbsp;
 1963:         <a href="#preview"><img id="mathspace1" onclick="eqntext('mathspace1')"
 1964:         src="../cgi-bin/mimetex.cgi?\large{abc\hfill{75}def}\hfill{150}ghi"
 1965:         alt="" border=0 align=middle></a> </center> <p class="continue">
 1966:      The first/inner <b>\hfill{75}</b> inserts exactly enough whitespace so
 1967:      that subexpression "<b><i>abc&nbsp;&nbsp;def</i></b>" spans 75 pixels.
 1968:      Then the second/outer <b>\hfill{150}</b> inserts exactly  enough
 1969:      whitespace so that the entire expression spans 150 pixels.
 1970:      Without explicit <b>{&nbsp;}</b>-nesting, mimeTeX evaluates expressions
 1971:      left-to-right (sinistrally), e.g., <b>...\hfill{150}...\hfill{75}...</b>
 1972:      is exactly equivalent to <b>...\hfill{150}{...\hfill{75}...}</b>.
 1973:      Notice that, this time, the second/right <b><i>textwidth</i></b>
 1974:      argument is necessarily smaller than the first/left. </p>
 1975: 
 1976:  <p> Finally, mimeTeX begins a new line whenever you write <b>\\</b>&nbsp;.
 1977:      And you may optionally write <b>\\[10]</b> to put a 10-pixel (or any
 1978:      other number) vertical space, scaled by
 1979:      <a href="#unitlength">\unitlength</a>, between lines.
 1980:      <a href="#array">\begin{eqnarray}</a> also splits long
 1981:      equations over several lines, as illustrated by
 1982:      <a href="#example10">Example&nbsp;10</a> above.
 1983:      But when that's not the best solution, you can also write,
 1984:      for example, </p> <center>
 1985:         <b>y=a+b+c+d\\\hspace{50}+e+f+g+h</b>
 1986:         &nbsp; &nbsp; to produce &nbsp; &nbsp;
 1987:         <a href="#preview"><img id="mathspace2" onclick="eqntext('mathspace2')"
 1988:         src="../cgi-bin/mimetex.cgi?\large y=a+b+c+d\\\hspace{50}+e+f+g+h"
 1989:         alt="" border=0 align=middle></a> </center>
 1990: 
 1991:  <p> However, mimeTeX can't correctly handle automatically-sized delimiters
 1992:      across linebreaks, e.g., </p> <center>
 1993:         <b>y=\left\{a+b+c+d\\\hspace{50}+e+f+g+h\right\}</b>
 1994:         &nbsp; &nbsp; produces &nbsp; &nbsp;
 1995:         <a href="#preview"><img id="mathspace3" onclick="eqntext('mathspace3')"
 1996:         src="../cgi-bin/mimetex.cgi?\large y=\{a+b+c+d\\
 1997:         \hspace{50}+e+f+g+h\}" alt="" border=0 align=middle></a> <br>
 1998: 	whereas you probably wanted &nbsp; &nbsp; &nbsp; &nbsp;
 1999:         <a href="#preview"><img id="mathspace4" onclick="eqntext('mathspace4')"
 2000:         src="../cgi-bin/mimetex.cgi?\large y=\big{a+b+c+d\\
 2001:         \hspace{50}+e+f+g+h\big}" alt="" border=0 align=middle></a>
 2002:         </center> <p class="continue">
 2003:      which I produced using <b>\big{...\\...\big}</b> instead
 2004:      of <b>\left\{...\\...\right\}</b>.  Expressions of the
 2005:      form <b>\left...\right&nbsp;\\&nbsp;\left...\right</b> should all be
 2006:      rendered  properly.  It's only <b>\left...\\...\right</b> that will
 2007:      look odd. </p>
 2008: 
 2009: <h3> <a name="whitespace">Whitespace, Comments,
 2010: and some other characters<font size=5>...</font></a> </h3>
 2011: 
 2012:  <p> Some browsers occasionally misinterpret typed blank spaces
 2013:      inside html query_string's.  In that case, you can write
 2014:      tildes (a&nbsp;<b>~</b>) wherever blanks are required or desired,
 2015:      e.g., <b>\alpha~w</b> instead of <b>\alpha&nbsp;w</b>, or
 2016:      <b>\frac~xy</b> or <b>\sqrt~z</b>, etc.  MimeTeX correctly
 2017:      interprets both blanks and <b>~</b>'s, and all
 2018:      other usual whitespace characters.  So use whatever's convenient
 2019:      as long as it's correctly interpreted inside query_string's by your
 2020:      browser. </p>
 2021: 
 2022:  <p> Similarly, some browsers occasionally misinterpret linebreaks/newlines
 2023:      inside the middle of long html query_string's.
 2024:      For example, </p>
 2025: <pre>&lt;img src="../cgi-bin/mimetex.cgi?f(x)=\frac1{\sigma\sqrt{2\pi}}
 2026:  \int\limits_{-\infty}^xe^{-\frac{(t-\mu)^2}{2\sig^2}}dt"
 2027:  alt="" border=0 align=middle&gt; </pre><p class="continue">
 2028:      breaks a long query_string over two lines.  If your browser interprets
 2029:      this correctly, then mimeTeX will render it correctly, too.  Otherwise,
 2030:      you'll have to enter long expressions on one big long line. </p>
 2031: 
 2032:  <p> If you can break long query_string's over several lines, then you may
 2033:      find mimeTeX's <b>%%comments%%</b> feature useful, too.  Note that
 2034:      comments must be preceded <i>and&nbsp;followed</i> by two <b>%</b>'s
 2035:      rather than LaTeX's usual one.  The above example could be written </p>
 2036: <pre>&lt;img src="../cgi-bin/mimetex.cgi?f(x)=\frac1{\sigma\sqrt{2\pi}} %%normalization%%
 2037:  \int\limits_{-\infty}^xe^{-\frac{(t-\mu)^2}{2\sig^2}}dt        %%integral%%"
 2038:  alt="" border=0 align=middle&gt; </pre>
 2039: 
 2040:  <p> Besides whitespace, browsers may misinterpret embedded apostrophes,
 2041:      and especially quotes, within query strings.  The <b>a's</b> and
 2042:      <b>b's</b> in <a href="#example7">Example&nbsp;7</a> above actually use
 2043:      superscripted commas for apostrophes, i.e., <b>a^,s</b> and <b>b^,s</b>,
 2044:      and you can also use LaTeX <b>\prime</b>'s, as in <b>a^\prime&nbsp;s</b>.
 2045:      For quotes, you can use <b>^{,,}</b> since <b>"</b> almost certainly
 2046:      won't work.  To help make things easier, in addition to the usual
 2047:      LaTeX <b>\prime</b>, mimeTeX also recognizes <b>\apostrophe</b> and
 2048:      <b>\quote</b> and <b>\percent</b>, all with the obvious meanings. </p>
 2049: 
 2050: 
 2051: <h2> <a name="symbols"> (IIIb) Math Symbols, Sizes, and Modes &nbsp; </a></h2>
 2052: 
 2053: <h3> <a name="characters">Character Sets<font size=5>...</font></a> </h3>
 2054: 
 2055:  <p> For complete information about the characters and math symbols
 2056:      available in mimeTeX, you'll need to browse through the bottom
 2057:      500-or-so lines of <b>mimetex.h</b>.  And several additional
 2058:      symbols like <b>\ldots</b> and <b>\AA</b> and <b>\hbar</b> are
 2059:      defined by the mimeTeX preprocessor, function <b>mimeprep(&nbsp;)</b>
 2060:      in <b>mimetex.c</b> &nbsp; &nbsp; Generally speaking, I've tried to
 2061:      encode the cmr10, cmmi10, cmmib10, cmsy10, cmex10, bbold10, rsfs10,
 2062:      stmary10 and wncyr10 families with "names", e.g., <b>\alpha \beta
 2063:      \forall \sqcup</b>, etc, identical to your LaTeX expectations.
 2064:      For example, the calligraphic symbols in cmsy10 are accessed by
 2065:      writing <b>\mathcal{A} \mathcal{B} \mathcal{XYZ}</b>.  Similarly,
 2066:      write <b>\mathbf{A}</b> for the cmmib fonts, write <b>\mathscr{A}</b>
 2067:      for rsfs10, write <b>\mathbb{R}</b> for bbold10, and write
 2068:      <b>{\cyr&nbsp;Khrushchev}</b> or <b>\cyr{Khrushchev}</b> to see
 2069:      <a href="#preview"><img id="cyrillic1" onclick="eqntext('cyrillic1')"
 2070:      src="../cgi-bin/mimetex.cgi?\large\cyr Khrushchev"
 2071:      alt="" border=0 align=middle></a>.
 2072:      Most LaTeX distributions supply stmaryrd.dvi and stmaryrd.sty
 2073:      that both document the names of the stmary10 symbols.
 2074:      Similarly, amsfndoc.dvi documents the names of the wncyr10
 2075:      cyrillic symbols and ligatures. </p>
 2076:      <!-- But there are various additions and omissions and exceptions
 2077:      vis-a-vis LaTeX.  For example, </p>
 2078:       <ul>
 2079:         <li> "Large" operators like \int are often also available as
 2080:              \Bigint, and similarly for \sum \prod \cup \cap, etc.
 2081:              If you find a \Bigxxx in mimetex.h then you'll also find the
 2082:              corresponding \xxx.  \Bigxxx operators are somewhat larger
 2083:              than their \xxx counterparts, and they automatically render
 2084:              super/subscripts in <a href="#modes">displaystyle</a>. </li>
 2085:       </ul> -->
 2086:  <p> I haven't exhaustively checked all the name-number matchings for
 2087:      the hundreds of symbols in mimetex.h.  You can eaily correct
 2088:      any minor mistake you find in what I hope is an obvious manner.
 2089:      The fonts <a href="#fonts">Appendix&nbsp;IVa</a> below provides
 2090:      additional information. </p>
 2091: 
 2092:  <p> In addition to extra LaTeX symbols like <b>\ldots</b>, <b>\AA</b>
 2093:      and <b>\hbar</b>, mentioned above, the mimeTeX preprocessor
 2094:      <b>mimeprep(&nbsp;)</b> also recognizes various html special
 2095:      characters like <b>&amp;lt;</b>, <b>&amp;gt;</b>, <b>&amp;nbsp;</b>,
 2096:      <b>&amp;quot;</b>, <b>&amp;amp;</b>, etc.  Some web tools apparently
 2097:      translate characters like, e.g., <b>&gt;</b> to <b>&amp;gt;</b>,
 2098:      even inside quoted query_string's, so mimeTeX's preprocessor
 2099:      translates them back to LaTeX symbols for you.  Moreover, html
 2100:      misinterprets quotes &nbsp;<b>&quot;</b>&nbsp; inside a quoted
 2101:      query string as the end of the query string.  So, for example,
 2102:      the cyrillic ligature <b>\&quot;E</b> has to be written in the
 2103:      even more cumbersome form <b>\&amp;quot;E</b> inside a query
 2104:      string. </p>
 2105: 
 2106: <h3> <a name="sizes">Font Sizes<font size=5>...</font></a> </h3>
 2107: 
 2108:  <p> MimeTeX currently has eight font sizes, numbered 0-7, with default 3.
 2109:      This font size numbering corresponds to the usual LaTeX directives
 2110:      &nbsp; <b>\tiny</b>, &nbsp; <b>\small</b>, &nbsp; <b>\normalsize</b>,
 2111:      &nbsp; <b>\large</b> (default), &nbsp; <b>\Large</b>, &nbsp;
 2112:      <b>\LARGE</b>, &nbsp; <b>\huge</b> and <b>\Huge</b>.
 2113:      These directives can be placed anywhere in a mimeTeX expression,
 2114:      and they change font size from that point forwards.  However, as usual,
 2115:      a font size change inside a <b>{&nbsp;}</b>-subexpression remains
 2116:      in effect only within that subexpression. </p>
 2117: 
 2118:  <p> In mimeTeX you may also write <b>\fontsize{0}...\fontsize{7}</b> or
 2119:      the shorter <b>\fs{0},...,\fs{7}</b> for <b>\tiny,...,\Huge</b>.
 2120:      And since these arguments are all single digits, the even shorter
 2121:      form <b>\fs0,...,\fs7</b> works equally well.  For example, </p>
 2122:      <center> <table cellpadding=0>
 2123:       <tr align=center>
 2124:         <td align="left"> <b>0</b>: &nbsp;
 2125:          &lt;img src="../cgi-bin/mimetex.cgi?<b>\tiny</b> f(x)=x^2"&gt;
 2126:          &nbsp; produces... </td>
 2127:         <td> <a href="#preview"><img id="sizes0" onclick="eqntext('sizes0')"
 2128:              src="../cgi-bin/mimetex.cgi?\tiny f(x)=x^2"
 2129:              alt="" border=0 align=middle></a> </td> </tr>
 2130:       <tr align=center>
 2131:         <td align="left"> <b>1</b>: &nbsp;
 2132:          &lt;img src="../cgi-bin/mimetex.cgi?<b>\fs1</b> f(x)=x^2"&gt; </td>
 2133:         <td> <a href="#preview"><img id="sizes1" onclick="eqntext('sizes1')"
 2134:              src="../cgi-bin/mimetex.cgi?\fs1 f(x)=x^2"
 2135:              alt="" border=0 align=middle></a> </td> </tr>
 2136:       <tr align=center>
 2137:         <td align="left"> <b>2</b>: &nbsp;
 2138:          &lt;img src="../cgi-bin/mimetex.cgi?<b>\normalsize</b> f(x)=x^2"&gt; </td>
 2139:         <td> <a href="#preview"><img id="sizes1" onclick="eqntext('sizes1')"
 2140:              src="../cgi-bin/mimetex.cgi?\normalsize f(x)=x^2"
 2141:              alt="" border=0 align=middle></a> </td> </tr>
 2142:       <tr align=center>
 2143:         <td align="left"> <b>3</b>: &nbsp;
 2144:          &lt;img src="../cgi-bin/mimetex.cgi?<b></b>f(x)=x^2"&gt; </td>
 2145:         <td> <a href="#preview"><img id="sizes3" onclick="eqntext('sizes3')"
 2146:              src="../cgi-bin/mimetex.cgi?f(x)=x^2"
 2147:              alt="" border=0 align=middle></a> </td> </tr>
 2148:       <tr align=center>
 2149:         <td align="left"> <b>4</b>: &nbsp;
 2150:          &lt;img src="../cgi-bin/mimetex.cgi?<b>\Large</b> f(x)=x^2"&gt; </td>
 2151:         <td> <a href="#preview"><img id="sizes4" onclick="eqntext('sizes4')"
 2152:              src="../cgi-bin/mimetex.cgi?\Large f(x)=x^2"
 2153:              alt="" border=0 align=middle></a> </td> </tr>
 2154:       <tr align=center>
 2155:         <td align="left"> <b>5</b>: &nbsp;
 2156:          &lt;img src="../cgi-bin/mimetex.cgi?<b>\fs5</b> f(x)=x^2"&gt; </td>
 2157:         <td> <a href="#preview"><img id="sizes5" onclick="eqntext('sizes5')"
 2158:              src="../cgi-bin/mimetex.cgi?\fs5f(x)=x^2"
 2159:              alt="" border=0 align=middle></a> </td> </tr>
 2160:       <tr align=center>
 2161:         <td align="left"> <b>6</b>: &nbsp;
 2162:          &lt;img src="../cgi-bin/mimetex.cgi?<b>\huge</b> f(x)=x^2"&gt; </td>
 2163:         <td> <a href="#preview"><img id="sizes6" onclick="eqntext('sizes6')"
 2164:              src="../cgi-bin/mimetex.cgi?\huge f(x)=x^2"
 2165:              alt="" border=0 align=middle></a> </td> </tr>
 2166:       <tr align=center>
 2167:         <td align="left"> <b>7</b>: &nbsp;
 2168:          &lt;img src="../cgi-bin/mimetex.cgi?<b>\fs7</b> f(x)=x^2"&gt; </td>
 2169:         <td> <a href="#preview"><img id="sizes7" onclick="eqntext('sizes7')"
 2170:              src="../cgi-bin/mimetex.cgi?\fs7 f(x)=x^2"
 2171:              alt="" border=0 align=middle></a> </td> </tr>
 2172:      </table> </center> <p class="continue">
 2173:      rendering <b>f(x)=x^2</b> in mimeTeX font sizes &nbsp;
 2174:      <b>0</b> (\tiny or \fs0), &nbsp; <b>1</b> (\small or \fs1), &nbsp;
 2175:      <b>2</b> (\normalsize or \fs2), &nbsp; <b>3</b> (default \large), &nbsp;
 2176:      <b>4</b> (\Large or \fs4), &nbsp; <b>5</b> (\LARGE or \fs5), &nbsp;
 2177:      <b>6</b> (\huge or \fs6) &nbsp; and &nbsp; <b>7</b> (\Huge or \fs7). </p>
 2178: 
 2179:  <p> You'll soon notice that exponents and \frac's and \atop's
 2180:      are automatically rendered one size smaller than their base
 2181:      expressions.  For example, </p> <center>
 2182:         <b>\Large y=e^{x^2}</b> &nbsp; produces &nbsp;
 2183:         <a href="#preview"><img id="sizes4" onclick="eqntext('sizes4')"
 2184:         src="../cgi-bin/mimetex.cgi?\Large y=e^{x^2}"
 2185:         alt="" border=0 align=middle></a> </center> <p class="continue">
 2186:      rendering the <b>"y=e"</b> in font size 4 (\Large), the <b>"x"</b> in
 2187:      font size 3 (\large), and the <b>"2"</b> in font size 2 (\normalsize).
 2188:      If you get below font size 0, the font size remains&nbsp;0. </p>
 2189: 
 2190:  <p> Explicit size declarations override mimeTeX's default sizing behavior.
 2191:      You can rewrite the preceding example as, say, </p> <center>
 2192:         <b>\Large y=e^{\normalsize x^{\tiny2}}</b> &nbsp; which now produces
 2193:         &nbsp; <a href="#preview"><img id="sizes5" onclick="eqntext('sizes5')"
 2194:         src="../cgi-bin/mimetex.cgi?\Large y=e^{\normalsize x^{\tiny2}}"
 2195:         alt="" border=0 align=middle></a> </center> <p class="continue">
 2196:      rendering the <b>"y=e"</b> in font size 4 (\Large unchanged),
 2197:      the <b>"x"</b> in font size 2 (\normalsize), and the <b>"2"</b>
 2198:      in font size&nbsp;0 (\tiny). </p>
 2199: 
 2200:  <p> Preceding an <b>\fs{&nbsp;}</b> size argument with <b>+</b> or
 2201:      <b>-</b> specifies "relative" sizing.  For example,
 2202:      <b>\large\text{abc{\fs{-2}def}ghi}</b> produces
 2203:      <a href="#preview"><img id="sizes6" onclick="eqntext('sizes6')"
 2204:      src="../cgi-bin/mimetex.cgi?\large\text{abc{\fs{-2}def}ghi}"
 2205:      alt="" border=0 align=middle></a>, rendering the <b>"def"</b>
 2206:      in font size 1 (two sizes smaller than \large).  Note that
 2207:      <b>\fs{-2}</b> affects only the subexpression in which it appears,
 2208:      and that its braces  are no longer optional since <b>-2</b> contains
 2209:      two characters.  For exponents (or any other size-changing commands
 2210:      like \frac), </p> <center>
 2211:         <b>\Large y=e^{\fs{-1}x^2}</b> &nbsp; produces &nbsp;
 2212:         <a href="#preview"><img id="sizes7" onclick="eqntext('sizes7')"
 2213:         src="../cgi-bin/mimetex.cgi?\Large y=e^{\fs{-1}x^2}"
 2214:         alt="" border=0 align=middle></a> </center> <p class="continue">
 2215:      rendering the <b>"y=e"</b> in font size 4 (\Large), as usual.
 2216:      The <b>"x"</b> would usually be rendered one size smaller,
 2217:      in font size 3, and your <b>\fs{-1}</b> is applied to that,
 2218:      resulting in font size 2.   And the final <b>"2"</b> is rendered,
 2219:      by the usual rules, one size smaller than the <b>"x"</b>,
 2220:      in font size&nbsp;1. </p>
 2221: 
 2222: <h3> <a name="modes">Modes<font size=5>...</font></a> </h3>
 2223: 
 2224:  <p> MimeTeX is always in a math-like mode, so you needn't surround
 2225:      expressions with <b>$...$</b>'s for <b>\textstyle</b>,
 2226:      or <b>$$...$$</b>'s for <b>\displaystyle</b>.
 2227:      <!-- or <b>\[...\]</b>'s, etc.  In fact, mimeTeX interprets <b>$</b>
 2228:      as a "preamble" terminator (e.g., see <a href="#array">\array</a>
 2229:      below), and interprets <b>\[...\]</b> as an abbreviation for
 2230:      <b>\left[...\right]</b>. -->
 2231:      By default, operator limits like <b>\int_a^b</b> are rendered
 2232:      <b>\textstyle</b> <a href="#preview">
 2233:      <img id="modes99a" onclick="eqntext('modes99a')"
 2234:      src="../cgi-bin/mimetex.cgi?\normalsize\int_a^b"
 2235:      alt="" border=0 align=middle></a> at font sizes <b>\normalsize</b>
 2236:      and smaller, and rendered <b>\displaystyle</b> <a href="#preview">
 2237:      <img id="modes99b" onclick="eqntext('modes99b')"
 2238:      src="../cgi-bin/mimetex.cgi?\large\int_a^b"
 2239:      alt="" border=0 align=middle></a> at font sizes <b>\large</b> and
 2240:      larger (see the <b>-DDISPLAYSIZE</b>
 2241:      <a href="#options">compile&nbsp;option</a> to change this default).
 2242:      And when <b>\displaystyle</b> is invoked (either implicitly at font size
 2243:      <b>\large</b> or larger, or if you explicitly write <b>\displaystyle</b>
 2244:      at any font size), then operators <b>\int</b>, <b>\sum</b>,
 2245:      <b>\prod</b>, etc, are automatically promoted to larger sizes.
 2246:      <!-- their <a href="#characters">\Bigxxx</a> counterparts. -->
 2247:      <!-- Conversely, <b>\displaystyle</b> is applied to all
 2248:      <a href="#characters">\Bigxxx</a> operators regardless of font size. -->
 2249:      <!-- i.e., super/subscripts are placed  directly above/below
 2250:      <b>\Bigsum</b>, but "alongside" <b>\sum</b>. -->
 2251:      For example, </p> <center>
 2252:         <!-- <b>\Bigsum_{i=1}^ni=\frac{n(n+1)}2</b> &nbsp; produces &nbsp;
 2253:         <a href="#preview"><img id="modes1a" onclick="eqntext('modes1a')"
 2254:         src="../cgi-bin/mimetex.cgi?
 2255:         \normalsize\Bigsum_{i=1}^ni=\frac{n(n+1)}2"
 2256:         alt="" border=0 align=middle></a>, <br> -->
 2257:         <b>\normalsize \sum_{i=1}^ni=\frac{n(n+1)}2</b>
 2258:         &nbsp; &nbsp; produces &nbsp; &nbsp;
 2259:         <a href="#preview"><img id="modes2a" onclick="eqntext('modes2a')"
 2260:         src="../cgi-bin/mimetex.cgi?\normalsize\sum_{i=1}^ni=\frac{n(n+1)}2"
 2261:         alt="" border=0 align=middle></a>, &nbsp; whereas <br>
 2262:         <b>\displaystyle \normalsize \sum_{i=1}^ni=\frac{n(n+1)}2</b>
 2263:         &nbsp;produces&nbsp;
 2264:         <a href="#preview"><img id="modes1b" onclick="eqntext('modes1b')"
 2265:         src="../cgi-bin/mimetex.cgi?
 2266:         \normalsize\displaystyle\sum_{i=1}^ni=\frac{n(n+1)}2"
 2267:         alt="" border=0 align=middle></a>, </center>
 2268:      <p class=continue> and <!-- replacing <b>\Bigsum</b> with the smaller
 2269:      <b>\sum</b> symbol, --> </p> <center>
 2270:         <b>\large \sum_{i=1}^ni=\frac{n(n+1)}2</b> &nbsp; produces &nbsp;
 2271:         <a href="#preview"><img id="modes1b" onclick="eqntext('modes1b')"
 2272:         src="../cgi-bin/mimetex.cgi?\large\sum_{i=1}^ni=\frac{n(n+1)}2"
 2273:         alt="" border=0 align=middle></a>, &nbsp; whereas <br>
 2274:         <b>\textstyle \large \sum_{i=1}^ni=\frac{n(n+1)}2</b>
 2275:         &nbsp; &nbsp; produces &nbsp; &nbsp;
 2276:         <a href="#preview"><img id="modes2b" onclick="eqntext('modes2b')"
 2277:         src="../cgi-bin/mimetex.cgi?\textstyle\large
 2278:         \sum_{i=1}^ni=\frac{n(n+1)}2" alt="" border=0 align=middle></a>.
 2279:         <!-- &nbsp; instead. --> </center>
 2280: 
 2281:  <p> As usual, <b>\nolimits</b> turns displaystyle off (or textstyle on)
 2282:      for the operator immediately preceding it.  For example, </p> <center>
 2283:         <b>\large \sum\nolimits_{i=1}^ni=\frac{n(n+1)}2</b>
 2284:         &nbsp; produces &nbsp;
 2285:         <a href="#preview"><img id="modes3" onclick="eqntext('modes3')"
 2286:         src="../cgi-bin/mimetex.cgi?
 2287:         \large\sum\nolimits_{i=1}^ni=\frac{n(n+1)}2"
 2288:         alt="" border=0 align=middle></a></center> <p class="continue">
 2289:      and likewise, <b>\limits</b> turns displaystyle on for the operator
 2290:      immediately preceding it.  For example, </p> <center>
 2291:         <b>\normalsize \sum\limits_{i=1}^ni=\frac{n(n+1)}2</b>
 2292:         &nbsp; produces &nbsp;
 2293:         <a href="#preview"><img id="modes4" onclick="eqntext('modes4')"
 2294:         src="../cgi-bin/mimetex.cgi?
 2295:         \normalsize\sum\limits_{i=1}^ni=\frac{n(n+1)}2"
 2296:         alt="" border=0 align=middle></a> </center>
 2297: 
 2298:  <p> By the way, <b>\limits</b> affects <i><b>_any_</b></i> character
 2299:      or subexpression immediately preceding it.  For example, </p> <center>
 2300:         <b>A^i_j</b> &nbsp; produces &nbsp;
 2301:         <a href="#preview"><img id="modes5" onclick="eqntext('modes5')"
 2302:         src="../cgi-bin/mimetex.cgi?\large A^i_j"
 2303:         alt="" border=0 align=middle></a> &nbsp; &nbsp; as usual, whereas <br>
 2304:         <b>A\limits^i_j</b> &nbsp; produces &nbsp;
 2305:         <a href="#preview"><img id="modes6" onclick="eqntext('modes6')"
 2306:         src="../cgi-bin/mimetex.cgi?\large A\limits^i_j"
 2307:         alt="" border=0 align=middle></a> &nbsp; instead. </center>
 2308:      <p class="continue">Likewise, for subexpressions, </p> <center>
 2309:         <b>\widehat{xyz}\limits^a</b> &nbsp; produces &nbsp;
 2310:         <a href="#preview"><img id="modes7" onclick="eqntext('modes7')"
 2311:         src="../cgi-bin/mimetex.cgi?\large\widehat{xyz}\limits^a"
 2312:         alt="" border=0 align=middle></a> </center> <p class="continue">
 2313:      This side effect may occasionally be useful.  For example, </p> <center>
 2314:         <b>x\rightarrow\limits^gy</b> &nbsp; produces &nbsp;
 2315:         <a href="#preview"><img id="modes8" onclick="eqntext('modes8')"
 2316:         src="../cgi-bin/mimetex.cgi?\large x\rightarrow\limits^gy"
 2317:         alt="" border=0 align=middle></a> </center> <p class="continue">
 2318:      (mimeTeX automatically centers super/subscripts above/below
 2319:      the long and Long <a href="#arrows">arrow</a> forms) </p>
 2320: 
 2321:  <p> The <b>\displaystyle</b> command turns on displaystyle math mode for
 2322:      the entire expression (or <b>{&nbsp;}</b>-enclosed subexpression),
 2323:      affecting <b><i>_all_</i></b> super/subscripts to the right
 2324:      of the \displaystyle, except for character classes Ordinary and
 2325:      Variable (TeXbook page 154).  Similarly, <b>\textstyle</b> turns
 2326:      off displaystyle math mode.  For example, </p> <center>
 2327:         <b>\sum_1^n {\displaystyle\sum_1^k\sum_1^lx_i^j} \sum_1^m</b>
 2328:         &nbsp; produces &nbsp;
 2329:         <a href="#preview"><img id="modes9" onclick="eqntext('modes9')"
 2330:         src="../cgi-bin/mimetex.cgi?\normalsize\sum_1^n
 2331:         {\displaystyle\sum_1^k\sum_1^lx_i^j}\sum_1^m"
 2332:         alt="" border=0 align=middle></a> </center> <p class="continue">
 2333:      Note that <b>\sum</b>'s within the subexpression are all affected by
 2334:      the beginning <b>\displaystyle</b>, but not the Variable <b>x_i^j</b>.
 2335:      An explicit <b>x\limits_i^j</b> always affects any preceding term. </p>
 2336: 
 2337: <h3> <a name="textboxes">text boxes<font size=5>...</font></a> </h3>
 2338: 
 2339:  <p> Finally, mimeTeX also has a text-like/roman mode
 2340:      entered by writing either <b>\text{anything&nbsp;at&nbsp;all}</b>
 2341:      or the equivalent LaTeX-2.09-like command
 2342:      <b>{\rm&nbsp;anything&nbsp;at&nbsp;all}</b>, both of which render
 2343:      <b>anything&nbsp;at&nbsp;all</b> in roman (font family cmr10).
 2344:      <b>\mbox{&nbsp;}</b> and several similar LaTeX commands are
 2345:      recognized by mimeTeX as synonyms for <b>\text{&nbsp;}</b>.
 2346:      For italic, write <b>\textit{anything&nbsp;at&nbsp;all}</b> or
 2347:      <b>{\it&nbsp;anything&nbsp;at&nbsp;all}</b>, both of which render
 2348:      <b>anything&nbsp;at&nbsp;all</b> in italic (font family cmmi10).
 2349:      All four forms respect spaces between words, except that the
 2350:      first/required  space after <b>{\rm&nbsp;etc}</b> and
 2351:      <b>{\it&nbsp;etc}</b> is still ignored.  <!-- Math <b>$...$</b>
 2352:      subexpressions inside <b>\mbox{&nbsp;}</b> or <b>\text{&nbsp;}</b>
 2353:      are treated in the usual way. -->  For example, </p> <center>
 2354:         <b>anything&nbsp;at&nbsp;all</b> &nbsp; just produces &nbsp;
 2355:         <a href="#preview"><img id="textboxes1" onclick="eqntext('textboxes1')"
 2356:         src="../cgi-bin/mimetex.cgi?\normalsize anything at all"
 2357:         alt="" border=0 align=middle></a> &nbsp; &nbsp; whereas <br> <br>
 2358:         <b>\text{anything&nbsp;at&nbsp;all}</b> &nbsp; produces &nbsp;
 2359:         <a href="#preview"><img id="textboxes2" onclick="eqntext('textboxes2')"
 2360:         src="../cgi-bin/mimetex.cgi?\normalsize\text{anything at all}"
 2361:         alt="" border=0 align=middle></a> &nbsp; &nbsp; and <br> <br>
 2362:         <b>\textit{anything&nbsp;at&nbsp;all}</b> &nbsp; produces &nbsp;
 2363:         <a href="#preview"><img id="textboxes3" onclick="eqntext('textboxes3')"
 2364:         src="../cgi-bin/mimetex.cgi?\normalsize\textit{anything at all}"
 2365:         alt="" border=0 align=middle></a> &nbsp; &nbsp; instead. </center>
 2366: 
 2367:  <p> You don't usually surround mimeTeX expressions with <b>$</b>'s,
 2368:      but that works in the usual way for <b>\text{&nbsp;}</b> and
 2369:      <b>\mbox{&nbsp;}</b>, rendering the <b>$...$</b>-enclosed
 2370:      subexpression in mathmode.  For example, </p> <center>
 2371:         <b>n=\left\{m/2\text{&nbsp; &nbsp; if $m$ even}
 2372:         \\(m+1)/2\text{&nbsp; if $m$ odd}\right.</b>
 2373:         &nbsp; produces &nbsp;
 2374:         <a href="#preview"><img id="textboxes9" onclick="eqntext('textboxes9')"
 2375:         src="../cgi-bin/mimetex.cgi?
 2376:         n=\left\{m/2\text{    if $m$ even}\\(m+1)/2\text{ if $m$ odd}\right."
 2377:         alt="" border=0 align=middle></a> </center>
 2378: 
 2379: 
 2380: <h2> <a name="delimiters"> (IIIc) Delimiters &nbsp; </a> </h2>
 2381: 
 2382: <h3> <a name="parens">Parentheses and Braces
 2383: (delimiters)<font size=5>...</font></a> </h3>
 2384: 
 2385:  <p> LaTeX's <b>\left(&nbsp;...&nbsp;\right)</b> and the other 21
 2386:      standard LaTeX delimiters are also recognized by mimeTeX.
 2387:      And mimeTeX also recognizes an etex-like <b>\middle</b>. &nbsp;
 2388:      <!-- may be written exactly
 2389:      like that, or may be abbreviated <b>\(</b> and <b>\)</b> in mimeTeX.
 2390:      Not all <b>\left</b> and <b>\right</b> LaTeX delimiters are currently
 2391:      available in mimeTeX, but those that are can be written in the usual
 2392:      way, or can be abbreviated as described above.  One exception is
 2393:      that <b>\left\|...\right\|</b> must instead be abbreviated
 2394:      <b>\=...\=</b> or can be written in full <b>\left\|...\right\|</b>
 2395:      as usual.  Also, <b>\left\langle...\right\rangle</b> is abbreviated
 2396:      <b>\&lt;...\&gt;</b>&nbsp;. </p> -->
 2397:      <!-- <p> Mixing abbreviated and unabbreviated delimiters within
 2398:      a matching pair is not allowed, e.g., \left(...\) <b>_won't_</b> work.
 2399:      But you can mix nested pairs, e.g., <b>\left(...\(...\)...\right)</b>
 2400:      will work as long as the matching delimiters comprising each pair are
 2401:      either both abbreviated or both unabbreviated. </p>
 2402:      <p> --> Several of the most common automatically sized delimiters
 2403:      are illustrated below... </p> <center>
 2404:        <!-- <table cellpadding=3 cellspacing=0 border=1> -->
 2405:        <table cellspacing=0 cellpadding=2 border=1>
 2406:         <tr align=center>
 2407:            <!-- <td> <b>LaTeX or <br> mimeTeX</b> </td> -->
 2408:            <td> <b>Delimiter</b> </td>
 2409:            <!-- <td> <b>or mimeTeX <br> abbreviation</b> </td> -->
 2410:            <td> <b>example...</b> </td>
 2411:            <td> <b>...renders</b> </td>
 2412:         </tr>
 2413:         <tr align=center>
 2414:            <td> \left(&nbsp;...&nbsp;\right) </td>
 2415:            <!-- <td> \(&nbsp;...&nbsp;\) </td> -->
 2416:            <td> \left( \frac1{1-x^2} \right)^2 </td>
 2417:            <td> <a href="#preview"><img id="parens1" onclick="eqntext('parens1')"
 2418:                  src="../cgi-bin/mimetex.cgi?\Large\left(\frac1{1-x^2}\right)^2"
 2419:                  alt="" border=0 align=middle></a> </td>
 2420:         </tr>
 2421:         <tr align=center>
 2422:            <td> \left[&nbsp;...&nbsp;\right] </td>
 2423:            <!-- <td> \[&nbsp;...&nbsp;\] </td> -->
 2424:            <td> \left[ \frac1{\sqrt2}x - y \right]^n </td>
 2425:            <td> <a href="#preview"><img id="parens2" onclick="eqntext('parens2')"
 2426:                  src="../cgi-bin/mimetex.cgi?\Large
 2427:                  \left[ \frac1{\sqrt2}x - y \right]^n"
 2428:                  alt="" border=0 align=middle></a> </td>
 2429:         </tr>
 2430:         <tr align=center>
 2431:            <td> \left\{&nbsp;...&nbsp;\right\} </td>
 2432:            <!-- <td> \{&nbsp;...&nbsp;\} </td> -->
 2433:            <td> \left\{ 1^2,2^2,3^2,\ldots \right\} </td>
 2434:            <td> <a href="#preview"><img id="parens3" onclick="eqntext('parens3')"
 2435:                  src="../cgi-bin/mimetex.cgi?
 2436:                  \large\left\{1^2,2^2,3^2,\ldots\right\}"
 2437:                  alt="" border=0 align=middle></a> </td>
 2438:         </tr>
 2439:         <tr align=center>
 2440:            <td> \left\langle &nbsp; ...<br>
 2441:                 &nbsp; &nbsp; &nbsp; &nbsp; ... &nbsp;\right\rangle </td>
 2442:            <!-- <td> \<&nbsp;...&nbsp;\> </td> -->
 2443:            <td> \left\langle \varphi \middle| \hat H <br>
 2444:                 &nbsp; &nbsp; &nbsp; &nbsp; \middle| \phi \right\rangle </td>
 2445:            <td> <a href="#preview"><img id="parens4" onclick="eqntext('parens4')"
 2446:                  src="../cgi-bin/mimetex.cgi?\Large
 2447:                  \left\langle\varphi\middle|\hat H\middle|\phi\right\rangle"
 2448:                  alt="" border=0 align=middle></a> </td>
 2449:         </tr>
 2450:         <tr align=center>
 2451:            <td> \left|&nbsp;...&nbsp;\right| </td>
 2452:            <!-- <td> \|&nbsp;...&nbsp;\| </td> -->
 2453:            <td> \left| \begin{matrix} a_1 & a_2 \\<br>
 2454:                 &nbsp; &nbsp; &nbsp; a_3 & a_4 \end{matrix} \right|</td>
 2455:            <td> <a href="#preview"><img id="parens5" onclick="eqntext('parens5')"
 2456:                  src="../cgi-bin/mimetex.cgi?\large
 2457:                  \left|\begin{matrix}a_1&a_2\\a_3&a_4\end{matrix}\right|"
 2458:                  alt="" border=0 align=middle></a> </td>
 2459:         </tr>
 2460:         <tr align=center>
 2461:            <td> \left\|&nbsp;...&nbsp;\right\| </td>
 2462:            <!-- <td> \=&nbsp;...&nbsp;\= </td> -->
 2463:            <td> \left\|x^2-y^2\right\| </td>
 2464:            <td> <a href="#preview"><img id="parens6" onclick="eqntext('parens6')"
 2465:                  src="../cgi-bin/mimetex.cgi?\large\left\|x^2-y^2\right\|"
 2466:                  alt="" border=0 align=middle></a> </td>
 2467:         </tr>
 2468:         <tr align=center>
 2469:            <td> \left\{&nbsp;...&nbsp;
 2470:                 \right<font size="5"><b>.</b></font> </td>
 2471:            <!-- <td> \{&nbsp;...&nbsp;\<b>.</b> </td> -->
 2472:            <td> y=\left\{ \text{this\\that}
 2473:                 \right<font size="5"><b>.</b></font> </td>
 2474:            <td> <a href="#preview"><img id="parens7" onclick="eqntext('parens7')"
 2475:                  src="../cgi-bin/mimetex.cgi?
 2476:                  \large y=\left\{\text{this\\that}\right."
 2477:                  alt="" border=0 align=middle></a> </td>
 2478:         </tr>
 2479:         <tr align=center>
 2480:            <td> \left<font size="5"><b>.</b></font>
 2481:                 &nbsp;...&nbsp;\right\} </td>
 2482:            <!-- <td> \<b>.</b>&nbsp;...&nbsp;\} </td> -->
 2483:            <td> \left<font size="5"><b>.</b></font>
 2484:                 \text{this\\that} \right\}=y </td>
 2485:            <td> <a href="#preview"><img id="parens8" onclick="eqntext('parens8')"
 2486:                  src="../cgi-bin/mimetex.cgi?
 2487:                  \large\left.\text{this\\that}\right\}=y"
 2488:                  alt="" border=0 align=middle></a> </td>
 2489:         </tr>
 2490:        </table> </center>
 2491:  <p> <b><u>Notes...&nbsp;</u></b> </p>
 2492:      <ol compact type=1>
 2493:        <!-- <li> The other LaTeX delimiters, i.e., floor's, ceil's,
 2494:             arrows, etc, can't yet be sized to fit. </li> -->
 2495:        <li> <a href="#sizes">Size&nbsp;declarations</a> inside any of the
 2496:             above delimiter pairs affect only the enclosed subexpression,
 2497:             e.g., <b>\Large w=\left(\small x+y\right)+z</b> produces
 2498:             <a href="#preview"><img id="parens9" onclick="eqntext('parens9')"
 2499:             src="../cgi-bin/mimetex.cgi?\Large w=\left(\small x+y\right)+z"
 2500:             alt="" border=0 align=middle></a> </li>
 2501:        <li> An expression may contain as many etex-like <b>\middle</b>'s as
 2502:             you like, and in mimeTeX the surrounding <b>\left...\right</b>
 2503:             isn't required.  When omitted, the scope of <b>\middle</b> is
 2504:             either the entire expression or the &nbsp; <b>{&nbsp;}</b>-enclosed
 2505:             subexpression in which the <b>\middle</b>'s occur.  For example, &nbsp;
 2506:             <b>\frac{a+1}b&nbsp;\middle/&nbsp;\middle(\frac{c+1}d&nbsp;\middle/&nbsp;\frac{e+1}f\middle)</b>
 2507:             &nbsp; renders &nbsp;
 2508:             <img src="../cgi-bin/mimetex.cgi?\large
 2509:             \frac{a+1}b\middle/\middle(\frac{c+1}d\middle/\frac{e+1}f\middle)"
 2510:             border=0 align=middle>. </li>
 2511:        <li> In the last two examples, note that mimeTeX recognizes the
 2512:             &nbsp; <b>\\</b> &nbsp; in &nbsp; <b>\text{this\\that}</b> &nbsp;
 2513:             as a linebreak.  For example, <b>x=1\\y=2\\z=3</b> renders &nbsp;
 2514:             <a href="#preview"><img id="parens9b" onclick="eqntext('parens9b')"
 2515:             src="../cgi-bin/mimetex.cgi?\small x=1\\y=2\\z=3"
 2516:             alt="" border=0 align=middle></a> </li>
 2517:        <!-- <li> An abbreviated left delimiter must be paired with the same
 2518:             "type" of matching right delimiter, e.g., <b>\[...\]</b> works
 2519:             whereas <b>\[...\)</b> doesn't work.  To render an "unmatched"
 2520:             pair of delimiters you must use the unabbreviated form, e.g.,
 2521:             <b>\left[...\right)</b> works fine. </li> -->
 2522:        <!-- <li> Similarly, "unusual" delimiter abbreviations like
 2523:             <b>\)...\(</b> also don't work in mimeTeX.  That is, &nbsp;
 2524:             <b>(,&nbsp;[,&nbsp;&lt;,&nbsp;{,</b> etc, must always be "left"
 2525:             in mimeTeX, and &nbsp; <b>),&nbsp;],&nbsp;&gt;,&nbsp;},</b> etc,
 2526:             must always be "right".  To render "unusual" delimiter pairs you
 2527:             must use the unabbreviated form, e.g., <b>\left)...\right[</b>
 2528:             works fine. </li> -->
 2529:        <!-- <li> <b>\right.</b> may be paired with any of the automatically
 2530:             sized delimiters, and may optionally be abbreviated as <b>\.</b>
 2531:             &nbsp;&nbsp; The same <b>\.</b> also serves as an abbreviation
 2532:             for <b>\left.</b> &nbsp;&nbsp; MimeTeX correctly interprets your
 2533:             intention if you correctly  balance delimiters.  For example,
 2534:             either <b>y=\left\{{this\atop&nbsp;that}\right.</b> or
 2535:             <b>y=\{{this\atop&nbsp;that}\.</b> renders the usual useful
 2536:             construction
 2537:             <a href="#preview"><img id="parens10" onclick="eqntext('parens10')"
 2538:             src="../cgi-bin/mimetex.cgi?
 2539:             \normalsize y=\{\text{this\atop that}\."
 2540:             alt="" border=0 align=middle></a> illustrated above. </li> -->
 2541:        <!-- <li> However, abbreviated <b>\.</b>'s cannot be nested in mimeTeX,
 2542:             e.g., <b>\[\(...\.\.</b> doesn't work.  Instead, unabbreviated
 2543:             <b>\left.</b> and <b>\right.</b> may be nested, e.g.,
 2544:             <b>\left[\left(...\right.\right.</b> works fine. </li> -->
 2545:        <!-- <li> Simply nested abbreviations like <b>\[\(...\)\]</b> work
 2546:             fine in mimeTeX.  But abbreviated delimiters like <b>\|...\|</b>
 2547:             and <b>\=...\=</b>, whose left and right forms are
 2548:             identical, cannot be nested.  To nest these delimiters you
 2549:             must use the corresponding unabbreviated <b>\left|..\right|</b>
 2550:             and <b>\left\|...\right\|</b>. </li> -->
 2551:        <!-- <li> All <b>\left(...\right)</b>'s (and abbreviated
 2552:             <b>\(...\)</b>'s), etc, must be correctly balanced,
 2553:             which may include being matched with <b>\left.</b>
 2554:             or <b>\right.</b> (or abbreviated <b>\.</b>).
 2555:             &nbsp;&nbsp; And, to repeat, you may <b>_not_</b> mix
 2556:             abbreviated and unabbreviated \(...\right), etc, within a
 2557:             matching pair. </li> -->
 2558:      </ol>
 2559: 
 2560:  <p> Besides the <b>\left...\right</b> delimiters discussed above,
 2561:      mimeTeX also supports constructions like
 2562:      <b>\left\int_a^b...\right<b>.</b></b>&nbsp;, which automatically
 2563:      sizes the <b>\left\int</b> to accommodate everything between it
 2564:      and its matching <b>\right<b>.</b></b> &nbsp; delimiter.
 2565:      The <b>\right</b> delimiter needn't necessarily be
 2566:      the <b>\right<b>.</b></b> &nbsp; illustrated, e.g.,
 2567:      <b>\left\int_a^b&nbsp;x^2dx&nbsp;=\frac{x^3}3\right|_a^b</b>
 2568:      produces
 2569:      <a href="#preview"><img id="parens11" onclick="eqntext('parens11')"
 2570:      src="../cgi-bin/mimetex.cgi?\large
 2571:      \left\int_a^bx^2dx=\frac{x^3}3\right|_a^b" border=0 alt=""
 2572:      align=middle></a>.  <!-- Except for Opening (TeX class 4) and
 2573:      Closing (class 5) delimiter characters like <b>(&nbsp;)</b> and
 2574:      <b>[&nbsp;]</b> and <b>\{&nbsp;\}</b>, limits are default-rendered
 2575:      \displaystyle, which is why <b>\right|\nolimits_a^b</b> was required. -->
 2576:      You can also write <b>\left\sum</b>, <b>\left\prod</b>,
 2577:      <b>\left\cup</b>, etc, for many of the symbols in CMEX10 and STMARY10.
 2578:      And any symbol that works with <b>\left</b> will also work
 2579:      with <b>\right</b>&nbsp;.  <!-- But mimeTeX abbreviations like &nbsp;
 2580:      <b>\(...\)</b> &nbsp; for &nbsp; <b>\left(...\right)</b> &nbsp;
 2581:      won't work with any of these CMEX10 symbols.  You'll have to write
 2582:      the usual unabbreviated <b>\left...\right</b> form. --> </p>
 2583: 
 2584:  <p> Unescaped <b>(&nbsp;)</b>'s and <b>[&nbsp;]</b>'s and <b>|&nbsp;|</b>'s
 2585:      and <b>&lt;&nbsp;&gt;</b>'s don't need to be balanced since mimeTeX just
 2586:      displays them like ordinary characters without any special significance.
 2587:      Ditto for the usual four <b>\big(</b> and <b>\Big(</b> and <b>\bigg(</b>
 2588:      and <b>\Bigg(</b>, and for their four right <b>)</b> counterparts, which
 2589:      just display <b>(...)</b>'s at fixed larger sizes, and also have no
 2590:      special significance.  All four big <b>[&nbsp;]</b>'s and
 2591:      <b>&lt;&nbsp;&gt;</b>'s and <b>{&nbsp;}</b>'s are also available
 2592:      as ordinary characters. </p>
 2593: 
 2594:  <p> As usual, unescaped <b>{...}</b>'s aren't displayed at all,
 2595:      must be balanced, and have the usual special LaTeX significance.
 2596:      MimeTeX interprets escaped <b>\{...\}</b>'s as abbreviations
 2597:      for <b>\left\{...\right\}</b> and therefore always sizes them to fit.
 2598:      If you need displayed but unsized <b>{...}</b>'s, write
 2599:      <b>\lbrace...\rbrace</b> or any of the four <b>\big{...\big}</b>'s. </p>
 2600: 
 2601: 
 2602: <h2> <a name="accents"> (IIId) Accents, Functions, Arrows,
 2603: Raise&nbsp;and&nbsp;rotate, Compose, Abbreviations, etc. &nbsp; </a> </h2>
 2604: 
 2605: <h3> Accents<font size=5>...</font> </h3>
 2606:   
 2607:  <p class="continue"> 
 2608:      <b>\vec{&nbsp;} \hat{&nbsp;} \bar{&nbsp;} \tilde{&nbsp;} \dot{&nbsp;}
 2609:      \ddot{&nbsp}</b> &nbsp; and &nbsp; <b>\acute{&nbsp;} \grave{&nbsp;}
 2610:      \breve{&nbsp;} \check{&nbsp}</b> are the only accents currently
 2611:      supported.  The first four are all "wide".  For example, you can write
 2612:      <b>\widehat{&nbsp;}</b> if you like, but there's absolutely no
 2613:      difference either way (and <b>\bar{&nbsp;}</b> and
 2614:      <b>\overline{&nbsp;}</b> are identical).  The last four accents
 2615:      only take a single character argument. <p>
 2616: 
 2617:  <p> Other accent-like directives available in mimeTeX are &nbsp;
 2618:      <b>\underline{&nbsp;} \cancel{&nbsp;} \sout{&nbsp;}</b>, &nbsp;
 2619:      as well as &nbsp;
 2620:      <b>\overset{&nbsp;}{&nbsp;} &nbsp; \underset{&nbsp;}{&nbsp;}</b> &nbsp;
 2621:      and the more ususal &nbsp;
 2622:      <b>\overbrace{&nbsp;}^{&nbsp;} &nbsp; \underbrace{&nbsp;}_{&nbsp;}</b>.
 2623:      &nbsp; And <b>\not</b> also works on the single character immediately
 2624:      following it.  Some of these directives are discussed in more detail
 2625:      below. </p>
 2626: 
 2627: <h3> <a name="functions">Function names<font size=5>...</font></a> </h3>
 2628: 
 2629:  <p> All 32 usual LaTeX function names <b>\arccos</b>,...,<b>\tanh</b>
 2630:      are recognized by mimeTeX and treated in the usual way.  MimeTeX
 2631:      also recognizes <b>\tr</b> for the trace, and also <b>\bmod</b>
 2632:      and <b>\pmod</b>.  And those functions that normally take "limits"
 2633:      also behave as expected, e.g., </p> <center>
 2634:         <b>\lim_{n\to\infty}S_n=S</b> &nbsp; produces &nbsp;
 2635:         <a href="#preview"><img id="functions1" onclick="eqntext('functions1')"
 2636:         src="../cgi-bin/mimetex.cgi?\large\lim_{n\to\infty}S_n=S"
 2637:         alt="" border=0 align=middle></a> </center>
 2638: 
 2639: <h3> <a name="arrows">long Arrows<font size=5>...</font></a> </h3>
 2640: 
 2641:  <p> All mimeTeX \long and \Long arrows take an optional [width] argument
 2642:      that explicitly sets the arrow's width in pixels, scaled by
 2643:      <a href="#unitlength">\unitlength</a>.  For example,
 2644:      <b>\longrightarrow[50]</b> draws a 50-pixel wide arrow
 2645:      <a href="#preview"><img id="arrows1" onclick="eqntext('arrows1')"
 2646:      src="../cgi-bin/mimetex.cgi?\longrightarrow[50]" alt="" border=0
 2647:      align=middle></a>, whereas just <b>\longrightarrow</b> calculates
 2648:      a default width
 2649:      <a href="#preview"><img id="arrows2" onclick="eqntext('arrows2')"
 2650:      src="../cgi-bin/mimetex.cgi?\longrightarrow" alt="" border=0
 2651:      align=middle></a>, as usual.  And, in addition to the usual
 2652:      right, left and leftright arrows, there are also \long (and \Long) up,
 2653:      down and updown arrows that take an optional [height] argument, also
 2654:      scaled by any preceding <a href="#unitlength">\unitlength</a>. </p>
 2655: 
 2656:  <p> In the event that you actually want to place an []-enclosed expression
 2657:      immediately following an "unsized" long arrow, just place a <b>~</b> or
 2658:      any white space after the arrow, e.g., <b>f:x\longrightarrow~[0,1]</b>
 2659:      produces
 2660:      <a href="#preview"><img id="arrows3" onclick="eqntext('arrows3')"
 2661:      src="../cgi-bin/mimetex.cgi?\normalsize f:x\longrightarrow~[0,1]"
 2662:      alt="" border=0 align=middle></a>.  Without any intervening white space,
 2663:      mimeTeX would have "eaten" the [0,1]. </p>
 2664: 
 2665:  <p> Super/subscripts immediately following all long/Long left/right arrows
 2666:      are displayed the same way <a href="#modes">\limits</a> displays them,
 2667:      e.g., </p> <center>
 2668:         <b>x\longrightarrow^gy</b> &nbsp; produces &nbsp;
 2669:         <a href="#preview"><img id="arrows4" onclick="eqntext('arrows4')"
 2670:         src="../cgi-bin/mimetex.cgi?\large x\longrightarrow^gy"
 2671:         alt="" border=0 align=middle></a> <br>
 2672:         <b>x\longrightarrow[50]^gy</b> &nbsp; produces &nbsp;
 2673:         <a href="#preview"><img id="arrows5" onclick="eqntext('arrows5')"
 2674:         src="../cgi-bin/mimetex.cgi?\large x\longrightarrow[50]^gy"
 2675:         alt="" border=0 align=middle></a> </center> <p class="continue">
 2676:      Subscripted long arrows can occasionally be useful, too, as in
 2677:      <a href="#example11">Example&nbsp;11</a> above, e.g., </p> <center>
 2678:         <b>u\longrightarrow[50]_\beta v</b> &nbsp; produces &nbsp;
 2679:         <a href="#preview"><img id="arrows6" onclick="eqntext('arrows6')"
 2680:         src="../cgi-bin/mimetex.cgi?\large u\longrightarrow[50]_\beta^{\,}v"
 2681:         alt="" border=0 align=middle></a> </center> <p class="continue">
 2682:      To defeat this default behavior, e.g., <b>\longrightarrow\nolimits^g</b>
 2683:      displays super/subscripts in the usual way. </p>
 2684: 
 2685:  <p> Super/subscripts immediately following all long/Long up/down arrows
 2686:      are treated correspondingly, i.e., superscripts are vertically
 2687:      centered to the arrow's left, and subscripts to its right.
 2688:      For example, </p> <center>
 2689:         <b>\longuparrow[30]^\gamma</b> &nbsp; produces &nbsp;
 2690:         <a href="#preview"><img id="arrows7" onclick="eqntext('arrows7')"
 2691:         src="../cgi-bin/mimetex.cgi?\large\longuparrow[30]^\gamma"
 2692:         alt="" border=0 align=middle></a> <br>
 2693:         <b>\longdownarrow[30]_\gamma</b> &nbsp; produces &nbsp; &nbsp; &nbsp;
 2694:         <a href="#preview"><img id="arrows8" onclick="eqntext('arrows8')"
 2695:         src="../cgi-bin/mimetex.cgi?\large\longdownarrow[30]_\gamma"
 2696:         alt="" border=0 align=middle></a> </center> <p class="continue">
 2697:      whose occasional usefulness is also illustrated by
 2698:      <a href="#example11">Example&nbsp;11</a>.  And as before, to defeat
 2699:      this default behavior, e.g., <b>\longuparrow\nolimits^\gamma</b>
 2700:      displays super/subscripts in the usual way. </p>
 2701: 
 2702: <h3> <a name="raiserotate">\raisebox{&nbsp;}{&nbsp;} and
 2703: \rotatebox{&nbsp;}{&nbsp;} and \reflectbox[&nbsp;]{&nbsp;}
 2704: <font size=5>...</font></a> </h3>
 2705: 
 2706:  <p> The <b>\raisebox{<i>height</i>}{<i>expression</i>}</b>
 2707:      and <b>\rotatebox{<i>angle</i>}{<i>expression</i>}</b>
 2708:      and <b>\reflectbox[<i>axis</i>]{<i>expression</i>}</b>
 2709:      commands help you fine-tune and manipulate mimeTeX renderings: </p>
 2710:      <ul>
 2711:        <li> <b>\raisebox</b>'s <b><i>height</i></b> argument is number
 2712:             of pixels, scaled by <a href="#unitlength">\unitlength</a>,
 2713:             and can be positive or negative. </li>
 2714:        <li> <b>\rotatebox</b>'s <b><i>angle</i></b> argument is number
 2715:             of degrees, and can also be positive (for clockwise) or
 2716:             negative, but must be a multiple of 90. </li>
 2717:        <li> <b>\reflectbox</b>'s optional <b><i>axis</i></b> argument
 2718:             defaults to 1 if not given, which reflects horizontally
 2719:             (the usual LaTeX behavior), or reflects vertically if
 2720:             specified as 2. </li>
 2721:        <li> For all three commands, the <b><i>expression</i></b>
 2722:             can be any valid LaTeX/mimeTeX expression. </li>
 2723:      </ul>
 2724:  <p> For example, mimeTeX's preprocessor
 2725:      defines the LaTeX <b>?`</b> symbol, an upside-down question
 2726:      mark, like </p> <center>
 2727:         <b>abc\raisebox{-2}{\rotatebox{180}?}def</b> &nbsp; produces &nbsp;
 2728:         <a href="#preview"><img id="raiserot1" onclick="eqntext('raiserot1')"
 2729:         src="../cgi-bin/mimetex.cgi?
 2730:         \large\rm abc\raiseb{-2}{\rotateb{180}{\LARGE?}}def"
 2731:         alt="" border=0 align=middle></a> </center>
 2732:  <p> Using <b>\reflectbox[2]{&nbsp;}</b> instead of
 2733:      <b>\rotatebox{180}{&nbsp;}</b> would result in the slightly
 2734:      different </p> <center>
 2735:         <b>abc\raisebox{-2}{\reflectbox[2]?}def</b> &nbsp; produces &nbsp;
 2736:         <a href="#preview"><img id="raiserot2" onclick="eqntext('raiserot2')"
 2737:         src="../cgi-bin/mimetex.cgi?
 2738:         \large\rm abc\raiseb{-2}{\reflectb[2]{\LARGE?}}def"
 2739:         alt="" border=0 align=middle></a> </center>
 2740: 
 2741: <h3> <a name="compose">\compose{&nbsp;}{&nbsp;}<font size=5>...</font></a></h3>
 2742: 
 2743:  <p class="continue"> 
 2744:      <b>\compose[<i>offset</i>]{<i>base</i>}{<i>overlay</i>}</b>
 2745:      superimposes the <b><i>overlay</i></b> expression on top of the
 2746:      <b><i>base</i></b> expression, displaying the result.
 2747:      Optionally, the overlay is horizontally <b><i>offset</i></b>
 2748:      by the specified number of pixels (positive offsets to the right,
 2749:      negative to the left). For example, </p> <center>
 2750:         <b>\compose{\LARGE O}{\normalsize c}</b> &nbsp; produces &nbsp;
 2751:         <a href="#preview"><img id="compose1" onclick="eqntext('compose1')"
 2752:         src="../cgi-bin/mimetex.cgi?\compose{\LARGE O}{\normalsize c}"
 2753:         alt="" border=0 align=middle></a> </center>
 2754: 
 2755:  <p> Separately or in some judicious combination, <b>\compose</b> and
 2756:      <b>\raisebox</b> and <b>\rotatebox</b> and <b>\reflectbox</b>
 2757:      should help you construct special symbols not "natively" available
 2758:      with mimeTeX's limited set of built-in font families.
 2759:      This can be especially useful in conjunction with the
 2760:      <b>-DNEWCOMMANDS</b> compile-time
 2761:      <a href="#options">option</a> discussed above. </p>
 2762: 
 2763: <h3> <a name="rule">\rule{&nbsp;}{&nbsp;}<font size=5>...</font></a></h3>
 2764: 
 2765:  <p class="continue"> 
 2766:      <b>\rule{<i>width</i>}{<i>height</i>}</b> behaves in the usual way,
 2767:      rendering a black rectangle <b><i>width</i></b> pixels wide and
 2768:      <b><i>height</i></b> pixels high, with its base on the established
 2769:      baseline.  For example, </p> <center>
 2770:         <b>\frac12xyz\rule{10}{20}ghi</b> &nbsp; produces &nbsp;
 2771:         <a href="#preview"><img id="rule1" onclick="eqntext('rule1')"
 2772:         src="../cgi-bin/mimetex.cgi?\frac12xyz\rule{10}{20}ghi"
 2773:         alt="" border=0 align=middle></a> </center>
 2774: 
 2775:  <p> The mimeTeX version of <b>\rule</b> has an optional
 2776:      <b>[<i>lift</i>]</b> argument, so that its full form is
 2777:      <b>\rule[<i>lift</i>]{<i>width</i>}{<i>height</i>}</b>.
 2778:      <b><i>lift</i></b> moves the rule's baseline by the specified
 2779:      number of pixels, up if positive or down if negative.
 2780:      For example, </p> <center>
 2781:         <b>\frac12xyz\rule[5]{10}{20}ghi</b> &nbsp; produces &nbsp;
 2782:         <a href="#preview"><img id="rule2" onclick="eqntext('rule2')"
 2783:         src="../cgi-bin/mimetex.cgi?\frac12xyz\rule[5]{10}{20}ghi"
 2784:         alt="" border=0 align=middle></a> &nbsp; and <br>
 2785:         <b>\frac12xyz\rule[-15]{10}{20}ghi</b> &nbsp; produces &nbsp;
 2786:         <a href="#preview"><img id="rule3" onclick="eqntext('rule3')"
 2787:         src="../cgi-bin/mimetex.cgi?\frac12xyz\rule[-15]{10}{20}ghi"
 2788:         alt="" border=0 align=middle></a> </center>
 2789: 
 2790: <h3> <a name="abbreviations">Abbreviations<font size=5>...</font></a> </h3>
 2791: 
 2792:  <p class="continue"> 
 2793:      <b>\ga</b> displays <b>\gamma</b>, but just <b>\g</b> displays
 2794:      <b>\gg</b> (<b>&gt;&gt;</b>).  That is, mimeTeX selects the
 2795:      shortest symbol or command which begins with whatever you type.
 2796:      This feature can help shorten an otherwise very long line,
 2797:      but it may be a bit dangerous. </p>
 2798: 
 2799:  <p> The mimeTeX <a href="#symbols">preprocessor</a>, briefly mentioned
 2800:      above, is responsible for recognizing several LaTeX symbols like
 2801:      <b>\ldots</b> and several commands like <b>\atop</b>&nbsp;.
 2802:      These symbols and commands cannot be abbreviated.  The special
 2803:      html characters like <b>&amp;nbsp;</b> are also recognized by
 2804:      the preprocessor and cannot be abbreviated. </p>
 2805: 
 2806: <h3> <a name="colors">Colors<font size=5>...</font></a> </h3>
 2807: 
 2808:  <p> Rudimentary color commands are provided by mimeTeX.  You can write
 2809:      <b>\color{red}</b> or <b>\color{green}</b> or<b>\color{blue}</b>
 2810:      (which may be abbreviated <b>\red</b> or <b>\green</b> or
 2811:      <b>\blue</b>) anywhere in an expression to render the entire
 2812:      expression in the specified color.  That is,
 2813:      <b>abc{\red&nbsp;def}ghi</b> renders the entire expression red,
 2814:      not just the <b>def</b> part.  Also, note that mimeTeX's "green"
 2815:      is actually color <b>#00FF00</b>, which the html standard more
 2816:      accurately calls "lime".  For example, </p> <center>
 2817:       <b>\blue e^x=\sum_{n=0}^\infty\frac{x^n}{n!}</b> &nbsp; produces &nbsp;
 2818:       <a href="#preview"><img id="colors1" onclick="eqntext('colors1')"
 2819:       src="../cgi-bin/mimetex.cgi?
 2820:       \Large\color{blue} e^x=\sum_{n=0}^\infty\frac{x^n}{n!}"
 2821:       alt="" border=0 align=middle></a> </center>
 2822: 
 2823: <h3> <a name="smash">&quot;Smash&quot;<font size=5>...</font></a> </h3>
 2824: 
 2825:  <p> TeX represents characters by boxes, with no idea how ink will be
 2826:      distributed inside.  So an expression like
 2827:      <b>\frac12\int_{a+b+c}^{d+e+f}g(x)dx</b> is typically rendered as &nbsp;
 2828:      <a href="#preview"><img id="smash1" onclick="eqntext('smash1')"
 2829:      src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
 2830:      \nosmash\frac12\int_{a+b+c}^{d+e+f}{g(x)dx}"
 2831:      alt="" border=0 align=middle></a>.
 2832:      But mimeTeX knows the character shapes of its fonts, and therefore tries
 2833:      to remove extra whitespace, rendering the same expression as &nbsp;
 2834:      <a href="#preview"><img id="smash2" onclick="eqntext('smash2')"
 2835:      src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
 2836:      \smash\frac12\int_{a+b+c}^{d+e+f}{g(x)}dx"
 2837:      alt="" border=0 align=middle></a> &nbsp; instead. </p>
 2838: 
 2839:  <p> Precede any expression with the mimeTeX directive <b>\nosmash</b>
 2840:      to render it without "smashing".  Or compile mimetex.c with the
 2841:      <b>-DNOSMASH</b> <a href="#options">option</a> if you prefer
 2842:      the typical TeX behavior as mimeTeX's default.  In this case,
 2843:      precede any expression with <b>\smash</b> to render it "smashed".
 2844:      And note that explicit space like <b>\hspace{10}</b>
 2845:      or <b>\;</b>&nbsp;, etc, is never smashed. </p>
 2846: 
 2847:  <p> The scope of <b>\smash</b> and <b>\nosmash</b> is the
 2848:      <b>{&nbsp;}</b>-enclosed subexpression in which the directive occurs.
 2849:      For example, if you want the <b><i>g(x)</i></b>&nbsp;part of the
 2850:      preceding example smashed, but not the <b>1/2</b>&nbsp;part,
 2851:      then the expression
 2852:      <b>\nosmash\frac12{\smash\int_{a+b+c}^{d+e+f}g(x)dx}</b>
 2853:      renders as &nbsp;
 2854:      <a href="#preview"><img id="smash3" onclick="eqntext('smash3')"
 2855:      src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
 2856:      \nosmash\frac12{\smash\int_{a+b+c}^{d+e+f}{g(x)dx}}"
 2857:      alt="" border=0 align=middle></a>.
 2858:      <!-- Moreover, explicit space like
 2859:      <b>\hspace{10}</b> or <b>\;</b>, etc, is never smashed.
 2860:      So <b>{\frac12\;\;}\int_{a+b+c}^{d+e+f}g(x)dx</b> renders as &nbsp;
 2861:      <a href="#preview"><img id="smash4" onclick="eqntext('smash4')"
 2862:      src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
 2863:      {\frac12\;\;}\int_{a+b+c}^{d+e+f}{g(x)dx}"
 2864:      alt="" border=0 align=middle></a>. --> </p>
 2865: 
 2866:  <p> For finer-grained control, note that <b>\smash</b> is shorthand
 2867:      for the default <b>\smashmargin{+3}</b> (and <b>\nosmash</b> is
 2868:      shorthand for <b>\smashmargin{0}</b>).  <b>\smashmargin</b>'s value
 2869:      is the minimum number of pixels between smashed symbols.  The leading
 2870:      <b>+</b> is optional.  If present, the font size (\tiny=0,...,\Huge=7)
 2871:      is added to the specified minimum.  Compile mimetex.c with the
 2872:      <b>-DSMASHMARGIN=<i>n</i></b> <a href="#options">option</a> to change
 2873:      the default from <b>3</b> to <b><i>n</i></b>.  Compare the preceding
 2874:      example with the over-smashed <b>\smashmargin{1}</b> &nbsp;
 2875:      <a href="#preview"><img id="smash5" onclick="eqntext('smash5')"
 2876:      src="../cgi-bin/mimetex.cgi?\normalsize\displaystyle
 2877:      \smashmargin1\frac12\int_{a+b+c}^{d+e+f}{g(x)}dx"
 2878:      alt="" border=0 align=middle></a> &nbsp; instead. </p>
 2879: 
 2880:  <p> Smashing is in "beta testing" and some expressions still don't look
 2881:      quite right when smashed, e.g., <b>1^2,2^2,3^2,\ldots</b> renders as
 2882:      <a href="#preview"><img id="smash6" onclick="eqntext('smash6')"
 2883:      src="../cgi-bin/mimetex.cgi?\Large1^2,2^2,3^2,\ldots"
 2884:      alt="" border=0 align=middle></a>.  Just compile with <b>-DNOSMASH</b>
 2885:      if you come across numerous annoying situations. </p>
 2886: 
 2887: <h3> <a name="not">\not and \cancel and \sout<font size=5>...</font></a> </h3>
 2888: 
 2889:  <p> The usual LaTeX &nbsp; <b>\not</b> &nbsp; "slashes" the single symbol
 2890:      following it, e.g., &nbsp; <b>i\not\partial\equiv&nbsp;i\not\nabla</b>
 2891:      &nbsp; produces <a href="#preview">
 2892:      <img id="not1" onclick="eqntext('not1')"
 2893:      src="../cgi-bin/mimetex.cgi?\normalsize i\not\partial\equiv i\not\nabla"
 2894:      alt="" border=0 align=middle></a>. </p>
 2895: 
 2896:  <p> For arbitrary expressions, mimeTeX provides &nbsp; <b>\cancel</b> &nbsp;
 2897:      which draws a line from the upper-right to lower-left corner of its
 2898:      argument, e.g., &nbsp; <b>a\cancel{x^2}=bx^{\not3}</b> &nbsp; produces
 2899:      &nbsp; <a href="#preview"><img id="not2" onclick="eqntext('not2')"
 2900:      src="../cgi-bin/mimetex.cgi?\large a\cancel{x^2}=bx^{\not3}"
 2901:      alt="" border=0 align=bottom></a>. </p>
 2902: 
 2903:  <p> Finally, similar to the <b>ulem.sty</b> package, &nbsp; <b>\sout</b>
 2904:      &nbsp; draws a horizontal strikeout line through its argument,
 2905:      e.g., &nbsp; <b>\sout{abcdefg}</b> &nbsp; produces <a href="#preview">
 2906:      <img id="not3" onclick="eqntext('not3')"
 2907:      src="../cgi-bin/mimetex.cgi?\normalsize\sout{abcdefg}"
 2908:      alt="" border=0 align=middle></a>.  MimeTeX's <b>\sout</b> also
 2909:      takes an optional argument that adjusts the vertical position of its
 2910:      strikeout line by the specified number of pixels, e.g., &nbsp;
 2911:      <b>\sout[+2]{abcdefg}</b> produces <a href="#preview">
 2912:      <img id="not4" onclick="eqntext('not4')"
 2913:      src="../cgi-bin/mimetex.cgi?\normalsize\sout[+2]{abcdefg}"
 2914:      alt="" border=0 align=middle></a> &nbsp; and &nbsp;
 2915:      <b>\sout[-2]{abcdefg}</b> produces
 2916:      <a href="#preview"><img id="not5" onclick="eqntext('not5')"
 2917:      src="../cgi-bin/mimetex.cgi?\normalsize\sout[-2]{abcdefg}"
 2918:      alt="" border=0 align=middle></a>. </p>
 2919: 
 2920: 
 2921: <h2> <a name="array"> (IIIe) \begin{array}{lcr}...\end{array} Environment
 2922: &nbsp; </a> </h2>
 2923: 
 2924:  <p> Rendering vectors and matrices, aligning equations, etc, is all done
 2925:      using the customary LaTeX environment &nbsp;
 2926:      <b>\begin{array}{lcr}&nbsp;a&b&c\\d&e&f\\etc&nbsp;\end{array}</b>
 2927:      &nbsp; which you can write in exactly that form.  MimeTeX also
 2928:      recognizes the following array-like environments </p>
 2929:      <center> <table cellpadding="1" cellspacing="1">
 2930:        <tr> <td align="left">   <b>\begin{array}{lcr}</b>    </td>
 2931:             <td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
 2932:             <td align="left">   <b>\end{array}</b>           </td> </tr>
 2933:        <tr> <td align="left">   <b>\begin{matrix}</b>        </td>
 2934:             <td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
 2935:             <td align="left">   <b>\end{matrix}</b>          </td> </tr>
 2936:        <tr> <td align="left">   <b>\begin{pmatrix}</b>       </td>
 2937:             <td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
 2938:             <td align="left">   <b>\end{pmatrix}</b>         </td> </tr>
 2939:        <tr> <td align="left">   <b>\begin{bmatrix}</b>       </td>
 2940:             <td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
 2941:             <td align="left">   <b>\end{bmatrix}</b>         </td> </tr>
 2942:        <tr> <td align="left">   <b>\begin{Bmatrix}</b>       </td>
 2943:             <td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
 2944:             <td align="left">   <b>\end{Bmatrix}</b>         </td> </tr>
 2945:        <tr> <td align="left">   <b>\begin{vmatrix}</b>       </td>
 2946:             <td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
 2947:             <td align="left">   <b>\end{vmatrix}</b>         </td> </tr>
 2948:        <tr> <td align="left">   <b>\begin{Vmatrix}</b>       </td>
 2949:             <td align="center"> <b>a&b&c \\ d&e&f \\ etc</b> </td>
 2950:             <td align="left">   <b>\end{Vmatrix}</b>         </td> </tr>
 2951:        <tr> <td align="left">   <b>\begin{eqnarray}</b>      </td>
 2952:             <td align="center"> <b>a&=&b \\ c&=&d \\ etc</b> </td>
 2953:             <td align="left">   <b>\end{eqnarray}</b>        </td> </tr>
 2954:        <tr> <td align="left">   <b>\begin{align}</b>         </td>
 2955:             <td align="center"> <b>a&=b \\ c&=d \\ etc</b>   </td>
 2956:             <td align="left">   <b>\end{align}</b>           </td> </tr>
 2957:        <tr> <td align="left">   <b>\begin{cases}</b>         </td>
 2958:             <td align="center"> <b>a&b \\ c&d \\ etc</b>     </td>
 2959:             <td align="left">   <b>\end{cases}</b>           </td> </tr>
 2960:        <tr> <td align="left">   <b>\begin{gather}</b>        </td>
 2961:             <td align="center"> <b>a \\ b \\ etc</b>         </td>
 2962:             <td align="left">   <b>\end{gather}</b>          </td> </tr>
 2963:      </table> </center> <p class="continue">
 2964:      There's a built-in maximum of 64 columns and 64 rows.  Nested
 2965:      array environments, e.g.,
 2966:    <b>\begin{pmatrix}a&\begin{matrix}1&2\\3&4\end{matrix}\\c&d\end{pmatrix}</b>,
 2967:      are permitted. </p>
 2968: 
 2969:  <p> MimeTeX also provides the abbreviation &nbsp;
 2970:      <b>\array{lcr$a&b&c\\d&e&f\\etc}</b> &nbsp;
 2971:      which has exactly the same effect as &nbsp;
 2972:      <b>\begin{array}{lcr}&nbsp;a&b&c\\d&e&f\\etc&nbsp;\end{array}</b>.
 2973:      And the <b>lcr$</b> "preamble" in <b>\array{lcr$etc}</b> is optional.
 2974:      In that case, &nbsp; <b>\array{a&b&c\\d&e&f\\etc}</b> &nbsp;
 2975:      has exactly the same effect as &nbsp;
 2976:      <b>\begin{matrix}&nbsp;a&b&c\\d&e&f\\etc&nbsp;\end{matrix}</b>.
 2977:      You can also write <b>\(\array{etc}\)</b> to "manually abbreviate"
 2978:      the pmatrix environment, or <b>\array{rcl$etc}</b> to abbreviate
 2979:      eqnarray, but mimeTeX has no explicit abbreviations for these
 2980:      other environments.  For example, </p> <center>
 2981:       <b>\begin{matrix}a_1&a_2&a_3\\b_1&b_2&b_3\\c_1&c_2&c_3\end{matrix}</b>
 2982:       &nbsp; produces &nbsp;
 2983:       <a href="#preview"><img id="array1" onclick="eqntext('array1')"
 2984:       src="../cgi-bin/mimetex.cgi?\large\begin{matrix}a_1&a_2&a_3\\
 2985:       b_1&b_2&b_3\\c_1&c_2&c_3\end{matrix}"
 2986:       alt="" border=0 align=middle></a> </center>
 2987: 
 2988:  <p> Solid <b>\hline</b>'s (but not \cline's) and vertical <b>l|c|r</b> bars
 2989:      are available, as usual.  For dashed lines and bars,
 2990:      <b>\begin{array}</b> provides the additional features <b>\hdash</b>
 2991:      and <b>l.c.r</b>&nbsp;. <b>\hline</b> and <b>\hdash</b> may not be
 2992:      abbreviated.  For example, </p> <center>
 2993:    <b>\begin{array}{c.c|c} a_1&a_2&a_3 \\\hdash b_1&b_2&b_3 <br>
 2994:      \\\hline c_1&c_2&c_3 \end{array}</b> &nbsp; produces <br>
 2995:        <a href="#preview"> <img id="array22" onclick="eqntext('array22')"
 2996:        src="../cgi-bin/mimetex.cgi?\large\begin{array}{c.c|c}
 2997:        a_1&a_2&a_3\\\hdash b_1&b_2&b_3\\\hline c_1&c_2&c_3\end{array}"
 2998:        alt="" border="0" align="middle"> </a> </center>
 2999: 
 3000:  <p> The default font size is unchanged by <b>\array{&nbsp;}</b>, but you
 3001:      can explicitly control it in the usual way, e.g.,
 3002:      <b>{\Large\begin{matrix}...\end{matrix}}</b> renders the entire array
 3003:      in font size 4.  In addition, any <b>&...&</b> cell may contain font
 3004:      size declarations which are always local to that cell,
 3005:      e.g., <b>&\fs{-1}...&</b> renders that one cell one font size smaller
 3006:      than current. </p>
 3007: 
 3008:  <p> The <b>{lcr}</b> in <b>\begin{array}{lcr}</b> sets left,center,right
 3009:      <i>"horizontal&nbsp;justification"</i> down columns of an array,
 3010:      as usual.  And "vertical&nbsp;justification" across rows defaults
 3011:      to what we'll call <b><i>baseline</i></b>, i.e., aligned equations,
 3012:      as in <a href="#example10">Example&nbsp;10</a> above, display properly.
 3013:      But the down arrows (for &nbsp;
 3014:        <a href="#preview"><img id="array3" onclick="eqntext('array3')"
 3015:        src="../cgi-bin/mimetex.cgi?\small\array{C$\gamma&\Large\downarr}"
 3016:        alt="" border=0 align=middle></a> &nbsp; and for &nbsp;
 3017:        <a href="#preview"><img id="array4" onclick="eqntext('array4')"
 3018:        src="../cgi-bin/mimetex.cgi?\small\array{C$\Large\downarr&\beta}"
 3019:        alt="" border=0 align=middle></a>)
 3020:      in <a href="#example11">Example&nbsp;11</a> require
 3021:      <i>"vertical&nbsp;centering"</i> across the middle row of that
 3022:      array.  So, in addition to lowercase <b>lcr</b>, mimeTeX's <b>{lcr}</b>
 3023:      in <b>\begin{array}{lcr}</b> may also contain uppercase <b>BC</b> to
 3024:      set "<b>B</b>"aseline or "<b>C</b>"enter vertical justification across
 3025:      the corresponding rows.  For example, <b>\begin{array}{rccclBCB}</b>
 3026:      sets baseline justification for the first and third rows, and center
 3027:      justification for the second row.  Without any <b>BC</b>'s,
 3028:      all rows default to the usual <b>B</b> baseline justification. </p>
 3029: 
 3030:  <p> MimeTeX has no <b>\arraycolsep</b> or <b>\arraystretch</b> parameters.
 3031:      Instead, <b>\begin{array}{lc25rB35C}</b> sets the absolute width
 3032:      of the second column to 25&nbsp;pixels, and the absolute height of the
 3033:      first row to 35&nbsp;pixels, as illustrated by
 3034:      <a href="#example9">Example&nbsp;9</a>.  Any number following
 3035:      an <b>lcrBC</b> specification sets the width of that one column
 3036:      (for <b>lcr</b>), or the height of that one row (for <b>BC</b>). <br>
 3037:      <img src="../cgi-bin/mimetex.cgi?\hspace{35}" alt="" border=0>
 3038:           You can optionally precede the number with a <b>+</b> sign,
 3039:      which "propagates" that value forward to all subsequent columns for
 3040:      <b>lcr</b>, or all subsequent rows for <b>BC</b>.  For example,
 3041:      <b>\begin{array}{lc+25rB+35C}</b> sets the absolute width of
 3042:      column&nbsp;2 and all subsequent columns to 25&nbsp;pixels,
 3043:      and the absolute height of row&nbsp;1 and all subsequent rows
 3044:      to 35&nbsp;pixels.  After absolute sizing has been set, the special
 3045:      value <b>0</b> reverts to automatic sizing for that one row or
 3046:      column, and <b>+0</b> reverts to automatic sizing for all subsequent
 3047:      rows or columns.  For example, <b>\begin{array}{c+25ccc+35ccc+0}</b>
 3048:      sets the absolute widths of columns&nbsp;1-3 to 25&nbsp;pixels,
 3049:      columns&nbsp;4-6 to 35&nbsp;pixels, and then reverts to automatic
 3050:      sizing for columns&nbsp;7 and all subsequent columns. <br>
 3051:      <img src="../cgi-bin/mimetex.cgi?\hspace{35}" alt="" border=0>
 3052:           The "propagation" introduced by <b>+</b> is local to the
 3053:      <b>\begin{array}</b> in which it occurs.  So you have to repeat
 3054:      the same specifications if you want rows aligned across several
 3055:      arrays on the same line (or columns aligned on several lines
 3056:      separated by <b>\\</b>).  Instead, a lowercase <b>g</b> globally
 3057:      copies your column specifications to all subsequent arrays,
 3058:      and an uppercase <b>G</b> globally copies your row specifications.
 3059:      And <b>gG</b> copies both column and row specifications.  For example,
 3060:      <b>\begin{array}{GC+25}</b> sets the height of all rows in this
 3061:      array to 25 pixels, and ditto for all subsequent arrays to its right.
 3062:      Explicit specifications in subsequent arrays override previous global
 3063:      values. <br>
 3064:      <img src="../cgi-bin/mimetex.cgi?\hspace{35}" alt="" border=0>
 3065:           Click one of the following examples to see illustrations
 3066:      of the above discussion: </p> <center>
 3067:      <a href="#preview"> <img id="array31" onclick="eqntext('array31')"
 3068:      src="../cgi-bin/mimetex.cgi?\large
 3069:      \left( \begin{array}{GC+30}
 3070:             \cos\frac\theta2 & i\,\sin\frac\theta2\\
 3071:             i\,\sin\frac\theta2 & \cos\frac\theta2 \end{array} \right)
 3072:      \left( \begin{array}
 3073:             z & x_{\tiny-} \\ x_{\tiny+} & -z \end{array} \right)
 3074:      \hfill{300}\text{\normalsize Example 1}"
 3075:      alt="" border="0" align="middle"> </a> <br>
 3076:      <a href="#preview"> <img id="array32" onclick="eqntext('array32')"
 3077:      src="../cgi-bin/mimetex.cgi?\large
 3078:      \left( \begin{array}{GC+30gc+40}
 3079:             \cos\frac\theta2 & i\,\sin\frac\theta2 \\
 3080:             i\,\sin\frac\theta2 & \cos\frac\theta2 \end{array} \right)
 3081:      \left( \begin{array}
 3082:             z & x_{\tiny-} \\ x_{\tiny+} & -z \end{array} \right)
 3083:      \hfill{300}\text{\normalsize Example 2}"
 3084:      alt="" border="0" align="middle"> </a> </center>
 3085: 
 3086:  <p> See <a href="#example8">Examples&nbsp;8-11</a> above for several
 3087:      additional <b>\begin{array}{lcr}</b> applications. </p>
 3088: 
 3089: 
 3090: <h2> <a name="picture"> (IIIf) \picture(&nbsp;){&nbsp;} "Environment",
 3091:      including \line(&nbsp;){&nbsp;} and \circle(&nbsp;) &nbsp; </a> </h2>
 3092: 
 3093:  <p> Besides <b>\begin{array}{lcr}</b>, mimeTeX also tries to emulate the
 3094:      familiar LaTeX picture environment with the somewhat similar<br>
 3095:       <b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \picture(width[,height])&nbsp;
 3096:       {&nbsp;(loc1){pic_elem1}&nbsp;(loc2){pic_elem2}&nbsp;...&nbsp;}</b><br>
 3097:      as illustrated by <a href="#example12">Examples&nbsp;12-13</a> above.
 3098:      Arguments surrounded by <b>[&nbsp;]</b>'s are optional.
 3099:      If the optional <b>[,height]</b> is omitted, then <b>height=width</b>
 3100:      is assumed.  Locations <b>(loc1)</b> and <b>(loc2)&nbsp;...</b> each
 3101:      denote  either a <b>\put(loc)</b> or a <b>\multiput(loc)</b>,
 3102:      and each location is of the form <b>([c]x,y[;xinc,yinc[;num]])</b>. </p>
 3103: 
 3104:  <p> A <b>\put(loc)</b> is denoted by a location of the form <b>([c]x,y)</b>
 3105:      where <b>x,y</b> denotes the coordinate where the lower-left corner
 3106:      of the subsequent picture_element will be placed, unless the letter
 3107:      <b>c</b> precedes the <b>x</b>-number, in which case <b>cx,y</b>
 3108:      denotes the center point instead.  The very lower-left corner of the
 3109:      entire picture is always <b>0,0</b>, and the upper-right corner is
 3110:      <b>width-1,height-1</b>.  Note, for example, that you'd never want
 3111:      to specify location <b>c0,0</b> since the picture_element would be
 3112:      mostly out-of-bounds (only its upper-right quadrant would be
 3113:      in-bounds). </p>
 3114: 
 3115:  <p> A <b>\multiput(loc)</b> starts like a <b>\put(loc)</b>, but location
 3116:      <b>[c]x,y</b> is followed by <b>;xinc,yinc[;num]</b> indicating the
 3117:      <b>x,y-inc</b>rements applied to each of <b>num</b> repetitions
 3118:      of picture_element.  If <b>;num</b> is omitted, repetitions continue
 3119:      until the picture_element goes out-of-bounds of the specified
 3120:      <b>width[,height]</b>.  Note that <b>x,y</b> are always positive or
 3121:      zero, but <b>xinc,yinc</b> may be postive, zero or negative. </p>
 3122: 
 3123:  <p> The <b>\picture(,){...}</b> parameters <b>width, height, x, y, xinc,
 3124:      yinc</b> may be either integer or may contain a decimal point,
 3125:      and they're all scaled by <a href="#unitlength">\unitlength</a>.
 3126:      The <b>num</b> parameter must be integer. </p>
 3127: 
 3128:  <p> Picture_element's <b>{pic_elem1}</b> and <b>{pic_elem2} ...</b>
 3129:      may be any expressions recognized by mimeTeX, even including other
 3130:      <b>\picture</b>'s nested to any level. </p>
 3131: 
 3132: <h3> <a name="circleline">\line(&nbsp;){&nbsp;} and
 3133: \circle(&nbsp;)<font size=5>...</font></a> </h3>
 3134: 
 3135:  <p> To help draw useful picture_element's, mimeTeX provides several
 3136:      drawing commands, <b>\line(xinc,yinc)[{xlen}]</b> and
 3137:      <b>\circle(xdiam[,ydiam][;arc])</b>.  Although primarily intended
 3138:      for use in <b>\picture</b>'s, you can use them in any mimeTeX
 3139:      expression, e.g., &nbsp; <b>abc\circle(20)def</b> &nbsp; produces &nbsp;
 3140:       <a href="#preview"><img id="circleline1" onclick="eqntext('circleline1')"
 3141:       src="../cgi-bin/mimetex.cgi?\large abc\circle(20)def"
 3142:       alt="" border="0" align="middle"></a>. </p>
 3143: 
 3144:  <p> Without its optional <b>{xlen}</b> parameter, the expression
 3145:      <b>(x,y){\line(xinc,yinc)}</b> draws a straight line from point
 3146:      <b>x,y</b> to point <b>x+xinc,y+yinc</b>.  The <b>inc</b>'s
 3147:      can be positive, zero or negative.  Don't prefix location <b>x,y</b>
 3148:      with a leading <b>c</b> for <b>\line</b>'s; the intended "corner"
 3149:      is determined by the signs of <b>xinc</b> and <b>yinc</b>.
 3150:      If given, the optional <b>{xlen}</b> parameter rescales the length
 3151:      of the line so its x-projection is <b>xlen</b> and its slope is
 3152:      unchanged. </p>
 3153: 
 3154:  <p> Without optional <b>,ydiam</b> and <b>;arc</b>, the expression
 3155:      <b>(x,y){\circle(xdiam)}</b> draws a circle of diameter <b>xdiam</b>
 3156:      centered at <b>x,y</b>.  Don't prefix location <b>x,y</b> with a
 3157:      leading <b>c</b> for <b>\circle</b>'s; centering is assumed.
 3158:      If <b>,ydiam</b> is also given, then <b>(x,y){\circle(xdiam,ydiam)}</b>
 3159:      draws the ellipse inscribed in a rectangle of width <b>xdiam</b>
 3160:      and height <b>ydiam</b> centered at <b>x,y</b>. <br>
 3161:      &nbsp; &nbsp; &nbsp; Finally, <b>;arc</b> specifies the arc to be
 3162:      drawn, in one of two ways.  An <b>;arc</b> argument given in the
 3163:      form <b>;1234</b> interprets each digit as a quadrant to be drawn,
 3164:      with <b>1</b> the upper-right quadrant and then proceeding
 3165:      counterclockwise, e.g., <b>\circle(12;34)</b> specifies the
 3166:      lower half of a circle whose diameter is twelve. <br>
 3167:      &nbsp; &nbsp; &nbsp;  Alternatively, an <b>;arc</b> argument given in
 3168:      the form <b>45,180</b> or <b>-60,120</b> specifies the endpoints of
 3169:      the desired arc in degrees, with <b>0</b> the positive x-axis and
 3170:      then proceeding counterclockwise.  The first number must always
 3171:      be smaller than the second (negative numbers are allowed), and the
 3172:      arc is drawn counterclockwise starting from the smaller number. </p>
 3173: 
 3174:  <p> Besides <a href="#example12">Examples 12-13</a> above,
 3175:      it's hard to resist illustrating<br>
 3176:      <font size=4><b>&nbsp; &nbsp; &nbsp;
 3177:      \unitlength{.6} &nbsp; \picture(100) {<br>
 3178:      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 3179:             (50,50){\circle(99)} %%head%%<br>
 3180:      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 3181:             (20,55;50,0;2){\fs{+1}\hat\bullet} %%eyes%%<br>
 3182:      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 3183:             (50,40){\bullet} %%nose%%<br>
 3184:      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 3185:             (50,35){\circle(50,25;34)} %%upper lip%%<br>
 3186:      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 3187:             (50,35){\circle(50,45;34)} %%lower lip%% &nbsp; }</b></font></p>
 3188:   <center>
 3189:    <a href="#preview"><img id="circleline2" onclick="eqntext('circleline2')"
 3190:    src="../cgi-bin/mimetex.cgi?\normalsize\unitlength{.6}\picture(100){
 3191:    (50,50){\circle(99)} (20,55;50,0;2){\fs{+1}\hat\bullet} (50,40){\bullet}
 3192:    (50,35){\circle(50,25;34)} (50,35){\circle(50,45;34)}}"
 3193:    alt="" border=0 align=middle></a><br>Have a nice day!</center>
 3194: 
 3195: 
 3196: <h2> <a name="commands"> (IIIg) Other mimeTeX Commands &nbsp; </a> </h2>
 3197: 
 3198:  <p> Various and sundry other LaTeX-like commands are also provided
 3199:      by mimeTeX.  In addition to features explicitly discussed below,
 3200:      mimeTeX supports the usual sub<b>_</b>scripts and super<b>^</b>scripts,
 3201:      and most of the typical LaTeX commands, many already discussed
 3202:      above, including </p>
 3203:      <ul>
 3204:        <li> <b>\frac{&nbsp;}{&nbsp;}</b> and <b>{&nbsp;\over&nbsp;}</b> </li>
 3205:        <li> <b>{&nbsp;\atop&nbsp;}</b> and <b>{&nbsp;\choose&nbsp;}</b> </li>
 3206:        <li> <b>\sqrt{&nbsp;}</b> </li>
 3207:        <li> <b>\lim_{&nbsp;}</b> and all the usual LaTeX function names </li>
 3208:        <li> <b>\hat{&nbsp;}</b> and <b>\widehat{&nbsp;}</b>
 3209:             and many of the usual LaTeX accents </li>
 3210:        <li> <b>\overbrace{&nbsp;}^{&nbsp;}</b> and
 3211:             <b>\underbrace{&nbsp;}_{&nbsp;}</b> </li>
 3212:        <li> <b>\overline{&nbsp;}</b> and <b>\underline{&nbsp;}</b> </li>
 3213:      </ul> <p class="continue">
 3214:      All these typical commands should behave as they usually do
 3215:      in LaTeX, and won't be discussed further.  Short discussions
 3216:      of some other commands follow. </p>
 3217: 
 3218: <h3> <a name="stackrel">\overset{&nbsp;}{&nbsp;} or 
 3219: \stackrel{&nbsp;}{&nbsp;} &nbsp; and &nbsp;
 3220: \underset{&nbsp;}{&nbsp;} or \relstack{&nbsp;}{&nbsp;}
 3221: <font size=5>...</font></a> </h3>
 3222: 
 3223:  <p class="continue">
 3224:      <b>\stackrel{&nbsp;}{&nbsp;}</b> behaves as usual in LaTeX,
 3225:      rendering its first argument one font size smaller and centered above
 3226:      its second.  And the amsmath-style <b>\overset{&nbsp;}{&nbsp;}</b> is
 3227:      identical.  For example, </p> <center>
 3228:      <b>"\vec x\overset{\rm def}=(x_1\ldots x_n)"</b>
 3229:      &nbsp; produces &nbsp;
 3230:         <a href="#preview"><img id="stackrel1" onclick="eqntext('stackrel1')"
 3231:         src="../cgi-bin/mimetex.cgi?
 3232:         \Large\vec x\,\overset{\small\rm def}=
 3233:         \,(x_1\ldots x_n)" alt="" border=0 align=middle></a> </center>
 3234: 
 3235:  <p> "Conversely" to <b>\stackrel{&nbsp;}{&nbsp;}</b>, mimeTeX provides
 3236:      <b>\relstack{&nbsp;}{&nbsp;}</b>, which renders its second argument
 3237:      one font size smaller and centered below its first.
 3238:      And the amsmath-style <b>\underset{&nbsp;}{&nbsp;}</b> renders its
 3239:      first argument one font size smaller and centered below its second.
 3240:      For example, the <b>\log</b> function name doesn't treat
 3241:      limits like <b>\lim_</b>, but you can write, for example, </p> <center>
 3242:         <b>"\underset{\rm base 2}\log32=5"</b> &nbsp; to render &nbsp;
 3243:         <a href="#preview"><img id="stackrel2" onclick="eqntext('stackrel2')"
 3244:         src="../cgi-bin/mimetex.cgi?
 3245:         \Large\underset{\small\rm base 2}\log32\,=\,5"
 3246:         alt="" border=0 align=middle></a> </center>
 3247: 
 3248:  <p> MimeTeX's <b>\limits</b> provides an easier but non-standard
 3249:      alternative to achieve the same effect.  For example, </p> <center>
 3250:      <b>"\vec x =\limits^{\rm def} (x_1\ldots x_n)"</b>
 3251:      &nbsp; produces &nbsp;
 3252:         <a href="#preview"><img id="stackrel3" onclick="eqntext('stackrel3')"
 3253:         src="../cgi-bin/mimetex.cgi?\Large\vec x\,=\limits^{\small\rm def}
 3254:         \,(x_1\ldots x_n)" alt="" border=0 align=middle></a> <br><br>
 3255:         and &nbsp; <b>"\log\limits_{\rm base 2}32=5"</b> &nbsp;
 3256:         produces &nbsp;
 3257:         <a href="#preview"><img id="stackrel4" onclick="eqntext('stackrel4')"
 3258:         src="../cgi-bin/mimetex.cgi?
 3259:         \Large\log\limits_{\small\rm base 2}32\,=\,5"
 3260:         alt="" border=0 align=middle></a> </center>
 3261: 
 3262: <h3> <a name="fbox">\fbox{&nbsp;}<font size=5>...</font></a> </h3>
 3263: 
 3264:  <p> In case html border attributes aren't suitable, mimeTeX provides
 3265:      the usual <b>\fbox{<i>expression</i>}</b> command, e.g., </p> <center>
 3266:         <b>"\fbox{x=\frac12}"</b> &nbsp; produces &nbsp;
 3267:         <a href="#preview"><img id="fbox1" onclick="eqntext('fbox1')"
 3268:         src="../cgi-bin/mimetex.cgi?\Large\fbox{x=\frac12}"
 3269:         alt="" border=0 align=middle></a> </center>
 3270: 
 3271:  <p> You can also write <b>\fbox[<i>width</i>]{<i>expression</i>}</b>
 3272:      to explicitly set the box's width, or you can write
 3273:      <b>\fbox[<i>width</i>][<i>height</i>]{<i>expression</i>}</b>
 3274:      to explicitly set both width and height. </p>
 3275: 
 3276: <h3> <a name="today">\today and \calendar<font size=5>...</font></a> </h3>
 3277: 
 3278:  <p class="continue"> <b>\today</b> &nbsp; renders &nbsp;
 3279:         <a href="#preview"><img id="today1" onclick="eqntext('today1')"
 3280:         src="../cgi-bin/mimetex.cgi?\normalsize\today"
 3281:         border=0 align=middle></a> &nbsp;
 3282:      in the usual LaTeX text&nbsp;mode way.
 3283:      That's <b>\today</b>'s default format#1.  MimeTeX has
 3284:      an optional format argument so that, for example, &nbsp;
 3285:      <b>\blue\today[2]</b> &nbsp; renders &nbsp;
 3286:         <a href="#preview"><img id="today2" onclick="eqntext('today2')"
 3287:         src="../cgi-bin/mimetex.cgi?\normalsize\blue\today[2]"
 3288:         border=0 align=middle></a>, &nbsp;
 3289:      showing both date and time.  And &nbsp;
 3290:      <b>\red\today[3]</b> &nbsp; renders &nbsp;
 3291:         <a href="#preview"><img id="today3" onclick="eqntext('today3')"
 3292:         src="../cgi-bin/mimetex.cgi?\normalsize\red\today[3]"
 3293:         border=0 align=bottom></a>,
 3294:      &nbsp; showing time only. </p>
 3295: 
 3296:  <p> To accommodate time zones, you may also write, for example, &nbsp;
 3297:      <b>\small\blue\today[2,+3]</b>, &nbsp; which renders &nbsp;
 3298:         <a href="#preview"><img id="today4" onclick="eqntext('today4')"
 3299:         src="../cgi-bin/mimetex.cgi?\small\blue\today[2,+3]"
 3300:         border=0 align=middle></a>, &nbsp;
 3301:      adding three hours to format#2.
 3302:      The arguments may be in either order. The time zone increment
 3303:      must always be preceded by either <b>+</b>&nbsp;or&nbsp;<b>-</b>,
 3304:      and must be in the range <b>-</b>23&nbsp;to&nbsp;<b>+</b>23. </p>
 3305: 
 3306:  <p class="continue"> <b>\calendar</b> &nbsp; renders a calendar for
 3307:      the current month, as illustrated by the left-hand image below.
 3308:      For a different month, the optional argument &nbsp
 3309:      <b>\small\blue\calendar[2001,9]</b> &nbsp; renders the right-hand
 3310:      image, for the requested year and month.  Years must be
 3311:      1973<b>...</b>2099 and months must be 1<b>...</b>12. </p>
 3312:      <center>
 3313:         <a href="#preview"><img id="today5" onclick="eqntext('today5')"
 3314:         src="../cgi-bin/mimetex.cgi?\normalsize\calendar"
 3315:         border=0 align=middle> </a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 3316:         <a href="#preview"><img id="today6" onclick="eqntext('today6')"
 3317:         src="../cgi-bin/mimetex.cgi?\small\blue\calendar[2001,9]"
 3318:         border=0 align=middle> </a> </center>
 3319: 
 3320:  <p> The default calendar emphasizes the current day of the current month,
 3321:      while any other month emphasizes no day.  Day emphasis is controlled
 3322:      by an optional third argument.  &nbsp; <b>\calendar[0,0,1]</b> &nbsp;
 3323:      emphasizes the first day of the current month, and
 3324:      &nbsp; <b>\calendar[2001,9,11]</b> &nbsp; emphasizes the eleventh
 3325:      day of that month.  &nbsp; <b>\calendar[0,0,99]</b> &nbsp;
 3326:      renders the current month with no day emphasized. </p>
 3327: 
 3328: <h3> <a name="input">\input{&nbsp;}<font size=5>...</font></a> </h3>
 3329: 
 3330:  <p class="continue">
 3331:      <b>\input{<i>filename</i>}</b> behaves just like the corresponding
 3332:      LaTeX command, reading the entire contents of <b><i>filename</i></b>
 3333:      into your expression at the point where the <b>\input</b> command
 3334:      occurs.  By default, <b><i>filename</i></b> resides in the same
 3335:      directory as mimetex.cgi.  Moreover, for security, absolute paths
 3336:      with leading <b>/</b>'s or <b>\</b>'s, and paths with <b>../</b>'s
 3337:      or <b>..\</b>'s, are not permitted.  See the <b>-DPATHPREFIX</b>
 3338:      <a href="#options">compile&nbsp;option</a>, discussed above,
 3339:      if you want <b>\input</b> files in some other directory.
 3340:      In any case, if <b><i>filename</i></b> isn't found, then
 3341:      <b>\input</b> tries to read <b><i>filename</i>.tex</b> instead.</p>
 3342: 
 3343:  <p> MimeTeX also supports the optional form
 3344:      <b>\input{<i>filename:tag</i>}</b>.  In this case,
 3345:      <b><i>filename</i></b> is read as before, but only those characters
 3346:      between <b>&lt;<i>tag</i>&gt;...&lt;/<i>tag</i>&gt;</b> are placed
 3347:      into your expression.  This permits you to have one file containing
 3348:      many different <b>&lt;<i>tag</i>&gt;</b>'s, e.g., one file containing
 3349:      all the questions and/or answers to a homework assignment or a quiz,
 3350:      etc. </p>
 3351: 
 3352: <h3> <a name="counter">\counter[&nbsp;]{&nbsp;}
 3353: <font size=5>...</font></a> </h3>
 3354: 
 3355:  <p> The bottom-right corner of this page contains a page hit counter
 3356:      that's maintained using mimeTeX's
 3357:      <b>\counter[<i>logfile</i>]{<i>counterfile</i>:<i>tag</i>}</b>
 3358:      command.  As with <b>\input</b>, described immediately above,
 3359:      both the required <b><i>counterfile</i></b> and the optional
 3360:      <b><i>logfile</i></b> are the names of files that reside in the
 3361:      same directory as your mimetex.cgi executable, unless you compiled
 3362:      mimetex with the <b>-DPATHPREFIX</b>
 3363:      <a href="#options">compile&nbsp;option</a>.  Before using
 3364:      the <b>\counter</b> command, Unix "touch" and "chmod" those files
 3365:      so they're mimeTeX readable and writable. </p>
 3366: 
 3367:  <p> If <b><i>counterfile</i></b> isn't readable and writable,
 3368:      then the <b>\counter</b> command always displays
 3369:      <b>1<sup><u>st</u></sup></b>.  Otherwise, it maintains a
 3370:      line in <b><i>counterfile</i></b> of the form
 3371:      <b>&lt;<i>tag</i>&gt;&nbsp;<i>value</i>&nbsp;&lt;/<i>tag</i>&gt;</b>
 3372:      where <b><i>value</i></b> is initialized as <b>1_</b> if the
 3373:      specified <b>&lt;<i>tag</i>&gt;</b> line doesn't already exist,
 3374:      and then incremented on each subsequent call.  That trailing
 3375:      underscore on the value in the file, e.g., <b>99_</b>, tells
 3376:      mimeTeX to display <b>99<sup><u>th</u></sup></b> with an
 3377:      ordinal suffix.  Edit the value in the file and remove the
 3378:      underscore if you don't want the ordinal suffix displayed.
 3379:      Finally, mimeTeX makes no effort to lock files or
 3380:      records&nbsp;(tags), so be careful using <b>\counter</b>
 3381:      if your hit rates are high enough so that frequent collisions
 3382:      are likely. </p>
 3383:      
 3384:  <p> The same <b><i>counterfile</i></b> can contain as many different
 3385:      <b>&lt;<i>tag</i>&gt;</b> lines as you like, so counters for
 3386:      all the pages on your site can be maintained in one file.
 3387:      MimeTeX also maintains a special <b>&lt;timestamp&gt;</b> tag
 3388:      in <b><i>counterfile</i></b> that logs the the date/time and
 3389:      name of the most recently updated tag. </p>
 3390: 
 3391:  <p> Somewhat more detailed log information can be accumulated in
 3392:      the optional <b><i>logfile</i></b>.  If you provide that
 3393:      filename, mimeTeX writes a line to it of the form
 3394:      <b>2008-09-07:12:59:33pm&nbsp;&lt;<i>tag</i>&gt;=99&nbsp;192.168.1.1&nbsp;<i>http_referer</i></b>
 3395:      containing a timestamp, the counter tag and its current value,
 3396:      and the user's IP address and http_referer page if they're
 3397:      available. </p>
 3398: 
 3399:  <p> The page hit counter displayed at the bottom-right corner
 3400:      of this page is maintained by the command
 3401:      <b>\counter[counters.log]{counters.txt:mimetex.html}</b>.
 3402:      After compiling and installing your
 3403:      own mimetex.cgi and your own copy of this page, that counter will
 3404:      continually show <b>1<sup><u>st</u></sup></b>'s
 3405:      unless/until you "touch" and "chmod" counters.txt (and, optionally,
 3406:      counters.log) in your mimetex.cgi directory. </p>
 3407: 
 3408: 
 3409: <h2> <a name="exceptions"> (IIIh) Other Exceptions
 3410: to LaTeX Syntax &nbsp; </a> </h2>
 3411: 
 3412: <h3> Binding Exceptions<font size=5>...</font> </h3>
 3413: 
 3414:  <p> MimeTeX's bindings are pretty much left-to-right.  For example,
 3415:      although mimeTeX correctly interprets <b>\frac12</b> as well as
 3416:      <b>\frac{1}{2}</b>, etc, the legal LaTeX expression <b>x^\frac12</b>
 3417:      must be written <b>x^{\frac12}</b>.  Otherwise, mimeTeX interprets
 3418:      it as <b>{x^\frac}12</b>, i.e., the same way <b>x^\alpha12</b>
 3419:      would be interpreted, which is entirely wrong for <b>\frac</b>.
 3420:      The same requirement also applies to other combinations of commands,
 3421:      e.g., you must write <b>\sqrt{\frac\alpha\beta}</b>, etc. </p>
 3422: 
 3423: 
 3424: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3425: SECTION IV.  APPENDICES
 3426: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
 3427: <h1> <a name="appendices"> (IV) Appendices &nbsp; </a> </h1>
 3428: 
 3429: <p> Programming information to help you modify mimeTeX's behavior,
 3430:   and to use its functionality in your own programs, is provided
 3431:   by these appendices.  The currently available appendices discuss
 3432:   (a)how to modify or extend mimeTeX's fonts, (b)how to use
 3433:   mimeTeX's principal function, make_raster(), and (c)how to use
 3434:   <a href="http://shh.thathost.com" target="_top">Sverre Huseby's</a>
 3435:   gifsave.c library. </p>
 3436: 
 3437: 
 3438: <h2> <a name="fonts"> (IVa) &nbsp; mimeTeX Fonts &nbsp; </a> </h2>
 3439: 
 3440: <p> The font information mimeTeX uses to render characters is
 3441:   derived from .gf font files (usually generated by <b>metafont</b>
 3442:   running against .mf files), which are then run through
 3443:   <b>gftype -i</b>  and finally through my <b>gfuntype</b> program
 3444:   (supplied with your mimeTeX distribution). </p>
 3445: 
 3446: <p> The final output from each such sequence of three runs
 3447:   (metafont &gt; gftype -i &gt; gfuntype) gives mimeTeX the
 3448:   bitmap information it needs to render one particular font
 3449:   family at one particular size.  The file <b>texfonts.h</b>
 3450:   supplied with your mimeTeX distribution collects the output
 3451:   from 72 such (sequences of) runs, representing nine font
 3452:   families at eight sizes each. </p>
 3453: 
 3454: <p> This collection of information in &nbsp; texfonts.h &nbsp; is
 3455:   "wired" into mimeTeX through tables maintained in <b>mimetex.h</b>.
 3456:   To change mimeTeX's fonts, you'll have to first modify (or totally
 3457:   replace) texfonts.h using your own gfuntype output, and then
 3458:   change mimetex.h to reflect your texfonts.h modifications. </p>
 3459: 
 3460: <p> This appendix provides a brief description of the above
 3461:   process, though you'll probably need at least some previous
 3462:   C programming experience to confidently accomplish it.
 3463:   Your motivation might be to add more fonts to mimeTeX,
 3464:   to change the font sizes I chose, or to add more
 3465:   font sizes, etc.  MimeTeX's design permits all this to be
 3466:   easily done once you understand the process. </p>
 3467: 
 3468: <p> Running <b>metafont</b> to generate a <b>.gf</b> file from <b>.mf</b>
 3469:   source will usually be your very first step.  A typical such run
 3470:   might be </p>
 3471:  <!-- <b>mf '\mode=onetz; mag=magstep(.5); input cmmi10'</b> --> <center>
 3472:  <b>mf '\mode=preview; mag=magstep(-16.393225); input cmmi10'</b></center>
 3473: <p class="continue"> which in this case generates output file
 3474:   <b>cmmi10.131gf</b> (which is mimeTeX's font size 3 for the
 3475:   cmmi family). </p>
 3476: 
 3477: <p> Given the cmmi10.131gf file from this metafont run
 3478:   (or substitute any other .gf file you like), next run </p>
 3479:      <center><b>gftype -i cmmi10.131gf &gt; typeout</b></center>
 3480: <p class="continue"> where <b>typeout</b> can be any temporary
 3481:   filename you like. </p>
 3482: 
 3483: <p> Finally, run <b>gfuntype</b> against the  typeout  file
 3484:   you just generated with the command </p>
 3485:      <center><b>gfuntype  -n cmmi131  typeout  cmmi131.h</b></center>
 3486:   <p class="continue"> to generate the final output file <b>cmmi131.h</b>
 3487:   (or any filename you supply as the last arg).  This
 3488:   contains the cmmi data in an array whose name is taken
 3489:   from the <b>-n</b> arg you supplied to gfuntype. </p>
 3490: 
 3491: <p> The above sequence of three runs resulted in output file
 3492:   <b>cmmi131.h</b>, containing the font information mimeTeX needs
 3493:   for one font family (cmmi) at one font size (3).  Repeat this
 3494:   sequence of three runs for each font size and each font family.
 3495:   Then pull all the output files into one big <b>texfonts.h</b> file
 3496:   (or write a small texfonts.h which just #include's them all). </p>
 3497: 
 3498: <p> For your information, the 72 sequences of runs represented
 3499:   in the texfonts.h file supplied with your mimeTeX distribution
 3500:   correspond to the following eight inital metafont runs for cmr10 </p>
 3501: <!-- 
 3502:         1 (.100gf)  mf '\mode=nextscrn; input cmr10'
 3503:         2 (.118gf)  mf '\mode=lview; input cmr10'
 3504:         3 (.131gf)  mf '\mode=onetz; mag=magstep(.5); input cmr10'
 3505:         4 (.160gf)  mf '\mode=itoh; input cmr10'
 3506:         5 (.180gf)  mf '\mode=lqlores; input cmr10'
 3507: -->
 3508:   <pre>   size=0 (.83gf)   mf '\mode=eighthre; input cmr10'
 3509:         1 (.100gf)  mf '\mode=preview; mag=magstep(-17.874274); input cmr10'
 3510:         2 (.118gf)  mf '\mode=preview; mag=magstep(-16.966458); input cmr10'
 3511:         3 (.131gf)  mf '\mode=preview; mag=magstep(-16.393225); input cmr10'
 3512:         4 (.160gf)  mf '\mode=preview; mag=magstep(-15.296391); input cmr10'
 3513:         5 (.180gf)  mf '\mode=preview; mag=magstep(-14.650373); input cmr10'
 3514:         6 (.210gf)  mf '\mode=preview; mag=magstep(-13.804885); input cmr10'
 3515:         7 (.250gf)  mf '\mode=preview; mag=magstep(-12.848589); input cmr10'</pre>
 3516:   <p class="continue">
 3517:   Then ditto for the eight other font families cmmi10, cmmib10, cmsy10,
 3518:   cmex10, bbold10, rsfs10, stmary10 and wncyr10.  And to generate other
 3519:   <b>.</b><i>dpi</i><b>gf</b> font sizes, calculate magsteps &nbsp;
 3520:   <img src="../cgi-bin/mimetex.cgi?\normalsize\frac{\log(dpi/2602)}{\log1.2}"
 3521:   alt="" align=middle border=0>. &nbsp;  All the subsequent gftype and
 3522:   gfuntype runs just follow the standard format described above. </p>
 3523: 
 3524: <p> To incorporate all this font information you just generated into
 3525:   mimeTeX, edit your <b>mimetex.h</b> file and find the table that looks
 3526:   something like </p><pre>static fontfamily aafonttable[] = {
 3527:  /* ----------------------------------------------------------------------------------------
 3528:     family    size=0,        1,        2,        3,        4,        5,        6,        7
 3529:  ----------------------------------------------------------------------------------------- */
 3530:  {   CMR10,{   cmr83,   cmr100,   cmr118,   cmr131,   cmr160,   cmr180,   cmr210,   cmr250}},
 3531:  {  CMMI10,{  cmmi83,  cmmi100,  cmmi118,  cmmi131,  cmmi160,  cmmi180,  cmmi210,  cmmi250}},
 3532:  { CMMIB10,{ cmmib83, cmmib100, cmmib118, cmmib131, cmmib160, cmmib180, cmmib210, cmmib250}},
 3533:  {  CMSY10,{  cmsy83,  cmsy100,  cmsy118,  cmsy131,  cmsy160,  cmsy180,  cmsy210,  cmsy250}},
 3534:  {  CMEX10,{  cmex83,  cmex100,  cmex118,  cmex131,  cmex160,  cmex180,  cmex210,  cmex250}},
 3535:  {  RSFS10,{  rsfs83,  rsfs100,  rsfs118,  rsfs131,  rsfs160,  rsfs180,  rsfs210,  rsfs250}},
 3536:  { BBOLD10,{ bbold83, bbold100, bbold118, bbold131, bbold160, bbold180, bbold210, bbold250}},
 3537:  {STMARY10,{stmary83,stmary100,stmary118,stmary131,stmary160,stmary180,stmary210,stmary250}},
 3538:  {   CYR10,{ wncyr83, wncyr100, wncyr118, wncyr131, wncyr160, wncyr180, wncyr210, wncyr250}},
 3539:  {    -999,{    NULL,     NULL,     NULL,     NULL,     NULL,     NULL,     NULL,     NULL}}
 3540: } ; /* --- end-of-fonttable[] --- */</pre><p class="continue">
 3541:   Note the 72 names <b>cmr83...wncyr250</b> in the table.  These must
 3542:   correspond to (or must be changed to) the names following the <b>-n</b>
 3543:   switch you specified for your &nbsp; gfuntype &nbsp; runs. </p>
 3544: 
 3545: <p> If you want more than eight font sizes, first build up texfonts.h
 3546:   with all the necessary information.  Then change LARGESTSIZE (and
 3547:   probably NORMALSIZE) in mimetex.h, and finally edit the above aafonttable[]
 3548:   by extending the columns in each row up to your largest size. </p>
 3549: 
 3550: <p> You can also add new rows by #define'ing a new family,
 3551:   and then adding a whole lot of character definitions at the bottom
 3552:   of mimetex.h, all in the obvious way (i.e., it should become obvious
 3553:   after reviewing mimetex.h).  A new row would be required,
 3554:   for example, to make another font available in mimeTeX. </p>
 3555: 
 3556: <p> One small problem with the above procedure is that the default
 3557:   &nbsp; gftype &nbsp; program supplied with most TeX distributions
 3558:   can't emit the long lines needed to display mimeTeX's larger font
 3559:   sizes.  You'll need to compile your own version from source.
 3560:   The following instructions are for Unix/Linux: <br> &nbsp; &nbsp;
 3561:   &nbsp; &nbsp; First, download both 
 3562:   <a href="http://www.ctan.org/tex-archive/systems/web2c/web-7.5.3.tar.gz"
 3563:   target="_top">web-7.5.3.tar.gz</a> and
 3564:   <a href="http://www.ctan.org/tex-archive/systems/web2c/web2c-7.5.3.tar.gz"
 3565:   target="_top">web2c-7.5.3.tar.gz</a>,
 3566:   or more recent versions.  Then &nbsp; untar &nbsp; them both,
 3567:   &nbsp; cd&nbsp;web2c-7.5.3/ &nbsp; and run &nbsp; ./configure &nbsp;
 3568:   and &nbsp; make &nbsp; in the usual way (make may fail before
 3569:   completion if you don't have all needed fonts installed,
 3570:   but it will create and compile gftype.c before failing).  Now edit
 3571:   &nbsp; texk/web2c/gftype.c&nbsp; and notice two lines very near the top
 3572:   that &nbsp; #define&nbsp;maxrow&nbsp;(79) &nbsp and similarly for maxcol.
 3573:   Change both 79's to 1024, and then re-run make.  The new &nbsp;
 3574:   texk/web2c/gftype &nbsp; executable image can emit the long
 3575:   lines needed for mimeTeX's larger font sizes. </p>
 3576: 
 3577: <p> Finally, the Unix/Linux bash shell script
 3578:   <a href="http://www.forkosh.com/texfonts.sh"
 3579:   target="_top">texfonts.sh</a> generates file &nbsp; texfonts.h &nbsp;
 3580:   containing the information for all 72 mimeTeX fonts discussed above
 3581:   (and, optionally, an extra 1200dpi cmr font used to test mimeTeX's
 3582:   supersampling algorithm).  You'll need to understand and edit this
 3583:   script to use it meaningfully.  But it helps automate mimeTeX's font
 3584:   generation procedure in case you want to experiment with different
 3585:   fonts.  (Note that metafont emits a complaint while generating the
 3586:   83dpi rsfs font.  Just press &lt;CR&gt; and it completes
 3587:   successfully.) </p>
 3588: 
 3589: 
 3590: <h2> <a name="makeraster"> (IVb) mimeTeX's make_raster()
 3591: function &nbsp; </a> </h2>
 3592: 
 3593: <p> MimeTeX converts an input LaTeX math expression to a corresponding GIF
 3594:  image in two steps.  First, it converts the input LaTeX expression to a
 3595:  corresponding bitmap raster.  Then <a href="http://shh.thathost.com"
 3596:  target="_top">Sverre Huseby's</a> gifsave library, discussed
 3597:  <a href="#gifsave">below</a>, converts that bitmap to the emitted gif.
 3598:  Though you never explicitly see that bitmap, it's mimeTeX's principal
 3599:  result.  MimeTeX is written so any program can easily use its
 3600:  expression-to-bitmap conversion capability with just a single line of code.
 3601:  The following complete program demonstrates the simplest such use. </p>
 3602: 
 3603: <pre> #include &lt;stdio.h&gt;
 3604:  #include "mimetex.h"
 3605:  int main ( int argc, char *argv[] )
 3606:  {
 3607:  raster    *rp = make_raster(argv[1],NORMALSIZE);
 3608:  type_raster(rp,stdout);  /* display ascii image of raster */
 3609:  }</pre>
 3610: 
 3611: <p> Cut-and-paste the above sample code from this file to, say,
 3612:  mimedemo.c (and fix the brackets around stdio.h).  Then compile <br>
 3613:    &nbsp; &nbsp; &nbsp; &nbsp;
 3614:    cc -DTEXFONTS mimedemo.c mimetex.c -lm -o mimedemo <br>
 3615:  and run it from your unix shell command line like <br>
 3616:    &nbsp; &nbsp; &nbsp; &nbsp; ./mimedemo &nbsp; &quot;x^2+y^2&quot; </p>
 3617:  
 3618: <p> MimeTeX's expression-to-bitmap conversion is accomplished by the
 3619:  make_raster() call, whose first argument is just a pointer to a
 3620:  (null-terminated) string containing any mimeTeX-compliant LaTeX
 3621:  expression, and whose second argument is the mimeTeX font size
 3622:  to use (overridden if your expression contains a preamble).
 3623:  The ascii display of the bitmap raster returned by make_raster()
 3624:  results from the subsequent call to type_raster().  That's all
 3625:  this program does, but you could use make_raster()'s returned bitmap
 3626:  for any other purpose you have in mind. </p>
 3627: 
 3628: <p> MimeTeX's primary purpose is to emit either xbitmaps or gif images
 3629:  rather than ascii displays.  And mimeTeX has anti-aliasing and various
 3630:  other options that further complicate its main() function compared to
 3631:  the simple example above.  The example below demonstrates mimeTeX
 3632:  usage in the slightly more realistic situation where an input expression
 3633:  is converted to a gif, without anti-aliasing, and emitted on stdout. </p>
 3634: 
 3635: <pre> #include &lt;stdio.h&gt;
 3636:  #include &lt;stdlib.h&gt;
 3637:  #include "mimetex.h"
 3638: 
 3639:  /* --- global needed by callback function, below, for gifsave.c --- */
 3640:  static  raster *rp = NULL;              /* 0/1 bitmap raster image */
 3641: 
 3642:  /* ---  callback function to return pixel value at col x, row y --- */
 3643:  int     GetPixel ( int x, int y )       /* pixel value will be 0 or 1 */
 3644:  { return (int)getpixel(rp,y,x); }       /* just use getpixel() macro */
 3645: 
 3646:  /* --- main() entry point --- */
 3647:  int     main ( int argc, char *argv[] )
 3648:  {
 3649:  /* --- get LaTeX expression from either browser query or command-line --- */
 3650:  char    *query = getenv("QUERY_STRING"),        /* check for query string */
 3651:          *expression = (query!=NULL? query :     /* input either from query */
 3652:             (argc>1? argv[1] : "f(x)=x^2"));     /* or from command line */
 3653:  /* ---- mimeTeX converts expression to bitmap raster ---- */
 3654:  rp = make_raster(expression,NORMALSIZE); /* mimeTeX rasterizes expression */
 3655:  /* ---- convert returned bitmap raster to gif, and emit it on stdout ---- */
 3656:  if ( query != NULL )                    /* Content-type line for browser */
 3657:    fprintf( stdout, "Content-type: image/gif\n\n" );
 3658:  /* --- initialize gifsave library and colors, and set transparent bg --- */
 3659:  GIF_Create(NULL, rp->width, rp->height, 2, 8); /* init for black/white */
 3660:  GIF_SetColor(0, 255, 255, 255);         /* always set background white */
 3661:  GIF_SetColor(1,   0,   0,   0);         /* and foreground black */
 3662:  GIF_SetTransparent(0);                  /* and set transparent background */
 3663:  /* --- finally, emit compressed gif image (to stdout) --- */
 3664:  GIF_CompressImage(0, 0, -1, -1, GetPixel);
 3665:  GIF_Close();
 3666:  }</pre>
 3667: 
 3668: <p> Cut-and-paste as before, compile like <br>
 3669:    &nbsp; &nbsp; &nbsp; &nbsp;
 3670:    cc -DTEXFONTS mimedemo.c mimetex.c gifsave.c -lm -o mimedemo <br>
 3671:  and run it like the first example, but this time you may want to redirect
 3672:  stdout <br>
 3673:    &nbsp; &nbsp; &nbsp; &nbsp; ./mimedemo &nbsp; &quot;x^2+y^2&quot;
 3674:    &nbsp; <b>&gt;</b> &nbsp; mimedemo.gif <br>
 3675:  since output is now a gif image consisting of mostly unprintable bytes.
 3676:  Input is typically from the command line as illustrated, but this example
 3677:  checks for a browser query string too.  That means you could actually
 3678:  replace mimetex.cgi with this executable, though anti-aliasing wouldn't
 3679:  be available. </p>
 3680: 
 3681: <p> Of course, this example's intent isn't to replace the mimetex.cgi
 3682:  executable, but rather to illustrate GIFSAVE library usage, documented
 3683:  in detail below.  And this example also illustrates usage of several
 3684:  mimeTeX raster structure elements, like rp-&gt;width and rp-&gt;height.
 3685:  So you'll probably also want to refer to mimetex.h, which contains those
 3686:  raster structures and other relevant definitions.  For instance, the
 3687:  example's GetPixel() callback function illustrates usage of the getpixel()
 3688:  macro in mimetex.h, to retrieve individual pixels by their x,y-coordinates.
 3689:  And there's a similar setpixel() macro in mimetex.h to store pixels.
 3690:  After completing all this reading, you'll be prepared to begin using
 3691:  mimeTeX functions in your own code. </p>
 3692: 
 3693: 
 3694: 
 3695: <h2> <a name="gifsave">
 3696: (IVc)</a> <a href="http://shh.thathost.com" target="_top">Sverre Huseby's</a>
 3697: gifsave.c library &nbsp; </h2>
 3698: 
 3699: <p> The information below is taken from the README file accompanying
 3700:   <a href="http://shh.thathost.com" target="_top">Sverre Huseby's</a>
 3701:   distribution of GIFSAVE.  I've made a few small editorial modifications,
 3702:   including descriptions of the several minor changes necessary
 3703:   to support mimeTeX.  And the mimeTeX example program immediately above
 3704:   uses GIFSAVE in a very straightforward way that should help clarify
 3705:   any questions which may remain after reading the documentation below. </p>
 3706: 
 3707: <pre>
 3708:                              INTRODUCTION
 3709:                              ============
 3710: 
 3711:  The GIFSAVE functions make it possible to save GIF images from
 3712:  your own C programs.
 3713: 
 3714:  GIFSAVE creates simple GIF files following the GIF87a standard.
 3715:  Interlaced images cannot be created.  There should only be
 3716:  one image per file.
 3717: 
 3718:  GIFSAVE consists of five functions, all returning type int,
 3719:  and no separate header file is required.
 3720: 
 3721:  The functions should be called in the order listed below
 3722:  for each GIF-file. One file must be closed before a new one
 3723:  can be created.
 3724: 
 3725:      GIF_Create() creates new GIF-files. It takes parameters
 3726:          specifying filename, screen size, number of colors,
 3727:          and color resolution.
 3728: 
 3729:      GIF_SetColor() sets up red, green, blue color components.
 3730:          It should be called once for each possible color.
 3731: 
 3732:      GIF_SetTransparent() is optional.  If called, it sets the
 3733:          color number of the color that should be transparent,
 3734:          i.e., the background color shows through this one.
 3735: 
 3736:      GIF_CompressImage() performs the compression of the image.
 3737:          It accepts parameters describing the position and size
 3738:          of the image on screen, and a user defined callback
 3739:          function that is supposed to fetch the pixel values.
 3740: 
 3741:      GIF_Close() terminates and closes the file.
 3742: 
 3743:  To use these functions, you must also write a callback
 3744:  function that returns the pixel values for each point
 3745:  in the image.
 3746: 
 3747: 
 3748:                              THE FUNCTIONS
 3749:                              =============
 3750: 
 3751:  GIF_Create()
 3752:  ------------
 3753:          Function  Creates a new GIF-file, and stores info on
 3754:                    the screen.
 3755: 
 3756:            Syntax  int GIF_Create(
 3757:                            char *filename,
 3758:                            int width, int height,
 3759:                            int numcolors, int colorres
 3760:                        );
 3761: 
 3762:           Remarks  Creates a new (or overwrites an existing)
 3763:                    GIF-file with the given filename. No
 3764:                    .GIF-extension is added.
 3765: 
 3766:                    If filename is passed as a NULL pointer,
 3767:                    output is directed to stdout.
 3768: 
 3769:                    The width- and height- parameters specify
 3770:                    the size of the image in pixels.
 3771: 
 3772:                    numcolors is the number of colors used in
 3773:                    the image.
 3774: 
 3775:                    colorres is number of bits used to encode a
 3776:                    primary color (red, green or blue).
 3777:                    In GIF-files, colors are built by combining
 3778:                    given amounts of each primary color.
 3779:                    On VGA-cards, each color is built by
 3780:                    combining red, green and blue values in
 3781:                    the range [0, 63]. Encoding the number 63
 3782:                    would require 6 bits, so colorres would be
 3783:                    set to 6.
 3784: 
 3785:      Return value  GIF_OK        - OK
 3786:                    GIF_ERRCREATE - Error creating file
 3787:                    GIF_ERRWRITE  - Error writing to file
 3788:                    GIF_OUTMEM    - Out of memory
 3789: 
 3790: 
 3791:  GIF_SetColor()
 3792:  --------------
 3793:          Function  Specifies the primary color component of a
 3794:                    color used in the image.
 3795: 
 3796:            Syntax  void GIF_SetColor(
 3797:                             int colornum,
 3798:                             int red, int green, int blue
 3799:                         );
 3800: 
 3801:           Remarks  This function updates the colortable-values
 3802:                    for color number colornum in the image.
 3803: 
 3804:                    Should be called for each color in the range
 3805:                    [0, numcolors]
 3806: 
 3807:                    with red, green and blue components in the
 3808:                    range  [0, (2^colorres)-1]
 3809: 
 3810:                    colorres and colornum are values previousely
 3811:                    given to the function GIF_Create().
 3812: 
 3813:      Return value  None
 3814: 
 3815: 
 3816:  GIF_SetTransparent()
 3817:  --------------------
 3818:          Function  Specifies the color number of the color
 3819:                    that should be considered transparent.
 3820: 
 3821:            Syntax  void GIF_SetTransparent(
 3822:                             int colornum
 3823:                         );
 3824: 
 3825:           Remarks  Need not be called at all.  But if called,
 3826:                    should be called only once with colornum in
 3827:                    the range  [0, numcolors]  i.e., colornum
 3828:                    must be one of the values previously
 3829:                    given to GIF_SetColor().
 3830: 
 3831:      Return value  None
 3832: 
 3833: 
 3834:  GIF_CompressImage()
 3835:  -------------------
 3836:          Function  Compresses an image and stores it in the
 3837:                    current file.
 3838: 
 3839:            Syntax  int GIF_CompressImage(
 3840:                            int left, int top,
 3841:                            int width, int height,
 3842:                            int (*getpixel)(int x, int y)
 3843:                        );
 3844: 
 3845:           Remarks  The left- and top- parameters indicate the
 3846:                    image offset from the upper left corner of
 3847:                    the screen.  They also give the start values
 3848:                    for calls to the userdefined callback
 3849:                    function.
 3850: 
 3851:                    width and height give the size of the image.
 3852:                    A value of -1 indicates the equivalent screen
 3853:                    size given in the call to GIF_Create().
 3854: 
 3855:                    If the image is supposed to cover the entire
 3856:                    screen, values 0, 0, -1, -1 should be given.
 3857: 
 3858:                    GIF_CompressImage() obtains the pixel values
 3859:                    by calling a user specified function. This
 3860:                    function is passed in the parameter getpixel.
 3861:                    See "callback()" further down for a
 3862:                    description of this function.
 3863: 
 3864:      Return value  GIF_OK        - OK
 3865:                    GIF_ERRWRITE  - Error writing to file
 3866:                    GIF_OUTMEM    - Out of memory
 3867: 
 3868: 
 3869:  GIF_Close()
 3870:  -----------
 3871:          Function  Closes the GIF-file.
 3872: 
 3873:            Syntax  int GIF_Close(void);
 3874: 
 3875:           Remarks  This function writes a terminating descriptor
 3876:                    to the file, and then closes it. Also frees
 3877:                    memory used by the other functions of GIFSAVE.
 3878: 
 3879:      Return value  GIF_OK        - OK
 3880:                    GIF_ERRWRITE  - Error writing to file
 3881: 
 3882: 
 3883:                          THE CALLBACK FUNCTION
 3884:                          =====================
 3885: 
 3886:  callback()
 3887:  ----------
 3888:          Function  Obtains pixel-values for the
 3889:                    GIF_CompressImage() -function.
 3890: 
 3891:            Syntax  int callback(int x, int y);
 3892: 
 3893:           Remarks  This function must be written by the
 3894:                    programmer.  It should accept two integer
 3895:                    parameters specifying a point in the image,
 3896:                    and return the pixel value at this point.
 3897: 
 3898:                    The ranges for these parameters are as
 3899:                    follows
 3900:                        x : [img_left, img_left + img_width - 1]
 3901:                        y : [img_top, img_top + img_height - 1]
 3902: 
 3903:                    where img_left, img_top, img_width and
 3904:                    img_height are the values left, top, width
 3905:                    and height passed to GIF_CompressImage().
 3906: 
 3907:                    An example; if the screen has width 640 and
 3908:                    height 350, and the image covers the entire
 3909:                    screen, x will be in the range  [0, 639]
 3910:                    and y in the range  [0, 349].
 3911: 
 3912:                    callback() need not get its values from the
 3913:                    screen. The values can be fetched from a
 3914:                    memory array, they can be calculated for
 3915:                    each point requested, etc.
 3916: 
 3917:                    The function is passed as a parameter to
 3918:                    GIF_CompressImage(), and can thus have any
 3919:                    name, not only callback().
 3920: 
 3921:      Return value  Pixel value at the point requested. Should
 3922:                    be in the range  [0, numcolors-1]  where
 3923:                    numcolors is as specified to GIF_Create().
 3924: </pre>
 3925: 
 3926: 
 3927: 
 3928: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3929: CONCLUDING REMARKS
 3930: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
 3931: <h1 id="remarks"> Concluding Remarks &nbsp; </h1>
 3932: 
 3933: <p> I hope you find mimeTeX useful.  If so, a contribution to your
 3934:   country's <a href="http://www.tug.org" target="_top">TeX Users Group</a>,
 3935:   or to the <a href="http://www.gnu.org" target="_top">GNU</a> project, is
 3936:   suggested, especially if you're a company that's currently profitable. </p>
 3937:   
 3938: <!--
 3939: <p> If you also like mimeTeX's source, I'm an independent contractor
 3940:   incorporated in the US as John Forkosh Associates, Inc.
 3941:   A <a href="http://www.forkosh.com/resume.html" target="_top">resume</a>
 3942:   is at <a href="http://www.forkosh.com" target="_top">www.forkosh.com</a>
 3943:   or email
 3944:   <a href="mailto:john&#64;forkosh&#46;com">john&#64;forkosh&#46;com</a> </p>
 3945: -->
 3946: 
 3947: <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3948: Footer across bottom of page
 3949: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
 3950: <hr size=4>
 3951: <table> <tr>
 3952:  <td> <font size=3 color="maroon"> <b>
 3953:   <nobr>Copyright <font size=5>&copy;</font> 2002-2008,
 3954:   <a href="http://www.forkosh.com">John Forkosh Associates, Inc.</a>
 3955:   </nobr><br>
 3956:   email: <a href="mailto:john&#64;forkosh&#46;com">john&#64;forkosh&#46;com</a>
 3957:   </b> </font> </td>
 3958:  <td> <img src="../cgi-bin/mimetex.cgi?\hspace{100}" alt="" border=0> </td>
 3959:  <td> <img src="../cgi-bin/mimetex.cgi?\blue{\small\rm You're the }
 3960:        \Large\counter[counters.log]{counters.txt:mimetex.html}\\[0]
 3961:        {\small\rm visitor to this page." alt="" border=0 align=bottom> </td>
 3962: </tr> </table>
 3963: </body>
 3964: </html>
 3965: <!-- end-of-file mimetex.html -->

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