Skip to content

Get numeral systems from Codex#7936

Draft
MDLC01 wants to merge 2 commits intotypst:mainfrom
MDLC01:numeral-systems
Draft

Get numeral systems from Codex#7936
MDLC01 wants to merge 2 commits intotypst:mainfrom
MDLC01:numeral-systems

Conversation

@MDLC01
Copy link
Collaborator

@MDLC01 MDLC01 commented Mar 2, 2026

As was previously discussed, this proposes to move numbering kinds to Codex. Numbering patterns stay in Typst, but numbering kinds and their "chars" are moved to Codex as numeral systems with shorthands.

This is still a draft as the corresponding Codex PR (typst/codex#145) should be merged first. Additionally, I made the decision to now raise an error when a numeral system cannot represent a number (e.g., zero) instead of arbitrarily falling back to Western Arabic numerals or a hyphen. Currently, the error is reported with a detached span, which is highly suboptimal.

For now, I do not make use of the names assigned to the various numeral systems in Codex and instead only use the shorthands. This means there should not be any observable behavior other than some numbers no longer being representable (hence the updated tests).

@MDLC01
Copy link
Collaborator Author

MDLC01 commented Mar 3, 2026

The tests for the various numeral systems should probably be moved to Codex, and the test for deprecated symbol variants will always be annoying to maintain so I think it should be removed altogether.

@MDLC01 MDLC01 force-pushed the numeral-systems branch from 75504e6 to 1a6fd1d Compare March 3, 2026 09:56
@MDLC01 MDLC01 force-pushed the numeral-systems branch from 1a6fd1d to 9c131d2 Compare March 3, 2026 09:57
@laurmaedje laurmaedje added the waiting-on-review This PR is waiting to be reviewed. label Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on-review This PR is waiting to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants