-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: re-order symbol and acent in mathtext #4588
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
Conversation
I suspect this change is fine as long as there are no symbols that are strict prefixes of accents. (Don't know if that's the case). Maybe add some tests? (Clearly it doesn't break existing ones, which is a good thing.) |
Try to find symbols before finding accents Closes matplotlib#4462
5191ab8
to
0fdeb6e
Compare
@mdboom rebased + tests added |
Ping me if I should merge these tests into one, the idea was to split them up to make bisection easier |
ping @mdboom |
FIX: re-order symbol and acent in mathtext
@tacaswell: In my system this switch messes up the position of the accents. It might be system dependent, but I think my system is common enough that this shouldn't happen (everything from Debian Testing repos except matplotlib master, Python 3.4). Before the fix, accents rendered fine, symbols didn't: After it, accents are shifted to the left: I don't know much about parsers, so I don't really understand how this can happen from a cursory glance at |
Well, that is exciting. On Fri, Aug 7, 2015, 12:19 PM Victor Zabalza notifications@github.com
|
What is the mathtex string you are using? On Fri, Aug 7, 2015 at 12:24 PM, Thomas A Caswell notifications@github.com
|
The top one is from a test, the bottom is the one from issue #4462, and which is in tests as well since this PR:
Note as well that the mathtext test for the first one doesn't fail for me: maybe the accents don't have enough area to meet the threshold? |
re: accents, I bet you are right about that. We probably only test them on As for the parsing, what I think is really strange is that the \hat for the On Fri, Aug 7, 2015 at 2:15 PM, Victor Zabalza notifications@github.com
|
It seems so: instead of being rendered in place and then shifted, it looks
|
Turns out this PR breaks the accent parsing, as in it never happens (and the comment in the code was correct). I am working on fixing this. @zblz Thanks for catching this before we released! |
This is a follow up to matplotlib#4588 The change in ae91e9f fixed the symbols that started with accent names, but broke all of the other accents. This fixes both by special casing the 8 named symbols that start with an accent as a prefix. ex '\doteq' should be parsed as a single symbol, not as as two symbols (e, q) with a dot over the e ('\dot{e}q')
This is a follow up to matplotlib#4588 The change in ae91e9f fixed the symbols that started with accent names, but broke all of the other accents. This fixes both by special casing the 8 named symbols that start with an accent as a prefix. ex '\doteq' should be parsed as a single symbol, not as as two symbols (e, q) with a dot over the e ('\dot{e}q')
Try to find symbols before finding accents
Closes #4462
attn @mdboom What can of worms have I opened here?