Use the unicode characters that Fred has been asking for for a while. This covers most of issues #116, #119, and #216. Still need to merge multiple primes into the characters for those.

This commit is contained in:
Davide P. Cervone 2012-08-19 20:13:46 -04:00
parent 0236ee5a54
commit 55a76151c0
9 changed files with 47 additions and 26 deletions

View File

@ -22,7 +22,7 @@
*/
MathJax.Extension["TeX/AMSmath"] = {
version: "2.0.1",
version: "2.0.2",
number: 0, // current equation number
startNumber: 0, // current starting equation number (for when equation is restarted)
@ -46,6 +46,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
/******************************************************************************/
TEXDEF.Add({
mathchar0mo: {
iiiint: ['2A0C',{texClass: MML.TEXCLASS.OP}]
},
macros: {
mathring: ['Accent','2DA'], // or 0x30A
@ -53,14 +57,16 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
negmedspace: ['Spacer',MML.LENGTH.NEGATIVEMEDIUMMATHSPACE],
negthickspace: ['Spacer',MML.LENGTH.NEGATIVETHICKMATHSPACE],
intI: ['Macro','\\mathchoice{\\!}{}{}{}\\!\\!\\int'],
// intI: ['Macro','\\mathchoice{\\!}{}{}{}\\!\\!\\int'],
// iint: ['MultiIntegral','\\int\\intI'], // now in core TeX input jax
// iiint: ['MultiIntegral','\\int\\intI\\intI'], // now in core TeX input jax
iiiint: ['MultiIntegral','\\int\\intI\\intI\\intI'],
// iiiint: ['MultiIntegral','\\int\\intI\\intI\\intI'], // now in mathchar0mo above
idotsint: ['MultiIntegral','\\int\\cdots\\int'],
dddot: ['Macro','\\mathop{#1}\\limits^{\\textstyle \\mathord{.}\\mathord{.}\\mathord{.}}',1],
ddddot: ['Macro','\\mathop{#1}\\limits^{\\textstyle \\mathord{.}\\mathord{.}\\mathord{.}\\mathord{.}}',1],
// dddot: ['Macro','\\mathop{#1}\\limits^{\\textstyle \\mathord{.}\\mathord{.}\\mathord{.}}',1],
// ddddot: ['Macro','\\mathop{#1}\\limits^{\\textstyle \\mathord{.}\\mathord{.}\\mathord{.}\\mathord{.}}',1],
dddot: ['Accent','20DB'],
ddddot: ['Accent','20DC'],
sideset: ['Macro','\\mathop{\\mathop{\\rlap{\\phantom{#3}}}\\nolimits#1\\!\\mathop{#3}\\nolimits#2}',3],

View File

@ -24,7 +24,7 @@
MathJax.InputJax.TeX = MathJax.InputJax({
id: "TeX",
version: "2.0.4",
version: "2.0.5",
directory: MathJax.InputJax.directory + "/TeX",
extensionDir: MathJax.InputJax.extensionDir + "/TeX",

View File

@ -878,18 +878,18 @@
hphantom: ['Phantom',0,1],
smash: 'Smash',
acute: ['Accent', "02CA"], // or 0301
grave: ['Accent', "02CB"], // or 0300
acute: ['Accent', "00B4"], // or 0301 or 02CA
grave: ['Accent', "0060"], // or 0300 or 02CB
ddot: ['Accent', "00A8"], // or 0308
tilde: ['Accent', "02DC"], // or 0303
bar: ['Accent', "02C9"], // or 0304
tilde: ['Accent', "007E"], // or 0303 or 02DC
bar: ['Accent', "00AF"], // or 0304 or 02C9
breve: ['Accent', "02D8"], // or 0306
check: ['Accent', "02C7"], // or 030C
hat: ['Accent', "02C6"], // or 0302
vec: ['Accent', "20D7"],
hat: ['Accent', "005E"], // or 0302 or 02C6
vec: ['Accent', "2192"], // or 20D7
dot: ['Accent', "02D9"], // or 0307
widetilde: ['Accent', "02DC",1], // or 0303
widehat: ['Accent', "02C6",1], // or 0302
widetilde: ['Accent', "007E",1], // or 0303 or 02DC
widehat: ['Accent', "005E",1], // or 0302 or 02C6
matrix: 'Matrix',
array: 'Matrix',

View File

@ -24,7 +24,7 @@
MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({
id: "HTML-CSS",
version: "2.0.6",
version: "2.0.7",
directory: MathJax.OutputJax.directory + "/HTML-CSS",
extensionDir: MathJax.OutputJax.extensionDir + "/HTML-CSS",
autoloadDir: MathJax.OutputJax.directory + "/HTML-CSS/autoload",

View File

@ -23,7 +23,7 @@
*/
(function (HTMLCSS,MML,AJAX) {
var VERSION = "2.0.2";
var VERSION = "2.0.3";
var MAIN = "MathJax_Main",
BOLD = "MathJax_Main-bold",
@ -204,15 +204,21 @@
0x22E2: "\u2291\u0338", // \not\sqsubseteq
0x22E3: "\u2292\u0338", // \not\sqsupseteq
0x2A0C: "\u222C\u222C", // quadruple integral
0x2033: "\u2032\u2032", // double prime
0x2034: "\u2032\u2032\u2032", // triple prime
0x2036: "\u2035\u2035", // double back prime
0x2037: "\u2035\u2035\u2035", // trile back prime
0x2057: "\u2032\u2032\u2032\u2032" // quadruple prime
0x2057: "\u2032\u2032\u2032\u2032", // quadruple prime
0x20DB: "...", // combining three dots above (only works with mover/under)
0x20DC: "...." // combining four dots above (only works with mover/under)
},
REMAPACCENT: {
"\u2192":"\u20D7"
"\u2192":"\u20D7",
"\u2032":"'",
"\u2035":"`"
},
REMAPACCENTUNDER: {
},

View File

@ -1854,8 +1854,9 @@
}
});
MML.entity.Augment({
toHTML: function (span,variant) {
toHTML: function (span,variant,remap,chars) {
var text = this.toString().replace(/[\u2061-\u2064]/g,""); // remove invisibles
if (remap) {text = remap(text,chars)}
if (variant.fontInherit) {
var scale = Math.floor(100/HTMLCSS.scale+.5) + "%";
HTMLCSS.addElement(span,"span",{style:{"font-size":scale}},[text]);

View File

@ -24,7 +24,7 @@
MathJax.OutputJax.SVG = MathJax.OutputJax({
id: "SVG",
version: "2.0.6",
version: "2.0.7",
directory: MathJax.OutputJax.directory + "/SVG",
extensionDir: MathJax.OutputJax.extensionDir + "/SVG",
autoloadDir: MathJax.OutputJax.directory + "/SVG/autoload",

View File

@ -23,7 +23,7 @@
*/
(function (SVG,MML,AJAX) {
var VERSION = "2.0.1";
var VERSION = "2.0.2";
var MAIN = "MathJax_Main",
BOLD = "MathJax_Main-bold",
@ -113,7 +113,7 @@
remap: {0x391:0x41, 0x392:0x42, 0x395:0x45, 0x396:0x5A, 0x397:0x48,
0x399:0x49, 0x39A:0x4B, 0x39C:0x4D, 0x39D:0x4E, 0x39F:0x4F,
0x3A1:0x50, 0x3A4:0x54, 0x3A7:0x58}},
"-TeX-variant": {fonts:[MAIN]},
"-TeX-variant": {fonts:[MAIN]}, // HACK: to get larger prime for \prime
"-largeOp": {fonts:[SIZE2,SIZE1,MAIN]},
"-smallOp": {fonts:[SIZE1,MAIN]}
},
@ -200,15 +200,21 @@
0x22E2: "\u2291\u0338", // \not\sqsubseteq
0x22E3: "\u2292\u0338", // \not\sqsupseteq
0x2A0C: "\u222C\u222C", // quadruple integral
0x2033: "\u2032\u2032", // double prime
0x2034: "\u2032\u2032\u2032", // triple prime
0x2036: "\u2035\u2035", // double back prime
0x2037: "\u2035\u2035\u2035", // trile back prime
0x2057: "\u2032\u2032\u2032\u2032" // quadruple prime
0x2057: "\u2032\u2032\u2032\u2032", // quadruple prime
0x20DB: "...", // combining three dots above (only works with mover/under)
0x20DC: "...." // combining four dots above (only works with mover/under)
},
REMAPACCENT: {
"\u2192":"\u20D7"
"\u2192":"\u20D7",
"\u2032":"'",
"\u2035":"`"
},
REMAPACCENTUNDER: {
},

View File

@ -1233,8 +1233,10 @@
}
});
MML.entity.Augment({
toSVG: function (variant,scale) {
return this.SVGhandleVariant(variant,scale,this.toString().replace(/[\u2061-\u2064]/g,"")); // remove invisibles
toSVG: function (variant,scale,remap,chars) {
var text = this.toString().replace(/[\u2061-\u2064]/g,""); // remove invisibles
if (remap) {text = remap(text,chars)}
return this.SVGhandleVariant(variant,scale,text);
}
});