简体   繁体   English

rmarkdown 和 pandoc 参考问题

[英]rmarkdown and pandoc reference problems

I have the following rmarkdown file to render (just an example of the full article):我有以下要渲染的 rmarkdown 文件(只是完整文章的一个示例):

---
title: 'Some Title'
author: 'Author Surname'
biliography: ab.bib
csl: abnt_italico.csl
output:
  bookdown::word_document2:
    fig_width: 4
    fig_height: 3
    fig_caption: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Introdução 

 Some text [@la01] some text

#References

My ab.bib is:我的 ab.bib 是:

@incollection{la01,
  title = {Videogames and {{Literacies}}},
  booktitle = {The {{Routledge Handbook}} of {{Literacy Studies}}},
  author = {Abrams, Sandra Schamroth},
  editor = {Rowsell, Jennifer and Pahl, Kate},
  year = {2015},
  pages = {251--266},
  publisher = {{Routledge Handbooks Online}},
  doi = {10.4324/9781315717647.ch16},
  file = {/Volumes/GoogleDrive/My Drive/biblioteca_digital/pdf_categorizados/abrams_2015_.pdf},
  isbn = {978-0-415-81624-3 978-1-315-71764-7 978-1-317-51061-1},
  keywords = {Literacy,Multimodality,SFL,Systemic Functional Linguistics,Systemic-Functional Linguistics,Videogames},
  language = {en}
}

Despite of the fact that my *bib file and my csl file are in the same directory as my Rmd file, I have the following error:尽管我的 *bib 文件和我的 csl 文件与我的 Rmd 文件位于同一目录中,但我有以下错误:

==> rmarkdown::render('/Volumes/GoogleDrive/My Drive/Profissional/Pesquisa/Artigos/livro_kleber_2020/artigo/v01_livro.Rmd',  encoding = 'UTF-8');


processing file: v01_livro.Rmd
  |.......................                                               |  33%
  ordinary text without R code

  |...............................................                       |  67%
label: setup (with options) 
List of 1
 $ include: logi FALSE

  |......................................................................| 100%
  ordinary text without R code


output file: v01_livro.knit.md

pandoc-citeproc: reference la01 not found
/usr/local/bin/pandoc +RTS -K512m -RTS v01_livro.utf8.md --to docx --from markdown+autolink_bare_uris+tex_math_single_backslash+smart --output v01_livro.docx --highlight-style tango --lua-filter /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/lua/pagebreak.lua 

Output created: v01_livro.docx

No list of references is generated whatsoever.不会生成任何参考列表。 Could anyone tell me if there is anything wrong?谁能告诉我有什么问题吗?

Update I also tried with no success:更新我也试过没有成功:


title: 'Some Title'
author: 'Author Surname'
biliography: 'ab.bib'
csl: 'abnt_italico.csl'
output:
  bookdown::word_document2:
    fig_width: 4
    fig_height: 3
    fig_caption: true
---

It seems you don't indicate the correct path in the header.您似乎没有在 header 中指明正确的路径。

You said that " bib file and my csl file are in the same directory as my Rmd file ", so, the correct header have to include:您说“ bib 文件和我的 csl 文件与我的 Rmd 文件位于同一目录中”,因此,正确的 header 必须包括:

bibliography: ./ab.bib  
csl: ./abnt_italico.csl 
# please, note the './' characters, for both, and the absence of quoting marks (" or '). 

PS: you don't have to quote bibliography: ./ab.bib and csl: ./abnt_italico.csl : correct header-style is like the first code-sample you provided, not the second one (your update). PS:您不必引用bibliography: ./ab.bibcsl: ./abnt_italico.csl :正确的标题样式就像您提供的第一个代码示例,而不是第二个(您的更新)。

Excellent day很棒的一天

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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