5

In my arabic environment the arabic numbers are mirrored. Minimal Example:

\definefont[Sheh][name:Scheherazade*arabic at 18pt]   
\definestartstop[Arab][commands=\setups{Arabic}]
\def\Arab{\doArab}
\def\Arab[#1]{
    \startArab 
            \setupalign[r2l]\Sheh \startalignment [middle] #1 \stopalignment
    \stopArab
    }

\starttext    
\Arab[

إِنَّ مَثَلَ عِيسَىٰ عِندَ ٱللَّـهِ كَمَثَلِ ءَادَمَ خَلَقَهُ مِن تُرَابٍ ثُمَّ قَالَ لَهُ كُن فَيَكُونُ ﴿٥٩﴾
]

The verse-number is wrong, it shows 95, but it is 59 in the code.  
\stoptext

I think this is an effect of \setupalign[r2l], so how to fix this, that

(٥٩)

is indeed interpreted as it is (59). Of course I could always mirror the numbers myself, but that would be not very suitable.

3
  • Have you tried \setupdirections[bidi=global]?
    – user22486
    Commented Oct 23, 2012 at 10:41
  • Definetly a good step! But now in the above code, the number is out of the brackets. If we can fix this one, than we are done!
    – Mustafa
    Commented Oct 23, 2012 at 11:09
  • 2
    That is a bug of ConTeXt. Write to the author of ConText.
    – user22486
    Commented Oct 23, 2012 at 11:29

2 Answers 2

3

If I understand the subject correctly, Eastern numbers are written (1) left-to-right (2) big-endian (the thousands digit is entered before the hundreds digit). They are written this way in input, and typeset the same way in output.

Your problem, again if I understand the mechanics correctly, is that ConTeXt, either by intention or by omission, does not automatically recognise numbers in the text, and therefore typesets them r2l like the rest of the text.

This might solve your problem:

\setupmathematics[align=l2r]

\Arab[
    \math{٥٩}
]

This solution does not suffice if you want to typeset mathematics r2l and typeset the numbers in the maths l2r. This seems to be a difficult problem: see

I personally think that if one could set up the \digits command for this, that command would be a better fit than \math. \digits semantically corresponds to numbers, whereas \math semantically corresponds to mathematics. Something like this would be nice:

\setupalign[r2l]
\setupdigits[align=l2r]
\digits{٥٩}

-->

٥٩, not ٩٥.

May I ask that you sign up to the ntg-context mailing list and ask your question again there? Hans Hagen, the main developer, is on that list; and I believe Khaled Hosny and/or Idris Hamid are, too. You will get an authoritative answer, and then we can amend this answer for the benefit of future visitors of this site.

2
  • 1
    At the moment I do not want to typeset both. But your solution does not work for me \environment arab-besser-sty \setupmathematics[align=l2r] \starttext \Arab[\math{٥٩}] \stoptext This does not print any number at all. Thank you for your suggestion with the mailing list, I will sign up there in a few days.
    – Mustafa
    Commented Oct 19, 2012 at 7:31
  • Did you manage to solve your problem, in the end?
    – Esteis
    Commented Jun 5, 2013 at 13:45
0
\setupdirections[bidi=global,method=one]

Source: https://wiki.contextgarden.net/RTL

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .