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

25 lines
576 B
CoffeeScript
Raw Normal View History

2014-07-17 08:23:43 -04:00
define [
"base"
], (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
2015-02-23 12:46:17 -05:00
MathJax?.Hub?.Config(mathjaxConfig);
2014-07-17 08:23:43 -04:00
App.directive "mathjax", () ->
return {
link: (scope, element, attrs) ->
setTimeout () ->
2015-02-23 12:46:17 -05:00
MathJax?.Hub?.Queue(["Typeset", MathJax?.Hub, element.get(0)])
2014-07-17 08:23:43 -04:00
, 0
}