【问题标题】:Rmarkdown to word document-how to align the image (a picture) as centerRmarkdown转word文档-如何将图片(一张图片)居中对齐
【发布时间】:2018-05-28 10:10:10
【问题描述】:

我正在编辑一个 rmd 文件,它将编织到一个 word 文档,我想知道如何将图像(图片)对齐为中心,当我将它插入 rmd 文件并 kint 到 word 时,图像对齐为光。

当我在代码中使用 fig.align='center' 时,

```{r color, echo=FALSE, fig.cap=figs("color")}
   knitr::include_graphics("../img/color.png")
```

它提示我:

警告信息: 在 hook_plot(x[i], reduce_plot_opts(options)) : Word 输出不支持块选项 fig.align、out.width、out.height、out.extra

【问题讨论】:

标签: r markdown r-markdown


【解决方案1】:

一种解决方案是使用 officedown 并像这样设置您的 YAML 标头:

---
output:
  officedown::rdocx_document:
    plots: 
      align: center
      
---

我相信中心是officedown::rdocx_document的默认设置

【讨论】:

    猜你喜欢
    • 2016-06-14
    • 2014-01-09
    • 2012-07-16
    • 1970-01-01
    • 2013-02-05
    • 2023-03-07
    • 1970-01-01
    • 1970-01-01
    • 2015-07-26
    相关资源
    最近更新 更多