# How can I force bibliography items not to be split across pages? [duplicate]

\documentclass{mwrep}
\usepackage[nodisplayskipstretch]{setspace} \setstretch{1.9}
\begin{document}

Dummy

\begin{thebibliography}{999}

\bibitem{1}John Doe, Jane Doe, Captain America, Superman:
\emph{Bibliography item with a very long title: part one},
Some title of a magazine with a very long title, 2009, pages 1234--4321

\bibitem{2}John Doe, Jane Doe, Captain America, Superman:
\emph{Bibliography item with a very long title: part one},
Some title of a magazine with a very long title, 2009, pages 1234--4321

\bibitem{3}John Doe, Jane Doe, Captain America, Superman:
\emph{Bibliography item with a very long title: part one},
Some title of a magazine with a very long title, 2009, pages 1234--4321

\bibitem{4}John Doe, Jane Doe, Captain America, Superman:
\emph{Bibliography item with a very long title: part one},
Some title of a magazine with a very long title, 2009, pages 1234--4321

\bibitem{5}John Doe, Jane Doe, Captain America, Superman:
\emph{Bibliography item with a very long title: part one},
Some title of a magazine with a very long title, 2009, pages 1234--4321

\bibitem{6}John Doe, Jane Doe, Captain America, Superman:
\emph{Bibliography item with a very long title: part one},
Some title of a magazine with a very long title, 2009, pages 1234--4321

\bibitem{7}John Doe, Jane Doe, Captain America, Superman:
\emph{Bibliography item with a very long title: part one},
Some title of a magazine with a very long title, 2009, pages 1234--4321

\bibitem{8}John Doe, Jane Doe, Captain America, Superman:
\emph{Bibliography item with a very long title: part one},
Some title of a magazine with a very long title, 2009, pages 1234--4321

\bibitem{9}John Doe, Jane Doe, Captain America, Superman:
\emph{Bibliography item with a very long title: part one},
Some title of a magazine with a very long title, 2009, pages 1234--4321

\bibitem{10}John Doe, Jane Doe, Captain America, Superman:
\emph{Bibliography item with a very long title: part one},
Some title of a magazine with a very long title, 2009, pages 1234--4321

\end{thebibliography}
\end{document}


As you can see, item 10 is split between two pages. How can I prevent that and force a bibitem to appear on single page?

Don't understand me wrong. My goal is not to fit everything on single page. I just don't like broken entities in my bibliography.

Note that @egreg's proposed solution gives you exactly what you're asking for. However, you may want to reconsider if this is really what you should be asking for. What if a bib entry stretches across 4, 5, or (shudder) even more lines? Do you still want to prohibit any line breaks in such cases, risking the creation of horribly underfull pages? Or, do you just want to tell LaTeX not to create "orphans" (single lines at bottom of page) or "widows" (single lines at top of a page) in a bibliography? To avoid creating typographic widows and orphans may be a more reasonable objective.

Unfortunately (in my view), the main LaTeX document classes set up the thebibliography environment with fairly permissive settings for \widowpenalty and \clubpenalty, of 4000 each. These are the parameters that assign penalties to typographic "widows" and "orphans" (the latter are called "clubs" in TeX jargon). Luckily, these penalties can easily be changed to 10000 -- the functional equivalent of "infinity" -- using the etoolbox package's \AtBeginEnvironment command:

\usepackage{etoolbox}
\makeatletter
\AtBeginEnvironment{thebibliography}{%
\clubpenalty10000
\@clubpenalty \clubpenalty
\widowpenalty10000}
\makeatother


With this addition to your preamble, your bibliography's 10th entry (and any other entries consisting of 3 or fewer lines) will no longer be split across two pages.

Incidentally, if your's is a one-off need, you needn't even bother with the etoolbox package. Just include the following instructions after \begin{thebibliography}{99} and before the first \bibitem instruction:

\makeatletter
\clubpenalty10000
\@clubpenalty \clubpenalty
\widowpenalty10000
\makeatother

• I had a situation in which I had a widow left. Using this code fixed three widows, but one remained. Maybe LaTeX didn't see a way to get rid of it. egreg's solution worked better in the case at hand, but may leave huge gaps in other documents, as you pointed out. So both solutions are useful. Thanks! – Stefan Müller Nov 23 '14 at 18:54

Just add \interlinepenalty=10000 after \begin{thebibliography}:

\begin{thebibliography}{99}
\interlinepenalty=10000

\bibitem{1}John Doe, Jane Doe, Captain America, Superman:
\emph{Bibliography item with a very long title: part one},
Some title of a magazine with a very long title, 2009, pages 1234--4321

...

\end{thebibliography}


This inhibits page breaks inside a paragraph.