aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arabluatex.dtx2
-rw-r--r--arabluatex.lua17
2 files changed, 13 insertions, 6 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index 4d6a00d..3b2f4c2 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -177,7 +177,7 @@
177 \doxitem{Option}{option}{options} 177 \doxitem{Option}{option}{options}
178\fi 178\fi
179\usepackage{microtype} 179\usepackage{microtype}
180\babelfont{rm}{Old Standard} 180\babelfont{rm}[RawFeature=onum]{Old Standard}
181\babelfont{sf}{NewComputerModernSans10} 181\babelfont{sf}{NewComputerModernSans10}
182\babelfont{tt}{NewComputerModernMono10} 182\babelfont{tt}{NewComputerModernMono10}
183\usepackage{manfnt} 183\usepackage{manfnt}
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