From ead71bd1eb0e996a00da3b88894eb0ee39cc7865 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sun, 6 May 2018 12:42:10 +0200 Subject: \abjad{} should be able to accept commands and counters as arguments --- arabluatex.dtx | 4 ++-- 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 \AtBeginDocument{% \ifdefined\abjad% \RenewDocumentCommand{\abjad}{m}% - {\luadirect{tex.sprint(abjadify(#1))}}% + {\luadirect{tex.sprint(abjadify(\luastring{#1}))}}% \else% \NewDocumentCommand{\abjad}{m}% - {\luadirect{tex.sprint(abjadify(#1))}} + {\luadirect{tex.sprint(abjadify(\luastring{#1}))}} \fi} % \end{macrocode} % \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 -- Hosny's that dates back to 2010. Thanks to him. -- See https://github.com/khaledhosny/lualatex-arabic function abjadify(n) - local abjadnum = "" + local abjadnum = "" + n = tonumber(n) if n >= 1000 then for i=1,math.floor(n/1000) do abjadnum = abjadnum .. abjad[4][1] -- cgit v1.2.3