【问题标题】:Image size control in Rmarkdown pdf generation with latex使用乳胶生成 Rmarkdown pdf 中的图像大小控制
【发布时间】:2015-12-11 08:10:42
【问题描述】:

我正在使用 Rmarkdownv2 生成带有一些本地图像的 pdf 文件。但与 html 相比,似乎在渲染的 pdf 中,图像被转换为​​更大的尺寸,分辨率更低。我目前用于图像的代码类似于: ![alt text](figures/fig1.png)

有什么方法可以控制 pdf 中的图像大小?我也试过了

pdf_document: fig_height: 1 fig_width: 2

但这没有用。提前致谢。

【问题讨论】:

    标签: r latex knitr r-markdown


    【解决方案1】:

    您可以使用development version of knitr (>= v1.11.22) 和include_graphics() 函数,例如

    ```{r out.width='70%'}
    knitr::include_graphics('figures/fig1.png')
    ```
    

    如果你想要一个图形标题,只需使用块选项fig.cap = 'A figure caption.'

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-02-24
      • 2010-09-12
      • 1970-01-01
      • 1970-01-01
      • 2017-02-26
      • 2018-12-28
      • 1970-01-01
      相关资源
      最近更新 更多