Page 1 of 1

Creating images of an Equation

Posted: Thu Sep 16, 2004 9:34 pm
by DD32
i'm in need of being able to generate iamges of mathematical/chemical equations... something like the quadratic formula of x=-b+\-SQRT(b^2-4ac)/2a

however i need it more in the format that would be displayed in MS eqation editor.. or OpenOfices equation editor... i could do it manually, but i'd like to automate the task...(it's for a web-based PHP script)..

I've looked around and can't find anything pre-written, on phpclasess or any others...
so i' might end up writing it myself using the GD library...
BUT does anyone know of some pre-written stuff.. or a way to approach such a task?

I'll post this now.. but it's not going to be about 2days before i am near a computer to start it at all.. so if anyone can help me out with anything, it'd be appreciated.

-=DD32=-

Posted: Thu Sep 16, 2004 9:37 pm
by feyd
look into LaTeX

Posted: Thu Sep 16, 2004 9:44 pm
by DD32
feyd wrote:look into LaTeX
ok i'll do that now.

Posted: Thu Sep 16, 2004 10:41 pm
by Slacker
what picture formats do they read?

Posted: Thu Sep 16, 2004 10:43 pm
by feyd
LaTeX? nothing, it's a document language that can render complex math equations...

Posted: Thu Sep 16, 2004 11:05 pm
by DD32
feyd wrote:LaTeX? nothing, it's a document language that can render complex math equations...
.

Seems useable... now.. just to work out how to use it.

Thanks!

-=DD32=-

Posted: Fri Sep 17, 2004 3:00 am
by timvw

Posted: Fri Sep 17, 2004 3:59 am
by DD32
Hmm.. nice try, unfortunatly thats not what i'm after at all.. first of all it doens't work in my browser, or the most common browsers, and second of all.. it requires a plugin to be installed anyway...

no offence mean't sorry.
I've found a simmilar thing like this, in teh form of a java applet that accepts LaTeX style equations.(http://www.esr.ruhr-uni-bochum.de/VCLab ... otEqn.html

I've also found a Perl script to convert LaTeX equations into Bitmap/PNG/Jpeg images(http://www.nought.de/tex2im.php)

And on top of that.. a PHP script that can directly call LaTeX and display teh result in PNG/Gif(somewhere in http://www.tug.org/tex-archive/support/ ... nder/demo/)

Allthough it's not completely PHP Based as i would prefer, it might have to do in teh long run, on and btw, when i say i don't prefer this option, i mean i'd strongly not have to rely on LaTeX to be installed... but i've looked around and couldn't work anything out..(other than doing a GD image myself.... as this isn't going to be placed on a custom-compiled and specific built server unfortunatly.. just the general run-off-the-mill webserver.. o i doubt i'll be able to use LaTeX on it.

Anyway, any more ideas are welcomes as usual.

-=DD32=-

Posted: Fri Sep 17, 2004 4:02 am
by feyd
most likely, the whole thing in a script, instead of an extension would run slow.

Posted: Fri Sep 17, 2004 4:05 am
by DD32
feyd wrote:most likely, the whole thing in a script, instead of an extension would run slow.
Sorry that doens't come accross very well with my logic...;
by script, and extension.. what refers to what? script = PHP|External language;
or something slightly different?

BUT i personally would expect an external script to be slower than it being done internally... mainly becasue it dones't have to load more off teh harddrove and instead has more processing to deal with..

-=DD32=-

Posted: Fri Sep 17, 2004 4:08 am
by feyd
script = php file.

the speed difference between an inline LaTeX rendering script and a compiled binary renderer can be huge.. but that's heavily dependant on how optimized the code is in each..

Posted: Fri Sep 17, 2004 4:10 am
by DD32
ah ok thanks...
well eitherway, thanks for the help, and i'll check back in a few days.

-=DD32=-

Posted: Sun Sep 19, 2004 6:11 am
by timvw
on freshmeat i saw this today :

http://redsymbol.com/software/l2p/

Posted: Sun Sep 19, 2004 9:06 pm
by DD32
Thanks i'l add it to the list of programs i'll try...