cboettig / knitcitations

:package: Generate citations for knitr markdown and html files
http://carlboettiger.info
Other
219 stars 28 forks source link

cleaner/shorter citation calls by key? #10

Closed cboettig closed 11 years ago

cboettig commented 12 years ago

A quick idea that came in my mind is, use deparse() or as.list(match.call()[-1]) inside citep() so that you can get rid of quotes, then use the dot-dot-dot argument; finally you should be able to write citep(Halper2006, Xie2012) - Yihui

cboettig commented 12 years ago

In other words, stick something like this at the start of citep.

> f <- function(...){ L <- as.list(match.call()[-1]); sapply(L, deparse)}
> f(Halpern2006, Xie2012)
[1] "Halpern2006" "Xie2012"    
cboettig commented 12 years ago
cboettig commented 11 years ago

Unlikely to be able to drop the quotations in the call and always parse successfully, particularly now that other data can be added to the citet call, such as the CiTO reason.

Meanwhile, at least the same interface will take a DOI, a bibentry object, a URL, or a character string matching a bibkey, and bibkeys can be assigned at the time of call.