diff options
| author | Leedehai <18319900+Leedehai@users.noreply.github.com> | 2023-04-29 14:51:29 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-29 20:51:29 +0200 |
| commit | ecd589a84f24cb0639bb20057d070bf0d9ec4899 (patch) | |
| tree | ac49cfb5d00fdfd7f9a3bdbca952d1238a46e9a3 /tests | |
| parent | b5d72caaf94a5079cf67ce5c4764992d5e9ed01a (diff) | |
Add a test checking equations can embed function-built pieces (#1033)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/bugs/math-realize.png | bin | 8926 -> 20296 bytes | |||
| -rw-r--r-- | tests/typ/bugs/math-realize.typ | 27 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/ref/bugs/math-realize.png b/tests/ref/bugs/math-realize.png Binary files differindex d6a14fa3..941f965b 100644 --- a/tests/ref/bugs/math-realize.png +++ b/tests/ref/bugs/math-realize.png 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)) $ |
