diff options
author | Robert Alessi <alessi@robertalessi.net> | 2018-05-06 12:42:10 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2018-05-06 12:42:10 +0200 |
commit | ead71bd1eb0e996a00da3b88894eb0ee39cc7865 (patch) | |
tree | b2dc5dfc9cf1724a263e19085a6e89382cdf6838 | |
parent | d29c2198970d50582a29f20c63d931a1b89b8811 (diff) | |
download | arabluatex-ead71bd1eb0e996a00da3b88894eb0ee39cc7865.tar.gz |
\abjad{} should be able to accept commands and counters as arguments
-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] |