Wednesday, February 16, 2011

MathJax

To get equations that just work on your site, go to http://www.mathjax.org/.

On those pages, there are several options, since it is a very flexible program, but the simplest is to copy the following text into your blog template or webpage:

<script type="text/javascript" src="http://www.mathjax.org/mathjax/MathJax.js">
    MathJax.Hub.Config({
        extensions: ["tex2jax.js"],
        jax: ["input/TeX", "output/HTML-CSS"],
        tex2jax: {
            inlineMath: [ ['$','$'], ["\\(","\\)"] ],
            displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
        },
        "HTML-CSS": { availableFonts: ["TeX"] }
    });
</script>

I found this after a much longer search than I thought at the configuration webpage.  Now what they actually have for the source is "path-to-MathJax/MathJax.js" and encourage you to get your own copy.  However, I don't have a place to put the downloaded mathjax stuff, so I just used theirs.  I don't think this is what they really want, but I didn't see a way around it.

There are lots of LaTeX commands you can use, here is a list

For example, this just works

$$\frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{1+\ldots}}}}}}$$

No comments:

Post a Comment

Powered by MathJax