Hello everyone,
Getting back to typst after a while off. I may be rusty and missing something absolutely obvious.
I’m typesetting a book with numbered parts and numbered chapters, but both are separate sequences (i.e. the first chapter of Part 2 is chapter 6, not 2.1).
However, as of now, the first level displays fine, but the first chapter is displayed as “Chapter 11” or “Chapter 1.1.” depending on where I’m messing with. And I would like to have it displayed as “Chapter 1” :
Currently, I have these show rules for the outline:
#show outline.entry.where(level: 1): it => link(
//text(font:"Josefin Sans")[],
it.element.location(),
it.indented(
if it.element.numbering != none {
"Partie " + numbering("1.", ..counter(heading).at(it.element.location()))
} else {it.prefix()},
it.body()
),
)
#show outline.entry.where(level: 2): it => link(
it.element.location(),
it.indented(
if it.element.numbering != none {
"Chapitre " + numbering("1.", ..counter(heading).at(it.element.location()))
} else {it.prefix()},
it.inner()
),
)
And for the text:
#show heading.where(level: 1): it => {
pagebreak(weak: true)
set align(right)
set par(justify: false)
v(20%)
block(below:2em)[
#text(font:"Josefin Sans", size: 18pt, weight: "regular", {
if heading.numbering != none [
Partie #counter(heading).display()]})
#v(-.5em)
#line(length: 100%, stroke:1pt)
#v(.5em)
#text(font:"Josefin Sans",size: 24pt, weight: "regular",)[#it.body]
]
}
#show heading.where(level: 2): it => {
pagebreak(weak: true)
set align(center)
v(20%)
block(below:2em)[
#text(size: 12pt, weight: "regular", {
if heading.numbering != none [
_Chapitre #counter(heading).display()_ \ ]})
#text(size: 18pt, weight: "regular",)[#emph[#it.body]]
]
}
The “Partie” and “Chapitre” parts are handled in the rules for the sake of the layout.
How do I ensure the two numbering sequences stay decorrelated, both in the text and in the outline (and in the header, but I think fixing the former two will solve that) ? Where did I mess up ?
Thanks in advance for your replies!
EDIT: Forgot to mention. Maybe numbly could help with my case, but is it still compatible ? I see it has not been update for 2 years.







