4

Breaking of section header and section content

Hi. How to prevent breaking of section header and section content? It is very strange behaviour for LaTeX, but it happened and I want to fix it.

Code of this section is below:

\section{Макетирование} 
\begin{wrapfigure}{l}{0.5\textwidth}
\includegraphics[width=\linewidth]{1}
\caption{Основное меню} \label{1}
\end{wrapfigure} \textbf{Рисунок 1}
\begin{enumerate} 
\item Поле Поиск предназначено для ...
\item ...
\end{enumerate} 
1
  • 1
    the simplest manual fix is to put \clearpage before the section. (presumably wrapfig is interfering with the usual prevention of page break, fixing that in general might be harder, I haven't looked this morning:) Commented Sep 17, 2014 at 10:18

1 Answer 1

4

Assuming you want to allow headings part way down a page - just not at the very bottom, one solution could be the needspace package. Needspace allows you to specify how much space must be on the page before placing the next item. However, this may not catch all instances of your issue.

Add \usepackage{needspace} and then do \needspace{X} before your \section{XYZ}. E.g. \needspace{5\baselineskip} will require at least 5 lines.

\needspace{5cm} %require at least 5cm on the page
\section{Макетирование} 
\begin{wrapfigure}{l}{0.5\textwidth}
\includegraphics[width=\linewidth]{1}
\caption{Основное меню} \label{1}
\end{wrapfigure} \textbf{Рисунок 1}
\begin{enumerate} 
\item Поле Поиск предназначено для ...
\item ...
\end{enumerate} 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .