[Bug]: mathtext should distinguish between unary and binary minus #28180
Labels
Difficulty: Medium
https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
Good first issue
Open a pull request against these issues if there are no active ones!
topic: text/mathtext
Bug summary
TeX inserts a (thin?) space after a binary minus, but not before a unary minus. Typographically, I believe this does look nicer.
mathtext does not distinguish the two cases and always puts in a thin space. It would be nice if it followed tex's behavior.
Code for reproduction
Actual outcome
Compare the spacing before the "b" and the "c": they are different with usetex, but not with mathtext.
Expected outcome
Remove the space in mathtext before the unary minus.
Additional information
Probably involves reading the TeXbook to figure out what is TeX's logic for distinguishing unary and binary minus.
Tagging as good first issue solely because there should be no API design at all, but medium (-hard) difficulty because that'll require both reading the TeXbook and learning about mathtext's implementation. However I would guess there's no "strong" technical blockers either.
Operating system
any
Matplotlib Version
3.10.0.dev137+g9387431ab6
Matplotlib Backend
qtagg
Python version
3.12
Jupyter version
no
Installation
git checkout
The text was updated successfully, but these errors were encountered: