diff options
author | Karl Berry <karl@freefriends.org> | 2017-04-10 22:02:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-04-10 22:02:09 +0000 |
commit | 9550d81dd608276fa34b7ad4d76623ed1bf0b585 (patch) | |
tree | db71021ea4db4e4980eb925d03625194eefc5999 /Master/texmf-dist/tex/lualatex | |
parent | 3813f353852891036ded396c3d78a8803c0b9385 (diff) |
arabluatex
git-svn-id: svn://tug.org/texlive/trunk@43739 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex')
3 files changed, 102 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua index 3b76376b80d..86445887daf 100644 --- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua @@ -157,6 +157,11 @@ local function takeoutabjad(str) 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") + return string.format("%s{%s}", tag, body) + end) str = string.gsub(str, "(\\cap.?)(%b{})", function(tag, body) body = string.sub(body, 2, -2) return string.format("%s", body) @@ -497,8 +502,8 @@ 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) + for i = 1,#hamzatrarabica do + inside = string.gsub(inside, hamzatrarabica[i].a, hamzatrarabica[i].b) end for i = 1,#tanwintrloc do inside = string.gsub(inside, tanwintrloc[i].a, tanwintrloc[i].b) @@ -512,8 +517,8 @@ local function transarabica(str) 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) + for i = 1,#longvtrarabica do + inside = string.gsub(inside, longvtrarabica[i].a, longvtrarabica[i].b) end for i = 1,#shortvtrloc do inside = string.gsub(inside, shortvtrloc[i].a, shortvtrloc[i].b) diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty index 9fa2c6e1a6b..a2e9afd7821 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/30 v1.8 An ArabTeX-like interface for LuaLaTeX] +[2017/04/02 v1.8.2 An ArabTeX-like interface for LuaLaTeX] \RequirePackage{ifluatex} \ifluatex\else \PackageError{arabluatex}{lualatex needed}{% @@ -112,6 +112,7 @@ \NewDocumentCommand{\SetArbUp}{m}{\RenewDocumentCommand{\al@arbup}{m}{#1}} \DeclareDocumentCommand{\cap}{m}% {\luadirect{tex.sprint(cap(\luastringN{#1}))}} +\let\Cap\cap \DeclareDocumentCommand{\txarb}{+m}{\bgroup\textdir TRT\arabicfont#1\egroup} \DeclareDocumentCommand{\txtrans}{+m}{\bgroup\textdir diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua index daf4c91a4fe..4463b6cf2fd 100644 --- a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua @@ -328,13 +328,15 @@ 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="iyyaT(%p?)$", b="īyaT%1"}, + {a="iyyaT(%p?%s)", b="īyaT%1"}, + {a="iyy(%p?)$", b="ī%1"}, + {a="iyy(%p?%s)", b="ī%1"}, + -- {a="T([^uai])", b="%1"}, + {a="T(\\arbup)", b="t%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([%|\"])", b="t%1"}, {a="T(%p?%s)", b="h%1"}, {a="T(%p?)$", b="h%1"}, {a="T(%p?)(%W)", b="h%1%2"}, @@ -551,15 +553,15 @@ 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(%p?)$", b="ī%1"}, + {a="iyy(%p?%s)", b="ī%1"}, {a="iyy", b="īy"}, {a="([tkdsg])(h)", b="%1'%2"}, -- {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(%p?)$", b="h%1"}, + {a="T(%p?%s)", b="h%1"}, {a="_t", b="th"}, {a="%^g", b="j"}, {a="%.h", b="ḥ"}, @@ -629,10 +631,78 @@ finaltrloc = { -- arabica +hamzatrarabica = { -- ≠ from hamzatrloc: initial hamza has to be held + -- hard coded hamza + {a="|\"'", b="ʾ"}, + {a="A\"'", b="ʾA"}, + {a="[au]\"'", b="ʾ"}, + {a="w\"'", b="ʾ"}, + {a="i\"'", b="ʾ"}, + {a="y\"'", b="ʾ"}, + -- hamza takes tašdīd too + {a="''([Uu])", b="ʾʾ%1"}, + {a="''([Aa])", b="ʾʾ%1"}, + {a="''([Ii])", b="ʾʾ%1"}, + -- initial long u and i (for a, see below) + {a="%'%_U", b="U"}, + {a="%'%_I", b="I"}, + -- taḫfīfu 'l-hamza + {a="^'u'([^uaiUAI])", b="U%1"}, + {a="(%W)'u'([^uaiUAI])", b="%1U%2"}, + {a="'u'([^uaiUAI])", b="ʾU"}, + {a="^'i'([^uaiUAI])", b="I%1"}, + {a="(%W)'i'([^uaiUAI])", b="%1I%2"}, + {a="'i'([^uaiUAI])", b="ʾI"}, + -- madda (historic writing below) + {a="^(')(A)", b="%2"}, + {a="(%W)(')(A)", b="%1%3"}, + {a="^'a'([^uaiUAI])", b="A%1"}, + {a="(%W)'a'([^uaiUAI])", b="%1A%2"}, + {a="'a'([^uaiUAI])", b="A%1"}, + {a="^'a?A", b="A"}, + {a="(%W)'a?A", b="%1A"}, + {a="'a?A", b="ʾA"}, + {a="(A)(')(i)$", b="%1ʾ%3"}, + {a="(A)(')(i)(%W)", b="%1ʾ%3%4"}, + {a="(A)(')(i)", b="%1ʾ%3"}, -- historic madda + {a="(A)(')", b="%1ʾ"}, -- historic madda + -- initial (needs both ^ and %W patterns): + -- hold it for now (see below, beginning of digraphs table) + {a="^(')([ua])", b="@%2"}, + {a="^(')(i)", b="@%2"}, + {a="(%W)(')([ua])", b="%1@%3"}, + {a="(%W)(')(i)", b="%1@%3"}, + -- final + {a="([Iy])(')(aN)$", b="%1ʾ%3"}, + {a="([Iy])(')(aN)(%W)", b="%1ʾ%3%4"}, + {a="([^uai])(')([uai]N?)$", b="%1ʾ%3"}, + {a="([^uai])(')([uai]N?)(%W)", b="%1ʾ%3%4"}, + {a="([UI])(')([uai])$", b="%1ʾ%3"}, + {a="([UI])(')([uai])(%W)", b="%1ʾ%3%4"}, + -- middle + {a="(U)(')", b="%1ʾ"}, + {a="([Iy])(')", b="%1ʾ"}, + {a="([^uai])(')([uU])", b="%1ʾ%3"}, + {a="([^uai])(')([aA])", b="%1ʾ%3"}, + {a="([^uai])(')([iI])", b="%1ʾ%3"}, + {a="(u)(')([uU])", b="%1ʾ%3"}, + {a="(u)(')([aA])", b="%1ʾ%3"}, + {a="(u)(')([iI])", b="%1ʾ%3"}, + {a="(a)(')([aA])", b="%1ʾ%3"}, + {a="(a)(')([uU])", b="%1ʾ%3"}, + {a="(a)(')([iI])", b="%1ʾ%3"}, + {a="(i)(')([aA])", b="%1ʾ%3"}, + {a="(i)(')([uU])", b="%1ʾ%3"}, + {a="(i)(')([iI])", b="%1ʾ%3"}, + {a="(a)(')([^uaiUAI])", b="%1ʾ%3"}, + {a="(u)(')([^uaiUAI])", b="%1ʾ%3"}, + {a="(i)(')([^uaiUAI])", b="%1ʾ%3"} +} + 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 + {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"}, @@ -680,6 +750,8 @@ trigraphstrarabica = { -- trigraphs or more } digraphstrarabica = { + {a="([uai]%-)(\"?[uai])", b="%1"}, -- hyphen + initial alif without hamza + {a="@", b=""}, -- remove the tag before the former hamza -- discard the ʾiʿrāb hyphen (begin) {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"}, {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"}, @@ -696,13 +768,13 @@ digraphstrarabica = { {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="iyy(%p?)$", b="ī%1"}, + {a="iyy(%p?%s)", 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="aT(%p?)$", b="a%1"}, + {a="aT(%p?%s)", b="a%1"}, {a="_t", b="ṯ"}, {a="%^g", b="ğ"}, {a="%.h", b="ḥ"}, @@ -753,3 +825,8 @@ singletrarabica = { {a="B", b=""} } +longvtrarabica = { + {a="[AY]", b="ā"}, + {a="U", b="ū"}, + {a="I", b="ī"} +} |