Skip to content

Add Arabic abjad numerals#170

Merged
MDLC01 merged 7 commits into
typst:mainfrom
seloumi:main
Jun 3, 2026
Merged

Add Arabic abjad numerals#170
MDLC01 merged 7 commits into
typst:mainfrom
seloumi:main

Conversation

@seloumi

@seloumi seloumi commented May 28, 2026

Copy link
Copy Markdown
Contributor

Arabic abjad numeral for alphabetic numbering #168.

Add Arabic abjad numerals

@MDLC01 MDLC01 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How to fix the issues raised by CI. You can click on the "Commit suggestion" button on each of them.

Comment thread src/numeral_systems.rs Outdated
Comment thread src/numeral_systems.rs Outdated
Comment thread src/numeral_systems.rs Outdated
Comment thread src/numeral_systems.rs Outdated
Co-authored-by: Malo <57839069+MDLC01@users.noreply.github.com>
Comment thread src/numeral_systems.rs Outdated
remove trailing space.

Co-authored-by: Malo <57839069+MDLC01@users.noreply.github.com>
@MDLC01 MDLC01 linked an issue May 29, 2026 that may be closed by this pull request
@MDLC01

MDLC01 commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Thanks for addressing the CI issues.

Regarding the actual content, I am not fully confident I understand how abjad numerals work. According to the Wiktionary page you linked,1 this wouldn't be a positional system nor a bijective system, but an additive system, similar to Roman numerals, where each symbol has a value, and concatenated symbols signify addition of their respective values.

This boils down to the following question: if you had eleven headings using this numbering, how would you expect them to be numbered?

Option A (currently implemented in this PR) Option B (what I understand from the Wiktionary page)
  • أ
  • ب
  • ج
  • د
  • ه
  • و
  • ز
  • ح
  • ط
  • ي
  • ك
  • أ
  • ب
  • ج
  • د
  • ه
  • و
  • ز
  • ح
  • ط
  • ي
  • يأ

Finally, I have a question regarding the way the fifth number should be displayed. Should it be "ه" or "ه‍"?

Footnotes

  1. https://en.wiktionary.org/wiki/Appendix:Abjad_numerals

@seloumi

seloumi commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

Arabic alphabetic abjad numbering is like Latin alphabetic numbering: a,b,c,........
The correct result of numbering should be like option A (like what we did in this PR).
For the fifth letter it should be like this "ه‍".

@seloumi

seloumi commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

Why do these errors reappear every time? I only changed the fifth character, and the errors popped up again!

@MDLC01

MDLC01 commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Then do you know what the Wiktionary page is referring to and whether it would make sense to implement that as well (in a separate PR)?

Regarding the fifth letter, this will require some change to the infrastructure. I opened a separate PR for that: #171.

Why do these errors reappear every time? I only changed the fifth character, and the errors popped up again!

In this case, this is due to the aforementioned infrastructure limitation. But more generally, even the slightest change to a numeral system will cause its magic number to change, so the corresponding test will fail. The goal is that we check that everything works as intended once, and then write the magic number. If something breaks in the future, we will notice it because the magic number will change.

@seloumi

seloumi commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

What matters to us is the alphabet numbering, the content of the link describes an old method for converting letters and words into numbers ("حساب الجمل").
504673967_4108350892728132_8269484078919387011_n

@MDLC01

MDLC01 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

#171 has been merged. After merging this PR with main, you should be able to use strings instead, which will let you specify "ه‍" properly.

@MDLC01 MDLC01 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Those changes should be enough.

Comment thread src/numeral_systems.rs
Comment thread src/numeral_systems.rs Outdated
seloumi and others added 2 commits June 1, 2026 21:30
To keep up with  changes in commit e9e87c3

Co-authored-by: Malo <57839069+MDLC01@users.noreply.github.com>
Co-authored-by: Malo <57839069+MDLC01@users.noreply.github.com>
@MDLC01

MDLC01 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

If this is merged before #172, it's probably easier to update the changelog in #172.

@MDLC01 MDLC01 merged commit 312f8c7 into typst:main Jun 3, 2026
2 checks passed
@MDLC01

MDLC01 commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Thank you for the pull request!

@seloumi

seloumi commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

@MDLC01 Thank you for the guidances.

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.

Arabic alphabetic numbering for lists and headings.

4 participants