I use beamer to create wonderful presentations slides.
My problem arises when I create the presentation handouts using
\usepackage{beamerarticle}
.In the generated handouts, it frequently happens that frameTitle/section titles appear at the end of the page, which is very annoying.
If what follows the frameTitle/section was a usual paragraph, then
\needspace{2\baselineskip}
might have helped, but sometimes it is an inline image whose hight is 80% of the text height that follows the frameTitle/section. In this case,\needspace{2\baselineskip}
doesn't help.When I was using MS Word, this was solved using an option called "keep with next". This option simply moves the section heading to the following page so that it is kept with what comes after. I think this is exactly what I want.
I think this may be done using
\nopagebreak
. I hope this command is smart enough to move the frameTitle/section heading to the following page if there is no space for what follows the frameTitle/section in the current page.So could you please tell me how can I redefine/patch the
\section
, \subsection
and \subsubsection
commands so that they issue \nopagebreak
before what follows these commands?I think this not a special beamer problem, but a general Latex problem.
For the FrameTitle, I think
\addtobeamertemplate{frametitle}{}{\nopagebreak}
does the trick. Please correct me is I'm wrong.Thanks in advance.