summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMax <me@mkor.je>2024-12-20 12:35:57 +0000
committerGitHub <noreply@github.com>2024-12-20 12:35:57 +0000
commitbb38a01d0625d5bdab0af50daf479e60c774d90e (patch)
treeb588b09ce44b698e7602d84ec3e43dd86a47b552 /tests
parent39706fe42f269b3a283eeff9b595480631737159 (diff)
Fix math size resolving (#5596)
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/math-size-arbitrary-content.pngbin0 -> 603 bytes
-rw-r--r--tests/ref/math-size-math-content-1.pngbin0 -> 2098 bytes
-rw-r--r--tests/ref/math-size-math-content-2.pngbin0 -> 1472 bytes
-rw-r--r--tests/ref/math-size-math-content-3.pngbin0 -> 877 bytes
-rw-r--r--tests/ref/math-size-resolve.pngbin0 -> 460 bytes
-rw-r--r--tests/ref/math-text-size.pngbin0 -> 1265 bytes
-rw-r--r--tests/suite/math/interactions.typ38
7 files changed, 38 insertions, 0 deletions
diff --git a/tests/ref/math-size-arbitrary-content.png b/tests/ref/math-size-arbitrary-content.png
new file mode 100644
index 00000000..3b6e35aa
--- /dev/null
+++ b/tests/ref/math-size-arbitrary-content.png
Binary files differ
diff --git a/tests/ref/math-size-math-content-1.png b/tests/ref/math-size-math-content-1.png
new file mode 100644
index 00000000..385433d5
--- /dev/null
+++ b/tests/ref/math-size-math-content-1.png
Binary files differ
diff --git a/tests/ref/math-size-math-content-2.png b/tests/ref/math-size-math-content-2.png
new file mode 100644
index 00000000..6e5e0e4d
--- /dev/null
+++ b/tests/ref/math-size-math-content-2.png
Binary files differ
diff --git a/tests/ref/math-size-math-content-3.png b/tests/ref/math-size-math-content-3.png
new file mode 100644
index 00000000..75eddaba
--- /dev/null
+++ b/tests/ref/math-size-math-content-3.png
Binary files differ
diff --git a/tests/ref/math-size-resolve.png b/tests/ref/math-size-resolve.png
new file mode 100644
index 00000000..63a1b5d2
--- /dev/null
+++ b/tests/ref/math-size-resolve.png
Binary files differ
diff --git a/tests/ref/math-text-size.png b/tests/ref/math-text-size.png
new file mode 100644
index 00000000..7c430a3a
--- /dev/null
+++ b/tests/ref/math-text-size.png
Binary files differ
diff --git a/tests/suite/math/interactions.typ b/tests/suite/math/interactions.typ
index 9a9b13ec..209f2f1b 100644
--- a/tests/suite/math/interactions.typ
+++ b/tests/suite/math/interactions.typ
@@ -114,3 +114,41 @@ 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)) $
+
+--- math-size-resolve ---
+#let length = context repr(measure("--").width)
+$ a length a ^ length $
+
+--- math-size-arbitrary-content ---
+// Test sizing of both relative and absolute non math content in math sizes.
+#let stuff = square(inset: 0pt)[hello]
+#let square = square(size: 5pt)
+$ stuff sum^stuff_square square $
+
+--- math-size-math-content-1 ---
+// Nested math content has styles overwritten by the inner equation.
+// Ideally the widths would match the actual length of the arrows.
+#let arrow = $stretch(->)^"much text"$
+$ arrow A^arrow A^A^arrow $
+#let width = context measure(arrow).width
+$ width A^width A^A^width $
+
+--- math-size-math-content-2 ---
+// Nested math content has styles overwritten by the inner equation.
+// Ideally the heights would match the actual height of the sums.
+#let sum = $sum^2$
+#let height(x) = context measure(x).height
+$sum = height(sum) $
+$ sum != height(sum) $
+
+--- math-size-math-content-3 ---
+// Sum doesn't get wrapped in math as it is a single expr.
+// Ideally the height would match the actual height of the sum.
+#let height(x) = context measure(x).height
+$ sum != height(sum) $
+
+--- math-text-size ---
+// Values retrieved from function are not resolved at the moment.
+// Ideally the left size would match the right size.
+#let size = context [#text.size.to-absolute() #1em.to-absolute()]
+$ size x^size x^x^size $