overleaf/services/web/public/coffee/directives/mathjax.coffee
Jessica Lawshe a739348146 Move MathJax directive to a shared directory
MathJax parsing now on learn pages, and soon to be on the blog, so move
out of the `ide/chat` directive.
2018-06-27 17:46:35 -05:00

25 lines
No EOL
576 B
CoffeeScript

define [
"base"
], (App) ->
mathjaxConfig =
messageStyle: "none"
imageFont:null
"HTML-CSS": { availableFonts: ["TeX"] },
TeX:
equationNumbers: { autoNumber: "AMS" },
useLabelIDs: false
tex2jax:
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true
skipStartupTypeset: true
MathJax?.Hub?.Config(mathjaxConfig);
App.directive "mathjax", () ->
return {
link: (scope, element, attrs) ->
setTimeout () ->
MathJax?.Hub?.Queue(["Typeset", MathJax?.Hub, element.get(0)])
, 0
}