Putting math on the Web, in (La)TeX

Joel A. Shapiro

(This replaces an example based on jsmath, which was based on a file prepared by John Doroshenko)

Many of us make web pages and need to incorporate mathematical expressions. I have recently learned of a package which allows us to post pages that have included math using familiar tex expressions, as for example
\(\int_0^\infty t^{z-1} e^{-t}\,dt = \Gamma(z)\). You can also make more complex, displayed equations.

This package is called mathJax. You can read about it from its home page at http://www.mathjax.org/.

The page so made can be read with any current browser (I am told) and looks quite reasonable. It does not require tex/latex fonts to be installed on the reader's computer.

Of course many of us have been posting (La)TeX math by making a pdf file and posting that. The advantage of mathJax is that you can use the features available in HTML, in particular links and easy editability.

If you want to try making a page that uses this, copy the first <script>...</script>... into the head section of a file, and insert latex equations, but not $\theta$ (use \(\theta\) instead).

If you really want to use single dollar signs for equations, add
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>

Another jsMath Example:

$$\int^1_\kappa \left[\bigl(1-w^2\bigr)\bigl(\kappa^2-w^2\bigr)\right]^{-1/2} dw = \frac{4}{\left(1+\sqrt{\kappa}\,\right)^2} K \left(\left(\frac{1-\sqrt{\kappa}}{1+\sqrt{\kappa}}\right)^{\!\!2}\right)$$

And here is another simple example

You can put the equation here \( f(x) = \sqrt{1+x}, \quad x \ge -1 \) or have it displayed like this: $$f(x) = \sqrt{1+x}, \quad x \ge -1$$