在 github-repo 的 README.md 中引用学术参考文献的简单方法

问题描述

我只是想知道是否有任何简单的方法可以使用 .bib 文件在 github 站点的自述文件中创建学术参考。 在 rmarkdown 中,我习惯于在文本中执行以下操作:

@test2010

如果我在 yaml-header 中指定了正确的 bibtex 文件,它就可以完美运行。

在“正常”的 github markdown 中有没有类似的东西?

解决方法

GitHub Flavored Markdown(GFM) 不支持参考书目。解决方法是从 R Markdown 生成 GFM。

步骤:创建 README.Rmdbibliography.bib 并编织 README.Rmd

README.Rmd

---
output:
  md_document:
    variant: markdown_github
bibliography: bibliography.bib
---

[@xie2018]

bibliography.bib

@Book{xie2018,title = {R Markdown: The Definitive Guide},author = {Yihui Xie and J.J. Allaire and Garrett Grolemund},publisher = {Chapman and Hall/CRC},address = {Boca Raton,Florida},year = {2018},note = {ISBN 9781138359338},url = {https://bookdown.org/yihui/rmarkdown},}

输出README.md

(Xie,Allaire,and Grolemund 2018)

<div id="refs" class="references csl-bib-body hanging-indent">

<div id="ref-xie2018" class="csl-entry">

Xie,Yihui,J. J. Allaire,and Garrett Grolemund. 2018. *R Markdown: The
Definitive Guide*. Boca Raton,Florida: Chapman; Hall/CRC.
<https://bookdown.org/yihui/rmarkdown>.

</div>

</div>