Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-04 Thread Otared Kavian
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 pra...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-04 Thread Hans Hagen

On 8/4/2015 5:46 AM, tala...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread Idris Samawi Hamid ادريس سماوي حامد

Hi Hans,

On Mon, 03 Aug 2015 09:13:34 -0600, Hans Hagen pra...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread Hans Hagen

On 8/3/2015 5:42 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:

Hi Hans,

On Mon, 03 Aug 2015 09:13:34 -0600, Hans Hagen pra...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread Idris Samawi Hamid ادريس سماوي حامد
On Mon, 03 Aug 2015 09:42:24 -0600, Idris Samawi Hamid ادريس سماوي حامد  
idris.ha...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread Idris Samawi Hamid ادريس سماوي حامد

On Mon, 03 Aug 2015 09:56:33 -0600, Hans Hagen pra...@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 pra...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread tala...@fastmail.fm
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
Description: Adobe PDF document

 On 3 Aug 2015, at 16:19, Hans Hagen pra...@wxs.nl wrote:
 
 On 8/3/2015 3:54 PM, tala...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread Hans Hagen

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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread tala...@fastmail.fm
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
=



num-ar.pdf
Description: Adobe PDF document


 On 3 Aug 2015, at 17:52, tala...@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, % -- 

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread Hans Hagen


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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread Hans Hagen

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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread Hans Hagen

On 8/3/2015 3:54 PM, tala...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread tala...@fastmail.fm
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, tala...@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 pra...@wxs.nl wrote:
 
 On 8/3/2015 3:54 PM, tala...@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
 

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread Otared Kavian
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 pra...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-03 Thread tala...@fastmail.fm
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,Talalp.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=

num-ar.pdf
Description: Adobe PDF document
On 2 Aug 2015, at 18:15, Idris Samawi Hamid ادريس سماوي حامد idris.ha...@colostate.edu wrote:Dear Talal,Salaam. See below:On Sun, 02 Aug 2015 07:31:37 -0600, tala...@fastmail.fm tala...@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 RLor just\startlinenumbering\righttoleft %% local RL, not needed if global RL invoked\startalignment[r2l]Again, it's a barbarous (and temporary) workaround. See attached.WassalaamIdrisPS 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 

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-02 Thread tala...@fastmail.fm
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.wolfg...@gmail.com 
 wrote:
 
 tala...@fastmail.fm mailto:tala...@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
 ___

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

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-02 Thread tala...@fastmail.fm
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.ha...@colostate.edu wrote:
 
 On Sun, 02 Aug 2015 03:24:12 -0600, tala...@fastmail.fm tala...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-02 Thread Idris Samawi Hamid ادريس سماوي حامد
On Sun, 02 Aug 2015 03:24:12 -0600, tala...@fastmail.fm  
tala...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-02 Thread Idris Samawi Hamid ادريس سماوي حامد

Dear Talal,
Salaam. See below:

On Sun, 02 Aug 2015 07:31:37 -0600, tala...@fastmail.fm  
tala...@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
Description: TeX document


r2l-linenumbering-arabic.pdf
Description: Adobe PDF document
___
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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-02 Thread tala...@fastmail.fm
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.ha...@colostate.edu wrote:
 
 Dear Talal,
 Salaam. See below:
 
 On Sun, 02 Aug 2015 07:31:37 -0600, tala...@fastmail.fm tala...@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 
 80523r2l-linenumbering-arabic.texr2l-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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-01 Thread Idris Samawi Hamid ادريس سماوي حامد

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, tala...@fastmail.fm  
tala...@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, tala...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-01 Thread Pablo Rodriguez
On 08/01/2015 05:37 PM, tala...@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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-01 Thread tala...@fastmail.fm
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 ofthe problem attached.

linertl.pdf
Description: Adobe PDF document


linertl.tex
Description: application/applefile
On 30 Jul 2015, at 16:30, tala...@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\stoptextThe RTL alignment works correctly on its own. However, whenyou 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?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-contextwebpage : http://www.pragma-ade.nl / http://tex.aanhet.netarchive : 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
___

Re: [NTG-context] r2l alignment and linenumbering conflict?

2015-08-01 Thread Wolfgang Schuster

tala...@fastmail.fm mailto:tala...@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
___