From d419ec5424884a2a18a32b9b96ddf6f5eac8e819 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sun, 25 Jun 2017 11:22:53 +0200 Subject: get the rid of \arbcolor which is not actually needed --- arabluatex.dtx | 49 ++++++++++++++++--------------------------------- arabluatex.lua | 6 +++--- 2 files changed, 19 insertions(+), 36 deletions(-) diff --git a/arabluatex.dtx b/arabluatex.dtx index b323ada..6f5132b 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx @@ -2282,24 +2282,6 @@ word that \cs{arbnull} is applied to. % % \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 -% -% \fi -% % \section{Transliteration} % \label{sec:transliteration} % It may be more appropriate to speak of \enquote{romanization} than @@ -2813,6 +2795,22 @@ al-muqAtil-Ina.}, wa-kAnat 'ummI min `u.zamA'-i buyUt-i % \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 + \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 +% +% \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 @@ -3463,21 +3461,6 @@ 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 diff --git a/arabluatex.lua b/arabluatex.lua index c8011b1..1793564 100644 --- a/arabluatex.lua +++ b/arabluatex.lua @@ -73,12 +73,12 @@ local function breakcmd(str) body = string.sub(body, 2, -2) return string.format("}\\%s{%s}\\arb{", tag, body) end) - -- \arbcolor - str = string.gsub(str, "\\(arbcolor.-)(%b{})(%b{})", + -- \textcolor + str = string.gsub(str, "\\(textcolor.?)(%b{})(%b{})", function(tag, bodycolor, bodytext) bodycolor = string.sub(bodycolor, 2, -2) bodytext = string.sub(bodytext, 2, -2) - return string.format("}\\textcolor{%s}{\\arb{%s}}\\arb{", bodycolor, bodytext) + return string.format("}\\%s{%s}{\\arb{%s}}\\arb{", tag, bodycolor, bodytext) end) -- Footnote str = string.gsub(str, "\\(Footnote.-)(%b{})", -- cgit v1.2.3