I would like to include the current section in my header in typst. The documentation on "page" show that a header needs to be of type none, or content. If I insert something like #counter("heading"), the value as I define the header is 0, so the header stays 0 throughout.
I though I could define use show heading
to create a function that updated the header when a new heading is made.
show heading: it => { set text(blue.darken(40%)) set page(header: grid(columns: (1fr, 3fr, 1fr), align(left)[LeftHead], align(center, title), align(right)[Right Head] )) it }
I however got the following error:
error: page configuration is not allowed inside of containers┌─ my_definitions.typ:81:4│81 │╭ set page(header: grid(columns: (1fr, 3fr, 1fr), 82 ││ align(left)[LeftHead], 83 ││ align(center, title), 84 ││ align(right)[Right Head]85 ││ ))│╰──────^
Is it possible to get a heading that updates?
See details above.