typst / typst/typst

Wrong location of footnotes in bidirectional text

Open
#3,108 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug model text
Dominant language
Rust
Stars
56.1k
Forks
1.7k
Avg merge
3d 10h
Merged PRs (30d)
22

Description

Description

When a footnote appears directly after a text flow in a different direction to the surrounding text, the footnote number will attach the the inner text and appear on the wrong side of it, at least in most cases where the inner text is semantically considered as a distinct flow from the outer one (for example in quotations).

Examples:

English text ואז עברית#footnote[With an English footnote]

Generates:
Generated with Typst-Renderer on the official Typst Discord: https://discord.com/channels/1054443721975922748/1056574658771681361/1191005071744446574

This second example is perhaps much more motivating for why this behaviour should not be the default:

טקסט בעברית שמציג מספר כמו 123#footnote[והערת שוליים אחריו]

Generated with Typst-Renderer on the official Typst Discord: https://discord.com/channels/1054443721975922748/1056574658771681361/1191007539622588566

Reproduction URL

No response

Operating system

No response

Typst version
  • I am using the latest version of Typst

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two bidirectional-text examples in Typst and trace the footnote placement and text-direction handling. The issue does not name files or tests, so locate the relevant footnote and bidi layout entry points first. Done means the footnote number appears on the correct side of the distinct text flow in both examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
internationalization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.