编织到vitae预定义的简历模板时,降价vitae软件包“未定义的控制顺序”错误

时间:2019-10-03 10:05:12

标签: r latex r-markdown knitr tinytex

在R markdown中,编织“ vitae”包中包含的任何现成的cv模板(awesomecv,moderncv等)时,出现“未定义的控制序列”错误。我正在使用tinytex。这是我执行的即用型代码(太长,无法将整个内容包含在SO帖子中,因此删除了“出版物”部分):

---
address: School of Physics & Chemistry, cole Normale Suprieure
date: "`r format(Sys.time(), '%B %Y')`"
email: Marie.Curie@ens.fr
github: mariecurie
linkedin: mariecurie
name: Marie
output:
  pdf_document: default
  vitae::awesomecv: default
phone: +1 22 3333 4444
position: Professor
surname: Curie
twitter: mariecurie
www: mariecurie.com
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
library(vitae)
```

# Some stuff about me

 * I poisoned myself doing research.
 * I was the first woman to win a Nobel prize
 * I was the first person and only woman to win a Nobel prize in two different sciences.

# Education


# Nobel Prizes

```{r}
library(tibble)
library(vitae)
tribble(
  ~Year, ~Type, ~Desc,
  1903, "Physics", "Awarded for her work on radioactivity with Pierre Curie and Henri Becquerel",
  1911, "Chemistry", "Awarded for the discovery of radium and polonium"
) %>% 
  brief_entries(
    glue::glue("Nobel Prize in {Type}"),
    Year, 
    Desc
  )
```

# Publications
...

这是我得到的错误:

! Undefined control sequence.
l.104 \briefsection
                   {\briefitem{Nobel Prize in Physics}{1903}{Awarded for her...

Error: Failed to compile filename.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See filename.log for more info.
Execution halted

我正在Windows> = 8 x64和RStudio上使用R版本3.6.1(2019-07-05)。

1 个答案:

答案 0 :(得分:2)

您首先在YAML标头的pdf_document部分列出output。这意味着它是默认的输出格式。看来vitae软件包生成的代码需要pdf_document中没有自动包含的LaTeX软件包。

但是,当我将订单切换到

output:
  vitae::awesomecv: default
  pdf_document: default

默认为vitae::awesomecv格式,在这种格式下,一切正常。如果您使用的是RStudio,还可以使用Knit上的下拉菜单,通过单击Knit to awesomecv自动进行此交换。

经过编辑以添加:实际上,如注释中所指出的,完全删除pdf_document行可能是有意义的,在这种情况下,可以简化为

output: vitae::awesomecv