ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* r2l alignment and linenumbering conflict?
@ 2015-07-30 15:30 talazem
  2015-08-01 15:37 ` talazem
  0 siblings, 1 reply; 25+ messages in thread
From: talazem @ 2015-07-30 15:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1051 bytes --]

There seems to be some limitation (or bug) in right-to-left (r2l) alignment, when used alongside linenumbering. Consider the following:

> \setuppapersize[A6]
> \starttext \showframe
> 
> \section{Incorrect}
> \startlinenumbering
> \startalignment[r2l]
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie dictum quam non congue. Integer ut dolor vel mi vestibulum molestie vel et nulla.
> \stopalignment
> \stoplinenumbering
> 
> \section{Correct}
> \startalignment[r2l]
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie dictum quam non congue. Integer ut dolor vel mi vestibulum molestie vel et nulla.
> \stopalignment
> 
> \stoptext

The RTL alignment works correctly on its own. However, when you introduce another factor — here,  linenumbers — the RTL alignment is ignored.

Perhaps this linked to the problem with of RTL footnotes being discussed here: gmane.comp.tex.context/92113 <http://article.gmane.org/gmane.comp.tex.context/92113>?

Best wishes,
Talal

[-- Attachment #1.2: Type: text/html, Size: 2244 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-07-30 15:30 r2l alignment and linenumbering conflict? talazem
@ 2015-08-01 15:37 ` talazem
  2015-08-01 18:04   ` Pablo Rodriguez
                     ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: talazem @ 2015-08-01 15:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1867 bytes --]

Sorry to pester, but this problem is barring me from moving my book project into ConTeXt this weekend.

The use of linenumbers seems to throw off the R2L mechanism. Example of the problem attached. 



> On 30 Jul 2015, at 16:30, talazem@fastmail.fm wrote:
> 
> There seems to be some limitation (or bug) in right-to-left (r2l) alignment, when used alongside linenumbering. Consider the following:
> 
>> \setuppapersize[A6]
>> \starttext \showframe
>> 
>> \section{Incorrect}
>> \startlinenumbering
>> \startalignment[r2l]
>> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie dictum quam non congue. Integer ut dolor vel mi vestibulum molestie vel et nulla.
>> \stopalignment
>> \stoplinenumbering
>> 
>> \section{Correct}
>> \startalignment[r2l]
>> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie dictum quam non congue. Integer ut dolor vel mi vestibulum molestie vel et nulla.
>> \stopalignment
>> 
>> \stoptext
> 
> The RTL alignment works correctly on its own. However, when you introduce another factor — here,  linenumbers — the RTL alignment is ignored.
> 
> Perhaps this linked to the problem with of RTL footnotes being discussed here: gmane.comp.tex.context/92113 <http://article.gmane.org/gmane.comp.tex.context/92113>?
> 
> Best wishes,
> Talal
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


[-- Attachment #1.2.1: Type: text/html, Size: 545 bytes --]

[-- Attachment #1.2.2: linertl.pdf --]
[-- Type: application/pdf, Size: 11046 bytes --]

[-- Attachment #1.2.3: Type: text/html, Size: 226 bytes --]

[-- Attachment #1.2.4: linertl.tex --]
[-- Type: application/applefile, Size: 71 bytes --]

[-- Attachment #1.2.5: Type: text/html, Size: 3740 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-01 15:37 ` talazem
@ 2015-08-01 18:04   ` Pablo Rodriguez
  2015-08-01 18:35   ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-01 18:47   ` Wolfgang Schuster
  2 siblings, 0 replies; 25+ messages in thread
From: Pablo Rodriguez @ 2015-08-01 18:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 08/01/2015 05:37 PM, talazem@fastmail.fm wrote:
> Sorry to pester, but this problem is barring me from moving my book
> project into ConTeXt this weekend.
> 
> The use of linenumbers seems to throw off the R2L mechanism. Example
> of the problem attached. 

Hi Talal,

I’m afraid that I don’t have a fix for what it might be a bug in ConTeXt.

If you want to work on you book before a fix is released, I’d suggest
you to add the following line at the top of your document:

    \definestartstop[linenumbering]

This will deactivate line numbering and it will allow you to work on the
rest of the book without having to add any code later.

If your book is already finished, you only have to wait for the fix ;-).

Just in case it helps,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-01 15:37 ` talazem
  2015-08-01 18:04   ` Pablo Rodriguez
@ 2015-08-01 18:35   ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-01 18:47   ` Wolfgang Schuster
  2 siblings, 0 replies; 25+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-08-01 18:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear Talal,
Salaam.

Your tex file linertl.tex appears to be corrupted, could you either repost  
it or send it to me off list?

I was also going to write something similar to Pablo. My suggestion is to  
move forward with the rest of your project and this will almost certainly  
be solved before you're done. Unless Hans says that there is no chance of  
a fix, which I *highly* doubt. Send a reminder to the list every few days  
or so, as you did today.

Proceeding this way produces an uneasy feeling; believe me, I know. But  
I've been in your shoes more times than I can count and it always worked  
out in the end.

Best wishes
Idris

On Sat, 01 Aug 2015 09:37:57 -0600, talazem@fastmail.fm  
<talazem@fastmail.fm> wrote:

> Sorry to pester, but this problem is barring me from moving my book  
> project into ConTeXt this weekend.
>
> The use of linenumbers seems to throw off the R2L mechanism. Example of  
> the problem attached.
>
>
>
>> On 30 Jul 2015, at 16:30, talazem@fastmail.fm wrote:
>>
>> There seems to be some limitation (or bug) in right-to-left (r2l)  
>> alignment, when used alongside linenumbering. Consider the following:
>>
>>> \setuppapersize[A6]
>>> \starttext \showframe
>>>
>>> \section{Incorrect}
>>> \startlinenumbering
>>> \startalignment[r2l]
>>> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque  
>>> molestie dictum quam non congue. Integer ut dolor vel mi vestibulum  
>>> molestie vel et nulla.
>>> \stopalignment
>>> \stoplinenumbering
>>>
>>> \section{Correct}
>>> \startalignment[r2l]
>>> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque  
>>> molestie dictum quam non congue. Integer ut dolor vel mi vestibulum  
>>> molestie vel et nulla.
>>> \stopalignment
>>>
>>> \stoptext
>>
>> The RTL alignment works correctly on its own. However, when you  
>> introduce another factor — here,  linenumbers — the RTL alignment is  
>> ignored.
>>
>> Perhaps this linked to the problem with of RTL footnotes being  
>> discussed here: gmane.comp.tex.context/92113  
>> <http://article.gmane.org/gmane.comp.tex.context/92113>?
>>
>> Best wishes,
>> Talal
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
>


-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-01 15:37 ` talazem
  2015-08-01 18:04   ` Pablo Rodriguez
  2015-08-01 18:35   ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-08-01 18:47   ` Wolfgang Schuster
  2015-08-02  9:24     ` talazem
  2 siblings, 1 reply; 25+ messages in thread
From: Wolfgang Schuster @ 2015-08-01 18:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 796 bytes --]

> talazem@fastmail.fm <mailto:talazem@fastmail.fm>
> 1. August 2015 17:37
> Sorry to pester, but this problem is barring me from moving my book 
> project into ConTeXt this weekend.
>
> The use of linenumbers seems to throw off the R2L mechanism. Example 
> of the problem attached.
>

The culprit is the function "boxed.stage_two" in page.lua which output 
each text line in the line numbering
environment in left to right mode. When you have justified lines 
everything is fine but when you have a ragged
line (e.g. the last line in a paragraph) ConTeXt aligns the context with 
the left margin.

\starttext \showframe

\startalignment[righttoleft,flushleft]

     \input ward

     \blank

     \startlinenumbering
     \input ward
     \stoplinenumbering

\stopalignment

\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2028 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-01 18:47   ` Wolfgang Schuster
@ 2015-08-02  9:24     ` talazem
  2015-08-02 11:51       ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 1 reply; 25+ messages in thread
From: talazem @ 2015-08-02  9:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2587 bytes --]

Thanks for that, Wolfgang. I can only hope that, as the culprit is known, it can be apprehended!

Idris: here is the document that I had sent (and many thanks to you and to Pablo for the more general advice):

>  \unexpanded\def\doVariant#1#2#3%
>       {\startlinenote[#1]{#2] #3}#2\stoplinenote[#1]}
> 
>    \newcounter\countvariants
>    \unexpanded\def\variant
>       {\doglobal\increment\countvariants
>        \normalexpanded{\doVariant{Varia:\countvariants}}}
> 
> \setupalign[r2l]
> 
> \showframe \starttext 
> 
> \section{Correct}
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie dictum quam non congue. Integer ut dolor vel mi vestibulum molestie vel et nulla. Morbi id justo vitae quam rhoncus tincidunt ut adipiscing nisi.
> 
> \section{Incorrect}
> \startlinenumbering
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie dictum quam non congue. Integer ut dolor vel mi vestibulum molestie vel et nulla. Morbi id justo vitae quam rhoncus tincidunt ut adipiscing nisi.
> \stoplinenumbering
> 
> \stoptext

All the best,
Talal

> On 1 Aug 2015, at 19:47, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
> 
>> talazem@fastmail.fm <mailto:talazem@fastmail.fm>	1. August 2015 17:37
>> Sorry to pester, but this problem is barring me from moving my book project into ConTeXt this weekend.
>> 
>> The use of linenumbers seems to throw off the R2L mechanism. Example of the problem attached. 
>> 
> 
> The culprit is the function "boxed.stage_two" in page.lua which output each text line in the line numbering
> environment in left to right mode. When you have justified lines everything is fine but when you have a ragged
> line (e.g. the last line in a paragraph) ConTeXt aligns the context with the left margin.
> 
> \starttext \showframe
> 
> \startalignment[righttoleft,flushleft]
> 
>     \input ward
> 
>     \blank
> 
>     \startlinenumbering
>     \input ward
>     \stoplinenumbering
> 
> \stopalignment
> 
> \stoptext
> 
> 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
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 5696 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-02  9:24     ` talazem
@ 2015-08-02 11:51       ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-02 13:31         ` talazem
  0 siblings, 1 reply; 25+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-08-02 11:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 02 Aug 2015 03:24:12 -0600, talazem@fastmail.fm  
<talazem@fastmail.fm> wrote:

> Thanks for that, Wolfgang. I can only hope that, as the culprit is  
> known, it can be apprehended!

Talal, here is a barbarous workaround using \thinrule:

======================
\setuppapersize[A6]
\starttext \showframe

\setupthinrules[color=white]
\setupwhitespace[big]

\section{Incorrect}
\startlinenumbering
\startalignment[r2l]
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque  
molestie dictum quam non congue. Integer ut dolor vel mi vestibulum  
molestie vel et nulla.\thinrule

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque  
molestie dictum quam non congue. Integer ut dolor vel mi vestibulum  
molestie vel et nulla.
\stopalignment
\stoplinenumbering

\section{Correct}
\startalignment[r2l]
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque  
molestie dictum quam non congue. Integer ut dolor vel mi vestibulum  
molestie vel et nulla.
\stopalignment

\stoptext
======================

This effectively hides the problem. Unfortunately it is apparently not  
straightforward to invoke the \thinrule automatically at the end of every  
paragraph [see the other thread with Alan].

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-02 11:51       ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-08-02 13:31         ` talazem
  2015-08-02 17:15           ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 1 reply; 25+ messages in thread
From: talazem @ 2015-08-02 13:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thank you very much for this, Idris. It works nicely in the sample file you sent. But it goes off again once you add \setupdirections[bidi=global]. Consider the following:

==========
\setuppapersize[A6]
\definefontfamily[mainface][serif][ALMFixed][%
	features=arabic,
	range=arabic,
	]
\setupbodyfont [mainface]

\starttext \showframe
\setupdirections[bidi=global]

\setupthinrules[color=white]
\setupwhitespace[big]

\section{Incorrect}
\startlinenumbering
\startalignment[r2l]
هذه رسالة لطيفة ألفها العالم الكبير الفهامة النحرير.
هذه رسالة جامعة مانعة ألفها الشيخ الفاضل...
\thinrule

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie dictum quam non congue. Integer ut dolor vel mi vestibulum molestie vel et nulla.
\stopalignment
\stoplinenumbering

\section{Correct}
\startalignment[r2l]
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie dictum quam non congue. Integer ut dolor vel mi vestibulum molestie vel et nulla.
\stopalignment

\stoptext
=============

With many thanks, and salam,
Talal

> On 2 Aug 2015, at 12:51, Idris Samawi Hamid ادريس سماوي حامد <Idris.Hamid@colostate.edu> wrote:
> 
> On Sun, 02 Aug 2015 03:24:12 -0600, talazem@fastmail.fm <talazem@fastmail.fm> wrote:
> 
>> Thanks for that, Wolfgang. I can only hope that, as the culprit is known, it can be apprehended!
> 
> Talal, here is a barbarous workaround using \thinrule:
> 
> ======================
> \setuppapersize[A6]
> \starttext \showframe
> 
> \setupthinrules[color=white]
> \setupwhitespace[big]
> 
> \section{Incorrect}
> \startlinenumbering
> \startalignment[r2l]
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie dictum quam non congue. Integer ut dolor vel mi vestibulum molestie vel et nulla.\thinrule
> 
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie dictum quam non congue. Integer ut dolor vel mi vestibulum molestie vel et nulla.
> \stopalignment
> \stoplinenumbering
> 
> \section{Correct}
> \startalignment[r2l]
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque molestie dictum quam non congue. Integer ut dolor vel mi vestibulum molestie vel et nulla.
> \stopalignment
> 
> \stoptext
> ======================
> 
> This effectively hides the problem. Unfortunately it is apparently not straightforward to invoke the \thinrule automatically at the end of every paragraph [see the other thread with Alan].
> 
> Best wishes
> Idris
> -- 
> Idris Samawi Hamid
> Professor of Philosophy
> Colorado State University
> Fort Collins, CO 80523
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-02 13:31         ` talazem
@ 2015-08-02 17:15           ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-02 20:46             ` talazem
  2015-08-03 13:54             ` talazem
  0 siblings, 2 replies; 25+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-08-02 17:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 2040 bytes --]

Dear Talal,
Salaam. See below:

On Sun, 02 Aug 2015 07:31:37 -0600, talazem@fastmail.fm  
<talazem@fastmail.fm> wrote:

> Thank you very much for this, Idris. It works nicely in the sample file  
> you sent. But it goes off again once you add  
> \setupdirections[bidi=global]. Consider the following:
>
> ==========
<snip>

> \setupdirections[bidi=global]
>
> \setupthinrules[color=white]
> \setupwhitespace[big]
>
> \section{Incorrect}
> \startlinenumbering
> \startalignment[r2l]
> هذه رسالة لطيفة ألفها العالم الكبير الفهامة النحرير.
> هذه رسالة جامعة مانعة ألفها الشيخ الفاضل...
> \thinrule
> ===========

You're right. \thinrule has LR unicode characters which is probably why it  
gets thrown off. So if you turn off global bidi and then either 1) just go  
with either global RL or 2) invoke RL inside the linenumbering it will  
work:

% \setupdirections[bidi=global]
\righttoleft %% global RL

or just

\startlinenumbering
\righttoleft %% local RL, not needed if global RL invoked
\startalignment[r2l]

Again, it's a barbarous (and temporary) workaround. See attached.

Wassalaam
Idris

PS Unless there is a lot of Latin in the critical edition file, I would  
probably depend more on explicit dir commands (\righttolet, \lefttoright)  
and less on bidi, which is still buggy in a number of ways. Beyond the  
ConTeXt implementation: The unicode bidi algorithm was not designed with  
advanced typesetting and typography in mind, works best for text-editing  
etc. per se. so local bidi *may perhaps* be more useful than global bidi  
for the critical-edition portion your project.

I'm not at all suggesting that this particular bug should not be a  
priority; printing paragraph lines in a linenumbering environment *must*  
be direction-agnostic. Just a matter of general strategy to consider.
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523

[-- Attachment #2: r2l-linenumbering-arabic.tex --]
[-- Type: application/x-tex, Size: 1048 bytes --]

[-- Attachment #3: r2l-linenumbering-arabic.pdf --]
[-- Type: application/pdf, Size: 11815 bytes --]

[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-02 17:15           ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-08-02 20:46             ` talazem
  2015-08-03 13:54             ` talazem
  1 sibling, 0 replies; 25+ messages in thread
From: talazem @ 2015-08-02 20:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thank you very much for this, Idris. What with the other bugs and problems I’ve faced with R2L (in footnotes, etc.), I was starting to wonder whether a more explicit, rather than global, use of RTL might be a better approach. I’m going to experiment with them, at least to learn how to use them with greater focus.

The good news is that apparently Hans has already patched the page-lin.lua file that Wolfgang had identified as the culprit, and it will be included in the next beta. 

Many thanks to you, Pablo, Wolfgang, and of course Hans so much for your help in getting these right-to-left issues solved. There are a couple of small bidi issues remaining, including that mentioned in the “footnotes when using RtL (Arabic)” thread. The one or two other ones I will post shortly. But, in any case, I have now completely moved my project over into ConTeXt, confident that it (and the team behind it) can handle all of the needs of a multilingual academic monograph and of a bi-direction, Arabic critical edition’s need

With many thanks,
Talal

> On 2 Aug 2015, at 18:15, Idris Samawi Hamid ادريس سماوي حامد <Idris.Hamid@colostate.edu> wrote:
> 
> Dear Talal,
> Salaam. See below:
> 
> On Sun, 02 Aug 2015 07:31:37 -0600, talazem@fastmail.fm <talazem@fastmail.fm> wrote:
> 
>> Thank you very much for this, Idris. It works nicely in the sample file you sent. But it goes off again once you add \setupdirections[bidi=global]. Consider the following:
>> 
>> ==========
> <snip>
> 
>> \setupdirections[bidi=global]
>> 
>> \setupthinrules[color=white]
>> \setupwhitespace[big]
>> 
>> \section{Incorrect}
>> \startlinenumbering
>> \startalignment[r2l]
>> هذه رسالة لطيفة ألفها العالم الكبير الفهامة النحرير.
>> هذه رسالة جامعة مانعة ألفها الشيخ الفاضل...
>> \thinrule
>> ===========
> 
> You're right. \thinrule has LR unicode characters which is probably why it gets thrown off. So if you turn off global bidi and then either 1) just go with either global RL or 2) invoke RL inside the linenumbering it will work:
> 
> % \setupdirections[bidi=global]
> \righttoleft %% global RL
> 
> or just
> 
> \startlinenumbering
> \righttoleft %% local RL, not needed if global RL invoked
> \startalignment[r2l]
> 
> Again, it's a barbarous (and temporary) workaround. See attached.
> 
> Wassalaam
> Idris
> 
> PS Unless there is a lot of Latin in the critical edition file, I would probably depend more on explicit dir commands (\righttolet, \lefttoright) and less on bidi, which is still buggy in a number of ways. Beyond the ConTeXt implementation: The unicode bidi algorithm was not designed with advanced typesetting and typography in mind, works best for text-editing etc. per se. so local bidi *may perhaps* be more useful than global bidi for the critical-edition portion your project.
> 
> I'm not at all suggesting that this particular bug should not be a priority; printing paragraph lines in a linenumbering environment *must* be direction-agnostic. Just a matter of general strategy to consider.
> -- 
> Idris Samawi Hamid
> Professor of Philosophy
> Colorado State University
> Fort Collins, CO 80523<r2l-linenumbering-arabic.tex><r2l-linenumbering-arabic.pdf>___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-02 17:15           ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-02 20:46             ` talazem
@ 2015-08-03 13:54             ` talazem
  2015-08-03 14:56               ` Hans Hagen
  2015-08-03 15:19               ` Hans Hagen
  1 sibling, 2 replies; 25+ messages in thread
From: talazem @ 2015-08-03 13:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 7184 bytes --]

I am having problems with the directionality of numbers and mirrored characters (like parentheses). When using bidi, the numbers are inverted (5102 instead of 2015); with the explicit commands, the mirrored characters are inverted as well.

For reasons I think I understand, this is only happening in the text: the problem occurs with numbers in headings (chapters, etc.), and likewise in the main of the text. The digits of footnotes, linemargin numbers, and page numbers are correctly arranged.

I have learnt that if I add the option [numbercommand=\lefttoright] to \setuphead[section], I can get the digits in the section number to be in the right order. But this does not address the problem of other numbers in the text.

How do I solve this? I am happy to abandon the conveniences of bidi, as Idris suggests might be needed (see below), but it didn’t get any easier when trying to do it manually. See MWE below.

With thanks,
Talal

p.s. The Wiki page on "Arabic and Hebrew" is out of date, instructing the use of \setcharactermirroring[1] which is clearly deprecated now in favour of \setupdirections[bidi=global]. I am happy to update the wiki page once I get my head around things. Does anybody have an authoritative list of the various commands related to right-to-left, as well as what combinations are not needed (e.g. are \setupalign[r2l] and \righttoleft overlapping, or do they play different roles)?

========
%%% LANGUAGE AND FONTS
\mainlanguage[arabic]	
\definefontfamily [mainface] [rm] [ALM Fixed][range=arabic,features=arabic]	   
\setupbodyfont[mainface,12pt]

%\setupdirections[bidi=global]
\setupalign[r2l]
%\righttoleft

%% HEADINGS

\setuphead[chapter,section][
	conversion=myconversion,
%	numbercommand=\lefttoright % <-- toggle
	]
\setuplinenumbering[conversion=myconversion]
\setupnotations[footnote][numberconversion=myconversion]
\setupnotations[linenote][numberconversion=myconversion]
\setuppagenumber[numberconversion=myconversion]

\defineconversion
	[myconversion]
	[١,٢,٣,٤,٥,٦,٧,٨,٩,١٠,
	١١,١٢,١٣,١٤,١٥,١٦,١٧,١٨,١٩,٢٠,
	۲۱,۲۲,۲۳,۲٤,۲٥,۲٦,۲۷,۲۸,۲۹,۳۰,
	٣١,٣٢,٣٣,٣٤,٣٥,٣٦,٣٧,٣٨,٣٩,٤٠,
	٤١,٤٢,٤٣,٤٤,٤٥,٤٦,٤٧,٤٨,٤٩,٥٠,
	٥١,٥٢,٥٣,٥٤,٥٥,٥٦,٥٧,٥٨,٥٩,٦٠,
	٦١,٦٢,٦٣,٦٤,٦٥,٦٦,٦٧,٦٨,٦٩,٧٠,
	٧١,٧٢,٧٣,٧٤,٧٥,٧٦,٧٧,٧٨,٧٩,٨٠,
	٨١,٨٢,٨٣,٨٤,٨٥,٨٦,٨٧,٨٨,٨٩,٩٠,
	٩١,٩٢,٩٣,٩٤,٩٥,٩٦,٩٧,٩٨,٩٩,١٠٠,
	١٠١,١٠٢,١٠٣,١٠٤,١٠٥,١٠٦,١٠٧,١٠٨,١٠٩,١١٠,
	١١١,١١٢,١١٣,١١٤,١١٥,١١٦,١١٧,١١٨,١١٩,١٢٠,
	١٢١,١٢٢,١٢٣,١٢٤,١٢٥,١٢٦,١٢٧,١٢٨,١٢٩,١٣٠,
	١٣١,١٣٢,١٣٣,١٣٤,١٣٥,١٣٦,١٣٧,١٣٨,١٣٩,١١٣٠,
	١٤١,١٤٢,١٤٣,١٤٤,١٤٥,١٤٦,١٤٧,١٤٨,١٤٩,١٥٠,
	١٥١,١٥٢,١٥٣,١٥٤,١٥٥,١٥٦,١٥٧,١٥٨,١٥٩,١٦٠,
	١٦١,١٦٢,١٦٣,١٦٤,١٦٥,١٦٦,١٦٧,١٦٨,١٦٩,١٧٠,
	١٧١,١٧٢,١٧٣,١٧٤,١٧٥,١٧٦,١٧٧,١٧٨,١٧٩,١٨٠,
	١٨١,١٨٢,١٨٣,١٨٤,١٨٥,١٨٦,١٨٧,١٨٨,١٨٩,١٩٠,
	١٩١,١٩٢,١٩٣,١٩٤,١٩٥,١٩٦,١٩٧,١٩٨,١٩٩,٢٠٠,
	٢٠١,٢٠٢,٢٠٣,٢٠٤,٢٠٥,٢٠٦,٢٠٧,٢٠٨,٢٠٩,٢١٠,
	٢١١,٢١٢,٢١٣,٢١٤,٢١٥,٢١٦,٢١٧,٢١٨,٢١٩,٢٢٠,
	٢٢١,٢٢٢,٢٢٣,٢٢٤,٢٢٥,٢٢٦,٢٢٧,٢٢٨,٢٢٩,٢٣٠,
	٢٣١,٢٣٢,٢٣٣,٢٣٤,٢٣٥,٢٣٦,٢٣٧,٢٣٨,٢٣٩,٢٢٣٠,
	٢٤١,٢٤٢,٢٤٣,٢٤٤,٢٤٥,٢٤٦,٢٤٧,٢٤٨,٢٤٩,٢٥٠,
	٢٥١,٢٥٢,٢٥٣,٢٥٤,٢٥٥,٢٥٦,٢٥٧,٢٥٨,٢٥٩,٢٦٠,
	٢٦١,٢٦٢,٢٦٣,٢٦٤,٢٦٥,٢٦٦,٢٦٧,٢٦٨,٢٦٩,٢٧٠,
	٢٧١,٢٧٢,٢٧٣,٢٧٤,٢٧٥,٢٧٦,٢٧٧,٢٧٨,٢٧٩,٢٨٠,
	٢٨١,٢٨٢,٢٨٣,٢٨٤,٢٨٥,٢٨٦,٢٨٧,٢٨٨,٢٨٩,٢٩٠,
	٢٩١,٢٩٢,٢٩٣,٢٩٤,٢٩٥,٢٩٦,٢٩٧,٢٩٨,٢٩٩,٣٠٠,
]

%%% DOCUMENT

\starttext \showframe 

\section{section one}

\startlinenumbering
\input tufte
\input tufte
\stoplinenumbering

\dorecurse{20}{
\section{محمد الجمل (١٨٧٢—١٩٢٣)}
	مرحباً باعالم . ١٢٣٤٥٦٧٨٩٠ مرحباً بالعالم. ولد عام١٩٣٤.
\footnote{تعليقة لطيفة.}
\pagebreak
}

\stoptext
=============



> On 2 Aug 2015, at 18:15, Idris Samawi Hamid ادريس سماوي حامد <Idris.Hamid@colostate.edu> wrote:
> 
> Dear Talal,
> Salaam. See below:
> 
> On Sun, 02 Aug 2015 07:31:37 -0600, talazem@fastmail.fm <talazem@fastmail.fm> wrote:
> 
>> Thank you very much for this, Idris. It works nicely in the sample file you sent. But it goes off again once you add \setupdirections[bidi=global]. Consider the following:
>> 
>> ==========
> <snip>
> 
>> \setupdirections[bidi=global]
>> 
>> \setupthinrules[color=white]
>> \setupwhitespace[big]
>> 
>> \section{Incorrect}
>> \startlinenumbering
>> \startalignment[r2l]
>> هذه رسالة لطيفة ألفها العالم الكبير الفهامة النحرير.
>> هذه رسالة جامعة مانعة ألفها الشيخ الفاضل...
>> \thinrule
>> ===========
> 
> You're right. \thinrule has LR unicode characters which is probably why it gets thrown off. So if you turn off global bidi and then either 1) just go with either global RL or 2) invoke RL inside the linenumbering it will work:
> 
> % \setupdirections[bidi=global]
> \righttoleft %% global RL
> 
> or just
> 
> \startlinenumbering
> \righttoleft %% local RL, not needed if global RL invoked
> \startalignment[r2l]
> 
> Again, it's a barbarous (and temporary) workaround. See attached.
> 
> Wassalaam
> Idris
> 
> PS Unless there is a lot of Latin in the critical edition file, I would probably depend more on explicit dir commands (\righttolet, \lefttoright) and less on bidi, which is still buggy in a number of ways. Beyond the ConTeXt implementation: The unicode bidi algorithm was not designed with advanced typesetting and typography in mind, works best for text-editing etc. per se. so local bidi *may perhaps* be more useful than global bidi for the critical-edition portion your project.
> 
> I'm not at all suggesting that this particular bug should not be a priority; printing paragraph lines in a linenumbering environment *must* be direction-agnostic. Just a matter of general strategy to consider.
> -- 
> Idris Samawi Hamid
> Professor of Philosophy
> Colorado State University
> Fort Collins, CO 80523<r2l-linenumbering-arabic.tex><r2l-linenumbering-arabic.pdf>___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


[-- Attachment #1.2.1: Type: text/html, Size: 9455 bytes --]

[-- Attachment #1.2.2: num-ar.pdf --]
[-- Type: application/pdf, Size: 29884 bytes --]

[-- Attachment #1.2.3: Type: text/html, Size: 4462 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 13:54             ` talazem
@ 2015-08-03 14:56               ` Hans Hagen
  2015-08-03 15:13                 ` Hans Hagen
  2015-08-03 19:25                 ` Otared Kavian
  2015-08-03 15:19               ` Hans Hagen
  1 sibling, 2 replies; 25+ messages in thread
From: Hans Hagen @ 2015-08-03 14:56 UTC (permalink / raw)
  To: ntg-context


what would be the proper name for such a conversion? simplearabic? 
arabicdigits?

> [myconversion]
> [١,٢,٣,٤,٥,٦,٧,٨,٩,١٠,
> ١١,١٢,١٣,١٤,١٥,١٦,١٧,١٨,١٩,٢٠,
> ۲۱,۲۲,۲۳,۲٤,۲٥,۲٦,۲۷,۲۸,۲۹,۳۰,
 > another million entries

Hans



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 14:56               ` Hans Hagen
@ 2015-08-03 15:13                 ` Hans Hagen
  2015-08-03 15:42                   ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-03 19:25                 ` Otared Kavian
  1 sibling, 1 reply; 25+ messages in thread
From: Hans Hagen @ 2015-08-03 15:13 UTC (permalink / raw)
  To: ntg-context

On 8/3/2015 4:56 PM, Hans Hagen wrote:
>
> what would be the proper name for such a conversion? simplearabic?
> arabicdigits?
>
>> [myconversion]
>> [١,٢,٣,٤,٥,٦,٧,٨,٩,١٠,
>> ١١,١٢,١٣,١٤,١٥,١٦,١٧,١٨,١٩,٢٠,
>> ۲۱,۲۲,۲۳,۲٤,۲٥,۲٦,۲۷,۲۸,۲۹,۳۰,
>  > another million entries

the next beta will have:

\setuplinenumbering[conversion=arabicdecimals]



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 13:54             ` talazem
  2015-08-03 14:56               ` Hans Hagen
@ 2015-08-03 15:19               ` Hans Hagen
  2015-08-03 16:29                 ` talazem
  1 sibling, 1 reply; 25+ messages in thread
From: Hans Hagen @ 2015-08-03 15:19 UTC (permalink / raw)
  To: ntg-context

On 8/3/2015 3:54 PM, talazem@fastmail.fm wrote:
> I am having problems with the directionality of numbers and mirrored
> characters (like parentheses). When using bidi, the numbers are inverted
> (5102 instead of 2015); with the explicit commands, the mirrored
> characters are inverted as well.

we have several approaches:

the oldest method is based on some heuristics and targets at tex input 
in the sense that we assume tagging and directional switches

the other two are unicode bidi based (successive versions and there 
might be more as that evolves)

in any case, everything bidi / rl has to fit into some system and that's 
something idris and i are working on (well, we did at some point but we 
need to pick up that thread) ... so maybe you can trigger idris into 
onthology mode and help him

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 15:13                 ` Hans Hagen
@ 2015-08-03 15:42                   ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-03 15:56                     ` Hans Hagen
  2015-08-03 16:06                     ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 2 replies; 25+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-08-03 15:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Hans,

On Mon, 03 Aug 2015 09:13:34 -0600, Hans Hagen <pragma@wxs.nl> wrote:

> On 8/3/2015 4:56 PM, Hans Hagen wrote:
>>
>> what would be the proper name for such a conversion? simplearabic?
>> arabicdigits?
>>
>>> [myconversion]
>>> [١,٢,٣,٤,٥,٦,٧,٨,٩,١٠,
>>> ١١,١٢,١٣,١٤,١٥,١٦,١٧,١٨,١٩,٢٠,
>>> ۲۱,۲۲,۲۳,۲٤,۲٥,۲٦,۲۷,۲۸,۲۹,۳۰,
>>  > another million entries
>
> the next beta will have:
>
> \setuplinenumbering[conversion=arabicdecimals]

What's wrong with 'persiannumerals' and 'arabicnumerals' which we had  
before? They are not supposed to by synonymous for abjadnumerals... In any  
case we need

U+: [0030-0039] -> [0660-0669]: arabicdecimals
U+: [0030-0039] -> [06F0-06F9]: persiandecimals

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 15:42                   ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-08-03 15:56                     ` Hans Hagen
  2015-08-03 16:17                       ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-03 16:06                     ` Idris Samawi Hamid ادريس سماوي حامد
  1 sibling, 1 reply; 25+ messages in thread
From: Hans Hagen @ 2015-08-03 15:56 UTC (permalink / raw)
  To: ntg-context

On 8/3/2015 5:42 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
> Hi Hans,
>
> On Mon, 03 Aug 2015 09:13:34 -0600, Hans Hagen <pragma@wxs.nl> wrote:
>
>> On 8/3/2015 4:56 PM, Hans Hagen wrote:
>>>
>>> what would be the proper name for such a conversion? simplearabic?
>>> arabicdigits?
>>>
>>>> [myconversion]
>>>> [١,٢,٣,٤,٥,٦,٧,٨,٩,١٠,
>>>> ١١,١٢,١٣,١٤,١٥,١٦,١٧,١٨,١٩,٢٠,
>>>> ۲۱,۲۲,۲۳,۲٤,۲٥,۲٦,۲۷,۲۸,۲۹,۳۰,
>>>  > another million entries
>>
>> the next beta will have:
>>
>> \setuplinenumbering[conversion=arabicdecimals]
>
> What's wrong with 'persiannumerals' and 'arabicnumerals' which we had
> before? They are not supposed to by synonymous for abjadnumerals... In
> any case we need
>
> U+: [0030-0039] -> [0660-0669]: arabicdecimals
> U+: [0030-0039] -> [06F0-06F9]: persiandecimals

don't confuse decimals with alphabetic ones

a b c ... z aa ab ac ... az ....

vs

1 2 3 ... 10 11 12

so decimals is mapping chars 0-9 onto whatever else, in principle we can 
have 15 => ae and 21 => ba

Hans




-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 15:42                   ` Idris Samawi Hamid ادريس سماوي حامد
  2015-08-03 15:56                     ` Hans Hagen
@ 2015-08-03 16:06                     ` Idris Samawi Hamid ادريس سماوي حامد
  1 sibling, 0 replies; 25+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-08-03 16:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 03 Aug 2015 09:42:24 -0600, Idris Samawi Hamid ادريس سماوي حامد  
<Idris.Hamid@colostate.edu> wrote:

> U+: [0030-0039] -> [0660-0669]: arabicdecimals
> U+: [0030-0039] -> [06F0-06F9]: persiandecimals

U+: [0030-0039]: latindecimals

Just a reminder (and of course unicodedata.txt has this info):  
persiandecimals behave *exactly* as latindecimals, while arabicdecimals  
have a "weak" bidi property.

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 15:56                     ` Hans Hagen
@ 2015-08-03 16:17                       ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 0 replies; 25+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-08-03 16:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 03 Aug 2015 09:56:33 -0600, Hans Hagen <pragma@wxs.nl> wrote:

> On 8/3/2015 5:42 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
>> Hi Hans,
>>
>> On Mon, 03 Aug 2015 09:13:34 -0600, Hans Hagen <pragma@wxs.nl> wrote:
>>
>>> On 8/3/2015 4:56 PM, Hans Hagen wrote:
>>>>
>>>> what would be the proper name for such a conversion? simplearabic?
>>>> arabicdigits?
>>>>
>>>>> [myconversion]
>>>>> [١,٢,٣,٤,٥,٦,٧,٨,٩,١٠,
>>>>> ١١,١٢,١٣,١٤,١٥,١٦,١٧,١٨,١٩,٢٠,
>>>>> ۲۱,۲۲,۲۳,۲٤,۲٥,۲٦,۲۷,۲۸,۲۹,۳۰,
>>>>  > another million entries
>>>
>>> the next beta will have:
>>>
>>> \setuplinenumbering[conversion=arabicdecimals]
>>
>> What's wrong with 'persiannumerals' and 'arabicnumerals' which we had
>> before? They are not supposed to by synonymous for abjadnumerals... In
>> any case we need
>>
>> U+: [0030-0039] -> [0660-0669]: arabicdecimals
>> U+: [0030-0039] -> [06F0-06F9]: persiandecimals
>
> don't confuse decimals with alphabetic ones
>
> a b c ... z aa ab ac ... az ....
>
> vs
>
> 1 2 3 ... 10 11 12
>
> so decimals is mapping chars 0-9 onto whatever else, in principle we can  
> have 15 => ae and 21 => ba

Sure, but that's what abjadnumerals are for. Right now we have

abjadnumerals=persiannumerals=arabicnumerals

If that's intentional, then no problem, arabicdecimals and persiandecimals  
are fine nomenclature

Ah, it just hit me: You're making a literal analogy with romannumerals....

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 15:19               ` Hans Hagen
@ 2015-08-03 16:29                 ` talazem
  2015-08-03 16:52                   ` talazem
  0 siblings, 1 reply; 25+ messages in thread
From: talazem @ 2015-08-03 16:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

Just to note: all numbers in the body text are having their digits placed individually right-to-left. Notice, in the attached PDF, how the ١٤ is displayed as ٤١, and how ١٨٧٢ is ٢٧٨١ … but also the footnote marker is ٣١ instead of ١٣ as it correctly is below in the footnote itself.

Is there any temporary work around for this, until we sort out the underlying causes?

Talal


[-- Attachment #2: PastedGraphic-1.pdf --]
[-- Type: application/pdf, Size: 11871 bytes --]

[-- Attachment #3: Type: text/plain, Size: 1845 bytes --]


> On 3 Aug 2015, at 16:19, Hans Hagen <pragma@wxs.nl> wrote:
> 
> On 8/3/2015 3:54 PM, talazem@fastmail.fm wrote:
>> I am having problems with the directionality of numbers and mirrored
>> characters (like parentheses). When using bidi, the numbers are inverted
>> (5102 instead of 2015); with the explicit commands, the mirrored
>> characters are inverted as well.
> 
> we have several approaches:
> 
> the oldest method is based on some heuristics and targets at tex input in the sense that we assume tagging and directional switches
> 
> the other two are unicode bidi based (successive versions and there might be more as that evolves)
> 
> in any case, everything bidi / rl has to fit into some system and that's something idris and i are working on (well, we did at some point but we need to pick up that thread) ... so maybe you can trigger idris into onthology mode and help him
> 
> Hans
> 
> 
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 16:29                 ` talazem
@ 2015-08-03 16:52                   ` talazem
  2015-08-04  3:46                     ` talazem
  0 siblings, 1 reply; 25+ messages in thread
From: talazem @ 2015-08-03 16:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Well, I don’t know if ‘solves’ the underlying questions that Hans wrote about, but after some more fiddling, I now have all the numbers appearing as I expect them to.

It required specifying `method=two` as part of `\setupdirections[bidi=global,method=two]`. That, along with the 	`numbercommand=\righttoleft` in \setuphead[section], means that it now looks as I expect it to.

Unless someone identifies a problem with any of this, I think I’ll write up a summary on the Wiki. Without trolling through the mailing list for anything on RTL and then experimenting with the various combinations, it would be hard for one to divine how to get this to work.

For posterity’s sake, here is a full MWE example:

======
%%% LANGUAGE AND FONTS
\mainlanguage[arabic]	
\definefontfamily [mainface] [rm] [ALM Fixed][range=arabic,features=arabic]	   
\setupbodyfont[mainface,12pt]

\setupdirections[bidi=global,method=two]
\setupalign[r2l]
%\righttoleft

%% HEADINGS

\setuphead[section][
	conversion=myconversion,
	numbercommand=\righttoleft, % <-- toggle
	]
\setuplinenumbering[conversion=myconversion]
\setupnotations[footnote][numberconversion=myconversion]
\setupnotations[linenote][numberconversion=myconversion]
\setuppagenumber[numberconversion=myconversion]

\defineconversion
	[myconversion]
[١,٢,٣,٤,٥,٦,٧,٨,٩,١٠,
١١,١٢,١٣,١٤,١٥,١٦,١٧,١٨,١٩,٢٠,
۲۱,۲۲,۲۳,۲٤,۲٥,۲٦,۲۷,۲۸,۲۹,۳۰,
٣١,٣٢,٣٣,٣٤,٣٥,٣٦,٣٧,٣٨,٣٩,٤٠,
٤١,٤٢,٤٣,٤٤,٤٥,٤٦,٤٧,٤٨,٤٩,٥٠,
٥١,٥٢,٥٣,٥٤,٥٥,٥٦,٥٧,٥٨,٥٩,٦٠,
٦١,٦٢,٦٣,٦٤,٦٥,٦٦,٦٧,٦٨,٦٩,٧٠,
٧١,٧٢,٧٣,٧٤,٧٥,٧٦,٧٧,٧٨,٧٩,٨٠,
٨١,٨٢,٨٣,٨٤,٨٥,٨٦,٨٧,٨٨,٨٩,٩٠,
٩١,٩٢,٩٣,٩٤,٩٥,٩٦,٩٧,٩٨,٩٩,١٠٠,
١٠١,١٠٢,١٠٣,١٠٤,١٠٥,١٠٦,١٠٧,١٠٨,١٠٩,١١٠,
١١١,١١٢,١١٣,١١٤,١١٥,١١٦,١١٧,١١٨,١١٩,١٢٠,
١٢١,١٢٢,١٢٣,١٢٤,١٢٥,١٢٦,١٢٧,١٢٨,١٢٩,١٣٠,
١٣١,١٣٢,١٣٣,١٣٤,١٣٥,١٣٦,١٣٧,١٣٨,١٣٩,١١٣٠,
١٤١,١٤٢,١٤٣,١٤٤,١٤٥,١٤٦,١٤٧,١٤٨,١٤٩,١٥٠,
١٥١,١٥٢,١٥٣,١٥٤,١٥٥,١٥٦,١٥٧,١٥٨,١٥٩,١٦٠,
١٦١,١٦٢,١٦٣,١٦٤,١٦٥,١٦٦,١٦٧,١٦٨,١٦٩,١٧٠,
١٧١,١٧٢,١٧٣,١٧٤,١٧٥,١٧٦,١٧٧,١٧٨,١٧٩,١٨٠,
١٨١,١٨٢,١٨٣,١٨٤,١٨٥,١٨٦,١٨٧,١٨٨,١٨٩,١٩٠,
١٩١,١٩٢,١٩٣,١٩٤,١٩٥,١٩٦,١٩٧,١٩٨,١٩٩,٢٠٠,
٢٠١,٢٠٢,٢٠٣,٢٠٤,٢٠٥,٢٠٦,٢٠٧,٢٠٨,٢٠٩,٢١٠,
٢١١,٢١٢,٢١٣,٢١٤,٢١٥,٢١٦,٢١٧,٢١٨,٢١٩,٢٢٠,
٢٢١,٢٢٢,٢٢٣,٢٢٤,٢٢٥,٢٢٦,٢٢٧,٢٢٨,٢٢٩,٢٣٠,
٢٣١,٢٣٢,٢٣٣,٢٣٤,٢٣٥,٢٣٦,٢٣٧,٢٣٨,٢٣٩,٢٢٣٠,
٢٤١,٢٤٢,٢٤٣,٢٤٤,٢٤٥,٢٤٦,٢٤٧,٢٤٨,٢٤٩,٢٥٠,
٢٥١,٢٥٢,٢٥٣,٢٥٤,٢٥٥,٢٥٦,٢٥٧,٢٥٨,٢٥٩,٢٦٠,
٢٦١,٢٦٢,٢٦٣,٢٦٤,٢٦٥,٢٦٦,٢٦٧,٢٦٨,٢٦٩,٢٧٠,
٢٧١,٢٧٢,٢٧٣,٢٧٤,٢٧٥,٢٧٦,٢٧٧,٢٧٨,٢٧٩,٢٨٠,
٢٨١,٢٨٢,٢٨٣,٢٨٤,٢٨٥,٢٨٦,٢٨٧,٢٨٨,٢٨٩,٢٩٠,
٢٩١,٢٩٢,٢٩٣,٢٩٤,٢٩٥,٢٩٦,٢٩٧,٢٩٨,٢٩٩,٣٠٠,
]

%%% DOCUMENT

\starttext \showframe 

\section{section one}

\startlinenumbering
\input tufte
\input tufte
\stoplinenumbering

\dorecurse{20}{
\section{محمد الجمل (١٨٧٢—١٩٢٣)}
	مرحباً باعالم . ١٢٣٤٥٦٧٨٩٠ مرحباً بالعالم. ولد عام ١٩٣٤.
\footnote{تعليقة لطيفة.}
\pagebreak
}

\stoptext
======

Best wishes,
Talal

> On 3 Aug 2015, at 17:29, talazem@fastmail.fm wrote:
> 
> Just to note: all numbers in the body text are having their digits placed individually right-to-left. Notice, in the attached PDF, how the ١٤ is displayed as ٤١, and how ١٨٧٢ is ٢٧٨١ … but also the footnote marker is ٣١ instead of ١٣ as it correctly is below in the footnote itself.
> 
> Is there any temporary work around for this, until we sort out the underlying causes?
> 
> Talal
> 
> <PastedGraphic-1.pdf>
>> On 3 Aug 2015, at 16:19, Hans Hagen <pragma@wxs.nl> wrote:
>> 
>> On 8/3/2015 3:54 PM, talazem@fastmail.fm wrote:
>>> I am having problems with the directionality of numbers and mirrored
>>> characters (like parentheses). When using bidi, the numbers are inverted
>>> (5102 instead of 2015); with the explicit commands, the mirrored
>>> characters are inverted as well.
>> 
>> we have several approaches:
>> 
>> the oldest method is based on some heuristics and targets at tex input in the sense that we assume tagging and directional switches
>> 
>> the other two are unicode bidi based (successive versions and there might be more as that evolves)
>> 
>> in any case, everything bidi / rl has to fit into some system and that's something idris and i are working on (well, we did at some point but we need to pick up that thread) ... so maybe you can trigger idris into onthology mode and help him
>> 
>> Hans
>> 
>> 
>> -----------------------------------------------------------------
>>                                         Hans Hagen | PRAGMA ADE
>>             Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>   tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>>                                            | www.pragma-pod.nl
>> -----------------------------------------------------------------
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 14:56               ` Hans Hagen
  2015-08-03 15:13                 ` Hans Hagen
@ 2015-08-03 19:25                 ` Otared Kavian
  2015-08-03 23:30                   ` Hans Hagen
  1 sibling, 1 reply; 25+ messages in thread
From: Otared Kavian @ 2015-08-03 19:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Hans, Idris, Talal,

Some years ago we had a discussion on the issue, but I don’t remember where we ended up…
In my opinion, I think that the numberings should be maned as follows:

arabicnumerals: should be  ١,٢,٣,٤,٥,٦,٧,٨,٩,٠

persiannumerals: should be ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ ۰

abjadnumerals: should be الف، ب، ج، د، ه، و، ز،…..

As of today it seems that « persiannumerals » results in what should be named abjadnuemrals, and this is not correct.

Best regards: OK

> On 03 Aug 2015, at 16:56, Hans Hagen <pragma@wxs.nl> wrote:
> 
> 
> what would be the proper name for such a conversion? simplearabic? arabicdigits?
> 
>> [myconversion]
>> [١,٢,٣,٤,٥,٦,٧,٨,٩,١٠,
>> ١١,١٢,١٣,١٤,١٥,١٦,١٧,١٨,١٩,٢٠,
>> ۲۱,۲۲,۲۳,۲٤,۲٥,۲٦,۲۷,۲۸,۲۹,۳۰,
> > another million entries
> 
> Hans
> 
> 
> 
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 19:25                 ` Otared Kavian
@ 2015-08-03 23:30                   ` Hans Hagen
  2015-08-04 16:25                     ` Otared Kavian
  0 siblings, 1 reply; 25+ messages in thread
From: Hans Hagen @ 2015-08-03 23:30 UTC (permalink / raw)
  To: ntg-context

On 8/3/2015 9:25 PM, Otared Kavian wrote:
> Hi Hans, Idris, Talal,
>
> Some years ago we had a discussion on the issue, but I don’t remember where we ended up…
> In my opinion, I think that the numberings should be maned as follows:
>
> arabicnumerals: should be  ١,٢,٣,٤,٥,٦,٧,٨,٩,٠
>
> persiannumerals: should be ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ ۰
>
> abjadnumerals: should be الف، ب، ج، د، ه، و، ز،…..
>
> As of today it seems that « persiannumerals » results in what should be named abjadnuemrals, and this is not correct.

so you and idris and tatal has to come to some agreement on that

we have these alphabetic ones

arabicnumerals
persiannumerals
arabicexnumerals

and some special ones

abjadnumerals
abjadnodotnumerals

(these use small, medium, large chars and do special things with 10 100 
1000)

and now

arabicdecimals
persiandecimals

see core-con.lua

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 16:52                   ` talazem
@ 2015-08-04  3:46                     ` talazem
  2015-08-04 21:06                       ` Hans Hagen
  0 siblings, 1 reply; 25+ messages in thread
From: talazem @ 2015-08-04  3:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 3649 bytes --]

Hans, the beta is a solid step forward regarding bidi and Arabic support, and not just in footnotes. Thank you.

However, it appears that my earlier declarations of ‘problem solved’ were a bit premature.  Footnotes display everything correctly, but not linenumber notes. Using the three bidi methods of \setupdirections[bidi]:

- ‘default’ orders the linenumber notes and their texts right-to-left, but any number therein is reversed (4102 instead of 2014).

- ‘one’ does not render either the note block nor the individual notes' texts right-to-left.

- ‘two’ is identical to method ‘one’.

Compare these to regular footnotes, where everything is rendered correctly as of this new beta.

Below is a minimal example with resulting PDF output.

Talal

=========
%%% LANGUAGE FONTS BIDI
\mainlanguage[arabic]	
\definefontfamily [mainface] [rm] [ALM Fixed] [range=arabic,features=arabic]	   
\setupbodyfont[mainface,11pt]

\setupdirections[bidi=global,method=two,fences=no]
\setupalign[r2l]

%% HEADINGS
\setuppagenumber[numberconversion=arabicdecimals]

%%%	NOTES

\definenote[footnote][% Used for my comments in English.
	setups=note:footnote,
	align=righttoleft,
	rule={on,right},
	paragraph=yes,
	]

\setupnotations[footnote][%
	align=righttoleft,
	alternative=serried,
	width=broad,
	distance=.5em,
	display=no,
	numberconversion=arabicdecimals,
	headstyle=\lefttoright,
	]

\setuplinenumbering[%
	style=\tfxx,
	referencing=on,
	step=1,
	location=outer,
	method=page,
	align=left,
	distance=1em,
	width=0.4em,
	conversion=arabicdecimals,
	]

\definelinenote[linenotedefault][%
	setups=note:linenotedefault,
	align=righttoleft,
	rule={on,right},
	paragraph=yes,
	]
\setupnotations[linenotedefault][% 
	align=righttoleft,
	alternative=serried,
	width=broad,
	distance=.5em,
	display=no,
	numberconversion=arabicdecimals,
	headstyle=\lefttoright,
	]

\definelinenote[linenoteone][%
	setups=note:linenoteone,
	align=righttoleft,
	rule={on,right},
	paragraph=yes,
	]
\setupnotations[linenoteone][% 
	align=righttoleft,
	alternative=serried,
	width=broad,
	distance=.5em,
	display=no,
	numberconversion=arabicdecimals,
	headstyle=\lefttoright,
	]

\definelinenote[linenotetwo][%
	setups=note:linenotetwo,
	align=righttoleft,
	rule={on,right},
	paragraph=yes,
	]
\setupnotations[linenotetwo][% 
	align=righttoleft,
	alternative=serried,
	width=broad,
	distance=.5em,
	display=no,
	numberconversion=arabicdecimals,
	headstyle=\lefttoright,
	]

\startsetups[note:footnote] 
	\setupdirections[bidi=on,method=two,fences=no] 
\stopsetups

\startsetups[note:linenotedefault]
	\setupdirections[bidi=on,method=default]
\stopsetups

\startsetups[note:linenoteone]
	\setupdirections[bidi=on,method=one]
\stopsetups

\startsetups[note:linenotetwo]
	\setupdirections[bidi=on,method=two] 
\stopsetups

%%% DOCUMENT

\starttext \showframe 

\startlinenumbering
\input ward\footnote{هذه تعليقة أولى كتبت عام ٢٠١٤.}
\input ward\footnote{هذه تعليقة ثانية (٢٠١٤).}
\input ward\linenotedefault{هذه تعليقة أولى كتبت عام ٢٠١٤.}
\input ward\linenotedefault{هذه تعليقة ثانية (٢٠١٤).}
\input ward\linenoteone{هذه تعليقة أولى كتبت عام ٢٠١٤.}
\input ward\linenoteone{هذه تعليقة ثانية (٢٠١٤).}
\input ward\linenotetwo{هذه تعليقة أولى كتبت عام ٢٠١٤.}
\input ward\linenotetwo{هذه تعليقة ثانية (٢٠١٤).}
\stoplinenumbering
\stoptext

\stoptext
=========


[-- Attachment #2: num-ar.pdf --]
[-- Type: application/pdf, Size: 13479 bytes --]

[-- Attachment #3: Type: text/plain, Size: 7376 bytes --]



> On 3 Aug 2015, at 17:52, talazem@fastmail.fm wrote:
> 
> Well, I don’t know if ‘solves’ the underlying questions that Hans wrote about, but after some more fiddling, I now have all the numbers appearing as I expect them to.
> 
> It required specifying `method=two` as part of `\setupdirections[bidi=global,method=two]`. That, along with the 	`numbercommand=\righttoleft` in \setuphead[section], means that it now looks as I expect it to.
> 
> Unless someone identifies a problem with any of this, I think I’ll write up a summary on the Wiki. Without trolling through the mailing list for anything on RTL and then experimenting with the various combinations, it would be hard for one to divine how to get this to work.
> 
> For posterity’s sake, here is a full MWE example:
> 
> ======
> %%% LANGUAGE AND FONTS
> \mainlanguage[arabic]	
> \definefontfamily [mainface] [rm] [ALM Fixed][range=arabic,features=arabic]	   
> \setupbodyfont[mainface,12pt]
> 
> \setupdirections[bidi=global,method=two]
> \setupalign[r2l]
> %\righttoleft
> 
> %% HEADINGS
> 
> \setuphead[section][
> 	conversion=myconversion,
> 	numbercommand=\righttoleft, % <-- toggle
> 	]
> \setuplinenumbering[conversion=myconversion]
> \setupnotations[footnote][numberconversion=myconversion]
> \setupnotations[linenote][numberconversion=myconversion]
> \setuppagenumber[numberconversion=myconversion]
> 
> \defineconversion
> 	[myconversion]
> [١,٢,٣,٤,٥,٦,٧,٨,٩,١٠,
> ١١,١٢,١٣,١٤,١٥,١٦,١٧,١٨,١٩,٢٠,
> ۲۱,۲۲,۲۳,۲٤,۲٥,۲٦,۲۷,۲۸,۲۹,۳۰,
> ٣١,٣٢,٣٣,٣٤,٣٥,٣٦,٣٧,٣٨,٣٩,٤٠,
> ٤١,٤٢,٤٣,٤٤,٤٥,٤٦,٤٧,٤٨,٤٩,٥٠,
> ٥١,٥٢,٥٣,٥٤,٥٥,٥٦,٥٧,٥٨,٥٩,٦٠,
> ٦١,٦٢,٦٣,٦٤,٦٥,٦٦,٦٧,٦٨,٦٩,٧٠,
> ٧١,٧٢,٧٣,٧٤,٧٥,٧٦,٧٧,٧٨,٧٩,٨٠,
> ٨١,٨٢,٨٣,٨٤,٨٥,٨٦,٨٧,٨٨,٨٩,٩٠,
> ٩١,٩٢,٩٣,٩٤,٩٥,٩٦,٩٧,٩٨,٩٩,١٠٠,
> ١٠١,١٠٢,١٠٣,١٠٤,١٠٥,١٠٦,١٠٧,١٠٨,١٠٩,١١٠,
> ١١١,١١٢,١١٣,١١٤,١١٥,١١٦,١١٧,١١٨,١١٩,١٢٠,
> ١٢١,١٢٢,١٢٣,١٢٤,١٢٥,١٢٦,١٢٧,١٢٨,١٢٩,١٣٠,
> ١٣١,١٣٢,١٣٣,١٣٤,١٣٥,١٣٦,١٣٧,١٣٨,١٣٩,١١٣٠,
> ١٤١,١٤٢,١٤٣,١٤٤,١٤٥,١٤٦,١٤٧,١٤٨,١٤٩,١٥٠,
> ١٥١,١٥٢,١٥٣,١٥٤,١٥٥,١٥٦,١٥٧,١٥٨,١٥٩,١٦٠,
> ١٦١,١٦٢,١٦٣,١٦٤,١٦٥,١٦٦,١٦٧,١٦٨,١٦٩,١٧٠,
> ١٧١,١٧٢,١٧٣,١٧٤,١٧٥,١٧٦,١٧٧,١٧٨,١٧٩,١٨٠,
> ١٨١,١٨٢,١٨٣,١٨٤,١٨٥,١٨٦,١٨٧,١٨٨,١٨٩,١٩٠,
> ١٩١,١٩٢,١٩٣,١٩٤,١٩٥,١٩٦,١٩٧,١٩٨,١٩٩,٢٠٠,
> ٢٠١,٢٠٢,٢٠٣,٢٠٤,٢٠٥,٢٠٦,٢٠٧,٢٠٨,٢٠٩,٢١٠,
> ٢١١,٢١٢,٢١٣,٢١٤,٢١٥,٢١٦,٢١٧,٢١٨,٢١٩,٢٢٠,
> ٢٢١,٢٢٢,٢٢٣,٢٢٤,٢٢٥,٢٢٦,٢٢٧,٢٢٨,٢٢٩,٢٣٠,
> ٢٣١,٢٣٢,٢٣٣,٢٣٤,٢٣٥,٢٣٦,٢٣٧,٢٣٨,٢٣٩,٢٢٣٠,
> ٢٤١,٢٤٢,٢٤٣,٢٤٤,٢٤٥,٢٤٦,٢٤٧,٢٤٨,٢٤٩,٢٥٠,
> ٢٥١,٢٥٢,٢٥٣,٢٥٤,٢٥٥,٢٥٦,٢٥٧,٢٥٨,٢٥٩,٢٦٠,
> ٢٦١,٢٦٢,٢٦٣,٢٦٤,٢٦٥,٢٦٦,٢٦٧,٢٦٨,٢٦٩,٢٧٠,
> ٢٧١,٢٧٢,٢٧٣,٢٧٤,٢٧٥,٢٧٦,٢٧٧,٢٧٨,٢٧٩,٢٨٠,
> ٢٨١,٢٨٢,٢٨٣,٢٨٤,٢٨٥,٢٨٦,٢٨٧,٢٨٨,٢٨٩,٢٩٠,
> ٢٩١,٢٩٢,٢٩٣,٢٩٤,٢٩٥,٢٩٦,٢٩٧,٢٩٨,٢٩٩,٣٠٠,
> ]
> 
> %%% DOCUMENT
> 
> \starttext \showframe 
> 
> \section{section one}
> 
> \startlinenumbering
> \input tufte
> \input tufte
> \stoplinenumbering
> 
> \dorecurse{20}{
> \section{محمد الجمل (١٨٧٢—١٩٢٣)}
> 	مرحباً باعالم . ١٢٣٤٥٦٧٨٩٠ مرحباً بالعالم. ولد عام ١٩٣٤.
> \footnote{تعليقة لطيفة.}
> \pagebreak
> }
> 
> \stoptext
> ======
> 
> Best wishes,
> Talal
> 
>> On 3 Aug 2015, at 17:29, talazem@fastmail.fm wrote:
>> 
>> Just to note: all numbers in the body text are having their digits placed individually right-to-left. Notice, in the attached PDF, how the ١٤ is displayed as ٤١, and how ١٨٧٢ is ٢٧٨١ … but also the footnote marker is ٣١ instead of ١٣ as it correctly is below in the footnote itself.
>> 
>> Is there any temporary work around for this, until we sort out the underlying causes?
>> 
>> Talal
>> 
>> <PastedGraphic-1.pdf>
>>> On 3 Aug 2015, at 16:19, Hans Hagen <pragma@wxs.nl> wrote:
>>> 
>>> On 8/3/2015 3:54 PM, talazem@fastmail.fm wrote:
>>>> I am having problems with the directionality of numbers and mirrored
>>>> characters (like parentheses). When using bidi, the numbers are inverted
>>>> (5102 instead of 2015); with the explicit commands, the mirrored
>>>> characters are inverted as well.
>>> 
>>> we have several approaches:
>>> 
>>> the oldest method is based on some heuristics and targets at tex input in the sense that we assume tagging and directional switches
>>> 
>>> the other two are unicode bidi based (successive versions and there might be more as that evolves)
>>> 
>>> in any case, everything bidi / rl has to fit into some system and that's something idris and i are working on (well, we did at some point but we need to pick up that thread) ... so maybe you can trigger idris into onthology mode and help him
>>> 
>>> Hans
>>> 
>>> 
>>> -----------------------------------------------------------------
>>>                                        Hans Hagen | PRAGMA ADE
>>>            Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>>  tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>>>                                           | www.pragma-pod.nl
>>> -----------------------------------------------------------------
>>> ___________________________________________________________________________________
>>> 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
>>> ___________________________________________________________________________________
>> 
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-03 23:30                   ` Hans Hagen
@ 2015-08-04 16:25                     ` Otared Kavian
  0 siblings, 0 replies; 25+ messages in thread
From: Otared Kavian @ 2015-08-04 16:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Hans,

Thanks for the new beta.

As Idris pointed out, the logic you follow for naming greeknumerals, romannumerals, persiannumerals, arabicnumerals, and all others in core-con.lua, makes sense but I didn’t notice this logic before…  Which means one may learn each and evry day :-)

As far as I know, at least in the Persian use of the abjad system of counting, the first case corresponding to the number 1, is usually written 
	الف
in order to avoid the confusion with the digit 
	۱

I don’t know if this can be fixed in the table you have in core-con.lua.

A further remark is that, don’t you think that the pagenumbering, as well as the numbers for chapters, sections, items, equations, etc, should be switched by default to arabicdecimals, or persiandecimals, as soon as \mainlanguage has been set to arabic or persian?
Or maybe one could have a command like
	\setupdefaultnumberings[arabicdecimals]
which sets a default for conversion of numbers for all the counters.

Again many thanks for the features you included in ConTeXt for bidi writing.

Best regards: OK

> On 04 Aug 2015, at 01:30, Hans Hagen <pragma@wxs.nl> wrote:
> 
> On 8/3/2015 9:25 PM, Otared Kavian wrote:
>> Hi Hans, Idris, Talal,
>> 
>> Some years ago we had a discussion on the issue, but I don’t remember where we ended up…
>> In my opinion, I think that the numberings should be maned as follows:
>> 
>> arabicnumerals: should be  ١,٢,٣,٤,٥,٦,٧,٨,٩,٠
>> 
>> persiannumerals: should be ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹ ۰
>> 
>> abjadnumerals: should be الف، ب، ج، د، ه، و، ز،…..
>> 
>> As of today it seems that « persiannumerals » results in what should be named abjadnuemrals, and this is not correct.
> 
> so you and idris and tatal has to come to some agreement on that
> 
> we have these alphabetic ones
> 
> arabicnumerals
> persiannumerals
> arabicexnumerals
> 
> and some special ones
> 
> abjadnumerals
> abjadnodotnumerals
> 
> (these use small, medium, large chars and do special things with 10 100 1000)
> 
> and now
> 
> arabicdecimals
> persiandecimals
> 
> see core-con.lua
> 
> Hans
> 
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: r2l alignment and linenumbering conflict?
  2015-08-04  3:46                     ` talazem
@ 2015-08-04 21:06                       ` Hans Hagen
  0 siblings, 0 replies; 25+ messages in thread
From: Hans Hagen @ 2015-08-04 21:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 8/4/2015 5:46 AM, talazem@fastmail.fm wrote:
> Hans, the beta is a solid step forward regarding bidi and Arabic support, and not just in footnotes. Thank you.
>
> However, it appears that my earlier declarations of ‘problem solved’ were a bit premature.  Footnotes display everything correctly, but not linenumber notes. Using the three bidi methods of \setupdirections[bidi]:
>
> - ‘default’ orders the linenumber notes and their texts right-to-left, but any number therein is reversed (4102 instead of 2014).

let's first try to get that one right .. new beta coming (also needs 
testing by idris

> - ‘one’ does not render either the note block nor the individual notes' texts right-to-left.

i have to rewrite that one using more efficient means (i really need 48 
hour sin a day)

> - ‘two’ is identical to method ‘one’.

it is .. just a newer version of the unicode bidi one

> Compare these to regular footnotes, where everything is rendered correctly as of this new beta.

you can trace flagging in default with:

\enabletrackers[typesetters.directions.default]

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2015-08-04 21:06 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-30 15:30 r2l alignment and linenumbering conflict? talazem
2015-08-01 15:37 ` talazem
2015-08-01 18:04   ` Pablo Rodriguez
2015-08-01 18:35   ` Idris Samawi Hamid ادريس سماوي حامد
2015-08-01 18:47   ` Wolfgang Schuster
2015-08-02  9:24     ` talazem
2015-08-02 11:51       ` Idris Samawi Hamid ادريس سماوي حامد
2015-08-02 13:31         ` talazem
2015-08-02 17:15           ` Idris Samawi Hamid ادريس سماوي حامد
2015-08-02 20:46             ` talazem
2015-08-03 13:54             ` talazem
2015-08-03 14:56               ` Hans Hagen
2015-08-03 15:13                 ` Hans Hagen
2015-08-03 15:42                   ` Idris Samawi Hamid ادريس سماوي حامد
2015-08-03 15:56                     ` Hans Hagen
2015-08-03 16:17                       ` Idris Samawi Hamid ادريس سماوي حامد
2015-08-03 16:06                     ` Idris Samawi Hamid ادريس سماوي حامد
2015-08-03 19:25                 ` Otared Kavian
2015-08-03 23:30                   ` Hans Hagen
2015-08-04 16:25                     ` Otared Kavian
2015-08-03 15:19               ` Hans Hagen
2015-08-03 16:29                 ` talazem
2015-08-03 16:52                   ` talazem
2015-08-04  3:46                     ` talazem
2015-08-04 21:06                       ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).