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.

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
\definevspacingamount[glueOverFootnotes][18pt plus 18pt minus 6pt]

\setupnotation[
  alternative=serried,
  style=\ss,
  numberstopper=,
  way=bypage,
  distance=1pt,
  location=page]

\setupnote[
  alternative=serried,
  paragraph=yes,
  bodyfont=small,
  inbetween=\penalty10000{ }\emdash{}{ }\penalty-100,  % \emdash{}
  location=page,
  before={\blank[glueOverFootnotes]},
  height=10cm]

\definebodyfontenvironment[11pt][interline=12pt]
\setupbodyfont[11pt]

\starttext
\showgrid
Lorem ipsum dolor sit amet, consectetur adipiscing elit.\footnote{a footnote}\par

\blank[12*line,fixed]

Lorem ipsum dolor sit amet, consectetur adipiscing elit.\footnote{another footnote}

\blank[12*line,fixed]

Lorem ipsum dolor sit amet, consectetur adipiscing elit.% \footnote{another
% longer footnote: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
% Ut mattis volutpat elit sit amet fermentum.}

\blank[12*line,fixed]

Quisque vel arcu ut tellus congue vulputate. Praesent nec tortor vitae
nibh elementum semper. Cras sit amet turpis ac quam bibendum interdum.
Orci varius natoque penatibus et magnis dis parturient montes, nascetur
ridiculus mus. Maecenas ac mi sed nisl bibendum ultricies.
Nullam ac augue non ex euismod fermentum id quis nulla.
Cras vel lorem aliquet eros maximus interdum nec fermentum ligula.
Cras eu eros nec justo blandit ullamcorper ut et magna.
Curabitur aliquam nunc at pharetra semper.
Pellentesque vel lectus ut diam varius vestibulum. Etiam non varius erat.
Nunc scelerisque, dolor sit amet feugiat vestibulum, nulla erat eleifend
mauris, eget ultricies neque velit non neque. Donec vitae tempus est,
a feugiat magna.

\stoptext
\definevspacingamount[glueOverFootnotes][18pt plus 18pt minus 6pt]

\setupnotation[
  alternative=serried,
  style=\ss,
  numberstopper=,
  way=bypage,
  distance=1pt,
  location=page]

\setupnote[
  alternative=serried,
  paragraph=yes,
  bodyfont=small,
  inbetween=\penalty10000{ }\emdash{}{ }\penalty-100,  % \emdash{}
  location=page,
  before={\blank[glueOverFootnotes]},
  height=10cm]

\definebodyfontenvironment[11pt][interline=12pt]
\setupbodyfont[11pt]

\starttext
\showgrid
Lorem ipsum dolor sit amet, consectetur adipiscing elit.\footnote{a footnote}\par

\blank[12*line,fixed]

Lorem ipsum dolor sit amet, consectetur adipiscing elit.\footnote{another footnote}

\blank[12*line,fixed]

Lorem ipsum dolor sit amet, consectetur adipiscing elit.% \footnote{another
% longer footnote: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
% Ut mattis volutpat elit sit amet fermentum.}

\blank[12*line,fixed]

Quisque vel arcu ut tellus congue vulputate. Praesent nec tortor vitae
nibh elementum semper. Cras sit amet turpis ac quam bibendum interdum.
Orci varius natoque penatibus et magnis dis parturient montes, nascetur
ridiculus mus. \vadjust{\kern -.5pt}Maecenas ac mi sed nisl bibendum ultricies.
Nullam ac augue non ex euismod fermentum id quis nulla.
Cras vel lorem aliquet eros maximus interdum nec fermentum ligula.
Cras eu eros nec justo blandit ullamcorper ut et magna.
Curabitur aliquam nunc at pharetra semper.
Pellentesque vel lectus ut diam varius vestibulum. Etiam non varius erat.
Nunc scelerisque, dolor sit amet feugiat vestibulum, nulla erat eleifend
mauris, eget ultricies neque velit non neque. Donec vitae tempus est,
a feugiat magna.

\stoptext
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to