Skip to content

Support Greek Numbering#4273

Merged
laurmaedje merged 17 commits intotypst:mainfrom
LuxxxLucy:lucy-numbering-br
Nov 1, 2024
Merged

Support Greek Numbering#4273
laurmaedje merged 17 commits intotypst:mainfrom
LuxxxLucy:lucy-numbering-br

Conversation

@LuxxxLucy
Copy link
Contributor

Regarding Issue #3882,

I mainly took references from Greek Number Converter and Greek Number

I am for now using the lowercase and upper case Alpha as the symbol.

Some test cases (unicode level) are added in numbering.rs

    greek_number_tests! {
...
        long_complex_0: (97_554, "αΜθʹ, ͵ζφνδ", Case::Lower),
        long_complex_1: (2_056_839_184, "βΜκʹ, αΜ͵εχπγ, ͵θρπδ", Case::Lower),
        long_complex_2: (12_312_398_676, "βΜρκγʹ, αΜ͵ασλθ, ͵ηχοϛ", Case::Lower),
...
    }

Png rendered
image

@LuxxxLucy LuxxxLucy changed the title Lucy numbering br Support Greek Numbering May 28, 2024
@LuxxxLucy LuxxxLucy force-pushed the lucy-numbering-br branch from aedd313 to fc4b688 Compare May 28, 2024 08:59
@jamesrswift
Copy link

Would it not make more sense for the numbering to cover the entire alphabet rather than the first 10 characters? Base 26 (or however many characters greek has) rather than base 10

@LuxxxLucy
Copy link
Contributor Author

LuxxxLucy commented May 28, 2024

Would it not make more sense for the numbering to cover the entire alphabet rather than the first 10 characters? Base 26 (or however many characters greek has) rather than base 10

Hi @Jamesxx I think the main issue is definition on what is the Greek numeral system. I believe the system you just described is called lower-greek which represent 11 as λ (the 11-th char of the alphabet), while the greek numbering system is a decimal-like system (though with a different set of chars), 11 is represented by "ιαʹ" (where "ι" is 10 and "α" is 1).

That being said, it seems to me that both should be implemented if permitted.

Copy link
Member

@laurmaedje laurmaedje left a comment

Choose a reason for hiding this comment

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

Here are a few comments, but not really relevant ones, since I can't judge the correctness of the Greek numbering itself. And then there is of course also still the question of the letter etc.

I'm not sure how best to proceed here.

@LuxxxLucy LuxxxLucy force-pushed the lucy-numbering-br branch from 8e1ef0f to 14cdcde Compare May 30, 2024 07:44
@laurmaedje laurmaedje added the waiting-on-review This PR is waiting to be reviewed. label Jul 7, 2024
@laurmaedje
Copy link
Member

I merged with main and tidied up the tests. While doing that I noticed that the number 2000000001 comes out differently with your code than with the online converter:

  • Your code: "βΜκʹ, αΜαʹ
  • Online converter: βΜκʹ, αʹ

@laurmaedje laurmaedje removed the waiting-on-review This PR is waiting to be reviewed. label Oct 31, 2024
@laurmaedje
Copy link
Member

Regarding the letter. It think we should use α and Α. Yes, the uppercase variant looks just like a normal A, but it is the only consistent choice. You can always write sym.Alpha and I also like the idea (forget where it was presented) to allow long-form numberings like {greek} and as soon as there is a brace-style numbering, implicit numbering is disabled.

@LuxxxLucy
Copy link
Contributor Author

I merged with main and tidied up the tests. While doing that I noticed that the number 2000000001 comes out differently with your code than with the online converter:

  • Your code: "βΜκʹ, αΜαʹ
  • Online converter: βΜκʹ, αʹ

Sorry, I did not realize it is so long ago and almost forgot this PR. I have just updated the PR with a fix and added more test cases.

Regarding the letter. It think we should use α and Α.

the current way should be this case, using the α and Α.

I also like the idea (forget where it was presented) to allow long-form numberings like {greek}

I like this idea as well! I am interested it supporting it but do not know how to start with it, do you have some hint/high level ideas on how to do it? that would be great.

@laurmaedje
Copy link
Member

I have just updated the PR with a fix and added more test cases.

Thanks!

the current way should be this case, using the α and Α.

Yep.

I like this idea as well! I am interested it supporting it but do not know how to start with it, do you have some hint/high level ideas on how to do it? that would be great.

Responded here: #1177 (comment)

@laurmaedje laurmaedje added this pull request to the merge queue Nov 1, 2024
@laurmaedje
Copy link
Member

Thank you!

Merged via the queue into typst:main with commit 23313b0 Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants