Optional $ MathJax delimiter

This commit is contained in:
Jessica Lawshe 2018-07-13 15:02:52 -05:00
parent 49cf2a8dee
commit 120acf4918

View file

@ -1,25 +1,27 @@
define [ define [
"base" "base"
], (App) -> ], (App) ->
mathjaxConfig =
extensions: ["Safe.js"]
messageStyle: "none"
imageFont:null
"HTML-CSS": { availableFonts: ["TeX"] },
TeX:
equationNumbers: { autoNumber: "AMS" },
useLabelIDs: false
tex2jax:
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true
skipStartupTypeset: true
MathJax?.Hub?.Config(mathjaxConfig);
App.directive "mathjax", () -> App.directive "mathjax", () ->
return { return {
link: (scope, element, attrs) -> link: (scope, element, attrs) ->
mathjaxConfig =
extensions: ["Safe.js"]
messageStyle: "none"
imageFont:null
"HTML-CSS": { availableFonts: ["TeX"] },
TeX:
equationNumbers: { autoNumber: "AMS" },
useLabelIDs: false
skipStartupTypeset: true
tex2jax:
processEscapes: true,
inlineMath: [ ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
if attrs.delimiter != 'no-single-dollar'
mathjaxConfig.tex2jax.inlineMath.push(['$','$']);
MathJax?.Hub?.Config(mathjaxConfig);
setTimeout () -> setTimeout () ->
MathJax?.Hub?.Queue(["Typeset", MathJax?.Hub, element.get(0)]) MathJax?.Hub?.Queue(["Typeset", MathJax?.Hub, element.get(0)])
, 0 , 0