Title: [Bug]: math_fontfamily="cm" prevents replacement of minus by unicode minus in `\mathdefault` · Issue #21687 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: math_fontfamily="cm" prevents replacement of minus by unicode minus in `\mathdefault` · Issue #21687 · matplotlib/matplotlib
X Title: [Bug]: math_fontfamily="cm" prevents replacement of minus by unicode minus in `\mathdefault` · Issue #21687 · matplotlib/matplotlib
Description: Bug summary All's in the title (and the examples). Code for reproduction from pylab import * figtext(.5, .6, r"$\mathdefault{a-b}$", math_fontfamily="dejavusans") figtext(.5, .5, r"$\mathdefault{a-b}$", math_fontfamily="cm") Actual outco...
Open Graph Description: Bug summary All's in the title (and the examples). Code for reproduction from pylab import * figtext(.5, .6, r"$\mathdefault{a-b}$", math_fontfamily="dejavusans") figtext(.5, .5, r"$\mathdefault{a-...
X Description: Bug summary All's in the title (and the examples). Code for reproduction from pylab import * figtext(.5, .6, r"$\mathdefault{a-b}$", math_fontfamily="dejavusans") figtext(.5...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/21687
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: math_fontfamily=\"cm\" prevents replacement of minus by unicode minus in `\\mathdefault`","articleBody":"### Bug summary\r\n\r\nAll's in the title (and the examples).\r\n\r\n### Code for reproduction\r\n\r\n```python\r\nfrom pylab import *\r\nfigtext(.5, .6, r\"$\\mathdefault{a-b}$\", math_fontfamily=\"dejavusans\")\r\nfigtext(.5, .5, r\"$\\mathdefault{a-b}$\", math_fontfamily=\"cm\")\r\n```\r\n\r\n### Actual outcome\r\n\r\n\r\nBoth lines use the text default font of DejaVu Sans, but setting math_fontfamily to cm prevented replacement of minus by unicode minus.\r\n\r\n### Expected outcome\r\n\r\nUnicode minus in both cases\r\n\r\n### Additional information\r\n\r\n(I probably have a fix that'll come after tearing down most mathtext deprecations that expire in 3.6, namely getting rid of the `math` kwarg in the various font classes and instead make the minus-\u003eunicode_minus replacement earlier, during the parsing stage.)\r\n\r\n### Operating system\r\n\r\nlinux\r\n\r\n### Matplotlib Version\r\n\r\n3.5\r\n\r\n### Matplotlib Backend\r\n\r\nqt5agg\r\n\r\n### Python version\r\n\r\n39\r\n\r\n### Jupyter version\r\n\r\nENOSUCHLIB\r\n\r\n### Installation\r\n\r\n_No response_","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2021-11-20T09:31:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/21687/matplotlib/issues/21687"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:11d69ba8-b2b0-e423-8c2d-cad3f295129f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D306:146969:23A886:2F4532:6A52C73A |
| html-safe-nonce | c45f06c281980001cb5f47c9ea73bb8f30c613141b9c20b8202033529244f441 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzA2OjE0Njk2OToyM0E4ODY6MkY0NTMyOjZBNTJDNzNBIiwidmlzaXRvcl9pZCI6IjYwNjM5Nzk0MjgzODc2Njk4MTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 91cca6e3365a69e551608b65adde07163094c2b43994436082adf073cbdae85c |
| hovercard-subject-tag | issue:1059104664 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/21687/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6d7879f1fdc26fbb79e7e4b43cb457ee84f4c8c9b8f016d22db8c2a650a7c586/matplotlib/matplotlib/issues/21687 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6d7879f1fdc26fbb79e7e4b43cb457ee84f4c8c9b8f016d22db8c2a650a7c586/matplotlib/matplotlib/issues/21687 |
| og:image:alt | Bug summary All's in the title (and the examples). Code for reproduction from pylab import * figtext(.5, .6, r"$\mathdefault{a-b}$", math_fontfamily="dejavusans") figtext(.5, .5, r"$\mathdefault{a-... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width