Description
Currently header-includes
in default.typst
are included after
#show: doc => conf(
// ...
)
They are also directly before include-before
:
pandoc/data/templates/default.typst
Lines 79 to 86 in 8613aa3
causing these two kinds of include to have the same effect.
Typst doesn't really have "headers", but I argue it would be more more consistent with the HTML behavior to move header-includes
before the show rule.
Currently, attempting to set the page color or background in header-includes
will cause the title and abstract to be rendered on a default black-on-white page, followed by a page break, before the rest of the content is rendered with the desired page settings.
Here is an example:
---
title: header-includes is too late in Typst template
abstract: |
The title and abstract will be printed in black on a white page,
and the rest of the content will be printed in white on a navy page.
header-includes: |
```{=typst}
#set page(fill: navy)
#set text(fill: white)
```
---
# Text on a new page
Because we did
```typst
#set page(fill: navy)
```
after
```typst
#show: doc => conf(
// ...
)
```
we started a new page with the new background color.
Happy to open a pull request with this change, but I figured I'd open a issue to discuss first.
cc @cscheid