1

How can I avoid page break in bibliography when bibsep is used from natbib package? Indeed, it seems that page breaking happens only when I define bibsep with setlenght.

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage[numbers,sort&compress]{natbib} % To create fancy citations from bibliography
   \setlength\bibsep{0.5\baselineskip} % vertical space between each item
\bibliographystyle{abbrvnat}

\begin{document}
\section{Introduction}
\newpage

\nocite{*} % adds all entries in the bib file to the bibliography
\bibliography{biblio} % compile with bibtex
\end{document}

This give me

enter image description here

enter image description here

And does not happen when I do not use it.

  • try to use \usepackage{etoolbox} \patchcmd{\thebibliography}{\clubpenalty4000}{\clubpenalty10000}{}{} \patchcmd{\thebibliography}{\widowpenalty4000}{\clubpenalty10000}{}{} in the begining of the document... It may help. I found it here: https://tex.stackexchange.com/questions/91686/preventing-page-breaks-from-occurring-in-bibliography-items (not-tested) – koleygr Jun 19 '17 at 17:28
  • Already tried, it does not work... – Anthony T. Jun 19 '17 at 18:26

2 Answers2

2

You can set all interline penalties to 10000:

\begin{filecontents*}{\jobname.bib}
@article{a,
  author={A. Aaa},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2001,
}
@article{b,
  author={B. Bbb},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2002,
}
@article{c,
  author={C. Ccc},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2003,
}
@article{d,
  author={D. Ddd},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2004,
}
@article{e,
  author={e. Eee},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2005,
}
@article{f,
  author={F. Fff},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2006,
}
@article{g,
  author={G. Ggg},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2007,
}
@article{h,
  author={H. Hhh},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2008,
}
@article{i,
  author={I. Iii},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2009,
}
@article{j,
  author={J. Jjj},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2010,
}
@article{k,
  author={K. Kkk},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2011,
}
@article{l,
  author={L. Lll},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2012,
}
@article{m,
  author={M. Mmm},
  title={\lipsum*[2-3]},
  journal={Journal},
  year=2013,
}
\end{filecontents*}

\documentclass{article}
%\usepackage[utf8]{inputenc}

\usepackage[numbers,sort&compress]{natbib} % To create fancy citations from bibliography
\usepackage{etoolbox}
\usepackage{lipsum}

\setlength\bibsep{0.5\baselineskip} % vertical space between each item
\bibliographystyle{abbrvnat}

\patchcmd{\thebibliography}
  {\clubpenalty 4000\widowpenalty 4000}
  {\clubpenalties 1 10000 \widowpenalties 1 10000 }
  {}{}


\begin{document}
\section{Introduction}
\newpage

\nocite{*} % adds all entries in the bib file to the bibliography

\bibliography{\jobname} % compile with bibtex
\end{document}
egreg
  • 1,121,712
  • Thank you for this, I tried many suggested solutions to this problem (e.g. wrapping in minipages, redefining thebibliography, ...) but yours was the only one that worked for my specific use case (> 300 references). I just included the etoolbox package and added your \patchcmd{...}. Works great! – peanutman Feb 05 '19 at 13:06
1

Use

\usepackage[sectionbib]{natbib}
Mensch
  • 65,388
Yingjie
  • 11