Fixed limit controls in textstyle
This commit is contained in:
parent
4be3931cb5
commit
9b0f42ea50
|
@ -261,8 +261,9 @@ Parser.prototype.parseAtom = function(pos, mode) {
|
||||||
this.lexer, currPos);
|
this.lexer, currPos);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var limits = lex.text == "\\limits";
|
var limits = lex.text === "\\limits";
|
||||||
base.result.value.limits = limits;
|
base.result.value.limits = limits;
|
||||||
|
base.result.value.alwaysHandleSupSub = true;
|
||||||
currPos = lex.position;
|
currPos = lex.position;
|
||||||
}
|
}
|
||||||
} else if (lex.text === "^") {
|
} else if (lex.text === "^") {
|
||||||
|
|
|
@ -104,7 +104,8 @@ var shouldHandleSupSub = function(group, options) {
|
||||||
} else if (group.type === "op") {
|
} else if (group.type === "op") {
|
||||||
// Operators handle supsubs differently when they have limits
|
// Operators handle supsubs differently when they have limits
|
||||||
// (e.g. `\displaystyle\sum_2^3`)
|
// (e.g. `\displaystyle\sum_2^3`)
|
||||||
return group.value.limits && options.style.size === Style.DISPLAY.size;
|
return group.value.limits &&
|
||||||
|
(options.style.size === Style.DISPLAY.size || group.value.alwaysHandleSupSub);
|
||||||
} else if (group.type === "accent") {
|
} else if (group.type === "accent") {
|
||||||
return isCharacterBox(group.value.base);
|
return isCharacterBox(group.value.base);
|
||||||
} else {
|
} else {
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 27 KiB |
Binary file not shown.
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 28 KiB |
|
@ -20,7 +20,7 @@
|
||||||
"LeftRight": "http://localhost:7936/test/screenshotter/test.html?m=\\left( x^2 \\right) \\left\\{ x^{x^{x^{x^x}}} \\right.",
|
"LeftRight": "http://localhost:7936/test/screenshotter/test.html?m=\\left( x^2 \\right) \\left\\{ x^{x^{x^{x^x}}} \\right.",
|
||||||
"LeftRightListStyling": "http://localhost:7936/test/screenshotter/test.html?m=a+\\left(x+y\\right)-x",
|
"LeftRightListStyling": "http://localhost:7936/test/screenshotter/test.html?m=a+\\left(x+y\\right)-x",
|
||||||
"LeftRightStyleSizing": "http://localhost:7936/test/screenshotter/test.html?m=+\\left\\{\\rule{0.1em}{1em}\\right.x^{+\\left\\{\\rule{0.1em}{1em}\\right.x^{+\\left\\{\\rule{0.1em}{1em}\\right.}}",
|
"LeftRightStyleSizing": "http://localhost:7936/test/screenshotter/test.html?m=+\\left\\{\\rule{0.1em}{1em}\\right.x^{+\\left\\{\\rule{0.1em}{1em}\\right.x^{+\\left\\{\\rule{0.1em}{1em}\\right.}}",
|
||||||
"LimitControls": "http://localhost:7936/test/screenshotter/test.html?m=\\displaystyle\\int\\limits_2^3 3x^2\\,dx + \\sum\\nolimits^n_{i=1}i",
|
"LimitControls": "http://localhost:7936/test/screenshotter/test.html?m=\\displaystyle\\int\\limits_2^3 3x^2\\,dx + \\sum\\nolimits^n_{i=1}i + \\textstyle\\int\\limits_x^y z",
|
||||||
"NestedFractions": "http://localhost:7936/test/screenshotter/test.html?m=\\dfrac{\\frac{a}{b}}{\\frac{c}{d}}\\dfrac{\\dfrac{a}{b}}{\\dfrac{c}{d}}\\frac{\\frac{a}{b}}{\\frac{c}{d}}",
|
"NestedFractions": "http://localhost:7936/test/screenshotter/test.html?m=\\dfrac{\\frac{a}{b}}{\\frac{c}{d}}\\dfrac{\\dfrac{a}{b}}{\\dfrac{c}{d}}\\frac{\\frac{a}{b}}{\\frac{c}{d}}",
|
||||||
"NullDelimiterInteraction": "http://localhost:7936/test/screenshotter/test.html?m=a \\bigl. + 2 \\quad \\left. + a \\right)",
|
"NullDelimiterInteraction": "http://localhost:7936/test/screenshotter/test.html?m=a \\bigl. + 2 \\quad \\left. + a \\right)",
|
||||||
"OpLimits": "http://localhost:7936/test/screenshotter/test.html?m={\\sin_2^2 \\lim_2^2 \\int_2^2 \\sum_2^2}{\\displaystyle \\lim_2^2 \\int_2^2 \\intop_2^2 \\sum_2^2}",
|
"OpLimits": "http://localhost:7936/test/screenshotter/test.html?m={\\sin_2^2 \\lim_2^2 \\int_2^2 \\sum_2^2}{\\displaystyle \\lim_2^2 \\int_2^2 \\intop_2^2 \\sum_2^2}",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user