Title: Issue · GitHub
Open Graph Title: Issue · matplotlib/matplotlib
X Title: Issue · matplotlib/matplotlib
Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
Open Graph Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
X Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
Opengraph URL: https://github.com/matplotlib/matplotlib
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Certain unicode in Matplotlib + LaTeX","articleBody":"The following code fails at `set_ylabel`:\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\n\r\nwith plt.style.context({'text.usetex': True}):\r\n (fig, ax) = plt.subplots()\r\n ax.set_xlabel(\"€\")\r\n ax.set_ylabel(\"Δ\")\r\n plt.show()\r\n```\r\n\r\nIt works with `$\\Delta$` instead of Δ and it works if I unset `text.usetex`.\r\n\r\nThe generated tex is this:\r\n\r\n```tex\r\n\\documentclass{article}\r\n\\newcommand{\\mathdefault}[1]{#1}\r\n\\usepackage{type1cm}\r\n\\usepackage{type1ec}\r\n\\usepackage{type1ec}\r\n\\usepackage{type1ec}\r\n\\usepackage[utf8]{inputenc}\r\n\\DeclareUnicodeCharacter{2212}{\\ensuremath{-}}\r\n\\usepackage[papersize=72in, margin=1in]{geometry}\r\n\r\n\\makeatletter\\@ifpackageloaded{textcomp}{}{\\usepackage{textcomp}}\\makeatother\r\n\\pagestyle{empty}\r\n\\begin{document}\r\n% The empty hbox ensures that a page is printed even for empty inputs, except\r\n% when using psfrag which gets confused by it.\r\n\\fontsize{10.000000}{12.500000}%\r\n\\ifdefined\\psfrag\\else\\hbox{}\\fi%\r\n{\\sffamily Δ}\r\n\\end{document}\r\n```\r\n\r\nand it compiles fine with pdflatex if I replace `\\usepackage[utf8]{inputenc}` by `\\usepackage[utf8x]{inputenc}`. Otherwise the error is the same:\r\n\r\n```tex\r\n! Package inputenc Error: Unicode character Δ (U+0394)\r\n(inputenc) not set up for use with LaTeX.\r\n```\r\n\r\nI think this is on the side of unexpected behavior.\r\n\r\nVersions: `Python 3.8.5` and `matplotlib==3.4.1`.\r\n\r\n","author":{"url":"https://github.com/numpde","@type":"Person","name":"numpde"},"datePublished":"2021-05-19T10:00:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/20262/matplotlib/issues/20262"}
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:b04bb240-516c-f57a-d9d6-dadf5889c58d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8402:18CEBB:15D3EEB:1CF1D65:6A51C074 |
| html-safe-nonce | cbd4716b865e6f510a9e14dbe29deedf3e3c7ec5a6600e8933509ddb8f989d78 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDAyOjE4Q0VCQjoxNUQzRUVCOjFDRjFENjU6NkE1MUMwNzQiLCJ2aXNpdG9yX2lkIjoiNTc2OTcwNzEyODQ2NzA3OTI4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5f0516fc8837072d709057ec27bc252c915b5894b2dad4571001c6b66271c493 |
| hovercard-subject-tag | repository:1385122 |
| 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/matplotlib/matplotlib/issues/20262 |
| twitter:image | https://opengraph.githubassets.com/9261bf81ff8848b426c0823e67448cf51d35b63d999294ff18880398e6b5b195/matplotlib/matplotlib |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9261bf81ff8848b426c0823e67448cf51d35b63d999294ff18880398e6b5b195/matplotlib/matplotlib |
| og:image:alt | matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-cache |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width