Thanks, Wolfgang!  This does work indeed.  I had actually tried it before but made a mistake which made it useless.

What commands accept this kind of setup?  Do the headers and footers accept such a thing?  How much overhead does this cause?

Is it possible to run the bidi code on a small string? Is there a macro like \applybidi{some-text-to-apply-bidi-algorithm-on}?

—MHB

On Tue, Jan 19, 2016 at 6:30 AM, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
19. Januar 2016 um 12:16
That should work for Ibn Saeed, but it's not a complete solution.  For example it does not work if one wants to write "page x of y" instead, with "page" and "y" written in Arabic/Persian.  Then the text of the header is partly LTR and part RTL.

This is still simple and I can use my hacky solution and mix \lefttoright and \righttoleft to get it right.  But is it possible to extend the \setupdirections[bidi=on] to apply to parts other than the main text?  I just noticed this does not apply to footnotes either.  Having numbers in the TRL footnote text produces incorrect typesetting.
ConTeXt resets many settings for headers, footers, footnotes etc. and have to set them again for these elements.

To apply the bidi setting to footnotes you have to add

\startsetups[bidi:footnotes]
  \setupdirection[bidi=on]
\stopsetups

\setupnotes[footnote][setups=bidi:footnotes]

to your document.

Wolfgang



___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________