0

单击 knit 按钮与 launch 时,我的行为不一致rmarkdown::render。我有一个名为 test.Rmd 的参数化.Rmd

---
title: '`r params$college` report'
params:
  college: 'Art & Business'
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, message = F)
```

```{r}
library(tidyverse)
library(knitr)
library(kableExtra)
```

```{r}
mtcars %>% 
 kable( format = 'latex',  longtable = T, booktabs = T) %>% 
  kable_styling(bootstrap_options = "condensed", font_size = 8) %>% 
  landscape(margin = c('1cm')) 
```

如果我单击编织按钮,文件就会编织。但是,如果我使用以下命令从控制台编织:

rmarkdown::render('test.Rmd', 
                               params = list(college = 'Art and Business'),
                               output_format = 'pdf_document')

我收到以下错误:

/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test.tex --template /Library /Frameworks/R.framework/Versions/3.4/Resources/library/rmarkdown/rmd/latex/default-1.17.0.2.tex --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable '几何:边距=1in'!LaTeX 错误:环境景观未定义。

错误:无法编译 test.tex。有关更多信息,请参阅 test.log。

4

0 回答 0