#Numbering nested lists with non latin characters

34 messages · Page 1 of 1 (latest)

fair hamlet
#

Hi All.

Has anyone succeeded to number nested lists with non latin characters ?

#set enum(numbering: "1.α)")

  • first item
    • first subitem
    • second subitem
  • second item

Thank you.

austere anchor
#

?r

#set enum(numbering: "1.α)", full: true)
+ first item
    + first subitem 
    + second subitem
+ second item 
austere anchor
#

full: true makes a difference here. Now this might not be exactly the desired result

austere anchor
pseudo frost
#

damn is there seriously no way to remove the apostrophe (without a custom func #set enum(numbering: (..ns) => numbering(sym.alpha, ..ns).slice(0, -2)))

fair hamlet
fair hamlet
timber crag
#

?r You need to use a code block to trigger the rendering.

#set enum(numbering: "1. অ)", full: true)
+ one
    + a 
    + b 
+ two
timber crag
#

Huh. Typst Renderer bot lacks support for those characters.

austere anchor
# fair hamlet Thank you but there is a problem : if you try with some other non latin scripts ...

I don't see that character mentioned in numbering documentation. Are you sure it is supported as a counting symbol? Docs say this

Counting symbols are 1, a, A, i, I, α, Α, 一, 壹, あ, い, ア, イ, א, 가, ㄱ, *, ١, ۱, १, ১, ক, ①, and ⓵. They are replaced by the number in the sequence, preserving the original case.

https://typst.app/docs/reference/model/numbering/

Typst

Documentation for the numbering function.

#

If it's not in the list, then it's unfortunately not supported. The package numberingx supports a few more scripts and numbering systems

#

Wikipedia says that ক is a bengali symbol, so that would be the only hope(?) The result with অ is indeed consistent with it just being treated as a constant string, not a numbering symbol

fair hamlet
fair hamlet
austere anchor
#

Do you have an example? I'm not sure what it means

fair hamlet
austere anchor
#

sure, numbering can be a function and the function receives an index or an array of indexes like 1 or (1, 1). So you just need a function to translate the number to the symbol

#

?r

#let nn = ("ا","ب","ج","د","ه","و","ز")
#set enum(numbering: i => nn.at(i - 1))   // XX need to handle wraparound
+ first
+ second
+ third
austere anchor
#

oh

#

see, it works if you just supply a function to do it

fair hamlet
austere anchor
#

then you have the same problem that I had first

#

need () for an array ([] is for a markup block)

#

as you can see the code above works (after edits)

fair hamlet
#

Thank you !
Is there a way to automate this for second level lists ?

austere anchor
#

I don't know, maybe with some smart function writing

fair hamlet
austere anchor
fair hamlet
austere anchor
#

I think you can add it in the numbering function, like just + ")"

fair hamlet