Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Synchronize mathtext docs and handling#26173

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

Merged
ksunden merged 2 commits intomatplotlib:mainfromoscargus:symboldocs
Aug 14, 2023

Conversation

@oscargus
Copy link
Member

@oscargusoscargus commentedJun 23, 2023
edited
Loading

PR summary

Solves parts of#26174 (second commit).

This sort of guarantees that (at least in a while), there will be no discrepancy between which symbols are supported and that those are supported correctly. That is, if a symbol is listed as a relational operator, there will be spaces surrounding it.

Also adds a few new sections to the supported symbols list. Not sure if "Western Europe" is the best description for å, Å etc (although they are used in Swedish and some of the other are used in Norwegian etc.).

Listed directly supported script, fraktur and black board characters. If nothing else to see which works and which should maybe be added...

The ones that are not yet added are:

vec = ⃗textasciicircum = ^imageof = ⊷origof = ⊶solbar = ⌿k = ̨textexclamdown = ¡llcorner = ⌞invnot = ⌐lq = ‘greater = >lrcorner = ⌟not = ̸bar = ̄rightharpoonaccent = ⃑textasciitilde = ~leftharpoonaccent = ⃐carriagereturn = ↵overarc = ̑candra = ̐quad =  minus = −kernelcontraction = ∻spadesuitopen = ♤textquotedblleft = “grave = ̀acwopencirclearrow = ↺dot = ̇turnednot = ⌙rasp = ʼH = ̋ulcorner = ⌜underbar = ̱lasp = ʽc = ̧colon = :textasciiacute = ´breve = ̆textquestiondown = ¿__sqrt__ = √emdash = —less = <tilde = ̃textasciigrave = `smallsetminus = ∖cdotp = ·hat = ̂acute = ́d = ̣t = ͡dddot = ⃛ocirc = ̊ddddot = ⃜thickspace =  endash = –urcorner = ⌝prurel = ⊰ddot = ̈check = ̌rq = ’textquotedblright = ”% = %_ = _# = #guillemotleft = «ring = ˚guilsinglright = ›macron = ¯guillemotright = »asterisk = *guilsinglleft = ‹plus = +smallintclockwise = ∱smallvarointclockwise = ∲smallointctrcclockwise = ∳

The accents should probably be removed as they are handled separately. For exampleddot is mapped tocombiningdiaeresis.

Then, one may wonder if we want to openly state that we support\plus rather than simply using+?

PR checklist

@oscargus
Copy link
MemberAuthor

Another change is that the extension prints the rendered symbols as above. Which clearly showed thatleftbrace had the wrong mapping.

@oscargus
Copy link
MemberAuthor

The failing test is because mathtext adds space around the "spaced operators" in subscripts as well, while LaTeX doesn't. (\to was not in the list of arrows, but should be spaced in normal size.)

@oscargus
Copy link
MemberAuthor

oscargus commentedJun 23, 2023
edited
Loading

Here is the outcome:https://output.circle-artifacts.com/output/job/0c35025a-735d-4800-a574-b790431306bd/artifacts/0/doc/build/html/users/explain/text/mathtext.html

A bit annoyingly *, +, and - are all interpreted as list bullets...

@QuLogic
Copy link
Member

A bit annoyingly *, +, and - are all interpreted as list bullets...

Should maybe be fixed? Perhaps a backslash prefix will work?

_mathtext.Parser._arrow_symbols],
["Dot symbols",
4,
r"""\cdots \vdots \ldots \ddots \adots \Colon \therefore \because""".split()],
Copy link
Member

Choose a reason for hiding this comment

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

Aren'ttherefore andbecause in Relation operators?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yes, they are. As well.

I just saw some table with "dot symbols" somewhere (do not remember where, maybe the "List of LaTeX symbols..." or whatever it is called), where they were included, so thought that it may make sense. Easy to modify though.

@oscargus
Copy link
MemberAuthor

Should maybe be fixed? Perhaps a backslash prefix will work?

Indeed. Just had no idea how to obtain it. Have tried to read up, but haven't found anything. I guess making an HTML table directly is a way to go though?

@QuLogic
Copy link
Member

Usually, a backslash before characters will stop reST from treating them as whatever markup, so pretty sure that'll work for the bullets as well.

@oscargusoscargusforce-pushed thesymboldocs branch 2 times, most recently fromd52726a tod7f95e6CompareJuly 13, 2023 02:20
@oscargus
Copy link
MemberAuthor

Fixed. Seems to work.

@ksundenksunden modified the milestones:v3.8.0,v3.8-docAug 8, 2023
@oscargusoscargus removed this from thev3.8-doc milestoneAug 9, 2023
@oscargusoscargus added this to thev3.8.0 milestoneAug 9, 2023
@oscargus
Copy link
MemberAuthor

I think this should go in 3.8 since there are "half-made" changes towards this and this is the final step.

'O' :216,
'hookleftarrow' :8617,
'trianglerighteq' :8885,
'nsime' :8772,
Copy link
Member

Choose a reason for hiding this comment

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

Has this just been wrong from 2006 ?!

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I guess so. However, I do not think it was documented so I wonder if someone ever used it?

Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

I have some concern about thensime ->nsimeq change, however it appears thatnsimeq is the correct symbol.

https://milde.users.sourceforge.net/LUCR/Math/mathpackages/txfonts-symbols.pdf

If we need an API change note, we can add that in a follow up PR.

ksunden
ksunden previously requested changesAug 9, 2023
'hermitmatrix' :8889,
'barvee' :8893,
'measuredrightangle' :8894,
'varlrtriangle' :8895,
Copy link
Member

Choose a reason for hiding this comment

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

This looks to have been correct?lrtriangle is U+25ff (9727) andvarlrtriangle is U+22bf (8895).

reference:https://ctan.mirrors.hoobly.com/fonts/stix/doc/stix.pdf

Both are triangles, but stix assigns this the same as the old name

'barvee' :8893,
'measuredrightangle' :8894,
'varlrtriangle' :8895,
'lrtriangle' :8895,
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
'lrtriangle' :8895,
'varlrtriangle' :8895,

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'll add lrtriangle then. DIdn't make sense to have varlrtriangle if we don't have lrtriangle...

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'm wondering if one should script the source of the STIX documentation and add all those symbols? The problem is just to add them to the documentation...

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Reverted to varlrtriangle. Any additional symbols will be in another PR.

\cup \triangleright \ddagger
\uplus \lhd \amalg
\dotplus \dotminus'''.split())
\dotplus \dotminus \Cap
Copy link
Member

Choose a reason for hiding this comment

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

This is going to change how some things render, do we need a note about this?

@ksunden
Copy link
Member

The doc build seems to still be gettinglrtriangle instead ofvarlrtriangle

Seems to be due to

ifignore_variantandsym!=r"\varnothing":
sym=sym.replace(r"\var","\\")

Probably the thing to do is to add just this one here.

@oscargus
Copy link
MemberAuthor

Ah, that may have been an additional reason for the name change...

@oscargus
Copy link
MemberAuthor

This is updated

@ksundenksunden merged commitac95c22 intomatplotlib:mainAug 14, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestAug 15, 2023
ksunden added a commit that referenced this pull requestAug 15, 2023
…173-on-v3.8.xBackport PR#26173 on branch v3.8.x (Synchronize mathtext docs and handling)
@oscargusoscargus deleted the symboldocs branchAugust 16, 2023 08:59
@ksundenksunden mentioned this pull requestSep 15, 2023
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@tacaswelltacaswelltacaswell approved these changes

@QuLogicQuLogicQuLogic left review comments

@ksundenksundenksunden approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

v3.8.0

Development

Successfully merging this pull request may close these issues.

4 participants

@oscargus@QuLogic@ksunden@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp