Avoid layout collisions with equation numbering
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 56.1k
- Forks
- 1.7k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Description
Description
When an equation is sufficiently long, its bounding box can collide with the equation number. There are two scenarios where this happens:
- The equation exceeds the column width. This feature does not address this case.
- The equation fits within the column, but due to center alignment, it extends far enough right to collide with the equation number.
I proposes implementing collision detection and dynamic positioning improve the typography for scenario 2 occurs. Specifically:
Proposed Behavior
- Detect when the bounding boxes of the centered equation and right-aligned equation number collide.
- If a collision is detected and sufficient space remains in the column, progressively offset the equation leftward until either:
- The equation and number no longer collide and achieve satisfactory typographic spacing, or
- The equation reaches the edge of the column.
Note: In the second outcome, the equation would span the full column width and may still collide with the numbering. This is expected behavior, the feature aims to utilize available space, but cannot resolve collisions when the equation genuinely requires the entire column.
Use Case
Near Collision
Here, the equation is uncomfortably close to the numbering when strictly centered in the column. It would look significantly better with a slightly offset to the left.
Collision
Now the equation is actually colliding with the equation number. But there's plenty of room in the column for them not to collide at all.
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
The issue does not name an implementation file, test, or entry point, so first locate the equation layout and numbering logic in the Rust codebase. Done means detecting collisions, shifting a centered equation left when space permits, and preserving the documented behavior when the equation reaches the column edge.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100