Latex for Web

MathJax

MathJax - A Javascript display engine for mathematics that works in all browsers. It’s a library that displays mathematical notation in web browsers using MathML, Latex, and ASCIIMathML markup.

Establishing Connection

MathJax allows you to use both a copy of the library on your own server and a version of the library from the CDN.

Approximate library connection format:

<script type="text/javascript" id="MathJax-script" async
        src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"
</script>

LaTeX markup

  • To display a formula in a separate block, enclose it in delimiters $$ … $$ or \[ … \]:
    \[ \sum_{i=0}^{n} i^{2} = \frac{(n^2 + n)(2n + 1)}{6}. \]
  • To display a formula inside a line, enclose it in delimiters \( … \). Separators $ … $ are not supported by default because single dollar signs can appear in text and cause the text to be converted into a formula incorrectly.

AsciiMath

AsciiMath - A lightweight markup language for mathematical formulas

MathML