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

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).
Bug report
Bug summary
All's in the title.
Code for reproduction
Actual outcome
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
\widehatand\widetilde.Matplotlib version
import matplotlib; print(matplotlib.__version__)): HEAD (3.3+)print(matplotlib.get_backend())): qt5aggFrom a quick look, this is due to the
sym.width/4horizontal correction added to an HCentered box inaccent(). Indeed replacingcenteredby justaccent_boxappears 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).