Title: mathtext: add mathnormal and distinguish between normal and italic family by llohse · Pull Request #31121 · matplotlib/matplotlib · GitHub
Open Graph Title: mathtext: add mathnormal and distinguish between normal and italic family by llohse · Pull Request #31121 · matplotlib/matplotlib
X Title: mathtext: add mathnormal and distinguish between normal and italic family by llohse · Pull Request #31121 · matplotlib/matplotlib
Description: PR summary This adds \mathnormal to the mathtext parser and handles mathit and mathnormal/default differently, to replicate the behaviour of LaTeX. In particular, it produces italic digits, whereas normal produces upright digits. closes #29253 This is implemented as follows: For cm, add the cmti (Computer Modern Text Italic) and use it for it. Use cmmi for normal, but map digits to cmr (same as in LaTeX). Technically, LaTeX further distinguishes between normal and the default, where the default uses roman digits and normal uses the digits from cmmi, which are slightly offset. For stix and dejavu, the font for digits is mapped to either upright or italic for normal and it, respesctively. To facilitate these features, I have moved the _get_font_constants functionality into the respective font classes instead of a global lookup table. This gets rid of the non-local access to the private _get_fonts from the lookup table. Moreover, this change prepares for reading the constants dynamically, as is necessary with generic OpenType math fonts. If this change is controversial, I could try to work around it. @QuLogic I have filed the PR against the text-overhaul branch because of the massive changes therein with respect to main. Examples PR checklist "closes #0000" is in the body of the PR description to link the related issue new and changed code is tested Plotting related features are demonstrated in an example New Features and API Changes are noted with a directive and release note Documentation complies with general and docstring guidelines
Open Graph Description: PR summary This adds \mathnormal to the mathtext parser and handles mathit and mathnormal/default differently, to replicate the behaviour of LaTeX. In particular, it produces italic digits, wherea...
X Description: PR summary This adds \mathnormal to the mathtext parser and handles mathit and mathnormal/default differently, to replicate the behaviour of LaTeX. In particular, it produces italic digits, wherea...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/31121
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f9647718-eb86-4d9d-3df5-fc36d2bf63f6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D0A2:E28FC:D5FD41:11C1308:6A51B841 |
| html-safe-nonce | 0274a8d021fcf58e5062881265086c188e9616f96cba29ca7f90c5ff55849d73 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEEyOkUyOEZDOkQ1RkQ0MToxMUMxMzA4OjZBNTFCODQxIiwidmlzaXRvcl9pZCI6IjExNzg4ODkzNTExMDg2MDYwMTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d5a8144db8450169b34c8bcbe93b20ee63d4f4ccc6a9d2034dcd0cd8e2c37862 |
| hovercard-subject-tag | pull_request:3262087426 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/matplotlib/matplotlib/pull/31121/files |
| twitter:image | https://avatars.githubusercontent.com/u/6746424?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/6746424?s=400&v=4 |
| og:image:alt | PR summary This adds \mathnormal to the mathtext parser and handles mathit and mathnormal/default differently, to replicate the behaviour of LaTeX. In particular, it produces italic digits, wherea... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width