I asked the same question 17 days ago, unfortunately I got sick and totally forgot about it by the time a user noticed me that my explanation wasn’t that clear. I decided to open a new post before rewriting entirely the question.
So, what I’m trying to do is to create a new header for chapters, which I want to place the highest on the header’s hierarchy but without getting rid of any of the default ones.
Right now my workaround is a function that draws the title of the chapter and somehow manages to place it on the index.
let chapter(title: "No title", body) = {
counter(heading).update(0)
show figure: set place(center+horizon)
show figure.caption: strong
show figure.caption: set text(40pt)
set figure.caption(position: top)
pagebreak(weak: true)
place(center+horizon)[#figure(
kind: "chapter",
numbering: "I",
supplement: "Chapter",
outlined: true,
placement: bottom,
gap: 150pt,
caption: [\ #title],
[#body]
)]
pagebreak(weak: true)
}
My problem with it is that the webapp UI doesn’t detect it as a proper header, hence it doesn’t show it on the outline (left panel).
I had the idea that if I could somehow move every header one spot down in the hierarchy, I could redefine the first one (=
) as my personalized chapter header.
Does anyone know a better way to do it than manually reformatting every header?
// What I've got
= Header 1
== Header 2
=== Header 3
==== Header 4
...
// What I'd like
= Chapter Header
== Header 1
=== Header 2
==== Header 3
===== Header 4
...
PS: Is it me or preformatted text isn’t Typst?