5

I want to write formulas in Mathematica format in my blog, inside tag's formula. What js should I use (and what libary), to replace those tag's, with http://www.wolframalpha.com/ search result image, when Dom gets loaded?

For example:

<formula>Limit[((3 + h)^(-1) + -1/3)/h, h -> 0]</formula>

gets replaced with: alt text

If it's to complex or can not be done with javascript, please explain why.

Margus
  • 19,694
  • 14
  • 55
  • 103

3 Answers3

2

You need to use wolframalpha API service, but it's not free and you can't do this using javascript because of same origin policy, only using server-side language.

antyrat
  • 27,479
  • 9
  • 75
  • 76
2

It seems that your real question is: "how do I get nice math on Blogger.com", so I will answer this instead.

A proven solution (see e.g. Psychedelic Geometry, no affiliation) is to use the MathTex system by John Forkosh (who also hosts a public cgi) together with the ReplaceMath script by Randall Farmer. Browse some source for modified versions of the script.

Installation is a matter of including a single javascript file, after which you can inline LaTeX in your html as $latex <some LaTeX to be png'ified> $.

Janus
  • 5,421
  • 2
  • 26
  • 37
1

If you want to format output from Wolfram Alpha then @antyrat is correct. But if you just want to write nice-looking mathematical expressions for your blog you should look at Presentation MathML and LaTeX. There is a variety of utilities for rendering LaTeX into gif or png or similar formats.

High Performance Mark
  • 77,191
  • 7
  • 105
  • 161
  • As i'm using blogger, i don't see how that is an option. Besides I assume that Mathematica Cell->Convert To->Bitmap + (Piscasa auto Sync) + drag & drop, should also work. – Margus Sep 24 '10 at 00:40