Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Doc]: dynamically resize the mathtext symbol tables #26143

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

Open
story645 opened this issue Jun 18, 2023 · 10 comments · May be fixed by #29640
Open

[Doc]: dynamically resize the mathtext symbol tables #26143

story645 opened this issue Jun 18, 2023 · 10 comments · May be fixed by #29640
Labels
Documentation Good first issue Open a pull request against these issues if there are no active ones! Maintenance topic: text/mathtext

Comments

@story645
Copy link
Member

story645 commented Jun 18, 2023

Documentation Link

https://matplotlib.org/devdocs/users/explain/text/mathtext.html#symbols

Problem

In the math text example, the number of columns for displaying each set of symbols is specified as part of defining each set of symbols:

symbols = [
["Lower-case Greek",
6,
r"""\alpha \beta \gamma \chi \delta \epsilon \eta \iota \kappa
\lambda \mu \nu \omega \phi \pi \psi \rho \sigma \tau \theta
\upsilon \xi \zeta \digamma \varepsilon \varkappa \varphi
\varpi \varrho \varsigma \vartheta""".split()],

This makes the tables somewhat brittle with respect to a reordering or a resizing.

Suggested improvement

modify the run function of the directive to generate a more dynamic table, maybe a list table

tagging this good first issue because the work is contained to the math_symbol_table.py file and the way to verify that the changes make sense is to build the docs and ensure that the resulting tables in the mathtext tutorials look similar to the old ones but are dynamically resizable. This issues requires working knowledge of sphinx.

@story645 story645 added Documentation Good first issue Open a pull request against these issues if there are no active ones! topic: text/mathtext Maintenance labels Jun 18, 2023
@github-actions
Copy link

Good first issue - notes for new contributors

This issue is suited to new contributors because it does not require understanding of the Matplotlib internals. To get started, please see our contributing guide.

We do not assign issues. Check the Development section in the sidebar for linked pull requests (PRs). If there are none, feel free to start working on it. If there is an open PR, please collaborate on the work by reviewing it rather than duplicating it in a competing PR.

If something is unclear, please reach out on any of our communication channels.

@Ashad001
Copy link

Hey, can I work on this???

@1taroh
Copy link

1taroh commented Jun 19, 2023

Hello.
I'm a beginner and I'm working on this issue.
Sometimes, two or more people work on same issue.
If so, what should we do? compete or collaborate?

@story645
Copy link
Member Author

story645 commented Jun 19, 2023

Hey all, as mentioned in #26143 (comment)

  1. we don't assign issues, meaning you all can work on any issues that don't have an open PR

  2. if there is a PR and you disagree with the approach, please review the PR and and try to come to a compromise before opening a new issue. If you feel your approach diverges enough to warrant opening a new PR, please explain why your approach is more optimal. We discourage similar competing PRs because it stretches already thin reviewer resources and can demoralize the person who had started working on their PR first. ETA 2: if you agree with the approach in the PR, please contribute by revewing/improving the PR and offering to work with the PR author when appropriate.

ETA: Sorry forgot to add, in this situation I'm going to warn you that there will likely be some thrashing on that file and you will most likely need to rebase any work you've done.

@oscargus
Copy link
Member

Is it possible to dynamically adapt the number of columns? Or is the idea to consider the length of the content and then cleverly select the number of columns in some way?

(I guess the main "problem" is that this is not really a "table", just that we want to stack information in a space-efficient way. So tables will typically not support resizing in that way?)

@story645
Copy link
Member Author

Is it possible to dynamically adapt the number of columns? Or is the idea to consider the length of the content and then cleverly select the number of columns in some way?

Both? I was thinking of how sphinx design grids dynamically wrap and this is sort of a 1 element per grid cell situation.

@NikosNikolaidis02
Copy link

Hey,

I found out that on the table the number of columns for example on "Upper-Case Greek" is 8

["Upper-case Greek",
8,
r"""\Delta \Gamma \Lambda \Omega \Phi \Pi \Psi \Sigma \Theta
\Upsilon \Xi \mho \nabla""".split()],

and the length of the table is 13 but here https://matplotlib.org/devdocs/users/explain/text/mathtext.html#symbols the number of columns is 4.

On the code https://github.com/matplotlib/matplotlib/blob/f329eb8fda1dc38c468caecf0d7f7d835a753f10/doc/sphinxext/math_symbol_table.py#L109C1-L109C1
takes the min of the 2 and it should be 8 but the columns is 4.

@oscargus
Copy link
Member

Here is the documentation regarding grids: https://sphinx-design.readthedocs.io/en/latest/grids.html

@rajveer43
Copy link

anyone working on this would like to take this on!

@melissawm
Copy link
Member

Hi @rajveer43 , you can see above that there is a pull request from @NikosNikolaidis02 that solves this issue. I'd suggest choosing another issue until they have a chance to respond to the comments there. Cheers!

@story645 story645 linked a pull request Feb 17, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment