Bug 15257 - citation() ignores header and footer specified via citHeader() and citFooter() in a package's inst/CITATION
citation() ignores header and footer specified via citHeader() and citFooter(...
Status: RESOLVED FIXED
Product: R
Classification: Unclassified
Component: Misc
R 3.0.0
x86_64/x64/amd64 (64-bit) Linux-Debian
: P5 normal
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-05 05:13 UTC by Pavel N. Krivitsky
Modified: 2013-04-06 14:33 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel N. Krivitsky 2013-04-05 05:13:00 UTC
Steps to Reproduce:

1) Start R version 3.0.0.

2) citation("base")


Expected Result:

According to the CITATION file in package base, it should be something very close to the following:

==== BEGIN ====

To cite R in publications use:

  R Core Team (2013). R: A language and environment for statistical
  computing. R Foundation for Statistical Computing, Vienna, Austria.
  URL http://www.R-project.org/.

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2013},
    url = {http://www.R-project.org/},
  }

We have invested a lot of time and effort in creating R, please cite it
when using it for data analysis. See also ‘citation("pkgname")’ for
citing R packages.

==== END ====

Actual Result:

==== BEGIN ====

  R Core Team (2013). R: A language and environment for statistical
  computing. R Foundation for Statistical Computing, Vienna, Austria.
  URL http://www.R-project.org/.

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2013},
    url = {http://www.R-project.org/},
  }

==== END ====


Build Date & Platform:

R version 3.0.0 (2013-04-03) -- "Masked Marvel"
Platform: x86_64-pc-linux-gnu (64-bit)


Additional Builds and Platforms:

The bug does occur on the R trunk revision 62494 on a similar platform. The bug does not occur on R release 2.15.1.


Additional Information:

The cause of the problem appears to be in utils::format.bibentry(), which calls (via S3 dispatching) utils::sort.bibentry(), which uses utils::`[.bibentry()` to reorder the entries in the list. utils::`[.bibentry` strips almost all attributes from the list of entries, including "mheader" and "mfooter", resulting in their not being printed.
Comment 1 Duncan Murdoch 2013-04-06 14:33:37 UTC
Thanks for the report and diagnosis -- will fix in R-devel and R-patched.