diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-07-10 18:16:59 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-07-10 18:16:59 +0200 |
| commit | 78f96f844bc54c5385c1efda0b5faad3c49fa79b (patch) | |
| tree | 3231348e9656b4514e8fb66c9a4df91f27ad685f /tests | |
| parent | 0e8492eac1606edba86748c4de547a2c758cd232 (diff) | |
Basic floating placement
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/layout/place-float-auto.png | bin | 0 -> 3331 bytes | |||
| -rw-r--r-- | tests/ref/layout/place-float-figure.png | bin | 0 -> 132015 bytes | |||
| -rw-r--r-- | tests/typ/layout/place-float-auto.typ | 19 | ||||
| -rw-r--r-- | tests/typ/layout/place-float-figure.typ | 21 |
4 files changed, 40 insertions, 0 deletions
diff --git a/tests/ref/layout/place-float-auto.png b/tests/ref/layout/place-float-auto.png Binary files differnew file mode 100644 index 00000000..f2e4ee92 --- /dev/null +++ b/tests/ref/layout/place-float-auto.png diff --git a/tests/ref/layout/place-float-figure.png b/tests/ref/layout/place-float-figure.png Binary files differnew file mode 100644 index 00000000..2cecb5ff --- /dev/null +++ b/tests/ref/layout/place-float-figure.png diff --git a/tests/typ/layout/place-float-auto.typ b/tests/typ/layout/place-float-auto.typ new file mode 100644 index 00000000..799c9fc7 --- /dev/null +++ b/tests/typ/layout/place-float-auto.typ @@ -0,0 +1,19 @@ +// Test floating placement. + +--- +#set page(height: 140pt) +#set place(clearance: 5pt) +#lorem(6) +#place(auto, float: true, rect[A]) +#place(auto, float: true, rect[B]) +#place(auto, float: true, rect[C]) +#place(auto, float: true, rect[D]) + +--- +// Error: 2-20 automatic positioning is only available for floating placement +// Hint: 2-20 you can enable floating placement with `place(float: true, ..)` +#place(auto)[Hello] + +--- +// Error: 2-45 floating placement must be `auto`, `top`, or `bottom` +#place(center + horizon, float: true)[Hello] diff --git a/tests/typ/layout/place-float-figure.typ b/tests/typ/layout/place-float-figure.typ new file mode 100644 index 00000000..7256a4eb --- /dev/null +++ b/tests/typ/layout/place-float-figure.typ @@ -0,0 +1,21 @@ +// Test floating figures. + +--- +#set page(height: 250pt, width: 150pt) + += Introduction +#lorem(10) #footnote[Lots of Latin] + +#figure( + placement: bottom, + caption: [A glacier #footnote[Lots of Ice]], + image("/files/glacier.jpg", width: 80%), +) + +#lorem(40) + +#figure( + placement: top, + caption: [An important], + image("/files/diagram.svg", width: 80%), +) |
