I'd like to include some basic math equations into a webpage. Is there an easy way of either compiling the LaTeX into an image which I can upload, or else of having the browser parse the code?
|
|
mathURL is pretty cool. It's specifically for mathematics though. |
|||
|
|
|
jsMath and its successor MathJax are JavaScript libraries which provide client side rendering of LaTeX formulas. (jsMath is what MathOverflow uses to render LaTeX.) |
|||||||||||||||
|
|
Google Charts has an output format for LaTeX: If you prefer client-side rendering, jsmath is popular (and the system used on MathOverflow) |
|||||||||||
|
There are other solutions but I think these are the easiest/best. |
||||
|
|
|
If you are using a Mac, LaTeXit is a great utility that lets you type in a bit of latex (intended for equations, but it will work with valid latex), runs latex of it and produces an image. It embeds the latex in the image, so of you open the image latter, you can edit the latex. This means you don't need a bunch of tiny .tex files laying around. |
|||
|
|
|
CodeCogs turns LaTeX into the picture format of your choice and hosts it. They do ask for money if you are going to be hitting them more than a few thousand times a day, though. This meta topic is essentially the same question. |
||||
|
|
|
A friend of mine hacked together mathcache: put a short It's probably worth noting that blogs hosted on WordPress.com have LaTeX support. Text beginning with |
|||
|
|
|
When embedding mathematics into a webpage, there are two primary questions:
In my opinion, each of these has a definite answer and a different solution should only be used if the optimal solution really cannot be done.
Server-side MathML is the optimal solution. Of course, it's not always possible and then other solutions are useful. There are various standard arguments against using server-side MathML and other myths about mathematics in webpages that are worth taking a minute over. Myths
Finally - on this part - for those that still worry about Joe Blogs (or Ola Nordmann, to be geographically correct) not being able to read your webpage due to using an old version of IE and refusing to install plugins, it is actually possible to have two versions of the mathematics on your server and send MathML to those that can see it and PNGs to those that can't, thus getting the best of both worlds. What about implementation? Well, there you're in luck. iTeX can do it all, and in spades. iTeX is a fast c++ program that converts a subset of LaTeX mathematical language into MathML. The original package comes with bindings for ruby, and I've extended this to PHP, Perl, and Python. By combining it with other packages, in particular svgmath or gtkmathview, it is possible to further convert the MathML to an image for broken browsers. (Contact me for these extensions; I haven't gotten round to writing them up yet - it's on my TODO list!) For examples, see the nlab (pure MathML) and the nforum (MathML, SVG, or PNG depending on what browser you are using). Lastly, although I'm concerned with accessibility, I'm not an expert. So I've cross-posted my answer to the blindmath mailing list and shall update this according to the response that I get there. |
|||||||||||||
|
|
If you put
into a document of yours, the resulting DVI or PDF file will contain one page per graphic with appropriate size information. Use
(taken from the documentation of |
||||
|
|
|
LaTeXML is a very powerful server-side tool to convert LaTeX documents and math expressions to HTML/MathML. It works well to serve LaTeXML-produced MathML and use MathJax to render it in the browser. |
||||
|
|
|
One more alternative for WordPress based site is my GFormula plugin, which allows you to compile the LaTeX into an image and past into a post. You can also set image dimensions for compiled image, background and foreground colors. |
||||
|
|