the outline title is adopting this behavior by default. it will pagebreak before and after the title, so the entries will be in the next page. how to disable this? and is this intended behavior ?
When including the if it.level == 1 in the body of the show rule, any heading with a higher level will not be shown at all, as the show rule returns none for them. You should instead use a where-selector as in
#show heading.where(level: 1): it => ...
A normal pagebreak may create an unwanted empty page when the previous page is already empty. You maybe want to set the weak parameter to prevent that.
#show outline: it => {
state("in-outline").update(true)
it
state("in-outline").update(false)
}
#show heading.where(depth: 1): it => {
if not state("in-outline", false).get() {
pagebreak(weak: true)
}
it
}
Although I think the outline title should not adopt behavior from the level one heading. as for your suggestion of using the where selector (which I’m thankful for), I have 6 levels of headings defined and default behavior for anything above that in my template, and the normal function seems to work best for me in such a case.