summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/layout/place-float-auto.pngbin0 -> 3331 bytes
-rw-r--r--tests/ref/layout/place-float-figure.pngbin0 -> 132015 bytes
-rw-r--r--tests/typ/layout/place-float-auto.typ19
-rw-r--r--tests/typ/layout/place-float-figure.typ21
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
new file mode 100644
index 00000000..f2e4ee92
--- /dev/null
+++ b/tests/ref/layout/place-float-auto.png
Binary files differ
diff --git a/tests/ref/layout/place-float-figure.png b/tests/ref/layout/place-float-figure.png
new file mode 100644
index 00000000..2cecb5ff
--- /dev/null
+++ b/tests/ref/layout/place-float-figure.png
Binary files differ
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%),
+)