Hi All
My heading style worked well in 0.13.1. However, it does not work for 0.14.0
ALL TESTS (heading 1)
EASY TESTS (heading 2)
Test 1. something (heading 3)
Test 2. something more (heading 3)
INTERMEDIATE TESTS (heading 2)
Test 3. Another test name (heading 3)
HARD TESTS (heading 2)
Test 4. Yet another test name (heading 3)
- Numbering is none for level 1 and 2
- Simple numbering for level 3, with prefix “Tests”
- Level 3 numbers remain consecutive even if a higher-level heading occurs
The code is:
#let third-heading-counter = counter("third-heading-level")
#show selector.or(heading.where(level: 1), heading.where(level: 2)): it => {
it
// Revert level 3+ resets
context {
let new-numbers = third-heading-counter.get()
counter(heading).update(if it.level == 1 {
(one, ..n) => (one, 0, ..new-numbers)
} else {
(one, two, ..n) => (one, two, ..new-numbers)
})
}
}
/* This part makes it so test number continues accross higer headers */
#show heading: it => {
if it.level >= 3 {
third-heading-counter.step(level: it.level - 2)
text(1.1em, it)
} else if it.level >= 3{
text(red, 1em, it)
}else{
it
}
}
#show heading.where(level: 1): set heading(numbering: none)
#show heading.where(level: 2): set heading(numbering: none)
// For level 3+: ignore first two numbers
#set heading(numbering: (first, second, ..n) => numbering("Test 1.", ..n))
The problem happens in the last line, where it complains about missing argument.
What would be the correct statement now?