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
Extra \cdot in LaTeX output for Mul between a numeric power and a polynomial with numeric coefficient since SymPy 1.10 #26540
Conversation
changes to fix sympy#26430 line 500 are where the changes start
✅ Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.13. Click here to see the pull request description that was parsed.
|
Thanks for the fix! ❤️ The minimal example in the issue could be added to the test cases. |
Also I wonder if it's possible to avoid adding |
# Debug output before modification | ||
# print("Original LaTeX:", _tex) | ||
pattern = r'(\^\{[\d]+?\})\s*\\cdot\s*(\\left\(.+?\\right\))' | ||
modified_latex = re.sub(pattern, r'\1 \2', _tex) | ||
# print("Modified LaTeX:", modified_latex) | ||
return modified_latex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The erroneous code should not be generated in the first place. Attempting to fix it afterwards with a regex is not the right fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oscarbenjamin How do you propose to fix it properly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would need to find the source of the incorrect \cdot
and fix it.
Closing after #26558 |
References to other Issues or PRs
Fix #26430
Brief description of what is fixed or changed
fixed cdot issue by adding regex to take out the unnecessary cdots
Other comments
Release Notes
solvers
functions