变更参考文献样式

9

我正在使用markdown编写我的简历,并希望有多个参考文献部分(一个用于期刊文章,另一个用于书籍章节等)。 我使用RefManagerR软件包来实现这一点,效果非常好。

library("RefManageR")
BIB <- structure(list(structure(list(title = "Quantitative palaeotemperature records inferred from fossil pollen and chironomid assemblages from Lake Gilltjarnen, northern central Sweden", author = structure(list(structure(list(given = "K", family = "Antonsson", role = NULL, email = NULL, comment = NULL), .Names = c("given", "family", "role", "email", "comment")), structure(list(given = "SJ", family = "Brooks", role = NULL, email = NULL, comment = NULL), .Names = c("given", "family", "role", "email", "comment")), structure(list(given = "H", family = "Seppa", role = NULL, email = NULL, comment = NULL), .Names = c("given", "family", "role", "email", "comment"))), class = "person"), journal = "Journal of Quaternary Science", year = "2006", number = "8", pages = "831-841", volume = "21"), .Names = c("title", "author", "journal", "year", "number", "pages", "volume"), bibtype = "Article", key = "RID:0428130725771-5", dateobj = structure(1136070000, class = c("POSIXct", "POSIXt"), tzone = "", day.mon = 0L))), strings = structure(character(0), .Names = character(0)), class = c("BibEntry", "bibentry"))

NoCite(BIB)
PrintBibliography(BIB, .opts = list(style = "latex", bib.style = "authoryear", 
                                    sorting = "ydnt"))

在pdf中呈现为:

Antonsson, K,S. Brooks和H. Seppa(2006)。 “Quantitative palaeotemperature records inferred from fossil pollen and chironomid assemblages from Lake Gilltjarnen, northern central Sweden”. In:Journal of Quaternary Science 21.8,pp. 831-841。

我想改变参考文献的风格。基本上,我想删除引号和In:,并在名称后加上缩写。我知道可以使用tools :: bibstyle来设置样式,并且需要创建一个名为formatArticle的程序,但是tools :: bibstyle的示例仅显示如何更改排序顺序,我无法找到如何查看默认的JSS样式。

请问有人能向我展示如何使用bibstyle吗?

或者,有人能向我展示如何使用内置于rmarkdown的参考书目生成器在单个文档中制作多个参考书目部分,以便我可以使用csl文件吗?


1
据我所见,目前在使用RefManageR时还没有这个选项。不过提高使用bibstyles的灵活性已经在计划中了。 - Martin Schmelzer
你打算使用除了 pdf 之外的输出格式吗?如果不是的话,你可以直接使用 latex 来实现你想要的效果,尽管你需要驯服那个野兽,并根据个人经验,这并不是一件有趣的事情。 - Kevin Arseneau
1个回答

1

仅回答多个部分中关于参考文献的部分: 如果您想“使用内置于rmarkdown的参考文献生成器”进行操作,则需要更改用于从Rmarkdown文件生成pdf的latex模板。在YAML部分设置模板,例如:

output:
  pdf_document:
    template: mytemplate.tex    

有关如何使用模板的参考资料

更简单的方法是在RMarkdown文件中添加多个部分,并打印出参考文献。以下是一个.Rmd文件的示例:

---
title: "2 bibs"
output: pdf_document
---

```{r init, echo=FALSE}
library("RefManageR")

## loading some bib entries from example file
file <- system.file("Bib", "biblatexExamples.bib", package = "RefManageR")
BibOptions(check.entries = FALSE)
bib <- ReadBib(file)

## Gerating the entries for the 2 sections
bib1 = bib[[5:6]]
bib2 = bib[[7:8]]
```

Intro text.

# Bib 1

```{r, results='asis', echo=FALSE}
NoCite(bib1)
PrintBibliography(bib1, .opts = list(style = "markdown", bib.style = "authoryear", sorting = "ydnt"))
```

# Bib 2

```{r, results='asis', echo=FALSE}
NoCite(bib2)
PrintBibliography(bib2, .opts = list(style = "markdown", bib.style = "authoryear", sorting = "ydnt"))
```

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接