tags:

views:

145

answers:

6

Is there some open source project I can refer to?

I'm using PHP.

Anyone knows?

+2  A: 

It looks like LatexRender might do what you want.

Dominic Rodger
It's too complex to set up.
Have you tried? It only requires two files (the site says), where one actaully wraps latex in a class, and the other contains a convenience function.
catchmeifyoutry
No,it need to install several other softwares
A: 

Check out mimetex and its variant mathtex.

nes1983
+3  A: 

I've tried about half a dozen of the available solutions. The best I've seen is QuickLaTeX which has a WordPress plugin which could easily be adapted to other platforms. It has better vertical alignment than the other solutions. There is a list of most of the available solutions at http://sixthform.info/steve/wordpress/?p=59

Rob Hyndman
A: 

Sure there is one good service or project avaiable. Its a latext implementation written in pure php have a look ;-)

The code is very clean and logical

LATEX PHP

streetparade
This is not pure PHP: it uses `latex` engine as a backend.
o_O Tync
+1  A: 

Download the Wikipedia engine and analyze how it renders formulas.

That's a general "how do I implement..." solution: remember where you might have met the feature you're looking for, then download the sources and use them/their ideas.

If you're looking for a pure PHP script that renders TeX -- you'll fail: no one dares to implement a script of that complexity. Even if you find one, it won't support all the nice packages provided by the TeX community!

All solutions use command-line TeX builders. NEVER invent bicycles until you're sure your bicycle has a chance of becoming the best ;)

o_O Tync
I think it's a general rule that if you're looking for a pure <insert non-C language here> way to render TeX - you'll fail. Every method I've seen of rendering TeX uses TeX under the hood.
Stobor
Which is also the point, no? All tex renders the same, regardless of where
ccook
A: 

There's a service that was implemented with mathtex:

http://www.forkosh.dreamhost.com/mathtex.cgi?\sum_i^N%20\lim_{x%20\rightarrow%20k}x

jbochi