# Efficient LaTeX for web pages?

• LaTeX

## Main Question or Discussion Point

I'm doing some web-based college-level course design in fluid mechanics. I'd like an efficient way to incorporate LaTeX equations - preferably on the fly like PF does here. I can create the equations elsewhere (e.g., using TexPoint, PowerPoint and Miktex) and then insert them into my pages but it seems a laborious process.

Does anyone know how PF does it? Is it open-source, proprietory, available...?

Anyone have any other ideas on this?

## Answers and Replies

Related MATLAB, Maple, Mathematica, LaTeX News on Phys.org
-Job-
Science Advisor
Not bad, is that what these forums use, mimeTex? It seems faster, though they say it's not 100% compliant.

Our IT dept is pretty "careful" (they won't even install a PHP engine) so I won't be able to get them to install mimetex. I was hoping (dreaming?) for something that would allow me just to write some LaTeX code and have an image generated and inserted into the page so that there is nothing "new" to scare our IT people. Maybe that's not possible?

Although not quite what I want, Latexrender seems worth invesigating since I have MikTeX and ImageMagick on my local machine.

chroot
Staff Emeritus
Science Advisor
Gold Member
The code for PF is custom-written, and is based on standard LaTeX coupled with a modified ps2img.

- Warren

-Job-
Science Advisor
I've incorporated mimeTex into my converter:
http://www.bloo.us/tex/services/ [Broken]
So now it can convert to .gif or .png
I have to say mimeTex is nice but it's not very feasible as .cgi
The way they suggest using mimeTex.cgi is to use it on image tags like:
Code:
<img src="../cgi-bin/mimetex.cgi?f(x)=\int_{-\infty}^xe^{-t^2}dt"
alt="" border=0 align=middle>
What this means is that:
. for large Latex documents your img tags can be pretty large.
. everytime you want to read the html file there is a call to the cgi script, unnecessary processing.
I used the .exe version and use it to save Latex into a gif only once and then link it statically. This is more efficient.
I want to put all these converters together and then write a web-based editor for latex. It will be able to convert to:
. gif
. png
. html
. mathml (xml)
. ps
. pdf
Obviously anyone can just download the respective converters and use them, but that's a pain (speaking from experience) because most of the time it's not straightforward how to install or run these, so i think my CSE department is going to like it, we'll see.
Anyway, getting to the question here, Dave what i suggest is have a main webpage with a text area. People can type text/html into this text area, being careful to have the Latex code in between the {tex}{/tex} tags. You would then have a button that submits this to the server, the server checks for any {tex} tags, removes them, processes the Latex code, generates the image, puts an <img> tag where the {tex} tag used to be and creates an html file which it saves locally.
Basically the very same thing as we have in the forums here. If you want a standalone application the idea would be the same. I think i could build such a standalone app pretty easily to tell you the truth, nothing outstanding. If you don't find a solution i may be able to help you.

Last edited by a moderator:
There is also a Linux program called tex2im that will convert Latex into .png images. Use google if you want to find it.