I have been trying to do slides and need a header for my them. I have tried the page.header parameter, however, the header is not placed covering the margin, which is a thing I want.
I looked on the docs and it said that this is correct behavior, and it gave me an example of how to cover the margins
Which works, but now the content does not know there is a header, So i would need to do some work to make it now go behind the #header on the foreground.
Then, I thought that if i take a page on a show rule like this:
#show page: p => [
#header
p.body
]
The body will do everything correctly and i can add margins for the body easily.
However, this does not do anything.
Am I using #show page wrong? Is this intended? Does this have to do with context?
The page element is kind of special. According to the doc below, we can’t use show page rules because they are incompatible with the current layout model.
Could you clarify it? Is that the height of the header on each page is different and you want header’s top edge to match page’s top edge and the page’s body come below the header?
Besides, perhaps something like this would suffice.
I think @Micaias_Oliveira’s issue is with the horizontal margins. The simplest solution is probably to set explicit margins and manually extend the header area, for example with pad:
Thank you! This “solves” half of the problem (feels like a hack more than a full solution. But one of the big problems is that the header continues to be only a fixed size. If I want it to be taller, it does not change size.
I tried header-ascent which does change the header size, but does not change the contents adapt to the smaller space.
This way the block will have a height equal to the top margin, minus the header ascent.
I agree it’s a bit hacky but it’s not too bad… The worst thing is that you need to know the left and right margin for the pad arguments (trying to get these values with context page.margin is tricky and unreliable unfortunately, see Promote `margin` to a type · Issue #3636 · typst/typst · GitHub).