overleaf/services/web/public/coffee/ide/chat/directives/mathjax.coffee

26 lines
582 B
CoffeeScript
Raw Normal View History

2014-07-17 08:23:43 -04:00
define [
"base"
"mathjax"
], (App) ->
mathjaxConfig =
2015-01-29 13:11:38 -05:00
messageStyle: "none"
imageFont:null
2014-07-17 08:23:43 -04:00
"HTML-CSS": { availableFonts: ["TeX"] },
TeX:
equationNumbers: { autoNumber: "AMS" },
useLabelIDs: false
tex2jax:
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true
2014-07-21 07:44:48 -04:00
skipStartupTypeset: true
2014-07-17 08:23:43 -04:00
MathJax.Hub.Config(mathjaxConfig);
App.directive "mathjax", () ->
return {
link: (scope, element, attrs) ->
setTimeout () ->
MathJax.Hub.Queue(["Typeset", MathJax.Hub, element.get(0)])
, 0
}