I have a template file template.typ that I import into all my other .typ documents in the project. Then I have a file all.typ, which includes a chapter chapter.typ. template.typ contains a #set page() rule, that induces page breaks when chapter.typ is #included in all.typ document.
Some minimal example:
// template.typ
#let template_func(body) = {
set page(
paper: "a4",
numbering: "1",
columns: 1,
)
body
}
// chapter.typ
#import "./template.typ": template_func
#show: template_func
== One chapter of the book
Some text of this one chapter. It should directly follow the foreword without pagebreak.
// all.typ
#import "./template.typ": template_func
#show: template_func
= All chapters
Foreword for the whole book
#include "./chapter.typ"
Conclusion of the whole book - this text is page-broken, but should follow directly without break.
I narrowed the problem down to the #page function that causes those pagebreaks. Is there a way how to include chapter.typ without the extra break? Thanks a lot