最佳答案
I have a Jekyll blog and I want to use MathJax with it, in the sense that I want to be able to type something like
$$\sum_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6}$$
in my markdown files, and have the correct LaTeX expression generated with MathJax, in a similar way to how it is done at math.stackexchange.
What is the easiest way to do this? Currently I have the file jsmath.js (GitHub gist) in my directory, and I thought I could have a simple file named mathjs
in my _includes
directory with the line
<script src="path/to/jsmath.js></script>
and include that in each post via
{% include mathjs %}
but this doesn't seem to work - when I run jekyll --server
the page is generated, but none of the content is visible.
Am I going about this the right way? Is there a better way to use MathJax with Jekyll?