diff options
-rw-r--r-- | arabluatex.dtx | 4 | ||||
-rw-r--r-- | arabluatex.lua | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx index 289512f..2672655 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx | |||
@@ -3988,10 +3988,10 @@ wa-ya.sIru ta.hta 'l-jild-i | |||
3988 | \AtBeginDocument{% | 3988 | \AtBeginDocument{% |
3989 | \ifdefined\abjad% | 3989 | \ifdefined\abjad% |
3990 | \RenewDocumentCommand{\abjad}{m}% | 3990 | \RenewDocumentCommand{\abjad}{m}% |
3991 | {\luadirect{tex.sprint(abjadify(#1))}}% | 3991 | {\luadirect{tex.sprint(abjadify(\luastring{#1}))}}% |
3992 | \else% | 3992 | \else% |
3993 | \NewDocumentCommand{\abjad}{m}% | 3993 | \NewDocumentCommand{\abjad}{m}% |
3994 | {\luadirect{tex.sprint(abjadify(#1))}} | 3994 | {\luadirect{tex.sprint(abjadify(\luastring{#1}))}} |
3995 | \fi} | 3995 | \fi} |
3996 | % \end{macrocode} | 3996 | % \end{macrocode} |
3997 | % \end{macro} | 3997 | % \end{macro} |
diff --git a/arabluatex.lua b/arabluatex.lua index 7a7460a..f0c03c6 100644 --- a/arabluatex.lua +++ b/arabluatex.lua | |||
@@ -760,7 +760,8 @@ end | |||
760 | -- Hosny's that dates back to 2010. Thanks to him. | 760 | -- Hosny's that dates back to 2010. Thanks to him. |
761 | -- See https://github.com/khaledhosny/lualatex-arabic | 761 | -- See https://github.com/khaledhosny/lualatex-arabic |
762 | function abjadify(n) | 762 | function abjadify(n) |
763 | local abjadnum = "" | 763 | local abjadnum = "" |
764 | n = tonumber(n) | ||
764 | if n >= 1000 then | 765 | if n >= 1000 then |
765 | for i=1,math.floor(n/1000) do | 766 | for i=1,math.floor(n/1000) do |
766 | abjadnum = abjadnum .. abjad[4][1] | 767 | abjadnum = abjadnum .. abjad[4][1] |