cboettig / knitcitations

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

max.names not used in citep #65

Open RemkoDuursma opened 9 years ago

RemkoDuursma commented 9 years ago
options(citation_format = "text", max.names=2)
citep("10.3832/ifor0901-006")

gives

"(Henry, Bombelli, Trotta, Alessandrini, Birigazzi, Sola, Vieilledent, Santenoise, Longuetaud, Valentini, Picard, and é, 2013)"

This also happens with citep when citing a bibentry from a local .bib file. Using version 1.0.2 (have tried Windows and Mac)

cboettig commented 9 years ago

Thanks, that's actually a bug in the documentation. The current setting is supposed to use all the authors the first time, and then only the max.names on subsequent calls. Maybe that's not a desirable default, I don't know. See if you just adding a non-displayed chunk with citep("10.3832/ifor0901-006") somewhere earlier on makes it respect the max.names flag on the second call?

RemkoDuursma commented 9 years ago

Thanks for the quick reply. I expected that behaviour when longnamesfirst=TRUE I think it's not a desirable default, unless of course longnamesfirst is set by the user.

I can get it to work like you suggest but I actually get 3 names not 2

options(citation_format = "text", max.names=2)
citep("10.3832/ifor0901-006")
citep("10.3832/ifor0901-006")

gives

"(Henry, Bombelli, Trotta, et al., 2013)"