Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Avoid layout collisions with equation numbering #7221

@pure-chance

Description

@pure-chance

Description

When an equation is sufficiently long, its bounding box can collide with the equation number. There are two scenarios where this happens:

  1. The equation exceeds the column width. This feature does not address this case.
  2. 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

  1. Detect when the bounding boxes of the centered equation and right-aligned equation number collide.
  2. If a collision is detected and sufficient space remains in the column, progressively offset the equation leftward until either:
    1. The equation and number no longer collide and achieve satisfactory typographic spacing, or
    2. 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

Image

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

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    change requestA proposal for changes to an existing featuremathRelated to math syntax, layout, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions