# Mathjax in Squarespace 6

Finally, I managed to get Mathjax working in Squarespace 6.  This is how it works:

1. Under Settings -> Code injection insert the following in the header:

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

then insert the following in a code block as HTML and you will see the Mathjax rendered equation below:

When $$a \ne 0$$, there are two solutions to $$ax^2 + bx + c = 0$$ and they are$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
When $$a \ne 0$$, there are two solutions to $$ax^2 + bx + c = 0$$ and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

Squarespace will only render the equation if you are viewing the website without being in editing or administration mode.  This is a little frustrating but you can have a separate window open to view what a visitor will see.