summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorPg Biel <9021226+PgBiel@users.noreply.github.com>2023-06-12 06:50:59 -0300
committerGitHub <noreply@github.com>2023-06-12 11:50:59 +0200
commitc58a8fbd1dfedf571a47a3c8504067f6365c6cd4 (patch)
treeea95a2421a60c5a9e875caa24d4997702764a4a2 /tests/typ
parent4e4413e7beb378f02f2f2f76abde125ecdbd3c69 (diff)
Add `outline.entry` (#1423)
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/meta/outline-entry.typ60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/typ/meta/outline-entry.typ b/tests/typ/meta/outline-entry.typ
new file mode 100644
index 00000000..ac78ec2a
--- /dev/null
+++ b/tests/typ/meta/outline-entry.typ
@@ -0,0 +1,60 @@
+// Tests outline entry.
+
+---
+#set page(width: 150pt)
+#set heading(numbering: "1.")
+
+#show outline.entry.where(
+ level: 1
+): it => {
+ v(12pt, weak: true)
+ strong(it)
+}
+
+#outline(indent: auto)
+
+#set text(8pt)
+#show heading: set block(spacing: 0.65em)
+
+= Introduction
+= Background
+== History
+== State of the Art
+= Analysis
+== Setup
+
+---
+#set page(width: 150pt, numbering: "I", margin: (bottom: 20pt))
+#set heading(numbering: "1.")
+#show outline.entry.where(level: 1): it => [
+ #let loc = it.element.location()
+ #let num = numbering(loc.page-numbering(), ..counter(page).at(loc))
+ #emph(link(loc, it.body))
+ #text(luma(100), box(width: 1fr, repeat[#it.fill.body;ยท]))
+ #link(loc, num)
+]
+
+#counter(page).update(3)
+#outline(indent: auto, fill: repeat[--])
+
+#set text(8pt)
+#show heading: set block(spacing: 0.65em)
+
+= Top heading
+== Not top heading
+=== Lower heading
+=== Lower too
+== Also not top
+
+#pagebreak()
+#set page(numbering: "1")
+
+= Another top heading
+== Middle heading
+=== Lower heading
+
+---
+// Error: 2-23 cannot outline cite
+#outline(target: cite)
+#cite("arrgh", "distress", [p. 22])
+#bibliography("/works.bib")