Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Spaced symbols should not be spaced when in limits etc #26174

Open
@oscargus

Description

@oscargus

Bug summary

As seen, LaTeX does not add a space around the arrows (or =/+-sign) when in subscripts, but mathtext does.

Note that there is no space around\to but in mathtext,around\rightarrow in mathtext, while for LaTeX they look exactly the same. (This is because\to is not listed in_mathtext.Parser._arrow_symbols, but it should be.)

Code for reproduction

importmatplotlib.pyplotaspltstrings= [r'$\limsup_{x\to\infty}$',r'$\limsup_{x\rightarrow\infty}$',r'$x \to \infty$',r'$x \rightarrow \infty$',r'$\limsup_{x=a+b}$',r'$x=a+b$',r'$A^{a \times b}_{c \Uparrow d}$']fori,sinenumerate(strings):plt.text(0,i*0.15+0.05,s,fontsize=20)plt.text(0.5,i*0.15+0.05,f"${s}$",usetex=True,fontsize=20)plt.axis(False)plt.savefig("spacing.png",dpi=200)

Actual outcome

image

Expected outcome

No spaces around "spaced operators" in subscript.

Additional information

@devRD is this something you know how to fix?

Related to the failing test in#26173

Operating system

No response

Matplotlib Version

Latest main

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp