Skip to content

Add middle for delims #26333

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

Merged
merged 1 commit into from
Jul 21, 2023
Merged

Add middle for delims #26333

merged 1 commit into from
Jul 21, 2023

Conversation

devRD
Copy link
Contributor

@devRD devRD commented Jul 17, 2023

PR summary

Fixes #23212

Adds support for \middle delimiter

PR checklist

@devRD devRD force-pushed the mt-middle branch 2 times, most recently from 4a0b099 to 92c3ec9 Compare July 17, 2023 16:33
@devRD devRD marked this pull request as ready for review July 18, 2023 16:50
@oscargus
Copy link
Member

Looks good! Can you please add a test for \middle . as well? Both to get code coverage and to confirm that deleting during the loop causes any issue. Should be possible to simply just add it to the new test?

@devRD devRD force-pushed the mt-middle branch 2 times, most recently from 2671ddc to 7edbadb Compare July 19, 2023 12:30
@jklymak
Copy link
Member

jklymak commented Jul 19, 2023

I'm confused why so many other images needed to be regenerated?

@devRD
Copy link
Contributor Author

devRD commented Jul 19, 2023

It does look strange, yes. I'm unsure why the additional images were regenerated as they don't look that far off from the original but these images all use the \left and \right delimiters... maybe it's regenerating because this PR touched that part?

@oscargus
Copy link
Member

oscargus commented Jul 20, 2023

There are some minor changes in the spacing, although quite hard to spot. I guess this is because the width and height is computed slightly different now.

Not sure if you have tried this, but what about doing the added for-loop before determining width and height? (And keeping the old expression.) One may even move the new for-loop inside if len(middle):

@devRD
Copy link
Contributor Author

devRD commented Jul 20, 2023

Thanks for the suggestion! @oscargus

I tested moving the for-loop before the height and depth calculation, but it doesn't set the AutoHeightChar for the middle delimiters. Moving it inside the if len(middle): after the height calculation works without the additional images being regenerated.

@ksunden ksunden added this to the v3.8.0 milestone Jul 21, 2023
@ksunden ksunden merged commit def68de into matplotlib:main Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support \middle
4 participants