# widow paragraph title with orphan epigraph with epigraph package

When I use an \epigraph{} command (from the epigraph package) just after a paragraph containing a title, I can get a widow paragraph title on a page bottom and an orphan epigraph on the next page top… It’s ugly.

This is a minimal example code of this behaviour:

\documentclass[a4paper,12pt,oneside,french]{article}
\usepackage{epigraph}
\usepackage{lipsum}

\widowpenalty=10000
\clubpenalty=10000
\raggedbottom

\begin{document}

\lipsum[1-4]

\paragraph{lorem ipsum dolor}
\epigraph{Lorem ipsum dolor sit amet}{Ciceron}

\lipsum[1]

\end{document}


And this is the rendering of this code:

As you see, I use \widowpenality, but I can’t force the paragraph title to go to the next page instead of leave as a widow on the original page.

So, how can I force all paragraph’s titles to go to the next page to follow there epigraph?

• Just use \pagebreak. Jun 21 '16 at 4:56
• No, I will not use a \pagebreak before every paragraph. However, I use \nopagebreak between \paragraph and \epigraph but it doesn’t work. Jun 21 '16 at 5:21

The reason for this break between the \paragraph and \epigraph stems from the construction of the \epigraph: it uses skips before (and after) and lists to adjust the layout. You may be better suited writing your own \epigraph:

\documentclass[a4paper,12pt]{article}
\usepackage{etoolbox}
\usepackage{lipsum}

\raggedbottom

\newcommand{\epigraph}[2]{%
\par\nobreak\noindent\par\nobreak\vspace{.5\baselineskip}
\hfill{\small\begin{tabular}{@{}p{.4\textwidth}@{}}
#1 \\[1ex]
\hline
\hfill #2
\end{tabular}}
\vspace{.5\baselineskip}
}

\begin{document}

\lipsum[1-4]

\paragraph{lorem ipsum dolor}
\epigraph{Lorem ipsum dolor sit amet}{Ciceron}

\lipsum[1]

\end{document}


The lengths used above are the typical defaults used by epigraph.

You could load the needspace package and issue the instruction

\needspace{3\baselineskip}


immediately before the \paragraph/\epigraph combination in question.

The full MWE (the paragraph header and the epigraph will show up at the top of a page:

\documentclass[a4paper,12pt,oneside,french]{article}
\usepackage{epigraph,lipsum}
\usepackage{needspace}

\widowpenalty=10000
\clubpenalty=10000
\raggedbottom

\begin{document}
\lipsum[1-4]

\needspace{3\baselineskip}
\paragraph{lorem ipsum dolor}
\epigraph{Lorem ipsum dolor sit amet}{Ciceron}

\lipsum[1]
\end{document}