Skip to content

Relation operator in mathtext should not be spaced when at end #23315

Open

Description

@QuLogic

Actually this reveals another bug: I deleted the ddots (etc.) test because they are now recognized as relation operators and extra spaces got added around them, but such spaces should actually not be there because the test string is r'$\dotplus$ $\doteq$ $\doteqdot$ $\ddots$' i.e. the relation operator is at (both) extremities of the dollar-enclosed part, in which case tex does not introduce a space. For a simpler example, consider figtext(.5, .5, "a$=b$", size=24) with or without usetex. With usetex, there's no space between "a" and "=" (whereas there's one between "=" and "b"), whereas mathtext introduces a space on both sides of the "=".

Fixing this bug (which probably involves reusing something like the "Binary operators at start of string should not be spaced" part of the code in def symbol()) should allow keeping the old ddots test, so I'll look into that...

Originally posted by @anntzer in #22950 (comment)

Activity

  1. github-actions commented on Dec 12, 2025

    @github-actions

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  2. added
    keepItems to be ignored by the “Stale” Github Action
    and removed
    status: inactiveMarked by the “Stale” Github Action
    on Dec 12, 2025
  3. added 2 commits that reference this issue on Sep 10, 2026
    9a143d7
    25781de
  4. ahmed5145 commented on Sep 10, 2026

    @ahmed5145
    Contributor

    Opened #32331 to fix this. It drops the boundary-side spacing for relation/binary/arrow operators (so a$=b$ no longer spaces before the =) and restores the un-hacked \ddots test. Two image baselines need regenerating in a FreeType 2.6.1 build. noted in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    keepItems to be ignored by the “Stale” Github Actiontopic: text/mathtext

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions