Skip to content

mathtext: Finetuning sup/super block to match TeX reference #4873

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

Merged
merged 14 commits into from
Aug 25, 2015
Prev Previous commit
Next Next commit
fix no nucleus in mathtext
  • Loading branch information
zblz committed Aug 24, 2015
commit 43b5455aa3fca4ec9e00e0eb4f9f2896e4b51bcc
3 changes: 2 additions & 1 deletion lib/matplotlib/mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -2791,7 +2791,8 @@ def subsuper(self, s, loc, toks):
# create new Hlist without kerning
nucleus = Hlist(new_children, do_kern=False)
else:
last_char.width = last_char._metrics.advance
if isinstance(nucleus, Char):
last_char.width = last_char._metrics.advance
nucleus = Hlist([nucleus])

# Handle regular sub/superscripts
Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/tests/test_mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
r'$xyz^kx_kx^py^{p-2} d_i^jb_jc_kd x^j_i E^0 E^0_u$', # github issue #4873
r'${xyz}^k{x}_{k}{x}^{p}{y}^{p-2} {d}_{i}^{j}{b}_{j}{c}_{k}{d} {x}^{j}_{i}{E}^{0}{E}^0_u$',
r'${\int}_x^x x\oint_x^x x\int_{X}^{X}x\int_x x \int^x x \int_{x} x\int^{x}{\int}_{x} x{\int}^{x}_{x}x$',
r'testing$^{123}$',

]

Expand Down