summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-07-10 18:16:59 +0200
committerLaurenz <laurmaedje@gmail.com>2023-07-10 18:16:59 +0200
commit78f96f844bc54c5385c1efda0b5faad3c49fa79b (patch)
tree3231348e9656b4514e8fb66c9a4df91f27ad685f /tests/typ
parent0e8492eac1606edba86748c4de547a2c758cd232 (diff)
Basic floating placement
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/layout/place-float-auto.typ19
-rw-r--r--tests/typ/layout/place-float-figure.typ21
2 files changed, 40 insertions, 0 deletions
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%),
+)