[NTG-context] moving the first line of a page to the previous page

Hans Hagen j.hagen at xs4all.nl
Tue Oct 9 14:03:41 CEST 2018


On 10/9/2018 1:32 PM, mf wrote:
> Hello list,
> sometimes ConTeXt moves the (would-be) last line of a page to the next 
> page, even when there's room for it at the bottom of a page, before the 
> footnotes.
> 
> Sometimes i understand why it does so: when the line contains a footnote 
> that would increase the footnotes' height, for example; or when you have 
> widows or orphans.
> 
> But sometimes it happens in an inexplicable way: in some pages there's 
> room at the bottom and it keeps the last line, in some other pages 
> there's more room (than in the previous case), but it moves the last 
> line to the next page anyway.
> Even looking at hyphenations, i can't find an explanation fot that 
> behaviour.

you can mess with penalties but at somepoint tex has to decide ... an 
option is to use \adaptlayout and make the page a line higher, another is

\starttext

\showframe

\dorecurse{22}{line #1\blank}
% \dorecurse{24}{line #1\blank}

\keeplinestogether{100} \input klein

\stoptext

but of course there can be side effects


> So i'm looking for a way to prevent ConTeXt from moving the last line to 
> the next page.
> 
> A solution i found is to insert a \vadjust{\kern -0.5pt} in the 
> second-last line of the page. It works -- see the attachments -- but it 
> modifies the interline, so it's feasible only for corrections under 1pt.
> 
> Another way would be locally shrinking the space before footnotes, but i 
> don't know how and when to do it.
> 
> Some words about the attachments:
> 
> - there are some footnotes and line height setups to resemble the real 
> configuration i'm working with
> 
> - keep-line-in-page-0.tex is the reference case
> 
> - keep-line-in-page-1.tex is the solution with \vadjust{\kern -0.5pt}
> 
> Best wishes,
> Massimiliano
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context at 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
> ___________________________________________________________________________________
> 


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list