编织成pdf时的YAML问题

编织成pdf时的YAML问题,pdf,yaml,r-markdown,rnotebook,tinytex,Pdf,Yaml,R Markdown,Rnotebook,Tinytex,我有一篇用rnotebook写的论文,我想把它编成pdf格式。 这是它的开始,包括YAML: --- title: "Are shifts between points of view challenging for readers? An examination of readers' eye movements in response to Woolf's *To the Lighthouse* and *Mrs Dalloway*" author: "Giulia Grisot, Kath

我有一篇用rnotebook写的论文,我想把它编成pdf格式。 这是它的开始,包括YAML:

---
title: "Are shifts between points of view challenging for readers? An examination of readers' eye movements in response to Woolf's *To the Lighthouse* and *Mrs Dalloway*"
author: "Giulia Grisot, Kathy Conklin, Violeta Sotirova - The University of Nottingham"
date: '`r format(Sys.time(), "%d %B %Y")`'
output:
  html_notebook:
    fig_caption: yes
    force_captions: yes
    #highlight: pygments
    number_sections: false
    theme: readable
# csl: sage-harvard.csl
csl: apa.csl
bibliography: library.bib
link-citations: yes
nocite: | 
  @Grisot2018

---

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

```{r, include=F}
library(tidyverse)
library(ggpubr)
```

# Abstract

The emergence of empirical approaches within stylistics has increased interest in how literary texts are processed by readers. Techniques of speech and thought representation represent an area ripe for empirical investigation in this respect, especially when these cause interpretative ambiguities.
我安装了tinytex,安装了miktex和pandoc。 我曾尝试在RStudio中使用“knit to pdf”命令,但它给了我这个错误,我不知道该怎么办

Error in yaml::yaml.load(..., eval.expr = TRUE) : 
  Scanner error: while scanning for the next token at line 4, column 31 found character that cannot start any token at line 4, column 31
Calls: <Anonymous> ... parse_yaml_front_matter -> yaml_load -> <Anonymous>
Execution halted
yaml::yaml.load(…,eval.expr=TRUE)中的错误: 扫描程序错误:在第4行第31列扫描下一个标记时,在第4行第31列发现无法启动任何标记的字符 电话:。。。解析yaml\u front\u matter->yaml\u load-> 停止执行
我认为这取决于yaml中的格式。当我编写你的代码时,R Studio对标题进行了一些重新格式化,但在此过程中,将日期中的“替换为”,导致了错误。我没有你的.bib文件,因此无法测试你的确切代码,但以下内容对我有效:

---
title: Are shifts between points of view challenging for readers? An examination of
  readers' eye movements in response to Woolf's *To the Lighthouse* and *Mrs Dalloway*
author: "Giulia Grisot, Kathy Conklin, Violeta Sotirova - The University of Nottingham"
date: '`r format(Sys.time(), "%d %B %Y")`'
output:
  pdf_document: default
  html_notebook:
    fig_caption: yes
    force_captions: yes
    number_sections: no
    theme: readable
---

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

```{r, include=F}
library(tidyverse)
#library(ggpubr)
```

# Abstract

我认为这取决于yaml中的格式。当我编写代码R时,Studio对标题进行了一些重新格式化,但在此过程中,将日期中的“替换为”,导致了错误。我没有你的.bib文件,因此无法测试你的确切代码,但以下内容对我有效:

---
title: Are shifts between points of view challenging for readers? An examination of
  readers' eye movements in response to Woolf's *To the Lighthouse* and *Mrs Dalloway*
author: "Giulia Grisot, Kathy Conklin, Violeta Sotirova - The University of Nottingham"
date: '`r format(Sys.time(), "%d %B %Y")`'
output:
  pdf_document: default
  html_notebook:
    fig_caption: yes
    force_captions: yes
    number_sections: no
    theme: readable
---

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

```{r, include=F}
library(tidyverse)
#library(ggpubr)
```

# Abstract