简体   繁体   中英

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

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?

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

Write a bibliography.bib file manually in editor or with a program like JabRef . There are also ways to autogenerate with eg 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, eg 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM