summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua')
-rw-r--r--Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua
index 07968c07180..3b552b6749e 100644
--- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua
+++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua
@@ -128,6 +128,26 @@ local function indnum(str)
return str
end
+local function processdiscretionary(str)
+ str = string.gsub(str, "\\%-", "\\-{}")
+ return str
+end
+
+local function processarbnull(str, scheme)
+ if scheme == "buckwalter" then
+ str = string.gsub(str, "(\\arbnull.?)(%b{})", function(tag, body)
+ body = string.sub(body, 2, -2)
+ return string.format("P%sP", body)
+ end)
+ else
+ str = string.gsub(str, "(\\arbnull.?)(%b{})", function(tag, body)
+ body = string.sub(body, 2, -2)
+ return string.format("o%so", body)
+ end)
+ end
+ return str
+end
+
local function takeoutabjad(str)
str = string.gsub(str, "(\\abjad.?)(%b{})", function(tag, body)
body = string.sub(body, 2, -2)
@@ -487,6 +507,7 @@ end
function processvoc(str, rules, scheme)
str = "\\arb{".. str.."}"
+ str = processarbnull(str, scheme)
str = takeoutcapetc(str)
str = protectarb(str)
str = breakcmd(str)
@@ -505,6 +526,7 @@ end
function processfullvoc(str, rules, scheme)
str = "\\arb{".. str.."}"
+ str = processarbnull(str, scheme)
str = takeoutcapetc(str)
str = protectarb(str)
str = breakcmd(str)
@@ -525,6 +547,7 @@ end
function processnovoc(str, rules, scheme)
str = "\\arb{".. str.."}"
+ str = processarbnull(str, scheme)
str = takeoutcapetc(str)
str = protectarb(str)
str = breakcmd(str)
@@ -543,6 +566,8 @@ end
function processtrans(str, mode, rules, scheme)
str = "\\arb{".. str.."}"
+ str = processdiscretionary(str)
+ str = processarbnull(str, scheme)
str = takeoutabjad(str)
str = protectarb(str)
str = breakcmd(str)