diff --git a/js/mathjax-onload.js b/js/mathjax-onload.js new file mode 100644 index 0000000..e353d47 --- /dev/null +++ b/js/mathjax-onload.js @@ -0,0 +1,12 @@ +// We wait for the onload function to load MathJax after the page is completely loaded. +// MathJax is loaded 1 unit of time after the page is ready. +// This hack prevent problems when you use social button from addthis. +// +window.onload = function () { + setTimeout(function () { + var script = document.createElement("script"); + script.type = "text/javascript"; + script.src = "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"; + document.getElementsByTagName("head")[0].appendChild(script); + },1) +} \ No newline at end of file diff --git a/js/revealmathjax.js b/js/revealmathjax.js index 9301c7b..b0a8003 100644 --- a/js/revealmathjax.js +++ b/js/revealmathjax.js @@ -1,4 +1,4 @@ -init_mathjax = function() { +reveal_mathjax = function() { if (window.MathJax) { // MathJax loaded MathJax.Hub.Config({ @@ -14,4 +14,4 @@ init_mathjax = function() { MathJax.Hub.Queue(["Typeset",MathJax.Hub]); } } -init_mathjax(); \ No newline at end of file +reveal_mathjax(); \ No newline at end of file diff --git a/templates/reveal_base.html b/templates/reveal_base.html index d46b71e..82a21a9 100644 --- a/templates/reveal_base.html +++ b/templates/reveal_base.html @@ -22,6 +22,16 @@ %slides% + +
+ + + + + +
+ + @@ -43,14 +53,15 @@ { src: 'reveal/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, { src: 'reveal/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } }, { src: 'notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }, - { src: 'https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML', async: true }, - { src: 'js/revealmathjax.js', async: true} + { src: 'http://s7.addthis.com/js/300/addthis_widget.js', async: true}, + { src: 'js/revealmathjax.js', async: true}, + { src: 'js/mathjax-onload.js', async: true} ] }); \ No newline at end of file