我想引用 RMarkdown 中的一位作者在他的名字中添加所有格。但是,我无法在没有出版年份的情况下引用作者或直接添加所有格。
它应该是这样的:
In Fenner's (2012) book ...
最小工作示例(针对 R Notebook):
---
title: "R Notebook"
output: html_notebook
references:
- id: fenner2012a
title: One-click science marketing
author:
- family: Fenner
given: Martin
container-title: Nature Materials
volume: 11
URL: 'http://dx.doi.org/10.1038/nmat3283'
DOI: 10.1038/nmat3283
issue: 4
publisher: Nature Publishing Group
page: 261-263
type: article-journal
issued:
year: 2012
month: 3
---
In @fenner2012a 's book ...
# References
当然,我可以手动添加名称(在 Fenner 的 [-@fenner2012a] 书中 ...
),但这是一个草率的解决方法。
还有别的办法吗?
最佳答案
我不知道 RMarkdown,但在标准的 pandoc 中,我在 pandoc-citeproc 之后直接添加了以下过滤器。
#!/bin/bash
sed -s 's/\({"t":"Space"}\),\({"t":"Str","c":"(2013)"}]]}\),\({"t":"Str","c":"\x27s"}\)/\3,\1,\2/g'
这太可怕了,而且可能非常微妙(如果你在 Windows 上就不好),但它可能会让你走上正轨。
您的引用将变成“在@fenner2012a 的书中”。
关于markdown - 仅在 RMarkdown 中引用作者/将所有格添加到文本引用中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44901308/