From 8402f499574664c136f3e1f1312b798049e9cb64 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sat, 9 Jun 2018 07:49:33 +0200
Subject: use enumitem instead of paralist. use al@rlmode in \abjad{}

---
 arabluatex.dtx | 133 +++++++++++++++++++++++++++++++--------------------------
 1 file changed, 72 insertions(+), 61 deletions(-)

(limited to 'arabluatex.dtx')

diff --git a/arabluatex.dtx b/arabluatex.dtx
index e68f64c..61375e3 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -178,12 +178,13 @@
     arabtex, luatex}}
 \usepackage[scale=1.5]{ccicons}
 \usepackage[toc,lot]{multitoc}
-\usepackage{paralist}
-\setdefaultitem{\textendash}{\textendash}{\textendash}{\textendash}
 \usepackage{enumitem}
 \setlist{nosep}
+\setlist[itemize]{label=\textendash}
+\setlist[enumerate,1]{label=(\alph*)}
+\setlist[enumerate,2]{label=\roman*.}
 \newlist{enumabjad}{enumerate}{10}
-\setlist[enumabjad]{label={\aemph*{\abjad{\arabic*}}}}
+\setlist[enumabjad]{label={\abjad{\arabic*}}}
 \usepackage{multicol}
 \usepackage{cleveref}
 \usepackage{quoting}
@@ -335,14 +336,14 @@
 %
 % Please send error reports and suggestions for improvements to Robert
 % Alessi:
-% \begin{compactitem}
+% \begin{itemize}
 % \item email: <\href{mailto:alessi@robertalessi.net?Subject=arabluatex}%
 %   {\texttt{alessi@robertalessi.net}}>
 % \item website: \url{http://www.robertalessi.net/arabluatex}
 % \item development: \url{http://git.robertalessi.net/arabluatex}
 % \item comments, feature requests, bug reports:
 % \url{https://notabug.org/ralessi/arabluatex/issues}
-% \end{compactitem}
+% \end{itemize}
 %
 % \marginpar{\texttt{gpl3+}}
 % This program is free software: you can redistribute it and/or modify
@@ -361,7 +362,7 @@
 %
 % This release of \package{arabluatex} consists of the following
 % source files:
-% \begin{compactitem}
+% \begin{itemize}
 % \item |arabluatex.ins|
 % \item |arabluatex.dtx|
 % \item |arabluatex.lua|
@@ -370,7 +371,7 @@
 % \item |arabluatex_novoc.lua|
 % \item |arabluatex_trans.lua|
 % \item |arabluatex.el|
-% \end{compactitem}
+% \end{itemize}
 % 
 % \subsection*{License applicable to this document}
 % \label{sec:documentation-license}
@@ -549,12 +550,12 @@
 % transliterates the Arab\TeX\ input into one of the accepted
 % standards. At present, three standards are supported (see below
 % \vref{sec:transliteration} for more details):
-% \begin{compactdesc}
+% \begin{description}
 % \item[dmg] \emph{Deutsche Morgenländische Gesellschaft}, which is
 %   selected by default;
 % \item[loc] \emph{Library of Congress};
 % \item[arabica] \emph{Arabica}.
-% \end{compactdesc}
+% \end{description}
 % More standards will be included in future releases of
 % \package{arabluatex}.
 % 
@@ -563,7 +564,7 @@
 % \NEWfeature{v.1.2} By default, \package{arabluatex} typesets Arabic
 % in a classic, traditional style the most prominent features of which
 % are the following:
-% \begin{compactitem}
+% \begin{itemize}
 % \item \enquote*{Classic} \arb[trans]{maddaT}: when
 % \arb[trans]{'alif} and \arb[trans]{hamzaT} accompanied by a simple
 % vowel or \arb[trans]{tanwIn} is preceded by an \arb[trans]{'alif} of
@@ -597,7 +598,7 @@ advisable to use \cs{SetArbEasy}.
 % \iffalse
 %</example>
 % \fi
-% \end{compactitem}
+% \end{itemize}
 % 
 % \DescribeMacro{\SetArbEasy} \NEWfeature{v1.4.4}
 % \DescribeMacro{\SetArbEasy*} \DescribeMacro{\SetArbDflt} Such
@@ -615,44 +616,44 @@ advisable to use \cs{SetArbEasy}.
 % \enquote*{starred} version of this command \cs{SetArbDflt*} either
 % in the preamble or at any point of the document.\footnote{For an
 % example, see \vref{sec:poetry-example}.} Examples follow:---
-% \begin{compactenum}[(a)]
+% \begin{enumerate}
 % \item \cs{SetArbDflt}:
-%   \begin{compactenum}[i.]
+%   \begin{enumerate}
 %   \item |voc| \arb[voc]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}
 %   \item |fullvoc| \arb[fullvoc]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}
 %   \item |trans| \arb[trans]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}
-%   \end{compactenum}
+%   \end{enumerate}
 % \item \cs{SetArbDflt*}:
-%   \begin{compactenum}[i.]\SetArbDflt*
+%   \begin{enumerate}\SetArbDflt*
 %   \item |voc| \arb[voc]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}
 %   \item |fullvoc| \arb[fullvoc]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}
 %   \item |trans| \arb[trans]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}\SetArbDflt
-%   \end{compactenum}
+%   \end{enumerate}
 % \item \cs{SetArbEasy}:
-%   \begin{compactenum}[i.]\SetArbEasy
+%   \begin{enumerate}\SetArbEasy
 %   \item |voc| \arb[voc]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}
 %   \item |fullvoc| \arb[fullvoc]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}
 %   \item |trans| \arb[trans]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}\SetArbDflt
-%   \end{compactenum}   
+%   \end{enumerate}
 % \item \cs{SetArbEasy*}:
-%   \begin{compactenum}[i.]\SetArbEasy*
+%   \begin{enumerate}\SetArbEasy*
 %   \item |voc| \arb[voc]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}
 %   \item |fullvoc| \arb[fullvoc]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}
 %   \item |trans| \arb[trans]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}\SetArbDflt
-%   \end{compactenum}   
-% \end{compactenum}
+%   \end{enumerate}
+% \end{enumerate}
 %
 % \iffalse
 %<*example>
@@ -760,12 +761,12 @@ vowels (see §~3).
 % document, as the \cs{arb} command may take any of the |voc|,
 % |fullvoc|, |novoc| or |trans| modes as optional argument, like
 % so:---
-% \begin{compactitem}
+% \begin{itemize}
 % \item \DescribeOption{voc} \cs{arb}|[voc]|\marg{Arabic text};
 % \item \DescribeOption{fullvoc} \cs{arb}|[fullvoc]|\marg{Arabic text};
 % \item \DescribeOption{novoc} \cs{arb}|[novoc]|\marg{Arabic text};
 % \item \DescribeOption{trans} \cs{arb}|[trans]|\marg{Arabic text}.
-% \end{compactitem}
+% \end{itemize}
 %
 % The same optional arguments may be passed to the environment |arab|:
 % one may have \cs{begin}|{arab}|\oarg{mode}|...|\cs{end}|{arab}|,
@@ -1026,7 +1027,7 @@ vowels (see §~3).
 % That said, there is no need to write the short vowels
 % \arb[trans]{fat.haT}, \arb[trans]{.dammaT} or \arb[trans]{kasraT}
 % except in the following cases:---
-% \begin{compactitem}
+% \begin{itemize}
 % \item at the commencement of a word, to indicate that a connective
 % \arb[trans]{'alif} is needed, with the exception of the article (see
 % below \vref{sec:quoting});
@@ -1034,7 +1035,7 @@ vowels (see §~3).
 %   analysis to determine the carrier of the \arb[trans]{hamzaT};
 % \item in the various transliteration modes, as vowels are always
 % expressed  in romanized Arabic.
-% \end{compactitem}
+% \end{itemize}
 %
 %\section{\package{arabluatex} in action}
 %\subsection{The vowels and diphthongs}
@@ -1360,7 +1361,7 @@ vowels (see §~3).
 % \label{ref:euphonic-tashdid} always follows a vowelless consonant
 % which is passed over in pronunciation and assimilated to a following
 % consonant. It may be found \parencite[i. 15 B--16 C]{Wright}:---
-% \begin{compactenum}[(a)]
+% \begin{enumerate}
 % \item With the \emph{solar} letters \arb[novoc]{t}, \arb[novoc]{_t},
 %   \arb[novoc]{d}, \arb[novoc]{_d}, \arb[novoc]{r}, \arb[novoc]{z},
 %   \arb[novoc]{s}, \arb[novoc]{^s}, \arb[novoc]{.s}, \arb[novoc]{.d},
@@ -1424,7 +1425,7 @@ vowels (see §~3).
 %   \arb[voc]{labi_ttu} \arb[trans]{labi_ttu}, will be discarded here,
 %   as it is largely condemned by the
 %   grammarians \parencite[see][i. 16 B--C]{Wright}.
-% \end{compactenum}
+% \end{enumerate}
 %
 % \paragraph{The definite article and the \arb[trans]{'alif-u 'l-wa.sl-i}}
 % \label{ref:definite-article}
@@ -1443,7 +1444,7 @@ vowels (see §~3).
 % doing that automatically provided that the vowel which is to be
 % absorbed by the final vowel of the preceding word be properly
 % encoded, like so:---
-% \begin{compactenum}[(a)]
+% \begin{enumerate}
 % \item Definite article at the beginning of a sentence is encoded\\
 %   \arabluaverb{al-}, or \arabluaverb{a<solar letter>-}\\ if one
 %   wishes to mark the assimilation---which is in no way required, as
@@ -1453,7 +1454,7 @@ vowels (see §~3).
 % \item In all remaining cases of elision, the \arb[trans]{'alifu
 % 'l-wa.sli} is expressed by the vowel that accompanies the omitted
 % \arb[trans]{hamzaT}: \meta{u, a, i}.
-% \end{compactenum}
+% \end{enumerate}
 % \begin{quote}
 %   \textbf{Article}: |bAb-u| |'l-madrasaT-i| \arb[fullvoc]{bAb-u
 %   'l-madrasaT-i} \arb[trans]{bAb-u 'l-madrasaT-i},
@@ -1471,7 +1472,7 @@ vowels (see §~3).
 %   'l-najm-a} \arb[trans]{fa-lammA ra'aW 'l-najm-a}.
 %
 %   \textbf{Particles}:---
-%   \begin{compactenum}[(a)]
+%   \begin{enumerate}
 %   \item \arb[trans]{li-}: \arb[trans]{'alif-u 'l-wa.sl-i} is omitted
 %     in the article \arb[fullvoc]{al} when it is preceded by the
 %     preposition \arb[fullvoc]{li}: |li-l-rajul-i|
@@ -1491,7 +1492,7 @@ vowels (see §~3).
 %   |bi-'l-|\allowbreak|qalam-i| \arb[fullvoc]{bi-'l-qalam-i}
 %   \arb[trans]{bi-'l-qalam-i}, |bi-'l-ru`b-i|
 %   \arb[fullvoc]{bi-'l-ru`b-i} \arb[trans]{bi-'l-ru`b-i}.
-%   \end{compactenum}
+%   \end{enumerate}
 %   
 %   \textbf{Perfect active, imperative, nomen actionis}: |qAla|
 %   |isma`| \arb[fullvoc]{qAla isma`} \arb[trans]{qAla isma`}, |qAla|
@@ -1710,7 +1711,7 @@ vowels (see §~3).
 %
 % \paragraph{\texttt{novoc}} In this mode, \enquote{quoting}
 % essentially means make visible something that ought not to be so.
-% \begin{compactenum}[(a)]
+% \begin{enumerate}
 % \item Quoting a vowel, either short or long, makes the
 %   \arb[trans]{.dammaT}, \arb[trans]{fat.haT} or \arb[trans]{kasraT}
 %   appear above the appropriate consonant:---
@@ -1744,13 +1745,13 @@ vowels (see §~3).
 %   "inhazama} \arb[trans]{huwa "inhazama}, |al-"intiqA.d-u|
 %   \arb[novoc]{al-"intiqA.d-u} \arb[trans]{al-"intiqA.d-u}.
 % \end{quote}
-% \end{compactenum}
+% \end{enumerate}
 %
 % \paragraph{\texttt{voc}}
 % In accordance with the general rule, in this mode, \enquote{quoting}
 % makes the vowels and the \arb[trans]{tanwIn} disappear, should this
 % feature be required for some reason:---
-% \begin{compactenum}[(a)]
+% \begin{enumerate}
 % \item Short and long vowels:---
 %   \begin{quote}
 %     |q"Ala q"A'iluN| \arb[voc]{q"Ala q"A'iluN} \arb[trans]{q"Ala
@@ -1765,12 +1766,12 @@ vowels (see §~3).
 %     \arb[voc]{hud"aN_A} \arb[trans]{hud"aN_A}, |^say'"iN|
 %     \arb[voc]{^say'"iN} \arb[trans]{^say'"iN}.
 %   \end{quote}
-% \end{compactenum}
+% \end{enumerate}
 % One may more usefully \enquote{quote} the initial vowels to write
 % the \arb[trans]{wa.slaT} above the \arb[trans]{'alif} or insert a
 % straight double quote after a consonant not followed by a vowel to
 % make the \arb[trans]{sukUn} appear:---
-% \begin{compactenum}[(a)]
+% \begin{enumerate}
 % \item \arb[trans]{'alif-u 'l-wa.sl-i}:---
 %   \begin{quote}
 %     |fI "istiq.sA'-iN| \arb[voc]{fI "istiq.sA'-iN} \arb[trans]{fI
@@ -1789,7 +1790,7 @@ vowels (see §~3).
 %     \arb[trans]{kam" qad" ma.dat" min"
 %     laylaTiN}.\label{ref:quoted-sukun-e}
 %   \end{quote}
-% \end{compactenum}
+% \end{enumerate}
 %
 % \paragraph{\texttt{fullvoc}}
 % In this mode, \enquote{quoting} can be used to take away any short
@@ -2190,7 +2191,7 @@ word that \cs{arbnull} is applied to.
 % to the following or the preceding ones over the
 % \arb[trans]{tadwIr}. The optional argument of the \cs{bayt} command
 % is designed to deal with the various situations that may arise:---
-% \begin{compactenum}[(a)]
+% \begin{enumerate}
 % \item If the two hemistichs be connected with one another by a
 % prominent horizontal flexible stroke, the \arb[trans]{ta.twIl} should
 % be used, like so: |[--]| (see \vref{sec:tatwil}). Of course, the
@@ -2261,7 +2262,7 @@ word that \cs{arbnull} is applied to.
 % write it all inside the \arb[trans]{tadwIr}. In that case, as the
 % word is to be placed in the middle, it has been surrounded by
 % spaces.
-% \end{compactenum}
+% \end{enumerate}
 %
 % \paragraph{Scaling and distortion of characters}
 % The |arabverse| environment and the \cs{bayt} command are designed
@@ -2412,12 +2413,12 @@ word that \cs{arbnull} is applied to.
 % removed. \package{arabluatex} will automatically fit those symbols
 % to the direction of the text. For the time being, the following
 % symbols are supported:
-% \begin{compactitem}
+% \begin{itemize}
 % \item parentheses: |()|
 % \item square brackets: |[]|
 % \item angle brackets: |<>|
 % \item braces: |{}|
-% \end{compactitem}
+% \end{itemize}
 %
 % \DescribeMacro{\abraces} Parentheses, square and angle brackets may
 % be input directly at the keyboard; however, words or letters that
@@ -2540,7 +2541,7 @@ word that \cs{arbnull} is applied to.
 % This mode transliterates the Arab\TeX\ input into one of the
 % accepted standards. As said above \vpageref{ref:describe-trans},
 % three standards are supported at present:
-% \begin{compactdesc}
+% \begin{description}
 % \item[dmg] \emph{Deutsche Morgenländische Gesellschaft}, which was
 % adopted by the International Convention of Orientalist Scholars in
 % Rome in 1935.\footnote{See \textcite{dmg}.} |dmg| transliteration
@@ -2559,7 +2560,7 @@ word that \cs{arbnull} is applied to.
 %   is most widely used by scholars in the field of Arabic
 %   studies.\footnote{See
 %   \url{http://www.brill.nl/files/brill.nl/specific/authors_instructions/ARAB.pdf}.}
-% \end{compactdesc}
+% \end{description}
 % More standards will be included in future releases of
 % \package{arabluatex}.
 %
@@ -2718,13 +2719,13 @@ Then as \Hunayn, \Razi.
 % \NEWfeature{v1.3} According to \textcite[6]{dmg}, Arabic
 % \arb[trans]{'i`rAb} may be rendered into |dmg| in three different
 % ways:
-% \begin{compactenum}[(a)]
+% \begin{enumerate}
 % \item \label{ref:dmg-full-rend}In full:
 %   \NoArbUp\arb[trans]{\uc{`amruNU}}\ArbUpDflt\,;
 % \item \label{ref:dmg-up-rend}As superscript text:
 %   \arb[trans]{\uc{`amruNU}}\,;
 % \item \label{ref:irab-discarded}Discarded: \arb[trans]{\uc{`amr}}.
-% \end{compactenum}
+% \end{enumerate}
 % \DescribeMacro{\arbup} By default, \package{arabluatex} applies rule
 % \ref{ref:dmg-up-rend}. Once delimited by a set of Lua functions,
 % \arb[trans]{'i`rAb} is passed as an argument on to a \cs{arbup}
@@ -2811,14 +2812,14 @@ muhaddamaTaN mi'_danatu-hu}: \arb[trans]{ra'aytu
 % book titles. \package{arabluatex} is able to render words ending
 % with \arb[trans]{tA' marbU.taT} in different ways, depending on
 % their function:---
-% \begin{compactenum}[(a)]
+% \begin{enumerate}
 % \item Nouns followed by an adjective in apposition: |madInaT|
 %   |kabIraT| \arb[trans]{madInaT kabIraT}, |al-madInaT| |al-kabIraT|
 %   \arb[trans]{al-madInaT al-kabIraT}.
 % \item Nouns followed by another noun in the genitive (contruct
 %   state): |.hikmaT| |al-l_ah| \arb[trans]{.hikmaT| \uc{al-l_ah}},
 %   |fi.d.daT| |al-darAhim| \arb[trans]{fi.d.daT al-darAhim}.
-% \end{compactenum}
+% \end{enumerate}
 % \begin{quoting}
 %   \textsc{Rem.} It may so happen, as in the absence of the article
 %   before the annexed word, that \package{arabluatex} be unable to
@@ -3062,7 +3063,7 @@ muhaddamaTaN mi'_danatu-hu}: \arb[trans]{ra'aytu
 %
 % That said, there are two ways of inserting Unicode
 % Arabic:
-% \begin{compactenum}[(a)] 
+% \begin{enumerate}
 % \item \DescribeMacro{\txarb} The \cs{txarb}\marg{Unicode Arabic}
 %   command for inserting Unicode Arabic text in paragraphs;
 % \item The \DescribeEnv{txarab} |txarab| environment for inserting
@@ -3078,7 +3079,7 @@ muhaddamaTaN mi'_danatu-hu}: \arb[trans]{ra'aytu
 % \iffalse
 %</example>
 % \fi
-% \end{compactenum}
+% \end{enumerate}
 %
 % \section{\LaTeX\ Commands in Arabic environments}
 % \label{sec:commands-in-arb}
@@ -3246,7 +3247,7 @@ qAla barzawayhi bn-u 'azhar-a, ra's-u 'a.tibbA'-i fAris-a...
 % their argument to be rendered in Arabic must be inserted again in
 % \cs{arb}. \NEWfeature{v1.12}These commands themselves may have up to
 % two optional and/or mandatory arguments, like so:---
-% \begin{compactenum}[(a)]
+% \begin{enumerate}
 % \item \cs{command} (no argument, lowermost combination)
 % \item \cs{command}\oarg{opt1} (one optional argument)
 % \item \cs{command}\marg{arg1} (one mandatory argument)
@@ -3255,7 +3256,7 @@ qAla barzawayhi bn-u 'azhar-a, ra's-u 'a.tibbA'-i fAris-a...
 % \item{} [\ldots]
 % \item \cs{command}\oarg{opt1}\oarg{opt2}\marg{arg1}\marg{arg2}
 % (uppermost combination)
-% \end{compactenum}
+% \end{enumerate}
 %
 %
 % \subsection{Environments}
@@ -3376,7 +3377,7 @@ qAla barzawayhi bn-u 'azhar-a, ra's-u 'a.tibbA'-i fAris-a...
   % preamble:---
   \usepackage{enumitem}
   \newlist{enumabjad}{enumerate}{10}
-  \setlist[enumabjad]{nosep, label={\aemph*{\abjad{\arabic*}}}}
+  \setlist[enumabjad]{nosep, label={\abjad{\arabic*}}}
   \usepackage{multicol}
 \end{arabluaverbatim}
 \begin{arabluacode}
@@ -3576,25 +3577,25 @@ wa-ya.sIru ta.hta 'l-jild-i
 % \label{sec:future-work}
 % A short, uncommented, list of what is planned in the versions of
 % \package{arabluatex} to come follows:
-% \begin{compactenum}[(a)]
+% \begin{enumerate}
 % \item Short-term:
-%   \begin{compactenum}[i.] 
+%   \begin{enumerate}
 %   \item \texttt{TEI xml} support: \package{arabluatex} will
 %     interoperate with \texttt{TEI xml} through new global and local
 %     options that will output Arabic in a \texttt{TEI xml} compliant
 %     file in addition to the usual PDF output: see
 %     \vpageref{ref:tei-to-come}.
-%   \end{compactenum}
+%   \end{enumerate}
 % \item Medium-term:
-%   \begin{compactenum}[i.]
+%   \begin{enumerate}
 %   \item More languages: the list of supported languages will
 %     eventually be the same as \package{arabtex}: see
 %     \vref{fn:arabtex-languages}.
 %   \item Formulate propositions for extending the Arab\TeX\ notation
 %     and the transliteration tables. Include them in
 %     \package{arabluatex}. See \vref{sec:additional-characters}.
-%   \end{compactenum}
-% \end{compactenum}
+%   \end{enumerate}
+% \end{enumerate}
 %
 % \StopEventually{}
 %
@@ -3906,19 +3907,25 @@ wa-ya.sIru ta.hta 'l-jild-i
 \NewDocumentCommand{\arb}{O{\al@mode} +m}%
 {\edef\@tempa{#1}%
   \ifx\@tempa\al@mode@voc%
+  \booltrue{al@rlmode}%
   \bgroup\textdir TRT\arabicfont%
   \luadirect{tex.sprint(processvoc(\luastringN{#2},
     \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
+  \boolfalse{al@rlmode}%
   \else%
   \ifx\@tempa\al@mode@fullvoc%
+  \booltrue{al@rlmode}%
   \bgroup\textdir TRT\arabicfont%
   \luadirect{tex.sprint(processfullvoc(\luastringN{#2},
     \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
+  \boolfalse{al@rlmode}%
   \else%
   \ifx\@tempa\al@mode@novoc%
+  \booltrue{al@rlmode}%
   \bgroup\textdir TRT\arabicfont%
   \luadirect{tex.sprint(processnovoc(\luastringN{#2},
     \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
+  \boolfalse{al@rlmode}%
   \else%
   \ifx\@tempa\al@mode@trans%
   \bgroup\textdir TLT\al@trans@style%
@@ -4081,11 +4088,15 @@ wa-ya.sIru ta.hta 'l-jild-i
 \AtBeginDocument{%
   \ifdefined\abjad%
   \RenewDocumentCommand{\abjad}{m}%
-  {\luadirect{tex.sprint(abjadify(\luastring{#1}))}}%
+  {\ifbool{al@rlmode}%
+    {\aemph{\luadirect{tex.sprint(abjadify(\luastring{#1}))}}}
+    {\luadirect{tex.sprint(abjadify(\luastring{#1}))}}}
   \else%
   \NewDocumentCommand{\abjad}{m}%
-  {\luadirect{tex.sprint(abjadify(\luastring{#1}))}}
-\fi}
+  {\ifbool{al@rlmode}%
+    {\aemph{\luadirect{tex.sprint(abjadify(\luastring{#1}))}}}
+    {\luadirect{tex.sprint(abjadify(\luastring{#1}))}}}
+  \fi}
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\arbnull}
-- 
cgit v1.2.3

