[XeTeX] Arabic text and color

Vafa Khalighi vafa at users.berlios.de
Thu Aug 20 01:22:16 CEST 2009

If I was in your place, I would just load xecolour package and usecolour
without any issue in bidirectional texts so in your example this is how you
could use it:

\newfontinstance\arabicfont[Script=Arabic,Scale=1.2,WordSpace=2]{XB Zar}




اعْلَمْ‏ ‬بِأَنَّ
  ‬أَصْلٌ‏ ‬مُسْتَقِلْ



so it gives you the result you want and it supports colour spanning multiple

However you still can use color or xcolor package but it will not support
colour spanning multiple lines in RTL mode, so if you decide to go this way
put this code at the preamble of your document after loading bidi package

\newcommand{\green}[1]{\beginL{\color{green}\if at RTL\beginR\fi#1\if at RTL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20090820/4c01c382/attachment.html>

More information about the XeTeX mailing list