What is the best way to embed LaTeX in a webpage?

Solution 1:

I prefer MathJax over solutions that choose to render images (which causes aliasing problems).

MathJax is an open source Javascript rendering engine for mathematics. It uses CSS and Webfonts instead of images or flash and can render LaTeX or MathML. That way you don't have problems with zoom and it's even screenreader compatible.

Solution 2:

I once developed a jQuery plugin that does in fact this: jsLaTeX

Here's the simplest example of how it can be used:

$(".latex").latex();


<div class="latex">  
    \int_{0}^{\pi}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx =\frac{22}{7}-\pi  
</div>

The above will generate the following LaTeX equation on your page:

Equation

The Demo Page of the plugin contains more code examples and demos.