Add automatic pagebreak on top-level headers

This commit is contained in:
Laurenz 2024-03-11 19:57:27 +01:00
parent fd9f81e7b4
commit fba4a1f643
No known key found for this signature in database
GPG key ID: FF04836F2CF8C139
3 changed files with 21 additions and 19 deletions

Binary file not shown.

View file

@ -108,22 +108,28 @@
// modify the spacing between various headings and the content below them
#show heading: it => {
let sizes = if it.level == 1 {
(64pt, 24pt, 24pt)
} else if it.level == 2 {
(32pt, 20pt, 18pt)
} else {
(24pt, 16pt, 14pt)
}
let sizes = if it.level == 1 {
(64pt, 24pt, 24pt)
} else if it.level == 2 {
(32pt, 20pt, 18pt)
} else {
(24pt, 16pt, 14pt)
}
[
#set text(size: sizes.at(2))
#v(sizes.at(0))
#if it.numbering != none [
#counter(heading).display(it.numbering) #h(4pt) #it.body
] else [#it.body]
#v(sizes.at(1))
]
// On top-level headers, do a weak pagebreak
// (weak = no pagebreak on already blank pages)
if it.level == 1 {
pagebreak(weak: true)
}
[
#set text(size: sizes.at(2))
#v(sizes.at(0))
#if it.numbering != none [
#counter(heading).display(it.numbering) #h(4pt) #it.body
] else [#it.body]
#v(sizes.at(1))
]
}
// Alternative formating for headdings
// #show heading: it => {

View file

@ -18,9 +18,6 @@
// - 25-35 pages without directories und attachments
// incl. graphics and tables
// - must document: task, process of implementation, solutions and results
// - proof that a connection between theoretical and practical was made
// and that the holy theory taught by the DHBW is of relevance
// - No
= Introduction
@ -35,7 +32,6 @@
You can use #link("https://github.com/crate-ci/typos")[Typos],
but I am too lazy to explain.
#pagebreak()
= Summary and Conclusion
#lorem(100)