mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Add in mathjax directive
This commit is contained in:
parent
361fe310ce
commit
a3faaf0c18
4 changed files with 30 additions and 1 deletions
|
@ -33,7 +33,10 @@ aside.chat(
|
|||
}"
|
||||
)
|
||||
.arrow(ng-style="{'border-color': 'hsl({{ hue(message.user) }}, 60%, 80%)'}")
|
||||
p(ng-repeat="content in message.contents track by $index") {{ content }}
|
||||
p(
|
||||
mathjax,
|
||||
ng-repeat="content in message.contents track by $index"
|
||||
) {{ content }}
|
||||
|
||||
.new-message
|
||||
textarea(
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
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
|
||||
}
|
|
@ -2,4 +2,5 @@ define [
|
|||
"ide/chat/controllers/ChatButtonController"
|
||||
"ide/chat/controllers/ChatController"
|
||||
"ide/chat/controllers/ChatMessageController"
|
||||
"ide/chat/directives/mathjax"
|
||||
], () ->
|
|
@ -76,6 +76,7 @@ define [
|
|||
prependMessage(message)
|
||||
|
||||
appendMessage = (message) ->
|
||||
console.log "MESSAGES", message, chat.state.messages
|
||||
chat.state.newMessage = message
|
||||
|
||||
lastMessage = chat.state.messages[chat.state.messages.length - 1]
|
||||
|
|
Loading…
Reference in a new issue