ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Bidi-related register problem
@ 2019-01-25  1:36 Rik Kabel
  2019-01-26 23:59 ` Rik Kabel
  0 siblings, 1 reply; 6+ messages in thread
From: Rik Kabel @ 2019-01-25  1:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Recent betas have introduced a bidi-related problem with register 
processing.

In the following example, compilation generates a recoverable error when 
register processing has to trim an entry to fit maxwidth. The error is:

luatex warning  > node filter: error: ...eXt/tex/texmf-context/tex/context/base/mkiv/typo-dub.lua:496: attempt to index local 'stacktop' (a nil value)

Removing the maxwidth constraint, or setting it to a much wider value, 
allows error-free compilation.

Without \setupdirections[bidi=on,method=two] there is no problem, but 
without it RTL texts are not handled properly. This is a recent change; 
bidi=global worked a few months ago. (I have not tried with LTR text in 
a default-RTL document).

    % macros=mkvi
    \defineregister[Mindex]
    \setupregister [Mindex]
                    [n=2,
                     maxwidth=4cm,
                     balance=no]

    \starttexdefinition unexpanded MIndex
       \dosinglegroupempty\doMIndex
    \stoptexdefinition

    \starttexdefinition unexpanded doMIndex #MARKER
       \def\Marker{#MARKER}%
       \dosinglegroupempty\doMIndexFull
    \stoptexdefinition

    \starttexdefinition doMIndexFull #ITEM
       \doifelse{#ITEM}{}
         {\expanded{\Mindex{\Marker}}}
         {\expanded{\Mindex{\Marker+#ITEM}}}
    \stoptexdefinition

    \setupdirections [bidi=on,method=two]

    \setupbodyfont   [libertinus,11pt]

    \starttext

    \startparagraph
       \MIndex{One}{Mairzy doats and dozy doats and liddle lamzy divey}

       \input jojomayer

    \stopparagraph

    \startparagraph
    סלאם שלום
    \stopparagraph

    \placeregister[Mindex]
    \stoptext

-- 
Rik Kabel



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

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Bidi-related register problem
  2019-01-25  1:36 Bidi-related register problem Rik Kabel
@ 2019-01-26 23:59 ` Rik Kabel
  2019-01-27  3:40   ` Rik Kabel
  2019-01-27 17:07   ` Hans Hagen
  0 siblings, 2 replies; 6+ messages in thread
From: Rik Kabel @ 2019-01-26 23:59 UTC (permalink / raw)
  To: ntg-context

Here is a much-closer-to minimal example.


  \setupregister   [index] [maxwidth=4cm]
  \setupdirections [bidi=on,method=two]
  \starttext
  .\index{Mairzy doats and dozy doats and liddle lamzy divey}
  \placeindex
  \stoptext

With the \setupdirections line removed, all is well. However, that line 
is otherwise required. Setting bidi off around \placeindex is not an 
option either, since some index entries require it.


-- 
Rik Kabel

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Bidi-related register problem
  2019-01-26 23:59 ` Rik Kabel
@ 2019-01-27  3:40   ` Rik Kabel
  2019-01-27 17:07   ` Hans Hagen
  1 sibling, 0 replies; 6+ messages in thread
From: Rik Kabel @ 2019-01-27  3:40 UTC (permalink / raw)
  To: ntg-context

And shorter still, isolating the problem to something in \limitatetext:

  \setupdirections [bidi=on,method=two]
  \starttext
  \limitatetext {Mairzy doats and dozy doats and liddle lamzy divey} {4cm}
  \stoptext

-- 
Rik

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Bidi-related register problem
  2019-01-26 23:59 ` Rik Kabel
  2019-01-27  3:40   ` Rik Kabel
@ 2019-01-27 17:07   ` Hans Hagen
  2019-01-27 18:15     ` Rik Kabel
  1 sibling, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2019-01-27 17:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Rik Kabel

On 1/27/2019 12:59 AM, Rik Kabel wrote:
> Here is a much-closer-to minimal example.
> 
> 
>   \setupregister   [index] [maxwidth=4cm]
>   \setupdirections [bidi=on,method=two]
>   \starttext
>   .\index{Mairzy doats and dozy doats and liddle lamzy divey}
>   \placeindex
>   \stoptext
> 
> With the \setupdirections line removed, all is well. However, that line 
> is otherwise required. Setting bidi off around \placeindex is not an 
> option either, since some index entries require it.
Tricky ... i'll catch it but better use method tree then (later this 
year i might redo some r2l code)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Bidi-related register problem
  2019-01-27 17:07   ` Hans Hagen
@ 2019-01-27 18:15     ` Rik Kabel
  2019-01-28  1:05       ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Rik Kabel @ 2019-01-27 18:15 UTC (permalink / raw)
  To: Hans Hagen, mailing list for ConTeXt users


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

On 1/27/2019 12:07, Hans Hagen wrote:
> On 1/27/2019 12:59 AM, Rik Kabel wrote:
>> Here is a much-closer-to minimal example.
>>
>>
>>   \setupregister   [index] [maxwidth=4cm]
>>   \setupdirections [bidi=on,method=two]
>>   \starttext
>>   .\index{Mairzy doats and dozy doats and liddle lamzy divey}
>>   \placeindex
>>   \stoptext
>>
>> With the \setupdirections line removed, all is well. However, that 
>> line is otherwise required. Setting bidi off around \placeindex is 
>> not an option either, since some index entries require it.
> Tricky ... i'll catch it but better use method tree then (later this 
> year i might redo some r2l code)
>
> Hans
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------

That allows the compilation to complete, but method=three breaks other 
stuff. Try this:

    \starttext
    \setupdirections [bidi=on,method=three]
    \rightaligned{(( How is this?}
    \stoptext

(I also see problems with boxes set in the margin where before they were 
set centered in the textblock, but cannot construct an example yet.)

-- 
Rik


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

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Bidi-related register problem
  2019-01-27 18:15     ` Rik Kabel
@ 2019-01-28  1:05       ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2019-01-28  1:05 UTC (permalink / raw)
  To: Rik Kabel, mailing list for ConTeXt users

On 1/27/2019 7:15 PM, Rik Kabel wrote:

> That allows the compilation to complete, but method=three breaks other 
> stuff. Try this:
> 
>     \starttext
>     \setupdirections [bidi=on,method=three]
>     \rightaligned{(( How is this?}
>     \stoptext
> 
> (I also see problems with boxes set in the margin where before they were 
> set centered in the textblock, but cannot construct an example yet.)
small samples will help (after i updated the beta)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2019-01-28  1:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25  1:36 Bidi-related register problem Rik Kabel
2019-01-26 23:59 ` Rik Kabel
2019-01-27  3:40   ` Rik Kabel
2019-01-27 17:07   ` Hans Hagen
2019-01-27 18:15     ` Rik Kabel
2019-01-28  1:05       ` 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).