在RMmarkdown中包含整个书目条目--相当于\fullcite?

问题描述 投票:0回答:1

有没有一种方法可以在我的Rmarkdown文档的正文中包含整个书目条目? 如果我使用 LaTeX,我会使用 \fullcite{Smith2000}. 然后它会打印,无论我想在哪里。

Smith, J. 2000. 一本好书. 牛津大学出版社。牛津大学出版社。

下面是一个示例.Rmd文件

---
title: "hi"
author: "dmt"
date: "30/04/2020"
output: html_document
bibliography: bib.bib
biblio-style: apalike
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown


```{r cars}
summary(cars)
```

Here is the citation of a book I am reading:

@Smith2000

But I would like to put the whole reference here like this: 

Smith, J. 2000. A nice book. Oxford: Oxford University Press.

How can I do this without writing it out?

而这里是一个样本.bib文件。

@book{Smith2000,
    Address = {Oxford},
    Author = {Smith, J},
    Date-Added = {2020-04-30 17:03:32 +0100},
    Date-Modified = {2020-04-30 17:04:03 +0100},
    Publisher = {Oxford University Press},
    Title = {A nice book},
    Year = {2000}}
latex r-markdown knitr biblatex
1个回答
3
投票

这对我来说很好用。

在你的RMD文件中执行这一部分:

```{r, echo=FALSE}
biblio <- bibtex::read.bib("bib.bib")
```

然后你可以在你的脚本中使用下面这行:

`r capture.output(print(biblio["Smith2000"]))`
© www.soinside.com 2019 - 2024. All rights reserved.