Skip to content

wide mathtext accents are mis-centered #19299

Closed

Description

@anntzer

Bug report

Bug summary

All's in the title.

Code for reproduction

from pylab import *

figtext(.5, .5, r"$\widebar{abc} \qquad \mathrm{\widebar{abc}}$")

Actual outcome

test

Expected outcome

The bar should be correctly centered. (The italic version is still ok-ish, but the roman one is far too offset.)
Likewise for \widehat and \widetilde.

Matplotlib version

  • Operating system: linux
  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): HEAD (3.3+)
  • Matplotlib backend (print(matplotlib.get_backend())): qt5agg
  • Python version: 3.9
  • Jupyter version (if applicable):
  • Other libraries:

From a quick look, this is due to the sym.width/4 horizontal correction added to an HCentered box in accent(). Indeed replacing centered by just accent_box appears to fix the issue... but now the italic correction is lost when using italics.

I think the correct solution likely implies doing an exegesis of node 12 of the TeXbook's appendix G (p442), or any of the articles linked at #18916 (comment).

Activity

  1. github-actions commented on Sep 29, 2023

    @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 Sep 29, 2023
  3. added this to the v3.11.0 milestone on Feb 4, 2026
  4. removed
    keepItems to be ignored by the “Stale” Github Action
    on Feb 4, 2026
  5. moved this to In Progress in Font and text overhaulon Feb 4, 2026
  6. anntzer commented on Feb 6, 2026

    @anntzer
    ContributorAuthor

    Closed by #31069.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions