GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Bug]: \right) is replaced with exclamation mark when using fontset='cm' · Issue #29886 · matplotlib/matplotlib

[Bug]: \right) is replaced with exclamation mark when using fontset='cm' #29886

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
[Bug]: \right) is replaced with exclamation mark when using fontset='cm'#29886
Copy link
Assignees
QuLogic
Labels
status: duplicatetopic: text/mathtext

Description

@Mackemania
Mackemania
opened on Apr 8, 2025
Issue body actions

Bug summary

This is similar to 5210. The right big parenthesis is replaced with an exclamation mark for certain latex code.

Multiple queries were tested as follows.

Code for reproduction

import matplotlib.pyplot as plt

plt.rc('mathtext', fontset='cm')
working_texts = ['\\left(\\int_x \\right)', '\\left(\\int^x \\right)']
bugged_texts = ['\\left(\\int_x^x \\right)', '\\left(\\int_{x}^{x} \\right)']
plt.text(0.5, 0.5, fr'${bugged_texts[0]}$', parse_math=True)
plt.show()

Actual outcome

Actual:
Image

Expected outcome

Expected:
Image
(But with the upper bound of the integral present)

Additional information

I have only tested with mathtext fontset 'cm' and without setting it. The default font does display it correctly.
As far as I've tested it only happens when both upper and lower bound of the integral is set. Using \sum or \iint instead of \int also works correctly with both bounds. \oint however causes the same issue.

Operating system

Windows

Matplotlib Version

3.10.0

Matplotlib Backend

module://backend_interagg

Python version

3.12.5, 3.13

Jupyter version

No response

Installation

pip

Reacted by 2shaar

Activity

  1. oscargus
    added
    topic: text/mathtext
    on Apr 8, 2025
  2. anntzer commented on Apr 8, 2025

    @anntzer
    anntzer
    on Apr 8, 2025
    Contributor
    More actions

    FWIW I cannot reproduce the issue?

  3. jklymak commented on Apr 8, 2025

    @jklymak
    jklymak
    on Apr 8, 2025
    Member
    More actions

    I can't reproduce it either. @oscargus did you get this to happen?

    @Mackemania how have you installed LaTeX

  4. jklymak
    added
    status: needs clarificationIssues that need more information to resolve.Issues that need more information to resolve.
    on Apr 8, 2025
  5. oscargus commented on Apr 9, 2025

    @oscargus
    oscargus
    on Apr 9, 2025
    Member
    More actions

    @oscargus did you get this to happen?

    No. (I have some weird installation issue on my Windows laptop, so wasn't able to try it. Just tagged it.)

  6. 2shaar commented on Apr 10, 2025

    @2shaar
    2shaar
    on Apr 10, 2025
    More actions

    I am able to reproduce the issue. My system:

    ╰─$ pip3 list | grep matplotlib
    matplotlib                           3.6.3
    matplotlib-inline                    0.1.6
    
    ╰─$ python3 --version                      
    Python 3.12.3
    

    I'm on 24.04.2 LTS (Noble Numbat)

  7. davidlowryduda commented on Apr 16, 2025

    @davidlowryduda
    davidlowryduda
    on Apr 16, 2025
    Contributor
    More actions

    I can also reproduce this issue. I have matplotlib 3.10.1 and matplotlib-line 0.1.7, with python 3.12.3.

  8. davidlowryduda commented on Apr 16, 2025

    @davidlowryduda
    davidlowryduda
    on Apr 16, 2025
    Contributor
    More actions

    Here is some more information. With the following code

    import matplotlib.pyplot as plt
    plt.rc('mathtext', fontset='cm')
    import matplotlib.mathtext
    import matplotlib.font_manager as fm
    
    for s in range(10, 35):
        fp = fm.FontProperties(size=s)
        matplotlib.mathtext.math_to_image("$\\left(\\int_x^x \\right) \\quad + 1$", f'example{s}.png', prop=fp)

    I get the exclamation point output for sizes 10-14, and 16; but not any of the others. This is very similar behavior to #5210

  9. QuLogic
    self-assigned this
    on Apr 17, 2025
  10. QuLogic commented on Apr 17, 2025

    @QuLogic
    QuLogic
    on Apr 17, 2025
    Member
    More actions

    This is in fact a duplicate of #5210.

  11. QuLogic
    closed this as a duplicateof Unexpected replacement of \right) with exclamation point in MathTextParser output #5210 on Apr 17, 2025
  12. QuLogic
    removed
    status: needs clarificationIssues that need more information to resolve.Issues that need more information to resolve.
    on Apr 17, 2025
  13. QuLogic
    added
    status: duplicate
    on Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @QuLogic
    QuLogic

Labels

status: duplicatetopic: text/mathtext

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.