diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000000000000000000000000000000000000..522acb3108446c625e338adfc5bc78b397d2d1fe
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "mathjax"]
+	path = mathjax
+	url = https://github.com/mathjax/MathJax.git
diff --git a/Makefile b/Makefile
index a1849d34d58fbfba659215b2b8eca51c41148a23..dc784c6b654e227d76334922b6b526c3d8480e3f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,16 @@
 .PHONY: html
-html: run
+html: build
 
 .PHONY: publish
-publish: run
+publish: build
 
-.PHONY: run
-run:
-	make -C fgs
+.PHONY: build
+build: mathjax
+	cd fgs && python3 __main__.py
+
+.PHONY: mathjax
+mathjax:
+	[ ! -d output/mathjax ] && cp -vr mathjax/es5 output/mathjax || true
 
 .PHONY: devserver
 devserver:
diff --git a/fgs/Makefile b/fgs/Makefile
index 6cfa260bbf2297c11be043f09ddb62a9ada3e30e..61357d60c72710f07dfe8358631094058ec73efe 100644
--- a/fgs/Makefile
+++ b/fgs/Makefile
@@ -1,4 +1,4 @@
 
 .PHONY: run
 run:
-	python3 __main__.py
+	make -C ..
diff --git a/mathjax b/mathjax
new file mode 160000
index 0000000000000000000000000000000000000000..600692ad9d3552cc25f85510d5797bc942ecc9f7
--- /dev/null
+++ b/mathjax
@@ -0,0 +1 @@
+Subproject commit 600692ad9d3552cc25f85510d5797bc942ecc9f7
diff --git a/theme/templates/base.html b/theme/templates/base.html
index f260d11ca3b7908de9b7226edd568a8186d19b9f..b798077b55fe0fcfad98567359fb547ebcef5f63 100644
--- a/theme/templates/base.html
+++ b/theme/templates/base.html
@@ -15,6 +15,7 @@
 	<!-- <meta HTTP-EQUIV="REFRESH" content="500; url=#"> -->
 	<link rel="preload" href="{{ siteurl }}/{{ theme.static_dir }}/css/{{ theme.css_file }}" as="style" />
 	<link rel="stylesheet" type="text/css" href="{{ siteurl }}/{{ theme.static_dir }}/css/{{ theme.css_file }}" />
+	<script src="{{ siteurl }}/mathjax/tex-chtml.js" id="MathJax-script" async></script>
 	{#- TODO load javascript? -#}
 	{#- TODO og: meta tags -#}
 	{#- TODO favicon -#}
@@ -26,8 +27,6 @@
 	{% endif -%}#}
 	{% block extra_head %}{% endblock extra_head %}
 	{% endblock head %}
-	<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
-<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
 </head>
 <body>
 	<header>