title | contributors | issues | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
MathJax |
|
|
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showMathMenu: false
});
</script>
Remove the script tags from the head
and add the following coffeescript to your application:
$ ->
loadMathJax()
$(document).on 'page:load', loadMathJax
loadMathJax = ->
window.MathJax = null
$.getScript "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML", ->
MathJax.Hub.Config
showMathMenu: false
-
Remove the script tags from the
head
. -
Define this classes somewhere in your application's JS:
class MathJax constructor: (@options) -> @bind() load: => window.MathJax = null @_fetch().done => window.MathJax.Hub.Config @options bind: -> $ => @load() $(document).on 'page:load', @load unbind: -> $(document).off 'page:load', @load # private _fetch: -> $.ajax dataType: 'script' cache: true url: "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
-
Add this line to your application's JS (after the class has been defined) to initialize MathJax
new MathJax showMathMenu: false