mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
24 lines
516 B
CoffeeScript
24 lines
516 B
CoffeeScript
|
define [
|
||
|
"base"
|
||
|
"mathjax"
|
||
|
], (App) ->
|
||
|
mathjaxConfig =
|
||
|
"HTML-CSS": { availableFonts: ["TeX"] },
|
||
|
TeX:
|
||
|
equationNumbers: { autoNumber: "AMS" },
|
||
|
useLabelIDs: false
|
||
|
tex2jax:
|
||
|
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
|
||
|
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
|
||
|
processEscapes: true
|
||
|
|
||
|
|
||
|
MathJax.Hub.Config(mathjaxConfig);
|
||
|
|
||
|
App.directive "mathjax", () ->
|
||
|
return {
|
||
|
link: (scope, element, attrs) ->
|
||
|
setTimeout () ->
|
||
|
MathJax.Hub.Queue(["Typeset", MathJax.Hub, element.get(0)])
|
||
|
, 0
|
||
|
}
|