aboutsummaryrefslogtreecommitdiff
path: root/arabluatex.lua
diff options
context:
space:
mode:
Diffstat (limited to 'arabluatex.lua')
-rw-r--r--arabluatex.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/arabluatex.lua b/arabluatex.lua
index 3d6ec80..114a569 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -204,10 +204,15 @@ local function arbnum(str) -- not used, see below
204 return str 204 return str
205end 205end
206 206
207local function indnum(str) 207local function indnum(str, dir)
208 str = string.gsub(str, "([0-9%,%-%/]+)", function(num) 208 if dir == "ltr"
209 return string.reverse(num) 209 then
210 end) 210 -- do nothing
211 else
212 str = string.gsub(str, "([0-9%,%-%/]+)", function(num)
213 return string.reverse(num)
214 end)
215 end
211 if indorarbnum == "Indian" 216 if indorarbnum == "Indian"
212 then 217 then
213 for i = 1,#numbers do 218 for i = 1,#numbers do
@@ -1302,7 +1307,9 @@ end
1302function arabluatex.ayah(str) 1307function arabluatex.ayah(str)
1303 if tonumber(str) ~= nil and str.len(str) < 4 then 1308 if tonumber(str) ~= nil and str.len(str) < 4 then
1304 if tex.textdir == "TRT" then 1309 if tex.textdir == "TRT" then
1305 str = indnum(str).."^^^^06dd" 1310 -- end of ayah is typeset LTR and the number comes after the
1311 -- sign (see https://github.com/aliftype/amiri/issues/263#issuecomment-1872979252)
1312 str = "{\\textdir TLT ".."^^^^06dd"..indnum(str, "ltr").."}"
1306 elseif tex.textdir == "TLT" then 1313 elseif tex.textdir == "TLT" then
1307 str = "\\arb[trans]{("..str..")}" 1314 str = "\\arb[trans]{("..str..")}"
1308 end 1315 end