# 9 Tools to Display Math on Web

By Xah Lee. Date: . Last updated: .

## MathJax for Web Publishing

MathJax is a JavaScript library for displaying math in browsers.

You can use any of {MathML, LaTeX, ASCIIMathML} markup for input.

Here is a example of using it. Put the following in your HTML page.

<script defer src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

then, in your web page, you can enter this plain text:

$$\Pr\left(\bigcup_i \Omega_i\right)=\sum_i \Pr(\Omega_i)=\sum_i\Pr(X=u_i)=1$$

it'll display like this:

$$\Pr\left(\bigcup_i \Omega_i\right)=\sum_i \Pr(\Omega_i)=\sum_i\Pr(X=u_i)=1$$

if your math expression has any of {&, >, <} symbols, you need to put space on both sides of the symbol. Or, to be absolutely safe, change them to { &amp;, &gt;, &lt; }. [see HTML XML Entities]

### MathJax Examples

$$\sum_{n=1}^k \frac{1}{n} ≻ \int_1^{k+1} \frac{1}{x} dx = \ln(k+1)$$
$$\sum_{n = 0}^\infty \frac{(-1)^{n}}{2n+1} = 1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \cdots = \frac{\pi}{4}$$
$$\int_a^b \! f(x) dx = F(b) - F(a)$$
$$f'(a)=\lim_{h\to 0}\frac{f(a+h)-f(a)}{h}$$
$$\overline{(z/w)} = \bar{z}/\bar{w}$$
$$\textstyle r=|z|=\sqrt{x^2+y^2}$$
$$\begin{bmatrix} 1 & 2\\ 3 & 4\\ \end{bmatrix} \begin{bmatrix} 0 & 1\\ 0 & 0\\ \end{bmatrix}= \begin{bmatrix} 0 & 1\\ 0 & 3\\ \end{bmatrix}$$

right click on the formula to get its TeX input.

## mathurl.com

http://mathurl.com/ is a very simple web site for creating math notations then you can point a URL to. You type LaTeX code, it displays the results as a image immediately as you edit. It also comes with a short perm URL that you can point to. You can come back to the URL later and edit the expression anytime.

Unicode Search 😄

## Detexify

Detexify is a tool that lets you draw a math symbol and it shows you the code for LaTeX. The tool is created by Daniel Kirsch at detexify.kirelabs.org

## Creating Keyboard Layout for Inputing Math Symbols

You can actually create your own keyboard layout, so that the symbols you use most often can be readily typed. It might take a few hours to do, but isn't hard. See: Create TeX/Math/APL Keyboard Layout

If you are a emacs user and live in emacs, it's even easier. See:

## Mathematica

Mathematica is a powerful tool for math presentation as well as computing math. This is the most robust, convenient, powerful, professional, solution.

## GNU TeXmacs

[ GNU TeXmacs ] [ https://en.wikipedia.org/wiki/GNU_TeXmacs ]. A word-processor-like program that renders 2D math formulas, using graphical user interface.

TeXmacs borrows ideas from TeX and Emacs but is not dependent on TeX nor Emacs.

## FireMath, a MathML Editor for Firefox

FireMath is a MathML editor as a Firefox plugin. Home at www.firemath.info

## Other

• [ SageMath ] [ https://en.wikipedia.org/wiki/Sage_(mathematics_software) ]

For a list of more, see: [ Formula editor ] [ https://en.wikipedia.org/wiki/Formula_editor ] .

## Rant

The technology to display math notation on the web browser, is really dismal. [ MathML ] [ https://en.wikipedia.org/wiki/MathML ] is released in 1998. Now, it is over 10 years, but it is still not widely supported in web browsers. Authors need to invest huge amount of time experimenting with several solutions, and in most cases, requires knowledge of HTML, CSS, XML, MathML, JavaScript, TeX, to various degrees. One early solution is to resort to some tool to turn math notations into images. This means, the browser needs to load a huge bunch of images, and the images are ugly, not scalable, cannot be copy and pasted. Images for math notation are still widely practiced today. Another solution requires readers to download some special plug-in. Another solution is to simply discard the web and use PDF instead.

In the past 10 years, huge amount of web technologies have developed, from blog to wiki to instant messaging to Twitter to interactive road maps to online videos to voice and video chats. Digital video is much more technically complex than math display system, but when it comes to math, sadly, the situation is rather stagnant. This is, of course, because relatively very few people need it. Perhaps 0.01% of web users.