Make functions (like \sin) be <mi> rather than <mo>, and insert ⁡ after their use (resolves issue #56).
This commit is contained in:
parent
afc36aac44
commit
3a8c20b372
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -12,5 +12,5 @@
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MathJax.InputJax.TeX=MathJax.InputJax({id:"TeX",version:"1.1.2",directory:MathJax.InputJax.directory+"/TeX",extensionDir:MathJax.InputJax.extensionDir+"/TeX",config:{TagSide:"right",TagIndent:"0.8em",MultLineWidth:"85%"}});MathJax.InputJax.TeX.Register("math/tex");MathJax.InputJax.TeX.loadComplete("config.js");
|
MathJax.InputJax.TeX=MathJax.InputJax({id:"TeX",version:"1.1.3",directory:MathJax.InputJax.directory+"/TeX",extensionDir:MathJax.InputJax.extensionDir+"/TeX",config:{TagSide:"right",TagIndent:"0.8em",MultLineWidth:"85%"}});MathJax.InputJax.TeX.Register("math/tex");MathJax.InputJax.TeX.loadComplete("config.js");
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -27,7 +27,7 @@ MathJax.ElementJax.mml = MathJax.ElementJax({
|
||||||
mimeType: "jax/mml"
|
mimeType: "jax/mml"
|
||||||
},{
|
},{
|
||||||
id: "mml",
|
id: "mml",
|
||||||
version: "1.1",
|
version: "1.1.1",
|
||||||
directory: MathJax.ElementJax.directory + "/mml",
|
directory: MathJax.ElementJax.directory + "/mml",
|
||||||
extensionDir: MathJax.ElementJax.extensionDir + "/mml",
|
extensionDir: MathJax.ElementJax.extensionDir + "/mml",
|
||||||
optableDir: MathJax.ElementJax.directory + "/mml/optable"
|
optableDir: MathJax.ElementJax.directory + "/mml/optable"
|
||||||
|
@ -545,7 +545,7 @@ MathJax.ElementJax.mml.Augment({
|
||||||
setTeXclass: function (prev) {
|
setTeXclass: function (prev) {
|
||||||
this.getValues("lspace","rspace"); // sets useMMLspacing
|
this.getValues("lspace","rspace"); // sets useMMLspacing
|
||||||
if (this.useMMLspacing) {this.texClass = MML.TEXCLASS.NONE; return this}
|
if (this.useMMLspacing) {this.texClass = MML.TEXCLASS.NONE; return this}
|
||||||
this.texClass = this.Get("texClass");
|
this.texClass = this.Get("texClass"); if (this.texClass === MML.TEXCLASS.NONE) {return prev}
|
||||||
if (prev) {this.prevClass = prev.texClass || MML.TEXCLASS.ORD; this.prevLevel = prev.Get("scriptlevel")}
|
if (prev) {this.prevClass = prev.texClass || MML.TEXCLASS.ORD; this.prevLevel = prev.Get("scriptlevel")}
|
||||||
else {this.prevClass = MML.TEXCLASS.NONE}
|
else {this.prevClass = MML.TEXCLASS.NONE}
|
||||||
if (this.texClass === MML.TEXCLASS.BIN &&
|
if (this.texClass === MML.TEXCLASS.BIN &&
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
MathJax.InputJax.TeX = MathJax.InputJax({
|
MathJax.InputJax.TeX = MathJax.InputJax({
|
||||||
id: "TeX",
|
id: "TeX",
|
||||||
version: "1.1.2",
|
version: "1.1.3",
|
||||||
directory: MathJax.InputJax.directory + "/TeX",
|
directory: MathJax.InputJax.directory + "/TeX",
|
||||||
extensionDir: MathJax.InputJax.extensionDir + "/TeX",
|
extensionDir: MathJax.InputJax.extensionDir + "/TeX",
|
||||||
|
|
||||||
|
|
|
@ -279,6 +279,17 @@
|
||||||
Add: function () {this.data.push.apply(this.data,arguments); return this}
|
Add: function () {this.data.push.apply(this.data,arguments); return this}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
STACKITEM.fn = STACKITEM.Subclass({
|
||||||
|
type: "fn",
|
||||||
|
checkItem: function (item) {
|
||||||
|
if (this.data[0]) {
|
||||||
|
if (item.type !== "mml") {return [this.data[0],item]}
|
||||||
|
return [this.data[0],MML.mo(MML.entity("#x2061")).With({texClass:MML.TEXCLASS.NONE}),item];
|
||||||
|
}
|
||||||
|
return this.SUPER(arguments).checkItem.apply(this,arguments);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
var TEXDEF = {};
|
var TEXDEF = {};
|
||||||
var STARTUP = function () {
|
var STARTUP = function () {
|
||||||
|
@ -627,38 +638,38 @@
|
||||||
huge: ['SetSize',2.07],
|
huge: ['SetSize',2.07],
|
||||||
Huge: ['SetSize',2.49],
|
Huge: ['SetSize',2.49],
|
||||||
|
|
||||||
arcsin: ['NamedOp',0],
|
arcsin: ['NamedFn'],
|
||||||
arccos: ['NamedOp',0],
|
arccos: ['NamedFn'],
|
||||||
arctan: ['NamedOp',0],
|
arctan: ['NamedFn'],
|
||||||
arg: ['NamedOp',0],
|
arg: ['NamedFn'],
|
||||||
cos: ['NamedOp',0],
|
cos: ['NamedFn'],
|
||||||
cosh: ['NamedOp',0],
|
cosh: ['NamedFn'],
|
||||||
cot: ['NamedOp',0],
|
cot: ['NamedFn'],
|
||||||
coth: ['NamedOp',0],
|
coth: ['NamedFn'],
|
||||||
csc: ['NamedOp',0],
|
csc: ['NamedFn'],
|
||||||
deg: ['NamedOp',0],
|
deg: ['NamedFn'],
|
||||||
det: 'NamedOp',
|
det: 'NamedOp',
|
||||||
dim: ['NamedOp',0],
|
dim: ['NamedFn'],
|
||||||
exp: ['NamedOp',0],
|
exp: ['NamedFn'],
|
||||||
gcd: 'NamedOp',
|
gcd: 'NamedOp',
|
||||||
hom: ['NamedOp',0],
|
hom: ['NamedFn'],
|
||||||
inf: 'NamedOp',
|
inf: 'NamedOp',
|
||||||
ker: ['NamedOp',0],
|
ker: ['NamedFn'],
|
||||||
lg: ['NamedOp',0],
|
lg: ['NamedFn'],
|
||||||
lim: 'NamedOp',
|
lim: 'NamedOp',
|
||||||
liminf: ['NamedOp',null,'lim inf'],
|
liminf: ['NamedOp','lim inf'],
|
||||||
limsup: ['NamedOp',null,'lim sup'],
|
limsup: ['NamedOp','lim sup'],
|
||||||
ln: ['NamedOp',0],
|
ln: ['NamedFn'],
|
||||||
log: ['NamedOp',0],
|
log: ['NamedFn'],
|
||||||
max: 'NamedOp',
|
max: 'NamedOp',
|
||||||
min: 'NamedOp',
|
min: 'NamedOp',
|
||||||
Pr: 'NamedOp',
|
Pr: 'NamedOp',
|
||||||
sec: ['NamedOp',0],
|
sec: ['NamedFn'],
|
||||||
sin: ['NamedOp',0],
|
sin: ['NamedFn'],
|
||||||
sinh: ['NamedOp',0],
|
sinh: ['NamedFn'],
|
||||||
sup: 'NamedOp',
|
sup: 'NamedOp',
|
||||||
tan: ['NamedOp',0],
|
tan: ['NamedFn'],
|
||||||
tanh: ['NamedOp',0],
|
tanh: ['NamedFn'],
|
||||||
|
|
||||||
limits: ['Limits',1],
|
limits: ['Limits',1],
|
||||||
nolimits: ['Limits',0],
|
nolimits: ['Limits',0],
|
||||||
|
@ -1114,13 +1125,17 @@
|
||||||
this.Push(STACKITEM[name.substr(1)]().With({delim: this.GetDelimiter(name)}));
|
this.Push(STACKITEM[name.substr(1)]().With({delim: this.GetDelimiter(name)}));
|
||||||
},
|
},
|
||||||
|
|
||||||
NamedOp: function (name,limits,id) {
|
NamedFn: function (name,id) {
|
||||||
var underover = (limits != null && limits === 0 ? FALSE : TRUE);
|
if (!id) {id = name.substr(1)};
|
||||||
if (!id) {id = name.substr(1)}; limits = ((limits || limits == null) ? TRUE : FALSE);
|
var mml = MML.mi(id).With({texClass: MML.TEXCLASS.OP});
|
||||||
|
this.Push(STACKITEM.fn(this.mmlToken(mml)));
|
||||||
|
},
|
||||||
|
NamedOp: function (name,id) {
|
||||||
|
if (!id) {id = name.substr(1)};
|
||||||
id = id.replace(/ /,String.fromCharCode(0x2006));
|
id = id.replace(/ /,String.fromCharCode(0x2006));
|
||||||
var mml = MML.mo(id).With({
|
var mml = MML.mo(id).With({
|
||||||
movablelimits: limits,
|
movablelimits: TRUE,
|
||||||
movesupsub: underover,
|
movesupsub: TRUE,
|
||||||
form: MML.FORM.PREFIX,
|
form: MML.FORM.PREFIX,
|
||||||
texClass: MML.TEXCLASS.OP
|
texClass: MML.TEXCLASS.OP
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user