diff --git a/crates/typst-library/src/math/spacing.rs b/crates/typst-library/src/math/spacing.rs index 848aca789..80bb30a02 100644 --- a/crates/typst-library/src/math/spacing.rs +++ b/crates/typst-library/src/math/spacing.rs @@ -47,8 +47,9 @@ pub(super) fn spacing( (Binary, _) if !script(l) => resolve(MEDIUM, l), (_, Binary) if !script(r) => resolve(MEDIUM, r), - // Thin spacing around large operators, unless next to a delimiter. - (Large, Opening | Fence) | (Closing | Fence, Large) => None, + // Thin spacing around large operators, unless to the left of + // an opening delimiter. TeXBook, p170 + (Large, Opening | Fence) => None, (Large, _) => resolve(THIN, l), (_, Large) => resolve(THIN, r), diff --git a/tests/ref/math/spacing.png b/tests/ref/math/spacing.png index 317682392..0430060bb 100644 Binary files a/tests/ref/math/spacing.png and b/tests/ref/math/spacing.png differ diff --git a/tests/typ/math/spacing.typ b/tests/typ/math/spacing.typ index 132477f7f..87bfb0028 100644 --- a/tests/typ/math/spacing.typ +++ b/tests/typ/math/spacing.typ @@ -13,7 +13,7 @@ $sum x, sum(x)$ \ $sum product x$ \ $f(x), zeta(x), "frac"(x)$ \ $a+dots.c+b$ - +$f(x) sin(y)$ --- // Test ignored vs non-ignored spaces. $f (x), f(x)$ \