aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2017-06-25 11:22:53 +0200
committerRobert Alessi <alessi@robertalessi.net>2017-06-25 11:22:53 +0200
commitd419ec5424884a2a18a32b9b96ddf6f5eac8e819 (patch)
treeb422a777b51b4407b02c092b5944aa17fe9d936e
parent20c8ba08828511c818741e234db2c33668dc8870 (diff)
downloadarabluatex-d419ec5424884a2a18a32b9b96ddf6f5eac8e819.tar.gz
get the rid of \arbcolor which is not actually needed
-rw-r--r--arabluatex.dtx49
-rw-r--r--arabluatex.lua6
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.
2282%</example> 2282%</example>
2283% \fi 2283% \fi
2284% 2284%
2285% \paragraph{Color}
2286% Here comes the example:
2287% For example, to distinguish words with a different color, one may
2288% proceed like so:---
2289% \iffalse
2290%<*example>
2291% \fi
2292\begin{arabluacode}
2293\begin{arab}
2294_tumma "intalaqa _dU 'l-qarn-ayni 'il_A 'ummaT-iN 'u_hr_A fI
2295\arbcolor{red}{\arb[fullvoc]{((ma.tli`-i 'l-^sams-i))}}
2296wa-lA binA'-a la-hum yu'amminu-hum mina 'l-^sams-i.
2297\end{arab}
2298\end{arabluacode}
2299% \iffalse
2300%</example>
2301% \fi
2302%
2303% \section{Transliteration} 2285% \section{Transliteration}
2304% \label{sec:transliteration} 2286% \label{sec:transliteration}
2305% It may be more appropriate to speak of \enquote{romanization} than 2287% 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
2813% \cs{LR}\marg{arg}, but typesets its argument from right to left. Even 2795% \cs{LR}\marg{arg}, but typesets its argument from right to left. Even
2814% in an Arabic environment, this command may be useful. 2796% in an Arabic environment, this command may be useful.
2815% 2797%
2798% For example, to distinguish words with a different color, one may
2799% proceed like so:---
2800% \iffalse
2801%<*example>
2802% \fi
2803\begin{arabluacode}
2804\begin{arab}
2805 _tumma "intalaqa _dU 'l-qarn-ayni 'il_A 'ummaT-iN 'u_hr_A fI
2806 \textcolor{red}{\arb[fullvoc]{((ma.tli`-i 'l-^sams-i))}} wa-lA
2807 binA'-a la-hum yu'amminu-hum mina 'l-^sams-i.
2808\end{arab}
2809\end{arabluacode}
2810% \iffalse
2811%</example>
2812% \fi
2813%
2816% \DescribeMacro{\LRfootnote} \DescribeMacro{\RLfootnote} 2814% \DescribeMacro{\LRfootnote} \DescribeMacro{\RLfootnote}
2817% \cs{LRfootnote}\marg{text} and \cs{RLfootnote}\marg{text} typeset 2815% \cs{LRfootnote}\marg{text} and \cs{RLfootnote}\marg{text} typeset
2818% left-to-right and right-to-left footnotes respectively in Arabic 2816% left-to-right and right-to-left footnotes respectively in Arabic
@@ -3463,21 +3461,6 @@ wa-ya.sIru ta.hta 'l-jild-i
3463 \else \fi\fi\fi\fi}[\par] 3461 \else \fi\fi\fi\fi}[\par]
3464% \end{macrocode} 3462% \end{macrocode}
3465% \end{environment} 3463% \end{environment}
3466% \begin{macro}{\arbcolor}
3467% \changes{v1.8.6}{2017/06/25}{New \cs{arbcolor} command}
3468% \cs{arbcolor} is the equivalent for the \cs{textcolor} command. Just
3469% as the latter, it takes two mandatory arguments. Of course,
3470% \cs{textcolor} must be defined for \cs{arbcolor} to work.
3471% takes two mandatory arguments.
3472% \begin{macrocode}
3473\NewDocumentCommand{\arbcolor}{m m}{%
3474 \ifdefined\textcolor%
3475 \textcolor{#1}{#2}%
3476 \else\@gobble#1%
3477 \arb{#2}
3478 \fi}
3479% \end{macrocode}
3480% \end{macro}
3481% \begin{environment}{arabverse} 3464% \begin{environment}{arabverse}
3482% \changes{v1.6}{2016/12/17}{New environment \texttt{arabverse} for 3465% \changes{v1.6}{2016/12/17}{New environment \texttt{arabverse} for
3483% typesetting Arabic poetry} The |arabverse| environment may receive 3466% 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)
73 body = string.sub(body, 2, -2) 73 body = string.sub(body, 2, -2)
74 return string.format("}\\%s{%s}\\arb{", tag, body) 74 return string.format("}\\%s{%s}\\arb{", tag, body)
75 end) 75 end)
76 -- \arbcolor 76 -- \textcolor
77 str = string.gsub(str, "\\(arbcolor.-)(%b{})(%b{})", 77 str = string.gsub(str, "\\(textcolor.?)(%b{})(%b{})",
78 function(tag, bodycolor, bodytext) 78 function(tag, bodycolor, bodytext)
79 bodycolor = string.sub(bodycolor, 2, -2) 79 bodycolor = string.sub(bodycolor, 2, -2)
80 bodytext = string.sub(bodytext, 2, -2) 80 bodytext = string.sub(bodytext, 2, -2)
81 return string.format("}\\textcolor{%s}{\\arb{%s}}\\arb{", bodycolor, bodytext) 81 return string.format("}\\%s{%s}{\\arb{%s}}\\arb{", tag, bodycolor, bodytext)
82 end) 82 end)
83 -- Footnote 83 -- Footnote
84 str = string.gsub(str, "\\(Footnote.-)(%b{})", 84 str = string.gsub(str, "\\(Footnote.-)(%b{})",