ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Orphans/Widows in the Index
       [not found] <001901cf5f26$3e1a2310$ba4e6930$@tosovsky@email.cz>
@ 2014-06-23 19:01 ` Jan Tosovsky
       [not found] ` <009301cf8f15$97925ab0$c6b71010$@tosovsky@email.cz>
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Tosovsky @ 2014-06-23 19:01 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2014-04-23 Jan Tosovsky wrote:
> 
> in my auto-generated two column index (registry) there are 
> several cases of widows - it is the last item of the given 
> letter which overflows to next column/page:
> 
>     --------------- (start page) -------
>     Usti 29 (! alone !)
> 
>     V
>     Vamberk 18
>     ...
>     ...
> 
> 
> There are also few cases of orphans, but this is not so strange:
>     ...
>     ...
>     Josef 29
> 
>     K         
>     Karel 69 (! alone !)
>     ---------------- (end page) ---------
> 
> In my setup I have defined (with no luck):
> 
> \startsetups[grid][mypenalties]
>     \setdefaultpenalties
>     \setpenalties\widowpenalties{2}{10000}
>     \setpenalties\clubpenalties {2}{10000}
> \stopsetups
> 
> \setuplayout[grid=yes, setups=mypenalties]
> 

After finishing another duties I am back ... and still facing these issues.

I think both cases could be eliminated by establishing a new constraint to
the 'key letter':
(1) There must be 0 or at least 3 lines at the beginning of the 
    page/column before the Key letter.
(2) There must be at least 2 lines after the Key letter.

Can this be somehow set in my source file? 

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

* Re: Orphans/Widows in the Index
       [not found] ` <009301cf8f15$97925ab0$c6b71010$@tosovsky@email.cz>
@ 2014-06-25 20:38   ` Jan Tosovsky
       [not found]   ` <00ba01cf90b5$6471be90$2d553bb0$@tosovsky@email.cz>
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Tosovsky @ 2014-06-25 20:38 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2014-06-23 Jan Tosovsky wrote:
> On 2014-04-23 Jan Tosovsky wrote:
> >
> > in my auto-generated two column index (registry) there are
> > several cases of widows - it is the last item of the given
> > letter which overflows to next column/page:
> >
> >     --------------- (start page) -------
> >     Usti 29 (! alone !)
> >
> >     V
> >     Vamberk 18
> >     ...
> >     ...
> >
> >
> > There are also few cases of orphans, but this is not so strange:
> >     ...
> >     ...
> >     Josef 29
> >
> >     K
> >     Karel 69 (! alone !)
> >     ---------------- (end page) ---------
> >
> 
> I think both cases could be eliminated by establishing a new constraint
> to the 'key letter':
> (1) There must be 0 or at least 3 lines at the beginning of the
>     page/column before the Key letter.
> (2) There must be at least 2 lines after the Key letter.
> 
> Can this be somehow set in my source file?
> 

I've found the corresponding code in strc-reg.mkiv:

\setvalue{\??registerindicator a}#1%
  {\registerparameter\c!before
   % bugged, why does leftskip gets set:
\vskip\lineheight\goodbreak\vskip-\lineheight
   \begingroup
   \useregisterstyleandcolor\c!style\c!color   
   \dontleavehmode
   \strut
   \iflocation
     \dosetdirectpagereference{\currentregister:\v!section:#1}%
   \fi
   \registerparameter\c!command{#1}%
   \endgroup
   \blank[\v!samepage]%
   \registerparameter\c!after
   \par
   \nobreak}

That (2) case can be fixed by a small change:
\testcolumn[3]\registerparameter\c!command{#1}%

But when tested on this MWE, you can see a drawback - the first letter (p)
starts always on the second line (not on the first one):

\setupregister[balance=yes]
\starttext
\index{primary+secondary+tertiary}
\index[primary long]{\dorecurse{5}{primary long }}
\index[primary longer]{\dorecurse{5}{primary longer }}
\input{tufte}
\completeindex
\stoptext

Can this issue somehow be eliminated? Tested on the last beta (with my
patch).

That (1) case is still open. I have no idea how to accomplish something like
this using (Con)TeX(t) syntax :-(

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

* Re: Orphans/Widows in the Index
       [not found]   ` <00ba01cf90b5$6471be90$2d553bb0$@tosovsky@email.cz>
@ 2014-07-05 10:42     ` Jan Tosovsky
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Tosovsky @ 2014-07-05 10:42 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2014-06-25 Jan Tosovsky wrote:
> On 2014-06-23 Jan Tosovsky wrote:
> > On 2014-04-23 Jan Tosovsky wrote:
> > >
> > > There are also few cases of orphans:
> > >     ...
> > >     ...
> > >     Josef 29
> > >
> > >     K
> > >     Karel 69 (! alone !)
> > >     ---------------- (end page) ---------
> > >
> 
> I've found the corresponding code in strc-reg.mkiv:
> 
> \setvalue{\??registerindicator a}#1%
>   {\registerparameter\c!before
>    % bugged, why does leftskip gets set:
> \vskip\lineheight\goodbreak\vskip-\lineheight
>    \begingroup
>    \useregisterstyleandcolor\c!style\c!color
>    \dontleavehmode
>    \strut
>    \iflocation
>      \dosetdirectpagereference{\currentregister:\v!section:#1}%
>    \fi
>    \registerparameter\c!command{#1}%
>    \endgroup
>    \blank[\v!samepage]%
>    \registerparameter\c!after
>    \par
>    \nobreak}
> 
> That (2) case can be fixed by a small change:
> \testcolumn[3]\registerparameter\c!command{#1}%
> 
> But when tested on this MWE, you can see a drawback - the first 
> letter (p) starts always on the second line (not on the first one):
> 
> \setupregister[balance=yes]
> \starttext
> \index{primary+secondary+tertiary}
> \index[primary long]{\dorecurse{5}{primary long }}
> \index[primary longer]{\dorecurse{5}{primary longer }}
> \input{tufte}
> \completeindex
> \stoptext

I've realized that empty line is placed before every Index section where
\testcolumn command is placed (by my patch).

Is there any way to use \testcolumn and avoid producing that empty line?

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

* Orphans/Widows in the Index
@ 2014-04-23 19:00 Jan Tosovsky
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Tosovsky @ 2014-04-23 19:00 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

Dear All,

in my auto-generated two column index (registry) there are several cases of
widows - it is the last item of the given letter which overflows to next
column/page:

    --------------- (start page) -------
    Usti 29 (!!! - I would expect to place here also one or better two
previous entries)

    V
    Vamberk 18 
    ...
    ...


There are also few cases of orphans, but this is not so strange:
    ...
    ...
    Josef 29

    K         (!!! - both these lines could be moved to the next
column/page)
    Karel 69  
    ---------------- (end page) ---------

In my setup I have defined:

\startsetups[grid][mypenalties]
    \setdefaultpenalties
    \setpenalties\widowpenalties{2}{10000} % change to {3}{10000} doesn't
help
    \setpenalties\clubpenalties {2}{10000}
\stopsetups

\setuplayout[grid=yes, setups=mypenalties]

It is hard to provide MWE. Moreover, the content is for private use only.

Is there any remedy for 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] 4+ messages in thread

end of thread, other threads:[~2014-07-05 10:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <001901cf5f26$3e1a2310$ba4e6930$@tosovsky@email.cz>
2014-06-23 19:01 ` Orphans/Widows in the Index Jan Tosovsky
     [not found] ` <009301cf8f15$97925ab0$c6b71010$@tosovsky@email.cz>
2014-06-25 20:38   ` Jan Tosovsky
     [not found]   ` <00ba01cf90b5$6471be90$2d553bb0$@tosovsky@email.cz>
2014-07-05 10:42     ` Jan Tosovsky
2014-04-23 19:00 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).