softbib: Software Bibliographies for R Projects

This package detects all the R libraries used in a project and automatically creates software bibliographies in PDF, Word, Rmarkdown, and BibTeX formats. Bibliographies can be printed in thousands of styles, using CSL files downloaded from the Zotero style repository.

Arel-Bundock, Vincent, and Joshua McCrain. 2023. “Software Citations in Political Science.” PS: Political Science & Politics, April, 1–4.



Or you can install the development version of softbib:


Make sure you restart R for the change to take effect.

Getting started

Navigate to a project folder, crawl the working directory to get a list of R packages, and create bibliographies:




Exclude some packages from the bibliography:

softbib(exclude = c("base", "dplyr"))

Specify the list of packages to include manually:

softbib(include = c("countrycode", "modelsummary", "marginaleffects"))

Download a Citation Style Language file from the Zotero archive and print a bibliography in the style of the American Political Science Review:

  destfile = "apsr.csl")

softbib(style = "apsr.csl")

Ignoring files and folders

softbib uses the renv::dependencies() function to detect R packages used in a project folder. Like the renv package, softbib can respect user instructions to ignore certain files and folders. To specify those ignore instructions, you must place a file called .renvignore in the working directory. This file can include lines such as:


LaTeX document with two bibliographies

It is relatively easy to insert a separate software bibliography in a LaTeX document by using the multibib package in a document preamble.

First, save this R script and execute it:

softbib::softbib(output = "software.bib")

Then, save this LaTeX document in the same folder:


\newcites{softbib}{Software Bibliography}

% for this example we insert a bibtex entry in the main latex file instead of an external .bib file
  title={The unintended consequences of bilateralism: Treaty shopping and international tax policy},
  author={Arel-Bundock, Vincent},
  journal={International Organization},
  publisher={Cambridge University Press}


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus non ipsum nibh. Morbi in nibh feugiat, congue purus sed, accumsan nunc. Ut porttitor egestas purus ut eleifend. Praesent gravida mauris quis nibh faucibus facilisis. In quis sapien quis nisl accumsan malesuada in eget lectus. Sed tempor dapibus ligula malesuada volutpat \cite{arel2017unintended}. 

% bibliography

% software bibliography


Finally, run these commands:

pdflatex article
bibtex article
bibtex softbib
pdflatex article
pdflatex article

The result should look like this: