From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/94410 Path: news.gmane.org!not-for-mail From: Mohammad Hossein Bateni Newsgroups: gmane.comp.tex.context Subject: Re: RTL section heads Date: Tue, 12 Apr 2016 20:46:12 -0400 Message-ID: References: <570BB8C3.5070207@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4907828999362298898==" X-Trace: ger.gmane.org 1460508415 6484 80.91.229.3 (13 Apr 2016 00:46:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Apr 2016 00:46:55 +0000 (UTC) Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Wed Apr 13 02:46:42 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aq8x7-0007Rt-3i for gctc-ntg-context-518@m.gmane.org; Wed, 13 Apr 2016 02:46:41 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A3CACA357; Wed, 13 Apr 2016 02:46:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AbJ5m98azCNG; Wed, 13 Apr 2016 02:46:26 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id ADC81A36E; Wed, 13 Apr 2016 02:46:26 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 59F1DA357 for ; Wed, 13 Apr 2016 02:46:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vZ3kLYo6zN_W for ; Wed, 13 Apr 2016 02:46:24 +0200 (CEST) Original-Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id F41B5A34F for ; Wed, 13 Apr 2016 02:46:13 +0200 (CEST) Original-Received: by mail-ob0-f170.google.com with SMTP id k9so22947216obk.2 for ; Tue, 12 Apr 2016 17:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=CLQTJ/skioCIdMLF18sFymkUtbzJJUV2O2lOCi+oXyk=; b=CO5FLWRSX5pgiWFqu+q78kt1t+hCtIDIB4YcJoqCKL7ncuxbGHBSFqwJD1Noq3Rwqh hEVE4Jzkc3dyTGyPwACMEDXJmW50BOmnv/6Ob66kMrzFiErhg3oRPOLRK01IEfrsoR4z QADRCdRBv/qkjqY7r4mwBR2dHmixo/ucUzJ7geNM05o0hePN/r4/UFeTXkafLBnKfbid cPk4pq3y3ffyhVCbL3YNiV4rkmyM+YWcX0YpvPb1VlExLsjcCgJ7EHh9IMOmyvima17R mawgZFse5buUNCITP5VXa83rgZsBYCgPniCgTikFcP0YZnE1S0F0UpIS2ja2ABShf7iU iwoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=CLQTJ/skioCIdMLF18sFymkUtbzJJUV2O2lOCi+oXyk=; b=mCWvxyYp+dYAeaHUjgerB81GduIDjvu8RW/cMiWD955s73m6iAtBU0avKR3lMAeUju lOJd10HwOn8dtRksPlKeruP7IjlWkO0ZPAxYT5XpAz4ajzfbxwVTUhVpV7P3gTjnXLGh Q203JOowDUkL6ZjSsJpwcok6xy5rcWSspubCEBncnCxbWMchR8DInNnPX00+V5NXsMX4 pFcHEkfaX0FWiP3UUNcHosGGkMI9dDRJPmHqJHOTRDjjKgefyFM4QtCxAsifnbI2aqcI f9v9sPsVSDHysMnfJvLqxWCuKQCyshpLQ/4x57XZiSxNzWwm/qy6+yHInO0Ux7OM3AgO ss0A== X-Gm-Message-State: AOPr4FUkTi0Ir+Mpnkdls5RnnKRK5HggUXLgBSVSIyjGrRG1atQhhvs0srFjFNy4VYZt8qZZSNnGnH4uVU0DEw== X-Received: by 10.182.216.236 with SMTP id ot12mr3128990obc.69.1460508372470; Tue, 12 Apr 2016 17:46:12 -0700 (PDT) Original-Received: by 10.202.188.134 with HTTP; Tue, 12 Apr 2016 17:46:12 -0700 (PDT) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:94410 Archived-At: --===============4907828999362298898== Content-Type: multipart/alternative; boundary=001a1134b2bcbb99a40530531a73 --001a1134b2bcbb99a40530531a73 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Unfortunately when I use method=3Dtwo for bidi, the numbers in the main bod= y are written from right to left. I'm starting to wonder whether it does anything nontrivial at all. \usemodule[simplefonts] \setmainfont[ALM Fixed][features=3Darabic,range=3Darabic] \setupdirections[bidi=3Dglobal,method=3Dtwo] \setupalign[r2l] \starttext =D8=B3=D8=A7=D9=84 =DB=B2=DB=B0=DB=B1=DB=B6 2016 \stoptext I'm pretty sure this used to work (for example in version 2016.01.18 22:21). A similar piece of code is working fine on the website . I'm using CONTEXT version: 2016.04.01 13:01. I also verified that it is not working in version: 2016.04.10 23:52= . On Mon, Apr 11, 2016 at 11:47 AM, Mohammad Hossein Bateni wrote: > Thanks, Hans! This does solve the problem with the list of numbers. And > actually if I add a numberstyle field, I can the section heads the way I > like. Here is the setup that worked. (I will update Wiki later.) > > \setupdirections[bidi=3Dglobal,method=3Dtwo] > \setupalign[r2l] > > \def\LTR#1{{\lefttoright#1}} > \def\leftpersiandecimals#1{\LTR{\persiandecimals{#1}}} > \defineconversion[leftpersiandecimals][\leftpersiandecimals] > \setuphead[chapter,title,section,subject] > [conversion=3Dleftpersiandecimals,numberstyle=3D\righttoleft] > > \defineseparatorset[dashsep][-,-,-,-] > \setuphead[section][sectionseparatorset=3Ddashsep] > > On Mon, Apr 11, 2016 at 10:46 AM, Hans Hagen wrote: > >> On 4/11/2016 4:25 AM, Mohammad Hossein Bateni wrote: >> >>> Hans & Wolfgang, >>> >>> Do you have suggestions here? How can I get the behavior I want for th= e >>> section head numbers? >>> >>> In fact, the following may be quite relevant. >>> >>> \usemodule[simplefonts] >>> \setmainfont[ALM Fixed][features=3Darabic,range=3Darabic] >>> >>> \setupdirections[bidi=3Dglobal,method=3Ddefault] >>> \setupalign[r2l] >>> >>> \starttext >>> >>> =D8=A7=D8=B9=D8=AF=D8=A7=D8=AF =DB=B1=D8=8C =DB=B2=D8=8C =DB=B3 =D9=88 = =DB=B4 =D8=B1=D8=A7 =D8=AF=D8=B1 =D9=86=D8=B8=D8=B1 =D8=A8=DA=AF=DB=8C=D8= =B1=DB=8C=D8=AF. >>> >>> =D8=A7=D8=B9=D8=AF=D8=A7=D8=AF 1=D8=8C 2=D8=8C 3 =D9=88 4 =D8=B1=D8=A7 = =D8=AF=D8=B1 =D9=86=D8=B8=D8=B1 =D8=A8=DA=AF=DB=8C=D8=B1=DB=8C=D8=AF. >>> >>> =D8=A7=D8=B9=D8=AF=D8=A7=D8=AF 1, 2, 3 =D9=88 4 =D8=B1=D8=A7 =D8=AF=D8= =B1 =D9=86=D8=B8=D8=B1 =D8=A8=DA=AF=DB=8C=D8=B1=DB=8C=D8=AF. >>> >>> \stoptext >>> >>> >>> I expect the numbers 1, 2, 3 and 4 to appear in the same order from >>> right to left. However, the visual order that I observe (regardless of >>> whether I use Persian digits or English digits, or whether I use Persia= n >>> or English commas) is 4, 1, 2, 3 (from left to right). Is this a bug i= n >>> the bidi code? If so, are there any workarounds? >>> >> >> method=3Dtwo >> >> Thanks, >>> Hossein >>> >>> On Fri, Apr 8, 2016 at 5:20 PM, Mohammad Hossein Bateni >>> > wrote: >>> >>> Hi, >>> >>> This is concerning an RTL text. I have one chapter and 10 sections >>> under that. My goal is to achieve the following. >>> 1) The number 10 should appear correctly with '1' visually to the >>> left of '0'. >>> 2) The chapter number should visually appear to the right of the >>> section number. >>> 3) Chapter and section numbers should be separated with a dash. >>> (This is ignored in this email and I will follow up about it in >>> another thread. To get a minimal working example, I also do not tr= y >>> to change the numbers to use Persian digits.) >>> >>> In particular, the headings will be visually something like the >>> following (aligned to the right). >>> elpmas 1 >>> txet 1-1 >>> txet 2-1 >>> txet 3-1 >>> ... >>> txet 10-1 >>> >>> Here's the first attempt. >>> >>> %% Attempt 1 >>> \setupalign[r2l] >>> >>> \starttext >>> \placecontent >>> >>> \chapter{sample} >>> \dorecurse{10}{\section{text}} >>> \stoptext >>> >>> The result is: >>> elpmas 1 >>> txet 1-1 >>> ... >>> txet 01-1 >>> >>> >>> Then I add "\setupdirections[bidi=3Dglobal,method=3Ddefault]" to th= e >>> beginning and I get the most strange result (number right-aligned >>> but texts left-aligned): >>> sample 1 >>> text 1.1 >>> ... >>> text 1.10 >>> >>> >>> A third attempt gives almost what I want (without period as the >>> separator). >>> >>> %% Attempt 3 >>> \setupalign[r2l] >>> >>> \def\LTR#1{{\lefttoright#1}} >>> \def\leftnumbers#1{\LTR{\numbers{#1}}} >>> \defineconversion[leftnumbers][\leftnumbers] >>> \setuphead[chapter,title,section,subject] [conversion=3Dleftnumbers= ] >>> >>> \starttext >>> \placecontent >>> >>> \chapter{sample} >>> \dorecurse{10}{\section{text}} >>> \stoptext >>> >>> >>> The big problem is that in my RTL documents, I always have the >>> setupdirections command, which messes things up here. (This makes >>> it difficult to one section name with English title, which should >>> still be typeset on the right-hand side of the page.) Note that in >>> attempt 2 above, there were two issues: >>> (1) Text and numbers appeared on the two far ends of the screen >>> instead of being close to each other. This does not happen when I >>> use Farsi text. >>> (2) Chapter number appears to the left of section number. >>> >>> >>> %% Attempt 5 >>> \usemodule[simplefonts] >>> \setmainfont[ALM Fixed][features=3Darabic,range=3Darabic] >>> >>> \setupdirections[bidi=3Dglobal,method=3Ddefault] >>> \setupalign[r2l] >>> >>> \starttext >>> \placecontent >>> >>> \chapter{=D9=86=D9=85=D9=88=D9=86=D9=87} >>> \dorecurse{10}{\section{=D9=85=D8=AA=D9=86}} >>> \stoptext >>> >>> >>> Interestingly the table of contents looks fine if I put the number >>> inside an LTR macro; still in the main body, the section heads are >>> typeset incorrectly. >>> >>> %% Attempt 6 >>> \usemodule[simplefonts] >>> \setmainfont[ALM Fixed][features=3Darabic,range=3Darabic] >>> >>> \setupdirections[bidi=3Dglobal,method=3Ddefault] >>> \setupalign[r2l] >>> >>> \def\LTR#1{{\lefttoright#1}} >>> \def\leftnumbers#1{\LTR{\numbers{#1}}} >>> \defineconversion[leftnumbers][\leftnumbers] >>> \setuphead[chapter,title,section,subject] [conversion=3Dleftnumbers= ] >>> >>> \starttext >>> \placecontent >>> >>> \chapter{=D9=86=D9=85=D9=88=D9=86=D9=87} >>> \dorecurse{10}{\section{=D9=85=D8=AA=D9=86}} >>> \stoptext >>> >>> >>> I guess the solution is to get the entire section head number strin= g >>> (e.g., 1.10) to have RTL direction, however, each individual number >>> string inside (say, 1 or 10) should be written LTR. How can this b= e >>> achieved? >>> >>> The six TeX files (with corresponding PDF outputs) are attached. >>> >>> BTW this is using ConTeXt ver: 2016.04.01 13:01 MKIV beta fmt: >>> 2016.4.7 int: english/english, running LuaTeX, Version beta-0.90.0 >>> (TeX Live 2016) on Mac OS X. >>> >>> Thanks a lot, >>> =E2=80=94MHB >>> >>> >>> >> >> -- >> >> ----------------------------------------------------------------- >> Hans Hagen | PRAGMA ADE >> Ridderstraat 27 | 8061 GH Hasselt | The Netherlands >> tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl >> ----------------------------------------------------------------- >> > > --001a1134b2bcbb99a40530531a73 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Unfortunately when I use method=3Dtwo for bidi, the number= s in the main body are written from right to left.=C2=A0 I'm starting t= o wonder whether it does anything nontrivial at all.

\usemodule[sim= plefonts]
\setmainfont[ALM Fixed][features=3Darabic,range=3Darabic]
=
\setupdirections[bidi=3Dglobal,method=3Dtwo]
\setupalign[r2l]
\starttext

=D8=B3=D8=A7=D9=84 =DB=B2=DB=B0=DB=B1=DB=B6
2016

\stoptext


I'm pretty sure this used to work (for example in version 2016.01= .18 22:21).=C2=A0 A similar piece of code is working fine on the website.=C2=A0 I'm using CONTEX= T version: 2016.04.01 13:01.=C2=A0 I also verified that it is not working i= n version: 2016.04.10 23:52.

On Mon, Apr= 11, 2016 at 11:47 AM, Mohammad Hossein Bateni <bateni@gmail.com> wrote:
Thanks, Hans= !=C2=A0 This does solve the problem with the list of numbers.=C2=A0 And act= ually if I add a numberstyle field, I can the section heads the way I like.= =C2=A0 Here is the setup that worked. =C2=A0(I will update Wiki later.)
=
\setupdirections[bidi=3Dglobal,method=3Dtwo]
\= setupalign[r2l]

\def\LTR#1{{\lefttoright#1}}
\def\leftpers= iandecimals#1{\LTR{\persiandecimals{#1}}}
\defineconversion[leftpersiand= ecimals][\leftpersiandecimals]
\setuphead[chapter,title,section,subject]= [conversion=3Dleftpersiandecimals,numberstyle=3D\righttoleft]
\defineseparatorset[dashsep][-,-,-,-]
\setuphead[sec= tion][sectionseparatorset=3Ddashsep]
<= div class=3D"h5">

= On Mon, Apr 11, 2016 at 10:46 AM, Hans Hagen <pragma@wxs.nl> wr= ote:
On 4/11/2016 4:25 AM, Mohammad= Hossein Bateni wrote:
Hans & Wolfgang,

Do you have suggestions here?=C2=A0 How can I get the behavior I want for t= he
section head numbers?

In fact, the following may be quite relevant.

\usemodule[simplefonts]
\setmainfont[ALM Fixed][features=3Darabic,range=3Darabic]

\setupdirections[bidi=3Dglobal,method=3Ddefault]
\setupalign[r2l]

\starttext

=D8=A7=D8=B9=D8=AF=D8=A7=D8=AF =DB=B1=D8=8C =DB=B2=D8=8C =DB=B3 =D9=88 =DB= =B4 =D8=B1=D8=A7 =D8=AF=D8=B1 =D9=86=D8=B8=D8=B1 =D8=A8=DA=AF=DB=8C=D8=B1= =DB=8C=D8=AF.

=D8=A7=D8=B9=D8=AF=D8=A7=D8=AF 1=D8=8C 2=D8=8C 3 =D9=88 4 =D8=B1=D8=A7 =D8= =AF=D8=B1 =D9=86=D8=B8=D8=B1 =D8=A8=DA=AF=DB=8C=D8=B1=DB=8C=D8=AF.

=D8=A7=D8=B9=D8=AF=D8=A7=D8=AF 1, 2, 3 =D9=88 4 =D8=B1=D8=A7 =D8=AF=D8=B1 = =D9=86=D8=B8=D8=B1 =D8=A8=DA=AF=DB=8C=D8=B1=DB=8C=D8=AF.

\stoptext


I expect the numbers 1, 2, 3 and 4 to appear in the same order from
right to left.=C2=A0 However, the visual order that I observe (regardless o= f
whether I use Persian digits or English digits, or whether I use Persian or English commas) is 4, 1, 2, 3 (from left to right).=C2=A0 Is this a bug = in
the bidi code?=C2=A0 If so, are there any workarounds?

method=3Dtwo

Thanks,
Hossein

On Fri, Apr 8, 2016 at 5:20 PM, Mohammad Hossein Bateni
<bateni@gmail.com<= /a> <mailto:bateni= @gmail.com>> wrote:

=C2=A0 =C2=A0 Hi,

=C2=A0 =C2=A0 This is concerning an RTL text.=C2=A0 I have one chapter and = 10 sections
=C2=A0 =C2=A0 under that.=C2=A0 My goal is to achieve the following.
=C2=A0 =C2=A0 1) The number 10 should appear correctly with '1' vis= ually to the
=C2=A0 =C2=A0 left of '0'.
=C2=A0 =C2=A0 2) The chapter number should visually appear to the right of = the
=C2=A0 =C2=A0 section number.
=C2=A0 =C2=A0 3) Chapter and section numbers should be separated with a das= h.
=C2=A0 =C2=A0 =C2=A0 (This is ignored in this email and I will follow up ab= out it in
=C2=A0 =C2=A0 another thread.=C2=A0 To get a minimal working example, I als= o do not try
=C2=A0 =C2=A0 to change the numbers to use Persian digits.)

=C2=A0 =C2=A0 In particular, the headings will be visually something like t= he
=C2=A0 =C2=A0 following (aligned to the right).
=C2=A0 =C2=A0 elpmas 1
=C2=A0 =C2=A0 txet 1-1
=C2=A0 =C2=A0 txet 2-1
=C2=A0 =C2=A0 txet 3-1
=C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 txet 10-1

=C2=A0 =C2=A0 Here's the first attempt.

=C2=A0 =C2=A0 %% Attempt 1
=C2=A0 =C2=A0 \setupalign[r2l]

=C2=A0 =C2=A0 \starttext
=C2=A0 =C2=A0 \placecontent

=C2=A0 =C2=A0 \chapter{sample}
=C2=A0 =C2=A0 \dorecurse{10}{\section{text}}
=C2=A0 =C2=A0 \stoptext

=C2=A0 =C2=A0 The result is:
=C2=A0 =C2=A0 elpmas 1
=C2=A0 =C2=A0 txet 1-1
=C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 txet 01-1


=C2=A0 =C2=A0 Then I add "\setupdirections[bidi=3Dglobal,method=3Ddefa= ult]" to the
=C2=A0 =C2=A0 beginning and I get the most strange result (number right-ali= gned
=C2=A0 =C2=A0 but texts left-aligned):
=C2=A0 =C2=A0 sample=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1 =C2=A0 =C2=A0 text=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A01.1
=C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 text=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A01.10


=C2=A0 =C2=A0 A third attempt gives almost what I want (without period as t= he
=C2=A0 =C2=A0 separator).

=C2=A0 =C2=A0 %% Attempt 3
=C2=A0 =C2=A0 \setupalign[r2l]

=C2=A0 =C2=A0 \def\LTR#1{{\lefttoright#1}}
=C2=A0 =C2=A0 \def\leftnumbers#1{\LTR{\numbers{#1}}}
=C2=A0 =C2=A0 \defineconversion[leftnumbers][\leftnumbers]
=C2=A0 =C2=A0 \setuphead[chapter,title,section,subject] [conversion=3Dleftn= umbers]

=C2=A0 =C2=A0 \starttext
=C2=A0 =C2=A0 \placecontent

=C2=A0 =C2=A0 \chapter{sample}
=C2=A0 =C2=A0 \dorecurse{10}{\section{text}}
=C2=A0 =C2=A0 \stoptext


=C2=A0 =C2=A0 The big problem is that in my RTL documents, I always have th= e
=C2=A0 =C2=A0 setupdirections command, which messes things up here.=C2=A0 (= This makes
=C2=A0 =C2=A0 it difficult to one section name with English title, which sh= ould
=C2=A0 =C2=A0 still be typeset on the right-hand side of the page.)=C2=A0 N= ote that in
=C2=A0 =C2=A0 attempt 2 above, there were two issues:
=C2=A0 =C2=A0 (1) Text and numbers appeared on the two far ends of the scre= en
=C2=A0 =C2=A0 instead of being close to each other.=C2=A0 This does not hap= pen when I
=C2=A0 =C2=A0 use Farsi text.
=C2=A0 =C2=A0 (2) Chapter number appears to the left of section number.


=C2=A0 =C2=A0 %% Attempt 5
=C2=A0 =C2=A0 \usemodule[simplefonts]
=C2=A0 =C2=A0 \setmainfont[ALM Fixed][features=3Darabic,range=3Darabic]

=C2=A0 =C2=A0 \setupdirections[bidi=3Dglobal,method=3Ddefault]
=C2=A0 =C2=A0 \setupalign[r2l]

=C2=A0 =C2=A0 \starttext
=C2=A0 =C2=A0 \placecontent

=C2=A0 =C2=A0 \chapter{=D9=86=D9=85=D9=88=D9=86=D9=87}
=C2=A0 =C2=A0 \dorecurse{10}{\section{=D9=85=D8=AA=D9=86}}
=C2=A0 =C2=A0 \stoptext


=C2=A0 =C2=A0 Interestingly the table of contents looks fine if I put the n= umber
=C2=A0 =C2=A0 inside an LTR macro; still in the main body, the section head= s are
=C2=A0 =C2=A0 typeset incorrectly.

=C2=A0 =C2=A0 %% Attempt 6
=C2=A0 =C2=A0 \usemodule[simplefonts]
=C2=A0 =C2=A0 \setmainfont[ALM Fixed][features=3Darabic,range=3Darabic]

=C2=A0 =C2=A0 \setupdirections[bidi=3Dglobal,method=3Ddefault]
=C2=A0 =C2=A0 \setupalign[r2l]

=C2=A0 =C2=A0 \def\LTR#1{{\lefttoright#1}}
=C2=A0 =C2=A0 \def\leftnumbers#1{\LTR{\numbers{#1}}}
=C2=A0 =C2=A0 \defineconversion[leftnumbers][\leftnumbers]
=C2=A0 =C2=A0 \setuphead[chapter,title,section,subject] [conversion=3Dleftn= umbers]

=C2=A0 =C2=A0 \starttext
=C2=A0 =C2=A0 \placecontent

=C2=A0 =C2=A0 \chapter{=D9=86=D9=85=D9=88=D9=86=D9=87}
=C2=A0 =C2=A0 \dorecurse{10}{\section{=D9=85=D8=AA=D9=86}}
=C2=A0 =C2=A0 \stoptext


=C2=A0 =C2=A0 I guess the solution is to get the entire section head number= string
=C2=A0 =C2=A0 (e.g., 1.10) to have RTL direction, however, each individual = number
=C2=A0 =C2=A0 string inside (say, 1 or 10) should be written LTR.=C2=A0 How= can this be
=C2=A0 =C2=A0 achieved?

=C2=A0 =C2=A0 The six TeX files (with corresponding PDF outputs) are attach= ed.

=C2=A0 =C2=A0 BTW this is using ConTeXt ver: 2016.04.01 13:01 MKIV beta f= mt:
=C2=A0 =C2=A0 2016.4.7 int: english/english, running LuaTeX, Version beta-0= .90.0
=C2=A0 =C2=A0 (TeX Live 2016) on Mac OS X.

=C2=A0 =C2=A0 Thanks a lot,
=C2=A0 =C2=A0 =E2=80=94MHB




--

-----------------------------------------------------------------
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 H= ans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Ridderstraat 27 | 8061 GH = Hasselt | The Netherlands
=C2=A0 =C2=A0 =C2=A0 tel: 038 477 53 69 | www.pragma-ade.com | www.prag= ma-pod.nl
-----------------------------------------------------------------


--001a1134b2bcbb99a40530531a73-- --===============4907828999362298898== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============4907828999362298898==--