mirror of
https://github.com/C0ffeeCode/typst-dhbw-technik-template.git
synced 2025-12-28 13:22:20 +01:00
Add automatic pagebreak on top-level headers
This commit is contained in:
parent
fd9f81e7b4
commit
fba4a1f643
3 changed files with 21 additions and 19 deletions
Binary file not shown.
36
template.typ
36
template.typ
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue