I would like to demonstrate declension in the Arabic language by coloring a single vowel or letter. I found some solutions to color a single letter, however the connections would break.
So again I'm looking for a solution that can color a vowel individually and a letter individually. I am currently using XeTeX and the polyglossia package. And input arabic text using: \textarabic.
I don't mind switching to another package, since I'm still just a beginner using this package anyway.
Any help would be appreciated. Thanks in advance.
@KhaledHosny I indeed tried to create a hack myself, unfortunately I was only able to do it for the last letter and also made use of the ZWJ. I didn't know how to enforce the final form of the letter though. Also for vowels I got stuck in how to do that. Here is the macro I created:
\newcommand{\mymacro}[1]{%
\StrRight{#1}{1}[\lastletter]%
\StrBefore{#1}{\lastletter}[\rest]%
\rest\char"200D{\color{red}\lastletter\char"200D}
}
I use it like this:\textarabic{\mymacro{اَلْمَدِينَة}}
But at the end I get a colored ة
When trying to color a single vowel, it just doesn't appear.
fontspecmanual). LuaTeX should have better support for this, the first question has ConTeXt answers, but the first can be easily adapted to LaTeX when usingluacolorpackage. – خالد حسني Jun 22 '13 at 01:03