diff options
author | Karl Berry <karl@freefriends.org> | 2018-01-04 23:45:57 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-01-04 23:45:57 +0000 |
commit | 196751def71387e14be5101a1953d0add736328e (patch) | |
tree | bc82db3a8a8749565abe1f2692573ccfc5d716c3 /Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua | |
parent | 493c985399debe97d5052f70079307d67d99b080 (diff) |
arabluatex (4jan18)
git-svn-id: svn://tug.org/texlive/trunk@46217 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua | 64 |
1 files changed, 47 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua index f6890edc432..2466093824c 100644 --- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua @@ -2,7 +2,7 @@ This file is part of the `arabluatex' package ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX -Copyright (C) 2016--2017 Robert Alessi +Copyright (C) 2016--2018 Robert Alessi Please send error reports and suggestions for improvements to Robert Alessi <alessi@robertalessi.net> @@ -192,10 +192,10 @@ end local function takeoutcapetc(str) str = string.gsub(str, "(\\arb.?%[trans%])(%b{})", function(tag, body) body = string.sub(body, 2, -2) - body = string.gsub(body, "(\\cap%s?)(%b{})", "\\Cap%2") + body = string.gsub(body, "(\\uc%s?)(%b{})", "\\Uc%2") return string.format("%s{%s}", tag, body) end) - str = string.gsub(str, "(\\cap.?)(%b{})", function(tag, body) + str = string.gsub(str, "(\\uc.?)(%b{})", function(tag, body) body = string.sub(body, 2, -2) return string.format("%s", body) end) @@ -665,25 +665,55 @@ function processtrans(str, mode, rules, scheme) return str end -function cap(str) +function uc(str) str = string.gsub(str, "(\\txtrans.?)(%b{})", function(tag, body) body = string.sub(body, 2, -2) return string.format("%s", body) end) - if string.find(str, "[^\\]%-['`ʾʿ]") then - str = string.gsub(str, "([^\\]%-['`])", "%1\\MakeUppercase ") - str = string.gsub(str, "([^\\]%-ʿ)", "%1\\MakeUppercase ") - str = string.gsub(str, "([^\\]%-ʾ)", "%1\\MakeUppercase ") - elseif string.find(str, "[^\\]%-[^'`ʾʿ]") then - str = string.gsub(str, "([^\\]%-)", "%1\\MakeUppercase ") - elseif string.find(str, "^['`ʾʿ]") then - str = string.gsub(str, "^(['`])", "%1\\MakeUppercase ") - str = string.gsub(str, "^(ʿ)", "%1\\MakeUppercase ") - str = string.gsub(str, "^(ʾ)", "%1\\MakeUppercase ") - else - str = "\\MakeUppercase "..str + str = string.gsub(str, "(%s[%(%<%[]?)(bn)", "%1{%2}") + for i = 1,#lcuc do + str = string.gsub(str, "^([%S]-%-[`']?)"..lcuc[i].a, "{%1"..lcuc[i].b.."}") + end + for i = 1,#lcuc do + str = string.gsub(str, "(%s[%(%<%[]?)([%S]-%-[`']?)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}") + end + for i = 1,#lcuc do + str = string.gsub(str, "^([%S]-%-ʿ)"..lcuc[i].a, "{%1"..lcuc[i].b.."}") + end + for i = 1,#lcuc do + str = string.gsub(str, "(%s[%(%<%[]?)([%S]-%-ʿ)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}") + end + for i = 1,#lcuc do + str = string.gsub(str, "^([%S]-%-ʾ)"..lcuc[i].a, "{%1"..lcuc[i].b.."}") + end + for i = 1,#lcuc do + str = string.gsub(str, "(%s[%(%<%[]?)([%S]-%-ʾ)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}") + end + for i = 1,#lcuc do + str = string.gsub(str, "^([`'])"..lcuc[i].a, "{%1"..lcuc[i].b.."}") + end + for i = 1,#lcuc do + str = string.gsub(str, "(%s[%(%<%[]?)([`'])"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}") + end + for i = 1,#lcuc do + str = string.gsub(str, "^(ʾ)"..lcuc[i].a, "{%1"..lcuc[i].b.."}") + end + for i = 1,#lcuc do + str = string.gsub(str, "(%s[%(%<%[]?)(ʾ)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}") + end + for i = 1,#lcuc do + str = string.gsub(str, "^(ʿ)"..lcuc[i].a, "{%1"..lcuc[i].b.."}") + end + for i = 1,#lcuc do + str = string.gsub(str, "(%s[%(%<%[]?)(ʿ)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}") + end + for i = 1,#lcuc do + str = string.gsub(str, "^"..lcuc[i].a, lcuc[i].b) + end + for i = 1,#lcuc do + str = string.gsub(str, "(%s[%(%<%[]?)"..lcuc[i].a, "%1"..lcuc[i].b) end -return "\\txtrans{"..str.."}" + return "\\txtrans{"..str.."}" end -- this function is adapted from an 'obsolete project' of Khaled |