From db5c8d1fcfcd1b4398719c6de1e6cd78ab62c5f8 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sat, 24 Jun 2017 21:16:22 +0200
Subject: new command \arbcolor which does the same as \textcolor in Arabic
 environments

---
 arabluatex.dtx | 53 +++++++++++++++++++++++++++++++++++------------------
 1 file changed, 35 insertions(+), 18 deletions(-)

(limited to 'arabluatex.dtx')

diff --git a/arabluatex.dtx b/arabluatex.dtx
index 4da2745..b323ada 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -227,7 +227,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{700}
+% \CheckSum{0}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -2282,6 +2282,24 @@ word that \cs{arbnull} is applied to.
 %</example>
 % \fi
 %
+% \paragraph{Color}
+% Here comes the example:
+% For example, to distinguish words with a different color, one may
+% proceed like so:---
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluacode}
+\begin{arab}
+_tumma "intalaqa _dU 'l-qarn-ayni 'il_A 'ummaT-iN 'u_hr_A fI
+\arbcolor{red}{\arb[fullvoc]{((ma.tli`-i 'l-^sams-i))}}
+wa-lA binA'-a la-hum yu'amminu-hum mina 'l-^sams-i.
+\end{arab}
+\end{arabluacode}
+% \iffalse
+%</example>
+% \fi
+%
 % \section{Transliteration}
 % \label{sec:transliteration}
 % It may be more appropriate to speak of \enquote{romanization} than
@@ -2794,23 +2812,7 @@ al-muqAtil-Ina.}, wa-kAnat 'ummI min `u.zamA'-i buyUt-i
 % \DescribeMacro{\RL} \cs{RL}\marg{arg} does the same as
 % \cs{LR}\marg{arg}, but typesets its argument from right to left. Even
 % in an Arabic environment, this command may be useful.
-%
-% For example, to distinguish words with a different color, one may
-% proceed like so:---
-% \iffalse
-%<*example>
-% \fi
-\begin{arabluacode}
-\begin{arab}
-_tumma "intalaqa _dU 'l-qarn-ayni 'il_A 'ummaT-iN 'u_hr_A fI
-\LR{\textcolor{red}{\arb[fullvoc]{((ma.tli`-i 'l-^sams-i))}}}
-wa-lA binA'-a la-hum yu'amminu-hum mina 'l-^sams-i.
-\end{arab}
-\end{arabluacode}
-% \iffalse
-%</example>
-% \fi
-%
+% 
 % \DescribeMacro{\LRfootnote} \DescribeMacro{\RLfootnote}
 % \cs{LRfootnote}\marg{text} and \cs{RLfootnote}\marg{text} typeset
 % left-to-right and right-to-left footnotes respectively in Arabic
@@ -3461,6 +3463,21 @@ wa-ya.sIru ta.hta 'l-jild-i
   \else \fi\fi\fi\fi}[\par]
 %    \end{macrocode}
 % \end{environment}
+% \begin{macro}{\arbcolor}
+% \changes{v1.8.6}{2017/06/25}{New \cs{arbcolor} command}
+% \cs{arbcolor} is the equivalent for the \cs{textcolor} command. Just
+% as the latter, it takes two mandatory arguments. Of course,
+% \cs{textcolor} must be defined for \cs{arbcolor} to work.
+% takes two mandatory arguments.
+%    \begin{macrocode}
+\NewDocumentCommand{\arbcolor}{m m}{%
+  \ifdefined\textcolor%
+  \textcolor{#1}{#2}%
+  \else\@gobble#1%
+  \arb{#2}
+  \fi}
+%    \end{macrocode}
+% \end{macro}
 % \begin{environment}{arabverse}
 %   \changes{v1.6}{2016/12/17}{New environment \texttt{arabverse} for
 %   typesetting Arabic poetry} The |arabverse| environment may receive
-- 
cgit v1.2.3

