簡體   English   中英

如何在R Markdown中改變biblatex中的引用風格?

[英]How to change citation style in biblatex in R Markdown?

citation_package: biblatex包含在.Rmd文件的YAML中時,是否可以指定引用樣式? 我在各種R降價手冊中找不到任何相關信息。

此問題已於20163月解決。 由於很多文檔都是在此之前編寫的,因此並不總是出現在指南中。 但是,rmarkdown上的NEWS文件始終是檢查新功能的好地方。

您可以在YAML中使用biblio-style參數。 如果你熟悉乳膠,這基本上填寫了\\usepackage[style= *SELECTED STYLE*]{biblatex} 這是一個例子。 它將為您構建一個單獨的.bib文件:

---
output: 
  pdf_document:
    citation_package: biblatex
keep_tex: TRUE
bibliography: test.bib
---

```{r}
knitr::write_bib(x = c("knitr", "rmarkdown") , file = "test.bib")
```

Some ref [@R-knitr]

Another ref [@R-rmarkdown]

# References

這輸出: 在此輸入圖像描述

添加biblio-style參數:

---
output: 
  pdf_document:
    citation_package: biblatex
keep_tex: TRUE
bibliography: test.bib
biblio-style: authoryear
---

```{r}
knitr::write_bib(x = c("knitr", "rmarkdown") , file = "test.bib")
```

Some ref [@R-knitr]

Another ref [@R-rmarkdown]

# References

在此輸入圖像描述

要了解有關您可以使用的不同樣式的更多信息,請訪問: https//www.sharelatex.com/learn/Biblatex_citation_styles

更進一步 :YAML只提供對biblio風格的一定程度的控制。 例如,您無法直接指定citestyle 如果你想進一步改變biblatex風格,你需要編輯pandoc模板: https//github.com/rstudio/rmarkdown/blob/master/inst/rmd/latex/default-1.15.2.tex 這有點高級,所以只有在您熟悉LaTex時才推薦它: https ://rmarkdown.rstudio.com/pdf_document_format.html#custom_templates

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM