From 6d9994d9d1dccadacf8c0c0690bc91bb12825ca7 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 15 Nov 2011 20:17:32 -0500 Subject: [PATCH] Add support for \mathchoice in SVG output --- extensions/TeX/mathchoice.js | 2 +- unpacked/extensions/TeX/mathchoice.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/TeX/mathchoice.js b/extensions/TeX/mathchoice.js index 67215942a..b2b1037b9 100644 --- a/extensions/TeX/mathchoice.js +++ b/extensions/TeX/mathchoice.js @@ -12,5 +12,5 @@ * http://www.apache.org/licenses/LICENSE-2.0 */ -MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var c="1.1";var a=MathJax.ElementJax.mml;var d=MathJax.InputJax.TeX;var b=d.Definitions;b.macros.mathchoice="MathChoice";d.Parse.Augment({MathChoice:function(f){var i=this.ParseArg(f),e=this.ParseArg(f),g=this.ParseArg(f),h=this.ParseArg(f);this.Push(a.TeXmathchoice(i,e,g,h))}});a.TeXmathchoice=a.mbase.Subclass({type:"TeXmathchoice",choice:function(){var e=this.getValues("displaystyle","scriptlevel");if(e.scriptlevel>0){return Math.min(3,e.scriptlevel+1)}return(e.displaystyle?0:1)},setTeXclass:function(e){return this.Core().setTeXclass(e)},isSpacelike:function(){return this.Core().isSpacelike()},isEmbellished:function(){return this.Core().isEmbellished()},Core:function(){return this.data[this.choice()]},toHTML:function(e){e=this.HTMLcreateSpan(e);e.bbox=this.Core().toHTML(e).bbox;if(e.firstChild&&e.firstChild.style.marginLeft){e.style.marginLeft=e.firstChild.style.marginLeft;e.firstChild.style.marginLeft=""}return e}});MathJax.Hub.Startup.signal.Post("TeX mathchoice Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/mathchoice.js"); +MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var c="1.1";var a=MathJax.ElementJax.mml;var d=MathJax.InputJax.TeX;var b=d.Definitions;b.macros.mathchoice="MathChoice";d.Parse.Augment({MathChoice:function(f){var i=this.ParseArg(f),e=this.ParseArg(f),g=this.ParseArg(f),h=this.ParseArg(f);this.Push(a.TeXmathchoice(i,e,g,h))}});a.TeXmathchoice=a.mbase.Subclass({type:"TeXmathchoice",choice:function(){var e=this.getValues("displaystyle","scriptlevel");if(e.scriptlevel>0){return Math.min(3,e.scriptlevel+1)}return(e.displaystyle?0:1)},setTeXclass:function(e){return this.Core().setTeXclass(e)},isSpacelike:function(){return this.Core().isSpacelike()},isEmbellished:function(){return this.Core().isEmbellished()},Core:function(){return this.data[this.choice()]},toHTML:function(e){e=this.HTMLcreateSpan(e);e.bbox=this.Core().toHTML(e).bbox;if(e.firstChild&&e.firstChild.style.marginLeft){e.style.marginLeft=e.firstChild.style.marginLeft;e.firstChild.style.marginLeft=""}return e},toSVG:function(){return this.Core().toSVG()}});MathJax.Hub.Startup.signal.Post("TeX mathchoice Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/mathchoice.js"); diff --git a/unpacked/extensions/TeX/mathchoice.js b/unpacked/extensions/TeX/mathchoice.js index a0a32f606..60a4e048e 100644 --- a/unpacked/extensions/TeX/mathchoice.js +++ b/unpacked/extensions/TeX/mathchoice.js @@ -67,7 +67,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { span.firstChild.style.marginLeft = ""; } return span; - } + }, + toSVG: function () {return this.Core().toSVG()} }); MathJax.Hub.Startup.signal.Post("TeX mathchoice Ready");