Skip to content

\overline and subscripts/superscripts in mathtext #5444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
breedlun opened this issue Nov 8, 2015 · 4 comments
Closed

\overline and subscripts/superscripts in mathtext #5444

breedlun opened this issue Nov 8, 2015 · 4 comments
Assignees
Milestone

Comments

@breedlun
Copy link
Contributor

breedlun commented Nov 8, 2015

The following code works fine in matplotlib 1.4.3, but it fails in matplotlib 1.5.0.

import matplotlib.pyplot as plt
ax = plt.subplot(111)
ax.plot([0,1],[0,1])
ax.text(0.5, 0.5, r'$\overline{\omega}$')
ax.text(0.5, 0.6, r'$\overline{\omega}^x$')
ax.text(0.5, 0.4, r'$\overline{\omega}_x$')

The traceback is super long, but here is the last line.

File "/Users/Ben/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/mathtext.py", line 2809, in subsuper
  last_char.width = last_char._metrics.advance
AttributeError: 'Vlist' object has no attribute '_metrics'
@QuLogic
Copy link
Member

QuLogic commented Nov 8, 2015

Bisect points to c56e56e in #4873:

commit c56e56edfd880b9980a72a840da56dc4b958c9ba
Author: Víctor Zabalza <>
Date:   Sat Aug 8 21:10:44 2015 +0100

    improve integral and slanted nuclei placement

    clean up, remove unnecesary do_kern=False

    fix overunder

    make cm clearer at small sizes

:040000 040000 ae8dcc2837d034b327c80473543c026b8815cfc9 44fd9df88d3835179736217a9145167a519f6dc6 M  lib

CC @zblz

@mdboom mdboom added this to the Critical bugfix release (1.5.1) milestone Nov 9, 2015
@zblz
Copy link
Member

zblz commented Nov 9, 2015

Well, that's embarrassing. We were definitely missing a test for a Vlist or Hlist as last character of the subsuper nucleus. I have added a fix against master in #5448, but should definitely be backported to 1.5.x.

@mdboom
Copy link
Member

mdboom commented Nov 9, 2015

No worries. The only people who never break code are people who never submit code ;) Thanks for the quick fix.

@zblz zblz closed this as completed in f83daa7 Nov 9, 2015
mdboom added a commit that referenced this issue Nov 9, 2015
Fix #5444: do not access subsuper nucleus _metrics if not available
mdboom added a commit that referenced this issue Nov 9, 2015
Fix #5444: do not access subsuper nucleus _metrics if not available
@breedlun
Copy link
Contributor Author

breedlun commented Nov 9, 2015

Slam, bam, thank you mam! That was a quick turn-around.

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

No branches or pull requests

5 participants