Occasionally, while exchanging files with collaborators or submitting articles, I’d like to extract a smaller .bib file from my main, “hold-all” bibliography file, i.e. containing only the entries that I’d actually cited in my document.
Fortunately this can be done fairly automatically using the bibexport tool. Quick rundown:
- Compile your document, say myarticle.tex the usual way, with your “big” allrefs.bib file.
- Run bibexport with the following:
bibexport -o extracted.bib myarticle
extracted.bib should now contain only the bibliography entries that were cited in myarticle.tex.
- Change \bibliography{allrefs.bib} to \bibliography{extracted.bib} in myarticle.tex.
- Send myarticle.tex and extracted.bib to collaborator or editor!