作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用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"))
Antonsson, K, S. Brooks and 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内置的书目生成器”进行操作,则需要更改用于从Rmarkdown文件生成pdf的 latex 模板。在YAML部分设置模板,如下所示:
output:
pdf_document:
template: mytemplate.tex
.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"))
```
关于r - 改变书目风格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46141683/
我是一名优秀的程序员,十分优秀!