1

我有一篇用 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
4

1 回答 1

0

我认为这取决于您的 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
于 2019-07-10T15:40:59.680 回答