diff options
Diffstat (limited to 'tests/typ/math/alignment.typ')
| -rw-r--r-- | tests/typ/math/alignment.typ | 79 |
1 files changed, 72 insertions, 7 deletions
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) $ |
