I need to typeset Arabic and color different group of letters/diactrical marks in different color. For this purpose, I explored capabilities of XeLaTeX/ArabXeTeX environment, but could not obtain good result. While searching for answers, I found an answer to a similar question here Coloring combining characters without changing color of a base character, unfortunately I could not reproduce it. The diactrical marks on my result is not at the correct place. (Check the picture.)

Here is the source ConTEXt code I used (almost same as Khaled Hosny's code shown in the link):




\definedfont[name:amiri*arabic at 36pt]

ضَرَبَ ضُرِبَ ضَرْبًا

قُلْ يَا أَيُّهَا الْكَافِرُونَ ﴿١﴾ لَا أَعْبُدُ مَا تَعْبُدُونَ ﴿٢﴾ وَلَا أَنتُمْ عَابِدُونَ مَا أَعْبُدُ ﴿٣﴾     وَلَا أَنَا عَابِدٌ مَّا عَبَدتُّمْ ﴿٤﴾ وَلَا أَنتُمْ عَابِدُونَ مَا أَعْبُدُ ﴿٥﴾ لَكُمْ دِينُكُمْ وَلِيَ دِينِ ﴿٦﴾


enter image description here

My questions are:

  1. How to use ConTEXt to typeset Arabic?

  2. How to use ConTEXt to color diactrical marks?

  • 1
    Please post a minimal working example (MWE) that shows the code that you used to generate the output – Aditya Nov 2 '15 at 3:24
  • I used the code from another question/answer. The link to them is given in my question above. Do I still have to copy/past the code? Thanks. – Taha Yasin Nov 2 '15 at 3:42
  • That question has multiple answers. It is easier for others to answer, if you paste what you tried that is not working for you – Aditya Nov 2 '15 at 3:59
  • I copied the code here. – Taha Yasin Nov 2 '15 at 8:08

Your code is not "almost same as Khaled Hosny's code," you left out the most important parts of the code in the answer you linked to. If I follow Khaled's procedure and produce an amiri.lfg file, then copy all his code (not just some bits and pieces), I get colored output. No idea if the diacritics are in the correct position, I don't know any Arabic). enter image description here

  • I could not get the diactrical marks at the right position, and thus did not go further to test the coloring part. Can you post your source code and your ConTEXt setup? Thanks. – Taha Yasin Nov 2 '15 at 11:04
  • 1
    As I wrote: I used Khaled's code from the answer you linked to (replacing his sample text with yours). I don't know what you mean by "context setup." If you want help, you will have to supply more information: what version are you running, what error messages (if any) did you receive? The information you gave was incomplete and misleading. – Thomas Nov 2 '15 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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