I'm making an annotated bibliography like the following MWE, thanks to moewe's answer. I would like to prevent a page break in a bib item, though the page break between the items is tolerable. A similar question has already been resolved, but the question and answers seems to be related to natbib and I need solutions for biblatex.
I tried to use wrap an item with vbox, but in vain.
Do you have any idea?
MWE
\documentclass{article}
\usepackage[backend = biber, style = apa, citestyle = numeric]{biblatex}
\renewbibmacro*{annotation}{%
\ifboolexpr{ test {\iffieldundef{annotation}}
or not togl {bbx:annotation}}
{}
{\begingroup
\togglefalse{blx@bibliography}%
\newline
\setunit{}%
\printfield{annotation}%
\endgroup}
\iffieldundef{abstract}
{}
{\begingroup
\togglefalse{blx@bibliography}%
\setunit{%
\par
\vspace{0.5\baselineskip}}%
\bibstring[\mkbibbold]{abstract}%
\setunit{\newline}%
\printfield{abstract}%
\endgroup}}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\defbibenvironment{bibliography}
{\list
%\vbox{
{\printtext[labelnumberwidth]{%
\printfield{labelprefix}%
\printfield{labelnumber}}}
{%\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}% %\bibitemsep
\setlength{\parsep}{\bibparsep}%
\setlength{\itemindent}{0\labelsep}%
\setlength{\listparindent}{0\labelsep}%
}%
\renewcommand*{\makelabel}[1]{\hss##1}}
%}
{\endlist}
{\item}
\begin{filecontents}{\jobname.bib}
@Manual{R-rmarkdown,
title = {rmarkdown: Dynamic Documents for {R}},
author = {JJ Allaire and Yihui Xie and Jonathan McPherson
and Javier Luraschi and Kevin Ushey and Aron Atkins
and Hadley Wickham and Joe Cheng and Winston Chang
and Richard Iannone},
year = {2020},
note = {R package version 2.3},
url = {https://github.com/rstudio/rmarkdown},
abstract = {This is a good book. That's why I cite this.
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.}
}
@Book{knitr2015,
title = {Dynamic Documents with {R} and knitr},
author = {Yihui Xie},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2015},
edition = {2nd},
note = {ISBN 978-1498716963},
url = {https://yihui.org/knitr/},
abstract = {This is a good book. That's why I cite this.
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{R-rmarkdown, knitr2015}
\printbibliography[title=References]
\end{document}
