README.md

Condense .bib

R build status Codecov test coverage

Condense a global .bib file used for citations in a Rmarkdown article to a local .bib with only references that are used in the article.

library(condensebib)

reduce_bib(
  file       = "my_paper.Rmd",
  master_bib = "../../central_bib_file.bib",
  out_bib    = "references.bib"
)

This will look for cite keys like "@author:2008" or google-style "@authoryearword" in the input .Rmd file, extract those cite keys from the master bib, and write them to a local bib. It should work with Latex/natbib-style citation commands as well.

Installation

Requires RefManageR and stringr.

remotes::install_github("andybega/condensebib")


andybega/condensebib documentation built on Oct. 29, 2021, 7:51 a.m.