aboutsummaryrefslogtreecommitdiff
path: root/arabluatex.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'arabluatex.dtx')
-rw-r--r--arabluatex.dtx75
1 files changed, 38 insertions, 37 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index 8f13acd..4f185ce 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -4327,9 +4327,9 @@ wa-ya.sIru ta.hta 'l-jild-i
4327\DeclareOptionX{trans}{\def\al@mode{trans}} 4327\DeclareOptionX{trans}{\def\al@mode{trans}}
4328\define@boolkey{arabluatex.sty}[@pkg@]{export}[true]{% 4328\define@boolkey{arabluatex.sty}[@pkg@]{export}[true]{%
4329 \if@pkg@export% 4329 \if@pkg@export%
4330 \AtBeginDocument{\luadirect{al_openstream()}% 4330 \AtBeginDocument{\luadirect{arabluatex.openstream()}%
4331 \MkArbBreak{@al@ob,@al@cb,@al@cb@sp}} 4331 \MkArbBreak{@al@ob,@al@cb,@al@cb@sp}}
4332 \AtEndDocument{\luadirect{al_closestream()}} 4332 \AtEndDocument{\luadirect{arabluatex.closestream()}}
4333 \else\fi} 4333 \else\fi}
4334\ExecuteOptionsX{voc} 4334\ExecuteOptionsX{voc}
4335\ProcessOptionsX\relax 4335\ProcessOptionsX\relax
@@ -4415,8 +4415,8 @@ wa-ya.sIru ta.hta 'l-jild-i
4415% \begin{macrocode} 4415% \begin{macrocode}
4416\NewDocumentCommand{\MkArbBreak}{s m}{% 4416\NewDocumentCommand{\MkArbBreak}{s m}{%
4417 \IfBooleanTF{#1} 4417 \IfBooleanTF{#1}
4418 {\luadirect{mkarbbreak(\luastringN{#2}, "out")}} 4418 {\luadirect{arabluatex.mkarbbreak(\luastringN{#2}, "out")}}
4419 {\luadirect{mkarbbreak(\luastringN{#2}, "dflt")}} 4419 {\luadirect{arabluatex.mkarbbreak(\luastringN{#2}, "dflt")}}
4420} 4420}
4421% \end{macrocode} 4421% \end{macrocode}
4422% \end{macro} 4422% \end{macro}
@@ -4437,12 +4437,12 @@ wa-ya.sIru ta.hta 'l-jild-i
4437\AtBeginDocument{\ifdef{\aemph}% 4437\AtBeginDocument{\ifdef{\aemph}%
4438 {\RenewDocumentCommand{\aemph}{s m}{% 4438 {\RenewDocumentCommand{\aemph}{s m}{%
4439 \IfBooleanTF{#1}{% 4439 \IfBooleanTF{#1}{%
4440 \luadirect{tex.sprint(aemph(\luastringN{#2}, "over"))}} 4440 \luadirect{tex.sprint(arabluatex.aemph(\luastringN{#2}, "over"))}}
4441 {\luadirect{tex.sprint(aemph(\luastringN{#2}, "dflt"))}}}} 4441 {\luadirect{tex.sprint(arabluatex.aemph(\luastringN{#2}, "dflt"))}}}}
4442 {\NewDocumentCommand{\aemph}{s m}{% 4442 {\NewDocumentCommand{\aemph}{s m}{%
4443 \IfBooleanTF{#1}{% 4443 \IfBooleanTF{#1}{%
4444 \luadirect{tex.sprint(aemph(\luastringN{#2}, "over"))}} 4444 \luadirect{tex.sprint(arabluatex.aemph(\luastringN{#2}, "over"))}}
4445 {\luadirect{tex.sprint(aemph(\luastringN{#2}, "dflt"))}}}}} 4445 {\luadirect{tex.sprint(arabluatex.aemph(\luastringN{#2}, "dflt"))}}}}}
4446% \end{macrocode} 4446% \end{macrocode}
4447% \end{macro} 4447% \end{macro}
4448% \end{macro} 4448% \end{macro}
@@ -4567,7 +4567,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4567% uppercased. \cs{uc} is actually coded in Lua. 4567% uppercased. \cs{uc} is actually coded in Lua.
4568% \begin{macrocode} 4568% \begin{macrocode}
4569\NewDocumentCommand{\uc}{m}% 4569\NewDocumentCommand{\uc}{m}%
4570 {\luadirect{tex.sprint(uc(\luastringN{#1}))}} 4570 {\luadirect{tex.sprint(arabluatex.uc(\luastringN{#1}))}}
4571% \end{macrocode} 4571% \end{macrocode}
4572% \end{macro} 4572% \end{macro}
4573% \begin{macro}{\Uc} \cs{uc} can be used safely in all of the modes 4573% \begin{macro}{\Uc} \cs{uc} can be used safely in all of the modes
@@ -4638,22 +4638,22 @@ wa-ya.sIru ta.hta 'l-jild-i
4638{\edef\@tempa{#1}% 4638{\edef\@tempa{#1}%
4639 \ifx\@tempa\al@mode@voc% 4639 \ifx\@tempa\al@mode@voc%
4640 \bgroup\booltrue{al@rlmode}\textdir TRT\arabicfont% 4640 \bgroup\booltrue{al@rlmode}\textdir TRT\arabicfont%
4641 \luadirect{tex.sprint(processvoc(\luastringN{#2}, 4641 \luadirect{tex.sprint(arabluatex.processvoc(\luastringN{#2},
4642 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup% 4642 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
4643 \else% 4643 \else%
4644 \ifx\@tempa\al@mode@fullvoc% 4644 \ifx\@tempa\al@mode@fullvoc%
4645 \bgroup\booltrue{al@rlmode}\textdir TRT\arabicfont% 4645 \bgroup\booltrue{al@rlmode}\textdir TRT\arabicfont%
4646 \luadirect{tex.sprint(processfullvoc(\luastringN{#2}, 4646 \luadirect{tex.sprint(arabluatex.processfullvoc(\luastringN{#2},
4647 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup% 4647 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
4648 \else% 4648 \else%
4649 \ifx\@tempa\al@mode@novoc% 4649 \ifx\@tempa\al@mode@novoc%
4650 \bgroup\booltrue{al@rlmode}\textdir TRT\arabicfont% 4650 \bgroup\booltrue{al@rlmode}\textdir TRT\arabicfont%
4651 \luadirect{tex.sprint(processnovoc(\luastringN{#2}, 4651 \luadirect{tex.sprint(arabluatex.processnovoc(\luastringN{#2},
4652 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup% 4652 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
4653 \else% 4653 \else%
4654 \ifx\@tempa\al@mode@trans% 4654 \ifx\@tempa\al@mode@trans%
4655 \bgroup\textdir TLT\al@trans@font\al@trans@style% 4655 \bgroup\textdir TLT\al@trans@font\al@trans@style%
4656 \luadirect{tex.sprint(processtrans(\luastringN{#2}, 4656 \luadirect{tex.sprint(arabluatex.processtrans(\luastringN{#2},
4657 \luastringO{\al@trans@convention}, 4657 \luastringO{\al@trans@convention},
4658 \luastringO{\al@arb@rules}, 4658 \luastringO{\al@arb@rules},
4659 \luastringO{\al@input@scheme}))}\egroup% 4659 \luastringO{\al@input@scheme}))}\egroup%
@@ -4674,7 +4674,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4674\NewDocumentCommand{\arbmark}{O{} m}{% 4674\NewDocumentCommand{\arbmark}{O{} m}{%
4675 \bgroup% 4675 \bgroup%
4676 \SetInputScheme{arabtex}% 4676 \SetInputScheme{arabtex}%
4677 \luadirect{tex.sprint(processarbmarks(\luastringN{#2}, 4677 \luadirect{tex.sprint(arabluatex.processarbmarks(\luastringN{#2},
4678 \luastringN{#1}))}% 4678 \luastringN{#1}))}%
4679 \egroup} 4679 \egroup}
4680% \end{macrocode} 4680% \end{macrocode}
@@ -4688,7 +4688,8 @@ wa-ya.sIru ta.hta 'l-jild-i
4688% romanized Arabic. 4688% romanized Arabic.
4689% \begin{macrocode} 4689% \begin{macrocode}
4690\NewDocumentCommand{\newarbmark}{m m m}{% 4690\NewDocumentCommand{\newarbmark}{m m m}{%
4691 \luadirect{newarbmark(\luastringN{#1}, \luastringN{#2}, \luastringN{#3})}} 4691 \luadirect{arabluatex.newarbmark(\luastringN{#1}, \luastringN{#2},
4692 \luastringN{#3})}}
4692% \end{macrocode} 4693% \end{macrocode}
4693% \end{macro} 4694% \end{macro}
4694% \begin{environment}{arab} 4695% \begin{environment}{arab}
@@ -4700,24 +4701,24 @@ wa-ya.sIru ta.hta 'l-jild-i
4700 \ifx\@tempa\al@mode@voc% 4701 \ifx\@tempa\al@mode@voc%
4701 \booltrue{al@rlmode}% 4702 \booltrue{al@rlmode}%
4702 \bgroup\pardir TRT\textdir TRT\arabicfont% 4703 \bgroup\pardir TRT\textdir TRT\arabicfont%
4703 \luadirect{tex.sprint(processvoc(\luastringO{\BODY}, 4704 \luadirect{tex.sprint(arabluatex.processvoc(\luastringO{\BODY},
4704 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup% 4705 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
4705 \else% 4706 \else%
4706 \ifx\@tempa\al@mode@fullvoc% 4707 \ifx\@tempa\al@mode@fullvoc%
4707 \booltrue{al@rlmode}% 4708 \booltrue{al@rlmode}%
4708 \bgroup\pardir TRT\textdir TRT\arabicfont% 4709 \bgroup\pardir TRT\textdir TRT\arabicfont%
4709 \luadirect{tex.sprint(processfullvoc(\luastringO{\BODY}, 4710 \luadirect{tex.sprint(arabluatex.processfullvoc(\luastringO{\BODY},
4710 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup% 4711 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
4711 \else% 4712 \else%
4712 \ifx\@tempa\al@mode@novoc% 4713 \ifx\@tempa\al@mode@novoc%
4713 \booltrue{al@rlmode}% 4714 \booltrue{al@rlmode}%
4714 \bgroup\pardir TRT\textdir TRT\arabicfont% 4715 \bgroup\pardir TRT\textdir TRT\arabicfont%
4715 \luadirect{tex.sprint(processnovoc(\luastringO{\BODY}, 4716 \luadirect{tex.sprint(arabluatex.processnovoc(\luastringO{\BODY},
4716 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup% 4717 \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
4717 \else% 4718 \else%
4718 \ifx\@tempa\al@mode@trans% 4719 \ifx\@tempa\al@mode@trans%
4719 \bgroup\pardir TLT\textdir TLT\al@trans@font\al@trans@style% 4720 \bgroup\pardir TLT\textdir TLT\al@trans@font\al@trans@style%
4720 \luadirect{tex.sprint(processtrans(\luastringO{\BODY}, 4721 \luadirect{tex.sprint(arabluatex.processtrans(\luastringO{\BODY},
4721 \luastringO{\al@trans@convention}, 4722 \luastringO{\al@trans@convention},
4722 \luastringO{\al@arb@rules}, 4723 \luastringO{\al@arb@rules},
4723 \luastringO{\al@input@scheme}))}\egroup% 4724 \luastringO{\al@input@scheme}))}\egroup%
@@ -4758,11 +4759,11 @@ wa-ya.sIru ta.hta 'l-jild-i
4758 \if@pkg@export\ifal@verse@export% 4759 \if@pkg@export\ifal@verse@export%
4759 \ArbOutFile{\begin{arabverse}}% 4760 \ArbOutFile{\begin{arabverse}}%
4760 % \ifx\al@mode\al@mode@trans% 4761 % \ifx\al@mode\al@mode@trans%
4761 % \luadirect{tooutfile(\luastringN{[#1]})}% 4762 % \luadirect{arabluatex.tooutfile(\luastringN{[#1]})}%
4762 % \else% 4763 % \else%
4763 \IfSubStr[1]{#1}{utf}% 4764 \IfSubStr[1]{#1}{utf}%
4764 {\luadirect{tooutfile(\luastringN{[#1]})}}% 4765 {\luadirect{arabluatex.tooutfile(\luastringN{[#1]})}}%
4765 {\luadirect{tooutfile(\luastringN{[#1, utf]})}}% 4766 {\luadirect{arabluatex.tooutfile(\luastringN{[#1, utf]})}}%
4766 % \fi 4767 % \fi
4767 \else\fi\else\fi\egroup% 4768 \else\fi\else\fi\egroup%
4768 \par\centering\noindent\bgroup\setkeys[al]{verse}[metre]{#1}% 4769 \par\centering\noindent\bgroup\setkeys[al]{verse}[metre]{#1}%
@@ -4852,13 +4853,13 @@ wa-ya.sIru ta.hta 'l-jild-i
4852 \ifdefined\abjad% 4853 \ifdefined\abjad%
4853 \RenewDocumentCommand{\abjad}{m}% 4854 \RenewDocumentCommand{\abjad}{m}%
4854 {\ifbool{al@rlmode}% 4855 {\ifbool{al@rlmode}%
4855 {\oline*{\luadirect{tex.sprint(abjadify(\luastring{#1}))}}} 4856 {\oline*{\luadirect{tex.sprint(arabluatex.abjadify(\luastring{#1}))}}}
4856 {\luadirect{tex.sprint(abjadify(\luastring{#1}))}}} 4857 {\luadirect{tex.sprint(arabluatex.abjadify(\luastring{#1}))}}}
4857 \else% 4858 \else%
4858 \NewDocumentCommand{\abjad}{m}% 4859 \NewDocumentCommand{\abjad}{m}%
4859 {\ifbool{al@rlmode}% 4860 {\ifbool{al@rlmode}%
4860 {\oline*{\luadirect{tex.sprint(abjadify(\luastring{#1}))}}} 4861 {\oline*{\luadirect{tex.sprint(arabluatex.abjadify(\luastring{#1}))}}}
4861 {\luadirect{tex.sprint(abjadify(\luastring{#1}))}}} 4862 {\luadirect{tex.sprint(arabluatex.abjadify(\luastring{#1}))}}}
4862 \fi} 4863 \fi}
4863% \end{macrocode} 4864% \end{macrocode}
4864% \end{macro} 4865% \end{macro}
@@ -4868,7 +4869,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4868% depending on the mode which is selected. 4869% depending on the mode which is selected.
4869% \begin{macrocode} 4870% \begin{macrocode}
4870\NewDocumentCommand{\ayah}{m}{% 4871\NewDocumentCommand{\ayah}{m}{%
4871 \luadirect{tex.sprint(ayah(\luastringN{#1}))}} 4872 \luadirect{tex.sprint(arabluatex.ayah(\luastringN{#1}))}}
4872% \end{macrocode} 4873% \end{macrocode}
4873% \end{macro} 4874% \end{macro}
4874% 4875%
@@ -4890,7 +4891,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4890% expresses its argument between braces.} 4891% expresses its argument between braces.}
4891% \begin{macrocode} 4892% \begin{macrocode}
4892\NewDocumentCommand{\abraces}{+m}{% 4893\NewDocumentCommand{\abraces}{+m}{%
4893 \luadirect{tex.sprint(abraces(\luastringN{#1}))}} 4894 \luadirect{tex.sprint(arabluatex.abraces(\luastringN{#1}))}}
4894% \end{macrocode} 4895% \end{macrocode}
4895% \end{macro} 4896% \end{macro}
4896% \begin{macro}{\LRmarginpar} \cs{LRmarginpar} is supposed to be 4897% \begin{macro}{\LRmarginpar} \cs{LRmarginpar} is supposed to be
@@ -4940,7 +4941,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4940% set with \cs{SetArbOutSuffix}\marg{suffix}. 4941% set with \cs{SetArbOutSuffix}\marg{suffix}.
4941% \begin{macrocode} 4942% \begin{macrocode}
4942\NewDocumentCommand{\SetArbOutSuffix}{m}{ 4943\NewDocumentCommand{\SetArbOutSuffix}{m}{
4943 \luadirect{al_utffilesuffix(\luastringN{#1})}} 4944 \luadirect{arabluatex.utffilesuffix(\luastringN{#1})}}
4944% \end{macrocode} 4945% \end{macrocode}
4945% \end{macro} 4946% \end{macro}
4946% \begin{macro}{\ArbOutFile} 4947% \begin{macro}{\ArbOutFile}
@@ -4958,8 +4959,8 @@ wa-ya.sIru ta.hta 'l-jild-i
4958\NewDocumentCommand{\ArbOutFile}{s O{no} +m}{% 4959\NewDocumentCommand{\ArbOutFile}{s O{no} +m}{%
4959 \if@pkg@export% 4960 \if@pkg@export%
4960 \IfBooleanTF{#1}{% 4961 \IfBooleanTF{#1}{%
4961 #3\luadirect{tooutfile(\luastringN{#3}, "#2")}}{% 4962 #3\luadirect{arabluatex.tooutfile(\luastringN{#3}, "#2")}}{%
4962 \luadirect{tooutfile(\luastringN{#3}, "#2")}}% 4963 \luadirect{arabluatex.tooutfile(\luastringN{#3}, "#2")}}%
4963 \else\IfBooleanTF{#1}{#3}{}\fi} 4964 \else\IfBooleanTF{#1}{#3}{}\fi}
4964% \end{macrocode} 4965% \end{macrocode}
4965% \end{macro} 4966% \end{macro}
@@ -4978,9 +4979,9 @@ wa-ya.sIru ta.hta 'l-jild-i
4978 \if@pkg@export% 4979 \if@pkg@export%
4979 \par 4980 \par
4980 \BODY 4981 \BODY
4981 \luadirect{al_doexport("yes")} 4982 \luadirect{arabluatex.doexport("yes")}
4982 \luadirect{tex.sprint(arbtoutf(\luastringO{\BODY}))} 4983 \luadirect{tex.sprint(arabluatex.arbtoutf(\luastringO{\BODY}))}
4983 \luadirect{al_doexport("no")} 4984 \luadirect{arabluatex.doexport("no")}
4984 \else\par\BODY\fi 4985 \else\par\BODY\fi
4985 }[\par] 4986 }[\par]
4986% \end{macrocode} 4987% \end{macrocode}
@@ -4995,9 +4996,9 @@ wa-ya.sIru ta.hta 'l-jild-i
4995 \if@pkg@export\ifal@verse@export% 4996 \if@pkg@export\ifal@verse@export%
4996 \par 4997 \par
4997 \BODY 4998 \BODY
4998 \luadirect{al_doexport("arabverse")} 4999 \luadirect{arabluatex.doexport("arabverse")}
4999 \luadirect{tex.sprint(arbtoutf(\luastringO{\BODY}))} 5000 \luadirect{tex.sprint(arabluatex.arbtoutf(\luastringO{\BODY}))}
5000 \luadirect{al_doexport("no")} 5001 \luadirect{arabluatex.doexport("no")}
5001 \else\par\BODY\fi\else\par\BODY\fi 5002 \else\par\BODY\fi\else\par\BODY\fi
5002}[\par] 5003}[\par]
5003% \end{macrocode} 5004% \end{macrocode}