<span class="mw-page-title-main">Bigbib2itsybitsy</span>
Fabrice P. Lauss𝕪's Web

bigbib2itsybitsy

bigbib2itsybitsy shrinks my BibTeX database down to only the entries a paper actually cites.

Written with Claude Sonnet 5 on 5 August (2026). Version 1.0.

What it does

Scans a .tex file for every \cite-family command (\cite, \citep, \citet, \textcite, \autocite, ...), looks each key up across ~/bib/sci.bib, ~/bib/arXiv.bib and ~/bib/Books.bib, and writes out only the matched entries verbatim — original formatting kept. Any @string shortcut a kept entry needs (e.g. journal = prl) is carried along too, so the output file stands on its own.

Usage

bigbib2itsybitsy paper.tex        # -> paper.bib
bigbib2itsybitsy paper.tex -o -   # to stdout

Notes

  • Missing or duplicate keys are reported to stderr; the output file's own header records how many were found and what fraction of the source library that is.
  • First bib file wins on a duplicate key.

Code

File:Bigbib2itsybitsy.gz — the script itself, gzipped.