README 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. --------------------------------------------------------------------------
  2. March 24, 2009 Version 1.71
  3. m i m e T e X R e a d m e F i l e
  4. (including pre-compiled Linux binary mimetex.cgi -- see NOTE below)
  5. Copyright(c) 2002-2009, John Forkosh Associates, Inc. All rights reserved.
  6. --------------------------------------------------------------------------
  7. by: John Forkosh
  8. john@forkosh.com www.forkosh.com
  9. This file is part of mimeTeX, which is free software.
  10. You may redistribute and/or modify it under the terms
  11. of the GNU General Public License, version 2 or later,
  12. as published by the Free Software Foundation. See
  13. http://www.gnu.org/licenses/gpl.html
  14. -------------------------------------------------------------
  15. NOTE for Linux users...
  16. -------------------------------------------------------------
  17. This zip file contains pre-compiled binary image mimetex.cgi,
  18. compiled under Debian GNU/Linux running kernel 2.4.32, with gcc
  19. 3.3.5. It also contains all mimetex source files. The compile
  20. command was
  21. gcc -static -DAA mimetex.c gifsave.c -lm -o mimetex.cgi
  22. -------------------------------------------------------------
  23. MimeTeX is discussed and illustrated online at
  24. its homepage
  25. http://www.forkosh.com/mimetex.html
  26. Or you can follow the Quick Start instructions below
  27. (or the more detailed instructions in Section III)
  28. to immediately install mimeTeX on your own machine.
  29. Then point your browser to
  30. http://www.yourdomain.com/mimetex.html
  31. for a demo/tutorial and reference.
  32. Installation problems? Point your browser to
  33. mimeTeX's homepage
  34. http://www.forkosh.com/mimetex.html
  35. then click its "full mimeTeX manual" link and see
  36. Section II.
  37. I. QUICK START
  38. ------------------------------------------------------------------------
  39. To compile and install mimeTeX
  40. * unzip mimetex.zip in any convenient working directory
  41. * to produce an executable that emits anti-aliased
  42. gif images (recommended)
  43. cc -DAA mimetex.c gifsave.c -lm -o mimetex.cgi
  44. -or- for gif images without anti-aliasing
  45. cc -DGIF mimetex.c gifsave.c -lm -o mimetex.cgi
  46. -or- to produce an executable that emits mime xbitmaps
  47. cc -DXBITMAP mimetex.c -lm -o mimetex.cgi
  48. (For Windows, see "Compile Notes" in Section III below.)
  49. * mv mimetex.cgi to your server's cgi-bin/ directory
  50. * mv mimetex.html to your server's htdocs/ directory
  51. * if the relative path from htdocs to cgi-bin isn't
  52. ../cgi-bin then edit mimetex.html and change the
  53. few dozen occurrences as necessary.
  54. Then, to quickly learn more about mimeTeX
  55. * point your browser to www.yourdomain.com/mimetex.html
  56. Any problems with the above?
  57. * read the more detailed instructions below,
  58. or see http://www.forkosh.com/mimetex.html
  59. II. INTRODUCTION
  60. ------------------------------------------------------------------------
  61. MimeTeX, licensed under the gpl, lets you easily embed LaTeX math in
  62. your html pages. It parses a LaTeX math expression and immediately
  63. emits the corresponding gif image, rather than the usual TeX dvi.
  64. And mimeTeX is an entirely separate little program that doesn't
  65. use TeX or its fonts in any way. It's just one cgi that you put in
  66. your site's cgi-bin/ directory, with no other dependencies.
  67. So mimeTeX is very easy to install. And it's equally easy to use.
  68. Just place an html <img> tag in your document wherever you want to
  69. see the corresponding LaTeX expression. For example,
  70. <img src="../cgi-bin/mimetex.cgi?f(x)=\int_{-\infty}^x~e^{-t^2}dt"
  71. border=0 align=absmiddle>
  72. generates and displays the corresponding gif image on-the-fly,
  73. wherever you put that <img> tag. MimeTeX doesn't need intermediate
  74. dvi-to-gif conversion, and it doesn't clutter your filesystem with
  75. separate little gif files for each converted expression. (Optional
  76. image caching does store gif files, and subsequently reads them as
  77. needed, rather than re-rendering the same images every time a page
  78. is reloaded.)
  79. III. COMPILATION AND INSTALLATION
  80. ------------------------------------------------------------------------
  81. I've built and run mimeTeX under Linux and NetBSD using gcc.
  82. The source code is ansi-standard C, and should compile
  83. and execute under all environments without any change whatsoever.
  84. Build instructions below are for Unix. Modify them as necessary
  85. for your particular situation. Note the -DWINDOWS switch if
  86. applicable.
  87. Unzip mimetex.zip in any convenient working directory.
  88. Your working directory should now contain
  89. mimetex.zip your gnu zipped mimeTeX distribution containing...
  90. README this file (see mimetex.html for demo/tutorial)
  91. LICENSE GPL license, under which you may use mimeTeX
  92. mimetex.c mimeTeX source program and all required functions
  93. mimetex.h header file for mimetex.c (and for gfuntype.c)
  94. gfuntype.c parses output from gftype -i and writes bitmap data
  95. texfonts.h output from several gfuntype runs, needed by mimetex.c
  96. gifsave.c gif library by Sverre H. Huseby <sverrehu@online.no>
  97. mimetex.html sample html document, mimeTeX demo and tutorial
  98. Note: all files in mimetex.zip use Unix line termination,
  99. i.e., linefeeds (without carriage returns) signal line endings.
  100. Conversion for Windows, Macs, VMS, etc, can usually be accomplished
  101. with unzip's -a option, i.e., unzip -a mimetex.zip
  102. Now, to compile a mimeTeX executable that emits anti-aliased gif
  103. images (recommended for most uses), type the command
  104. cc -DAA mimetex.c gifsave.c -lm -o mimetex.cgi
  105. Or, for an executable that emits gif images without
  106. anti-aliasing,
  107. cc -DGIF mimetex.c gifsave.c -lm -o mimetex.cgi
  108. Alternatively, to compile a mimeTeX executable that emits
  109. mime xbitmaps, just type the command
  110. cc -DXBITMAP mimetex.c -lm -o mimetex.cgi
  111. Compile Notes:
  112. * If (and only if) you're compiling a Windows executable
  113. with the -DAA or -DGIF option (but not -DXBITMAP), then
  114. add -DWINDOWS also. For example,
  115. cc -DAA -DWINDOWS mimetex.c gifsave.c -lm -o mimetex.cgi
  116. The above Unix-like syntax works with MinGW (http://www.mingw.org)
  117. and djgpp (http://www.delorie.com/djgpp/) Windows compilers, but
  118. probably not with most others, where it's only intended as a
  119. "template".
  120. * Several additional command-line options that you may find
  121. useful are discussed in Section IId (href="#options")
  122. of your mimetex.html page.
  123. That's all there is to building mimeTeX. You can now test your
  124. mimetex.cgi executable from the Unix command line by typing, e.g.,
  125. ./mimetex.cgi "x^2+y^2"
  126. which should emit two ascii rasters something like the following
  127. Ascii dump of bitmap image... Hex dump of colormap indexes...
  128. ........**..................**.. .......1**1................1**1.
  129. .......*..*.....*..........*..*. .......*23*.....*..........*23*.
  130. ..........*.....*.............*. ..........*.....*.............*.
  131. .***......*.....*....**.*.....*. .***1....2*.....*....**3*....2*.
  132. .**.*....*......*....**.*....*.. .**.*...1*......*....**.*...1*..
  133. ..*.....*.*..******...*.*...*.*. ..*....2*.*..******...*.*..2*.*.
  134. **.*...****.....*....*.*...****. **.*...****.....*....*.*2..****.
  135. ****............*.....**........ ****............*....1**........
  136. ................*......*........ ................*......*........
  137. ................*....**......... ................*....**1........
  138. The 5 colormap indexes denote rgb...
  139. .-->255 1-->196 2-->186 3-->177 *-->0
  140. The right-hand illustration shows asterisks in the same positions as
  141. the left-hand one, along with anti-aliased grayscale colormap indexes
  142. assigned to neighboring pixels, and with the rgb value for each
  143. index. Just typing ./mimetex.cgi without an argument should produce
  144. ascii rasters for the default expression f(x)=x^2. If you see the
  145. two ascii rasters then your binary's good, so mv it to your server's
  146. cgi-bin/ directory and set permissions as necessary.
  147. Once mimetex.cgi is working, mv it to your server's cgi-bin/ directory
  148. (wherever cgi programs are expected), and chmod/chown it as necessary.
  149. Then mv mimetex.html to your server's htdocs/ directory. Now point
  150. your browser to www.yourdomain.com/mimetex.html and you should see
  151. your mimeTeX user's manual reference page.
  152. Install Notes:
  153. * These two directories are typically of the form
  154. somewhere/www/cgi-bin/ and somewhere/www/htdocs/
  155. so I set up mimtex.html to access mimetex.cgi from
  156. the relative path ../cgi-bin/ If your directories
  157. are non-conforming, you may have to edit the few dozen
  158. occurrences of ../cgi-bin/mimetex.cgi in mimetex.html
  159. Sometimes a suitable symlink works. If not, you'll
  160. have to edit. In that case, globally changing
  161. ../cgi-bin/mimetex.cgi often works.
  162. * Either way, once mimetex.html displays properly, you can
  163. assume everything is working, and can begin authoring html
  164. documents using mimetex.cgi to render your own math.
  165. IV. REVISION HISTORY
  166. ------------------------------------------------------------------------
  167. 11/30/04 J.Forkosh version 1.60 (beta) released
  168. 10/02/04 J.Forkosh version 1.50 released on CTAN with various new
  169. features and fixes, and updated documentation.
  170. 07/18/04 J.Forkosh version 1.40 re-released on CTAN with minor
  171. changes, e.g., \mathbb font and nested \array's
  172. now supported.
  173. 03/21/04 J.Forkosh version 1.40 released on CTAN, with improved
  174. LaTeX compatibility, various new features and
  175. fixes, including fix to work under Windows.
  176. 12/21/03 J.Forkosh version 1.30 released on CTAN, with improved
  177. LaTeX compatibility and anti-aliasing, various new
  178. features, and thoroughly updated documentation.
  179. 10/17/03 J.Forkosh version 1.20 released on CTAN, adding picture
  180. environment and various other changes (e.g.,
  181. more delimiters arbitrarily sized) and fixes.
  182. 07/29/03 J.Forkosh version 1.10 released on CTAN, completely replacing
  183. mimeTeX's original built-in fonts with thinner and
  184. more pleasing fonts, and adding one larger size.
  185. 06/27/03 J.Forkosh version 1.01 released on CTAN, adding lowpass
  186. anti-aliasing for gifs, and http_referer checks,
  187. and fixing a few very obscure bugs.
  188. 12/11/02 J.Forkosh version 1.00 released on CTAN, fixing \array bug
  189. and adding various new features.
  190. 10/31/02 J.Forkosh version 0.99 released on CTAN
  191. 09/18/02 J.Forkosh internal beta test release
  192. V. CONCLUDING REMARKS
  193. ------------------------------------------------------------------------
  194. I hope you find mimeTeX useful. If so, a contribution to your
  195. country's TeX Users Group, or to the GNU project, is suggested,
  196. especially if you're a company that's currently profitable.
  197. If you also like mimeTeX's source, I'm an independent contractor
  198. incorporated in the US as John Forkosh Associates, Inc. A resume
  199. is at www.forkosh.com or email john@forkosh.com
  200. ========================= END-OF-FILE README ===========================