What is the best way to avoid a page break just after a \epigraph command from epigraph package? I'm adding epigraphs after section titles.
\documentclass{article}
\usepackage[nopar]{lipsum}
\usepackage{epigraph}
\begin{document}
\section{Aaaa}
\epigraph{$1+2 \neq 3$}{Matlab}
\lipsum[1-4]
\section{Bbbb}
\epigraph{$1+2 \neq 3$}{Matlab}
\lipsum[1-4]
\end{document}
I tried with \penalty1000, with \nopagebreak, and with \clubpenalties without success.
I managed to do that with \needspace like in this answer, adding to the preamble:
\usepackage{etoolbox}
\usepackage{needspace}
\preto\section{\needspace{7\baselineskip}}
Is this a good way? Is there a better one?