Skip to content
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

Footnote near bottom appears on the next page #5603

Open
1 task done
PgBiel opened this issue Dec 18, 2024 · 3 comments
Open
1 task done

Footnote near bottom appears on the next page #5603

PgBiel opened this issue Dec 18, 2024 · 3 comments
Labels
bug Something isn't working layout Related to layout, positioning, etc.

Comments

@PgBiel
Copy link
Contributor

PgBiel commented Dec 18, 2024

Description

As seen in #5314 (comment)

Placing a footnote at the very bottom of a page prompts it to appear on the next page, breaking the footnote invariant. This isn't a regression, and occurs on both Typst 0.11.1 and 0.12.

Repro:

#set page("a4")

#v(96%)

#block[abc#footnote[footnote]]

(Replacing #v(96%) with #([a\ ] * 47) has the same effect.)

Output - Page 1:
page 1 has just "abc^1", footnote entry isn't there

Output - Page 2:
page 2 is empty but has the footnote, "footnote", at the bottom

Reproduction URL

No response

Operating system

Web app, Linux

Typst version

  • I am using the latest version of Typst
@PgBiel PgBiel added bug Something isn't working layout Related to layout, positioning, etc. labels Dec 18, 2024
@PgBiel
Copy link
Contributor Author

PgBiel commented Dec 18, 2024

I think the problem here, at least when peeking at 0.12 code, is that footnotes restrict themselves to the available space in the page (minus separator and gap) when being placed, whereas, theoretically, they're separate from the page. Regardless, at least migrating the block to the next page would be nice... but the problem is that we disable migration when the block is breakable. We could make it smarter to allow migration in that case if the entire block fits in the first page.

@laurmaedje
Copy link
Member

Yeah, this is a known limitation. Footnotes in breakable blocks work much better in 0.12, but migration for upholding the footnote invariant is not currently supported.

@laurmaedje
Copy link
Member

laurmaedje commented Dec 19, 2024

Note that we wouldn't want to migrate the full breakable block as it would potentially leave a ton of empty space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working layout Related to layout, positioning, etc.
Projects
None yet
Development

No branches or pull requests

2 participants