diff --git a/lib/matplotlib/_mathtext.py b/lib/matplotlib/_mathtext.py index b41dca9d6988..ad30a5173634 100644 --- a/lib/matplotlib/_mathtext.py +++ b/lib/matplotlib/_mathtext.py @@ -2160,6 +2160,8 @@ def accent(self, s, loc, toks): accent_box.shrink() accent_box.shrink() centered = HCentered([Hbox(sym.width / 4.0), accent_box]) + while isinstance(sym, Hlist): + sym = sym.children[0] centered.hpack(sym.width, 'exactly') return Vlist([ centered,