How to specify enum numbering start and have it automatically reset?

Hello Guys i have the following problem.

whenever i use

#set enum( //Nummerierung 
  full:true, 
  numbering: numbly("{1:(1)}", "{2:a})")
)

for numbering my points, it does not reset by a b and c, instead it goes on with e f and g.
Is there a way to reset it like the normal numbering with start:5.

Hi! Can you share a minimal example that shows your problem. I tried to reproduce the issue with the set rule you shared but it worked as I would expect.

And please put your code inside a code block.

```typst
Your code
```

How to post in the Questions category :


== C.1~~~ Allgemeines zu MMC
#v(2mm)
Erstellen Sie wenn notwendig eine neue virtuelle Windows 11-Maschine (ein virtueller PC als #emph[Linked Clone],

#set enum( //Nummerierung 
  full: true,
  start: 5,
  numbering: numbly("{1:(1)}", "{2:a})"),
)

+ Beantworten Sie z.B. durch Internet-Recherche die folgenden Fragen zur MMC:

  + Wozu dient die MMC? 
  + Was ist ein _Snap-in_?
  + Nennen Sie zwei Beispiele vorgefertigter System-Tools, welche die MMC nutzen!

for example i have this number 5 and then i have to use start at 5 because it resets to 1 again after using plain text between the numbering and when i start at 5 the abc numbering also starts at 5 is there a way to prevent that or any other way to solve this problem

You should use an explicit numbering instead of enum sugar syntax. Or indent the parts in-between enum items.

#import "@preview/numbly:0.1.0": numbly
#set enum(full: true, numbering: numbly("{1:(1)}", "{2:a})"))
// #set heading(numbering: (..n) => numbering("A.1", ..n) + h(0.7em))
#set heading(numbering: "A.1   ")

= Heading
= Heading
= Heading

== Allgemeines zu MMC
#v(2mm)
Erstellen Sie wenn notwendig eine neue virtuelle Windows 11-Maschine (ein
virtueller PC als _Linked Clone_,

5. Beantworten Sie z.B. durch Internet-Recherche die folgenden Fragen zur MMC:
  + Wozu dient die MMC?
  + Was ist ein _Snap-in_?
  + Nennen Sie zwei Beispiele vorgefertigter System-Tools, welche die MMC
    nutzen!

#lorem(50)

6. #lorem(10)

  #lorem(50)

+ #lorem(10)

thanks but i dont mean the heading i mean the points under the heading

@Andrew used an explicit number to set the correct number for the questions. From the documentation:

Starting a line with a number followed by a dot creates an explicitly numbered enumeration item.

1 Like

You can also define a custom counter to keep track of the current. A quick example:

#import "@preview/numbly:0.1.0": *

#let q-counter = counter("question")
#let question(body) = {
  set enum(
    full: true,
    numbering: numbly("{1:(1)}", "{2:a})")
  )
  q-counter.step()
  context enum(
    start: q-counter.get().first(), 
    body
  )
}

#question[
Frage
]


#question[
Frage
]

Erstellen Sie wenn notwendig eine neue virtuelle Windows 11-Maschine (ein virtueller PC als #emph[Linked Clone],


#question[
Beantworten Sie z.B. durch Internet-Recherche die folgenden Fragen zur MMC:
  + Wozu dient die MMC? 
  + Was ist ein _Snap-in_?
  + Nennen Sie zwei Beispiele vorgefertigter System-Tools, welche die MMC nutzen!
]

@Andrew it’d be appreciated if you could add an explanation (even if brief) to your answers instead of just pasting links and/or code. Doing that and expecting the poster - who might not be as experienced with Typst as you - to understand what changed or what it means caused this confusion (and, frankly, I also had to look around a bit to see what it was). Thanks!

@Mert_Karavin the problem was that you used set enum(start: 5) which sets the start of all enums to 5, at any level. By writing 5. abc instead of + abc, you get this for only one enum instead, compared to using the set rule. That’s what Andrew was trying to convey. Hope that clarifies it now!

(Addendum: I’ve changed your post’s title to a question as per our guidelines linked by Andrew earlier. Please keep this in mind in the future :slight_smile:)

Thank you very much guys but i have a new question conserning numbering in typst.

with the code provided from the top i was able to number most things however i encoutered following problem

when this is my code

#let q-counter = counter("count")
#let count(body) = {
  set enum(
    full: true,
    numbering: numbly("{1:(1)}", "{2:a})", "{3:i}", "{4:1.}"),
  )
  q-counter.step()
  context enum(
    start: q-counter.get().first(), 
    body
  )
}

Your code does not produce the output on the screenshot.

I don’t see any problem aside from not understanding the text. Can you elaborate?