andybega / condensebib

Rmarkdown + central bib file => local condensed bib file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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")

About

Rmarkdown + central bib file => local condensed bib file

License:Other


Languages

Language:R 100.0%