aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arabluatex.dtx17
-rw-r--r--arabluatex.lua10
2 files changed, 20 insertions, 7 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index 1a5df1f..bcc391e 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -3439,12 +3439,13 @@ wa-ya.sIru ta.hta 'l-jild-i
3439% \end{macrocode} 3439% \end{macrocode}
3440% Declare the global options, and define them: 3440% Declare the global options, and define them:
3441% \begin{macrocode} 3441% \begin{macrocode}
3442\DeclareOption{voc}{\def\al@mode{voc}} 3442\RequirePackage{xkeyval}
3443\DeclareOption{fullvoc}{\def\al@mode{fullvoc}} 3443\DeclareOptionX{voc}{\def\al@mode{voc}}
3444\DeclareOption{novoc}{\def\al@mode{novoc}} 3444\DeclareOptionX{fullvoc}{\def\al@mode{fullvoc}}
3445\DeclareOption{trans}{\def\al@mode{trans}} 3445\DeclareOptionX{novoc}{\def\al@mode{novoc}}
3446\ExecuteOptions{voc} 3446\DeclareOptionX{trans}{\def\al@mode{trans}}
3447\ProcessOptions\relax 3447\ExecuteOptionsX{voc}
3448\ProcessOptionsX\relax
3448\def\al@mode@voc{voc} 3449\def\al@mode@voc{voc}
3449\def\al@mode@fullvoc{fullvoc} 3450\def\al@mode@fullvoc{fullvoc}
3450\def\al@mode@novoc{novoc} 3451\def\al@mode@novoc{novoc}
@@ -3460,7 +3461,7 @@ wa-ya.sIru ta.hta 'l-jild-i
3460\RequirePackage{xparse} 3461\RequirePackage{xparse}
3461\RequirePackage{environ} 3462\RequirePackage{environ}
3462\RequirePackage{adjustbox} 3463\RequirePackage{adjustbox}
3463\RequirePackage{xkeyval} 3464\RequirePackage{newfile}
3464% \end{macrocode} 3465% \end{macrocode}
3465% The following boolean will be set to |true| in |RL| mode: 3466% The following boolean will be set to |true| in |RL| mode:
3466% \begin{macrocode} 3467% \begin{macrocode}
@@ -3659,6 +3660,8 @@ wa-ya.sIru ta.hta 'l-jild-i
3659 {\luadirect{tex.sprint(uc(\luastringN{#1}))}} 3660 {\luadirect{tex.sprint(uc(\luastringN{#1}))}}
3660% \end{macrocode} 3661% \end{macrocode}
3661% \end{macro} 3662% \end{macro}
3663% \package{arabluatex} is able to write out unicode Arabic or unicode
3664% transliterated Arabic to an external file.
3662% \begin{macro}{\Uc} \cs{uc} may be used safely in all of the modes 3665% \begin{macro}{\Uc} \cs{uc} may be used safely in all of the modes
3663% that are provided by \package{arabluatex} as any of the |voc|, 3666% that are provided by \package{arabluatex} as any of the |voc|,
3664% |fullvoc| and |novoc| modes discard it on top of any other 3667% |fullvoc| and |novoc| modes discard it on top of any other
diff --git a/arabluatex.lua b/arabluatex.lua
index 088d241..2adcdb0 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -670,6 +670,9 @@ function uc(str)
670 body = string.sub(body, 2, -2) 670 body = string.sub(body, 2, -2)
671 return string.format("%s", body) 671 return string.format("%s", body)
672 end) 672 end)
673 -- Allah and ibn
674 str = string.gsub(str, "([%'%-]?)(l%-lāh)([uai]?)", "%1{Llāh%3}")
675 str = string.gsub(str, "(al%-lāh)([uai]?)", "{Allāh%2}")
673 str = string.gsub(str, "(%s[%(%<%[]?)([i%']?b[n%.])", "%1{%2}") 676 str = string.gsub(str, "(%s[%(%<%[]?)([i%']?b[n%.])", "%1{%2}")
674 for i = 1,#lcuc do 677 for i = 1,#lcuc do
675 str = string.gsub(str, "^([%S]-%-[`']?)"..lcuc[i].a, "{%1"..lcuc[i].b.."}") 678 str = string.gsub(str, "^([%S]-%-[`']?)"..lcuc[i].a, "{%1"..lcuc[i].b.."}")
@@ -758,3 +761,10 @@ function aemph(str)
758 end 761 end
759 return str 762 return str
760end 763end
764
765function writevrb(str)
766 local f = io.open(tex.jobname.."-out.tex", "a+")
767 f:write(str)
768 f:close()
769 return true
770end