you should start the state at 1. i don’t remember exactly why but yeah it’s kinda hacky so starting it at 0 gives you like an off-by-one error. but it should work, as you can see in the original example.
#let enum-level = state("enum-level", 1)
then, i think your show rule isn’t working for the top-level enum (level == 1) because what we’re basically doing is: for every enum, apply the set rule only starting from its children (not to the enum itself). given that the top-level enum isn’t inside any other enum, it’ll never have the rule applied. instead you should do just a regular set rule for the top-level, and have your show rule override this for all subsequent levels:
#set enum(indent: -5em)
#show enum: it => context {
set enum(indent: 0em) if enum-level.get() == 2
set enum(indent: 5em) if enum-level.get() == 3
it
}
that should give you this:
