Index: trunk/extensions/Math/modules/MathJax/extensions/TeX/texvc.js |
— | — | @@ -113,16 +113,14 @@ |
114 | 114 | }, |
115 | 115 | |
116 | 116 | macros: { |
117 | | - sgn: ['NamedOp',0], |
| 117 | + sgn: 'NamedFn', |
118 | 118 | textcolor: ['Macro','\\color{#1}',1], |
119 | | - bold: ['Macro','{\\boldsymbol #1}',1] // boldsymbol |
| 119 | + bold: ['Macro','\\boldsymbol'] // boldsymbol |
120 | 120 | } |
121 | 121 | |
122 | 122 | }); |
123 | 123 | }); |
124 | 124 | |
125 | | -MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () { |
126 | | - MathJax.Hub.Startup.signal.Post("TeX texvc Ready"); |
127 | | -}); |
| 125 | +MathJax.Hub.Startup.signal.Post("TeX texvc Ready"); |
128 | 126 | |
129 | 127 | MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/texvc.js"); |
Index: trunk/extensions/Math/modules/MathJax/extensions/wiki2jax.js |
— | — | @@ -16,10 +16,9 @@ |
17 | 17 | |
18 | 18 | PreProcess: function (element) { |
19 | 19 | if (!this.configured) { |
20 | | - MathJax.Hub.Insert(this.config,(MathJax.Hub.config.wiki2jax||{})); |
| 20 | + this.config = MathJax.Hub.CombineConfig("wiki2jax", this.config); |
21 | 21 | if (this.config.Augment) {MathJax.Hub.Insert(this,this.config.Augment)} |
22 | | - if (typeof(this.config.previewTeX) !== "undefined" && !this.config.previewTeX) |
23 | | - {this.config.preview = "none"} // backward compatibility for previewTeX parameter |
| 22 | + |
24 | 23 | this.previewClass = MathJax.Hub.config.preRemoveClass; |
25 | 24 | this.configured = true; |
26 | 25 | } |
— | — | @@ -31,7 +30,7 @@ |
32 | 31 | |
33 | 32 | ConvertMath: function (node) { |
34 | 33 | var parent = node.parentNode, |
35 | | - mode = parent.tagName === "DD" && parent.firstChild === parent.lastChild ? "; mode=display" : "", |
| 34 | + mode = parent.tagName === "DD" && parent.childNodes.length === 1 ? "; mode=display" : "", |
36 | 35 | tex; |
37 | 36 | if (node.nodeName == 'IMG') { |
38 | 37 | tex = node.alt; |
— | — | @@ -46,6 +45,7 @@ |
47 | 46 | if (parent.firstChild === node) tex = "\\displaystyle{"+tex+"}"; |
48 | 47 | } |
49 | 48 | |
| 49 | + // @fixme auto-enable the 'color' extension and drop this |
50 | 50 | var i; |
51 | 51 | while ((i = tex.search(/\\color{/)) != -1) { |
52 | 52 | var braces = 0; |
— | — | @@ -61,8 +61,7 @@ |
62 | 62 | |
63 | 63 | var script = document.createElement("script"); |
64 | 64 | script.type = "math/tex" + mode; |
65 | | - if (MathJax.Hub.Browser.isMSIE) {script.text = tex} |
66 | | - else {script.appendChild(document.createTextNode(tex))} |
| 65 | + MathJax.HTML.setScript(script, tex); |
67 | 66 | |
68 | 67 | if (node.nextSibling) {parent.insertBefore(script,node.nextSibling)} |
69 | 68 | else {parent.appendChild(script)} |
— | — | @@ -80,7 +79,7 @@ |
81 | 80 | } |
82 | 81 | }, |
83 | 82 | |
84 | | - filterTeX: function (tex) {return tex} |
| 83 | + filterPreview: function (tex) {return tex} |
85 | 84 | |
86 | 85 | }; |
87 | 86 | |
Index: trunk/extensions/Math/modules/MathJax/config/TeX-AMS-texvc_HTML.js |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | MathJax.Hub.Config({ |
3 | | - extensions: ["wiki2jax.js","TeX/texvc.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js"], |
| 3 | + extensions: ["wiki2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js"], |
4 | 4 | jax: ["input/TeX","output/HTML-CSS"], |
5 | | - TeX: {extensions: ["noErrors.js","noUndefined.js","AMSmath.js","AMSsymbols.js"]} |
| 5 | + TeX: {extensions: ["noErrors.js","noUndefined.js","AMSmath.js","AMSsymbols.js","texvc.js"]} |
6 | 6 | }); |
7 | 7 | MathJax.Ajax.loadComplete("[MathJax]/config/TeX-AMS-texvc_HTML.js"); |