latex - 包括 RMarkdown 中的整个书目条目 - 相当于 \fullcite?
问题描述
有没有办法在我的 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}}
解决方案
这对我来说很好:
在你的 RMD 文件中执行这个块:
```{r, echo=FALSE}
biblio <- bibtex::read.bib("bib.bib")
```
然后,您可以在脚本中使用以下行:
`r capture.output(print(biblio["Smith2000"]))`
推荐阅读
- javascript - 如果字段具有默认值,如何使用验证插件对输入字段进行必需
- sqlite - 如何使用 sqlite-net 扩展“https://bitbucket.org/twincoders/sqlite-net-extensions”?
- python - 在考虑深度学习方法时,我的 ROC 曲线有什么问题?
- mysql - 如何为模型中的所有选择查询定义默认 where 条件?
- kubernetes - 如何在 windows 机器上安装 kubernetes 二进制文件(包括 kubelet、kubctl、kubeadm)
- ruby-on-rails - Rails 3:仅将特定用户重定向到新应用程序,而其他人应该能够访问旧应用程序
- c# - Net Core API:分配数组名称并在 Angular 中显示
- node.js - 如何解决console.log in express的问题
- groovy - 如何确定列表排序的方法
- ios - 在 xcode 10 中切换通话栏拉伸初始屏幕默认徽标?