In Arabic script you add short vowels/diacritics (marks) above/below the consonants. How do yo go about coloring them (on a case by case basis) without losing connection/breaking the letters/vowels in a word?
In the MWE below I'm trying to color the letter b in the (transliterated) word balad without also coloring a that stands above the consonant in the word.
Lastly, in the small sample below I manage to get a work solution by adding an extension/prolongation to the letter b (using _ and adding to this the 'zero width join' unicode character \char"200D suffix), but this is somewhat a hack and adds unnecessary (and unwanted) strokes to the text.
MWE
\documentclass[a4paper,12pt,twoside]{memoir}
\usepackage{xcolor}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{arabxetex}
\let\textarabic\relax % required for polyglossia/arabxetex
\let\Arabic\relax %
\setotherlanguages{arabic}
\begin{document}
1.
\begin{arab}[voc]
balad
\end{arab}
2.
\begin{arab}[voc]
\textcolor{red}{b_}\char"200D alad
\end{arab}
\end{document}
I found this (link) old post using pdfLaTeX, with the package arabtex and style acolor.sty, solving it in a more generic manner (where all vowels/marks are colored). However I can't seem to get this working in the MWE above, and unsure if this solution for arabtex also will work with the above MWE in arabxetex
Typing in XeLaTeX with memoir in Overleaf.


LuaLaTeX(arabluatex) andXeLaTeX(arabxetex), and for the project at hand, I'm typing it in the later, i.e.XeLaTeXwith packagesarabxetexandpolyglossia. Looking for a working solution with this setup. – imdk4242 Jul 29 '19 at 22:07xelatex) – Robert Alessi Jul 29 '19 at 22:20\arabcolor{}is not a predefined command inarabxetex, and manually coloring (and using the syntax with.) breaks the stroke of the word. – imdk4242 Jul 30 '19 at 08:29\arbcolor{}and.a .u .iinput scheme are specific toarabluatex. Besides, Lua is needed to color nodes asarabluatexdoes. – Robert Alessi Jul 30 '19 at 12:11acolor.styis forarabtex. Regardingarabxetex, I fear that Khaled Hosny's answer applies. You might want to ask him directly. – Robert Alessi Aug 03 '19 at 13:25@kh..., wait for the autocompletion to operate, and add a space, just as I did here. He will be notified. – Robert Alessi Aug 03 '19 at 15:39@mechanism didn't work there. Let's wait for a couple of days. – Robert Alessi Aug 03 '19 at 19:51