- Home /

I have enabled mathjax via code injection. However it does not appear to work unless I manually reload the page:

See here for an example:

http://www.wjm.io/dynamical-systems-lecture-notes

and click on the link "1. The definition of a dynamical system".

The math does not load (you see lots of $...$). However if you hit reload the math renders perfectly. I am using the York template.

The code injection I used was:

```
<script type="text/x-mathjax-config"> MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); MathJax.Hub.Config({
TeX: { equationNumbers: { autoNumber: "AMS" } }
});
</script>
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
```

Comment

**Answer** by renaudfv
·
Sep 20, 2016 at 05:02 PM

Try calling the CDN before using the script. Maybe your browser cashes Mathjax the first time, thus the need to reload. Otherwise, the library is not present on your website before use.

You should also think about calling the CDN from within the header injected code if you need it elsewhere.

```
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
<script type="text/x-mathjax-config"> MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); MathJax.Hub.Config({
TeX: { equationNumbers: { autoNumber: "AMS" } }
});
</script>
```

Established 2003 Squarespace Handmade in NYC

Powered by AnswerHub