From thrift@ra.csc.ti.com Fri May 20 10:17:58 1994 Article: 16838 of comp.infosystems.www From: thrift@ra.csc.ti.com (Philip Thrift) Subject: Embedding LaTeX in HTML Organization: Texas Instruments Date: Thu, 19 May 94 19:12:01 GMT-1:00 There has been some discussion about including math and table data, which LaTeX is good for, in HTML files (a problem until MATH and TABLE containers are generally supported). Below is a solution I use that some may find useful (I have). There is of course the latex2html package at http://cbl.leeds.ac.uk/nikos/tex2html/doc/latex2html/latex2html.html and the method below uses pstogif, pstoppm.ps, pstoxbm from that package. The approach I use below is sort of the opposite of latex2html: embed LaTeX in HTML and translate. Pending approval, I could probably release the software, but the filter I wrote is simple, so I hope this explanation is sufficient for now. I am not aware of anyone else using this approach. The solution I use is to embed LaTeX data in HTML comments. Anything in is considered LaTex data. This is similar to the way 'server side includes' are done in the latest WWW protocol. Below is an example of an HTMX file (containing LaTeX in HTML comments): example.htmx: ------------------------------------------------------------------ Example of embedding LaTex in an HTML file

Here is an example of a table:

Euler's equation looks like:

where is the natural logarithm base and . ------------------------------------------------------------------ I wrote a filter 'axtex' that extracts the LaTeX "objects" from HTMX files and produces a .tex and ultimately an image file for each one, and produces an HTML file with the corresponding inlines: example.html: ------------------------------------------------------------------------- Example of embedding LaTex in an HTML file

Here is an example of a table:

Euler's equation looks like:

where is the natural logarithm base and . ------------------------------------------------------------------------- The XBM files (or GIF could have been generated) are created by the 'axtex' filter using the latex,dvips, and pstoxbm (or pstogif) utilities. I found this approach useful from the point of view of an HTML author: you only want to escape to LaTeX when you need to (for now). -pt