I want these to begin a recto page (think Chapter start), so at the moment, I include the line:
#pagebreak(weak: true, to: "odd")
before each = Heading text within the text itself.
Is it possible, and if so how, to modify the #show rule to incorporate the new page command immediately before the heading, so as to obviate the need of repeating it throughout the document?
Prioritize show-set rules and keep show rules minimal/non-hacky:
#show heading.where(level: 1): set align(center)
#show heading.where(level: 1): set text(24pt, weight: "regular")
#show heading.where(level: 1): smallcaps
#show heading.where(level: 1): it => pagebreak(weak: true, to: "odd") + it
= Chapter A
#lorem(50)
= Chapter B
#lorem(50)
This is the most idiomatic way, but since show rules are used, you won’t be able to un-smallcaps or un-pagebreak level 1 heading, unless this is set inside a non-root scope. But at least all other heading features/behavior will work.
As for my code, that was based on the example given in the ‘Advanced Styling’ section of the Tutorial—with input from @PgBiel in answer to a related question! I guess one of the problems with Typst being still very much in development is that the Tutorial doesn’t get updated to match so quickly.