diff --git a/tests/ref/bugs/math-realize.png b/tests/ref/bugs/math-realize.png index d6a14fa33..941f965b1 100644 Binary files a/tests/ref/bugs/math-realize.png and b/tests/ref/bugs/math-realize.png differ diff --git a/tests/typ/bugs/math-realize.typ b/tests/typ/bugs/math-realize.typ index 19e2c93a2..d79915420 100644 --- a/tests/typ/bugs/math-realize.typ +++ b/tests/typ/bugs/math-realize.typ @@ -18,3 +18,30 @@ $ vec(1,2) * 2 $ $ x^2 #hide[$(>= phi.alt) union y^2 0$] z^2 $ Hello #hide[there $x$] and #hide[$ f(x) := x^2 $] + +--- +// Test equations can embed equation pieces built by functions +#let foo(v1, v2) = { + // Return an equation piece that would've been rendered in + // inline style if the piece is not embedded + $v1 v2^2$ +} +#let bar(v1, v2) = { + // Return an equation piece that would've been rendered in + // block style if the piece is not embedded + $ v1 v2^2 $ +} +#let baz(..sink) = { + // Return an equation piece built by joining arrays + sink.pos().map(x => $hat(#x)$).join(sym.and) +} + +Inline $2 foo(alpha, (M+foo(a, b)))$. + +Inline $2 bar(alpha, (M+foo(a, b)))$. + +Inline $2 baz(x,y,baz(u, v))$. + +$ 2 foo(alpha, (M+foo(a, b))) $ +$ 2 bar(alpha, (M+foo(a, b))) $ +$ 2 baz(x,y,baz(u, v)) $