mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
fix: Correct for negative margin in integrand lower limits (#2987)
* fix: Correct for negative margin in integrand lower limits. * Adjust for width limit. * Update screenshots. * Update Safari screenshot. * Catch null subGroup. * Remove redundant code.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// @flow
|
||||
import buildCommon from "../../buildCommon";
|
||||
import * as html from "../../buildHTML";
|
||||
import utils from "../../utils";
|
||||
import type {StyleInterface} from "../../Style";
|
||||
import type Options from "../../Options";
|
||||
import type {DomSpan, SymbolNode} from "../../domTree";
|
||||
@@ -18,6 +19,7 @@ export const assembleSupSub = (
|
||||
baseShift: number,
|
||||
): DomSpan => {
|
||||
base = buildCommon.makeSpan([], [base]);
|
||||
const subIsSingleCharacter = subGroup && utils.isCharacterBox(subGroup);
|
||||
let sub;
|
||||
let sup;
|
||||
// We manually have to handle the superscripts and subscripts. This,
|
||||
@@ -105,6 +107,13 @@ export const assembleSupSub = (
|
||||
return base;
|
||||
}
|
||||
|
||||
return buildCommon.makeSpan(
|
||||
["mop", "op-limits"], [finalGroup], options);
|
||||
const parts = [finalGroup];
|
||||
if (sub && slant !== 0 && !subIsSingleCharacter) {
|
||||
// A negative margin-left was applied to the lower limit.
|
||||
// Avoid an overlap by placing a spacer on the left on the group.
|
||||
const spacer = buildCommon.makeSpan(["mspace"], [], options);
|
||||
spacer.style.marginRight = `${slant}em`;
|
||||
parts.unshift(spacer);
|
||||
}
|
||||
return buildCommon.makeSpan(["mop", "op-limits"], parts, options);
|
||||
};
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 33 KiB |
Binary file not shown.
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 34 KiB |
Binary file not shown.
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 26 KiB |
@@ -184,7 +184,8 @@ Integrands: |
|
||||
\begin{array}{l}
|
||||
\displaystyle \int + \oint + \iint + \oiint_i^n \\[0.6em]
|
||||
\displaystyle \iiint + \oiiint + \textstyle \int + \oint_i^n \\[0.6em]
|
||||
\iint + \oiint + \iiint + \oiiint
|
||||
\iint + \oiint + \iiint + \oiiint \\[0.6em]
|
||||
\int\limits^x_{y + 4 - a} \int\limits^x_{y + 4 - a}
|
||||
\end{array}
|
||||
KaTeX:
|
||||
tex: \KaTeX, \large \KaTeX
|
||||
|
Reference in New Issue
Block a user