【发布时间】:2022-12-07 04:50:43
【问题描述】:
我收到以下错误
! Paragraph ended before \Gin@ii was complete.
<to be read again>
\par
l.398
当尝试将 Rstudio 中的以下 Rmarkdown 编织成 pdf 时,它涉及定义 \includegraphics 的变体。
---
title: "Test"
output:
pdf_document:
latex_engine: lualatex
keep_tex: yes
html_document: default
date: "2022-12-06"
header-include:
- usepackage{graphicx}
---
\newcommand\IG[1]{\includegraphics[width = \textwidth]{#1}}
\IG{test.png}
奇怪的是,当我通过 lulatex 执行时,tex 输出编译正确外部Rstudio 的(是的,我必须在这里使用 lualatex)。
该错误似乎与https://tex.stackexchange.com/questions/37650/paragraph-ended-before-giniii-was-complete-while-inserting-image-with-inclu 和Rmarkdown Error: "! Paragraph ended before \@fileswith@ptions was complete" 有关,但那里的解决方案都没有帮助,我无法弄清楚我的情况出了什么问题。
编辑:奇怪的是,错误似乎来来去去。我有时会得到它,但其他人不会(我只是重新运行上面的代码,这次它通过了)。
【问题讨论】:
标签: pdf r-markdown rstudio knitr