You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add page numbering support for Devanagari digits. #4843
In the meantime, this workaround seems to give sensible results. (Definitely not claiming this is the best solution - I'm sure people more familiar with Typst than I am can come up with a better one.)
Thanks for the great workaround—it worked well for the page numbers.
There are other sections of the report where the numbering needs to be updated, like the table of contents and headings. I believe using #set heading(numbering: "१.") should also apply Devanagari numerals to the headings.
Similarly, setting the heading with #set heading(numbering: "१.क") should use Devanagari letters for the second-level headings. Here, १ is the Devanagari numeral for "1," and क is the Devanagari letter for A This pattern should continue with १.ख, १.ग, etc. But this might be a separate discussion.
You're most welcome! Maybe the code below could be a partial solution for the page numbers and headers. (You will need to add more rows to the function convert-letters-devanagari if some sections have more than three subsections; in the code below I set the next symbols to ? as I don't know how Devanagari letters should be ordered. This code will also likely fail if there are more than two levels of headings.) This is most likely not the best solution, though - and only a workaround.
Activity
FlorentCLMichel commentedon Aug 27, 2024
In the meantime, this workaround seems to give sensible results. (Definitely not claiming this is the best solution - I'm sure people more familiar with Typst than I am can come up with a better one.)
starryprabin commentedon Aug 27, 2024
Thanks for the great workaround—it worked well for the page numbers.
There are other sections of the report where the numbering needs to be updated, like the table of contents and headings. I believe using
#set heading(numbering: "१.")should also apply Devanagari numerals to the headings.Similarly, setting the heading with
#set heading(numbering: "१.क")should use Devanagari letters for the second-level headings. Here,१is the Devanagari numeral for "1," andकis the Devanagari letter forAThis pattern should continue with१.ख,१.ग, etc. But this might be a separate discussion.FlorentCLMichel commentedon Aug 27, 2024
You're most welcome! Maybe the code below could be a partial solution for the page numbers and headers. (You will need to add more rows to the function
convert-letters-devanagariif some sections have more than three subsections; in the code below I set the next symbols to?as I don't know how Devanagari letters should be ordered. This code will also likely fail if there are more than two levels of headings.) This is most likely not the best solution, though - and only a workaround.starryprabin commentedon Aug 28, 2024
Thank you @FlorentCLMichel for your workaround. It worked beautifully. Wishing you all the best.