问题
I'd like to cite an author in RMarkdown adding a possessive 's to his name. However, I cannot find a way to cite the author without the year of publication or to directly add a possessive 's.
It should look like this:
In Fenner's (2012) book ...
Minimal Working Example (for a 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
Of course, I could add the name manually (In Fenner's [-@fenner2012a] book ...
) but this is a sloppy workaround.
Is there another way?
回答1:
I don't know about RMarkdown, but in standard pandoc I've added the following filter directly after pandoc-citeproc.
#!/bin/bash
sed -s 's/\({"t":"Space"}\),\({"t":"Str","c":"(2013)"}]]}\),\({"t":"Str","c":"\x27s"}\)/\3,\1,\2/g'
It is horrible, and probably very delicate (and no good if you're on Windows), but it might put you on the right track.
Your citation would become "in @fenner2012a's book".
来源:https://stackoverflow.com/questions/44901308/cite-author-only-in-rmarkdown-add-possessive-s-to-in-text-citation