summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMax <me@mkor.je>2024-09-27 08:34:38 +0000
committerGitHub <noreply@github.com>2024-09-27 08:34:38 +0000
commit93a5b712b1919859fa526e989477db2e7256689f (patch)
tree3a104a02465cb5012e127b400d0e1afd2ffa8432 /tests
parentab67eee2d479e72834598bb681bd0eb493f0dec2 (diff)
Fix `math.lr` size argument not being applied to enclosed `math.mid` (#5050)
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/math-lr-mid-size-nested-equation.pngbin0 -> 900 bytes
-rw-r--r--tests/ref/math-lr-mid-size.pngbin0 -> 2210 bytes
-rw-r--r--tests/ref/math-lr-nested.pngbin0 -> 126 bytes
-rw-r--r--tests/suite/math/delimited.typ35
4 files changed, 35 insertions, 0 deletions
diff --git a/tests/ref/math-lr-mid-size-nested-equation.png b/tests/ref/math-lr-mid-size-nested-equation.png
new file mode 100644
index 00000000..df010668
--- /dev/null
+++ b/tests/ref/math-lr-mid-size-nested-equation.png
Binary files differ
diff --git a/tests/ref/math-lr-mid-size.png b/tests/ref/math-lr-mid-size.png
new file mode 100644
index 00000000..12b4c086
--- /dev/null
+++ b/tests/ref/math-lr-mid-size.png
Binary files differ
diff --git a/tests/ref/math-lr-nested.png b/tests/ref/math-lr-nested.png
new file mode 100644
index 00000000..eb172009
--- /dev/null
+++ b/tests/ref/math-lr-nested.png
Binary files differ
diff --git a/tests/suite/math/delimited.typ b/tests/suite/math/delimited.typ
index 632fbd40..d6e1d864 100644
--- a/tests/suite/math/delimited.typ
+++ b/tests/suite/math/delimited.typ
@@ -52,6 +52,31 @@ $ { x mid(|) sum_(i=1)^oo phi_i (x) < 1 } \
mid(bar.v.double)
floor(hat(I) mid(slash) { dot mid(|) dot } mid(|) I/n) } $
+--- math-lr-mid-size ---
+// Test mid when lr size is set.
+#set page(width: auto)
+
+$ lr({ A mid(|) integral }) quad
+ lr(size: #1em, { A mid(|) integral }) quad
+ lr(size: #(1em+20%), { A mid(|) integral }) \
+
+ lr(] A mid(|) integral ]) quad
+ lr(size: #1em, ] A mid(|) integral ]) quad
+ lr(size: #(1em+20%), ] A mid(|) integral ]) \
+
+ lr(( A mid(|) integral ]) quad
+ lr(size: #1em, ( A mid(|) integral ]) quad
+ lr(size: #(1em+20%), ( A mid(|) integral ]) $
+
+--- math-lr-mid-size-nested-equation ---
+// Test mid size when lr size is set, when nested in an equation.
+#set page(width: auto)
+
+#let body = ${ A mid(|) integral }$
+$ lr(body) quad
+ lr(size: #1em, body) quad
+ lr(size: #(1em+20%), body) $
+
--- math-lr-unbalanced ---
// Test unbalanced delimiters.
$ 1/(2 (x) $
@@ -63,6 +88,16 @@ $ 1/(2 y (x) (2(3)) $
// and immediately before the closing.
$ [#h(1em, weak: true)A(dif x, f(x) dif x)sum#h(1em, weak: true)] $
+--- math-lr-nested ---
+// Test nested lr calls.
+#let body1 = math.lr($|$, size: 4em)
+#let body2 = $lr(|, size: #4em)$
+
+$lr(|, size: #2em)$
+$lr(lr(|, size: #4em), size: #50%)$
+$lr(body1, size: #50%)$
+$lr(body2, size: #50%)$
+
--- issue-4188-lr-corner-brackets ---
// Test positioning of U+231C to U+231F
$⌜a⌟⌞b⌝$ = $⌜$$a$$⌟$$⌞$$b$$⌝$