Skip to content

Thin space missing after mathtext operators #17852

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

Closed
anntzer opened this issue Jul 7, 2020 · 4 comments
Closed

Thin space missing after mathtext operators #17852

anntzer opened this issue Jul 7, 2020 · 4 comments
Labels
Difficulty: Hard 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
Milestone

Comments

@anntzer
Copy link
Contributor

anntzer commented Jul 7, 2020

Bug report

Bug summary

Mathtext operators (\log, \max, etc.) should insert a thin space after themselves (if followed by ordinary characters, not if followed by an open parenthesis, see https://tex.stackexchange.com/questions/225922/spacing-rules-for-operatorname/225924#225924), but currently it does not.

Code for reproduction

from pylab import *
figtext(.5, .6, r"$\log 6$ (usetex)", usetex=True)
figtext(.5, .5, r"$\log 6$ (current)")
figtext(.5, .4, r"$\mathdefault{log}\,6$ (manual thin space)")
figtext(.5, .3, r"$\mathdefault{log}\ 6$ (manual full space)")
show()

Actual outcome

out
Note the missing thin space between "g" and "6" in the current behavior.

Matplotlib version

  • Operating system: fedora
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())): qt5agg
  • Python version: 38
  • Jupyter version (if applicable):
  • Other libraries:
@tacaswell tacaswell added this to the v3.4.0 milestone Jul 7, 2020
@tacaswell tacaswell added Difficulty: Hard 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! labels Jul 7, 2020
@tacaswell
Copy link
Member

Labeled this as hard because the fix is going to involve diving into the tex parser in https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/mathtext.py but good first issue because there is no API design and should not require any changes outside of the mathtext.py.

@jkseppan
Copy link
Member

Is this done since #17890 was merged?

@anntzer
Copy link
Contributor Author

anntzer commented Jul 27, 2020

I think sub/superscript handling is still a problem (#17890 (comment)).

@QuLogic QuLogic modified the milestones: v3.4.0, v3.5.0 Jan 27, 2021
@QuLogic QuLogic modified the milestones: v3.5.0, v3.6.0 Sep 25, 2021
timhoffm added a commit to timhoffm/matplotlib that referenced this issue Jun 10, 2022
Picks up matplotlib#22839.

Closes matplotlib#22839, matplotlib#17852.

Co-authored-by: henrybeUM <98666765+henrybeUM@users.noreply.github.com>
timhoffm added a commit to timhoffm/matplotlib that referenced this issue Jun 12, 2022
Picks up matplotlib#22839.

Closes matplotlib#22839, matplotlib#17852.

Co-authored-by: henrybeUM <98666765+henrybeUM@users.noreply.github.com>
@oscargus
Copy link
Member

Closed by #23243

andrew-fennell pushed a commit to andrew-fennell/matplotlib that referenced this issue Jun 14, 2022
Picks up matplotlib#22839.

Closes matplotlib#22839, matplotlib#17852.

Co-authored-by: henrybeUM <98666765+henrybeUM@users.noreply.github.com>
jklymak pushed a commit to jklymak/matplotlib that referenced this issue Jun 24, 2022
Picks up matplotlib#22839.

Closes matplotlib#22839, matplotlib#17852.

Co-authored-by: henrybeUM <98666765+henrybeUM@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Hard 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
Projects
None yet
Development

No branches or pull requests

5 participants