【发布时间】:2020-03-18 12:42:52
【问题描述】:
我正在使用 R rticles 包中的 Elsevier 模板在 Rstudio 中生成 pdf 文档。对于论文,我想包含一个 .png 图像。当我用
加载图像时
一切正常,但是当我将其更改为等效的 knitr 命令时(我更喜欢它,因为它更容易设置无花果大小等)。
{r map, fig.cap="text"}
knitr::include_graphics("images/framework.png")
我收到以下错误:
! Paragraph ended before \Gin@iii was complete.
<to be read again>
当我在 rmarkdown output:pdf_document 中切换到 pdf 的标准输出设置时,knitr 选项确实有效,所以我猜这个问题一定与 rticles 包有关。我在互联网上查看并认为这可能与使用 \graphics 包而不是 \graphicx 乳胶包有关......
https://tex.stackexchange.com/questions/37650/paragraph-ended-before-giniii-was-complete-while-inserting-image-with-inclu
我尝试在 yaml 中添加以下内容:
header-includes:
- \usepackage{graphicx}
但错误仍然存在。
【问题讨论】:
标签: r templates r-markdown