mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-25 06:04:02 +00:00
Optional $ MathJax delimiter
This commit is contained in:
parent
49cf2a8dee
commit
120acf4918
1 changed files with 19 additions and 17 deletions
|
@ -1,6 +1,9 @@
|
||||||
define [
|
define [
|
||||||
"base"
|
"base"
|
||||||
], (App) ->
|
], (App) ->
|
||||||
|
App.directive "mathjax", () ->
|
||||||
|
return {
|
||||||
|
link: (scope, element, attrs) ->
|
||||||
mathjaxConfig =
|
mathjaxConfig =
|
||||||
extensions: ["Safe.js"]
|
extensions: ["Safe.js"]
|
||||||
messageStyle: "none"
|
messageStyle: "none"
|
||||||
|
@ -9,17 +12,16 @@ define [
|
||||||
TeX:
|
TeX:
|
||||||
equationNumbers: { autoNumber: "AMS" },
|
equationNumbers: { autoNumber: "AMS" },
|
||||||
useLabelIDs: false
|
useLabelIDs: false
|
||||||
tex2jax:
|
|
||||||
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
|
|
||||||
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
|
|
||||||
processEscapes: true
|
|
||||||
skipStartupTypeset: true
|
skipStartupTypeset: true
|
||||||
|
tex2jax:
|
||||||
|
processEscapes: true,
|
||||||
|
inlineMath: [ ["\\(","\\)"] ],
|
||||||
|
displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
|
||||||
|
if attrs.delimiter != 'no-single-dollar'
|
||||||
|
mathjaxConfig.tex2jax.inlineMath.push(['$','$']);
|
||||||
|
|
||||||
MathJax?.Hub?.Config(mathjaxConfig);
|
MathJax?.Hub?.Config(mathjaxConfig);
|
||||||
|
|
||||||
App.directive "mathjax", () ->
|
|
||||||
return {
|
|
||||||
link: (scope, element, attrs) ->
|
|
||||||
setTimeout () ->
|
setTimeout () ->
|
||||||
MathJax?.Hub?.Queue(["Typeset", MathJax?.Hub, element.get(0)])
|
MathJax?.Hub?.Queue(["Typeset", MathJax?.Hub, element.get(0)])
|
||||||
, 0
|
, 0
|
||||||
|
|
Loading…
Reference in a new issue