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 | |
| parent | 5ccc6876194a3f9329021bf22e7c8d0ed6bf74a1 (diff) | |
Fix broken matrices with alignment and optimize code while we're at it (#935)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/math/alignment.png | bin | 23935 -> 6413 bytes | |||
| -rw-r--r-- | tests/ref/math/matrix-alignment.png | bin | 0 -> 15027 bytes | |||
| -rw-r--r-- | tests/typ/math/alignment.typ | 60 | ||||
| -rw-r--r-- | tests/typ/math/matrix-alignment.typ | 55 |
4 files changed, 55 insertions, 60 deletions
diff --git a/tests/ref/math/alignment.png b/tests/ref/math/alignment.png Binary files differindex 2e3c3d5d..917c49e1 100644 --- a/tests/ref/math/alignment.png +++ b/tests/ref/math/alignment.png diff --git a/tests/ref/math/matrix-alignment.png b/tests/ref/math/matrix-alignment.png Binary files differnew file mode 100644 index 00000000..1449553d --- /dev/null +++ b/tests/ref/math/matrix-alignment.png diff --git a/tests/typ/math/alignment.typ b/tests/typ/math/alignment.typ index 70c52d37..8f12971f 100644 --- a/tests/typ/math/alignment.typ +++ b/tests/typ/math/alignment.typ @@ -26,68 +26,8 @@ $ $ --- -// Test alternating alignment. -$ -"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) $ 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) $ |
