diff options
| author | Max <me@mkor.je> | 2024-09-26 14:46:26 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-26 14:46:26 +0000 |
| commit | e00e3e4fbfb9432061d176fb0a3e6b4bf2430fc6 (patch) | |
| tree | f9842b736f93e8f00ae752a22b587ac4e2c3bf0c /tests | |
| parent | a40e068590895562f0d1a4aa17fe97b9bf5630a3 (diff) | |
Add `math.stretch` element function (#5030)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/math-stretch-attach-nested-equation.png | bin | 0 -> 180 bytes | |||
| -rw-r--r-- | tests/ref/math-stretch-attach.png | bin | 0 -> 2245 bytes | |||
| -rw-r--r-- | tests/ref/math-stretch-basic.png | bin | 0 -> 787 bytes | |||
| -rw-r--r-- | tests/ref/math-stretch-complex.png | bin | 0 -> 1457 bytes | |||
| -rw-r--r-- | tests/ref/math-stretch-horizontal.png | bin | 0 -> 591 bytes | |||
| -rw-r--r-- | tests/ref/math-stretch-nested.png | bin | 0 -> 253 bytes | |||
| -rw-r--r-- | tests/ref/math-stretch-shorthand.png | bin | 0 -> 375 bytes | |||
| -rw-r--r-- | tests/ref/math-stretch-vertical.png | bin | 0 -> 481 bytes | |||
| -rw-r--r-- | tests/suite/math/stretch.typ | 72 |
9 files changed, 72 insertions, 0 deletions
diff --git a/tests/ref/math-stretch-attach-nested-equation.png b/tests/ref/math-stretch-attach-nested-equation.png Binary files differnew file mode 100644 index 00000000..5ab4fbb5 --- /dev/null +++ b/tests/ref/math-stretch-attach-nested-equation.png diff --git a/tests/ref/math-stretch-attach.png b/tests/ref/math-stretch-attach.png Binary files differnew file mode 100644 index 00000000..179281a5 --- /dev/null +++ b/tests/ref/math-stretch-attach.png diff --git a/tests/ref/math-stretch-basic.png b/tests/ref/math-stretch-basic.png Binary files differnew file mode 100644 index 00000000..3144b11f --- /dev/null +++ b/tests/ref/math-stretch-basic.png diff --git a/tests/ref/math-stretch-complex.png b/tests/ref/math-stretch-complex.png Binary files differnew file mode 100644 index 00000000..be694b71 --- /dev/null +++ b/tests/ref/math-stretch-complex.png diff --git a/tests/ref/math-stretch-horizontal.png b/tests/ref/math-stretch-horizontal.png Binary files differnew file mode 100644 index 00000000..9b30be59 --- /dev/null +++ b/tests/ref/math-stretch-horizontal.png diff --git a/tests/ref/math-stretch-nested.png b/tests/ref/math-stretch-nested.png Binary files differnew file mode 100644 index 00000000..4583cab9 --- /dev/null +++ b/tests/ref/math-stretch-nested.png diff --git a/tests/ref/math-stretch-shorthand.png b/tests/ref/math-stretch-shorthand.png Binary files differnew file mode 100644 index 00000000..59db832a --- /dev/null +++ b/tests/ref/math-stretch-shorthand.png diff --git a/tests/ref/math-stretch-vertical.png b/tests/ref/math-stretch-vertical.png Binary files differnew file mode 100644 index 00000000..1f60506d --- /dev/null +++ b/tests/ref/math-stretch-vertical.png diff --git a/tests/suite/math/stretch.typ b/tests/suite/math/stretch.typ new file mode 100644 index 00000000..e6817ee5 --- /dev/null +++ b/tests/suite/math/stretch.typ @@ -0,0 +1,72 @@ +// Test math stretch. + +--- math-stretch-basic --- +// Test basic stretch. +$ P -> Q stretch(->, size: #200%) R \ + R stretch(->) S stretch(->, size: #50%)^"epimorphism" T $ + +--- math-stretch-complex --- +// Test complex stretch. +$ H stretch(=)^"define" U + p V \ + x stretch(harpoons.ltrb, size: #3em) y + stretch(\[, size: #150%) z \ + f : X stretch(arrow.hook, size: #150%)_"injective" Y \ + V stretch(->, size: #(100% + 1.5em))^("surjection") ZZ $ + +--- math-stretch-attach --- +// Test stretch interactions with attachments. +#set page(width: auto) + +$stretch(stretch(=, size: #4em))_A$ +$stretch(arrow.hook, size: #5em)^"injective map"$ +$stretch(arrow.hook, size: #200%)^"injective map"$ + +$ P = Q + stretch(=)^(k = 0)_(forall i) R + stretch(=, size: #150%)^(k = 0)_(forall i) S + stretch(=, size: #2mm)^(k = 0)_(forall i) T \ + U stretch(equiv)^(forall i)_"Chern-Weil" V + stretch(equiv, size: #(120% + 2mm))^(forall i)_"Chern-Weil" W $ + +--- math-stretch-horizontal --- +// Test stretching along horizontal axis. +#let ext(sym) = math.stretch(sym, size: 2em) +$ ext(arrow.r) quad ext(arrow.l.double.bar) \ + ext(harpoon.rb) quad ext(harpoons.ltrb) \ + ext(paren.t) quad ext(shell.b) \ + ext(eq) quad ext(equiv) $ + +--- math-stretch-vertical --- +// Test stretching along vertical axis. +#let ext(sym) = math.stretch(sym, size: 2em) +$ ext(bar.v) quad ext(bar.v.double) quad + ext(angle.l) quad ext(angle.r) quad + ext(paren.l) quad ext(paren.r) \ + ext(bracket.l.double) quad ext(bracket.r.double) quad + ext(brace.l) quad ext(brace.r) quad + ext(bracket.l) quad ext(bracket.r) $ + +--- math-stretch-shorthand --- +// Test stretch when base is given with shorthand. +$stretch(||, size: #2em)$ +$stretch(\(, size: #2em)$ +$stretch("⟧", size: #2em)$ +$stretch("|", size: #2em)$ +$stretch(->, size: #2em)$ +$stretch(↣, size: #2em)$ + +--- math-stretch-nested --- +// Test nested stretch calls. +$ stretch(=, size: #2em) \ + stretch(stretch(=, size: #4em), size: #50%) $ + +#let base = math.stretch($=$, size: 4em) +$ stretch(base, size: #50%) $ + +#let base = $stretch(=, size: #4em) $ +$ stretch(base, size: #50%) $ + +--- math-stretch-attach-nested-equation --- +// Test stretching with attachments when nested in an equation. +#let body = $stretch(=)$ +$ body^"text" $ |
