I wanted to try out encouraging of pagebreak using \pagebreak[number]
.
As far for now it only breaks the page when I define \pagebreak[4]
and only then (it won't work on any other circumstances).
Can someone explain to me how should it work ?
If I have a new section just in the bottom of the page and if I use \pagebreak[3]
over \section{xxxxx}
it will not break it then.
The manual says :
The \pagebreak command tells LaTeX to break the current page at the
point of the command. With the optional argument, number, you can
convert the \pagebreak command from a demand to a request. The number
must be a number from 0 to 4. The higher the number, the more
insistent the request is.
Best Answer
The command
\pagebreak[3]
only modifies the chances that the break appears at that place. Namely, it reduces the penalty for such a break by301
. The command\pagebreak[4]
reduces the penalty by10000
which is a sort-of "TeX's infinity", and it enforces a page break by making it not cost anything.However,
\pagebreak[3]
cannot work in cases where LaTeX does not see anything wrong with the output (which is the case of a section title quite close to the bottom of the page). So you have to tell LaTeX to consider bottomtitles as a bad thing, and the easiest way to do this is by using a feature of thetitlesec
package:Its idea is simple: Enforce a page-break if there is not much space left on the page. The implementation is more complicated, and I am sure that I am not able to explain in here in a good way.