Skip to content

wide mathtext accents are mis-centered #19299

Open
@anntzer

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).

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