References to floating figures point to wrong location
Open
Nobody has claimed this yet.
bug
introspection
- Dominant language
- Rust
- Stars
- 56.1k
- Forks
- 1.7k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Description
Description
The location of a floating figure is set to where it is created, but not where it is actually laid out.
This is visible in the location function, and also noticeable when clicking on a reference only to not end up at the figure.
#set page(height: 2.2cm, width: 8cm)
@figure
#figure(
[#rect()<actual>],
placement: top,
caption: [A rectangle]
) <figure>
`figure:` #context query(<figure>).first().location().position() \
`rect: ` #context query(<actual>).first().location().position()
Tried with 0.11.1 on the webapp, and on main with f91cad7d
Reproduction URL
No response
Operating system
Web app, Windows
Typst version
- I am using the latest version of Typst
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the location function and run the supplied Typst example with the floating figure. Compare the reported positions and reference navigation for the figure and its actual content; done means both point to the figure's laid-out location rather than its creation location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100