Reduce whitespaces in PDF book built in bookdown using bookdown::pdf_book

Hi all,

When I build a book in pdf format using the bookdown::pdf_book, there are large whitespaces (see the image below) throughout the book. What would be the best approach to reduce the size of the whitespaces?

My book repository is here and the latex preamble is here

Looking forward to your kind reply and guidance.


It looks to me like there isn't room for the next figure to fit on that page, so it gets pushed to the next page. Isn't that what you want?