You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It turns out it's not just the heading whose style can affect the page number's style. In fact, whatever style belonging to the last element on the page's proper (that is, excluding the page marginals) can affect the page number's style.
#setpage(numbering: "1", number-align: center)
= thick number#pagebreak()
= thin number
text under the heading
#pagebreak()
*thick text*#pagebreak()
_italic text_#pagebreak()
#text(fill: red, [red text])
Looks like a dupe of #241. Not an easy fix it seems, though one solution would be replacing page.rs typst::layout::page::Packed<PageElem>::layout()'s
let sub = content
.clone().styled(AlignElem::set_alignment(align)).layout(engine, styles, pod)?
.into_frame();
with
let sub = content
.clone().styled(AlignElem::set_alignment(align)).layout(engine,StyleChain::new(&Styles::new()), pod)? // Use a brand-new StyleChain!.into_frame();
Not an easy fix it seems, though one solution would be replacing page.rs ...
That would break other things (the capability to change global styles from Rust, e.g. in the tests, but it would also mean that headers/footers would never respect a global #set text(font: ..)). But #241 is on my radar as I'm working on the realization and I'll try to fix it.
Description
If a page with a number ends with a heading, the page number too is large and bold (or however else headings are displayed).
It manifests in this example:
I expect that the number would not take the style of headings. It seems that the heading is not ended properly.
Reproduction URL
https://typst.app/project/pVTEcA738PFjlwKgbr30PB
Operating system
Web app
Typst version
The text was updated successfully, but these errors were encountered: