| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Comparing between the Tex and mathtext, It looks like the superscript is On Thu, Aug 6, 2015 at 12:44 PM, Victor Zabalza notifications@github.com
|
Sorry, something went wrong.
|
Well, it seems that reducing the space after the sub/subscript is not that simple after all: it works well with numbers, but for slanted characters: TeX, of course, handles these beautifully. I'll try to see where the difference in spacing comes from. @WeatherGod: indeed it is, I'll try to match that as well. |
Sorry, something went wrong.
Sorry, something went wrong.
finetuning with cm TeX match superscript height
|
So I think I've got it under control now for CM, stix and stixsans fontsets. There were a few challenges with integrals (also related to the Char vs Hlist issue above), but they look good now and I have added a couple of tests for them. I will amend the baseline images shortly and then the PR can be properly reviewed. This is how a sample looks with this PR in cm: To be compared with the usetex=True rendering: The same sample also looks good for stix and stixsans: |
Sorry, something went wrong.
|
@tacaswell, @mdboom : I think this is now complete, it would be great if you could review it at some point. Looking at the issue list, this PR will fix the issue with spacing after superscripts reported in #4333. |
Sorry, something went wrong.
|
I have also added the sub/supercript parameters for Arev Sans, which is checked for by looking at rcParams['mathtext.fontset'] == 'custom' rcParams['mathtext.rm'] == 'sans' rcParams['font.sans-serif'][0].lower() == 'arev sans' This could be useful for users using it and if #4636 is accepted. |
Sorry, something went wrong.
clean up, remove unnecesary do_kern=False fix overunder make cm clearer at small sizes
|
Thanks! I'm happy to merge this once Travis passes. |
Sorry, something went wrong.
|
hold on. The second to last line has some spacing issues. The "f" and "2" On Mon, Aug 24, 2015 at 10:45 AM, Michael Droettboom <
|
Sorry, something went wrong.
|
Also, the "prime" symbol in that line is much too close, especially when On Mon, Aug 24, 2015 at 10:49 AM, Benjamin Root ben.v.root@gmail.com
|
Sorry, something went wrong.
|
Also, our mathtext might be parsing something slightly differently than On Mon, Aug 24, 2015 at 10:49 AM, Benjamin Root ben.v.root@gmail.com
|
Sorry, something went wrong.
|
@WeatherGod: Yes, the kerning for the f is particularly tight, but it is tight everywhere, as you mention for the regular f and numerals 2 and 9 (and that's why I added them to that line), so it is not an issue with the sub/super script. I tried to minimize it for cm, where it looks pretty good, but did not manage for stix of stixsans. Maybe the kerning for the f should be slightly widened elsewhere to match TeX. I added a modification of the superscript kerning that takes into account how much the last character rises above the x-height to try and mitigate this, but it is tricky: if it is correct for the italic f, it is too wide for, e.g., $E^0$ (which is already slightly wider than tex), so I tried to reach a compromise. The prime issue only happens for stix and stixsans, where it seems to match $\prime$ to an already superscripted prime, as opposed to a nice and big prime for TeX and cm. This I also believe is outside the scope of this PR, but should definitely be fixed so they are consistent. |
Sorry, something went wrong.
|
I fixed a test failure in test_axes that came from having no nucleus inside mathtext (e.g., a$^2$). I added a test in mathtext so it can be caught by running only the test_mathtext tests. There were also a couple of superscripts in other tests that were failing because I had not replaced the baseline images. Should be fine now. |
Sorry, something went wrong.
|
I agree that the stix issues with the prime symbol and some of the other miscellaneous spacing is a separate issue from this PR, and indeed this PR makes things no worse than it was before in that regard. |
Sorry, something went wrong.
|
Ok, well, let's create some issue tickets for those so that we don't forget to fix them. This is great work @zblz! |
Sorry, something went wrong.
|
Ok, I created issue #4987 to track the issues I noted above. Great work! Mike, I have not reviewed a single line of code here (I wouldn't know what any of it means anyway). So, I'll leave merging this up to you? |
Sorry, something went wrong.
mathtext: Finetuning sup/super block to match TeX reference
see comments in matplotlib#4873 and matplotlib#4987: Primes in stix and DejaVu are already superscripted, so the TeX way of setting a prime as $f^\prime$ results in doubly-superscripted primes. For consistency with TeX, here we use the CM prime symbol.
see comments in matplotlib#4873 and matplotlib#4987: Primes in stix and DejaVu are already superscripted, so the TeX way of setting a prime as $f^\prime$ results in doubly-superscripted primes. For consistency with TeX, here we use the CM prime symbol.
see comments in matplotlib#4873 and matplotlib#4987: Primes in stix and DejaVu are already superscripted, so the TeX way of setting a prime as $f^\prime$ results in doubly-superscripted primes. For consistency with TeX, here we use the CM prime symbol.
see comments in matplotlib#4873 and matplotlib#4987: Primes in stix and DejaVu are already superscripted, so the TeX way of setting a prime as $f^\prime$ results in doubly-superscripted primes. For consistency with TeX, here we use the CM prime symbol.
| Back | FazBrowse Home | New Git URL |
As mentioned in #4872, I found that sub/super blocks in mathtext have slightly too much space after them, even after @mdboom fix in #4401. As initial reference, this a TeX rendering of a bunch of sub/superscripts (with E and 5 because they are box-like and separation differences are easier to spot):

The current master renders it as follows:

And with the modifications of this PR, it looks like this:

Summary of changes:
Regression images coming soon!