Why can't I write level 3 headings?

Hi,

When I try to write a paragraph title using ===, I raise this error :
*

I think the problem comes from one of the packages great theorems or rich-counter, because of this :

// `at` method for this rich-counter
 let at(key) = {
   // get inherited numbers
   let num_parent = (parent_rhcntr.at)(key)
   while num_parent.len() < inherited_levels { num_parent.push(0) }
   while num_parent.len() > inherited_levels { num_parent.pop() }

   // get numbers of own partial counter
   let updates = updates_during((parent_rhcntr.last_update_location)(inherited_levels, key), key)
   let num_self = compute_counter(updates)

   return num_parent + num_self
 }

Does anyone know how to solve it ?

Thanks in advance !

As a first guess (otherwise, please copy and paste in more of the code), .pop() is returning a value and it’s being joined in as a part of the result of the at function.

Do this to explicitly discard the return value from pop, I don’t think you are using it:

let _ = num_parent.pop()
1 Like

Nice guess, it works perfectly. Thanks a lot !

I just had a look and found this: Error when level of subsections more than `inherited_levels` · Issue #4 · jbirnick/typst-rich-counters · GitHub

If you upgrade rich-counters to 0.2.2, this should go away too!

1 Like