#page break before headings
14 messages · Page 1 of 1 (latest)
try this:
show heading: it => {
if it.level == 1 {
pagebreak()
}
it
}
?render
#show heading: it => {
if it.level == 1 {
pagebreak()
}
it
}
here wie are with text before heading
The render engine does not render multiple Pages, should Note that it skips 2 Pages
= Heading
== SubHeading
= Heading
Note: 2 more pages ignored
^ try this, maybe this is a problem with the https://typst.app ?
it works locally and with @void plaza
works here as well: https://typst.app/project/rVuhf8Dk3j2HlUAdup_VvA
ah, you want to write this in a template file not in the main file
?render ```#let tmpl() = {
show heading: it => {
if it.level == 1 {
pagebreak()
}
it.body
}
}
#tmpl()
= Heading
== SubHeading
= Heading```
because the pagebreak is in a different container as you mentioned.