1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
// Test forced page breaks.
--- pagebreak ---
// Just a pagebreak.
// Should result in two pages.
#pagebreak()
--- pagebreak-around-set-page ---
// Pagebreak, empty with styles and then pagebreak
// Should result in one auto-sized page and two conifer-colored 2cm wide pages.
#pagebreak()
#set page(width: 2cm, fill: conifer)
#pagebreak()
--- pagebreak-weak-after-set-page ---
// Two text bodies separated with and surrounded by weak pagebreaks.
// Should result in two aqua-colored pages.
#set page(fill: aqua)
#pagebreak(weak: true)
First
#pagebreak(weak: true)
Second
#pagebreak(weak: true)
--- pagebreak-set-page-mixed ---
// Test a combination of pagebreaks, styled pages and pages with bodies.
// Should result in three five pages, with the fourth one being forest-colored.
#set page(width: 80pt, height: 30pt)
#[#set page(width: 60pt); First]
#pagebreak()
#pagebreak()
Third
#page(height: 20pt, fill: forest)[]
Fif#[#set page();th]
--- pagebreak-followed-by-page-call ---
// Test hard and weak pagebreak followed by page with body.
// Should result in three navy-colored pages.
#set page(fill: navy)
#set text(fill: white)
First
#pagebreak()
#page[Second]
#pagebreak(weak: true)
#page[Third]
--- pagebreak-in-container ---
#box[
// Error: 4-15 pagebreaks are not allowed inside of containers
// Hint: 4-15 try using a `#colbreak()` instead
#pagebreak()
]
--- pagebreak-weak-place ---
// After place
// Should result in three pages.
First
#pagebreak(weak: true)
#place(right)[placed A]
#pagebreak(weak: true)
Third
--- pagebreak-weak-meta ---
// After only ignorables & invisibles
// Should result in two pages.
First
#pagebreak(weak: true)
#counter(page).update(1)
#metadata("Some")
#pagebreak(weak: true)
Second
--- pagebreak-meta ---
// After only ignorables, but regular break
// Should result in three pages.
First
#pagebreak()
#counter(page).update(1)
#metadata("Some")
#pagebreak()
Third
--- pagebreak-to ---
#set page(width: 80pt, height: 30pt)
First
#pagebreak(to: "odd")
Third
#pagebreak(to: "even")
Fourth
#pagebreak(to: "even")
Sixth
#pagebreak()
Seventh
#pagebreak(to: "odd")
#page[Ninth]
--- pagebreak-to-auto-sized ---
#set page(width: auto, height: auto)
// Test with auto-sized page.
First
#pagebreak(to: "odd")
Third
--- pagebreak-to-multiple-pages ---
#set page(height: 30pt, width: 80pt)
// Test when content extends to more than one page
First
Second
#pagebreak(to: "odd")
Third
--- issue-2134-pagebreak-bibliography ---
// Test weak pagebreak before bibliography.
#pagebreak(weak: true)
#bibliography("/assets/bib/works.bib")
--- issue-2095-pagebreak-numbering ---
// The empty page 2 should not have a page number
#set page(numbering: none)
This and next page should not be numbered
#pagebreak(weak: true, to: "odd")
#set page(numbering: "1")
#counter(page).update(1)
This page should
--- issue-2162-pagebreak-set-style ---
// The styles should not be applied to the pagebreak empty page,
// it should only be applied after that.
#pagebreak(to: "even") // We should now skip to page 2
Some text on page 2
#pagebreak(to: "even") // We should now skip to page 4
#set page(fill: orange) // This sets the color of the page starting from page 4
Some text on page 4
--- issue-2591-single-weak-pagebreak ---
#pagebreak(weak: true)
--- issue-2841-pagebreak-to-weak ---
First
#pagebreak(to: "odd")
#pagebreak(weak: true)
Odd
|