summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-03-31 23:23:33 +0000
committerKarl Berry <karl@freefriends.org>2017-03-31 23:23:33 +0000
commit5a79b99deceadff69a94adffd5df61caccfa7554 (patch)
treeb0d921581a99d71ae62cf6fd88e1715d5501b8ed /Master/texmf-dist/tex
parent071026baab3643897ae28725b0cd7120214920dd (diff)
arabluatex (31mar17)
git-svn-id: svn://tug.org/texlive/trunk@43663 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua37
-rw-r--r--Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty2
-rw-r--r--Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua150
3 files changed, 182 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua
index 91932b78213..3b76376b80d 100644
--- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua
+++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua
@@ -494,6 +494,41 @@ local function transloc(str)
return str
end
+local function transarabica(str)
+ str = string.gsub(str, "\\arb(%b{})", function(inside)
+ inside = string.sub(inside, 2, -2)
+ for i = 1,#hamzatrloc do
+ inside = string.gsub(inside, hamzatrloc[i].a, hamzatrloc[i].b)
+ end
+ for i = 1,#tanwintrloc do
+ inside = string.gsub(inside, tanwintrloc[i].a, tanwintrloc[i].b)
+ end
+ for i = 1,#trigraphstrarabica do
+ inside = string.gsub(inside, trigraphstrarabica[i].a, trigraphstrarabica[i].b)
+ end
+ for i = 1,#digraphstrarabica do
+ inside = string.gsub(inside, digraphstrarabica[i].a, digraphstrarabica[i].b)
+ end
+ for i = 1,#singletrarabica do
+ inside = string.gsub(inside, singletrarabica[i].a, singletrarabica[i].b)
+ end
+ for i = 1,#longvtrloc do
+ inside = string.gsub(inside, longvtrloc[i].a, longvtrloc[i].b)
+ end
+ for i = 1,#shortvtrloc do
+ inside = string.gsub(inside, shortvtrloc[i].a, shortvtrloc[i].b)
+ end
+ for i = 1,#punctuationtr do
+ inside = string.gsub(inside, punctuationtr[i].a, punctuationtr[i].b)
+ end
+ for i = 1,#nulltr do
+ inside = string.gsub(inside, nulltr[i].a, nulltr[i].b)
+ end
+ return string.format("\\txtrans{%s}", inside)
+ end)
+return str
+end
+
local function processbuckw(str)
str = string.gsub(str, "\\arb(%b{})", function(inside)
inside = string.sub(inside, 2, -2)
@@ -579,6 +614,8 @@ function processtrans(str, mode, rules, scheme)
str = transdmg(str, rules)
elseif mode == "loc" then
str = transloc(str)
+ elseif mode == "arabica" then
+ str = transarabica(str)
end
str = unprotectarb(str)
return str
diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty
index 19d00ec0646..9fa2c6e1a6b 100644
--- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty
+++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty
@@ -41,7 +41,7 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{arabluatex}%
-[2017/03/18 v1.7.3 An ArabTeX-like interface for LuaLaTeX]
+[2017/03/30 v1.8 An ArabTeX-like interface for LuaLaTeX]
\RequirePackage{ifluatex}
\ifluatex\else
\PackageError{arabluatex}{lualatex needed}{%
diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua
index 5e7dbe5dda6..daf4c91a4fe 100644
--- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua
+++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua
@@ -328,9 +328,16 @@ digraphstrdmg = {
{a="([%_]?[Uu])(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])", b="u%2%3"},
{a="([%_]?[Ii])(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])", b="i%2%3"},
{a="%-%-", b=""},
+ {a="iyyaT$", b="īyaT"},
+ {a="iyyaT(%W)", b="īyaT%1"},
+ {a="iyy$", b="ī"},
+ {a="iyy(%W)", b="ī%1"},
-- {a="T([^uai])", b="%1"},
+ {a="([a%'][%_%^%.]?[tdrzsln]%-)(%S-)T([%(%[%|%<%s])(a[%_%^%.]?[tdrzsln]%-)", b="%1%2h%3%4"}, --p
+ {a="T([%(%[%|%<%s])(a[%_%^%.]?[tdrzsln]%-)", b="t%1%2"}, --p
{a="T(%p?%s)", b="h%1"},
{a="T(%p?)$", b="h%1"},
+ {a="T(%p?)(%W)", b="h%1%2"},
{a="_t", b="ṯ"},
{a="%^g", b="ğ"},
{a="%.h", b="ḥ"},
@@ -479,7 +486,7 @@ tanwintrloc = {
trigraphstrloc = { -- trigraphs or more
-- 'llatI / 'llad_I
{a="^'ll(a)([%_]?[dt])", b="all%1%2"},
- {a="(%s)'ll(a)([%_]?[dt])", b="%1all%2%3"},
+ {a="([%(%[%|%<%s])'ll(a)([%_]?[dt])", b="%1all%2%3"}, --p
-- al- + lām
{a="^(a)l%-(l)", b="%1l-%2"},
{a="(%s)(a)l%-(l)", b="%1%2l-%3"},
@@ -493,7 +500,7 @@ trigraphstrloc = { -- trigraphs or more
{a="^(a)l%-([uai])", b="%1l-%2"},
{a="(%s)(a)l%-([uai])", b="%1%2l-%3"},
-- li-/la- + art. + initial unstable hamza is a special orthography
- {a="l([ai])%-l%-([uai])", b="l%1l-%2"},
+ {a="l([ai])%-l%-([uai])", b="l%1-l-%2"},
-- al- + lunar consonant (i.e. what remains)
{a="^(a)l%-", b="%1l-"},
{a="(%s)(a)l%-", b="%1%2l-"},
@@ -502,13 +509,13 @@ trigraphstrloc = { -- trigraphs or more
-- art. with waṣla + solar consonant
{a="'l%-([%_%^%.]?[tdrzsn])", b="al-%1"},
-- li-/la- + art. + lām
- {a="l([ai])%-l%-(l)", b="l%1-%2"},
+ {a="l([ai])%-l%-(l)", b="l%1-l-%2"},
-- assim. art. with waṣla + solar consonant
{a="'([%_%^%.]?[tdrzsn])%-", b="al-"},
-- li-/la- + art. + solar consonant is a special orthography
- {a="l([ai])%-l%-([%_%^%.]?[tdrzsn])", b="l%1l-%2"},
+ {a="l([ai])%-l%-([%_%^%.]?[tdrzsn])", b="l%1-l-%2"},
-- li-/la- + assim. art. + solar consonant is a special orthography
- {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="l%1l-%3"},
+ {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="l%1-l-%3"},
-- art. with waṣla + initial unstable hamza
{a="'l%-([uai])", b="al-%1"},
-- art. with waṣla + lunar consonant (i.e. what remains)
@@ -544,9 +551,13 @@ digraphstrloc = {
{a="(%s)([uai])", b="%1%2"}, -- initial alif without hamza
{a="%-%-", b=""},
{a="uww", b="ūw"},
+ {a="iyy$", b="ī"},
+ {a="iyy(%W)", b="ī%1"},
{a="iyy", b="īy"},
{a="([tkdsg])(h)", b="%1'%2"},
--- {a="T([^uai])", b="h%1"},
+ -- {a="T([^uai])", b="h%1"},
+ {a="([a%']l%-)(%S-)T([%(%[%|%<%s])(al%-)", b="%1%2h%3%4"}, --p
+ {a="T([%(%[%|%<%s])(al%-)", b="t%1%2"}, --p
{a="T$", b="h"},
{a="T(%W)", b="h%1"},
{a="_t", b="th"},
@@ -615,3 +626,130 @@ shortvtrloc = {
finaltrloc = {
{a="ʾ", b="'"},
}
+
+-- arabica
+
+trigraphstrarabica = { -- trigraphs or more
+ -- 'llatI / 'llad_I
+ {a="^'ll(a)([%_]?[dt])", b="ll%1%2"},
+ {a="([%(%[%|%<%s])'ll(a)([%_]?[dt])", b="%1ll%2%3"}, --p
+ -- al- + lām
+ {a="^(a)l%-(l)", b="%1l-%2"},
+ {a="(%s)(a)l%-(l)", b="%1%2l-%3"},
+ -- al- + solar consonant
+ {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="%1l-%2"},
+ {a="(%s)(a)l%-([%_%^%.]?[tdrzsn])", b="%1%2l-%3"},
+ -- assim. art. + solar consonant
+ {a="^(a)([%_%^%.]?[tdrzsn])%-", b="%1l-"},
+ {a="(%s)(a)([%_%^%.]?[tdrzsn])%-", b="%1%2l-"},
+ -- al- + initial unstable hamza
+ {a="^(a)l%-([uai])", b="%1l-%2"},
+ {a="(%s)(a)l%-([uai])", b="%1%2l-%3"},
+ -- li-/la- + art. + initial unstable hamza is a special orthography
+ {a="l([ai])%-l%-([uai])", b="l%1-l-%2"},
+ -- al- + lunar consonant (i.e. what remains)
+ {a="^(a)l%-", b="%1l-"},
+ {a="(%s)(a)l%-", b="%1%2l-"},
+ -- art. with waṣla + lām
+ {a="'l%-(l)", b="l-%1"},
+ -- art. with waṣla + solar consonant
+ {a="'l%-([%_%^%.]?[tdrzsn])", b="l-%1"},
+ -- li-/la- + art. + lām
+ {a="l([ai])%-l%-(l)", b="l%1-l-%2"},
+ -- assim. art. with waṣla + solar consonant
+ {a="'([%_%^%.]?[tdrzsn])%-", b="l-"},
+ -- li-/la- + art. + solar consonant is a special orthography
+ {a="l([ai])%-l%-([%_%^%.]?[tdrzsn])", b="l%1-l-%2"},
+ -- li-/la- + assim. art. + solar consonant is a special orthography
+ {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="l%1-l-%3"},
+ -- art. with waṣla + initial unstable hamza
+ {a="'l%-([uai])", b="l-%1"},
+ -- art. with waṣla + lunar consonant (i.e. what remains)
+ {a="'l%-", b="l-"},
+ -- the silent wāw
+ {a="uU$", b="u"},
+ {a="uU(%W)", b="u%1"},
+ {a="aU$", b="a"},
+ {a="aU(%W)", b="a%1"},
+ {a="iU$", b="i"},
+ {a="iU(%W)", b="i%1"},
+ -- words ending in -āT with silent wāw/yāʾ
+ {a="(_a)UA", b="A"},
+ {a="(_a)U", b="A"},
+ {a="(_a)I", b="A"}
+}
+
+digraphstrarabica = {
+ -- discard the ʾiʿrāb hyphen (begin)
+ {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"},
+ {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"},
+ {a="(%-)(\"?At[ui])(%p?%s)", b="%2%3"},
+ {a="(%-)(\"?At[ui])(%p?)$", b="%2%3"},
+ {a="(%-)(\"?Ani)(%p?%s)", b="%2%3"},
+ {a="(%-)(\"?Ani)(%p?)$", b="%2%3"},
+ {a="(%-)(\"?ayni)(%p?%s)", b="%2%3"},
+ {a="(%-)(\"?ayni)(%p?)$", b="%2%3"},
+ {a="(%-)([uai])(%p?%s)", b="%2%3"},
+ {a="(%-)([uai])(%p?)$", b="%2%3"},
+ -- discard the ʾiʿrāb hyphen (end)
+ {a="(%-)(\"?[uai])", b="%1%2"}, -- hyphen + initial alif without hamza
+ {a="^(\"?[uai])", b="%1"}, -- initial alif without hamza
+ {a="(%s)([uai])", b="%1%2"}, -- initial alif without hamza
+ {a="%-%-", b=""},
+ {a="iyy$", b="ī"},
+ {a="iyy(%W)", b="ī%1"},
+ -- {a="T([^uai])", b="h%1"},
+ {a="([a%']l%-)(%S-)aT([%(%[%|%<%s])(al%-)", b="%1%2a%3%4"}, --p
+ {a="aT([%(%[%|%<%s])(al%-)", b="at%1%2"}, --p
+ {a="aT$", b="a"},
+ {a="aT(%W)", b="a%1"},
+ {a="_t", b="ṯ"},
+ {a="%^g", b="ğ"},
+ {a="%.h", b="ḥ"},
+ {a="_h", b="ḫ"},
+ {a="_d", b="ḏ"},
+ {a="%^s", b="š"},
+ {a="%.s", b="ṣ"},
+ {a="%.d", b="ḍ"},
+ {a="%.t", b="ṭ"},
+ {a="%.z", b="ẓ"},
+ {a="%.g", b="ġ"},
+ {a="(U)(A)", b="ū"},
+ {a="WA", b="w"},
+ {a="(a)W", b="%1w"},
+ {a="_A", b="ā"},
+ {a="_u", b="ū"},
+ {a="_a", b="ā"},
+ {a="_i", b="ī"},
+ {a="%.b", b="b"},
+ {a="%.f", b="f"},
+ {a="%.q", b="q"},
+ {a="%.k", b="k"},
+ {a="%.n", b="n"},
+ {a="%^d", b="d"}
+}
+
+singletrarabica = {
+ {a="b", b="b"},
+ {a="t", b="t"},
+ {a="j", b="ğ"},
+ {a="x", b="ḫ"},
+ {a="d", b="d"},
+ {a="r", b="r"},
+ {a="z", b="z"},
+ {a="s", b="s"},
+ {a="`", b="ʿ"},
+ {a="f", b="f"},
+ {a="q", b="q"},
+ {a="k", b="k"},
+ {a="l", b="l"},
+ {a="m", b="m"},
+ {a="n", b="n"},
+ {a="h", b="h"},
+ {a="w", b="w"},
+ {a="y", b="y"},
+ {a="T", b="t"},
+ {a="\"", b=""},
+ {a="B", b=""}
+}
+