本文介绍了引用rmd文件中的引用& pandoc-citeproc.exe中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次要在rmd文件中使用引文,但我不知道该怎么做.我将rmd文件转换为pdf文档,但是在生成参考书目和书目时遇到了问题.编织时出现此错误:

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:

这是我的Yaml上下文:

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}

并且我在rmd文件的最后一部分中列出了这样的引用:

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.}

在我的上下文中,我都将其引用为[@ Csardi2006].有解决这个问题的主意吗?更具体地说,如何引用rmd文件?

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?

推荐答案

也许您需要将bibliography.bib文件放入您的工作目录中,或将您的参考书目列在头部,例如参考书目:

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:

在编辑器中或使用 JabRef 之类的程序手动编写bibliography.bib文件.还有其他方法可以自动生成佐特罗:

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{...}

将其另存为"bibliography.bib"到您的工作目录中.

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

带有书目的YAML元数据:

The YAML metadata with bibliography:

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

或包含引用的YAML元数据,例如快速投稿:

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
---

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

这篇关于引用rmd文件中的引用& pandoc-citeproc.exe中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 01:57