Skip to content
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

Month names not set as text when using usetex #19836

Closed
maxnoe opened this issue Mar 31, 2021 · 3 comments · Fixed by #19849
Closed

Month names not set as text when using usetex #19836

maxnoe opened this issue Mar 31, 2021 · 3 comments · Fixed by #19849

Comments

@maxnoe
Copy link
Contributor

maxnoe commented Mar 31, 2021

Bug report

From the image in the release notes for matplotlib 3.4 here:
https://matplotlib.org/stable/users/whats_new.html#date-formatters-now-respect-usetex-rcparam

The dateformatter does not use text mode for the month names but sets them like $Aug$. Which is bad typography, since it will be typeset as the mathematical expression A * u * g, not the text Aug.

@anntzer
Copy link
Contributor

anntzer commented Mar 31, 2021

Currently the formatter wraps text in \mathdefault (so things work with usetex=False), but mathdefault is a matplotlib-only thing and we just strip it out for usetex. In #18520 I argued that we should perhaps map it to amsmath's \text instead, which would fix that.

@smartlixx
Copy link
Contributor

If amsmath's \text is not introduced in the near future, we can modify _wrap_in_tex function to differentiate alphabets and other characters, leaving alphabets out from \mathdefault. This way is a little clumsy, but it works. A PR can be open with this approach.

@tacaswell
Copy link
Member

tacaswell commented May 14, 2021

@maxnoe Was this a change from 3.3? silly question, it is a new feature in 3.4 🐑

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

Successfully merging a pull request may close this issue.

4 participants