上一页中的大图形和白线 (bookdown/Rmarkdown)

Big graphic makes and white lines in previous page (bookdown/Rmarkdown)

我在我的 rmd 两个段落之间添加了一个大的 PNG(高,与 A4 纸具有相似的纵横比)图像,使用以下块(标题是这样制作的,因为它将包含引用):

(ref:cap-etlm) The ETLM.
```{r etlm, results = "asis", echo = FALSE, fig.cap = "(ref:cap-etlm)",  out.width='\textwidth'}
include_graphics("figures/etlm.png")
````

问题是,在生成pdf输出时,前一页变得稀疏,有很多空行(以红线显示):

如果图像没有占据整个页面但足够大,也可能是这种情况。

如何让一些文本(在 rmd 中,在 chunk/its 引用之后写的)出现在图像之前?

提前致谢。

编辑:

This Gist is rmd of a minimal reproducible example (updated screenshot). It also requires csl files, etc., which are in a zip file here on TinyUpload.

您的文件 template.tex 包含以下行:

\usepackage{float}
\floatplacement{figure}{H}

这会强制 LaTeX 将图形始终放置在此处,即它们被定义的位置。删除这两行可以解决我的问题。