[Tex/LaTex] Preventing page breaks from occurring in bibliography items

bibliographiespage-breaking

Using Bibtex and Natbib, does anyone know how to prevent a pagebreak from occurring mid-item?

I would like the bibliography to either:

  • Put an entire record on a given page, or
  • Carry the record over to the following page.

I DONT want the bibliography to:

  • Break a record halfway through the actual record so that part is on one page, and part on the next.

My bibliography has 6+ pages of records, so I am talking about breaks midway through an INDIVIDUAL record, not through the actual bibliography, which is inevitable and perfectly fine.

My bibliography is in a multicol environment, sample to follow:

Output

In the above, you can see that item 186 and 212 are not complete, therefore, would like them to start on the next column and next page respectively.

MWE for the bibliography as follows:

\bibliographystyle{BSTFILE} %my style file.
\newcommand*{\doi}[1]{\href{http://dx.doi.org/\detokenize{#1}}{\raggedright\mybibdoicolor{DOI: \detokenize{#1}}}} %format DOI's
\setlength{\bibsep}{0.0pt} %separation
\def\mybibfontsize{\small} %fontsize
\def\mybibnumbercolor{gray} %define number color
\renewcommand{\bibnumfmt}[1]{\color{\mybibnumbercolor}[\textbf{#1}]}  %change color of number
\addcontentsline{toc}{chapter}{References} %add to toc

\begin{multicols}{2}{
    \mybibfontsize\bibliography{BIBLIOGRAPHY}
}
\end{multicols}

Best Answer

Typically bst files provides definition for the various entry type where the first call is to the function output.bibitem and the last on to the function fin.entry. Thus to wrap whole \bibitems in minipage we can add hooks to such functions. The code below illustrates the changes.

FUNCTION {output.bibitem}
{ newline$
  "\begin{minipage}{\textwidth}" write$
  newline$
  "\bibitem[{" write$
  label write$
  ")" make.full.names duplicate$ short.list =
     { pop$ }
     { * }
   if$
  "}]{" * write$
  cite$ write$
  "}" write$
  newline$
  ""
  before.all 'output.state :=
}

FUNCTION {fin.entry}
{ add.period$
  write$
  newline$
  "\end{minipage}" write$
  newline$
}

We introduced

newline$
"\begin{minipage}{\textwidth}" write$

at the begin of the function output.bibitem and

"\end{minipage}" write$
 newline$

at the end of the function fin.entry.