How do I modify the penalty given to a pagebreak between paragraphs? I looked everywhere and could not figure out. If I really need to I can redefine \par but I'm unsatisfied with such a hack.
- 88,848
- 868
- 7
- 19
1 Answers
The penalty for breaking before the \parskip glue inserted between paragraphs is 0, so one possibility is to redefine \par to add a \penalty node before that skip. One problem doing that in latex is that latex redefines \par all the time (after headings and list items, to control breaking and indentation, in parboxes and minipages (to restore the default definition) etc, so you need to coordinate your redefinition with any other macros that are resetting \par.
An alternative way to view the same requirement is that you want to make it more likely that page break happens between paragraphs than mid-paragraph. Given that the inter-paragraph penalty is essentially fixed at 0, rather than change that you can increase the \interlinepenalty to discourage breaking between lines. \interlinepenalty is normally 0 (except after section headings, or in the scope of samepage) So you can increase it to make breaks between paragraphs more likely.
You also need to add some stretchable glue to the page, either by using \raggedbottom or making \parskip or some other glue flexible. If there is no stretchable glue then TeX has no choice in the page breaking, it has to break after the last line that fits on the page, or if the penalty is 10000 so that is not possible it will make an over-full box and over-print the page boundary.
- 757,742
-
The problem I had with changing only
\interlinepenalty(which I already did) is that it is only one of the many penalties, and I had wanted to be able to encourage page-breaking between paragraphs relative to all other places. In the end I did redefine\parand so far had no issues. – user21820 Nov 24 '15 at 13:34
\interlinepenalty. – user21820 Jun 18 '15 at 08:42\par.;-)– egreg Jun 18 '15 at 09:02\par. I hesitate to redefine\parjust like that as I don't know what might break. – user21820 Jun 18 '15 at 09:15\parwill be kept local to the group, so you shouldn't worry to break things elsewhere. – jarnosc Oct 31 '15 at 22:05\parbecause I want to encourage page-break between paragraphs rather than in the middle, if the paragraph is not too long. – user21820 Nov 01 '15 at 14:10