From 636c09401c1b2a46fb9771b464add7373cea0533 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Mon, 1 Jan 2024 09:41:39 +0100 Subject: arabluatex.ayah(): the number must be typeset LTR and come after the sign. (thanks to Khaled Hosny.) --- arabluatex.dtx | 2 +- arabluatex.lua | 17 ++++++++++++----- 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 @@ \doxitem{Option}{option}{options} \fi \usepackage{microtype} -\babelfont{rm}{Old Standard} +\babelfont{rm}[RawFeature=onum]{Old Standard} \babelfont{sf}{NewComputerModernSans10} \babelfont{tt}{NewComputerModernMono10} \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 return str end -local function indnum(str) - str = string.gsub(str, "([0-9%,%-%/]+)", function(num) - return string.reverse(num) - end) +local function indnum(str, dir) + if dir == "ltr" + then + -- do nothing + else + str = string.gsub(str, "([0-9%,%-%/]+)", function(num) + return string.reverse(num) + end) + end if indorarbnum == "Indian" then for i = 1,#numbers do @@ -1302,7 +1307,9 @@ end function arabluatex.ayah(str) if tonumber(str) ~= nil and str.len(str) < 4 then if tex.textdir == "TRT" then - str = indnum(str).."^^^^06dd" + -- end of ayah is typeset LTR and the number comes after the + -- sign (see https://github.com/aliftype/amiri/issues/263#issuecomment-1872979252) + str = "{\\textdir TLT ".."^^^^06dd"..indnum(str, "ltr").."}" elseif tex.textdir == "TLT" then str = "\\arb[trans]{("..str..")}" end -- cgit v1.2.3