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

Typst writer: A footnote should be able to be referenced multiple times #10626

Open
YDX-2147483647 opened this issue Feb 17, 2025 · 2 comments
Open
Labels

Comments

@YDX-2147483647
Copy link

Explain the problem.

If a footnote is referenced multiple times, it should be created only once, but the current implementation creates a new one for each reference.

By giving a label to a footnote, you can have multiple references to it.
Footnote Function – Typst Documentation

Here is a footnote reference,[^1] and again.[^1]

[^1]: Here is the footnote.
pandoc --from markdown --to typst --no-highlight

Current output:

Here is a footnote reference,#footnote[Here is the footnote.] and
again.#footnote[Here is the footnote.]

Expected output:

Here is a footnote reference,#footnote[Here is the footnote.] <fn-1> and
again.@fn-1

Pandoc version?

Relates-to: #8893

@YDX-2147483647 YDX-2147483647 changed the title Typst writer: A footnote can be referenced multiple times Typst writer: A footnote should be able to be referenced multiple times Feb 17, 2025
@jgm
Copy link
Owner

jgm commented Feb 17, 2025

This is essentially #1603.

Once the markdown is parsed, the Pandoc structure does not allow us to distinguish between the case where there was just a single note marker used and the case where multiple note markers are used. We just have an inline element Notes [Block].

@jgm
Copy link
Owner

jgm commented Feb 17, 2025

Changing this would require changing the Pandoc structure to have either

  • a block element Note Text [Block] and an inline element NoteRef Text, or less disruptively
  • an inline element Note Text [Block] where the Text part stores the marker.

Of course, any change to Pandoc is a breaking change through the whole ecosystem and requires code changes virtually everywhere. So this wouldn't be a simple fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants