Skip to content

Commit e33cc5a

Browse files
committed
Merge branch 'issue218' into develop
2 parents 1fc8929 + 7349136 commit e33cc5a

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

extensions/TeX/autoload-all.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
* http://www.apache.org/licenses/LICENSE-2.0
1313
*/
1414

15-
MathJax.Extension["TeX/autoload-all"]={version:"2.0.2"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var h={action:["mathtip","texttip","toggle"],AMSmath:["mathring","nobreakspace","negmedspace","negthickspace","intI","iiiint","idotsint","dddot","ddddot","sideset","boxed","substack","injlim","projlim","varliminf","varlimsup","varinjlim","varprojlim","DeclareMathOperator","operatorname","genfrac","tfrac","dfrac","binom","tbinom","dbinom","cfrac","shoveleft","shoveright","xrightarrow","xleftarrow"],begingroup:["begingroup","endgroup","gdef","global"],cancel:["cancel","bcancel","xcancel","cancelto"],color:["color","colorbox","fcolorbox","DefineColor"],enclose:["enclose"],extpfeil:["Newextarrow","xlongequal","xmapsto","xtofrom","xtwoheadleftarrow","xtwoheadrightarrow"],mhchem:["ce","cee","cf"]};var c={AMSmath:["subarray","smallmatrix","equation","equation*"]};var d,g,b,a={macros:{},environment:{}};for(d in h){if(h.hasOwnProperty(d)){if(!MathJax.Extension["TeX/"+d]){var f=h[d];for(g=0,b=f.length;g<b;g++){a.macros[f[g]]=["Extension",d]}}}}for(d in c){if(c.hasOwnProperty(d)){if(!MathJax.Extension["TeX/"+d]){var e=c[d];for(g=0,b=e.length;g<b;g++){a.environment[e[g]]=["ExtensionEnv",null,d]}}}}MathJax.InputJax.TeX.Definitions.Add(a);MathJax.Hub.Startup.signal.Post("TeX autoload-all Ready")});MathJax.Callback.Queue(["Require",MathJax.Ajax,"[MathJax]/extensions/TeX/AMSsymbols.js"],["loadComplete",MathJax.Ajax,"[MathJax]/extensions/TeX/autoload-all.js"]);
15+
MathJax.Extension["TeX/autoload-all"]={version:"2.0.3"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var h={action:["mathtip","texttip","toggle"],AMSmath:["mathring","nobreakspace","negmedspace","negthickspace","intI","iiiint","idotsint","dddot","ddddot","sideset","boxed","substack","injlim","projlim","varliminf","varlimsup","varinjlim","varprojlim","DeclareMathOperator","operatorname","genfrac","tfrac","dfrac","binom","tbinom","dbinom","cfrac","shoveleft","shoveright","xrightarrow","xleftarrow"],begingroup:["begingroup","endgroup","gdef","global"],cancel:["cancel","bcancel","xcancel","cancelto"],color:["color","textcolor","colorbox","fcolorbox","DefineColor"],enclose:["enclose"],extpfeil:["Newextarrow","xlongequal","xmapsto","xtofrom","xtwoheadleftarrow","xtwoheadrightarrow"],mhchem:["ce","cee","cf"]};var c={AMSmath:["subarray","smallmatrix","equation","equation*"]};var d,g,b,a={macros:{},environment:{}};for(d in h){if(h.hasOwnProperty(d)){if(!MathJax.Extension["TeX/"+d]){var f=h[d];for(g=0,b=f.length;g<b;g++){a.macros[f[g]]=["Extension",d]}}}}for(d in c){if(c.hasOwnProperty(d)){if(!MathJax.Extension["TeX/"+d]){var e=c[d];for(g=0,b=e.length;g<b;g++){a.environment[e[g]]=["ExtensionEnv",null,d]}}}}MathJax.InputJax.TeX.Definitions.Add(a);MathJax.Hub.Startup.signal.Post("TeX autoload-all Ready")});MathJax.Callback.Queue(["Require",MathJax.Ajax,"[MathJax]/extensions/TeX/AMSsymbols.js"],["loadComplete",MathJax.Ajax,"[MathJax]/extensions/TeX/autoload-all.js"]);
1616

extensions/TeX/color.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unpacked/extensions/TeX/autoload-all.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424

2525
MathJax.Extension["TeX/autoload-all"] = {
26-
version: "2.0.2"
26+
version: "2.0.3"
2727
};
2828

2929
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
@@ -38,7 +38,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
3838
"shoveleft","shoveright","xrightarrow","xleftarrow"],
3939
begingroup: ["begingroup","endgroup","gdef","global"],
4040
cancel: ["cancel","bcancel","xcancel","cancelto"],
41-
color: ["color","colorbox","fcolorbox","DefineColor"],
41+
color: ["color","textcolor","colorbox","fcolorbox","DefineColor"],
4242
enclose: ["enclose"],
4343
extpfeil: ["Newextarrow","xlongequal","xmapsto","xtofrom",
4444
"xtwoheadleftarrow","xtwoheadrightarrow"],

unpacked/extensions/TeX/color.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
*
33
* MathJax/extensions/TeX/color.js
44
*
5-
* Implements LaTeX-compatible \color macro rather than MathJax's
6-
* original (non-standard) version. It includes the rgb, gray, and
7-
* named color models, and the \definecolor macro.
5+
* Implements LaTeX-compatible \color macro rather than MathJax's original
6+
* (non-standard) version. It includes the rgb, gray, and named color
7+
* models, and the \textcolor, \definecolor, \colorbox, and \fcolorbox
8+
* macros.
89
*
910
* ---------------------------------------------------------------------
1011
*
@@ -27,7 +28,7 @@
2728
// The configuration defaults, augmented by the user settings
2829
//
2930
MathJax.Extension["TeX/color"] = {
30-
version: "2.0.1",
31+
version: "2.0.2",
3132

3233
config: MathJax.Hub.CombineConfig("TeX.color",{
3334
padding: "5px",
@@ -170,6 +171,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
170171
TEX.Definitions.Add({
171172
macros: {
172173
color: "Color",
174+
textcolor: "TextColor",
173175
definecolor: "DefineColor",
174176
colorbox: "ColorBox",
175177
fcolorbox: "fColorBox"
@@ -189,6 +191,16 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
189191
this.stack.env.color = color;
190192
this.Push(mml);
191193
},
194+
195+
TextColor: function (name) {
196+
var model = this.GetBrackets(name),
197+
color = this.GetArgument(name);
198+
color = COLOR.getColor(model,color);
199+
var old = this.stack.env.color; this.stack.env.color = color;
200+
var math = this.ParseArg(name);
201+
if (old) {this.stack.env.color} else {delete this.stack.env.color}
202+
this.Push(MML.mstyle(math).With({mathcolor: color}));
203+
},
192204

193205
//
194206
// Define the \definecolor macro

0 commit comments

Comments
 (0)