summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/math/alignment.pngbin9752 -> 23935 bytes
-rw-r--r--tests/typ/math/alignment.typ79
2 files changed, 72 insertions, 7 deletions
diff --git a/tests/ref/math/alignment.png b/tests/ref/math/alignment.png
index 45b0cd86..2e3c3d5d 100644
--- a/tests/ref/math/alignment.png
+++ b/tests/ref/math/alignment.png
Binary files differ
diff --git a/tests/typ/math/alignment.typ b/tests/typ/math/alignment.typ
index 8482d89e..70c52d37 100644
--- a/tests/typ/math/alignment.typ
+++ b/tests/typ/math/alignment.typ
@@ -2,9 +2,8 @@
---
// Test alignment step functions.
-#set page(width: 300pt)
$
-"abc" &= c \
+"a" &= c \
&= c + 1 & "By definition" \
&= d + 100 + 1000 \
&= x && "Even longer" \
@@ -12,17 +11,83 @@ $
---
// Test post-fix alignment.
-#set page(width: 300pt)
$
& "right" \
"a very long line" \
+"left" \
+$
+
+---
+// Test no alignment.
+$
+"right" \
+"a very long line" \
+"left" \
$
---
// Test alternating alignment.
-#set page(width: 300pt)
$
-"abc" & "abc abc abc" & "abc abc" \
-"abc abc" & "abc abc" & "abc" \
-"abc abc abc" & "abc" & "abc abc abc" \
+"a" & "a a a" & "a a" \
+"a a" & "a a" & "a" \
+"a a a" & "a" & "a a a" \
+$
+
+---
+// Test alternating alignment in a vector.
+$ vec(
+ "a" & "a a a" & "a a",
+ "a a" & "a a" & "a",
+ "a a a" & "a" & "a a a",
+) $
+
+---
+// Test alternating explicit alignment in a matrix.
+$ mat(
+ "a" & "a a a" & "a a";
+ "a a" & "a a" & "a";
+ "a a a" & "a" & "a a a";
+) $
+
+---
+// Test alignment in a matrix.
+$ mat(
+ "a", "a a a", "a a";
+ "a a", "a a", "a";
+ "a a a", "a", "a a a";
+) $
+
+---
+// Test explicit left alignment in a matrix.
+$ mat(
+ &"a", &"a a a", &"a a";
+ &"a a", &"a a", &"a";
+ &"a a a", &"a", &"a a a";
+) $
+
+---
+// Test explicit right alignment in a matrix.
+$ mat(
+ "a"&, "a a a"&, "a a"&;
+ "a a"&, "a a"&, "a"&;
+ "a a a"&, "a"&, "a a a"&;
+) $
+
+---
+// Test #460 equations.
+$
+a &=b & quad c&=d \
+e &=f & g&=h
$
+
+$ mat(&a+b,c;&d, e) $
+$ mat(&a+b&,c;&d&, e) $
+$ mat(&&&a+b,c;&&&d, e) $
+$ mat(.&a+b&.,c;.....&d&....., e) $
+
+---
+// Test #454 equations.
+$ mat(-1, 1, 1; 1, -1, 1; 1, 1, -1) $
+$ mat(-1&, 1&, 1&; 1&, -1&, 1&; 1&, 1&, -1&) $
+$ mat(-1&, 1&, 1&; 1, -1, 1; 1, 1, -1) $
+$ mat(&-1, &1, &1; 1, -1, 1; 1, 1, -1) $