Repository navigation
Conversation
|
Thanks! As the rendering will change, the result images must be updated as well. If I recall correctly, and I may not, there are some edge cases where this actually will not work properly. Probably in the cases where the error is large (like 31 instead of 3-4). I think the current approach works if there is a single character for the hyphen, but not for multicharacter hyphens. So probably one should check that the length of the HList is 1? Related is #23189 although that takes it a bit further to use a character with accent if available. And I realize that there are probably a similar issue there... |
| centered = HCentered([Hbox(sym.width / 4.0), accent_box]) | ||
| while isinstance(sym, Hlist): | ||
| sym = sym.children[0] |
There was a problem hiding this comment.
I'm probably wrong, but shouldn't line 2162 go below the two newly added lines? The way it currently is, sym is a Char in case of \dot s and an Hlist with kerning in case of \dot{s}, whereby centered will be different in those two cases.
There was a problem hiding this comment.
Good observation! I believe that as well. (Probably a bit clearer on the changed images.)
Yes this also affects
It doesn't seem this simple. The length of a Hlist is always more than 1 because it includes the char + the kerning amount. Therefore this fix would never have an affect on Hlists. If we want to get the accents on Hlists and chars to line up, we might need to manipulate the amount of kerning that each character gets, which is something I don't yet know how to do. I'm open to suggestions 😺 |
|
Sorry for letting this slip. I guess I do not really know how to proceed... I think the correct way is to check as is done now, just more "careful", to see if there is more than one character or not. However, I also think that another solution, probably better in the long term, but more complicated, is to make sure that the additional kerning is not added for groups consisting of groups and so on (basically |

PR Summary
Fixes #23257. Apply #23257 (comment) to correct the positioning of the accent when mathtext is used in italics.
PR Checklist
Documentation and Tests
pytestpasses)Release Notes
.. versionadded::directive in the docstring and documented indoc/users/next_whats_new/.. versionchanged::directive in the docstring and documented indoc/api/next_api_changes/next_whats_new/README.rstornext_api_changes/README.rst