On Mon, 27 Mar 2017, Kasper Daniel Hansen wrote:
Thanks. It would be great to have this working in 3.4. In Bioc there are
multiple packages with CITATION files with multiple entries, one such
example is minfi
bioconductor.org/packages/minfi
On my wishlist is that it would be great to have support for printing the
header field which many people use to give a context for the citation. This
is important because when you list multiple papers you need (I think) some
explanation for when to cite the different ones.
But this is what citation("pkg_name") or print(bibentry_object, style =
"citation") already do or am I missing something.
I haven't installed "minfi" but just sourced the CITATION into an object x
and the print(x, style = "citation") seemed to work as intended.
But this is probably a good example where even adding four BibTeX items
leads to scrolling even on console windows with many lines and columns. In
these cases it would likely be better not to display any BibTeX and rather
add a hint as to how the BibTeX can be obtained if desired. In addition to
Martin's idea with 'citation(package="pkg", bibtex.max=Inf)' one could also
use 'toBibtex(citation("pkg"))'. The latter, of course, only gives the
BibTeX but again for long lists like the one in minfi it is probably more
digestable in separate chunks...
Best,
Z
Best,
Kasper
On Mon, Mar 27, 2017 at 7:25 AM, Martin Maechler <
maechler at stat.math.ethz.ch
Fox, John <jfox at mcmaster.ca>
on Mon, 16 Jan 2017 15:44:05 +0000 writes:
> Dear Martin,
> Thanks for addressing this question, if belatedly!
> After a little bit of thought, perhaps a default somewhere between 1
and Inf makes sense, along with an additional argument to citation:
citation(package="pkg", bibtex.max=n), with default bibtex.max=
getOption("citation.bibtex.max"), where the citation.bibtex.max option
is
initially set to something like 4. If the number of available citations
exceeds bibtex.max, then a message like "there are additional BiBTeX
citations, enter 'citation(package="pkg", bibtex.max=Inf)' to see all of
them."
In the mean time, I have always used my proposed change.
I think any number between 1 and Inf is so much arbitrary that
inspite of your good thoughts I kept the *new* default at Inf.
and because of this open question, I have forgotten to commit
the change to the development version of R !
I have done so now, however not ported it yet to "R 3.4.0 alpha".
If not much surfaces (in CRAN / Bioc checks), we may port it in
time for 3.4.0.
Martin
>> -----Original Message-----
>> From: Martin Maechler [mailto:maechler at stat.math.ethz.ch]
>> Sent: Monday, January 16, 2017 10:02 AM
>> To: Fox, John <jfox at mcmaster.ca>
>> Cc: r-package-devel at r-project.org
>> Subject: Re: [R-pkg-devel] multiple bibentry()s in CITATION
>>
>>>>>>> Fox, John <jfox at mcmaster.ca>
>>>>>>> on Fri, 2 Sep 2016 15:42:46 +0000 writes:
>>
>> (which is more than 4 months ago)
>>
>>> Dear list members,
>>> I've noticed that citation(package="pkg") generates both a text
>> citation and a BiBTeX entry when the CITATION file contains a
>> call to bibentry() or citEntry(), but that only text citations are
>> if there are multiple calls to bibentry() or citEntry().
>>
>>> Is this behaviour intentional? In my opinion, it's useful always
>> to show the BiBTeX (although it's available through
>> toBibtex(citation(package="pkg")) ).
>>
>>> The Writing R Extensions manual says, "A CITATION file will
>> contain *calls* [my emphasis] to function bibentry."
>>
>>
>> and you did not get a reply....
>> I had wanted but forgotten about it ... two parts :
>>
>> 1) On November 24, 2012, I had improved R with an option to get
>> so this has been a "hidden gem" ;-) for a while in R:
>>
>>> options(citation.bibtex.max = Inf)
>>> citation(package = "Rcmdr")
>>
>> To cite the 'Rcmdr' package in publications use:
>>
>> Fox, J., and Bouchet-Valat, M. (2017). Rcmdr: R Commander. R
>> version 2.3-2.
>>
>> A BibTeX entry for LaTeX users is
>>
>> @Manual{,
>> title = {{Rcmdr: R Commander}},
>> author = {John Fox and Milan Bouchet-Valat},
>> year = {2017},
>> note = {R package version 2.3-2},
>> url = {http://socserv.socsci.mcmaster.ca/jfox/Misc/Rcmdr/},
>> }
>>
>> Fox, J. (2017). Using the R Commander: A Point-and-Click Interface
>> R. Boca Raton FL:
>> Chapman and Hall/CRC Press.
>>
>> A BibTeX entry for LaTeX users is
>>
>> @Book{,
>> title = {Using the {R Commander}: A Point-and-Click Interface for
>> {R}},
>> author = {John Fox},
>> year = {2017},
>> publisher = {Chapman and Hall/CRC Press},
>> address = {Boca Raton {FL}},
>> url = {http://socserv.mcmaster.ca/jfox/Books/RCommander/},
>> }
>>
>> Fox, J. (2005). The R Commander: A Basic Statistics Graphical User
>> Interface to R.
>> Journal of Statistical Software, 14(9): 1--42.
>>
>> A BibTeX entry for LaTeX users is
>>
>> @Article{,
>> title = {The {R} {C}ommander: A Basic Statistics Graphical User
>> Interface to {R}},
>> author = {John Fox},
>> year = {2005},
>> journal = {Journal of Statistical Software},
>> volume = {14},
>> number = {9},
>> pages = {1--42},
>> url = {http://www.jstatsoft.org/v14/i09},
>> }
>>
>> ----------------
>>
>> This all works "obviously" (;-) via utils:::format.bibentry () and
>> when I had made the number one an argument to that function with a
>> default you can set via options(), I had wondered a bit why the
>> should by default be at one.
>>
>> E.g., it looks strange that by *adding* a 2nd reference, you get
>> citation output.... and to me it would seem more coherent to have
>> default rather be 'Inf' instead of '1', i.e. always showing both
>> and bibtex.
>>
>> There is quite a difference though: For our copula package, e.g.,
>>
>>> options(citation.bibtex.max = 1); citation(package = "copula")
>>
>> To cite the R package copula in publications use:
>>
>> Marius Hofert, Ivan Kojadinovic, Martin Maechler and Jun Yan
>> copula:
>> Multivariate Dependence with Copulas. R package version 0.999-16
>> with Continuous
>> Margins Using the copula R Package. Journal of Statistical
>>
>> This is relatively compact (18 lines)
>> whereas it gives 67 lines of output when the option is set to
>>
>> Other opinions?
>> What do you think, would it be worth the compatibility break to
>> the default from '1' to 'Inf' ?
>>
>> Best regards,
>> Martin