-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Fixes Issue #26377 - Auto-escape % Symbol in Latex in pie labels #26981
Conversation
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.
Super close, just needs a marker to skip the test when latex isn't available and to make the test name a bit more descriptive.
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.
I think this could do with a comment explaining the regex substitution - otherwise looks good.
I am a tad confused by the title. It says "operator", but it is only letting I think this needs a whats new entry so that we can highlight this if anyone has been (ab)using this to intentionally put comments into strings. |
Fixes Issue matplotlib#26377 - Adding Support For % operator in Latex Excaping The % Operator in LaTeX for the Pie method Update _axes.py Added usetex key in textprops dictionary in pie method Removing Flake Issues and Prioritizing textprops parameter Fixes % operator in Latex in Pie Method Removed Trailing Whitespace Removed Unnecessary Label Test in Pie Update lib/matplotlib/tests/test_axes.py Skip Test when latex is not available Co-authored-by: Kyle Sunden <git@ksunden.space> Update lib/matplotlib/tests/test_axes.py Update test_name for % operator in Latex in Pie Method Co-authored-by: Kyle Sunden <git@ksunden.space> Added Dependency for needs_usetex testing for checking Latex dependency Comment For Using Regex To Support % Symbol in Latex Comments added to escape % if not already escaped using regex Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Going to skip waiting for AppVeyor, as the fix for it isn't in yet, and this shouldn't affect it. |
PR summary
Fixes Issue #26377 - Adding Support For % operator in Latex. Continued From #26642
'%' operator is considered as the start of a comment in LaTeX. In order to avoid this behavior,
\%
needs to be used.Uses Regex to substitute
\%
instead of%
. It also resolves in case the string is already pre-escaped.PR checklist