This is a complement to these questions:

My aim is to create a macro like \color which can be used in RTL mode (right to left) and in all circumstances to color text and drawing stuff without issues:

Here my attempt (which use fontspec Color key to color text and normal \color to color rules and drawings but this need to patch every drawing stuff like \rule, tikzpicture,... )



% patch \rule commmand



Right to left text {\rtlcolor{red} RED TEXT \rule{5pt}{5pt} right to left text  
right to left text right to left text right to left text right to left text } out of group 


enter image description here

  • 2
    Why is switching to luatex not an option for you? You are now fighting since weeks with the insufficient rtf model of xelatex. Feb 4 '19 at 11:04
  • Most of rtl writers use xelatex rather then lualatex because of the great support from bidi package
    – Salim Bou
    Feb 4 '19 at 11:24
  • 3
    That's now. But seeing the lack of development in xetex/bidi/polyglossia compared to the changes in bidi/babel and the luatex engine I would say it would make more sense to spent your time to improve luatex. Feb 4 '19 at 14:26

Your Answer

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

Browse other questions tagged or ask your own question.