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

后端 未结 1 871
梦毁少年i
梦毁少年i 2021-01-20 20:01

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 g

相关标签:
1条回答
  • 2021-01-20 20:40

    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
    
    0 讨论(0)
提交回复
热议问题