8000 Sort Greek and Hebrew characters by oscargus · Pull Request #26145 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Sort Greek and Hebrew characters #26145

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions doc/sphinxext/math_symbol_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
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()],
r"""\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \kappa \lambda \mu
\nu \xi \pi \rho \sigma \tau \upsilon \phi \psi \chi \omega \digamma
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\nu \xi \pi \rho \sigma \tau \upsilon \phi \psi \chi \omega \digamma
\nu \xi \pi \rho \sigma \tau \upsilon \phi \chi \psi \omega \digamma

wiki says "..., Φ φ, Χ χ, Ψ ψ, ..."

https://en.wikipedia.org/wiki/Greek_alphabet

\varepsilon \vartheta \varkappa \varphi \varpi \varrho \varsigma""".split()],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to put the \var versions with their normal versions or all at the end like tihs?

Copy link
Member Author
8000

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. :-)

["Upper-case Greek",
8,
r"""\Delta \Gamma \Lambda \Omega \Phi \Pi \Psi \Sigma \Theta
\Upsilon \Xi \mho \nabla""".split()],
6,
r"""\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega
""".split()],
["Hebrew",
6,
r"""\aleph \beth \daleth \gimel""".split()],
r"""\aleph \beth \gimel \daleth""".split()],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
r"""\aleph \beth \gimel \daleth""".split()],
r"""\daleth \gimel \beth \aleph""".split()],

I trust @story645 's suggestion that the Hebrew should be ordered right-to-left.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, missed that aspect of it.

["Delimiters",
6,
_mathtext.Parser._delims],
Expand All @@ -28,7 +27,7 @@
{fr"\{fn}" for fn in _mathtext.Parser._function_names}],
["Binary operation and relation symbols",
4,
r"""\ast \pm \slash \cap \star \mp \cup \cdot \uplus
set(r"""\ast \pm \slash \cap \star \mp \cup \cdot \uplus
\triangleleft \circ \odot \sqcap \triangleright \bullet \ominus
\sqcup \bigcirc \oplus \wedge \diamond \oslash \vee
\bigtriangledown \times \otimes \dag \bigtriangleup \div \wr
Expand Down Expand Up @@ -57,10 +56,10 @@
\lneqq \gneqq \ntriangleright \lnsim \gnsim \ntrianglerighteq
\coloneq \eqsim \nequiv \napprox \nsupset \doublebarwedge \nVdash
\Doteq \nsubset \eqcolon \ne
""".split()],
""".split())],
["Arrow symbols",
4,
r"""\leftarrow \longleftarrow \uparrow \Leftarrow \Longleftarrow
set(r"""\leftarrow \longleftarrow \uparrow \Leftarrow \Longleftarrow
\Uparrow \rightarrow \longrightarrow \downarrow \Rightarrow
\Longrightarrow \Downarrow \leftrightarrow \updownarrow
\longleftrightarrow \updownarrow \Leftrightarrow
Expand All @@ -80,17 +79,17 @@
\nrightarrow \nLeftarrow \nRightarrow \nleftrightarrow
\nLeftrightarrow \to \Swarrow \Searrow \Nwarrow \Nearrow
\leftsquigarrow
""".split()],
""".split())],
["Miscellaneous symbols",
4,
r"""\neg \infty \forall \wp \exists \bigstar \angle \partial
set(r"""\neg \infty \forall \wp \exists \bigstar \angle \partial
\nexists \measuredangle \eth \emptyset \sphericalangle \clubsuit
\varnothing \complement \diamondsuit \imath \Finv \triangledown
\heartsuit \jmath \Game \spadesuit \ell \hbar \vartriangle \cdots
\hslash \vdots \blacksquare \ldots \blacktriangle \ddots \sharp
\prime \blacktriangledown \Im \flat \backprime \Re \natural
\circledS \P \copyright \ss \circledR \S \yen \AA \checkmark \$
\cent \triangle \QED \sinewave""".split()]
\cent \triangle \QED \sinewave \mho \nabla""".split())]
]


Expand All @@ -105,7 +104,9 @@ def render_symbol(sym):

lines = []
for category, columns, syms in symbols:
syms = sorted(list(syms))
# Assume that lists are correctly sorted
if isinstance(syms, set):
syms = sorted(list(syms))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
syms = sorted(list(syms))
syms = sorted(syms)

sets are iterable so sorted can take them directly.

Super picky, take it or leave it.

columns = min(columns, len(syms))
lines.append("**%s**" % category)
lines.append('')
Expand Down
0