[luatex] Refuses to page break between section headings

Reinhard Kotucha reinhard.kotucha at web.de
Wed Mar 11 00:10:57 CET 2015


On 2015-03-09 at 23:45:14 +0100, Ulrike Fischer wrote:

 > Am Mon, 9 Mar 2015 23:34:21 +0100 schrieb Reinhard Kotucha:
 > 
 > >  > I hadn't seen that you are creating an one-time, rather small
 > >  > which is needed soon document. In this case both \clearpage
 > >  > (forced pagebreak) or \filbreak (allows a break) is ok.
 > > 
 > > Ulrike,
 > > at a first glance is seems that \filbreak is the best solution
 > > because one could consider to redefine the section command:
 > > 
 > >   \newcommand\Section[1]{\section{#1}\filbreak}
 > > 
 > > It works like a charm if the paragraph fits on the current page,
 > > but unfortunately it's moved to the next page if there isn't
 > > enough space on the current page.
 > 
 > If I wanted to insert \filbreak automatically (and not only when
 > there is no text after a section) I would put it before the
 > \section.

Yes,

  \newcommand\Section[1]{\filbreak\section{#1}}

is better than

  \newcommand\Section[1]{\section{#1}\filbreak}

but it's not perfect.  In both cases the whole paragraph is pushed to
the next page.  If \filbreak comes before \section, the section header
is pushed to the next page too.  This is the only difference.  TeX
doesn't make any attempt to split the paragraph.

Regards,
  Reinhard

-- 
------------------------------------------------------------------
Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de
------------------------------------------------------------------


More information about the luatex mailing list