【问题标题】:Why is 'et al' appearing in markdown bibliography?为什么“等”出现在降价参考书目中?
【发布时间】:2013-04-29 23:43:35
【问题描述】:

我正在尝试在 Markdown 中制作参考书目。为了构建参考书目,我使用 R 中的 knitr 包和 pandoc 将 .Rmd 文件转换为 PDF。

我的 .bib 文件中的条目如下所示,取自 http://johnmacfarlane.net/pandoc/demo/biblio.bib:

@Book{item1,
author="John Doe",
title="First Book",
year="2005",
address="Cambridge",
publisher="Cambridge University Press"
}

@Article{item2,
author="John Doe",
title="Article",
year="2006",
journal="Journal of Generic Studies",
volume="6",
pages="33-34"
}

为了构建我的参考书目,我使用了以下函数,取自:http://quantifyingmemory.blogspot.co.il/2013/02/reproducible-research-with-r-knitr.html

knitsPDF <- function(name) {
  library(knitr)
  knit(paste0(name, ".Rmd"), encoding = "utf-8")
  system(paste0("pandoc -o ", name, ".pdf ", name, ".md --bibliography /Users/.../Desktop/test.bib --csl /Users/.../Desktop/taylor-and-francis-harvard-x.csl"))
}

我的 .Rmd 文件的内容是

This is some text [@item1]

This is more text [@item2]

References

输出PDF的内容是:

This is some text (Doe 2005)
This is more text (Doe 2006)

Bibliography
Doe, J. et al., 2005. First Book. Cambridge: Cambridge University Press. 

Doe, J. et al., 2006. Article. Journal of Generic Studies, 6, 33–34.

请注意参考书目中出现的“et al”。为什么 et al 会出现,我该如何阻止它出现?我需要参考书目:

Bibliography
    Doe, J., 2005. First Book. Cambridge: Cambridge University Press. 

    Doe, J., 2006. Article. Journal of Generic Studies, 6, 33–34.

【问题讨论】:

  • 我对 pandoc 没有那么丰富的经验,但你尝试过不同的风格吗?我猜这是您使用的样式的问题。

标签: r knitr pandoc pander


【解决方案1】:

确实,这只是样式文件的问题。下载此样式文件:http://www.zotero.org/styles/harvard-durham-university-business-school

并更改此代码

knitsPDF <- function(name) {
  library(knitr)
  knit(paste0(name, ".Rmd"), encoding = "utf-8")
  system(paste0("pandoc -o ", name, ".pdf ", name, ".md --bibliography /Users/.../Desktop/test.bib --csl /Users/.../Desktop/harvard-durham-university-business-school.csl"))
}

解决了问题

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2023-03-22
  • 1970-01-01
  • 2017-10-01
  • 1970-01-01
  • 1970-01-01
  • 2019-03-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多