citing references in a rmd file & error in pandoc-citeproc.exe

Deadly 提交于 2019-12-20 01:58:23

问题


This is my first time that I want to use citations in my rmd file and I don't know how can I do it exactly. I converted my rmd file to pdf document, but I have problem in generating reference and bibliography. I get this error while knitting:

pandoc-citeproc.exe: Could not find bibliography.bib pandoc.exe: Error running filter pandoc-citeproc Filter returned error status 1 Error: pandoc document conversion failed with error 83

This is my yaml context:

>     title: "Context"
>     author: "Minoo"
>     date: "2017/06/06"
>     output: 
>       pdf_document:
>         toc: true
>         toc_depth: 3
>     bibliography: bibliography.bib
>     vignette: >
>       %\VignetteIndexEntry{Context}
>       %\VignetteEngine{knitr::rmarkdown}
>       %\VignetteEncoding{UTF-8}

and I have listed my citations like this in the last part of my rmd file:

@article{@Csardi2006, Csardi G, Nepusz T: The igraph software package for complex network research, InterJournal, Complex Systems 1695. 2006. http://igraph.org}
@article{@Butts2015, Butts C (2015). network: Classes for Relational Data. The Statnet Project (http://statnet.org). R package version 1.13.0, http://CRAN.R-project.org/package=network.}
@article{@Butts2008, Butts C (2008). “network: a Package for Managing Relational Data in R.” Journal of Statistical Software, 24(2). http://www.jstatsoft.org/v24/i02/paper.}

I either cite them in my contexts as [@Csardi2006]. Any idea to solve this problem? More specifically,how can I cite in a rmd file?


回答1:


Perhaps you need either to place a bibliography.bib file into your working directory or list your bibliography into the head, e.g. for bibliography:

Write a bibliography.bib file manually in editor or with a program like JabRef. There are also ways to autogenerate with e.g. Zotero:

% Encoding: UTF-8
    @article{csardi2006,
      author  = {G, Csardi and T, Nepusz},
      title   = {The igraph software package for complex network research},
      journal = {InterJournal, Complex Systems},
      year    = {2006},
      url     = {http://igraph.org},
    }
    @article{...}
    @article{...}

Save it into your working directory as "bibliography.bib".

The YAML metadata with bibliography:

---
title: "Context"
author: "Minoo"
date: "June 13, 2017"
output:
  pdf_document: default
  html_document: default
bibliography: bibliography.bib
---

Or YAML metadata with inclusion of references, e.g. for quick papers:

---
title: "Context"
author: "Minoo"
date: "June 13, 2017"
output:
  pdf_document: default
  html_document: default
references:
- id: csardi2006
  author:
  - family: Csardi
    given: G.
  - family: Nepusz
    given: T.
  publisher: InterJournal, Complex Systems
  title: The igraph software package for complex network research
  type: article-journal
  issued:
    year: 2006
---

Text section of RMD:

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

## Text

Lorem ipsum dolor sit amet [@csardi2006], consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam

## Biblio


来源:https://stackoverflow.com/questions/44520138/citing-references-in-a-rmd-file-error-in-pandoc-citeproc-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!