New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Citation formatting fails in table.header #4023
Comments
Same happens on footers. Strange... Thanks for reporting. |
Adding I also tested placing a labelled heading inside a repeated table header, and I could still query it, so introspection isn't completely broken. Paging @laurmaedje for ideas. Are we doing something too cursed with regions, to the point of somehow breaking citations? Very weird... |
I've tested further, and this only happens in the first page of the table with a repeated header. That is, if you write #table(
table.header([#context { if here().page() == 1 [nothing here] else [@citation] }]),
...
) it won't error and will display normally, unless you add the citation on the first page as well. In a perhaps similar fashion (at least on the surface), for footers, this only happens if the table has only one page. Otherwise, the citation displays normally across all of a footer's repetitions, including the final appearance of the footer, at the last page of the table. Edit: The footer also errors on the first page if the citation is in an auto row. It does not error on any other pages, however, just like the header here. However, the repeated header errors on the first page having However, fractional rows in headers and footers are seemingly not affected by the bug. |
Taking a look at this issue. It seems that the offending citation group element sometimes shows up with a different location. |
I’ve found that the citation group element is getting two different locations because |
Replacing line 234 of - let mut locator = Locator::chained(locator);
+ let mut locator = Locator::new(); makes this bug not manifest, but this obviously isn’t a desirable solution. |
Perhaps the error happens because the assigned locations don't line up across measurement and true layout. If it is indeed this, the problem is explained in the "Measurement and Introspection" section in https://laurmaedje.github.io/posts/frozen-state/. |
Description
When I try to compile a typst document that has a citation in a
table.header
(link to offending commit), I get the following error message:I don't know if this is a problem with
table.header
itself or in the way that I've defined aframe
template function in the filetau-presentation.typ
, but it would be cool if this could get resolved.Reproduction URL
https://gitlab.com/SeSodesa/tau-typst-presentation/-/commit/cefd297354da39d0f778431177c80ae15f7d9bfa
Operating system
macOS
Typst version
The text was updated successfully, but these errors were encountered: