Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Refactor math_symbol_table.py to dynamically determine column number#30105
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Refactor math_symbol_table.py to dynamically determine column number#30105
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join uson gitter for real-time discussion.
For details on testing, writing docs, and our review process, please seethe developer guide
We strive to be a welcoming and open project. Please follow ourCode of Conduct.
679cb47
to2420e6a
CompareUh oh!
There was an error while loading.Please reload this page.
b726525
to8fe5cb2
Compare…for symbol tables(Issuematplotlib#26143)- Remove hardcoded column numbers; now columns are auto-calculated based on symbol length and page width constraints. Future changes to symbol lists require no manual column adjustment.
8fe5cb2
to76e8873
CompareThere 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.
Thanks for this@BeiChenStanly. I think this is a nice clean solution and the table renders well for me on both laptop and tablet screen. I just have some minor style comments.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
story645 commentedMay 26, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Any chance you can get this working w/ 1-2 columns for cell phones? Also thank you very much for picking this up! |
Can't we defer the column layout to CSS? I'm not an expert in these things, but flexbox with flex-wrap could likely do the job. |
aae40e3
to5d25f17
Compare5d25f17
to9ea11da
Compare@story645@timhoffm
Let me know if you have any further suggestions! |
Why if you only apply the css style to the div class for the math table? We have other custom css classes inhttps://github.com/matplotlib/matplotlib/blob/main/doc/_static/mpl.css |
Apologies, I did not read the issue carefully enough and missed the bit about checking how it responds to window resizing. I think a few potential contributors also missed that so I took the liberty of editing the issue OP to hopefully make it obvious. |
Thank you for your suggestion! The current table styles are provided by the documentation theme, which ensures consistent look and feel (including things like row highlighting on hover, alternating row colors, and compatibility with theme changes) across all tables—certainly not just the math table. While it’s possible to apply a custom CSS class to a This could lead to duplicated effort, potential inconsistencies, and more maintenance if the theme changes in the future. In addition, I’d like to confirm the original intent of this issue, just to make sure we’re on the same page. Is the main goal to:
Thanks again for your feedback! |
The goal is more truly responsive layout, w/ avoiding fixed column size being a kinda of iterative step. One of the ways we get responsive grids in other parts of the docs is by usinghttps://sphinx-design.readthedocs.io/en/latest/grids.html. Is there a way to maybe use that here - have the directive auto generate/populate a sphinx design grid? |
Thank you for clarifying and for the suggestion regarding Sphinx Design grids! I will work on redefining the directive to auto-generate a Sphinx Design grid and provide suitable CSS for the symbol table. I do want to note that if the theme or the Sphinx Design extension changes in the future, we may need to maintain or update the custom styles to ensure continued compatibility. I'm also still learning about advanced grid layouts and their best practices, so I would really appreciate any further advice or examples you can share—especially regarding responsive grids and integration with Sphinx Design. Thanks again for your helpful feedback and guidance! |
You might not need to - the sphinx grid might just do the trick. |
Fixed Issue#26143
PR summary
This PR refactors
math_symbol_table.py
so that the symbol tables in the mathtext documentation dynamically determine the number of columns, instead of relying on hardcoded values.What was changed