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
|
||||
*/
|
||||
|
||||
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"
|
||||
},{
|
||||
id: "mml",
|
||||
version: "1.1",
|
||||
version: "1.1.1",
|
||||
directory: MathJax.ElementJax.directory + "/mml",
|
||||
extensionDir: MathJax.ElementJax.extensionDir + "/mml",
|
||||
optableDir: MathJax.ElementJax.directory + "/mml/optable"
|
||||
|
@ -545,7 +545,7 @@ MathJax.ElementJax.mml.Augment({
|
|||
setTeXclass: function (prev) {
|
||||
this.getValues("lspace","rspace"); // sets useMMLspacing
|
||||
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")}
|
||||
else {this.prevClass = MML.TEXCLASS.NONE}
|
||||
if (this.texClass === MML.TEXCLASS.BIN &&
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
MathJax.InputJax.TeX = MathJax.InputJax({
|
||||
id: "TeX",
|
||||
version: "1.1.2",
|
||||
version: "1.1.3",
|
||||
directory: MathJax.InputJax.directory + "/TeX",
|
||||
extensionDir: MathJax.InputJax.extensionDir + "/TeX",
|
||||
|
||||
|
|
|
@ -279,6 +279,17 @@
|
|||
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 STARTUP = function () {
|
||||
|
@ -627,38 +638,38 @@
|
|||
huge: ['SetSize',2.07],
|
||||
Huge: ['SetSize',2.49],
|
||||
|
||||
arcsin: ['NamedOp',0],
|
||||
arccos: ['NamedOp',0],
|
||||
arctan: ['NamedOp',0],
|
||||
arg: ['NamedOp',0],
|
||||
cos: ['NamedOp',0],
|
||||
cosh: ['NamedOp',0],
|
||||
cot: ['NamedOp',0],
|
||||
coth: ['NamedOp',0],
|
||||
csc: ['NamedOp',0],
|
||||
deg: ['NamedOp',0],
|
||||
arcsin: ['NamedFn'],
|
||||
arccos: ['NamedFn'],
|
||||
arctan: ['NamedFn'],
|
||||
arg: ['NamedFn'],
|
||||
cos: ['NamedFn'],
|
||||
cosh: ['NamedFn'],
|
||||
cot: ['NamedFn'],
|
||||
coth: ['NamedFn'],
|
||||
csc: ['NamedFn'],
|
||||
deg: ['NamedFn'],
|
||||
det: 'NamedOp',
|
||||
dim: ['NamedOp',0],
|
||||
exp: ['NamedOp',0],
|
||||
dim: ['NamedFn'],
|
||||
exp: ['NamedFn'],
|
||||
gcd: 'NamedOp',
|
||||
hom: ['NamedOp',0],
|
||||
hom: ['NamedFn'],
|
||||
inf: 'NamedOp',
|
||||
ker: ['NamedOp',0],
|
||||
lg: ['NamedOp',0],
|
||||
ker: ['NamedFn'],
|
||||
lg: ['NamedFn'],
|
||||
lim: 'NamedOp',
|
||||
liminf: ['NamedOp',null,'lim inf'],
|
||||
limsup: ['NamedOp',null,'lim sup'],
|
||||
ln: ['NamedOp',0],
|
||||
log: ['NamedOp',0],
|
||||
liminf: ['NamedOp','lim inf'],
|
||||
limsup: ['NamedOp','lim sup'],
|
||||
ln: ['NamedFn'],
|
||||
log: ['NamedFn'],
|
||||
max: 'NamedOp',
|
||||
min: 'NamedOp',
|
||||
Pr: 'NamedOp',
|
||||
sec: ['NamedOp',0],
|
||||
sin: ['NamedOp',0],
|
||||
sinh: ['NamedOp',0],
|
||||
sec: ['NamedFn'],
|
||||
sin: ['NamedFn'],
|
||||
sinh: ['NamedFn'],
|
||||
sup: 'NamedOp',
|
||||
tan: ['NamedOp',0],
|
||||
tanh: ['NamedOp',0],
|
||||
tan: ['NamedFn'],
|
||||
tanh: ['NamedFn'],
|
||||
|
||||
limits: ['Limits',1],
|
||||
nolimits: ['Limits',0],
|
||||
|
@ -1114,13 +1125,17 @@
|
|||
this.Push(STACKITEM[name.substr(1)]().With({delim: this.GetDelimiter(name)}));
|
||||
},
|
||||
|
||||
NamedOp: function (name,limits,id) {
|
||||
var underover = (limits != null && limits === 0 ? FALSE : TRUE);
|
||||
if (!id) {id = name.substr(1)}; limits = ((limits || limits == null) ? TRUE : FALSE);
|
||||
NamedFn: function (name,id) {
|
||||
if (!id) {id = name.substr(1)};
|
||||
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));
|
||||
var mml = MML.mo(id).With({
|
||||
movablelimits: limits,
|
||||
movesupsub: underover,
|
||||
movablelimits: TRUE,
|
||||
movesupsub: TRUE,
|
||||
form: MML.FORM.PREFIX,
|
||||
texClass: MML.TEXCLASS.OP
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user