ropensci / bibtex

bibtex parser for R
https://docs.ropensci.org/bibtex/
35 stars 12 forks source link

Also look in inst/ for REFERENCES.bib #19

Closed ms609 closed 3 years ago

ms609 commented 6 years ago

This is where packages using Rdpack will store their REFERENCES file.

coatless commented 3 years ago

@ms609 not sure that inst/REFERNECES.bib needs to be checked if REFERENCES.bib is already checked. Check is aiming to read from an installed package. By default, the inst directory goes away once the package is installed. Thus, inst/REFERENCES.bib is promoted to top-level REFERENCES.bib.

Just an FYI, rOpenSci is working to restore the package on CRAN. Not sure when this will be incorporated.

ms609 commented 3 years ago

One case where I would find this behaviour useful is when using 'bibtex' to process bibtex entries when a package is not installed. For example, in the project https://github.com/ms609/hyoliths, I needed to cross-reference entries in a data file against entries in inst/REFERENCES.bib: if my script found a bibtex entry corresponding to a citation in the data file, it'd replace the text "(Smith 2020)" with the key "@Smith2020". This modified text would then be incorporated in an .Rmd vignette linked to inst/REFERENCES.bib.

coatless commented 3 years ago

@ms609 I simplified the logic and allowed for a slight extension to the findBibFile() in 7ccf8eae7e2c6c3e1138662da12d30660fdd7bab. The next version should be able to detect inst/REFERENCES.bib. But, I'm not sure what the benefit will be as we're specifically checking against installed packages with system.file(). If this doesn't work, let's talk about what you need in an issue ticket.