How to display mathematics on your websites

unDraw mathematics illustration

Options for including mathematics on your website include:

The Nift documentation covers how to display $\LaTeX$ on your websites using MathJax. Repeating the information on this page, using MathJax on your site is as simple as adding the following code to the head of each page:

<!-- uses MathJax CDC for LaTeX support
	 see for more info -->
<script type="text/x-mathjax-config">
		extensions: ["tex2jax.js"],
		jax: ["input/TeX", "output/HTML-CSS"],
			inlineMath: [['$','$'], ['\\(','\\)']],
			displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
			processEscapes: true
		"HTML-CSS": { availableFonts: ["MathJax TeX"] }
<script type="text/javascript" 

You should then be able to paste $\LaTeX$ equations straight into content files. Both `$..$` and `\(..\)` work for inline equations, and both `$$..$$` and `\[..\]` work for displayed equations (note inside markdown/showdown blocks use `\\(..\\)` and `\\[..\\]`, or the `$` syntax). Eg. When \\(a \ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\) and they are: \\[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}\\]

If you want to insert a dollar sign on a page, as opposed to opening/closing an inline equation, use \\$ and MathJax will escape the character.

Note: if you are opening a page locally and are not connected to the internet then MathJax will not load, you will simply see the unprocessed LaTeX equations.