Re: [NTG-context] Paragraph breaking bug with BiDi text

2016-01-08 Thread Mohammad Hossein Bateni
Minor point: changing "\pardir TLT" to "\pardir TLT\textdir TLT" in the
last paragraph produces better visual, however, the previous paragraphs
already demonstrate the problem sufficiently.

On Fri, Jan 8, 2016 at 10:40 PM, Mohammad Hossein Bateni 
wrote:

> Hello,
>
> When a line ends with a sequence whose direction differs from that of the
> paragraph, we risk pushing some text into the margin (when not necessary).
> Here is an example with corresponding output:
>
>
> \usemodule[simplefonts]
> \setmainfont[ALM Fixed][features=arabic,range=arabic]
> \setupalign[r2l]
> \setupwhitespace[big]
> \showframe
>
> \starttext
>
> % 10 copies of Persian word "hello" stay on one line.
> \dorecurse{10}{سلام }
> % 20 copies makes a 2-line paragraph.
> \dorecurse{20}{سلام }
>
> % one copy of the word goes into the margin although the Latin letters
> perfectly fit the line.
> \dorecurse{10}{سلام }
> {\textdir TLT\dorecurse{20}{a}}
> \dorecurse{10}{سلام }
>
> % although the Latin string extends into the margin, TeX still puts one
> copy of "hello" there as well.
> \dorecurse{10}{سلام }
> {\textdir TLT\dorecurse{30}{a}}
> \dorecurse{10}{سلام }
>
> % something similar happens here with the opposite par/text dir
> \pardir TLT
> \dorecurse{10}{bidi }
> {\textdir TRT\dorecurse{20}{آ}}
> \dorecurse{10}{bidi }
>
> \stoptext
>
>
> The problem seems to be that after typesetting the LTR text within the RTL
> paragraph, TeX thinks the current text ends at the left end of the LTR
> portion; hence, it tries to add something to the line; it's only after that
> that it discovers we ran into the margin!
>
> —MHB
>
>
___
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
___

[NTG-context] Paragraph breaking bug with BiDi text

2016-01-08 Thread Mohammad Hossein Bateni
Hello,

When a line ends with a sequence whose direction differs from that of the
paragraph, we risk pushing some text into the margin (when not necessary).
Here is an example with corresponding output:


\usemodule[simplefonts]
\setmainfont[ALM Fixed][features=arabic,range=arabic]
\setupalign[r2l]
\setupwhitespace[big]
\showframe

\starttext

% 10 copies of Persian word "hello" stay on one line.
\dorecurse{10}{سلام }
% 20 copies makes a 2-line paragraph.
\dorecurse{20}{سلام }

% one copy of the word goes into the margin although the Latin letters
perfectly fit the line.
\dorecurse{10}{سلام }
{\textdir TLT\dorecurse{20}{a}}
\dorecurse{10}{سلام }

% although the Latin string extends into the margin, TeX still puts one
copy of "hello" there as well.
\dorecurse{10}{سلام }
{\textdir TLT\dorecurse{30}{a}}
\dorecurse{10}{سلام }

% something similar happens here with the opposite par/text dir
\pardir TLT
\dorecurse{10}{bidi }
{\textdir TRT\dorecurse{20}{آ}}
\dorecurse{10}{bidi }

\stoptext


The problem seems to be that after typesetting the LTR text within the RTL
paragraph, TeX thinks the current text ends at the left end of the LTR
portion; hence, it tries to add something to the line; it's only after that
that it discovers we ran into the margin!

—MHB


bidi-par-bug.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] RTL problem with figure numbers

2016-01-08 Thread Mohammad Hossein Bateni
Do you think the solution here is adding a numbercommand key to floats as
well which can be set to \righttoleft?  Or is the need to do the same for
chapter, section, etc. also a bug which should be fixed?

—MHB

On Sun, Jan 3, 2016 at 11:56 PM, Mohammad Hossein Bateni 
wrote:

> No difference with latest beta from context-garden:
> CONTEXT current version: 2015.12.31 16:49
> LuaTeX, Version beta-0.87.0 (TeX Live 2016/dev)
>
> The 10th page of the PDF output is attached.
>
> On Sun, Jan 3, 2016 at 5:27 PM, Hans Hagen  wrote:
>
>> On 1/3/2016 8:46 PM, Mohammad Hossein Bateni wrote:
>>
>> I use TeXLive 2015 on Mac OS X,
>>>   CONTEXT 2015.05.18 12:26, and
>>>   LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238).
>>>
>>
>> use the version from contextgarden as things might have evolved
>>
>> 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] Footnote rules for bidi document

2016-01-08 Thread Mohammad Hossein Bateni
I updated the documentation on context garden.  Hans, I hadn't noticed that
you updated the macros on the same day as your last message!

I had another question regarding the definition of notes/footnotes.  It is
not that important but I am curious: is it possible to define two notes
that are essentially the same except for some of their stylistic
definitions?  Let me give an example.

some text \Afootnote{A}
more text \Bfootnote{B}
some more text \Afootnote{C}

And I want the result at the bottom of the page to read:

1 A
2 B
3 C

However, I'd like to have the power to control how the numbers are typeset
in the text and at the bottom, as well as determine the fonts, etc. of
\Afootnote and \Bfootnote separately.

On Mon, Jan 4, 2016 at 11:21 AM, Mohammad Hossein Bateni 
wrote:

> That said, I'm not asking for this to be the default. I only want to
>>> know how it can be achieved. The code will be put in my style file or
>>> module.
>>>
>>
>> i'll add rule=paragraph (i.e. listen to the first following paragraph if
>> possible) ... you need to document it as for sure i forget about it
>>
>
> Awesome!  Thanks, Hans!  Once this becomes available and I test it, I'll
> update the documentation for Footnotes on Context Garden.
>
>
>> Is it possible to determine the direction of the first line of footnote
>>> block while typesetting the footnote rule? I imagine it should not be
>>> difficult in Lua. Note that this may be the leftover from a long
>>> footnote that started on some previous page.
>>>
>>
> —MHB
>
___
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
___