I have defined a custom amsthm environment for my theorems and such, because
I want to have a line break after the header.
\newtheoremstyle{teo}
{15pt} % ABOVESPACE
{} % BELOWSPACE
{\itshape} % BODYFONT
{0pt} % INDENT (empty value is the same as 0pt)
{\bfseries\large} % HEADFONT
{.} % HEADPUNCT
{\newline} % HEADSPACE
{} % CUSTOM-HEAD-SPEC
Is there any way to prevent LaTeX from putting a page break in between the header and body of my theorems? The \nopagebreak command does not seem to work for me.
If I put it into my custom environment definition, it just produces errors and if I insert it into an instance of the environment itself it seems to do nothing.
Edit: This produces an example of the behavior I want to avoid:
\documentclass[a4paper,10pt]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[ngerman,english]{babel}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{lipsum}
\newtheoremstyle{teo}
{15pt} % ABOVESPACE
{} % BELOWSPACE
{\itshape} % BODYFONT
{0pt} % INDENT (empty value is the same as 0pt)
{\bfseries\large} % HEADFONT
{.} % HEADPUNCT
{\newline} % HEADSPACE
{} % CUSTOM-HEAD-SPEC
\theoremstyle{teo}
\newtheorem{defi}{Definition}[section]
\begin{document}
\section{test}
\lipsum[1-3]
\vspace{90px}
\lipsum[4]
\begin{defi}[Derivative Operator Monoid]
Let $(R,\Delta)$ be a differential ring. We define: \dots
\end{defi}
\end{document}
Edit2: Added the missing document class line.
