TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I change the color of Arab word endings without losing the connections? It's just ugly and loses readability. I'm using Tex Live 2012: arabxetex with xelatex but any package and/or engine is welcome.







share|improve this question
up vote 15 down vote accepted

A workaround is to insert Zero Width Joiner character around the text break area, this would force final/initial forms. For most fonts with should be OK, though it would break contextual alternates in more advanced fonts, but the text should still be readable. Other than that, there is no way to switch color without breaking text into two parts in XeTeX.



\newcommand{\colorred}[1]{\char"200D\textcolor{red}{\char"200D #1}}





sample output

P.S. just use regular color package, \addfontfeature{} loads (and switches to) a new font each time it is called, witch is an overkill for just switching colors.

share|improve this answer

Using the built-in mechanism of ArabTeX, you can indicate by a hyphen (which becomes invisible) that a given letter should consider itself medial, albeit standing at a word border.


should make do in your example. However the choice of the font may change the result significantly. (I don't know, if the two forms of the ha are acceptable for the context of the question.) See also my answer here.

share|improve this answer

To obtain colored vowels in Arabic script, we can use ArabTeX with the acolor.sty. The following example shows how to use it:


\node[text=#2,opacity=0.5] (ombre)
at (0,0) {#3};
\node[text=#1] at (-.089,.089) {#3};


\fcolorbox{blue!30!black}{lightyellow!47!white}{\ombre[blue!30!black][yellow]{\Huge \setnashbf \RL{\fullvocalize \acolor{diacritics}{poppyred} \acolor{letters}{darkgreen}     $\bigstar$ bismi  al-ll_ahi \acolor{diacritics}{poppyredd}  al-rra.h-m_ani \acolor{diacritics}{poppyreddd}  al-rra.hImi $\bigstar $}}}


\fcolorbox{blue!30!black}{lightyellow!47!white}{\ombre[blue!30!black][yellow]{\LARGE \setnashbf \RL{ \fullvocalize \acolor{diacritics}{blue} \acolor{letters}{darkgreen} 
$\ast$ wa bihi na-s-ta-`Inu wa  al-.ha--mdu li-ll_ahi a-lla_dI yassaranA \acolor{hamza}{purple} lil-'a`--mAli al-.s.sAli.haTi $\ast$ }}}

share|improve this answer
where to find acolor.sty ? – Hafid Boukhoulda Apr 15 at 21:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.