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

26 lines
587 B
CoffeeScript
Raw Normal View History

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