summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/ref/bugs/math-realize.pngbin8926 -> 20296 bytes
-rw-r--r--tests/typ/bugs/math-realize.typ27
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/ref/bugs/math-realize.png b/tests/ref/bugs/math-realize.png
index d6a14fa3..941f965b 100644
--- a/tests/ref/bugs/math-realize.png
+++ b/tests/ref/bugs/math-realize.png
Binary files differ
diff --git a/tests/typ/bugs/math-realize.typ b/tests/typ/bugs/math-realize.typ
index 19e2c93a..d7991542 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)) $