ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: [Index] Indenting long primaries after secondaries
       [not found] <019201cf331d$8bf5be80$a3e13b80$@tosovsky@email.cz>
@ 2014-03-07 17:54 ` Jan Tosovsky
       [not found] ` <00f801cf3a2e$4f722120$ee566360$@tosovsky@email.cz>
  1 sibling, 0 replies; 8+ messages in thread
From: Jan Tosovsky @ 2014-03-07 17:54 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2014-02-26 Jan Tosovsky wrote:
> 
> when a long primary is preceded with the secondary or tertiary 
> index entry, the second line is not indented as usual, see 
> the following example:
> 
> \setupregister[balance=no]
> \starttext
> \index{primary+secondary+tertiary}
> \index[primary long]{\dorecurse{5}{primary long }}
> \index[primary longer]{\dorecurse{5}{primary longer }} % but this is Ok
> \input{tufte}
> \completeindex
> \stoptext
> 

I've tested this in new beta and the issue is still there...

Jan

___________________________________________________________________________________
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] 8+ messages in thread

* Re: [Index] Indenting long primaries after secondaries
       [not found] ` <00f801cf3a2e$4f722120$ee566360$@tosovsky@email.cz>
@ 2014-03-16 13:35   ` Hans Hagen
  2014-03-16 15:34     ` Jan Tosovsky
       [not found]     ` <003001cf412d$3f2692a0$bd73b7e0$@tosovsky@email.cz>
  0 siblings, 2 replies; 8+ messages in thread
From: Hans Hagen @ 2014-03-16 13:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 3/7/2014 6:54 PM, Jan Tosovsky wrote:
> On 2014-02-26 Jan Tosovsky wrote:
>>
>> when a long primary is preceded with the secondary or tertiary
>> index entry, the second line is not indented as usual, see
>> the following example:
>>
>> \setupregister[balance=no]
>> \starttext
>> \index{primary+secondary+tertiary}
>> \index[primary long]{\dorecurse{5}{primary long }}
>> \index[primary longer]{\dorecurse{5}{primary longer }} % but this is Ok
>> \input{tufte}
>> \completeindex
>> \stoptext
>>
>
> I've tested this in new beta and the issue is still there...

how is a \dorecurse supposed to get sorted ...

-----------------------------------------------------------------
                                           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] 8+ messages in thread

* Re: [Index] Indenting long primaries after secondaries
  2014-03-16 13:35   ` Hans Hagen
@ 2014-03-16 15:34     ` Jan Tosovsky
       [not found]     ` <003001cf412d$3f2692a0$bd73b7e0$@tosovsky@email.cz>
  1 sibling, 0 replies; 8+ messages in thread
From: Jan Tosovsky @ 2014-03-16 15:34 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2014-03-16 Hans Hagen wrote:
> On 3/7/2014 6:54 PM, Jan Tosovsky wrote:
> > On 2014-02-26 Jan Tosovsky wrote:
> >>
> >> when a long primary is preceded with the secondary or tertiary
> >> index entry, the second line is not indented as usual, see
> >> the following example:
> >>
> >> \setupregister[balance=no]
> >> \starttext
> >> \index{primary+secondary+tertiary}
> >> \index[primary long]{\dorecurse{5}{primary long }}
> >> \index[primary longer]{\dorecurse{5}{primary longer }} % Ok 
> >> \input{tufte}
> >> \completeindex
> >> \stoptext
> >>
> 
> how is a \dorecurse supposed to get sorted ...
> 

That \dorecurse is used in this MWE only to make it shorter. Indeed, this
command confuses the letter grouping procedure so this is the reason why I
specified the sorting key via the bracket syntax [].

I think there is no need to fix this grouping issue (not enough ROI), but if
so, I would expect to resolve the \dorecurse command first and then apply
the grouping/sorting etc.

My main wish is fixing that indentation (or offering any workaround).

Thanks, Jan

___________________________________________________________________________________
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] 8+ messages in thread

* Re: [Index] Indenting long primaries after secondaries
       [not found]     ` <003001cf412d$3f2692a0$bd73b7e0$@tosovsky@email.cz>
@ 2014-03-16 16:09       ` Hans Hagen
  2014-03-16 17:31         ` Jan Tosovsky
       [not found]         ` <003b01cf413d$98624020$c926c060$@tosovsky@email.cz>
  2014-03-16 16:14       ` Hans Hagen
  1 sibling, 2 replies; 8+ messages in thread
From: Hans Hagen @ 2014-03-16 16:09 UTC (permalink / raw)
  To: ntg-context

On 3/16/2014 4:34 PM, Jan Tosovsky wrote:
> On 2014-03-16 Hans Hagen wrote:
>> On 3/7/2014 6:54 PM, Jan Tosovsky wrote:
>>> On 2014-02-26 Jan Tosovsky wrote:
>>>>
>>>> when a long primary is preceded with the secondary or tertiary
>>>> index entry, the second line is not indented as usual, see
>>>> the following example:
>>>>
>>>> \setupregister[balance=no]
>>>> \starttext
>>>> \index{primary+secondary+tertiary}
>>>> \index[primary long]{\dorecurse{5}{primary long }}
>>>> \index[primary longer]{\dorecurse{5}{primary longer }} % Ok
>>>> \input{tufte}
>>>> \completeindex
>>>> \stoptext
>>>>
>>
>> how is a \dorecurse supposed to get sorted ...
>>
>
> That \dorecurse is used in this MWE only to make it shorter. Indeed, this
> command confuses the letter grouping procedure so this is the reason why I
> specified the sorting key via the bracket syntax [].
>
> I think there is no need to fix this grouping issue (not enough ROI), but if
> so, I would expect to resolve the \dorecurse command first and then apply
> the grouping/sorting etc.
>
> My main wish is fixing that indentation (or offering any workaround).

we get this:

p
primary
   secondary
     tertiary 1
primary long primary long primary
   long primary long primary long 1
primary longer primary longer primary
   longer primary longer primary longer
   1

getting this:

p
primary
   secondary
     tertiary 1
primary long primary long primary
long primary long primary long 1
primary longer primary longer primary
longer primary longer primary longer
   1

is pretty hard because it would demand postprocessing entries but i 
wonder it looks better

\defineprocessor[twolines][style=\aftergroup\hangafter\aftergroup\plustwo]

\setupregister
   [balance=no]

\starttext
     \index{primary+secondary+tertiary}
     \index{twolines->primary long primary long primary long primary 
long primary long}
     \index{twolines->primary longer primary longer primary longer 
primary longer primary longer}
     \input{tufte}
     \completeindex
\stoptext

assuming that we never change the implementation

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] 8+ messages in thread

* Re: [Index] Indenting long primaries after secondaries
       [not found]     ` <003001cf412d$3f2692a0$bd73b7e0$@tosovsky@email.cz>
  2014-03-16 16:09       ` Hans Hagen
@ 2014-03-16 16:14       ` Hans Hagen
  1 sibling, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2014-03-16 16:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 3/16/2014 4:34 PM, Jan Tosovsky wrote:
> On 2014-03-16 Hans Hagen wrote:
>> On 3/7/2014 6:54 PM, Jan Tosovsky wrote:
>>> On 2014-02-26 Jan Tosovsky wrote:
>>>>
>>>> when a long primary is preceded with the secondary or tertiary
>>>> index entry, the second line is not indented as usual, see
>>>> the following example:
>>>>
>>>> \setupregister[balance=no]
>>>> \starttext
>>>> \index{primary+secondary+tertiary}
>>>> \index[primary long]{\dorecurse{5}{primary long }}
>>>> \index[primary longer]{\dorecurse{5}{primary longer }} % Ok
>>>> \input{tufte}
>>>> \completeindex
>>>> \stoptext
>>>>
>>
>> how is a \dorecurse supposed to get sorted ...
>>
>
> That \dorecurse is used in this MWE only to make it shorter. Indeed, this
> command confuses the letter grouping procedure so this is the reason why I
> specified the sorting key via the bracket syntax [].
>
> I think there is no need to fix this grouping issue (not enough ROI), but if
> so, I would expect to resolve the \dorecurse command first and then apply
> the grouping/sorting etc.
>
> My main wish is fixing that indentation (or offering any workaround).

stylistic variant:

\defineprocessor[twolines][command=\MyStyle]

\unexpanded\def\MyStyle#1%
   {\setbox\scratchbox\hbox{#1}%
    \scratchdimen\dimexpr\hsize-\leftskip-\hangindent\relax
    \ifdim\wd\scratchbox>\scratchdimen
      \aftergroup\hangafter
      \aftergroup\plustwo
      \aftergroup\break
    \else\ifdim\wd\scratchbox>2\scratchdimen
      \aftergroup\hangafter
      \aftergroup\plustwo
      \aftergroup\break
    \fi\fi
    \unhbox\scratchbox}

\setupregister
   [balance=no]

\setupregister
   [index:1]
   [textstyle=\MyStyle]

\starttext
     \index{primary+secondary+tertiary}
     \index{twolines->primary long primary long primary long primary 
long primary long}
     \index{twolines->primary longer primary longer primary longer 
primary longer primary longer}
     \input{tufte}
     \completeindex
\stoptext


-----------------------------------------------------------------
                                           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] 8+ messages in thread

* Re: [Index] Indenting long primaries after secondaries
  2014-03-16 16:09       ` Hans Hagen
@ 2014-03-16 17:31         ` Jan Tosovsky
       [not found]         ` <003b01cf413d$98624020$c926c060$@tosovsky@email.cz>
  1 sibling, 0 replies; 8+ messages in thread
From: Jan Tosovsky @ 2014-03-16 17:31 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

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

On 2014-03-16 Hans Hagen wrote:
> >>> On 2014-02-26 Jan Tosovsky wrote:
> >>>>
> >>>> when a long primary is preceded with the secondary or tertiary
> >>>> index entry, the second line is not indented as usual, see
> >>>> the following example:
> >>>>
> >>>> \setupregister[balance=no]
> >>>> \starttext
> >>>> \index{primary+secondary+tertiary}
> >>>> \index[primary long]{\dorecurse{5}{primary long }}
> >>>> \index[primary longer]{\dorecurse{5}{primary longer }} % Ok
> >>>> \input{tufte}
> >>>> \completeindex
> >>>> \stoptext
> >>>>
> >
> > My main wish is fixing that indentation (or offering any workaround).
> 
> we get this:
> 
> p
> primary
>    secondary
>      tertiary 1
> primary long primary long primary
>    long primary long primary long 1
> primary longer primary longer primary
>    longer primary longer primary longer
>    1
> 

hmm, I was getting different output in ConTeXt-2014.03.07:

p
primary
  secondary
     tertiary 1
primary long primary long primary
long primary long primary long 1 (!!! this was not indented)
primary longer primary longer primary
  longer primary longer primary longer 1

(or see the screenshot)

I've just updated ConTeXt to 2014.03.16 and now it works as expected!

Thanks a lot!

Jan

[-- Attachment #2: long_primary.png --]
[-- Type: application/octet-stream, Size: 24726 bytes --]

[-- Attachment #3: 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] 8+ messages in thread

* Re: [Index] Indenting long primaries after secondaries
       [not found]         ` <003b01cf413d$98624020$c926c060$@tosovsky@email.cz>
@ 2014-03-16 18:06           ` Hans Hagen
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2014-03-16 18:06 UTC (permalink / raw)
  To: ntg-context

On 3/16/2014 6:31 PM, Jan Tosovsky wrote:
> On 2014-03-16 Hans Hagen wrote:
>>>>> On 2014-02-26 Jan Tosovsky wrote:
>>>>>>
>>>>>> when a long primary is preceded with the secondary or tertiary
>>>>>> index entry, the second line is not indented as usual, see
>>>>>> the following example:
>>>>>>
>>>>>> \setupregister[balance=no]
>>>>>> \starttext
>>>>>> \index{primary+secondary+tertiary}
>>>>>> \index[primary long]{\dorecurse{5}{primary long }}
>>>>>> \index[primary longer]{\dorecurse{5}{primary longer }} % Ok
>>>>>> \input{tufte}
>>>>>> \completeindex
>>>>>> \stoptext
>>>>>>
>>>
>>> My main wish is fixing that indentation (or offering any workaround).
>>
>> we get this:
>>
>> p
>> primary
>>     secondary
>>       tertiary 1
>> primary long primary long primary
>>     long primary long primary long 1
>> primary longer primary longer primary
>>     longer primary longer primary longer
>>     1
>>
>
> hmm, I was getting different output in ConTeXt-2014.03.07:
>
> p
> primary
>    secondary
>       tertiary 1
> primary long primary long primary
> long primary long primary long 1 (!!! this was not indented)
> primary longer primary longer primary
>    longer primary longer primary longer 1
>
> (or see the screenshot)
>
> I've just updated ConTeXt to 2014.03.16 and now it works as expected!
>
> Thanks a lot!

The register mechanism has been adapted a bit and this was probably a 
positive side effect. Some changes:

- using mixed columns
- support for: referencemethod=forward (smaller tuc files)
- more efficient interactive support (esp when no page numbers)
- better keeping entries and subentries together

Apart from that the beta has some (small) speed improvements and there 
will be a slightly different index anchoring once the new version of 
luatex is available on all platforms.

Also, the beta has slightly different low level implementation of some 
of the interactive features (which can result in more efficient pdf 
files in some cases). In fact, due to some other changes, pdf files 
could be smaller anyway.

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] 8+ messages in thread

* [Index] Indenting long primaries after secondaries
@ 2014-02-26 18:07 Jan Tosovsky
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Tosovsky @ 2014-02-26 18:07 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

Dear All,

when a long primary is preceded with the secondary or tertiary index entry,
the second line is not indented as usual, see the following example:

\setupregister[balance=no]
\starttext
\index{primary+secondary+tertiary}
\index[primary long]{\dorecurse{5}{primary long }}
\index[primary longer]{\dorecurse{5}{primary longer }} % but this is Ok
\input{tufte}
\completeindex
\stoptext

How can I avoid this?

Thanks, Jan

___________________________________________________________________________________
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] 8+ messages in thread

end of thread, other threads:[~2014-03-16 18:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <019201cf331d$8bf5be80$a3e13b80$@tosovsky@email.cz>
2014-03-07 17:54 ` [Index] Indenting long primaries after secondaries Jan Tosovsky
     [not found] ` <00f801cf3a2e$4f722120$ee566360$@tosovsky@email.cz>
2014-03-16 13:35   ` Hans Hagen
2014-03-16 15:34     ` Jan Tosovsky
     [not found]     ` <003001cf412d$3f2692a0$bd73b7e0$@tosovsky@email.cz>
2014-03-16 16:09       ` Hans Hagen
2014-03-16 17:31         ` Jan Tosovsky
     [not found]         ` <003b01cf413d$98624020$c926c060$@tosovsky@email.cz>
2014-03-16 18:06           ` Hans Hagen
2014-03-16 16:14       ` Hans Hagen
2014-02-26 18:07 Jan Tosovsky

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).