Mathematics

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 CDN for LaTeX support
<script id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>
<script>
window.MathJax = {
tex: {
inlineMath: [['$', '$'], ['\$$', '\$$']],
displayMath: [['$$', '$$'], ["\$", "\$"]],
processEscapes: true
}
};
</script>


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.