I would like to have page 1 start from chapter 1, but it seems impossible. I don’t know how to set it up given the formatting of the document I want. Everything is fine, except for that detail. Could someone explain it to me?
You have included your code in code blocks which is great, but the language in this case should be typ:
```typ
//Your code goes here
```
The code you have provided does not compile. It takes more effort to help you if each person that attempts to do so must work around missing pieces. Your code as it has been posted has these two issues:
main.typ does not import template.typ so the functions called don’t exist in that scope
Neither of the chapters included in main.typ have been given. Using lorem() is handy for these kinds of MWE.
Then, can’t make automatic page break inside formatting function:
#let document-template(body) = {
show link: set text(fill: blue)
set text(font: "Source Sans Pro", size: 16pt, hyphenate: true)
set par(justify: true)
set figure.caption(position: bottom)
counter(page).update(1)
set page(numbering: "1")
// Ativa numeração para capítulos, seções e subseções
set heading(numbering: "1.1")
// Personaliza os headings por nível
show heading: it => {
if it.level == 1 {
text(size: 28pt, weight: "bold")[#it]
v(0.5cm)
} else if it.level == 2 {
text(size: 24pt, weight: "bold")[#it]
v(0.3cm)
} else if it.level == 3 {
text(size: 20pt, weight: "bold")[#it]
v(0.2cm)
} else {
// Outros níveis (se houver)
it
}
}
body
}
Hi @Rafael_Bluhm, first of all welcome and thanks for editing your post as indicated!
If you’re satisfied with your solution, be sure to give it a checkmark , this will help others find the solution in the future. If not, you can describe what you’re missing from your solution, or ask a new question focused on the remaining problem. Thanks!