diff options
| author | Alex Saveau <saveau.alexandre@gmail.com> | 2023-04-24 02:16:13 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-24 11:16:13 +0200 |
| commit | bc802bd8fb1656e5004b7c1b8a4e02ec7fc31aa8 (patch) | |
| tree | f299db167684d0c553b1dd132b92a3ea348617ba /tests/typ/math/matrix-alignment.typ | |
| parent | 5ccc6876194a3f9329021bf22e7c8d0ed6bf74a1 (diff) | |
Fix broken matrices with alignment and optimize code while we're at it (#935)
Diffstat (limited to 'tests/typ/math/matrix-alignment.typ')
| -rw-r--r-- | tests/typ/math/matrix-alignment.typ | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/typ/math/matrix-alignment.typ b/tests/typ/math/matrix-alignment.typ new file mode 100644 index 00000000..fd149dd8 --- /dev/null +++ b/tests/typ/math/matrix-alignment.typ @@ -0,0 +1,55 @@ +// Test matrix alignment math. + +--- +// 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. +$ 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) $ |
