oxeimon
oxeimon

Reputation: 101

How do I display latex-style math on squarespace?

I want to display latex-style math on my squarespace site.

I'm having trouble finding resources for this. One of the best seems to be this other stackoverflow post, but it's been 7 years since the last activity, and none of the answers seem to work for me.

I expect this is because squarespace keeps changing how they do things. Does anyone here know how to get latex-style math working on their squarespace site?

To be precise, since cdn.mathjax.org is dead, I've only tried the second answer's suggestion, which is to put the suggested code in my website's footer, which I did as suggested by squarespace. I then add a html code block on my page, with the code

 <p>Hello, World! testing latex $\mathcal{M}_{1,1}$</p>

but unfortunately the mathcal doesn't render.

Upvotes: 0

Views: 93

Answers (1)

Reyomi
Reyomi

Reputation: 263

You should check if you have referenced MathJax CDN correctly (here's the Documentation).

For example, base on what you provided, you can add this script in your footer (you can find this in Settings > Advanced > Code Injection > Footer):

<script type="text/javascript" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script type="text/javascript">
MathJax = {
  tex: {
    inlineMath: [['$', '$'], ['\\(', '\\)']]
  },
  svg: {
    fontCache: 'global'
  }
};
</script>

Upvotes: 0

Related Questions