summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-01-23 12:50:51 +0100
committerGitHub <noreply@github.com>2025-01-23 11:50:51 +0000
commit52ee33a275063369673d8802fb820db3825a661f (patch)
treee4f8ca45e7b9efd608babba5aed85042f8994a08 /tests
parent1bd8ff0e0fa7966f4bd2a4426241781bed168df7 (diff)
Rework outline (#5735)
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/heading-hanging-indent-auto.pngbin0 -> 849 bytes
-rw-r--r--tests/ref/heading-hanging-indent-length.pngbin0 -> 1396 bytes
-rw-r--r--tests/ref/heading-hanging-indent-zero.pngbin0 -> 859 bytes
-rw-r--r--tests/ref/issue-1041-smartquotes-in-outline.pngbin3467 -> 3412 bytes
-rw-r--r--tests/ref/issue-2048-outline-multiline.pngbin0 -> 1634 bytes
-rw-r--r--tests/ref/issue-4476-outline-rtl-title-ending-in-ltr-text.pngbin0 -> 3341 bytes
-rw-r--r--tests/ref/issue-4476-rtl-title-ending-in-ltr-text.pngbin6307 -> 0 bytes
-rw-r--r--tests/ref/issue-4859-outline-entry-show-set.pngbin0 -> 749 bytes
-rw-r--r--tests/ref/issue-5176-cjk-title.pngbin1246 -> 0 bytes
-rw-r--r--tests/ref/issue-5176-outline-cjk-title.pngbin0 -> 1218 bytes
-rw-r--r--tests/ref/issue-5370-figure-caption-separator-outline.pngbin2078 -> 0 bytes
-rw-r--r--tests/ref/issue-622-hide-meta-outline.pngbin2109 -> 2061 bytes
-rw-r--r--tests/ref/issue-785-cite-locate.pngbin9191 -> 9441 bytes
-rw-r--r--tests/ref/outline-bookmark.pngbin1030 -> 474 bytes
-rw-r--r--tests/ref/outline-entry-complex.pngbin14460 -> 8461 bytes
-rw-r--r--tests/ref/outline-entry-inner.pngbin0 -> 462 bytes
-rw-r--r--tests/ref/outline-entry.pngbin10099 -> 5890 bytes
-rw-r--r--tests/ref/outline-first-line-indent.pngbin10837 -> 5539 bytes
-rw-r--r--tests/ref/outline-heading-start-of-page.pngbin0 -> 6935 bytes
-rw-r--r--tests/ref/outline-indent-auto-mixed-prefix-short.pngbin0 -> 1045 bytes
-rw-r--r--tests/ref/outline-indent-auto-mixed-prefix.pngbin0 -> 5712 bytes
-rw-r--r--tests/ref/outline-indent-auto-no-prefix.pngbin0 -> 3101 bytes
-rw-r--r--tests/ref/outline-indent-auto.pngbin0 -> 5176 bytes
-rw-r--r--tests/ref/outline-indent-fixed.pngbin0 -> 3018 bytes
-rw-r--r--tests/ref/outline-indent-func.pngbin0 -> 2884 bytes
-rw-r--r--tests/ref/outline-indent-no-numbering.pngbin2924 -> 0 bytes
-rw-r--r--tests/ref/outline-indent-numbering.pngbin7101 -> 0 bytes
-rw-r--r--tests/ref/outline-indent-zero.pngbin0 -> 3465 bytes
-rw-r--r--tests/ref/outline-spacing.pngbin0 -> 2553 bytes
-rw-r--r--tests/ref/outline-styled-text.pngbin1481 -> 1416 bytes
-rw-r--r--tests/ref/outline.pngbin6743 -> 0 bytes
-rw-r--r--tests/ref/query-running-header.pngbin9302 -> 9064 bytes
-rw-r--r--tests/suite/model/figure.typ6
-rw-r--r--tests/suite/model/heading.typ12
-rw-r--r--tests/suite/model/outline.typ296
35 files changed, 218 insertions, 96 deletions
diff --git a/tests/ref/heading-hanging-indent-auto.png b/tests/ref/heading-hanging-indent-auto.png
new file mode 100644
index 00000000..823feb14
--- /dev/null
+++ b/tests/ref/heading-hanging-indent-auto.png
Binary files differ
diff --git a/tests/ref/heading-hanging-indent-length.png b/tests/ref/heading-hanging-indent-length.png
new file mode 100644
index 00000000..e371674e
--- /dev/null
+++ b/tests/ref/heading-hanging-indent-length.png
Binary files differ
diff --git a/tests/ref/heading-hanging-indent-zero.png b/tests/ref/heading-hanging-indent-zero.png
new file mode 100644
index 00000000..659ddbef
--- /dev/null
+++ b/tests/ref/heading-hanging-indent-zero.png
Binary files differ
diff --git a/tests/ref/issue-1041-smartquotes-in-outline.png b/tests/ref/issue-1041-smartquotes-in-outline.png
index 19a78ac6..00c276c1 100644
--- a/tests/ref/issue-1041-smartquotes-in-outline.png
+++ b/tests/ref/issue-1041-smartquotes-in-outline.png
Binary files differ
diff --git a/tests/ref/issue-2048-outline-multiline.png b/tests/ref/issue-2048-outline-multiline.png
new file mode 100644
index 00000000..0ecc2d80
--- /dev/null
+++ b/tests/ref/issue-2048-outline-multiline.png
Binary files differ
diff --git a/tests/ref/issue-4476-outline-rtl-title-ending-in-ltr-text.png b/tests/ref/issue-4476-outline-rtl-title-ending-in-ltr-text.png
new file mode 100644
index 00000000..c7c359a1
--- /dev/null
+++ b/tests/ref/issue-4476-outline-rtl-title-ending-in-ltr-text.png
Binary files differ
diff --git a/tests/ref/issue-4476-rtl-title-ending-in-ltr-text.png b/tests/ref/issue-4476-rtl-title-ending-in-ltr-text.png
deleted file mode 100644
index 94d06f1a..00000000
--- a/tests/ref/issue-4476-rtl-title-ending-in-ltr-text.png
+++ /dev/null
Binary files differ
diff --git a/tests/ref/issue-4859-outline-entry-show-set.png b/tests/ref/issue-4859-outline-entry-show-set.png
new file mode 100644
index 00000000..33ff442d
--- /dev/null
+++ b/tests/ref/issue-4859-outline-entry-show-set.png
Binary files differ
diff --git a/tests/ref/issue-5176-cjk-title.png b/tests/ref/issue-5176-cjk-title.png
deleted file mode 100644
index e904fbd7..00000000
--- a/tests/ref/issue-5176-cjk-title.png
+++ /dev/null
Binary files differ
diff --git a/tests/ref/issue-5176-outline-cjk-title.png b/tests/ref/issue-5176-outline-cjk-title.png
new file mode 100644
index 00000000..a206f92c
--- /dev/null
+++ b/tests/ref/issue-5176-outline-cjk-title.png
Binary files differ
diff --git a/tests/ref/issue-5370-figure-caption-separator-outline.png b/tests/ref/issue-5370-figure-caption-separator-outline.png
deleted file mode 100644
index a9b0d06e..00000000
--- a/tests/ref/issue-5370-figure-caption-separator-outline.png
+++ /dev/null
Binary files differ
diff --git a/tests/ref/issue-622-hide-meta-outline.png b/tests/ref/issue-622-hide-meta-outline.png
index 6d8702b4..d627e088 100644
--- a/tests/ref/issue-622-hide-meta-outline.png
+++ b/tests/ref/issue-622-hide-meta-outline.png
Binary files differ
diff --git a/tests/ref/issue-785-cite-locate.png b/tests/ref/issue-785-cite-locate.png
index 5240aa77..d387ed0d 100644
--- a/tests/ref/issue-785-cite-locate.png
+++ b/tests/ref/issue-785-cite-locate.png
Binary files differ
diff --git a/tests/ref/outline-bookmark.png b/tests/ref/outline-bookmark.png
index 66e5329d..83c74444 100644
--- a/tests/ref/outline-bookmark.png
+++ b/tests/ref/outline-bookmark.png
Binary files differ
diff --git a/tests/ref/outline-entry-complex.png b/tests/ref/outline-entry-complex.png
index d0491179..d2ad49e7 100644
--- a/tests/ref/outline-entry-complex.png
+++ b/tests/ref/outline-entry-complex.png
Binary files differ
diff --git a/tests/ref/outline-entry-inner.png b/tests/ref/outline-entry-inner.png
new file mode 100644
index 00000000..5376c996
--- /dev/null
+++ b/tests/ref/outline-entry-inner.png
Binary files differ
diff --git a/tests/ref/outline-entry.png b/tests/ref/outline-entry.png
index a46e483c..acaa87d4 100644
--- a/tests/ref/outline-entry.png
+++ b/tests/ref/outline-entry.png
Binary files differ
diff --git a/tests/ref/outline-first-line-indent.png b/tests/ref/outline-first-line-indent.png
index e40b4409..e3341295 100644
--- a/tests/ref/outline-first-line-indent.png
+++ b/tests/ref/outline-first-line-indent.png
Binary files differ
diff --git a/tests/ref/outline-heading-start-of-page.png b/tests/ref/outline-heading-start-of-page.png
new file mode 100644
index 00000000..e6dbbb5f
--- /dev/null
+++ b/tests/ref/outline-heading-start-of-page.png
Binary files differ
diff --git a/tests/ref/outline-indent-auto-mixed-prefix-short.png b/tests/ref/outline-indent-auto-mixed-prefix-short.png
new file mode 100644
index 00000000..4b8c7107
--- /dev/null
+++ b/tests/ref/outline-indent-auto-mixed-prefix-short.png
Binary files differ
diff --git a/tests/ref/outline-indent-auto-mixed-prefix.png b/tests/ref/outline-indent-auto-mixed-prefix.png
new file mode 100644
index 00000000..097e0bf8
--- /dev/null
+++ b/tests/ref/outline-indent-auto-mixed-prefix.png
Binary files differ
diff --git a/tests/ref/outline-indent-auto-no-prefix.png b/tests/ref/outline-indent-auto-no-prefix.png
new file mode 100644
index 00000000..e746b35b
--- /dev/null
+++ b/tests/ref/outline-indent-auto-no-prefix.png
Binary files differ
diff --git a/tests/ref/outline-indent-auto.png b/tests/ref/outline-indent-auto.png
new file mode 100644
index 00000000..53517abd
--- /dev/null
+++ b/tests/ref/outline-indent-auto.png
Binary files differ
diff --git a/tests/ref/outline-indent-fixed.png b/tests/ref/outline-indent-fixed.png
new file mode 100644
index 00000000..16df5d88
--- /dev/null
+++ b/tests/ref/outline-indent-fixed.png
Binary files differ
diff --git a/tests/ref/outline-indent-func.png b/tests/ref/outline-indent-func.png
new file mode 100644
index 00000000..b9a4948c
--- /dev/null
+++ b/tests/ref/outline-indent-func.png
Binary files differ
diff --git a/tests/ref/outline-indent-no-numbering.png b/tests/ref/outline-indent-no-numbering.png
deleted file mode 100644
index 7c3a0ec0..00000000
--- a/tests/ref/outline-indent-no-numbering.png
+++ /dev/null
Binary files differ
diff --git a/tests/ref/outline-indent-numbering.png b/tests/ref/outline-indent-numbering.png
deleted file mode 100644
index e3195f76..00000000
--- a/tests/ref/outline-indent-numbering.png
+++ /dev/null
Binary files differ
diff --git a/tests/ref/outline-indent-zero.png b/tests/ref/outline-indent-zero.png
new file mode 100644
index 00000000..e85cba48
--- /dev/null
+++ b/tests/ref/outline-indent-zero.png
Binary files differ
diff --git a/tests/ref/outline-spacing.png b/tests/ref/outline-spacing.png
new file mode 100644
index 00000000..897a5f74
--- /dev/null
+++ b/tests/ref/outline-spacing.png
Binary files differ
diff --git a/tests/ref/outline-styled-text.png b/tests/ref/outline-styled-text.png
index 89f48070..e4520d12 100644
--- a/tests/ref/outline-styled-text.png
+++ b/tests/ref/outline-styled-text.png
Binary files differ
diff --git a/tests/ref/outline.png b/tests/ref/outline.png
deleted file mode 100644
index aeb4ef32..00000000
--- a/tests/ref/outline.png
+++ /dev/null
Binary files differ
diff --git a/tests/ref/query-running-header.png b/tests/ref/query-running-header.png
index 395bc2ae..b19eec22 100644
--- a/tests/ref/query-running-header.png
+++ b/tests/ref/query-running-header.png
Binary files differ
diff --git a/tests/suite/model/figure.typ b/tests/suite/model/figure.typ
index 0e5db4d0..58ba2b2a 100644
--- a/tests/suite/model/figure.typ
+++ b/tests/suite/model/figure.typ
@@ -289,9 +289,3 @@ HI#footnote.entry(clearance: 2.5em)[There]
)
#c
-
---- issue-5370-figure-caption-separator-outline ---
-// Test that language-dependant caption separator is respected in outline.
-#outline(title: none, target: figure)
-#set text(lang: "ru")
-#figure(rect(), caption: [Rectangle])
diff --git a/tests/suite/model/heading.typ b/tests/suite/model/heading.typ
index 72dc4aa3..45e5b50a 100644
--- a/tests/suite/model/heading.typ
+++ b/tests/suite/model/heading.typ
@@ -97,6 +97,18 @@ comment spans lines
= Fake level 2
== Fake level 3
+--- heading-hanging-indent-auto ---
+#set heading(numbering: "1.1.a.")
+= State of the Art
+
+--- heading-hanging-indent-zero ---
+#set heading(numbering: "1.1.a.", hanging-indent: 0pt)
+= State of the Art
+
+--- heading-hanging-indent-length ---
+#set heading(numbering: "1.1.a.", hanging-indent: 2em)
+= State of the Art In Multi-Line
+
--- heading-offset-and-level ---
// Passing level directly still overrides all other set values
#set heading(numbering: "1.1", offset: 1)
diff --git a/tests/suite/model/outline.typ b/tests/suite/model/outline.typ
index a8426d6c..a755151d 100644
--- a/tests/suite/model/outline.typ
+++ b/tests/suite/model/outline.typ
@@ -1,112 +1,135 @@
---- outline ---
-#set page(height: 200pt, margin: (bottom: 20pt), numbering: "1")
-#set heading(numbering: "(1/a)")
-#show heading.where(level: 1): set text(12pt)
-#show heading.where(level: 2): set text(10pt)
+--- outline-spacing ---
+#set heading(numbering: "1.a.")
+#set outline.entry(fill: none)
+#show outline.entry.where(level: 1): set block(above: 1.2em)
-#outline(fill: none)
+#outline()
+#show heading: none
= A
-= B
-#lines(3)
+== B
+== C
+= D
+== E
-// This heading is right at the start of the page, so that we can test
-// whether the tag migrates properly.
-#[
- #set heading(outlined: false)
- == C
-]
+--- outline-indent-auto ---
+#set heading(numbering: "I.i.")
+#set page(width: 150pt)
+#show heading: none
-A
+#context test(outline.indent, auto)
+#outline()
+= A
+== B
+== C
== D
+=== Title that breaks across lines
+= E
== F
-==== G
+=== Aligned
---- outline-styled-text ---
-#outline(title: none)
+--- outline-indent-auto-mixed-prefix ---
+#show heading: none
+#show outline.entry.where(level: 1): strong
-= #text(blue)[He]llo
+#outline()
---- outline-bookmark ---
-#outline(title: none, fill: none)
+#set heading(numbering: "I.i.")
+= A
+== B
+=== Title that breaks
+= C
+== D
+= E
+#[
+ #set heading(numbering: none)
+ = F
+ == Numberless title that breaks
+ === G
+]
+= H
+
+--- outline-indent-auto-mixed-prefix-short ---
+#show heading: none
+
+#outline()
+
+#set heading(numbering: "I.i.")
+= A
+#set heading(numbering: none)
+= B
+
+--- outline-indent-auto-no-prefix ---
+#show heading: none
+
+#outline()
-// Ensure 'bookmarked' option doesn't affect the outline
-#set heading(numbering: "(I)", bookmarked: false)
= A
+== B
+=== Title that breaks across lines
+= C
+== D
+=== E
---- outline-indent-numbering ---
-// With heading numbering
-#set page(width: 200pt)
+--- outline-indent-zero ---
#set heading(numbering: "1.a.")
#show heading: none
-#set outline(fill: none)
-#context test(outline.indent, none)
-#outline(indent: none)
-#outline(indent: auto)
-#outline(indent: 2em)
-#outline(indent: n => ([-], [], [==], [====]).at(n))
+#outline(indent: 0pt)
= A
== B
-== C
-=== D
-==== E
+=== C
+==== Title that breaks across lines
+#set heading(numbering: none)
+== E
+= F
---- outline-indent-no-numbering ---
-// Without heading numbering
-#set page(width: 200pt)
+--- outline-indent-fixed ---
+#set heading(numbering: "1.a.")
#show heading: none
-#set outline(fill: none)
-#outline(indent: none)
-#outline(indent: auto)
-#outline(indent: n => 2em * n)
+#outline(indent: 1em)
-= About
-== History
+= A
+== B
+=== C
+==== Title that breaks
+#set heading(numbering: none)
+== E
+= F
---- outline-indent-bad-type ---
-// Error: 2-35 expected relative length or content, found dictionary
-#outline(indent: n => (a: "dict"))
+--- outline-indent-func ---
+#set heading(numbering: "1.a.")
+#show heading: none
-= Heading
+#outline(indent: n => (0pt, 1em, 2.5em, 3em).at(n))
---- outline-first-line-indent ---
-#set par(first-line-indent: 1.5em)
-#set heading(numbering: "1.1.a.")
-#show outline.entry.where(level: 1): it => {
- v(0.5em, weak: true)
- strong(it)
-}
+= A
+== B
+=== C
+==== Title breaks
+#set heading(numbering: none)
+== E
+= F
-#outline()
+--- outline-indent-bad-type ---
+// Error: 2-35 expected relative length, found dictionary
+#outline(indent: n => (a: "dict"))
-= Introduction
-= Background
-== History
-== State of the Art
-= Analysis
-== Setup
+= Heading
--- outline-entry ---
#set page(width: 150pt)
#set heading(numbering: "1.")
-#show outline.entry.where(
- level: 1
-): it => {
- v(12pt, weak: true)
- strong(it)
-}
+#show outline.entry.where(level: 1): set block(above: 12pt)
+#show outline.entry.where(level: 1): strong
#outline(indent: auto)
-#v(1.2em, weak: true)
-
-#set text(8pt)
-#show heading: set block(spacing: 0.65em)
+#show heading: none
= Introduction
= Background
== History
@@ -117,20 +140,23 @@ A
--- outline-entry-complex ---
#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)
-]
+
+#set outline.entry(fill: repeat[--])
+#show outline.entry.where(level: 1): it => link(
+ it.element.location(),
+ it.indented(it.prefix(), {
+ emph(it.body())
+ [ ]
+ text(luma(100), box(width: 1fr, repeat[--·--]))
+ [ ]
+ it.page()
+ })
+)
#counter(page).update(3)
-#outline(indent: auto, fill: repeat[--])
-#v(1.2em, weak: true)
+#outline()
-#set text(8pt)
-#show heading: set block(spacing: 0.65em)
+#show heading: none
= Top heading
== Not top heading
@@ -145,30 +171,120 @@ A
== Middle heading
=== Lower heading
+--- outline-entry-inner ---
+#set heading(numbering: "1.")
+#show outline.entry: it => block(it.inner())
+#show heading: none
+
+#set outline.entry(fill: repeat[ -- ])
+#outline()
+
+= A
+= B
+
+--- outline-heading-start-of-page ---
+#set page(width: 140pt, height: 200pt, margin: (bottom: 20pt), numbering: "1")
+#set heading(numbering: "(1/a)")
+#show heading.where(level: 1): set text(12pt)
+#show heading.where(level: 2): set text(10pt)
+
+#set outline.entry(fill: none)
+#outline()
+
+= A
+= B
+#lines(3)
+
+// This heading is right at the start of the page, so that we can test
+// whether the tag migrates properly.
+#[
+ #set heading(outlined: false)
+ == C
+]
+
+A
+
+== D
+== F
+==== G
+
+--- outline-bookmark ---
+// Ensure that `bookmarked` option doesn't affect the outline
+#set heading(numbering: "(I)", bookmarked: false)
+#set outline.entry(fill: none)
+#show heading: none
+#outline()
+
+= A
+
+--- outline-styled-text ---
+#outline(title: none)
+
+= #text(blue)[He]llo
+
+--- outline-first-line-indent ---
+#set par(first-line-indent: 1.5em)
+#set heading(numbering: "1.1.a.")
+#show outline.entry.where(level: 1): strong
+
+#outline()
+
+#show heading: none
+= Introduction
+= Background
+== History
+== State of the Art
+= Analysis
+== Setup
+
--- outline-bad-element ---
// Error: 2-27 cannot outline metadata
#outline(target: metadata)
#metadata("hello")
+
+--- issue-2048-outline-multiline ---
+// Without the word joiner between the dots and the page number,
+// the page number would be alone in its line.
+#set page(width: 125pt)
+#set heading(numbering: "1.a.")
+#show heading: none
+
+#outline()
+
+= A
+== This just fits here
+
--- issue-2530-outline-entry-panic-text ---
// Outline entry (pre-emptive)
-// Error: 2-48 cannot outline text
-#outline.entry(1, [Hello], [World!], none, [1])
+// Error: 2-27 cannot outline text
+#outline.entry(1, [Hello])
--- issue-2530-outline-entry-panic-heading ---
// Outline entry (pre-emptive, improved error)
-// Error: 2-55 heading must have a location
-// Hint: 2-55 try using a query or a show rule to customize the outline.entry instead
-#outline.entry(1, heading[Hello], [World!], none, [1])
+// Error: 2-34 heading must have a location
+// Hint: 2-34 try using a show rule to customize the outline.entry instead
+#outline.entry(1, heading[Hello])
---- issue-4476-rtl-title-ending-in-ltr-text ---
+--- issue-4476-outline-rtl-title-ending-in-ltr-text ---
#set text(lang: "he")
#outline()
+#show heading: none
= הוקוס Pocus
= זוהי כותרת שתורגמה על ידי מחשב
---- issue-5176-cjk-title ---
+--- issue-4859-outline-entry-show-set ---
+#set heading(numbering: "1.a.")
+#show outline.entry.where(level: 1): set outline.entry(fill: none)
+#show heading: none
+
+#outline()
+
+= A
+== B
+
+--- issue-5176-outline-cjk-title ---
#set text(font: "Noto Serif CJK SC")
#show heading: none