Don't produce doube exponent/subscript errors for UnderOver constructs like \underline and \overbrace. Resolves issue reported on StackExchange.
This commit is contained in:
parent
d6b6b2e249
commit
cce02ddfde
|
@ -391,7 +391,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
bot = TEX.Parse(bot,this.stack.env).mml()
|
bot = TEX.Parse(bot,this.stack.env).mml()
|
||||||
mml.SetData(mml.under,MML.mpadded(bot).With(def).With({voffset:"-.24em"}));
|
mml.SetData(mml.under,MML.mpadded(bot).With(def).With({voffset:"-.24em"}));
|
||||||
}
|
}
|
||||||
this.Push(mml);
|
this.Push(mml.With({subsupOK:true}));
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1193,7 +1193,7 @@
|
||||||
if (base.isEmbellishedWrapper) {base = base.data[0].data[0]}
|
if (base.isEmbellishedWrapper) {base = base.data[0].data[0]}
|
||||||
var movesupsub = base.movesupsub, position = base.sup;
|
var movesupsub = base.movesupsub, position = base.sup;
|
||||||
if ((base.type === "msubsup" && base.data[base.sup]) ||
|
if ((base.type === "msubsup" && base.data[base.sup]) ||
|
||||||
(base.type === "munderover" && base.data[base.over]))
|
(base.type === "munderover" && base.data[base.over] && !base.subsupOK))
|
||||||
{TEX.Error(["DoubleExponent","Double exponent: use braces to clarify"])}
|
{TEX.Error(["DoubleExponent","Double exponent: use braces to clarify"])}
|
||||||
if (base.type !== "msubsup") {
|
if (base.type !== "msubsup") {
|
||||||
if (movesupsub) {
|
if (movesupsub) {
|
||||||
|
@ -1220,7 +1220,7 @@
|
||||||
if (base.isEmbellishedWrapper) {base = base.data[0].data[0]}
|
if (base.isEmbellishedWrapper) {base = base.data[0].data[0]}
|
||||||
var movesupsub = base.movesupsub, position = base.sub;
|
var movesupsub = base.movesupsub, position = base.sub;
|
||||||
if ((base.type === "msubsup" && base.data[base.sub]) ||
|
if ((base.type === "msubsup" && base.data[base.sub]) ||
|
||||||
(base.type === "munderover" && base.data[base.under]))
|
(base.type === "munderover" && base.data[base.under] && !base.subsupOK))
|
||||||
{TEX.Error(["DoubleSubscripts","Double subscripts: use braces to clarify"])}
|
{TEX.Error(["DoubleSubscripts","Double subscripts: use braces to clarify"])}
|
||||||
if (base.type !== "msubsup") {
|
if (base.type !== "msubsup") {
|
||||||
if (movesupsub) {
|
if (movesupsub) {
|
||||||
|
@ -1433,10 +1433,12 @@
|
||||||
if (base.isa(MML.munderover) && base.isEmbellished())
|
if (base.isa(MML.munderover) && base.isEmbellished())
|
||||||
{base = MML.mrow(MML.mo().With({rspace:0}),base)} // add an empty <mi> so it's not embellished any more
|
{base = MML.mrow(MML.mo().With({rspace:0}),base)} // add an empty <mi> so it's not embellished any more
|
||||||
var mml = MML.munderover(base,null,null);
|
var mml = MML.munderover(base,null,null);
|
||||||
mml.data[mml[pos]] =
|
mml.SetData(
|
||||||
this.mmlToken(MML.mo(MML.entity("#x"+c)).With({stretchy:true, accent:(pos == "under")}));
|
mml[pos],
|
||||||
|
this.mmlToken(MML.mo(MML.entity("#x"+c)).With({stretchy:true, accent:(pos==="under")}))
|
||||||
|
);
|
||||||
if (stack) {mml = MML.TeXAtom(mml).With({texClass:MML.TEXCLASS.OP, movesupsub:true})}
|
if (stack) {mml = MML.TeXAtom(mml).With({texClass:MML.TEXCLASS.OP, movesupsub:true})}
|
||||||
this.Push(mml);
|
this.Push(mml.With({subsupOK:true}));
|
||||||
},
|
},
|
||||||
|
|
||||||
Overset: function (name) {
|
Overset: function (name) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user