I tried to generate a pdf using a stylesheet in css and also a stylesheet from mediawiki in php, but which also was written in css. The combination of these two led to some unexpected behaviour concerning page breaks.
So headings were alone at the end of the page while the rest of the section was on the next page and also sometimes just one word stood alone at the beginning of a new page while the rest was on the page before. Reason therefor were not the page break commands but the orphans and widows command in the php file.
First try was to reset the values to default or a lower value but only if I commented these two lines out the problem was fixed.
Here are two pdfs to show this problem.
So headings were alone at the end of the page while the rest of the section was on the next page and also sometimes just one word stood alone at the beginning of a new page while the rest was on the page before. Reason therefor were not the page break commands but the orphans and widows command in the php file.
First try was to reset the values to default or a lower value but only if I commented these two lines out the problem was fixed.
Here are two pdfs to show this problem.