diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-11-23 12:45:20 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-11-23 12:45:20 +0100 |
| commit | 4f9e5819bbab1f93ad4f4b789038c60487a76368 (patch) | |
| tree | 488a4e0422db4531d9882cf08f0b5cc21ae55a23 /tests/typ/layout | |
| parent | d3f6040cedacad1b6c323be721c9086f6c5d9a44 (diff) | |
2d alignments with plus operator
Diffstat (limited to 'tests/typ/layout')
| -rw-r--r-- | tests/typ/layout/align.typ | 16 | ||||
| -rw-r--r-- | tests/typ/layout/background.typ | 2 | ||||
| -rw-r--r-- | tests/typ/layout/move.typ | 2 | ||||
| -rw-r--r-- | tests/typ/layout/page.typ | 4 | ||||
| -rw-r--r-- | tests/typ/layout/placed.typ | 2 |
5 files changed, 20 insertions, 6 deletions
diff --git a/tests/typ/layout/align.typ b/tests/typ/layout/align.typ index c41e0cb4..4a50d3dc 100644 --- a/tests/typ/layout/align.typ +++ b/tests/typ/layout/align.typ @@ -7,7 +7,7 @@ align(center, square(size: 20pt, fill: eastern)), align(right, square(size: 15pt, fill: eastern)), ) -#align(center, horizon, rect(fill: eastern, height: 10pt)) +#align(center + horizon, rect(fill: eastern, height: 10pt)) #align(bottom, stack( align(center, rect(fill: conifer, height: 10pt)), rect(fill: forest, height: 10pt), @@ -19,3 +19,17 @@ Dolor ] + +--- +// Ref: false +#test(type(center), "alignment") +#test(type(horizon), "alignment") +#test(type(center + horizon), "2d alignment") + +--- +// Error: 8-22 cannot add two horizontal alignments +#align(center + right, [A]) + +--- +// Error: 8-20 cannot add two vertical alignments +#align(top + bottom, [A]) diff --git a/tests/typ/layout/background.typ b/tests/typ/layout/background.typ index 81c8c99d..6303a83b 100644 --- a/tests/typ/layout/background.typ +++ b/tests/typ/layout/background.typ @@ -13,6 +13,6 @@ height: 100% + 20pt, ) ) -#align(bottom, right)[ +#align(bottom + right)[ _Welcome to_ #underline[*Tigerland*] ] diff --git a/tests/typ/layout/move.typ b/tests/typ/layout/move.typ index a7cdf368..c1f97e15 100644 --- a/tests/typ/layout/move.typ +++ b/tests/typ/layout/move.typ @@ -2,7 +2,7 @@ #let tex = [{ [T] h(-0.14 * size) - move(dy: 0.22 * size)[E] + move(y: 0.22 * size)[E] h(-0.12 * size) [X] }] diff --git a/tests/typ/layout/page.typ b/tests/typ/layout/page.typ index 1f707327..dc6c7c81 100644 --- a/tests/typ/layout/page.typ +++ b/tests/typ/layout/page.typ @@ -9,8 +9,8 @@ // Set all margins at once. [ #page(margins: 5pt) - #place(top, left)[TL] - #place(bottom, right)[BR] + #place(top + left)[TL] + #place(bottom + right)[BR] ] // Set individual margins. diff --git a/tests/typ/layout/placed.typ b/tests/typ/layout/placed.typ index 41431dee..da56ae2d 100644 --- a/tests/typ/layout/placed.typ +++ b/tests/typ/layout/placed.typ @@ -1,5 +1,5 @@ #page("a8") -#place(bottom, center)[© Typst] +#place(bottom + center)[© Typst] = Placement #place(right, image("../../res/tiger.jpg", width: 1.8cm)) |
