2

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: enter image description here

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?

2
  • Just use \pagebreak.
    – Werner
    Jun 21, 2016 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.
    – fauve
    Jun 21, 2016 at 5:21

2 Answers 2

2

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:

enter image description here

\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.

1

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}

You must log in to answer this question.

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