diff options
| author | Max <me@mkor.je> | 2024-12-20 12:35:57 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-20 12:35:57 +0000 |
| commit | bb38a01d0625d5bdab0af50daf479e60c774d90e (patch) | |
| tree | b588b09ce44b698e7602d84ec3e43dd86a47b552 /tests | |
| parent | 39706fe42f269b3a283eeff9b595480631737159 (diff) | |
Fix math size resolving (#5596)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/math-size-arbitrary-content.png | bin | 0 -> 603 bytes | |||
| -rw-r--r-- | tests/ref/math-size-math-content-1.png | bin | 0 -> 2098 bytes | |||
| -rw-r--r-- | tests/ref/math-size-math-content-2.png | bin | 0 -> 1472 bytes | |||
| -rw-r--r-- | tests/ref/math-size-math-content-3.png | bin | 0 -> 877 bytes | |||
| -rw-r--r-- | tests/ref/math-size-resolve.png | bin | 0 -> 460 bytes | |||
| -rw-r--r-- | tests/ref/math-text-size.png | bin | 0 -> 1265 bytes | |||
| -rw-r--r-- | tests/suite/math/interactions.typ | 38 |
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 Binary files differnew file mode 100644 index 00000000..3b6e35aa --- /dev/null +++ b/tests/ref/math-size-arbitrary-content.png diff --git a/tests/ref/math-size-math-content-1.png b/tests/ref/math-size-math-content-1.png Binary files differnew file mode 100644 index 00000000..385433d5 --- /dev/null +++ b/tests/ref/math-size-math-content-1.png diff --git a/tests/ref/math-size-math-content-2.png b/tests/ref/math-size-math-content-2.png Binary files differnew file mode 100644 index 00000000..6e5e0e4d --- /dev/null +++ b/tests/ref/math-size-math-content-2.png diff --git a/tests/ref/math-size-math-content-3.png b/tests/ref/math-size-math-content-3.png Binary files differnew file mode 100644 index 00000000..75eddaba --- /dev/null +++ b/tests/ref/math-size-math-content-3.png diff --git a/tests/ref/math-size-resolve.png b/tests/ref/math-size-resolve.png Binary files differnew file mode 100644 index 00000000..63a1b5d2 --- /dev/null +++ b/tests/ref/math-size-resolve.png diff --git a/tests/ref/math-text-size.png b/tests/ref/math-text-size.png Binary files differnew file mode 100644 index 00000000..7c430a3a --- /dev/null +++ b/tests/ref/math-text-size.png 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 $ |
