Skip to content

Thin space missing after mathtext operators #17852

Closed

Description

@anntzer

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:

Activity

  1. added this to the v3.4.0 milestone on Jul 7, 2020
  2. added
    Difficulty: Hardhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
    🌱 Good first issueOpen a pull request against these issues if there are no active ones!
    on Jul 7, 2020
  3. tacaswell commented on Jul 7, 2020

    @tacaswell
    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.

  4. jkseppan commented on Jul 27, 2020

    @jkseppan
    Member

    Is this done since #17890 was merged?

  5. anntzer commented on Jul 27, 2020

    @anntzer
    ContributorAuthor

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

  6. modified the milestones: v3.4.0, v3.5.0 on Jan 27, 2021
  7. modified the milestones: v3.5.0, v3.6.0 on Sep 25, 2021
  8. oscargus commented on Jun 13, 2022

    @oscargus
    Member

    Closed by #23243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Hardhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuestopic: text/mathtext🌱 Good first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions