aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arabluatex.dtx22
-rw-r--r--arabluatex.lua13
-rw-r--r--arabluatex_voc.lua4
3 files changed, 36 insertions, 3 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index b97ce4e..e6b680e 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -3692,9 +3692,9 @@ wa-ya.sIru ta.hta 'l-jild-i
3692% Lua functions to insert transliterated Arabic text. Therefore, it is 3692% Lua functions to insert transliterated Arabic text. Therefore, it is
3693% not documented. 3693% not documented.
3694% \begin{macrocode} 3694% \begin{macrocode}
3695\DeclareDocumentCommand{\txarb}{+m}{\bgroup\textdir 3695\NewDocumentCommand{\txarb}{+m}{\bgroup\textdir
3696 TRT\arabicfont#1\egroup} 3696 TRT\arabicfont#1\egroup}
3697\DeclareDocumentCommand{\txtrans}{+m}{\bgroup\textdir 3697\NewDocumentCommand{\txtrans}{+m}{\bgroup\textdir
3698 TLT\al@trans@font#1\egroup} 3698 TLT\al@trans@font#1\egroup}
3699% \end{macrocode} 3699% \end{macrocode}
3700% \end{macro} 3700% \end{macro}
@@ -3716,7 +3716,7 @@ wa-ya.sIru ta.hta 'l-jild-i
3716% either globally if no option is set, or locally, then passes its 3716% either globally if no option is set, or locally, then passes its
3717% argument to the appropriate Lua function. 3717% argument to the appropriate Lua function.
3718% \begin{macrocode} 3718% \begin{macrocode}
3719\DeclareDocumentCommand{\arb}{O{\al@mode} +m}% 3719\NewDocumentCommand{\arb}{O{\al@mode} +m}%
3720{\edef\@tempa{#1}% 3720{\edef\@tempa{#1}%
3721 \ifx\@tempa\al@mode@voc% 3721 \ifx\@tempa\al@mode@voc%
3722 \bgroup\textdir TRT\arabicfont% 3722 \bgroup\textdir TRT\arabicfont%
@@ -3743,6 +3743,22 @@ wa-ya.sIru ta.hta 'l-jild-i
3743 \fi\fi\fi\fi} 3743 \fi\fi\fi\fi}
3744% \end{macrocode} 3744% \end{macrocode}
3745% \end{macro} 3745% \end{macro}
3746% \begin{macro}{\arbmark}
3747% New command to be documented
3748% \begin{macrocode}
3749\NewDocumentCommand{\garbmark}{m}{%
3750 \bgroup%
3751 \SetInputScheme{arabtex}%
3752 \ifx\al@mode\al@mode@trans%
3753 \luadirect{tex.write(processarbmarks(\luastringN{#1},
3754 \luastringO{trans}))}%
3755 \else%
3756 \luadirect{tex.write(processarbmarks(\luastringN{#1},
3757 \luastringO{notrans}))}%
3758 \fi\egroup}
3759% \end{macrocode}
3760%
3761% \end{macro}
3746% \begin{environment}{arab} 3762% \begin{environment}{arab}
3747% The |arab| environment does for paragraphs the same as \cs{arb} does 3763% The |arab| environment does for paragraphs the same as \cs{arb} does
3748% for short insertions of Arabic text. 3764% for short insertions of Arabic text.
diff --git a/arabluatex.lua b/arabluatex.lua
index 2b1360c..2c0e2c2 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -665,6 +665,19 @@ function processtrans(str, mode, rules, scheme)
665return str 665return str
666end 666end
667 667
668function processarbmarks(str, mode)
669 if mode == "trans" then
670 for i = 1,#arbmarks do
671 str = string.gsub(str, arbmarks[i].a, arbmarks[i].c)
672 end
673 else
674 for i = 1,#arbmarks do
675 str = string.gsub(str, arbmarks[i].a, arbmarks[i].b)
676 end
677 end
678 return str
679end
680
668function uc(str) 681function uc(str)
669 str = string.gsub(str, "(\\txtrans.?)(%b{})", function(tag, body) 682 str = string.gsub(str, "(\\txtrans.?)(%b{})", function(tag, body)
670 body = string.sub(body, 2, -2) 683 body = string.sub(body, 2, -2)
diff --git a/arabluatex_voc.lua b/arabluatex_voc.lua
index a0108fe..b27efdc 100644
--- a/arabluatex_voc.lua
+++ b/arabluatex_voc.lua
@@ -22,6 +22,10 @@ along with this program. If not, see
22<http://www.gnu.org/licenses/>. 22<http://www.gnu.org/licenses/>.
23--]] 23--]]
24 24
25arbmarks = {
26 {a="bismillah", b="﷽", c="\\arb{bi-ismi \\uc{'l-l_ahi} 'l-ra.hm_ani 'l-ra.hImi}"}
27}
28
25abjad = { 29abjad = {
26{"a\"'", "b", "j", "d", "h", "w", "z", ".h", ".t"}, 30{"a\"'", "b", "j", "d", "h", "w", "z", ".h", ".t"},
27{"y", "k", "l", "m", "n", "s", "`", "f", ".s", }, 31{"y", "k", "l", "m", "n", "s", "`", "f", ".s", },