Skip to content

Conversation

@AngelPone
Copy link

@AngelPone AngelPone commented Dec 13, 2025

This pull request fixes magic.bibliography-as-footnote (#229) through the following fixes:

  1. extract the bibliography using cite(<key>, form: full)
  2. use regex to remove [1] at the beginning of rendered citation.
  3. record the bibitem everytime a new key is visited.
  4. reuse the footnote if some item is cited multiple times in one subsection.

Based on this new mecanism, the state bibliography-map and bibliography-counter, and the argument record will be unnecessary and thus are removed.

@jhalmen
Copy link

jhalmen commented Dec 22, 2025

I'd tried this quickly last week, and the footnote citations only appear on the first sub-slide when using animations i.e. #uncover and family

@AngelPone
Copy link
Author

@jhalmen I've pushed some changes to address this issue, and it should now be resolved in most scenarios.

However, during testing, I noticed a couple of edge cases that seem to be outside the scope of this PR:

  1. Footnote visibility with animations: Citations appear in the footnotes immediately, even if the #cite has not yet been revealed. For example:
- Item 1 @some-key  #pause
- Item 2 @another-key

On the first slide, only the bibliography entry for Item 1 should be visible. However, entries for both @some-key and @another-key are displayed. This seems to be related to how Touying handles animation internally.

  1. Page overflow with animations: When content is long enough to overflow to a second page, combining this with animation can sometimes result in blank pages.

Note: Both issues were also present in the old bibliography-as-footnote implementation (pre-Typst 0.14.0), so they are likely pre-existing issues rather than regressions introduced by this PR.

@OrangeX4 OrangeX4 self-requested a review December 25, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants