How do I make the second level heading start from "I" (1)

Hey, working on my bachelors thesis template I got to a problem. I need to start a new Counter in my Attachments, but I cant make it start from One. Insted it always starts from 2 (in roman numbers). Attached a screenshot from the table of Contents (Look at “Anhang - Temperaturdiagramme”) and my code for the “Anhang” Page.

#v(25pt)
#set heading(numbering: none)
= Anhang
#counter(heading).update(1)

#heading(numbering: "I", level: 2)[Temperaturdiagramme]

#pagebreak()

It’s a classic Roman trap. You need to exclude the first level heading number from the numbering:

meme

#outline()

#set heading(numbering: none)
// #show heading.where(level: 2): set heading(numbering: "1.1.")
#show heading.where(level: 2): set heading(
  numbering: (..n) => numbering("I", n.pos().last()),
)

= Anhang
// #counter(heading).update(1)
== Temperaturdiagramme

1 Like

Thank you so much!

@Andrew’s solution is perfectly fine and does solve the exact question. If multiple heading levels should be supported, the solution is a bit cumbersome.
A more general solution would be to generally remove the first heading number.

#set heading(numbering: (_,..rest) => numbering("I.a", ..rest))
// needed to remove the space between the number and the heading 
#show heading.where(level: 1): set heading(numbering: none)

= Anhang
== Temperaturdiagramme
=== Temperaturdiagramm 1
=== Temperaturdiagramm 2

2 Likes

Dammit, I forgot about this trick again