#heading numbers not showing

4 messages · Page 1 of 1 (latest)

sage prawn
#

I'm trying to show heading numbers like this (based on a template from jwhear.

This works:
let level = 2
set heading(
numbering: (..numbers) =>
if numbers.pos().len() <= level {
return numbering("1.1.", ..numbers)
}
)

But for some reason it stops working when adding this as well:

show heading.where(level: 2): it => {
  text(
    size: 10pt,
    it.body
  )
}   

Is there an example I should have a look at?

stable perch
#

?render ```typ
#set text(10pt)
#set heading(numbering: "1.")
#show heading: it => {
if it.level <= 2 {
it
} else {
text(size: 10pt, it.body)
}
}

= hello world
== foo
=== bar
#lorem(10)

stable perch
#

if you use it.body by itself, the numbering is removed and the heading is no longer a block