From 79c0fac2e0890107ddc1a0f5e60ef11cba305c3f Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Mon, 22 Jan 2018 19:06:23 +0100 Subject: use xkeyval for package option processing; process the name of God through \prname{} --- arabluatex.dtx | 17 ++++++++++------- arabluatex.lua | 10 ++++++++++ 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 % \end{macrocode} % Declare the global options, and define them: % \begin{macrocode} -\DeclareOption{voc}{\def\al@mode{voc}} -\DeclareOption{fullvoc}{\def\al@mode{fullvoc}} -\DeclareOption{novoc}{\def\al@mode{novoc}} -\DeclareOption{trans}{\def\al@mode{trans}} -\ExecuteOptions{voc} -\ProcessOptions\relax +\RequirePackage{xkeyval} +\DeclareOptionX{voc}{\def\al@mode{voc}} +\DeclareOptionX{fullvoc}{\def\al@mode{fullvoc}} +\DeclareOptionX{novoc}{\def\al@mode{novoc}} +\DeclareOptionX{trans}{\def\al@mode{trans}} +\ExecuteOptionsX{voc} +\ProcessOptionsX\relax \def\al@mode@voc{voc} \def\al@mode@fullvoc{fullvoc} \def\al@mode@novoc{novoc} @@ -3460,7 +3461,7 @@ wa-ya.sIru ta.hta 'l-jild-i \RequirePackage{xparse} \RequirePackage{environ} \RequirePackage{adjustbox} -\RequirePackage{xkeyval} +\RequirePackage{newfile} % \end{macrocode} % The following boolean will be set to |true| in |RL| mode: % \begin{macrocode} @@ -3659,6 +3660,8 @@ wa-ya.sIru ta.hta 'l-jild-i {\luadirect{tex.sprint(uc(\luastringN{#1}))}} % \end{macrocode} % \end{macro} +% \package{arabluatex} is able to write out unicode Arabic or unicode +% transliterated Arabic to an external file. % \begin{macro}{\Uc} \cs{uc} may be used safely in all of the modes % that are provided by \package{arabluatex} as any of the |voc|, % |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) body = string.sub(body, 2, -2) return string.format("%s", body) end) + -- Allah and ibn + str = string.gsub(str, "([%'%-]?)(l%-lāh)([uai]?)", "%1{Llāh%3}") + str = string.gsub(str, "(al%-lāh)([uai]?)", "{Allāh%2}") str = string.gsub(str, "(%s[%(%<%[]?)([i%']?b[n%.])", "%1{%2}") for i = 1,#lcuc do str = string.gsub(str, "^([%S]-%-[`']?)"..lcuc[i].a, "{%1"..lcuc[i].b.."}") @@ -758,3 +761,10 @@ function aemph(str) end return str end + +function writevrb(str) + local f = io.open(tex.jobname.."-out.tex", "a+") + f:write(str) + f:close() + return true +end -- cgit v1.2.3