[luatex] Refuses to page break between section headings

Reinhard Kotucha reinhard.kotucha at web.de
Mon Mar 9 23:34:21 CET 2015


On 2015-03-09 at 21:38:35 +0100, Ulrike Fischer wrote:

 > Am Mon, 9 Mar 2015 21:18:51 +0100 schrieb Jonas Olson:
 > 
 > 
 > >> So why did you use \section? Because the output is bold? Because of
 > >> the spacing? Because the output is numbered?
 >  
 > > Because it's bold and large (though I can recreate that myself), but 
 > > most of all because of the spacing. I don't need the numbering, so I use 
 > > the starred version. (Actually, I use "\documentclass[article]{memoir}" 
 > > and have "\chapter*{A}" instead of sections, but I wanted to create a 
 > > simpler example for posting here.)
 > 
 > 
 > 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.  See the example below.  However, it's good that
you mentioned it though.  It seems that \clearpage is the right way to
go for the time being.

Regards,
  Reinhard

\documentclass{article}
\usepackage[showframe]{geometry}
\newcommand\text{The quick brown fox jumps over the lazy dog. }
\newcommand\Section[1]{\section{#1}\filbreak}
\begin{document}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\text \text \text \text
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\Section{A}
\text \text \text \text \text \text \text
\Section{A}
\Section{A}
\end{document}


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


More information about the luatex mailing list