ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Index - ranges
       [not found] <007801cedc04$43767660$ca636320$@tosovsky@email.cz>
@ 2013-11-08 19:53 ` honyk
  2013-11-12 21:14 ` honyk
       [not found] ` <00d401cedfec$3eb0c090$bc1241b0$@tosovsky@email.cz>
  2 siblings, 0 replies; 5+ messages in thread
From: honyk @ 2013-11-08 19:53 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2013-11-07 honyk wrote:
> 
> 1) when a range for my subject index entry is specified and the text
> between doesn't overflow to the next page, even in this case 
> the range of pages 1-1 is created. Is there any option to normalize 
> it to a single page number?
> 
> \startregister[index][range_01]{primary}
> Dummy text.
> \stopregister[index][range_01]

It is rare, but any help to eliminate it completely is appreciated.

> 2) when ranges are used heavily, confusing results are produced. In
> following examples I would expect a single range 1-6:
>    a) 1-3, 3-6
>    b) 1-6, 2-4
>    c) 1-6, 5-6

This one was caused by improper Docbook => dbcontext => ConTeXt conversion.
All ranges of secondaries were treated as primaries so they were collected
at primaries. After fixing the XSLT such cases dissapeared completely.
Great. This would be a blocker for me.
 
> 3) when several single index entries are used on consecutive pages, the
> result 1,2,3,4,5 is produced. Is there any option to create a range
> from this?

I'm reconsidering this now. I designed my 'subject' index to use ranges when
the subject is thoroughly explained, which obviously needs to define
beginning and end. On the contrary, when the subject is just mentioned
(above the threshold of importance), I inserted just a single index entry
instance. 

Collecting these single instances into the range of e.g. 1-5 would bring
false expectations that the subject is thoroughly explained there...

This logic goes slightly against the case (1). When the range would be
collapsed into to a single value, we would loose the info that the subject
is described here. But it looks weird.

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

* Re: Index - ranges
       [not found] <007801cedc04$43767660$ca636320$@tosovsky@email.cz>
  2013-11-08 19:53 ` Index - ranges honyk
@ 2013-11-12 21:14 ` honyk
       [not found] ` <00d401cedfec$3eb0c090$bc1241b0$@tosovsky@email.cz>
  2 siblings, 0 replies; 5+ messages in thread
From: honyk @ 2013-11-12 21:14 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2013-11-07 honyk wrote:
> 
> 1) when a range for my subject index entry is specified and the text
> between doesn't overflow to the next page, even in this case 
> the range of pages 1-1 is created. Is there any option to normalize 
> it to a single page number?
> 
> \startregister[index][range_01]{primary}
> Dummy text.
> \stopregister[index][range_01]
> 
> ...
> 3) when several single index entries are used on consecutive pages, the
> result 1,2,3,4,5 is produced. Is there any option to create a range
> from this?

(A)
I've found a promising option compress=no|yes|all in an experimental test
case located in the strc-reg.mkiv file. The corresponding lua code seems to
be performing some cleanup of page ranges, but when I define it same way,
there is no difference in my output (still 1-1):

\startregister[index][range_01]{primary}
Dummy text.
\stopregister[index][range_01]
\placeregister[index][compress=yes]

Is it necessary to switch it on somehow? 

(B)
I've also found a special syntax for collapsing pages in
http://wiki.contextgarden.net/Registers
[[Command/{{{1}}}|\{{{1}}}]] - but I have no idea how to appply it. 

I already use the 'command' parameter to switch the index group letter to
upper case: \setupregister[index][n=2,command=\Word,style=normal]

Can these commands be combined together somehow? Or is it obsolete in favor
of (A)?

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

* Re: Index - ranges
       [not found] ` <00d401cedfec$3eb0c090$bc1241b0$@tosovsky@email.cz>
@ 2013-11-15 12:50   ` honyk
       [not found]   ` <008c01cee201$4a65bff0$df313fd0$@tosovsky@email.cz>
  1 sibling, 0 replies; 5+ messages in thread
From: honyk @ 2013-11-15 12:50 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2013-11-12 honyk wrote:
> On 2013-11-07 honyk wrote:
> >
> > 1) when a range for my subject index entry is specified and the text
> > between doesn't overflow to the next page, even in this case
> > the range of pages 1-1 is created. Is there any option to normalize
> > it to a single page number?
> >
> > \startregister[index][range_01]{primary}
> > Dummy text.
> > \stopregister[index][range_01]
> > 
> I've found a promising option compress=no|yes|all in an experimental
> test case located in the strc-reg.mkiv file. The corresponding lua 
> code seems to be performing some cleanup of page ranges, but when 
> I define it same way, there is no difference in my output (still 1-1).

Looking into the lua code this one is an edge case as normalization is
performed if #pages > 1 which is not achieved here. No problem.

But I've encountered more serious issue now:
When original pages are 'compressed' for the index
114, 117, 119, 122, 130-132, 135, 135-139, 188-204, 321-321

The incorrect result is returned:
114, 117, 119, 122, 130-135, 135-321

I'd expect:
114, 117, 119, 122, 130-132, 135-139, 188-204, 321

Debugging it roughly I've noticed unsorted page numbers before compressing
(in collapsedpage function in strc-reg.lua), which leads to unexpected
result from first/second comparison.

Some kind of page entries sorting might help here.

Regards, 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] 5+ messages in thread

* Re: Index - ranges
       [not found]   ` <008c01cee201$4a65bff0$df313fd0$@tosovsky@email.cz>
@ 2013-11-15 17:32     ` honyk
  0 siblings, 0 replies; 5+ messages in thread
From: honyk @ 2013-11-15 17:32 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2013-11-15 honyk wrote:
> On 2013-11-12 honyk wrote:
> > On 2013-11-07 honyk wrote:
> > >
> > > 1) when a range for my subject index entry is specified and the
> > > text between doesn't overflow to the next page, even in this case
> > > the range of pages 1-1 is created. Is there any option to normalize
> > > it to a single page number?
> > >
> > > \startregister[index][range_01]{primary}
> > > Dummy text.
> > > \stopregister[index][range_01]

I've finally found it is caused by this logic:

if first == last then
  if first.references.lastrealpage then
     -- IMHO this could be optional
     pagerange(first,first,true,prefixspec,pagespec)
  else
     pagenumber(first,prefixspec,pagespec)
  end
elseif last.references.lastrealpage then
  pagerange(first,last,true,prefixspec,pagespec)
else
  pagerange(first,last,false,prefixspec,pagespec)
end

Even after normalization, if there is a range, it is preserved regardless it
spans multiple pages or not. The fix is quite easy. But whether to convert
these single page ranges into a single value or not could be optional, or
applied according to the compress parameter (both 'yes' and 'all' would
collapse the range).

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

* Index - ranges
@ 2013-11-07 21:56 honyk
  0 siblings, 0 replies; 5+ messages in thread
From: honyk @ 2013-11-07 21:56 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

Dear All,

1) when a range for my subject index entry is specified and the text between
doesn't overflow to the next page, even in this case the range of pages 1-1
is created. Is there any option to normalize it to a single page number?

\startregister[index][range_01]{primary}
Dummy text.
\stopregister[index][range_01]

2) when ranges are used heavily, confusing results are produced. In
following examples I would expect a single range 1-6:
   a) 1-3, 3-6
   b) 1-6, 2-4
   c) 1-6, 5-6

3) when several single index entries are used on consecutive pages, the
result 1,2,3,4,5 is produced. Is there any option to create a range from
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] 5+ messages in thread

end of thread, other threads:[~2013-11-15 17:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <007801cedc04$43767660$ca636320$@tosovsky@email.cz>
2013-11-08 19:53 ` Index - ranges honyk
2013-11-12 21:14 ` honyk
     [not found] ` <00d401cedfec$3eb0c090$bc1241b0$@tosovsky@email.cz>
2013-11-15 12:50   ` honyk
     [not found]   ` <008c01cee201$4a65bff0$df313fd0$@tosovsky@email.cz>
2013-11-15 17:32     ` honyk
2013-11-07 21:56 honyk

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