简体   繁体   English

Bookdown中不一致的图形注释行间距渲染pdf

[英]Inconsistent figure note line spacing rendering pdf in Bookdown

I am trying to insert a figure note to render in pdf from the following code chunk: 我正在尝试从以下代码块中插入要在pdf中呈现的图形注释:

``{r boxfreshAe, out.width = c("49%","49%","49%","49%"),fig.align = "center", warning=FALSE, message=FALSE, error=FALSE, fig.pos="H",fig.show = 'hold', fig.cap='(ref:boxfreshAe)', echo=FALSE}

the text note reads like this: 文本注释如下所示:

(ref:boxfreshAe) Forest of Ae - boxplot of fresh example (%) by management example. (ref:boxfreshAe)Ae的森林-按管理示例划分的新示例(%)的箱线图。 A): 0 - 15 cm depth; A):0-15厘米深; B): 15 - 30 cm depth; B):15-30厘米深; C): litter example; C):垃圾例子; D): H horizon. D):H地平线。 Displayed are minimum, twenty-fifth percentile, fiftyeth percentile, seventy-fifth percentile and maximum. 显示的是最小值,第二十五个百分点,五十个百分点,第七十五个百分点和最大值。 Black dots are observations that may be outliers accoring to the rule ± 1.5 * interquartile range, this being determined as as the upper quartile minus the lower quartile [@reference2015]. 黑点是根据规则±1.5 *四分位间距确定的异常值,这被确定为上四分位减去下四分位[@ reference2015]。 Same colour / shape dots are same block replication. 相同的颜色/形状点是相同的块复制。

but also this would work the same: 但这也一样工作:

(ref:boxfreshAe) example example example example example example example example example example example example example example example exampleexample example example example example example example exampleexample example example exampleexample example example example (ref:boxfreshAe)示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例示例

the above chunk contains box-and-whiskers plots and results in a pdf with a figure note that looks like this: 上面的代码块包含箱须图,并生成带有如下图注的pdf文件:


在此处输入图片说明


This is not what I want because the figure is using the layout of the main text of my book which I setup in the index.Rmd with linestretch: 2 . 这不是我想要的,因为该图使用的是我的书的正文的布局,该布局是我在index.Rmd中设置的linestretch: 2

Instead, when I insert a photo the figure note has a reduced line spacing. 相反,当我插入照片时,数字笔记的行距减小了。 I would like this spacing (below) to be also in the figure above. 我希望该间距(下)也在上图中。

(ref:shallow-Hhor) detail of the H horizon in the Control treatment. (ref:shallow-Hhor)对照处理中H水平的详细信息。 This was consistently < 5 cm deep. 深度始终小于5厘米。

```{r shallow-Hhor, out.width = "50%" , fig.align="center",fig.pos="h", fig.cap='(ref:shallow-Hhor)', echo=FALSE}

在此处输入图片说明


Any help is very welcome, many thanks in advance. 任何帮助都非常欢迎,在此先感谢您。

我通过将块选项从fig.pos="H"更改为fig.pos="!h"解决了问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM