summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMax <me@mkor.je>2024-12-08 16:55:34 +0000
committerGitHub <noreply@github.com>2024-12-08 16:55:34 +0000
commit468a60103dca9c6788be2207c9785d5ba771c800 (patch)
treed8f8e9597e2f5d1ed1e38d8d9b1e5a81d211fd10 /tests
parent57f7c167d867094660077d3da75a0207497aa36e (diff)
Fix multiline annotations in over- elems in math changing the baseline (#5459)
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/math-cases-linebreaks.pngbin0 -> 570 bytes
-rw-r--r--tests/ref/math-mat-linebreaks.pngbin0 -> 651 bytes
-rw-r--r--tests/ref/math-underover-multiline-annotation.pngbin0 -> 1672 bytes
-rw-r--r--tests/ref/math-vec-linebreaks.pngbin0 -> 856 bytes
-rw-r--r--tests/suite/math/cases.typ5
-rw-r--r--tests/suite/math/mat.typ5
-rw-r--r--tests/suite/math/underover.typ7
-rw-r--r--tests/suite/math/vec.typ5
8 files changed, 22 insertions, 0 deletions
diff --git a/tests/ref/math-cases-linebreaks.png b/tests/ref/math-cases-linebreaks.png
new file mode 100644
index 00000000..543d5384
--- /dev/null
+++ b/tests/ref/math-cases-linebreaks.png
Binary files differ
diff --git a/tests/ref/math-mat-linebreaks.png b/tests/ref/math-mat-linebreaks.png
new file mode 100644
index 00000000..52ff0a8b
--- /dev/null
+++ b/tests/ref/math-mat-linebreaks.png
Binary files differ
diff --git a/tests/ref/math-underover-multiline-annotation.png b/tests/ref/math-underover-multiline-annotation.png
new file mode 100644
index 00000000..ad8f0c80
--- /dev/null
+++ b/tests/ref/math-underover-multiline-annotation.png
Binary files differ
diff --git a/tests/ref/math-vec-linebreaks.png b/tests/ref/math-vec-linebreaks.png
new file mode 100644
index 00000000..6eeed42b
--- /dev/null
+++ b/tests/ref/math-vec-linebreaks.png
Binary files differ
diff --git a/tests/suite/math/cases.typ b/tests/suite/math/cases.typ
index 2cf48e6f..1c7b4a6b 100644
--- a/tests/suite/math/cases.typ
+++ b/tests/suite/math/cases.typ
@@ -15,3 +15,8 @@ $ x = cases(1, 2) $
--- math-cases-delim ---
#set math.cases(delim: sym.angle.l)
$ cases(a, b, c) $
+
+--- math-cases-linebreaks ---
+// Currently linebreaks are equivalent to commas, though this behaviour may
+// change in the future.
+$ cases(a, b, c) cases(reverse: #true, a \ b \ c) $
diff --git a/tests/suite/math/mat.typ b/tests/suite/math/mat.typ
index baec53ee..391ff167 100644
--- a/tests/suite/math/mat.typ
+++ b/tests/suite/math/mat.typ
@@ -229,6 +229,11 @@ $ mat(delim: angle.r, 1, 2; 3, 4) $
$ mat(delim: #(none, "["), 1, 2; 3, 4) $
$ mat(delim: #(sym.angle.r, sym.bracket.double.r), 1, 2; 3, 4) $
+--- math-mat-linebreaks ---
+// Unlike cases and vectors, linebreaks are discarded in matrices. This
+// behaviour may change in the future.
+$ mat(a; b; c) mat(a \ b \ c) $
+
--- issue-1617-mat-align ---
#set page(width: auto)
$ mat(a, b; c, d) mat(x; y) $
diff --git a/tests/suite/math/underover.typ b/tests/suite/math/underover.typ
index 5eca70b3..600ccf7c 100644
--- a/tests/suite/math/underover.typ
+++ b/tests/suite/math/underover.typ
@@ -45,3 +45,10 @@ $A_2 != overline(A)_2 != underline(A)_2 != underline(overline(A))_2 \
$J^b != overline(J)^b != underline(J)^b != underline(overline(J))^b \
K^3 != overline(K)^3 != underline(K)^3 != underline(overline(K))^3 \
T^i != overline(T)^i != underline(T)^i != underline(overline(T))^i$
+
+--- math-underover-multiline-annotation ---
+// Test that multiline annotations do not change the baseline.
+$ S = overbrace(beta (alpha) S I, "one line")
+ - overbrace(mu (N), "two" \ "line") $
+$ S = underbrace(beta (alpha) S I, "one line")
+ - underbrace(mu (N), "two" \ "line") $
diff --git a/tests/suite/math/vec.typ b/tests/suite/math/vec.typ
index cf7057f3..5de7eca9 100644
--- a/tests/suite/math/vec.typ
+++ b/tests/suite/math/vec.typ
@@ -49,3 +49,8 @@ $ vec(1, 2) $
--- math-vec-delim-invalid-closing ---
// Error: 22-33 invalid delimiter: "%"
#set math.vec(delim: (none, "%"))
+
+--- math-vec-linebreaks ---
+// Currently linebreaks are equivalent to commas, though this behaviour may
+// change in the future.
+$ vec(a, b, c) vec(a \ b \ c) $