From 5d50737789a119871b089273f5624bc79780a21e Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Mon, 11 Jun 2018 14:38:47 +0200
Subject: added \MkArbBreak* and \arbcolor

---
 arabluatex.dtx | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

(limited to 'arabluatex.dtx')

diff --git a/arabluatex.dtx b/arabluatex.dtx
index e3e60c3..dbc431d 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -2500,15 +2500,15 @@ word that \cs{arbnull} is applied to.
 % \fi%
 % 
 % The example below provides an implementation of this technique. It
-% may be observed that \cs{textcolor} is used so as to have the marks
+% may be observed that \cs{arbcolor} is used so as to have the marks
 % printed in red:---%
 % \iffalse
 %<*example>
 % \fi
 \begin{arabluacode}
   \SetArbDflt*
-  \newarbmark{sly}{\textcolor{red}{^^^^06d6}}{}
-  \newarbmark{jim}{\textcolor{red}{^^^^06da}}{}
+  \newarbmark{sly}{\arbcolor[red]{^^^^06d6}}{}
+  \newarbmark{jim}{\arbcolor[red]{^^^^06da}}{}
   \begin{arab}
     sUraTu 'l-nisA'i, 19:
   \end{arab}
@@ -3230,7 +3230,7 @@ qAla barzawayhi bn-u 'azhar-a, ra's-u 'a.tibbA'-i fAris-a...
 % \fi
 \begin{arabluacode}
   \MkArbBreak{fvred}
-  \newcommand{\fvred}[1]{\textcolor{red}{\arb[fullvoc]{#1}}}
+  \newcommand{\fvred}[1]{\arbcolor[red]{\arb[fullvoc]{#1}}}
 \begin{arab}[voc]
   _tumma "intalaqa _dU 'l-qarn-ayni 'il_A 'ummaT-iN 'u_hr_A fI
   \fvred{((ma.tli`-i 'l-^sams-i))} wa-lA binA'-a la-hum
@@ -3478,15 +3478,16 @@ qAla barzawayhi bn-u 'azhar-a, ra's-u 'a.tibbA'-i fAris-a...
 %
 % \paragraph{Color}
 % \label{sec:textcolor}
-% The two-argument command \cs{textcolor}\marg{color}\marg{Arabic
-% text} is supported inside \cs{begin}|{arab}| \ldots\
+% The two-argument command
+% \cs{textcolor}\marg{color}\marg{\cs{arb}\oarg{opt}\marg{Arabic
+% text}} is supported inside \cs{begin}|{arab}| \ldots\
 % \cs{end}|{arab}|. One simple example follows:--- %
 % \iffalse
 %<*example>
 % \fi
 \begin{arabluacode}
 \begin{arab}
-  \textcolor{red}{\uc{m}uha_d_dabu \uc{'l-d}Ini \uc{`a}bdu
+  \arbcolor[red]{\uc{m}uha_d_dabu \uc{'l-d}Ini \uc{`a}bdu
     \uc{'l-r}a.hImi bnu \uc{`a}liyyiN} huwa ^say_hu-nA 'l-'imAmu
   'l-.sadru 'l-kabIru 'l-`Alimu 'l-fA.dilu \uc{m}uha_d_dabu
   \uc{'l-d}Ini \uc{'a}bU \uc{m}u.hammadiN \uc{`a}bdu
@@ -3494,7 +3495,7 @@ qAla barzawayhi bn-u 'azhar-a, ra's-u 'a.tibbA'-i fAris-a...
   bi-\uc{'l-d}a_hwari.
 \end{arab}
 \begin{arab}[trans]
-  \textcolor{red}{\uc{m}uha_d_dabu \uc{'l-d}Ini \uc{`a}bdu
+  \arbcolor[red]{\uc{m}uha_d_dabu \uc{'l-d}Ini \uc{`a}bdu
     \uc{'l-r}a.hImi bnu \uc{`a}liyyiN} huwa ^say_hu-nA 'l-'imAmu
   'l-.sadru 'l-kabIru 'l-`Alimu 'l-fA.dilu \uc{m}uha_d_dabu
   \uc{'l-d}Ini \uc{'a}bU \uc{m}u.hammadiN \uc{`a}bdu
@@ -3711,9 +3712,13 @@ wa-ya.sIru ta.hta 'l-jild-i
 % to give any command---either new or already existing---the
 % precedence over \package{arabluatex} inside Arabic environments. It
 % is actually coded in Lua.
+% \changes{v1.12}{2018/06/11}{TODO}
 %    \begin{macrocode}
-\DeclareDocumentCommand{\MkArbBreak}{m}{%
-  \luadirect{mkarbbreak(\luastringN{#1})}}
+\DeclareDocumentCommand{\MkArbBreak}{s m}{%
+  \IfBooleanTF{#1}
+  {\luadirect{mkarbbreak(\luastringN{#1}, "out")}}
+  {\luadirect{mkarbbreak(\luastringN{#1}, "dflt")}}
+}
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\aemph} Arabic emphasis. Needs to be redefined as
@@ -3735,6 +3740,16 @@ wa-ya.sIru ta.hta 'l-jild-i
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \begin{macro}{\arbcolor}\changes{v1.12}{2018/06/10}{Standard color
+% command for Arabic environments}
+% \cs{arbcolor}\oarg{color}\marg{Arabic text} takes the Arabic text to
+% be colored as argument.
+%    \begin{macrocode}
+\NewDocumentCommand{\arbcolor}{o m}{%
+  \IfNoValueTF{#1}{#2}{\textcolor{#1}{#2}}}
+%    \end{macrocode}
+% 
+% \end{macro}
 % \begin{macro}{\SetInputScheme}
 %   \changes{v1.4}{2016/07/05}{\cs{SetInputScheme} can be used to
 %   process other input schemes such as \enquote*{Buckwalter}}
-- 
cgit v1.2.3

