I'm typesetting a large document (phdthesis) with pdflatex and I'm using KOMAscriptand the scrreprtdocument class.
I was very surprised as I saw a heading (\subsubsection) standing at the bottom of a page without any text below!
This is really bad style and it seems to happen to others also (see How can one keep a \section{} from being at the end of a page in LaTeX? and Avoiding page breaks shortly after section/subsection headings), but in my case the pagebreak is directly after the heading - there are not even 2 lines of text attached...
It seems to have to do with the many and big floats in this chapter and I think I'll have to adjust that manually, when the text is complete and editing is finished.
However, I wonder if pdflatex should not at least print a warning about that in the log file (I could not find any warnings concerning that), if it feels impelled to do such ugly things...
And I use the \raggedbottom-option (as I also had problems with very big spacing between large paragraphs), so I had hoped that this would avoid such "orphans".
setting the penalties to 1000 did not change anything:
\widowpenalty=1000
\clubpenalty=1000
---------- edit:
I now know where it comes from, but not how to avoid it:
I have defined a command to quickly add fixmenotes to the document with \N{Note}
It is defined as \newcommand{\N}[1]{\fxfatal*[inline=true,nomargin]{/#1/}{}}
... and I used it directly after the problematic section command like:
\subsubsection{Title of the section}
\N{note about what to change in that section later} And now starts the normal text of the section...
If I move the note \N{...} to another place, e. g. after the first sentence of the section, the pagebreak is before the section title.
Question: Is there anything I can do to redefine the \N{} command to avoid that behavior?
It would be difficult to construct a minimal example in this case, so my question is:
1) why is there no warning?
2) I would consider a lonely heading much worse than a page which has some empty white space at the bottom - how can I make pdflatex "know" that?
My preamble has become quite complex with the time - I have left out all "simple" newcommands etc. and tried only to keep things which might interfere with my questions:
\documentclass[11pt, a4paper,
twoside, autooneside,
headinclude, footexclude,
liststotoc, bibtotoc,
tablecaptionabove, noonelinecaption, headsepline, halfparskip
]{scrreprt}
\usepackage{svn-multi}
\svnidlong
%(...)
\areaset[8mm]{15.5cm}{25.2cm}
\setkomafont{sectioning}{\normalfont\normalcolor\bfseries}
\addtokomafont{captionlabel}{\bfseries}
\usepackage[UKenglish, ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage[TS1, T1]{fontenc}
\usepackage{aecompl}
\usepackage[ngerman, iso]{isodate}
\isodate
\usepackage{datetime}
\usepackage[version=3]{mhchem}
\usepackage[caption=false, format=hang]{subfig}
\usepackage{pdflscape}
\usepackage[stable]{footmisc}
\usepackage[automark]{scrpage2}
\pagestyle{scrheadings}
\automark[section]{chapter}
\cfoot{\footnotesize Rev.~\svnrev{} (\svnfilerev) \\vom \svnyear-\svnmonth-\svnday \ \svnhour:\svnminute:\svnsecond}
\ifoot{\footnotesize erstellt:\\\today{} \currenttime}
\usepackage{hyperref}
\usepackage[pdftex]{graphicx}
\usepackage{color}
\usepackage{amsmath}
\usepackage{amstext}
\usepackage{amssymb}
\usepackage{array}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage[numbers, sort&compress]{natbib}
\usepackage[]{rotating}
\usepackage{url}
\usepackage[tight]{units}
\usepackage[color]{showkeys}
\renewcommand*\showkeyslabelformat[1]{\fbox{\normalfont\tiny\ttfamily#1}}
\definecolor{refkey}{cmyk}{0.26,0,0.76,0}%{gray}{0.5}
\definecolor{labelkey}{cmyk}{0.26,0,0.76,0}%{gray}{0.5}
\usepackage[draft]{fixme}
\fxsetup{theme=color, inline, targetlayout=color, author=}
\usepackage{paralist}
\deffootnote[1em]{1em}{1em} {\textsuperscript{\thefootnotemark} }
\setcapindent{1cm}
\makeatletter
\setlength{\@fptop}{0pt}
\makeatother
% Alter some LaTeX defaults for better treatment of figures:
%Quelle: http://mintaka.sdsu.edu/GF/bibliog/latex/floats.html
% See p.105 of "TeX Unbound" for suggested values.
% See pp. 199-200 of Lamport's "LaTeX" book for details.
% General parameters, for ALL pages:
\renewcommand{\topfraction}{0.9} % max fraction of floats at top
\renewcommand{\bottomfraction}{0.8} % max fraction of floats at bottom
% Parameters for TEXT pages (not float pages):
\setcounter{topnumber}{3}
\setcounter{bottomnumber}{2}
\setcounter{totalnumber}{4} % 2 may work better
\setcounter{dbltopnumber}{2} % for 2-column pages
\renewcommand{\dbltopfraction}{0.9} % fit big float above 2-col. text
\renewcommand{\textfraction}{0.07} % allow minimal text w. figs
% Parameters for FLOAT pages (not text pages):
\renewcommand{\floatpagefraction}{0.8} % require fuller float pages
% N.B.: floatpagefraction MUST be less than topfraction !!
\renewcommand{\dblfloatpagefraction}{0.8} % require fuller float pages
% remember to use [htp] or [htpb] for placement